@cravern/bpmn-flow-designer 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +16629 -6349
- package/dist/index.umd.js +61 -53
- package/package.json +2 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(fe,J){typeof exports=="object"&&typeof module<"u"?J(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],J):(fe=typeof globalThis<"u"?globalThis:fe||self,J(fe.BpmnFlowDesigner={},fe.React))})(this,(function(fe,J){"use strict";var Ft=document.createElement("style");Ft.textContent=`@import"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap";*,: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: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::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: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{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,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}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-feature-settings:normal;font-variation-settings:normal;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;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([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]:where(:not([hidden=until-found])){display:none}body{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-family:Inter,Inter Var,system-ui,sans-serif}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.bpmn-io-style .djs-palette{display:none!important}.bpmn-io-style .djs-container{background-color:transparent!important}.bjs-powered-by{display:none!important}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.-right-4{right:-1rem}.top-0{top:0}.top-1\\/2{top:50%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.mr-1{margin-right:.25rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-auto{margin-top:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-14{height:3.5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-5{height:1.25rem}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-screen{height:100vh}.min-h-screen{min-height:100vh}.w-0{width:0px}.w-3{width:.75rem}.w-5{width:1.25rem}.w-80{width:20rem}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-7xl{max-width:80rem}.flex-1{flex:1 1 0%}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-8{gap:2rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-indigo-600{--tw-border-opacity: 1;border-color:rgb(79 70 229 / var(--tw-border-opacity, 1))}.border-slate-100{--tw-border-opacity: 1;border-color:rgb(241 245 249 / var(--tw-border-opacity, 1))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-slate-300{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-indigo-100{--tw-bg-opacity: 1;background-color:rgb(224 231 255 / var(--tw-bg-opacity, 1))}.bg-indigo-600{--tw-bg-opacity: 1;background-color:rgb(79 70 229 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-slate-50\\/50{background-color:#f8fafc80}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\\/80{background-color:#fffc}.bg-\\[radial-gradient\\(\\#e5e7eb_1px\\,transparent_1px\\)\\]{background-image:radial-gradient(#e5e7eb 1px,transparent 1px)}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pl-4{padding-left:1rem}.pt-6{padding-top:1.5rem}.text-center{text-align:center}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\\[10px\\]{font-size:10px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tracking-tight{letter-spacing:-.025em}.tracking-tighter{letter-spacing:-.05em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-indigo-400{--tw-text-opacity: 1;color:rgb(129 140 248 / var(--tw-text-opacity, 1))}.text-indigo-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.text-indigo-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.opacity-0{opacity:0}.opacity-40{opacity:.4}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.\\[background-size\\:24px_24px\\]{background-size:24px 24px}.hover\\:border-indigo-400:hover{--tw-border-opacity: 1;border-color:rgb(129 140 248 / var(--tw-border-opacity, 1))}.hover\\:bg-indigo-200:hover{--tw-bg-opacity: 1;background-color:rgb(199 210 254 / var(--tw-bg-opacity, 1))}.hover\\:bg-indigo-50\\/50:hover{background-color:#eef2ff80}.hover\\:bg-indigo-700:hover{--tw-bg-opacity: 1;background-color:rgb(67 56 202 / var(--tw-bg-opacity, 1))}.hover\\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\\:text-indigo-600:hover{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.hover\\:text-slate-700:hover{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.hover\\:shadow-sm:hover{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-indigo-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity, 1))}.active\\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\\:bg-slate-300:disabled{--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}.group:hover .group-hover\\:opacity-100{opacity:1}@media(min-width:1024px){.lg\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}
|
|
2
|
-
/*$vite$:1*/`,document.head.appendChild(
|
|
1
|
+
(function(Pt,Te){typeof exports=="object"&&typeof module<"u"?Te(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],Te):(Pt=typeof globalThis<"u"?globalThis:Pt||self,Te(Pt.BpmnFlowDesigner={},Pt.React))})(this,(function(Pt,Te){"use strict";var Gr=document.createElement("style");Gr.textContent=`@import"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap";*,: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: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::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: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{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,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}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-feature-settings:normal;font-variation-settings:normal;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;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([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]:where(:not([hidden=until-found])){display:none}body{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-family:Inter,Inter Var,system-ui,sans-serif}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.bpmn-io-style .djs-palette{display:none!important}.bpmn-io-style .djs-container{background-color:transparent!important}.bjs-powered-by{display:none!important}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.-right-4{right:-1rem}.top-0{top:0}.top-1\\/2{top:50%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.mr-1{margin-right:.25rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-auto{margin-top:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-14{height:3.5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-5{height:1.25rem}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-screen{height:100vh}.min-h-screen{min-height:100vh}.w-0{width:0px}.w-3{width:.75rem}.w-5{width:1.25rem}.w-80{width:20rem}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-7xl{max-width:80rem}.flex-1{flex:1 1 0%}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-8{gap:2rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-indigo-600{--tw-border-opacity: 1;border-color:rgb(79 70 229 / var(--tw-border-opacity, 1))}.border-slate-100{--tw-border-opacity: 1;border-color:rgb(241 245 249 / var(--tw-border-opacity, 1))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-slate-300{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-indigo-100{--tw-bg-opacity: 1;background-color:rgb(224 231 255 / var(--tw-bg-opacity, 1))}.bg-indigo-600{--tw-bg-opacity: 1;background-color:rgb(79 70 229 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-slate-50\\/50{background-color:#f8fafc80}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\\/80{background-color:#fffc}.bg-\\[radial-gradient\\(\\#e5e7eb_1px\\,transparent_1px\\)\\]{background-image:radial-gradient(#e5e7eb 1px,transparent 1px)}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pl-4{padding-left:1rem}.pt-6{padding-top:1.5rem}.text-center{text-align:center}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\\[10px\\]{font-size:10px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tracking-tight{letter-spacing:-.025em}.tracking-tighter{letter-spacing:-.05em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-indigo-400{--tw-text-opacity: 1;color:rgb(129 140 248 / var(--tw-text-opacity, 1))}.text-indigo-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.text-indigo-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.opacity-0{opacity:0}.opacity-40{opacity:.4}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.\\[background-size\\:24px_24px\\]{background-size:24px 24px}.hover\\:border-indigo-400:hover{--tw-border-opacity: 1;border-color:rgb(129 140 248 / var(--tw-border-opacity, 1))}.hover\\:bg-indigo-200:hover{--tw-bg-opacity: 1;background-color:rgb(199 210 254 / var(--tw-bg-opacity, 1))}.hover\\:bg-indigo-50\\/50:hover{background-color:#eef2ff80}.hover\\:bg-indigo-700:hover{--tw-bg-opacity: 1;background-color:rgb(67 56 202 / var(--tw-bg-opacity, 1))}.hover\\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\\:text-indigo-600:hover{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.hover\\:text-slate-700:hover{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.hover\\:shadow-sm:hover{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-indigo-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity, 1))}.active\\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\\:bg-slate-300:disabled{--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}.group:hover .group-hover\\:opacity-100{opacity:1}@media(min-width:1024px){.lg\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}
|
|
2
|
+
/*$vite$:1*/`,document.head.appendChild(Gr);function Ml(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var $n={exports:{}},vn={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
5
5
|
*
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var
|
|
10
|
+
*/var qr;function Il(){if(qr)return vn;qr=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(i,r,o){var l=null;if(o!==void 0&&(l=""+o),r.key!==void 0&&(l=""+r.key),"key"in r){o={};for(var u in r)u!=="key"&&(o[u]=r[u])}else o=r;return r=o.ref,{$$typeof:n,type:i,key:l,ref:r!==void 0?r:null,props:o}}return vn.Fragment=e,vn.jsx=t,vn.jsxs=t,vn}var _n={};/**
|
|
11
11
|
* @license React
|
|
12
12
|
* react-jsx-runtime.development.js
|
|
13
13
|
*
|
|
@@ -15,219 +15,227 @@
|
|
|
15
15
|
*
|
|
16
16
|
* This source code is licensed under the MIT license found in the
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var
|
|
18
|
+
*/var Hr;function Pl(){return Hr||(Hr=1,process.env.NODE_ENV!=="production"&&(function(){function n(m){if(m==null)return null;if(typeof m=="function")return m.$$typeof===O?null:m.displayName||m.name||null;if(typeof m=="string")return m;switch(m){case D:return"Fragment";case T:return"Profiler";case F:return"StrictMode";case I:return"Suspense";case R:return"SuspenseList";case P:return"Activity"}if(typeof m=="object")switch(typeof m.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),m.$$typeof){case b:return"Portal";case A:return m.displayName||"Context";case k:return(m._context.displayName||"Context")+".Consumer";case S:var _=m.render;return m=m.displayName,m||(m=_.displayName||_.name||"",m=m!==""?"ForwardRef("+m+")":"ForwardRef"),m;case M:return _=m.displayName||null,_!==null?_:n(m.type)||"Memo";case C:_=m._payload,m=m._init;try{return n(m(_))}catch{}}return null}function e(m){return""+m}function t(m){try{e(m);var _=!1}catch{_=!0}if(_){_=console;var v=_.error,E=typeof Symbol=="function"&&Symbol.toStringTag&&m[Symbol.toStringTag]||m.constructor.name||"Object";return v.call(_,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",E),e(m)}}function i(m){if(m===D)return"<>";if(typeof m=="object"&&m!==null&&m.$$typeof===C)return"<...>";try{var _=n(m);return _?"<"+_+">":"<...>"}catch{return"<...>"}}function r(){var m=U.A;return m===null?null:m.getOwner()}function o(){return Error("react-stack-top-frame")}function l(m){if($.call(m,"key")){var _=Object.getOwnPropertyDescriptor(m,"key").get;if(_&&_.isReactWarning)return!1}return m.key!==void 0}function u(m,_){function v(){ce||(ce=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",_))}v.isReactWarning=!0,Object.defineProperty(m,"key",{get:v,configurable:!0})}function c(){var m=n(this.type);return ne[m]||(ne[m]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),m=this.props.ref,m!==void 0?m:null}function f(m,_,v,E,N,Z){var ee=v.ref;return m={$$typeof:w,type:m,key:_,props:v,_owner:E},(ee!==void 0?ee:null)!==null?Object.defineProperty(m,"ref",{enumerable:!1,get:c}):Object.defineProperty(m,"ref",{enumerable:!1,value:null}),m._store={},Object.defineProperty(m._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(m,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(m,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:N}),Object.defineProperty(m,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.freeze&&(Object.freeze(m.props),Object.freeze(m)),m}function d(m,_,v,E,N,Z){var ee=_.children;if(ee!==void 0)if(E)if(te(ee)){for(E=0;E<ee.length;E++)h(ee[E]);Object.freeze&&Object.freeze(ee)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(ee);if($.call(_,"key")){ee=n(m);var oe=Object.keys(_).filter(function(ye){return ye!=="key"});E=0<oe.length?"{key: someKey, "+oe.join(": ..., ")+": ...}":"{key: someKey}",p[ee+E]||(oe=0<oe.length?"{"+oe.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
19
19
|
let props = %s;
|
|
20
20
|
<%s {...props} />
|
|
21
21
|
React keys must be passed directly to JSX without using spread:
|
|
22
22
|
let props = %s;
|
|
23
|
-
<%s key={someKey} {...props} />`,W,Y,Pe,Y),Xo[Y+W]=!0)}if(Y=null,H!==void 0&&(t(H),Y=""+H),l(F)&&(t(F.key),Y=""+F.key),"key"in F){H={};for(var Vt in F)Vt!=="key"&&(H[Vt]=F[Vt])}else H=F;return Y&&u(H,typeof y=="function"?y.displayName||y.name||"Unknown":y),c(y,Y,H,i(),lt,Lt)}function p(y){m(y)?y._store&&(y._store.validated=1):typeof y=="object"&&y!==null&&y.$$typeof===b&&(y._payload.status==="fulfilled"?m(y._payload.value)&&y._payload.value._store&&(y._payload.value._store.validated=1):y._store&&(y._store.validated=1))}function m(y){return typeof y=="object"&&y!==null&&y.$$typeof===g}var h=J,g=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),V=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),Q=Symbol.for("react.client.reference"),Ne=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$e=Object.prototype.hasOwnProperty,ne=Array.isArray,ye=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(y){return y()}};var Wo,Yo={},Zo=h.react_stack_bottom_frame.bind(h,a)(),Ko=ye(n(a)),Xo={};be.Fragment=x,be.jsx=function(y,F,H){var W=1e4>Ne.recentlyCreatedOwnerStacks++;return f(y,F,H,!1,W?Error("react-stack-top-frame"):Zo,W?ye(n(y)):Ko)},be.jsxs=function(y,F,H){var W=1e4>Ne.recentlyCreatedOwnerStacks++;return f(y,F,H,!0,W?Error("react-stack-top-frame"):Zo,W?ye(n(y)):Ko)}})()),be}var Bt;function ei(){return Bt||(Bt=1,process.env.NODE_ENV==="production"?Oe.exports=Qo():Oe.exports=jo()),Oe.exports}var C=ei();/**
|
|
23
|
+
<%s key={someKey} {...props} />`,E,ee,oe,ee),p[ee+E]=!0)}if(ee=null,v!==void 0&&(t(v),ee=""+v),l(_)&&(t(_.key),ee=""+_.key),"key"in _){v={};for(var Ae in _)Ae!=="key"&&(v[Ae]=_[Ae])}else v=_;return ee&&u(v,typeof m=="function"?m.displayName||m.name||"Unknown":m),f(m,ee,v,r(),N,Z)}function h(m){g(m)?m._store&&(m._store.validated=1):typeof m=="object"&&m!==null&&m.$$typeof===C&&(m._payload.status==="fulfilled"?g(m._payload.value)&&m._payload.value._store&&(m._payload.value._store.validated=1):m._store&&(m._store.validated=1))}function g(m){return typeof m=="object"&&m!==null&&m.$$typeof===w}var x=Te,w=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),F=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),A=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),O=Symbol.for("react.client.reference"),U=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=Object.prototype.hasOwnProperty,te=Array.isArray,Fe=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(m){return m()}};var ce,ne={},qe=x.react_stack_bottom_frame.bind(x,o)(),y=Fe(i(o)),p={};_n.Fragment=D,_n.jsx=function(m,_,v){var E=1e4>U.recentlyCreatedOwnerStacks++;return d(m,_,v,!1,E?Error("react-stack-top-frame"):qe,E?Fe(i(m)):y)},_n.jsxs=function(m,_,v){var E=1e4>U.recentlyCreatedOwnerStacks++;return d(m,_,v,!0,E?Error("react-stack-top-frame"):qe,E?Fe(i(m)):y)}})()),_n}var Wr;function kl(){return Wr||(Wr=1,process.env.NODE_ENV==="production"?$n.exports=Il():$n.exports=Pl()),$n.exports}var V=kl();function et(n,e){e&&(n.super_=e,n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}))}const xn=Object.prototype.toString,Nl=Object.prototype.hasOwnProperty;function Di(n){return n===void 0}function Wt(n){return n!==void 0}function zr(n){return n==null}function Ke(n){return xn.call(n)==="[object Array]"}function kt(n){return xn.call(n)==="[object Object]"}function gt(n){return xn.call(n)==="[object Number]"}function yt(n){const e=xn.call(n);return e==="[object Function]"||e==="[object AsyncFunction]"||e==="[object GeneratorFunction]"||e==="[object AsyncGeneratorFunction]"||e==="[object Proxy]"}function tt(n){return xn.call(n)==="[object String]"}function Gn(n,e){return!zr(n)&&Nl.call(n,e)}function Je(n,e){const t=Li(e);let i;return q(n,function(r,o){if(t(r,o))return i=r,!1}),i}function Dl(n,e){const t=Li(e);let i=Ke(n)?-1:void 0;return q(n,function(r,o){if(t(r,o))return i=o,!1}),i}function zt(n,e){const t=Li(e);let i=[];return q(n,function(r,o){t(r,o)&&i.push(r)}),i}function q(n,e){let t,i;if(Di(n))return;const r=Ke(n)?Vl:Fl;for(let o in n)if(Gn(n,o)&&(t=n[o],i=e(t,r(o)),i===!1))return t}function Yt(n,e,t){return q(n,function(i,r){t=e(t,i,r)}),t}function Yr(n,e){return!!Yt(n,function(t,i,r){return t&&e(i,r)},!0)}function Kr(n,e){return!!Je(n,e)}function Ll(n,e){let t=[];return q(n,function(i,r){t.push(e(i,r))}),t}function Jr(n){return function(e){return Yr(n,function(t,i){return e[i]===t})}}function Li(n){return yt(n)?n:e=>e===n}function Fl(n){return n}function Vl(n){return Number(n)}function Bl(n,e){let t,i,r,o;function l(h){let g=Date.now(),x=h?0:o+e-g;if(x>0)return u(x);n.apply(r,i),c()}function u(h){t=setTimeout(l,h)}function c(){t&&clearTimeout(t),t=o=i=r=void 0}function f(){t&&l(!0),c()}function d(...h){o=Date.now(),i=h,r=this,t||u(e)}return d.flush=f,d.cancel=c,d}function vt(n,e){return n.bind(e)}function Y(n,...e){return Object.assign(n,...e)}function Ol(n,e,t){let i=n;return q(e,function(r,o){if(typeof r!="number"&&typeof r!="string")throw new Error("illegal key type: "+typeof r+". Key should be of type number or string.");if(r==="constructor")throw new Error("illegal key: constructor");if(r==="__proto__")throw new Error("illegal key: __proto__");let l=e[o+1],u=i[r];Wt(l)&&zr(u)&&(u=i[r]=isNaN(+l)?{}:[]),Di(l)?Di(t)?delete i[r]:i[r]=t:i=u}),n}function Ul(n,e){let t={},i=Object(n);return q(e,function(r){r in i&&(t[r]=n[r])}),t}function $l(n,e){let t={},i=Object(n);return q(i,function(r,o){e.indexOf(o)===-1&&(t[o]=r)}),t}var Gl=1e3;function ut(n,e){var t=this;e=e||Gl,n.on(["render.shape","render.connection"],e,function(i,r){var o=i.type,l=r.element,u=r.gfx,c=r.attrs;if(t.canRender(l))return o==="render.shape"?t.drawShape(u,l,c):t.drawConnection(u,l,c)}),n.on(["render.getShapePath","render.getConnectionPath"],e,function(i,r){if(t.canRender(r))return i.type==="render.getShapePath"?t.getShapePath(r):t.getConnectionPath(r)})}ut.prototype.canRender=function(n){},ut.prototype.drawShape=function(n,e){},ut.prototype.drawConnection=function(n,e){},ut.prototype.getShapePath=function(n){},ut.prototype.getConnectionPath=function(n){};function K(n,e){var t=ve(n);return t&&typeof t.$instanceOf=="function"&&t.$instanceOf(e)}function ql(n,e){return Kr(e,function(t){return K(n,t)})}function ve(n){return n&&n.businessObject||n}function Kt(n){return n&&n.di}function Fi(n,e){return K(n,"bpmn:CallActivity")?!1:K(n,"bpmn:SubProcess")?(e=e||Kt(n),e&&K(e,"bpmndi:BPMNPlane")?!0:e&&!!e.isExpanded):K(n,"bpmn:Participant")?!!ve(n).processRef:!0}function Hl(n){return n&&!!ve(n).triggeredByEvent}function Wl(n){return kt(n)&&Gn(n,"waypoints")}var qn={width:90,height:20},Zr=15;function zl(n){return K(n,"bpmn:Event")||K(n,"bpmn:Gateway")||K(n,"bpmn:DataStoreReference")||K(n,"bpmn:DataObjectReference")||K(n,"bpmn:DataInput")||K(n,"bpmn:DataOutput")||K(n,"bpmn:SequenceFlow")||K(n,"bpmn:MessageFlow")||K(n,"bpmn:Group")}function Yl(n){var e=n.length/2-1,t=n[Math.floor(e)],i=n[Math.ceil(e+.01)],r=Kl(n),o=Math.atan((i.y-t.y)/(i.x-t.x)),l=r.x,u=r.y;return Math.abs(o)<Math.PI/2?u-=Zr:l+=Zr,{x:l,y:u}}function Kl(n){var e=n.length/2-1,t=n[Math.floor(e)],i=n[Math.ceil(e+.01)];return{x:t.x+(i.x-t.x)/2,y:t.y+(i.y-t.y)/2}}function Jl(n){return n.waypoints?Yl(n.waypoints):K(n,"bpmn:Group")?{x:n.x+n.width/2,y:n.y+qn.height/2}:{x:n.x+n.width/2,y:n.y+n.height+qn.height/2}}function Zl(n,e){var t,i,r,o=n.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(qn.width,r.width),height:r.height},t={x:r.x+r.width/2,y:r.y+r.height/2}):(t=Jl(e),i=qn),Y({x:t.x-i.width/2,y:t.y-i.height/2},i)}function Xl(n){if(K(n,"bpmn:FlowElement")||K(n,"bpmn:Participant")||K(n,"bpmn:Lane")||K(n,"bpmn:SequenceFlow")||K(n,"bpmn:MessageFlow")||K(n,"bpmn:DataInput")||K(n,"bpmn:DataOutput"))return"name";if(K(n,"bpmn:TextAnnotation"))return"text";if(K(n,"bpmn:Group"))return"categoryValueRef"}function Ql(n){var e=n.categoryValueRef;return e&&e.value||""}function Hn(n){var e=n.businessObject,t=Xl(e);if(t)return t==="categoryValueRef"?Ql(e):e[t]||""}function jl(n,e){if(n.ownerDocument!==e.ownerDocument)try{return e.ownerDocument.importNode(n,!0)}catch{}return n}function eu(n,e){return e.appendChild(jl(n,e))}function _e(n,e){return eu(e,n),n}var Vi=2,Xr={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":Vi,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":Vi,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function tu(n,e){return Xr[e]?n.style[e]:n.getAttributeNS(null,e)}function Qr(n,e,t){var i=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=Xr[i];r?(r===Vi&&typeof t=="number"&&(t=String(t)+"px"),n.style[i]=t):n.setAttributeNS(null,e,t)}function nu(n,e){var t=Object.keys(e),i,r;for(i=0,r;r=t[i];i++)Qr(n,r,e[r])}function le(n,e,t){if(typeof e=="string")if(t!==void 0)Qr(n,e,t);else return tu(n,e);else nu(n,e);return n}const iu=Object.prototype.toString;function Oe(n){return new _t(n)}function _t(n){if(!n||!n.nodeType)throw new Error("A DOM element reference is required");this.el=n,this.list=n.classList}_t.prototype.add=function(n){return this.list.add(n),this},_t.prototype.remove=function(n){return iu.call(n)=="[object RegExp]"?this.removeMatching(n):(this.list.remove(n),this)},_t.prototype.removeMatching=function(n){const e=this.array();for(let t=0;t<e.length;t++)n.test(e[t])&&this.remove(e[t]);return this},_t.prototype.toggle=function(n,e){return typeof e<"u"?e!==this.list.toggle(n,e)&&this.list.toggle(n):this.list.toggle(n),this},_t.prototype.array=function(){return Array.from(this.list)},_t.prototype.has=_t.prototype.contains=function(n){return this.list.contains(n)};function ru(n){for(var e;e=n.firstChild;)n.removeChild(e);return n}var Bi={svg:"http://www.w3.org/2000/svg"},jr='<svg xmlns="'+Bi.svg+'"';function ou(n){var e=!1;n.substring(0,4)==="<svg"?n.indexOf(Bi.svg)===-1&&(n=jr+n.substring(4)):(n=jr+">"+n+"</svg>",e=!0);var t=su(n);if(!e)return t;for(var i=document.createDocumentFragment(),r=t.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function su(n){var e;return e=new DOMParser,e.async=!1,e.parseFromString(n,"text/xml")}function de(n,e){var t;return n=n.trim(),n.charAt(0)==="<"?(t=ou(n).firstChild,t=document.importNode(t,!0)):t=document.createElementNS(Bi.svg,n),e&&le(t,e),t}var Oi=null;function eo(){return Oi===null&&(Oi=de("svg")),Oi}function to(n,e){var t,i,r=Object.keys(e);for(t=0;i=r[t];t++)n[i]=e[i];return n}function au(n,e,t,i,r,o){var l=eo().createSVGMatrix();switch(arguments.length){case 0:return l;case 1:return to(l,n);case 6:return to(l,{a:n,b:e,c:t,d:i,e:r,f:o})}}function Cn(n){return eo().createSVGTransform()}var no=/([&<>]{1})/g,lu=/([&<>\n\r"]{1})/g,uu={"&":"&","<":"<",">":">",'"':"'"};function Ui(n,e){function t(i,r){return uu[r]||r}return n.replace(e,t)}function io(n,e){var t,i,r,o,l;switch(n.nodeType){case 3:e.push(Ui(n.textContent,no));break;case 1:if(e.push("<",n.tagName),n.hasAttributes())for(r=n.attributes,t=0,i=r.length;t<i;++t)o=r.item(t),e.push(" ",o.name,'="',Ui(o.value,lu),'"');if(n.hasChildNodes()){for(e.push(">"),l=n.childNodes,t=0,i=l.length;t<i;++t)io(l.item(t),e);e.push("</",n.tagName,">")}else e.push("/>");break;case 8:e.push("<!--",Ui(n.nodeValue,no),"-->");break;case 4:e.push("<![CDATA[",n.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+n.nodeType)}return e}function cu(n){for(var e=n.firstChild,t=[];e;)io(e,t),e=e.nextSibling;return t.join("")}function ro(n,e){return cu(n)}function En(n){var e=n.parentNode;return e&&e.removeChild(n),n}function fu(n,e){return e instanceof SVGMatrix?n.createSVGTransformFromMatrix(e):e}function du(n,e){var t,i;for(n.clear(),t=0;i=e[t];t++)n.appendItem(fu(n,i))}function Tn(n,e){var t=n.transform.baseVal;return e&&(Array.isArray(e)||(e=[e]),du(t,e)),t.consolidate()}function Nt(n){return n.flat().join(",").replace(/,?([A-z]),?/g,"$1")}function pu(n){return["M",n.x,n.y]}function $i(n){return["L",n.x,n.y]}function hu(n,e,t){return["C",n.x,n.y,e.x,e.y,t.x,t.y]}function mu(n,e){const t=n.length,i=[pu(n[0])];for(let r=1;r<t;r++){const o=n[r-1],l=n[r],u=n[r+1];if(!u||!e){i.push($i(l));continue}const c=Math.min(e,Gi(l.x-o.x,l.y-o.y),Gi(u.x-l.x,u.y-l.y));if(!c){i.push($i(l));continue}const f=Wn(l,o,c),d=Wn(l,o,c*.5),h=Wn(l,u,c),g=Wn(l,u,c*.5);i.push($i(f)),i.push(hu(d,g,h))}return i}function Wn(n,e,t){const i=e.x-n.x,r=e.y-n.y,o=Gi(i,r),l=t/o;return{x:n.x+i*l,y:n.y+r*l}}function Gi(n,e){return Math.sqrt(Math.pow(n,2)+Math.pow(e,2))}function qi(n,e,t){gt(e)&&(t=e,e=null),e||(e={});const i=de("path",e);return gt(t)&&(i.dataset.cornerRadius=String(t)),oo(i,n)}function oo(n,e){const t=parseInt(n.dataset.cornerRadius,10)||0;return le(n,{d:Nt(mu(e,t))}),n}var wn="hsl(225, 10%, 15%)";function nt(n,e){return Kr(n.eventDefinitions,function(t){return t.$type===e})}function gu(n){return n.$type==="bpmn:IntermediateThrowEvent"||n.$type==="bpmn:EndEvent"}function yu(n){var e=n.dataObjectRef;return n.isCollection||e&&e.isCollection}function re(n,e){var t=Kt(n);return t.get("color:background-color")||t.get("bioc:fill")||e||"white"}function B(n,e){var t=Kt(n);return t.get("color:border-color")||t.get("bioc:stroke")||e||wn}function Sn(n,e,t){var i=Kt(n),r=i.get("label");return r&&r.get("color:color")||e||B(n,t)}function vu(n){var e=n.x+n.width/2,t=n.y+n.height/2,i=n.width/2,r=[["M",e,t],["m",0,-i],["a",i,i,0,1,1,0,2*i],["a",i,i,0,1,1,0,-2*i],["z"]];return Nt(r)}function _u(n,e){var t=n.x,i=n.y,r=n.width,o=n.height,l=[["M",t+e,i],["l",r-e*2,0],["a",e,e,0,0,1,e,e],["l",0,o-e*2],["a",e,e,0,0,1,-e,e],["l",e*2-r,0],["a",e,e,0,0,1,-e,-e],["l",0,e*2-o],["a",e,e,0,0,1,e,-e],["z"]];return Nt(l)}function xu(n){var e=n.width,t=n.height,i=n.x,r=n.y,o=e/2,l=t/2,u=[["M",i+o,r],["l",o,l],["l",-o,l],["l",-o,-l],["z"]];return Nt(u)}function Cu(n){var e=n.x,t=n.y,i=n.width,r=n.height,o=[["M",e,t],["l",i,0],["l",0,r],["l",-i,0],["z"]];return Nt(o)}function Eu(n,e){return e.forEach(function(t){t&&typeof t!="string"&&!Array.isArray(t)&&Object.keys(t).forEach(function(i){if(i!=="default"&&!(i in n)){var r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return t[i]}})}})}),Object.freeze(n)}const Tu=Object.prototype.toString,wu=Object.prototype.hasOwnProperty;function Su(n){return n===void 0}function Au(n){return Tu.call(n)==="[object Array]"}function bu(n,e){return wu.call(n,e)}function so(n,e){let t,i;if(Su(n))return;const r=Au(n)?Mu:Ru;for(let o in n)if(bu(n,o)&&(t=n[o],i=e(t,r(o)),i===!1))return t}function Ru(n){return n}function Mu(n){return Number(n)}function Ve(n,...e){const t=n.style;return so(e,function(i){i&&so(i,function(r,o){t[o]=r})}),n}function Iu(n,e,t){return arguments.length==2?n.getAttribute(e):t===null?n.removeAttribute(e):(n.setAttribute(e,t),n)}const Pu=Object.prototype.toString;function zn(n){return new xt(n)}function xt(n){if(!n||!n.nodeType)throw new Error("A DOM element reference is required");this.el=n,this.list=n.classList}xt.prototype.add=function(n){return this.list.add(n),this},xt.prototype.remove=function(n){return Pu.call(n)=="[object RegExp]"?this.removeMatching(n):(this.list.remove(n),this)},xt.prototype.removeMatching=function(n){const e=this.array();for(let t=0;t<e.length;t++)n.test(e[t])&&this.remove(e[t]);return this},xt.prototype.toggle=function(n,e){return typeof e<"u"?e!==this.list.toggle(n,e)&&this.list.toggle(n):this.list.toggle(n),this},xt.prototype.array=function(){return Array.from(this.list)},xt.prototype.has=xt.prototype.contains=function(n){return this.list.contains(n)};function ao(n){for(var e;e=n.firstChild;)n.removeChild(e);return n}function ku(n,e,t){var i=t?n:n.parentNode;return i&&typeof i.closest=="function"&&i.closest(e)||null}var Yn={},Kn,Hi,Wi;function lo(){Kn=window.addEventListener?"addEventListener":"attachEvent",Hi=window.removeEventListener?"removeEventListener":"detachEvent",Wi=Kn!=="addEventListener"?"on":""}var Nu=Yn.bind=function(n,e,t,i){return Kn||lo(),n[Kn](Wi+e,t,i||!1),t},Du=Yn.unbind=function(n,e,t,i){return Hi||lo(),n[Hi](Wi+e,t,i||!1),t},zi=Eu({__proto__:null,bind:Nu,unbind:Du,default:Yn},[Yn]),uo=["focus","blur"];function Lu(n,e,t,i,r){return uo.indexOf(t)!==-1&&(r=!0),zi.bind(n,t,function(o){var l=o.target||o.srcElement;o.delegateTarget=ku(l,e,!0),o.delegateTarget&&i.call(n,o)},r)}function Fu(n,e,t,i){return uo.indexOf(e)!==-1&&(i=!0),zi.unbind(n,e,t,i)}var Yi={bind:Lu,unbind:Fu},Vu=Bu,co=!1,Jn;typeof document<"u"&&(Jn=document.createElement("div"),Jn.innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',co=!Jn.getElementsByTagName("link").length,Jn=void 0);var Ce={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:co?[1,"X<div>","</div>"]:[0,"",""]};Ce.td=Ce.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],Ce.option=Ce.optgroup=[1,'<select multiple="multiple">',"</select>"],Ce.thead=Ce.tbody=Ce.colgroup=Ce.caption=Ce.tfoot=[1,"<table>","</table>"],Ce.polyline=Ce.ellipse=Ce.polygon=Ce.circle=Ce.text=Ce.line=Ce.path=Ce.rect=Ce.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];function Bu(n,e){if(typeof n!="string")throw new TypeError("String expected");e||(e=document);var t=/<([\w:]+)/.exec(n);if(!t)return e.createTextNode(n);n=n.replace(/^\s+|\s+$/g,"");var i=t[1];if(i=="body"){var c=e.createElement("html");return c.innerHTML=n,c.removeChild(c.lastChild)}var r=Object.prototype.hasOwnProperty.call(Ce,i)?Ce[i]:Ce._default,o=r[0],l=r[1],u=r[2],c=e.createElement("div");for(c.innerHTML=l+n+u;o--;)c=c.lastChild;if(c.firstChild==c.lastChild)return c.removeChild(c.firstChild);for(var f=e.createDocumentFragment();c.firstChild;)f.appendChild(c.removeChild(c.firstChild));return f}var it=Vu;function Ze(n,e){return e=e||document,e.querySelector(n)}function Ou(n,e){return e=e||document,e.querySelectorAll(n)}function Zn(n){n.parentNode&&n.parentNode.removeChild(n)}function fo(n,e,t,i,r){var o=Cn();o.setTranslate(e,t);var l=Cn();l.setRotate(i||0,0,0);var u=Cn();u.setScale(1,1),Tn(n,[o,l,u])}function po(n,e,t){var i=Cn();i.setTranslate(e,t),Tn(n,i)}function Uu(n,e){var t=Cn();t.setRotate(e,0,0),Tn(n,t)}function $u(n,e){return e={exports:{}},n(e,e.exports),e.exports}var Gu=$u(function(n){var e=n.exports=function(t,i){if(i||(i=16),t===void 0&&(t=128),t<=0)return"0";for(var r=Math.log(Math.pow(2,t))/Math.log(i),o=2;r===1/0;o*=2)r=Math.log(Math.pow(2,t/o))/Math.log(i)*o;for(var l=r-Math.floor(r),u="",o=0;o<Math.floor(r);o++){var c=Math.floor(Math.random()*i).toString(i);u=c+u}if(l){var f=Math.pow(i,l),c=Math.floor(Math.random()*f).toString(i);u=c+u}var d=parseInt(u,i);return d!==1/0&&d>=Math.pow(2,t)?e(t,i):u};e.rack=function(t,i,r){var o=function(u){var c=0;do{if(c++>10)if(r)t+=r;else throw new Error("too many ID collisions, use more bits");var f=e(t,i)}while(Object.hasOwnProperty.call(l,f));return l[f]=u,f},l=o.hats={};return o.get=function(u){return o.hats[u]},o.set=function(u,c){return o.hats[u]=c,o},o.bits=t||128,o.base=i||16,o}});function ct(n){if(!(this instanceof ct))return new ct(n);n=n||[128,36,1],this._seed=n.length?Gu.rack(n[0],n[1],n[2]):n}ct.prototype.next=function(n){return this._seed(n||!0)},ct.prototype.nextPrefixed=function(n,e){var t;do t=n+this.next(!0);while(this.assigned(t));return this.claim(t,e),t},ct.prototype.claim=function(n,e){this._seed.set(n,e||!0)},ct.prototype.assigned=function(n){return this._seed.get(n)||!1},ct.prototype.unclaim=function(n){delete this._seed.hats[n]},ct.prototype.clear=function(){var n=this._seed.hats,e;for(e in n)this.unclaim(e)};var qu=new ct,Xn=10,Ki=3,Jt=.95,Hu=.35,Wu=10;function Dt(n,e,t,i,r,o,l){ut.call(this,e,l);var u=n&&n.defaultFillColor,c=n&&n.defaultStrokeColor,f=n&&n.defaultLabelColor,d=qu.next(),h={};function g(y){return t.computeStyle(y,{strokeLinecap:"round",strokeLinejoin:"round",stroke:wn,strokeWidth:2,fill:"white"})}function x(y){return t.computeStyle(y,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:wn,strokeWidth:2})}function w(y,p){var{ref:m={x:0,y:0},scale:_=1,element:v}=p,E=de("marker",{id:y,viewBox:"0 0 20 20",refX:m.x,refY:m.y,markerWidth:20*_,markerHeight:20*_,orient:"auto"});_e(E,v);var N=Ze("defs",r._svg);N||(N=de("defs"),_e(r._svg,N)),_e(N,E),h[y]=E}function b(y){return y.replace(/[^0-9a-zA-Z]+/g,"_")}function D(y,p,m){var _=y+"-"+b(p)+"-"+b(m)+"-"+d;return h[_]||F(_,y,p,m),"url(#"+_+")"}function F(y,p,m,_){if(p==="sequenceflow-end"){var v=de("path",{d:"M 1 5 L 11 10 L 1 15 Z",...g({fill:_,stroke:_,strokeWidth:1})});w(y,{element:v,ref:{x:11,y:10},scale:.5})}if(p==="messageflow-start"){var E=de("circle",{cx:6,cy:6,r:3.5,...g({fill:m,stroke:_,strokeWidth:1,strokeDasharray:[1e4,1]})});w(y,{element:E,ref:{x:6,y:6}})}if(p==="messageflow-end"){var N=de("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...g({fill:m,stroke:_,strokeWidth:1,strokeDasharray:[1e4,1]})});w(y,{element:N,ref:{x:8.5,y:5}})}if(p==="association-start"){var Z=de("path",{d:"M 11 5 L 1 10 L 11 15",...x({fill:"none",stroke:_,strokeWidth:1.5,strokeDasharray:[1e4,1]})});w(y,{element:Z,ref:{x:1,y:10},scale:.5})}if(p==="association-end"){var ee=de("path",{d:"M 1 5 L 11 10 L 1 15",...x({fill:"none",stroke:_,strokeWidth:1.5,strokeDasharray:[1e4,1]})});w(y,{element:ee,ref:{x:11,y:10},scale:.5})}if(p==="conditional-flow-marker"){var oe=de("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...g({fill:m,stroke:_})});w(y,{element:oe,ref:{x:-1,y:10},scale:.5})}if(p==="conditional-default-flow-marker"){var Ae=de("path",{d:"M 6 4 L 10 16",...g({stroke:_})});w(y,{element:Ae,ref:{x:0,y:10},scale:.5})}}function T(y,p,m,_,v){kt(_)&&(v=_,_=0),_=_||0,v=g(v),v.fill==="none"&&delete v.fillOpacity;var E=p/2,N=m/2,Z=de("circle",{cx:E,cy:N,r:Math.round((p+m)/4-_),...v});return _e(y,Z),Z}function k(y,p,m,_,v,E){kt(v)&&(E=v,v=0),v=v||0,E=g(E);var N=de("rect",{x:v,y:v,width:p-v*2,height:m-v*2,rx:_,ry:_,...E});return _e(y,N),N}function A(y,p,m,_){var v=p/2,E=m/2,N=[{x:v,y:0},{x:p,y:E},{x:v,y:m},{x:0,y:E}],Z=N.map(function(oe){return oe.x+","+oe.y}).join(" ");_=g(_);var ee=de("polygon",{..._,points:Z});return _e(y,ee),ee}function S(y,p,m,_){m=x(m);var v=qi(p,m,_);return _e(y,v),v}function I(y,p,m){return S(y,p,m,5)}function R(y,p,m){m=x(m);var _=de("path",{...m,d:p});return _e(y,_),_}function M(y,p,m,_){return R(p,m,Y({"data-marker":y},_))}function C(y){return ce[y]}function P(y){return function(p,m,_){return C(y)(p,m,_)}}function O(y,p){var m=ve(y),_=gu(m);return m.eventDefinitions&&m.eventDefinitions.length>1?m.parallelMultiple?C("bpmn:ParallelMultipleEventDefinition")(p,y,_):C("bpmn:MultipleEventDefinition")(p,y,_):nt(m,"bpmn:MessageEventDefinition")?C("bpmn:MessageEventDefinition")(p,y,_):nt(m,"bpmn:TimerEventDefinition")?C("bpmn:TimerEventDefinition")(p,y,_):nt(m,"bpmn:ConditionalEventDefinition")?C("bpmn:ConditionalEventDefinition")(p,y):nt(m,"bpmn:SignalEventDefinition")?C("bpmn:SignalEventDefinition")(p,y,_):nt(m,"bpmn:EscalationEventDefinition")?C("bpmn:EscalationEventDefinition")(p,y,_):nt(m,"bpmn:LinkEventDefinition")?C("bpmn:LinkEventDefinition")(p,y,_):nt(m,"bpmn:ErrorEventDefinition")?C("bpmn:ErrorEventDefinition")(p,y,_):nt(m,"bpmn:CancelEventDefinition")?C("bpmn:CancelEventDefinition")(p,y,_):nt(m,"bpmn:CompensateEventDefinition")?C("bpmn:CompensateEventDefinition")(p,y,_):nt(m,"bpmn:TerminateEventDefinition")?C("bpmn:TerminateEventDefinition")(p,y,_):null}function U(y,p,m){m=Y({size:{width:100}},m);var _=o.createText(p||"",m);return Oe(_).add("djs-label"),_e(y,_),_}function $(y,p,m){var _=ve(p);return U(y,_.name,{box:p,align:m,padding:7,style:{fill:Sn(p,f,c)}})}function te(y,p){var m={width:90,height:30,x:p.width/2+p.x,y:p.height/2+p.y};return U(y,Hn(p),{box:m,fitBox:!0,style:Y({},o.getExternalStyle(),{fill:Sn(p,f,c)})})}function Fe(y,p,m){var _=U(y,p,{box:{height:30,width:m.height},align:"center-middle",style:{fill:Sn(m,f,c)}}),v=-1*m.height;fo(_,0,-v,270)}var ce=this.handlers={"bpmn:Event":function(y,p,m){return"fillOpacity"in m||(m.fillOpacity=Jt),T(y,p.width,p.height,m)},"bpmn:StartEvent":function(y,p,m){var _={fill:re(p,u),stroke:B(p,c)},v=ve(p);v.isInterrupting||(_={strokeDasharray:"6",fill:re(p,u),stroke:B(p,c)});var E=C("bpmn:Event")(y,p,_);return(!m||m.renderIcon!==!1)&&O(p,y),E},"bpmn:MessageEventDefinition":function(y,p,m){var _=i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:p.width,containerHeight:p.height,position:{mx:.235,my:.315}}),v=m?B(p,c):re(p,u),E=m?re(p,u):B(p,c),N=R(y,_,{strokeWidth:1,fill:v,stroke:E});return N},"bpmn:TimerEventDefinition":function(y,p){var m=T(y,p.width,p.height,.2*p.height,{strokeWidth:2,fill:re(p,u),stroke:B(p,c)}),_=i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:p.width,containerHeight:p.height,position:{mx:.5,my:.5}});R(y,_,{strokeWidth:2,stroke:B(p,c)});for(var v=0;v<12;v++){var E=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:p.width,containerHeight:p.height,position:{mx:.5,my:.5}}),N=p.width/2,Z=p.height/2;R(y,E,{strokeWidth:1,transform:"rotate("+v*30+","+Z+","+N+")",stroke:B(p,c)})}return m},"bpmn:EscalationEventDefinition":function(y,p,m){var _=i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:p.width,containerHeight:p.height,position:{mx:.5,my:.2}}),v=m?B(p,c):"none";return R(y,_,{strokeWidth:1,fill:v,stroke:B(p,c)})},"bpmn:ConditionalEventDefinition":function(y,p){var m=i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:p.width,containerHeight:p.height,position:{mx:.5,my:.222}});return R(y,m,{strokeWidth:1,stroke:B(p,c)})},"bpmn:LinkEventDefinition":function(y,p,m){var _=i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:p.width,containerHeight:p.height,position:{mx:.57,my:.263}}),v=m?B(p,c):"none";return R(y,_,{strokeWidth:1,fill:v,stroke:B(p,c)})},"bpmn:ErrorEventDefinition":function(y,p,m){var _=i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:p.width,containerHeight:p.height,position:{mx:.2,my:.722}}),v=m?B(p,c):"none";return R(y,_,{strokeWidth:1,fill:v,stroke:B(p,c)})},"bpmn:CancelEventDefinition":function(y,p,m){var _=i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:p.width,containerHeight:p.height,position:{mx:.638,my:-.055}}),v=m?B(p,c):"none",E=R(y,_,{strokeWidth:1,fill:v,stroke:B(p,c)});return Uu(E,45),E},"bpmn:CompensateEventDefinition":function(y,p,m){var _=i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:p.width,containerHeight:p.height,position:{mx:.22,my:.5}}),v=m?B(p,c):"none";return R(y,_,{strokeWidth:1,fill:v,stroke:B(p,c)})},"bpmn:SignalEventDefinition":function(y,p,m){var _=i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:p.width,containerHeight:p.height,position:{mx:.5,my:.2}}),v=m?B(p,c):"none";return R(y,_,{strokeWidth:1,fill:v,stroke:B(p,c)})},"bpmn:MultipleEventDefinition":function(y,p,m){var _=i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:p.width,containerHeight:p.height,position:{mx:.222,my:.36}}),v=m?B(p,c):"none";return R(y,_,{strokeWidth:1,fill:v})},"bpmn:ParallelMultipleEventDefinition":function(y,p){var m=i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:p.width,containerHeight:p.height,position:{mx:.458,my:.194}});return R(y,m,{strokeWidth:1,fill:B(p,c),stroke:B(p,c)})},"bpmn:EndEvent":function(y,p,m){var _=C("bpmn:Event")(y,p,{strokeWidth:4,fill:re(p,u),stroke:B(p,c)});return(!m||m.renderIcon!==!1)&&O(p,y),_},"bpmn:TerminateEventDefinition":function(y,p){var m=T(y,p.width,p.height,8,{strokeWidth:4,fill:B(p,c),stroke:B(p,c)});return m},"bpmn:IntermediateEvent":function(y,p,m){var _=C("bpmn:Event")(y,p,{strokeWidth:1.5,fill:re(p,u),stroke:B(p,c)});return T(y,p.width,p.height,Ki,{strokeWidth:1.5,fill:re(p,"none"),stroke:B(p,c)}),(!m||m.renderIcon!==!1)&&O(p,y),_},"bpmn:IntermediateCatchEvent":P("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":P("bpmn:IntermediateEvent"),"bpmn:Activity":function(y,p,m){return m=m||{},"fillOpacity"in m||(m.fillOpacity=Jt),k(y,p.width,p.height,Xn,m)},"bpmn:Task":function(y,p){var m={fill:re(p,u),stroke:B(p,c)},_=C("bpmn:Activity")(y,p,m);return $(y,p,"center-middle"),ne(y,p),_},"bpmn:ServiceTask":function(y,p){var m=C("bpmn:Task")(y,p),_=i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});R(y,_,{strokeWidth:1,fill:re(p,u),stroke:B(p,c)});var v=i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}});R(y,v,{strokeWidth:0,fill:re(p,u)});var E=i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return R(y,E,{strokeWidth:1,fill:re(p,u),stroke:B(p,c)}),m},"bpmn:UserTask":function(y,p){var m=C("bpmn:Task")(y,p),_=15,v=12,E=i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:_,y:v}});R(y,E,{strokeWidth:.5,fill:re(p,u),stroke:B(p,c)});var N=i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:_,y:v}});R(y,N,{strokeWidth:.5,fill:re(p,u),stroke:B(p,c)});var Z=i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:_,y:v}});return R(y,Z,{strokeWidth:.5,fill:B(p,c),stroke:B(p,c)}),m},"bpmn:ManualTask":function(y,p){var m=C("bpmn:Task")(y,p),_=i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return R(y,_,{strokeWidth:.5,fill:re(p,u),stroke:B(p,c)}),m},"bpmn:SendTask":function(y,p){var m=C("bpmn:Task")(y,p),_=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return R(y,_,{strokeWidth:1,fill:B(p,c),stroke:re(p,u)}),m},"bpmn:ReceiveTask":function(y,p){var m=ve(p),_=C("bpmn:Task")(y,p),v;return m.instantiate?(T(y,28,28,20*.22,{strokeWidth:1}),v=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):v=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),R(y,v,{strokeWidth:1,fill:re(p,u),stroke:B(p,c)}),_},"bpmn:ScriptTask":function(y,p){var m=C("bpmn:Task")(y,p),_=i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return R(y,_,{strokeWidth:1,stroke:B(p,c)}),m},"bpmn:BusinessRuleTask":function(y,p){var m=C("bpmn:Task")(y,p),_=i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),v=R(y,_);le(v,{strokeWidth:1,fill:re(p,"#aaaaaa"),stroke:B(p,c)});var E=i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),N=R(y,E);return le(N,{strokeWidth:1,stroke:B(p,c)}),m},"bpmn:SubProcess":function(y,p,m){m={fill:re(p,u),stroke:B(p,c),...m};var _=C("bpmn:Activity")(y,p,m),v=Fi(p);return Hl(p)&&le(_,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),$(y,p,v?"center-top":"center-middle"),v?ne(y,p):ne(y,p,["SubProcessMarker"]),_},"bpmn:AdHocSubProcess":function(y,p){return C("bpmn:SubProcess")(y,p)},"bpmn:Transaction":function(y,p){var m=C("bpmn:SubProcess")(y,p,{strokeWidth:1.5}),_=t.style(["no-fill","no-events"],{stroke:B(p,c),strokeWidth:1.5});return k(y,p.width,p.height,Xn-3,Ki,_),m},"bpmn:CallActivity":function(y,p){return C("bpmn:SubProcess")(y,p,{strokeWidth:5})},"bpmn:Participant":function(y,p){var m=1.5,_={fillOpacity:Jt,fill:re(p,u),stroke:B(p,c),strokeWidth:m},v=C("bpmn:Lane")(y,p,_),E=Fi(p);if(E){S(y,[{x:30,y:0},{x:30,y:p.height}],{stroke:B(p,c),strokeWidth:m});var N=ve(p).name;Fe(y,N,p)}else{var Z=ve(p).name;U(y,Z,{box:p,align:"center-middle",style:{fill:Sn(p,f,c)}})}var ee=!!ve(p).participantMultiplicity;return ee&&C("ParticipantMultiplicityMarker")(y,p),v},"bpmn:Lane":function(y,p,m){var _=k(y,p.width,p.height,0,{fill:re(p,u),fillOpacity:Hu,stroke:B(p,c),strokeWidth:1.5,...m}),v=ve(p);if(v.$type==="bpmn:Lane"){var E=v.name;Fe(y,E,p)}return _},"bpmn:InclusiveGateway":function(y,p){var m=C("bpmn:Gateway")(y,p);return T(y,p.width,p.height,p.height*.24,{strokeWidth:2.5,fill:re(p,u),stroke:B(p,c)}),m},"bpmn:ExclusiveGateway":function(y,p){var m=C("bpmn:Gateway")(y,p),_=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:p.width,containerHeight:p.height,position:{mx:.32,my:.3}});return Kt(p).isMarkerVisible&&R(y,_,{strokeWidth:1,fill:B(p,c),stroke:B(p,c)}),m},"bpmn:ComplexGateway":function(y,p){var m=C("bpmn:Gateway")(y,p),_=i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:p.width,containerHeight:p.height,position:{mx:.46,my:.26}});return R(y,_,{strokeWidth:1,fill:B(p,c),stroke:B(p,c)}),m},"bpmn:ParallelGateway":function(y,p){var m=C("bpmn:Gateway")(y,p),_=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:p.width,containerHeight:p.height,position:{mx:.46,my:.2}});return R(y,_,{strokeWidth:1,fill:B(p,c),stroke:B(p,c)}),m},"bpmn:EventBasedGateway":function(y,p){var m=ve(p),_=C("bpmn:Gateway")(y,p);T(y,p.width,p.height,p.height*.2,{strokeWidth:1,fill:"none",stroke:B(p,c)});var v=m.eventGatewayType,E=!!m.instantiate;function N(){var ee=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:p.width,containerHeight:p.height,position:{mx:.36,my:.44}});R(y,ee,{strokeWidth:2,fill:re(p,"none"),stroke:B(p,c)})}if(v==="Parallel"){var Z=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:p.width,containerHeight:p.height,position:{mx:.474,my:.296}});R(y,Z,{strokeWidth:1,fill:"none"})}else v==="Exclusive"&&(E||T(y,p.width,p.height,p.height*.26,{strokeWidth:1,fill:"none",stroke:B(p,c)}),N());return _},"bpmn:Gateway":function(y,p){return A(y,p.width,p.height,{fill:re(p,u),fillOpacity:Jt,stroke:B(p,c)})},"bpmn:SequenceFlow":function(y,p){var m=re(p,u),_=B(p,c),v=I(y,p.waypoints,{markerEnd:D("sequenceflow-end",m,_),stroke:B(p,c)}),E=ve(p),N;return p.source&&(N=p.source.businessObject,E.conditionExpression&&N.$instanceOf("bpmn:Activity")&&le(v,{markerStart:D("conditional-flow-marker",m,_)}),N.default&&(N.$instanceOf("bpmn:Gateway")||N.$instanceOf("bpmn:Activity"))&&N.default===E&&le(v,{markerStart:D("conditional-default-flow-marker",m,_)})),v},"bpmn:Association":function(y,p,m){var _=ve(p),v=re(p,u),E=B(p,c);return m={strokeDasharray:"0, 5",stroke:B(p,c),...m},(_.associationDirection==="One"||_.associationDirection==="Both")&&(m.markerEnd=D("association-end",v,E)),_.associationDirection==="Both"&&(m.markerStart=D("association-start",v,E)),I(y,p.waypoints,m)},"bpmn:DataInputAssociation":function(y,p){var m=re(p,u),_=B(p,c);return C("bpmn:Association")(y,p,{markerEnd:D("association-end",m,_)})},"bpmn:DataOutputAssociation":function(y,p){var m=re(p,u),_=B(p,c);return C("bpmn:Association")(y,p,{markerEnd:D("association-end",m,_)})},"bpmn:MessageFlow":function(y,p){var m=ve(p),_=Kt(p),v=re(p,u),E=B(p,c),N=I(y,p.waypoints,{markerEnd:D("messageflow-end",v,E),markerStart:D("messageflow-start",v,E),strokeDasharray:"10, 11",strokeWidth:1.5,stroke:B(p,c)});if(m.messageRef){var Z=N.getPointAtLength(N.getTotalLength()/2),ee=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:Z.x,y:Z.y}}),oe={strokeWidth:1};_.messageVisibleKind==="initiating"?(oe.fill="white",oe.stroke=wn):(oe.fill="#888",oe.stroke="white");var Ae=R(y,ee,oe),ye=m.messageRef.name,Ye=U(y,ye,{align:"center-top",fitBox:!0,style:{fill:B(p,f)}}),Qe=Ae.getBBox(),he=Ye.getBBox(),be=Z.x-he.width/2,mt=Z.y+Qe.height/2+Wu;fo(Ye,be,mt,0)}return N},"bpmn:DataObject":function(y,p){var m=i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:p.width,containerHeight:p.height,position:{mx:.474,my:.296}}),_=R(y,m,{fill:re(p,u),fillOpacity:Jt,stroke:B(p,c)}),v=ve(p);return yu(v)&&qe(y,p),_},"bpmn:DataObjectReference":P("bpmn:DataObject"),"bpmn:DataInput":function(y,p){var m=i.getRawPath("DATA_ARROW"),_=C("bpmn:DataObject")(y,p);return R(y,m,{strokeWidth:1}),_},"bpmn:DataOutput":function(y,p){var m=i.getRawPath("DATA_ARROW"),_=C("bpmn:DataObject")(y,p);return R(y,m,{strokeWidth:1,fill:wn}),_},"bpmn:DataStoreReference":function(y,p){var m=i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:p.width,containerHeight:p.height,position:{mx:0,my:.133}}),_=R(y,m,{strokeWidth:2,fill:re(p,u),fillOpacity:Jt,stroke:B(p,c)});return _},"bpmn:BoundaryEvent":function(y,p,m){var _=ve(p),v=_.cancelActivity,E={strokeWidth:1.5,fill:re(p,u),stroke:B(p,c)};v||(E.strokeDasharray="6");var N={...E,fillOpacity:1},Z={...E,fill:"none"},ee=C("bpmn:Event")(y,p,N);return T(y,p.width,p.height,Ki,Z),(!m||m.renderIcon!==!1)&&O(p,y),ee},"bpmn:Group":function(y,p){return k(y,p.width,p.height,Xn,{stroke:B(p,c),strokeWidth:1.5,strokeDasharray:"10,6,0,6",fill:"none",pointerEvents:"none"})},label:function(y,p){return te(y,p)},"bpmn:TextAnnotation":function(y,p){var m=k(y,p.width,p.height,0,0,{fill:"none",stroke:"none"}),_=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:p.width,containerHeight:p.height,position:{mx:0,my:0}});R(y,_,{stroke:B(p,c)});var v=ve(p).text||"";return U(y,v,{box:p,align:"left-top",padding:7,style:{fill:Sn(p,f,c)}}),m},ParticipantMultiplicityMarker:function(y,p){var m=i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:p.width,containerHeight:p.height,position:{mx:p.width/2/p.width,my:(p.height-15)/p.height}});M("participant-multiplicity",y,m,{strokeWidth:2,fill:re(p,u),stroke:B(p,c)})},SubProcessMarker:function(y,p){var m=k(y,14,14,0,{strokeWidth:1,fill:re(p,u),stroke:B(p,c)});po(m,p.width/2-7.5,p.height-20);var _=i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:p.width,containerHeight:p.height,position:{mx:(p.width/2-7.5)/p.width,my:(p.height-20)/p.height}});M("sub-process",y,_,{fill:re(p,u),stroke:B(p,c)})},ParallelMarker:function(y,p,m){var _=i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:p.width,containerHeight:p.height,position:{mx:(p.width/2+m.parallel)/p.width,my:(p.height-20)/p.height}});M("parallel",y,_,{fill:re(p,u),stroke:B(p,c)})},SequentialMarker:function(y,p,m){var _=i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:p.width,containerHeight:p.height,position:{mx:(p.width/2+m.seq)/p.width,my:(p.height-19)/p.height}});M("sequential",y,_,{fill:re(p,u),stroke:B(p,c)})},CompensationMarker:function(y,p,m){var _=i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:p.width,containerHeight:p.height,position:{mx:(p.width/2+m.compensation)/p.width,my:(p.height-13)/p.height}});M("compensation",y,_,{strokeWidth:1,fill:re(p,u),stroke:B(p,c)})},LoopMarker:function(y,p,m){var _=i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:p.width,containerHeight:p.height,position:{mx:(p.width/2+m.loop)/p.width,my:(p.height-7)/p.height}});M("loop",y,_,{strokeWidth:1.5,fill:re(p,u),stroke:B(p,c),strokeMiterlimit:.5})},AdhocMarker:function(y,p,m){var _=i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:p.width,containerHeight:p.height,position:{mx:(p.width/2+m.adhoc)/p.width,my:(p.height-15)/p.height}});M("adhoc",y,_,{strokeWidth:1,fill:B(p,c),stroke:B(p,c)})}};function ne(y,p,m){var _=ve(p),v=m&&m.indexOf("SubProcessMarker")!==-1,E;v?E={seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:E={seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},q(m,function(ee){C(ee)(y,p,E)}),_.isForCompensation&&C("CompensationMarker")(y,p,E),_.$type==="bpmn:AdHocSubProcess"&&C("AdhocMarker")(y,p,E);var N=_.loopCharacteristics,Z=N&&N.isSequential;N&&(Z===void 0&&C("LoopMarker")(y,p,E),Z===!1&&C("ParallelMarker")(y,p,E),Z===!0&&C("SequentialMarker")(y,p,E))}function qe(y,p){var m=(p.height-18)/p.height,_=i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:p.width,containerHeight:p.height,position:{mx:.33,my:m}});R(y,_,{strokeWidth:2})}this._drawPath=R,this._renderer=C}et(Dt,ut),Dt.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],Dt.prototype.canRender=function(n){return K(n,"bpmn:BaseElement")},Dt.prototype.drawShape=function(n,e){var t=e.type,i=this._renderer(t);return i(n,e)},Dt.prototype.drawConnection=function(n,e){var t=e.type,i=this._renderer(t);return i(n,e)},Dt.prototype.getShapePath=function(n){return K(n,"bpmn:Event")?vu(n):K(n,"bpmn:Activity")?_u(n,Xn):K(n,"bpmn:Gateway")?xu(n):Cu(n)};var zu=0,Yu={width:150,height:50};function Ku(n){var e=n.split("-");return{horizontal:e[0]||"center",vertical:e[1]||"top"}}function Ju(n){return kt(n)?Y({top:0,left:0,right:0,bottom:0},n):{top:n,left:n,right:n,bottom:n}}function Zu(n,e){e.textContent=n;var t;try{var i,r=n==="";return e.textContent=r?"dummy":n,t=e.getBBox(),i={width:t.width+t.x*2,height:t.height},r&&(i.width=0),i}catch{return{width:0,height:0}}}function Xu(n,e,t){for(var i=n.shift(),r=i,o;;){if(o=Zu(r,t),o.width=r?o.width:0,r===" "||r===""||o.width<Math.round(e)||r.length<2)return Qu(n,r,i,o);r=ec(r,o.width,e)}}function Qu(n,e,t,i){if(e.length<t.length){var r=t.slice(e.length).trim();n.unshift(r)}return{width:i.width,height:i.height,text:e}}var ho="";function ju(n,e){var t=n.split(/(\s|-|\u00AD)/g),i,r=[],o=0;if(t.length>1)for(;i=t.shift();)if(i.length+o<e)r.push(i),o+=i.length;else{(i==="-"||i===ho)&&r.pop();break}var l=r[r.length-1];return l&&l===ho&&(r[r.length-1]="-"),r.join("")}function ec(n,e,t){var i=Math.max(n.length*(t/e),1),r=ju(n,i);return r||(r=n.slice(0,Math.max(Math.round(i-1),1))),r}function tc(){var n=document.getElementById("helper-svg");return n||(n=de("svg"),le(n,{id:"helper-svg"}),Ve(n,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(n)),n}function Qn(n){this._config=Y({},{size:Yu,padding:zu,style:{},align:"center-top"},n||{})}Qn.prototype.createText=function(n,e){return this.layoutText(n,e).element},Qn.prototype.getDimensions=function(n,e){return this.layoutText(n,e).dimensions},Qn.prototype.layoutText=function(n,e){var t=Y({},this._config.size,e.box),i=Y({},this._config.style,e.style),r=Ku(e.align||this._config.align),o=Ju(e.padding!==void 0?e.padding:this._config.padding),l=e.fitBox||!1,u=nc(i),c=n.split(/\u00AD?\r?\n/),f=[],d=t.width-o.left-o.right,h=de("text");le(h,{x:0,y:0}),le(h,i);var g=tc();for(_e(g,h);c.length;)f.push(Xu(c,d,h));r.vertical==="middle"&&(o.top=o.bottom=0);var x=Yt(f,function(T,k,A){return T+(u||k.height)},0)+o.top+o.bottom,w=Yt(f,function(T,k,A){return k.width>T?k.width:T},0),b=o.top;r.vertical==="middle"&&(b+=(t.height-x)/2),b-=(u||f[0].height)/4;var D=de("text");le(D,i),q(f,function(T){var k;switch(b+=u||T.height,r.horizontal){case"left":k=o.left;break;case"right":k=(l?w:d)-o.right-T.width;break;default:k=Math.max(((l?w:d)-T.width)/2+o.left,0)}var A=de("tspan");le(A,{x:k,y:b}),A.textContent=T.text,_e(D,A)}),En(h);var F={width:w,height:x};return{dimensions:F,element:D}};function nc(n){if("fontSize"in n&&"lineHeight"in n)return n.lineHeight*parseInt(n.fontSize,10)}var ic=12,rc=1.2,oc=30;function mo(n){var e=Y({fontFamily:"Arial, sans-serif",fontSize:ic,fontWeight:"normal",lineHeight:rc},n&&n.defaultStyle||{}),t=parseInt(e.fontSize,10)-1,i=Y({},e,{fontSize:t},n&&n.externalStyle||{}),r=new Qn({style:e});this.getExternalLabelBounds=function(o,l){var u=r.getDimensions(l,{box:{width:90,height:30},style:i});return{x:Math.round(o.x+o.width/2-u.width/2),y:Math.round(o.y),width:Math.ceil(u.width),height:Math.ceil(u.height)}},this.getTextAnnotationBounds=function(o,l){var u=r.getDimensions(l,{box:o,style:e,align:"left-top",padding:5});return{x:o.x,y:o.y,width:o.width,height:Math.max(oc,Math.round(u.height))}},this.createText=function(o,l){return r.createText(o,l||{})},this.getDefaultStyle=function(){return e},this.getExternalStyle=function(){return i}}mo.$inject=["config.textRenderer"];function sc(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var i=this.pathMap[e],r,o;t.abspos?(r=t.abspos.x,o=t.abspos.y):(r=t.containerWidth*t.position.mx,o=t.containerHeight*t.position.my);var l={};if(t.position){for(var u=t.containerHeight/i.height*t.yScaleFactor,c=t.containerWidth/i.width*t.xScaleFactor,f=0;f<i.heightElements.length;f++)l["y"+f]=i.heightElements[f]*u;for(var d=0;d<i.widthElements.length;d++)l["x"+d]=i.widthElements[d]*c}var h=cc(i.d,{mx:r,my:o,e:l});return h}}var ac=/\{([^{}]+)\}/g,lc=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;function uc(n,e,t){var i=t;return e.replace(lc,function(r,o,l,u,c){o=o||u,i&&(o in i&&(i=i[o]),typeof i=="function"&&c&&(i=i()))}),i=(i==null||i==t?n:i)+"",i}function cc(n,e){return String(n).replace(ac,function(t,i){return uc(t,i,e)})}const fc={__init__:["bpmnRenderer"],bpmnRenderer:["type",Dt],textRenderer:["type",mo],pathMap:["type",sc]};function dc(n,e){return e=e||{},n.replace(/{([^}]+)}/g,function(t,i){return e[i]||"{"+i+"}"})}const go={translate:["value",dc]};function pc(n){return{x:Math.round(n.x),y:Math.round(n.y)}}function Ji(n){return{top:n.y,right:n.x+(n.width||0),bottom:n.y+(n.height||0),left:n.x}}function hc(n){return{x:n.left,y:n.top,width:n.right-n.left,height:n.bottom-n.top}}function mc(n){return pc({x:n.x+(n.width||0)/2,y:n.y+(n.height||0)/2})}function gc(n){for(var e=n.waypoints,t=e.reduce(function(f,d,h){var g=e[h-1];if(g){var x=f[f.length-1],w=x&&x.endLength||0,b=yc(g,d);f.push({start:g,end:d,startLength:w,endLength:w+b,length:b})}return f},[]),i=t.reduce(function(f,d){return f+d.length},0),r=i/2,o=0,l=t[o];l.endLength<r;)l=t[++o];var u=(r-l.startLength)/l.length,c={x:l.start.x+(l.end.x-l.start.x)*u,y:l.start.y+(l.end.y-l.start.y)*u};return c}function Zi(n){return Wl(n)?gc(n):mc(n)}function yc(n,e){return Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2))}function Re(n){return n?"<"+n.$type+(n.id?' id="'+n.id:"")+'" />':"<null>"}function jn(n,e,t){return Y({id:n.id,type:n.$type,businessObject:n,di:e},t)}function vc(n,e,t){var i=n.waypoint;return!i||i.length<2?[Zi(e),Zi(t)]:i.map(function(r){return{x:r.x,y:r.y}})}function yo(n,e,t,i){return new Error(n("element {element} referenced by {referenced}#{property} not yet drawn",{element:Re(t),referenced:Re(e),property:i}))}function ft(n,e,t,i,r,o){this._eventBus=n,this._canvas=e,this._elementFactory=t,this._elementRegistry=i,this._translate=r,this._textRenderer=o}ft.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate","textRenderer"],ft.prototype.add=function(n,e,t){var i,r=this._translate,o,l;if(K(e,"bpmndi:BPMNPlane")){var u=K(n,"bpmn:SubProcess")?{id:n.id+"_plane"}:{};i=this._elementFactory.createRoot(jn(n,e,u)),this._canvas.addRootElement(i)}else if(K(e,"bpmndi:BPMNShape")){var c=!Fi(n,e),f=xc(n);o=t&&(t.hidden||t.collapsed);var d=e.bounds;i=this._elementFactory.createShape(jn(n,e,{collapsed:c,hidden:o,x:Math.round(d.x),y:Math.round(d.y),width:Math.round(d.width),height:Math.round(d.height),isFrame:f})),K(n,"bpmn:BoundaryEvent")&&this._attachBoundary(n,i),K(n,"bpmn:Lane")&&(l=0),K(n,"bpmn:DataStoreReference")&&(_c(t,Zi(d))||(t=this._canvas.findRoot(t))),this._canvas.addShape(i,t,l)}else if(K(e,"bpmndi:BPMNEdge")){var h=this._getSource(n),g=this._getTarget(n);o=t&&(t.hidden||t.collapsed),i=this._elementFactory.createConnection(jn(n,e,{hidden:o,source:h,target:g,waypoints:vc(e,h,g)})),K(n,"bpmn:DataAssociation")&&(t=this._canvas.findRoot(t)),this._canvas.addConnection(i,t,l)}else throw new Error(r("unknown di {di} for element {semantic}",{di:Re(e),semantic:Re(n)}));return zl(n)&&Hn(i)&&this.addLabel(n,e,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},ft.prototype._attachBoundary=function(n,e){var t=this._translate,i=n.attachedToRef;if(!i)throw new Error(t("missing {semantic}#attachedToRef",{semantic:Re(n)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw yo(t,n,i,"attachedToRef");e.host=r,o||(r.attachers=o=[]),o.indexOf(e)===-1&&o.push(e)},ft.prototype.addLabel=function(n,e,t){var i,r,o;return i=Zl(e,t),r=Hn(t),r&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(jn(n,e,{id:n.id+"_label",labelTarget:t,type:"label",hidden:t.hidden||!Hn(t),x:Math.round(i.x),y:Math.round(i.y),width:Math.round(i.width),height:Math.round(i.height)})),this._canvas.addShape(o,t.parent)},ft.prototype._getConnectedElement=function(n,e){var t,i,r=n.$type,o=this._translate;if(i=n[e+"Ref"],e==="source"&&r==="bpmn:DataInputAssociation"&&(i=i&&i[0]),(e==="source"&&r==="bpmn:DataOutputAssociation"||e==="target"&&r==="bpmn:DataInputAssociation")&&(i=n.$parent),t=i&&this._getElement(i),t)return t;throw i?yo(o,n,i,e+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:Re(n),side:e}))},ft.prototype._getSource=function(n){return this._getConnectedElement(n,"source")},ft.prototype._getTarget=function(n){return this._getConnectedElement(n,"target")},ft.prototype._getElement=function(n){return this._elementRegistry.get(n.id)};function _c(n,e){var t=e.x,i=e.y;return t>=n.x&&t<=n.x+n.width&&i>=n.y&&i<=n.y+n.height}function xc(n){return K(n,"bpmn:Group")}const Cc={__depends__:[fc,{__depends__:[go],bpmnImporter:["type",ft]}]};function Xi(n){return n.originalEvent||n.srcEvent}function Ec(){return/mac/i.test(navigator.platform)}function vo(n,e){return(Xi(n)||n).button===e}function An(n){return vo(n,0)}function Tc(n){return vo(n,1)}function wc(n){var e=Xi(n)||n;return An(n)?Ec()?e.metaKey:e.ctrlKey:!1}function Sc(n){var e=Xi(n)||n;return An(n)&&e.shiftKey}function Ac(n){return!0}function ei(n){return An(n)||Tc(n)}var _o=500;function xo(n,e,t){var i=this;function r(M,C,P){if(!u(M,C)){var O,U,$;P?U=e.getGraphics(P):(O=C.delegateTarget||C.target,O&&(U=O,P=e.get(U))),!(!U||!P)&&($=n.fire(M,{element:P,gfx:U,originalEvent:C}),$===!1&&(C.stopPropagation(),C.preventDefault()))}}var o={};function l(M){return o[M]}function u(M,C){var P=f[M]||An;return!P(C)}var c={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},f={"element.contextmenu":Ac,"element.mousedown":ei,"element.mouseup":ei,"element.click":ei,"element.dblclick":ei};function d(M,C,P){var O=c[M];if(!O)throw new Error("unmapped DOM event name <"+M+">");return r(O,C,P)}var h="svg, .djs-element";function g(M,C,P,O){var U=o[P]=function($){r(P,$)};O&&(f[P]=O),U.$delegate=Yi.bind(M,h,C,U)}function x(M,C,P){var O=l(P);O&&Yi.unbind(M,C,O.$delegate)}function w(M){q(c,function(C,P){g(M,P,C)})}function b(M){q(c,function(C,P){x(M,P,C)})}n.on("canvas.destroy",function(M){b(M.svg)}),n.on("canvas.init",function(M){w(M.svg)}),n.on(["shape.added","connection.added"],function(M){var C=M.element,P=M.gfx;n.fire("interactionEvents.createHit",{element:C,gfx:P})}),n.on(["shape.changed","connection.changed"],_o,function(M){var C=M.element,P=M.gfx;n.fire("interactionEvents.updateHit",{element:C,gfx:P})}),n.on("interactionEvents.createHit",_o,function(M){var C=M.element,P=M.gfx;i.createDefaultHit(C,P)}),n.on("interactionEvents.updateHit",function(M){var C=M.element,P=M.gfx;i.updateDefaultHit(C,P)});var D=S("djs-hit djs-hit-stroke"),F=S("djs-hit djs-hit-click-stroke"),T=S("djs-hit djs-hit-all"),k=S("djs-hit djs-hit-no-move"),A={all:T,"click-stroke":F,stroke:D,"no-move":k};function S(M,C){return C=Y({stroke:"white",strokeWidth:15},C||{}),t.cls(M,["no-fill","no-border"],C)}function I(M,C){var P=A[C];if(!P)throw new Error("invalid hit type <"+C+">");return le(M,P),M}function R(M,C){_e(M,C)}this.removeHits=function(M){var C=Ou(".djs-hit",M);q(C,En)},this.createDefaultHit=function(M,C){var P=M.waypoints,O=M.isFrame,U;return P?this.createWaypointsHit(C,P):(U=O?"stroke":"all",this.createBoxHit(C,U,{width:M.width,height:M.height}))},this.createWaypointsHit=function(M,C){var P=qi(C);return I(P,"stroke"),R(M,P),P},this.createBoxHit=function(M,C,P){P=Y({x:0,y:0},P);var O=de("rect");return I(O,C),le(O,P),R(M,O),O},this.updateDefaultHit=function(M,C){var P=Ze(".djs-hit",C);if(P)return M.waypoints?oo(P,M.waypoints):le(P,{width:M.width,height:M.height}),P},this.fire=r,this.triggerMouseEvent=d,this.mouseHandler=l,this.registerEvent=g,this.unregisterEvent=x}xo.$inject=["eventBus","elementRegistry","styles"];const bc={__init__:["interactionEvents"],interactionEvents:["type",xo]};function Lt(n,e){e=!!e,Ke(n)||(n=[n]);var t,i,r,o;return q(n,function(l){var u=l;l.waypoints&&!e&&(u=Lt(l.waypoints,!0));var c=u.x,f=u.y,d=u.height||0,h=u.width||0;(c<t||t===void 0)&&(t=c),(f<i||i===void 0)&&(i=f),(c+h>r||r===void 0)&&(r=c+h),(f+d>o||o===void 0)&&(o=f+d)}),{x:t,y:i,height:o-i,width:r-t}}function Co(n){return"waypoints"in n?"connection":"x"in n?"shape":"root"}function Eo(n){return!!(n&&n.isFrame)}var Rc=500,Mc=1e3;function Ft(n,e){this._eventBus=n,this.offset=5;var t=e.cls("djs-outline",["no-fill"]),i=this;function r(o){var l=de("rect");return le(l,Y({x:0,y:0,rx:4,width:100,height:100},t)),l}n.on(["shape.added","shape.changed"],Rc,function(o){var l=o.element,u=o.gfx,c=Ze(".djs-outline",u);c||(c=i.getOutline(l)||r(),_e(u,c)),i.updateShapeOutline(c,l)}),n.on(["connection.added","connection.changed"],function(o){var l=o.element,u=o.gfx,c=Ze(".djs-outline",u);c||(c=r(),_e(u,c)),i.updateConnectionOutline(c,l)})}Ft.prototype.updateShapeOutline=function(n,e){var t=!1,i=this._getProviders();i.length&&q(i,function(r){t=t||r.updateOutline(e,n)}),t||le(n,{x:-this.offset,y:-this.offset,width:e.width+this.offset*2,height:e.height+this.offset*2})},Ft.prototype.updateConnectionOutline=function(n,e){var t=Lt(e);le(n,{x:t.x-this.offset,y:t.y-this.offset,width:t.width+this.offset*2,height:t.height+this.offset*2})},Ft.prototype.registerProvider=function(n,e){e||(e=n,n=Mc),this._eventBus.on("outline.getProviders",n,function(t){t.providers.push(e)})},Ft.prototype._getProviders=function(){var n=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(n),n.providers},Ft.prototype.getOutline=function(n){var e,t=this._getProviders();return q(t,function(i){yt(i.getOutline)&&(e=e||i.getOutline(n))}),e},Ft.$inject=["eventBus","styles","elementRegistry"];const Ic={__init__:["outline"],outline:["type",Ft]};function Zt(n,e){this._eventBus=n,this._canvas=e,this._selectedElements=[];var t=this;n.on(["shape.remove","connection.remove"],function(i){var r=i.element;t.deselect(r)}),n.on(["diagram.clear","root.set"],function(i){t.select(null)})}Zt.$inject=["eventBus","canvas"],Zt.prototype.deselect=function(n){var e=this._selectedElements,t=e.indexOf(n);if(t!==-1){var i=e.slice();e.splice(t,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:e})}},Zt.prototype.get=function(){return this._selectedElements},Zt.prototype.isSelected=function(n){return this._selectedElements.indexOf(n)!==-1},Zt.prototype.select=function(n,e){var t=this._selectedElements,i=t.slice();Ke(n)||(n=n?[n]:[]);var r=this._canvas,o=r.getRootElement();n=n.filter(function(l){var u=r.findRoot(l);return o===u}),e?q(n,function(l){t.indexOf(l)===-1&&t.push(l)}):this._selectedElements=t=n.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})};var To="hover",wo="selected",ti=6;function Qi(n,e,t){this._canvas=n;var i=this;this._multiSelectionBox=null;function r(l,u){n.addMarker(l,u)}function o(l,u){n.removeMarker(l,u)}e.on("element.hover",function(l){r(l.element,To)}),e.on("element.out",function(l){o(l.element,To)}),e.on("selection.changed",function(l){function u(h){o(h,wo)}function c(h){r(h,wo)}var f=l.oldSelection,d=l.newSelection;q(f,function(h){d.indexOf(h)===-1&&u(h)}),q(d,function(h){f.indexOf(h)===-1&&c(h)}),i._updateSelectionOutline(d)}),e.on("element.changed",function(l){t.isSelected(l.element)&&i._updateSelectionOutline(t.get())})}Qi.$inject=["canvas","eventBus","selection"],Qi.prototype._updateSelectionOutline=function(n){var e=this._canvas.getLayer("selectionOutline");ru(e);var t=n.length>1,i=this._canvas.getContainer();if(Oe(i)[t?"add":"remove"]("djs-multi-select"),!!t){var r=Pc(Lt(n)),o=de("rect");le(o,Y({rx:3},r)),Oe(o).add("djs-selection-outline"),_e(e,o)}};function Pc(n){return{x:n.x-ti,y:n.y-ti,width:n.width+ti*2,height:n.height+ti*2}}function So(n,e,t,i){n.on("create.end",500,function(r){var o=r.context,l=o.canExecute,u=o.elements,c=o.hints||{},f=c.autoSelect;if(l){if(f===!1)return;Ke(f)?e.select(f):e.select(u.filter(kc))}}),n.on("connect.end",500,function(r){var o=r.context,l=o.connection;l&&e.select(l)}),n.on("shape.move.end",500,function(r){var o=r.previousSelection||[],l=i.get(r.context.shape.id),u=Je(o,function(c){return l.id===c.id});u||e.select(l)}),n.on("element.click",function(r){if(An(r)){var o=r.element;o===t.getRootElement()&&(o=null);var l=e.isSelected(o),u=e.get().length>1,c=wc(r)||Sc(r);if(l&&u)return c?e.deselect(o):e.select(o);l?e.deselect(o):e.select(o,c)}})}So.$inject=["eventBus","selection","canvas","elementRegistry"];function kc(n){return!n.hidden}const Nc={__init__:["selectionVisuals","selectionBehavior"],__depends__:[bc,Ic],selection:["type",Zt],selectionVisuals:["type",Qi],selectionBehavior:["type",So]};function Ao(n){this._counter=0,this._prefix=(n?n+"-":"")+Math.floor(Math.random()*1e9)+"-"}Ao.prototype.next=function(){return this._prefix+ ++this._counter};var Dc=new Ao("ov"),Lc=500;function Se(n,e,t,i){this._eventBus=e,this._canvas=t,this._elementRegistry=i,this._ids=Dc,this._overlayDefaults=Y({show:null,scale:!0},n&&n.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=Fc(t.getContainer()),this._init()}Se.$inject=["config.overlays","eventBus","canvas","elementRegistry"],Se.prototype.get=function(n){if(tt(n)&&(n={id:n}),tt(n.element)&&(n.element=this._elementRegistry.get(n.element)),n.element){var e=this._getOverlayContainer(n.element,!0);return e?n.type?zt(e.overlays,Jr({type:n.type})):e.overlays.slice():[]}else return n.type?zt(this._overlays,Jr({type:n.type})):n.id?this._overlays[n.id]:null},Se.prototype.add=function(n,e,t){if(kt(e)&&(t=e,e=null),n.id||(n=this._elementRegistry.get(n)),!t.position)throw new Error("must specifiy overlay position");if(!t.html)throw new Error("must specifiy overlay html");if(!n)throw new Error("invalid element specified");var i=this._ids.next();return t=Y({},this._overlayDefaults,t,{id:i,type:e,element:n,html:t.html}),this._addOverlay(t),i},Se.prototype.remove=function(n){var e=this.get(n)||[];Ke(e)||(e=[e]);var t=this;q(e,function(i){var r=t._getOverlayContainer(i.element,!0);if(i&&(Zn(i.html),Zn(i.htmlContainer),delete i.htmlContainer,delete i.element,delete t._overlays[i.id]),r){var o=r.overlays.indexOf(i);o!==-1&&r.overlays.splice(o,1)}})},Se.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"},Se.prototype.show=function(){ni(this._overlayRoot)},Se.prototype.hide=function(){ni(this._overlayRoot,!1)},Se.prototype.clear=function(){this._overlays={},this._overlayContainers=[],ao(this._overlayRoot)},Se.prototype._updateOverlayContainer=function(n){var e=n.element,t=n.html,i=e.x,r=e.y;if(e.waypoints){var o=Lt(e);i=o.x,r=o.y}bo(t,i,r),Iu(n.html,"data-container-id",e.id)},Se.prototype._updateOverlay=function(n){var e=n.position,t=n.htmlContainer,i=n.element,r=e.left,o=e.top;if(e.right!==void 0){var l;i.waypoints?l=Lt(i).width:l=i.width,r=e.right*-1+l}if(e.bottom!==void 0){var u;i.waypoints?u=Lt(i).height:u=i.height,o=e.bottom*-1+u}bo(t,r||0,o||0),this._updateOverlayVisibilty(n,this._canvas.viewbox())},Se.prototype._createOverlayContainer=function(n){var e=it('<div class="djs-overlays" />');Ve(e,{position:"absolute"}),this._overlayRoot.appendChild(e);var t={html:e,element:n,overlays:[]};return this._updateOverlayContainer(t),this._overlayContainers.push(t),t},Se.prototype._updateRoot=function(n){var e=n.scale||1,t="matrix("+[e,0,0,e,-1*n.x*e,-1*n.y*e].join(",")+")";Ro(this._overlayRoot,t)},Se.prototype._getOverlayContainer=function(n,e){var t=Je(this._overlayContainers,function(i){return i.element===n});return!t&&!e?this._createOverlayContainer(n):t},Se.prototype._addOverlay=function(n){var e=n.id,t=n.element,i=n.html,r,o;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),tt(i)&&(i=it(i)),o=this._getOverlayContainer(t),r=it('<div class="djs-overlay" data-overlay-id="'+e+'">'),Ve(r,{position:"absolute"}),r.appendChild(i),n.type&&zn(r).add("djs-overlay-"+n.type);var l=this._canvas.findRoot(t),u=this._canvas.getRootElement();ni(r,l===u),n.htmlContainer=r,o.overlays.push(n),o.html.appendChild(r),this._overlays[e]=n,this._updateOverlay(n),this._updateOverlayVisibilty(n,this._canvas.viewbox())},Se.prototype._updateOverlayVisibilty=function(n,e){var t=n.show,i=this._canvas.findRoot(n.element),r=t&&t.minZoom,o=t&&t.maxZoom,l=n.htmlContainer,u=this._canvas.getRootElement(),c=!0;(i!==u||t&&(Wt(r)&&r>e.scale||Wt(o)&&o<e.scale))&&(c=!1),ni(l,c),this._updateOverlayScale(n,e)},Se.prototype._updateOverlayScale=function(n,e){var t=n.scale,i,r,o=n.htmlContainer,l,u="";t!==!0&&(t===!1?(i=1,r=1):(i=t.min,r=t.max),Wt(i)&&e.scale<i&&(l=(1/e.scale||1)*i),Wt(r)&&e.scale>r&&(l=(1/e.scale||1)*r)),Wt(l)&&(u="scale("+l+","+l+")"),Ro(o,u)},Se.prototype._updateOverlaysVisibilty=function(n){var e=this;q(this._overlays,function(t){e._updateOverlayVisibilty(t,n)})},Se.prototype._init=function(){var n=this._eventBus,e=this;function t(i){e._updateRoot(i),e._updateOverlaysVisibilty(i),e.show()}n.on("canvas.viewbox.changing",function(i){e.hide()}),n.on("canvas.viewbox.changed",function(i){t(i.viewbox)}),n.on(["shape.remove","connection.remove"],function(i){var r=i.element,o=e.get({element:r});q(o,function(c){e.remove(c.id)});var l=e._getOverlayContainer(r);if(l){Zn(l.html);var u=e._overlayContainers.indexOf(l);u!==-1&&e._overlayContainers.splice(u,1)}}),n.on("element.changed",Lc,function(i){var r=i.element,o=e._getOverlayContainer(r,!0);o&&(q(o.overlays,function(l){e._updateOverlay(l)}),e._updateOverlayContainer(o))}),n.on("element.marker.update",function(i){var r=e._getOverlayContainer(i.element,!0);r&&zn(r.html)[i.add?"add":"remove"](i.marker)}),n.on("root.set",function(){e._updateOverlaysVisibilty(e._canvas.viewbox())}),n.on("diagram.clear",this.clear,this)};function Fc(n){var e=it('<div class="djs-overlay-container" />');return Ve(e,{position:"absolute",width:0,height:0}),n.insertBefore(e,n.firstChild),e}function bo(n,e,t){Ve(n,{left:e+"px",top:t+"px"})}function ni(n,e){n.style.display=e===!1?"none":""}function Ro(n,e){n.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(t){n.style[t+"transform"]=e})}const Mo={__init__:["overlays"],overlays:["type",Se]};function Io(n,e,t,i){n.on("element.changed",function(r){var o=r.element;(o.parent||o===e.getRootElement())&&(r.gfx=t.getGraphics(o)),r.gfx&&n.fire(Co(o)+".changed",r)}),n.on("elements.changed",function(r){var o=r.elements;o.forEach(function(l){n.fire("element.changed",{element:l})}),i.updateContainments(o)}),n.on("shape.changed",function(r){i.update("shape",r.element,r.gfx)}),n.on("connection.changed",function(r){i.update("connection",r.element,r.gfx)})}Io.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];const Vc={__init__:["changeSupport"],changeSupport:["type",Io]};var Bc=1e3;function Pe(n){this._eventBus=n}Pe.$inject=["eventBus"];function Oc(n,e){return function(t){return n.call(e||null,t.context,t.command,t)}}Pe.prototype.on=function(n,e,t,i,r,o){if((yt(e)||gt(e))&&(o=r,r=i,i=t,t=e,e=null),yt(t)&&(o=r,r=i,i=t,t=Bc),kt(r)&&(o=r,r=!1),!yt(i))throw new Error("handlerFn must be a function");Ke(n)||(n=[n]);var l=this._eventBus;q(n,function(u){var c=["commandStack",u,e].filter(function(f){return f}).join(".");l.on(c,t,r?Oc(i,o):i,o)})},Pe.prototype.canExecute=dt("canExecute"),Pe.prototype.preExecute=dt("preExecute"),Pe.prototype.preExecuted=dt("preExecuted"),Pe.prototype.execute=dt("execute"),Pe.prototype.executed=dt("executed"),Pe.prototype.postExecute=dt("postExecute"),Pe.prototype.postExecuted=dt("postExecuted"),Pe.prototype.revert=dt("revert"),Pe.prototype.reverted=dt("reverted");function dt(n){return function(t,i,r,o,l){(yt(t)||gt(t))&&(l=o,o=r,r=i,i=t,t=null),this.on(t,n,i,r,o,l)}}function ji(n,e){e.invoke(Pe,this),this.executed(function(t){var i=t.context;i.rootElement?n.setRootElement(i.rootElement):i.rootElement=n.getRootElement()}),this.revert(function(t){var i=t.context;i.rootElement&&n.setRootElement(i.rootElement)})}et(ji,Pe),ji.$inject=["canvas","injector"];const Uc={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",ji]};var $c={"&":"&","<":"<",">":">",'"':""","'":"'"};function Gc(n){return n=""+n,n&&n.replace(/[&<>"']/g,function(e){return $c[e]})}var qc="_plane";function er(n){var e=n.id;return K(n,"bpmn:SubProcess")?Hc(e):e}function Hc(n){return n+qc}var Wc="bjs-breadcrumbs-shown";function Po(n,e,t){var i=it('<ul class="bjs-breadcrumbs"></ul>'),r=t.getContainer(),o=zn(r);r.appendChild(i);var l=[];n.on("element.changed",function(c){var f=c.element,d=ve(f),h=Je(l,function(g){return g===d});h&&u()});function u(c){c&&(l=zc(c));var f=l.map(function(h){var g=Gc(h.name||h.id),x=it('<li><span class="bjs-crumb"><a title="'+g+'">'+g+"</a></span></li>"),w=t.findRoot(er(h))||t.findRoot(h.id);if(!w&&K(h,"bpmn:Process")){var b=e.find(function(D){var F=ve(D);return F&&F.get("processRef")&&F.get("processRef")===h});w=t.findRoot(b.id)}return x.addEventListener("click",function(){t.setRootElement(w)}),x});i.innerHTML="";var d=f.length>1;o.toggle(Wc,d),f.forEach(function(h){i.appendChild(h)})}n.on("root.set",function(c){u(c.element)})}Po.$inject=["eventBus","elementRegistry","canvas"];function zc(n){for(var e=ve(n),t=[],i=e;i;i=i.$parent)(K(i,"bpmn:SubProcess")||K(i,"bpmn:Process"))&&t.push(i);return t.reverse()}function ko(n,e){var t=null,i=new Yc;n.on("root.set",function(r){var o=r.element,l=e.viewbox(),u=i.get(o);if(i.set(t,{x:l.x,y:l.y,zoom:l.scale}),t=o,!(K(o,"bpmn:Collaboration")&&!u)){u=u||{x:0,y:0,zoom:1};var c=(l.x-u.x)*l.scale,f=(l.y-u.y)*l.scale;(c!==0||f!==0)&&e.scroll({dx:c,dy:f}),u.zoom!==l.scale&&e.zoom(u.zoom,{x:0,y:0})}}),n.on("diagram.clear",function(){i.clear(),t=null})}ko.$inject=["eventBus","canvas"];function Yc(){this._entries=[],this.set=function(n,e){var t=!1;for(var i in this._entries)if(this._entries[i][0]===n){this._entries[i][1]=e,t=!0;break}t||this._entries.push([n,e])},this.get=function(n){for(var e in this._entries)if(this._entries[e][0]===n)return this._entries[e][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(n){var e=-1;for(var t in this._entries)if(this._entries[t][0]===n){e=t;break}e!==-1&&this._entries.splice(e,1)}}var No={x:180,y:160};function Vt(n,e){this._eventBus=n,this._moddle=e;var t=this;n.on("import.render.start",1500,function(i,r){t._handleImport(r.definitions)})}Vt.prototype._handleImport=function(n){if(n.diagrams){var e=this;this._definitions=n,this._processToDiagramMap={},n.diagrams.forEach(function(i){!i.plane||!i.plane.bpmnElement||(e._processToDiagramMap[i.plane.bpmnElement.id]=i)});var t=[];n.diagrams.forEach(function(i){var r=e._createNewDiagrams(i.plane);Array.prototype.push.apply(t,r)}),t.forEach(function(i){e._movePlaneElementsToOrigin(i.plane)})}},Vt.prototype._createNewDiagrams=function(n){var e=this,t=[],i=[];n.get("planeElement").forEach(function(o){var l=o.bpmnElement;if(l){var u=l.$parent;K(l,"bpmn:SubProcess")&&!o.isExpanded&&t.push(l),Jc(l,n)&&i.push({diElement:o,parent:u})}});var r=[];return t.forEach(function(o){if(!e._processToDiagramMap[o.id]){var l=e._createDiagram(o);e._processToDiagramMap[o.id]=l,r.push(l)}}),i.forEach(function(o){for(var l=o.diElement,u=o.parent;u&&t.indexOf(u)===-1;)u=u.$parent;if(u){var c=e._processToDiagramMap[u.id];e._moveToDiPlane(l,c.plane)}}),r},Vt.prototype._movePlaneElementsToOrigin=function(n){var e=n.get("planeElement"),t=Kc(n),i={x:t.x-No.x,y:t.y-No.y};e.forEach(function(r){r.waypoint?r.waypoint.forEach(function(o){o.x=o.x-i.x,o.y=o.y-i.y}):r.bounds&&(r.bounds.x=r.bounds.x-i.x,r.bounds.y=r.bounds.y-i.y)})},Vt.prototype._moveToDiPlane=function(n,e){var t=Do(n),i=t.plane.get("planeElement");i.splice(i.indexOf(n),1),e.get("planeElement").push(n)},Vt.prototype._createDiagram=function(n){var e=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:n}),t=this._moddle.create("bpmndi:BPMNDiagram",{plane:e});return e.$parent=t,e.bpmnElement=n,t.$parent=this._definitions,this._definitions.diagrams.push(t),t},Vt.$inject=["eventBus","moddle"];function Do(n){return K(n,"bpmndi:BPMNDiagram")?n:Do(n.$parent)}function Kc(n){var e={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return n.planeElement.forEach(function(t){if(t.bounds){var i=Ji(t.bounds);e.top=Math.min(i.top,e.top),e.left=Math.min(i.left,e.left)}}),hc(e)}function Jc(n,e){var t=n.$parent;return!(!K(t,"bpmn:SubProcess")||t===e.bpmnElement||ql(n,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))}var ii=250,Zc='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg>',Xc="bjs-drilldown-empty";function Ct(n,e,t,i){Pe.call(this,e),this._canvas=n,this._eventBus=e,this._elementRegistry=t,this._overlays=i;var r=this;this.executed("shape.toggleCollapse",ii,function(o){var l=o.shape;r._canDrillDown(l)?r._addOverlay(l):r._removeOverlay(l)},!0),this.reverted("shape.toggleCollapse",ii,function(o){var l=o.shape;r._canDrillDown(l)?r._addOverlay(l):r._removeOverlay(l)},!0),this.executed(["shape.create","shape.move","shape.delete"],ii,function(o){var l=o.oldParent,u=o.newParent||o.parent,c=o.shape;r._canDrillDown(c)&&r._addOverlay(c),r._updateDrilldownOverlay(l),r._updateDrilldownOverlay(u),r._updateDrilldownOverlay(c)},!0),this.reverted(["shape.create","shape.move","shape.delete"],ii,function(o){var l=o.oldParent,u=o.newParent||o.parent,c=o.shape;r._canDrillDown(c)&&r._addOverlay(c),r._updateDrilldownOverlay(l),r._updateDrilldownOverlay(u),r._updateDrilldownOverlay(c)},!0),e.on("import.render.complete",function(){t.filter(function(o){return r._canDrillDown(o)}).map(function(o){r._addOverlay(o)})})}et(Ct,Pe),Ct.prototype._updateDrilldownOverlay=function(n){var e=this._canvas;if(n){var t=e.findRoot(n);t&&this._updateOverlayVisibility(t)}},Ct.prototype._canDrillDown=function(n){var e=this._canvas;return K(n,"bpmn:SubProcess")&&e.findRoot(er(n))},Ct.prototype._updateOverlayVisibility=function(n){var e=this._overlays,t=ve(n),i=e.get({element:t.id,type:"drilldown"})[0];if(i){var r=t&&t.get("flowElements")&&t.get("flowElements").length;zn(i.html).toggle(Xc,!r)}},Ct.prototype._addOverlay=function(n){var e=this._canvas,t=this._overlays,i=t.get({element:n,type:"drilldown"});i.length&&this._removeOverlay(n);var r=it('<button class="bjs-drilldown">'+Zc+"</button>");r.addEventListener("click",function(){e.setRootElement(e.findRoot(er(n)))}),t.add(n,"drilldown",{position:{bottom:-7,right:-8},html:r}),this._updateOverlayVisibility(n)},Ct.prototype._removeOverlay=function(n){var e=this._overlays;e.remove({element:n,type:"drilldown"})},Ct.$inject=["canvas","eventBus","elementRegistry","overlays"];const Qc={__depends__:[Mo,Vc,Uc],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",Po],drilldownCentering:["type",ko],drilldownOverlayBehavior:["type",Ct],subprocessCompatibility:["type",Vt]},jc=/^class[ {]/;function ef(n){return jc.test(n.toString())}function tr(n){return Array.isArray(n)}function nr(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function ri(...n){n.length===1&&tr(n[0])&&(n=n[0]),n=[...n];const e=n.pop();return e.$inject=n,e}const tf=/constructor\s*[^(]*\(\s*([^)]*)\)/m,nf=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,rf=/\/\*([^*]*)\*\//m;function of(n){if(typeof n!="function")throw new Error(`Cannot annotate "${n}". Expected a function!`);const e=n.toString().match(ef(n)?tf:nf);if(!e)return[];const t=e[1]||e[2];return t&&t.split(",").map(i=>{const r=i.match(rf);return(r&&r[1]||i).trim()})||[]}function Lo(n,e){e=e||{get:function(T,k){if(t.push(T),k===!1)return null;throw l(`No provider for "${T}"!`)}};const t=[],i=this._providers=Object.create(e._providers||null),r=this._instances=Object.create(null),o=r.injector=this,l=function(T){const k=t.join(" -> ");return t.length=0,new Error(k?`${T} (Resolving: ${k})`:T)};function u(T,k){if(!i[T]&&T.indexOf(".")!==-1){const A=T.split(".");let S=u(A.shift());for(;A.length;)S=S[A.shift()];return S}if(nr(r,T))return r[T];if(nr(i,T)){if(t.indexOf(T)!==-1)throw t.push(T),l("Cannot resolve circular dependency!");return t.push(T),r[T]=i[T][0](i[T][1]),t.pop(),r[T]}return e.get(T,k)}function c(T,k){if(typeof k>"u"&&(k={}),typeof T!="function")if(tr(T))T=ri(T.slice());else throw l(`Cannot invoke "${T}". Expected a function!`);const S=(T.$inject||of(T)).map(I=>nr(k,I)?k[I]:u(I));return{fn:T,dependencies:S}}function f(T){const{fn:k,dependencies:A}=c(T),S=Function.prototype.bind.apply(k,[null].concat(A));return new S}function d(T,k,A){const{fn:S,dependencies:I}=c(T,A);return S.apply(k,I)}function h(T){return ri(k=>T.get(k))}function g(T,k){if(k&&k.length){const A=Object.create(null),S=Object.create(null),I=[],R=[],M=[];let C,P,O,U;for(let $ in i)C=i[$],k.indexOf($)!==-1&&(C[2]==="private"?(P=I.indexOf(C[3]),P===-1?(O=C[3].createChild([],k),U=h(O),I.push(C[3]),R.push(O),M.push(U),A[$]=[U,$,"private",O]):A[$]=[M[P],$,"private",R[P]]):A[$]=[C[2],C[1]],S[$]=!0),(C[2]==="factory"||C[2]==="type")&&C[1].$scope&&k.forEach(te=>{C[1].$scope.indexOf(te)!==-1&&(A[$]=[C[2],C[1]],S[te]=!0)});k.forEach($=>{if(!S[$])throw new Error('No provider for "'+$+'". Cannot use provider from the parent!')}),T.unshift(A)}return new Lo(T,o)}const x={factory:d,type:f,value:function(T){return T}};function w(T,k){const A=T.__init__||[];return function(){A.forEach(S=>{typeof S=="string"?k.get(S):k.invoke(S)})}}function b(T){const k=T.__exports__;if(k){const A=T.__modules__,S=Object.keys(T).reduce((P,O)=>(O!=="__exports__"&&O!=="__modules__"&&O!=="__init__"&&O!=="__depends__"&&(P[O]=T[O]),P),Object.create(null)),I=(A||[]).concat(S),R=g(I),M=ri(function(P){return R.get(P)});k.forEach(function(P){i[P]=[M,P,"private",R]});const C=(T.__init__||[]).slice();return C.unshift(function(){R.init()}),T=Object.assign({},T,{__init__:C}),w(T,R)}return Object.keys(T).forEach(function(A){if(A==="__init__"||A==="__depends__")return;if(T[A][2]==="private"){i[A]=T[A];return}const S=T[A][0],I=T[A][1];i[A]=[x[S],sf(S,I),S]}),w(T,o)}function D(T,k){return T.indexOf(k)!==-1||(T=(k.__depends__||[]).reduce(D,T),T.indexOf(k)!==-1)?T:T.concat(k)}function F(T){const k=T.reduce(D,[]).map(b);let A=!1;return function(){A||(A=!0,k.forEach(S=>S()))}}this.get=u,this.invoke=d,this.instantiate=f,this.createChild=g,this.init=F(n)}function sf(n,e){return n!=="value"&&tr(e)&&(e=ri(e.slice())),e}var af=1;function Et(n,e){ut.call(this,n,af),this.CONNECTION_STYLE=e.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=e.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=e.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}et(Et,ut),Et.prototype.canRender=function(){return!0},Et.prototype.drawShape=function(e,t,i){var r=de("rect");return le(r,{x:0,y:0,width:t.width||0,height:t.height||0}),Eo(t)?le(r,Y({},this.FRAME_STYLE,i||{})):le(r,Y({},this.SHAPE_STYLE,i||{})),_e(e,r),r},Et.prototype.drawConnection=function(e,t,i){var r=qi(t.waypoints,Y({},this.CONNECTION_STYLE,i||{}));return _e(e,r),r},Et.prototype.getShapePath=function(e){var t=e.x,i=e.y,r=e.width,o=e.height,l=[["M",t,i],["l",r,0],["l",0,o],["l",-r,0],["z"]];return Nt(l)},Et.prototype.getConnectionPath=function(e){var t=e.waypoints,i,r,o=[];for(i=0;r=t[i];i++)r=r.original||r,o.push([i===0?"M":"L",r.x,r.y]);return Nt(o)},Et.$inject=["eventBus","styles"];function lf(){var n={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},e=this;this.cls=function(t,i,r){var o=this.style(i,r);return Y(o,{class:t})},this.style=function(t,i){!Ke(t)&&!i&&(i=t,t=[]);var r=Yt(t,function(o,l){return Y(o,n[l]||{})},{});return i?Y(r,i):r},this.computeStyle=function(t,i,r){return Ke(i)||(r=i,i=[]),e.style(i||[],Y({},r,t||{}))}}const uf={__init__:["defaultRenderer"],defaultRenderer:["type",Et],styles:["type",lf]};function cf(n,e){if(!n||!e)return-1;var t=n.indexOf(e);return t!==-1&&n.splice(t,1),t}function ff(n,e,t){if(!(!n||!e)){typeof t!="number"&&(t=-1);var i=n.indexOf(e);if(i!==-1){if(i===t)return;if(t!==-1)n.splice(i,1);else return}t!==-1?n.splice(t,0,e):n.push(e)}}function oi(n,e){return Math.round(n*e)/e}function Fo(n){return gt(n)?n+"px":n}function df(n){for(;n.parent;)n=n.parent;return n}function pf(n){n=Y({},{width:"100%",height:"100%"},n);const e=n.container||document.body,t=document.createElement("div");return t.setAttribute("class","djs-container djs-parent"),Ve(t,{position:"relative",overflow:"hidden",width:Fo(n.width),height:Fo(n.height)}),e.appendChild(t),t}function Vo(n,e,t){const i=de("g");Oe(i).add(e);const r=t!==void 0?t:n.childNodes.length-1;return n.insertBefore(i,n.childNodes[r]||null),i}const hf="base",Bo=0,mf=1,gf={shape:["x","y","width","height"],connection:["waypoints"]};function J(n,e,t,i){this._eventBus=e,this._elementRegistry=i,this._graphicsFactory=t,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._init(n||{})}J.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],J.prototype._init=function(n){const e=this._eventBus,t=this._container=pf(n),i=this._svg=de("svg");le(i,{width:"100%",height:"100%"}),_e(t,i);const r=this._viewport=Vo(i,"viewport");n.deferUpdate&&(this._viewboxChanged=Bl(vt(this._viewboxChanged,this),300)),e.on("diagram.init",()=>{e.fire("canvas.init",{svg:i,viewport:r})}),e.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),e.on("diagram.destroy",500,this._destroy,this),e.on("diagram.clear",500,this._clear,this)},J.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});const n=this._container.parentNode;n&&n.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},J.prototype._clear=function(){this._elementRegistry.getAll().forEach(e=>{const t=Co(e);t==="root"?this.removeRootElement(e):this._removeElement(e,t)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox},J.prototype.getDefaultLayer=function(){return this.getLayer(hf,Bo)},J.prototype.getLayer=function(n,e){if(!n)throw new Error("must specify a name");let t=this._layers[n];if(t||(t=this._layers[n]=this._createLayer(n,e)),typeof e<"u"&&t.index!==e)throw new Error("layer <"+n+"> already created at index <"+e+">");return t.group},J.prototype._getChildIndex=function(n){return Yt(this._layers,function(e,t){return t.visible&&n>=t.index&&e++,e},0)},J.prototype._createLayer=function(n,e){typeof e>"u"&&(e=mf);const t=this._getChildIndex(e);return{group:Vo(this._viewport,"layer-"+n,t),index:e,visible:!0}},J.prototype.showLayer=function(n){if(!n)throw new Error("must specify a name");const e=this._layers[n];if(!e)throw new Error("layer <"+n+"> does not exist");const t=this._viewport,i=e.group,r=e.index;if(e.visible)return i;const o=this._getChildIndex(r);return t.insertBefore(i,t.childNodes[o]||null),e.visible=!0,i},J.prototype.hideLayer=function(n){if(!n)throw new Error("must specify a name");const e=this._layers[n];if(!e)throw new Error("layer <"+n+"> does not exist");const t=e.group;return e.visible&&(En(t),e.visible=!1),t},J.prototype._removeLayer=function(n){const e=this._layers[n];e&&(delete this._layers[n],En(e.group))},J.prototype.getActiveLayer=function(){const n=this._findPlaneForRoot(this.getRootElement());return n?n.layer:null},J.prototype.findRoot=function(n){return typeof n=="string"&&(n=this._elementRegistry.get(n)),n?(this._findPlaneForRoot(df(n))||{}).rootElement:void 0},J.prototype.getRootElements=function(){return this._planes.map(function(n){return n.rootElement})},J.prototype._findPlaneForRoot=function(n){return Je(this._planes,function(e){return e.rootElement===n})},J.prototype.getContainer=function(){return this._container},J.prototype._updateMarker=function(n,e,t){let i;n.id||(n=this._elementRegistry.get(n)),i=this._elementRegistry._elements[n.id],i&&(q([i.gfx,i.secondaryGfx],function(r){r&&(t?Oe(r).add(e):Oe(r).remove(e))}),this._eventBus.fire("element.marker.update",{element:n,gfx:i.gfx,marker:e,add:!!t}))},J.prototype.addMarker=function(n,e){this._updateMarker(n,e,!0)},J.prototype.removeMarker=function(n,e){this._updateMarker(n,e,!1)},J.prototype.hasMarker=function(n,e){n.id||(n=this._elementRegistry.get(n));const t=this.getGraphics(n);return Oe(t).has(e)},J.prototype.toggleMarker=function(n,e){this.hasMarker(n,e)?this.removeMarker(n,e):this.addMarker(n,e)},J.prototype.getRootElement=function(){const n=this._rootElement;return n||this._planes.length?n:this.setRootElement(this.addRootElement(null))},J.prototype.addRootElement=function(n){const e=this._rootsIdx++;n||(n={id:"__implicitroot_"+e,children:[],isImplicit:!0});const t=n.layer="root-"+e;this._ensureValid("root",n);const i=this.getLayer(t,Bo);return this.hideLayer(t),this._addRoot(n,i),this._planes.push({rootElement:n,layer:i}),n},J.prototype.removeRootElement=function(n){if(typeof n=="string"&&(n=this._elementRegistry.get(n)),!!this._findPlaneForRoot(n))return this._removeRoot(n),this._removeLayer(n.layer),this._planes=this._planes.filter(function(t){return t.rootElement!==n}),this._rootElement===n&&(this._rootElement=null),n},J.prototype.setRootElement=function(n){if(n===this._rootElement)return;let e;if(!n)throw new Error("rootElement required");return e=this._findPlaneForRoot(n),e||(n=this.addRootElement(n)),this._setRoot(n),n},J.prototype._removeRoot=function(n){const e=this._elementRegistry,t=this._eventBus;t.fire("root.remove",{element:n}),t.fire("root.removed",{element:n}),e.remove(n)},J.prototype._addRoot=function(n,e){const t=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:n}),t.add(n,e),i.fire("root.added",{element:n,gfx:e})},J.prototype._setRoot=function(n,e){const t=this._rootElement;t&&(this._elementRegistry.updateGraphics(t,null,!0),this.hideLayer(t.layer)),n&&(e||(e=this._findPlaneForRoot(n).layer),this._elementRegistry.updateGraphics(n,this._svg,!0),this.showLayer(n.layer)),this._rootElement=n,this._eventBus.fire("root.set",{element:n})},J.prototype._ensureValid=function(n,e){if(!e.id)throw new Error("element must have an id");if(this._elementRegistry.get(e.id))throw new Error("element <"+e.id+"> already exists");const t=gf[n];if(!Yr(t,function(r){return typeof e[r]<"u"}))throw new Error("must supply { "+t.join(", ")+" } with "+n)},J.prototype._setParent=function(n,e,t){ff(e.children,n,t),n.parent=e},J.prototype._addElement=function(n,e,t,i){t=t||this.getRootElement();const r=this._eventBus,o=this._graphicsFactory;this._ensureValid(n,e),r.fire(n+".add",{element:e,parent:t}),this._setParent(e,t,i);const l=o.create(n,e,i);return this._elementRegistry.add(e,l),o.update(n,e,l),r.fire(n+".added",{element:e,gfx:l}),e},J.prototype.addShape=function(n,e,t){return this._addElement("shape",n,e,t)},J.prototype.addConnection=function(n,e,t){return this._addElement("connection",n,e,t)},J.prototype._removeElement=function(n,e){const t=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(n=t.get(n.id||n),!!n)return r.fire(e+".remove",{element:n}),i.remove(n),cf(n.parent&&n.parent.children,n),n.parent=null,r.fire(e+".removed",{element:n}),t.remove(n),n},J.prototype.removeShape=function(n){return this._removeElement(n,"shape")},J.prototype.removeConnection=function(n){return this._removeElement(n,"connection")},J.prototype.getGraphics=function(n,e){return this._elementRegistry.getGraphics(n,e)},J.prototype._changeViewbox=function(n){this._eventBus.fire("canvas.viewbox.changing"),n.apply(this),this._cachedViewbox=null,this._viewboxChanged()},J.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},J.prototype.viewbox=function(n){if(n===void 0&&this._cachedViewbox)return this._cachedViewbox;const e=this._viewport,t=this.getSize();let i,r,o,l,u,c,f;if(n)this._changeViewbox(function(){u=Math.min(t.width/n.width,t.height/n.height);const d=this._svg.createSVGMatrix().scale(u).translate(-n.x,-n.y);Tn(e,d)});else return o=this._rootElement?this.getActiveLayer():null,i=o&&o.getBBox()||{},l=Tn(e),r=l?l.matrix:au(),u=oi(r.a,1e3),c=oi(-r.e||0,1e3),f=oi(-r.f||0,1e3),n=this._cachedViewbox={x:c?c/u:0,y:f?f/u:0,width:t.width/u,height:t.height/u,scale:u,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:t},n;return n},J.prototype.scroll=function(n){const e=this._viewport;let t=e.getCTM();return n&&this._changeViewbox(function(){n=Y({dx:0,dy:0},n||{}),t=this._svg.createSVGMatrix().translate(n.dx,n.dy).multiply(t),Oo(e,t)}),{x:t.e,y:t.f}},J.prototype.scrollToElement=function(n,e){let t=100;typeof n=="string"&&(n=this._elementRegistry.get(n));const i=this.findRoot(n);if(i!==this.getRootElement()&&this.setRootElement(i),i===n)return;e||(e={}),typeof e=="number"&&(t=e),e={top:e.top||t,right:e.right||t,bottom:e.bottom||t,left:e.left||t};const r=Lt(n),o=Ji(r),l=this.viewbox(),u=this.zoom();let c,f;l.y+=e.top/u,l.x+=e.left/u,l.width-=(e.right+e.left)/u,l.height-=(e.bottom+e.top)/u;const d=Ji(l);if(!(r.width<l.width&&r.height<l.height))c=r.x-l.x,f=r.y-l.y;else{const g=Math.max(0,o.right-d.right),x=Math.min(0,o.left-d.left),w=Math.max(0,o.bottom-d.bottom),b=Math.min(0,o.top-d.top);c=g||x,f=w||b}this.scroll({dx:-c*u,dy:-f*u})},J.prototype.zoom=function(n,e){if(!n)return this.viewbox(n).scale;if(n==="fit-viewport")return this._fitViewport(e);let t,i;return this._changeViewbox(function(){typeof e!="object"&&(t=this.viewbox().outer,e={x:t.width/2,y:t.height/2}),i=this._setZoom(n,e)}),oi(i.a,1e3)};function Oo(n,e){const t="matrix("+e.a+","+e.b+","+e.c+","+e.d+","+e.e+","+e.f+")";n.setAttribute("transform",t)}J.prototype._fitViewport=function(n){const e=this.viewbox(),t=e.outer,i=e.inner;let r,o;return i.x>=0&&i.y>=0&&i.x+i.width<=t.width&&i.y+i.height<=t.height&&!n?o={x:0,y:0,width:Math.max(i.width+i.x,t.width),height:Math.max(i.height+i.y,t.height)}:(r=Math.min(1,t.width/i.width,t.height/i.height),o={x:i.x+(n?i.width/2-t.width/r/2:0),y:i.y+(n?i.height/2-t.height/r/2:0),width:t.width/r,height:t.height/r}),this.viewbox(o),this.viewbox(!1).scale},J.prototype._setZoom=function(n,e){const t=this._svg,i=this._viewport,r=t.createSVGMatrix(),o=t.createSVGPoint();let l,u,c,f,d;c=i.getCTM();const h=c.a;return e?(l=Y(o,e),u=l.matrixTransform(c.inverse()),f=r.translate(u.x,u.y).scale(1/h*n).translate(-u.x,-u.y),d=c.multiply(f)):d=r.scale(n),Oo(this._viewport,d),d},J.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},J.prototype.getAbsoluteBBox=function(n){const e=this.viewbox();let t;n.waypoints?t=this.getGraphics(n).getBBox():t=n;const i=t.x*e.scale-e.x*e.scale,r=t.y*e.scale-e.y*e.scale,o=t.width*e.scale,l=t.height*e.scale;return{x:i,y:r,width:o,height:l}},J.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Xt="data-element-id";function Ue(n){this._elements={},this._eventBus=n}Ue.$inject=["eventBus"],Ue.prototype.add=function(n,e,t){var i=n.id;this._validateId(i),le(e,Xt,i),t&&le(t,Xt,i),this._elements[i]={element:n,gfx:e,secondaryGfx:t}},Ue.prototype.remove=function(n){var e=this._elements,t=n.id||n,i=t&&e[t];i&&(le(i.gfx,Xt,""),i.secondaryGfx&&le(i.secondaryGfx,Xt,""),delete e[t])},Ue.prototype.updateId=function(n,e){this._validateId(e),typeof n=="string"&&(n=this.get(n)),this._eventBus.fire("element.updateId",{element:n,newId:e});var t=this.getGraphics(n),i=this.getGraphics(n,!0);this.remove(n),n.id=e,this.add(n,t,i)},Ue.prototype.updateGraphics=function(n,e,t){var i=n.id||n,r=this._elements[i];return t?r.secondaryGfx=e:r.gfx=e,e&&le(e,Xt,i),e},Ue.prototype.get=function(n){var e;typeof n=="string"?e=n:e=n&&le(n,Xt);var t=this._elements[e];return t&&t.element},Ue.prototype.filter=function(n){var e=[];return this.forEach(function(t,i){n(t,i)&&e.push(t)}),e},Ue.prototype.find=function(n){for(var e=this._elements,t=Object.keys(e),i=0;i<t.length;i++){var r=t[i],o=e[r],l=o.element,u=o.gfx;if(n(l,u))return l}},Ue.prototype.getAll=function(){return this.filter(function(n){return n})},Ue.prototype.forEach=function(n){var e=this._elements;Object.keys(e).forEach(function(t){var i=e[t],r=i.element,o=i.gfx;return n(r,o)})},Ue.prototype.getGraphics=function(n,e){var t=n.id||n,i=this._elements[t];return i&&(e?i.secondaryGfx:i.gfx)},Ue.prototype._validateId=function(n){if(!n)throw new Error("element must have an id");if(this._elements[n])throw new Error("element with id "+n+" already added")};var si={exports:{}},ai={},Uo;function $o(){if(Uo)return ai;Uo=1;function n(t,i,r,o){var l=r.inverse;return Object.defineProperty(t,"remove",{value:function(u){var c=this.indexOf(u);return c!==-1&&(this.splice(c,1),i.unset(u,l,o)),u}}),Object.defineProperty(t,"contains",{value:function(u){return this.indexOf(u)!==-1}}),Object.defineProperty(t,"add",{value:function(u,c){var f=this.indexOf(u);if(typeof c>"u"){if(f!==-1)return;c=this.length}f!==-1&&this.splice(f,1),this.splice(c,0,u),f===-1&&i.set(u,l,o)}}),Object.defineProperty(t,"__refs_collection",{value:!0}),t}function e(t){return t.__refs_collection===!0}return ai.extend=n,ai.isExtended=e,ai}var ir,Go;function yf(){if(Go)return ir;Go=1;var n=$o();function e(o,l){return Object.prototype.hasOwnProperty.call(o,l.name||l)}function t(o,l,u){var c=n.extend(u[l.name]||[],o,l,u);Object.defineProperty(u,l.name,{enumerable:l.enumerable,value:c}),c.length&&c.forEach(function(f){o.set(f,l.inverse,u)})}function i(o,l,u){var c=l.inverse,f=u[l.name];Object.defineProperty(u,l.name,{configurable:l.configurable,enumerable:l.enumerable,get:function(){return f},set:function(d){if(d!==f){var h=f;f=null,h&&o.unset(h,c,u),f=d,o.set(f,c,u)}}})}function r(o,l){if(!(this instanceof r))return new r(o,l);o.inverse=l,l.inverse=o,this.props={},this.props[o.name]=o,this.props[l.name]=l}return r.prototype.bind=function(o,l){if(typeof l=="string"){if(!this.props[l])throw new Error("no property <"+l+"> in ref");l=this.props[l]}l.collection?t(this,l,o):i(this,l,o)},r.prototype.ensureRefsCollection=function(o,l){var u=o[l.name];return n.isExtended(u)||t(this,l,o),u},r.prototype.ensureBound=function(o,l){e(o,l)||this.bind(o,l)},r.prototype.unset=function(o,l,u){o&&(this.ensureBound(o,l),l.collection?this.ensureRefsCollection(o,l).remove(u):o[l.name]=void 0)},r.prototype.set=function(o,l,u){o&&(this.ensureBound(o,l),l.collection?this.ensureRefsCollection(o,l).add(u):o[l.name]=u)},ir=r,ir}var qo;function vf(){return qo||(qo=1,si.exports=yf(),si.exports.Collection=$o()),si.exports}var _f=vf();const bn=Ml(_f);var rr=new bn({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Ho=new bn({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Wo=new bn({name:"attachers",collection:!0},{name:"host"}),zo=new bn({name:"outgoing",collection:!0},{name:"source"}),Yo=new bn({name:"incoming",collection:!0},{name:"target"});function Rn(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(n){var e=this.label,t=this.labels;!n&&e?t.remove(e):t.add(n,0)}}),rr.bind(this,"parent"),Ho.bind(this,"labels"),zo.bind(this,"outgoing"),Yo.bind(this,"incoming")}function Mn(){Rn.call(this),rr.bind(this,"children"),Wo.bind(this,"host"),Wo.bind(this,"attachers")}et(Mn,Rn);function Ko(){Rn.call(this),rr.bind(this,"children")}et(Ko,Mn);function Jo(){Mn.call(this),Ho.bind(this,"labelTarget")}et(Jo,Mn);function Zo(){Rn.call(this),zo.bind(this,"source"),Yo.bind(this,"target")}et(Zo,Rn);var xf={connection:Zo,shape:Mn,label:Jo,root:Ko};function Cf(n,e){var t=xf[n];if(!t)throw new Error("unknown type: <"+n+">");return Y(new t,e)}function Qt(){this._uid=12}Qt.prototype.createRoot=function(n){return this.create("root",n)},Qt.prototype.createLabel=function(n){return this.create("label",n)},Qt.prototype.createShape=function(n){return this.create("shape",n)},Qt.prototype.createConnection=function(n){return this.create("connection",n)},Qt.prototype.create=function(n,e){return e=Y({},e||{}),e.id||(e.id=n+"_"+this._uid++),Cf(n,e)};var li="__fn",Xo=1e3,Ef=Array.prototype.slice;function Be(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}Be.prototype.on=function(n,e,t,i){if(n=Ke(n)?n:[n],yt(e)&&(i=t,t=e,e=Xo),!gt(e))throw new Error("priority must be a number");var r=t;i&&(r=vt(t,i),r[li]=t[li]||t);var o=this;n.forEach(function(l){o._addListener(l,{priority:e,callback:r,next:null})})},Be.prototype.once=function(n,e,t,i){var r=this;if(yt(e)&&(i=t,t=e,e=Xo),!gt(e))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var l=t.apply(i,arguments);return r.off(n,o),l}o[li]=t,this.on(n,e,o)},Be.prototype.off=function(n,e){n=Ke(n)?n:[n];var t=this;n.forEach(function(i){t._removeListener(i,e)})},Be.prototype.createEvent=function(n){var e=new In;return e.init(n),e},Be.prototype.fire=function(n,e){var t,i,r,o;if(o=Ef.call(arguments),typeof n=="object"&&(e=n,n=e.type),!n)throw new Error("no event type specified");if(i=this._listeners[n],!!i){e instanceof In?t=e:t=this.createEvent(e),o[0]=t;var l=t.type;n!==l&&(t.type=n);try{r=this._invokeListeners(t,o,i)}finally{n!==l&&(t.type=l)}return r===void 0&&t.defaultPrevented&&(r=!1),r}},Be.prototype.handleError=function(n){return this.fire("error",{error:n})===!1},Be.prototype._destroy=function(){this._listeners={}},Be.prototype._invokeListeners=function(n,e,t){for(var i;t&&!n.cancelBubble;)i=this._invokeListener(n,e,t),t=t.next;return i},Be.prototype._invokeListener=function(n,e,t){var i;if(t.callback.__isTomb)return i;try{i=Tf(t.callback,e),i!==void 0&&(n.returnValue=i,n.stopPropagation()),i===!1&&n.preventDefault()}catch(r){if(!this.handleError(r))throw console.error("unhandled error in event listener",r),r}return i},Be.prototype._addListener=function(n,e){var t=this._getListeners(n),i;if(!t){this._setListeners(n,e);return}for(;t;){if(t.priority<e.priority){e.next=t,i?i.next=e:this._setListeners(n,e);return}i=t,t=t.next}i.next=e},Be.prototype._getListeners=function(n){return this._listeners[n]},Be.prototype._setListeners=function(n,e){this._listeners[n]=e},Be.prototype._removeListener=function(n,e){var t=this._getListeners(n),i,r,o;if(!e){this._setListeners(n,null);return}for(;t;)i=t.next,o=t.callback,(o===e||o[li]===e)&&(r?r.next=i:this._setListeners(n,i)),r=t,t=i};function In(){}In.prototype.stopPropagation=function(){this.cancelBubble=!0},In.prototype.preventDefault=function(){this.defaultPrevented=!0},In.prototype.init=function(n){Y(this,n||{})};function Tf(n,e){return n.apply(null,e)}function wf(n){return n.childNodes[0]}function Sf(n){return n.parentNode.childNodes[1]}function $e(n,e){this._eventBus=n,this._elementRegistry=e}$e.$inject=["eventBus","elementRegistry"],$e.prototype._getChildrenContainer=function(n){var e=this._elementRegistry.getGraphics(n),t;return n.parent?(t=Sf(e),t||(t=de("g"),Oe(t).add("djs-children"),_e(e.parentNode,t))):t=e,t},$e.prototype._clear=function(n){var e=wf(n);return ao(e),e},$e.prototype._createContainer=function(n,e,t,i){var r=de("g");Oe(r).add("djs-group"),typeof t<"u"?Qo(r,e,e.childNodes[t]):_e(e,r);var o=de("g");Oe(o).add("djs-element"),Oe(o).add("djs-"+n),i&&Oe(o).add("djs-frame"),_e(r,o);var l=de("g");return Oe(l).add("djs-visual"),_e(o,l),o},$e.prototype.create=function(n,e,t){var i=this._getChildrenContainer(e.parent);return this._createContainer(n,i,t,Eo(e))},$e.prototype.updateContainments=function(n){var e=this,t=this._elementRegistry,i;i=Yt(n,function(r,o){return o.parent&&(r[o.parent.id]=o.parent),r},{}),q(i,function(r){var o=r.children;if(o){var l=e._getChildrenContainer(r);q(o.slice().reverse(),function(u){var c=t.getGraphics(u);Qo(c.parentNode,l)})}})},$e.prototype.drawShape=function(n,e,t={}){var i=this._eventBus;return i.fire("render.shape",{gfx:n,element:e,attrs:t})},$e.prototype.getShapePath=function(n){var e=this._eventBus;return e.fire("render.getShapePath",n)},$e.prototype.drawConnection=function(n,e,t={}){var i=this._eventBus;return i.fire("render.connection",{gfx:n,element:e,attrs:t})},$e.prototype.getConnectionPath=function(n){var e=this._eventBus;return e.fire("render.getConnectionPath",n)},$e.prototype.update=function(n,e,t){if(e.parent){var i=this._clear(t);if(n==="shape")this.drawShape(i,e),po(t,e.x,e.y);else if(n==="connection")this.drawConnection(i,e);else throw new Error("unknown type: "+n);e.hidden?le(t,"display","none"):le(t,"display","block")}},$e.prototype.remove=function(n){var e=this._elementRegistry.getGraphics(n);En(e.parentNode)};function Qo(n,e,t){var i=t||e.firstChild;n!==i&&e.insertBefore(n,i)}const Af={__depends__:[uf],__init__:["canvas"],canvas:["type",J],elementRegistry:["type",Ue],elementFactory:["type",Qt],eventBus:["type",Be],graphicsFactory:["type",$e]};function bf(n){var e=new Lo(n);return e.init(),e}function Rf(n){n=n||{};var e={config:["value",n]},t=[e,Af].concat(n.modules||[]);return bf(t)}function jt(n,e){this._injector=e=e||Rf(n),this.get=e.get,this.invoke=e.invoke,this.get("eventBus").fire("diagram.init")}jt.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},jt.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};function or(){}or.prototype.get=function(n){return this.$model.properties.get(this,n)},or.prototype.set=function(n,e){this.$model.properties.set(this,n,e)};function jo(n,e){this.model=n,this.properties=e}jo.prototype.createType=function(n){var e=this.model,t=this.properties,i=Object.create(or.prototype);q(n.properties,function(l){!l.isMany&&l.default!==void 0&&(i[l.name]=l.default)}),t.defineModel(i,e),t.defineDescriptor(i,n);var r=n.ns.name;function o(l){t.define(this,"$type",{value:r,enumerable:!0}),t.define(this,"$attrs",{value:{}}),t.define(this,"$parent",{writable:!0}),q(l,vt(function(u,c){this.set(c,u)},this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,t.defineModel(o,e),t.defineDescriptor(o,n),o};var Mf={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},es={String:function(n){return n},Boolean:function(n){return n==="true"},Integer:function(n){return parseInt(n,10)},Real:function(n){return parseFloat(n)}};function sr(n,e){var t=es[n];return t?t(e):e}function ar(n){return!!Mf[n]}function ts(n){return!!es[n]}function Me(n,e){var t=n.split(/:/),i,r;if(t.length===1)i=n,r=e;else if(t.length===2)i=t[1],r=t[0];else throw new Error("expected <prefix:localName> or <localName>, got "+n);return n=(r?r+":":"")+i,{name:n,prefix:r,localName:i}}function Ge(n){this.ns=n,this.name=n.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}Ge.prototype.build=function(){return Ul(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Ge.prototype.addProperty=function(n,e,t){typeof e=="boolean"&&(t=e,e=void 0),this.addNamedProperty(n,t!==!1);var i=this.properties;e!==void 0?i.splice(e,0,n):i.push(n)},Ge.prototype.replaceProperty=function(n,e,t){var i=n.ns,r=this.properties,o=this.propertiesByName,l=n.name!==e.name;if(n.isId){if(!e.isId)throw new Error("property <"+e.ns.name+"> must be id property to refine <"+n.ns.name+">");this.setIdProperty(e,!1)}if(n.isBody){if(!e.isBody)throw new Error("property <"+e.ns.name+"> must be body property to refine <"+n.ns.name+">");this.setBodyProperty(e,!1)}var u=r.indexOf(n);if(u===-1)throw new Error("property <"+i.name+"> not found in property list");r.splice(u,1),this.addProperty(e,t?void 0:u,l),o[i.name]=o[i.localName]=e},Ge.prototype.redefineProperty=function(n,e,t){var i=n.ns.prefix,r=e.split("#"),o=Me(r[0],i),l=Me(r[1],o.prefix).name,u=this.propertiesByName[l];if(u)this.replaceProperty(u,n,t);else throw new Error("refined property <"+l+"> not found");delete n.redefines},Ge.prototype.addNamedProperty=function(n,e){var t=n.ns,i=this.propertiesByName;e&&(this.assertNotDefined(n,t.name),this.assertNotDefined(n,t.localName)),i[t.name]=i[t.localName]=n},Ge.prototype.removeNamedProperty=function(n){var e=n.ns,t=this.propertiesByName;delete t[e.name],delete t[e.localName]},Ge.prototype.setBodyProperty=function(n,e){if(e&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+n.ns.name+">)");this.bodyProperty=n},Ge.prototype.setIdProperty=function(n,e){if(e&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+n.ns.name+">)");this.idProperty=n},Ge.prototype.assertNotTrait=function(n){if((n.extends||[]).length)throw new Error(`cannot create <${n.name}> extending <${n.extends}>`)},Ge.prototype.assertNotDefined=function(n,e){var t=n.name,i=this.propertiesByName[t];if(i)throw new Error("property <"+t+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+n.definedBy.ns.name+"#"+n.ns.name+"> not allowed without redefines")},Ge.prototype.hasProperty=function(n){return this.propertiesByName[n]},Ge.prototype.addTrait=function(n,e){e&&this.assertNotTrait(n);var t=this.allTypesByName,i=this.allTypes,r=n.name;r in t||(q(n.properties,vt(function(o){o=Y({},o,{name:o.ns.localName,inherited:e}),Object.defineProperty(o,"definedBy",{value:n});var l=o.replaces,u=o.redefines;l||u?this.redefineProperty(o,l||u,l):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),i.push(n),t[r]=n)};function Tt(n,e){this.packageMap={},this.typeMap={},this.packages=[],this.properties=e,q(n,vt(this.registerPackage,this))}Tt.prototype.getPackage=function(n){return this.packageMap[n]},Tt.prototype.getPackages=function(){return this.packages},Tt.prototype.registerPackage=function(n){n=Y({},n);var e=this.packageMap;ns(e,n,"prefix"),ns(e,n,"uri"),q(n.types,vt(function(t){this.registerType(t,n)},this)),e[n.uri]=e[n.prefix]=n,this.packages.push(n)},Tt.prototype.registerType=function(n,e){n=Y({},n,{superClass:(n.superClass||[]).slice(),extends:(n.extends||[]).slice(),properties:(n.properties||[]).slice(),meta:Y(n.meta||{})});var t=Me(n.name,e.prefix),i=t.name,r={};q(n.properties,vt(function(o){var l=Me(o.name,t.prefix),u=l.name;ar(o.type)||(o.type=Me(o.type,l.prefix).name),Y(o,{ns:l,name:u}),r[u]=o},this)),Y(n,{ns:t,name:i,propertiesByName:r}),q(n.extends,vt(function(o){var l=Me(o,t.prefix),u=this.typeMap[l.name];u.traits=u.traits||[],u.traits.push(i)},this)),this.definePackage(n,e),this.typeMap[i]=n},Tt.prototype.mapTypes=function(n,e,t){var i=ar(n.name)?{name:n.name}:this.typeMap[n.name],r=this;function o(c,f){var d=Me(c,ar(c)?"":n.prefix);r.mapTypes(d,e,f)}function l(c){return o(c,!0)}function u(c){return o(c,!1)}if(!i)throw new Error("unknown type <"+n.name+">");q(i.superClass,t?l:u),e(i,!t),q(i.traits,l)},Tt.prototype.getEffectiveDescriptor=function(n){var e=Me(n),t=new Ge(e);this.mapTypes(e,function(r,o){t.addTrait(r,o)});var i=t.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},Tt.prototype.definePackage=function(n,e){this.properties.define(n,"$pkg",{value:e})};function ns(n,e,t){var i=e[t];if(i in n)throw new Error("package with "+t+" <"+i+"> already defined")}function Bt(n){this.model=n}Bt.prototype.set=function(n,e,t){if(!tt(e)||!e.length)throw new TypeError("property name must be a non-empty string");var i=this.getProperty(n,e),r=i&&i.name;If(t)?i?delete n[r]:delete n.$attrs[lr(e)]:i?r in n?n[r]=t:is(n,i,t):n.$attrs[lr(e)]=t},Bt.prototype.get=function(n,e){var t=this.getProperty(n,e);if(!t)return n.$attrs[lr(e)];var i=t.name;return!n[i]&&t.isMany&&is(n,t,[]),n[i]},Bt.prototype.define=function(n,e,t){if(!t.writable){var i=t.value;t=Y({},t,{get:function(){return i}}),delete t.value}Object.defineProperty(n,e,t)},Bt.prototype.defineDescriptor=function(n,e){this.define(n,"$descriptor",{value:e})},Bt.prototype.defineModel=function(n,e){this.define(n,"$model",{value:e})},Bt.prototype.getProperty=function(n,e){var t=this.model,i=t.getPropertyDescriptor(n,e);if(i)return i;if(e.includes(":"))return null;const r=t.config.strict;if(typeof r<"u"){const o=new TypeError(`unknown property <${e}> on <${n.$type}>`);if(r)throw o;typeof console<"u"&&console.warn(o)}return null};function If(n){return typeof n>"u"}function is(n,e,t){Object.defineProperty(n,e.name,{enumerable:!e.isReference,writable:!0,value:t,configurable:!0})}function lr(n){return n.replace(/^:/,"")}function He(n,e={}){this.properties=new Bt(this),this.factory=new jo(this,this.properties),this.registry=new Tt(n,this.properties),this.typeCache={},this.config=e}He.prototype.create=function(n,e){var t=this.getType(n);if(!t)throw new Error("unknown type <"+n+">");return new t(e)},He.prototype.getType=function(n){var e=this.typeCache,t=tt(n)?n:n.ns.name,i=e[t];return i||(n=this.registry.getEffectiveDescriptor(t),i=e[t]=this.factory.createType(n)),i},He.prototype.createAny=function(n,e,t){var i=Me(n),r={$type:n,$instanceOf:function(l){return l===this.$type},get:function(l){return this[l]},set:function(l,u){Ol(this,[l],u)}},o={name:n,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:e}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"get",{enumerable:!1,writable:!0}),this.properties.define(r,"set",{enumerable:!1,writable:!0}),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),q(t,function(l,u){kt(l)&&l.value!==void 0?r[l.name]=l.value:r[u]=l}),r},He.prototype.getPackage=function(n){return this.registry.getPackage(n)},He.prototype.getPackages=function(){return this.registry.getPackages()},He.prototype.getElementDescriptor=function(n){return n.$descriptor},He.prototype.hasType=function(n,e){e===void 0&&(e=n,n=this);var t=n.$model.getElementDescriptor(n);return e in t.allTypesByName},He.prototype.getPropertyDescriptor=function(n,e){return this.getElementDescriptor(n).propertiesByName[e]},He.prototype.getTypeDescriptor=function(n){return this.registry.typeMap[n]};var rs=String.fromCharCode,Pf=Object.prototype.hasOwnProperty,kf=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,Pn={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(Pn).forEach(function(n){Pn[n.toUpperCase()]=Pn[n]});function Nf(n,e,t,i){return i?Pf.call(Pn,i)?Pn[i]:"&"+i+";":rs(e||parseInt(t,16))}function Ot(n){return n.length>3&&n.indexOf("&")!==-1?n.replace(kf,Nf):n}var Df="http://www.w3.org/2001/XMLSchema-instance",Lf="xsi",os="xsi:type",ss="non-whitespace outside of root node";function en(n){return new Error(n)}function as(n){return"missing namespace for prefix <"+n+">"}function ui(n){return{get:n,enumerable:!0}}function Ff(n){var e={},t;for(t in n)e[t]=n[t];return e}function ur(n){return n+"$uri"}function Vf(n){var e={},t,i;for(t in n)i=n[t],e[i]=i,e[ur(i)]=t;return e}function ls(){return{line:0,column:0}}function Bf(n){throw n}function us(n){if(!this)return new us(n);var e=n&&n.proxy,t,i,r,o,l=Bf,u,c,f,d,h=ls,g=!1,x=!1,w=null,b=!1,D;function F(A){A instanceof Error||(A=en(A)),w=A,l(A,h)}function T(A){u&&(A instanceof Error||(A=en(A)),u(A,h))}this.on=function(A,S){if(typeof S!="function")throw en("required args <name, cb>");switch(A){case"openTag":i=S;break;case"text":t=S;break;case"closeTag":r=S;break;case"error":l=S;break;case"warn":u=S;break;case"cdata":o=S;break;case"attention":d=S;break;case"question":f=S;break;case"comment":c=S;break;default:throw en("unsupported event: "+A)}return this},this.ns=function(A){if(typeof A>"u"&&(A={}),typeof A!="object")throw en("required args <nsMap={}>");var S={},I;for(I in A)S[I]=A[I];return S[Df]=Lf,x=!0,D=S,this},this.parse=function(A){if(typeof A!="string")throw en("required args <xml=string>");return w=null,k(A),h=ls,b=!1,w},this.stop=function(){b=!0};function k(A){var S=x?[]:null,I=x?Vf(D):null,R,M=[],C=0,P=!1,O=!1,U=0,$=0,te,Fe,ce,ne,qe,y,p,m,_,v="",E=0,N;function Z(){if(N!==null)return N;var oe,Ae,ye,Ye=x&&I.xmlns,Qe=x&&g?[]:null,he=E,be=v,mt=be.length,bl,It,Ee,lt,fe,yn={},Rl={},je,z,ue;e:for(;he<mt;he++)if(je=!1,z=be.charCodeAt(he),!(z===32||z<14&&z>8)){for((z<65||z>122||z>90&&z<97)&&z!==95&&z!==58&&(T("illegal first char attribute name"),je=!0),ue=he+1;ue<mt;ue++)if(z=be.charCodeAt(ue),!(z>96&&z<123||z>64&&z<91||z>47&&z<59||z===46||z===45||z===95)){if(z===32||z<14&&z>8){T("missing attribute value"),he=ue;continue e}if(z===61)break;T("illegal attribute name char"),je=!0}if(fe=be.substring(he,ue),fe==="xmlns:xmlns"&&(T("illegal declaration of xmlns"),je=!0),z=be.charCodeAt(ue+1),z===34)ue=be.indexOf('"',he=ue+2),ue===-1&&(ue=be.indexOf("'",he),ue!==-1&&(T("attribute value quote missmatch"),je=!0));else if(z===39)ue=be.indexOf("'",he=ue+2),ue===-1&&(ue=be.indexOf('"',he),ue!==-1&&(T("attribute value quote missmatch"),je=!0));else for(T("missing attribute value quotes"),je=!0,ue=ue+1;ue<mt&&(z=be.charCodeAt(ue+1),!(z===32||z<14&&z>8));ue++);for(ue===-1&&(T("missing closing quotes"),ue=mt,je=!0),je||(Ee=be.substring(he,ue)),he=ue;ue+1<mt&&(z=be.charCodeAt(ue+1),!(z===32||z<14&&z>8));ue++)he===ue&&(T("illegal character after attribute end"),je=!0);if(he=ue+1,je)continue e;if(fe in Rl){T("attribute <"+fe+"> already defined");continue}if(Rl[fe]=!0,!x){yn[fe]=Ee;continue}if(g){if(It=fe==="xmlns"?"xmlns":fe.charCodeAt(0)===120&&fe.substr(0,6)==="xmlns:"?fe.substr(6):null,It!==null){if(oe=Ot(Ee),Ae=ur(It),lt=D[oe],!lt){if(It==="xmlns"||Ae in I&&I[Ae]!==oe)do lt="ns"+C++;while(typeof I[lt]<"u");else lt=It;D[oe]=lt}I[It]!==lt&&(bl||(I=Ff(I),bl=!0),I[It]=lt,It==="xmlns"&&(I[ur(lt)]=oe,Ye=lt),I[Ae]=oe),yn[fe]=Ee;continue}Qe.push(fe,Ee);continue}if(z=fe.indexOf(":"),z===-1){yn[fe]=Ee;continue}if(!(ye=I[fe.substring(0,z)])){T(as(fe.substring(0,z)));continue}fe=Ye===ye?fe.substr(z+1):ye+fe.substr(z),fe===os&&(z=Ee.indexOf(":"),z!==-1?(ye=Ee.substring(0,z),ye=I[ye]||ye,Ee=ye+Ee.substring(z)):Ee=Ye+":"+Ee),yn[fe]=Ee}if(g)for(he=0,mt=Qe.length;he<mt;he++){if(fe=Qe[he++],Ee=Qe[he],z=fe.indexOf(":"),z!==-1){if(!(ye=I[fe.substring(0,z)])){T(as(fe.substring(0,z)));continue}fe=Ye===ye?fe.substr(z+1):ye+fe.substr(z),fe===os&&(z=Ee.indexOf(":"),z!==-1?(ye=Ee.substring(0,z),ye=I[ye]||ye,Ee=ye+Ee.substring(z)):Ee=Ye+":"+Ee)}yn[fe]=Ee}return N=yn}function ee(){for(var oe=/(\r\n|\r|\n)/g,Ae=0,ye=0,Ye=0,Qe=$,he,be;U>=Ye&&(he=oe.exec(A),!(!he||(Qe=he[0].length+he.index,Qe>U)));)Ae+=1,Ye=Qe;return U==-1?(ye=Qe,be=A.substring($)):$===0?be=A.substring($,U):(ye=U-Ye,be=$==-1?A.substring(U):A.substring(U,$+1)),{data:be,line:Ae,column:ye}}for(h=ee,e&&(_=Object.create({},{name:ui(function(){return p}),originalName:ui(function(){return m}),attrs:ui(Z),ns:ui(function(){return I})}));$!==-1;){if(A.charCodeAt($)===60?U=$:U=A.indexOf("<",$),U===-1){if(M.length)return F("unexpected end of file");if($===0)return F("missing start tag");$<A.length&&A.substring($).trim()&&T(ss);return}if($!==U){if(M.length){if(t&&(t(A.substring($,U),Ot,h),b))return}else if(A.substring($,U).trim()&&(T(ss),b))return}if(ne=A.charCodeAt(U+1),ne===33){if(ce=A.charCodeAt(U+2),ce===91&&A.substr(U+3,6)==="CDATA["){if($=A.indexOf("]]>",U),$===-1)return F("unclosed cdata");if(o&&(o(A.substring(U+9,$),h),b))return;$+=3;continue}if(ce===45&&A.charCodeAt(U+3)===45){if($=A.indexOf("-->",U),$===-1)return F("unclosed comment");if(c&&(c(A.substring(U+4,$),Ot,h),b))return;$+=3;continue}}if(ne===63){if($=A.indexOf("?>",U),$===-1)return F("unclosed question");if(f&&(f(A.substring(U,$+2),h),b))return;$+=2;continue}for(te=U+1;;te++){if(qe=A.charCodeAt(te),isNaN(qe))return $=-1,F("unclosed tag");if(qe===34)ce=A.indexOf('"',te+1),te=ce!==-1?ce:te;else if(qe===39)ce=A.indexOf("'",te+1),te=ce!==-1?ce:te;else if(qe===62){$=te;break}}if(ne===33){if(d&&(d(A.substring(U,$+1),Ot,h),b))return;$+=1;continue}if(N={},ne===47){if(P=!1,O=!0,!M.length)return F("missing open tag");if(te=p=M.pop(),ce=U+2+te.length,A.substring(U+2,ce)!==te)return F("closing tag mismatch");for(;ce<$;ce++)if(ne=A.charCodeAt(ce),!(ne===32||ne>8&&ne<14))return F("close tag")}else{if(A.charCodeAt($-1)===47?(te=p=A.substring(U+1,$-1),P=!0,O=!0):(te=p=A.substring(U+1,$),P=!0,O=!1),!(ne>96&&ne<123||ne>64&&ne<91||ne===95||ne===58))return F("illegal first char nodeName");for(ce=1,Fe=te.length;ce<Fe;ce++)if(ne=te.charCodeAt(ce),!(ne>96&&ne<123||ne>64&&ne<91||ne>47&&ne<59||ne===45||ne===95||ne==46)){if(ne===32||ne<14&&ne>8){p=te.substring(0,ce),N=null;break}return F("invalid nodeName")}O||M.push(p)}if(x){if(R=I,P&&(O||S.push(R),N===null&&(g=te.indexOf("xmlns",ce)!==-1)&&(E=ce,v=te,Z(),g=!1)),m=p,ne=p.indexOf(":"),ne!==-1){if(y=I[p.substring(0,ne)],!y)return F("missing namespace on <"+m+">");p=p.substr(ne+1)}else y=I.xmlns;y&&(p=y+":"+p)}if(P&&(E=ce,v=te,i&&(e?i(_,Ot,O,h):i(p,Z,Ot,O,h),b)))return;if(O){if(r&&(r(e?_:p,Ot,P,h),b))return;x&&(P?I=R:I=S.pop())}$+=1}}}function cs(n){return n.xml&&n.xml.tagAlias==="lowerCase"}var Of={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},ci="xsi:type";function fs(n){return n.xml&&n.xml.serialize}function ds(n){return fs(n)===ci}function Uf(n){return fs(n)==="property"}function $f(n){return n.charAt(0).toUpperCase()+n.slice(1)}function ps(n,e){return cs(e)?n.prefix+":"+$f(n.localName):n.name}function Gf(n,e){var t=n.name,i=n.localName,r=e.xml&&e.xml.typePrefix;return r&&i.indexOf(r)===0?n.prefix+":"+i.slice(r.length):t}function qf(n,e){var t=Me(n),i=e.getPackage(t.prefix);return Gf(t,i)}function wt(n){return new Error(n)}function pt(n){return n.$descriptor}function Hf(n){Y(this,n),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw wt("expected element");var t=this.elementsById,i=pt(e),r=i.idProperty,o;if(r&&(o=e.get(r.name),o)){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(o))throw new Error("illegal ID <"+o+">");if(t[o])throw wt("duplicate ID <"+o+">");t[o]=e}},this.addWarning=function(e){this.warnings.push(e)}}function kn(){}kn.prototype.handleEnd=function(){},kn.prototype.handleText=function(){},kn.prototype.handleNode=function(){};function cr(){}cr.prototype=Object.create(kn.prototype),cr.prototype.handleNode=function(){return this};function tn(){}tn.prototype=Object.create(kn.prototype),tn.prototype.handleText=function(n){this.body=(this.body||"")+n};function Nn(n,e){this.property=n,this.context=e}Nn.prototype=Object.create(tn.prototype),Nn.prototype.handleNode=function(n){if(this.element)throw wt("expected no sub nodes");return this.element=this.createReference(n),this},Nn.prototype.handleEnd=function(){this.element.id=this.body},Nn.prototype.createReference=function(n){return{property:this.property.ns.name,id:""}};function fr(n,e){this.element=e,this.propertyDesc=n}fr.prototype=Object.create(tn.prototype),fr.prototype.handleEnd=function(){var n=this.body||"",e=this.element,t=this.propertyDesc;n=sr(t.type,n),t.isMany?e.get(t.name).push(n):e.set(t.name,n)};function fi(){}fi.prototype=Object.create(tn.prototype),fi.prototype.handleNode=function(n){var e=this,t=this.element;return t?e=this.handleChild(n):(t=this.element=this.createElement(n),this.context.addElement(t)),e};function Ie(n,e,t){this.model=n,this.type=n.getType(e),this.context=t}Ie.prototype=Object.create(fi.prototype),Ie.prototype.addReference=function(n){this.context.addReference(n)},Ie.prototype.handleText=function(n){var e=this.element,t=pt(e),i=t.bodyProperty;if(!i)throw wt("unexpected body text <"+n+">");tn.prototype.handleText.call(this,n)},Ie.prototype.handleEnd=function(){var n=this.body,e=this.element,t=pt(e),i=t.bodyProperty;i&&n!==void 0&&(n=sr(i.type,n),e.set(i.name,n))},Ie.prototype.createElement=function(n){var e=n.attributes,t=this.type,i=pt(t),r=this.context,o=new t({}),l=this.model,u;return q(e,function(c,f){var d=i.propertiesByName[f],h;d&&d.isReference?d.isMany?(h=c.split(" "),q(h,function(g){r.addReference({element:o,property:d.ns.name,id:g})})):r.addReference({element:o,property:d.ns.name,id:c}):(d?c=sr(d.type,c):f!=="xmlns"&&(u=Me(f,i.ns.prefix),l.getPackage(u.prefix)&&r.addWarning({message:"unknown attribute <"+f+">",element:o,property:f,value:c})),o.set(f,c))}),o},Ie.prototype.getPropertyForNode=function(n){var e=n.name,t=Me(e),i=this.type,r=this.model,o=pt(i),l=t.name,u=o.propertiesByName[l],c,f;if(u&&!u.isAttr)return ds(u)&&(c=n.attributes[ci],c)?(c=qf(c,r),f=r.getType(c),Y({},u,{effectiveType:pt(f).name})):u;var d=r.getPackage(t.prefix);if(d){if(c=ps(t,d),f=r.getType(c),u=Je(o.properties,function(h){return!h.isVirtual&&!h.isReference&&!h.isAttribute&&f.hasType(h.type)}),u)return Y({},u,{effectiveType:pt(f).name})}else if(u=Je(o.properties,function(h){return!h.isReference&&!h.isAttribute&&h.type==="Element"}),u)return u;throw wt("unrecognized element <"+t.name+">")},Ie.prototype.toString=function(){return"ElementDescriptor["+pt(this.type).name+"]"},Ie.prototype.valueHandler=function(n,e){return new fr(n,e)},Ie.prototype.referenceHandler=function(n){return new Nn(n,this.context)},Ie.prototype.handler=function(n){return n==="Element"?new nn(this.model,n,this.context):new Ie(this.model,n,this.context)},Ie.prototype.handleChild=function(n){var e,t,i,r;if(e=this.getPropertyForNode(n),i=this.element,t=e.effectiveType||e.type,ts(t))return this.valueHandler(e,i);e.isReference?r=this.referenceHandler(e).handleNode(n):r=this.handler(t).handleNode(n);var o=r.element;return o!==void 0&&(e.isMany?i.get(e.name).push(o):i.set(e.name,o),e.isReference?(Y(o,{element:i}),this.context.addReference(o)):o.$parent=i),r};function dr(n,e,t){Ie.call(this,n,e,t)}dr.prototype=Object.create(Ie.prototype),dr.prototype.createElement=function(n){var e=n.name,t=Me(e),i=this.model,r=this.type,o=i.getPackage(t.prefix),l=o&&ps(t,o)||e;if(!r.hasType(l))throw wt("unexpected element <"+n.originalName+">");return Ie.prototype.createElement.call(this,n)};function nn(n,e,t){this.model=n,this.context=t}nn.prototype=Object.create(fi.prototype),nn.prototype.createElement=function(n){var e=n.name,t=Me(e),i=t.prefix,r=n.ns[i+"$uri"],o=n.attributes;return this.model.createAny(e,r,o)},nn.prototype.handleChild=function(n){var e=new nn(this.model,"Element",this.context).handleNode(n),t=this.element,i=e.element,r;return i!==void 0&&(r=t.$children=t.$children||[],r.push(i),i.$parent=t),e},nn.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function pr(n){n instanceof He&&(n={model:n}),Y(this,{lax:!1},n)}pr.prototype.fromXML=function(n,e,t){var i=e.rootHandler;e instanceof Ie?(i=e,e={}):typeof e=="string"?(i=this.handler(e),e={}):typeof i=="string"&&(i=this.handler(i));var r=this.model,o=this.lax,l=new Hf(Y({},e,{rootHandler:i})),u=new us({proxy:!0}),c=Wf();i.context=l,c.push(i);function f(S,I,R){var M=I(),C=M.line,P=M.column,O=M.data;O.charAt(0)==="<"&&O.indexOf(" ")!==-1&&(O=O.slice(0,O.indexOf(" "))+">");var U="unparsable content "+(O?O+" ":"")+`detected
|
|
24
|
+
line: `+C+`
|
|
25
|
+
column: `+P+`
|
|
26
|
+
nested error: `+S.message;if(R)return l.addWarning({message:U,error:S}),!0;throw wt(U)}function d(S,I){return f(S,I,!0)}function h(){var S=l.elementsById,I=l.references,R,M;for(R=0;M=I[R];R++){var C=M.element,P=S[M.id],O=pt(C).propertiesByName[M.property];if(P||l.addWarning({message:"unresolved reference <"+M.id+">",element:M.element,property:M.property,value:M.id}),O.isMany){var U=C.get(O.name),$=U.indexOf(M);$===-1&&($=U.length),P?U[$]=P:U.splice($,1)}else C.set(O.name,P)}}function g(){c.pop().handleEnd()}var x=/^<\?xml /i,w=/ encoding="([^"]+)"/i,b=/^utf-8$/i;function D(S){if(x.test(S)){var I=w.exec(S),R=I&&I[1];!R||b.test(R)||l.addWarning({message:"unsupported document encoding <"+R+">, falling back to UTF-8"})}}function F(S,I){var R=c.peek();try{c.push(R.handleNode(S))}catch(M){f(M,I,o)&&c.push(new cr)}}function T(S,I){try{c.peek().handleText(S)}catch(R){d(R,I)}}function k(S,I){S.trim()&&T(S,I)}var A=r.getPackages().reduce(function(S,I){return S[I.uri]=I.prefix,S},{"http://www.w3.org/XML/1998/namespace":"xml"});return u.ns(A).on("openTag",function(S,I,R,M){var C=S.attrs||{},P=Object.keys(C).reduce(function(U,$){var te=I(C[$]);return U[$]=te,U},{}),O={name:S.name,originalName:S.originalName,attributes:P,ns:S.ns};F(O,M)}).on("question",D).on("closeTag",g).on("cdata",T).on("text",function(S,I,R){k(I(S),R)}).on("error",f).on("warn",d),new Promise(function(S,I){var R;try{u.parse(n),h()}catch(U){R=U}var M=i.element;!R&&!M&&(R=wt("failed to parse document as <"+i.type.$descriptor.name+">"));var C=l.warnings,P=l.references,O=l.elementsById;return R?(R.warnings=C,I(R)):S({rootElement:M,elementsById:O,references:P,warnings:C})})},pr.prototype.handler=function(n){return new dr(this.model,n)};function Wf(){var n=[];return Object.defineProperty(n,"peek",{value:function(){return this[this.length-1]}}),n}var zf=`<?xml version="1.0" encoding="UTF-8"?>
|
|
27
|
+
`,Yf=/<|>|'|"|&|\n\r|\n/g,hs=/<|>|&/g;function Kf(n){var e={},t={},i={},r=[],o=[];this.byUri=function(l){return t[l]||n&&n.byUri(l)},this.add=function(l,u){t[l.uri]=l,u?r.push(l):o.push(l),this.mapPrefix(l.prefix,l.uri)},this.uriByPrefix=function(l){return e[l||"xmlns"]},this.mapPrefix=function(l,u){e[l||"xmlns"]=u},this.getNSKey=function(l){return l.prefix!==void 0?l.uri+"|"+l.prefix:l.uri},this.logUsed=function(l){var u=l.uri,c=this.getNSKey(l);i[c]=this.byUri(u),n&&n.logUsed(l)},this.getUsed=function(l){function u(d){var h=c.getNSKey(d);return i[h]}var c=this,f=[].concat(r,o);return f.filter(u)}}function Jf(n){return n.charAt(0).toLowerCase()+n.slice(1)}function Zf(n,e){return cs(e)?Jf(n):n}function ms(n,e){n.super_=e,n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}})}function gs(n){return tt(n)?n:(n.prefix?n.prefix+":":"")+n.localName}function Xf(n){return n.getUsed().filter(function(e){return e.prefix!=="xml"}).map(function(e){var t="xmlns"+(e.prefix?":"+e.prefix:"");return{name:t,value:e.uri}})}function Qf(n,e){return e.isGeneric?Y({localName:e.ns.localName},n):Y({localName:Zf(e.ns.localName,e.$pkg)},n)}function jf(n,e){return Y({localName:e.ns.localName},n)}function ed(n){var e=n.$descriptor;return zt(e.properties,function(t){var i=t.name;if(t.isVirtual||!Gn(n,i))return!1;var r=n[i];return r===t.default||r===null?!1:t.isMany?r.length:!0})}var td={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},nd={"<":"lt",">":"gt","&":"amp"};function ys(n,e,t){return n=tt(n)?n:""+n,n.replace(e,function(i){return"&"+t[i]+";"})}function id(n){return ys(n,Yf,td)}function rd(n){return ys(n,hs,nd)}function od(n){return zt(n,function(e){return e.isAttr})}function sd(n){return zt(n,function(e){return!e.isAttr})}function hr(n){this.tagName=n}hr.prototype.build=function(n){return this.element=n,this},hr.prototype.serializeTo=function(n){n.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()};function Ut(){}Ut.prototype.serializeValue=Ut.prototype.serializeTo=function(n){n.append(this.escape?rd(this.value):this.value)},Ut.prototype.build=function(n,e){return this.value=e,n.type==="String"&&e.search(hs)!==-1&&(this.escape=!0),this};function mr(n){this.tagName=n}ms(mr,Ut),mr.prototype.serializeTo=function(n){n.appendIndent().append("<"+this.tagName+">"),this.serializeValue(n),n.append("</"+this.tagName+">").appendNewLine()};function me(n,e){this.body=[],this.attrs=[],this.parent=n,this.propertyDescriptor=e}me.prototype.build=function(n){this.element=n;var e=n.$descriptor,t=this.propertyDescriptor,i,r,o=e.isGeneric;return o?i=this.parseGeneric(n):i=this.parseNsAttributes(n),t?this.ns=this.nsPropertyTagName(t):this.ns=this.nsTagName(e),this.tagName=this.addTagName(this.ns),o||(r=ed(n),this.parseAttributes(od(r)),this.parseContainments(sd(r))),this.parseGenericAttributes(n,i),this},me.prototype.nsTagName=function(n){var e=this.logNamespaceUsed(n.ns);return Qf(e,n)},me.prototype.nsPropertyTagName=function(n){var e=this.logNamespaceUsed(n.ns);return jf(e,n)},me.prototype.isLocalNs=function(n){return n.uri===this.ns.uri},me.prototype.nsAttributeName=function(n){var e;if(tt(n)?e=Me(n):e=n.ns,n.inherited)return{localName:e.localName};var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),this.isLocalNs(t)?{localName:e.localName}:Y({localName:e.localName},t)},me.prototype.parseGeneric=function(n){var e=this,t=this.body,i=[];return q(n,function(r,o){var l;o==="$body"?t.push(new Ut().build({type:"String"},r)):o==="$children"?q(r,function(u){t.push(new me(e).build(u))}):o.indexOf("$")!==0&&(l=e.parseNsAttribute(n,o,r),l&&i.push({name:o,value:r}))}),i},me.prototype.parseNsAttribute=function(n,e,t){var i=n.$model,r=Me(e),o;if(r.prefix==="xmlns"&&(o={prefix:r.localName,uri:t}),!r.prefix&&r.localName==="xmlns"&&(o={uri:t}),!o)return{name:e,value:t};if(i&&i.getPackage(t))this.logNamespace(o,!0,!0);else{var l=this.logNamespaceUsed(o,!0);this.getNamespaces().logUsed(l)}},me.prototype.parseNsAttributes=function(n,e){var t=this,i=n.$attrs,r=[];return q(i,function(o,l){var u=t.parseNsAttribute(n,l,o);u&&r.push(u)}),r},me.prototype.parseGenericAttributes=function(n,e){var t=this;q(e,function(i){if(i.name!==ci)try{t.addAttribute(t.nsAttributeName(i.name),i.value)}catch(r){console.warn("missing namespace information for ",i.name,"=",i.value,"on",n,r)}})},me.prototype.parseContainments=function(n){var e=this,t=this.body,i=this.element;q(n,function(r){var o=i.get(r.name),l=r.isReference,u=r.isMany;if(u||(o=[o]),r.isBody)t.push(new Ut().build(r,o[0]));else if(ts(r.type))q(o,function(d){t.push(new mr(e.addTagName(e.nsPropertyTagName(r))).build(r,d))});else if(l)q(o,function(d){t.push(new hr(e.addTagName(e.nsPropertyTagName(r))).build(d))});else{var c=ds(r),f=Uf(r);q(o,function(d){var h;c?h=new di(e,r):f?h=new me(e,r):h=new me(e),t.push(h.build(d))})}})},me.prototype.getNamespaces=function(n){var e=this.namespaces,t=this.parent,i;return e||(i=t&&t.getNamespaces(),n||!i?this.namespaces=e=new Kf(i):e=i),e},me.prototype.logNamespace=function(n,e,t){var i=this.getNamespaces(t),r=n.uri,o=n.prefix,l=i.byUri(r);return(!l||t)&&i.add(n,e),i.mapPrefix(o,r),n},me.prototype.logNamespaceUsed=function(n,e){var t=this.element,i=t.$model,r=this.getNamespaces(e),o=n.prefix,l=n.uri,u,c,f;if(!o&&!l)return{localName:n.localName};if(f=Of[o]||i&&(i.getPackage(o)||{}).uri,l=l||f||r.uriByPrefix(o),!l)throw new Error("no namespace uri given for prefix <"+o+">");if(n=r.byUri(l),!n){for(u=o,c=1;r.uriByPrefix(u);)u=o+"_"+c++;n=this.logNamespace({prefix:u,uri:l},f===l)}return o&&r.mapPrefix(o,l),n},me.prototype.parseAttributes=function(n){var e=this,t=this.element;q(n,function(i){var r=t.get(i.name);if(i.isReference)if(!i.isMany)r=r.id;else{var o=[];q(r,function(l){o.push(l.id)}),r=o.join(" ")}e.addAttribute(e.nsAttributeName(i),r)})},me.prototype.addTagName=function(n){var e=this.logNamespaceUsed(n);return this.getNamespaces().logUsed(e),gs(n)},me.prototype.addAttribute=function(n,e){var t=this.attrs;tt(e)&&(e=id(e));var i=Dl(t,function(o){return o.name.localName===n.localName&&o.name.uri===n.uri&&o.name.prefix===n.prefix}),r={name:n,value:e};i!==-1?t.splice(i,1,r):t.push(r)},me.prototype.serializeAttributes=function(n){var e=this.attrs,t=this.namespaces;t&&(e=Xf(t).concat(e)),q(e,function(i){n.append(" ").append(gs(i.name)).append('="').append(i.value).append('"')})},me.prototype.serializeTo=function(n){var e=this.body[0],t=e&&e.constructor!==Ut;n.appendIndent().append("<"+this.tagName),this.serializeAttributes(n),n.append(e?">":" />"),e&&(t&&n.appendNewLine().indent(),q(this.body,function(i){i.serializeTo(n)}),t&&n.unindent().appendIndent(),n.append("</"+this.tagName+">")),n.appendNewLine()};function di(n,e){me.call(this,n,e)}ms(di,me),di.prototype.parseNsAttributes=function(n){var e=me.prototype.parseNsAttributes.call(this,n),t=n.$descriptor;if(t.name===this.propertyDescriptor.type)return e;var i=this.typeNs=this.nsTagName(t);this.getNamespaces().logUsed(this.typeNs);var r=n.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(ci),(i.prefix?i.prefix+":":"")+o+t.ns.localName),e},di.prototype.isLocalNs=function(n){return n.uri===(this.typeNs||this.ns).uri};function ad(){this.value="",this.write=function(n){this.value+=n}}function ld(n,e){var t=[""];this.append=function(i){return n.write(i),this},this.appendNewLine=function(){return e&&n.write(`
|
|
28
|
+
`),this},this.appendIndent=function(){return e&&n.write(t.join(" ")),this},this.indent=function(){return t.push(""),this},this.unindent=function(){return t.pop(),this}}function ud(n){n=Y({format:!1,preamble:!0},n||{});function e(t,i){var r=i||new ad,o=new ld(r,n.format);if(n.preamble&&o.append(zf),new me().build(t).serializeTo(o),!i)return r.value}return{toXML:e}}function pi(n,e){He.call(this,n,e)}pi.prototype=Object.create(He.prototype),pi.prototype.fromXML=function(n,e,t){tt(e)||(t=e,e="bpmn:Definitions");var i=new pr(Y({model:this,lax:!0},t)),r=i.handler(e);return i.fromXML(n,r)},pi.prototype.toXML=function(n,e){var t=new ud(e);return new Promise(function(i,r){try{var o=t.toXML(n);return i({xml:o})}catch(l){return r(l)}})};var cd="BPMN20",fd="http://www.omg.org/spec/BPMN/20100524/MODEL",dd="bpmn",pd=[],hd=[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],md=[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],gd={tagAlias:"lowerCase",typePrefix:"t"},yd={name:cd,uri:fd,prefix:dd,associations:pd,types:hd,enumerations:md,xml:gd},vd="BPMNDI",_d="http://www.omg.org/spec/BPMN/20100524/DI",xd="bpmndi",Cd=[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],Ed=[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],Td=[],wd={name:vd,uri:_d,prefix:xd,types:Cd,enumerations:Ed,associations:Td},Sd="DC",Ad="http://www.omg.org/spec/DD/20100524/DC",bd="dc",Rd=[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],Md=[],Id={name:Sd,uri:Ad,prefix:bd,types:Rd,associations:Md},Pd="DI",kd="http://www.omg.org/spec/DD/20100524/DI",Nd="di",Dd=[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],Ld=[],Fd={tagAlias:"lowerCase"},Vd={name:Pd,uri:kd,prefix:Nd,types:Dd,associations:Ld,xml:Fd},Bd="bpmn.io colors for BPMN",Od="http://bpmn.io/schema/bpmn/biocolor/1.0",Ud="bioc",$d=[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],Gd=[],qd=[],Hd={name:Bd,uri:Od,prefix:Ud,types:$d,enumerations:Gd,associations:qd},Wd="BPMN in Color",zd="http://www.omg.org/spec/BPMN/non-normative/color/1.0",Yd="color",Kd=[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],Jd=[],Zd=[],Xd={name:Wd,uri:zd,prefix:Yd,types:Kd,enumerations:Jd,associations:Zd},Qd={bpmn:yd,bpmndi:wd,dc:Id,di:Vd,bioc:Hd,color:Xd};function jd(n,e){var t=Y({},Qd,n);return new pi(t,e)}var ep="Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472";function tp(n){Gn(n,"di")||Object.defineProperty(n,"di",{enumerable:!1,get:function(){throw new Error(ep)}})}function ke(n,e){return n.$instanceOf(e)}function np(n){return Je(n.rootElements,function(e){return ke(e,"bpmn:Process")||ke(e,"bpmn:Collaboration")})}function ip(n,e){var t={},i=[],r={};function o(v,E){return function(N){v(N,E)}}function l(v){t[v.id]=v}function u(v){return t[v.id]}function c(v,E){var N=v.gfx;if(N)throw new Error(e("already rendered {element}",{element:Re(v)}));return n.element(v,r[v.id],E)}function f(v,E){return n.root(v,r[v.id],E)}function d(v,E){try{var N=r[v.id]&&c(v,E);return l(v),N}catch(Z){h(Z.message,{element:v,error:Z}),console.error(e("failed to import {element}",{element:Re(v)})),console.error(Z)}}function h(v,E){n.error(v,E)}var g=this.registerDi=function(E){var N=E.bpmnElement;N?r[N.id]?h(e("multiple DI elements defined for {element}",{element:Re(N)}),{element:N}):(r[N.id]=E,tp(N)):h(e("no bpmnElement referenced in {element}",{element:Re(E)}),{element:E})};function x(v){w(v.plane)}function w(v){g(v),q(v.planeElement,b)}function b(v){g(v)}this.handleDefinitions=function(E,N){var Z=E.diagrams;if(N&&Z.indexOf(N)===-1)throw new Error(e("diagram not part of bpmn:Definitions"));if(!N&&Z&&Z.length&&(N=Z[0]),!N)throw new Error(e("no diagram to display"));r={},x(N);var ee=N.plane;if(!ee)throw new Error(e("no plane for {element}",{element:Re(N)}));var oe=ee.bpmnElement;if(!oe)if(oe=np(E),oe)h(e("correcting missing bpmnElement on {plane} to {rootElement}",{plane:Re(ee),rootElement:Re(oe)})),ee.bpmnElement=oe,g(ee);else throw new Error(e("no process or collaboration to display"));var Ae=f(oe,ee);if(ke(oe,"bpmn:Process")||ke(oe,"bpmn:SubProcess"))F(oe,Ae);else if(ke(oe,"bpmn:Collaboration"))m(oe,Ae),T(E.rootElements,Ae);else throw new Error(e("unsupported bpmnElement for {plane}: {rootElement}",{plane:Re(ee),rootElement:Re(oe)}));D(i)};var D=this.handleDeferred=function(){for(var E;i.length;)E=i.shift(),E()};function F(v,E){qe(v,E),P(v.ioSpecification,E),C(v.artifacts,E),l(v)}function T(v,E){var N=zt(v,function(Z){return!u(Z)&&ke(Z,"bpmn:Process")&&Z.laneSets});N.forEach(o(F,E))}function k(v,E){d(v,E)}function A(v,E){q(v,o(k,E))}function S(v,E){d(v,E)}function I(v,E){d(v,E)}function R(v,E){d(v,E)}function M(v,E){d(v,E)}function C(v,E){q(v,function(N){ke(N,"bpmn:Association")?i.push(function(){M(N,E)}):M(N,E)})}function P(v,E){v&&(q(v.dataInputs,o(I,E)),q(v.dataOutputs,o(R,E)))}var O=this.handleSubProcess=function(E,N){qe(E,N),C(E.artifacts,N)};function U(v,E){var N=d(v,E);ke(v,"bpmn:SubProcess")&&O(v,N||E),ke(v,"bpmn:Activity")&&P(v.ioSpecification,E),i.push(function(){q(v.dataInputAssociations,o(S,E)),q(v.dataOutputAssociations,o(S,E))})}function $(v,E){d(v,E)}function te(v,E){d(v,E)}function Fe(v,E){i.push(function(){var N=d(v,E);v.childLaneSet&&ce(v.childLaneSet,N||E),_(v)})}function ce(v,E){q(v.lanes,o(Fe,E))}function ne(v,E){q(v,o(ce,E))}function qe(v,E){y(v.flowElements,E),v.laneSets&&ne(v.laneSets,E)}function y(v,E){q(v,function(N){ke(N,"bpmn:SequenceFlow")?i.push(function(){$(N,E)}):ke(N,"bpmn:BoundaryEvent")?i.unshift(function(){U(N,E)}):ke(N,"bpmn:FlowNode")?U(N,E):ke(N,"bpmn:DataObject")||(ke(N,"bpmn:DataStoreReference")||ke(N,"bpmn:DataObjectReference")?te(N,E):h(e("unrecognized flowElement {element} in context {context}",{element:Re(N),context:E?Re(E.businessObject):"null"}),{element:N,context:E}))})}function p(v,E){var N=d(v,E),Z=v.processRef;Z&&F(Z,N||E)}function m(v,E){q(v.participants,o(p,E)),C(v.artifacts,E),i.push(function(){A(v.messageFlows,E)})}function _(v){q(v.flowNodeRef,function(E){var N=E.get("lanes");N&&N.push(v)})}}function rp(n,e,t){var i,r,o,l,u,c=[];function f(d,h){var g={root:function(D,F){return i.add(D,F)},element:function(D,F,T){return i.add(D,F,T)},error:function(D,F){c.push({message:D,context:F})}},x=new ip(g,o);h=h||d.diagrams&&d.diagrams[0];var w=op(d,h);if(!w)throw new Error(o("no diagram to display"));q(w,function(D){x.handleDefinitions(d,D)});var b=h.plane.bpmnElement.id;l.setRootElement(l.findRoot(b+"_plane")||l.findRoot(b))}return new Promise(function(d,h){try{return i=n.get("bpmnImporter"),r=n.get("eventBus"),o=n.get("translate"),l=n.get("canvas"),r.fire("import.render.start",{definitions:e}),f(e,t),r.fire("import.render.complete",{error:u,warnings:c}),d({warnings:c})}catch(g){return g.warnings=c,h(g)}})}function op(n,e){if(e){var t=e.plane.bpmnElement,i=t;!K(t,"bpmn:Process")&&!K(t,"bpmn:Collaboration")&&(i=sp(t));var r;K(i,"bpmn:Collaboration")?r=i:r=Je(n.rootElements,function(f){if(K(f,"bpmn:Collaboration"))return Je(f.participants,function(d){return d.processRef===i})});var o=[i];r&&(o=Ll(r.participants,function(f){return f.processRef}),o.push(r));var l=vs(o),u=[e],c=[t];return q(n.diagrams,function(f){var d=f.plane.bpmnElement;l.indexOf(d)!==-1&&c.indexOf(d)===-1&&(u.push(f),c.push(d))}),u}}function vs(n){var e=[];return q(n,function(t){t&&(e.push(t),e=e.concat(vs(t.flowElements)))}),e}function sp(n){for(var e=n;e;){if(K(e,"bpmn:Process"))return e;e=e.$parent}}var ap='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>',_s=ap,xs={verticalAlign:"middle"},Cs={color:"#404040"},lp={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},up={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},cp={position:"absolute",left:"50%",top:"40%",transform:"translate(-50%)",width:"260px",padding:"10px",background:"white",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",display:"flex",lineHeight:"1.3"},fp='<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link">'+_s+'</a><span>Web-based tooling for BPMN, DMN and forms powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>',rt;function dp(){rt=it(fp),Ve(rt,lp),Ve(Ze("svg",rt),xs),Ve(Ze(".backdrop",rt),up),Ve(Ze(".notice",rt),cp),Ve(Ze(".link",rt),Cs,{margin:"15px 20px 15px 10px",alignSelf:"center"})}function pp(){rt||(dp(),Yi.bind(rt,".backdrop","click",function(n){document.body.removeChild(rt)})),document.body.appendChild(rt)}function xe(n){n=Y({},mp,n),this._moddle=this._createModdle(n),this._container=this._createContainer(n),yp(this._container),this._init(this._container,this._moddle,n)}et(xe,jt),xe.prototype.importXML=async function(e,t){const i=this;function r(l){return i.get("eventBus").createEvent(l)}let o=[];try{e=this._emit("import.parse.start",{xml:e})||e;let l;try{l=await this._moddle.fromXML(e,"bpmn:Definitions")}catch(g){throw this._emit("import.parse.complete",{error:g}),g}let u=l.rootElement;const c=l.references,f=l.warnings,d=l.elementsById;o=o.concat(f),u=this._emit("import.parse.complete",r({error:null,definitions:u,elementsById:d,references:c,warnings:o}))||u;const h=await this.importDefinitions(u,t);return o=o.concat(h.warnings),this._emit("import.done",{error:null,warnings:o}),{warnings:o}}catch(l){let u=l;throw o=o.concat(u.warnings||[]),hi(u,o),u=hp(u),this._emit("import.done",{error:u,warnings:u.warnings}),u}},xe.prototype.importDefinitions=async function(e,t){return this._setDefinitions(e),{warnings:(await this.open(t)).warnings}},xe.prototype.open=async function(e){const t=this._definitions;let i=e;if(!t){const o=new Error("no XML imported");throw hi(o,[]),o}if(typeof e=="string"&&(i=gp(t,e),!i)){const o=new Error("BPMNDiagram <"+e+"> not found");throw hi(o,[]),o}try{this.clear()}catch(o){throw hi(o,[]),o}const{warnings:r}=await rp(this,t,i);return{warnings:r}},xe.prototype.saveXML=async function(e){e=e||{};let t=this._definitions,i,r;try{if(!t)throw new Error("no definitions loaded");t=this._emit("saveXML.start",{definitions:t})||t,r=(await this._moddle.toXML(t,e)).xml,r=this._emit("saveXML.serialized",{xml:r})||r}catch(l){i=l}const o=i?{error:i}:{xml:r};if(this._emit("saveXML.done",o),i)throw i;return o},xe.prototype.saveSVG=async function(){this._emit("saveSVG.start");let e,t;try{const i=this.get("canvas"),r=i.getActiveLayer(),o=Ze("defs",i._svg),l=ro(r),u=o?"<defs>"+ro(o)+"</defs>":"",c=r.getBBox();e=`<?xml version="1.0" encoding="utf-8"?>
|
|
29
|
+
<!-- created with bpmn-js / http://bpmn.io -->
|
|
30
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
31
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="`+c.width+'" height="'+c.height+'" viewBox="'+c.x+" "+c.y+" "+c.width+" "+c.height+'" version="1.1">'+u+l+"</svg>"}catch(i){t=i}if(this._emit("saveSVG.done",{error:t,svg:e}),t)throw t;return{svg:e}},xe.prototype._setDefinitions=function(n){this._definitions=n},xe.prototype.getModules=function(){return this._modules},xe.prototype.clear=function(){this.getDefinitions()&&jt.prototype.clear.call(this)},xe.prototype.destroy=function(){jt.prototype.destroy.call(this),Zn(this._container)},xe.prototype.on=function(n,e,t,i){return this.get("eventBus").on(n,e,t,i)},xe.prototype.off=function(n,e){this.get("eventBus").off(n,e)},xe.prototype.attachTo=function(n){if(!n)throw new Error("parentNode required");this.detach(),n.get&&n.constructor.prototype.jquery&&(n=n.get(0)),typeof n=="string"&&(n=Ze(n)),n.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},xe.prototype.getDefinitions=function(){return this._definitions},xe.prototype.detach=function(){const n=this._container,e=n.parentNode;e&&(this._emit("detach",{}),e.removeChild(n))},xe.prototype._init=function(n,e,t){const i=t.modules||this.getModules(t),r=t.additionalModules||[],o=[{bpmnjs:["value",this],moddle:["value",e]}],l=[].concat(o,i,r),u=Y($l(t,["additionalModules"]),{canvas:Y({},t.canvas,{container:n}),modules:l});jt.call(this,u),t&&t.container&&this.attachTo(t.container)},xe.prototype._emit=function(n,e){return this.get("eventBus").fire(n,e)},xe.prototype._createContainer=function(n){const e=it('<div class="bjs-container"></div>');return Ve(e,{width:Es(n.width),height:Es(n.height),position:n.position}),e},xe.prototype._createModdle=function(n){const e=Y({},this._moddleExtensions,n.moddleExtensions);return new jd(e)},xe.prototype._modules=[];function hi(n,e){return n.warnings=e,n}function hp(n){const t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(n.message);return t&&(n.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+t[2]),n}const mp={width:"100%",height:"100%",position:"relative"};function Es(n){return n+(gt(n)?"px":"")}function gp(n,e){return e&&Je(n.diagrams,function(t){return t.id===e})||null}function yp(n){const t='<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+_s+"</a>",i=it(t);Ve(Ze("svg",i),xs),Ve(i,Cs,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),n.appendChild(i),zi.bind(i,"click",function(r){pp(),r.preventDefault()})}function mi(n){xe.call(this,n)}et(mi,xe),mi.prototype._modules=[Cc,go,Nc,Mo,Qc],mi.prototype._moddleExtensions={};/**
|
|
24
32
|
* @license lucide-react v0.460.0 - ISC
|
|
25
33
|
*
|
|
26
34
|
* This source code is licensed under the ISC license.
|
|
27
35
|
* See the LICENSE file in the root directory of this source tree.
|
|
28
|
-
*/const
|
|
36
|
+
*/const vp=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ts=(...n)=>n.filter((e,t,i)=>!!e&&e.trim()!==""&&i.indexOf(e)===t).join(" ").trim();/**
|
|
29
37
|
* @license lucide-react v0.460.0 - ISC
|
|
30
38
|
*
|
|
31
39
|
* This source code is licensed under the ISC license.
|
|
32
40
|
* See the LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var
|
|
41
|
+
*/var _p={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
34
42
|
* @license lucide-react v0.460.0 - ISC
|
|
35
43
|
*
|
|
36
44
|
* This source code is licensed under the ISC license.
|
|
37
45
|
* See the LICENSE file in the root directory of this source tree.
|
|
38
|
-
*/const
|
|
46
|
+
*/const xp=Te.forwardRef(({color:n="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:i,className:r="",children:o,iconNode:l,...u},c)=>Te.createElement("svg",{ref:c,..._p,width:e,height:e,stroke:n,strokeWidth:i?Number(t)*24/Number(e):t,className:Ts("lucide",r),...u},[...l.map(([f,d])=>Te.createElement(f,d)),...Array.isArray(o)?o:[o]]));/**
|
|
39
47
|
* @license lucide-react v0.460.0 - ISC
|
|
40
48
|
*
|
|
41
49
|
* This source code is licensed under the ISC license.
|
|
42
50
|
* See the LICENSE file in the root directory of this source tree.
|
|
43
|
-
*/const
|
|
51
|
+
*/const Ne=(n,e)=>{const t=Te.forwardRef(({className:i,...r},o)=>Te.createElement(xp,{ref:o,iconNode:e,className:Ts(`lucide-${vp(n)}`,i),...r}));return t.displayName=`${n}`,t};/**
|
|
44
52
|
* @license lucide-react v0.460.0 - ISC
|
|
45
53
|
*
|
|
46
54
|
* This source code is licensed under the ISC license.
|
|
47
55
|
* See the LICENSE file in the root directory of this source tree.
|
|
48
|
-
*/const
|
|
56
|
+
*/const Cp=Ne("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
49
57
|
* @license lucide-react v0.460.0 - ISC
|
|
50
58
|
*
|
|
51
59
|
* This source code is licensed under the ISC license.
|
|
52
60
|
* See the LICENSE file in the root directory of this source tree.
|
|
53
|
-
*/const
|
|
61
|
+
*/const Ep=Ne("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/**
|
|
54
62
|
* @license lucide-react v0.460.0 - ISC
|
|
55
63
|
*
|
|
56
64
|
* This source code is licensed under the ISC license.
|
|
57
65
|
* See the LICENSE file in the root directory of this source tree.
|
|
58
|
-
*/const
|
|
66
|
+
*/const Tp=Ne("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
59
67
|
* @license lucide-react v0.460.0 - ISC
|
|
60
68
|
*
|
|
61
69
|
* This source code is licensed under the ISC license.
|
|
62
70
|
* See the LICENSE file in the root directory of this source tree.
|
|
63
|
-
*/const
|
|
71
|
+
*/const gi=Ne("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
64
72
|
* @license lucide-react v0.460.0 - ISC
|
|
65
73
|
*
|
|
66
74
|
* This source code is licensed under the ISC license.
|
|
67
75
|
* See the LICENSE file in the root directory of this source tree.
|
|
68
|
-
*/const
|
|
76
|
+
*/const wp=Ne("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
69
77
|
* @license lucide-react v0.460.0 - ISC
|
|
70
78
|
*
|
|
71
79
|
* This source code is licensed under the ISC license.
|
|
72
80
|
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
-
*/const
|
|
81
|
+
*/const Sp=Ne("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
74
82
|
* @license lucide-react v0.460.0 - ISC
|
|
75
83
|
*
|
|
76
84
|
* This source code is licensed under the ISC license.
|
|
77
85
|
* See the LICENSE file in the root directory of this source tree.
|
|
78
|
-
*/const
|
|
86
|
+
*/const Ap=Ne("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
79
87
|
* @license lucide-react v0.460.0 - ISC
|
|
80
88
|
*
|
|
81
89
|
* This source code is licensed under the ISC license.
|
|
82
90
|
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
-
*/const
|
|
91
|
+
*/const bp=Ne("GitCommitHorizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);/**
|
|
84
92
|
* @license lucide-react v0.460.0 - ISC
|
|
85
93
|
*
|
|
86
94
|
* This source code is licensed under the ISC license.
|
|
87
95
|
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
-
*/const
|
|
96
|
+
*/const Rp=Ne("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
|
|
89
97
|
* @license lucide-react v0.460.0 - ISC
|
|
90
98
|
*
|
|
91
99
|
* This source code is licensed under the ISC license.
|
|
92
100
|
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
-
*/const
|
|
101
|
+
*/const Mp=Ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
94
102
|
* @license lucide-react v0.460.0 - ISC
|
|
95
103
|
*
|
|
96
104
|
* This source code is licensed under the ISC license.
|
|
97
105
|
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
-
*/const
|
|
106
|
+
*/const ws=Ne("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
99
107
|
* @license lucide-react v0.460.0 - ISC
|
|
100
108
|
*
|
|
101
109
|
* This source code is licensed under the ISC license.
|
|
102
110
|
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
-
*/const
|
|
111
|
+
*/const Ip=Ne("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
|
104
112
|
* @license lucide-react v0.460.0 - ISC
|
|
105
113
|
*
|
|
106
114
|
* This source code is licensed under the ISC license.
|
|
107
115
|
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
-
*/const
|
|
116
|
+
*/const Pp=Ne("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
109
117
|
* @license lucide-react v0.460.0 - ISC
|
|
110
118
|
*
|
|
111
119
|
* This source code is licensed under the ISC license.
|
|
112
120
|
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
-
*/const
|
|
121
|
+
*/const kp=Ne("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
|
|
114
122
|
* @license lucide-react v0.460.0 - ISC
|
|
115
123
|
*
|
|
116
124
|
* This source code is licensed under the ISC license.
|
|
117
125
|
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
-
*/const gi=Z("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);var G;(function(o){o.assertEqual=i=>{};function e(i){}o.assertIs=e;function t(i){throw new Error}o.assertNever=t,o.arrayToEnum=i=>{const a={};for(const l of i)a[l]=l;return a},o.getValidEnumValues=i=>{const a=o.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),l={};for(const u of a)l[u]=i[u];return o.objectValues(l)},o.objectValues=i=>o.objectKeys(i).map(function(a){return i[a]}),o.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const l in i)Object.prototype.hasOwnProperty.call(i,l)&&a.push(l);return a},o.find=(i,a)=>{for(const l of i)if(a(l))return l},o.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(l=>typeof l=="string"?`'${l}'`:l).join(a)}o.joinValues=n,o.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(G||(G={}));var Ot;(function(o){o.mergeShapes=(e,t)=>({...e,...t})})(Ot||(Ot={}));const w=G.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ae=o=>{switch(typeof o){case"undefined":return w.undefined;case"string":return w.string;case"number":return Number.isNaN(o)?w.nan:w.number;case"boolean":return w.boolean;case"function":return w.function;case"bigint":return w.bigint;case"symbol":return w.symbol;case"object":return Array.isArray(o)?w.array:o===null?w.null:o.then&&typeof o.then=="function"&&o.catch&&typeof o.catch=="function"?w.promise:typeof Map<"u"&&o instanceof Map?w.map:typeof Set<"u"&&o instanceof Set?w.set:typeof Date<"u"&&o instanceof Date?w.date:w.object;default:return w.unknown}},T=G.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class se extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},n={_errors:[]},i=a=>{for(const l of a.issues)if(l.code==="invalid_union")l.unionErrors.map(i);else if(l.code==="invalid_return_type")i(l.returnTypeError);else if(l.code==="invalid_arguments")i(l.argumentsError);else if(l.path.length===0)n._errors.push(t(l));else{let u=n,d=0;for(;d<l.path.length;){const c=l.path[d];d===l.path.length-1?(u[c]=u[c]||{_errors:[]},u[c]._errors.push(t(l))):u[c]=u[c]||{_errors:[]},u=u[c],d++}}};return i(this),n}static assert(e){if(!(e instanceof se))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,G.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];t[a]=t[a]||[],t[a].push(e(i))}else n.push(e(i));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}se.create=o=>new se(o);const ut=(o,e)=>{let t;switch(o.code){case T.invalid_type:o.received===w.undefined?t="Required":t=`Expected ${o.expected}, received ${o.received}`;break;case T.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(o.expected,G.jsonStringifyReplacer)}`;break;case T.unrecognized_keys:t=`Unrecognized key(s) in object: ${G.joinValues(o.keys,", ")}`;break;case T.invalid_union:t="Invalid input";break;case T.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${G.joinValues(o.options)}`;break;case T.invalid_enum_value:t=`Invalid enum value. Expected ${G.joinValues(o.options)}, received '${o.received}'`;break;case T.invalid_arguments:t="Invalid function arguments";break;case T.invalid_return_type:t="Invalid function return type";break;case T.invalid_date:t="Invalid date";break;case T.invalid_string:typeof o.validation=="object"?"includes"in o.validation?(t=`Invalid input: must include "${o.validation.includes}"`,typeof o.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${o.validation.position}`)):"startsWith"in o.validation?t=`Invalid input: must start with "${o.validation.startsWith}"`:"endsWith"in o.validation?t=`Invalid input: must end with "${o.validation.endsWith}"`:G.assertNever(o.validation):o.validation!=="regex"?t=`Invalid ${o.validation}`:t="Invalid";break;case T.too_small:o.type==="array"?t=`Array must contain ${o.exact?"exactly":o.inclusive?"at least":"more than"} ${o.minimum} element(s)`:o.type==="string"?t=`String must contain ${o.exact?"exactly":o.inclusive?"at least":"over"} ${o.minimum} character(s)`:o.type==="number"?t=`Number must be ${o.exact?"exactly equal to ":o.inclusive?"greater than or equal to ":"greater than "}${o.minimum}`:o.type==="bigint"?t=`Number must be ${o.exact?"exactly equal to ":o.inclusive?"greater than or equal to ":"greater than "}${o.minimum}`:o.type==="date"?t=`Date must be ${o.exact?"exactly equal to ":o.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(o.minimum))}`:t="Invalid input";break;case T.too_big:o.type==="array"?t=`Array must contain ${o.exact?"exactly":o.inclusive?"at most":"less than"} ${o.maximum} element(s)`:o.type==="string"?t=`String must contain ${o.exact?"exactly":o.inclusive?"at most":"under"} ${o.maximum} character(s)`:o.type==="number"?t=`Number must be ${o.exact?"exactly":o.inclusive?"less than or equal to":"less than"} ${o.maximum}`:o.type==="bigint"?t=`BigInt must be ${o.exact?"exactly":o.inclusive?"less than or equal to":"less than"} ${o.maximum}`:o.type==="date"?t=`Date must be ${o.exact?"exactly":o.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(o.maximum))}`:t="Invalid input";break;case T.custom:t="Invalid input";break;case T.invalid_intersection_types:t="Intersection results could not be merged";break;case T.not_multiple_of:t=`Number must be a multiple of ${o.multipleOf}`;break;case T.not_finite:t="Number must be finite";break;default:t=e.defaultError,G.assertNever(o)}return{message:t}};let yi=ut;function vi(){return yi}const Ti=o=>{const{data:e,path:t,errorMaps:n,issueData:i}=o,a=[...t,...i.path||[]],l={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let u="";const d=n.filter(c=>!!c).slice().reverse();for(const c of d)u=c(l,{data:e,defaultError:u}).message;return{...i,path:a,message:u}};function _(o,e){const t=vi(),n=Ti({issueData:e,data:o.data,path:o.path,errorMaps:[o.common.contextualErrorMap,o.schemaErrorMap,t,t===ut?void 0:ut].filter(i=>!!i)});o.common.issues.push(n)}class K{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const i of t){if(i.status==="aborted")return D;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const i of t){const a=await i.key,l=await i.value;n.push({key:a,value:l})}return K.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const i of t){const{key:a,value:l}=i;if(a.status==="aborted"||l.status==="aborted")return D;a.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof l.value<"u"||i.alwaysSet)&&(n[a.value]=l.value)}return{status:e.value,value:n}}}const D=Object.freeze({status:"aborted"}),Le=o=>({status:"dirty",value:o}),j=o=>({status:"valid",value:o}),Ht=o=>o.status==="aborted",Jt=o=>o.status==="dirty",ve=o=>o.status==="valid",Je=o=>typeof Promise<"u"&&o instanceof Promise;var S;(function(o){o.errToObj=e=>typeof e=="string"?{message:e}:e||{},o.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(S||(S={}));class oe{constructor(e,t,n,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const zt=(o,e)=>{if(ve(e))return{success:!0,data:e.value};if(!o.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new se(o.common.issues);return this._error=t,this._error}}};function L(o){if(!o)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:i}=o;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(l,u)=>{const{message:d}=o;return l.code==="invalid_enum_value"?{message:d??u.defaultError}:typeof u.data>"u"?{message:d??n??u.defaultError}:l.code!=="invalid_type"?{message:u.defaultError}:{message:d??t??u.defaultError}},description:i}}class U{get description(){return this._def.description}_getType(e){return ae(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ae(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new K,ctx:{common:e.parent.common,data:e.data,parsedType:ae(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Je(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ae(e)},i=this._parseSync({data:e,path:n.path,parent:n});return zt(n,i)}"~validate"(e){var n,i;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ae(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return ve(a)?{value:a.value}:{issues:t.common.issues}}catch(a){(i=(n=a==null?void 0:a.message)==null?void 0:n.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>ve(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ae(e)},i=this._parse({data:e,path:n.path,parent:n}),a=await(Je(i)?i:Promise.resolve(i));return zt(n,a)}refine(e,t){const n=i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t;return this._refinement((i,a)=>{const l=e(i),u=()=>a.addIssue({code:T.custom,...n(i)});return typeof Promise<"u"&&l instanceof Promise?l.then(d=>d?!0:(u(),!1)):l?!0:(u(),!1)})}refinement(e,t){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof t=="function"?t(n,i):t),!1))}_refinement(e){return new xe({schema:this,typeName:N.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return ue.create(this,this._def)}nullable(){return Ee.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return re.create(this)}promise(){return Ke.create(this,this._def)}or(e){return We.create([this,e],this._def)}and(e){return Ye.create(this,e,this._def)}transform(e){return new xe({...L(this._def),schema:this,typeName:N.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new mt({...L(this._def),innerType:this,defaultValue:t,typeName:N.ZodDefault})}brand(){return new $i({typeName:N.ZodBranded,type:this,...L(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ht({...L(this._def),innerType:this,catchValue:t,typeName:N.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return gt.create(this,e)}readonly(){return yt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ci=/^c[^\s-]{8,}$/i,_i=/^[0-9a-z]+$/,xi=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ei=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,wi=/^[a-z0-9_-]{21}$/i,Si=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ai=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Mi=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ii="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ct;const Ri=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ki=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Ni=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Pi=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Di=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,bi=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Wt="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Li=new RegExp(`^${Wt}$`);function Yt(o){let e="[0-5]\\d";o.precision?e=`${e}\\.\\d{${o.precision}}`:o.precision==null&&(e=`${e}(\\.\\d+)?`);const t=o.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Vi(o){return new RegExp(`^${Yt(o)}$`)}function Fi(o){let e=`${Wt}T${Yt(o)}`;const t=[];return t.push(o.local?"Z?":"Z"),o.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Ui(o,e){return!!((e==="v4"||!e)&&Ri.test(o)||(e==="v6"||!e)&&Ni.test(o))}function Gi(o,e){if(!Si.test(o))return!1;try{const[t]=o.split(".");if(!t)return!1;const n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function Bi(o,e){return!!((e==="v4"||!e)&&ki.test(o)||(e==="v6"||!e)&&Pi.test(o))}class ie extends U{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==w.string){const a=this._getOrReturnCtx(e);return _(a,{code:T.invalid_type,expected:w.string,received:a.parsedType}),D}const n=new K;let i;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),_(i,{code:T.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),_(i,{code:T.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const l=e.data.length>a.value,u=e.data.length<a.value;(l||u)&&(i=this._getOrReturnCtx(e,i),l?_(i,{code:T.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):u&&_(i,{code:T.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")Mi.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"email",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")ct||(ct=new RegExp(Ii,"u")),ct.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"emoji",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")Ei.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"uuid",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")wi.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"nanoid",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Ci.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"cuid",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")_i.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"cuid2",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")xi.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"ulid",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),_(i,{validation:"url",code:T.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"regex",code:T.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(e,i),_(i,{code:T.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),_(i,{code:T.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),_(i,{code:T.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?Fi(a).test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{code:T.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?Li.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{code:T.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?Vi(a).test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{code:T.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?Ai.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"duration",code:T.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?Ui(e.data,a.version)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"ip",code:T.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?Gi(e.data,a.alg)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"jwt",code:T.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?Bi(e.data,a.version)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"cidr",code:T.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?Di.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"base64",code:T.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?bi.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"base64url",code:T.invalid_string,message:a.message}),n.dirty()):G.assertNever(a);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(i=>e.test(i),{validation:t,code:T.invalid_string,...S.errToObj(n)})}_addCheck(e){return new ie({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...S.errToObj(e)})}url(e){return this._addCheck({kind:"url",...S.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...S.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...S.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...S.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...S.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...S.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...S.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...S.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...S.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...S.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...S.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...S.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...S.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...S.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...S.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...S.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...S.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...S.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...S.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...S.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...S.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...S.errToObj(t)})}nonempty(e){return this.min(1,S.errToObj(e))}trim(){return new ie({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ie({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ie({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}ie.create=o=>new ie({checks:[],typeName:N.ZodString,coerce:(o==null?void 0:o.coerce)??!1,...L(o)});function qi(o,e){const t=(o.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=t>n?t:n,a=Number.parseInt(o.toFixed(i).replace(".","")),l=Number.parseInt(e.toFixed(i).replace(".",""));return a%l/10**i}class pe extends U{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==w.number){const a=this._getOrReturnCtx(e);return _(a,{code:T.invalid_type,expected:w.number,received:a.parsedType}),D}let n;const i=new K;for(const a of this._def.checks)a.kind==="int"?G.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{code:T.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),_(n,{code:T.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),_(n,{code:T.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?qi(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),_(n,{code:T.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{code:T.not_finite,message:a.message}),i.dirty()):G.assertNever(a);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,S.toString(t))}gt(e,t){return this.setLimit("min",e,!1,S.toString(t))}lte(e,t){return this.setLimit("max",e,!0,S.toString(t))}lt(e,t){return this.setLimit("max",e,!1,S.toString(t))}setLimit(e,t,n,i){return new pe({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:S.toString(i)}]})}_addCheck(e){return new pe({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:S.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:S.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:S.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:S.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:S.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&G.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}pe.create=o=>new pe({checks:[],typeName:N.ZodNumber,coerce:(o==null?void 0:o.coerce)||!1,...L(o)});class me extends U{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==w.bigint)return this._getInvalidInput(e);let n;const i=new K;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),_(n,{code:T.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),_(n,{code:T.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),_(n,{code:T.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):G.assertNever(a);return{status:i.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return _(t,{code:T.invalid_type,expected:w.bigint,received:t.parsedType}),D}gte(e,t){return this.setLimit("min",e,!0,S.toString(t))}gt(e,t){return this.setLimit("min",e,!1,S.toString(t))}lte(e,t){return this.setLimit("max",e,!0,S.toString(t))}lt(e,t){return this.setLimit("max",e,!1,S.toString(t))}setLimit(e,t,n,i){return new me({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:S.toString(i)}]})}_addCheck(e){return new me({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:S.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}me.create=o=>new me({checks:[],typeName:N.ZodBigInt,coerce:(o==null?void 0:o.coerce)??!1,...L(o)});class ze extends U{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==w.boolean){const n=this._getOrReturnCtx(e);return _(n,{code:T.invalid_type,expected:w.boolean,received:n.parsedType}),D}return j(e.data)}}ze.create=o=>new ze({typeName:N.ZodBoolean,coerce:(o==null?void 0:o.coerce)||!1,...L(o)});class Te extends U{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==w.date){const a=this._getOrReturnCtx(e);return _(a,{code:T.invalid_type,expected:w.date,received:a.parsedType}),D}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return _(a,{code:T.invalid_date}),D}const n=new K;let i;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),_(i,{code:T.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),_(i,{code:T.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):G.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Te({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:S.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:S.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}Te.create=o=>new Te({checks:[],coerce:(o==null?void 0:o.coerce)||!1,typeName:N.ZodDate,...L(o)});class Zt extends U{_parse(e){if(this._getType(e)!==w.symbol){const n=this._getOrReturnCtx(e);return _(n,{code:T.invalid_type,expected:w.symbol,received:n.parsedType}),D}return j(e.data)}}Zt.create=o=>new Zt({typeName:N.ZodSymbol,...L(o)});class Kt extends U{_parse(e){if(this._getType(e)!==w.undefined){const n=this._getOrReturnCtx(e);return _(n,{code:T.invalid_type,expected:w.undefined,received:n.parsedType}),D}return j(e.data)}}Kt.create=o=>new Kt({typeName:N.ZodUndefined,...L(o)});class Xt extends U{_parse(e){if(this._getType(e)!==w.null){const n=this._getOrReturnCtx(e);return _(n,{code:T.invalid_type,expected:w.null,received:n.parsedType}),D}return j(e.data)}}Xt.create=o=>new Xt({typeName:N.ZodNull,...L(o)});class Qt extends U{constructor(){super(...arguments),this._any=!0}_parse(e){return j(e.data)}}Qt.create=o=>new Qt({typeName:N.ZodAny,...L(o)});class dt extends U{constructor(){super(...arguments),this._unknown=!0}_parse(e){return j(e.data)}}dt.create=o=>new dt({typeName:N.ZodUnknown,...L(o)});class le extends U{_parse(e){const t=this._getOrReturnCtx(e);return _(t,{code:T.invalid_type,expected:w.never,received:t.parsedType}),D}}le.create=o=>new le({typeName:N.ZodNever,...L(o)});class jt extends U{_parse(e){if(this._getType(e)!==w.undefined){const n=this._getOrReturnCtx(e);return _(n,{code:T.invalid_type,expected:w.void,received:n.parsedType}),D}return j(e.data)}}jt.create=o=>new jt({typeName:N.ZodVoid,...L(o)});class re extends U{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),i=this._def;if(t.parsedType!==w.array)return _(t,{code:T.invalid_type,expected:w.array,received:t.parsedType}),D;if(i.exactLength!==null){const l=t.data.length>i.exactLength.value,u=t.data.length<i.exactLength.value;(l||u)&&(_(t,{code:l?T.too_big:T.too_small,minimum:u?i.exactLength.value:void 0,maximum:l?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&t.data.length<i.minLength.value&&(_(t,{code:T.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(_(t,{code:T.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((l,u)=>i.type._parseAsync(new oe(t,l,t.path,u)))).then(l=>K.mergeArray(n,l));const a=[...t.data].map((l,u)=>i.type._parseSync(new oe(t,l,t.path,u)));return K.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new re({...this._def,minLength:{value:e,message:S.toString(t)}})}max(e,t){return new re({...this._def,maxLength:{value:e,message:S.toString(t)}})}length(e,t){return new re({...this._def,exactLength:{value:e,message:S.toString(t)}})}nonempty(e){return this.min(1,e)}}re.create=(o,e)=>new re({type:o,minLength:null,maxLength:null,exactLength:null,typeName:N.ZodArray,...L(e)});function Ce(o){if(o instanceof z){const e={};for(const t in o.shape){const n=o.shape[t];e[t]=ue.create(Ce(n))}return new z({...o._def,shape:()=>e})}else return o instanceof re?new re({...o._def,type:Ce(o.element)}):o instanceof ue?ue.create(Ce(o.unwrap())):o instanceof Ee?Ee.create(Ce(o.unwrap())):o instanceof he?he.create(o.items.map(e=>Ce(e))):o}class z extends U{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=G.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==w.object){const c=this._getOrReturnCtx(e);return _(c,{code:T.invalid_type,expected:w.object,received:c.parsedType}),D}const{status:n,ctx:i}=this._processInputParams(e),{shape:a,keys:l}=this._getCached(),u=[];if(!(this._def.catchall instanceof le&&this._def.unknownKeys==="strip"))for(const c in i.data)l.includes(c)||u.push(c);const d=[];for(const c of l){const f=a[c],p=i.data[c];d.push({key:{status:"valid",value:c},value:f._parse(new oe(i,p,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof le){const c=this._def.unknownKeys;if(c==="passthrough")for(const f of u)d.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(c==="strict")u.length>0&&(_(i,{code:T.unrecognized_keys,keys:u}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const f of u){const p=i.data[f];d.push({key:{status:"valid",value:f},value:c._parse(new oe(i,p,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const f of d){const p=await f.key,m=await f.value;c.push({key:p,value:m,alwaysSet:f.alwaysSet})}return c}).then(c=>K.mergeObjectSync(n,c)):K.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return S.errToObj,new z({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var a,l;const i=((l=(a=this._def).errorMap)==null?void 0:l.call(a,t,n).message)??n.defaultError;return t.code==="unrecognized_keys"?{message:S.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new z({...this._def,unknownKeys:"strip"})}passthrough(){return new z({...this._def,unknownKeys:"passthrough"})}extend(e){return new z({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new z({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:N.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new z({...this._def,catchall:e})}pick(e){const t={};for(const n of G.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new z({...this._def,shape:()=>t})}omit(e){const t={};for(const n of G.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new z({...this._def,shape:()=>t})}deepPartial(){return Ce(this)}partial(e){const t={};for(const n of G.objectKeys(this.shape)){const i=this.shape[n];e&&!e[n]?t[n]=i:t[n]=i.optional()}return new z({...this._def,shape:()=>t})}required(e){const t={};for(const n of G.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof ue;)a=a._def.innerType;t[n]=a}return new z({...this._def,shape:()=>t})}keyof(){return nn(G.objectKeys(this.shape))}}z.create=(o,e)=>new z({shape:()=>o,unknownKeys:"strip",catchall:le.create(),typeName:N.ZodObject,...L(e)}),z.strictCreate=(o,e)=>new z({shape:()=>o,unknownKeys:"strict",catchall:le.create(),typeName:N.ZodObject,...L(e)}),z.lazycreate=(o,e)=>new z({shape:o,unknownKeys:"strip",catchall:le.create(),typeName:N.ZodObject,...L(e)});class We extends U{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function i(a){for(const u of a)if(u.result.status==="valid")return u.result;for(const u of a)if(u.result.status==="dirty")return t.common.issues.push(...u.ctx.common.issues),u.result;const l=a.map(u=>new se(u.ctx.common.issues));return _(t,{code:T.invalid_union,unionErrors:l}),D}if(t.common.async)return Promise.all(n.map(async a=>{const l={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:l}),ctx:l}})).then(i);{let a;const l=[];for(const d of n){const c={...t,common:{...t.common,issues:[]},parent:null},f=d._parseSync({data:t.data,path:t.path,parent:c});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:c}),c.common.issues.length&&l.push(c.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const u=l.map(d=>new se(d));return _(t,{code:T.invalid_union,unionErrors:u}),D}}get options(){return this._def.options}}We.create=(o,e)=>new We({options:o,typeName:N.ZodUnion,...L(e)});function ft(o,e){const t=ae(o),n=ae(e);if(o===e)return{valid:!0,data:o};if(t===w.object&&n===w.object){const i=G.objectKeys(e),a=G.objectKeys(o).filter(u=>i.indexOf(u)!==-1),l={...o,...e};for(const u of a){const d=ft(o[u],e[u]);if(!d.valid)return{valid:!1};l[u]=d.data}return{valid:!0,data:l}}else if(t===w.array&&n===w.array){if(o.length!==e.length)return{valid:!1};const i=[];for(let a=0;a<o.length;a++){const l=o[a],u=e[a],d=ft(l,u);if(!d.valid)return{valid:!1};i.push(d.data)}return{valid:!0,data:i}}else return t===w.date&&n===w.date&&+o==+e?{valid:!0,data:o}:{valid:!1}}class Ye extends U{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),i=(a,l)=>{if(Ht(a)||Ht(l))return D;const u=ft(a.value,l.value);return u.valid?((Jt(a)||Jt(l))&&t.dirty(),{status:t.value,value:u.data}):(_(n,{code:T.invalid_intersection_types}),D)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,l])=>i(a,l)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Ye.create=(o,e,t)=>new Ye({left:o,right:e,typeName:N.ZodIntersection,...L(t)});class he extends U{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.array)return _(n,{code:T.invalid_type,expected:w.array,received:n.parsedType}),D;if(n.data.length<this._def.items.length)return _(n,{code:T.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),D;!this._def.rest&&n.data.length>this._def.items.length&&(_(n,{code:T.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...n.data].map((l,u)=>{const d=this._def.items[u]||this._def.rest;return d?d._parse(new oe(n,l,n.path,u)):null}).filter(l=>!!l);return n.common.async?Promise.all(a).then(l=>K.mergeArray(t,l)):K.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new he({...this._def,rest:e})}}he.create=(o,e)=>{if(!Array.isArray(o))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new he({items:o,typeName:N.ZodTuple,rest:null,...L(e)})};class Ze extends U{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.object)return _(n,{code:T.invalid_type,expected:w.object,received:n.parsedType}),D;const i=[],a=this._def.keyType,l=this._def.valueType;for(const u in n.data)i.push({key:a._parse(new oe(n,u,n.path,u)),value:l._parse(new oe(n,n.data[u],n.path,u)),alwaysSet:u in n.data});return n.common.async?K.mergeObjectAsync(t,i):K.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof U?new Ze({keyType:e,valueType:t,typeName:N.ZodRecord,...L(n)}):new Ze({keyType:ie.create(),valueType:e,typeName:N.ZodRecord,...L(t)})}}class en extends U{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.map)return _(n,{code:T.invalid_type,expected:w.map,received:n.parsedType}),D;const i=this._def.keyType,a=this._def.valueType,l=[...n.data.entries()].map(([u,d],c)=>({key:i._parse(new oe(n,u,n.path,[c,"key"])),value:a._parse(new oe(n,d,n.path,[c,"value"]))}));if(n.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const d of l){const c=await d.key,f=await d.value;if(c.status==="aborted"||f.status==="aborted")return D;(c.status==="dirty"||f.status==="dirty")&&t.dirty(),u.set(c.value,f.value)}return{status:t.value,value:u}})}else{const u=new Map;for(const d of l){const c=d.key,f=d.value;if(c.status==="aborted"||f.status==="aborted")return D;(c.status==="dirty"||f.status==="dirty")&&t.dirty(),u.set(c.value,f.value)}return{status:t.value,value:u}}}}en.create=(o,e,t)=>new en({valueType:e,keyType:o,typeName:N.ZodMap,...L(t)});class Ve extends U{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.set)return _(n,{code:T.invalid_type,expected:w.set,received:n.parsedType}),D;const i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(_(n,{code:T.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(_(n,{code:T.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());const a=this._def.valueType;function l(d){const c=new Set;for(const f of d){if(f.status==="aborted")return D;f.status==="dirty"&&t.dirty(),c.add(f.value)}return{status:t.value,value:c}}const u=[...n.data.values()].map((d,c)=>a._parse(new oe(n,d,n.path,c)));return n.common.async?Promise.all(u).then(d=>l(d)):l(u)}min(e,t){return new Ve({...this._def,minSize:{value:e,message:S.toString(t)}})}max(e,t){return new Ve({...this._def,maxSize:{value:e,message:S.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ve.create=(o,e)=>new Ve({valueType:o,minSize:null,maxSize:null,typeName:N.ZodSet,...L(e)});class pt extends U{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}pt.create=(o,e)=>new pt({getter:o,typeName:N.ZodLazy,...L(e)});class tn extends U{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return _(t,{received:t.data,code:T.invalid_literal,expected:this._def.value}),D}return{status:"valid",value:e.data}}get value(){return this._def.value}}tn.create=(o,e)=>new tn({value:o,typeName:N.ZodLiteral,...L(e)});function nn(o,e){return new _e({values:o,typeName:N.ZodEnum,...L(e)})}class _e extends U{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return _(t,{expected:G.joinValues(n),received:t.parsedType,code:T.invalid_type}),D}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return _(t,{received:t.data,code:T.invalid_enum_value,options:n}),D}return j(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return _e.create(e,{...this._def,...t})}exclude(e,t=this._def){return _e.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}_e.create=nn;class on extends U{_parse(e){const t=G.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==w.string&&n.parsedType!==w.number){const i=G.objectValues(t);return _(n,{expected:G.joinValues(i),received:n.parsedType,code:T.invalid_type}),D}if(this._cache||(this._cache=new Set(G.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=G.objectValues(t);return _(n,{received:n.data,code:T.invalid_enum_value,options:i}),D}return j(e.data)}get enum(){return this._def.values}}on.create=(o,e)=>new on({values:o,typeName:N.ZodNativeEnum,...L(e)});class Ke extends U{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==w.promise&&t.common.async===!1)return _(t,{code:T.invalid_type,expected:w.promise,received:t.parsedType}),D;const n=t.parsedType===w.promise?t.data:Promise.resolve(t.data);return j(n.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Ke.create=(o,e)=>new Ke({type:o,typeName:N.ZodPromise,...L(e)});class xe extends U{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===N.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:l=>{_(n,l),l.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const l=i.transform(n.data,a);if(n.common.async)return Promise.resolve(l).then(async u=>{if(t.value==="aborted")return D;const d=await this._def.schema._parseAsync({data:u,path:n.path,parent:n});return d.status==="aborted"?D:d.status==="dirty"||t.value==="dirty"?Le(d.value):d});{if(t.value==="aborted")return D;const u=this._def.schema._parseSync({data:l,path:n.path,parent:n});return u.status==="aborted"?D:u.status==="dirty"||t.value==="dirty"?Le(u.value):u}}if(i.type==="refinement"){const l=u=>{const d=i.refinement(u,a);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(n.common.async===!1){const u=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return u.status==="aborted"?D:(u.status==="dirty"&&t.dirty(),l(u.value),{status:t.value,value:u.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(u=>u.status==="aborted"?D:(u.status==="dirty"&&t.dirty(),l(u.value).then(()=>({status:t.value,value:u.value}))))}if(i.type==="transform")if(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ve(l))return D;const u=i.transform(l.value,a);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:u}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>ve(l)?Promise.resolve(i.transform(l.value,a)).then(u=>({status:t.value,value:u})):D);G.assertNever(i)}}xe.create=(o,e,t)=>new xe({schema:o,typeName:N.ZodEffects,effect:e,...L(t)}),xe.createWithPreprocess=(o,e,t)=>new xe({schema:e,effect:{type:"preprocess",transform:o},typeName:N.ZodEffects,...L(t)});class ue extends U{_parse(e){return this._getType(e)===w.undefined?j(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ue.create=(o,e)=>new ue({innerType:o,typeName:N.ZodOptional,...L(e)});class Ee extends U{_parse(e){return this._getType(e)===w.null?j(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ee.create=(o,e)=>new Ee({innerType:o,typeName:N.ZodNullable,...L(e)});class mt extends U{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===w.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}mt.create=(o,e)=>new mt({innerType:o,typeName:N.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...L(e)});class ht extends U{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Je(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new se(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new se(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ht.create=(o,e)=>new ht({innerType:o,typeName:N.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...L(e)});class rn extends U{_parse(e){if(this._getType(e)!==w.nan){const n=this._getOrReturnCtx(e);return _(n,{code:T.invalid_type,expected:w.nan,received:n.parsedType}),D}return{status:"valid",value:e.data}}}rn.create=o=>new rn({typeName:N.ZodNaN,...L(o)});class $i extends U{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class gt extends U{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?D:a.status==="dirty"?(t.dirty(),Le(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?D:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,t){return new gt({in:e,out:t,typeName:N.ZodPipeline})}}class yt extends U{_parse(e){const t=this._def.innerType._parse(e),n=i=>(ve(i)&&(i.value=Object.freeze(i.value)),i);return Je(t)?t.then(i=>n(i)):n(t)}unwrap(){return this._def.innerType}}yt.create=(o,e)=>new yt({innerType:o,typeName:N.ZodReadonly,...L(e)});var N;(function(o){o.ZodString="ZodString",o.ZodNumber="ZodNumber",o.ZodNaN="ZodNaN",o.ZodBigInt="ZodBigInt",o.ZodBoolean="ZodBoolean",o.ZodDate="ZodDate",o.ZodSymbol="ZodSymbol",o.ZodUndefined="ZodUndefined",o.ZodNull="ZodNull",o.ZodAny="ZodAny",o.ZodUnknown="ZodUnknown",o.ZodNever="ZodNever",o.ZodVoid="ZodVoid",o.ZodArray="ZodArray",o.ZodObject="ZodObject",o.ZodUnion="ZodUnion",o.ZodDiscriminatedUnion="ZodDiscriminatedUnion",o.ZodIntersection="ZodIntersection",o.ZodTuple="ZodTuple",o.ZodRecord="ZodRecord",o.ZodMap="ZodMap",o.ZodSet="ZodSet",o.ZodFunction="ZodFunction",o.ZodLazy="ZodLazy",o.ZodLiteral="ZodLiteral",o.ZodEnum="ZodEnum",o.ZodEffects="ZodEffects",o.ZodNativeEnum="ZodNativeEnum",o.ZodOptional="ZodOptional",o.ZodNullable="ZodNullable",o.ZodDefault="ZodDefault",o.ZodCatch="ZodCatch",o.ZodPromise="ZodPromise",o.ZodBranded="ZodBranded",o.ZodPipeline="ZodPipeline",o.ZodReadonly="ZodReadonly"})(N||(N={}));const ge=ie.create,sn=pe.create;me.create;const Oi=ze.create;Te.create;const an=dt.create;le.create;const Fe=re.create,Hi=z.create,Ji=We.create;Ye.create,he.create;const zi=Ze.create,Wi=pt.create,Yi=_e.create;Ke.create,ue.create,Ee.create;const we={string:(o=>ie.create({...o,coerce:!0})),number:(o=>pe.create({...o,coerce:!0})),boolean:(o=>ze.create({...o,coerce:!0})),bigint:(o=>me.create({...o,coerce:!0})),date:(o=>Te.create({...o,coerce:!0}))};/**
|
|
126
|
+
*/const Np=Ne("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);var ae;(function(n){n.assertEqual=r=>{};function e(r){}n.assertIs=e;function t(r){throw new Error}n.assertNever=t,n.arrayToEnum=r=>{const o={};for(const l of r)o[l]=l;return o},n.getValidEnumValues=r=>{const o=n.objectKeys(r).filter(u=>typeof r[r[u]]!="number"),l={};for(const u of o)l[u]=r[u];return n.objectValues(l)},n.objectValues=r=>n.objectKeys(r).map(function(o){return r[o]}),n.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const o=[];for(const l in r)Object.prototype.hasOwnProperty.call(r,l)&&o.push(l);return o},n.find=(r,o)=>{for(const l of r)if(o(l))return l},n.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,o=" | "){return r.map(l=>typeof l=="string"?`'${l}'`:l).join(o)}n.joinValues=i,n.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(ae||(ae={}));var Ss;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(Ss||(Ss={}));const H=ae.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),St=n=>{switch(typeof n){case"undefined":return H.undefined;case"string":return H.string;case"number":return Number.isNaN(n)?H.nan:H.number;case"boolean":return H.boolean;case"function":return H.function;case"bigint":return H.bigint;case"symbol":return H.symbol;case"object":return Array.isArray(n)?H.array:n===null?H.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?H.promise:typeof Map<"u"&&n instanceof Map?H.map:typeof Set<"u"&&n instanceof Set?H.set:typeof Date<"u"&&n instanceof Date?H.date:H.object;default:return H.unknown}},L=ae.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ht extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(o){return o.message},i={_errors:[]},r=o=>{for(const l of o.issues)if(l.code==="invalid_union")l.unionErrors.map(r);else if(l.code==="invalid_return_type")r(l.returnTypeError);else if(l.code==="invalid_arguments")r(l.argumentsError);else if(l.path.length===0)i._errors.push(t(l));else{let u=i,c=0;for(;c<l.path.length;){const f=l.path[c];c===l.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(t(l))):u[f]=u[f]||{_errors:[]},u=u[f],c++}}};return r(this),i}static assert(e){if(!(e instanceof ht))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ae.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},i=[];for(const r of this.issues)if(r.path.length>0){const o=r.path[0];t[o]=t[o]||[],t[o].push(e(r))}else i.push(e(r));return{formErrors:i,fieldErrors:t}}get formErrors(){return this.flatten()}}ht.create=n=>new ht(n);const gr=(n,e)=>{let t;switch(n.code){case L.invalid_type:n.received===H.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case L.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,ae.jsonStringifyReplacer)}`;break;case L.unrecognized_keys:t=`Unrecognized key(s) in object: ${ae.joinValues(n.keys,", ")}`;break;case L.invalid_union:t="Invalid input";break;case L.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${ae.joinValues(n.options)}`;break;case L.invalid_enum_value:t=`Invalid enum value. Expected ${ae.joinValues(n.options)}, received '${n.received}'`;break;case L.invalid_arguments:t="Invalid function arguments";break;case L.invalid_return_type:t="Invalid function return type";break;case L.invalid_date:t="Invalid date";break;case L.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:ae.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case L.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="bigint"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case L.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case L.custom:t="Invalid input";break;case L.invalid_intersection_types:t="Intersection results could not be merged";break;case L.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case L.not_finite:t="Number must be finite";break;default:t=e.defaultError,ae.assertNever(n)}return{message:t}};let Dp=gr;function Lp(){return Dp}const Fp=n=>{const{data:e,path:t,errorMaps:i,issueData:r}=n,o=[...t,...r.path||[]],l={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let u="";const c=i.filter(f=>!!f).slice().reverse();for(const f of c)u=f(l,{data:e,defaultError:u}).message;return{...r,path:o,message:u}};function G(n,e){const t=Lp(),i=Fp({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===gr?void 0:gr].filter(r=>!!r)});n.common.issues.push(i)}class De{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const i=[];for(const r of t){if(r.status==="aborted")return j;r.status==="dirty"&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,t){const i=[];for(const r of t){const o=await r.key,l=await r.value;i.push({key:o,value:l})}return De.mergeObjectSync(e,i)}static mergeObjectSync(e,t){const i={};for(const r of t){const{key:o,value:l}=r;if(o.status==="aborted"||l.status==="aborted")return j;o.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof l.value<"u"||r.alwaysSet)&&(i[o.value]=l.value)}return{status:e.value,value:i}}}const j=Object.freeze({status:"aborted"}),Dn=n=>({status:"dirty",value:n}),We=n=>({status:"valid",value:n}),As=n=>n.status==="aborted",bs=n=>n.status==="dirty",rn=n=>n.status==="valid",yi=n=>typeof Promise<"u"&&n instanceof Promise;var W;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(W||(W={}));class ot{constructor(e,t,i,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=i,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Rs=(n,e)=>{if(rn(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ht(n.common.issues);return this._error=t,this._error}}};function ie(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:i,description:r}=n;if(e&&(t||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(l,u)=>{const{message:c}=n;return l.code==="invalid_enum_value"?{message:c??u.defaultError}:typeof u.data>"u"?{message:c??i??u.defaultError}:l.code!=="invalid_type"?{message:u.defaultError}:{message:c??t??u.defaultError}},description:r}}class se{get description(){return this._def.description}_getType(e){return St(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:St(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new De,ctx:{common:e.parent.common,data:e.data,parsedType:St(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(yi(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const i=this.safeParse(e,t);if(i.success)return i.data;throw i.error}safeParse(e,t){const i={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:St(e)},r=this._parseSync({data:e,path:i.path,parent:i});return Rs(i,r)}"~validate"(e){var i,r;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:St(e)};if(!this["~standard"].async)try{const o=this._parseSync({data:e,path:[],parent:t});return rn(o)?{value:o.value}:{issues:t.common.issues}}catch(o){(r=(i=o==null?void 0:o.message)==null?void 0:i.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(o=>rn(o)?{value:o.value}:{issues:t.common.issues})}async parseAsync(e,t){const i=await this.safeParseAsync(e,t);if(i.success)return i.data;throw i.error}async safeParseAsync(e,t){const i={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:St(e)},r=this._parse({data:e,path:i.path,parent:i}),o=await(yi(r)?r:Promise.resolve(r));return Rs(i,o)}refine(e,t){const i=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,o)=>{const l=e(r),u=()=>o.addIssue({code:L.custom,...i(r)});return typeof Promise<"u"&&l instanceof Promise?l.then(c=>c?!0:(u(),!1)):l?!0:(u(),!1)})}refinement(e,t){return this._refinement((i,r)=>e(i)?!0:(r.addIssue(typeof t=="function"?t(i,r):t),!1))}_refinement(e){return new ln({schema:this,typeName:Q.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return bt.create(this,this._def)}nullable(){return un.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return at.create(this)}promise(){return Ei.create(this,this._def)}or(e){return _i.create([this,e],this._def)}and(e){return xi.create(this,e,this._def)}transform(e){return new ln({...ie(this._def),schema:this,typeName:Q.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Cr({...ie(this._def),innerType:this,defaultValue:t,typeName:Q.ZodDefault})}brand(){return new oh({typeName:Q.ZodBranded,type:this,...ie(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Er({...ie(this._def),innerType:this,catchValue:t,typeName:Q.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Tr.create(this,e)}readonly(){return wr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Vp=/^c[^\s-]{8,}$/i,Bp=/^[0-9a-z]+$/,Op=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Up=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,$p=/^[a-z0-9_-]{21}$/i,Gp=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,qp=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Hp=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Wp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let yr;const zp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Yp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Kp=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Jp=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Zp=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Xp=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ms="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Qp=new RegExp(`^${Ms}$`);function Is(n){let e="[0-5]\\d";n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`);const t=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function jp(n){return new RegExp(`^${Is(n)}$`)}function eh(n){let e=`${Ms}T${Is(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function th(n,e){return!!((e==="v4"||!e)&&zp.test(n)||(e==="v6"||!e)&&Kp.test(n))}function nh(n,e){if(!Gp.test(n))return!1;try{const[t]=n.split(".");if(!t)return!1;const i=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function ih(n,e){return!!((e==="v4"||!e)&&Yp.test(n)||(e==="v6"||!e)&&Jp.test(n))}class st extends se{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==H.string){const o=this._getOrReturnCtx(e);return G(o,{code:L.invalid_type,expected:H.string,received:o.parsedType}),j}const i=new De;let r;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(r=this._getOrReturnCtx(e,r),G(r,{code:L.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")e.data.length>o.value&&(r=this._getOrReturnCtx(e,r),G(r,{code:L.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){const l=e.data.length>o.value,u=e.data.length<o.value;(l||u)&&(r=this._getOrReturnCtx(e,r),l?G(r,{code:L.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&G(r,{code:L.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")Hp.test(e.data)||(r=this._getOrReturnCtx(e,r),G(r,{validation:"email",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")yr||(yr=new RegExp(Wp,"u")),yr.test(e.data)||(r=this._getOrReturnCtx(e,r),G(r,{validation:"emoji",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")Up.test(e.data)||(r=this._getOrReturnCtx(e,r),G(r,{validation:"uuid",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")$p.test(e.data)||(r=this._getOrReturnCtx(e,r),G(r,{validation:"nanoid",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")Vp.test(e.data)||(r=this._getOrReturnCtx(e,r),G(r,{validation:"cuid",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")Bp.test(e.data)||(r=this._getOrReturnCtx(e,r),G(r,{validation:"cuid2",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")Op.test(e.data)||(r=this._getOrReturnCtx(e,r),G(r,{validation:"ulid",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),G(r,{validation:"url",code:L.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),G(r,{validation:"regex",code:L.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(e,r),G(r,{code:L.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(r=this._getOrReturnCtx(e,r),G(r,{code:L.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(r=this._getOrReturnCtx(e,r),G(r,{code:L.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?eh(o).test(e.data)||(r=this._getOrReturnCtx(e,r),G(r,{code:L.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?Qp.test(e.data)||(r=this._getOrReturnCtx(e,r),G(r,{code:L.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?jp(o).test(e.data)||(r=this._getOrReturnCtx(e,r),G(r,{code:L.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?qp.test(e.data)||(r=this._getOrReturnCtx(e,r),G(r,{validation:"duration",code:L.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?th(e.data,o.version)||(r=this._getOrReturnCtx(e,r),G(r,{validation:"ip",code:L.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?nh(e.data,o.alg)||(r=this._getOrReturnCtx(e,r),G(r,{validation:"jwt",code:L.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?ih(e.data,o.version)||(r=this._getOrReturnCtx(e,r),G(r,{validation:"cidr",code:L.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?Zp.test(e.data)||(r=this._getOrReturnCtx(e,r),G(r,{validation:"base64",code:L.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?Xp.test(e.data)||(r=this._getOrReturnCtx(e,r),G(r,{validation:"base64url",code:L.invalid_string,message:o.message}),i.dirty()):ae.assertNever(o);return{status:i.value,value:e.data}}_regex(e,t,i){return this.refinement(r=>e.test(r),{validation:t,code:L.invalid_string,...W.errToObj(i)})}_addCheck(e){return new st({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...W.errToObj(e)})}url(e){return this._addCheck({kind:"url",...W.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...W.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...W.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...W.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...W.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...W.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...W.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...W.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...W.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...W.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...W.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...W.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...W.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...W.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...W.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...W.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...W.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...W.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...W.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...W.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...W.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...W.errToObj(t)})}nonempty(e){return this.min(1,W.errToObj(e))}trim(){return new st({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new st({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new st({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}st.create=n=>new st({checks:[],typeName:Q.ZodString,coerce:(n==null?void 0:n.coerce)??!1,...ie(n)});function rh(n,e){const t=(n.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,r=t>i?t:i,o=Number.parseInt(n.toFixed(r).replace(".","")),l=Number.parseInt(e.toFixed(r).replace(".",""));return o%l/10**r}class $t extends se{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==H.number){const o=this._getOrReturnCtx(e);return G(o,{code:L.invalid_type,expected:H.number,received:o.parsedType}),j}let i;const r=new De;for(const o of this._def.checks)o.kind==="int"?ae.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{code:L.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),G(i,{code:L.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),G(i,{code:L.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?rh(e.data,o.value)!==0&&(i=this._getOrReturnCtx(e,i),G(i,{code:L.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{code:L.not_finite,message:o.message}),r.dirty()):ae.assertNever(o);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,W.toString(t))}gt(e,t){return this.setLimit("min",e,!1,W.toString(t))}lte(e,t){return this.setLimit("max",e,!0,W.toString(t))}lt(e,t){return this.setLimit("max",e,!1,W.toString(t))}setLimit(e,t,i,r){return new $t({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:W.toString(r)}]})}_addCheck(e){return new $t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:W.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:W.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:W.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:W.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:W.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:W.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:W.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:W.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:W.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ae.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(t===null||i.value>t)&&(t=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(t)&&Number.isFinite(e)}}$t.create=n=>new $t({checks:[],typeName:Q.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...ie(n)});class Gt extends se{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==H.bigint)return this._getInvalidInput(e);let i;const r=new De;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),G(i,{code:L.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),G(i,{code:L.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),G(i,{code:L.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):ae.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return G(t,{code:L.invalid_type,expected:H.bigint,received:t.parsedType}),j}gte(e,t){return this.setLimit("min",e,!0,W.toString(t))}gt(e,t){return this.setLimit("min",e,!1,W.toString(t))}lte(e,t){return this.setLimit("max",e,!0,W.toString(t))}lt(e,t){return this.setLimit("max",e,!1,W.toString(t))}setLimit(e,t,i,r){return new Gt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:W.toString(r)}]})}_addCheck(e){return new Gt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:W.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:W.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:W.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:W.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:W.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Gt.create=n=>new Gt({checks:[],typeName:Q.ZodBigInt,coerce:(n==null?void 0:n.coerce)??!1,...ie(n)});class vi extends se{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==H.boolean){const i=this._getOrReturnCtx(e);return G(i,{code:L.invalid_type,expected:H.boolean,received:i.parsedType}),j}return We(e.data)}}vi.create=n=>new vi({typeName:Q.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...ie(n)});class on extends se{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==H.date){const o=this._getOrReturnCtx(e);return G(o,{code:L.invalid_type,expected:H.date,received:o.parsedType}),j}if(Number.isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return G(o,{code:L.invalid_date}),j}const i=new De;let r;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(r=this._getOrReturnCtx(e,r),G(r,{code:L.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(r=this._getOrReturnCtx(e,r),G(r,{code:L.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):ae.assertNever(o);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new on({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:W.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:W.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}on.create=n=>new on({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:Q.ZodDate,...ie(n)});class Ps extends se{_parse(e){if(this._getType(e)!==H.symbol){const i=this._getOrReturnCtx(e);return G(i,{code:L.invalid_type,expected:H.symbol,received:i.parsedType}),j}return We(e.data)}}Ps.create=n=>new Ps({typeName:Q.ZodSymbol,...ie(n)});class ks extends se{_parse(e){if(this._getType(e)!==H.undefined){const i=this._getOrReturnCtx(e);return G(i,{code:L.invalid_type,expected:H.undefined,received:i.parsedType}),j}return We(e.data)}}ks.create=n=>new ks({typeName:Q.ZodUndefined,...ie(n)});class Ns extends se{_parse(e){if(this._getType(e)!==H.null){const i=this._getOrReturnCtx(e);return G(i,{code:L.invalid_type,expected:H.null,received:i.parsedType}),j}return We(e.data)}}Ns.create=n=>new Ns({typeName:Q.ZodNull,...ie(n)});class Ds extends se{constructor(){super(...arguments),this._any=!0}_parse(e){return We(e.data)}}Ds.create=n=>new Ds({typeName:Q.ZodAny,...ie(n)});class vr extends se{constructor(){super(...arguments),this._unknown=!0}_parse(e){return We(e.data)}}vr.create=n=>new vr({typeName:Q.ZodUnknown,...ie(n)});class At extends se{_parse(e){const t=this._getOrReturnCtx(e);return G(t,{code:L.invalid_type,expected:H.never,received:t.parsedType}),j}}At.create=n=>new At({typeName:Q.ZodNever,...ie(n)});class Ls extends se{_parse(e){if(this._getType(e)!==H.undefined){const i=this._getOrReturnCtx(e);return G(i,{code:L.invalid_type,expected:H.void,received:i.parsedType}),j}return We(e.data)}}Ls.create=n=>new Ls({typeName:Q.ZodVoid,...ie(n)});class at extends se{_parse(e){const{ctx:t,status:i}=this._processInputParams(e),r=this._def;if(t.parsedType!==H.array)return G(t,{code:L.invalid_type,expected:H.array,received:t.parsedType}),j;if(r.exactLength!==null){const l=t.data.length>r.exactLength.value,u=t.data.length<r.exactLength.value;(l||u)&&(G(t,{code:l?L.too_big:L.too_small,minimum:u?r.exactLength.value:void 0,maximum:l?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(G(t,{code:L.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(G(t,{code:L.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),t.common.async)return Promise.all([...t.data].map((l,u)=>r.type._parseAsync(new ot(t,l,t.path,u)))).then(l=>De.mergeArray(i,l));const o=[...t.data].map((l,u)=>r.type._parseSync(new ot(t,l,t.path,u)));return De.mergeArray(i,o)}get element(){return this._def.type}min(e,t){return new at({...this._def,minLength:{value:e,message:W.toString(t)}})}max(e,t){return new at({...this._def,maxLength:{value:e,message:W.toString(t)}})}length(e,t){return new at({...this._def,exactLength:{value:e,message:W.toString(t)}})}nonempty(e){return this.min(1,e)}}at.create=(n,e)=>new at({type:n,minLength:null,maxLength:null,exactLength:null,typeName:Q.ZodArray,...ie(e)});function sn(n){if(n instanceof we){const e={};for(const t in n.shape){const i=n.shape[t];e[t]=bt.create(sn(i))}return new we({...n._def,shape:()=>e})}else return n instanceof at?new at({...n._def,type:sn(n.element)}):n instanceof bt?bt.create(sn(n.unwrap())):n instanceof un?un.create(sn(n.unwrap())):n instanceof qt?qt.create(n.items.map(e=>sn(e))):n}class we extends se{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=ae.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==H.object){const f=this._getOrReturnCtx(e);return G(f,{code:L.invalid_type,expected:H.object,received:f.parsedType}),j}const{status:i,ctx:r}=this._processInputParams(e),{shape:o,keys:l}=this._getCached(),u=[];if(!(this._def.catchall instanceof At&&this._def.unknownKeys==="strip"))for(const f in r.data)l.includes(f)||u.push(f);const c=[];for(const f of l){const d=o[f],h=r.data[f];c.push({key:{status:"valid",value:f},value:d._parse(new ot(r,h,r.path,f)),alwaysSet:f in r.data})}if(this._def.catchall instanceof At){const f=this._def.unknownKeys;if(f==="passthrough")for(const d of u)c.push({key:{status:"valid",value:d},value:{status:"valid",value:r.data[d]}});else if(f==="strict")u.length>0&&(G(r,{code:L.unrecognized_keys,keys:u}),i.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const d of u){const h=r.data[d];c.push({key:{status:"valid",value:d},value:f._parse(new ot(r,h,r.path,d)),alwaysSet:d in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const f=[];for(const d of c){const h=await d.key,g=await d.value;f.push({key:h,value:g,alwaysSet:d.alwaysSet})}return f}).then(f=>De.mergeObjectSync(i,f)):De.mergeObjectSync(i,c)}get shape(){return this._def.shape()}strict(e){return W.errToObj,new we({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,i)=>{var o,l;const r=((l=(o=this._def).errorMap)==null?void 0:l.call(o,t,i).message)??i.defaultError;return t.code==="unrecognized_keys"?{message:W.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new we({...this._def,unknownKeys:"strip"})}passthrough(){return new we({...this._def,unknownKeys:"passthrough"})}extend(e){return new we({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new we({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Q.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new we({...this._def,catchall:e})}pick(e){const t={};for(const i of ae.objectKeys(e))e[i]&&this.shape[i]&&(t[i]=this.shape[i]);return new we({...this._def,shape:()=>t})}omit(e){const t={};for(const i of ae.objectKeys(this.shape))e[i]||(t[i]=this.shape[i]);return new we({...this._def,shape:()=>t})}deepPartial(){return sn(this)}partial(e){const t={};for(const i of ae.objectKeys(this.shape)){const r=this.shape[i];e&&!e[i]?t[i]=r:t[i]=r.optional()}return new we({...this._def,shape:()=>t})}required(e){const t={};for(const i of ae.objectKeys(this.shape))if(e&&!e[i])t[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof bt;)o=o._def.innerType;t[i]=o}return new we({...this._def,shape:()=>t})}keyof(){return Bs(ae.objectKeys(this.shape))}}we.create=(n,e)=>new we({shape:()=>n,unknownKeys:"strip",catchall:At.create(),typeName:Q.ZodObject,...ie(e)}),we.strictCreate=(n,e)=>new we({shape:()=>n,unknownKeys:"strict",catchall:At.create(),typeName:Q.ZodObject,...ie(e)}),we.lazycreate=(n,e)=>new we({shape:n,unknownKeys:"strip",catchall:At.create(),typeName:Q.ZodObject,...ie(e)});class _i extends se{_parse(e){const{ctx:t}=this._processInputParams(e),i=this._def.options;function r(o){for(const u of o)if(u.result.status==="valid")return u.result;for(const u of o)if(u.result.status==="dirty")return t.common.issues.push(...u.ctx.common.issues),u.result;const l=o.map(u=>new ht(u.ctx.common.issues));return G(t,{code:L.invalid_union,unionErrors:l}),j}if(t.common.async)return Promise.all(i.map(async o=>{const l={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:l}),ctx:l}})).then(r);{let o;const l=[];for(const c of i){const f={...t,common:{...t.common,issues:[]},parent:null},d=c._parseSync({data:t.data,path:t.path,parent:f});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:f}),f.common.issues.length&&l.push(f.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;const u=l.map(c=>new ht(c));return G(t,{code:L.invalid_union,unionErrors:u}),j}}get options(){return this._def.options}}_i.create=(n,e)=>new _i({options:n,typeName:Q.ZodUnion,...ie(e)});function _r(n,e){const t=St(n),i=St(e);if(n===e)return{valid:!0,data:n};if(t===H.object&&i===H.object){const r=ae.objectKeys(e),o=ae.objectKeys(n).filter(u=>r.indexOf(u)!==-1),l={...n,...e};for(const u of o){const c=_r(n[u],e[u]);if(!c.valid)return{valid:!1};l[u]=c.data}return{valid:!0,data:l}}else if(t===H.array&&i===H.array){if(n.length!==e.length)return{valid:!1};const r=[];for(let o=0;o<n.length;o++){const l=n[o],u=e[o],c=_r(l,u);if(!c.valid)return{valid:!1};r.push(c.data)}return{valid:!0,data:r}}else return t===H.date&&i===H.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class xi extends se{_parse(e){const{status:t,ctx:i}=this._processInputParams(e),r=(o,l)=>{if(As(o)||As(l))return j;const u=_r(o.value,l.value);return u.valid?((bs(o)||bs(l))&&t.dirty(),{status:t.value,value:u.data}):(G(i,{code:L.invalid_intersection_types}),j)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,l])=>r(o,l)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}xi.create=(n,e,t)=>new xi({left:n,right:e,typeName:Q.ZodIntersection,...ie(t)});class qt extends se{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==H.array)return G(i,{code:L.invalid_type,expected:H.array,received:i.parsedType}),j;if(i.data.length<this._def.items.length)return G(i,{code:L.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),j;!this._def.rest&&i.data.length>this._def.items.length&&(G(i,{code:L.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const o=[...i.data].map((l,u)=>{const c=this._def.items[u]||this._def.rest;return c?c._parse(new ot(i,l,i.path,u)):null}).filter(l=>!!l);return i.common.async?Promise.all(o).then(l=>De.mergeArray(t,l)):De.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new qt({...this._def,rest:e})}}qt.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new qt({items:n,typeName:Q.ZodTuple,rest:null,...ie(e)})};class Ci extends se{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==H.object)return G(i,{code:L.invalid_type,expected:H.object,received:i.parsedType}),j;const r=[],o=this._def.keyType,l=this._def.valueType;for(const u in i.data)r.push({key:o._parse(new ot(i,u,i.path,u)),value:l._parse(new ot(i,i.data[u],i.path,u)),alwaysSet:u in i.data});return i.common.async?De.mergeObjectAsync(t,r):De.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,i){return t instanceof se?new Ci({keyType:e,valueType:t,typeName:Q.ZodRecord,...ie(i)}):new Ci({keyType:st.create(),valueType:e,typeName:Q.ZodRecord,...ie(t)})}}class Fs extends se{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==H.map)return G(i,{code:L.invalid_type,expected:H.map,received:i.parsedType}),j;const r=this._def.keyType,o=this._def.valueType,l=[...i.data.entries()].map(([u,c],f)=>({key:r._parse(new ot(i,u,i.path,[f,"key"])),value:o._parse(new ot(i,c,i.path,[f,"value"]))}));if(i.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const c of l){const f=await c.key,d=await c.value;if(f.status==="aborted"||d.status==="aborted")return j;(f.status==="dirty"||d.status==="dirty")&&t.dirty(),u.set(f.value,d.value)}return{status:t.value,value:u}})}else{const u=new Map;for(const c of l){const f=c.key,d=c.value;if(f.status==="aborted"||d.status==="aborted")return j;(f.status==="dirty"||d.status==="dirty")&&t.dirty(),u.set(f.value,d.value)}return{status:t.value,value:u}}}}Fs.create=(n,e,t)=>new Fs({valueType:e,keyType:n,typeName:Q.ZodMap,...ie(t)});class Ln extends se{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==H.set)return G(i,{code:L.invalid_type,expected:H.set,received:i.parsedType}),j;const r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(G(i,{code:L.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(G(i,{code:L.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const o=this._def.valueType;function l(c){const f=new Set;for(const d of c){if(d.status==="aborted")return j;d.status==="dirty"&&t.dirty(),f.add(d.value)}return{status:t.value,value:f}}const u=[...i.data.values()].map((c,f)=>o._parse(new ot(i,c,i.path,f)));return i.common.async?Promise.all(u).then(c=>l(c)):l(u)}min(e,t){return new Ln({...this._def,minSize:{value:e,message:W.toString(t)}})}max(e,t){return new Ln({...this._def,maxSize:{value:e,message:W.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ln.create=(n,e)=>new Ln({valueType:n,minSize:null,maxSize:null,typeName:Q.ZodSet,...ie(e)});class xr extends se{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}xr.create=(n,e)=>new xr({getter:n,typeName:Q.ZodLazy,...ie(e)});class Vs extends se{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return G(t,{received:t.data,code:L.invalid_literal,expected:this._def.value}),j}return{status:"valid",value:e.data}}get value(){return this._def.value}}Vs.create=(n,e)=>new Vs({value:n,typeName:Q.ZodLiteral,...ie(e)});function Bs(n,e){return new an({values:n,typeName:Q.ZodEnum,...ie(e)})}class an extends se{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),i=this._def.values;return G(t,{expected:ae.joinValues(i),received:t.parsedType,code:L.invalid_type}),j}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),i=this._def.values;return G(t,{received:t.data,code:L.invalid_enum_value,options:i}),j}return We(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return an.create(e,{...this._def,...t})}exclude(e,t=this._def){return an.create(this.options.filter(i=>!e.includes(i)),{...this._def,...t})}}an.create=Bs;class Os extends se{_parse(e){const t=ae.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==H.string&&i.parsedType!==H.number){const r=ae.objectValues(t);return G(i,{expected:ae.joinValues(r),received:i.parsedType,code:L.invalid_type}),j}if(this._cache||(this._cache=new Set(ae.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const r=ae.objectValues(t);return G(i,{received:i.data,code:L.invalid_enum_value,options:r}),j}return We(e.data)}get enum(){return this._def.values}}Os.create=(n,e)=>new Os({values:n,typeName:Q.ZodNativeEnum,...ie(e)});class Ei extends se{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==H.promise&&t.common.async===!1)return G(t,{code:L.invalid_type,expected:H.promise,received:t.parsedType}),j;const i=t.parsedType===H.promise?t.data:Promise.resolve(t.data);return We(i.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Ei.create=(n,e)=>new Ei({type:n,typeName:Q.ZodPromise,...ie(e)});class ln extends se{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Q.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:i}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:l=>{G(i,l),l.fatal?t.abort():t.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){const l=r.transform(i.data,o);if(i.common.async)return Promise.resolve(l).then(async u=>{if(t.value==="aborted")return j;const c=await this._def.schema._parseAsync({data:u,path:i.path,parent:i});return c.status==="aborted"?j:c.status==="dirty"||t.value==="dirty"?Dn(c.value):c});{if(t.value==="aborted")return j;const u=this._def.schema._parseSync({data:l,path:i.path,parent:i});return u.status==="aborted"?j:u.status==="dirty"||t.value==="dirty"?Dn(u.value):u}}if(r.type==="refinement"){const l=u=>{const c=r.refinement(u,o);if(i.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(i.common.async===!1){const u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return u.status==="aborted"?j:(u.status==="dirty"&&t.dirty(),l(u.value),{status:t.value,value:u.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(u=>u.status==="aborted"?j:(u.status==="dirty"&&t.dirty(),l(u.value).then(()=>({status:t.value,value:u.value}))))}if(r.type==="transform")if(i.common.async===!1){const l=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!rn(l))return j;const u=r.transform(l.value,o);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:u}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(l=>rn(l)?Promise.resolve(r.transform(l.value,o)).then(u=>({status:t.value,value:u})):j);ae.assertNever(r)}}ln.create=(n,e,t)=>new ln({schema:n,typeName:Q.ZodEffects,effect:e,...ie(t)}),ln.createWithPreprocess=(n,e,t)=>new ln({schema:e,effect:{type:"preprocess",transform:n},typeName:Q.ZodEffects,...ie(t)});class bt extends se{_parse(e){return this._getType(e)===H.undefined?We(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}bt.create=(n,e)=>new bt({innerType:n,typeName:Q.ZodOptional,...ie(e)});class un extends se{_parse(e){return this._getType(e)===H.null?We(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}un.create=(n,e)=>new un({innerType:n,typeName:Q.ZodNullable,...ie(e)});class Cr extends se{_parse(e){const{ctx:t}=this._processInputParams(e);let i=t.data;return t.parsedType===H.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Cr.create=(n,e)=>new Cr({innerType:n,typeName:Q.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ie(e)});class Er extends se{_parse(e){const{ctx:t}=this._processInputParams(e),i={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return yi(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ht(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new ht(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Er.create=(n,e)=>new Er({innerType:n,typeName:Q.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ie(e)});class Us extends se{_parse(e){if(this._getType(e)!==H.nan){const i=this._getOrReturnCtx(e);return G(i,{code:L.invalid_type,expected:H.nan,received:i.parsedType}),j}return{status:"valid",value:e.data}}}Us.create=n=>new Us({typeName:Q.ZodNaN,...ie(n)});class oh extends se{_parse(e){const{ctx:t}=this._processInputParams(e),i=t.data;return this._def.type._parse({data:i,path:t.path,parent:t})}unwrap(){return this._def.type}}class Tr extends se{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?j:o.status==="dirty"?(t.dirty(),Dn(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{const r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?j:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(e,t){return new Tr({in:e,out:t,typeName:Q.ZodPipeline})}}class wr extends se{_parse(e){const t=this._def.innerType._parse(e),i=r=>(rn(r)&&(r.value=Object.freeze(r.value)),r);return yi(t)?t.then(r=>i(r)):i(t)}unwrap(){return this._def.innerType}}wr.create=(n,e)=>new wr({innerType:n,typeName:Q.ZodReadonly,...ie(e)});var Q;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(Q||(Q={}));const Ht=st.create,$s=$t.create;Gt.create;const sh=vi.create;on.create;const Gs=vr.create;At.create;const Fn=at.create,ah=we.create,lh=_i.create;xi.create,qt.create;const uh=Ci.create,ch=xr.create,fh=an.create;Ei.create,bt.create,un.create;const cn={string:(n=>st.create({...n,coerce:!0})),number:(n=>$t.create({...n,coerce:!0})),boolean:(n=>vi.create({...n,coerce:!0})),bigint:(n=>Gt.create({...n,coerce:!0})),date:(n=>on.create({...n,coerce:!0}))};/**
|
|
119
127
|
* @license
|
|
120
128
|
* Copyright 2025 Google LLC
|
|
121
129
|
* SPDX-License-Identifier: Apache-2.0
|
|
122
|
-
*/let
|
|
130
|
+
*/let dh,ph;function hh(){return{geminiUrl:dh,vertexUrl:ph}}function mh(n,e,t){var i,r,o;if(!(!((i=n.httpOptions)===null||i===void 0)&&i.baseUrl)){const l=hh();return n.vertexai?(r=l.vertexUrl)!==null&&r!==void 0?r:e:(o=l.geminiUrl)!==null&&o!==void 0?o:t}return n.httpOptions.baseUrl}/**
|
|
123
131
|
* @license
|
|
124
132
|
* Copyright 2025 Google LLC
|
|
125
133
|
* SPDX-License-Identifier: Apache-2.0
|
|
126
|
-
*/class
|
|
134
|
+
*/class fn{}function X(n,e){const t=/\{([^}]+)\}/g;return n.replace(t,(i,r)=>{if(Object.prototype.hasOwnProperty.call(e,r)){const o=e[r];return o!=null?String(o):""}else throw new Error(`Key '${r}' not found in valueMap.`)})}function a(n,e,t){for(let o=0;o<e.length-1;o++){const l=e[o];if(l.endsWith("[]")){const u=l.slice(0,-2);if(!(u in n))if(Array.isArray(t))n[u]=Array.from({length:t.length},()=>({}));else throw new Error(`Value must be a list given an array path ${l}`);if(Array.isArray(n[u])){const c=n[u];if(Array.isArray(t))for(let f=0;f<c.length;f++){const d=c[f];a(d,e.slice(o+1),t[f])}else for(const f of c)a(f,e.slice(o+1),t)}return}else if(l.endsWith("[0]")){const u=l.slice(0,-3);u in n||(n[u]=[{}]);const c=n[u];a(c[0],e.slice(o+1),t);return}(!n[l]||typeof n[l]!="object")&&(n[l]={}),n=n[l]}const i=e[e.length-1],r=n[i];if(r!==void 0){if(!t||typeof t=="object"&&Object.keys(t).length===0||t===r)return;if(typeof r=="object"&&typeof t=="object"&&r!==null&&t!==null)Object.assign(r,t);else throw new Error(`Cannot set value for an existing key. Key: ${i}`)}else n[i]=t}function s(n,e){try{if(e.length===1&&e[0]==="_self")return n;for(let t=0;t<e.length;t++){if(typeof n!="object"||n===null)return;const i=e[t];if(i.endsWith("[]")){const r=i.slice(0,-2);if(r in n){const o=n[r];return Array.isArray(o)?o.map(l=>s(l,e.slice(t+1))):void 0}else return}else n=n[i]}return n}catch(t){if(t instanceof TypeError)return;throw t}}/**
|
|
127
135
|
* @license
|
|
128
136
|
* Copyright 2025 Google LLC
|
|
129
137
|
* SPDX-License-Identifier: Apache-2.0
|
|
130
|
-
*/var ln;(function(o){o.OUTCOME_UNSPECIFIED="OUTCOME_UNSPECIFIED",o.OUTCOME_OK="OUTCOME_OK",o.OUTCOME_FAILED="OUTCOME_FAILED",o.OUTCOME_DEADLINE_EXCEEDED="OUTCOME_DEADLINE_EXCEEDED"})(ln||(ln={}));var un;(function(o){o.LANGUAGE_UNSPECIFIED="LANGUAGE_UNSPECIFIED",o.PYTHON="PYTHON"})(un||(un={}));var ee;(function(o){o.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",o.STRING="STRING",o.NUMBER="NUMBER",o.INTEGER="INTEGER",o.BOOLEAN="BOOLEAN",o.ARRAY="ARRAY",o.OBJECT="OBJECT",o.NULL="NULL"})(ee||(ee={}));var cn;(function(o){o.HARM_CATEGORY_UNSPECIFIED="HARM_CATEGORY_UNSPECIFIED",o.HARM_CATEGORY_HATE_SPEECH="HARM_CATEGORY_HATE_SPEECH",o.HARM_CATEGORY_DANGEROUS_CONTENT="HARM_CATEGORY_DANGEROUS_CONTENT",o.HARM_CATEGORY_HARASSMENT="HARM_CATEGORY_HARASSMENT",o.HARM_CATEGORY_SEXUALLY_EXPLICIT="HARM_CATEGORY_SEXUALLY_EXPLICIT",o.HARM_CATEGORY_CIVIC_INTEGRITY="HARM_CATEGORY_CIVIC_INTEGRITY"})(cn||(cn={}));var dn;(function(o){o.HARM_BLOCK_METHOD_UNSPECIFIED="HARM_BLOCK_METHOD_UNSPECIFIED",o.SEVERITY="SEVERITY",o.PROBABILITY="PROBABILITY"})(dn||(dn={}));var fn;(function(o){o.HARM_BLOCK_THRESHOLD_UNSPECIFIED="HARM_BLOCK_THRESHOLD_UNSPECIFIED",o.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",o.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",o.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",o.BLOCK_NONE="BLOCK_NONE",o.OFF="OFF"})(fn||(fn={}));var pn;(function(o){o.MODE_UNSPECIFIED="MODE_UNSPECIFIED",o.MODE_DYNAMIC="MODE_DYNAMIC"})(pn||(pn={}));var mn;(function(o){o.AUTH_TYPE_UNSPECIFIED="AUTH_TYPE_UNSPECIFIED",o.NO_AUTH="NO_AUTH",o.API_KEY_AUTH="API_KEY_AUTH",o.HTTP_BASIC_AUTH="HTTP_BASIC_AUTH",o.GOOGLE_SERVICE_ACCOUNT_AUTH="GOOGLE_SERVICE_ACCOUNT_AUTH",o.OAUTH="OAUTH",o.OIDC_AUTH="OIDC_AUTH"})(mn||(mn={}));var hn;(function(o){o.FINISH_REASON_UNSPECIFIED="FINISH_REASON_UNSPECIFIED",o.STOP="STOP",o.MAX_TOKENS="MAX_TOKENS",o.SAFETY="SAFETY",o.RECITATION="RECITATION",o.LANGUAGE="LANGUAGE",o.OTHER="OTHER",o.BLOCKLIST="BLOCKLIST",o.PROHIBITED_CONTENT="PROHIBITED_CONTENT",o.SPII="SPII",o.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",o.IMAGE_SAFETY="IMAGE_SAFETY",o.UNEXPECTED_TOOL_CALL="UNEXPECTED_TOOL_CALL"})(hn||(hn={}));var gn;(function(o){o.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",o.NEGLIGIBLE="NEGLIGIBLE",o.LOW="LOW",o.MEDIUM="MEDIUM",o.HIGH="HIGH"})(gn||(gn={}));var yn;(function(o){o.HARM_SEVERITY_UNSPECIFIED="HARM_SEVERITY_UNSPECIFIED",o.HARM_SEVERITY_NEGLIGIBLE="HARM_SEVERITY_NEGLIGIBLE",o.HARM_SEVERITY_LOW="HARM_SEVERITY_LOW",o.HARM_SEVERITY_MEDIUM="HARM_SEVERITY_MEDIUM",o.HARM_SEVERITY_HIGH="HARM_SEVERITY_HIGH"})(yn||(yn={}));var vn;(function(o){o.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",o.SAFETY="SAFETY",o.OTHER="OTHER",o.BLOCKLIST="BLOCKLIST",o.PROHIBITED_CONTENT="PROHIBITED_CONTENT"})(vn||(vn={}));var Tn;(function(o){o.TRAFFIC_TYPE_UNSPECIFIED="TRAFFIC_TYPE_UNSPECIFIED",o.ON_DEMAND="ON_DEMAND",o.PROVISIONED_THROUGHPUT="PROVISIONED_THROUGHPUT"})(Tn||(Tn={}));var Xe;(function(o){o.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",o.TEXT="TEXT",o.IMAGE="IMAGE",o.AUDIO="AUDIO"})(Xe||(Xe={}));var Cn;(function(o){o.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",o.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",o.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",o.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH"})(Cn||(Cn={}));var vt;(function(o){o.JOB_STATE_UNSPECIFIED="JOB_STATE_UNSPECIFIED",o.JOB_STATE_QUEUED="JOB_STATE_QUEUED",o.JOB_STATE_PENDING="JOB_STATE_PENDING",o.JOB_STATE_RUNNING="JOB_STATE_RUNNING",o.JOB_STATE_SUCCEEDED="JOB_STATE_SUCCEEDED",o.JOB_STATE_FAILED="JOB_STATE_FAILED",o.JOB_STATE_CANCELLING="JOB_STATE_CANCELLING",o.JOB_STATE_CANCELLED="JOB_STATE_CANCELLED",o.JOB_STATE_PAUSED="JOB_STATE_PAUSED",o.JOB_STATE_EXPIRED="JOB_STATE_EXPIRED",o.JOB_STATE_UPDATING="JOB_STATE_UPDATING",o.JOB_STATE_PARTIALLY_SUCCEEDED="JOB_STATE_PARTIALLY_SUCCEEDED"})(vt||(vt={}));var _n;(function(o){o.ADAPTER_SIZE_UNSPECIFIED="ADAPTER_SIZE_UNSPECIFIED",o.ADAPTER_SIZE_ONE="ADAPTER_SIZE_ONE",o.ADAPTER_SIZE_TWO="ADAPTER_SIZE_TWO",o.ADAPTER_SIZE_FOUR="ADAPTER_SIZE_FOUR",o.ADAPTER_SIZE_EIGHT="ADAPTER_SIZE_EIGHT",o.ADAPTER_SIZE_SIXTEEN="ADAPTER_SIZE_SIXTEEN",o.ADAPTER_SIZE_THIRTY_TWO="ADAPTER_SIZE_THIRTY_TWO"})(_n||(_n={}));var xn;(function(o){o.FEATURE_SELECTION_PREFERENCE_UNSPECIFIED="FEATURE_SELECTION_PREFERENCE_UNSPECIFIED",o.PRIORITIZE_QUALITY="PRIORITIZE_QUALITY",o.BALANCED="BALANCED",o.PRIORITIZE_COST="PRIORITIZE_COST"})(xn||(xn={}));var En;(function(o){o.UNSPECIFIED="UNSPECIFIED",o.BLOCKING="BLOCKING",o.NON_BLOCKING="NON_BLOCKING"})(En||(En={}));var wn;(function(o){o.MODE_UNSPECIFIED="MODE_UNSPECIFIED",o.MODE_DYNAMIC="MODE_DYNAMIC"})(wn||(wn={}));var Sn;(function(o){o.MODE_UNSPECIFIED="MODE_UNSPECIFIED",o.AUTO="AUTO",o.ANY="ANY",o.NONE="NONE"})(Sn||(Sn={}));var An;(function(o){o.URL_RETRIEVAL_STATUS_UNSPECIFIED="URL_RETRIEVAL_STATUS_UNSPECIFIED",o.URL_RETRIEVAL_STATUS_SUCCESS="URL_RETRIEVAL_STATUS_SUCCESS",o.URL_RETRIEVAL_STATUS_ERROR="URL_RETRIEVAL_STATUS_ERROR"})(An||(An={}));var Mn;(function(o){o.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",o.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",o.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",o.BLOCK_NONE="BLOCK_NONE"})(Mn||(Mn={}));var In;(function(o){o.DONT_ALLOW="DONT_ALLOW",o.ALLOW_ADULT="ALLOW_ADULT",o.ALLOW_ALL="ALLOW_ALL"})(In||(In={}));var Rn;(function(o){o.auto="auto",o.en="en",o.ja="ja",o.ko="ko",o.hi="hi"})(Rn||(Rn={}));var kn;(function(o){o.MASK_MODE_DEFAULT="MASK_MODE_DEFAULT",o.MASK_MODE_USER_PROVIDED="MASK_MODE_USER_PROVIDED",o.MASK_MODE_BACKGROUND="MASK_MODE_BACKGROUND",o.MASK_MODE_FOREGROUND="MASK_MODE_FOREGROUND",o.MASK_MODE_SEMANTIC="MASK_MODE_SEMANTIC"})(kn||(kn={}));var Nn;(function(o){o.CONTROL_TYPE_DEFAULT="CONTROL_TYPE_DEFAULT",o.CONTROL_TYPE_CANNY="CONTROL_TYPE_CANNY",o.CONTROL_TYPE_SCRIBBLE="CONTROL_TYPE_SCRIBBLE",o.CONTROL_TYPE_FACE_MESH="CONTROL_TYPE_FACE_MESH"})(Nn||(Nn={}));var Pn;(function(o){o.SUBJECT_TYPE_DEFAULT="SUBJECT_TYPE_DEFAULT",o.SUBJECT_TYPE_PERSON="SUBJECT_TYPE_PERSON",o.SUBJECT_TYPE_ANIMAL="SUBJECT_TYPE_ANIMAL",o.SUBJECT_TYPE_PRODUCT="SUBJECT_TYPE_PRODUCT"})(Pn||(Pn={}));var Dn;(function(o){o.EDIT_MODE_DEFAULT="EDIT_MODE_DEFAULT",o.EDIT_MODE_INPAINT_REMOVAL="EDIT_MODE_INPAINT_REMOVAL",o.EDIT_MODE_INPAINT_INSERTION="EDIT_MODE_INPAINT_INSERTION",o.EDIT_MODE_OUTPAINT="EDIT_MODE_OUTPAINT",o.EDIT_MODE_CONTROLLED_EDITING="EDIT_MODE_CONTROLLED_EDITING",o.EDIT_MODE_STYLE="EDIT_MODE_STYLE",o.EDIT_MODE_BGSWAP="EDIT_MODE_BGSWAP",o.EDIT_MODE_PRODUCT_IMAGE="EDIT_MODE_PRODUCT_IMAGE"})(Dn||(Dn={}));var bn;(function(o){o.STATE_UNSPECIFIED="STATE_UNSPECIFIED",o.PROCESSING="PROCESSING",o.ACTIVE="ACTIVE",o.FAILED="FAILED"})(bn||(bn={}));var Ln;(function(o){o.SOURCE_UNSPECIFIED="SOURCE_UNSPECIFIED",o.UPLOADED="UPLOADED",o.GENERATED="GENERATED"})(Ln||(Ln={}));var Vn;(function(o){o.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",o.TEXT="TEXT",o.IMAGE="IMAGE",o.VIDEO="VIDEO",o.AUDIO="AUDIO",o.DOCUMENT="DOCUMENT"})(Vn||(Vn={}));var Fn;(function(o){o.START_SENSITIVITY_UNSPECIFIED="START_SENSITIVITY_UNSPECIFIED",o.START_SENSITIVITY_HIGH="START_SENSITIVITY_HIGH",o.START_SENSITIVITY_LOW="START_SENSITIVITY_LOW"})(Fn||(Fn={}));var Un;(function(o){o.END_SENSITIVITY_UNSPECIFIED="END_SENSITIVITY_UNSPECIFIED",o.END_SENSITIVITY_HIGH="END_SENSITIVITY_HIGH",o.END_SENSITIVITY_LOW="END_SENSITIVITY_LOW"})(Un||(Un={}));var Gn;(function(o){o.ACTIVITY_HANDLING_UNSPECIFIED="ACTIVITY_HANDLING_UNSPECIFIED",o.START_OF_ACTIVITY_INTERRUPTS="START_OF_ACTIVITY_INTERRUPTS",o.NO_INTERRUPTION="NO_INTERRUPTION"})(Gn||(Gn={}));var Bn;(function(o){o.TURN_COVERAGE_UNSPECIFIED="TURN_COVERAGE_UNSPECIFIED",o.TURN_INCLUDES_ONLY_ACTIVITY="TURN_INCLUDES_ONLY_ACTIVITY",o.TURN_INCLUDES_ALL_INPUT="TURN_INCLUDES_ALL_INPUT"})(Bn||(Bn={}));var qn;(function(o){o.SCHEDULING_UNSPECIFIED="SCHEDULING_UNSPECIFIED",o.SILENT="SILENT",o.WHEN_IDLE="WHEN_IDLE",o.INTERRUPT="INTERRUPT"})(qn||(qn={}));var $n;(function(o){o.SCALE_UNSPECIFIED="SCALE_UNSPECIFIED",o.C_MAJOR_A_MINOR="C_MAJOR_A_MINOR",o.D_FLAT_MAJOR_B_FLAT_MINOR="D_FLAT_MAJOR_B_FLAT_MINOR",o.D_MAJOR_B_MINOR="D_MAJOR_B_MINOR",o.E_FLAT_MAJOR_C_MINOR="E_FLAT_MAJOR_C_MINOR",o.E_MAJOR_D_FLAT_MINOR="E_MAJOR_D_FLAT_MINOR",o.F_MAJOR_D_MINOR="F_MAJOR_D_MINOR",o.G_FLAT_MAJOR_E_FLAT_MINOR="G_FLAT_MAJOR_E_FLAT_MINOR",o.G_MAJOR_E_MINOR="G_MAJOR_E_MINOR",o.A_FLAT_MAJOR_F_MINOR="A_FLAT_MAJOR_F_MINOR",o.A_MAJOR_G_FLAT_MINOR="A_MAJOR_G_FLAT_MINOR",o.B_FLAT_MAJOR_G_MINOR="B_FLAT_MAJOR_G_MINOR",o.B_MAJOR_A_FLAT_MINOR="B_MAJOR_A_FLAT_MINOR"})($n||($n={}));var Ae;(function(o){o.PLAYBACK_CONTROL_UNSPECIFIED="PLAYBACK_CONTROL_UNSPECIFIED",o.PLAY="PLAY",o.PAUSE="PAUSE",o.STOP="STOP",o.RESET_CONTEXT="RESET_CONTEXT"})(Ae||(Ae={}));class Ue{get text(){var e,t,n,i,a,l,u,d;if(((i=(n=(t=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||t===void 0?void 0:t.content)===null||n===void 0?void 0:n.parts)===null||i===void 0?void 0:i.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning text from the first one.");let c="",f=!1;const p=[];for(const m of(d=(u=(l=(a=this.candidates)===null||a===void 0?void 0:a[0])===null||l===void 0?void 0:l.content)===null||u===void 0?void 0:u.parts)!==null&&d!==void 0?d:[]){for(const[h,g]of Object.entries(m))h!=="text"&&h!=="thought"&&(g!==null||g!==void 0)&&p.push(h);if(typeof m.text=="string"){if(typeof m.thought=="boolean"&&m.thought)continue;f=!0,c+=m.text}}return p.length>0&&console.warn(`there are non-text parts ${p} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),f?c:void 0}get data(){var e,t,n,i,a,l,u,d;if(((i=(n=(t=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||t===void 0?void 0:t.content)===null||n===void 0?void 0:n.parts)===null||i===void 0?void 0:i.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning data from the first one.");let c="";const f=[];for(const p of(d=(u=(l=(a=this.candidates)===null||a===void 0?void 0:a[0])===null||l===void 0?void 0:l.content)===null||u===void 0?void 0:u.parts)!==null&&d!==void 0?d:[]){for(const[m,h]of Object.entries(p))m!=="inlineData"&&(h!==null||h!==void 0)&&f.push(m);p.inlineData&&typeof p.inlineData.data=="string"&&(c+=atob(p.inlineData.data))}return f.length>0&&console.warn(`there are non-data parts ${f} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),c.length>0?btoa(c):void 0}get functionCalls(){var e,t,n,i,a,l,u,d;if(((i=(n=(t=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||t===void 0?void 0:t.content)===null||n===void 0?void 0:n.parts)===null||i===void 0?void 0:i.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning function calls from the first one.");const c=(d=(u=(l=(a=this.candidates)===null||a===void 0?void 0:a[0])===null||l===void 0?void 0:l.content)===null||u===void 0?void 0:u.parts)===null||d===void 0?void 0:d.filter(f=>f.functionCall).map(f=>f.functionCall).filter(f=>f!==void 0);if((c==null?void 0:c.length)!==0)return c}get executableCode(){var e,t,n,i,a,l,u,d,c;if(((i=(n=(t=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||t===void 0?void 0:t.content)===null||n===void 0?void 0:n.parts)===null||i===void 0?void 0:i.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning executable code from the first one.");const f=(d=(u=(l=(a=this.candidates)===null||a===void 0?void 0:a[0])===null||l===void 0?void 0:l.content)===null||u===void 0?void 0:u.parts)===null||d===void 0?void 0:d.filter(p=>p.executableCode).map(p=>p.executableCode).filter(p=>p!==void 0);if((f==null?void 0:f.length)!==0)return(c=f==null?void 0:f[0])===null||c===void 0?void 0:c.code}get codeExecutionResult(){var e,t,n,i,a,l,u,d,c;if(((i=(n=(t=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||t===void 0?void 0:t.content)===null||n===void 0?void 0:n.parts)===null||i===void 0?void 0:i.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning code execution result from the first one.");const f=(d=(u=(l=(a=this.candidates)===null||a===void 0?void 0:a[0])===null||l===void 0?void 0:l.content)===null||u===void 0?void 0:u.parts)===null||d===void 0?void 0:d.filter(p=>p.codeExecutionResult).map(p=>p.codeExecutionResult).filter(p=>p!==void 0);if((f==null?void 0:f.length)!==0)return(c=f==null?void 0:f[0])===null||c===void 0?void 0:c.output}}class On{}class Hn{}class ji{}class er{}class Jn{}class zn{}class Wn{}class tr{}class Yn{}class Zn{}class Kn{}class nr{}class Tt{constructor(e){const t={};for(const n of e.headers.entries())t[n[0]]=n[1];this.headers=t,this.responseInternal=e}json(){return this.responseInternal.json()}}class or{}class ir{}class rr{get text(){var e,t,n;let i="",a=!1;const l=[];for(const u of(n=(t=(e=this.serverContent)===null||e===void 0?void 0:e.modelTurn)===null||t===void 0?void 0:t.parts)!==null&&n!==void 0?n:[]){for(const[d,c]of Object.entries(u))d!=="text"&&d!=="thought"&&c!==null&&l.push(d);if(typeof u.text=="string"){if(typeof u.thought=="boolean"&&u.thought)continue;a=!0,i+=u.text}}return l.length>0&&console.warn(`there are non-text parts ${l} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),a?i:void 0}get data(){var e,t,n;let i="";const a=[];for(const l of(n=(t=(e=this.serverContent)===null||e===void 0?void 0:e.modelTurn)===null||t===void 0?void 0:t.parts)!==null&&n!==void 0?n:[]){for(const[u,d]of Object.entries(l))u!=="inlineData"&&d!==null&&a.push(u);l.inlineData&&typeof l.inlineData.data=="string"&&(i+=atob(l.inlineData.data))}return a.length>0&&console.warn(`there are non-data parts ${a} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),i.length>0?btoa(i):void 0}}class sr{get audioChunk(){if(this.serverContent&&this.serverContent.audioChunks&&this.serverContent.audioChunks.length>0)return this.serverContent.audioChunks[0]}}/**
|
|
138
|
+
*/var qs;(function(n){n.OUTCOME_UNSPECIFIED="OUTCOME_UNSPECIFIED",n.OUTCOME_OK="OUTCOME_OK",n.OUTCOME_FAILED="OUTCOME_FAILED",n.OUTCOME_DEADLINE_EXCEEDED="OUTCOME_DEADLINE_EXCEEDED"})(qs||(qs={}));var Hs;(function(n){n.LANGUAGE_UNSPECIFIED="LANGUAGE_UNSPECIFIED",n.PYTHON="PYTHON"})(Hs||(Hs={}));var ze;(function(n){n.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",n.STRING="STRING",n.NUMBER="NUMBER",n.INTEGER="INTEGER",n.BOOLEAN="BOOLEAN",n.ARRAY="ARRAY",n.OBJECT="OBJECT",n.NULL="NULL"})(ze||(ze={}));var Ws;(function(n){n.HARM_CATEGORY_UNSPECIFIED="HARM_CATEGORY_UNSPECIFIED",n.HARM_CATEGORY_HATE_SPEECH="HARM_CATEGORY_HATE_SPEECH",n.HARM_CATEGORY_DANGEROUS_CONTENT="HARM_CATEGORY_DANGEROUS_CONTENT",n.HARM_CATEGORY_HARASSMENT="HARM_CATEGORY_HARASSMENT",n.HARM_CATEGORY_SEXUALLY_EXPLICIT="HARM_CATEGORY_SEXUALLY_EXPLICIT",n.HARM_CATEGORY_CIVIC_INTEGRITY="HARM_CATEGORY_CIVIC_INTEGRITY"})(Ws||(Ws={}));var zs;(function(n){n.HARM_BLOCK_METHOD_UNSPECIFIED="HARM_BLOCK_METHOD_UNSPECIFIED",n.SEVERITY="SEVERITY",n.PROBABILITY="PROBABILITY"})(zs||(zs={}));var Ys;(function(n){n.HARM_BLOCK_THRESHOLD_UNSPECIFIED="HARM_BLOCK_THRESHOLD_UNSPECIFIED",n.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",n.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",n.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",n.BLOCK_NONE="BLOCK_NONE",n.OFF="OFF"})(Ys||(Ys={}));var Ks;(function(n){n.MODE_UNSPECIFIED="MODE_UNSPECIFIED",n.MODE_DYNAMIC="MODE_DYNAMIC"})(Ks||(Ks={}));var Js;(function(n){n.AUTH_TYPE_UNSPECIFIED="AUTH_TYPE_UNSPECIFIED",n.NO_AUTH="NO_AUTH",n.API_KEY_AUTH="API_KEY_AUTH",n.HTTP_BASIC_AUTH="HTTP_BASIC_AUTH",n.GOOGLE_SERVICE_ACCOUNT_AUTH="GOOGLE_SERVICE_ACCOUNT_AUTH",n.OAUTH="OAUTH",n.OIDC_AUTH="OIDC_AUTH"})(Js||(Js={}));var Zs;(function(n){n.FINISH_REASON_UNSPECIFIED="FINISH_REASON_UNSPECIFIED",n.STOP="STOP",n.MAX_TOKENS="MAX_TOKENS",n.SAFETY="SAFETY",n.RECITATION="RECITATION",n.LANGUAGE="LANGUAGE",n.OTHER="OTHER",n.BLOCKLIST="BLOCKLIST",n.PROHIBITED_CONTENT="PROHIBITED_CONTENT",n.SPII="SPII",n.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",n.IMAGE_SAFETY="IMAGE_SAFETY",n.UNEXPECTED_TOOL_CALL="UNEXPECTED_TOOL_CALL"})(Zs||(Zs={}));var Xs;(function(n){n.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",n.NEGLIGIBLE="NEGLIGIBLE",n.LOW="LOW",n.MEDIUM="MEDIUM",n.HIGH="HIGH"})(Xs||(Xs={}));var Qs;(function(n){n.HARM_SEVERITY_UNSPECIFIED="HARM_SEVERITY_UNSPECIFIED",n.HARM_SEVERITY_NEGLIGIBLE="HARM_SEVERITY_NEGLIGIBLE",n.HARM_SEVERITY_LOW="HARM_SEVERITY_LOW",n.HARM_SEVERITY_MEDIUM="HARM_SEVERITY_MEDIUM",n.HARM_SEVERITY_HIGH="HARM_SEVERITY_HIGH"})(Qs||(Qs={}));var js;(function(n){n.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",n.SAFETY="SAFETY",n.OTHER="OTHER",n.BLOCKLIST="BLOCKLIST",n.PROHIBITED_CONTENT="PROHIBITED_CONTENT"})(js||(js={}));var ea;(function(n){n.TRAFFIC_TYPE_UNSPECIFIED="TRAFFIC_TYPE_UNSPECIFIED",n.ON_DEMAND="ON_DEMAND",n.PROVISIONED_THROUGHPUT="PROVISIONED_THROUGHPUT"})(ea||(ea={}));var Ti;(function(n){n.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",n.TEXT="TEXT",n.IMAGE="IMAGE",n.AUDIO="AUDIO"})(Ti||(Ti={}));var ta;(function(n){n.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",n.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",n.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",n.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH"})(ta||(ta={}));var Sr;(function(n){n.JOB_STATE_UNSPECIFIED="JOB_STATE_UNSPECIFIED",n.JOB_STATE_QUEUED="JOB_STATE_QUEUED",n.JOB_STATE_PENDING="JOB_STATE_PENDING",n.JOB_STATE_RUNNING="JOB_STATE_RUNNING",n.JOB_STATE_SUCCEEDED="JOB_STATE_SUCCEEDED",n.JOB_STATE_FAILED="JOB_STATE_FAILED",n.JOB_STATE_CANCELLING="JOB_STATE_CANCELLING",n.JOB_STATE_CANCELLED="JOB_STATE_CANCELLED",n.JOB_STATE_PAUSED="JOB_STATE_PAUSED",n.JOB_STATE_EXPIRED="JOB_STATE_EXPIRED",n.JOB_STATE_UPDATING="JOB_STATE_UPDATING",n.JOB_STATE_PARTIALLY_SUCCEEDED="JOB_STATE_PARTIALLY_SUCCEEDED"})(Sr||(Sr={}));var na;(function(n){n.ADAPTER_SIZE_UNSPECIFIED="ADAPTER_SIZE_UNSPECIFIED",n.ADAPTER_SIZE_ONE="ADAPTER_SIZE_ONE",n.ADAPTER_SIZE_TWO="ADAPTER_SIZE_TWO",n.ADAPTER_SIZE_FOUR="ADAPTER_SIZE_FOUR",n.ADAPTER_SIZE_EIGHT="ADAPTER_SIZE_EIGHT",n.ADAPTER_SIZE_SIXTEEN="ADAPTER_SIZE_SIXTEEN",n.ADAPTER_SIZE_THIRTY_TWO="ADAPTER_SIZE_THIRTY_TWO"})(na||(na={}));var ia;(function(n){n.FEATURE_SELECTION_PREFERENCE_UNSPECIFIED="FEATURE_SELECTION_PREFERENCE_UNSPECIFIED",n.PRIORITIZE_QUALITY="PRIORITIZE_QUALITY",n.BALANCED="BALANCED",n.PRIORITIZE_COST="PRIORITIZE_COST"})(ia||(ia={}));var ra;(function(n){n.UNSPECIFIED="UNSPECIFIED",n.BLOCKING="BLOCKING",n.NON_BLOCKING="NON_BLOCKING"})(ra||(ra={}));var oa;(function(n){n.MODE_UNSPECIFIED="MODE_UNSPECIFIED",n.MODE_DYNAMIC="MODE_DYNAMIC"})(oa||(oa={}));var sa;(function(n){n.MODE_UNSPECIFIED="MODE_UNSPECIFIED",n.AUTO="AUTO",n.ANY="ANY",n.NONE="NONE"})(sa||(sa={}));var aa;(function(n){n.URL_RETRIEVAL_STATUS_UNSPECIFIED="URL_RETRIEVAL_STATUS_UNSPECIFIED",n.URL_RETRIEVAL_STATUS_SUCCESS="URL_RETRIEVAL_STATUS_SUCCESS",n.URL_RETRIEVAL_STATUS_ERROR="URL_RETRIEVAL_STATUS_ERROR"})(aa||(aa={}));var la;(function(n){n.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",n.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",n.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",n.BLOCK_NONE="BLOCK_NONE"})(la||(la={}));var ua;(function(n){n.DONT_ALLOW="DONT_ALLOW",n.ALLOW_ADULT="ALLOW_ADULT",n.ALLOW_ALL="ALLOW_ALL"})(ua||(ua={}));var ca;(function(n){n.auto="auto",n.en="en",n.ja="ja",n.ko="ko",n.hi="hi"})(ca||(ca={}));var fa;(function(n){n.MASK_MODE_DEFAULT="MASK_MODE_DEFAULT",n.MASK_MODE_USER_PROVIDED="MASK_MODE_USER_PROVIDED",n.MASK_MODE_BACKGROUND="MASK_MODE_BACKGROUND",n.MASK_MODE_FOREGROUND="MASK_MODE_FOREGROUND",n.MASK_MODE_SEMANTIC="MASK_MODE_SEMANTIC"})(fa||(fa={}));var da;(function(n){n.CONTROL_TYPE_DEFAULT="CONTROL_TYPE_DEFAULT",n.CONTROL_TYPE_CANNY="CONTROL_TYPE_CANNY",n.CONTROL_TYPE_SCRIBBLE="CONTROL_TYPE_SCRIBBLE",n.CONTROL_TYPE_FACE_MESH="CONTROL_TYPE_FACE_MESH"})(da||(da={}));var pa;(function(n){n.SUBJECT_TYPE_DEFAULT="SUBJECT_TYPE_DEFAULT",n.SUBJECT_TYPE_PERSON="SUBJECT_TYPE_PERSON",n.SUBJECT_TYPE_ANIMAL="SUBJECT_TYPE_ANIMAL",n.SUBJECT_TYPE_PRODUCT="SUBJECT_TYPE_PRODUCT"})(pa||(pa={}));var ha;(function(n){n.EDIT_MODE_DEFAULT="EDIT_MODE_DEFAULT",n.EDIT_MODE_INPAINT_REMOVAL="EDIT_MODE_INPAINT_REMOVAL",n.EDIT_MODE_INPAINT_INSERTION="EDIT_MODE_INPAINT_INSERTION",n.EDIT_MODE_OUTPAINT="EDIT_MODE_OUTPAINT",n.EDIT_MODE_CONTROLLED_EDITING="EDIT_MODE_CONTROLLED_EDITING",n.EDIT_MODE_STYLE="EDIT_MODE_STYLE",n.EDIT_MODE_BGSWAP="EDIT_MODE_BGSWAP",n.EDIT_MODE_PRODUCT_IMAGE="EDIT_MODE_PRODUCT_IMAGE"})(ha||(ha={}));var ma;(function(n){n.STATE_UNSPECIFIED="STATE_UNSPECIFIED",n.PROCESSING="PROCESSING",n.ACTIVE="ACTIVE",n.FAILED="FAILED"})(ma||(ma={}));var ga;(function(n){n.SOURCE_UNSPECIFIED="SOURCE_UNSPECIFIED",n.UPLOADED="UPLOADED",n.GENERATED="GENERATED"})(ga||(ga={}));var ya;(function(n){n.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",n.TEXT="TEXT",n.IMAGE="IMAGE",n.VIDEO="VIDEO",n.AUDIO="AUDIO",n.DOCUMENT="DOCUMENT"})(ya||(ya={}));var va;(function(n){n.START_SENSITIVITY_UNSPECIFIED="START_SENSITIVITY_UNSPECIFIED",n.START_SENSITIVITY_HIGH="START_SENSITIVITY_HIGH",n.START_SENSITIVITY_LOW="START_SENSITIVITY_LOW"})(va||(va={}));var _a;(function(n){n.END_SENSITIVITY_UNSPECIFIED="END_SENSITIVITY_UNSPECIFIED",n.END_SENSITIVITY_HIGH="END_SENSITIVITY_HIGH",n.END_SENSITIVITY_LOW="END_SENSITIVITY_LOW"})(_a||(_a={}));var xa;(function(n){n.ACTIVITY_HANDLING_UNSPECIFIED="ACTIVITY_HANDLING_UNSPECIFIED",n.START_OF_ACTIVITY_INTERRUPTS="START_OF_ACTIVITY_INTERRUPTS",n.NO_INTERRUPTION="NO_INTERRUPTION"})(xa||(xa={}));var Ca;(function(n){n.TURN_COVERAGE_UNSPECIFIED="TURN_COVERAGE_UNSPECIFIED",n.TURN_INCLUDES_ONLY_ACTIVITY="TURN_INCLUDES_ONLY_ACTIVITY",n.TURN_INCLUDES_ALL_INPUT="TURN_INCLUDES_ALL_INPUT"})(Ca||(Ca={}));var Ea;(function(n){n.SCHEDULING_UNSPECIFIED="SCHEDULING_UNSPECIFIED",n.SILENT="SILENT",n.WHEN_IDLE="WHEN_IDLE",n.INTERRUPT="INTERRUPT"})(Ea||(Ea={}));var Ta;(function(n){n.SCALE_UNSPECIFIED="SCALE_UNSPECIFIED",n.C_MAJOR_A_MINOR="C_MAJOR_A_MINOR",n.D_FLAT_MAJOR_B_FLAT_MINOR="D_FLAT_MAJOR_B_FLAT_MINOR",n.D_MAJOR_B_MINOR="D_MAJOR_B_MINOR",n.E_FLAT_MAJOR_C_MINOR="E_FLAT_MAJOR_C_MINOR",n.E_MAJOR_D_FLAT_MINOR="E_MAJOR_D_FLAT_MINOR",n.F_MAJOR_D_MINOR="F_MAJOR_D_MINOR",n.G_FLAT_MAJOR_E_FLAT_MINOR="G_FLAT_MAJOR_E_FLAT_MINOR",n.G_MAJOR_E_MINOR="G_MAJOR_E_MINOR",n.A_FLAT_MAJOR_F_MINOR="A_FLAT_MAJOR_F_MINOR",n.A_MAJOR_G_FLAT_MINOR="A_MAJOR_G_FLAT_MINOR",n.B_FLAT_MAJOR_G_MINOR="B_FLAT_MAJOR_G_MINOR",n.B_MAJOR_A_FLAT_MINOR="B_MAJOR_A_FLAT_MINOR"})(Ta||(Ta={}));var dn;(function(n){n.PLAYBACK_CONTROL_UNSPECIFIED="PLAYBACK_CONTROL_UNSPECIFIED",n.PLAY="PLAY",n.PAUSE="PAUSE",n.STOP="STOP",n.RESET_CONTEXT="RESET_CONTEXT"})(dn||(dn={}));class Vn{get text(){var e,t,i,r,o,l,u,c;if(((r=(i=(t=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||t===void 0?void 0:t.content)===null||i===void 0?void 0:i.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning text from the first one.");let f="",d=!1;const h=[];for(const g of(c=(u=(l=(o=this.candidates)===null||o===void 0?void 0:o[0])===null||l===void 0?void 0:l.content)===null||u===void 0?void 0:u.parts)!==null&&c!==void 0?c:[]){for(const[x,w]of Object.entries(g))x!=="text"&&x!=="thought"&&(w!==null||w!==void 0)&&h.push(x);if(typeof g.text=="string"){if(typeof g.thought=="boolean"&&g.thought)continue;d=!0,f+=g.text}}return h.length>0&&console.warn(`there are non-text parts ${h} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),d?f:void 0}get data(){var e,t,i,r,o,l,u,c;if(((r=(i=(t=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||t===void 0?void 0:t.content)===null||i===void 0?void 0:i.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning data from the first one.");let f="";const d=[];for(const h of(c=(u=(l=(o=this.candidates)===null||o===void 0?void 0:o[0])===null||l===void 0?void 0:l.content)===null||u===void 0?void 0:u.parts)!==null&&c!==void 0?c:[]){for(const[g,x]of Object.entries(h))g!=="inlineData"&&(x!==null||x!==void 0)&&d.push(g);h.inlineData&&typeof h.inlineData.data=="string"&&(f+=atob(h.inlineData.data))}return d.length>0&&console.warn(`there are non-data parts ${d} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),f.length>0?btoa(f):void 0}get functionCalls(){var e,t,i,r,o,l,u,c;if(((r=(i=(t=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||t===void 0?void 0:t.content)===null||i===void 0?void 0:i.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning function calls from the first one.");const f=(c=(u=(l=(o=this.candidates)===null||o===void 0?void 0:o[0])===null||l===void 0?void 0:l.content)===null||u===void 0?void 0:u.parts)===null||c===void 0?void 0:c.filter(d=>d.functionCall).map(d=>d.functionCall).filter(d=>d!==void 0);if((f==null?void 0:f.length)!==0)return f}get executableCode(){var e,t,i,r,o,l,u,c,f;if(((r=(i=(t=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||t===void 0?void 0:t.content)===null||i===void 0?void 0:i.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning executable code from the first one.");const d=(c=(u=(l=(o=this.candidates)===null||o===void 0?void 0:o[0])===null||l===void 0?void 0:l.content)===null||u===void 0?void 0:u.parts)===null||c===void 0?void 0:c.filter(h=>h.executableCode).map(h=>h.executableCode).filter(h=>h!==void 0);if((d==null?void 0:d.length)!==0)return(f=d==null?void 0:d[0])===null||f===void 0?void 0:f.code}get codeExecutionResult(){var e,t,i,r,o,l,u,c,f;if(((r=(i=(t=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||t===void 0?void 0:t.content)===null||i===void 0?void 0:i.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning code execution result from the first one.");const d=(c=(u=(l=(o=this.candidates)===null||o===void 0?void 0:o[0])===null||l===void 0?void 0:l.content)===null||u===void 0?void 0:u.parts)===null||c===void 0?void 0:c.filter(h=>h.codeExecutionResult).map(h=>h.codeExecutionResult).filter(h=>h!==void 0);if((d==null?void 0:d.length)!==0)return(f=d==null?void 0:d[0])===null||f===void 0?void 0:f.output}}class wa{}class Sa{}class gh{}class yh{}class Aa{}class ba{}class Ra{}class vh{}class Ma{}class Ia{}class Pa{}class _h{}class Ar{constructor(e){const t={};for(const i of e.headers.entries())t[i[0]]=i[1];this.headers=t,this.responseInternal=e}json(){return this.responseInternal.json()}}class xh{}class Ch{}class Eh{get text(){var e,t,i;let r="",o=!1;const l=[];for(const u of(i=(t=(e=this.serverContent)===null||e===void 0?void 0:e.modelTurn)===null||t===void 0?void 0:t.parts)!==null&&i!==void 0?i:[]){for(const[c,f]of Object.entries(u))c!=="text"&&c!=="thought"&&f!==null&&l.push(c);if(typeof u.text=="string"){if(typeof u.thought=="boolean"&&u.thought)continue;o=!0,r+=u.text}}return l.length>0&&console.warn(`there are non-text parts ${l} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),o?r:void 0}get data(){var e,t,i;let r="";const o=[];for(const l of(i=(t=(e=this.serverContent)===null||e===void 0?void 0:e.modelTurn)===null||t===void 0?void 0:t.parts)!==null&&i!==void 0?i:[]){for(const[u,c]of Object.entries(l))u!=="inlineData"&&c!==null&&o.push(u);l.inlineData&&typeof l.inlineData.data=="string"&&(r+=atob(l.inlineData.data))}return o.length>0&&console.warn(`there are non-data parts ${o} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),r.length>0?btoa(r):void 0}}class Th{get audioChunk(){if(this.serverContent&&this.serverContent.audioChunks&&this.serverContent.audioChunks.length>0)return this.serverContent.audioChunks[0]}}/**
|
|
131
139
|
* @license
|
|
132
140
|
* Copyright 2025 Google LLC
|
|
133
141
|
* SPDX-License-Identifier: Apache-2.0
|
|
134
|
-
*/function
|
|
142
|
+
*/function pe(n,e){if(!e||typeof e!="string")throw new Error("model is required and must be a string");if(n.isVertexAI()){if(e.startsWith("publishers/")||e.startsWith("projects/")||e.startsWith("models/"))return e;if(e.indexOf("/")>=0){const t=e.split("/",2);return`publishers/${t[0]}/models/${t[1]}`}else return`publishers/google/models/${e}`}else return e.startsWith("models/")||e.startsWith("tunedModels/")?e:`models/${e}`}function ka(n,e){const t=pe(n,e);return t?t.startsWith("publishers/")&&n.isVertexAI()?`projects/${n.getProject()}/locations/${n.getLocation()}/${t}`:t.startsWith("models/")&&n.isVertexAI()?`projects/${n.getProject()}/locations/${n.getLocation()}/publishers/google/${t}`:t:""}function Na(n,e){return Array.isArray(e)?e.map(t=>wi(n,t)):[wi(n,e)]}function wi(n,e){if(typeof e=="object"&&e!==null)return e;throw new Error(`Could not parse input as Blob. Unsupported blob type: ${typeof e}`)}function wh(n,e){const t=wi(n,e);if(t.mimeType&&t.mimeType.startsWith("image/"))return t;throw new Error(`Unsupported mime type: ${t.mimeType}`)}function Sh(n,e){const t=wi(n,e);if(t.mimeType&&t.mimeType.startsWith("audio/"))return t;throw new Error(`Unsupported mime type: ${t.mimeType}`)}function Da(n,e){if(e==null)throw new Error("PartUnion is required");if(typeof e=="object")return e;if(typeof e=="string")return{text:e};throw new Error(`Unsupported part type: ${typeof e}`)}function La(n,e){if(e==null||Array.isArray(e)&&e.length===0)throw new Error("PartListUnion is required");return Array.isArray(e)?e.map(t=>Da(n,t)):[Da(n,e)]}function br(n){return n!=null&&typeof n=="object"&&"parts"in n&&Array.isArray(n.parts)}function Fa(n){return n!=null&&typeof n=="object"&&"functionCall"in n}function Va(n){return n!=null&&typeof n=="object"&&"functionResponse"in n}function Le(n,e){if(e==null)throw new Error("ContentUnion is required");return br(e)?e:{role:"user",parts:La(n,e)}}function Ba(n,e){if(!e)return[];if(n.isVertexAI()&&Array.isArray(e))return e.flatMap(t=>{const i=Le(n,t);return i.parts&&i.parts.length>0&&i.parts[0].text!==void 0?[i.parts[0].text]:[]});if(n.isVertexAI()){const t=Le(n,e);return t.parts&&t.parts.length>0&&t.parts[0].text!==void 0?[t.parts[0].text]:[]}return Array.isArray(e)?e.map(t=>Le(n,t)):[Le(n,e)]}function Xe(n,e){if(e==null||Array.isArray(e)&&e.length===0)throw new Error("contents are required");if(!Array.isArray(e)){if(Fa(e)||Va(e))throw new Error("To specify functionCall or functionResponse parts, please wrap them in a Content object, specifying the role for them");return[Le(n,e)]}const t=[],i=[],r=br(e[0]);for(const o of e){const l=br(o);if(l!=r)throw new Error("Mixing Content and Parts is not supported, please group the parts into a the appropriate Content objects and specify the roles for them");if(l)t.push(o);else{if(Fa(o)||Va(o))throw new Error("To specify functionCall or functionResponse parts, please wrap them, and any other parts, in Content objects as appropriate, specifying the role for them");i.push(o)}}return r||t.push({role:"user",parts:La(n,i)}),t}const Ah=new Set(["type","format","title","description","default","items","minItems","maxItems","enum","properties","required","minProperties","maxProperties","minimum","maximum","minLength","maxLength","pattern","anyOf","propertyOrdering"]),Oa=fh(["string","number","integer","object","array","boolean","null"]),bh=lh([Oa,Fn(Oa)]);function Rh(n=!0){const e=ch(()=>{const t=ah({type:bh.optional(),format:Ht().optional(),title:Ht().optional(),description:Ht().optional(),default:Gs().optional(),items:e.optional(),minItems:cn.string().optional(),maxItems:cn.string().optional(),enum:Fn(Gs()).optional(),properties:uh(Ht(),e).optional(),required:Fn(Ht()).optional(),minProperties:cn.string().optional(),maxProperties:cn.string().optional(),propertyOrdering:Fn(Ht()).optional(),minimum:$s().optional(),maximum:$s().optional(),minLength:cn.string().optional(),maxLength:cn.string().optional(),pattern:Ht().optional(),anyOf:Fn(e).optional(),additionalProperties:sh().optional()});return n?t.strict():t});return e}function Mh(n,e){n.includes("null")&&(e.nullable=!0);const t=n.filter(i=>i!=="null");if(t.length===1)e.type=Object.keys(ze).includes(t[0].toUpperCase())?ze[t[0].toUpperCase()]:ze.TYPE_UNSPECIFIED;else{e.anyOf=[];for(const i of t)e.anyOf.push({type:Object.keys(ze).includes(i.toUpperCase())?ze[i.toUpperCase()]:ze.TYPE_UNSPECIFIED})}}function pn(n){const e={},t=["items"],i=["anyOf"],r=["properties"];if(n.type&&n.anyOf)throw new Error("type and anyOf cannot be both populated.");const o=n.anyOf;o!=null&&o.length==2&&(o[0].type==="null"?(e.nullable=!0,n=o[1]):o[1].type==="null"&&(e.nullable=!0,n=o[0])),n.type instanceof Array&&Mh(n.type,e);for(const[l,u]of Object.entries(n))if(u!=null)if(l=="type"){if(u==="null")throw new Error("type: null can not be the only possible type for the field.");if(u instanceof Array)continue;e.type=Object.keys(ze).includes(u.toUpperCase())?u.toUpperCase():ze.TYPE_UNSPECIFIED}else if(t.includes(l))e[l]=pn(u);else if(i.includes(l)){const c=[];for(const f of u){if(f.type=="null"){e.nullable=!0;continue}c.push(pn(f))}e[l]=c}else if(r.includes(l)){const c={};for(const[f,d]of Object.entries(u))c[f]=pn(d);e[l]=c}else{if(l==="additionalProperties")continue;e[l]=u}return e}function Si(n,e){if(Object.keys(e).includes("$schema")){delete e.$schema;const t=Rh().parse(e);return pn(t)}else return pn(e)}function Ua(n,e){if(typeof e=="object")return e;if(typeof e=="string")return{voiceConfig:{prebuiltVoiceConfig:{voiceName:e}}};throw new Error(`Unsupported speechConfig type: ${typeof e}`)}function Rr(n,e){if("multiSpeakerVoiceConfig"in e)throw new Error("multiSpeakerVoiceConfig is not supported in the live API.");return e}function Bn(n,e){if(e.functionDeclarations)for(const t of e.functionDeclarations)t.parameters&&(t.parameters=Si(n,t.parameters)),t.response&&(t.response=Si(n,t.response));return e}function On(n,e){if(e==null)throw new Error("tools is required");if(!Array.isArray(e))throw new Error("tools is required and must be an array of Tools");const t=[];for(const i of e)t.push(i);return t}function Ih(n,e,t,i=1){const r=!e.startsWith(`${t}/`)&&e.split("/").length===i;return n.isVertexAI()?e.startsWith("projects/")?e:e.startsWith("locations/")?`projects/${n.getProject()}/${e}`:e.startsWith(`${t}/`)?`projects/${n.getProject()}/locations/${n.getLocation()}/${e}`:r?`projects/${n.getProject()}/locations/${n.getLocation()}/${t}/${e}`:e:r?`${t}/${e}`:e}function Rt(n,e){if(typeof e!="string")throw new Error("name must be a string");return Ih(n,e,"cachedContents")}function $a(n,e){switch(e){case"STATE_UNSPECIFIED":return"JOB_STATE_UNSPECIFIED";case"CREATING":return"JOB_STATE_RUNNING";case"ACTIVE":return"JOB_STATE_SUCCEEDED";case"FAILED":return"JOB_STATE_FAILED";default:return e}}function Mt(n,e){if(typeof e!="string")throw new Error("fromImageBytes must be a string");return e}function Ph(n){return n!=null&&typeof n=="object"&&"name"in n}function kh(n){return n!=null&&typeof n=="object"&&"video"in n}function Nh(n){return n!=null&&typeof n=="object"&&"uri"in n}function Ga(n,e){var t;let i;if(Ph(e)&&(i=e.name),!(Nh(e)&&(i=e.uri,i===void 0))&&!(kh(e)&&(i=(t=e.video)===null||t===void 0?void 0:t.uri,i===void 0))){if(typeof e=="string"&&(i=e),i===void 0)throw new Error("Could not extract file name from the provided input.");if(i.startsWith("https://")){const o=i.split("files/")[1].match(/[a-z0-9]+/);if(o===null)throw new Error(`Could not extract file name from URI ${i}`);i=o[0]}else i.startsWith("files/")&&(i=i.split("files/")[1]);return i}}function qa(n,e){let t;return n.isVertexAI()?t=e?"publishers/google/models":"models":t=e?"models":"tunedModels",t}function Ha(n,e){for(const t of["models","tunedModels","publisherModels"])if(Dh(e,t))return e[t];return[]}function Dh(n,e){return n!==null&&typeof n=="object"&&e in n}function Lh(n,e={}){const t=n,i={name:t.name,description:t.description,parameters:pn(Ai(t.inputSchema))};return e.behavior&&(i.behavior=e.behavior),{functionDeclarations:[i]}}function Fh(n,e={}){const t=[],i=new Set;for(const r of n){const o=r.name;if(i.has(o))throw new Error(`Duplicate function name ${o} found in MCP tools. Please ensure function names are unique.`);i.add(o);const l=Lh(r,e);l.functionDeclarations&&t.push(...l.functionDeclarations)}return{functionDeclarations:t}}function Vh(n){const e=[];for(const t of n)e.push(Ai(t));return e}function Bh(n){const e={};for(const[t,i]of Object.entries(n)){const r=i;e[t]=Ai(r)}return e}function Ai(n){const e=new Set(["items"]),t=new Set(["anyOf"]),i=new Set(["properties"]),r={};for(const[o,l]of Object.entries(n))if(e.has(o))r[o]=Ai(l);else if(t.has(o))r[o]=Vh(l);else if(i.has(o))r[o]=Bh(l);else if(o==="type"){const u=l.toUpperCase();r[o]=Object.keys(ze).includes(u)?u:ze.TYPE_UNSPECIFIED}else Ah.has(o)&&(r[o]=l);return r}/**
|
|
135
143
|
* @license
|
|
136
144
|
* Copyright 2025 Google LLC
|
|
137
145
|
* SPDX-License-Identifier: Apache-2.0
|
|
138
|
-
*/function xr(o,e){const t={},n=r(e,["fps"]);n!=null&&s(t,["fps"],n);const i=r(e,["endOffset"]);i!=null&&s(t,["endOffset"],i);const a=r(e,["startOffset"]);return a!=null&&s(t,["startOffset"],a),t}function Er(o,e){const t={};if(r(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const n=r(e,["data"]);n!=null&&s(t,["data"],n);const i=r(e,["mimeType"]);return i!=null&&s(t,["mimeType"],i),t}function wr(o,e){const t={};if(r(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const n=r(e,["fileUri"]);n!=null&&s(t,["fileUri"],n);const i=r(e,["mimeType"]);return i!=null&&s(t,["mimeType"],i),t}function Sr(o,e){const t={},n=r(e,["videoMetadata"]);n!=null&&s(t,["videoMetadata"],xr(o,n));const i=r(e,["thought"]);i!=null&&s(t,["thought"],i);const a=r(e,["inlineData"]);a!=null&&s(t,["inlineData"],Er(o,a));const l=r(e,["fileData"]);l!=null&&s(t,["fileData"],wr(o,l));const u=r(e,["thoughtSignature"]);u!=null&&s(t,["thoughtSignature"],u);const d=r(e,["codeExecutionResult"]);d!=null&&s(t,["codeExecutionResult"],d);const c=r(e,["executableCode"]);c!=null&&s(t,["executableCode"],c);const f=r(e,["functionCall"]);f!=null&&s(t,["functionCall"],f);const p=r(e,["functionResponse"]);p!=null&&s(t,["functionResponse"],p);const m=r(e,["text"]);return m!=null&&s(t,["text"],m),t}function co(o,e){const t={},n=r(e,["parts"]);if(n!=null){let a=n;Array.isArray(a)&&(a=a.map(l=>Sr(o,l))),s(t,["parts"],a)}const i=r(e,["role"]);return i!=null&&s(t,["role"],i),t}function Ar(o,e){const t={},n=r(e,["behavior"]);n!=null&&s(t,["behavior"],n);const i=r(e,["description"]);i!=null&&s(t,["description"],i);const a=r(e,["name"]);a!=null&&s(t,["name"],a);const l=r(e,["parameters"]);l!=null&&s(t,["parameters"],l);const u=r(e,["response"]);return u!=null&&s(t,["response"],u),t}function Mr(o,e){const t={},n=r(e,["startTime"]);n!=null&&s(t,["startTime"],n);const i=r(e,["endTime"]);return i!=null&&s(t,["endTime"],i),t}function Ir(o,e){const t={},n=r(e,["timeRangeFilter"]);return n!=null&&s(t,["timeRangeFilter"],Mr(o,n)),t}function Rr(o,e){const t={},n=r(e,["mode"]);n!=null&&s(t,["mode"],n);const i=r(e,["dynamicThreshold"]);return i!=null&&s(t,["dynamicThreshold"],i),t}function kr(o,e){const t={},n=r(e,["dynamicRetrievalConfig"]);return n!=null&&s(t,["dynamicRetrievalConfig"],Rr(o,n)),t}function Nr(){return{}}function Pr(o,e){const t={},n=r(e,["functionDeclarations"]);if(n!=null){let d=n;Array.isArray(d)&&(d=d.map(c=>Ar(o,c))),s(t,["functionDeclarations"],d)}if(r(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const i=r(e,["googleSearch"]);i!=null&&s(t,["googleSearch"],Ir(o,i));const a=r(e,["googleSearchRetrieval"]);if(a!=null&&s(t,["googleSearchRetrieval"],kr(o,a)),r(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");if(r(e,["googleMaps"])!==void 0)throw new Error("googleMaps parameter is not supported in Gemini API.");r(e,["urlContext"])!=null&&s(t,["urlContext"],Nr());const u=r(e,["codeExecution"]);return u!=null&&s(t,["codeExecution"],u),t}function Dr(o,e){const t={},n=r(e,["mode"]);n!=null&&s(t,["mode"],n);const i=r(e,["allowedFunctionNames"]);return i!=null&&s(t,["allowedFunctionNames"],i),t}function br(o,e){const t={},n=r(e,["latitude"]);n!=null&&s(t,["latitude"],n);const i=r(e,["longitude"]);return i!=null&&s(t,["longitude"],i),t}function Lr(o,e){const t={},n=r(e,["latLng"]);n!=null&&s(t,["latLng"],br(o,n));const i=r(e,["languageCode"]);return i!=null&&s(t,["languageCode"],i),t}function Vr(o,e){const t={},n=r(e,["functionCallingConfig"]);n!=null&&s(t,["functionCallingConfig"],Dr(o,n));const i=r(e,["retrievalConfig"]);return i!=null&&s(t,["retrievalConfig"],Lr(o,i)),t}function Fr(o,e,t){const n={},i=r(e,["ttl"]);t!==void 0&&i!=null&&s(t,["ttl"],i);const a=r(e,["expireTime"]);t!==void 0&&a!=null&&s(t,["expireTime"],a);const l=r(e,["displayName"]);t!==void 0&&l!=null&&s(t,["displayName"],l);const u=r(e,["contents"]);if(t!==void 0&&u!=null){let p=te(o,u);Array.isArray(p)&&(p=p.map(m=>co(o,m))),s(t,["contents"],p)}const d=r(e,["systemInstruction"]);t!==void 0&&d!=null&&s(t,["systemInstruction"],co(o,X(o,d)));const c=r(e,["tools"]);if(t!==void 0&&c!=null){let p=c;Array.isArray(p)&&(p=p.map(m=>Pr(o,m))),s(t,["tools"],p)}const f=r(e,["toolConfig"]);if(t!==void 0&&f!=null&&s(t,["toolConfig"],Vr(o,f)),r(e,["kmsKeyName"])!==void 0)throw new Error("kmsKeyName parameter is not supported in Gemini API.");return n}function Ur(o,e){const t={},n=r(e,["model"]);n!=null&&s(t,["model"],Xn(o,n));const i=r(e,["config"]);return i!=null&&s(t,["config"],Fr(o,i,t)),t}function Gr(o,e){const t={},n=r(e,["name"]);n!=null&&s(t,["_url","name"],ce(o,n));const i=r(e,["config"]);return i!=null&&s(t,["config"],i),t}function Br(o,e){const t={},n=r(e,["name"]);n!=null&&s(t,["_url","name"],ce(o,n));const i=r(e,["config"]);return i!=null&&s(t,["config"],i),t}function qr(o,e,t){const n={},i=r(e,["ttl"]);t!==void 0&&i!=null&&s(t,["ttl"],i);const a=r(e,["expireTime"]);return t!==void 0&&a!=null&&s(t,["expireTime"],a),n}function $r(o,e){const t={},n=r(e,["name"]);n!=null&&s(t,["_url","name"],ce(o,n));const i=r(e,["config"]);return i!=null&&s(t,["config"],qr(o,i,t)),t}function Or(o,e,t){const n={},i=r(e,["pageSize"]);t!==void 0&&i!=null&&s(t,["_query","pageSize"],i);const a=r(e,["pageToken"]);return t!==void 0&&a!=null&&s(t,["_query","pageToken"],a),n}function Hr(o,e){const t={},n=r(e,["config"]);return n!=null&&s(t,["config"],Or(o,n,t)),t}function Jr(o,e){const t={},n=r(e,["fps"]);n!=null&&s(t,["fps"],n);const i=r(e,["endOffset"]);i!=null&&s(t,["endOffset"],i);const a=r(e,["startOffset"]);return a!=null&&s(t,["startOffset"],a),t}function zr(o,e){const t={},n=r(e,["displayName"]);n!=null&&s(t,["displayName"],n);const i=r(e,["data"]);i!=null&&s(t,["data"],i);const a=r(e,["mimeType"]);return a!=null&&s(t,["mimeType"],a),t}function Wr(o,e){const t={},n=r(e,["displayName"]);n!=null&&s(t,["displayName"],n);const i=r(e,["fileUri"]);i!=null&&s(t,["fileUri"],i);const a=r(e,["mimeType"]);return a!=null&&s(t,["mimeType"],a),t}function Yr(o,e){const t={},n=r(e,["videoMetadata"]);n!=null&&s(t,["videoMetadata"],Jr(o,n));const i=r(e,["thought"]);i!=null&&s(t,["thought"],i);const a=r(e,["inlineData"]);a!=null&&s(t,["inlineData"],zr(o,a));const l=r(e,["fileData"]);l!=null&&s(t,["fileData"],Wr(o,l));const u=r(e,["thoughtSignature"]);u!=null&&s(t,["thoughtSignature"],u);const d=r(e,["codeExecutionResult"]);d!=null&&s(t,["codeExecutionResult"],d);const c=r(e,["executableCode"]);c!=null&&s(t,["executableCode"],c);const f=r(e,["functionCall"]);f!=null&&s(t,["functionCall"],f);const p=r(e,["functionResponse"]);p!=null&&s(t,["functionResponse"],p);const m=r(e,["text"]);return m!=null&&s(t,["text"],m),t}function fo(o,e){const t={},n=r(e,["parts"]);if(n!=null){let a=n;Array.isArray(a)&&(a=a.map(l=>Yr(o,l))),s(t,["parts"],a)}const i=r(e,["role"]);return i!=null&&s(t,["role"],i),t}function Zr(o,e){const t={};if(r(e,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");const n=r(e,["description"]);n!=null&&s(t,["description"],n);const i=r(e,["name"]);i!=null&&s(t,["name"],i);const a=r(e,["parameters"]);a!=null&&s(t,["parameters"],a);const l=r(e,["response"]);return l!=null&&s(t,["response"],l),t}function Kr(o,e){const t={},n=r(e,["startTime"]);n!=null&&s(t,["startTime"],n);const i=r(e,["endTime"]);return i!=null&&s(t,["endTime"],i),t}function Xr(o,e){const t={},n=r(e,["timeRangeFilter"]);return n!=null&&s(t,["timeRangeFilter"],Kr(o,n)),t}function Qr(o,e){const t={},n=r(e,["mode"]);n!=null&&s(t,["mode"],n);const i=r(e,["dynamicThreshold"]);return i!=null&&s(t,["dynamicThreshold"],i),t}function jr(o,e){const t={},n=r(e,["dynamicRetrievalConfig"]);return n!=null&&s(t,["dynamicRetrievalConfig"],Qr(o,n)),t}function es(){return{}}function ts(o,e){const t={},n=r(e,["apiKeyString"]);return n!=null&&s(t,["apiKeyString"],n),t}function ns(o,e){const t={},n=r(e,["apiKeyConfig"]);n!=null&&s(t,["apiKeyConfig"],ts(o,n));const i=r(e,["authType"]);i!=null&&s(t,["authType"],i);const a=r(e,["googleServiceAccountConfig"]);a!=null&&s(t,["googleServiceAccountConfig"],a);const l=r(e,["httpBasicAuthConfig"]);l!=null&&s(t,["httpBasicAuthConfig"],l);const u=r(e,["oauthConfig"]);u!=null&&s(t,["oauthConfig"],u);const d=r(e,["oidcConfig"]);return d!=null&&s(t,["oidcConfig"],d),t}function os(o,e){const t={},n=r(e,["authConfig"]);return n!=null&&s(t,["authConfig"],ns(o,n)),t}function is(o,e){const t={},n=r(e,["functionDeclarations"]);if(n!=null){let f=n;Array.isArray(f)&&(f=f.map(p=>Zr(o,p))),s(t,["functionDeclarations"],f)}const i=r(e,["retrieval"]);i!=null&&s(t,["retrieval"],i);const a=r(e,["googleSearch"]);a!=null&&s(t,["googleSearch"],Xr(o,a));const l=r(e,["googleSearchRetrieval"]);l!=null&&s(t,["googleSearchRetrieval"],jr(o,l)),r(e,["enterpriseWebSearch"])!=null&&s(t,["enterpriseWebSearch"],es());const d=r(e,["googleMaps"]);if(d!=null&&s(t,["googleMaps"],os(o,d)),r(e,["urlContext"])!==void 0)throw new Error("urlContext parameter is not supported in Vertex AI.");const c=r(e,["codeExecution"]);return c!=null&&s(t,["codeExecution"],c),t}function rs(o,e){const t={},n=r(e,["mode"]);n!=null&&s(t,["mode"],n);const i=r(e,["allowedFunctionNames"]);return i!=null&&s(t,["allowedFunctionNames"],i),t}function ss(o,e){const t={},n=r(e,["latitude"]);n!=null&&s(t,["latitude"],n);const i=r(e,["longitude"]);return i!=null&&s(t,["longitude"],i),t}function as(o,e){const t={},n=r(e,["latLng"]);n!=null&&s(t,["latLng"],ss(o,n));const i=r(e,["languageCode"]);return i!=null&&s(t,["languageCode"],i),t}function ls(o,e){const t={},n=r(e,["functionCallingConfig"]);n!=null&&s(t,["functionCallingConfig"],rs(o,n));const i=r(e,["retrievalConfig"]);return i!=null&&s(t,["retrievalConfig"],as(o,i)),t}function us(o,e,t){const n={},i=r(e,["ttl"]);t!==void 0&&i!=null&&s(t,["ttl"],i);const a=r(e,["expireTime"]);t!==void 0&&a!=null&&s(t,["expireTime"],a);const l=r(e,["displayName"]);t!==void 0&&l!=null&&s(t,["displayName"],l);const u=r(e,["contents"]);if(t!==void 0&&u!=null){let m=te(o,u);Array.isArray(m)&&(m=m.map(h=>fo(o,h))),s(t,["contents"],m)}const d=r(e,["systemInstruction"]);t!==void 0&&d!=null&&s(t,["systemInstruction"],fo(o,X(o,d)));const c=r(e,["tools"]);if(t!==void 0&&c!=null){let m=c;Array.isArray(m)&&(m=m.map(h=>is(o,h))),s(t,["tools"],m)}const f=r(e,["toolConfig"]);t!==void 0&&f!=null&&s(t,["toolConfig"],ls(o,f));const p=r(e,["kmsKeyName"]);return t!==void 0&&p!=null&&s(t,["encryption_spec","kmsKeyName"],p),n}function cs(o,e){const t={},n=r(e,["model"]);n!=null&&s(t,["model"],Xn(o,n));const i=r(e,["config"]);return i!=null&&s(t,["config"],us(o,i,t)),t}function ds(o,e){const t={},n=r(e,["name"]);n!=null&&s(t,["_url","name"],ce(o,n));const i=r(e,["config"]);return i!=null&&s(t,["config"],i),t}function fs(o,e){const t={},n=r(e,["name"]);n!=null&&s(t,["_url","name"],ce(o,n));const i=r(e,["config"]);return i!=null&&s(t,["config"],i),t}function ps(o,e,t){const n={},i=r(e,["ttl"]);t!==void 0&&i!=null&&s(t,["ttl"],i);const a=r(e,["expireTime"]);return t!==void 0&&a!=null&&s(t,["expireTime"],a),n}function ms(o,e){const t={},n=r(e,["name"]);n!=null&&s(t,["_url","name"],ce(o,n));const i=r(e,["config"]);return i!=null&&s(t,["config"],ps(o,i,t)),t}function hs(o,e,t){const n={},i=r(e,["pageSize"]);t!==void 0&&i!=null&&s(t,["_query","pageSize"],i);const a=r(e,["pageToken"]);return t!==void 0&&a!=null&&s(t,["_query","pageToken"],a),n}function gs(o,e){const t={},n=r(e,["config"]);return n!=null&&s(t,["config"],hs(o,n,t)),t}function tt(o,e){const t={},n=r(e,["name"]);n!=null&&s(t,["name"],n);const i=r(e,["displayName"]);i!=null&&s(t,["displayName"],i);const a=r(e,["model"]);a!=null&&s(t,["model"],a);const l=r(e,["createTime"]);l!=null&&s(t,["createTime"],l);const u=r(e,["updateTime"]);u!=null&&s(t,["updateTime"],u);const d=r(e,["expireTime"]);d!=null&&s(t,["expireTime"],d);const c=r(e,["usageMetadata"]);return c!=null&&s(t,["usageMetadata"],c),t}function ys(){return{}}function vs(o,e){const t={},n=r(e,["nextPageToken"]);n!=null&&s(t,["nextPageToken"],n);const i=r(e,["cachedContents"]);if(i!=null){let a=i;Array.isArray(a)&&(a=a.map(l=>tt(o,l))),s(t,["cachedContents"],a)}return t}function nt(o,e){const t={},n=r(e,["name"]);n!=null&&s(t,["name"],n);const i=r(e,["displayName"]);i!=null&&s(t,["displayName"],i);const a=r(e,["model"]);a!=null&&s(t,["model"],a);const l=r(e,["createTime"]);l!=null&&s(t,["createTime"],l);const u=r(e,["updateTime"]);u!=null&&s(t,["updateTime"],u);const d=r(e,["expireTime"]);d!=null&&s(t,["expireTime"],d);const c=r(e,["usageMetadata"]);return c!=null&&s(t,["usageMetadata"],c),t}function Ts(){return{}}function Cs(o,e){const t={},n=r(e,["nextPageToken"]);n!=null&&s(t,["nextPageToken"],n);const i=r(e,["cachedContents"]);if(i!=null){let a=i;Array.isArray(a)&&(a=a.map(l=>nt(o,l))),s(t,["cachedContents"],a)}return t}/**
|
|
146
|
+
*/function Oh(n,e){const t={},i=s(e,["fps"]);i!=null&&a(t,["fps"],i);const r=s(e,["endOffset"]);r!=null&&a(t,["endOffset"],r);const o=s(e,["startOffset"]);return o!=null&&a(t,["startOffset"],o),t}function Uh(n,e){const t={};if(s(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const i=s(e,["data"]);i!=null&&a(t,["data"],i);const r=s(e,["mimeType"]);return r!=null&&a(t,["mimeType"],r),t}function $h(n,e){const t={};if(s(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const i=s(e,["fileUri"]);i!=null&&a(t,["fileUri"],i);const r=s(e,["mimeType"]);return r!=null&&a(t,["mimeType"],r),t}function Gh(n,e){const t={},i=s(e,["videoMetadata"]);i!=null&&a(t,["videoMetadata"],Oh(n,i));const r=s(e,["thought"]);r!=null&&a(t,["thought"],r);const o=s(e,["inlineData"]);o!=null&&a(t,["inlineData"],Uh(n,o));const l=s(e,["fileData"]);l!=null&&a(t,["fileData"],$h(n,l));const u=s(e,["thoughtSignature"]);u!=null&&a(t,["thoughtSignature"],u);const c=s(e,["codeExecutionResult"]);c!=null&&a(t,["codeExecutionResult"],c);const f=s(e,["executableCode"]);f!=null&&a(t,["executableCode"],f);const d=s(e,["functionCall"]);d!=null&&a(t,["functionCall"],d);const h=s(e,["functionResponse"]);h!=null&&a(t,["functionResponse"],h);const g=s(e,["text"]);return g!=null&&a(t,["text"],g),t}function Wa(n,e){const t={},i=s(e,["parts"]);if(i!=null){let o=i;Array.isArray(o)&&(o=o.map(l=>Gh(n,l))),a(t,["parts"],o)}const r=s(e,["role"]);return r!=null&&a(t,["role"],r),t}function qh(n,e){const t={},i=s(e,["behavior"]);i!=null&&a(t,["behavior"],i);const r=s(e,["description"]);r!=null&&a(t,["description"],r);const o=s(e,["name"]);o!=null&&a(t,["name"],o);const l=s(e,["parameters"]);l!=null&&a(t,["parameters"],l);const u=s(e,["response"]);return u!=null&&a(t,["response"],u),t}function Hh(n,e){const t={},i=s(e,["startTime"]);i!=null&&a(t,["startTime"],i);const r=s(e,["endTime"]);return r!=null&&a(t,["endTime"],r),t}function Wh(n,e){const t={},i=s(e,["timeRangeFilter"]);return i!=null&&a(t,["timeRangeFilter"],Hh(n,i)),t}function zh(n,e){const t={},i=s(e,["mode"]);i!=null&&a(t,["mode"],i);const r=s(e,["dynamicThreshold"]);return r!=null&&a(t,["dynamicThreshold"],r),t}function Yh(n,e){const t={},i=s(e,["dynamicRetrievalConfig"]);return i!=null&&a(t,["dynamicRetrievalConfig"],zh(n,i)),t}function Kh(){return{}}function Jh(n,e){const t={},i=s(e,["functionDeclarations"]);if(i!=null){let c=i;Array.isArray(c)&&(c=c.map(f=>qh(n,f))),a(t,["functionDeclarations"],c)}if(s(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const r=s(e,["googleSearch"]);r!=null&&a(t,["googleSearch"],Wh(n,r));const o=s(e,["googleSearchRetrieval"]);if(o!=null&&a(t,["googleSearchRetrieval"],Yh(n,o)),s(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");if(s(e,["googleMaps"])!==void 0)throw new Error("googleMaps parameter is not supported in Gemini API.");s(e,["urlContext"])!=null&&a(t,["urlContext"],Kh());const u=s(e,["codeExecution"]);return u!=null&&a(t,["codeExecution"],u),t}function Zh(n,e){const t={},i=s(e,["mode"]);i!=null&&a(t,["mode"],i);const r=s(e,["allowedFunctionNames"]);return r!=null&&a(t,["allowedFunctionNames"],r),t}function Xh(n,e){const t={},i=s(e,["latitude"]);i!=null&&a(t,["latitude"],i);const r=s(e,["longitude"]);return r!=null&&a(t,["longitude"],r),t}function Qh(n,e){const t={},i=s(e,["latLng"]);i!=null&&a(t,["latLng"],Xh(n,i));const r=s(e,["languageCode"]);return r!=null&&a(t,["languageCode"],r),t}function jh(n,e){const t={},i=s(e,["functionCallingConfig"]);i!=null&&a(t,["functionCallingConfig"],Zh(n,i));const r=s(e,["retrievalConfig"]);return r!=null&&a(t,["retrievalConfig"],Qh(n,r)),t}function em(n,e,t){const i={},r=s(e,["ttl"]);t!==void 0&&r!=null&&a(t,["ttl"],r);const o=s(e,["expireTime"]);t!==void 0&&o!=null&&a(t,["expireTime"],o);const l=s(e,["displayName"]);t!==void 0&&l!=null&&a(t,["displayName"],l);const u=s(e,["contents"]);if(t!==void 0&&u!=null){let h=Xe(n,u);Array.isArray(h)&&(h=h.map(g=>Wa(n,g))),a(t,["contents"],h)}const c=s(e,["systemInstruction"]);t!==void 0&&c!=null&&a(t,["systemInstruction"],Wa(n,Le(n,c)));const f=s(e,["tools"]);if(t!==void 0&&f!=null){let h=f;Array.isArray(h)&&(h=h.map(g=>Jh(n,g))),a(t,["tools"],h)}const d=s(e,["toolConfig"]);if(t!==void 0&&d!=null&&a(t,["toolConfig"],jh(n,d)),s(e,["kmsKeyName"])!==void 0)throw new Error("kmsKeyName parameter is not supported in Gemini API.");return i}function tm(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["model"],ka(n,i));const r=s(e,["config"]);return r!=null&&a(t,["config"],em(n,r,t)),t}function nm(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["_url","name"],Rt(n,i));const r=s(e,["config"]);return r!=null&&a(t,["config"],r),t}function im(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["_url","name"],Rt(n,i));const r=s(e,["config"]);return r!=null&&a(t,["config"],r),t}function rm(n,e,t){const i={},r=s(e,["ttl"]);t!==void 0&&r!=null&&a(t,["ttl"],r);const o=s(e,["expireTime"]);return t!==void 0&&o!=null&&a(t,["expireTime"],o),i}function om(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["_url","name"],Rt(n,i));const r=s(e,["config"]);return r!=null&&a(t,["config"],rm(n,r,t)),t}function sm(n,e,t){const i={},r=s(e,["pageSize"]);t!==void 0&&r!=null&&a(t,["_query","pageSize"],r);const o=s(e,["pageToken"]);return t!==void 0&&o!=null&&a(t,["_query","pageToken"],o),i}function am(n,e){const t={},i=s(e,["config"]);return i!=null&&a(t,["config"],sm(n,i,t)),t}function lm(n,e){const t={},i=s(e,["fps"]);i!=null&&a(t,["fps"],i);const r=s(e,["endOffset"]);r!=null&&a(t,["endOffset"],r);const o=s(e,["startOffset"]);return o!=null&&a(t,["startOffset"],o),t}function um(n,e){const t={},i=s(e,["displayName"]);i!=null&&a(t,["displayName"],i);const r=s(e,["data"]);r!=null&&a(t,["data"],r);const o=s(e,["mimeType"]);return o!=null&&a(t,["mimeType"],o),t}function cm(n,e){const t={},i=s(e,["displayName"]);i!=null&&a(t,["displayName"],i);const r=s(e,["fileUri"]);r!=null&&a(t,["fileUri"],r);const o=s(e,["mimeType"]);return o!=null&&a(t,["mimeType"],o),t}function fm(n,e){const t={},i=s(e,["videoMetadata"]);i!=null&&a(t,["videoMetadata"],lm(n,i));const r=s(e,["thought"]);r!=null&&a(t,["thought"],r);const o=s(e,["inlineData"]);o!=null&&a(t,["inlineData"],um(n,o));const l=s(e,["fileData"]);l!=null&&a(t,["fileData"],cm(n,l));const u=s(e,["thoughtSignature"]);u!=null&&a(t,["thoughtSignature"],u);const c=s(e,["codeExecutionResult"]);c!=null&&a(t,["codeExecutionResult"],c);const f=s(e,["executableCode"]);f!=null&&a(t,["executableCode"],f);const d=s(e,["functionCall"]);d!=null&&a(t,["functionCall"],d);const h=s(e,["functionResponse"]);h!=null&&a(t,["functionResponse"],h);const g=s(e,["text"]);return g!=null&&a(t,["text"],g),t}function za(n,e){const t={},i=s(e,["parts"]);if(i!=null){let o=i;Array.isArray(o)&&(o=o.map(l=>fm(n,l))),a(t,["parts"],o)}const r=s(e,["role"]);return r!=null&&a(t,["role"],r),t}function dm(n,e){const t={};if(s(e,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");const i=s(e,["description"]);i!=null&&a(t,["description"],i);const r=s(e,["name"]);r!=null&&a(t,["name"],r);const o=s(e,["parameters"]);o!=null&&a(t,["parameters"],o);const l=s(e,["response"]);return l!=null&&a(t,["response"],l),t}function pm(n,e){const t={},i=s(e,["startTime"]);i!=null&&a(t,["startTime"],i);const r=s(e,["endTime"]);return r!=null&&a(t,["endTime"],r),t}function hm(n,e){const t={},i=s(e,["timeRangeFilter"]);return i!=null&&a(t,["timeRangeFilter"],pm(n,i)),t}function mm(n,e){const t={},i=s(e,["mode"]);i!=null&&a(t,["mode"],i);const r=s(e,["dynamicThreshold"]);return r!=null&&a(t,["dynamicThreshold"],r),t}function gm(n,e){const t={},i=s(e,["dynamicRetrievalConfig"]);return i!=null&&a(t,["dynamicRetrievalConfig"],mm(n,i)),t}function ym(){return{}}function vm(n,e){const t={},i=s(e,["apiKeyString"]);return i!=null&&a(t,["apiKeyString"],i),t}function _m(n,e){const t={},i=s(e,["apiKeyConfig"]);i!=null&&a(t,["apiKeyConfig"],vm(n,i));const r=s(e,["authType"]);r!=null&&a(t,["authType"],r);const o=s(e,["googleServiceAccountConfig"]);o!=null&&a(t,["googleServiceAccountConfig"],o);const l=s(e,["httpBasicAuthConfig"]);l!=null&&a(t,["httpBasicAuthConfig"],l);const u=s(e,["oauthConfig"]);u!=null&&a(t,["oauthConfig"],u);const c=s(e,["oidcConfig"]);return c!=null&&a(t,["oidcConfig"],c),t}function xm(n,e){const t={},i=s(e,["authConfig"]);return i!=null&&a(t,["authConfig"],_m(n,i)),t}function Cm(n,e){const t={},i=s(e,["functionDeclarations"]);if(i!=null){let d=i;Array.isArray(d)&&(d=d.map(h=>dm(n,h))),a(t,["functionDeclarations"],d)}const r=s(e,["retrieval"]);r!=null&&a(t,["retrieval"],r);const o=s(e,["googleSearch"]);o!=null&&a(t,["googleSearch"],hm(n,o));const l=s(e,["googleSearchRetrieval"]);l!=null&&a(t,["googleSearchRetrieval"],gm(n,l)),s(e,["enterpriseWebSearch"])!=null&&a(t,["enterpriseWebSearch"],ym());const c=s(e,["googleMaps"]);if(c!=null&&a(t,["googleMaps"],xm(n,c)),s(e,["urlContext"])!==void 0)throw new Error("urlContext parameter is not supported in Vertex AI.");const f=s(e,["codeExecution"]);return f!=null&&a(t,["codeExecution"],f),t}function Em(n,e){const t={},i=s(e,["mode"]);i!=null&&a(t,["mode"],i);const r=s(e,["allowedFunctionNames"]);return r!=null&&a(t,["allowedFunctionNames"],r),t}function Tm(n,e){const t={},i=s(e,["latitude"]);i!=null&&a(t,["latitude"],i);const r=s(e,["longitude"]);return r!=null&&a(t,["longitude"],r),t}function wm(n,e){const t={},i=s(e,["latLng"]);i!=null&&a(t,["latLng"],Tm(n,i));const r=s(e,["languageCode"]);return r!=null&&a(t,["languageCode"],r),t}function Sm(n,e){const t={},i=s(e,["functionCallingConfig"]);i!=null&&a(t,["functionCallingConfig"],Em(n,i));const r=s(e,["retrievalConfig"]);return r!=null&&a(t,["retrievalConfig"],wm(n,r)),t}function Am(n,e,t){const i={},r=s(e,["ttl"]);t!==void 0&&r!=null&&a(t,["ttl"],r);const o=s(e,["expireTime"]);t!==void 0&&o!=null&&a(t,["expireTime"],o);const l=s(e,["displayName"]);t!==void 0&&l!=null&&a(t,["displayName"],l);const u=s(e,["contents"]);if(t!==void 0&&u!=null){let g=Xe(n,u);Array.isArray(g)&&(g=g.map(x=>za(n,x))),a(t,["contents"],g)}const c=s(e,["systemInstruction"]);t!==void 0&&c!=null&&a(t,["systemInstruction"],za(n,Le(n,c)));const f=s(e,["tools"]);if(t!==void 0&&f!=null){let g=f;Array.isArray(g)&&(g=g.map(x=>Cm(n,x))),a(t,["tools"],g)}const d=s(e,["toolConfig"]);t!==void 0&&d!=null&&a(t,["toolConfig"],Sm(n,d));const h=s(e,["kmsKeyName"]);return t!==void 0&&h!=null&&a(t,["encryption_spec","kmsKeyName"],h),i}function bm(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["model"],ka(n,i));const r=s(e,["config"]);return r!=null&&a(t,["config"],Am(n,r,t)),t}function Rm(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["_url","name"],Rt(n,i));const r=s(e,["config"]);return r!=null&&a(t,["config"],r),t}function Mm(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["_url","name"],Rt(n,i));const r=s(e,["config"]);return r!=null&&a(t,["config"],r),t}function Im(n,e,t){const i={},r=s(e,["ttl"]);t!==void 0&&r!=null&&a(t,["ttl"],r);const o=s(e,["expireTime"]);return t!==void 0&&o!=null&&a(t,["expireTime"],o),i}function Pm(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["_url","name"],Rt(n,i));const r=s(e,["config"]);return r!=null&&a(t,["config"],Im(n,r,t)),t}function km(n,e,t){const i={},r=s(e,["pageSize"]);t!==void 0&&r!=null&&a(t,["_query","pageSize"],r);const o=s(e,["pageToken"]);return t!==void 0&&o!=null&&a(t,["_query","pageToken"],o),i}function Nm(n,e){const t={},i=s(e,["config"]);return i!=null&&a(t,["config"],km(n,i,t)),t}function bi(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["name"],i);const r=s(e,["displayName"]);r!=null&&a(t,["displayName"],r);const o=s(e,["model"]);o!=null&&a(t,["model"],o);const l=s(e,["createTime"]);l!=null&&a(t,["createTime"],l);const u=s(e,["updateTime"]);u!=null&&a(t,["updateTime"],u);const c=s(e,["expireTime"]);c!=null&&a(t,["expireTime"],c);const f=s(e,["usageMetadata"]);return f!=null&&a(t,["usageMetadata"],f),t}function Dm(){return{}}function Lm(n,e){const t={},i=s(e,["nextPageToken"]);i!=null&&a(t,["nextPageToken"],i);const r=s(e,["cachedContents"]);if(r!=null){let o=r;Array.isArray(o)&&(o=o.map(l=>bi(n,l))),a(t,["cachedContents"],o)}return t}function Ri(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["name"],i);const r=s(e,["displayName"]);r!=null&&a(t,["displayName"],r);const o=s(e,["model"]);o!=null&&a(t,["model"],o);const l=s(e,["createTime"]);l!=null&&a(t,["createTime"],l);const u=s(e,["updateTime"]);u!=null&&a(t,["updateTime"],u);const c=s(e,["expireTime"]);c!=null&&a(t,["expireTime"],c);const f=s(e,["usageMetadata"]);return f!=null&&a(t,["usageMetadata"],f),t}function Fm(){return{}}function Vm(n,e){const t={},i=s(e,["nextPageToken"]);i!=null&&a(t,["nextPageToken"],i);const r=s(e,["cachedContents"]);if(r!=null){let o=r;Array.isArray(o)&&(o=o.map(l=>Ri(n,l))),a(t,["cachedContents"],o)}return t}/**
|
|
139
147
|
* @license
|
|
140
148
|
* Copyright 2025 Google LLC
|
|
141
149
|
* SPDX-License-Identifier: Apache-2.0
|
|
142
|
-
*/var
|
|
150
|
+
*/var hn;(function(n){n.PAGED_ITEM_BATCH_JOBS="batchJobs",n.PAGED_ITEM_MODELS="models",n.PAGED_ITEM_TUNING_JOBS="tuningJobs",n.PAGED_ITEM_FILES="files",n.PAGED_ITEM_CACHED_CONTENTS="cachedContents"})(hn||(hn={}));class Mi{constructor(e,t,i,r){this.pageInternal=[],this.paramsInternal={},this.requestInternal=t,this.init(e,i,r)}init(e,t,i){var r,o;this.nameInternal=e,this.pageInternal=t[this.nameInternal]||[],this.idxInternal=0;let l={config:{}};i?typeof i=="object"?l=Object.assign({},i):l=i:l={config:{}},l.config&&(l.config.pageToken=t.nextPageToken),this.paramsInternal=l,this.pageInternalSize=(o=(r=l.config)===null||r===void 0?void 0:r.pageSize)!==null&&o!==void 0?o:this.pageInternal.length}initNextPage(e){this.init(this.nameInternal,e,this.paramsInternal)}get page(){return this.pageInternal}get name(){return this.nameInternal}get pageSize(){return this.pageInternalSize}get params(){return this.paramsInternal}get pageLength(){return this.pageInternal.length}getItem(e){return this.pageInternal[e]}[Symbol.asyncIterator](){return{next:async()=>{if(this.idxInternal>=this.pageLength)if(this.hasNextPage())await this.nextPage();else return{value:void 0,done:!0};const e=this.getItem(this.idxInternal);return this.idxInternal+=1,{value:e,done:!1}},return:async()=>({value:void 0,done:!0})}}async nextPage(){if(!this.hasNextPage())throw new Error("No more pages to fetch.");const e=await this.requestInternal(this.params);return this.initNextPage(e),this.page}hasNextPage(){var e;return((e=this.params.config)===null||e===void 0?void 0:e.pageToken)!==void 0}}/**
|
|
143
151
|
* @license
|
|
144
152
|
* Copyright 2025 Google LLC
|
|
145
153
|
* SPDX-License-Identifier: Apache-2.0
|
|
146
|
-
*/class
|
|
154
|
+
*/class Bm extends fn{constructor(e){super(),this.apiClient=e,this.list=async(t={})=>new Mi(hn.PAGED_ITEM_CACHED_CONTENTS,i=>this.listInternal(i),await this.listInternal(t),t)}async create(e){var t,i,r,o;let l,u="",c={};if(this.apiClient.isVertexAI()){const f=bm(this.apiClient,e);return u=X("cachedContents",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),l.then(d=>Ri(this.apiClient,d))}else{const f=tm(this.apiClient,e);return u=X("cachedContents",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(d=>d.json()),l.then(d=>bi(this.apiClient,d))}}async get(e){var t,i,r,o;let l,u="",c={};if(this.apiClient.isVertexAI()){const f=Rm(this.apiClient,e);return u=X("{name}",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),l.then(d=>Ri(this.apiClient,d))}else{const f=nm(this.apiClient,e);return u=X("{name}",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(d=>d.json()),l.then(d=>bi(this.apiClient,d))}}async delete(e){var t,i,r,o;let l,u="",c={};if(this.apiClient.isVertexAI()){const f=Mm(this.apiClient,e);return u=X("{name}",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"DELETE",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),l.then(()=>{const d=Fm(),h=new Ia;return Object.assign(h,d),h})}else{const f=im(this.apiClient,e);return u=X("{name}",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"DELETE",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(d=>d.json()),l.then(()=>{const d=Dm(),h=new Ia;return Object.assign(h,d),h})}}async update(e){var t,i,r,o;let l,u="",c={};if(this.apiClient.isVertexAI()){const f=Pm(this.apiClient,e);return u=X("{name}",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"PATCH",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),l.then(d=>Ri(this.apiClient,d))}else{const f=om(this.apiClient,e);return u=X("{name}",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"PATCH",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(d=>d.json()),l.then(d=>bi(this.apiClient,d))}}async listInternal(e){var t,i,r,o;let l,u="",c={};if(this.apiClient.isVertexAI()){const f=Nm(this.apiClient,e);return u=X("cachedContents",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),l.then(d=>{const h=Vm(this.apiClient,d),g=new Pa;return Object.assign(g,h),g})}else{const f=am(this.apiClient,e);return u=X("cachedContents",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(d=>d.json()),l.then(d=>{const h=Lm(this.apiClient,d),g=new Pa;return Object.assign(g,h),g})}}}function Ya(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],i=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ge(n){return this instanceof ge?(this.v=n,this):new ge(n)}function mn(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(n,e||[]),r,o=[];return r=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",l),r[Symbol.asyncIterator]=function(){return this},r;function l(x){return function(w){return Promise.resolve(w).then(x,h)}}function u(x,w){i[x]&&(r[x]=function(b){return new Promise(function(D,F){o.push([x,b,D,F])>1||c(x,b)})},w&&(r[x]=w(r[x])))}function c(x,w){try{f(i[x](w))}catch(b){g(o[0][3],b)}}function f(x){x.value instanceof ge?Promise.resolve(x.value.v).then(d,h):g(o[0][2],x)}function d(x){c("next",x)}function h(x){c("throw",x)}function g(x,w){x(w),o.shift(),o.length&&c(o[0][0],o[0][1])}}function Un(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof Ya=="function"?Ya(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=n[o]&&function(l){return new Promise(function(u,c){l=n[o](l),r(u,c,l.done,l.value)})}}function r(o,l,u,c){Promise.resolve(c).then(function(f){o({value:f,done:u})},l)}}typeof SuppressedError=="function"&&SuppressedError;/**
|
|
147
155
|
* @license
|
|
148
156
|
* Copyright 2025 Google LLC
|
|
149
157
|
* SPDX-License-Identifier: Apache-2.0
|
|
150
|
-
*/function
|
|
158
|
+
*/function Om(n){var e;if(n.candidates==null||n.candidates.length===0)return!1;const t=(e=n.candidates[0])===null||e===void 0?void 0:e.content;return t===void 0?!1:Ka(t)}function Ka(n){if(n.parts===void 0||n.parts.length===0)return!1;for(const e of n.parts)if(e===void 0||Object.keys(e).length===0||!e.thought&&e.text!==void 0&&e.text==="")return!1;return!0}function Um(n){if(n.length!==0){for(const e of n)if(e.role!=="user"&&e.role!=="model")throw new Error(`Role must be user or model, but got ${e.role}.`)}}function Ja(n){if(n===void 0||n.length===0)return[];const e=[],t=n.length;let i=0;for(;i<t;)if(n[i].role==="user")e.push(n[i]),i++;else{const r=[];let o=!0;for(;i<t&&n[i].role==="model";)r.push(n[i]),o&&!Ka(n[i])&&(o=!1),i++;o?e.push(...r):e.pop()}return e}class $m{constructor(e,t){this.modelsModule=e,this.apiClient=t}create(e){return new Gm(this.apiClient,this.modelsModule,e.model,e.config,structuredClone(e.history))}}class Gm{constructor(e,t,i,r={},o=[]){this.apiClient=e,this.modelsModule=t,this.model=i,this.config=r,this.history=o,this.sendPromise=Promise.resolve(),Um(o)}async sendMessage(e){var t;await this.sendPromise;const i=Le(this.apiClient,e.message),r=this.modelsModule.generateContent({model:this.model,contents:this.getHistory(!0).concat(i),config:(t=e.config)!==null&&t!==void 0?t:this.config});return this.sendPromise=(async()=>{var o,l,u;const c=await r,f=(l=(o=c.candidates)===null||o===void 0?void 0:o[0])===null||l===void 0?void 0:l.content,d=c.automaticFunctionCallingHistory,h=this.getHistory(!0).length;let g=[];d!=null&&(g=(u=d.slice(h))!==null&&u!==void 0?u:[]);const x=f?[f]:[];this.recordHistory(i,x,g)})(),await this.sendPromise.catch(()=>{this.sendPromise=Promise.resolve()}),r}async sendMessageStream(e){var t;await this.sendPromise;const i=Le(this.apiClient,e.message),r=this.modelsModule.generateContentStream({model:this.model,contents:this.getHistory(!0).concat(i),config:(t=e.config)!==null&&t!==void 0?t:this.config});this.sendPromise=r.then(()=>{}).catch(()=>{});const o=await r;return this.processStreamResponse(o,i)}getHistory(e=!1){const t=e?Ja(this.history):this.history;return structuredClone(t)}processStreamResponse(e,t){var i,r;return mn(this,arguments,function*(){var l,u,c,f;const d=[];try{for(var h=!0,g=Un(e),x;x=yield ge(g.next()),l=x.done,!l;h=!0){f=x.value,h=!1;const w=f;if(Om(w)){const b=(r=(i=w.candidates)===null||i===void 0?void 0:i[0])===null||r===void 0?void 0:r.content;b!==void 0&&d.push(b)}yield yield ge(w)}}catch(w){u={error:w}}finally{try{!h&&!l&&(c=g.return)&&(yield ge(c.call(g)))}finally{if(u)throw u.error}}this.recordHistory(t,d)})}recordHistory(e,t,i){let r=[];t.length>0&&t.every(o=>o.role!==void 0)?r=t:r.push({role:"model",parts:[]}),i&&i.length>0?this.history.push(...Ja(i)):this.history.push(e),this.history.push(...r)}}/**
|
|
151
159
|
* @license
|
|
152
160
|
* Copyright 2025 Google LLC
|
|
153
161
|
* SPDX-License-Identifier: Apache-2.0
|
|
154
|
-
*/function
|
|
162
|
+
*/function qm(n,e,t){const i={},r=s(e,["pageSize"]);t!==void 0&&r!=null&&a(t,["_query","pageSize"],r);const o=s(e,["pageToken"]);return t!==void 0&&o!=null&&a(t,["_query","pageToken"],o),i}function Hm(n,e){const t={},i=s(e,["config"]);return i!=null&&a(t,["config"],qm(n,i,t)),t}function Wm(n,e){const t={},i=s(e,["details"]);i!=null&&a(t,["details"],i);const r=s(e,["message"]);r!=null&&a(t,["message"],r);const o=s(e,["code"]);return o!=null&&a(t,["code"],o),t}function zm(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["name"],i);const r=s(e,["displayName"]);r!=null&&a(t,["displayName"],r);const o=s(e,["mimeType"]);o!=null&&a(t,["mimeType"],o);const l=s(e,["sizeBytes"]);l!=null&&a(t,["sizeBytes"],l);const u=s(e,["createTime"]);u!=null&&a(t,["createTime"],u);const c=s(e,["expirationTime"]);c!=null&&a(t,["expirationTime"],c);const f=s(e,["updateTime"]);f!=null&&a(t,["updateTime"],f);const d=s(e,["sha256Hash"]);d!=null&&a(t,["sha256Hash"],d);const h=s(e,["uri"]);h!=null&&a(t,["uri"],h);const g=s(e,["downloadUri"]);g!=null&&a(t,["downloadUri"],g);const x=s(e,["state"]);x!=null&&a(t,["state"],x);const w=s(e,["source"]);w!=null&&a(t,["source"],w);const b=s(e,["videoMetadata"]);b!=null&&a(t,["videoMetadata"],b);const D=s(e,["error"]);return D!=null&&a(t,["error"],Wm(n,D)),t}function Ym(n,e){const t={},i=s(e,["file"]);i!=null&&a(t,["file"],zm(n,i));const r=s(e,["config"]);return r!=null&&a(t,["config"],r),t}function Km(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["_url","file"],Ga(n,i));const r=s(e,["config"]);return r!=null&&a(t,["config"],r),t}function Jm(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["_url","file"],Ga(n,i));const r=s(e,["config"]);return r!=null&&a(t,["config"],r),t}function Zm(n,e){const t={},i=s(e,["details"]);i!=null&&a(t,["details"],i);const r=s(e,["message"]);r!=null&&a(t,["message"],r);const o=s(e,["code"]);return o!=null&&a(t,["code"],o),t}function Mr(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["name"],i);const r=s(e,["displayName"]);r!=null&&a(t,["displayName"],r);const o=s(e,["mimeType"]);o!=null&&a(t,["mimeType"],o);const l=s(e,["sizeBytes"]);l!=null&&a(t,["sizeBytes"],l);const u=s(e,["createTime"]);u!=null&&a(t,["createTime"],u);const c=s(e,["expirationTime"]);c!=null&&a(t,["expirationTime"],c);const f=s(e,["updateTime"]);f!=null&&a(t,["updateTime"],f);const d=s(e,["sha256Hash"]);d!=null&&a(t,["sha256Hash"],d);const h=s(e,["uri"]);h!=null&&a(t,["uri"],h);const g=s(e,["downloadUri"]);g!=null&&a(t,["downloadUri"],g);const x=s(e,["state"]);x!=null&&a(t,["state"],x);const w=s(e,["source"]);w!=null&&a(t,["source"],w);const b=s(e,["videoMetadata"]);b!=null&&a(t,["videoMetadata"],b);const D=s(e,["error"]);return D!=null&&a(t,["error"],Zm(n,D)),t}function Xm(n,e){const t={},i=s(e,["nextPageToken"]);i!=null&&a(t,["nextPageToken"],i);const r=s(e,["files"]);if(r!=null){let o=r;Array.isArray(o)&&(o=o.map(l=>Mr(n,l))),a(t,["files"],o)}return t}function Qm(){return{}}function jm(){return{}}/**
|
|
155
163
|
* @license
|
|
156
164
|
* Copyright 2025 Google LLC
|
|
157
165
|
* SPDX-License-Identifier: Apache-2.0
|
|
158
|
-
*/class
|
|
166
|
+
*/class eg extends fn{constructor(e){super(),this.apiClient=e,this.list=async(t={})=>new Mi(hn.PAGED_ITEM_FILES,i=>this.listInternal(i),await this.listInternal(t),t)}async upload(e){if(this.apiClient.isVertexAI())throw new Error("Vertex AI does not support uploading files. You can share files through a GCS bucket.");return this.apiClient.uploadFile(e.file,e.config).then(t=>Mr(this.apiClient,t))}async download(e){await this.apiClient.downloadFile(e)}async listInternal(e){var t,i;let r,o="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const u=Hm(this.apiClient,e);return o=X("files",u._url),l=u._query,delete u.config,delete u._url,delete u._query,r=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(c=>c.json()),r.then(c=>{const f=Xm(this.apiClient,c),d=new _h;return Object.assign(d,f),d})}}async createInternal(e){var t,i;let r,o="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const u=Ym(this.apiClient,e);return o=X("upload/v1beta/files",u._url),l=u._query,delete u.config,delete u._url,delete u._query,r=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(c=>c.json()),r.then(()=>{const c=Qm(),f=new xh;return Object.assign(f,c),f})}}async get(e){var t,i;let r,o="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const u=Km(this.apiClient,e);return o=X("files/{file}",u._url),l=u._query,delete u.config,delete u._url,delete u._query,r=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(c=>c.json()),r.then(c=>Mr(this.apiClient,c))}}async delete(e){var t,i;let r,o="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const u=Jm(this.apiClient,e);return o=X("files/{file}",u._url),l=u._query,delete u.config,delete u._url,delete u._query,r=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(c=>c.json()),r.then(()=>{const c=jm(),f=new Ch;return Object.assign(f,c),f})}}}/**
|
|
159
167
|
* @license
|
|
160
168
|
* Copyright 2025 Google LLC
|
|
161
169
|
* SPDX-License-Identifier: Apache-2.0
|
|
162
|
-
*/function Us(o,e){const t={},n=r(e,["voiceName"]);return n!=null&&s(t,["voiceName"],n),t}function Gs(o,e){const t={},n=r(e,["voiceName"]);return n!=null&&s(t,["voiceName"],n),t}function go(o,e){const t={},n=r(e,["prebuiltVoiceConfig"]);return n!=null&&s(t,["prebuiltVoiceConfig"],Us(o,n)),t}function Bs(o,e){const t={},n=r(e,["prebuiltVoiceConfig"]);return n!=null&&s(t,["prebuiltVoiceConfig"],Gs(o,n)),t}function qs(o,e){const t={},n=r(e,["speaker"]);n!=null&&s(t,["speaker"],n);const i=r(e,["voiceConfig"]);return i!=null&&s(t,["voiceConfig"],go(o,i)),t}function $s(o,e){const t={},n=r(e,["speakerVoiceConfigs"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(a=>qs(o,a))),s(t,["speakerVoiceConfigs"],i)}return t}function Os(o,e){const t={},n=r(e,["voiceConfig"]);n!=null&&s(t,["voiceConfig"],go(o,n));const i=r(e,["multiSpeakerVoiceConfig"]);i!=null&&s(t,["multiSpeakerVoiceConfig"],$s(o,i));const a=r(e,["languageCode"]);return a!=null&&s(t,["languageCode"],a),t}function Hs(o,e){const t={},n=r(e,["voiceConfig"]);if(n!=null&&s(t,["voiceConfig"],Bs(o,n)),r(e,["multiSpeakerVoiceConfig"])!==void 0)throw new Error("multiSpeakerVoiceConfig parameter is not supported in Vertex AI.");const i=r(e,["languageCode"]);return i!=null&&s(t,["languageCode"],i),t}function Js(o,e){const t={},n=r(e,["fps"]);n!=null&&s(t,["fps"],n);const i=r(e,["endOffset"]);i!=null&&s(t,["endOffset"],i);const a=r(e,["startOffset"]);return a!=null&&s(t,["startOffset"],a),t}function zs(o,e){const t={},n=r(e,["fps"]);n!=null&&s(t,["fps"],n);const i=r(e,["endOffset"]);i!=null&&s(t,["endOffset"],i);const a=r(e,["startOffset"]);return a!=null&&s(t,["startOffset"],a),t}function Ws(o,e){const t={};if(r(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const n=r(e,["data"]);n!=null&&s(t,["data"],n);const i=r(e,["mimeType"]);return i!=null&&s(t,["mimeType"],i),t}function Ys(o,e){const t={},n=r(e,["displayName"]);n!=null&&s(t,["displayName"],n);const i=r(e,["data"]);i!=null&&s(t,["data"],i);const a=r(e,["mimeType"]);return a!=null&&s(t,["mimeType"],a),t}function Zs(o,e){const t={};if(r(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const n=r(e,["fileUri"]);n!=null&&s(t,["fileUri"],n);const i=r(e,["mimeType"]);return i!=null&&s(t,["mimeType"],i),t}function Ks(o,e){const t={},n=r(e,["displayName"]);n!=null&&s(t,["displayName"],n);const i=r(e,["fileUri"]);i!=null&&s(t,["fileUri"],i);const a=r(e,["mimeType"]);return a!=null&&s(t,["mimeType"],a),t}function Xs(o,e){const t={},n=r(e,["videoMetadata"]);n!=null&&s(t,["videoMetadata"],Js(o,n));const i=r(e,["thought"]);i!=null&&s(t,["thought"],i);const a=r(e,["inlineData"]);a!=null&&s(t,["inlineData"],Ws(o,a));const l=r(e,["fileData"]);l!=null&&s(t,["fileData"],Zs(o,l));const u=r(e,["thoughtSignature"]);u!=null&&s(t,["thoughtSignature"],u);const d=r(e,["codeExecutionResult"]);d!=null&&s(t,["codeExecutionResult"],d);const c=r(e,["executableCode"]);c!=null&&s(t,["executableCode"],c);const f=r(e,["functionCall"]);f!=null&&s(t,["functionCall"],f);const p=r(e,["functionResponse"]);p!=null&&s(t,["functionResponse"],p);const m=r(e,["text"]);return m!=null&&s(t,["text"],m),t}function Qs(o,e){const t={},n=r(e,["videoMetadata"]);n!=null&&s(t,["videoMetadata"],zs(o,n));const i=r(e,["thought"]);i!=null&&s(t,["thought"],i);const a=r(e,["inlineData"]);a!=null&&s(t,["inlineData"],Ys(o,a));const l=r(e,["fileData"]);l!=null&&s(t,["fileData"],Ks(o,l));const u=r(e,["thoughtSignature"]);u!=null&&s(t,["thoughtSignature"],u);const d=r(e,["codeExecutionResult"]);d!=null&&s(t,["codeExecutionResult"],d);const c=r(e,["executableCode"]);c!=null&&s(t,["executableCode"],c);const f=r(e,["functionCall"]);f!=null&&s(t,["functionCall"],f);const p=r(e,["functionResponse"]);p!=null&&s(t,["functionResponse"],p);const m=r(e,["text"]);return m!=null&&s(t,["text"],m),t}function js(o,e){const t={},n=r(e,["parts"]);if(n!=null){let a=n;Array.isArray(a)&&(a=a.map(l=>Xs(o,l))),s(t,["parts"],a)}const i=r(e,["role"]);return i!=null&&s(t,["role"],i),t}function ea(o,e){const t={},n=r(e,["parts"]);if(n!=null){let a=n;Array.isArray(a)&&(a=a.map(l=>Qs(o,l))),s(t,["parts"],a)}const i=r(e,["role"]);return i!=null&&s(t,["role"],i),t}function ta(o,e){const t={},n=r(e,["behavior"]);n!=null&&s(t,["behavior"],n);const i=r(e,["description"]);i!=null&&s(t,["description"],i);const a=r(e,["name"]);a!=null&&s(t,["name"],a);const l=r(e,["parameters"]);l!=null&&s(t,["parameters"],l);const u=r(e,["response"]);return u!=null&&s(t,["response"],u),t}function na(o,e){const t={};if(r(e,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");const n=r(e,["description"]);n!=null&&s(t,["description"],n);const i=r(e,["name"]);i!=null&&s(t,["name"],i);const a=r(e,["parameters"]);a!=null&&s(t,["parameters"],a);const l=r(e,["response"]);return l!=null&&s(t,["response"],l),t}function oa(o,e){const t={},n=r(e,["startTime"]);n!=null&&s(t,["startTime"],n);const i=r(e,["endTime"]);return i!=null&&s(t,["endTime"],i),t}function ia(o,e){const t={},n=r(e,["startTime"]);n!=null&&s(t,["startTime"],n);const i=r(e,["endTime"]);return i!=null&&s(t,["endTime"],i),t}function ra(o,e){const t={},n=r(e,["timeRangeFilter"]);return n!=null&&s(t,["timeRangeFilter"],oa(o,n)),t}function sa(o,e){const t={},n=r(e,["timeRangeFilter"]);return n!=null&&s(t,["timeRangeFilter"],ia(o,n)),t}function aa(o,e){const t={},n=r(e,["mode"]);n!=null&&s(t,["mode"],n);const i=r(e,["dynamicThreshold"]);return i!=null&&s(t,["dynamicThreshold"],i),t}function la(o,e){const t={},n=r(e,["mode"]);n!=null&&s(t,["mode"],n);const i=r(e,["dynamicThreshold"]);return i!=null&&s(t,["dynamicThreshold"],i),t}function ua(o,e){const t={},n=r(e,["dynamicRetrievalConfig"]);return n!=null&&s(t,["dynamicRetrievalConfig"],aa(o,n)),t}function ca(o,e){const t={},n=r(e,["dynamicRetrievalConfig"]);return n!=null&&s(t,["dynamicRetrievalConfig"],la(o,n)),t}function da(){return{}}function fa(o,e){const t={},n=r(e,["apiKeyString"]);return n!=null&&s(t,["apiKeyString"],n),t}function pa(o,e){const t={},n=r(e,["apiKeyConfig"]);n!=null&&s(t,["apiKeyConfig"],fa(o,n));const i=r(e,["authType"]);i!=null&&s(t,["authType"],i);const a=r(e,["googleServiceAccountConfig"]);a!=null&&s(t,["googleServiceAccountConfig"],a);const l=r(e,["httpBasicAuthConfig"]);l!=null&&s(t,["httpBasicAuthConfig"],l);const u=r(e,["oauthConfig"]);u!=null&&s(t,["oauthConfig"],u);const d=r(e,["oidcConfig"]);return d!=null&&s(t,["oidcConfig"],d),t}function ma(o,e){const t={},n=r(e,["authConfig"]);return n!=null&&s(t,["authConfig"],pa(o,n)),t}function ha(){return{}}function ga(o,e){const t={},n=r(e,["functionDeclarations"]);if(n!=null){let d=n;Array.isArray(d)&&(d=d.map(c=>ta(o,c))),s(t,["functionDeclarations"],d)}if(r(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const i=r(e,["googleSearch"]);i!=null&&s(t,["googleSearch"],ra(o,i));const a=r(e,["googleSearchRetrieval"]);if(a!=null&&s(t,["googleSearchRetrieval"],ua(o,a)),r(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");if(r(e,["googleMaps"])!==void 0)throw new Error("googleMaps parameter is not supported in Gemini API.");r(e,["urlContext"])!=null&&s(t,["urlContext"],ha());const u=r(e,["codeExecution"]);return u!=null&&s(t,["codeExecution"],u),t}function ya(o,e){const t={},n=r(e,["functionDeclarations"]);if(n!=null){let f=n;Array.isArray(f)&&(f=f.map(p=>na(o,p))),s(t,["functionDeclarations"],f)}const i=r(e,["retrieval"]);i!=null&&s(t,["retrieval"],i);const a=r(e,["googleSearch"]);a!=null&&s(t,["googleSearch"],sa(o,a));const l=r(e,["googleSearchRetrieval"]);l!=null&&s(t,["googleSearchRetrieval"],ca(o,l)),r(e,["enterpriseWebSearch"])!=null&&s(t,["enterpriseWebSearch"],da());const d=r(e,["googleMaps"]);if(d!=null&&s(t,["googleMaps"],ma(o,d)),r(e,["urlContext"])!==void 0)throw new Error("urlContext parameter is not supported in Vertex AI.");const c=r(e,["codeExecution"]);return c!=null&&s(t,["codeExecution"],c),t}function va(o,e){const t={},n=r(e,["handle"]);if(n!=null&&s(t,["handle"],n),r(e,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return t}function Ta(o,e){const t={},n=r(e,["handle"]);n!=null&&s(t,["handle"],n);const i=r(e,["transparent"]);return i!=null&&s(t,["transparent"],i),t}function yo(){return{}}function vo(){return{}}function Ca(o,e){const t={},n=r(e,["disabled"]);n!=null&&s(t,["disabled"],n);const i=r(e,["startOfSpeechSensitivity"]);i!=null&&s(t,["startOfSpeechSensitivity"],i);const a=r(e,["endOfSpeechSensitivity"]);a!=null&&s(t,["endOfSpeechSensitivity"],a);const l=r(e,["prefixPaddingMs"]);l!=null&&s(t,["prefixPaddingMs"],l);const u=r(e,["silenceDurationMs"]);return u!=null&&s(t,["silenceDurationMs"],u),t}function _a(o,e){const t={},n=r(e,["disabled"]);n!=null&&s(t,["disabled"],n);const i=r(e,["startOfSpeechSensitivity"]);i!=null&&s(t,["startOfSpeechSensitivity"],i);const a=r(e,["endOfSpeechSensitivity"]);a!=null&&s(t,["endOfSpeechSensitivity"],a);const l=r(e,["prefixPaddingMs"]);l!=null&&s(t,["prefixPaddingMs"],l);const u=r(e,["silenceDurationMs"]);return u!=null&&s(t,["silenceDurationMs"],u),t}function xa(o,e){const t={},n=r(e,["automaticActivityDetection"]);n!=null&&s(t,["automaticActivityDetection"],Ca(o,n));const i=r(e,["activityHandling"]);i!=null&&s(t,["activityHandling"],i);const a=r(e,["turnCoverage"]);return a!=null&&s(t,["turnCoverage"],a),t}function Ea(o,e){const t={},n=r(e,["automaticActivityDetection"]);n!=null&&s(t,["automaticActivityDetection"],_a(o,n));const i=r(e,["activityHandling"]);i!=null&&s(t,["activityHandling"],i);const a=r(e,["turnCoverage"]);return a!=null&&s(t,["turnCoverage"],a),t}function wa(o,e){const t={},n=r(e,["targetTokens"]);return n!=null&&s(t,["targetTokens"],n),t}function Sa(o,e){const t={},n=r(e,["targetTokens"]);return n!=null&&s(t,["targetTokens"],n),t}function Aa(o,e){const t={},n=r(e,["triggerTokens"]);n!=null&&s(t,["triggerTokens"],n);const i=r(e,["slidingWindow"]);return i!=null&&s(t,["slidingWindow"],wa(o,i)),t}function Ma(o,e){const t={},n=r(e,["triggerTokens"]);n!=null&&s(t,["triggerTokens"],n);const i=r(e,["slidingWindow"]);return i!=null&&s(t,["slidingWindow"],Sa(o,i)),t}function Ia(o,e){const t={},n=r(e,["proactiveAudio"]);return n!=null&&s(t,["proactiveAudio"],n),t}function Ra(o,e){const t={},n=r(e,["proactiveAudio"]);return n!=null&&s(t,["proactiveAudio"],n),t}function ka(o,e,t){const n={},i=r(e,["generationConfig"]);t!==void 0&&i!=null&&s(t,["setup","generationConfig"],i);const a=r(e,["responseModalities"]);t!==void 0&&a!=null&&s(t,["setup","generationConfig","responseModalities"],a);const l=r(e,["temperature"]);t!==void 0&&l!=null&&s(t,["setup","generationConfig","temperature"],l);const u=r(e,["topP"]);t!==void 0&&u!=null&&s(t,["setup","generationConfig","topP"],u);const d=r(e,["topK"]);t!==void 0&&d!=null&&s(t,["setup","generationConfig","topK"],d);const c=r(e,["maxOutputTokens"]);t!==void 0&&c!=null&&s(t,["setup","generationConfig","maxOutputTokens"],c);const f=r(e,["mediaResolution"]);t!==void 0&&f!=null&&s(t,["setup","generationConfig","mediaResolution"],f);const p=r(e,["seed"]);t!==void 0&&p!=null&&s(t,["setup","generationConfig","seed"],p);const m=r(e,["speechConfig"]);t!==void 0&&m!=null&&s(t,["setup","generationConfig","speechConfig"],Os(o,_t(o,m)));const h=r(e,["enableAffectiveDialog"]);t!==void 0&&h!=null&&s(t,["setup","generationConfig","enableAffectiveDialog"],h);const g=r(e,["systemInstruction"]);t!==void 0&&g!=null&&s(t,["setup","systemInstruction"],js(o,X(o,g)));const v=r(e,["tools"]);if(t!==void 0&&v!=null){let A=Be(o,v);Array.isArray(A)&&(A=A.map(P=>ga(o,Ge(o,P)))),s(t,["setup","tools"],A)}const x=r(e,["sessionResumption"]);t!==void 0&&x!=null&&s(t,["setup","sessionResumption"],va(o,x));const M=r(e,["inputAudioTranscription"]);t!==void 0&&M!=null&&s(t,["setup","inputAudioTranscription"],yo());const R=r(e,["outputAudioTranscription"]);t!==void 0&&R!=null&&s(t,["setup","outputAudioTranscription"],yo());const k=r(e,["realtimeInputConfig"]);t!==void 0&&k!=null&&s(t,["setup","realtimeInputConfig"],xa(o,k));const V=r(e,["contextWindowCompression"]);t!==void 0&&V!=null&&s(t,["setup","contextWindowCompression"],Aa(o,V));const E=r(e,["proactivity"]);return t!==void 0&&E!=null&&s(t,["setup","proactivity"],Ia(o,E)),n}function Na(o,e,t){const n={},i=r(e,["generationConfig"]);t!==void 0&&i!=null&&s(t,["setup","generationConfig"],i);const a=r(e,["responseModalities"]);t!==void 0&&a!=null&&s(t,["setup","generationConfig","responseModalities"],a);const l=r(e,["temperature"]);t!==void 0&&l!=null&&s(t,["setup","generationConfig","temperature"],l);const u=r(e,["topP"]);t!==void 0&&u!=null&&s(t,["setup","generationConfig","topP"],u);const d=r(e,["topK"]);t!==void 0&&d!=null&&s(t,["setup","generationConfig","topK"],d);const c=r(e,["maxOutputTokens"]);t!==void 0&&c!=null&&s(t,["setup","generationConfig","maxOutputTokens"],c);const f=r(e,["mediaResolution"]);t!==void 0&&f!=null&&s(t,["setup","generationConfig","mediaResolution"],f);const p=r(e,["seed"]);t!==void 0&&p!=null&&s(t,["setup","generationConfig","seed"],p);const m=r(e,["speechConfig"]);t!==void 0&&m!=null&&s(t,["setup","generationConfig","speechConfig"],Hs(o,_t(o,m)));const h=r(e,["enableAffectiveDialog"]);t!==void 0&&h!=null&&s(t,["setup","generationConfig","enableAffectiveDialog"],h);const g=r(e,["systemInstruction"]);t!==void 0&&g!=null&&s(t,["setup","systemInstruction"],ea(o,X(o,g)));const v=r(e,["tools"]);if(t!==void 0&&v!=null){let A=Be(o,v);Array.isArray(A)&&(A=A.map(P=>ya(o,Ge(o,P)))),s(t,["setup","tools"],A)}const x=r(e,["sessionResumption"]);t!==void 0&&x!=null&&s(t,["setup","sessionResumption"],Ta(o,x));const M=r(e,["inputAudioTranscription"]);t!==void 0&&M!=null&&s(t,["setup","inputAudioTranscription"],vo());const R=r(e,["outputAudioTranscription"]);t!==void 0&&R!=null&&s(t,["setup","outputAudioTranscription"],vo());const k=r(e,["realtimeInputConfig"]);t!==void 0&&k!=null&&s(t,["setup","realtimeInputConfig"],Ea(o,k));const V=r(e,["contextWindowCompression"]);t!==void 0&&V!=null&&s(t,["setup","contextWindowCompression"],Ma(o,V));const E=r(e,["proactivity"]);return t!==void 0&&E!=null&&s(t,["setup","proactivity"],Ra(o,E)),n}function Pa(o,e){const t={},n=r(e,["model"]);n!=null&&s(t,["setup","model"],q(o,n));const i=r(e,["config"]);return i!=null&&s(t,["config"],ka(o,i,t)),t}function Da(o,e){const t={},n=r(e,["model"]);n!=null&&s(t,["setup","model"],q(o,n));const i=r(e,["config"]);return i!=null&&s(t,["config"],Na(o,i,t)),t}function ba(){return{}}function La(){return{}}function Va(){return{}}function Fa(){return{}}function Ua(o,e){const t={},n=r(e,["media"]);n!=null&&s(t,["mediaChunks"],Qn(o,n));const i=r(e,["audio"]);i!=null&&s(t,["audio"],lr(o,i));const a=r(e,["audioStreamEnd"]);a!=null&&s(t,["audioStreamEnd"],a);const l=r(e,["video"]);l!=null&&s(t,["video"],ar(o,l));const u=r(e,["text"]);return u!=null&&s(t,["text"],u),r(e,["activityStart"])!=null&&s(t,["activityStart"],ba()),r(e,["activityEnd"])!=null&&s(t,["activityEnd"],Va()),t}function Ga(o,e){const t={},n=r(e,["media"]);if(n!=null&&s(t,["mediaChunks"],Qn(o,n)),r(e,["audio"])!==void 0)throw new Error("audio parameter is not supported in Vertex AI.");const i=r(e,["audioStreamEnd"]);if(i!=null&&s(t,["audioStreamEnd"],i),r(e,["video"])!==void 0)throw new Error("video parameter is not supported in Vertex AI.");if(r(e,["text"])!==void 0)throw new Error("text parameter is not supported in Vertex AI.");return r(e,["activityStart"])!=null&&s(t,["activityStart"],La()),r(e,["activityEnd"])!=null&&s(t,["activityEnd"],Fa()),t}function To(o,e){const t={},n=r(e,["text"]);n!=null&&s(t,["text"],n);const i=r(e,["weight"]);return i!=null&&s(t,["weight"],i),t}function Ba(o,e){const t={},n=r(e,["weightedPrompts"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(a=>To(o,a))),s(t,["weightedPrompts"],i)}return t}function Co(o,e){const t={},n=r(e,["temperature"]);n!=null&&s(t,["temperature"],n);const i=r(e,["topK"]);i!=null&&s(t,["topK"],i);const a=r(e,["seed"]);a!=null&&s(t,["seed"],a);const l=r(e,["guidance"]);l!=null&&s(t,["guidance"],l);const u=r(e,["bpm"]);u!=null&&s(t,["bpm"],u);const d=r(e,["density"]);d!=null&&s(t,["density"],d);const c=r(e,["brightness"]);c!=null&&s(t,["brightness"],c);const f=r(e,["scale"]);f!=null&&s(t,["scale"],f);const p=r(e,["muteBass"]);p!=null&&s(t,["muteBass"],p);const m=r(e,["muteDrums"]);m!=null&&s(t,["muteDrums"],m);const h=r(e,["onlyBassAndDrums"]);return h!=null&&s(t,["onlyBassAndDrums"],h),t}function qa(o,e){const t={},n=r(e,["musicGenerationConfig"]);return n!=null&&s(t,["musicGenerationConfig"],Co(o,n)),t}function _o(o,e){const t={},n=r(e,["model"]);return n!=null&&s(t,["model"],n),t}function xo(o,e){const t={},n=r(e,["weightedPrompts"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(a=>To(o,a))),s(t,["weightedPrompts"],i)}return t}function Et(o,e){const t={},n=r(e,["setup"]);n!=null&&s(t,["setup"],_o(o,n));const i=r(e,["clientContent"]);i!=null&&s(t,["clientContent"],xo(o,i));const a=r(e,["musicGenerationConfig"]);a!=null&&s(t,["musicGenerationConfig"],Co(o,a));const l=r(e,["playbackControl"]);return l!=null&&s(t,["playbackControl"],l),t}function $a(){return{}}function Oa(){return{}}function Ha(o,e){const t={},n=r(e,["fps"]);n!=null&&s(t,["fps"],n);const i=r(e,["endOffset"]);i!=null&&s(t,["endOffset"],i);const a=r(e,["startOffset"]);return a!=null&&s(t,["startOffset"],a),t}function Ja(o,e){const t={},n=r(e,["fps"]);n!=null&&s(t,["fps"],n);const i=r(e,["endOffset"]);i!=null&&s(t,["endOffset"],i);const a=r(e,["startOffset"]);return a!=null&&s(t,["startOffset"],a),t}function za(o,e){const t={},n=r(e,["data"]);n!=null&&s(t,["data"],n);const i=r(e,["mimeType"]);return i!=null&&s(t,["mimeType"],i),t}function Wa(o,e){const t={},n=r(e,["displayName"]);n!=null&&s(t,["displayName"],n);const i=r(e,["data"]);i!=null&&s(t,["data"],i);const a=r(e,["mimeType"]);return a!=null&&s(t,["mimeType"],a),t}function Ya(o,e){const t={},n=r(e,["fileUri"]);n!=null&&s(t,["fileUri"],n);const i=r(e,["mimeType"]);return i!=null&&s(t,["mimeType"],i),t}function Za(o,e){const t={},n=r(e,["displayName"]);n!=null&&s(t,["displayName"],n);const i=r(e,["fileUri"]);i!=null&&s(t,["fileUri"],i);const a=r(e,["mimeType"]);return a!=null&&s(t,["mimeType"],a),t}function Ka(o,e){const t={},n=r(e,["videoMetadata"]);n!=null&&s(t,["videoMetadata"],Ha(o,n));const i=r(e,["thought"]);i!=null&&s(t,["thought"],i);const a=r(e,["inlineData"]);a!=null&&s(t,["inlineData"],za(o,a));const l=r(e,["fileData"]);l!=null&&s(t,["fileData"],Ya(o,l));const u=r(e,["thoughtSignature"]);u!=null&&s(t,["thoughtSignature"],u);const d=r(e,["codeExecutionResult"]);d!=null&&s(t,["codeExecutionResult"],d);const c=r(e,["executableCode"]);c!=null&&s(t,["executableCode"],c);const f=r(e,["functionCall"]);f!=null&&s(t,["functionCall"],f);const p=r(e,["functionResponse"]);p!=null&&s(t,["functionResponse"],p);const m=r(e,["text"]);return m!=null&&s(t,["text"],m),t}function Xa(o,e){const t={},n=r(e,["videoMetadata"]);n!=null&&s(t,["videoMetadata"],Ja(o,n));const i=r(e,["thought"]);i!=null&&s(t,["thought"],i);const a=r(e,["inlineData"]);a!=null&&s(t,["inlineData"],Wa(o,a));const l=r(e,["fileData"]);l!=null&&s(t,["fileData"],Za(o,l));const u=r(e,["thoughtSignature"]);u!=null&&s(t,["thoughtSignature"],u);const d=r(e,["codeExecutionResult"]);d!=null&&s(t,["codeExecutionResult"],d);const c=r(e,["executableCode"]);c!=null&&s(t,["executableCode"],c);const f=r(e,["functionCall"]);f!=null&&s(t,["functionCall"],f);const p=r(e,["functionResponse"]);p!=null&&s(t,["functionResponse"],p);const m=r(e,["text"]);return m!=null&&s(t,["text"],m),t}function Qa(o,e){const t={},n=r(e,["parts"]);if(n!=null){let a=n;Array.isArray(a)&&(a=a.map(l=>Ka(o,l))),s(t,["parts"],a)}const i=r(e,["role"]);return i!=null&&s(t,["role"],i),t}function ja(o,e){const t={},n=r(e,["parts"]);if(n!=null){let a=n;Array.isArray(a)&&(a=a.map(l=>Xa(o,l))),s(t,["parts"],a)}const i=r(e,["role"]);return i!=null&&s(t,["role"],i),t}function Eo(o,e){const t={},n=r(e,["text"]);n!=null&&s(t,["text"],n);const i=r(e,["finished"]);return i!=null&&s(t,["finished"],i),t}function wo(o,e){const t={},n=r(e,["text"]);n!=null&&s(t,["text"],n);const i=r(e,["finished"]);return i!=null&&s(t,["finished"],i),t}function el(o,e){const t={},n=r(e,["retrievedUrl"]);n!=null&&s(t,["retrievedUrl"],n);const i=r(e,["urlRetrievalStatus"]);return i!=null&&s(t,["urlRetrievalStatus"],i),t}function tl(o,e){const t={},n=r(e,["urlMetadata"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(a=>el(o,a))),s(t,["urlMetadata"],i)}return t}function nl(o,e){const t={},n=r(e,["modelTurn"]);n!=null&&s(t,["modelTurn"],Qa(o,n));const i=r(e,["turnComplete"]);i!=null&&s(t,["turnComplete"],i);const a=r(e,["interrupted"]);a!=null&&s(t,["interrupted"],a);const l=r(e,["groundingMetadata"]);l!=null&&s(t,["groundingMetadata"],l);const u=r(e,["generationComplete"]);u!=null&&s(t,["generationComplete"],u);const d=r(e,["inputTranscription"]);d!=null&&s(t,["inputTranscription"],Eo(o,d));const c=r(e,["outputTranscription"]);c!=null&&s(t,["outputTranscription"],Eo(o,c));const f=r(e,["urlContextMetadata"]);return f!=null&&s(t,["urlContextMetadata"],tl(o,f)),t}function ol(o,e){const t={},n=r(e,["modelTurn"]);n!=null&&s(t,["modelTurn"],ja(o,n));const i=r(e,["turnComplete"]);i!=null&&s(t,["turnComplete"],i);const a=r(e,["interrupted"]);a!=null&&s(t,["interrupted"],a);const l=r(e,["groundingMetadata"]);l!=null&&s(t,["groundingMetadata"],l);const u=r(e,["generationComplete"]);u!=null&&s(t,["generationComplete"],u);const d=r(e,["inputTranscription"]);d!=null&&s(t,["inputTranscription"],wo(o,d));const c=r(e,["outputTranscription"]);return c!=null&&s(t,["outputTranscription"],wo(o,c)),t}function il(o,e){const t={},n=r(e,["id"]);n!=null&&s(t,["id"],n);const i=r(e,["args"]);i!=null&&s(t,["args"],i);const a=r(e,["name"]);return a!=null&&s(t,["name"],a),t}function rl(o,e){const t={},n=r(e,["args"]);n!=null&&s(t,["args"],n);const i=r(e,["name"]);return i!=null&&s(t,["name"],i),t}function sl(o,e){const t={},n=r(e,["functionCalls"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(a=>il(o,a))),s(t,["functionCalls"],i)}return t}function al(o,e){const t={},n=r(e,["functionCalls"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(a=>rl(o,a))),s(t,["functionCalls"],i)}return t}function ll(o,e){const t={},n=r(e,["ids"]);return n!=null&&s(t,["ids"],n),t}function ul(o,e){const t={},n=r(e,["ids"]);return n!=null&&s(t,["ids"],n),t}function it(o,e){const t={},n=r(e,["modality"]);n!=null&&s(t,["modality"],n);const i=r(e,["tokenCount"]);return i!=null&&s(t,["tokenCount"],i),t}function rt(o,e){const t={},n=r(e,["modality"]);n!=null&&s(t,["modality"],n);const i=r(e,["tokenCount"]);return i!=null&&s(t,["tokenCount"],i),t}function cl(o,e){const t={},n=r(e,["promptTokenCount"]);n!=null&&s(t,["promptTokenCount"],n);const i=r(e,["cachedContentTokenCount"]);i!=null&&s(t,["cachedContentTokenCount"],i);const a=r(e,["responseTokenCount"]);a!=null&&s(t,["responseTokenCount"],a);const l=r(e,["toolUsePromptTokenCount"]);l!=null&&s(t,["toolUsePromptTokenCount"],l);const u=r(e,["thoughtsTokenCount"]);u!=null&&s(t,["thoughtsTokenCount"],u);const d=r(e,["totalTokenCount"]);d!=null&&s(t,["totalTokenCount"],d);const c=r(e,["promptTokensDetails"]);if(c!=null){let h=c;Array.isArray(h)&&(h=h.map(g=>it(o,g))),s(t,["promptTokensDetails"],h)}const f=r(e,["cacheTokensDetails"]);if(f!=null){let h=f;Array.isArray(h)&&(h=h.map(g=>it(o,g))),s(t,["cacheTokensDetails"],h)}const p=r(e,["responseTokensDetails"]);if(p!=null){let h=p;Array.isArray(h)&&(h=h.map(g=>it(o,g))),s(t,["responseTokensDetails"],h)}const m=r(e,["toolUsePromptTokensDetails"]);if(m!=null){let h=m;Array.isArray(h)&&(h=h.map(g=>it(o,g))),s(t,["toolUsePromptTokensDetails"],h)}return t}function dl(o,e){const t={},n=r(e,["promptTokenCount"]);n!=null&&s(t,["promptTokenCount"],n);const i=r(e,["cachedContentTokenCount"]);i!=null&&s(t,["cachedContentTokenCount"],i);const a=r(e,["candidatesTokenCount"]);a!=null&&s(t,["responseTokenCount"],a);const l=r(e,["toolUsePromptTokenCount"]);l!=null&&s(t,["toolUsePromptTokenCount"],l);const u=r(e,["thoughtsTokenCount"]);u!=null&&s(t,["thoughtsTokenCount"],u);const d=r(e,["totalTokenCount"]);d!=null&&s(t,["totalTokenCount"],d);const c=r(e,["promptTokensDetails"]);if(c!=null){let g=c;Array.isArray(g)&&(g=g.map(v=>rt(o,v))),s(t,["promptTokensDetails"],g)}const f=r(e,["cacheTokensDetails"]);if(f!=null){let g=f;Array.isArray(g)&&(g=g.map(v=>rt(o,v))),s(t,["cacheTokensDetails"],g)}const p=r(e,["candidatesTokensDetails"]);if(p!=null){let g=p;Array.isArray(g)&&(g=g.map(v=>rt(o,v))),s(t,["responseTokensDetails"],g)}const m=r(e,["toolUsePromptTokensDetails"]);if(m!=null){let g=m;Array.isArray(g)&&(g=g.map(v=>rt(o,v))),s(t,["toolUsePromptTokensDetails"],g)}const h=r(e,["trafficType"]);return h!=null&&s(t,["trafficType"],h),t}function fl(o,e){const t={},n=r(e,["timeLeft"]);return n!=null&&s(t,["timeLeft"],n),t}function pl(o,e){const t={},n=r(e,["timeLeft"]);return n!=null&&s(t,["timeLeft"],n),t}function ml(o,e){const t={},n=r(e,["newHandle"]);n!=null&&s(t,["newHandle"],n);const i=r(e,["resumable"]);i!=null&&s(t,["resumable"],i);const a=r(e,["lastConsumedClientMessageIndex"]);return a!=null&&s(t,["lastConsumedClientMessageIndex"],a),t}function hl(o,e){const t={},n=r(e,["newHandle"]);n!=null&&s(t,["newHandle"],n);const i=r(e,["resumable"]);i!=null&&s(t,["resumable"],i);const a=r(e,["lastConsumedClientMessageIndex"]);return a!=null&&s(t,["lastConsumedClientMessageIndex"],a),t}function gl(o,e){const t={};r(e,["setupComplete"])!=null&&s(t,["setupComplete"],$a());const i=r(e,["serverContent"]);i!=null&&s(t,["serverContent"],nl(o,i));const a=r(e,["toolCall"]);a!=null&&s(t,["toolCall"],sl(o,a));const l=r(e,["toolCallCancellation"]);l!=null&&s(t,["toolCallCancellation"],ll(o,l));const u=r(e,["usageMetadata"]);u!=null&&s(t,["usageMetadata"],cl(o,u));const d=r(e,["goAway"]);d!=null&&s(t,["goAway"],fl(o,d));const c=r(e,["sessionResumptionUpdate"]);return c!=null&&s(t,["sessionResumptionUpdate"],ml(o,c)),t}function yl(o,e){const t={};r(e,["setupComplete"])!=null&&s(t,["setupComplete"],Oa());const i=r(e,["serverContent"]);i!=null&&s(t,["serverContent"],ol(o,i));const a=r(e,["toolCall"]);a!=null&&s(t,["toolCall"],al(o,a));const l=r(e,["toolCallCancellation"]);l!=null&&s(t,["toolCallCancellation"],ul(o,l));const u=r(e,["usageMetadata"]);u!=null&&s(t,["usageMetadata"],dl(o,u));const d=r(e,["goAway"]);d!=null&&s(t,["goAway"],pl(o,d));const c=r(e,["sessionResumptionUpdate"]);return c!=null&&s(t,["sessionResumptionUpdate"],hl(o,c)),t}function vl(){return{}}function Tl(o,e){const t={},n=r(e,["text"]);n!=null&&s(t,["text"],n);const i=r(e,["weight"]);return i!=null&&s(t,["weight"],i),t}function Cl(o,e){const t={},n=r(e,["weightedPrompts"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(a=>Tl(o,a))),s(t,["weightedPrompts"],i)}return t}function _l(o,e){const t={},n=r(e,["temperature"]);n!=null&&s(t,["temperature"],n);const i=r(e,["topK"]);i!=null&&s(t,["topK"],i);const a=r(e,["seed"]);a!=null&&s(t,["seed"],a);const l=r(e,["guidance"]);l!=null&&s(t,["guidance"],l);const u=r(e,["bpm"]);u!=null&&s(t,["bpm"],u);const d=r(e,["density"]);d!=null&&s(t,["density"],d);const c=r(e,["brightness"]);c!=null&&s(t,["brightness"],c);const f=r(e,["scale"]);f!=null&&s(t,["scale"],f);const p=r(e,["muteBass"]);p!=null&&s(t,["muteBass"],p);const m=r(e,["muteDrums"]);m!=null&&s(t,["muteDrums"],m);const h=r(e,["onlyBassAndDrums"]);return h!=null&&s(t,["onlyBassAndDrums"],h),t}function xl(o,e){const t={},n=r(e,["clientContent"]);n!=null&&s(t,["clientContent"],Cl(o,n));const i=r(e,["musicGenerationConfig"]);return i!=null&&s(t,["musicGenerationConfig"],_l(o,i)),t}function El(o,e){const t={},n=r(e,["data"]);n!=null&&s(t,["data"],n);const i=r(e,["mimeType"]);i!=null&&s(t,["mimeType"],i);const a=r(e,["sourceMetadata"]);return a!=null&&s(t,["sourceMetadata"],xl(o,a)),t}function wl(o,e){const t={},n=r(e,["audioChunks"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(a=>El(o,a))),s(t,["audioChunks"],i)}return t}function Sl(o,e){const t={},n=r(e,["text"]);n!=null&&s(t,["text"],n);const i=r(e,["filteredReason"]);return i!=null&&s(t,["filteredReason"],i),t}function Al(o,e){const t={};r(e,["setupComplete"])!=null&&s(t,["setupComplete"],vl());const i=r(e,["serverContent"]);i!=null&&s(t,["serverContent"],wl(o,i));const a=r(e,["filteredPrompt"]);return a!=null&&s(t,["filteredPrompt"],Sl(o,a)),t}/**
|
|
170
|
+
*/function tg(n,e){const t={},i=s(e,["voiceName"]);return i!=null&&a(t,["voiceName"],i),t}function ng(n,e){const t={},i=s(e,["voiceName"]);return i!=null&&a(t,["voiceName"],i),t}function Za(n,e){const t={},i=s(e,["prebuiltVoiceConfig"]);return i!=null&&a(t,["prebuiltVoiceConfig"],tg(n,i)),t}function ig(n,e){const t={},i=s(e,["prebuiltVoiceConfig"]);return i!=null&&a(t,["prebuiltVoiceConfig"],ng(n,i)),t}function rg(n,e){const t={},i=s(e,["speaker"]);i!=null&&a(t,["speaker"],i);const r=s(e,["voiceConfig"]);return r!=null&&a(t,["voiceConfig"],Za(n,r)),t}function og(n,e){const t={},i=s(e,["speakerVoiceConfigs"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(o=>rg(n,o))),a(t,["speakerVoiceConfigs"],r)}return t}function sg(n,e){const t={},i=s(e,["voiceConfig"]);i!=null&&a(t,["voiceConfig"],Za(n,i));const r=s(e,["multiSpeakerVoiceConfig"]);r!=null&&a(t,["multiSpeakerVoiceConfig"],og(n,r));const o=s(e,["languageCode"]);return o!=null&&a(t,["languageCode"],o),t}function ag(n,e){const t={},i=s(e,["voiceConfig"]);if(i!=null&&a(t,["voiceConfig"],ig(n,i)),s(e,["multiSpeakerVoiceConfig"])!==void 0)throw new Error("multiSpeakerVoiceConfig parameter is not supported in Vertex AI.");const r=s(e,["languageCode"]);return r!=null&&a(t,["languageCode"],r),t}function lg(n,e){const t={},i=s(e,["fps"]);i!=null&&a(t,["fps"],i);const r=s(e,["endOffset"]);r!=null&&a(t,["endOffset"],r);const o=s(e,["startOffset"]);return o!=null&&a(t,["startOffset"],o),t}function ug(n,e){const t={},i=s(e,["fps"]);i!=null&&a(t,["fps"],i);const r=s(e,["endOffset"]);r!=null&&a(t,["endOffset"],r);const o=s(e,["startOffset"]);return o!=null&&a(t,["startOffset"],o),t}function cg(n,e){const t={};if(s(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const i=s(e,["data"]);i!=null&&a(t,["data"],i);const r=s(e,["mimeType"]);return r!=null&&a(t,["mimeType"],r),t}function fg(n,e){const t={},i=s(e,["displayName"]);i!=null&&a(t,["displayName"],i);const r=s(e,["data"]);r!=null&&a(t,["data"],r);const o=s(e,["mimeType"]);return o!=null&&a(t,["mimeType"],o),t}function dg(n,e){const t={};if(s(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const i=s(e,["fileUri"]);i!=null&&a(t,["fileUri"],i);const r=s(e,["mimeType"]);return r!=null&&a(t,["mimeType"],r),t}function pg(n,e){const t={},i=s(e,["displayName"]);i!=null&&a(t,["displayName"],i);const r=s(e,["fileUri"]);r!=null&&a(t,["fileUri"],r);const o=s(e,["mimeType"]);return o!=null&&a(t,["mimeType"],o),t}function hg(n,e){const t={},i=s(e,["videoMetadata"]);i!=null&&a(t,["videoMetadata"],lg(n,i));const r=s(e,["thought"]);r!=null&&a(t,["thought"],r);const o=s(e,["inlineData"]);o!=null&&a(t,["inlineData"],cg(n,o));const l=s(e,["fileData"]);l!=null&&a(t,["fileData"],dg(n,l));const u=s(e,["thoughtSignature"]);u!=null&&a(t,["thoughtSignature"],u);const c=s(e,["codeExecutionResult"]);c!=null&&a(t,["codeExecutionResult"],c);const f=s(e,["executableCode"]);f!=null&&a(t,["executableCode"],f);const d=s(e,["functionCall"]);d!=null&&a(t,["functionCall"],d);const h=s(e,["functionResponse"]);h!=null&&a(t,["functionResponse"],h);const g=s(e,["text"]);return g!=null&&a(t,["text"],g),t}function mg(n,e){const t={},i=s(e,["videoMetadata"]);i!=null&&a(t,["videoMetadata"],ug(n,i));const r=s(e,["thought"]);r!=null&&a(t,["thought"],r);const o=s(e,["inlineData"]);o!=null&&a(t,["inlineData"],fg(n,o));const l=s(e,["fileData"]);l!=null&&a(t,["fileData"],pg(n,l));const u=s(e,["thoughtSignature"]);u!=null&&a(t,["thoughtSignature"],u);const c=s(e,["codeExecutionResult"]);c!=null&&a(t,["codeExecutionResult"],c);const f=s(e,["executableCode"]);f!=null&&a(t,["executableCode"],f);const d=s(e,["functionCall"]);d!=null&&a(t,["functionCall"],d);const h=s(e,["functionResponse"]);h!=null&&a(t,["functionResponse"],h);const g=s(e,["text"]);return g!=null&&a(t,["text"],g),t}function gg(n,e){const t={},i=s(e,["parts"]);if(i!=null){let o=i;Array.isArray(o)&&(o=o.map(l=>hg(n,l))),a(t,["parts"],o)}const r=s(e,["role"]);return r!=null&&a(t,["role"],r),t}function yg(n,e){const t={},i=s(e,["parts"]);if(i!=null){let o=i;Array.isArray(o)&&(o=o.map(l=>mg(n,l))),a(t,["parts"],o)}const r=s(e,["role"]);return r!=null&&a(t,["role"],r),t}function vg(n,e){const t={},i=s(e,["behavior"]);i!=null&&a(t,["behavior"],i);const r=s(e,["description"]);r!=null&&a(t,["description"],r);const o=s(e,["name"]);o!=null&&a(t,["name"],o);const l=s(e,["parameters"]);l!=null&&a(t,["parameters"],l);const u=s(e,["response"]);return u!=null&&a(t,["response"],u),t}function _g(n,e){const t={};if(s(e,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");const i=s(e,["description"]);i!=null&&a(t,["description"],i);const r=s(e,["name"]);r!=null&&a(t,["name"],r);const o=s(e,["parameters"]);o!=null&&a(t,["parameters"],o);const l=s(e,["response"]);return l!=null&&a(t,["response"],l),t}function xg(n,e){const t={},i=s(e,["startTime"]);i!=null&&a(t,["startTime"],i);const r=s(e,["endTime"]);return r!=null&&a(t,["endTime"],r),t}function Cg(n,e){const t={},i=s(e,["startTime"]);i!=null&&a(t,["startTime"],i);const r=s(e,["endTime"]);return r!=null&&a(t,["endTime"],r),t}function Eg(n,e){const t={},i=s(e,["timeRangeFilter"]);return i!=null&&a(t,["timeRangeFilter"],xg(n,i)),t}function Tg(n,e){const t={},i=s(e,["timeRangeFilter"]);return i!=null&&a(t,["timeRangeFilter"],Cg(n,i)),t}function wg(n,e){const t={},i=s(e,["mode"]);i!=null&&a(t,["mode"],i);const r=s(e,["dynamicThreshold"]);return r!=null&&a(t,["dynamicThreshold"],r),t}function Sg(n,e){const t={},i=s(e,["mode"]);i!=null&&a(t,["mode"],i);const r=s(e,["dynamicThreshold"]);return r!=null&&a(t,["dynamicThreshold"],r),t}function Ag(n,e){const t={},i=s(e,["dynamicRetrievalConfig"]);return i!=null&&a(t,["dynamicRetrievalConfig"],wg(n,i)),t}function bg(n,e){const t={},i=s(e,["dynamicRetrievalConfig"]);return i!=null&&a(t,["dynamicRetrievalConfig"],Sg(n,i)),t}function Rg(){return{}}function Mg(n,e){const t={},i=s(e,["apiKeyString"]);return i!=null&&a(t,["apiKeyString"],i),t}function Ig(n,e){const t={},i=s(e,["apiKeyConfig"]);i!=null&&a(t,["apiKeyConfig"],Mg(n,i));const r=s(e,["authType"]);r!=null&&a(t,["authType"],r);const o=s(e,["googleServiceAccountConfig"]);o!=null&&a(t,["googleServiceAccountConfig"],o);const l=s(e,["httpBasicAuthConfig"]);l!=null&&a(t,["httpBasicAuthConfig"],l);const u=s(e,["oauthConfig"]);u!=null&&a(t,["oauthConfig"],u);const c=s(e,["oidcConfig"]);return c!=null&&a(t,["oidcConfig"],c),t}function Pg(n,e){const t={},i=s(e,["authConfig"]);return i!=null&&a(t,["authConfig"],Ig(n,i)),t}function kg(){return{}}function Ng(n,e){const t={},i=s(e,["functionDeclarations"]);if(i!=null){let c=i;Array.isArray(c)&&(c=c.map(f=>vg(n,f))),a(t,["functionDeclarations"],c)}if(s(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const r=s(e,["googleSearch"]);r!=null&&a(t,["googleSearch"],Eg(n,r));const o=s(e,["googleSearchRetrieval"]);if(o!=null&&a(t,["googleSearchRetrieval"],Ag(n,o)),s(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");if(s(e,["googleMaps"])!==void 0)throw new Error("googleMaps parameter is not supported in Gemini API.");s(e,["urlContext"])!=null&&a(t,["urlContext"],kg());const u=s(e,["codeExecution"]);return u!=null&&a(t,["codeExecution"],u),t}function Dg(n,e){const t={},i=s(e,["functionDeclarations"]);if(i!=null){let d=i;Array.isArray(d)&&(d=d.map(h=>_g(n,h))),a(t,["functionDeclarations"],d)}const r=s(e,["retrieval"]);r!=null&&a(t,["retrieval"],r);const o=s(e,["googleSearch"]);o!=null&&a(t,["googleSearch"],Tg(n,o));const l=s(e,["googleSearchRetrieval"]);l!=null&&a(t,["googleSearchRetrieval"],bg(n,l)),s(e,["enterpriseWebSearch"])!=null&&a(t,["enterpriseWebSearch"],Rg());const c=s(e,["googleMaps"]);if(c!=null&&a(t,["googleMaps"],Pg(n,c)),s(e,["urlContext"])!==void 0)throw new Error("urlContext parameter is not supported in Vertex AI.");const f=s(e,["codeExecution"]);return f!=null&&a(t,["codeExecution"],f),t}function Lg(n,e){const t={},i=s(e,["handle"]);if(i!=null&&a(t,["handle"],i),s(e,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return t}function Fg(n,e){const t={},i=s(e,["handle"]);i!=null&&a(t,["handle"],i);const r=s(e,["transparent"]);return r!=null&&a(t,["transparent"],r),t}function Xa(){return{}}function Qa(){return{}}function Vg(n,e){const t={},i=s(e,["disabled"]);i!=null&&a(t,["disabled"],i);const r=s(e,["startOfSpeechSensitivity"]);r!=null&&a(t,["startOfSpeechSensitivity"],r);const o=s(e,["endOfSpeechSensitivity"]);o!=null&&a(t,["endOfSpeechSensitivity"],o);const l=s(e,["prefixPaddingMs"]);l!=null&&a(t,["prefixPaddingMs"],l);const u=s(e,["silenceDurationMs"]);return u!=null&&a(t,["silenceDurationMs"],u),t}function Bg(n,e){const t={},i=s(e,["disabled"]);i!=null&&a(t,["disabled"],i);const r=s(e,["startOfSpeechSensitivity"]);r!=null&&a(t,["startOfSpeechSensitivity"],r);const o=s(e,["endOfSpeechSensitivity"]);o!=null&&a(t,["endOfSpeechSensitivity"],o);const l=s(e,["prefixPaddingMs"]);l!=null&&a(t,["prefixPaddingMs"],l);const u=s(e,["silenceDurationMs"]);return u!=null&&a(t,["silenceDurationMs"],u),t}function Og(n,e){const t={},i=s(e,["automaticActivityDetection"]);i!=null&&a(t,["automaticActivityDetection"],Vg(n,i));const r=s(e,["activityHandling"]);r!=null&&a(t,["activityHandling"],r);const o=s(e,["turnCoverage"]);return o!=null&&a(t,["turnCoverage"],o),t}function Ug(n,e){const t={},i=s(e,["automaticActivityDetection"]);i!=null&&a(t,["automaticActivityDetection"],Bg(n,i));const r=s(e,["activityHandling"]);r!=null&&a(t,["activityHandling"],r);const o=s(e,["turnCoverage"]);return o!=null&&a(t,["turnCoverage"],o),t}function $g(n,e){const t={},i=s(e,["targetTokens"]);return i!=null&&a(t,["targetTokens"],i),t}function Gg(n,e){const t={},i=s(e,["targetTokens"]);return i!=null&&a(t,["targetTokens"],i),t}function qg(n,e){const t={},i=s(e,["triggerTokens"]);i!=null&&a(t,["triggerTokens"],i);const r=s(e,["slidingWindow"]);return r!=null&&a(t,["slidingWindow"],$g(n,r)),t}function Hg(n,e){const t={},i=s(e,["triggerTokens"]);i!=null&&a(t,["triggerTokens"],i);const r=s(e,["slidingWindow"]);return r!=null&&a(t,["slidingWindow"],Gg(n,r)),t}function Wg(n,e){const t={},i=s(e,["proactiveAudio"]);return i!=null&&a(t,["proactiveAudio"],i),t}function zg(n,e){const t={},i=s(e,["proactiveAudio"]);return i!=null&&a(t,["proactiveAudio"],i),t}function Yg(n,e,t){const i={},r=s(e,["generationConfig"]);t!==void 0&&r!=null&&a(t,["setup","generationConfig"],r);const o=s(e,["responseModalities"]);t!==void 0&&o!=null&&a(t,["setup","generationConfig","responseModalities"],o);const l=s(e,["temperature"]);t!==void 0&&l!=null&&a(t,["setup","generationConfig","temperature"],l);const u=s(e,["topP"]);t!==void 0&&u!=null&&a(t,["setup","generationConfig","topP"],u);const c=s(e,["topK"]);t!==void 0&&c!=null&&a(t,["setup","generationConfig","topK"],c);const f=s(e,["maxOutputTokens"]);t!==void 0&&f!=null&&a(t,["setup","generationConfig","maxOutputTokens"],f);const d=s(e,["mediaResolution"]);t!==void 0&&d!=null&&a(t,["setup","generationConfig","mediaResolution"],d);const h=s(e,["seed"]);t!==void 0&&h!=null&&a(t,["setup","generationConfig","seed"],h);const g=s(e,["speechConfig"]);t!==void 0&&g!=null&&a(t,["setup","generationConfig","speechConfig"],sg(n,Rr(n,g)));const x=s(e,["enableAffectiveDialog"]);t!==void 0&&x!=null&&a(t,["setup","generationConfig","enableAffectiveDialog"],x);const w=s(e,["systemInstruction"]);t!==void 0&&w!=null&&a(t,["setup","systemInstruction"],gg(n,Le(n,w)));const b=s(e,["tools"]);if(t!==void 0&&b!=null){let I=On(n,b);Array.isArray(I)&&(I=I.map(R=>Ng(n,Bn(n,R)))),a(t,["setup","tools"],I)}const D=s(e,["sessionResumption"]);t!==void 0&&D!=null&&a(t,["setup","sessionResumption"],Lg(n,D));const F=s(e,["inputAudioTranscription"]);t!==void 0&&F!=null&&a(t,["setup","inputAudioTranscription"],Xa());const T=s(e,["outputAudioTranscription"]);t!==void 0&&T!=null&&a(t,["setup","outputAudioTranscription"],Xa());const k=s(e,["realtimeInputConfig"]);t!==void 0&&k!=null&&a(t,["setup","realtimeInputConfig"],Og(n,k));const A=s(e,["contextWindowCompression"]);t!==void 0&&A!=null&&a(t,["setup","contextWindowCompression"],qg(n,A));const S=s(e,["proactivity"]);return t!==void 0&&S!=null&&a(t,["setup","proactivity"],Wg(n,S)),i}function Kg(n,e,t){const i={},r=s(e,["generationConfig"]);t!==void 0&&r!=null&&a(t,["setup","generationConfig"],r);const o=s(e,["responseModalities"]);t!==void 0&&o!=null&&a(t,["setup","generationConfig","responseModalities"],o);const l=s(e,["temperature"]);t!==void 0&&l!=null&&a(t,["setup","generationConfig","temperature"],l);const u=s(e,["topP"]);t!==void 0&&u!=null&&a(t,["setup","generationConfig","topP"],u);const c=s(e,["topK"]);t!==void 0&&c!=null&&a(t,["setup","generationConfig","topK"],c);const f=s(e,["maxOutputTokens"]);t!==void 0&&f!=null&&a(t,["setup","generationConfig","maxOutputTokens"],f);const d=s(e,["mediaResolution"]);t!==void 0&&d!=null&&a(t,["setup","generationConfig","mediaResolution"],d);const h=s(e,["seed"]);t!==void 0&&h!=null&&a(t,["setup","generationConfig","seed"],h);const g=s(e,["speechConfig"]);t!==void 0&&g!=null&&a(t,["setup","generationConfig","speechConfig"],ag(n,Rr(n,g)));const x=s(e,["enableAffectiveDialog"]);t!==void 0&&x!=null&&a(t,["setup","generationConfig","enableAffectiveDialog"],x);const w=s(e,["systemInstruction"]);t!==void 0&&w!=null&&a(t,["setup","systemInstruction"],yg(n,Le(n,w)));const b=s(e,["tools"]);if(t!==void 0&&b!=null){let I=On(n,b);Array.isArray(I)&&(I=I.map(R=>Dg(n,Bn(n,R)))),a(t,["setup","tools"],I)}const D=s(e,["sessionResumption"]);t!==void 0&&D!=null&&a(t,["setup","sessionResumption"],Fg(n,D));const F=s(e,["inputAudioTranscription"]);t!==void 0&&F!=null&&a(t,["setup","inputAudioTranscription"],Qa());const T=s(e,["outputAudioTranscription"]);t!==void 0&&T!=null&&a(t,["setup","outputAudioTranscription"],Qa());const k=s(e,["realtimeInputConfig"]);t!==void 0&&k!=null&&a(t,["setup","realtimeInputConfig"],Ug(n,k));const A=s(e,["contextWindowCompression"]);t!==void 0&&A!=null&&a(t,["setup","contextWindowCompression"],Hg(n,A));const S=s(e,["proactivity"]);return t!==void 0&&S!=null&&a(t,["setup","proactivity"],zg(n,S)),i}function Jg(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["setup","model"],pe(n,i));const r=s(e,["config"]);return r!=null&&a(t,["config"],Yg(n,r,t)),t}function Zg(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["setup","model"],pe(n,i));const r=s(e,["config"]);return r!=null&&a(t,["config"],Kg(n,r,t)),t}function Xg(){return{}}function Qg(){return{}}function jg(){return{}}function ey(){return{}}function ty(n,e){const t={},i=s(e,["media"]);i!=null&&a(t,["mediaChunks"],Na(n,i));const r=s(e,["audio"]);r!=null&&a(t,["audio"],Sh(n,r));const o=s(e,["audioStreamEnd"]);o!=null&&a(t,["audioStreamEnd"],o);const l=s(e,["video"]);l!=null&&a(t,["video"],wh(n,l));const u=s(e,["text"]);return u!=null&&a(t,["text"],u),s(e,["activityStart"])!=null&&a(t,["activityStart"],Xg()),s(e,["activityEnd"])!=null&&a(t,["activityEnd"],jg()),t}function ny(n,e){const t={},i=s(e,["media"]);if(i!=null&&a(t,["mediaChunks"],Na(n,i)),s(e,["audio"])!==void 0)throw new Error("audio parameter is not supported in Vertex AI.");const r=s(e,["audioStreamEnd"]);if(r!=null&&a(t,["audioStreamEnd"],r),s(e,["video"])!==void 0)throw new Error("video parameter is not supported in Vertex AI.");if(s(e,["text"])!==void 0)throw new Error("text parameter is not supported in Vertex AI.");return s(e,["activityStart"])!=null&&a(t,["activityStart"],Qg()),s(e,["activityEnd"])!=null&&a(t,["activityEnd"],ey()),t}function ja(n,e){const t={},i=s(e,["text"]);i!=null&&a(t,["text"],i);const r=s(e,["weight"]);return r!=null&&a(t,["weight"],r),t}function iy(n,e){const t={},i=s(e,["weightedPrompts"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(o=>ja(n,o))),a(t,["weightedPrompts"],r)}return t}function el(n,e){const t={},i=s(e,["temperature"]);i!=null&&a(t,["temperature"],i);const r=s(e,["topK"]);r!=null&&a(t,["topK"],r);const o=s(e,["seed"]);o!=null&&a(t,["seed"],o);const l=s(e,["guidance"]);l!=null&&a(t,["guidance"],l);const u=s(e,["bpm"]);u!=null&&a(t,["bpm"],u);const c=s(e,["density"]);c!=null&&a(t,["density"],c);const f=s(e,["brightness"]);f!=null&&a(t,["brightness"],f);const d=s(e,["scale"]);d!=null&&a(t,["scale"],d);const h=s(e,["muteBass"]);h!=null&&a(t,["muteBass"],h);const g=s(e,["muteDrums"]);g!=null&&a(t,["muteDrums"],g);const x=s(e,["onlyBassAndDrums"]);return x!=null&&a(t,["onlyBassAndDrums"],x),t}function ry(n,e){const t={},i=s(e,["musicGenerationConfig"]);return i!=null&&a(t,["musicGenerationConfig"],el(n,i)),t}function tl(n,e){const t={},i=s(e,["model"]);return i!=null&&a(t,["model"],i),t}function nl(n,e){const t={},i=s(e,["weightedPrompts"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(o=>ja(n,o))),a(t,["weightedPrompts"],r)}return t}function Ir(n,e){const t={},i=s(e,["setup"]);i!=null&&a(t,["setup"],tl(n,i));const r=s(e,["clientContent"]);r!=null&&a(t,["clientContent"],nl(n,r));const o=s(e,["musicGenerationConfig"]);o!=null&&a(t,["musicGenerationConfig"],el(n,o));const l=s(e,["playbackControl"]);return l!=null&&a(t,["playbackControl"],l),t}function oy(){return{}}function sy(){return{}}function ay(n,e){const t={},i=s(e,["fps"]);i!=null&&a(t,["fps"],i);const r=s(e,["endOffset"]);r!=null&&a(t,["endOffset"],r);const o=s(e,["startOffset"]);return o!=null&&a(t,["startOffset"],o),t}function ly(n,e){const t={},i=s(e,["fps"]);i!=null&&a(t,["fps"],i);const r=s(e,["endOffset"]);r!=null&&a(t,["endOffset"],r);const o=s(e,["startOffset"]);return o!=null&&a(t,["startOffset"],o),t}function uy(n,e){const t={},i=s(e,["data"]);i!=null&&a(t,["data"],i);const r=s(e,["mimeType"]);return r!=null&&a(t,["mimeType"],r),t}function cy(n,e){const t={},i=s(e,["displayName"]);i!=null&&a(t,["displayName"],i);const r=s(e,["data"]);r!=null&&a(t,["data"],r);const o=s(e,["mimeType"]);return o!=null&&a(t,["mimeType"],o),t}function fy(n,e){const t={},i=s(e,["fileUri"]);i!=null&&a(t,["fileUri"],i);const r=s(e,["mimeType"]);return r!=null&&a(t,["mimeType"],r),t}function dy(n,e){const t={},i=s(e,["displayName"]);i!=null&&a(t,["displayName"],i);const r=s(e,["fileUri"]);r!=null&&a(t,["fileUri"],r);const o=s(e,["mimeType"]);return o!=null&&a(t,["mimeType"],o),t}function py(n,e){const t={},i=s(e,["videoMetadata"]);i!=null&&a(t,["videoMetadata"],ay(n,i));const r=s(e,["thought"]);r!=null&&a(t,["thought"],r);const o=s(e,["inlineData"]);o!=null&&a(t,["inlineData"],uy(n,o));const l=s(e,["fileData"]);l!=null&&a(t,["fileData"],fy(n,l));const u=s(e,["thoughtSignature"]);u!=null&&a(t,["thoughtSignature"],u);const c=s(e,["codeExecutionResult"]);c!=null&&a(t,["codeExecutionResult"],c);const f=s(e,["executableCode"]);f!=null&&a(t,["executableCode"],f);const d=s(e,["functionCall"]);d!=null&&a(t,["functionCall"],d);const h=s(e,["functionResponse"]);h!=null&&a(t,["functionResponse"],h);const g=s(e,["text"]);return g!=null&&a(t,["text"],g),t}function hy(n,e){const t={},i=s(e,["videoMetadata"]);i!=null&&a(t,["videoMetadata"],ly(n,i));const r=s(e,["thought"]);r!=null&&a(t,["thought"],r);const o=s(e,["inlineData"]);o!=null&&a(t,["inlineData"],cy(n,o));const l=s(e,["fileData"]);l!=null&&a(t,["fileData"],dy(n,l));const u=s(e,["thoughtSignature"]);u!=null&&a(t,["thoughtSignature"],u);const c=s(e,["codeExecutionResult"]);c!=null&&a(t,["codeExecutionResult"],c);const f=s(e,["executableCode"]);f!=null&&a(t,["executableCode"],f);const d=s(e,["functionCall"]);d!=null&&a(t,["functionCall"],d);const h=s(e,["functionResponse"]);h!=null&&a(t,["functionResponse"],h);const g=s(e,["text"]);return g!=null&&a(t,["text"],g),t}function my(n,e){const t={},i=s(e,["parts"]);if(i!=null){let o=i;Array.isArray(o)&&(o=o.map(l=>py(n,l))),a(t,["parts"],o)}const r=s(e,["role"]);return r!=null&&a(t,["role"],r),t}function gy(n,e){const t={},i=s(e,["parts"]);if(i!=null){let o=i;Array.isArray(o)&&(o=o.map(l=>hy(n,l))),a(t,["parts"],o)}const r=s(e,["role"]);return r!=null&&a(t,["role"],r),t}function il(n,e){const t={},i=s(e,["text"]);i!=null&&a(t,["text"],i);const r=s(e,["finished"]);return r!=null&&a(t,["finished"],r),t}function rl(n,e){const t={},i=s(e,["text"]);i!=null&&a(t,["text"],i);const r=s(e,["finished"]);return r!=null&&a(t,["finished"],r),t}function yy(n,e){const t={},i=s(e,["retrievedUrl"]);i!=null&&a(t,["retrievedUrl"],i);const r=s(e,["urlRetrievalStatus"]);return r!=null&&a(t,["urlRetrievalStatus"],r),t}function vy(n,e){const t={},i=s(e,["urlMetadata"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(o=>yy(n,o))),a(t,["urlMetadata"],r)}return t}function _y(n,e){const t={},i=s(e,["modelTurn"]);i!=null&&a(t,["modelTurn"],my(n,i));const r=s(e,["turnComplete"]);r!=null&&a(t,["turnComplete"],r);const o=s(e,["interrupted"]);o!=null&&a(t,["interrupted"],o);const l=s(e,["groundingMetadata"]);l!=null&&a(t,["groundingMetadata"],l);const u=s(e,["generationComplete"]);u!=null&&a(t,["generationComplete"],u);const c=s(e,["inputTranscription"]);c!=null&&a(t,["inputTranscription"],il(n,c));const f=s(e,["outputTranscription"]);f!=null&&a(t,["outputTranscription"],il(n,f));const d=s(e,["urlContextMetadata"]);return d!=null&&a(t,["urlContextMetadata"],vy(n,d)),t}function xy(n,e){const t={},i=s(e,["modelTurn"]);i!=null&&a(t,["modelTurn"],gy(n,i));const r=s(e,["turnComplete"]);r!=null&&a(t,["turnComplete"],r);const o=s(e,["interrupted"]);o!=null&&a(t,["interrupted"],o);const l=s(e,["groundingMetadata"]);l!=null&&a(t,["groundingMetadata"],l);const u=s(e,["generationComplete"]);u!=null&&a(t,["generationComplete"],u);const c=s(e,["inputTranscription"]);c!=null&&a(t,["inputTranscription"],rl(n,c));const f=s(e,["outputTranscription"]);return f!=null&&a(t,["outputTranscription"],rl(n,f)),t}function Cy(n,e){const t={},i=s(e,["id"]);i!=null&&a(t,["id"],i);const r=s(e,["args"]);r!=null&&a(t,["args"],r);const o=s(e,["name"]);return o!=null&&a(t,["name"],o),t}function Ey(n,e){const t={},i=s(e,["args"]);i!=null&&a(t,["args"],i);const r=s(e,["name"]);return r!=null&&a(t,["name"],r),t}function Ty(n,e){const t={},i=s(e,["functionCalls"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(o=>Cy(n,o))),a(t,["functionCalls"],r)}return t}function wy(n,e){const t={},i=s(e,["functionCalls"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(o=>Ey(n,o))),a(t,["functionCalls"],r)}return t}function Sy(n,e){const t={},i=s(e,["ids"]);return i!=null&&a(t,["ids"],i),t}function Ay(n,e){const t={},i=s(e,["ids"]);return i!=null&&a(t,["ids"],i),t}function Ii(n,e){const t={},i=s(e,["modality"]);i!=null&&a(t,["modality"],i);const r=s(e,["tokenCount"]);return r!=null&&a(t,["tokenCount"],r),t}function Pi(n,e){const t={},i=s(e,["modality"]);i!=null&&a(t,["modality"],i);const r=s(e,["tokenCount"]);return r!=null&&a(t,["tokenCount"],r),t}function by(n,e){const t={},i=s(e,["promptTokenCount"]);i!=null&&a(t,["promptTokenCount"],i);const r=s(e,["cachedContentTokenCount"]);r!=null&&a(t,["cachedContentTokenCount"],r);const o=s(e,["responseTokenCount"]);o!=null&&a(t,["responseTokenCount"],o);const l=s(e,["toolUsePromptTokenCount"]);l!=null&&a(t,["toolUsePromptTokenCount"],l);const u=s(e,["thoughtsTokenCount"]);u!=null&&a(t,["thoughtsTokenCount"],u);const c=s(e,["totalTokenCount"]);c!=null&&a(t,["totalTokenCount"],c);const f=s(e,["promptTokensDetails"]);if(f!=null){let x=f;Array.isArray(x)&&(x=x.map(w=>Ii(n,w))),a(t,["promptTokensDetails"],x)}const d=s(e,["cacheTokensDetails"]);if(d!=null){let x=d;Array.isArray(x)&&(x=x.map(w=>Ii(n,w))),a(t,["cacheTokensDetails"],x)}const h=s(e,["responseTokensDetails"]);if(h!=null){let x=h;Array.isArray(x)&&(x=x.map(w=>Ii(n,w))),a(t,["responseTokensDetails"],x)}const g=s(e,["toolUsePromptTokensDetails"]);if(g!=null){let x=g;Array.isArray(x)&&(x=x.map(w=>Ii(n,w))),a(t,["toolUsePromptTokensDetails"],x)}return t}function Ry(n,e){const t={},i=s(e,["promptTokenCount"]);i!=null&&a(t,["promptTokenCount"],i);const r=s(e,["cachedContentTokenCount"]);r!=null&&a(t,["cachedContentTokenCount"],r);const o=s(e,["candidatesTokenCount"]);o!=null&&a(t,["responseTokenCount"],o);const l=s(e,["toolUsePromptTokenCount"]);l!=null&&a(t,["toolUsePromptTokenCount"],l);const u=s(e,["thoughtsTokenCount"]);u!=null&&a(t,["thoughtsTokenCount"],u);const c=s(e,["totalTokenCount"]);c!=null&&a(t,["totalTokenCount"],c);const f=s(e,["promptTokensDetails"]);if(f!=null){let w=f;Array.isArray(w)&&(w=w.map(b=>Pi(n,b))),a(t,["promptTokensDetails"],w)}const d=s(e,["cacheTokensDetails"]);if(d!=null){let w=d;Array.isArray(w)&&(w=w.map(b=>Pi(n,b))),a(t,["cacheTokensDetails"],w)}const h=s(e,["candidatesTokensDetails"]);if(h!=null){let w=h;Array.isArray(w)&&(w=w.map(b=>Pi(n,b))),a(t,["responseTokensDetails"],w)}const g=s(e,["toolUsePromptTokensDetails"]);if(g!=null){let w=g;Array.isArray(w)&&(w=w.map(b=>Pi(n,b))),a(t,["toolUsePromptTokensDetails"],w)}const x=s(e,["trafficType"]);return x!=null&&a(t,["trafficType"],x),t}function My(n,e){const t={},i=s(e,["timeLeft"]);return i!=null&&a(t,["timeLeft"],i),t}function Iy(n,e){const t={},i=s(e,["timeLeft"]);return i!=null&&a(t,["timeLeft"],i),t}function Py(n,e){const t={},i=s(e,["newHandle"]);i!=null&&a(t,["newHandle"],i);const r=s(e,["resumable"]);r!=null&&a(t,["resumable"],r);const o=s(e,["lastConsumedClientMessageIndex"]);return o!=null&&a(t,["lastConsumedClientMessageIndex"],o),t}function ky(n,e){const t={},i=s(e,["newHandle"]);i!=null&&a(t,["newHandle"],i);const r=s(e,["resumable"]);r!=null&&a(t,["resumable"],r);const o=s(e,["lastConsumedClientMessageIndex"]);return o!=null&&a(t,["lastConsumedClientMessageIndex"],o),t}function Ny(n,e){const t={};s(e,["setupComplete"])!=null&&a(t,["setupComplete"],oy());const r=s(e,["serverContent"]);r!=null&&a(t,["serverContent"],_y(n,r));const o=s(e,["toolCall"]);o!=null&&a(t,["toolCall"],Ty(n,o));const l=s(e,["toolCallCancellation"]);l!=null&&a(t,["toolCallCancellation"],Sy(n,l));const u=s(e,["usageMetadata"]);u!=null&&a(t,["usageMetadata"],by(n,u));const c=s(e,["goAway"]);c!=null&&a(t,["goAway"],My(n,c));const f=s(e,["sessionResumptionUpdate"]);return f!=null&&a(t,["sessionResumptionUpdate"],Py(n,f)),t}function Dy(n,e){const t={};s(e,["setupComplete"])!=null&&a(t,["setupComplete"],sy());const r=s(e,["serverContent"]);r!=null&&a(t,["serverContent"],xy(n,r));const o=s(e,["toolCall"]);o!=null&&a(t,["toolCall"],wy(n,o));const l=s(e,["toolCallCancellation"]);l!=null&&a(t,["toolCallCancellation"],Ay(n,l));const u=s(e,["usageMetadata"]);u!=null&&a(t,["usageMetadata"],Ry(n,u));const c=s(e,["goAway"]);c!=null&&a(t,["goAway"],Iy(n,c));const f=s(e,["sessionResumptionUpdate"]);return f!=null&&a(t,["sessionResumptionUpdate"],ky(n,f)),t}function Ly(){return{}}function Fy(n,e){const t={},i=s(e,["text"]);i!=null&&a(t,["text"],i);const r=s(e,["weight"]);return r!=null&&a(t,["weight"],r),t}function Vy(n,e){const t={},i=s(e,["weightedPrompts"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(o=>Fy(n,o))),a(t,["weightedPrompts"],r)}return t}function By(n,e){const t={},i=s(e,["temperature"]);i!=null&&a(t,["temperature"],i);const r=s(e,["topK"]);r!=null&&a(t,["topK"],r);const o=s(e,["seed"]);o!=null&&a(t,["seed"],o);const l=s(e,["guidance"]);l!=null&&a(t,["guidance"],l);const u=s(e,["bpm"]);u!=null&&a(t,["bpm"],u);const c=s(e,["density"]);c!=null&&a(t,["density"],c);const f=s(e,["brightness"]);f!=null&&a(t,["brightness"],f);const d=s(e,["scale"]);d!=null&&a(t,["scale"],d);const h=s(e,["muteBass"]);h!=null&&a(t,["muteBass"],h);const g=s(e,["muteDrums"]);g!=null&&a(t,["muteDrums"],g);const x=s(e,["onlyBassAndDrums"]);return x!=null&&a(t,["onlyBassAndDrums"],x),t}function Oy(n,e){const t={},i=s(e,["clientContent"]);i!=null&&a(t,["clientContent"],Vy(n,i));const r=s(e,["musicGenerationConfig"]);return r!=null&&a(t,["musicGenerationConfig"],By(n,r)),t}function Uy(n,e){const t={},i=s(e,["data"]);i!=null&&a(t,["data"],i);const r=s(e,["mimeType"]);r!=null&&a(t,["mimeType"],r);const o=s(e,["sourceMetadata"]);return o!=null&&a(t,["sourceMetadata"],Oy(n,o)),t}function $y(n,e){const t={},i=s(e,["audioChunks"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(o=>Uy(n,o))),a(t,["audioChunks"],r)}return t}function Gy(n,e){const t={},i=s(e,["text"]);i!=null&&a(t,["text"],i);const r=s(e,["filteredReason"]);return r!=null&&a(t,["filteredReason"],r),t}function qy(n,e){const t={};s(e,["setupComplete"])!=null&&a(t,["setupComplete"],Ly());const r=s(e,["serverContent"]);r!=null&&a(t,["serverContent"],$y(n,r));const o=s(e,["filteredPrompt"]);return o!=null&&a(t,["filteredPrompt"],Gy(n,o)),t}/**
|
|
163
171
|
* @license
|
|
164
172
|
* Copyright 2025 Google LLC
|
|
165
173
|
* SPDX-License-Identifier: Apache-2.0
|
|
166
|
-
*/function Ml(o,e){const t={},n=r(e,["fps"]);n!=null&&s(t,["fps"],n);const i=r(e,["endOffset"]);i!=null&&s(t,["endOffset"],i);const a=r(e,["startOffset"]);return a!=null&&s(t,["startOffset"],a),t}function Il(o,e){const t={};if(r(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const n=r(e,["data"]);n!=null&&s(t,["data"],n);const i=r(e,["mimeType"]);return i!=null&&s(t,["mimeType"],i),t}function Rl(o,e){const t={};if(r(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const n=r(e,["fileUri"]);n!=null&&s(t,["fileUri"],n);const i=r(e,["mimeType"]);return i!=null&&s(t,["mimeType"],i),t}function kl(o,e){const t={},n=r(e,["videoMetadata"]);n!=null&&s(t,["videoMetadata"],Ml(o,n));const i=r(e,["thought"]);i!=null&&s(t,["thought"],i);const a=r(e,["inlineData"]);a!=null&&s(t,["inlineData"],Il(o,a));const l=r(e,["fileData"]);l!=null&&s(t,["fileData"],Rl(o,l));const u=r(e,["thoughtSignature"]);u!=null&&s(t,["thoughtSignature"],u);const d=r(e,["codeExecutionResult"]);d!=null&&s(t,["codeExecutionResult"],d);const c=r(e,["executableCode"]);c!=null&&s(t,["executableCode"],c);const f=r(e,["functionCall"]);f!=null&&s(t,["functionCall"],f);const p=r(e,["functionResponse"]);p!=null&&s(t,["functionResponse"],p);const m=r(e,["text"]);return m!=null&&s(t,["text"],m),t}function st(o,e){const t={},n=r(e,["parts"]);if(n!=null){let a=n;Array.isArray(a)&&(a=a.map(l=>kl(o,l))),s(t,["parts"],a)}const i=r(e,["role"]);return i!=null&&s(t,["role"],i),t}function Nl(o,e){const t={},n=r(e,["anyOf"]);n!=null&&s(t,["anyOf"],n);const i=r(e,["default"]);i!=null&&s(t,["default"],i);const a=r(e,["description"]);a!=null&&s(t,["description"],a);const l=r(e,["enum"]);l!=null&&s(t,["enum"],l);const u=r(e,["example"]);u!=null&&s(t,["example"],u);const d=r(e,["format"]);d!=null&&s(t,["format"],d);const c=r(e,["items"]);c!=null&&s(t,["items"],c);const f=r(e,["maxItems"]);f!=null&&s(t,["maxItems"],f);const p=r(e,["maxLength"]);p!=null&&s(t,["maxLength"],p);const m=r(e,["maxProperties"]);m!=null&&s(t,["maxProperties"],m);const h=r(e,["maximum"]);h!=null&&s(t,["maximum"],h);const g=r(e,["minItems"]);g!=null&&s(t,["minItems"],g);const v=r(e,["minLength"]);v!=null&&s(t,["minLength"],v);const x=r(e,["minProperties"]);x!=null&&s(t,["minProperties"],x);const M=r(e,["minimum"]);M!=null&&s(t,["minimum"],M);const R=r(e,["nullable"]);R!=null&&s(t,["nullable"],R);const k=r(e,["pattern"]);k!=null&&s(t,["pattern"],k);const V=r(e,["properties"]);V!=null&&s(t,["properties"],V);const E=r(e,["propertyOrdering"]);E!=null&&s(t,["propertyOrdering"],E);const A=r(e,["required"]);A!=null&&s(t,["required"],A);const P=r(e,["title"]);P!=null&&s(t,["title"],P);const O=r(e,["type"]);return O!=null&&s(t,["type"],O),t}function Pl(o,e){const t={};if(r(e,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");const n=r(e,["category"]);n!=null&&s(t,["category"],n);const i=r(e,["threshold"]);return i!=null&&s(t,["threshold"],i),t}function Dl(o,e){const t={},n=r(e,["behavior"]);n!=null&&s(t,["behavior"],n);const i=r(e,["description"]);i!=null&&s(t,["description"],i);const a=r(e,["name"]);a!=null&&s(t,["name"],a);const l=r(e,["parameters"]);l!=null&&s(t,["parameters"],l);const u=r(e,["response"]);return u!=null&&s(t,["response"],u),t}function bl(o,e){const t={},n=r(e,["startTime"]);n!=null&&s(t,["startTime"],n);const i=r(e,["endTime"]);return i!=null&&s(t,["endTime"],i),t}function Ll(o,e){const t={},n=r(e,["timeRangeFilter"]);return n!=null&&s(t,["timeRangeFilter"],bl(o,n)),t}function Vl(o,e){const t={},n=r(e,["mode"]);n!=null&&s(t,["mode"],n);const i=r(e,["dynamicThreshold"]);return i!=null&&s(t,["dynamicThreshold"],i),t}function Fl(o,e){const t={},n=r(e,["dynamicRetrievalConfig"]);return n!=null&&s(t,["dynamicRetrievalConfig"],Vl(o,n)),t}function Ul(){return{}}function Gl(o,e){const t={},n=r(e,["functionDeclarations"]);if(n!=null){let d=n;Array.isArray(d)&&(d=d.map(c=>Dl(o,c))),s(t,["functionDeclarations"],d)}if(r(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const i=r(e,["googleSearch"]);i!=null&&s(t,["googleSearch"],Ll(o,i));const a=r(e,["googleSearchRetrieval"]);if(a!=null&&s(t,["googleSearchRetrieval"],Fl(o,a)),r(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");if(r(e,["googleMaps"])!==void 0)throw new Error("googleMaps parameter is not supported in Gemini API.");r(e,["urlContext"])!=null&&s(t,["urlContext"],Ul());const u=r(e,["codeExecution"]);return u!=null&&s(t,["codeExecution"],u),t}function Bl(o,e){const t={},n=r(e,["mode"]);n!=null&&s(t,["mode"],n);const i=r(e,["allowedFunctionNames"]);return i!=null&&s(t,["allowedFunctionNames"],i),t}function ql(o,e){const t={},n=r(e,["latitude"]);n!=null&&s(t,["latitude"],n);const i=r(e,["longitude"]);return i!=null&&s(t,["longitude"],i),t}function $l(o,e){const t={},n=r(e,["latLng"]);n!=null&&s(t,["latLng"],ql(o,n));const i=r(e,["languageCode"]);return i!=null&&s(t,["languageCode"],i),t}function Ol(o,e){const t={},n=r(e,["functionCallingConfig"]);n!=null&&s(t,["functionCallingConfig"],Bl(o,n));const i=r(e,["retrievalConfig"]);return i!=null&&s(t,["retrievalConfig"],$l(o,i)),t}function Hl(o,e){const t={},n=r(e,["voiceName"]);return n!=null&&s(t,["voiceName"],n),t}function So(o,e){const t={},n=r(e,["prebuiltVoiceConfig"]);return n!=null&&s(t,["prebuiltVoiceConfig"],Hl(o,n)),t}function Jl(o,e){const t={},n=r(e,["speaker"]);n!=null&&s(t,["speaker"],n);const i=r(e,["voiceConfig"]);return i!=null&&s(t,["voiceConfig"],So(o,i)),t}function zl(o,e){const t={},n=r(e,["speakerVoiceConfigs"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(a=>Jl(o,a))),s(t,["speakerVoiceConfigs"],i)}return t}function Wl(o,e){const t={},n=r(e,["voiceConfig"]);n!=null&&s(t,["voiceConfig"],So(o,n));const i=r(e,["multiSpeakerVoiceConfig"]);i!=null&&s(t,["multiSpeakerVoiceConfig"],zl(o,i));const a=r(e,["languageCode"]);return a!=null&&s(t,["languageCode"],a),t}function Yl(o,e){const t={},n=r(e,["includeThoughts"]);n!=null&&s(t,["includeThoughts"],n);const i=r(e,["thinkingBudget"]);return i!=null&&s(t,["thinkingBudget"],i),t}function Zl(o,e,t){const n={},i=r(e,["systemInstruction"]);t!==void 0&&i!=null&&s(t,["systemInstruction"],st(o,X(o,i)));const a=r(e,["temperature"]);a!=null&&s(n,["temperature"],a);const l=r(e,["topP"]);l!=null&&s(n,["topP"],l);const u=r(e,["topK"]);u!=null&&s(n,["topK"],u);const d=r(e,["candidateCount"]);d!=null&&s(n,["candidateCount"],d);const c=r(e,["maxOutputTokens"]);c!=null&&s(n,["maxOutputTokens"],c);const f=r(e,["stopSequences"]);f!=null&&s(n,["stopSequences"],f);const p=r(e,["responseLogprobs"]);p!=null&&s(n,["responseLogprobs"],p);const m=r(e,["logprobs"]);m!=null&&s(n,["logprobs"],m);const h=r(e,["presencePenalty"]);h!=null&&s(n,["presencePenalty"],h);const g=r(e,["frequencyPenalty"]);g!=null&&s(n,["frequencyPenalty"],g);const v=r(e,["seed"]);v!=null&&s(n,["seed"],v);const x=r(e,["responseMimeType"]);x!=null&&s(n,["responseMimeType"],x);const M=r(e,["responseSchema"]);if(M!=null&&s(n,["responseSchema"],Nl(o,je(o,M))),r(e,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(r(e,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");const R=r(e,["safetySettings"]);if(t!==void 0&&R!=null){let B=R;Array.isArray(B)&&(B=B.map(Q=>Pl(o,Q))),s(t,["safetySettings"],B)}const k=r(e,["tools"]);if(t!==void 0&&k!=null){let B=Be(o,k);Array.isArray(B)&&(B=B.map(Q=>Gl(o,Ge(o,Q)))),s(t,["tools"],B)}const V=r(e,["toolConfig"]);if(t!==void 0&&V!=null&&s(t,["toolConfig"],Ol(o,V)),r(e,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const E=r(e,["cachedContent"]);t!==void 0&&E!=null&&s(t,["cachedContent"],ce(o,E));const A=r(e,["responseModalities"]);A!=null&&s(n,["responseModalities"],A);const P=r(e,["mediaResolution"]);P!=null&&s(n,["mediaResolution"],P);const O=r(e,["speechConfig"]);if(O!=null&&s(n,["speechConfig"],Wl(o,ro(o,O))),r(e,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const b=r(e,["thinkingConfig"]);return b!=null&&s(n,["thinkingConfig"],Yl(o,b)),n}function Ao(o,e){const t={},n=r(e,["model"]);n!=null&&s(t,["_url","model"],q(o,n));const i=r(e,["contents"]);if(i!=null){let l=te(o,i);Array.isArray(l)&&(l=l.map(u=>st(o,u))),s(t,["contents"],l)}const a=r(e,["config"]);return a!=null&&s(t,["generationConfig"],Zl(o,a,t)),t}function Kl(o,e,t){const n={},i=r(e,["taskType"]);t!==void 0&&i!=null&&s(t,["requests[]","taskType"],i);const a=r(e,["title"]);t!==void 0&&a!=null&&s(t,["requests[]","title"],a);const l=r(e,["outputDimensionality"]);if(t!==void 0&&l!=null&&s(t,["requests[]","outputDimensionality"],l),r(e,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(r(e,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");return n}function Xl(o,e){const t={},n=r(e,["model"]);n!=null&&s(t,["_url","model"],q(o,n));const i=r(e,["contents"]);i!=null&&s(t,["requests[]","content"],oo(o,i));const a=r(e,["config"]);a!=null&&s(t,["config"],Kl(o,a,t));const l=r(e,["model"]);return l!==void 0&&s(t,["requests[]","model"],q(o,l)),t}function Ql(o,e,t){const n={};if(r(e,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(r(e,["negativePrompt"])!==void 0)throw new Error("negativePrompt parameter is not supported in Gemini API.");const i=r(e,["numberOfImages"]);t!==void 0&&i!=null&&s(t,["parameters","sampleCount"],i);const a=r(e,["aspectRatio"]);t!==void 0&&a!=null&&s(t,["parameters","aspectRatio"],a);const l=r(e,["guidanceScale"]);if(t!==void 0&&l!=null&&s(t,["parameters","guidanceScale"],l),r(e,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const u=r(e,["safetyFilterLevel"]);t!==void 0&&u!=null&&s(t,["parameters","safetySetting"],u);const d=r(e,["personGeneration"]);t!==void 0&&d!=null&&s(t,["parameters","personGeneration"],d);const c=r(e,["includeSafetyAttributes"]);t!==void 0&&c!=null&&s(t,["parameters","includeSafetyAttributes"],c);const f=r(e,["includeRaiReason"]);t!==void 0&&f!=null&&s(t,["parameters","includeRaiReason"],f);const p=r(e,["language"]);t!==void 0&&p!=null&&s(t,["parameters","language"],p);const m=r(e,["outputMimeType"]);t!==void 0&&m!=null&&s(t,["parameters","outputOptions","mimeType"],m);const h=r(e,["outputCompressionQuality"]);if(t!==void 0&&h!=null&&s(t,["parameters","outputOptions","compressionQuality"],h),r(e,["addWatermark"])!==void 0)throw new Error("addWatermark parameter is not supported in Gemini API.");if(r(e,["enhancePrompt"])!==void 0)throw new Error("enhancePrompt parameter is not supported in Gemini API.");return n}function jl(o,e){const t={},n=r(e,["model"]);n!=null&&s(t,["_url","model"],q(o,n));const i=r(e,["prompt"]);i!=null&&s(t,["instances[0]","prompt"],i);const a=r(e,["config"]);return a!=null&&s(t,["config"],Ql(o,a,t)),t}function eu(o,e){const t={},n=r(e,["model"]);n!=null&&s(t,["_url","name"],q(o,n));const i=r(e,["config"]);return i!=null&&s(t,["config"],i),t}function tu(o,e,t){const n={},i=r(e,["pageSize"]);t!==void 0&&i!=null&&s(t,["_query","pageSize"],i);const a=r(e,["pageToken"]);t!==void 0&&a!=null&&s(t,["_query","pageToken"],a);const l=r(e,["filter"]);t!==void 0&&l!=null&&s(t,["_query","filter"],l);const u=r(e,["queryBase"]);return t!==void 0&&u!=null&&s(t,["_url","models_url"],lo(o,u)),n}function nu(o,e){const t={},n=r(e,["config"]);return n!=null&&s(t,["config"],tu(o,n,t)),t}function ou(o,e,t){const n={},i=r(e,["displayName"]);t!==void 0&&i!=null&&s(t,["displayName"],i);const a=r(e,["description"]);t!==void 0&&a!=null&&s(t,["description"],a);const l=r(e,["defaultCheckpointId"]);return t!==void 0&&l!=null&&s(t,["defaultCheckpointId"],l),n}function iu(o,e){const t={},n=r(e,["model"]);n!=null&&s(t,["_url","name"],q(o,n));const i=r(e,["config"]);return i!=null&&s(t,["config"],ou(o,i,t)),t}function ru(o,e){const t={},n=r(e,["model"]);n!=null&&s(t,["_url","name"],q(o,n));const i=r(e,["config"]);return i!=null&&s(t,["config"],i),t}function su(o,e){const t={};if(r(e,["systemInstruction"])!==void 0)throw new Error("systemInstruction parameter is not supported in Gemini API.");if(r(e,["tools"])!==void 0)throw new Error("tools parameter is not supported in Gemini API.");if(r(e,["generationConfig"])!==void 0)throw new Error("generationConfig parameter is not supported in Gemini API.");return t}function au(o,e){const t={},n=r(e,["model"]);n!=null&&s(t,["_url","model"],q(o,n));const i=r(e,["contents"]);if(i!=null){let l=te(o,i);Array.isArray(l)&&(l=l.map(u=>st(o,u))),s(t,["contents"],l)}const a=r(e,["config"]);return a!=null&&s(t,["config"],su(o,a)),t}function lu(o,e){const t={};if(r(e,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");const n=r(e,["imageBytes"]);n!=null&&s(t,["bytesBase64Encoded"],de(o,n));const i=r(e,["mimeType"]);return i!=null&&s(t,["mimeType"],i),t}function uu(o,e,t){const n={},i=r(e,["numberOfVideos"]);if(t!==void 0&&i!=null&&s(t,["parameters","sampleCount"],i),r(e,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(r(e,["fps"])!==void 0)throw new Error("fps parameter is not supported in Gemini API.");const a=r(e,["durationSeconds"]);if(t!==void 0&&a!=null&&s(t,["parameters","durationSeconds"],a),r(e,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const l=r(e,["aspectRatio"]);if(t!==void 0&&l!=null&&s(t,["parameters","aspectRatio"],l),r(e,["resolution"])!==void 0)throw new Error("resolution parameter is not supported in Gemini API.");const u=r(e,["personGeneration"]);if(t!==void 0&&u!=null&&s(t,["parameters","personGeneration"],u),r(e,["pubsubTopic"])!==void 0)throw new Error("pubsubTopic parameter is not supported in Gemini API.");const d=r(e,["negativePrompt"]);if(t!==void 0&&d!=null&&s(t,["parameters","negativePrompt"],d),r(e,["enhancePrompt"])!==void 0)throw new Error("enhancePrompt parameter is not supported in Gemini API.");if(r(e,["generateAudio"])!==void 0)throw new Error("generateAudio parameter is not supported in Gemini API.");return n}function cu(o,e){const t={},n=r(e,["model"]);n!=null&&s(t,["_url","model"],q(o,n));const i=r(e,["prompt"]);i!=null&&s(t,["instances[0]","prompt"],i);const a=r(e,["image"]);a!=null&&s(t,["instances[0]","image"],lu(o,a));const l=r(e,["config"]);return l!=null&&s(t,["config"],uu(o,l,t)),t}function du(o,e){const t={},n=r(e,["fps"]);n!=null&&s(t,["fps"],n);const i=r(e,["endOffset"]);i!=null&&s(t,["endOffset"],i);const a=r(e,["startOffset"]);return a!=null&&s(t,["startOffset"],a),t}function fu(o,e){const t={},n=r(e,["displayName"]);n!=null&&s(t,["displayName"],n);const i=r(e,["data"]);i!=null&&s(t,["data"],i);const a=r(e,["mimeType"]);return a!=null&&s(t,["mimeType"],a),t}function pu(o,e){const t={},n=r(e,["displayName"]);n!=null&&s(t,["displayName"],n);const i=r(e,["fileUri"]);i!=null&&s(t,["fileUri"],i);const a=r(e,["mimeType"]);return a!=null&&s(t,["mimeType"],a),t}function mu(o,e){const t={},n=r(e,["videoMetadata"]);n!=null&&s(t,["videoMetadata"],du(o,n));const i=r(e,["thought"]);i!=null&&s(t,["thought"],i);const a=r(e,["inlineData"]);a!=null&&s(t,["inlineData"],fu(o,a));const l=r(e,["fileData"]);l!=null&&s(t,["fileData"],pu(o,l));const u=r(e,["thoughtSignature"]);u!=null&&s(t,["thoughtSignature"],u);const d=r(e,["codeExecutionResult"]);d!=null&&s(t,["codeExecutionResult"],d);const c=r(e,["executableCode"]);c!=null&&s(t,["executableCode"],c);const f=r(e,["functionCall"]);f!=null&&s(t,["functionCall"],f);const p=r(e,["functionResponse"]);p!=null&&s(t,["functionResponse"],p);const m=r(e,["text"]);return m!=null&&s(t,["text"],m),t}function ke(o,e){const t={},n=r(e,["parts"]);if(n!=null){let a=n;Array.isArray(a)&&(a=a.map(l=>mu(o,l))),s(t,["parts"],a)}const i=r(e,["role"]);return i!=null&&s(t,["role"],i),t}function hu(o,e){const t={},n=r(e,["anyOf"]);n!=null&&s(t,["anyOf"],n);const i=r(e,["default"]);i!=null&&s(t,["default"],i);const a=r(e,["description"]);a!=null&&s(t,["description"],a);const l=r(e,["enum"]);l!=null&&s(t,["enum"],l);const u=r(e,["example"]);u!=null&&s(t,["example"],u);const d=r(e,["format"]);d!=null&&s(t,["format"],d);const c=r(e,["items"]);c!=null&&s(t,["items"],c);const f=r(e,["maxItems"]);f!=null&&s(t,["maxItems"],f);const p=r(e,["maxLength"]);p!=null&&s(t,["maxLength"],p);const m=r(e,["maxProperties"]);m!=null&&s(t,["maxProperties"],m);const h=r(e,["maximum"]);h!=null&&s(t,["maximum"],h);const g=r(e,["minItems"]);g!=null&&s(t,["minItems"],g);const v=r(e,["minLength"]);v!=null&&s(t,["minLength"],v);const x=r(e,["minProperties"]);x!=null&&s(t,["minProperties"],x);const M=r(e,["minimum"]);M!=null&&s(t,["minimum"],M);const R=r(e,["nullable"]);R!=null&&s(t,["nullable"],R);const k=r(e,["pattern"]);k!=null&&s(t,["pattern"],k);const V=r(e,["properties"]);V!=null&&s(t,["properties"],V);const E=r(e,["propertyOrdering"]);E!=null&&s(t,["propertyOrdering"],E);const A=r(e,["required"]);A!=null&&s(t,["required"],A);const P=r(e,["title"]);P!=null&&s(t,["title"],P);const O=r(e,["type"]);return O!=null&&s(t,["type"],O),t}function gu(o,e){const t={},n=r(e,["featureSelectionPreference"]);return n!=null&&s(t,["featureSelectionPreference"],n),t}function yu(o,e){const t={},n=r(e,["method"]);n!=null&&s(t,["method"],n);const i=r(e,["category"]);i!=null&&s(t,["category"],i);const a=r(e,["threshold"]);return a!=null&&s(t,["threshold"],a),t}function vu(o,e){const t={};if(r(e,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");const n=r(e,["description"]);n!=null&&s(t,["description"],n);const i=r(e,["name"]);i!=null&&s(t,["name"],i);const a=r(e,["parameters"]);a!=null&&s(t,["parameters"],a);const l=r(e,["response"]);return l!=null&&s(t,["response"],l),t}function Tu(o,e){const t={},n=r(e,["startTime"]);n!=null&&s(t,["startTime"],n);const i=r(e,["endTime"]);return i!=null&&s(t,["endTime"],i),t}function Cu(o,e){const t={},n=r(e,["timeRangeFilter"]);return n!=null&&s(t,["timeRangeFilter"],Tu(o,n)),t}function _u(o,e){const t={},n=r(e,["mode"]);n!=null&&s(t,["mode"],n);const i=r(e,["dynamicThreshold"]);return i!=null&&s(t,["dynamicThreshold"],i),t}function xu(o,e){const t={},n=r(e,["dynamicRetrievalConfig"]);return n!=null&&s(t,["dynamicRetrievalConfig"],_u(o,n)),t}function Eu(){return{}}function wu(o,e){const t={},n=r(e,["apiKeyString"]);return n!=null&&s(t,["apiKeyString"],n),t}function Su(o,e){const t={},n=r(e,["apiKeyConfig"]);n!=null&&s(t,["apiKeyConfig"],wu(o,n));const i=r(e,["authType"]);i!=null&&s(t,["authType"],i);const a=r(e,["googleServiceAccountConfig"]);a!=null&&s(t,["googleServiceAccountConfig"],a);const l=r(e,["httpBasicAuthConfig"]);l!=null&&s(t,["httpBasicAuthConfig"],l);const u=r(e,["oauthConfig"]);u!=null&&s(t,["oauthConfig"],u);const d=r(e,["oidcConfig"]);return d!=null&&s(t,["oidcConfig"],d),t}function Au(o,e){const t={},n=r(e,["authConfig"]);return n!=null&&s(t,["authConfig"],Su(o,n)),t}function Mo(o,e){const t={},n=r(e,["functionDeclarations"]);if(n!=null){let f=n;Array.isArray(f)&&(f=f.map(p=>vu(o,p))),s(t,["functionDeclarations"],f)}const i=r(e,["retrieval"]);i!=null&&s(t,["retrieval"],i);const a=r(e,["googleSearch"]);a!=null&&s(t,["googleSearch"],Cu(o,a));const l=r(e,["googleSearchRetrieval"]);l!=null&&s(t,["googleSearchRetrieval"],xu(o,l)),r(e,["enterpriseWebSearch"])!=null&&s(t,["enterpriseWebSearch"],Eu());const d=r(e,["googleMaps"]);if(d!=null&&s(t,["googleMaps"],Au(o,d)),r(e,["urlContext"])!==void 0)throw new Error("urlContext parameter is not supported in Vertex AI.");const c=r(e,["codeExecution"]);return c!=null&&s(t,["codeExecution"],c),t}function Mu(o,e){const t={},n=r(e,["mode"]);n!=null&&s(t,["mode"],n);const i=r(e,["allowedFunctionNames"]);return i!=null&&s(t,["allowedFunctionNames"],i),t}function Iu(o,e){const t={},n=r(e,["latitude"]);n!=null&&s(t,["latitude"],n);const i=r(e,["longitude"]);return i!=null&&s(t,["longitude"],i),t}function Ru(o,e){const t={},n=r(e,["latLng"]);n!=null&&s(t,["latLng"],Iu(o,n));const i=r(e,["languageCode"]);return i!=null&&s(t,["languageCode"],i),t}function ku(o,e){const t={},n=r(e,["functionCallingConfig"]);n!=null&&s(t,["functionCallingConfig"],Mu(o,n));const i=r(e,["retrievalConfig"]);return i!=null&&s(t,["retrievalConfig"],Ru(o,i)),t}function Nu(o,e){const t={},n=r(e,["voiceName"]);return n!=null&&s(t,["voiceName"],n),t}function Pu(o,e){const t={},n=r(e,["prebuiltVoiceConfig"]);return n!=null&&s(t,["prebuiltVoiceConfig"],Nu(o,n)),t}function Du(o,e){const t={},n=r(e,["voiceConfig"]);if(n!=null&&s(t,["voiceConfig"],Pu(o,n)),r(e,["multiSpeakerVoiceConfig"])!==void 0)throw new Error("multiSpeakerVoiceConfig parameter is not supported in Vertex AI.");const i=r(e,["languageCode"]);return i!=null&&s(t,["languageCode"],i),t}function bu(o,e){const t={},n=r(e,["includeThoughts"]);n!=null&&s(t,["includeThoughts"],n);const i=r(e,["thinkingBudget"]);return i!=null&&s(t,["thinkingBudget"],i),t}function Lu(o,e,t){const n={},i=r(e,["systemInstruction"]);t!==void 0&&i!=null&&s(t,["systemInstruction"],ke(o,X(o,i)));const a=r(e,["temperature"]);a!=null&&s(n,["temperature"],a);const l=r(e,["topP"]);l!=null&&s(n,["topP"],l);const u=r(e,["topK"]);u!=null&&s(n,["topK"],u);const d=r(e,["candidateCount"]);d!=null&&s(n,["candidateCount"],d);const c=r(e,["maxOutputTokens"]);c!=null&&s(n,["maxOutputTokens"],c);const f=r(e,["stopSequences"]);f!=null&&s(n,["stopSequences"],f);const p=r(e,["responseLogprobs"]);p!=null&&s(n,["responseLogprobs"],p);const m=r(e,["logprobs"]);m!=null&&s(n,["logprobs"],m);const h=r(e,["presencePenalty"]);h!=null&&s(n,["presencePenalty"],h);const g=r(e,["frequencyPenalty"]);g!=null&&s(n,["frequencyPenalty"],g);const v=r(e,["seed"]);v!=null&&s(n,["seed"],v);const x=r(e,["responseMimeType"]);x!=null&&s(n,["responseMimeType"],x);const M=r(e,["responseSchema"]);M!=null&&s(n,["responseSchema"],hu(o,je(o,M)));const R=r(e,["routingConfig"]);R!=null&&s(n,["routingConfig"],R);const k=r(e,["modelSelectionConfig"]);k!=null&&s(n,["modelConfig"],gu(o,k));const V=r(e,["safetySettings"]);if(t!==void 0&&V!=null){let ne=V;Array.isArray(ne)&&(ne=ne.map(ye=>yu(o,ye))),s(t,["safetySettings"],ne)}const E=r(e,["tools"]);if(t!==void 0&&E!=null){let ne=Be(o,E);Array.isArray(ne)&&(ne=ne.map(ye=>Mo(o,Ge(o,ye)))),s(t,["tools"],ne)}const A=r(e,["toolConfig"]);t!==void 0&&A!=null&&s(t,["toolConfig"],ku(o,A));const P=r(e,["labels"]);t!==void 0&&P!=null&&s(t,["labels"],P);const O=r(e,["cachedContent"]);t!==void 0&&O!=null&&s(t,["cachedContent"],ce(o,O));const b=r(e,["responseModalities"]);b!=null&&s(n,["responseModalities"],b);const B=r(e,["mediaResolution"]);B!=null&&s(n,["mediaResolution"],B);const Q=r(e,["speechConfig"]);Q!=null&&s(n,["speechConfig"],Du(o,ro(o,Q)));const Ne=r(e,["audioTimestamp"]);Ne!=null&&s(n,["audioTimestamp"],Ne);const $e=r(e,["thinkingConfig"]);return $e!=null&&s(n,["thinkingConfig"],bu(o,$e)),n}function Io(o,e){const t={},n=r(e,["model"]);n!=null&&s(t,["_url","model"],q(o,n));const i=r(e,["contents"]);if(i!=null){let l=te(o,i);Array.isArray(l)&&(l=l.map(u=>ke(o,u))),s(t,["contents"],l)}const a=r(e,["config"]);return a!=null&&s(t,["generationConfig"],Lu(o,a,t)),t}function Vu(o,e,t){const n={},i=r(e,["taskType"]);t!==void 0&&i!=null&&s(t,["instances[]","task_type"],i);const a=r(e,["title"]);t!==void 0&&a!=null&&s(t,["instances[]","title"],a);const l=r(e,["outputDimensionality"]);t!==void 0&&l!=null&&s(t,["parameters","outputDimensionality"],l);const u=r(e,["mimeType"]);t!==void 0&&u!=null&&s(t,["instances[]","mimeType"],u);const d=r(e,["autoTruncate"]);return t!==void 0&&d!=null&&s(t,["parameters","autoTruncate"],d),n}function Fu(o,e){const t={},n=r(e,["model"]);n!=null&&s(t,["_url","model"],q(o,n));const i=r(e,["contents"]);i!=null&&s(t,["instances[]","content"],oo(o,i));const a=r(e,["config"]);return a!=null&&s(t,["config"],Vu(o,a,t)),t}function Uu(o,e,t){const n={},i=r(e,["outputGcsUri"]);t!==void 0&&i!=null&&s(t,["parameters","storageUri"],i);const a=r(e,["negativePrompt"]);t!==void 0&&a!=null&&s(t,["parameters","negativePrompt"],a);const l=r(e,["numberOfImages"]);t!==void 0&&l!=null&&s(t,["parameters","sampleCount"],l);const u=r(e,["aspectRatio"]);t!==void 0&&u!=null&&s(t,["parameters","aspectRatio"],u);const d=r(e,["guidanceScale"]);t!==void 0&&d!=null&&s(t,["parameters","guidanceScale"],d);const c=r(e,["seed"]);t!==void 0&&c!=null&&s(t,["parameters","seed"],c);const f=r(e,["safetyFilterLevel"]);t!==void 0&&f!=null&&s(t,["parameters","safetySetting"],f);const p=r(e,["personGeneration"]);t!==void 0&&p!=null&&s(t,["parameters","personGeneration"],p);const m=r(e,["includeSafetyAttributes"]);t!==void 0&&m!=null&&s(t,["parameters","includeSafetyAttributes"],m);const h=r(e,["includeRaiReason"]);t!==void 0&&h!=null&&s(t,["parameters","includeRaiReason"],h);const g=r(e,["language"]);t!==void 0&&g!=null&&s(t,["parameters","language"],g);const v=r(e,["outputMimeType"]);t!==void 0&&v!=null&&s(t,["parameters","outputOptions","mimeType"],v);const x=r(e,["outputCompressionQuality"]);t!==void 0&&x!=null&&s(t,["parameters","outputOptions","compressionQuality"],x);const M=r(e,["addWatermark"]);t!==void 0&&M!=null&&s(t,["parameters","addWatermark"],M);const R=r(e,["enhancePrompt"]);return t!==void 0&&R!=null&&s(t,["parameters","enhancePrompt"],R),n}function Gu(o,e){const t={},n=r(e,["model"]);n!=null&&s(t,["_url","model"],q(o,n));const i=r(e,["prompt"]);i!=null&&s(t,["instances[0]","prompt"],i);const a=r(e,["config"]);return a!=null&&s(t,["config"],Uu(o,a,t)),t}function wt(o,e){const t={},n=r(e,["gcsUri"]);n!=null&&s(t,["gcsUri"],n);const i=r(e,["imageBytes"]);i!=null&&s(t,["bytesBase64Encoded"],de(o,i));const a=r(e,["mimeType"]);return a!=null&&s(t,["mimeType"],a),t}function Bu(o,e){const t={},n=r(e,["maskMode"]);n!=null&&s(t,["maskMode"],n);const i=r(e,["segmentationClasses"]);i!=null&&s(t,["maskClasses"],i);const a=r(e,["maskDilation"]);return a!=null&&s(t,["dilation"],a),t}function qu(o,e){const t={},n=r(e,["controlType"]);n!=null&&s(t,["controlType"],n);const i=r(e,["enableControlImageComputation"]);return i!=null&&s(t,["computeControl"],i),t}function $u(o,e){const t={},n=r(e,["styleDescription"]);return n!=null&&s(t,["styleDescription"],n),t}function Ou(o,e){const t={},n=r(e,["subjectType"]);n!=null&&s(t,["subjectType"],n);const i=r(e,["subjectDescription"]);return i!=null&&s(t,["subjectDescription"],i),t}function Hu(o,e){const t={},n=r(e,["referenceImage"]);n!=null&&s(t,["referenceImage"],wt(o,n));const i=r(e,["referenceId"]);i!=null&&s(t,["referenceId"],i);const a=r(e,["referenceType"]);a!=null&&s(t,["referenceType"],a);const l=r(e,["maskImageConfig"]);l!=null&&s(t,["maskImageConfig"],Bu(o,l));const u=r(e,["controlImageConfig"]);u!=null&&s(t,["controlImageConfig"],qu(o,u));const d=r(e,["styleImageConfig"]);d!=null&&s(t,["styleImageConfig"],$u(o,d));const c=r(e,["subjectImageConfig"]);return c!=null&&s(t,["subjectImageConfig"],Ou(o,c)),t}function Ju(o,e,t){const n={},i=r(e,["outputGcsUri"]);t!==void 0&&i!=null&&s(t,["parameters","storageUri"],i);const a=r(e,["negativePrompt"]);t!==void 0&&a!=null&&s(t,["parameters","negativePrompt"],a);const l=r(e,["numberOfImages"]);t!==void 0&&l!=null&&s(t,["parameters","sampleCount"],l);const u=r(e,["aspectRatio"]);t!==void 0&&u!=null&&s(t,["parameters","aspectRatio"],u);const d=r(e,["guidanceScale"]);t!==void 0&&d!=null&&s(t,["parameters","guidanceScale"],d);const c=r(e,["seed"]);t!==void 0&&c!=null&&s(t,["parameters","seed"],c);const f=r(e,["safetyFilterLevel"]);t!==void 0&&f!=null&&s(t,["parameters","safetySetting"],f);const p=r(e,["personGeneration"]);t!==void 0&&p!=null&&s(t,["parameters","personGeneration"],p);const m=r(e,["includeSafetyAttributes"]);t!==void 0&&m!=null&&s(t,["parameters","includeSafetyAttributes"],m);const h=r(e,["includeRaiReason"]);t!==void 0&&h!=null&&s(t,["parameters","includeRaiReason"],h);const g=r(e,["language"]);t!==void 0&&g!=null&&s(t,["parameters","language"],g);const v=r(e,["outputMimeType"]);t!==void 0&&v!=null&&s(t,["parameters","outputOptions","mimeType"],v);const x=r(e,["outputCompressionQuality"]);t!==void 0&&x!=null&&s(t,["parameters","outputOptions","compressionQuality"],x);const M=r(e,["editMode"]);t!==void 0&&M!=null&&s(t,["parameters","editMode"],M);const R=r(e,["baseSteps"]);return t!==void 0&&R!=null&&s(t,["parameters","editConfig","baseSteps"],R),n}function zu(o,e){const t={},n=r(e,["model"]);n!=null&&s(t,["_url","model"],q(o,n));const i=r(e,["prompt"]);i!=null&&s(t,["instances[0]","prompt"],i);const a=r(e,["referenceImages"]);if(a!=null){let u=a;Array.isArray(u)&&(u=u.map(d=>Hu(o,d))),s(t,["instances[0]","referenceImages"],u)}const l=r(e,["config"]);return l!=null&&s(t,["config"],Ju(o,l,t)),t}function Wu(o,e,t){const n={},i=r(e,["includeRaiReason"]);t!==void 0&&i!=null&&s(t,["parameters","includeRaiReason"],i);const a=r(e,["outputMimeType"]);t!==void 0&&a!=null&&s(t,["parameters","outputOptions","mimeType"],a);const l=r(e,["outputCompressionQuality"]);t!==void 0&&l!=null&&s(t,["parameters","outputOptions","compressionQuality"],l);const u=r(e,["numberOfImages"]);t!==void 0&&u!=null&&s(t,["parameters","sampleCount"],u);const d=r(e,["mode"]);return t!==void 0&&d!=null&&s(t,["parameters","mode"],d),n}function Yu(o,e){const t={},n=r(e,["model"]);n!=null&&s(t,["_url","model"],q(o,n));const i=r(e,["image"]);i!=null&&s(t,["instances[0]","image"],wt(o,i));const a=r(e,["upscaleFactor"]);a!=null&&s(t,["parameters","upscaleConfig","upscaleFactor"],a);const l=r(e,["config"]);return l!=null&&s(t,["config"],Wu(o,l,t)),t}function Zu(o,e){const t={},n=r(e,["model"]);n!=null&&s(t,["_url","name"],q(o,n));const i=r(e,["config"]);return i!=null&&s(t,["config"],i),t}function Ku(o,e,t){const n={},i=r(e,["pageSize"]);t!==void 0&&i!=null&&s(t,["_query","pageSize"],i);const a=r(e,["pageToken"]);t!==void 0&&a!=null&&s(t,["_query","pageToken"],a);const l=r(e,["filter"]);t!==void 0&&l!=null&&s(t,["_query","filter"],l);const u=r(e,["queryBase"]);return t!==void 0&&u!=null&&s(t,["_url","models_url"],lo(o,u)),n}function Xu(o,e){const t={},n=r(e,["config"]);return n!=null&&s(t,["config"],Ku(o,n,t)),t}function Qu(o,e,t){const n={},i=r(e,["displayName"]);t!==void 0&&i!=null&&s(t,["displayName"],i);const a=r(e,["description"]);t!==void 0&&a!=null&&s(t,["description"],a);const l=r(e,["defaultCheckpointId"]);return t!==void 0&&l!=null&&s(t,["defaultCheckpointId"],l),n}function ju(o,e){const t={},n=r(e,["model"]);n!=null&&s(t,["_url","model"],q(o,n));const i=r(e,["config"]);return i!=null&&s(t,["config"],Qu(o,i,t)),t}function ec(o,e){const t={},n=r(e,["model"]);n!=null&&s(t,["_url","name"],q(o,n));const i=r(e,["config"]);return i!=null&&s(t,["config"],i),t}function tc(o,e,t){const n={},i=r(e,["systemInstruction"]);t!==void 0&&i!=null&&s(t,["systemInstruction"],ke(o,X(o,i)));const a=r(e,["tools"]);if(t!==void 0&&a!=null){let u=a;Array.isArray(u)&&(u=u.map(d=>Mo(o,d))),s(t,["tools"],u)}const l=r(e,["generationConfig"]);return t!==void 0&&l!=null&&s(t,["generationConfig"],l),n}function nc(o,e){const t={},n=r(e,["model"]);n!=null&&s(t,["_url","model"],q(o,n));const i=r(e,["contents"]);if(i!=null){let l=te(o,i);Array.isArray(l)&&(l=l.map(u=>ke(o,u))),s(t,["contents"],l)}const a=r(e,["config"]);return a!=null&&s(t,["config"],tc(o,a,t)),t}function oc(o,e){const t={},n=r(e,["model"]);n!=null&&s(t,["_url","model"],q(o,n));const i=r(e,["contents"]);if(i!=null){let l=te(o,i);Array.isArray(l)&&(l=l.map(u=>ke(o,u))),s(t,["contents"],l)}const a=r(e,["config"]);return a!=null&&s(t,["config"],a),t}function ic(o,e,t){const n={},i=r(e,["numberOfVideos"]);t!==void 0&&i!=null&&s(t,["parameters","sampleCount"],i);const a=r(e,["outputGcsUri"]);t!==void 0&&a!=null&&s(t,["parameters","storageUri"],a);const l=r(e,["fps"]);t!==void 0&&l!=null&&s(t,["parameters","fps"],l);const u=r(e,["durationSeconds"]);t!==void 0&&u!=null&&s(t,["parameters","durationSeconds"],u);const d=r(e,["seed"]);t!==void 0&&d!=null&&s(t,["parameters","seed"],d);const c=r(e,["aspectRatio"]);t!==void 0&&c!=null&&s(t,["parameters","aspectRatio"],c);const f=r(e,["resolution"]);t!==void 0&&f!=null&&s(t,["parameters","resolution"],f);const p=r(e,["personGeneration"]);t!==void 0&&p!=null&&s(t,["parameters","personGeneration"],p);const m=r(e,["pubsubTopic"]);t!==void 0&&m!=null&&s(t,["parameters","pubsubTopic"],m);const h=r(e,["negativePrompt"]);t!==void 0&&h!=null&&s(t,["parameters","negativePrompt"],h);const g=r(e,["enhancePrompt"]);t!==void 0&&g!=null&&s(t,["parameters","enhancePrompt"],g);const v=r(e,["generateAudio"]);return t!==void 0&&v!=null&&s(t,["parameters","generateAudio"],v),n}function rc(o,e){const t={},n=r(e,["model"]);n!=null&&s(t,["_url","model"],q(o,n));const i=r(e,["prompt"]);i!=null&&s(t,["instances[0]","prompt"],i);const a=r(e,["image"]);a!=null&&s(t,["instances[0]","image"],wt(o,a));const l=r(e,["config"]);return l!=null&&s(t,["config"],ic(o,l,t)),t}function sc(o,e){const t={},n=r(e,["fps"]);n!=null&&s(t,["fps"],n);const i=r(e,["endOffset"]);i!=null&&s(t,["endOffset"],i);const a=r(e,["startOffset"]);return a!=null&&s(t,["startOffset"],a),t}function ac(o,e){const t={},n=r(e,["data"]);n!=null&&s(t,["data"],n);const i=r(e,["mimeType"]);return i!=null&&s(t,["mimeType"],i),t}function lc(o,e){const t={},n=r(e,["fileUri"]);n!=null&&s(t,["fileUri"],n);const i=r(e,["mimeType"]);return i!=null&&s(t,["mimeType"],i),t}function uc(o,e){const t={},n=r(e,["videoMetadata"]);n!=null&&s(t,["videoMetadata"],sc(o,n));const i=r(e,["thought"]);i!=null&&s(t,["thought"],i);const a=r(e,["inlineData"]);a!=null&&s(t,["inlineData"],ac(o,a));const l=r(e,["fileData"]);l!=null&&s(t,["fileData"],lc(o,l));const u=r(e,["thoughtSignature"]);u!=null&&s(t,["thoughtSignature"],u);const d=r(e,["codeExecutionResult"]);d!=null&&s(t,["codeExecutionResult"],d);const c=r(e,["executableCode"]);c!=null&&s(t,["executableCode"],c);const f=r(e,["functionCall"]);f!=null&&s(t,["functionCall"],f);const p=r(e,["functionResponse"]);p!=null&&s(t,["functionResponse"],p);const m=r(e,["text"]);return m!=null&&s(t,["text"],m),t}function cc(o,e){const t={},n=r(e,["parts"]);if(n!=null){let a=n;Array.isArray(a)&&(a=a.map(l=>uc(o,l))),s(t,["parts"],a)}const i=r(e,["role"]);return i!=null&&s(t,["role"],i),t}function dc(o,e){const t={},n=r(e,["citationSources"]);return n!=null&&s(t,["citations"],n),t}function fc(o,e){const t={},n=r(e,["retrievedUrl"]);n!=null&&s(t,["retrievedUrl"],n);const i=r(e,["urlRetrievalStatus"]);return i!=null&&s(t,["urlRetrievalStatus"],i),t}function pc(o,e){const t={},n=r(e,["urlMetadata"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(a=>fc(o,a))),s(t,["urlMetadata"],i)}return t}function mc(o,e){const t={},n=r(e,["content"]);n!=null&&s(t,["content"],cc(o,n));const i=r(e,["citationMetadata"]);i!=null&&s(t,["citationMetadata"],dc(o,i));const a=r(e,["tokenCount"]);a!=null&&s(t,["tokenCount"],a);const l=r(e,["finishReason"]);l!=null&&s(t,["finishReason"],l);const u=r(e,["urlContextMetadata"]);u!=null&&s(t,["urlContextMetadata"],pc(o,u));const d=r(e,["avgLogprobs"]);d!=null&&s(t,["avgLogprobs"],d);const c=r(e,["groundingMetadata"]);c!=null&&s(t,["groundingMetadata"],c);const f=r(e,["index"]);f!=null&&s(t,["index"],f);const p=r(e,["logprobsResult"]);p!=null&&s(t,["logprobsResult"],p);const m=r(e,["safetyRatings"]);return m!=null&&s(t,["safetyRatings"],m),t}function Ro(o,e){const t={},n=r(e,["candidates"]);if(n!=null){let u=n;Array.isArray(u)&&(u=u.map(d=>mc(o,d))),s(t,["candidates"],u)}const i=r(e,["modelVersion"]);i!=null&&s(t,["modelVersion"],i);const a=r(e,["promptFeedback"]);a!=null&&s(t,["promptFeedback"],a);const l=r(e,["usageMetadata"]);return l!=null&&s(t,["usageMetadata"],l),t}function hc(o,e){const t={},n=r(e,["values"]);return n!=null&&s(t,["values"],n),t}function gc(){return{}}function yc(o,e){const t={},n=r(e,["embeddings"]);if(n!=null){let a=n;Array.isArray(a)&&(a=a.map(l=>hc(o,l))),s(t,["embeddings"],a)}return r(e,["metadata"])!=null&&s(t,["metadata"],gc()),t}function vc(o,e){const t={},n=r(e,["bytesBase64Encoded"]);n!=null&&s(t,["imageBytes"],de(o,n));const i=r(e,["mimeType"]);return i!=null&&s(t,["mimeType"],i),t}function ko(o,e){const t={},n=r(e,["safetyAttributes","categories"]);n!=null&&s(t,["categories"],n);const i=r(e,["safetyAttributes","scores"]);i!=null&&s(t,["scores"],i);const a=r(e,["contentType"]);return a!=null&&s(t,["contentType"],a),t}function Tc(o,e){const t={},n=r(e,["_self"]);n!=null&&s(t,["image"],vc(o,n));const i=r(e,["raiFilteredReason"]);i!=null&&s(t,["raiFilteredReason"],i);const a=r(e,["_self"]);return a!=null&&s(t,["safetyAttributes"],ko(o,a)),t}function Cc(o,e){const t={},n=r(e,["predictions"]);if(n!=null){let a=n;Array.isArray(a)&&(a=a.map(l=>Tc(o,l))),s(t,["generatedImages"],a)}const i=r(e,["positivePromptSafetyAttributes"]);return i!=null&&s(t,["positivePromptSafetyAttributes"],ko(o,i)),t}function _c(o,e){const t={},n=r(e,["baseModel"]);n!=null&&s(t,["baseModel"],n);const i=r(e,["createTime"]);i!=null&&s(t,["createTime"],i);const a=r(e,["updateTime"]);return a!=null&&s(t,["updateTime"],a),t}function St(o,e){const t={},n=r(e,["name"]);n!=null&&s(t,["name"],n);const i=r(e,["displayName"]);i!=null&&s(t,["displayName"],i);const a=r(e,["description"]);a!=null&&s(t,["description"],a);const l=r(e,["version"]);l!=null&&s(t,["version"],l);const u=r(e,["_self"]);u!=null&&s(t,["tunedModelInfo"],_c(o,u));const d=r(e,["inputTokenLimit"]);d!=null&&s(t,["inputTokenLimit"],d);const c=r(e,["outputTokenLimit"]);c!=null&&s(t,["outputTokenLimit"],c);const f=r(e,["supportedGenerationMethods"]);return f!=null&&s(t,["supportedActions"],f),t}function xc(o,e){const t={},n=r(e,["nextPageToken"]);n!=null&&s(t,["nextPageToken"],n);const i=r(e,["_self"]);if(i!=null){let a=uo(o,i);Array.isArray(a)&&(a=a.map(l=>St(o,l))),s(t,["models"],a)}return t}function Ec(){return{}}function wc(o,e){const t={},n=r(e,["totalTokens"]);n!=null&&s(t,["totalTokens"],n);const i=r(e,["cachedContentTokenCount"]);return i!=null&&s(t,["cachedContentTokenCount"],i),t}function Sc(o,e){const t={},n=r(e,["video","uri"]);n!=null&&s(t,["uri"],n);const i=r(e,["video","encodedVideo"]);i!=null&&s(t,["videoBytes"],de(o,i));const a=r(e,["encoding"]);return a!=null&&s(t,["mimeType"],a),t}function Ac(o,e){const t={},n=r(e,["_self"]);return n!=null&&s(t,["video"],Sc(o,n)),t}function Mc(o,e){const t={},n=r(e,["generatedSamples"]);if(n!=null){let l=n;Array.isArray(l)&&(l=l.map(u=>Ac(o,u))),s(t,["generatedVideos"],l)}const i=r(e,["raiMediaFilteredCount"]);i!=null&&s(t,["raiMediaFilteredCount"],i);const a=r(e,["raiMediaFilteredReasons"]);return a!=null&&s(t,["raiMediaFilteredReasons"],a),t}function Ic(o,e){const t={},n=r(e,["name"]);n!=null&&s(t,["name"],n);const i=r(e,["metadata"]);i!=null&&s(t,["metadata"],i);const a=r(e,["done"]);a!=null&&s(t,["done"],a);const l=r(e,["error"]);l!=null&&s(t,["error"],l);const u=r(e,["response","generateVideoResponse"]);return u!=null&&s(t,["response"],Mc(o,u)),t}function Rc(o,e){const t={},n=r(e,["fps"]);n!=null&&s(t,["fps"],n);const i=r(e,["endOffset"]);i!=null&&s(t,["endOffset"],i);const a=r(e,["startOffset"]);return a!=null&&s(t,["startOffset"],a),t}function kc(o,e){const t={},n=r(e,["displayName"]);n!=null&&s(t,["displayName"],n);const i=r(e,["data"]);i!=null&&s(t,["data"],i);const a=r(e,["mimeType"]);return a!=null&&s(t,["mimeType"],a),t}function Nc(o,e){const t={},n=r(e,["displayName"]);n!=null&&s(t,["displayName"],n);const i=r(e,["fileUri"]);i!=null&&s(t,["fileUri"],i);const a=r(e,["mimeType"]);return a!=null&&s(t,["mimeType"],a),t}function Pc(o,e){const t={},n=r(e,["videoMetadata"]);n!=null&&s(t,["videoMetadata"],Rc(o,n));const i=r(e,["thought"]);i!=null&&s(t,["thought"],i);const a=r(e,["inlineData"]);a!=null&&s(t,["inlineData"],kc(o,a));const l=r(e,["fileData"]);l!=null&&s(t,["fileData"],Nc(o,l));const u=r(e,["thoughtSignature"]);u!=null&&s(t,["thoughtSignature"],u);const d=r(e,["codeExecutionResult"]);d!=null&&s(t,["codeExecutionResult"],d);const c=r(e,["executableCode"]);c!=null&&s(t,["executableCode"],c);const f=r(e,["functionCall"]);f!=null&&s(t,["functionCall"],f);const p=r(e,["functionResponse"]);p!=null&&s(t,["functionResponse"],p);const m=r(e,["text"]);return m!=null&&s(t,["text"],m),t}function Dc(o,e){const t={},n=r(e,["parts"]);if(n!=null){let a=n;Array.isArray(a)&&(a=a.map(l=>Pc(o,l))),s(t,["parts"],a)}const i=r(e,["role"]);return i!=null&&s(t,["role"],i),t}function bc(o,e){const t={},n=r(e,["citations"]);return n!=null&&s(t,["citations"],n),t}function Lc(o,e){const t={},n=r(e,["content"]);n!=null&&s(t,["content"],Dc(o,n));const i=r(e,["citationMetadata"]);i!=null&&s(t,["citationMetadata"],bc(o,i));const a=r(e,["finishMessage"]);a!=null&&s(t,["finishMessage"],a);const l=r(e,["finishReason"]);l!=null&&s(t,["finishReason"],l);const u=r(e,["avgLogprobs"]);u!=null&&s(t,["avgLogprobs"],u);const d=r(e,["groundingMetadata"]);d!=null&&s(t,["groundingMetadata"],d);const c=r(e,["index"]);c!=null&&s(t,["index"],c);const f=r(e,["logprobsResult"]);f!=null&&s(t,["logprobsResult"],f);const p=r(e,["safetyRatings"]);return p!=null&&s(t,["safetyRatings"],p),t}function No(o,e){const t={},n=r(e,["candidates"]);if(n!=null){let c=n;Array.isArray(c)&&(c=c.map(f=>Lc(o,f))),s(t,["candidates"],c)}const i=r(e,["createTime"]);i!=null&&s(t,["createTime"],i);const a=r(e,["responseId"]);a!=null&&s(t,["responseId"],a);const l=r(e,["modelVersion"]);l!=null&&s(t,["modelVersion"],l);const u=r(e,["promptFeedback"]);u!=null&&s(t,["promptFeedback"],u);const d=r(e,["usageMetadata"]);return d!=null&&s(t,["usageMetadata"],d),t}function Vc(o,e){const t={},n=r(e,["truncated"]);n!=null&&s(t,["truncated"],n);const i=r(e,["token_count"]);return i!=null&&s(t,["tokenCount"],i),t}function Fc(o,e){const t={},n=r(e,["values"]);n!=null&&s(t,["values"],n);const i=r(e,["statistics"]);return i!=null&&s(t,["statistics"],Vc(o,i)),t}function Uc(o,e){const t={},n=r(e,["billableCharacterCount"]);return n!=null&&s(t,["billableCharacterCount"],n),t}function Gc(o,e){const t={},n=r(e,["predictions[]","embeddings"]);if(n!=null){let a=n;Array.isArray(a)&&(a=a.map(l=>Fc(o,l))),s(t,["embeddings"],a)}const i=r(e,["metadata"]);return i!=null&&s(t,["metadata"],Uc(o,i)),t}function Bc(o,e){const t={},n=r(e,["gcsUri"]);n!=null&&s(t,["gcsUri"],n);const i=r(e,["bytesBase64Encoded"]);i!=null&&s(t,["imageBytes"],de(o,i));const a=r(e,["mimeType"]);return a!=null&&s(t,["mimeType"],a),t}function Po(o,e){const t={},n=r(e,["safetyAttributes","categories"]);n!=null&&s(t,["categories"],n);const i=r(e,["safetyAttributes","scores"]);i!=null&&s(t,["scores"],i);const a=r(e,["contentType"]);return a!=null&&s(t,["contentType"],a),t}function At(o,e){const t={},n=r(e,["_self"]);n!=null&&s(t,["image"],Bc(o,n));const i=r(e,["raiFilteredReason"]);i!=null&&s(t,["raiFilteredReason"],i);const a=r(e,["_self"]);a!=null&&s(t,["safetyAttributes"],Po(o,a));const l=r(e,["prompt"]);return l!=null&&s(t,["enhancedPrompt"],l),t}function qc(o,e){const t={},n=r(e,["predictions"]);if(n!=null){let a=n;Array.isArray(a)&&(a=a.map(l=>At(o,l))),s(t,["generatedImages"],a)}const i=r(e,["positivePromptSafetyAttributes"]);return i!=null&&s(t,["positivePromptSafetyAttributes"],Po(o,i)),t}function $c(o,e){const t={},n=r(e,["predictions"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(a=>At(o,a))),s(t,["generatedImages"],i)}return t}function Oc(o,e){const t={},n=r(e,["predictions"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(a=>At(o,a))),s(t,["generatedImages"],i)}return t}function Hc(o,e){const t={},n=r(e,["endpoint"]);n!=null&&s(t,["name"],n);const i=r(e,["deployedModelId"]);return i!=null&&s(t,["deployedModelId"],i),t}function Jc(o,e){const t={},n=r(e,["labels","google-vertex-llm-tuning-base-model-id"]);n!=null&&s(t,["baseModel"],n);const i=r(e,["createTime"]);i!=null&&s(t,["createTime"],i);const a=r(e,["updateTime"]);return a!=null&&s(t,["updateTime"],a),t}function zc(o,e){const t={},n=r(e,["checkpointId"]);n!=null&&s(t,["checkpointId"],n);const i=r(e,["epoch"]);i!=null&&s(t,["epoch"],i);const a=r(e,["step"]);return a!=null&&s(t,["step"],a),t}function Mt(o,e){const t={},n=r(e,["name"]);n!=null&&s(t,["name"],n);const i=r(e,["displayName"]);i!=null&&s(t,["displayName"],i);const a=r(e,["description"]);a!=null&&s(t,["description"],a);const l=r(e,["versionId"]);l!=null&&s(t,["version"],l);const u=r(e,["deployedModels"]);if(u!=null){let m=u;Array.isArray(m)&&(m=m.map(h=>Hc(o,h))),s(t,["endpoints"],m)}const d=r(e,["labels"]);d!=null&&s(t,["labels"],d);const c=r(e,["_self"]);c!=null&&s(t,["tunedModelInfo"],Jc(o,c));const f=r(e,["defaultCheckpointId"]);f!=null&&s(t,["defaultCheckpointId"],f);const p=r(e,["checkpoints"]);if(p!=null){let m=p;Array.isArray(m)&&(m=m.map(h=>zc(o,h))),s(t,["checkpoints"],m)}return t}function Wc(o,e){const t={},n=r(e,["nextPageToken"]);n!=null&&s(t,["nextPageToken"],n);const i=r(e,["_self"]);if(i!=null){let a=uo(o,i);Array.isArray(a)&&(a=a.map(l=>Mt(o,l))),s(t,["models"],a)}return t}function Yc(){return{}}function Zc(o,e){const t={},n=r(e,["totalTokens"]);return n!=null&&s(t,["totalTokens"],n),t}function Kc(o,e){const t={},n=r(e,["tokensInfo"]);return n!=null&&s(t,["tokensInfo"],n),t}function Xc(o,e){const t={},n=r(e,["gcsUri"]);n!=null&&s(t,["uri"],n);const i=r(e,["bytesBase64Encoded"]);i!=null&&s(t,["videoBytes"],de(o,i));const a=r(e,["mimeType"]);return a!=null&&s(t,["mimeType"],a),t}function Qc(o,e){const t={},n=r(e,["_self"]);return n!=null&&s(t,["video"],Xc(o,n)),t}function jc(o,e){const t={},n=r(e,["videos"]);if(n!=null){let l=n;Array.isArray(l)&&(l=l.map(u=>Qc(o,u))),s(t,["generatedVideos"],l)}const i=r(e,["raiMediaFilteredCount"]);i!=null&&s(t,["raiMediaFilteredCount"],i);const a=r(e,["raiMediaFilteredReasons"]);return a!=null&&s(t,["raiMediaFilteredReasons"],a),t}function ed(o,e){const t={},n=r(e,["name"]);n!=null&&s(t,["name"],n);const i=r(e,["metadata"]);i!=null&&s(t,["metadata"],i);const a=r(e,["done"]);a!=null&&s(t,["done"],a);const l=r(e,["error"]);l!=null&&s(t,["error"],l);const u=r(e,["response"]);return u!=null&&s(t,["response"],jc(o,u)),t}/**
|
|
174
|
+
*/function Hy(n,e){const t={},i=s(e,["fps"]);i!=null&&a(t,["fps"],i);const r=s(e,["endOffset"]);r!=null&&a(t,["endOffset"],r);const o=s(e,["startOffset"]);return o!=null&&a(t,["startOffset"],o),t}function Wy(n,e){const t={};if(s(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const i=s(e,["data"]);i!=null&&a(t,["data"],i);const r=s(e,["mimeType"]);return r!=null&&a(t,["mimeType"],r),t}function zy(n,e){const t={};if(s(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const i=s(e,["fileUri"]);i!=null&&a(t,["fileUri"],i);const r=s(e,["mimeType"]);return r!=null&&a(t,["mimeType"],r),t}function Yy(n,e){const t={},i=s(e,["videoMetadata"]);i!=null&&a(t,["videoMetadata"],Hy(n,i));const r=s(e,["thought"]);r!=null&&a(t,["thought"],r);const o=s(e,["inlineData"]);o!=null&&a(t,["inlineData"],Wy(n,o));const l=s(e,["fileData"]);l!=null&&a(t,["fileData"],zy(n,l));const u=s(e,["thoughtSignature"]);u!=null&&a(t,["thoughtSignature"],u);const c=s(e,["codeExecutionResult"]);c!=null&&a(t,["codeExecutionResult"],c);const f=s(e,["executableCode"]);f!=null&&a(t,["executableCode"],f);const d=s(e,["functionCall"]);d!=null&&a(t,["functionCall"],d);const h=s(e,["functionResponse"]);h!=null&&a(t,["functionResponse"],h);const g=s(e,["text"]);return g!=null&&a(t,["text"],g),t}function ki(n,e){const t={},i=s(e,["parts"]);if(i!=null){let o=i;Array.isArray(o)&&(o=o.map(l=>Yy(n,l))),a(t,["parts"],o)}const r=s(e,["role"]);return r!=null&&a(t,["role"],r),t}function Ky(n,e){const t={},i=s(e,["anyOf"]);i!=null&&a(t,["anyOf"],i);const r=s(e,["default"]);r!=null&&a(t,["default"],r);const o=s(e,["description"]);o!=null&&a(t,["description"],o);const l=s(e,["enum"]);l!=null&&a(t,["enum"],l);const u=s(e,["example"]);u!=null&&a(t,["example"],u);const c=s(e,["format"]);c!=null&&a(t,["format"],c);const f=s(e,["items"]);f!=null&&a(t,["items"],f);const d=s(e,["maxItems"]);d!=null&&a(t,["maxItems"],d);const h=s(e,["maxLength"]);h!=null&&a(t,["maxLength"],h);const g=s(e,["maxProperties"]);g!=null&&a(t,["maxProperties"],g);const x=s(e,["maximum"]);x!=null&&a(t,["maximum"],x);const w=s(e,["minItems"]);w!=null&&a(t,["minItems"],w);const b=s(e,["minLength"]);b!=null&&a(t,["minLength"],b);const D=s(e,["minProperties"]);D!=null&&a(t,["minProperties"],D);const F=s(e,["minimum"]);F!=null&&a(t,["minimum"],F);const T=s(e,["nullable"]);T!=null&&a(t,["nullable"],T);const k=s(e,["pattern"]);k!=null&&a(t,["pattern"],k);const A=s(e,["properties"]);A!=null&&a(t,["properties"],A);const S=s(e,["propertyOrdering"]);S!=null&&a(t,["propertyOrdering"],S);const I=s(e,["required"]);I!=null&&a(t,["required"],I);const R=s(e,["title"]);R!=null&&a(t,["title"],R);const M=s(e,["type"]);return M!=null&&a(t,["type"],M),t}function Jy(n,e){const t={};if(s(e,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");const i=s(e,["category"]);i!=null&&a(t,["category"],i);const r=s(e,["threshold"]);return r!=null&&a(t,["threshold"],r),t}function Zy(n,e){const t={},i=s(e,["behavior"]);i!=null&&a(t,["behavior"],i);const r=s(e,["description"]);r!=null&&a(t,["description"],r);const o=s(e,["name"]);o!=null&&a(t,["name"],o);const l=s(e,["parameters"]);l!=null&&a(t,["parameters"],l);const u=s(e,["response"]);return u!=null&&a(t,["response"],u),t}function Xy(n,e){const t={},i=s(e,["startTime"]);i!=null&&a(t,["startTime"],i);const r=s(e,["endTime"]);return r!=null&&a(t,["endTime"],r),t}function Qy(n,e){const t={},i=s(e,["timeRangeFilter"]);return i!=null&&a(t,["timeRangeFilter"],Xy(n,i)),t}function jy(n,e){const t={},i=s(e,["mode"]);i!=null&&a(t,["mode"],i);const r=s(e,["dynamicThreshold"]);return r!=null&&a(t,["dynamicThreshold"],r),t}function ev(n,e){const t={},i=s(e,["dynamicRetrievalConfig"]);return i!=null&&a(t,["dynamicRetrievalConfig"],jy(n,i)),t}function tv(){return{}}function nv(n,e){const t={},i=s(e,["functionDeclarations"]);if(i!=null){let c=i;Array.isArray(c)&&(c=c.map(f=>Zy(n,f))),a(t,["functionDeclarations"],c)}if(s(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const r=s(e,["googleSearch"]);r!=null&&a(t,["googleSearch"],Qy(n,r));const o=s(e,["googleSearchRetrieval"]);if(o!=null&&a(t,["googleSearchRetrieval"],ev(n,o)),s(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");if(s(e,["googleMaps"])!==void 0)throw new Error("googleMaps parameter is not supported in Gemini API.");s(e,["urlContext"])!=null&&a(t,["urlContext"],tv());const u=s(e,["codeExecution"]);return u!=null&&a(t,["codeExecution"],u),t}function iv(n,e){const t={},i=s(e,["mode"]);i!=null&&a(t,["mode"],i);const r=s(e,["allowedFunctionNames"]);return r!=null&&a(t,["allowedFunctionNames"],r),t}function rv(n,e){const t={},i=s(e,["latitude"]);i!=null&&a(t,["latitude"],i);const r=s(e,["longitude"]);return r!=null&&a(t,["longitude"],r),t}function ov(n,e){const t={},i=s(e,["latLng"]);i!=null&&a(t,["latLng"],rv(n,i));const r=s(e,["languageCode"]);return r!=null&&a(t,["languageCode"],r),t}function sv(n,e){const t={},i=s(e,["functionCallingConfig"]);i!=null&&a(t,["functionCallingConfig"],iv(n,i));const r=s(e,["retrievalConfig"]);return r!=null&&a(t,["retrievalConfig"],ov(n,r)),t}function av(n,e){const t={},i=s(e,["voiceName"]);return i!=null&&a(t,["voiceName"],i),t}function ol(n,e){const t={},i=s(e,["prebuiltVoiceConfig"]);return i!=null&&a(t,["prebuiltVoiceConfig"],av(n,i)),t}function lv(n,e){const t={},i=s(e,["speaker"]);i!=null&&a(t,["speaker"],i);const r=s(e,["voiceConfig"]);return r!=null&&a(t,["voiceConfig"],ol(n,r)),t}function uv(n,e){const t={},i=s(e,["speakerVoiceConfigs"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(o=>lv(n,o))),a(t,["speakerVoiceConfigs"],r)}return t}function cv(n,e){const t={},i=s(e,["voiceConfig"]);i!=null&&a(t,["voiceConfig"],ol(n,i));const r=s(e,["multiSpeakerVoiceConfig"]);r!=null&&a(t,["multiSpeakerVoiceConfig"],uv(n,r));const o=s(e,["languageCode"]);return o!=null&&a(t,["languageCode"],o),t}function fv(n,e){const t={},i=s(e,["includeThoughts"]);i!=null&&a(t,["includeThoughts"],i);const r=s(e,["thinkingBudget"]);return r!=null&&a(t,["thinkingBudget"],r),t}function dv(n,e,t){const i={},r=s(e,["systemInstruction"]);t!==void 0&&r!=null&&a(t,["systemInstruction"],ki(n,Le(n,r)));const o=s(e,["temperature"]);o!=null&&a(i,["temperature"],o);const l=s(e,["topP"]);l!=null&&a(i,["topP"],l);const u=s(e,["topK"]);u!=null&&a(i,["topK"],u);const c=s(e,["candidateCount"]);c!=null&&a(i,["candidateCount"],c);const f=s(e,["maxOutputTokens"]);f!=null&&a(i,["maxOutputTokens"],f);const d=s(e,["stopSequences"]);d!=null&&a(i,["stopSequences"],d);const h=s(e,["responseLogprobs"]);h!=null&&a(i,["responseLogprobs"],h);const g=s(e,["logprobs"]);g!=null&&a(i,["logprobs"],g);const x=s(e,["presencePenalty"]);x!=null&&a(i,["presencePenalty"],x);const w=s(e,["frequencyPenalty"]);w!=null&&a(i,["frequencyPenalty"],w);const b=s(e,["seed"]);b!=null&&a(i,["seed"],b);const D=s(e,["responseMimeType"]);D!=null&&a(i,["responseMimeType"],D);const F=s(e,["responseSchema"]);if(F!=null&&a(i,["responseSchema"],Ky(n,Si(n,F))),s(e,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(s(e,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");const T=s(e,["safetySettings"]);if(t!==void 0&&T!=null){let P=T;Array.isArray(P)&&(P=P.map(O=>Jy(n,O))),a(t,["safetySettings"],P)}const k=s(e,["tools"]);if(t!==void 0&&k!=null){let P=On(n,k);Array.isArray(P)&&(P=P.map(O=>nv(n,Bn(n,O)))),a(t,["tools"],P)}const A=s(e,["toolConfig"]);if(t!==void 0&&A!=null&&a(t,["toolConfig"],sv(n,A)),s(e,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const S=s(e,["cachedContent"]);t!==void 0&&S!=null&&a(t,["cachedContent"],Rt(n,S));const I=s(e,["responseModalities"]);I!=null&&a(i,["responseModalities"],I);const R=s(e,["mediaResolution"]);R!=null&&a(i,["mediaResolution"],R);const M=s(e,["speechConfig"]);if(M!=null&&a(i,["speechConfig"],cv(n,Ua(n,M))),s(e,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const C=s(e,["thinkingConfig"]);return C!=null&&a(i,["thinkingConfig"],fv(n,C)),i}function sl(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["_url","model"],pe(n,i));const r=s(e,["contents"]);if(r!=null){let l=Xe(n,r);Array.isArray(l)&&(l=l.map(u=>ki(n,u))),a(t,["contents"],l)}const o=s(e,["config"]);return o!=null&&a(t,["generationConfig"],dv(n,o,t)),t}function pv(n,e,t){const i={},r=s(e,["taskType"]);t!==void 0&&r!=null&&a(t,["requests[]","taskType"],r);const o=s(e,["title"]);t!==void 0&&o!=null&&a(t,["requests[]","title"],o);const l=s(e,["outputDimensionality"]);if(t!==void 0&&l!=null&&a(t,["requests[]","outputDimensionality"],l),s(e,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(s(e,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");return i}function hv(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["_url","model"],pe(n,i));const r=s(e,["contents"]);r!=null&&a(t,["requests[]","content"],Ba(n,r));const o=s(e,["config"]);o!=null&&a(t,["config"],pv(n,o,t));const l=s(e,["model"]);return l!==void 0&&a(t,["requests[]","model"],pe(n,l)),t}function mv(n,e,t){const i={};if(s(e,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(s(e,["negativePrompt"])!==void 0)throw new Error("negativePrompt parameter is not supported in Gemini API.");const r=s(e,["numberOfImages"]);t!==void 0&&r!=null&&a(t,["parameters","sampleCount"],r);const o=s(e,["aspectRatio"]);t!==void 0&&o!=null&&a(t,["parameters","aspectRatio"],o);const l=s(e,["guidanceScale"]);if(t!==void 0&&l!=null&&a(t,["parameters","guidanceScale"],l),s(e,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const u=s(e,["safetyFilterLevel"]);t!==void 0&&u!=null&&a(t,["parameters","safetySetting"],u);const c=s(e,["personGeneration"]);t!==void 0&&c!=null&&a(t,["parameters","personGeneration"],c);const f=s(e,["includeSafetyAttributes"]);t!==void 0&&f!=null&&a(t,["parameters","includeSafetyAttributes"],f);const d=s(e,["includeRaiReason"]);t!==void 0&&d!=null&&a(t,["parameters","includeRaiReason"],d);const h=s(e,["language"]);t!==void 0&&h!=null&&a(t,["parameters","language"],h);const g=s(e,["outputMimeType"]);t!==void 0&&g!=null&&a(t,["parameters","outputOptions","mimeType"],g);const x=s(e,["outputCompressionQuality"]);if(t!==void 0&&x!=null&&a(t,["parameters","outputOptions","compressionQuality"],x),s(e,["addWatermark"])!==void 0)throw new Error("addWatermark parameter is not supported in Gemini API.");if(s(e,["enhancePrompt"])!==void 0)throw new Error("enhancePrompt parameter is not supported in Gemini API.");return i}function gv(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["_url","model"],pe(n,i));const r=s(e,["prompt"]);r!=null&&a(t,["instances[0]","prompt"],r);const o=s(e,["config"]);return o!=null&&a(t,["config"],mv(n,o,t)),t}function yv(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["_url","name"],pe(n,i));const r=s(e,["config"]);return r!=null&&a(t,["config"],r),t}function vv(n,e,t){const i={},r=s(e,["pageSize"]);t!==void 0&&r!=null&&a(t,["_query","pageSize"],r);const o=s(e,["pageToken"]);t!==void 0&&o!=null&&a(t,["_query","pageToken"],o);const l=s(e,["filter"]);t!==void 0&&l!=null&&a(t,["_query","filter"],l);const u=s(e,["queryBase"]);return t!==void 0&&u!=null&&a(t,["_url","models_url"],qa(n,u)),i}function _v(n,e){const t={},i=s(e,["config"]);return i!=null&&a(t,["config"],vv(n,i,t)),t}function xv(n,e,t){const i={},r=s(e,["displayName"]);t!==void 0&&r!=null&&a(t,["displayName"],r);const o=s(e,["description"]);t!==void 0&&o!=null&&a(t,["description"],o);const l=s(e,["defaultCheckpointId"]);return t!==void 0&&l!=null&&a(t,["defaultCheckpointId"],l),i}function Cv(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["_url","name"],pe(n,i));const r=s(e,["config"]);return r!=null&&a(t,["config"],xv(n,r,t)),t}function Ev(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["_url","name"],pe(n,i));const r=s(e,["config"]);return r!=null&&a(t,["config"],r),t}function Tv(n,e){const t={};if(s(e,["systemInstruction"])!==void 0)throw new Error("systemInstruction parameter is not supported in Gemini API.");if(s(e,["tools"])!==void 0)throw new Error("tools parameter is not supported in Gemini API.");if(s(e,["generationConfig"])!==void 0)throw new Error("generationConfig parameter is not supported in Gemini API.");return t}function wv(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["_url","model"],pe(n,i));const r=s(e,["contents"]);if(r!=null){let l=Xe(n,r);Array.isArray(l)&&(l=l.map(u=>ki(n,u))),a(t,["contents"],l)}const o=s(e,["config"]);return o!=null&&a(t,["config"],Tv(n,o)),t}function Sv(n,e){const t={};if(s(e,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");const i=s(e,["imageBytes"]);i!=null&&a(t,["bytesBase64Encoded"],Mt(n,i));const r=s(e,["mimeType"]);return r!=null&&a(t,["mimeType"],r),t}function Av(n,e,t){const i={},r=s(e,["numberOfVideos"]);if(t!==void 0&&r!=null&&a(t,["parameters","sampleCount"],r),s(e,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(s(e,["fps"])!==void 0)throw new Error("fps parameter is not supported in Gemini API.");const o=s(e,["durationSeconds"]);if(t!==void 0&&o!=null&&a(t,["parameters","durationSeconds"],o),s(e,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const l=s(e,["aspectRatio"]);if(t!==void 0&&l!=null&&a(t,["parameters","aspectRatio"],l),s(e,["resolution"])!==void 0)throw new Error("resolution parameter is not supported in Gemini API.");const u=s(e,["personGeneration"]);if(t!==void 0&&u!=null&&a(t,["parameters","personGeneration"],u),s(e,["pubsubTopic"])!==void 0)throw new Error("pubsubTopic parameter is not supported in Gemini API.");const c=s(e,["negativePrompt"]);if(t!==void 0&&c!=null&&a(t,["parameters","negativePrompt"],c),s(e,["enhancePrompt"])!==void 0)throw new Error("enhancePrompt parameter is not supported in Gemini API.");if(s(e,["generateAudio"])!==void 0)throw new Error("generateAudio parameter is not supported in Gemini API.");return i}function bv(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["_url","model"],pe(n,i));const r=s(e,["prompt"]);r!=null&&a(t,["instances[0]","prompt"],r);const o=s(e,["image"]);o!=null&&a(t,["instances[0]","image"],Sv(n,o));const l=s(e,["config"]);return l!=null&&a(t,["config"],Av(n,l,t)),t}function Rv(n,e){const t={},i=s(e,["fps"]);i!=null&&a(t,["fps"],i);const r=s(e,["endOffset"]);r!=null&&a(t,["endOffset"],r);const o=s(e,["startOffset"]);return o!=null&&a(t,["startOffset"],o),t}function Mv(n,e){const t={},i=s(e,["displayName"]);i!=null&&a(t,["displayName"],i);const r=s(e,["data"]);r!=null&&a(t,["data"],r);const o=s(e,["mimeType"]);return o!=null&&a(t,["mimeType"],o),t}function Iv(n,e){const t={},i=s(e,["displayName"]);i!=null&&a(t,["displayName"],i);const r=s(e,["fileUri"]);r!=null&&a(t,["fileUri"],r);const o=s(e,["mimeType"]);return o!=null&&a(t,["mimeType"],o),t}function Pv(n,e){const t={},i=s(e,["videoMetadata"]);i!=null&&a(t,["videoMetadata"],Rv(n,i));const r=s(e,["thought"]);r!=null&&a(t,["thought"],r);const o=s(e,["inlineData"]);o!=null&&a(t,["inlineData"],Mv(n,o));const l=s(e,["fileData"]);l!=null&&a(t,["fileData"],Iv(n,l));const u=s(e,["thoughtSignature"]);u!=null&&a(t,["thoughtSignature"],u);const c=s(e,["codeExecutionResult"]);c!=null&&a(t,["codeExecutionResult"],c);const f=s(e,["executableCode"]);f!=null&&a(t,["executableCode"],f);const d=s(e,["functionCall"]);d!=null&&a(t,["functionCall"],d);const h=s(e,["functionResponse"]);h!=null&&a(t,["functionResponse"],h);const g=s(e,["text"]);return g!=null&&a(t,["text"],g),t}function gn(n,e){const t={},i=s(e,["parts"]);if(i!=null){let o=i;Array.isArray(o)&&(o=o.map(l=>Pv(n,l))),a(t,["parts"],o)}const r=s(e,["role"]);return r!=null&&a(t,["role"],r),t}function kv(n,e){const t={},i=s(e,["anyOf"]);i!=null&&a(t,["anyOf"],i);const r=s(e,["default"]);r!=null&&a(t,["default"],r);const o=s(e,["description"]);o!=null&&a(t,["description"],o);const l=s(e,["enum"]);l!=null&&a(t,["enum"],l);const u=s(e,["example"]);u!=null&&a(t,["example"],u);const c=s(e,["format"]);c!=null&&a(t,["format"],c);const f=s(e,["items"]);f!=null&&a(t,["items"],f);const d=s(e,["maxItems"]);d!=null&&a(t,["maxItems"],d);const h=s(e,["maxLength"]);h!=null&&a(t,["maxLength"],h);const g=s(e,["maxProperties"]);g!=null&&a(t,["maxProperties"],g);const x=s(e,["maximum"]);x!=null&&a(t,["maximum"],x);const w=s(e,["minItems"]);w!=null&&a(t,["minItems"],w);const b=s(e,["minLength"]);b!=null&&a(t,["minLength"],b);const D=s(e,["minProperties"]);D!=null&&a(t,["minProperties"],D);const F=s(e,["minimum"]);F!=null&&a(t,["minimum"],F);const T=s(e,["nullable"]);T!=null&&a(t,["nullable"],T);const k=s(e,["pattern"]);k!=null&&a(t,["pattern"],k);const A=s(e,["properties"]);A!=null&&a(t,["properties"],A);const S=s(e,["propertyOrdering"]);S!=null&&a(t,["propertyOrdering"],S);const I=s(e,["required"]);I!=null&&a(t,["required"],I);const R=s(e,["title"]);R!=null&&a(t,["title"],R);const M=s(e,["type"]);return M!=null&&a(t,["type"],M),t}function Nv(n,e){const t={},i=s(e,["featureSelectionPreference"]);return i!=null&&a(t,["featureSelectionPreference"],i),t}function Dv(n,e){const t={},i=s(e,["method"]);i!=null&&a(t,["method"],i);const r=s(e,["category"]);r!=null&&a(t,["category"],r);const o=s(e,["threshold"]);return o!=null&&a(t,["threshold"],o),t}function Lv(n,e){const t={};if(s(e,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");const i=s(e,["description"]);i!=null&&a(t,["description"],i);const r=s(e,["name"]);r!=null&&a(t,["name"],r);const o=s(e,["parameters"]);o!=null&&a(t,["parameters"],o);const l=s(e,["response"]);return l!=null&&a(t,["response"],l),t}function Fv(n,e){const t={},i=s(e,["startTime"]);i!=null&&a(t,["startTime"],i);const r=s(e,["endTime"]);return r!=null&&a(t,["endTime"],r),t}function Vv(n,e){const t={},i=s(e,["timeRangeFilter"]);return i!=null&&a(t,["timeRangeFilter"],Fv(n,i)),t}function Bv(n,e){const t={},i=s(e,["mode"]);i!=null&&a(t,["mode"],i);const r=s(e,["dynamicThreshold"]);return r!=null&&a(t,["dynamicThreshold"],r),t}function Ov(n,e){const t={},i=s(e,["dynamicRetrievalConfig"]);return i!=null&&a(t,["dynamicRetrievalConfig"],Bv(n,i)),t}function Uv(){return{}}function $v(n,e){const t={},i=s(e,["apiKeyString"]);return i!=null&&a(t,["apiKeyString"],i),t}function Gv(n,e){const t={},i=s(e,["apiKeyConfig"]);i!=null&&a(t,["apiKeyConfig"],$v(n,i));const r=s(e,["authType"]);r!=null&&a(t,["authType"],r);const o=s(e,["googleServiceAccountConfig"]);o!=null&&a(t,["googleServiceAccountConfig"],o);const l=s(e,["httpBasicAuthConfig"]);l!=null&&a(t,["httpBasicAuthConfig"],l);const u=s(e,["oauthConfig"]);u!=null&&a(t,["oauthConfig"],u);const c=s(e,["oidcConfig"]);return c!=null&&a(t,["oidcConfig"],c),t}function qv(n,e){const t={},i=s(e,["authConfig"]);return i!=null&&a(t,["authConfig"],Gv(n,i)),t}function al(n,e){const t={},i=s(e,["functionDeclarations"]);if(i!=null){let d=i;Array.isArray(d)&&(d=d.map(h=>Lv(n,h))),a(t,["functionDeclarations"],d)}const r=s(e,["retrieval"]);r!=null&&a(t,["retrieval"],r);const o=s(e,["googleSearch"]);o!=null&&a(t,["googleSearch"],Vv(n,o));const l=s(e,["googleSearchRetrieval"]);l!=null&&a(t,["googleSearchRetrieval"],Ov(n,l)),s(e,["enterpriseWebSearch"])!=null&&a(t,["enterpriseWebSearch"],Uv());const c=s(e,["googleMaps"]);if(c!=null&&a(t,["googleMaps"],qv(n,c)),s(e,["urlContext"])!==void 0)throw new Error("urlContext parameter is not supported in Vertex AI.");const f=s(e,["codeExecution"]);return f!=null&&a(t,["codeExecution"],f),t}function Hv(n,e){const t={},i=s(e,["mode"]);i!=null&&a(t,["mode"],i);const r=s(e,["allowedFunctionNames"]);return r!=null&&a(t,["allowedFunctionNames"],r),t}function Wv(n,e){const t={},i=s(e,["latitude"]);i!=null&&a(t,["latitude"],i);const r=s(e,["longitude"]);return r!=null&&a(t,["longitude"],r),t}function zv(n,e){const t={},i=s(e,["latLng"]);i!=null&&a(t,["latLng"],Wv(n,i));const r=s(e,["languageCode"]);return r!=null&&a(t,["languageCode"],r),t}function Yv(n,e){const t={},i=s(e,["functionCallingConfig"]);i!=null&&a(t,["functionCallingConfig"],Hv(n,i));const r=s(e,["retrievalConfig"]);return r!=null&&a(t,["retrievalConfig"],zv(n,r)),t}function Kv(n,e){const t={},i=s(e,["voiceName"]);return i!=null&&a(t,["voiceName"],i),t}function Jv(n,e){const t={},i=s(e,["prebuiltVoiceConfig"]);return i!=null&&a(t,["prebuiltVoiceConfig"],Kv(n,i)),t}function Zv(n,e){const t={},i=s(e,["voiceConfig"]);if(i!=null&&a(t,["voiceConfig"],Jv(n,i)),s(e,["multiSpeakerVoiceConfig"])!==void 0)throw new Error("multiSpeakerVoiceConfig parameter is not supported in Vertex AI.");const r=s(e,["languageCode"]);return r!=null&&a(t,["languageCode"],r),t}function Xv(n,e){const t={},i=s(e,["includeThoughts"]);i!=null&&a(t,["includeThoughts"],i);const r=s(e,["thinkingBudget"]);return r!=null&&a(t,["thinkingBudget"],r),t}function Qv(n,e,t){const i={},r=s(e,["systemInstruction"]);t!==void 0&&r!=null&&a(t,["systemInstruction"],gn(n,Le(n,r)));const o=s(e,["temperature"]);o!=null&&a(i,["temperature"],o);const l=s(e,["topP"]);l!=null&&a(i,["topP"],l);const u=s(e,["topK"]);u!=null&&a(i,["topK"],u);const c=s(e,["candidateCount"]);c!=null&&a(i,["candidateCount"],c);const f=s(e,["maxOutputTokens"]);f!=null&&a(i,["maxOutputTokens"],f);const d=s(e,["stopSequences"]);d!=null&&a(i,["stopSequences"],d);const h=s(e,["responseLogprobs"]);h!=null&&a(i,["responseLogprobs"],h);const g=s(e,["logprobs"]);g!=null&&a(i,["logprobs"],g);const x=s(e,["presencePenalty"]);x!=null&&a(i,["presencePenalty"],x);const w=s(e,["frequencyPenalty"]);w!=null&&a(i,["frequencyPenalty"],w);const b=s(e,["seed"]);b!=null&&a(i,["seed"],b);const D=s(e,["responseMimeType"]);D!=null&&a(i,["responseMimeType"],D);const F=s(e,["responseSchema"]);F!=null&&a(i,["responseSchema"],kv(n,Si(n,F)));const T=s(e,["routingConfig"]);T!=null&&a(i,["routingConfig"],T);const k=s(e,["modelSelectionConfig"]);k!=null&&a(i,["modelConfig"],Nv(n,k));const A=s(e,["safetySettings"]);if(t!==void 0&&A!=null){let te=A;Array.isArray(te)&&(te=te.map(Fe=>Dv(n,Fe))),a(t,["safetySettings"],te)}const S=s(e,["tools"]);if(t!==void 0&&S!=null){let te=On(n,S);Array.isArray(te)&&(te=te.map(Fe=>al(n,Bn(n,Fe)))),a(t,["tools"],te)}const I=s(e,["toolConfig"]);t!==void 0&&I!=null&&a(t,["toolConfig"],Yv(n,I));const R=s(e,["labels"]);t!==void 0&&R!=null&&a(t,["labels"],R);const M=s(e,["cachedContent"]);t!==void 0&&M!=null&&a(t,["cachedContent"],Rt(n,M));const C=s(e,["responseModalities"]);C!=null&&a(i,["responseModalities"],C);const P=s(e,["mediaResolution"]);P!=null&&a(i,["mediaResolution"],P);const O=s(e,["speechConfig"]);O!=null&&a(i,["speechConfig"],Zv(n,Ua(n,O)));const U=s(e,["audioTimestamp"]);U!=null&&a(i,["audioTimestamp"],U);const $=s(e,["thinkingConfig"]);return $!=null&&a(i,["thinkingConfig"],Xv(n,$)),i}function ll(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["_url","model"],pe(n,i));const r=s(e,["contents"]);if(r!=null){let l=Xe(n,r);Array.isArray(l)&&(l=l.map(u=>gn(n,u))),a(t,["contents"],l)}const o=s(e,["config"]);return o!=null&&a(t,["generationConfig"],Qv(n,o,t)),t}function jv(n,e,t){const i={},r=s(e,["taskType"]);t!==void 0&&r!=null&&a(t,["instances[]","task_type"],r);const o=s(e,["title"]);t!==void 0&&o!=null&&a(t,["instances[]","title"],o);const l=s(e,["outputDimensionality"]);t!==void 0&&l!=null&&a(t,["parameters","outputDimensionality"],l);const u=s(e,["mimeType"]);t!==void 0&&u!=null&&a(t,["instances[]","mimeType"],u);const c=s(e,["autoTruncate"]);return t!==void 0&&c!=null&&a(t,["parameters","autoTruncate"],c),i}function e0(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["_url","model"],pe(n,i));const r=s(e,["contents"]);r!=null&&a(t,["instances[]","content"],Ba(n,r));const o=s(e,["config"]);return o!=null&&a(t,["config"],jv(n,o,t)),t}function t0(n,e,t){const i={},r=s(e,["outputGcsUri"]);t!==void 0&&r!=null&&a(t,["parameters","storageUri"],r);const o=s(e,["negativePrompt"]);t!==void 0&&o!=null&&a(t,["parameters","negativePrompt"],o);const l=s(e,["numberOfImages"]);t!==void 0&&l!=null&&a(t,["parameters","sampleCount"],l);const u=s(e,["aspectRatio"]);t!==void 0&&u!=null&&a(t,["parameters","aspectRatio"],u);const c=s(e,["guidanceScale"]);t!==void 0&&c!=null&&a(t,["parameters","guidanceScale"],c);const f=s(e,["seed"]);t!==void 0&&f!=null&&a(t,["parameters","seed"],f);const d=s(e,["safetyFilterLevel"]);t!==void 0&&d!=null&&a(t,["parameters","safetySetting"],d);const h=s(e,["personGeneration"]);t!==void 0&&h!=null&&a(t,["parameters","personGeneration"],h);const g=s(e,["includeSafetyAttributes"]);t!==void 0&&g!=null&&a(t,["parameters","includeSafetyAttributes"],g);const x=s(e,["includeRaiReason"]);t!==void 0&&x!=null&&a(t,["parameters","includeRaiReason"],x);const w=s(e,["language"]);t!==void 0&&w!=null&&a(t,["parameters","language"],w);const b=s(e,["outputMimeType"]);t!==void 0&&b!=null&&a(t,["parameters","outputOptions","mimeType"],b);const D=s(e,["outputCompressionQuality"]);t!==void 0&&D!=null&&a(t,["parameters","outputOptions","compressionQuality"],D);const F=s(e,["addWatermark"]);t!==void 0&&F!=null&&a(t,["parameters","addWatermark"],F);const T=s(e,["enhancePrompt"]);return t!==void 0&&T!=null&&a(t,["parameters","enhancePrompt"],T),i}function n0(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["_url","model"],pe(n,i));const r=s(e,["prompt"]);r!=null&&a(t,["instances[0]","prompt"],r);const o=s(e,["config"]);return o!=null&&a(t,["config"],t0(n,o,t)),t}function Pr(n,e){const t={},i=s(e,["gcsUri"]);i!=null&&a(t,["gcsUri"],i);const r=s(e,["imageBytes"]);r!=null&&a(t,["bytesBase64Encoded"],Mt(n,r));const o=s(e,["mimeType"]);return o!=null&&a(t,["mimeType"],o),t}function i0(n,e){const t={},i=s(e,["maskMode"]);i!=null&&a(t,["maskMode"],i);const r=s(e,["segmentationClasses"]);r!=null&&a(t,["maskClasses"],r);const o=s(e,["maskDilation"]);return o!=null&&a(t,["dilation"],o),t}function r0(n,e){const t={},i=s(e,["controlType"]);i!=null&&a(t,["controlType"],i);const r=s(e,["enableControlImageComputation"]);return r!=null&&a(t,["computeControl"],r),t}function o0(n,e){const t={},i=s(e,["styleDescription"]);return i!=null&&a(t,["styleDescription"],i),t}function s0(n,e){const t={},i=s(e,["subjectType"]);i!=null&&a(t,["subjectType"],i);const r=s(e,["subjectDescription"]);return r!=null&&a(t,["subjectDescription"],r),t}function a0(n,e){const t={},i=s(e,["referenceImage"]);i!=null&&a(t,["referenceImage"],Pr(n,i));const r=s(e,["referenceId"]);r!=null&&a(t,["referenceId"],r);const o=s(e,["referenceType"]);o!=null&&a(t,["referenceType"],o);const l=s(e,["maskImageConfig"]);l!=null&&a(t,["maskImageConfig"],i0(n,l));const u=s(e,["controlImageConfig"]);u!=null&&a(t,["controlImageConfig"],r0(n,u));const c=s(e,["styleImageConfig"]);c!=null&&a(t,["styleImageConfig"],o0(n,c));const f=s(e,["subjectImageConfig"]);return f!=null&&a(t,["subjectImageConfig"],s0(n,f)),t}function l0(n,e,t){const i={},r=s(e,["outputGcsUri"]);t!==void 0&&r!=null&&a(t,["parameters","storageUri"],r);const o=s(e,["negativePrompt"]);t!==void 0&&o!=null&&a(t,["parameters","negativePrompt"],o);const l=s(e,["numberOfImages"]);t!==void 0&&l!=null&&a(t,["parameters","sampleCount"],l);const u=s(e,["aspectRatio"]);t!==void 0&&u!=null&&a(t,["parameters","aspectRatio"],u);const c=s(e,["guidanceScale"]);t!==void 0&&c!=null&&a(t,["parameters","guidanceScale"],c);const f=s(e,["seed"]);t!==void 0&&f!=null&&a(t,["parameters","seed"],f);const d=s(e,["safetyFilterLevel"]);t!==void 0&&d!=null&&a(t,["parameters","safetySetting"],d);const h=s(e,["personGeneration"]);t!==void 0&&h!=null&&a(t,["parameters","personGeneration"],h);const g=s(e,["includeSafetyAttributes"]);t!==void 0&&g!=null&&a(t,["parameters","includeSafetyAttributes"],g);const x=s(e,["includeRaiReason"]);t!==void 0&&x!=null&&a(t,["parameters","includeRaiReason"],x);const w=s(e,["language"]);t!==void 0&&w!=null&&a(t,["parameters","language"],w);const b=s(e,["outputMimeType"]);t!==void 0&&b!=null&&a(t,["parameters","outputOptions","mimeType"],b);const D=s(e,["outputCompressionQuality"]);t!==void 0&&D!=null&&a(t,["parameters","outputOptions","compressionQuality"],D);const F=s(e,["editMode"]);t!==void 0&&F!=null&&a(t,["parameters","editMode"],F);const T=s(e,["baseSteps"]);return t!==void 0&&T!=null&&a(t,["parameters","editConfig","baseSteps"],T),i}function u0(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["_url","model"],pe(n,i));const r=s(e,["prompt"]);r!=null&&a(t,["instances[0]","prompt"],r);const o=s(e,["referenceImages"]);if(o!=null){let u=o;Array.isArray(u)&&(u=u.map(c=>a0(n,c))),a(t,["instances[0]","referenceImages"],u)}const l=s(e,["config"]);return l!=null&&a(t,["config"],l0(n,l,t)),t}function c0(n,e,t){const i={},r=s(e,["includeRaiReason"]);t!==void 0&&r!=null&&a(t,["parameters","includeRaiReason"],r);const o=s(e,["outputMimeType"]);t!==void 0&&o!=null&&a(t,["parameters","outputOptions","mimeType"],o);const l=s(e,["outputCompressionQuality"]);t!==void 0&&l!=null&&a(t,["parameters","outputOptions","compressionQuality"],l);const u=s(e,["numberOfImages"]);t!==void 0&&u!=null&&a(t,["parameters","sampleCount"],u);const c=s(e,["mode"]);return t!==void 0&&c!=null&&a(t,["parameters","mode"],c),i}function f0(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["_url","model"],pe(n,i));const r=s(e,["image"]);r!=null&&a(t,["instances[0]","image"],Pr(n,r));const o=s(e,["upscaleFactor"]);o!=null&&a(t,["parameters","upscaleConfig","upscaleFactor"],o);const l=s(e,["config"]);return l!=null&&a(t,["config"],c0(n,l,t)),t}function d0(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["_url","name"],pe(n,i));const r=s(e,["config"]);return r!=null&&a(t,["config"],r),t}function p0(n,e,t){const i={},r=s(e,["pageSize"]);t!==void 0&&r!=null&&a(t,["_query","pageSize"],r);const o=s(e,["pageToken"]);t!==void 0&&o!=null&&a(t,["_query","pageToken"],o);const l=s(e,["filter"]);t!==void 0&&l!=null&&a(t,["_query","filter"],l);const u=s(e,["queryBase"]);return t!==void 0&&u!=null&&a(t,["_url","models_url"],qa(n,u)),i}function h0(n,e){const t={},i=s(e,["config"]);return i!=null&&a(t,["config"],p0(n,i,t)),t}function m0(n,e,t){const i={},r=s(e,["displayName"]);t!==void 0&&r!=null&&a(t,["displayName"],r);const o=s(e,["description"]);t!==void 0&&o!=null&&a(t,["description"],o);const l=s(e,["defaultCheckpointId"]);return t!==void 0&&l!=null&&a(t,["defaultCheckpointId"],l),i}function g0(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["_url","model"],pe(n,i));const r=s(e,["config"]);return r!=null&&a(t,["config"],m0(n,r,t)),t}function y0(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["_url","name"],pe(n,i));const r=s(e,["config"]);return r!=null&&a(t,["config"],r),t}function v0(n,e,t){const i={},r=s(e,["systemInstruction"]);t!==void 0&&r!=null&&a(t,["systemInstruction"],gn(n,Le(n,r)));const o=s(e,["tools"]);if(t!==void 0&&o!=null){let u=o;Array.isArray(u)&&(u=u.map(c=>al(n,c))),a(t,["tools"],u)}const l=s(e,["generationConfig"]);return t!==void 0&&l!=null&&a(t,["generationConfig"],l),i}function _0(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["_url","model"],pe(n,i));const r=s(e,["contents"]);if(r!=null){let l=Xe(n,r);Array.isArray(l)&&(l=l.map(u=>gn(n,u))),a(t,["contents"],l)}const o=s(e,["config"]);return o!=null&&a(t,["config"],v0(n,o,t)),t}function x0(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["_url","model"],pe(n,i));const r=s(e,["contents"]);if(r!=null){let l=Xe(n,r);Array.isArray(l)&&(l=l.map(u=>gn(n,u))),a(t,["contents"],l)}const o=s(e,["config"]);return o!=null&&a(t,["config"],o),t}function C0(n,e,t){const i={},r=s(e,["numberOfVideos"]);t!==void 0&&r!=null&&a(t,["parameters","sampleCount"],r);const o=s(e,["outputGcsUri"]);t!==void 0&&o!=null&&a(t,["parameters","storageUri"],o);const l=s(e,["fps"]);t!==void 0&&l!=null&&a(t,["parameters","fps"],l);const u=s(e,["durationSeconds"]);t!==void 0&&u!=null&&a(t,["parameters","durationSeconds"],u);const c=s(e,["seed"]);t!==void 0&&c!=null&&a(t,["parameters","seed"],c);const f=s(e,["aspectRatio"]);t!==void 0&&f!=null&&a(t,["parameters","aspectRatio"],f);const d=s(e,["resolution"]);t!==void 0&&d!=null&&a(t,["parameters","resolution"],d);const h=s(e,["personGeneration"]);t!==void 0&&h!=null&&a(t,["parameters","personGeneration"],h);const g=s(e,["pubsubTopic"]);t!==void 0&&g!=null&&a(t,["parameters","pubsubTopic"],g);const x=s(e,["negativePrompt"]);t!==void 0&&x!=null&&a(t,["parameters","negativePrompt"],x);const w=s(e,["enhancePrompt"]);t!==void 0&&w!=null&&a(t,["parameters","enhancePrompt"],w);const b=s(e,["generateAudio"]);return t!==void 0&&b!=null&&a(t,["parameters","generateAudio"],b),i}function E0(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["_url","model"],pe(n,i));const r=s(e,["prompt"]);r!=null&&a(t,["instances[0]","prompt"],r);const o=s(e,["image"]);o!=null&&a(t,["instances[0]","image"],Pr(n,o));const l=s(e,["config"]);return l!=null&&a(t,["config"],C0(n,l,t)),t}function T0(n,e){const t={},i=s(e,["fps"]);i!=null&&a(t,["fps"],i);const r=s(e,["endOffset"]);r!=null&&a(t,["endOffset"],r);const o=s(e,["startOffset"]);return o!=null&&a(t,["startOffset"],o),t}function w0(n,e){const t={},i=s(e,["data"]);i!=null&&a(t,["data"],i);const r=s(e,["mimeType"]);return r!=null&&a(t,["mimeType"],r),t}function S0(n,e){const t={},i=s(e,["fileUri"]);i!=null&&a(t,["fileUri"],i);const r=s(e,["mimeType"]);return r!=null&&a(t,["mimeType"],r),t}function A0(n,e){const t={},i=s(e,["videoMetadata"]);i!=null&&a(t,["videoMetadata"],T0(n,i));const r=s(e,["thought"]);r!=null&&a(t,["thought"],r);const o=s(e,["inlineData"]);o!=null&&a(t,["inlineData"],w0(n,o));const l=s(e,["fileData"]);l!=null&&a(t,["fileData"],S0(n,l));const u=s(e,["thoughtSignature"]);u!=null&&a(t,["thoughtSignature"],u);const c=s(e,["codeExecutionResult"]);c!=null&&a(t,["codeExecutionResult"],c);const f=s(e,["executableCode"]);f!=null&&a(t,["executableCode"],f);const d=s(e,["functionCall"]);d!=null&&a(t,["functionCall"],d);const h=s(e,["functionResponse"]);h!=null&&a(t,["functionResponse"],h);const g=s(e,["text"]);return g!=null&&a(t,["text"],g),t}function b0(n,e){const t={},i=s(e,["parts"]);if(i!=null){let o=i;Array.isArray(o)&&(o=o.map(l=>A0(n,l))),a(t,["parts"],o)}const r=s(e,["role"]);return r!=null&&a(t,["role"],r),t}function R0(n,e){const t={},i=s(e,["citationSources"]);return i!=null&&a(t,["citations"],i),t}function M0(n,e){const t={},i=s(e,["retrievedUrl"]);i!=null&&a(t,["retrievedUrl"],i);const r=s(e,["urlRetrievalStatus"]);return r!=null&&a(t,["urlRetrievalStatus"],r),t}function I0(n,e){const t={},i=s(e,["urlMetadata"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(o=>M0(n,o))),a(t,["urlMetadata"],r)}return t}function P0(n,e){const t={},i=s(e,["content"]);i!=null&&a(t,["content"],b0(n,i));const r=s(e,["citationMetadata"]);r!=null&&a(t,["citationMetadata"],R0(n,r));const o=s(e,["tokenCount"]);o!=null&&a(t,["tokenCount"],o);const l=s(e,["finishReason"]);l!=null&&a(t,["finishReason"],l);const u=s(e,["urlContextMetadata"]);u!=null&&a(t,["urlContextMetadata"],I0(n,u));const c=s(e,["avgLogprobs"]);c!=null&&a(t,["avgLogprobs"],c);const f=s(e,["groundingMetadata"]);f!=null&&a(t,["groundingMetadata"],f);const d=s(e,["index"]);d!=null&&a(t,["index"],d);const h=s(e,["logprobsResult"]);h!=null&&a(t,["logprobsResult"],h);const g=s(e,["safetyRatings"]);return g!=null&&a(t,["safetyRatings"],g),t}function ul(n,e){const t={},i=s(e,["candidates"]);if(i!=null){let u=i;Array.isArray(u)&&(u=u.map(c=>P0(n,c))),a(t,["candidates"],u)}const r=s(e,["modelVersion"]);r!=null&&a(t,["modelVersion"],r);const o=s(e,["promptFeedback"]);o!=null&&a(t,["promptFeedback"],o);const l=s(e,["usageMetadata"]);return l!=null&&a(t,["usageMetadata"],l),t}function k0(n,e){const t={},i=s(e,["values"]);return i!=null&&a(t,["values"],i),t}function N0(){return{}}function D0(n,e){const t={},i=s(e,["embeddings"]);if(i!=null){let o=i;Array.isArray(o)&&(o=o.map(l=>k0(n,l))),a(t,["embeddings"],o)}return s(e,["metadata"])!=null&&a(t,["metadata"],N0()),t}function L0(n,e){const t={},i=s(e,["bytesBase64Encoded"]);i!=null&&a(t,["imageBytes"],Mt(n,i));const r=s(e,["mimeType"]);return r!=null&&a(t,["mimeType"],r),t}function cl(n,e){const t={},i=s(e,["safetyAttributes","categories"]);i!=null&&a(t,["categories"],i);const r=s(e,["safetyAttributes","scores"]);r!=null&&a(t,["scores"],r);const o=s(e,["contentType"]);return o!=null&&a(t,["contentType"],o),t}function F0(n,e){const t={},i=s(e,["_self"]);i!=null&&a(t,["image"],L0(n,i));const r=s(e,["raiFilteredReason"]);r!=null&&a(t,["raiFilteredReason"],r);const o=s(e,["_self"]);return o!=null&&a(t,["safetyAttributes"],cl(n,o)),t}function V0(n,e){const t={},i=s(e,["predictions"]);if(i!=null){let o=i;Array.isArray(o)&&(o=o.map(l=>F0(n,l))),a(t,["generatedImages"],o)}const r=s(e,["positivePromptSafetyAttributes"]);return r!=null&&a(t,["positivePromptSafetyAttributes"],cl(n,r)),t}function B0(n,e){const t={},i=s(e,["baseModel"]);i!=null&&a(t,["baseModel"],i);const r=s(e,["createTime"]);r!=null&&a(t,["createTime"],r);const o=s(e,["updateTime"]);return o!=null&&a(t,["updateTime"],o),t}function kr(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["name"],i);const r=s(e,["displayName"]);r!=null&&a(t,["displayName"],r);const o=s(e,["description"]);o!=null&&a(t,["description"],o);const l=s(e,["version"]);l!=null&&a(t,["version"],l);const u=s(e,["_self"]);u!=null&&a(t,["tunedModelInfo"],B0(n,u));const c=s(e,["inputTokenLimit"]);c!=null&&a(t,["inputTokenLimit"],c);const f=s(e,["outputTokenLimit"]);f!=null&&a(t,["outputTokenLimit"],f);const d=s(e,["supportedGenerationMethods"]);return d!=null&&a(t,["supportedActions"],d),t}function O0(n,e){const t={},i=s(e,["nextPageToken"]);i!=null&&a(t,["nextPageToken"],i);const r=s(e,["_self"]);if(r!=null){let o=Ha(n,r);Array.isArray(o)&&(o=o.map(l=>kr(n,l))),a(t,["models"],o)}return t}function U0(){return{}}function $0(n,e){const t={},i=s(e,["totalTokens"]);i!=null&&a(t,["totalTokens"],i);const r=s(e,["cachedContentTokenCount"]);return r!=null&&a(t,["cachedContentTokenCount"],r),t}function G0(n,e){const t={},i=s(e,["video","uri"]);i!=null&&a(t,["uri"],i);const r=s(e,["video","encodedVideo"]);r!=null&&a(t,["videoBytes"],Mt(n,r));const o=s(e,["encoding"]);return o!=null&&a(t,["mimeType"],o),t}function q0(n,e){const t={},i=s(e,["_self"]);return i!=null&&a(t,["video"],G0(n,i)),t}function H0(n,e){const t={},i=s(e,["generatedSamples"]);if(i!=null){let l=i;Array.isArray(l)&&(l=l.map(u=>q0(n,u))),a(t,["generatedVideos"],l)}const r=s(e,["raiMediaFilteredCount"]);r!=null&&a(t,["raiMediaFilteredCount"],r);const o=s(e,["raiMediaFilteredReasons"]);return o!=null&&a(t,["raiMediaFilteredReasons"],o),t}function W0(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["name"],i);const r=s(e,["metadata"]);r!=null&&a(t,["metadata"],r);const o=s(e,["done"]);o!=null&&a(t,["done"],o);const l=s(e,["error"]);l!=null&&a(t,["error"],l);const u=s(e,["response","generateVideoResponse"]);return u!=null&&a(t,["response"],H0(n,u)),t}function z0(n,e){const t={},i=s(e,["fps"]);i!=null&&a(t,["fps"],i);const r=s(e,["endOffset"]);r!=null&&a(t,["endOffset"],r);const o=s(e,["startOffset"]);return o!=null&&a(t,["startOffset"],o),t}function Y0(n,e){const t={},i=s(e,["displayName"]);i!=null&&a(t,["displayName"],i);const r=s(e,["data"]);r!=null&&a(t,["data"],r);const o=s(e,["mimeType"]);return o!=null&&a(t,["mimeType"],o),t}function K0(n,e){const t={},i=s(e,["displayName"]);i!=null&&a(t,["displayName"],i);const r=s(e,["fileUri"]);r!=null&&a(t,["fileUri"],r);const o=s(e,["mimeType"]);return o!=null&&a(t,["mimeType"],o),t}function J0(n,e){const t={},i=s(e,["videoMetadata"]);i!=null&&a(t,["videoMetadata"],z0(n,i));const r=s(e,["thought"]);r!=null&&a(t,["thought"],r);const o=s(e,["inlineData"]);o!=null&&a(t,["inlineData"],Y0(n,o));const l=s(e,["fileData"]);l!=null&&a(t,["fileData"],K0(n,l));const u=s(e,["thoughtSignature"]);u!=null&&a(t,["thoughtSignature"],u);const c=s(e,["codeExecutionResult"]);c!=null&&a(t,["codeExecutionResult"],c);const f=s(e,["executableCode"]);f!=null&&a(t,["executableCode"],f);const d=s(e,["functionCall"]);d!=null&&a(t,["functionCall"],d);const h=s(e,["functionResponse"]);h!=null&&a(t,["functionResponse"],h);const g=s(e,["text"]);return g!=null&&a(t,["text"],g),t}function Z0(n,e){const t={},i=s(e,["parts"]);if(i!=null){let o=i;Array.isArray(o)&&(o=o.map(l=>J0(n,l))),a(t,["parts"],o)}const r=s(e,["role"]);return r!=null&&a(t,["role"],r),t}function X0(n,e){const t={},i=s(e,["citations"]);return i!=null&&a(t,["citations"],i),t}function Q0(n,e){const t={},i=s(e,["content"]);i!=null&&a(t,["content"],Z0(n,i));const r=s(e,["citationMetadata"]);r!=null&&a(t,["citationMetadata"],X0(n,r));const o=s(e,["finishMessage"]);o!=null&&a(t,["finishMessage"],o);const l=s(e,["finishReason"]);l!=null&&a(t,["finishReason"],l);const u=s(e,["avgLogprobs"]);u!=null&&a(t,["avgLogprobs"],u);const c=s(e,["groundingMetadata"]);c!=null&&a(t,["groundingMetadata"],c);const f=s(e,["index"]);f!=null&&a(t,["index"],f);const d=s(e,["logprobsResult"]);d!=null&&a(t,["logprobsResult"],d);const h=s(e,["safetyRatings"]);return h!=null&&a(t,["safetyRatings"],h),t}function fl(n,e){const t={},i=s(e,["candidates"]);if(i!=null){let f=i;Array.isArray(f)&&(f=f.map(d=>Q0(n,d))),a(t,["candidates"],f)}const r=s(e,["createTime"]);r!=null&&a(t,["createTime"],r);const o=s(e,["responseId"]);o!=null&&a(t,["responseId"],o);const l=s(e,["modelVersion"]);l!=null&&a(t,["modelVersion"],l);const u=s(e,["promptFeedback"]);u!=null&&a(t,["promptFeedback"],u);const c=s(e,["usageMetadata"]);return c!=null&&a(t,["usageMetadata"],c),t}function j0(n,e){const t={},i=s(e,["truncated"]);i!=null&&a(t,["truncated"],i);const r=s(e,["token_count"]);return r!=null&&a(t,["tokenCount"],r),t}function e_(n,e){const t={},i=s(e,["values"]);i!=null&&a(t,["values"],i);const r=s(e,["statistics"]);return r!=null&&a(t,["statistics"],j0(n,r)),t}function t_(n,e){const t={},i=s(e,["billableCharacterCount"]);return i!=null&&a(t,["billableCharacterCount"],i),t}function n_(n,e){const t={},i=s(e,["predictions[]","embeddings"]);if(i!=null){let o=i;Array.isArray(o)&&(o=o.map(l=>e_(n,l))),a(t,["embeddings"],o)}const r=s(e,["metadata"]);return r!=null&&a(t,["metadata"],t_(n,r)),t}function i_(n,e){const t={},i=s(e,["gcsUri"]);i!=null&&a(t,["gcsUri"],i);const r=s(e,["bytesBase64Encoded"]);r!=null&&a(t,["imageBytes"],Mt(n,r));const o=s(e,["mimeType"]);return o!=null&&a(t,["mimeType"],o),t}function dl(n,e){const t={},i=s(e,["safetyAttributes","categories"]);i!=null&&a(t,["categories"],i);const r=s(e,["safetyAttributes","scores"]);r!=null&&a(t,["scores"],r);const o=s(e,["contentType"]);return o!=null&&a(t,["contentType"],o),t}function Nr(n,e){const t={},i=s(e,["_self"]);i!=null&&a(t,["image"],i_(n,i));const r=s(e,["raiFilteredReason"]);r!=null&&a(t,["raiFilteredReason"],r);const o=s(e,["_self"]);o!=null&&a(t,["safetyAttributes"],dl(n,o));const l=s(e,["prompt"]);return l!=null&&a(t,["enhancedPrompt"],l),t}function r_(n,e){const t={},i=s(e,["predictions"]);if(i!=null){let o=i;Array.isArray(o)&&(o=o.map(l=>Nr(n,l))),a(t,["generatedImages"],o)}const r=s(e,["positivePromptSafetyAttributes"]);return r!=null&&a(t,["positivePromptSafetyAttributes"],dl(n,r)),t}function o_(n,e){const t={},i=s(e,["predictions"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(o=>Nr(n,o))),a(t,["generatedImages"],r)}return t}function s_(n,e){const t={},i=s(e,["predictions"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(o=>Nr(n,o))),a(t,["generatedImages"],r)}return t}function a_(n,e){const t={},i=s(e,["endpoint"]);i!=null&&a(t,["name"],i);const r=s(e,["deployedModelId"]);return r!=null&&a(t,["deployedModelId"],r),t}function l_(n,e){const t={},i=s(e,["labels","google-vertex-llm-tuning-base-model-id"]);i!=null&&a(t,["baseModel"],i);const r=s(e,["createTime"]);r!=null&&a(t,["createTime"],r);const o=s(e,["updateTime"]);return o!=null&&a(t,["updateTime"],o),t}function u_(n,e){const t={},i=s(e,["checkpointId"]);i!=null&&a(t,["checkpointId"],i);const r=s(e,["epoch"]);r!=null&&a(t,["epoch"],r);const o=s(e,["step"]);return o!=null&&a(t,["step"],o),t}function Dr(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["name"],i);const r=s(e,["displayName"]);r!=null&&a(t,["displayName"],r);const o=s(e,["description"]);o!=null&&a(t,["description"],o);const l=s(e,["versionId"]);l!=null&&a(t,["version"],l);const u=s(e,["deployedModels"]);if(u!=null){let g=u;Array.isArray(g)&&(g=g.map(x=>a_(n,x))),a(t,["endpoints"],g)}const c=s(e,["labels"]);c!=null&&a(t,["labels"],c);const f=s(e,["_self"]);f!=null&&a(t,["tunedModelInfo"],l_(n,f));const d=s(e,["defaultCheckpointId"]);d!=null&&a(t,["defaultCheckpointId"],d);const h=s(e,["checkpoints"]);if(h!=null){let g=h;Array.isArray(g)&&(g=g.map(x=>u_(n,x))),a(t,["checkpoints"],g)}return t}function c_(n,e){const t={},i=s(e,["nextPageToken"]);i!=null&&a(t,["nextPageToken"],i);const r=s(e,["_self"]);if(r!=null){let o=Ha(n,r);Array.isArray(o)&&(o=o.map(l=>Dr(n,l))),a(t,["models"],o)}return t}function f_(){return{}}function d_(n,e){const t={},i=s(e,["totalTokens"]);return i!=null&&a(t,["totalTokens"],i),t}function p_(n,e){const t={},i=s(e,["tokensInfo"]);return i!=null&&a(t,["tokensInfo"],i),t}function h_(n,e){const t={},i=s(e,["gcsUri"]);i!=null&&a(t,["uri"],i);const r=s(e,["bytesBase64Encoded"]);r!=null&&a(t,["videoBytes"],Mt(n,r));const o=s(e,["mimeType"]);return o!=null&&a(t,["mimeType"],o),t}function m_(n,e){const t={},i=s(e,["_self"]);return i!=null&&a(t,["video"],h_(n,i)),t}function g_(n,e){const t={},i=s(e,["videos"]);if(i!=null){let l=i;Array.isArray(l)&&(l=l.map(u=>m_(n,u))),a(t,["generatedVideos"],l)}const r=s(e,["raiMediaFilteredCount"]);r!=null&&a(t,["raiMediaFilteredCount"],r);const o=s(e,["raiMediaFilteredReasons"]);return o!=null&&a(t,["raiMediaFilteredReasons"],o),t}function y_(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["name"],i);const r=s(e,["metadata"]);r!=null&&a(t,["metadata"],r);const o=s(e,["done"]);o!=null&&a(t,["done"],o);const l=s(e,["error"]);l!=null&&a(t,["error"],l);const u=s(e,["response"]);return u!=null&&a(t,["response"],g_(n,u)),t}/**
|
|
167
175
|
* @license
|
|
168
176
|
* Copyright 2025 Google LLC
|
|
169
177
|
* SPDX-License-Identifier: Apache-2.0
|
|
170
|
-
*/const
|
|
178
|
+
*/const v_="Content-Type",__="X-Server-Timeout",x_="User-Agent",Lr="x-goog-api-client",C_="google-genai-sdk/1.3.0",E_="v1beta1",T_="v1beta",pl=/^data: (.*)(?:\n\n|\r\r|\r\n\r\n)/;class hl extends Error{constructor(e,t){t?super(e,{cause:t}):super(e,{cause:new Error().stack}),this.message=e,this.name="ClientError"}}class Fr extends Error{constructor(e,t){t?super(e,{cause:t}):super(e,{cause:new Error().stack}),this.message=e,this.name="ServerError"}}class w_{constructor(e){var t,i;this.clientOptions=Object.assign(Object.assign({},e),{project:e.project,location:e.location,apiKey:e.apiKey,vertexai:e.vertexai});const r={};this.clientOptions.vertexai?(r.apiVersion=(t=this.clientOptions.apiVersion)!==null&&t!==void 0?t:E_,r.baseUrl=this.baseUrlFromProjectLocation(),this.normalizeAuthParameters()):(r.apiVersion=(i=this.clientOptions.apiVersion)!==null&&i!==void 0?i:T_,r.baseUrl="https://generativelanguage.googleapis.com/"),r.headers=this.getDefaultHeaders(),this.clientOptions.httpOptions=r,e.httpOptions&&(this.clientOptions.httpOptions=this.patchHttpOptions(r,e.httpOptions))}baseUrlFromProjectLocation(){return this.clientOptions.project&&this.clientOptions.location&&this.clientOptions.location!=="global"?`https://${this.clientOptions.location}-aiplatform.googleapis.com/`:"https://aiplatform.googleapis.com/"}normalizeAuthParameters(){if(this.clientOptions.project&&this.clientOptions.location){this.clientOptions.apiKey=void 0;return}this.clientOptions.project=void 0,this.clientOptions.location=void 0}isVertexAI(){var e;return(e=this.clientOptions.vertexai)!==null&&e!==void 0?e:!1}getProject(){return this.clientOptions.project}getLocation(){return this.clientOptions.location}getApiVersion(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.apiVersion!==void 0)return this.clientOptions.httpOptions.apiVersion;throw new Error("API version is not set.")}getBaseUrl(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.baseUrl!==void 0)return this.clientOptions.httpOptions.baseUrl;throw new Error("Base URL is not set.")}getRequestUrl(){return this.getRequestUrlInternal(this.clientOptions.httpOptions)}getHeaders(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.headers!==void 0)return this.clientOptions.httpOptions.headers;throw new Error("Headers are not set.")}getRequestUrlInternal(e){if(!e||e.baseUrl===void 0||e.apiVersion===void 0)throw new Error("HTTP options are not correctly set.");const i=[e.baseUrl.endsWith("/")?e.baseUrl.slice(0,-1):e.baseUrl];return e.apiVersion&&e.apiVersion!==""&&i.push(e.apiVersion),i.join("/")}getBaseResourcePath(){return`projects/${this.clientOptions.project}/locations/${this.clientOptions.location}`}getApiKey(){return this.clientOptions.apiKey}getWebsocketBaseUrl(){const e=this.getBaseUrl(),t=new URL(e);return t.protocol=t.protocol=="http:"?"ws":"wss",t.toString()}setBaseUrl(e){if(this.clientOptions.httpOptions)this.clientOptions.httpOptions.baseUrl=e;else throw new Error("HTTP options are not correctly set.")}constructUrl(e,t,i){const r=[this.getRequestUrlInternal(t)];return i&&r.push(this.getBaseResourcePath()),e!==""&&r.push(e),new URL(`${r.join("/")}`)}shouldPrependVertexProjectPath(e){return!(this.clientOptions.apiKey||!this.clientOptions.vertexai||e.path.startsWith("projects/")||e.httpMethod==="GET"&&e.path.startsWith("publishers/google/models"))}async request(e){let t=this.clientOptions.httpOptions;e.httpOptions&&(t=this.patchHttpOptions(this.clientOptions.httpOptions,e.httpOptions));const i=this.shouldPrependVertexProjectPath(e),r=this.constructUrl(e.path,t,i);if(e.queryParams)for(const[l,u]of Object.entries(e.queryParams))r.searchParams.append(l,String(u));let o={};if(e.httpMethod==="GET"){if(e.body&&e.body!=="{}")throw new Error("Request body should be empty for GET request, but got non empty request body")}else o.body=e.body;return o=await this.includeExtraHttpOptionsToRequestInit(o,t,e.abortSignal),this.unaryApiCall(r,o,e.httpMethod)}patchHttpOptions(e,t){const i=JSON.parse(JSON.stringify(e));for(const[r,o]of Object.entries(t))typeof o=="object"?i[r]=Object.assign(Object.assign({},i[r]),o):o!==void 0&&(i[r]=o);return i}async requestStream(e){let t=this.clientOptions.httpOptions;e.httpOptions&&(t=this.patchHttpOptions(this.clientOptions.httpOptions,e.httpOptions));const i=this.shouldPrependVertexProjectPath(e),r=this.constructUrl(e.path,t,i);(!r.searchParams.has("alt")||r.searchParams.get("alt")!=="sse")&&r.searchParams.set("alt","sse");let o={};return o.body=e.body,o=await this.includeExtraHttpOptionsToRequestInit(o,t,e.abortSignal),this.streamApiCall(r,o,e.httpMethod)}async includeExtraHttpOptionsToRequestInit(e,t,i){if(t&&t.timeout||i){const r=new AbortController,o=r.signal;t.timeout&&(t==null?void 0:t.timeout)>0&&setTimeout(()=>r.abort(),t.timeout),i&&i.addEventListener("abort",()=>{r.abort()}),e.signal=o}return e.headers=await this.getHeadersInternal(t),e}async unaryApiCall(e,t,i){return this.apiCall(e.toString(),Object.assign(Object.assign({},t),{method:i})).then(async r=>(await ml(r),new Ar(r))).catch(r=>{throw r instanceof Error?r:new Error(JSON.stringify(r))})}async streamApiCall(e,t,i){return this.apiCall(e.toString(),Object.assign(Object.assign({},t),{method:i})).then(async r=>(await ml(r),this.processStreamResponse(r))).catch(r=>{throw r instanceof Error?r:new Error(JSON.stringify(r))})}processStreamResponse(e){var t;return mn(this,arguments,function*(){const r=(t=e==null?void 0:e.body)===null||t===void 0?void 0:t.getReader(),o=new TextDecoder("utf-8");if(!r)throw new Error("Response body is empty");try{let l="";for(;;){const{done:u,value:c}=yield ge(r.read());if(u){if(l.trim().length>0)throw new Error("Incomplete JSON segment at the end");break}const f=o.decode(c);try{const h=JSON.parse(f);if("error"in h){const g=JSON.parse(JSON.stringify(h.error)),x=g.status,w=g.code,b=`got status: ${x}. ${JSON.stringify(h)}`;if(w>=400&&w<500)throw new hl(b);if(w>=500&&w<600)throw new Fr(b)}}catch(h){const g=h;if(g.name==="ClientError"||g.name==="ServerError")throw h}l+=f;let d=l.match(pl);for(;d;){const h=d[1];try{const g=new Response(h,{headers:e==null?void 0:e.headers,status:e==null?void 0:e.status,statusText:e==null?void 0:e.statusText});yield yield ge(new Ar(g)),l=l.slice(d[0].length),d=l.match(pl)}catch(g){throw new Error(`exception parsing stream chunk ${h}. ${g}`)}}}}finally{r.releaseLock()}})}async apiCall(e,t){return fetch(e,t).catch(i=>{throw new Error(`exception ${i} sending request`)})}getDefaultHeaders(){const e={},t=C_+" "+this.clientOptions.userAgentExtra;return e[x_]=t,e[Lr]=t,e[v_]="application/json",e}async getHeadersInternal(e){const t=new Headers;if(e&&e.headers){for(const[i,r]of Object.entries(e.headers))t.append(i,r);e.timeout&&e.timeout>0&&t.append(__,String(Math.ceil(e.timeout/1e3)))}return await this.clientOptions.auth.addAuthHeaders(t),t}async uploadFile(e,t){var i;const r={};t!=null&&(r.mimeType=t.mimeType,r.name=t.name,r.displayName=t.displayName),r.name&&!r.name.startsWith("files/")&&(r.name=`files/${r.name}`);const o=this.clientOptions.uploader,l=await o.stat(e);r.sizeBytes=String(l.size);const u=(i=t==null?void 0:t.mimeType)!==null&&i!==void 0?i:l.type;if(u===void 0||u==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");r.mimeType=u;const c=await this.fetchUploadUrl(r,t);return o.upload(e,c,this)}async downloadFile(e){await this.clientOptions.downloader.download(e,this)}async fetchUploadUrl(e,t){var i;let r={};t!=null&&t.httpOptions?r=t.httpOptions:r={apiVersion:"",headers:{"Content-Type":"application/json","X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${e.sizeBytes}`,"X-Goog-Upload-Header-Content-Type":`${e.mimeType}`}};const o={file:e},l=await this.request({path:X("upload/v1beta/files",o._url),body:JSON.stringify(o),httpMethod:"POST",httpOptions:r});if(!l||!(l!=null&&l.headers))throw new Error("Server did not return an HttpResponse or the returned HttpResponse did not have headers.");const u=(i=l==null?void 0:l.headers)===null||i===void 0?void 0:i["x-goog-upload-url"];if(u===void 0)throw new Error("Failed to get upload url. Server did not return the x-google-upload-url in the headers");return u}}async function ml(n){var e;if(n===void 0)throw new Fr("response is undefined");if(!n.ok){const t=n.status,i=n.statusText;let r;!((e=n.headers.get("content-type"))===null||e===void 0)&&e.includes("application/json")?r=await n.json():r={error:{message:await n.text(),code:n.status,status:n.statusText}};const o=`got status: ${t} ${i}. ${JSON.stringify(r)}`;throw t>=400&&t<500?new hl(o):t>=500&&t<600?new Fr(o):new Error(o)}}/**
|
|
171
179
|
* @license
|
|
172
180
|
* Copyright 2025 Google LLC
|
|
173
181
|
* SPDX-License-Identifier: Apache-2.0
|
|
174
|
-
*/const
|
|
182
|
+
*/const S_="mcp_used/unknown";function gl(n){for(const e of n)if(Vr(e)||typeof e=="object"&&"inputSchema"in e)return!0;return!1}function yl(n){var e;const t=(e=n[Lr])!==null&&e!==void 0?e:"";n[Lr]=(t+` ${S_}`).trimStart()}function A_(n){var e,t,i;return(i=(t=(e=n.config)===null||e===void 0?void 0:e.tools)===null||t===void 0?void 0:t.some(r=>Vr(r)))!==null&&i!==void 0?i:!1}function b_(n){var e,t,i;return(i=(t=(e=n.config)===null||e===void 0?void 0:e.tools)===null||t===void 0?void 0:t.some(r=>!Vr(r)))!==null&&i!==void 0?i:!1}function Vr(n){return n!==null&&typeof n=="object"&&n instanceof Br}function R_(n,e=100){return mn(this,arguments,function*(){let i,r=0;for(;r<e;){const o=yield ge(n.listTools({cursor:i}));for(const l of o.tools)yield yield ge(l),r++;if(!o.nextCursor)break;i=o.nextCursor}})}class Br{constructor(e=[],t){this.mcpTools=[],this.functionNameToMcpClient={},this.mcpClients=e,this.config=t}static create(e,t){return new Br(e,t)}async initialize(){var e,t,i,r;if(this.mcpTools.length>0)return;const o={},l=[];for(const d of this.mcpClients)try{for(var u=!0,c=(t=void 0,Un(R_(d))),f;f=await c.next(),e=f.done,!e;u=!0){r=f.value,u=!1;const h=r;l.push(h);const g=h.name;if(o[g])throw new Error(`Duplicate function name ${g} found in MCP tools. Please ensure function names are unique.`);o[g]=d}}catch(h){t={error:h}}finally{try{!u&&!e&&(i=c.return)&&await i.call(c)}finally{if(t)throw t.error}}this.mcpTools=l,this.functionNameToMcpClient=o}async tool(){return await this.initialize(),Fh(this.mcpTools,this.config)}async callTool(e){await this.initialize();const t=[];for(const i of e)if(i.name in this.functionNameToMcpClient){const o=await this.functionNameToMcpClient[i.name].callTool({name:i.name,arguments:i.args});t.push({functionResponse:{name:i.name,response:o.isError?{error:o}:o}})}return t}}/**
|
|
175
183
|
* @license
|
|
176
184
|
* Copyright 2025 Google LLC
|
|
177
185
|
* SPDX-License-Identifier: Apache-2.0
|
|
178
|
-
*/async function
|
|
186
|
+
*/async function M_(n,e,t){const i=new Th;let r;t.data instanceof Blob?r=JSON.parse(await t.data.text()):r=JSON.parse(t.data);const o=qy(n,r);Object.assign(i,o),e(i)}class I_{constructor(e,t,i){this.apiClient=e,this.auth=t,this.webSocketFactory=i}async connect(e){var t,i;if(this.apiClient.isVertexAI())throw new Error("Live music is not supported for Vertex AI.");console.warn("Live music generation is experimental and may change in future versions.");const r=this.apiClient.getWebsocketBaseUrl(),o=this.apiClient.getApiVersion(),l=N_(this.apiClient.getDefaultHeaders()),u=this.apiClient.getApiKey(),c=`${r}/ws/google.ai.generativelanguage.${o}.GenerativeService.BidiGenerateMusic?key=${u}`;let f=()=>{};const d=new Promise(k=>{f=k}),h=e.callbacks,g=function(){f({})},x=this.apiClient,w={onopen:g,onmessage:k=>{M_(x,h.onmessage,k)},onerror:(t=h==null?void 0:h.onerror)!==null&&t!==void 0?t:function(k){},onclose:(i=h==null?void 0:h.onclose)!==null&&i!==void 0?i:function(k){}},b=this.webSocketFactory.create(c,k_(l),w);b.connect(),await d;const D=pe(this.apiClient,e.model),F=tl(this.apiClient,{model:D}),T=Ir(this.apiClient,{setup:F});return b.send(JSON.stringify(T)),new P_(b,this.apiClient)}}class P_{constructor(e,t){this.conn=e,this.apiClient=t}async setWeightedPrompts(e){if(!e.weightedPrompts||Object.keys(e.weightedPrompts).length===0)throw new Error("Weighted prompts must be set and contain at least one entry.");const t=iy(this.apiClient,e),i=nl(this.apiClient,t);this.conn.send(JSON.stringify({clientContent:i}))}async setMusicGenerationConfig(e){e.musicGenerationConfig||(e.musicGenerationConfig={});const t=ry(this.apiClient,e),i=Ir(this.apiClient,t);this.conn.send(JSON.stringify(i))}sendPlaybackControl(e){const t=Ir(this.apiClient,{playbackControl:e});this.conn.send(JSON.stringify(t))}play(){this.sendPlaybackControl(dn.PLAY)}pause(){this.sendPlaybackControl(dn.PAUSE)}stop(){this.sendPlaybackControl(dn.STOP)}resetContext(){this.sendPlaybackControl(dn.RESET_CONTEXT)}close(){this.conn.close()}}function k_(n){const e={};return n.forEach((t,i)=>{e[i]=t}),e}function N_(n){const e=new Headers;for(const[t,i]of Object.entries(n))e.append(t,i);return e}/**
|
|
179
187
|
* @license
|
|
180
188
|
* Copyright 2025 Google LLC
|
|
181
189
|
* SPDX-License-Identifier: Apache-2.0
|
|
182
|
-
*/const
|
|
190
|
+
*/const D_="FunctionResponse request must have an `id` field from the response of a ToolCall.FunctionalCalls in Google AI.";async function L_(n,e,t){const i=new Eh;let r;if(t.data instanceof Blob?r=JSON.parse(await t.data.text()):r=JSON.parse(t.data),n.isVertexAI()){const o=Dy(n,r);Object.assign(i,o)}else{const o=Ny(n,r);Object.assign(i,o)}e(i)}class F_{constructor(e,t,i){this.apiClient=e,this.auth=t,this.webSocketFactory=i,this.music=new I_(this.apiClient,this.auth,this.webSocketFactory)}async connect(e){var t,i,r,o,l,u;const c=this.apiClient.getWebsocketBaseUrl(),f=this.apiClient.getApiVersion();let d;const h=this.apiClient.getDefaultHeaders();e.config&&e.config.tools&&gl(e.config.tools)&&yl(h);const g=U_(h);if(this.apiClient.isVertexAI())d=`${c}/ws/google.cloud.aiplatform.${f}.LlmBidiService/BidiGenerateContent`,await this.auth.addAuthHeaders(g);else{const C=this.apiClient.getApiKey();let P="BidiGenerateContent",O="key";C!=null&&C.startsWith("auth_tokens/")&&(console.warn("Warning: Ephemeral token support is experimental and may change in future versions."),P="BidiGenerateContentConstrained",O="access_token"),d=`${c}/ws/google.ai.generativelanguage.${f}.GenerativeService.${P}?${O}=${C}`}let x=()=>{};const w=new Promise(C=>{x=C}),b=e.callbacks,D=function(){var C;(C=b==null?void 0:b.onopen)===null||C===void 0||C.call(b),x({})},F=this.apiClient,T={onopen:D,onmessage:C=>{L_(F,b.onmessage,C)},onerror:(t=b==null?void 0:b.onerror)!==null&&t!==void 0?t:function(C){},onclose:(i=b==null?void 0:b.onclose)!==null&&i!==void 0?i:function(C){}},k=this.webSocketFactory.create(d,O_(g),T);k.connect(),await w;let A=pe(this.apiClient,e.model);if(this.apiClient.isVertexAI()&&A.startsWith("publishers/")){const C=this.apiClient.getProject(),P=this.apiClient.getLocation();A=`projects/${C}/locations/${P}/`+A}let S={};this.apiClient.isVertexAI()&&((r=e.config)===null||r===void 0?void 0:r.responseModalities)===void 0&&(e.config===void 0?e.config={responseModalities:[Ti.AUDIO]}:e.config.responseModalities=[Ti.AUDIO]),!((o=e.config)===null||o===void 0)&&o.generationConfig&&console.warn("Setting `LiveConnectConfig.generation_config` is deprecated, please set the fields on `LiveConnectConfig` directly. This will become an error in a future version (not before Q3 2025).");const I=(u=(l=e.config)===null||l===void 0?void 0:l.tools)!==null&&u!==void 0?u:[],R=[];for(const C of I)if(this.isCallableTool(C)){const P=C;R.push(await P.tool())}else R.push(C);R.length>0&&(e.config.tools=R);const M={model:A,config:e.config,callbacks:e.callbacks};return this.apiClient.isVertexAI()?S=Zg(this.apiClient,M):S=Jg(this.apiClient,M),delete S.config,k.send(JSON.stringify(S)),new B_(k,this.apiClient)}isCallableTool(e){return"callTool"in e&&typeof e.callTool=="function"}}const V_={turnComplete:!0};class B_{constructor(e,t){this.conn=e,this.apiClient=t}tLiveClientContent(e,t){if(t.turns!==null&&t.turns!==void 0){let i=[];try{i=Xe(e,t.turns),e.isVertexAI()?i=i.map(r=>gn(e,r)):i=i.map(r=>ki(e,r))}catch{throw new Error(`Failed to parse client content "turns", type: '${typeof t.turns}'`)}return{clientContent:{turns:i,turnComplete:t.turnComplete}}}return{clientContent:{turnComplete:t.turnComplete}}}tLiveClienttToolResponse(e,t){let i=[];if(t.functionResponses==null)throw new Error("functionResponses is required.");if(Array.isArray(t.functionResponses)?i=t.functionResponses:i=[t.functionResponses],i.length===0)throw new Error("functionResponses is required.");for(const o of i){if(typeof o!="object"||o===null||!("name"in o)||!("response"in o))throw new Error(`Could not parse function response, type '${typeof o}'.`);if(!e.isVertexAI()&&!("id"in o))throw new Error(D_)}return{toolResponse:{functionResponses:i}}}sendClientContent(e){e=Object.assign(Object.assign({},V_),e);const t=this.tLiveClientContent(this.apiClient,e);this.conn.send(JSON.stringify(t))}sendRealtimeInput(e){let t={};this.apiClient.isVertexAI()?t={realtimeInput:ny(this.apiClient,e)}:t={realtimeInput:ty(this.apiClient,e)},this.conn.send(JSON.stringify(t))}sendToolResponse(e){if(e.functionResponses==null)throw new Error("Tool response parameters are required.");const t=this.tLiveClienttToolResponse(this.apiClient,e);this.conn.send(JSON.stringify(t))}close(){this.conn.close()}}function O_(n){const e={};return n.forEach((t,i)=>{e[i]=t}),e}function U_(n){const e=new Headers;for(const[t,i]of Object.entries(n))e.append(t,i);return e}/**
|
|
183
191
|
* @license
|
|
184
192
|
* Copyright 2025 Google LLC
|
|
185
193
|
* SPDX-License-Identifier: Apache-2.0
|
|
186
|
-
*/const
|
|
194
|
+
*/const vl=10;function _l(n){var e,t,i;if(!((e=n==null?void 0:n.automaticFunctionCalling)===null||e===void 0)&&e.disable)return!0;let r=!1;for(const l of(t=n==null?void 0:n.tools)!==null&&t!==void 0?t:[])if(Ni(l)){r=!0;break}if(!r)return!0;const o=(i=n==null?void 0:n.automaticFunctionCalling)===null||i===void 0?void 0:i.maximumRemoteCalls;return o&&(o<0||!Number.isInteger(o))||o==0?(console.warn("Invalid maximumRemoteCalls value provided for automatic function calling. Disabled automatic function calling. Please provide a valid integer value greater than 0. maximumRemoteCalls provided:",o),!0):!1}function Ni(n){return"callTool"in n&&typeof n.callTool=="function"}function xl(n){var e;return!(!((e=n==null?void 0:n.automaticFunctionCalling)===null||e===void 0)&&e.ignoreCallHistory)}/**
|
|
187
195
|
* @license
|
|
188
196
|
* Copyright 2025 Google LLC
|
|
189
197
|
* SPDX-License-Identifier: Apache-2.0
|
|
190
|
-
*/class wd extends Se{constructor(e){super(),this.apiClient=e,this.generateContent=async t=>{var n,i,a,l,u;const d=await this.processParamsForMcpUsage(t);if(!ud(t)||Go(t.config))return await this.generateContentInternal(d);if(cd(t))throw new Error("Automatic function calling with CallableTools and Tools is not yet supported.");let c,f;const p=te(this.apiClient,d.contents),m=(a=(i=(n=d.config)===null||n===void 0?void 0:n.automaticFunctionCalling)===null||i===void 0?void 0:i.maximumRemoteCalls)!==null&&a!==void 0?a:Uo;let h=0;for(;h<m&&(c=await this.generateContentInternal(d),!(!c.functionCalls||c.functionCalls.length===0));){const g=c.candidates[0].content,v=[];for(const x of(u=(l=t.config)===null||l===void 0?void 0:l.tools)!==null&&u!==void 0?u:[])if(at(x)){const R=await x.callTool(c.functionCalls);v.push(...R)}h++,f={role:"user",parts:v},d.contents=te(this.apiClient,d.contents),d.contents.push(g),d.contents.push(f),Bo(d.config)&&(p.push(g),p.push(f))}return Bo(d.config)&&(c.automaticFunctionCallingHistory=p),c},this.generateContentStream=async t=>{if(Go(t.config)){const n=await this.processParamsForMcpUsage(t);return await this.generateContentStreamInternal(n)}else return await this.processAfcStream(t)},this.generateImages=async t=>await this.generateImagesInternal(t).then(n=>{var i;let a;const l=[];if(n!=null&&n.generatedImages)for(const d of n.generatedImages)d&&(d!=null&&d.safetyAttributes)&&((i=d==null?void 0:d.safetyAttributes)===null||i===void 0?void 0:i.contentType)==="Positive Prompt"?a=d==null?void 0:d.safetyAttributes:l.push(d);let u;return a?u={generatedImages:l,positivePromptSafetyAttributes:a}:u={generatedImages:l},u}),this.list=async t=>{var n;const l={config:Object.assign(Object.assign({},{queryBase:!0}),t==null?void 0:t.config)};if(this.apiClient.isVertexAI()&&!l.config.queryBase){if(!((n=l.config)===null||n===void 0)&&n.filter)throw new Error("Filtering tuned models list for Vertex AI is not currently supported");l.config.filter="labels.tune-type:*"}return new ot(Ie.PAGED_ITEM_MODELS,u=>this.listInternal(u),await this.listInternal(l),l)},this.editImage=async t=>{const n={model:t.model,prompt:t.prompt,referenceImages:[],config:t.config};return t.referenceImages&&t.referenceImages&&(n.referenceImages=t.referenceImages.map(i=>i.toReferenceImageAPI())),await this.editImageInternal(n)},this.upscaleImage=async t=>{let n={numberOfImages:1,mode:"upscale"};t.config&&(n=Object.assign(Object.assign({},n),t.config));const i={model:t.model,image:t.image,upscaleFactor:t.upscaleFactor,config:n};return await this.upscaleImageInternal(i)}}async processParamsForMcpUsage(e){var t,n,i;const a=(t=e.config)===null||t===void 0?void 0:t.tools;if(!a)return e;const l=await Promise.all(a.map(async d=>at(d)?await d.tool():d)),u={model:e.model,contents:e.contents,config:Object.assign(Object.assign({},e.config),{tools:l})};if(u.config.tools=l,e.config&&e.config.tools&&Vo(e.config.tools)){const d=(i=(n=e.config.httpOptions)===null||n===void 0?void 0:n.headers)!==null&&i!==void 0?i:{};let c=Object.assign({},d);Object.keys(c).length===0&&(c=this.apiClient.getDefaultHeaders()),Fo(c),u.config.httpOptions=Object.assign(Object.assign({},e.config.httpOptions),{headers:c})}return u}async initAfcToolsMap(e){var t,n,i;const a=new Map;for(const l of(n=(t=e.config)===null||t===void 0?void 0:t.tools)!==null&&n!==void 0?n:[])if(at(l)){const u=l,d=await u.tool();for(const c of(i=d.functionDeclarations)!==null&&i!==void 0?i:[]){if(!c.name)throw new Error("Function declaration name is required.");if(a.has(c.name))throw new Error(`Duplicate tool declaration name: ${c.name}`);a.set(c.name,u)}}return a}async processAfcStream(e){var t,n,i;const a=(i=(n=(t=e.config)===null||t===void 0?void 0:t.automaticFunctionCalling)===null||n===void 0?void 0:n.maximumRemoteCalls)!==null&&i!==void 0?i:Uo;let l=!1,u=0;const d=await this.initAfcToolsMap(e);return(function(c,f,p){var m,h;return Re(this,arguments,function*(){for(var g,v,x,M;u<a;){l&&(u++,l=!1);const E=yield $(c.processParamsForMcpUsage(p)),A=yield $(c.generateContentStreamInternal(E)),P=[],O=[];try{for(var R=!0,k=(v=void 0,qe(A)),V;V=yield $(k.next()),g=V.done,!g;R=!0){M=V.value,R=!1;const b=M;if(yield yield $(b),b.candidates&&(!((m=b.candidates[0])===null||m===void 0)&&m.content)){O.push(b.candidates[0].content);for(const B of(h=b.candidates[0].content.parts)!==null&&h!==void 0?h:[])if(u<a&&B.functionCall){if(!B.functionCall.name)throw new Error("Function call name was not returned by the model.");if(f.has(B.functionCall.name)){const Q=yield $(f.get(B.functionCall.name).callTool([B.functionCall]));P.push(...Q)}else throw new Error(`Automatic function calling was requested, but not all the tools the model used implement the CallableTool interface. Available tools: ${f.keys()}, mising tool: ${B.functionCall.name}`)}}}}catch(b){v={error:b}}finally{try{!R&&!g&&(x=k.return)&&(yield $(x.call(k)))}finally{if(v)throw v.error}}if(P.length>0){l=!0;const b=new Ue;b.candidates=[{content:{role:"user",parts:P}}],yield yield $(b);const B=[];B.push(...O),B.push({role:"user",parts:P});const Q=te(c.apiClient,p.contents).concat(B);p.contents=Q}else break}})})(this,d,e)}async generateContentInternal(e){var t,n,i,a;let l,u="",d={};if(this.apiClient.isVertexAI()){const c=Io(this.apiClient,e);return u=I("{model}:generateContent",c._url),d=c._query,delete c.config,delete c._url,delete c._query,l=this.apiClient.request({path:u,queryParams:d,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(n=e.config)===null||n===void 0?void 0:n.abortSignal}).then(f=>f.json()),l.then(f=>{const p=No(this.apiClient,f),m=new Ue;return Object.assign(m,p),m})}else{const c=Ao(this.apiClient,e);return u=I("{model}:generateContent",c._url),d=c._query,delete c.config,delete c._url,delete c._query,l=this.apiClient.request({path:u,queryParams:d,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(a=e.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>{const p=Ro(this.apiClient,f),m=new Ue;return Object.assign(m,p),m})}}async generateContentStreamInternal(e){var t,n,i,a;let l,u="",d={};if(this.apiClient.isVertexAI()){const c=Io(this.apiClient,e);u=I("{model}:streamGenerateContent?alt=sse",c._url),d=c._query,delete c.config,delete c._url,delete c._query;const f=this.apiClient;return l=f.requestStream({path:u,queryParams:d,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(n=e.config)===null||n===void 0?void 0:n.abortSignal}),l.then(function(p){return Re(this,arguments,function*(){var m,h,g,v;try{for(var x=!0,M=qe(p),R;R=yield $(M.next()),m=R.done,!m;x=!0){v=R.value,x=!1;const V=No(f,yield $(v.json())),E=new Ue;Object.assign(E,V),yield yield $(E)}}catch(k){h={error:k}}finally{try{!x&&!m&&(g=M.return)&&(yield $(g.call(M)))}finally{if(h)throw h.error}}})})}else{const c=Ao(this.apiClient,e);u=I("{model}:streamGenerateContent?alt=sse",c._url),d=c._query,delete c.config,delete c._url,delete c._query;const f=this.apiClient;return l=f.requestStream({path:u,queryParams:d,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(a=e.config)===null||a===void 0?void 0:a.abortSignal}),l.then(function(p){return Re(this,arguments,function*(){var m,h,g,v;try{for(var x=!0,M=qe(p),R;R=yield $(M.next()),m=R.done,!m;x=!0){v=R.value,x=!1;const V=Ro(f,yield $(v.json())),E=new Ue;Object.assign(E,V),yield yield $(E)}}catch(k){h={error:k}}finally{try{!x&&!m&&(g=M.return)&&(yield $(g.call(M)))}finally{if(h)throw h.error}}})})}}async embedContent(e){var t,n,i,a;let l,u="",d={};if(this.apiClient.isVertexAI()){const c=Fu(this.apiClient,e);return u=I("{model}:predict",c._url),d=c._query,delete c.config,delete c._url,delete c._query,l=this.apiClient.request({path:u,queryParams:d,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(n=e.config)===null||n===void 0?void 0:n.abortSignal}).then(f=>f.json()),l.then(f=>{const p=Gc(this.apiClient,f),m=new On;return Object.assign(m,p),m})}else{const c=Xl(this.apiClient,e);return u=I("{model}:batchEmbedContents",c._url),d=c._query,delete c.config,delete c._url,delete c._query,l=this.apiClient.request({path:u,queryParams:d,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(a=e.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>{const p=yc(this.apiClient,f),m=new On;return Object.assign(m,p),m})}}async generateImagesInternal(e){var t,n,i,a;let l,u="",d={};if(this.apiClient.isVertexAI()){const c=Gu(this.apiClient,e);return u=I("{model}:predict",c._url),d=c._query,delete c.config,delete c._url,delete c._query,l=this.apiClient.request({path:u,queryParams:d,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(n=e.config)===null||n===void 0?void 0:n.abortSignal}).then(f=>f.json()),l.then(f=>{const p=qc(this.apiClient,f),m=new Hn;return Object.assign(m,p),m})}else{const c=jl(this.apiClient,e);return u=I("{model}:predict",c._url),d=c._query,delete c.config,delete c._url,delete c._query,l=this.apiClient.request({path:u,queryParams:d,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(a=e.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>{const p=Cc(this.apiClient,f),m=new Hn;return Object.assign(m,p),m})}}async editImageInternal(e){var t,n;let i,a="",l={};if(this.apiClient.isVertexAI()){const u=zu(this.apiClient,e);return a=I("{model}:predict",u._url),l=u._query,delete u.config,delete u._url,delete u._query,i=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(n=e.config)===null||n===void 0?void 0:n.abortSignal}).then(d=>d.json()),i.then(d=>{const c=$c(this.apiClient,d),f=new ji;return Object.assign(f,c),f})}else throw new Error("This method is only supported by the Vertex AI.")}async upscaleImageInternal(e){var t,n;let i,a="",l={};if(this.apiClient.isVertexAI()){const u=Yu(this.apiClient,e);return a=I("{model}:predict",u._url),l=u._query,delete u.config,delete u._url,delete u._query,i=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(n=e.config)===null||n===void 0?void 0:n.abortSignal}).then(d=>d.json()),i.then(d=>{const c=Oc(this.apiClient,d),f=new er;return Object.assign(f,c),f})}else throw new Error("This method is only supported by the Vertex AI.")}async get(e){var t,n,i,a;let l,u="",d={};if(this.apiClient.isVertexAI()){const c=Zu(this.apiClient,e);return u=I("{name}",c._url),d=c._query,delete c.config,delete c._url,delete c._query,l=this.apiClient.request({path:u,queryParams:d,body:JSON.stringify(c),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(n=e.config)===null||n===void 0?void 0:n.abortSignal}).then(f=>f.json()),l.then(f=>Mt(this.apiClient,f))}else{const c=eu(this.apiClient,e);return u=I("{name}",c._url),d=c._query,delete c.config,delete c._url,delete c._query,l=this.apiClient.request({path:u,queryParams:d,body:JSON.stringify(c),httpMethod:"GET",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(a=e.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>St(this.apiClient,f))}}async listInternal(e){var t,n,i,a;let l,u="",d={};if(this.apiClient.isVertexAI()){const c=Xu(this.apiClient,e);return u=I("{models_url}",c._url),d=c._query,delete c.config,delete c._url,delete c._query,l=this.apiClient.request({path:u,queryParams:d,body:JSON.stringify(c),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(n=e.config)===null||n===void 0?void 0:n.abortSignal}).then(f=>f.json()),l.then(f=>{const p=Wc(this.apiClient,f),m=new Jn;return Object.assign(m,p),m})}else{const c=nu(this.apiClient,e);return u=I("{models_url}",c._url),d=c._query,delete c.config,delete c._url,delete c._query,l=this.apiClient.request({path:u,queryParams:d,body:JSON.stringify(c),httpMethod:"GET",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(a=e.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>{const p=xc(this.apiClient,f),m=new Jn;return Object.assign(m,p),m})}}async update(e){var t,n,i,a;let l,u="",d={};if(this.apiClient.isVertexAI()){const c=ju(this.apiClient,e);return u=I("{model}",c._url),d=c._query,delete c.config,delete c._url,delete c._query,l=this.apiClient.request({path:u,queryParams:d,body:JSON.stringify(c),httpMethod:"PATCH",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(n=e.config)===null||n===void 0?void 0:n.abortSignal}).then(f=>f.json()),l.then(f=>Mt(this.apiClient,f))}else{const c=iu(this.apiClient,e);return u=I("{name}",c._url),d=c._query,delete c.config,delete c._url,delete c._query,l=this.apiClient.request({path:u,queryParams:d,body:JSON.stringify(c),httpMethod:"PATCH",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(a=e.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>St(this.apiClient,f))}}async delete(e){var t,n,i,a;let l,u="",d={};if(this.apiClient.isVertexAI()){const c=ec(this.apiClient,e);return u=I("{name}",c._url),d=c._query,delete c.config,delete c._url,delete c._query,l=this.apiClient.request({path:u,queryParams:d,body:JSON.stringify(c),httpMethod:"DELETE",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(n=e.config)===null||n===void 0?void 0:n.abortSignal}).then(f=>f.json()),l.then(()=>{const f=Yc(),p=new zn;return Object.assign(p,f),p})}else{const c=ru(this.apiClient,e);return u=I("{name}",c._url),d=c._query,delete c.config,delete c._url,delete c._query,l=this.apiClient.request({path:u,queryParams:d,body:JSON.stringify(c),httpMethod:"DELETE",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(a=e.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(()=>{const f=Ec(),p=new zn;return Object.assign(p,f),p})}}async countTokens(e){var t,n,i,a;let l,u="",d={};if(this.apiClient.isVertexAI()){const c=nc(this.apiClient,e);return u=I("{model}:countTokens",c._url),d=c._query,delete c.config,delete c._url,delete c._query,l=this.apiClient.request({path:u,queryParams:d,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(n=e.config)===null||n===void 0?void 0:n.abortSignal}).then(f=>f.json()),l.then(f=>{const p=Zc(this.apiClient,f),m=new Wn;return Object.assign(m,p),m})}else{const c=au(this.apiClient,e);return u=I("{model}:countTokens",c._url),d=c._query,delete c.config,delete c._url,delete c._query,l=this.apiClient.request({path:u,queryParams:d,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(a=e.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>{const p=wc(this.apiClient,f),m=new Wn;return Object.assign(m,p),m})}}async computeTokens(e){var t,n;let i,a="",l={};if(this.apiClient.isVertexAI()){const u=oc(this.apiClient,e);return a=I("{model}:computeTokens",u._url),l=u._query,delete u.config,delete u._url,delete u._query,i=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(n=e.config)===null||n===void 0?void 0:n.abortSignal}).then(d=>d.json()),i.then(d=>{const c=Kc(this.apiClient,d),f=new tr;return Object.assign(f,c),f})}else throw new Error("This method is only supported by the Vertex AI.")}async generateVideos(e){var t,n,i,a;let l,u="",d={};if(this.apiClient.isVertexAI()){const c=rc(this.apiClient,e);return u=I("{model}:predictLongRunning",c._url),d=c._query,delete c.config,delete c._url,delete c._query,l=this.apiClient.request({path:u,queryParams:d,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(n=e.config)===null||n===void 0?void 0:n.abortSignal}).then(f=>f.json()),l.then(f=>ed(this.apiClient,f))}else{const c=cu(this.apiClient,e);return u=I("{model}:predictLongRunning",c._url),d=c._query,delete c.config,delete c._url,delete c._query,l=this.apiClient.request({path:u,queryParams:d,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(a=e.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>Ic(this.apiClient,f))}}}/**
|
|
198
|
+
*/class $_ extends fn{constructor(e){super(),this.apiClient=e,this.generateContent=async t=>{var i,r,o,l,u;const c=await this.processParamsForMcpUsage(t);if(!A_(t)||_l(t.config))return await this.generateContentInternal(c);if(b_(t))throw new Error("Automatic function calling with CallableTools and Tools is not yet supported.");let f,d;const h=Xe(this.apiClient,c.contents),g=(o=(r=(i=c.config)===null||i===void 0?void 0:i.automaticFunctionCalling)===null||r===void 0?void 0:r.maximumRemoteCalls)!==null&&o!==void 0?o:vl;let x=0;for(;x<g&&(f=await this.generateContentInternal(c),!(!f.functionCalls||f.functionCalls.length===0));){const w=f.candidates[0].content,b=[];for(const D of(u=(l=t.config)===null||l===void 0?void 0:l.tools)!==null&&u!==void 0?u:[])if(Ni(D)){const T=await D.callTool(f.functionCalls);b.push(...T)}x++,d={role:"user",parts:b},c.contents=Xe(this.apiClient,c.contents),c.contents.push(w),c.contents.push(d),xl(c.config)&&(h.push(w),h.push(d))}return xl(c.config)&&(f.automaticFunctionCallingHistory=h),f},this.generateContentStream=async t=>{if(_l(t.config)){const i=await this.processParamsForMcpUsage(t);return await this.generateContentStreamInternal(i)}else return await this.processAfcStream(t)},this.generateImages=async t=>await this.generateImagesInternal(t).then(i=>{var r;let o;const l=[];if(i!=null&&i.generatedImages)for(const c of i.generatedImages)c&&(c!=null&&c.safetyAttributes)&&((r=c==null?void 0:c.safetyAttributes)===null||r===void 0?void 0:r.contentType)==="Positive Prompt"?o=c==null?void 0:c.safetyAttributes:l.push(c);let u;return o?u={generatedImages:l,positivePromptSafetyAttributes:o}:u={generatedImages:l},u}),this.list=async t=>{var i;const l={config:Object.assign(Object.assign({},{queryBase:!0}),t==null?void 0:t.config)};if(this.apiClient.isVertexAI()&&!l.config.queryBase){if(!((i=l.config)===null||i===void 0)&&i.filter)throw new Error("Filtering tuned models list for Vertex AI is not currently supported");l.config.filter="labels.tune-type:*"}return new Mi(hn.PAGED_ITEM_MODELS,u=>this.listInternal(u),await this.listInternal(l),l)},this.editImage=async t=>{const i={model:t.model,prompt:t.prompt,referenceImages:[],config:t.config};return t.referenceImages&&t.referenceImages&&(i.referenceImages=t.referenceImages.map(r=>r.toReferenceImageAPI())),await this.editImageInternal(i)},this.upscaleImage=async t=>{let i={numberOfImages:1,mode:"upscale"};t.config&&(i=Object.assign(Object.assign({},i),t.config));const r={model:t.model,image:t.image,upscaleFactor:t.upscaleFactor,config:i};return await this.upscaleImageInternal(r)}}async processParamsForMcpUsage(e){var t,i,r;const o=(t=e.config)===null||t===void 0?void 0:t.tools;if(!o)return e;const l=await Promise.all(o.map(async c=>Ni(c)?await c.tool():c)),u={model:e.model,contents:e.contents,config:Object.assign(Object.assign({},e.config),{tools:l})};if(u.config.tools=l,e.config&&e.config.tools&&gl(e.config.tools)){const c=(r=(i=e.config.httpOptions)===null||i===void 0?void 0:i.headers)!==null&&r!==void 0?r:{};let f=Object.assign({},c);Object.keys(f).length===0&&(f=this.apiClient.getDefaultHeaders()),yl(f),u.config.httpOptions=Object.assign(Object.assign({},e.config.httpOptions),{headers:f})}return u}async initAfcToolsMap(e){var t,i,r;const o=new Map;for(const l of(i=(t=e.config)===null||t===void 0?void 0:t.tools)!==null&&i!==void 0?i:[])if(Ni(l)){const u=l,c=await u.tool();for(const f of(r=c.functionDeclarations)!==null&&r!==void 0?r:[]){if(!f.name)throw new Error("Function declaration name is required.");if(o.has(f.name))throw new Error(`Duplicate tool declaration name: ${f.name}`);o.set(f.name,u)}}return o}async processAfcStream(e){var t,i,r;const o=(r=(i=(t=e.config)===null||t===void 0?void 0:t.automaticFunctionCalling)===null||i===void 0?void 0:i.maximumRemoteCalls)!==null&&r!==void 0?r:vl;let l=!1,u=0;const c=await this.initAfcToolsMap(e);return(function(f,d,h){var g,x;return mn(this,arguments,function*(){for(var w,b,D,F;u<o;){l&&(u++,l=!1);const S=yield ge(f.processParamsForMcpUsage(h)),I=yield ge(f.generateContentStreamInternal(S)),R=[],M=[];try{for(var T=!0,k=(b=void 0,Un(I)),A;A=yield ge(k.next()),w=A.done,!w;T=!0){F=A.value,T=!1;const C=F;if(yield yield ge(C),C.candidates&&(!((g=C.candidates[0])===null||g===void 0)&&g.content)){M.push(C.candidates[0].content);for(const P of(x=C.candidates[0].content.parts)!==null&&x!==void 0?x:[])if(u<o&&P.functionCall){if(!P.functionCall.name)throw new Error("Function call name was not returned by the model.");if(d.has(P.functionCall.name)){const O=yield ge(d.get(P.functionCall.name).callTool([P.functionCall]));R.push(...O)}else throw new Error(`Automatic function calling was requested, but not all the tools the model used implement the CallableTool interface. Available tools: ${d.keys()}, mising tool: ${P.functionCall.name}`)}}}}catch(C){b={error:C}}finally{try{!T&&!w&&(D=k.return)&&(yield ge(D.call(k)))}finally{if(b)throw b.error}}if(R.length>0){l=!0;const C=new Vn;C.candidates=[{content:{role:"user",parts:R}}],yield yield ge(C);const P=[];P.push(...M),P.push({role:"user",parts:R});const O=Xe(f.apiClient,h.contents).concat(P);h.contents=O}else break}})})(this,c,e)}async generateContentInternal(e){var t,i,r,o;let l,u="",c={};if(this.apiClient.isVertexAI()){const f=ll(this.apiClient,e);return u=X("{model}:generateContent",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),l.then(d=>{const h=fl(this.apiClient,d),g=new Vn;return Object.assign(g,h),g})}else{const f=sl(this.apiClient,e);return u=X("{model}:generateContent",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(d=>d.json()),l.then(d=>{const h=ul(this.apiClient,d),g=new Vn;return Object.assign(g,h),g})}}async generateContentStreamInternal(e){var t,i,r,o;let l,u="",c={};if(this.apiClient.isVertexAI()){const f=ll(this.apiClient,e);u=X("{model}:streamGenerateContent?alt=sse",f._url),c=f._query,delete f.config,delete f._url,delete f._query;const d=this.apiClient;return l=d.requestStream({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}),l.then(function(h){return mn(this,arguments,function*(){var g,x,w,b;try{for(var D=!0,F=Un(h),T;T=yield ge(F.next()),g=T.done,!g;D=!0){b=T.value,D=!1;const A=fl(d,yield ge(b.json())),S=new Vn;Object.assign(S,A),yield yield ge(S)}}catch(k){x={error:k}}finally{try{!D&&!g&&(w=F.return)&&(yield ge(w.call(F)))}finally{if(x)throw x.error}}})})}else{const f=sl(this.apiClient,e);u=X("{model}:streamGenerateContent?alt=sse",f._url),c=f._query,delete f.config,delete f._url,delete f._query;const d=this.apiClient;return l=d.requestStream({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}),l.then(function(h){return mn(this,arguments,function*(){var g,x,w,b;try{for(var D=!0,F=Un(h),T;T=yield ge(F.next()),g=T.done,!g;D=!0){b=T.value,D=!1;const A=ul(d,yield ge(b.json())),S=new Vn;Object.assign(S,A),yield yield ge(S)}}catch(k){x={error:k}}finally{try{!D&&!g&&(w=F.return)&&(yield ge(w.call(F)))}finally{if(x)throw x.error}}})})}}async embedContent(e){var t,i,r,o;let l,u="",c={};if(this.apiClient.isVertexAI()){const f=e0(this.apiClient,e);return u=X("{model}:predict",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),l.then(d=>{const h=n_(this.apiClient,d),g=new wa;return Object.assign(g,h),g})}else{const f=hv(this.apiClient,e);return u=X("{model}:batchEmbedContents",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(d=>d.json()),l.then(d=>{const h=D0(this.apiClient,d),g=new wa;return Object.assign(g,h),g})}}async generateImagesInternal(e){var t,i,r,o;let l,u="",c={};if(this.apiClient.isVertexAI()){const f=n0(this.apiClient,e);return u=X("{model}:predict",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),l.then(d=>{const h=r_(this.apiClient,d),g=new Sa;return Object.assign(g,h),g})}else{const f=gv(this.apiClient,e);return u=X("{model}:predict",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(d=>d.json()),l.then(d=>{const h=V0(this.apiClient,d),g=new Sa;return Object.assign(g,h),g})}}async editImageInternal(e){var t,i;let r,o="",l={};if(this.apiClient.isVertexAI()){const u=u0(this.apiClient,e);return o=X("{model}:predict",u._url),l=u._query,delete u.config,delete u._url,delete u._query,r=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(c=>c.json()),r.then(c=>{const f=o_(this.apiClient,c),d=new gh;return Object.assign(d,f),d})}else throw new Error("This method is only supported by the Vertex AI.")}async upscaleImageInternal(e){var t,i;let r,o="",l={};if(this.apiClient.isVertexAI()){const u=f0(this.apiClient,e);return o=X("{model}:predict",u._url),l=u._query,delete u.config,delete u._url,delete u._query,r=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(c=>c.json()),r.then(c=>{const f=s_(this.apiClient,c),d=new yh;return Object.assign(d,f),d})}else throw new Error("This method is only supported by the Vertex AI.")}async get(e){var t,i,r,o;let l,u="",c={};if(this.apiClient.isVertexAI()){const f=d0(this.apiClient,e);return u=X("{name}",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),l.then(d=>Dr(this.apiClient,d))}else{const f=yv(this.apiClient,e);return u=X("{name}",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(d=>d.json()),l.then(d=>kr(this.apiClient,d))}}async listInternal(e){var t,i,r,o;let l,u="",c={};if(this.apiClient.isVertexAI()){const f=h0(this.apiClient,e);return u=X("{models_url}",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),l.then(d=>{const h=c_(this.apiClient,d),g=new Aa;return Object.assign(g,h),g})}else{const f=_v(this.apiClient,e);return u=X("{models_url}",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(d=>d.json()),l.then(d=>{const h=O0(this.apiClient,d),g=new Aa;return Object.assign(g,h),g})}}async update(e){var t,i,r,o;let l,u="",c={};if(this.apiClient.isVertexAI()){const f=g0(this.apiClient,e);return u=X("{model}",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"PATCH",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),l.then(d=>Dr(this.apiClient,d))}else{const f=Cv(this.apiClient,e);return u=X("{name}",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"PATCH",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(d=>d.json()),l.then(d=>kr(this.apiClient,d))}}async delete(e){var t,i,r,o;let l,u="",c={};if(this.apiClient.isVertexAI()){const f=y0(this.apiClient,e);return u=X("{name}",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"DELETE",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),l.then(()=>{const d=f_(),h=new ba;return Object.assign(h,d),h})}else{const f=Ev(this.apiClient,e);return u=X("{name}",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"DELETE",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(d=>d.json()),l.then(()=>{const d=U0(),h=new ba;return Object.assign(h,d),h})}}async countTokens(e){var t,i,r,o;let l,u="",c={};if(this.apiClient.isVertexAI()){const f=_0(this.apiClient,e);return u=X("{model}:countTokens",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),l.then(d=>{const h=d_(this.apiClient,d),g=new Ra;return Object.assign(g,h),g})}else{const f=wv(this.apiClient,e);return u=X("{model}:countTokens",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(d=>d.json()),l.then(d=>{const h=$0(this.apiClient,d),g=new Ra;return Object.assign(g,h),g})}}async computeTokens(e){var t,i;let r,o="",l={};if(this.apiClient.isVertexAI()){const u=x0(this.apiClient,e);return o=X("{model}:computeTokens",u._url),l=u._query,delete u.config,delete u._url,delete u._query,r=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(c=>c.json()),r.then(c=>{const f=p_(this.apiClient,c),d=new vh;return Object.assign(d,f),d})}else throw new Error("This method is only supported by the Vertex AI.")}async generateVideos(e){var t,i,r,o;let l,u="",c={};if(this.apiClient.isVertexAI()){const f=E0(this.apiClient,e);return u=X("{model}:predictLongRunning",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),l.then(d=>y_(this.apiClient,d))}else{const f=bv(this.apiClient,e);return u=X("{model}:predictLongRunning",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(d=>d.json()),l.then(d=>W0(this.apiClient,d))}}}/**
|
|
191
199
|
* @license
|
|
192
200
|
* Copyright 2025 Google LLC
|
|
193
201
|
* SPDX-License-Identifier: Apache-2.0
|
|
194
|
-
*/function
|
|
202
|
+
*/function G_(n,e){const t={},i=s(e,["operationName"]);i!=null&&a(t,["_url","operationName"],i);const r=s(e,["config"]);return r!=null&&a(t,["config"],r),t}function q_(n,e){const t={},i=s(e,["operationName"]);i!=null&&a(t,["_url","operationName"],i);const r=s(e,["config"]);return r!=null&&a(t,["config"],r),t}function H_(n,e){const t={},i=s(e,["operationName"]);i!=null&&a(t,["operationName"],i);const r=s(e,["resourceName"]);r!=null&&a(t,["_url","resourceName"],r);const o=s(e,["config"]);return o!=null&&a(t,["config"],o),t}function W_(n,e){const t={},i=s(e,["video","uri"]);i!=null&&a(t,["uri"],i);const r=s(e,["video","encodedVideo"]);r!=null&&a(t,["videoBytes"],Mt(n,r));const o=s(e,["encoding"]);return o!=null&&a(t,["mimeType"],o),t}function z_(n,e){const t={},i=s(e,["_self"]);return i!=null&&a(t,["video"],W_(n,i)),t}function Y_(n,e){const t={},i=s(e,["generatedSamples"]);if(i!=null){let l=i;Array.isArray(l)&&(l=l.map(u=>z_(n,u))),a(t,["generatedVideos"],l)}const r=s(e,["raiMediaFilteredCount"]);r!=null&&a(t,["raiMediaFilteredCount"],r);const o=s(e,["raiMediaFilteredReasons"]);return o!=null&&a(t,["raiMediaFilteredReasons"],o),t}function K_(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["name"],i);const r=s(e,["metadata"]);r!=null&&a(t,["metadata"],r);const o=s(e,["done"]);o!=null&&a(t,["done"],o);const l=s(e,["error"]);l!=null&&a(t,["error"],l);const u=s(e,["response","generateVideoResponse"]);return u!=null&&a(t,["response"],Y_(n,u)),t}function J_(n,e){const t={},i=s(e,["gcsUri"]);i!=null&&a(t,["uri"],i);const r=s(e,["bytesBase64Encoded"]);r!=null&&a(t,["videoBytes"],Mt(n,r));const o=s(e,["mimeType"]);return o!=null&&a(t,["mimeType"],o),t}function Z_(n,e){const t={},i=s(e,["_self"]);return i!=null&&a(t,["video"],J_(n,i)),t}function X_(n,e){const t={},i=s(e,["videos"]);if(i!=null){let l=i;Array.isArray(l)&&(l=l.map(u=>Z_(n,u))),a(t,["generatedVideos"],l)}const r=s(e,["raiMediaFilteredCount"]);r!=null&&a(t,["raiMediaFilteredCount"],r);const o=s(e,["raiMediaFilteredReasons"]);return o!=null&&a(t,["raiMediaFilteredReasons"],o),t}function Cl(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["name"],i);const r=s(e,["metadata"]);r!=null&&a(t,["metadata"],r);const o=s(e,["done"]);o!=null&&a(t,["done"],o);const l=s(e,["error"]);l!=null&&a(t,["error"],l);const u=s(e,["response"]);return u!=null&&a(t,["response"],X_(n,u)),t}/**
|
|
195
203
|
* @license
|
|
196
204
|
* Copyright 2025 Google LLC
|
|
197
205
|
* SPDX-License-Identifier: Apache-2.0
|
|
198
|
-
*/class
|
|
206
|
+
*/class Q_ extends fn{constructor(e){super(),this.apiClient=e}async getVideosOperation(e){const t=e.operation,i=e.config;if(t.name===void 0||t.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){const r=t.name.split("/operations/")[0];let o;return i&&"httpOptions"in i&&(o=i.httpOptions),this.fetchPredictVideosOperationInternal({operationName:t.name,resourceName:r,config:{httpOptions:o}})}else return this.getVideosOperationInternal({operationName:t.name,config:i})}async getVideosOperationInternal(e){var t,i,r,o;let l,u="",c={};if(this.apiClient.isVertexAI()){const f=q_(this.apiClient,e);return u=X("{operationName}",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),l.then(d=>Cl(this.apiClient,d))}else{const f=G_(this.apiClient,e);return u=X("{operationName}",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(d=>d.json()),l.then(d=>K_(this.apiClient,d))}}async fetchPredictVideosOperationInternal(e){var t,i;let r,o="",l={};if(this.apiClient.isVertexAI()){const u=H_(this.apiClient,e);return o=X("{resourceName}:fetchPredictOperation",u._url),l=u._query,delete u.config,delete u._url,delete u._query,r=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(c=>c.json()),r.then(c=>Cl(this.apiClient,c))}else throw new Error("This method is only supported by the Vertex AI.")}}/**
|
|
199
207
|
* @license
|
|
200
208
|
* Copyright 2025 Google LLC
|
|
201
209
|
* SPDX-License-Identifier: Apache-2.0
|
|
202
|
-
*/function
|
|
210
|
+
*/function j_(n,e){const t={},i=s(e,["voiceName"]);return i!=null&&a(t,["voiceName"],i),t}function El(n,e){const t={},i=s(e,["prebuiltVoiceConfig"]);return i!=null&&a(t,["prebuiltVoiceConfig"],j_(n,i)),t}function ex(n,e){const t={},i=s(e,["speaker"]);i!=null&&a(t,["speaker"],i);const r=s(e,["voiceConfig"]);return r!=null&&a(t,["voiceConfig"],El(n,r)),t}function tx(n,e){const t={},i=s(e,["speakerVoiceConfigs"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(o=>ex(n,o))),a(t,["speakerVoiceConfigs"],r)}return t}function nx(n,e){const t={},i=s(e,["voiceConfig"]);i!=null&&a(t,["voiceConfig"],El(n,i));const r=s(e,["multiSpeakerVoiceConfig"]);r!=null&&a(t,["multiSpeakerVoiceConfig"],tx(n,r));const o=s(e,["languageCode"]);return o!=null&&a(t,["languageCode"],o),t}function ix(n,e){const t={},i=s(e,["fps"]);i!=null&&a(t,["fps"],i);const r=s(e,["endOffset"]);r!=null&&a(t,["endOffset"],r);const o=s(e,["startOffset"]);return o!=null&&a(t,["startOffset"],o),t}function rx(n,e){const t={};if(s(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const i=s(e,["data"]);i!=null&&a(t,["data"],i);const r=s(e,["mimeType"]);return r!=null&&a(t,["mimeType"],r),t}function ox(n,e){const t={};if(s(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const i=s(e,["fileUri"]);i!=null&&a(t,["fileUri"],i);const r=s(e,["mimeType"]);return r!=null&&a(t,["mimeType"],r),t}function sx(n,e){const t={},i=s(e,["videoMetadata"]);i!=null&&a(t,["videoMetadata"],ix(n,i));const r=s(e,["thought"]);r!=null&&a(t,["thought"],r);const o=s(e,["inlineData"]);o!=null&&a(t,["inlineData"],rx(n,o));const l=s(e,["fileData"]);l!=null&&a(t,["fileData"],ox(n,l));const u=s(e,["thoughtSignature"]);u!=null&&a(t,["thoughtSignature"],u);const c=s(e,["codeExecutionResult"]);c!=null&&a(t,["codeExecutionResult"],c);const f=s(e,["executableCode"]);f!=null&&a(t,["executableCode"],f);const d=s(e,["functionCall"]);d!=null&&a(t,["functionCall"],d);const h=s(e,["functionResponse"]);h!=null&&a(t,["functionResponse"],h);const g=s(e,["text"]);return g!=null&&a(t,["text"],g),t}function ax(n,e){const t={},i=s(e,["parts"]);if(i!=null){let o=i;Array.isArray(o)&&(o=o.map(l=>sx(n,l))),a(t,["parts"],o)}const r=s(e,["role"]);return r!=null&&a(t,["role"],r),t}function lx(n,e){const t={},i=s(e,["behavior"]);i!=null&&a(t,["behavior"],i);const r=s(e,["description"]);r!=null&&a(t,["description"],r);const o=s(e,["name"]);o!=null&&a(t,["name"],o);const l=s(e,["parameters"]);l!=null&&a(t,["parameters"],l);const u=s(e,["response"]);return u!=null&&a(t,["response"],u),t}function ux(n,e){const t={},i=s(e,["startTime"]);i!=null&&a(t,["startTime"],i);const r=s(e,["endTime"]);return r!=null&&a(t,["endTime"],r),t}function cx(n,e){const t={},i=s(e,["timeRangeFilter"]);return i!=null&&a(t,["timeRangeFilter"],ux(n,i)),t}function fx(n,e){const t={},i=s(e,["mode"]);i!=null&&a(t,["mode"],i);const r=s(e,["dynamicThreshold"]);return r!=null&&a(t,["dynamicThreshold"],r),t}function dx(n,e){const t={},i=s(e,["dynamicRetrievalConfig"]);return i!=null&&a(t,["dynamicRetrievalConfig"],fx(n,i)),t}function px(){return{}}function hx(n,e){const t={},i=s(e,["functionDeclarations"]);if(i!=null){let c=i;Array.isArray(c)&&(c=c.map(f=>lx(n,f))),a(t,["functionDeclarations"],c)}if(s(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const r=s(e,["googleSearch"]);r!=null&&a(t,["googleSearch"],cx(n,r));const o=s(e,["googleSearchRetrieval"]);if(o!=null&&a(t,["googleSearchRetrieval"],dx(n,o)),s(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");if(s(e,["googleMaps"])!==void 0)throw new Error("googleMaps parameter is not supported in Gemini API.");s(e,["urlContext"])!=null&&a(t,["urlContext"],px());const u=s(e,["codeExecution"]);return u!=null&&a(t,["codeExecution"],u),t}function mx(n,e){const t={},i=s(e,["handle"]);if(i!=null&&a(t,["handle"],i),s(e,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return t}function Tl(){return{}}function gx(n,e){const t={},i=s(e,["disabled"]);i!=null&&a(t,["disabled"],i);const r=s(e,["startOfSpeechSensitivity"]);r!=null&&a(t,["startOfSpeechSensitivity"],r);const o=s(e,["endOfSpeechSensitivity"]);o!=null&&a(t,["endOfSpeechSensitivity"],o);const l=s(e,["prefixPaddingMs"]);l!=null&&a(t,["prefixPaddingMs"],l);const u=s(e,["silenceDurationMs"]);return u!=null&&a(t,["silenceDurationMs"],u),t}function yx(n,e){const t={},i=s(e,["automaticActivityDetection"]);i!=null&&a(t,["automaticActivityDetection"],gx(n,i));const r=s(e,["activityHandling"]);r!=null&&a(t,["activityHandling"],r);const o=s(e,["turnCoverage"]);return o!=null&&a(t,["turnCoverage"],o),t}function vx(n,e){const t={},i=s(e,["targetTokens"]);return i!=null&&a(t,["targetTokens"],i),t}function _x(n,e){const t={},i=s(e,["triggerTokens"]);i!=null&&a(t,["triggerTokens"],i);const r=s(e,["slidingWindow"]);return r!=null&&a(t,["slidingWindow"],vx(n,r)),t}function xx(n,e){const t={},i=s(e,["proactiveAudio"]);return i!=null&&a(t,["proactiveAudio"],i),t}function Cx(n,e,t){const i={},r=s(e,["generationConfig"]);t!==void 0&&r!=null&&a(t,["setup","generationConfig"],r);const o=s(e,["responseModalities"]);t!==void 0&&o!=null&&a(t,["setup","generationConfig","responseModalities"],o);const l=s(e,["temperature"]);t!==void 0&&l!=null&&a(t,["setup","generationConfig","temperature"],l);const u=s(e,["topP"]);t!==void 0&&u!=null&&a(t,["setup","generationConfig","topP"],u);const c=s(e,["topK"]);t!==void 0&&c!=null&&a(t,["setup","generationConfig","topK"],c);const f=s(e,["maxOutputTokens"]);t!==void 0&&f!=null&&a(t,["setup","generationConfig","maxOutputTokens"],f);const d=s(e,["mediaResolution"]);t!==void 0&&d!=null&&a(t,["setup","generationConfig","mediaResolution"],d);const h=s(e,["seed"]);t!==void 0&&h!=null&&a(t,["setup","generationConfig","seed"],h);const g=s(e,["speechConfig"]);t!==void 0&&g!=null&&a(t,["setup","generationConfig","speechConfig"],nx(n,Rr(n,g)));const x=s(e,["enableAffectiveDialog"]);t!==void 0&&x!=null&&a(t,["setup","generationConfig","enableAffectiveDialog"],x);const w=s(e,["systemInstruction"]);t!==void 0&&w!=null&&a(t,["setup","systemInstruction"],ax(n,Le(n,w)));const b=s(e,["tools"]);if(t!==void 0&&b!=null){let I=On(n,b);Array.isArray(I)&&(I=I.map(R=>hx(n,Bn(n,R)))),a(t,["setup","tools"],I)}const D=s(e,["sessionResumption"]);t!==void 0&&D!=null&&a(t,["setup","sessionResumption"],mx(n,D));const F=s(e,["inputAudioTranscription"]);t!==void 0&&F!=null&&a(t,["setup","inputAudioTranscription"],Tl());const T=s(e,["outputAudioTranscription"]);t!==void 0&&T!=null&&a(t,["setup","outputAudioTranscription"],Tl());const k=s(e,["realtimeInputConfig"]);t!==void 0&&k!=null&&a(t,["setup","realtimeInputConfig"],yx(n,k));const A=s(e,["contextWindowCompression"]);t!==void 0&&A!=null&&a(t,["setup","contextWindowCompression"],_x(n,A));const S=s(e,["proactivity"]);return t!==void 0&&S!=null&&a(t,["setup","proactivity"],xx(n,S)),i}function Ex(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["setup","model"],pe(n,i));const r=s(e,["config"]);return r!=null&&a(t,["config"],Cx(n,r,t)),t}function Tx(n,e,t){const i={},r=s(e,["expireTime"]);t!==void 0&&r!=null&&a(t,["expireTime"],r);const o=s(e,["newSessionExpireTime"]);t!==void 0&&o!=null&&a(t,["newSessionExpireTime"],o);const l=s(e,["uses"]);t!==void 0&&l!=null&&a(t,["uses"],l);const u=s(e,["liveConnectConstraints"]);t!==void 0&&u!=null&&a(t,["bidiGenerateContentSetup"],Ex(n,u));const c=s(e,["lockAdditionalFields"]);return t!==void 0&&c!=null&&a(t,["fieldMask"],c),i}function wx(n,e){const t={},i=s(e,["config"]);return i!=null&&a(t,["config"],Tx(n,i,t)),t}function Sx(n,e){const t={},i=s(e,["name"]);return i!=null&&a(t,["name"],i),t}/**
|
|
203
211
|
* @license
|
|
204
212
|
* Copyright 2025 Google LLC
|
|
205
213
|
* SPDX-License-Identifier: Apache-2.0
|
|
206
|
-
*/function
|
|
214
|
+
*/function Ax(n){const e=[];for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)){const i=n[t];if(typeof i=="object"&&i!=null&&Object.keys(i).length>0){const r=Object.keys(i).map(o=>`${t}.${o}`);e.push(...r)}else e.push(t)}return e.join(",")}function bx(n,e){let t=null;const i=n.bidiGenerateContentSetup;if(typeof i=="object"&&i!==null&&"setup"in i){const o=i.setup;typeof o=="object"&&o!==null?(n.bidiGenerateContentSetup=o,t=o):delete n.bidiGenerateContentSetup}else i!==void 0&&delete n.bidiGenerateContentSetup;const r=n.fieldMask;if(t){const o=Ax(t);if(Array.isArray(e==null?void 0:e.lockAdditionalFields)&&(e==null?void 0:e.lockAdditionalFields.length)===0)o?n.fieldMask=o:delete n.fieldMask;else if(e!=null&&e.lockAdditionalFields&&e.lockAdditionalFields.length>0&&r!==null&&Array.isArray(r)&&r.length>0){const l=["temperature","topK","topP","maxOutputTokens","responseModalities","seed","speechConfig"];let u=[];r.length>0&&(u=r.map(f=>l.includes(f)?`generationConfig.${f}`:f));const c=[];o&&c.push(o),u.length>0&&c.push(...u),c.length>0?n.fieldMask=c.join(","):delete n.fieldMask}else delete n.fieldMask}else r!==null&&Array.isArray(r)&&r.length>0?n.fieldMask=r.join(","):delete n.fieldMask;return n}class Rx extends fn{constructor(e){super(),this.apiClient=e}async create(e){var t,i;let r,o="",l={};if(this.apiClient.isVertexAI())throw new Error("The client.tokens.create method is only supported by the Gemini Developer API.");{const u=wx(this.apiClient,e);o=X("auth_tokens",u._url),l=u._query,delete u.config,delete u._url,delete u._query;const c=bx(u,e.config);return r=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json()),r.then(f=>Sx(this.apiClient,f))}}}/**
|
|
207
215
|
* @license
|
|
208
216
|
* Copyright 2025 Google LLC
|
|
209
217
|
* SPDX-License-Identifier: Apache-2.0
|
|
210
|
-
*/function
|
|
218
|
+
*/function Mx(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["_url","name"],i);const r=s(e,["config"]);return r!=null&&a(t,["config"],r),t}function Ix(n,e,t){const i={},r=s(e,["pageSize"]);t!==void 0&&r!=null&&a(t,["_query","pageSize"],r);const o=s(e,["pageToken"]);t!==void 0&&o!=null&&a(t,["_query","pageToken"],o);const l=s(e,["filter"]);return t!==void 0&&l!=null&&a(t,["_query","filter"],l),i}function Px(n,e){const t={},i=s(e,["config"]);return i!=null&&a(t,["config"],Ix(n,i,t)),t}function kx(n,e){const t={},i=s(e,["textInput"]);i!=null&&a(t,["textInput"],i);const r=s(e,["output"]);return r!=null&&a(t,["output"],r),t}function Nx(n,e){const t={};if(s(e,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");const i=s(e,["examples"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(o=>kx(n,o))),a(t,["examples","examples"],r)}return t}function Dx(n,e,t){const i={};if(s(e,["validationDataset"])!==void 0)throw new Error("validationDataset parameter is not supported in Gemini API.");const r=s(e,["tunedModelDisplayName"]);if(t!==void 0&&r!=null&&a(t,["displayName"],r),s(e,["description"])!==void 0)throw new Error("description parameter is not supported in Gemini API.");const o=s(e,["epochCount"]);t!==void 0&&o!=null&&a(t,["tuningTask","hyperparameters","epochCount"],o);const l=s(e,["learningRateMultiplier"]);if(l!=null&&a(i,["tuningTask","hyperparameters","learningRateMultiplier"],l),s(e,["exportLastCheckpointOnly"])!==void 0)throw new Error("exportLastCheckpointOnly parameter is not supported in Gemini API.");if(s(e,["adapterSize"])!==void 0)throw new Error("adapterSize parameter is not supported in Gemini API.");const u=s(e,["batchSize"]);t!==void 0&&u!=null&&a(t,["tuningTask","hyperparameters","batchSize"],u);const c=s(e,["learningRate"]);return t!==void 0&&c!=null&&a(t,["tuningTask","hyperparameters","learningRate"],c),i}function Lx(n,e){const t={},i=s(e,["baseModel"]);i!=null&&a(t,["baseModel"],i);const r=s(e,["trainingDataset"]);r!=null&&a(t,["tuningTask","trainingData"],Nx(n,r));const o=s(e,["config"]);return o!=null&&a(t,["config"],Dx(n,o,t)),t}function Fx(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["_url","name"],i);const r=s(e,["config"]);return r!=null&&a(t,["config"],r),t}function Vx(n,e,t){const i={},r=s(e,["pageSize"]);t!==void 0&&r!=null&&a(t,["_query","pageSize"],r);const o=s(e,["pageToken"]);t!==void 0&&o!=null&&a(t,["_query","pageToken"],o);const l=s(e,["filter"]);return t!==void 0&&l!=null&&a(t,["_query","filter"],l),i}function Bx(n,e){const t={},i=s(e,["config"]);return i!=null&&a(t,["config"],Vx(n,i,t)),t}function Ox(n,e,t){const i={},r=s(e,["gcsUri"]);if(t!==void 0&&r!=null&&a(t,["supervisedTuningSpec","trainingDatasetUri"],r),s(e,["examples"])!==void 0)throw new Error("examples parameter is not supported in Vertex AI.");return i}function Ux(n,e){const t={},i=s(e,["gcsUri"]);return i!=null&&a(t,["validationDatasetUri"],i),t}function $x(n,e,t){const i={},r=s(e,["validationDataset"]);t!==void 0&&r!=null&&a(t,["supervisedTuningSpec"],Ux(n,r));const o=s(e,["tunedModelDisplayName"]);t!==void 0&&o!=null&&a(t,["tunedModelDisplayName"],o);const l=s(e,["description"]);t!==void 0&&l!=null&&a(t,["description"],l);const u=s(e,["epochCount"]);t!==void 0&&u!=null&&a(t,["supervisedTuningSpec","hyperParameters","epochCount"],u);const c=s(e,["learningRateMultiplier"]);t!==void 0&&c!=null&&a(t,["supervisedTuningSpec","hyperParameters","learningRateMultiplier"],c);const f=s(e,["exportLastCheckpointOnly"]);t!==void 0&&f!=null&&a(t,["supervisedTuningSpec","exportLastCheckpointOnly"],f);const d=s(e,["adapterSize"]);if(t!==void 0&&d!=null&&a(t,["supervisedTuningSpec","hyperParameters","adapterSize"],d),s(e,["batchSize"])!==void 0)throw new Error("batchSize parameter is not supported in Vertex AI.");if(s(e,["learningRate"])!==void 0)throw new Error("learningRate parameter is not supported in Vertex AI.");return i}function Gx(n,e){const t={},i=s(e,["baseModel"]);i!=null&&a(t,["baseModel"],i);const r=s(e,["trainingDataset"]);r!=null&&a(t,["supervisedTuningSpec","trainingDatasetUri"],Ox(n,r,t));const o=s(e,["config"]);return o!=null&&a(t,["config"],$x(n,o,t)),t}function qx(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["model"],i);const r=s(e,["name"]);return r!=null&&a(t,["endpoint"],r),t}function wl(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["name"],i);const r=s(e,["state"]);r!=null&&a(t,["state"],$a(n,r));const o=s(e,["createTime"]);o!=null&&a(t,["createTime"],o);const l=s(e,["tuningTask","startTime"]);l!=null&&a(t,["startTime"],l);const u=s(e,["tuningTask","completeTime"]);u!=null&&a(t,["endTime"],u);const c=s(e,["updateTime"]);c!=null&&a(t,["updateTime"],c);const f=s(e,["description"]);f!=null&&a(t,["description"],f);const d=s(e,["baseModel"]);d!=null&&a(t,["baseModel"],d);const h=s(e,["_self"]);h!=null&&a(t,["tunedModel"],qx(n,h));const g=s(e,["distillationSpec"]);g!=null&&a(t,["distillationSpec"],g);const x=s(e,["experiment"]);x!=null&&a(t,["experiment"],x);const w=s(e,["labels"]);w!=null&&a(t,["labels"],w);const b=s(e,["pipelineJob"]);b!=null&&a(t,["pipelineJob"],b);const D=s(e,["serviceAccount"]);D!=null&&a(t,["serviceAccount"],D);const F=s(e,["tunedModelDisplayName"]);return F!=null&&a(t,["tunedModelDisplayName"],F),t}function Hx(n,e){const t={},i=s(e,["nextPageToken"]);i!=null&&a(t,["nextPageToken"],i);const r=s(e,["tunedModels"]);if(r!=null){let o=r;Array.isArray(o)&&(o=o.map(l=>wl(n,l))),a(t,["tuningJobs"],o)}return t}function Wx(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["name"],i);const r=s(e,["metadata"]);r!=null&&a(t,["metadata"],r);const o=s(e,["done"]);o!=null&&a(t,["done"],o);const l=s(e,["error"]);return l!=null&&a(t,["error"],l),t}function zx(n,e){const t={},i=s(e,["checkpointId"]);i!=null&&a(t,["checkpointId"],i);const r=s(e,["epoch"]);r!=null&&a(t,["epoch"],r);const o=s(e,["step"]);o!=null&&a(t,["step"],o);const l=s(e,["endpoint"]);return l!=null&&a(t,["endpoint"],l),t}function Yx(n,e){const t={},i=s(e,["model"]);i!=null&&a(t,["model"],i);const r=s(e,["endpoint"]);r!=null&&a(t,["endpoint"],r);const o=s(e,["checkpoints"]);if(o!=null){let l=o;Array.isArray(l)&&(l=l.map(u=>zx(n,u))),a(t,["checkpoints"],l)}return t}function Or(n,e){const t={},i=s(e,["name"]);i!=null&&a(t,["name"],i);const r=s(e,["state"]);r!=null&&a(t,["state"],$a(n,r));const o=s(e,["createTime"]);o!=null&&a(t,["createTime"],o);const l=s(e,["startTime"]);l!=null&&a(t,["startTime"],l);const u=s(e,["endTime"]);u!=null&&a(t,["endTime"],u);const c=s(e,["updateTime"]);c!=null&&a(t,["updateTime"],c);const f=s(e,["error"]);f!=null&&a(t,["error"],f);const d=s(e,["description"]);d!=null&&a(t,["description"],d);const h=s(e,["baseModel"]);h!=null&&a(t,["baseModel"],h);const g=s(e,["tunedModel"]);g!=null&&a(t,["tunedModel"],Yx(n,g));const x=s(e,["supervisedTuningSpec"]);x!=null&&a(t,["supervisedTuningSpec"],x);const w=s(e,["tuningDataStats"]);w!=null&&a(t,["tuningDataStats"],w);const b=s(e,["encryptionSpec"]);b!=null&&a(t,["encryptionSpec"],b);const D=s(e,["partnerModelTuningSpec"]);D!=null&&a(t,["partnerModelTuningSpec"],D);const F=s(e,["distillationSpec"]);F!=null&&a(t,["distillationSpec"],F);const T=s(e,["experiment"]);T!=null&&a(t,["experiment"],T);const k=s(e,["labels"]);k!=null&&a(t,["labels"],k);const A=s(e,["pipelineJob"]);A!=null&&a(t,["pipelineJob"],A);const S=s(e,["serviceAccount"]);S!=null&&a(t,["serviceAccount"],S);const I=s(e,["tunedModelDisplayName"]);return I!=null&&a(t,["tunedModelDisplayName"],I),t}function Kx(n,e){const t={},i=s(e,["nextPageToken"]);i!=null&&a(t,["nextPageToken"],i);const r=s(e,["tuningJobs"]);if(r!=null){let o=r;Array.isArray(o)&&(o=o.map(l=>Or(n,l))),a(t,["tuningJobs"],o)}return t}/**
|
|
211
219
|
* @license
|
|
212
220
|
* Copyright 2025 Google LLC
|
|
213
221
|
* SPDX-License-Identifier: Apache-2.0
|
|
214
|
-
*/class
|
|
222
|
+
*/class Jx extends fn{constructor(e){super(),this.apiClient=e,this.get=async t=>await this.getInternal(t),this.list=async(t={})=>new Mi(hn.PAGED_ITEM_TUNING_JOBS,i=>this.listInternal(i),await this.listInternal(t),t),this.tune=async t=>{if(this.apiClient.isVertexAI())return await this.tuneInternal(t);{const i=await this.tuneMldevInternal(t);let r="";return i.metadata!==void 0&&i.metadata.tunedModel!==void 0?r=i.metadata.tunedModel:i.name!==void 0&&i.name.includes("/operations/")&&(r=i.name.split("/operations/")[0]),{name:r,state:Sr.JOB_STATE_QUEUED}}}}async getInternal(e){var t,i,r,o;let l,u="",c={};if(this.apiClient.isVertexAI()){const f=Fx(this.apiClient,e);return u=X("{name}",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),l.then(d=>Or(this.apiClient,d))}else{const f=Mx(this.apiClient,e);return u=X("{name}",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(d=>d.json()),l.then(d=>wl(this.apiClient,d))}}async listInternal(e){var t,i,r,o;let l,u="",c={};if(this.apiClient.isVertexAI()){const f=Bx(this.apiClient,e);return u=X("tuningJobs",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),l.then(d=>{const h=Kx(this.apiClient,d),g=new Ma;return Object.assign(g,h),g})}else{const f=Px(this.apiClient,e);return u=X("tunedModels",f._url),c=f._query,delete f.config,delete f._url,delete f._query,l=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(d=>d.json()),l.then(d=>{const h=Hx(this.apiClient,d),g=new Ma;return Object.assign(g,h),g})}}async tuneInternal(e){var t,i;let r,o="",l={};if(this.apiClient.isVertexAI()){const u=Gx(this.apiClient,e);return o=X("tuningJobs",u._url),l=u._query,delete u.config,delete u._url,delete u._query,r=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(c=>c.json()),r.then(c=>Or(this.apiClient,c))}else throw new Error("This method is only supported by the Vertex AI.")}async tuneMldevInternal(e){var t,i;let r,o="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const u=Lx(this.apiClient,e);return o=X("tunedModels",u._url),l=u._query,delete u.config,delete u._url,delete u._query,r=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(c=>c.json()),r.then(c=>Wx(this.apiClient,c))}}}/**
|
|
215
223
|
* @license
|
|
216
224
|
* Copyright 2025 Google LLC
|
|
217
225
|
* SPDX-License-Identifier: Apache-2.0
|
|
218
|
-
*/class
|
|
226
|
+
*/class Zx{async download(e,t){throw new Error("Download to file is not supported in the browser, please use a browser compliant download like an <a> tag.")}}const Xx=1024*1024*8,Qx=3,jx=1e3,eC=2,Ur="x-goog-upload-status";async function tC(n,e,t){var i,r,o;let l=0,u=0,c=new Ar(new Response),f="upload";for(l=n.size;u<l;){const h=Math.min(Xx,l-u),g=n.slice(u,u+h);u+h>=l&&(f+=", finalize");let x=0,w=jx;for(;x<Qx&&(c=await t.request({path:"",body:g,httpMethod:"POST",httpOptions:{apiVersion:"",baseUrl:e,headers:{"X-Goog-Upload-Command":f,"X-Goog-Upload-Offset":String(u),"Content-Length":String(h)}}}),!(!((i=c==null?void 0:c.headers)===null||i===void 0)&&i[Ur]));)x++,await iC(w),w=w*eC;if(u+=h,((r=c==null?void 0:c.headers)===null||r===void 0?void 0:r[Ur])!=="active")break;if(l<=u)throw new Error("All content has been uploaded, but the upload status is not finalized.")}const d=await(c==null?void 0:c.json());if(((o=c==null?void 0:c.headers)===null||o===void 0?void 0:o[Ur])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");return d.file}async function nC(n){return{size:n.size,type:n.type}}function iC(n){return new Promise(e=>setTimeout(e,n))}class rC{async upload(e,t,i){if(typeof e=="string")throw new Error("File path is not supported in browser uploader.");return await tC(e,t,i)}async stat(e){if(typeof e=="string")throw new Error("File path is not supported in browser uploader.");return await nC(e)}}/**
|
|
219
227
|
* @license
|
|
220
228
|
* Copyright 2025 Google LLC
|
|
221
229
|
* SPDX-License-Identifier: Apache-2.0
|
|
222
|
-
*/class
|
|
230
|
+
*/class oC{create(e,t,i){return new sC(e,t,i)}}class sC{constructor(e,t,i){this.url=e,this.headers=t,this.callbacks=i}connect(){this.ws=new WebSocket(this.url),this.ws.onopen=this.callbacks.onopen,this.ws.onerror=this.callbacks.onerror,this.ws.onclose=this.callbacks.onclose,this.ws.onmessage=this.callbacks.onmessage}send(e){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.send(e)}close(){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.close()}}/**
|
|
223
231
|
* @license
|
|
224
232
|
* Copyright 2025 Google LLC
|
|
225
233
|
* SPDX-License-Identifier: Apache-2.0
|
|
226
|
-
*/const
|
|
234
|
+
*/const Sl="x-goog-api-key";class aC{constructor(e){this.apiKey=e}async addAuthHeaders(e){if(e.get(Sl)===null){if(this.apiKey.startsWith("auth_tokens/"))throw new Error("Ephemeral tokens are only supported by the live API.");if(!this.apiKey)throw new Error("API key is missing. Please provide a valid API key.");e.append(Sl,this.apiKey)}}}/**
|
|
227
235
|
* @license
|
|
228
236
|
* Copyright 2025 Google LLC
|
|
229
237
|
* SPDX-License-Identifier: Apache-2.0
|
|
230
|
-
*/const
|
|
238
|
+
*/const lC="gl-node/";class uC{constructor(e){var t;if(e.apiKey==null)throw new Error("An API Key must be set when running in a browser");if(e.project||e.location)throw new Error("Vertex AI project based authentication is not supported on browser runtimes. Please do not provide a project or location.");this.vertexai=(t=e.vertexai)!==null&&t!==void 0?t:!1,this.apiKey=e.apiKey;const i=mh(e,void 0,void 0);i&&(e.httpOptions?e.httpOptions.baseUrl=i:e.httpOptions={baseUrl:i}),this.apiVersion=e.apiVersion;const r=new aC(this.apiKey);this.apiClient=new w_({auth:r,apiVersion:this.apiVersion,apiKey:this.apiKey,vertexai:this.vertexai,httpOptions:e.httpOptions,userAgentExtra:lC+"web",uploader:new rC,downloader:new Zx}),this.models=new $_(this.apiClient),this.live=new F_(this.apiClient,r,new oC),this.chats=new $m(this.models,this.apiClient),this.caches=new Bm(this.apiClient),this.files=new eg(this.apiClient),this.operations=new Q_(this.apiClient),this.authTokens=new Rx(this.apiClient),this.tunings=new Jx(this.apiClient)}}const $r=[{id:"bp1",name:"Order to Cash",capabilities:[{id:"cap1",name:"Order Management",cycles:[{id:"cyc1",name:"Standard Order Processing",type:"cycle",practices:[{id:"pra1",name:"Validate Customer Credit",type:"practice"},{id:"pra3",name:"Check Inventory Availability",type:"practice"}]},{id:"cyc2",name:"Returns Management",type:"cycle",practices:[{id:"pra4",name:"Issue Return Material Auth",type:"practice"}]}]},{id:"cap2",name:"Invoicing & Collections",cycles:[{id:"cyc3",name:"Automated Billing Cycle",type:"cycle",practices:[]}]}]},{id:"bp2",name:"Hire to Retire",capabilities:[{id:"cap3",name:"Talent Acquisition",cycles:[{id:"cyc4",name:"Recruitment Funnel",type:"cycle",practices:[{id:"pra2",name:"Interview Evaluation",type:"practice"},{id:"pra5",name:"Background Verification",type:"practice"}]}]}]}],Al=`<?xml version="1.0" encoding="UTF-8"?>
|
|
231
239
|
<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn">
|
|
232
240
|
<bpmn:process id="Process_1" isExecutable="false">
|
|
233
241
|
<bpmn:startEvent id="StartEvent_1" name="Start" />
|
|
@@ -239,4 +247,4 @@ React keys must be passed directly to JSX without using spread:
|
|
|
239
247
|
</bpmndi:BPMNShape>
|
|
240
248
|
</bpmndi:BPMNPlane>
|
|
241
249
|
</bpmndi:BPMNDiagram>
|
|
242
|
-
</bpmn:definitions>`,Yf=()=>{const[o,e]=J.useState("dashboard"),[t,n]=J.useState(bt[0].id),[i,a]=J.useState(null),l=J.useRef(null),u=J.useRef(null),[d,c]=J.useState(!0),[f,p]=J.useState(""),[m,h]=J.useState(!1),[g,v]=J.useState("");J.useEffect(()=>{if(o==="designer"&&l.current){const E=setTimeout(()=>{!u.current&&l.current&&(u.current=new BpmnJS({container:l.current}),u.current.importXML(zo).catch(console.error))},50);return()=>clearTimeout(E)}return()=>{if(u.current){try{u.current.destroy()}catch(E){console.warn("Modeler destruction warning",E)}u.current=null}}},[o]);const x=E=>{a(E),e("designer")},M=()=>{e("dashboard"),a(null),p(""),v(""),h(!1)},R=async()=>{if(u.current)try{const{xml:E}=await u.current.saveXML({format:!0}),A=new Blob([E],{type:"application/xml"}),P=document.createElement("a");P.href=URL.createObjectURL(A),P.download=`${(i==null?void 0:i.name.replace(/\s+/g,"_"))||"process"}.bpmn`,P.click()}catch(E){console.error("Error exporting BPMN",E)}},k=async()=>{if(!(!f.trim()||!u.current)){h(!0),v("Drafting flow...");try{let P=(await new Wf({apiKey:"PLACEHOLDER_API_KEY"}).models.generateContent({model:"gemini-3-flash-preview",contents:`Generate a valid BPMN 2.0 XML for a ${i==null?void 0:i.type} named "${i==null?void 0:i.name}". Specific requirements: "${f}". Return ONLY the raw XML code.`})).text||"";P=P.replace(/^```xml\n/,"").replace(/\n```$/,"").trim(),P.includes("<bpmn:definitions")?(await u.current.importXML(P),v("Import successful!"),p("")):v("Generated invalid XML.")}catch(E){console.error("AI Generation error",E),v("Generation failed.")}finally{h(!1),setTimeout(()=>v(""),3e3)}}},V=(E,A)=>{if(!u.current)return;const P=u.current.get("elementFactory"),O=u.current.get("create");let b=P.createShape({type:A});b&&O.start(E,b)};if(o==="dashboard"){const E=bt.find(A=>A.id===t);return C.jsxs("div",{className:"min-h-screen bg-slate-50 text-slate-900",children:[C.jsx("header",{className:"bg-white border-b border-slate-200 px-8 py-6",children:C.jsxs("div",{className:"max-w-7xl mx-auto flex justify-between items-center",children:[C.jsxs("div",{children:[C.jsxs("h1",{className:"text-2xl font-bold tracking-tight text-slate-900 flex items-center gap-2",children:[C.jsx(ri,{className:"text-indigo-600"}),"Enterprise Blueprint"]}),C.jsx("p",{className:"text-slate-500 text-sm",children:"Organize processes, capabilities, and work cycles."})]}),C.jsxs("button",{className:"bg-indigo-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-indigo-700 transition-colors flex items-center gap-2 shadow-sm",children:[C.jsx(fi,{size:18})," New Process"]})]})}),C.jsx("div",{className:"bg-white border-b border-slate-200 sticky top-0 z-10",children:C.jsx("div",{className:"max-w-7xl mx-auto flex gap-8 px-8",children:bt.map(A=>C.jsx("button",{onClick:()=>n(A.id),className:`py-4 text-sm font-semibold border-b-2 transition-all ${t===A.id?"border-indigo-600 text-indigo-600":"border-transparent text-slate-500 hover:text-slate-700"}`,children:A.name},A.id))})}),C.jsx("main",{className:"max-w-7xl mx-auto p-8",children:C.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:E==null?void 0:E.capabilities.map(A=>C.jsxs("div",{className:"bg-white rounded-2xl border border-slate-200 shadow-sm overflow-hidden flex flex-col h-fit",children:[C.jsxs("div",{className:"p-6 border-b border-slate-100 bg-slate-50/50",children:[C.jsxs("h3",{className:"text-lg font-bold flex items-center gap-2 text-slate-800",children:[C.jsx(hi,{className:"text-indigo-500 w-5 h-5"}),A.name]}),C.jsx("span",{className:"text-xs font-semibold text-slate-400 uppercase tracking-widest mt-1 block",children:"Capability"})]}),C.jsxs("div",{className:"p-6 space-y-4",children:[C.jsxs("h4",{className:"text-xs font-bold text-slate-400 uppercase tracking-wider mb-2 flex items-center gap-2",children:[C.jsx($t,{size:14})," Work Cycles & Practices"]}),C.jsx("div",{className:"space-y-4",children:A.cycles.map(P=>C.jsxs("div",{className:"rounded-xl border border-slate-100 overflow-hidden bg-white shadow-sm",children:[C.jsxs("div",{className:"flex items-center justify-between p-3 bg-slate-50/50 group border-b border-slate-100",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx($t,{size:14,className:"text-indigo-400"}),C.jsx("span",{className:"text-sm font-bold text-slate-800",children:P.name})]}),C.jsx("button",{onClick:()=>x(P),className:"text-[10px] font-bold text-indigo-600 bg-indigo-100 px-2 py-1 rounded hover:bg-indigo-200 transition-colors uppercase tracking-tight",children:"Design Cycle"})]}),C.jsx("div",{className:"p-2 space-y-1",children:P.practices.length>0?P.practices.map(O=>C.jsxs("div",{className:"flex items-center justify-between p-2 pl-4 rounded-lg hover:bg-indigo-50/50 group transition-all",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx(ci,{size:12,className:"text-slate-300"}),C.jsx("span",{className:"text-xs font-medium text-slate-600",children:O.name})]}),C.jsxs("button",{onClick:()=>x(O),className:"text-[10px] font-semibold text-slate-400 opacity-0 group-hover:opacity-100 hover:text-indigo-600 flex items-center gap-1 transition-all",children:["Design Practice ",C.jsx(He,{size:10})]})]},O.id)):C.jsx("div",{className:"py-2 px-4 text-[10px] italic text-slate-400",children:"No practices defined for this cycle."})})]},P.id))})]})]},A.id))})})]})}return C.jsxs("div",{className:"flex h-screen w-full bg-white overflow-hidden text-slate-800",children:[C.jsxs("div",{className:`${d?"w-80":"w-0"} transition-all duration-300 border-r border-slate-200 bg-slate-50 flex flex-col relative z-20 shadow-xl`,children:[d&&C.jsxs("div",{className:"flex-1 flex flex-col p-6 overflow-y-auto w-80",children:[C.jsxs("div",{className:"flex items-center gap-2 mb-8",children:[C.jsx("button",{onClick:E=>{E.preventDefault(),M()},className:"p-2 hover:bg-slate-200 rounded-lg transition-colors mr-1 flex items-center justify-center text-slate-600 hover:text-indigo-600 active:scale-95 cursor-pointer",title:"Back to Dashboard",children:C.jsx(ii,{size:18})}),C.jsx("h1",{className:"font-bold text-lg tracking-tight text-slate-900 truncate",children:i==null?void 0:i.name})]}),C.jsxs("div",{className:"space-y-6",children:[C.jsxs("section",{children:[C.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-slate-400 mb-4 flex items-center gap-2",children:"Palette"}),C.jsx("div",{className:"grid grid-cols-1 gap-2",children:[{type:"bpmn:StartEvent",icon:C.jsx(li,{size:18}),label:"Start",color:"bg-green-50 text-green-600"},{type:"bpmn:Task",icon:C.jsx(mi,{size:18}),label:"Task",color:"bg-slate-100 text-slate-600"},{type:"bpmn:IntermediateCatchEvent",icon:C.jsx(di,{size:18}),label:"Event",color:"bg-blue-50 text-blue-600"},{type:"bpmn:EndEvent",icon:C.jsx(ai,{size:18}),label:"End",color:"bg-red-50 text-red-600"}].map(E=>C.jsxs("div",{onMouseDown:A=>V(A,E.type),className:"flex items-center gap-3 p-3 bg-white border border-slate-200 rounded-xl cursor-grab hover:border-indigo-400 hover:shadow-sm transition-all group",children:[C.jsx("div",{className:`p-2 rounded-lg ${E.color}`,children:E.icon}),C.jsx("span",{className:"text-sm font-medium",children:E.label})]},E.type))})]}),C.jsx("hr",{className:"border-slate-200"}),C.jsxs("section",{children:[C.jsxs("label",{className:"block text-xs font-bold uppercase tracking-wider text-slate-400 mb-3 flex items-center gap-2",children:[C.jsx(pi,{className:"w-3 h-3 text-indigo-500"}),"AI Architect"]}),C.jsx("textarea",{className:"w-full h-24 p-3 text-sm border border-slate-300 rounded-xl focus:ring-2 focus:ring-indigo-500 bg-white outline-none resize-none transition-all",placeholder:"Ask AI to draft this process...",value:f,onChange:E=>p(E.target.value)}),C.jsx("button",{onClick:k,disabled:m||!f.trim(),className:"w-full mt-2 bg-indigo-600 hover:bg-indigo-700 disabled:bg-slate-300 text-white font-medium py-2 rounded-xl flex items-center justify-center gap-2 transition-all shadow-md active:scale-95",children:m?"Drafting...":"Generate Flow"}),g&&C.jsx("p",{className:"mt-2 text-[10px] text-center font-medium text-indigo-600",children:g})]}),C.jsx("section",{className:"mt-auto space-y-3 pt-6 border-t border-slate-200",children:C.jsxs("button",{onClick:()=>{u.current&&u.current.importXML(zo)},className:"w-full flex items-center gap-2 p-2 text-red-500 hover:bg-red-50 rounded-lg text-xs font-medium transition-all",children:[C.jsx(gi,{size:14})," Reset Canvas"]})})]})]}),C.jsx("button",{onClick:()=>c(!d),className:"absolute -right-4 top-1/2 -translate-y-1/2 bg-white border border-slate-200 rounded-full p-1 shadow-md hover:text-indigo-600 transition-all z-50",children:d?C.jsx(si,{size:20}):C.jsx(He,{size:20})})]}),C.jsxs("div",{className:"flex-1 relative flex flex-col min-w-0",children:[C.jsxs("header",{className:"h-14 border-b border-slate-200 flex items-center justify-between px-6 bg-white/80 backdrop-blur-md z-10",children:[C.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium",children:[C.jsx("span",{className:"text-slate-400",children:"Architecture"}),C.jsx(He,{size:12,className:"text-slate-300"}),C.jsx("span",{className:"text-slate-400 uppercase tracking-tighter",children:(i==null?void 0:i.type)==="cycle"?"Cycle":"Practice"}),C.jsx(He,{size:12,className:"text-slate-300"}),C.jsx("span",{className:"text-slate-900 font-bold",children:i==null?void 0:i.name})]}),C.jsx("div",{className:"flex gap-2",children:C.jsxs("button",{onClick:R,className:"text-xs font-bold text-white bg-indigo-600 hover:bg-indigo-700 px-4 py-2 rounded-lg shadow-sm flex items-center gap-2 transition-all active:scale-95",children:[C.jsx(ui,{size:14})," Export BPMN"]})})]}),C.jsxs("div",{className:"flex-1 relative overflow-hidden bg-white",children:[C.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(#e5e7eb_1px,transparent_1px)] [background-size:24px_24px] pointer-events-none opacity-40"}),C.jsx("div",{ref:l,className:"h-full w-full bpmn-io-style relative"})]})]})]})};fe.BpmnFlowDesigner=Yf,Object.defineProperty(fe,Symbol.toStringTag,{value:"Module"})}));
|
|
250
|
+
</bpmn:definitions>`,cC=()=>{const[n,e]=Te.useState("dashboard"),[t,i]=Te.useState($r[0].id),[r,o]=Te.useState(null),l=Te.useRef(null),u=Te.useRef(null),[c,f]=Te.useState(!0),[d,h]=Te.useState(""),[g,x]=Te.useState(!1),[w,b]=Te.useState("");Te.useEffect(()=>{if(n==="designer"&&l.current){const S=setTimeout(()=>{!u.current&&l.current&&(u.current=new mi({container:l.current}),u.current.importXML(Al).catch(console.error))},50);return()=>clearTimeout(S)}return()=>{if(u.current){try{u.current.destroy()}catch(S){console.warn("Modeler destruction warning",S)}u.current=null}}},[n]);const D=S=>{o(S),e("designer")},F=()=>{e("dashboard"),o(null),h(""),b(""),x(!1)},T=async()=>{if(u.current)try{const{xml:S}=await u.current.saveXML({format:!0}),I=new Blob([S],{type:"application/xml"}),R=document.createElement("a");R.href=URL.createObjectURL(I),R.download=`${(r==null?void 0:r.name.replace(/\s+/g,"_"))||"process"}.bpmn`,R.click()}catch(S){console.error("Error exporting BPMN",S)}},k=async()=>{if(!(!d.trim()||!u.current)){x(!0),b("Drafting flow...");try{let R=(await new uC({apiKey:"PLACEHOLDER_API_KEY"}).models.generateContent({model:"gemini-3-flash-preview",contents:`Generate a valid BPMN 2.0 XML for a ${r==null?void 0:r.type} named "${r==null?void 0:r.name}". Specific requirements: "${d}". Return ONLY the raw XML code.`})).text||"";R=R.replace(/^```xml\n/,"").replace(/\n```$/,"").trim(),R.includes("<bpmn:definitions")?(await u.current.importXML(R),b("Import successful!"),h("")):b("Generated invalid XML.")}catch(S){console.error("AI Generation error",S),b("Generation failed.")}finally{x(!1),setTimeout(()=>b(""),3e3)}}},A=(S,I)=>{if(!u.current)return;const R=u.current.get("elementFactory"),M=u.current.get("create");let C=R.createShape({type:I});C&&M.start(S,C)};if(n==="dashboard"){const S=$r.find(I=>I.id===t);return V.jsxs("div",{className:"min-h-screen bg-slate-50 text-slate-900",children:[V.jsx("header",{className:"bg-white border-b border-slate-200 px-8 py-6",children:V.jsxs("div",{className:"max-w-7xl mx-auto flex justify-between items-center",children:[V.jsxs("div",{children:[V.jsxs("h1",{className:"text-2xl font-bold tracking-tight text-slate-900 flex items-center gap-2",children:[V.jsx(Ep,{className:"text-indigo-600"}),"Enterprise Blueprint"]}),V.jsx("p",{className:"text-slate-500 text-sm",children:"Organize processes, capabilities, and work cycles."})]}),V.jsxs("button",{className:"bg-indigo-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-indigo-700 transition-colors flex items-center gap-2 shadow-sm",children:[V.jsx(Mp,{size:18})," New Process"]})]})}),V.jsx("div",{className:"bg-white border-b border-slate-200 sticky top-0 z-10",children:V.jsx("div",{className:"max-w-7xl mx-auto flex gap-8 px-8",children:$r.map(I=>V.jsx("button",{onClick:()=>i(I.id),className:`py-4 text-sm font-semibold border-b-2 transition-all ${t===I.id?"border-indigo-600 text-indigo-600":"border-transparent text-slate-500 hover:text-slate-700"}`,children:I.name},I.id))})}),V.jsx("main",{className:"max-w-7xl mx-auto p-8",children:V.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:S==null?void 0:S.capabilities.map(I=>V.jsxs("div",{className:"bg-white rounded-2xl border border-slate-200 shadow-sm overflow-hidden flex flex-col h-fit",children:[V.jsxs("div",{className:"p-6 border-b border-slate-100 bg-slate-50/50",children:[V.jsxs("h3",{className:"text-lg font-bold flex items-center gap-2 text-slate-800",children:[V.jsx(kp,{className:"text-indigo-500 w-5 h-5"}),I.name]}),V.jsx("span",{className:"text-xs font-semibold text-slate-400 uppercase tracking-widest mt-1 block",children:"Capability"})]}),V.jsxs("div",{className:"p-6 space-y-4",children:[V.jsxs("h4",{className:"text-xs font-bold text-slate-400 uppercase tracking-wider mb-2 flex items-center gap-2",children:[V.jsx(ws,{size:14})," Work Cycles & Practices"]}),V.jsx("div",{className:"space-y-4",children:I.cycles.map(R=>V.jsxs("div",{className:"rounded-xl border border-slate-100 overflow-hidden bg-white shadow-sm",children:[V.jsxs("div",{className:"flex items-center justify-between p-3 bg-slate-50/50 group border-b border-slate-100",children:[V.jsxs("div",{className:"flex items-center gap-2",children:[V.jsx(ws,{size:14,className:"text-indigo-400"}),V.jsx("span",{className:"text-sm font-bold text-slate-800",children:R.name})]}),V.jsx("button",{onClick:()=>D(R),className:"text-[10px] font-bold text-indigo-600 bg-indigo-100 px-2 py-1 rounded hover:bg-indigo-200 transition-colors uppercase tracking-tight",children:"Design Cycle"})]}),V.jsx("div",{className:"p-2 space-y-1",children:R.practices.length>0?R.practices.map(M=>V.jsxs("div",{className:"flex items-center justify-between p-2 pl-4 rounded-lg hover:bg-indigo-50/50 group transition-all",children:[V.jsxs("div",{className:"flex items-center gap-2",children:[V.jsx(bp,{size:12,className:"text-slate-300"}),V.jsx("span",{className:"text-xs font-medium text-slate-600",children:M.name})]}),V.jsxs("button",{onClick:()=>D(M),className:"text-[10px] font-semibold text-slate-400 opacity-0 group-hover:opacity-100 hover:text-indigo-600 flex items-center gap-1 transition-all",children:["Design Practice ",V.jsx(gi,{size:10})]})]},M.id)):V.jsx("div",{className:"py-2 px-4 text-[10px] italic text-slate-400",children:"No practices defined for this cycle."})})]},R.id))})]})]},I.id))})})]})}return V.jsxs("div",{className:"flex h-screen w-full bg-white overflow-hidden text-slate-800",children:[V.jsxs("div",{className:`${c?"w-80":"w-0"} transition-all duration-300 border-r border-slate-200 bg-slate-50 flex flex-col relative z-20 shadow-xl`,children:[c&&V.jsxs("div",{className:"flex-1 flex flex-col p-6 overflow-y-auto w-80",children:[V.jsxs("div",{className:"flex items-center gap-2 mb-8",children:[V.jsx("button",{onClick:S=>{S.preventDefault(),F()},className:"p-2 hover:bg-slate-200 rounded-lg transition-colors mr-1 flex items-center justify-center text-slate-600 hover:text-indigo-600 active:scale-95 cursor-pointer",title:"Back to Dashboard",children:V.jsx(Cp,{size:18})}),V.jsx("h1",{className:"font-bold text-lg tracking-tight text-slate-900 truncate",children:r==null?void 0:r.name})]}),V.jsxs("div",{className:"space-y-6",children:[V.jsxs("section",{children:[V.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-slate-400 mb-4 flex items-center gap-2",children:"Palette"}),V.jsx("div",{className:"grid grid-cols-1 gap-2",children:[{type:"bpmn:StartEvent",icon:V.jsx(Sp,{size:18}),label:"Start",color:"bg-green-50 text-green-600"},{type:"bpmn:Task",icon:V.jsx(Pp,{size:18}),label:"Task",color:"bg-slate-100 text-slate-600"},{type:"bpmn:IntermediateCatchEvent",icon:V.jsx(Rp,{size:18}),label:"Event",color:"bg-blue-50 text-blue-600"},{type:"bpmn:EndEvent",icon:V.jsx(wp,{size:18}),label:"End",color:"bg-red-50 text-red-600"}].map(S=>V.jsxs("div",{onMouseDown:I=>A(I,S.type),className:"flex items-center gap-3 p-3 bg-white border border-slate-200 rounded-xl cursor-grab hover:border-indigo-400 hover:shadow-sm transition-all group",children:[V.jsx("div",{className:`p-2 rounded-lg ${S.color}`,children:S.icon}),V.jsx("span",{className:"text-sm font-medium",children:S.label})]},S.type))})]}),V.jsx("hr",{className:"border-slate-200"}),V.jsxs("section",{children:[V.jsxs("label",{className:"block text-xs font-bold uppercase tracking-wider text-slate-400 mb-3 flex items-center gap-2",children:[V.jsx(Ip,{className:"w-3 h-3 text-indigo-500"}),"AI Architect"]}),V.jsx("textarea",{className:"w-full h-24 p-3 text-sm border border-slate-300 rounded-xl focus:ring-2 focus:ring-indigo-500 bg-white outline-none resize-none transition-all",placeholder:"Ask AI to draft this process...",value:d,onChange:S=>h(S.target.value)}),V.jsx("button",{onClick:k,disabled:g||!d.trim(),className:"w-full mt-2 bg-indigo-600 hover:bg-indigo-700 disabled:bg-slate-300 text-white font-medium py-2 rounded-xl flex items-center justify-center gap-2 transition-all shadow-md active:scale-95",children:g?"Drafting...":"Generate Flow"}),w&&V.jsx("p",{className:"mt-2 text-[10px] text-center font-medium text-indigo-600",children:w})]}),V.jsx("section",{className:"mt-auto space-y-3 pt-6 border-t border-slate-200",children:V.jsxs("button",{onClick:()=>{u.current&&u.current.importXML(Al)},className:"w-full flex items-center gap-2 p-2 text-red-500 hover:bg-red-50 rounded-lg text-xs font-medium transition-all",children:[V.jsx(Np,{size:14})," Reset Canvas"]})})]})]}),V.jsx("button",{onClick:()=>f(!c),className:"absolute -right-4 top-1/2 -translate-y-1/2 bg-white border border-slate-200 rounded-full p-1 shadow-md hover:text-indigo-600 transition-all z-50",children:c?V.jsx(Tp,{size:20}):V.jsx(gi,{size:20})})]}),V.jsxs("div",{className:"flex-1 relative flex flex-col min-w-0",children:[V.jsxs("header",{className:"h-14 border-b border-slate-200 flex items-center justify-between px-6 bg-white/80 backdrop-blur-md z-10",children:[V.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium",children:[V.jsx("span",{className:"text-slate-400",children:"Architecture"}),V.jsx(gi,{size:12,className:"text-slate-300"}),V.jsx("span",{className:"text-slate-400 uppercase tracking-tighter",children:(r==null?void 0:r.type)==="cycle"?"Cycle":"Practice"}),V.jsx(gi,{size:12,className:"text-slate-300"}),V.jsx("span",{className:"text-slate-900 font-bold",children:r==null?void 0:r.name})]}),V.jsx("div",{className:"flex gap-2",children:V.jsxs("button",{onClick:T,className:"text-xs font-bold text-white bg-indigo-600 hover:bg-indigo-700 px-4 py-2 rounded-lg shadow-sm flex items-center gap-2 transition-all active:scale-95",children:[V.jsx(Ap,{size:14})," Export BPMN"]})})]}),V.jsxs("div",{className:"flex-1 relative overflow-hidden bg-white",children:[V.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(#e5e7eb_1px,transparent_1px)] [background-size:24px_24px] pointer-events-none opacity-40"}),V.jsx("div",{ref:l,className:"h-full w-full bpmn-io-style relative"})]})]})]})};Pt.BpmnFlowDesigner=cC,Object.defineProperty(Pt,Symbol.toStringTag,{value:"Module"})}));
|