From c3c35677ca1abe8acd4cb3b1ea36560fe8cbf8b4 Mon Sep 17 00:00:00 2001 From: hhd <17835559578@163.com> Date: Tue, 18 Mar 2025 18:57:40 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E3=80=91=E6=96=B0=E5=A2=9E=E5=86=85=E9=83=A8=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/dist/index.css | 1 - packages/ui/dist/index.d.ts | 40 - packages/ui/dist/index.js | 16799 ---------------- packages/ui/dist/index.js.map | 1 - packages/ui/dist/index.umd.js | 8 - packages/ui/dist/index.umd.js.map | 1 - packages/ui/src/Tinyflow.ts | 1 + packages/ui/src/components/Toolbar.svelte | 6 + .../src/components/nodes/InternalNode.svelte | 103 + packages/ui/src/components/nodes/index.ts | 2 + packages/vue/src/Tinyflow.vue | 4 +- 11 files changed, 115 insertions(+), 16851 deletions(-) delete mode 100644 packages/ui/dist/index.css delete mode 100644 packages/ui/dist/index.d.ts delete mode 100644 packages/ui/dist/index.js delete mode 100644 packages/ui/dist/index.js.map delete mode 100644 packages/ui/dist/index.umd.js delete mode 100644 packages/ui/dist/index.umd.js.map create mode 100644 packages/ui/src/components/nodes/InternalNode.svelte diff --git a/packages/ui/dist/index.css b/packages/ui/dist/index.css deleted file mode 100644 index 8fa10c2..0000000 --- a/packages/ui/dist/index.css +++ /dev/null @@ -1 +0,0 @@ -.svelte-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgb(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.svelte-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgb(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #777;--xy-background-pattern-lines-color-default: #777;--xy-background-pattern-cross-color-default: #777;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.svelte-flow__background{background-color:var(--xy-background-color, var(--xy-background-color-props, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.svelte-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.svelte-flow__pane{z-index:1}.svelte-flow__pane.draggable{cursor:grab}.svelte-flow__pane.dragging{cursor:grabbing}.svelte-flow__pane.selection{cursor:pointer}.svelte-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.svelte-flow__renderer{z-index:4}.svelte-flow__selection{z-index:6}.svelte-flow__nodesselection-rect:focus,.svelte-flow__nodesselection-rect:focus-visible{outline:none}.svelte-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.svelte-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.svelte-flow .svelte-flow__edges{position:absolute}.svelte-flow .svelte-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.svelte-flow__edge{pointer-events:visibleStroke}.svelte-flow__edge.selectable{cursor:pointer}.svelte-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.svelte-flow__edge.animated path.svelte-flow__edge-interaction{stroke-dasharray:none;animation:none}.svelte-flow__edge.inactive{pointer-events:none}.svelte-flow__edge.selected,.svelte-flow__edge:focus,.svelte-flow__edge:focus-visible{outline:none}.svelte-flow__edge.selected .svelte-flow__edge-path,.svelte-flow__edge.selectable:focus .svelte-flow__edge-path,.svelte-flow__edge.selectable:focus-visible .svelte-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.svelte-flow__edge-textwrapper{pointer-events:all}.svelte-flow__edge .svelte-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.svelte-flow__connection{pointer-events:none}.svelte-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.svelte-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.svelte-flow__nodes{pointer-events:none;transform-origin:0 0}.svelte-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.svelte-flow__node.selectable{cursor:pointer}.svelte-flow__node.draggable{cursor:grab;pointer-events:all}.svelte-flow__node.draggable.dragging{cursor:grabbing}.svelte-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.svelte-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.svelte-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.svelte-flow__handle.connectingfrom{pointer-events:all}.svelte-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.svelte-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.svelte-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.svelte-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.svelte-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.svelte-flow__edgeupdater{cursor:move;pointer-events:all}.svelte-flow__panel{position:absolute;z-index:5;margin:15px}.svelte-flow__panel.top{top:0}.svelte-flow__panel.bottom{bottom:0}.svelte-flow__panel.left{left:0}.svelte-flow__panel.right{right:0}.svelte-flow__panel.center{left:50%;transform:translate(-50%)}.svelte-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.svelte-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.svelte-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.svelte-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.svelte-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.svelte-flow__minimap-svg{display:block}.svelte-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.svelte-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.svelte-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.svelte-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.svelte-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.svelte-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.svelte-flow__controls.horizontal{flex-direction:row}.svelte-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.svelte-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.svelte-flow__edge.updating .svelte-flow__edge-path{stroke:#777}.svelte-flow__edge-text{font-size:10px}.svelte-flow__node.selectable:focus,.svelte-flow__node.selectable:focus-visible{outline:none}.svelte-flow__node-input,.svelte-flow__node-default,.svelte-flow__node-output,.svelte-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.svelte-flow__node-input.selectable:hover,.svelte-flow__node-default.selectable:hover,.svelte-flow__node-output.selectable:hover,.svelte-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.svelte-flow__node-input.selectable.selected,.svelte-flow__node-input.selectable:focus,.svelte-flow__node-input.selectable:focus-visible,.svelte-flow__node-default.selectable.selected,.svelte-flow__node-default.selectable:focus,.svelte-flow__node-default.selectable:focus-visible,.svelte-flow__node-output.selectable.selected,.svelte-flow__node-output.selectable:focus,.svelte-flow__node-output.selectable:focus-visible,.svelte-flow__node-group.selectable.selected,.svelte-flow__node-group.selectable:focus,.svelte-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.svelte-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.svelte-flow__nodesselection-rect,.svelte-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.svelte-flow__nodesselection-rect:focus,.svelte-flow__nodesselection-rect:focus-visible,.svelte-flow__selection:focus,.svelte-flow__selection:focus-visible{outline:none}.svelte-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.svelte-flow__controls-button:disabled{pointer-events:none}.svelte-flow__controls-button:disabled svg{fill-opacity:.4}.svelte-flow__controls-button:last-child{border-bottom:none}.svelte-flow__resize-control{position:absolute}.svelte-flow__resize-control.left,.svelte-flow__resize-control.right{cursor:ew-resize}.svelte-flow__resize-control.top,.svelte-flow__resize-control.bottom{cursor:ns-resize}.svelte-flow__resize-control.top.left,.svelte-flow__resize-control.bottom.right{cursor:nwse-resize}.svelte-flow__resize-control.bottom.left,.svelte-flow__resize-control.top.right{cursor:nesw-resize}.svelte-flow__resize-control.handle{width:4px;height:4px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));transform:translate(-50%,-50%)}.svelte-flow__resize-control.handle.left{left:0;top:50%}.svelte-flow__resize-control.handle.right{left:100%;top:50%}.svelte-flow__resize-control.handle.top{left:50%;top:0}.svelte-flow__resize-control.handle.bottom{left:50%;top:100%}.svelte-flow__resize-control.handle.top.left,.svelte-flow__resize-control.handle.bottom.left{left:0}.svelte-flow__resize-control.handle.top.right,.svelte-flow__resize-control.handle.bottom.right{left:100%}.svelte-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.svelte-flow__resize-control.line.left,.svelte-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.svelte-flow__resize-control.line.left{left:0;border-left-width:1px}.svelte-flow__resize-control.line.right{left:100%;border-right-width:1px}.svelte-flow__resize-control.line.top,.svelte-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.svelte-flow__resize-control.line.top{top:0;border-top-width:1px}.svelte-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.svelte-flow__edge-label{text-align:center;position:absolute;padding:2px;font-size:10px;cursor:pointer;color:var(--xy-edge-label-color, var(--xy-edge-label-color-default));background:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.svelte-flow__nodes,.svelte-flow__edgelabel-renderer{z-index:0}:root,:root .tf-theme-light{--tf-primary-color: #2563EB;--xy-node-boxshadow-selected: 0 0 0 1px var(--tf-primary-color);--xy-handle-background-color: var(--tf-primary-color)}.tf-btn{display:flex;align-items:center;justify-content:center;gap:2px;background:#fff;border:1px solid #ccc;cursor:pointer;border-radius:5px;padding:5px;margin:0;height:fit-content;width:fit-content}.tf-btn svg{fill:currentColor;width:16px;height:16px}.tf-btn:hover{border:1px solid var(--tf-primary-color)}.tf-input,.tf-textarea{display:flex;border-radius:5px;border:1px solid #ccc;padding:5px 10px;box-sizing:border-box;resize:vertical;outline:none}.tf-input::placeholder,.tf-textarea::placeholder{color:#ccc}.tf-input:focus,.tf-textarea:focus{border-color:var(--tf-primary-color);box-shadow:0 0 5px #51cbee33}.tf-input[disabled],.tf-textarea[disabled]{background-color:#f0f0f0;cursor:not-allowed;color:#aaa}.tf-select-input{display:flex;border:1px solid #ccc;padding:3px 10px;border-radius:5px;font-size:14px;justify-content:space-between;align-items:center;cursor:pointer;background:#fff;height:27px}.tf-select-input:focus{border-color:var(--tf-primary-color);box-shadow:0 0 5px #51cbee33}.tf-select-input-value{height:21px;min-width:10px;font-size:12px;display:flex;align-items:center}.tf-select-input-arrow{display:block;width:16px;height:16px;color:#666}.tf-select-input-placeholder{color:#ccc}.tf-select-content{display:flex;flex-direction:column;background:#fff;margin-top:5px;border:1px solid #ccc;border-radius:5px;padding:5px;width:max-content;min-width:100%;z-index:9999;box-sizing:border-box}.tf-select-content-item{display:flex;align-items:center;padding:5px 10px;border:none;background:#fff;border-radius:5px;cursor:pointer;line-height:100%;gap:2px}.tf-select-content-item span{width:16px;display:flex}.tf-select-content-item svg{width:16px;height:16px;margin:auto}.tf-select-content-item:hover{background:#f0f0f0}.tf-select-content-children{padding-left:14px}.tf-checkbox{width:14px;height:14px}.tf-tabs{display:flex;align-items:center;justify-content:center;gap:5px;padding:5px;border-radius:5px;border:none;background:#f4f4f5}.tf-tabs .tf-tabs-item{flex-grow:1;padding:5px 10px;cursor:pointer;border-radius:5px;display:flex;align-items:center;justify-content:center;font-size:14px;color:#808088}.tf-tabs .tf-tabs-item.active{background:#fff;color:#333;font-weight:500;box-shadow:0 0 5px #00000026}h3.tf-heading{font-weight:700;font-size:14px;margin-top:2px;margin-bottom:3px;color:#333}.tf-collapse{border:none;border-radius:5px}.tf-collapse-item-title{display:flex;align-items:center;cursor:pointer;font-size:14px}.tf-collapse-item-title-icon{display:flex;width:26px;height:26px;color:#2563eb;background:#cedafb;border-radius:5px;padding:3px;justify-content:center;align-items:center;margin-right:10px}.tf-collapse-item-title-icon svg{width:22px;height:22px;color:#3474ff}.tf-collapse-item-title-arrow{display:block;width:16px;height:16px;margin-left:auto}.tf-collapse-item-description{font-size:12px;margin:10px 0;color:#999}.svelte-flow__nodes .svelte-flow__node{border:3px solid transparent;border-radius:5px;box-sizing:border-box}.svelte-flow__nodes .svelte-flow__node .svelte-flow__handle{width:16px;height:16px;background:transparent;display:flex;justify-content:center;align-items:center;border:none}.svelte-flow__nodes .svelte-flow__node .svelte-flow__handle:after{content:" ";background:#2563eb;width:8px;height:8px;border-radius:100%;transition:width .1s,height .1s}.svelte-flow__nodes .svelte-flow__node .svelte-flow__handle:hover:after{width:16px;height:16px}.svelte-flow__nodes .svelte-flow__node div.loop_handle_wrapper:after{content:"循环体";background:#2563eb;width:100px;height:20px;border-radius:0;display:flex;color:#fff;justify-content:center;align-items:center}.svelte-flow__nodes .svelte-flow__node div.loop_handle_wrapper:hover:after{width:100px;height:20px}.svelte-flow__nodes .svelte-flow__node:after{content:" ";position:absolute;border-radius:5px;top:-2px;left:-2px;border:1px solid #ccc;height:calc(100% + 2px);width:calc(100% + 2px)}.svelte-flow__nodes .svelte-flow__node:hover{border:3px solid #bacaef7d}.svelte-flow__nodes .svelte-flow__node.selectable.selected{border:3px solid #bacaef7d;box-shadow:var(--xy-node-boxshadow-selected)}.svelte-flow__nodes .svelte-flow__node:hover:after{display:none}.svelte-flow__nodes .svelte-flow__node.selectable.selected:after{display:none}.tf-node-wrapper{border-radius:5px;min-width:300px;background:#fff}.tf-node-wrapper-title{height:30px;background:#eff1f5;color:#bcbcbc;font-size:12px;display:flex;align-items:center;padding-left:5px;border-bottom:1px solid #ccc;font-weight:300;letter-spacing:1px}.tf-node-wrapper-body{padding:10px}.svelte-flow__attribution a{display:none}.tf-toolbar{position:absolute;top:10px;left:10px;z-index:9999;display:flex;gap:5px;transition:transform .5s ease,opacity .5s ease;transform:translate(-220px)}.tf-toolbar.show{transform:translate(0)}.tf-toolbar-container{background:#fff;border:1px solid #eee;border-radius:5px;box-shadow:0 0 5px #0000001a;padding:10px;width:180px}.tf-toolbar-container-header{display:flex}.tf-toolbar-container-body{display:flex;margin-top:20px}.tf-toolbar-container-body .tf-toolbar-container-base,.tf-toolbar-container-body .tf-toolbar-container-tools{display:flex;flex-direction:column;gap:4px;flex-grow:1}.tf-toolbar-container-body .tf-toolbar-container-base .tf-btn,.tf-toolbar-container-body .tf-toolbar-container-tools .tf-btn{border:none;width:100%;justify-content:flex-start;height:40px;gap:10px;cursor:grabbing;border-radius:5px}.tf-toolbar-container-body .tf-toolbar-container-base .tf-btn svg,.tf-toolbar-container-body .tf-toolbar-container-tools .tf-btn svg{width:20px;height:20px;fill:#2563eb}.tf-toolbar-container-body .tf-toolbar-container-base .tf-btn:hover,.tf-toolbar-container-body .tf-toolbar-container-tools .tf-btn:hover{background:#f1f1f1}.tinyflow-logo:after{content:"Tinyflow.ai";font-size:145px;display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-weight:800;color:#03153b54;text-shadow:1px 3px 6px #cedafb,0 0 0 #000,1px 3px 6px #fff;opacity:.1} diff --git a/packages/ui/dist/index.d.ts b/packages/ui/dist/index.d.ts deleted file mode 100644 index e04e9dc..0000000 --- a/packages/ui/dist/index.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { Edge } from '@xyflow/svelte'; -import { Node as Node_2 } from '@xyflow/svelte'; -import { useSvelteFlow } from '@xyflow/svelte'; -import { Viewport } from '@xyflow/svelte'; - -export declare type Item = { - value: number | string; - label: string; - children?: Item[]; -}; - -export declare class Tinyflow { - private options; - private rootEl; - private svelteFlowInstance; - constructor(options: TinyflowOptions); - private _init; - private _setOptions; - getOptions(): TinyflowOptions; - getData(): { - nodes: Node_2[]; - edges: Edge[]; - viewport: Viewport; - }; - setData(data: TinyflowData): void; - destroy(): void; -} - -export declare type TinyflowData = Partial['toObject']>>; - -export declare type TinyflowOptions = { - element: string | Element; - data?: TinyflowData; - provider?: { - llm?: () => Item[] | Promise; - knowledge?: () => Item[] | Promise; - }; -}; - -export { } diff --git a/packages/ui/dist/index.js b/packages/ui/dist/index.js deleted file mode 100644 index 299f7dc..0000000 --- a/packages/ui/dist/index.js +++ /dev/null @@ -1,16799 +0,0 @@ -var Jd = Object.defineProperty; -var Ea = (e) => { - throw TypeError(e); -}; -var Qd = (e, t, n) => t in e ? Jd(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; -var yt = (e, t, n) => Qd(e, typeof t != "symbol" ? t + "" : t, n), ji = (e, t, n) => t.has(e) || Ea("Cannot " + n); -var st = (e, t, n) => (ji(e, t, "read from private field"), n ? n.call(e) : t.get(e)), nr = (e, t, n) => t.has(e) ? Ea("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Gr = (e, t, n, r) => (ji(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), $a = (e, t, n) => (ji(e, t, "access private method"), n); -const ef = "5"; -var Dl; -typeof window < "u" && ((Dl = window.__svelte ?? (window.__svelte = {})).v ?? (Dl.v = /* @__PURE__ */ new Set())).add(ef); -let Br = !1, tf = !1; -function nf() { - Br = !0; -} -nf(); -const As = 1, Vs = 2, Al = 4, rf = 8, of = 16, sf = 1, af = 2, Vl = 4, lf = 8, uf = 16, Ol = 1, cf = 2, Os = "[", Ls = "[!", Is = "]", _r = {}, Pt = Symbol(), Ll = "http://www.w3.org/2000/svg", Sa = !1, tn = 2, Il = 4, Ei = 8, zs = 16, On = 32, Yr = 64, Qo = 128, Kt = 256, ei = 512, pt = 1024, Ln = 2048, gr = 4096, Nn = 8192, $i = 16384, df = 32768, Zr = 65536, ff = 1 << 17, gf = 1 << 19, zl = 1 << 20, Wn = Symbol("$state"), Rs = Symbol("legacy props"), hf = Symbol(""); -var bo = Array.isArray, vf = Array.prototype.indexOf, Bs = Array.from, ti = Object.keys, io = Object.defineProperty, Tn = Object.getOwnPropertyDescriptor, Rl = Object.getOwnPropertyDescriptors, pf = Object.prototype, mf = Array.prototype, Ys = Object.getPrototypeOf; -function Ur(e) { - return typeof e == "function"; -} -const dt = () => { -}; -function yf(e) { - return e(); -} -function so(e) { - for (var t = 0; t < e.length; t++) - e[t](); -} -const wf = typeof requestIdleCallback > "u" ? (e) => setTimeout(e, 1) : requestIdleCallback; -let ao = [], lo = []; -function Bl() { - var e = ao; - ao = [], so(e); -} -function Yl() { - var e = lo; - lo = [], so(e); -} -function Co(e) { - ao.length === 0 && queueMicrotask(Bl), ao.push(e); -} -function _f(e) { - lo.length === 0 && wf(Yl), lo.push(e); -} -function Pa() { - ao.length > 0 && Bl(), lo.length > 0 && Yl(); -} -function Zl(e) { - return e === this.v; -} -function Zs(e, t) { - return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function"; -} -function Xs(e) { - return !Zs(e, this.v); -} -function xf(e) { - throw new Error("https://svelte.dev/e/effect_in_teardown"); -} -function bf() { - throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); -} -function Cf(e) { - throw new Error("https://svelte.dev/e/effect_orphan"); -} -function kf() { - throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); -} -function Ef() { - throw new Error("https://svelte.dev/e/hydration_failed"); -} -function $f(e) { - throw new Error("https://svelte.dev/e/props_invalid_value"); -} -function Sf() { - throw new Error("https://svelte.dev/e/state_descriptors_fixed"); -} -function Pf() { - throw new Error("https://svelte.dev/e/state_prototype_fixed"); -} -function Nf() { - throw new Error("https://svelte.dev/e/state_unsafe_local_read"); -} -function Tf() { - throw new Error("https://svelte.dev/e/state_unsafe_mutation"); -} -function Tt(e, t) { - var n = { - f: 0, - // TODO ideally we could skip this altogether, but it causes type errors - v: e, - reactions: null, - equals: Zl, - rv: 0, - wv: 0 - }; - return n; -} -function sr(e) { - return /* @__PURE__ */ Xl(Tt(e)); -} -// @__NO_SIDE_EFFECTS__ -function ko(e, t = !1) { - var r; - const n = Tt(e); - return t || (n.equals = Xs), Br && Be !== null && Be.l !== null && ((r = Be.l).s ?? (r.s = [])).push(n), n; -} -function te(e, t = !1) { - return /* @__PURE__ */ Xl(/* @__PURE__ */ ko(e, t)); -} -// @__NO_SIDE_EFFECTS__ -function Xl(e) { - return Ue !== null && !Qt && Ue.f & tn && (dn === null ? Df([e]) : dn.push(e)), e; -} -function G(e, t) { - return Ue !== null && !Qt && Hi() && Ue.f & (tn | zs) && // If the source was created locally within the current derived, then - // we allow the mutation. - (dn === null || !dn.includes(e)) && Tf(), cs(e, t); -} -function cs(e, t) { - return e.equals(t) || (e.v, e.v = t, e.wv = Jl(), Wl(e, Ln), Hi() && Fe !== null && Fe.f & pt && !(Fe.f & (On | Yr)) && (En === null ? Af([e]) : En.push(e))), t; -} -function Na(e, t = 1) { - var n = h(e), r = t === 1 ? n++ : n--; - return G(e, n), r; -} -function Wl(e, t) { - var n = e.reactions; - if (n !== null) - for (var r = Hi(), o = n.length, i = 0; i < o; i++) { - var s = n[i], a = s.f; - a & Ln || !r && s === Fe || (nn(s, t), a & (pt | Kt) && (a & tn ? Wl( - /** @type {Derived} */ - s, - gr - ) : Ti( - /** @type {Effect} */ - s - ))); - } -} -// @__NO_SIDE_EFFECTS__ -function Me(e) { - var t = tn | Ln, n = Ue !== null && Ue.f & tn ? ( - /** @type {Derived} */ - Ue - ) : null; - return Fe === null || n !== null && n.f & Kt ? t |= Kt : Fe.f |= zl, { - ctx: Be, - deps: null, - effects: null, - equals: Zl, - f: t, - fn: e, - reactions: null, - rv: 0, - v: ( - /** @type {V} */ - null - ), - wv: 0, - parent: n ?? Fe - }; -} -// @__NO_SIDE_EFFECTS__ -function pe(e) { - const t = /* @__PURE__ */ Me(e); - return t.equals = Xs, t; -} -function Fl(e) { - var t = e.effects; - if (t !== null) { - e.effects = null; - for (var n = 0; n < t.length; n += 1) - qt( - /** @type {Effect} */ - t[n] - ); - } -} -function Mf(e) { - for (var t = e.parent; t !== null; ) { - if (!(t.f & tn)) - return ( - /** @type {Effect} */ - t - ); - t = t.parent; - } - return null; -} -function Hf(e) { - var t, n = Fe; - Un(Mf(e)); - try { - Fl(e), t = eu(e); - } finally { - Un(n); - } - return t; -} -function Kl(e) { - var t = Hf(e), n = (Zn || e.f & Kt) && e.deps !== null ? gr : pt; - nn(e, n), e.equals(t) || (e.v = t, e.wv = Jl()); -} -function Si(e) { - console.warn("https://svelte.dev/e/hydration_mismatch"); -} -let Se = !1; -function Lt(e) { - Se = e; -} -let De; -function bt(e) { - if (e === null) - throw Si(), _r; - return De = e; -} -function hn() { - return bt( - /** @type {TemplateNode} */ - /* @__PURE__ */ yn(De) - ); -} -function Z(e) { - if (Se) { - if (/* @__PURE__ */ yn(De) !== null) - throw Si(), _r; - De = e; - } -} -function Te(e = 1) { - if (Se) { - for (var t = e, n = De; t--; ) - n = /** @type {TemplateNode} */ - /* @__PURE__ */ yn(n); - De = n; - } -} -function ds() { - for (var e = 0, t = De; ; ) { - if (t.nodeType === 8) { - var n = ( - /** @type {Comment} */ - t.data - ); - if (n === Is) { - if (e === 0) return t; - e -= 1; - } else (n === Os || n === Ls) && (e += 1); - } - var r = ( - /** @type {TemplateNode} */ - /* @__PURE__ */ yn(t) - ); - t.remove(), t = r; - } -} -function Vt(e, t = null, n) { - if (typeof e != "object" || e === null || Wn in e) - return e; - const r = Ys(e); - if (r !== pf && r !== mf) - return e; - var o = /* @__PURE__ */ new Map(), i = bo(e), s = Tt(0); - i && o.set("length", Tt( - /** @type {any[]} */ - e.length - )); - var a; - return new Proxy( - /** @type {any} */ - e, - { - defineProperty(l, u, c) { - (!("value" in c) || c.configurable === !1 || c.enumerable === !1 || c.writable === !1) && Sf(); - var f = o.get(u); - return f === void 0 ? (f = Tt(c.value), o.set(u, f)) : G(f, Vt(c.value, a)), !0; - }, - deleteProperty(l, u) { - var c = o.get(u); - if (c === void 0) - u in l && o.set(u, Tt(Pt)); - else { - if (i && typeof u == "string") { - var f = ( - /** @type {Source} */ - o.get("length") - ), d = Number(u); - Number.isInteger(d) && d < f.v && G(f, d); - } - G(c, Pt), Ta(s); - } - return !0; - }, - get(l, u, c) { - var p; - if (u === Wn) - return e; - var f = o.get(u), d = u in l; - if (f === void 0 && (!d || (p = Tn(l, u)) != null && p.writable) && (f = Tt(Vt(d ? l[u] : Pt, a)), o.set(u, f)), f !== void 0) { - var g = h(f); - return g === Pt ? void 0 : g; - } - return Reflect.get(l, u, c); - }, - getOwnPropertyDescriptor(l, u) { - var c = Reflect.getOwnPropertyDescriptor(l, u); - if (c && "value" in c) { - var f = o.get(u); - f && (c.value = h(f)); - } else if (c === void 0) { - var d = o.get(u), g = d == null ? void 0 : d.v; - if (d !== void 0 && g !== Pt) - return { - enumerable: !0, - configurable: !0, - value: g, - writable: !0 - }; - } - return c; - }, - has(l, u) { - var g; - if (u === Wn) - return !0; - var c = o.get(u), f = c !== void 0 && c.v !== Pt || Reflect.has(l, u); - if (c !== void 0 || Fe !== null && (!f || (g = Tn(l, u)) != null && g.writable)) { - c === void 0 && (c = Tt(f ? Vt(l[u], a) : Pt), o.set(u, c)); - var d = h(c); - if (d === Pt) - return !1; - } - return f; - }, - set(l, u, c, f) { - var _; - var d = o.get(u), g = u in l; - if (i && u === "length") - for (var p = c; p < /** @type {Source} */ - d.v; p += 1) { - var x = o.get(p + ""); - x !== void 0 ? G(x, Pt) : p in l && (x = Tt(Pt), o.set(p + "", x)); - } - d === void 0 ? (!g || (_ = Tn(l, u)) != null && _.writable) && (d = Tt(void 0), G(d, Vt(c, a)), o.set(u, d)) : (g = d.v !== Pt, G(d, Vt(c, a))); - var k = Reflect.getOwnPropertyDescriptor(l, u); - if (k != null && k.set && k.set.call(f, c), !g) { - if (i && typeof u == "string") { - var E = ( - /** @type {Source} */ - o.get("length") - ), m = Number(u); - Number.isInteger(m) && m >= E.v && G(E, m + 1); - } - Ta(s); - } - return !0; - }, - ownKeys(l) { - h(s); - var u = Reflect.ownKeys(l).filter((d) => { - var g = o.get(d); - return g === void 0 || g.v !== Pt; - }); - for (var [c, f] of o) - f.v !== Pt && !(c in l) && u.push(c); - return u; - }, - setPrototypeOf() { - Pf(); - } - } - ); -} -function Ta(e, t = 1) { - G(e, e.v + t); -} -var Nt, ql, Gl, Ul; -function fs() { - if (Nt === void 0) { - Nt = window, ql = /Firefox/.test(navigator.userAgent); - var e = Element.prototype, t = Node.prototype; - Gl = Tn(t, "firstChild").get, Ul = Tn(t, "nextSibling").get, e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__styles = null, e.__e = void 0, Text.prototype.__t = void 0; - } -} -function Hn(e = "") { - return document.createTextNode(e); -} -// @__NO_SIDE_EFFECTS__ -function xt(e) { - return Gl.call(e); -} -// @__NO_SIDE_EFFECTS__ -function yn(e) { - return Ul.call(e); -} -function X(e, t) { - if (!Se) - return /* @__PURE__ */ xt(e); - var n = ( - /** @type {TemplateNode} */ - /* @__PURE__ */ xt(De) - ); - if (n === null) - n = De.appendChild(Hn()); - else if (t && n.nodeType !== 3) { - var r = Hn(); - return n == null || n.before(r), bt(r), r; - } - return bt(n), n; -} -function _e(e, t) { - if (!Se) { - var n = ( - /** @type {DocumentFragment} */ - /* @__PURE__ */ xt( - /** @type {Node} */ - e - ) - ); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ yn(n) : n; - } - return De; -} -function R(e, t = 1, n = !1) { - let r = Se ? De : e; - for (var o; t--; ) - o = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ yn(r); - if (!Se) - return r; - var i = r == null ? void 0 : r.nodeType; - if (n && i !== 3) { - var s = Hn(); - return r === null ? o == null || o.after(s) : r.before(s), bt(s), s; - } - return bt(r), /** @type {TemplateNode} */ - r; -} -function Ws(e) { - e.textContent = ""; -} -let Fo = !1, ni = !1, ri = null, or = !1, Fs = !1; -function Ma(e) { - Fs = e; -} -let oo = []; -let Ue = null, Qt = !1; -function Gn(e) { - Ue = e; -} -let Fe = null; -function Un(e) { - Fe = e; -} -let dn = null; -function Df(e) { - dn = e; -} -let wt = null, At = 0, En = null; -function Af(e) { - En = e; -} -let jl = 1, oi = 0, Zn = !1; -function Jl() { - return ++jl; -} -function Xr(e) { - var f; - var t = e.f; - if (t & Ln) - return !0; - if (t & gr) { - var n = e.deps, r = (t & Kt) !== 0; - if (n !== null) { - var o, i, s = (t & ei) !== 0, a = r && Fe !== null && !Zn, l = n.length; - if (s || a) { - var u = ( - /** @type {Derived} */ - e - ), c = u.parent; - for (o = 0; o < l; o++) - i = n[o], (s || !((f = i == null ? void 0 : i.reactions) != null && f.includes(u))) && (i.reactions ?? (i.reactions = [])).push(u); - s && (u.f ^= ei), a && c !== null && !(c.f & Kt) && (u.f ^= Kt); - } - for (o = 0; o < l; o++) - if (i = n[o], Xr( - /** @type {Derived} */ - i - ) && Kl( - /** @type {Derived} */ - i - ), i.wv > e.wv) - return !0; - } - (!r || Fe !== null && !Zn) && nn(e, pt); - } - return !1; -} -function Vf(e, t) { - for (var n = t; n !== null; ) { - if (n.f & Qo) - try { - n.fn(e); - return; - } catch { - n.f ^= Qo; - } - n = n.parent; - } - throw Fo = !1, e; -} -function Of(e) { - return (e.f & $i) === 0 && (e.parent === null || (e.parent.f & Qo) === 0); -} -function Pi(e, t, n, r) { - if (Fo) { - if (n === null && (Fo = !1), Of(t)) - throw e; - return; - } - n !== null && (Fo = !0); - { - Vf(e, t); - return; - } -} -function Ql(e, t, n = !0) { - var r = e.reactions; - if (r !== null) - for (var o = 0; o < r.length; o++) { - var i = r[o]; - i.f & tn ? Ql( - /** @type {Derived} */ - i, - t, - !1 - ) : t === i && (n ? nn(i, Ln) : i.f & pt && nn(i, gr), Ti( - /** @type {Effect} */ - i - )); - } -} -function eu(e) { - var g; - var t = wt, n = At, r = En, o = Ue, i = Zn, s = dn, a = Be, l = Qt, u = e.f; - wt = /** @type {null | Value[]} */ - null, At = 0, En = null, Zn = (u & Kt) !== 0 && (Qt || !or || Ue === null), Ue = u & (On | Yr) ? null : e, dn = null, Ha(e.ctx), Qt = !1, oi++; - try { - var c = ( - /** @type {Function} */ - (0, e.fn)() - ), f = e.deps; - if (wt !== null) { - var d; - if (ii(e, At), f !== null && At > 0) - for (f.length = At + wt.length, d = 0; d < wt.length; d++) - f[At + d] = wt[d]; - else - e.deps = f = wt; - if (!Zn) - for (d = At; d < f.length; d++) - ((g = f[d]).reactions ?? (g.reactions = [])).push(e); - } else f !== null && At < f.length && (ii(e, At), f.length = At); - if (Hi() && En !== null && !Qt && f !== null && !(e.f & (tn | gr | Ln))) - for (d = 0; d < /** @type {Source[]} */ - En.length; d++) - Ql( - En[d], - /** @type {Effect} */ - e - ); - return o !== null && oi++, c; - } finally { - wt = t, At = n, En = r, Ue = o, Zn = i, dn = s, Ha(a), Qt = l; - } -} -function Lf(e, t) { - let n = t.reactions; - if (n !== null) { - var r = vf.call(n, e); - if (r !== -1) { - var o = n.length - 1; - o === 0 ? n = t.reactions = null : (n[r] = n[o], n.pop()); - } - } - n === null && t.f & tn && // Destroying a child effect while updating a parent effect can cause a dependency to appear - // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps` - // allows us to skip the expensive work of disconnecting and immediately reconnecting it - (wt === null || !wt.includes(t)) && (nn(t, gr), t.f & (Kt | ei) || (t.f ^= ei), Fl( - /** @type {Derived} **/ - t - ), ii( - /** @type {Derived} **/ - t, - 0 - )); -} -function ii(e, t) { - var n = e.deps; - if (n !== null) - for (var r = t; r < n.length; r++) - Lf(e, n[r]); -} -function Ni(e) { - var t = e.f; - if (!(t & $i)) { - nn(e, pt); - var n = Fe, r = Be, o = or; - Fe = e, or = !0; - try { - t & zs ? Ff(e) : iu(e), ou(e); - var i = eu(e); - e.teardown = typeof i == "function" ? i : null, e.wv = jl; - var s = e.deps, a; - Sa && tf && e.f & Ln; - } catch (l) { - Pi(l, e, n, r || e.ctx); - } finally { - or = o, Fe = n; - } - } -} -function If() { - try { - kf(); - } catch (e) { - if (ri !== null) - Pi(e, ri, null); - else - throw e; - } -} -function tu() { - var e = or; - try { - var t = 0; - for (or = !0; oo.length > 0; ) { - t++ > 1e3 && If(); - var n = oo, r = n.length; - oo = []; - for (var o = 0; o < r; o++) { - var i = n[o]; - i.f & pt || (i.f ^= pt); - var s = Rf(i); - zf(s); - } - } - } finally { - ni = !1, or = e, ri = null; - } -} -function zf(e) { - var t = e.length; - if (t !== 0) - for (var n = 0; n < t; n++) { - var r = e[n]; - if (!(r.f & ($i | Nn))) - try { - Xr(r) && (Ni(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null ? su(r) : r.fn = null)); - } catch (o) { - Pi(o, r, null, r.ctx); - } - } -} -function Ti(e) { - ni || (ni = !0, queueMicrotask(tu)); - for (var t = ri = e; t.parent !== null; ) { - t = t.parent; - var n = t.f; - if (n & (Yr | On)) { - if (!(n & pt)) return; - t.f ^= pt; - } - } - oo.push(t); -} -function Rf(e) { - for (var t = [], n = e.first; n !== null; ) { - var r = n.f, o = (r & On) !== 0, i = o && (r & pt) !== 0; - if (!i && !(r & Nn)) { - if (r & Il) - t.push(n); - else if (o) - n.f ^= pt; - else { - var s = Ue; - try { - Ue = n, Xr(n) && Ni(n); - } catch (u) { - Pi(u, n, null, n.ctx); - } finally { - Ue = s; - } - } - var a = n.first; - if (a !== null) { - n = a; - continue; - } - } - var l = n.parent; - for (n = n.next; n === null && l !== null; ) - n = l.next, l = l.parent; - } - return t; -} -function y(e) { - var t; - for (Pa(); oo.length > 0; ) - ni = !0, tu(), Pa(); - return ( - /** @type {T} */ - t - ); -} -function h(e) { - var t = e.f, n = (t & tn) !== 0; - if (Ue !== null && !Qt) { - dn !== null && dn.includes(e) && Nf(); - var r = Ue.deps; - e.rv < oi && (e.rv = oi, wt === null && r !== null && r[At] === e ? At++ : wt === null ? wt = [e] : (!Zn || !wt.includes(e)) && wt.push(e)); - } else if (n && /** @type {Derived} */ - e.deps === null && /** @type {Derived} */ - e.effects === null) { - var o = ( - /** @type {Derived} */ - e - ), i = o.parent; - i !== null && !(i.f & Kt) && (o.f ^= Kt); - } - return n && (o = /** @type {Derived} */ - e, Xr(o) && Kl(o)), e.v; -} -function vn(e) { - var t = Qt; - try { - return Qt = !0, e(); - } finally { - Qt = t; - } -} -const Bf = -7169; -function nn(e, t) { - e.f = e.f & Bf | t; -} -function U(e) { - if (!(typeof e != "object" || !e || e instanceof EventTarget)) { - if (Wn in e) - gs(e); - else if (!Array.isArray(e)) - for (let t in e) { - const n = e[t]; - typeof n == "object" && n && Wn in n && gs(n); - } - } -} -function gs(e, t = /* @__PURE__ */ new Set()) { - if (typeof e == "object" && e !== null && // We don't want to traverse DOM elements - !(e instanceof EventTarget) && !t.has(e)) { - t.add(e), e instanceof Date && e.getTime(); - for (let r in e) - try { - gs(e[r], t); - } catch { - } - const n = Ys(e); - if (n !== Object.prototype && n !== Array.prototype && n !== Map.prototype && n !== Set.prototype && n !== Date.prototype) { - const r = Rl(n); - for (let o in r) { - const i = r[o].get; - if (i) - try { - i.call(e); - } catch { - } - } - } - } -} -function nu(e) { - Fe === null && Ue === null && Cf(), Ue !== null && Ue.f & Kt && Fe === null && bf(), Fs && xf(); -} -function Yf(e, t) { - var n = t.last; - n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e); -} -function hr(e, t, n, r = !0) { - var o = (e & Yr) !== 0, i = Fe, s = { - ctx: Be, - deps: null, - nodes_start: null, - nodes_end: null, - f: e | Ln, - first: null, - fn: t, - last: null, - next: null, - parent: o ? null : i, - prev: null, - teardown: null, - transitions: null, - wv: 0 - }; - if (n) - try { - Ni(s), s.f |= df; - } catch (u) { - throw qt(s), u; - } - else t !== null && Ti(s); - var a = n && s.deps === null && s.first === null && s.nodes_start === null && s.teardown === null && (s.f & (zl | Qo)) === 0; - if (!a && !o && r && (i !== null && Yf(s, i), Ue !== null && Ue.f & tn)) { - var l = ( - /** @type {Derived} */ - Ue - ); - (l.effects ?? (l.effects = [])).push(s); - } - return s; -} -function ru(e) { - const t = hr(Ei, null, !1); - return nn(t, pt), t.teardown = e, t; -} -function Nr(e) { - nu(); - var t = Fe !== null && (Fe.f & On) !== 0 && Be !== null && !Be.m; - if (t) { - var n = ( - /** @type {ComponentContext} */ - Be - ); - (n.e ?? (n.e = [])).push({ - fn: e, - effect: Fe, - reaction: Ue - }); - } else { - var r = Ot(e); - return r; - } -} -function Zf(e) { - return nu(), Wr(e); -} -function Xf(e) { - const t = hr(Yr, e, !0); - return () => { - qt(t); - }; -} -function Wf(e) { - const t = hr(Yr, e, !0); - return (n = {}) => new Promise((r) => { - n.outro ? Tr(t, () => { - qt(t), r(void 0); - }) : (qt(t), r(void 0)); - }); -} -function Ot(e) { - return hr(Il, e, !1); -} -function le(e, t) { - var n = ( - /** @type {ComponentContextLegacy} */ - Be - ), r = { effect: null, ran: !1 }; - n.l.r1.push(r), r.effect = Wr(() => { - e(), !r.ran && (r.ran = !0, G(n.l.r2, !0), vn(t)); - }); -} -function gt() { - var e = ( - /** @type {ComponentContextLegacy} */ - Be - ); - Wr(() => { - if (h(e.l.r2)) { - for (var t of e.l.r1) { - var n = t.effect; - n.f & pt && nn(n, gr), Xr(n) && Ni(n), t.ran = !1; - } - e.l.r2.v = !1; - } - }); -} -function Wr(e) { - return hr(Ei, e, !0); -} -function $e(e, t = [], n = Me) { - const r = t.map(n); - return vr(() => e(...r.map(h))); -} -function vr(e, t = 0) { - return hr(Ei | zs | t, e, !0); -} -function Dn(e, t = !0) { - return hr(Ei | On, e, !0, t); -} -function ou(e) { - var t = e.teardown; - if (t !== null) { - const n = Fs, r = Ue; - Ma(!0), Gn(null); - try { - t.call(null); - } finally { - Ma(n), Gn(r); - } - } -} -function iu(e, t = !1) { - var n = e.first; - for (e.first = e.last = null; n !== null; ) { - var r = n.next; - qt(n, t), n = r; - } -} -function Ff(e) { - for (var t = e.first; t !== null; ) { - var n = t.next; - t.f & On || qt(t), t = n; - } -} -function qt(e, t = !0) { - var n = !1; - if ((t || e.f & gf) && e.nodes_start !== null) { - for (var r = e.nodes_start, o = e.nodes_end; r !== null; ) { - var i = r === o ? null : ( - /** @type {TemplateNode} */ - /* @__PURE__ */ yn(r) - ); - r.remove(), r = i; - } - n = !0; - } - iu(e, t && !n), ii(e, 0), nn(e, $i); - var s = e.transitions; - if (s !== null) - for (const l of s) - l.stop(); - ou(e); - var a = e.parent; - a !== null && a.first !== null && su(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes_start = e.nodes_end = null; -} -function su(e) { - var t = e.parent, n = e.prev, r = e.next; - n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e && (t.first = r), t.last === e && (t.last = n)); -} -function Tr(e, t) { - var n = []; - Ks(e, n, !0), au(n, () => { - qt(e), t && t(); - }); -} -function au(e, t) { - var n = e.length; - if (n > 0) { - var r = () => --n || t(); - for (var o of e) - o.out(r); - } else - t(); -} -function Ks(e, t, n) { - if (!(e.f & Nn)) { - if (e.f ^= Nn, e.transitions !== null) - for (const s of e.transitions) - (s.is_global || n) && t.push(s); - for (var r = e.first; r !== null; ) { - var o = r.next, i = (r.f & Zr) !== 0 || (r.f & On) !== 0; - Ks(r, t, i ? n : !1), r = o; - } - } -} -function uo(e) { - lu(e, !0); -} -function lu(e, t) { - if (e.f & Nn) { - e.f ^= Nn, e.f & pt || (e.f ^= pt), Xr(e) && (nn(e, Ln), Ti(e)); - for (var n = e.first; n !== null; ) { - var r = n.next, o = (n.f & Zr) !== 0 || (n.f & On) !== 0; - lu(n, o ? t : !1), n = r; - } - if (e.transitions !== null) - for (const i of e.transitions) - (i.is_global || t) && i.in(); - } -} -function Mi(e) { - throw new Error("https://svelte.dev/e/lifecycle_outside_component"); -} -let Be = null; -function Ha(e) { - Be = e; -} -function ar(e) { - return ( - /** @type {T} */ - qs().get(e) - ); -} -function Mr(e, t) { - return qs().set(e, t), t; -} -function Kf(e) { - return qs().has(e); -} -function ue(e, t = !1, n) { - Be = { - p: Be, - c: null, - e: null, - m: !1, - s: e, - x: null, - l: null - }, Br && !t && (Be.l = { - s: null, - u: null, - r1: [], - r2: Tt(!1) - }); -} -function ce(e) { - const t = Be; - if (t !== null) { - e !== void 0 && (t.x = e); - const s = t.e; - if (s !== null) { - var n = Fe, r = Ue; - t.e = null; - try { - for (var o = 0; o < s.length; o++) { - var i = s[o]; - Un(i.effect), Gn(i.reaction), Ot(i.fn); - } - } finally { - Un(n), Gn(r); - } - } - Be = t.p, t.m = !0; - } - return e || /** @type {T} */ - {}; -} -function Hi() { - return !Br || Be !== null && Be.l === null; -} -function qs(e) { - return Be === null && Mi(), Be.c ?? (Be.c = new Map(qf(Be) || void 0)); -} -function qf(e) { - let t = e.p; - for (; t !== null; ) { - const n = t.c; - if (n !== null) - return n; - t = t.p; - } - return null; -} -function Gf(e) { - return e.endsWith("capture") && e !== "gotpointercapture" && e !== "lostpointercapture"; -} -const Uf = [ - "beforeinput", - "click", - "change", - "dblclick", - "contextmenu", - "focusin", - "focusout", - "input", - "keydown", - "keyup", - "mousedown", - "mousemove", - "mouseout", - "mouseover", - "mouseup", - "pointerdown", - "pointermove", - "pointerout", - "pointerover", - "pointerup", - "touchend", - "touchmove", - "touchstart" -]; -function jf(e) { - return Uf.includes(e); -} -const Jf = { - // no `class: 'className'` because we handle that separately - formnovalidate: "formNoValidate", - ismap: "isMap", - nomodule: "noModule", - playsinline: "playsInline", - readonly: "readOnly", - defaultvalue: "defaultValue", - defaultchecked: "defaultChecked", - srcobject: "srcObject", - novalidate: "noValidate", - allowfullscreen: "allowFullscreen", - disablepictureinpicture: "disablePictureInPicture", - disableremoteplayback: "disableRemotePlayback" -}; -function Qf(e) { - return e = e.toLowerCase(), Jf[e] ?? e; -} -const e1 = ["touchstart", "touchmove"]; -function t1(e) { - return e1.includes(e); -} -const n1 = ( - /** @type {const} */ - ["textarea", "script", "style", "title"] -); -function r1(e) { - return n1.includes( - /** @type {RAW_TEXT_ELEMENTS[number]} */ - e - ); -} -function o1(e, t) { - if (t) { - const n = document.body; - e.autofocus = !0, Co(() => { - document.activeElement === n && e.focus(); - }); - } -} -function i1(e) { - Se && /* @__PURE__ */ xt(e) !== null && Ws(e); -} -let Da = !1; -function s1() { - Da || (Da = !0, document.addEventListener( - "reset", - (e) => { - Promise.resolve().then(() => { - var t; - if (!e.defaultPrevented) - for ( - const n of - /**@type {HTMLFormElement} */ - e.target.elements - ) - (t = n.__on_r) == null || t.call(n); - }); - }, - // In the capture phase to guarantee we get noticed of it (no possiblity of stopPropagation) - { capture: !0 } - )); -} -function a1(e) { - var t = Ue, n = Fe; - Gn(null), Un(null); - try { - return e(); - } finally { - Gn(t), Un(n); - } -} -const uu = /* @__PURE__ */ new Set(), hs = /* @__PURE__ */ new Set(); -function cu(e, t, n, r = {}) { - function o(i) { - if (r.capture || eo.call(t, i), !i.cancelBubble) - return a1(() => n == null ? void 0 : n.call(this, i)); - } - return e.startsWith("pointer") || e.startsWith("touch") || e === "wheel" ? Co(() => { - t.addEventListener(e, o, r); - }) : t.addEventListener(e, o, r), o; -} -function Qe(e, t, n, r, o) { - var i = { capture: r, passive: o }, s = cu(e, t, n, i); - (t === document.body || t === window || t === document) && ru(() => { - t.removeEventListener(e, s, i); - }); -} -function Di(e) { - for (var t = 0; t < e.length; t++) - uu.add(e[t]); - for (var n of hs) - n(e); -} -function eo(e) { - var m; - var t = this, n = ( - /** @type {Node} */ - t.ownerDocument - ), r = e.type, o = ((m = e.composedPath) == null ? void 0 : m.call(e)) || [], i = ( - /** @type {null | Element} */ - o[0] || e.target - ), s = 0, a = e.__root; - if (a) { - var l = o.indexOf(a); - if (l !== -1 && (t === document || t === /** @type {any} */ - window)) { - e.__root = t; - return; - } - var u = o.indexOf(t); - if (u === -1) - return; - l <= u && (s = l); - } - if (i = /** @type {Element} */ - o[s] || e.target, i !== t) { - io(e, "currentTarget", { - configurable: !0, - get() { - return i || n; - } - }); - var c = Ue, f = Fe; - Gn(null), Un(null); - try { - for (var d, g = []; i !== null; ) { - var p = i.assignedSlot || i.parentNode || /** @type {any} */ - i.host || null; - try { - var x = i["__" + r]; - if (x !== void 0 && (!/** @type {any} */ - i.disabled || // DOM could've been updated already by the time this is reached, so we check this as well - // -> the target could not have been disabled because it emits the event in the first place - e.target === i)) - if (bo(x)) { - var [k, ...E] = x; - k.apply(i, [e, ...E]); - } else - x.call(i, e); - } catch (_) { - d ? g.push(_) : d = _; - } - if (e.cancelBubble || p === t || p === null) - break; - i = p; - } - if (d) { - for (let _ of g) - queueMicrotask(() => { - throw _; - }); - throw d; - } - } finally { - e.__root = t, delete e.currentTarget, Gn(c), Un(f); - } - } -} -function Gs(e) { - var t = document.createElement("template"); - return t.innerHTML = e, t.content; -} -function Ht(e, t) { - var n = ( - /** @type {Effect} */ - Fe - ); - n.nodes_start === null && (n.nodes_start = e, n.nodes_end = t); -} -// @__NO_SIDE_EFFECTS__ -function ne(e, t) { - var n = (t & Ol) !== 0, r = (t & cf) !== 0, o, i = !e.startsWith(""); - return () => { - if (Se) - return Ht(De, null), De; - o === void 0 && (o = Gs(i ? e : "" + e), n || (o = /** @type {Node} */ - /* @__PURE__ */ xt(o))); - var s = ( - /** @type {TemplateNode} */ - r || ql ? document.importNode(o, !0) : o.cloneNode(!0) - ); - if (n) { - var a = ( - /** @type {TemplateNode} */ - /* @__PURE__ */ xt(s) - ), l = ( - /** @type {TemplateNode} */ - s.lastChild - ); - Ht(a, l); - } else - Ht(s, s); - return s; - }; -} -// @__NO_SIDE_EFFECTS__ -function xe(e, t, n = "svg") { - var r = !e.startsWith(""), o = (t & Ol) !== 0, i = `<${n}>${r ? e : "" + e}`, s; - return () => { - if (Se) - return Ht(De, null), De; - if (!s) { - var a = ( - /** @type {DocumentFragment} */ - Gs(i) - ), l = ( - /** @type {Element} */ - /* @__PURE__ */ xt(a) - ); - if (o) - for (s = document.createDocumentFragment(); /* @__PURE__ */ xt(l); ) - s.appendChild( - /** @type {Node} */ - /* @__PURE__ */ xt(l) - ); - else - s = /** @type {Element} */ - /* @__PURE__ */ xt(l); - } - var u = ( - /** @type {TemplateNode} */ - s.cloneNode(!0) - ); - if (o) { - var c = ( - /** @type {TemplateNode} */ - /* @__PURE__ */ xt(u) - ), f = ( - /** @type {TemplateNode} */ - u.lastChild - ); - Ht(c, f); - } else - Ht(u, u); - return u; - }; -} -function Ie(e = "") { - if (!Se) { - var t = Hn(e + ""); - return Ht(t, t), t; - } - var n = De; - return n.nodeType !== 3 && (n.before(n = Hn()), bt(n)), Ht(n, n), n; -} -function et() { - if (Se) - return Ht(De, null), De; - var e = document.createDocumentFragment(), t = document.createComment(""), n = Hn(); - return e.append(t, n), Ht(t, n), e; -} -function L(e, t) { - if (Se) { - Fe.nodes_end = De, hn(); - return; - } - e !== null && e.before( - /** @type {Node} */ - t - ); -} -function wn(e, t) { - var n = t == null ? "" : typeof t == "object" ? t + "" : t; - n !== (e.__t ?? (e.__t = e.nodeValue)) && (e.__t = n, e.nodeValue = n + ""); -} -function du(e, t) { - return fu(e, t); -} -function l1(e, t) { - fs(), t.intro = t.intro ?? !1; - const n = t.target, r = Se, o = De; - try { - for (var i = ( - /** @type {TemplateNode} */ - /* @__PURE__ */ xt(n) - ); i && (i.nodeType !== 8 || /** @type {Comment} */ - i.data !== Os); ) - i = /** @type {TemplateNode} */ - /* @__PURE__ */ yn(i); - if (!i) - throw _r; - Lt(!0), bt( - /** @type {Comment} */ - i - ), hn(); - const s = fu(e, { ...t, anchor: i }); - if (De === null || De.nodeType !== 8 || /** @type {Comment} */ - De.data !== Is) - throw Si(), _r; - return Lt(!1), /** @type {Exports} */ - s; - } catch (s) { - if (s === _r) - return t.recover === !1 && Ef(), fs(), Ws(n), Lt(!1), du(e, t); - throw s; - } finally { - Lt(r), bt(o); - } -} -const mr = /* @__PURE__ */ new Map(); -function fu(e, { target: t, anchor: n, props: r = {}, events: o, context: i, intro: s = !0 }) { - fs(); - var a = /* @__PURE__ */ new Set(), l = (f) => { - for (var d = 0; d < f.length; d++) { - var g = f[d]; - if (!a.has(g)) { - a.add(g); - var p = t1(g); - t.addEventListener(g, eo, { passive: p }); - var x = mr.get(g); - x === void 0 ? (document.addEventListener(g, eo, { passive: p }), mr.set(g, 1)) : mr.set(g, x + 1); - } - } - }; - l(Bs(uu)), hs.add(l); - var u = void 0, c = Wf(() => { - var f = n ?? t.appendChild(Hn()); - return Dn(() => { - if (i) { - ue({}); - var d = ( - /** @type {ComponentContext} */ - Be - ); - d.c = i; - } - o && (r.$$events = o), Se && Ht( - /** @type {TemplateNode} */ - f, - null - ), u = e(f, r) || {}, Se && (Fe.nodes_end = De), i && ce(); - }), () => { - var p; - for (var d of a) { - t.removeEventListener(d, eo); - var g = ( - /** @type {number} */ - mr.get(d) - ); - --g === 0 ? (document.removeEventListener(d, eo), mr.delete(d)) : mr.set(d, g); - } - hs.delete(l), f !== n && ((p = f.parentNode) == null || p.removeChild(f)); - }; - }); - return vs.set(u, c), u; -} -let vs = /* @__PURE__ */ new WeakMap(); -function u1(e, t) { - const n = vs.get(e); - return n ? (vs.delete(e), n(t)) : Promise.resolve(); -} -function be(e, t, [n, r] = [0, 0]) { - Se && n === 0 && hn(); - var o = e, i = null, s = null, a = Pt, l = n > 0 ? Zr : 0, u = !1; - const c = (d, g = !0) => { - u = !0, f(g, d); - }, f = (d, g) => { - if (a === (a = d)) return; - let p = !1; - if (Se && r !== -1) { - if (n === 0) { - const k = ( - /** @type {Comment} */ - o.data - ); - k === Os ? r = 0 : k === Ls ? r = 1 / 0 : (r = parseInt(k.substring(1)), r !== r && (r = a ? 1 / 0 : -1)); - } - const x = r > n; - !!a === x && (o = ds(), bt(o), Lt(!1), p = !0, r = -1); - } - a ? (i ? uo(i) : g && (i = Dn(() => g(o))), s && Tr(s, () => { - s = null; - })) : (s ? uo(s) : g && (s = Dn(() => g(o, [n + 1, r]))), i && Tr(i, () => { - i = null; - })), p && Lt(!0); - }; - vr(() => { - u = !1, t(c), u || f(null, null); - }, l), Se && (o = De); -} -function Ai(e, t) { - return t; -} -function c1(e, t, n, r) { - for (var o = [], i = t.length, s = 0; s < i; s++) - Ks(t[s].e, o, !0); - var a = i > 0 && o.length === 0 && n !== null; - if (a) { - var l = ( - /** @type {Element} */ - /** @type {Element} */ - n.parentNode - ); - Ws(l), l.append( - /** @type {Element} */ - n - ), r.clear(), Rn(e, t[0].prev, t[i - 1].next); - } - au(o, () => { - for (var u = 0; u < i; u++) { - var c = t[u]; - a || (r.delete(c.k), Rn(e, c.prev, c.next)), qt(c.e, !a); - } - }); -} -function zt(e, t, n, r, o, i = null) { - var s = e, a = { flags: t, items: /* @__PURE__ */ new Map(), first: null }, l = (t & Al) !== 0; - if (l) { - var u = ( - /** @type {Element} */ - e - ); - s = Se ? bt( - /** @type {Comment | Text} */ - /* @__PURE__ */ xt(u) - ) : u.appendChild(Hn()); - } - Se && hn(); - var c = null, f = !1, d = /* @__PURE__ */ pe(() => { - var g = n(); - return bo(g) ? g : g == null ? [] : Bs(g); - }); - vr(() => { - var g = h(d), p = g.length; - if (f && p === 0) - return; - f = p === 0; - let x = !1; - if (Se) { - var k = ( - /** @type {Comment} */ - s.data === Ls - ); - k !== (p === 0) && (s = ds(), bt(s), Lt(!1), x = !0); - } - if (Se) { - for (var E = null, m, _ = 0; _ < p; _++) { - if (De.nodeType === 8 && /** @type {Comment} */ - De.data === Is) { - s = /** @type {Comment} */ - De, x = !0, Lt(!1); - break; - } - var v = g[_], b = r(v, _); - m = gu( - De, - a, - E, - null, - v, - b, - _, - o, - t, - n - ), a.items.set(b, m), E = m; - } - p > 0 && bt(ds()); - } - Se || d1(g, a, s, o, t, r, n), i !== null && (p === 0 ? c ? uo(c) : c = Dn(() => i(s)) : c !== null && Tr(c, () => { - c = null; - })), x && Lt(!0), h(d); - }), Se && (s = De); -} -function d1(e, t, n, r, o, i, s) { - var S, H, C, P; - var a = (o & rf) !== 0, l = (o & (As | Vs)) !== 0, u = e.length, c = t.items, f = t.first, d = f, g, p = null, x, k = [], E = [], m, _, v, b; - if (a) - for (b = 0; b < u; b += 1) - m = e[b], _ = i(m, b), v = c.get(_), v !== void 0 && ((S = v.a) == null || S.measure(), (x ?? (x = /* @__PURE__ */ new Set())).add(v)); - for (b = 0; b < u; b += 1) { - if (m = e[b], _ = i(m, b), v = c.get(_), v === void 0) { - var N = d ? ( - /** @type {TemplateNode} */ - d.e.nodes_start - ) : n; - p = gu( - N, - t, - p, - p === null ? t.first : p.next, - m, - _, - b, - r, - o, - s - ), c.set(_, p), k = [], E = [], d = p.next; - continue; - } - if (l && f1(v, m, b, o), v.e.f & Nn && (uo(v.e), a && ((H = v.a) == null || H.unfix(), (x ?? (x = /* @__PURE__ */ new Set())).delete(v))), v !== d) { - if (g !== void 0 && g.has(v)) { - if (k.length < E.length) { - var $ = E[0], T; - p = $.prev; - var A = k[0], D = k[k.length - 1]; - for (T = 0; T < k.length; T += 1) - Aa(k[T], $, n); - for (T = 0; T < E.length; T += 1) - g.delete(E[T]); - Rn(t, A.prev, D.next), Rn(t, p, A), Rn(t, D, $), d = $, p = D, b -= 1, k = [], E = []; - } else - g.delete(v), Aa(v, d, n), Rn(t, v.prev, v.next), Rn(t, v, p === null ? t.first : p.next), Rn(t, p, v), p = v; - continue; - } - for (k = [], E = []; d !== null && d.k !== _; ) - d.e.f & Nn || (g ?? (g = /* @__PURE__ */ new Set())).add(d), E.push(d), d = d.next; - if (d === null) - continue; - v = d; - } - k.push(v), p = v, d = v.next; - } - if (d !== null || g !== void 0) { - for (var O = g === void 0 ? [] : Bs(g); d !== null; ) - d.e.f & Nn || O.push(d), d = d.next; - var V = O.length; - if (V > 0) { - var z = o & Al && u === 0 ? n : null; - if (a) { - for (b = 0; b < V; b += 1) - (C = O[b].a) == null || C.measure(); - for (b = 0; b < V; b += 1) - (P = O[b].a) == null || P.fix(); - } - c1(t, O, z, c); - } - } - a && Co(() => { - var M; - if (x !== void 0) - for (v of x) - (M = v.a) == null || M.apply(); - }), Fe.first = t.first && t.first.e, Fe.last = p && p.e; -} -function f1(e, t, n, r) { - r & As && cs(e.v, t), r & Vs ? cs( - /** @type {Value} */ - e.i, - n - ) : e.i = n; -} -function gu(e, t, n, r, o, i, s, a, l, u) { - var c = (l & As) !== 0, f = (l & of) === 0, d = c ? f ? /* @__PURE__ */ ko(o) : Tt(o) : o, g = l & Vs ? Tt(s) : s, p = { - i: g, - v: d, - k: i, - a: null, - // @ts-expect-error - e: null, - prev: n, - next: r - }; - try { - return p.e = Dn(() => a(e, d, g, u), Se), p.e.prev = n && n.e, p.e.next = r && r.e, n === null ? t.first = p : (n.next = p, n.e.next = p.e), r !== null && (r.prev = p, r.e.prev = p.e), p; - } finally { - } -} -function Aa(e, t, n) { - for (var r = e.next ? ( - /** @type {TemplateNode} */ - e.next.e.nodes_start - ) : n, o = t ? ( - /** @type {TemplateNode} */ - t.e.nodes_start - ) : n, i = ( - /** @type {TemplateNode} */ - e.e.nodes_start - ); i !== r; ) { - var s = ( - /** @type {TemplateNode} */ - /* @__PURE__ */ yn(i) - ); - o.before(i), i = s; - } -} -function Rn(e, t, n) { - t === null ? e.first = n : (t.next = n, t.e.next = n && n.e), n !== null && (n.prev = t, n.e.prev = t && t.e); -} -function hu(e, t, n, r, o) { - var i = e, s = "", a; - vr(() => { - if (s === (s = t() ?? "")) { - Se && hn(); - return; - } - a !== void 0 && (qt(a), a = void 0), s !== "" && (a = Dn(() => { - if (Se) { - De.data; - for (var l = hn(), u = l; l !== null && (l.nodeType !== 8 || /** @type {Comment} */ - l.data !== ""); ) - u = l, l = /** @type {TemplateNode} */ - /* @__PURE__ */ yn(l); - if (l === null) - throw Si(), _r; - Ht(De, u), i = bt(l); - return; - } - var c = s + "", f = Gs(c); - Ht( - /** @type {TemplateNode} */ - /* @__PURE__ */ xt(f), - /** @type {TemplateNode} */ - f.lastChild - ), i.before(f); - })); - }); -} -function vt(e, t, n, r, o) { - var a; - Se && hn(); - var i = (a = t.$$slots) == null ? void 0 : a[n], s = !1; - i === !0 && (i = t[n === "default" ? "children" : n], s = !0), i === void 0 || i(e, s ? () => r : r); -} -function g1(e) { - const t = {}; - e.children && (t.default = !0); - for (const n in e.$$slots) - t[n] = !0; - return t; -} -function lr(e, t, ...n) { - var r = e, o = dt, i; - vr(() => { - o !== (o = t()) && (i && (qt(i), i = null), i = Dn(() => ( - /** @type {SnippetFn} */ - o(r, ...n) - ))); - }, Zr), Se && (r = De); -} -function vu(e, t, n) { - Se && hn(); - var r = e, o, i; - vr(() => { - o !== (o = t()) && (i && (Tr(i), i = null), o && (i = Dn(() => n(r, o)))); - }, Zr), Se && (r = De); -} -function h1(e, t, n, r, o, i) { - let s = Se; - Se && hn(); - var a, l, u = null; - Se && De.nodeType === 1 && (u = /** @type {Element} */ - De, hn()); - var c = ( - /** @type {TemplateNode} */ - Se ? De : e - ), f; - vr(() => { - const d = t() || null; - var g = d === "svg" ? Ll : null; - d !== a && (f && (d === null ? Tr(f, () => { - f = null, l = null; - }) : d === l ? uo(f) : qt(f)), d && d !== l && (f = Dn(() => { - if (u = Se ? ( - /** @type {Element} */ - u - ) : g ? document.createElementNS(g, d) : document.createElement(d), Ht(u, u), r) { - Se && r1(d) && u.append(document.createComment("")); - var p = ( - /** @type {TemplateNode} */ - Se ? /* @__PURE__ */ xt(u) : u.appendChild(Hn()) - ); - Se && (p === null ? Lt(!1) : bt(p)), r(u, p); - } - Fe.nodes_end = u, c.before(u); - })), a = d, a && (l = a)); - }, Zr), s && (Lt(!0), bt(c)); -} -function je(e, t) { - Co(() => { - var n = e.getRootNode(), r = ( - /** @type {ShadowRoot} */ - n.host ? ( - /** @type {ShadowRoot} */ - n - ) : ( - /** @type {Document} */ - n.head ?? /** @type {Document} */ - n.ownerDocument.head - ) - ); - if (!r.querySelector("#" + t.hash)) { - const o = document.createElement("style"); - o.id = t.hash, o.textContent = t.code, r.appendChild(o); - } - }); -} -function ht(e, t, n) { - Ot(() => { - var r = vn(() => t(e, n == null ? void 0 : n()) || {}); - if (n && (r != null && r.update)) { - var o = !1, i = ( - /** @type {any} */ - {} - ); - Wr(() => { - var s = n(); - U(s), o && Zs(i, s) && (i = s, r.update(s)); - }), o = !0; - } - if (r != null && r.destroy) - return () => ( - /** @type {Function} */ - r.destroy() - ); - }); -} -function pu(e) { - var t, n, r = ""; - if (typeof e == "string" || typeof e == "number") r += e; - else if (typeof e == "object") if (Array.isArray(e)) { - var o = e.length; - for (t = 0; t < o; t++) e[t] && (n = pu(e[t])) && (r && (r += " "), r += n); - } else for (n in e) e[n] && (r && (r += " "), r += n); - return r; -} -function v1() { - for (var e, t, n = 0, r = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t = pu(e)) && (r && (r += " "), r += t); - return r; -} -function _n(e) { - return typeof e == "object" ? v1(e) : e ?? ""; -} -const Va = [...` -\r\f \v\uFEFF`]; -function p1(e, t, n) { - var r = e == null ? "" : "" + e; - if (t && (r = r ? r + " " + t : t), n) { - for (var o in n) - if (n[o]) - r = r ? r + " " + o : o; - else if (r.length) - for (var i = o.length, s = 0; (s = r.indexOf(o, s)) >= 0; ) { - var a = s + i; - (s === 0 || Va.includes(r[s - 1])) && (a === r.length || Va.includes(r[a])) ? r = (s === 0 ? "" : r.substring(0, s)) + r.substring(a + 1) : s = a; - } - } - return r === "" ? null : r; -} -function Ct(e, t, n, r, o, i) { - var s = e.__className; - if (Se || s !== n) { - var a = p1(n, r, i); - (!Se || a !== e.getAttribute("class")) && (a == null ? e.removeAttribute("class") : t ? e.className = a : e.setAttribute("class", a)), e.__className = n; - } else if (i) - for (var l in i) { - var u = !!i[l]; - (o == null || u !== !!o[l]) && e.classList.toggle(l, u); - } - return i; -} -const jr = Symbol("class"); -function mu(e) { - if (Se) { - var t = !1, n = () => { - if (!t) { - if (t = !0, e.hasAttribute("value")) { - var r = e.value; - ae(e, "value", null), e.value = r; - } - if (e.hasAttribute("checked")) { - var o = e.checked; - ae(e, "checked", null), e.checked = o; - } - } - }; - e.__on_r = n, _f(n), s1(); - } -} -function m1(e, t) { - t ? e.hasAttribute("selected") || e.setAttribute("selected", "") : e.removeAttribute("selected"); -} -function ae(e, t, n, r) { - var o = e.__attributes ?? (e.__attributes = {}); - Se && (o[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === "LINK") || o[t] !== (o[t] = n) && (t === "style" && "__styles" in e && (e.__styles = {}), t === "loading" && (e[hf] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && yu(e).includes(t) ? e[t] = n : e.setAttribute(t, n)); -} -function rn(e, t, n, r, o = !1, i = !1, s = !1) { - let a = Se && i; - a && Lt(!1); - var l = t || {}, u = e.tagName === "OPTION"; - for (var c in t) - c in n || (n[c] = null); - n.class ? n.class = _n(n.class) : (r || n[jr]) && (n.class = null); - var f = yu(e), d = ( - /** @type {Record} **/ - e.__attributes ?? (e.__attributes = {}) - ); - for (const _ in n) { - let v = n[_]; - if (u && _ === "value" && v == null) { - e.value = e.__value = "", l[_] = v; - continue; - } - if (_ === "class") { - var g = e.namespaceURI === "http://www.w3.org/1999/xhtml"; - Ct(e, g, v, r, t == null ? void 0 : t[jr], n[jr]), l[_] = v, l[jr] = n[jr]; - continue; - } - var p = l[_]; - if (v !== p) { - l[_] = v; - var x = _[0] + _[1]; - if (x !== "$$") { - if (x === "on") { - const b = {}, N = "$$" + _; - let $ = _.slice(2); - var k = jf($); - if (Gf($) && ($ = $.slice(0, -7), b.capture = !0), !k && p) { - if (v != null) continue; - e.removeEventListener($, l[N], b), l[N] = null; - } - if (v != null) - if (k) - e[`__${$}`] = v, Di([$]); - else { - let T = function(A) { - l[_].call(this, A); - }; - l[N] = cu($, e, T, b); - } - else k && (e[`__${$}`] = void 0); - } else if (_ === "style" && v != null) - e.style.cssText = v + ""; - else if (_ === "autofocus") - o1( - /** @type {HTMLElement} */ - e, - !!v - ); - else if (!i && (_ === "__value" || _ === "value" && v != null)) - e.value = e.__value = v; - else if (_ === "selected" && u) - m1( - /** @type {HTMLOptionElement} */ - e, - v - ); - else { - var E = _; - o || (E = Qf(E)); - var m = E === "defaultValue" || E === "defaultChecked"; - if (v == null && !i && !m) - if (d[_] = null, E === "value" || E === "checked") { - let b = ( - /** @type {HTMLInputElement} */ - e - ); - const N = t === void 0; - if (E === "value") { - let $ = b.defaultValue; - b.removeAttribute(E), b.defaultValue = $, b.value = b.__value = N ? $ : null; - } else { - let $ = b.defaultChecked; - b.removeAttribute(E), b.defaultChecked = $, b.checked = N ? $ : !1; - } - } else - e.removeAttribute(_); - else m || f.includes(E) && (i || typeof v != "string") ? e[E] = v : typeof v != "function" && ae(e, E, v); - } - _ === "style" && "__styles" in e && (e.__styles = {}); - } - } - } - return a && Lt(!0), l; -} -var Oa = /* @__PURE__ */ new Map(); -function yu(e) { - var t = Oa.get(e.nodeName); - if (t) return t; - Oa.set(e.nodeName, t = []); - for (var n, r = e, o = Element.prototype; o !== r; ) { - n = Rl(r); - for (var i in n) - n[i].set && t.push(i); - r = Ys(r); - } - return t; -} -function at(e, t, n, r) { - var o = e.__styles ?? (e.__styles = {}); - o[t] !== n && (o[t] = n, n == null ? e.style.removeProperty(t) : e.style.setProperty(t, n, "")); -} -var Yn, Pr, xo, Ci, wu; -const ki = class ki { - /** @param {ResizeObserverOptions} options */ - constructor(t) { - nr(this, Ci); - /** */ - nr(this, Yn, /* @__PURE__ */ new WeakMap()); - /** @type {ResizeObserver | undefined} */ - nr(this, Pr); - /** @type {ResizeObserverOptions} */ - nr(this, xo); - Gr(this, xo, t); - } - /** - * @param {Element} element - * @param {(entry: ResizeObserverEntry) => any} listener - */ - observe(t, n) { - var r = st(this, Yn).get(t) || /* @__PURE__ */ new Set(); - return r.add(n), st(this, Yn).set(t, r), $a(this, Ci, wu).call(this).observe(t, st(this, xo)), () => { - var o = st(this, Yn).get(t); - o.delete(n), o.size === 0 && (st(this, Yn).delete(t), st(this, Pr).unobserve(t)); - }; - } -}; -Yn = new WeakMap(), Pr = new WeakMap(), xo = new WeakMap(), Ci = new WeakSet(), wu = function() { - return st(this, Pr) ?? Gr(this, Pr, new ResizeObserver( - /** @param {any} entries */ - (t) => { - for (var n of t) { - ki.entries.set(n.target, n); - for (var r of st(this, Yn).get(n.target) || []) - r(n); - } - } - )); -}, /** @static */ -yt(ki, "entries", /* @__PURE__ */ new WeakMap()); -let ps = ki; -var y1 = /* @__PURE__ */ new ps({ - box: "border-box" -}); -function La(e, t, n) { - var r = y1.observe(e, () => n(e[t])); - Ot(() => (vn(() => n(e[t])), r)); -} -function Ia(e, t) { - return e === t || (e == null ? void 0 : e[Wn]) === t; -} -function An(e = {}, t, n, r) { - return Ot(() => { - var o, i; - return Wr(() => { - o = i, i = [], vn(() => { - e !== n(...i) && (t(e, ...i), o && Ia(n(...o), e) && t(null, ...o)); - }); - }), () => { - Co(() => { - i && Ia(n(...i), e) && t(null, ...i); - }); - }; - }), e; -} -function He(e = !1) { - const t = ( - /** @type {ComponentContextLegacy} */ - Be - ), n = t.l.u; - if (!n) return; - let r = () => U(t.s); - if (e) { - let o = 0, i = ( - /** @type {Record} */ - {} - ); - const s = /* @__PURE__ */ Me(() => { - let a = !1; - const l = t.s; - for (const u in l) - l[u] !== i[u] && (i[u] = l[u], a = !0); - return a && o++, o; - }); - r = () => h(s); - } - n.b.length && Zf(() => { - za(t, r), so(n.b); - }), Nr(() => { - const o = vn(() => n.m.map(yf)); - return () => { - for (const i of o) - typeof i == "function" && i(); - }; - }), n.a.length && Nr(() => { - za(t, r), so(n.a); - }); -} -function za(e, t) { - if (e.l.s) - for (const n of e.l.s) h(n); - t(); -} -function Le(e, t) { - var i; - var n = ( - /** @type {Record} */ - (i = e.$$events) == null ? void 0 : i[t.type] - ), r = bo(n) ? n.slice() : n == null ? [] : [n]; - for (var o of r) - o.call(this, t); -} -function xn(e) { - Be === null && Mi(), Br && Be.l !== null ? _1(Be).m.push(e) : Nr(() => { - const t = vn(e); - if (typeof t == "function") return ( - /** @type {() => void} */ - t - ); - }); -} -function Us(e) { - Be === null && Mi(), xn(() => () => vn(e)); -} -function w1(e, t, { bubbles: n = !1, cancelable: r = !1 } = {}) { - return new CustomEvent(e, { detail: t, bubbles: n, cancelable: r }); -} -function Vi() { - const e = Be; - return e === null && Mi(), (t, n, r) => { - var i; - const o = ( - /** @type {Record} */ - (i = e.s.$$events) == null ? void 0 : i[ - /** @type {any} */ - t - ] - ); - if (o) { - const s = bo(o) ? o.slice() : [o], a = w1( - /** @type {string} */ - t, - n, - r - ); - for (const l of s) - l.call(e.x, a); - return !a.defaultPrevented; - } - return !0; - }; -} -function _1(e) { - var t = ( - /** @type {ComponentContextLegacy} */ - e.l - ); - return t.u ?? (t.u = { a: [], b: [], m: [] }); -} -function js(e, t, n) { - if (e == null) - return t(void 0), n && n(void 0), dt; - const r = vn( - () => e.subscribe( - t, - // @ts-expect-error - n - ) - ); - return r.unsubscribe ? () => r.unsubscribe() : r; -} -const yr = []; -function Zt(e, t) { - return { - subscribe: ye(e, t).subscribe - }; -} -function ye(e, t = dt) { - let n = null; - const r = /* @__PURE__ */ new Set(); - function o(a) { - if (Zs(e, a) && (e = a, n)) { - const l = !yr.length; - for (const u of r) - u[1](), yr.push(u, e); - if (l) { - for (let u = 0; u < yr.length; u += 2) - yr[u][0](yr[u + 1]); - yr.length = 0; - } - } - } - function i(a) { - o(a( - /** @type {T} */ - e - )); - } - function s(a, l = dt) { - const u = [a, l]; - return r.add(u), r.size === 1 && (n = t(o, i) || dt), a( - /** @type {T} */ - e - ), () => { - r.delete(u), r.size === 0 && n && (n(), n = null); - }; - } - return { set: o, update: i, subscribe: s }; -} -function Fn(e, t, n) { - const r = !Array.isArray(e), o = r ? [e] : e; - if (!o.every(Boolean)) - throw new Error("derived() expects stores as input, got a falsy value"); - const i = t.length < 2; - return Zt(n, (s, a) => { - let l = !1; - const u = []; - let c = 0, f = dt; - const d = () => { - if (c) - return; - f(); - const p = t(r ? u[0] : u, s, a); - i ? s(p) : f = typeof p == "function" ? p : dt; - }, g = o.map( - (p, x) => js( - p, - (k) => { - u[x] = k, c &= ~(1 << x), l && d(); - }, - () => { - c |= 1 << x; - } - ) - ); - return l = !0, d(), function() { - so(g), f(), l = !1; - }; - }); -} -function q(e) { - let t; - return js(e, (n) => t = n)(), t; -} -let zo = !1, ms = Symbol(); -function j(e, t, n) { - const r = n[t] ?? (n[t] = { - store: null, - source: /* @__PURE__ */ ko(void 0), - unsubscribe: dt - }); - if (r.store !== e && !(ms in n)) - if (r.unsubscribe(), r.store = e ?? null, e == null) - r.source.v = void 0, r.unsubscribe = dt; - else { - var o = !0; - r.unsubscribe = js(e, (i) => { - o ? r.source.v = i : G(r.source, i); - }), o = !1; - } - return e && ms in n ? q(e) : h(r.source); -} -function x1(e, t, n) { - let r = n[t]; - return r && r.store !== e && (r.unsubscribe(), r.unsubscribe = dt), e; -} -function si(e, t) { - return e.set(t), t; -} -function tt() { - const e = {}; - function t() { - ru(() => { - for (var n in e) - e[n].unsubscribe(); - io(e, ms, { - enumerable: !1, - value: !0 - }); - }); - } - return [e, t]; -} -function b1(e) { - var t = zo; - try { - return zo = !1, [e(), zo]; - } finally { - zo = t; - } -} -const C1 = { - get(e, t) { - if (!e.exclude.includes(t)) - return e.props[t]; - }, - set(e, t) { - return !1; - }, - getOwnPropertyDescriptor(e, t) { - if (!e.exclude.includes(t) && t in e.props) - return { - enumerable: !0, - configurable: !0, - value: e.props[t] - }; - }, - has(e, t) { - return e.exclude.includes(t) ? !1 : t in e.props; - }, - ownKeys(e) { - return Reflect.ownKeys(e.props).filter((t) => !e.exclude.includes(t)); - } -}; -// @__NO_SIDE_EFFECTS__ -function Et(e, t, n) { - return new Proxy( - { props: e, exclude: t }, - C1 - ); -} -const k1 = { - get(e, t) { - if (!e.exclude.includes(t)) - return h(e.version), t in e.special ? e.special[t]() : e.props[t]; - }, - set(e, t, n) { - return t in e.special || (e.special[t] = w( - { - get [t]() { - return e.props[t]; - } - }, - /** @type {string} */ - t, - Vl - )), e.special[t](n), Na(e.version), !0; - }, - getOwnPropertyDescriptor(e, t) { - if (!e.exclude.includes(t) && t in e.props) - return { - enumerable: !0, - configurable: !0, - value: e.props[t] - }; - }, - deleteProperty(e, t) { - return e.exclude.includes(t) || (e.exclude.push(t), Na(e.version)), !0; - }, - has(e, t) { - return e.exclude.includes(t) ? !1 : t in e.props; - }, - ownKeys(e) { - return Reflect.ownKeys(e.props).filter((t) => !e.exclude.includes(t)); - } -}; -function rt(e, t) { - return new Proxy({ props: e, exclude: t, special: {}, version: Tt(0) }, k1); -} -const E1 = { - get(e, t) { - let n = e.props.length; - for (; n--; ) { - let r = e.props[n]; - if (Ur(r) && (r = r()), typeof r == "object" && r !== null && t in r) return r[t]; - } - }, - set(e, t, n) { - let r = e.props.length; - for (; r--; ) { - let o = e.props[r]; - Ur(o) && (o = o()); - const i = Tn(o, t); - if (i && i.set) - return i.set(n), !0; - } - return !1; - }, - getOwnPropertyDescriptor(e, t) { - let n = e.props.length; - for (; n--; ) { - let r = e.props[n]; - if (Ur(r) && (r = r()), typeof r == "object" && r !== null && t in r) { - const o = Tn(r, t); - return o && !o.configurable && (o.configurable = !0), o; - } - } - }, - has(e, t) { - if (t === Wn || t === Rs) return !1; - for (let n of e.props) - if (Ur(n) && (n = n()), n != null && t in n) return !0; - return !1; - }, - ownKeys(e) { - const t = []; - for (let n of e.props) { - Ur(n) && (n = n()); - for (const r in n) - t.includes(r) || t.push(r); - } - return t; - } -}; -function ct(...e) { - return new Proxy({ props: e }, E1); -} -function w(e, t, n, r) { - var N; - var o = (n & sf) !== 0, i = !Br || (n & af) !== 0, s = (n & lf) !== 0, a = (n & uf) !== 0, l = !1, u; - s ? [u, l] = b1(() => ( - /** @type {V} */ - e[t] - )) : u = /** @type {V} */ - e[t]; - var c = Wn in e || Rs in e, f = s && (((N = Tn(e, t)) == null ? void 0 : N.set) ?? (c && t in e && (($) => e[t] = $))) || void 0, d = ( - /** @type {V} */ - r - ), g = !0, p = !1, x = () => (p = !0, g && (g = !1, a ? d = vn( - /** @type {() => V} */ - r - ) : d = /** @type {V} */ - r), d); - u === void 0 && r !== void 0 && (f && i && $f(), u = x(), f && f(u)); - var k; - if (i) - k = () => { - var $ = ( - /** @type {V} */ - e[t] - ); - return $ === void 0 ? x() : (g = !0, p = !1, $); - }; - else { - var E = (o ? Me : pe)( - () => ( - /** @type {V} */ - e[t] - ) - ); - E.f |= ff, k = () => { - var $ = h(E); - return $ !== void 0 && (d = /** @type {V} */ - void 0), $ === void 0 ? d : $; - }; - } - if (!(n & Vl)) - return k; - if (f) { - var m = e.$$legacy; - return function($, T) { - return arguments.length > 0 ? ((!i || !T || m || l) && f(T ? k() : $), $) : k(); - }; - } - var _ = !1, v = /* @__PURE__ */ ko(u), b = /* @__PURE__ */ Me(() => { - var $ = k(), T = h(v); - return _ ? (_ = !1, T) : v.v = $; - }); - return o || (b.equals = Xs), function($, T) { - if (arguments.length > 0) { - const A = T ? h(b) : i && s ? Vt($) : $; - return b.equals(A) || (_ = !0, G(v, A), p && d !== void 0 && (d = A), vn(() => h(b))), $; - } - return h(b); - }; -} -function $1(e) { - return new S1(e); -} -var $n, Xt; -class S1 { - /** - * @param {ComponentConstructorOptions & { - * component: any; - * }} options - */ - constructor(t) { - /** @type {any} */ - nr(this, $n); - /** @type {Record} */ - nr(this, Xt); - var i; - var n = /* @__PURE__ */ new Map(), r = (s, a) => { - var l = /* @__PURE__ */ ko(a); - return n.set(s, l), l; - }; - const o = new Proxy( - { ...t.props || {}, $$events: {} }, - { - get(s, a) { - return h(n.get(a) ?? r(a, Reflect.get(s, a))); - }, - has(s, a) { - return a === Rs ? !0 : (h(n.get(a) ?? r(a, Reflect.get(s, a))), Reflect.has(s, a)); - }, - set(s, a, l) { - return G(n.get(a) ?? r(a, l), l), Reflect.set(s, a, l); - } - } - ); - Gr(this, Xt, (t.hydrate ? l1 : du)(t.component, { - target: t.target, - anchor: t.anchor, - props: o, - context: t.context, - intro: t.intro ?? !1, - recover: t.recover - })), (!((i = t == null ? void 0 : t.props) != null && i.$$host) || t.sync === !1) && y(), Gr(this, $n, o.$$events); - for (const s of Object.keys(st(this, Xt))) - s === "$set" || s === "$destroy" || s === "$on" || io(this, s, { - get() { - return st(this, Xt)[s]; - }, - /** @param {any} value */ - set(a) { - st(this, Xt)[s] = a; - }, - enumerable: !0 - }); - st(this, Xt).$set = /** @param {Record} next */ - (s) => { - Object.assign(o, s); - }, st(this, Xt).$destroy = () => { - u1(st(this, Xt)); - }; - } - /** @param {Record} props */ - $set(t) { - st(this, Xt).$set(t); - } - /** - * @param {string} event - * @param {(...args: any[]) => any} callback - * @returns {any} - */ - $on(t, n) { - st(this, $n)[t] = st(this, $n)[t] || []; - const r = (...o) => n.call(this, ...o); - return st(this, $n)[t].push(r), () => { - st(this, $n)[t] = st(this, $n)[t].filter( - /** @param {any} fn */ - (o) => o !== r - ); - }; - } - $destroy() { - st(this, Xt).$destroy(); - } -} -$n = new WeakMap(), Xt = new WeakMap(); -let _u; -typeof HTMLElement == "function" && (_u = class extends HTMLElement { - /** - * @param {*} $$componentCtor - * @param {*} $$slots - * @param {*} use_shadow_dom - */ - constructor(t, n, r) { - super(); - /** The Svelte component constructor */ - yt(this, "$$ctor"); - /** Slots */ - yt(this, "$$s"); - /** @type {any} The Svelte component instance */ - yt(this, "$$c"); - /** Whether or not the custom element is connected */ - yt(this, "$$cn", !1); - /** @type {Record} Component props data */ - yt(this, "$$d", {}); - /** `true` if currently in the process of reflecting component props back to attributes */ - yt(this, "$$r", !1); - /** @type {Record} Props definition (name, reflected, type etc) */ - yt(this, "$$p_d", {}); - /** @type {Record} Event listeners */ - yt(this, "$$l", {}); - /** @type {Map} Event listener unsubscribe functions */ - yt(this, "$$l_u", /* @__PURE__ */ new Map()); - /** @type {any} The managed render effect for reflecting attributes */ - yt(this, "$$me"); - this.$$ctor = t, this.$$s = n, r && this.attachShadow({ mode: "open" }); - } - /** - * @param {string} type - * @param {EventListenerOrEventListenerObject} listener - * @param {boolean | AddEventListenerOptions} [options] - */ - addEventListener(t, n, r) { - if (this.$$l[t] = this.$$l[t] || [], this.$$l[t].push(n), this.$$c) { - const o = this.$$c.$on(t, n); - this.$$l_u.set(n, o); - } - super.addEventListener(t, n, r); - } - /** - * @param {string} type - * @param {EventListenerOrEventListenerObject} listener - * @param {boolean | AddEventListenerOptions} [options] - */ - removeEventListener(t, n, r) { - if (super.removeEventListener(t, n, r), this.$$c) { - const o = this.$$l_u.get(n); - o && (o(), this.$$l_u.delete(n)); - } - } - async connectedCallback() { - if (this.$$cn = !0, !this.$$c) { - let t = function(o) { - return (i) => { - const s = document.createElement("slot"); - o !== "default" && (s.name = o), L(i, s); - }; - }; - if (await Promise.resolve(), !this.$$cn || this.$$c) - return; - const n = {}, r = P1(this); - for (const o of this.$$s) - o in r && (o === "default" && !this.$$d.children ? (this.$$d.children = t(o), n.default = !0) : n[o] = t(o)); - for (const o of this.attributes) { - const i = this.$$g_p(o.name); - i in this.$$d || (this.$$d[i] = Ko(i, o.value, this.$$p_d, "toProp")); - } - for (const o in this.$$p_d) - !(o in this.$$d) && this[o] !== void 0 && (this.$$d[o] = this[o], delete this[o]); - this.$$c = $1({ - component: this.$$ctor, - target: this.shadowRoot || this, - props: { - ...this.$$d, - $$slots: n, - $$host: this - } - }), this.$$me = Xf(() => { - Wr(() => { - var o; - this.$$r = !0; - for (const i of ti(this.$$c)) { - if (!((o = this.$$p_d[i]) != null && o.reflect)) continue; - this.$$d[i] = this.$$c[i]; - const s = Ko( - i, - this.$$d[i], - this.$$p_d, - "toAttribute" - ); - s == null ? this.removeAttribute(this.$$p_d[i].attribute || i) : this.setAttribute(this.$$p_d[i].attribute || i, s); - } - this.$$r = !1; - }); - }); - for (const o in this.$$l) - for (const i of this.$$l[o]) { - const s = this.$$c.$on(o, i); - this.$$l_u.set(i, s); - } - this.$$l = {}; - } - } - // We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte - // and setting attributes through setAttribute etc, this is helpful - /** - * @param {string} attr - * @param {string} _oldValue - * @param {string} newValue - */ - attributeChangedCallback(t, n, r) { - var o; - this.$$r || (t = this.$$g_p(t), this.$$d[t] = Ko(t, r, this.$$p_d, "toProp"), (o = this.$$c) == null || o.$set({ [t]: this.$$d[t] })); - } - disconnectedCallback() { - this.$$cn = !1, Promise.resolve().then(() => { - !this.$$cn && this.$$c && (this.$$c.$destroy(), this.$$me(), this.$$c = void 0); - }); - } - /** - * @param {string} attribute_name - */ - $$g_p(t) { - return ti(this.$$p_d).find( - (n) => this.$$p_d[n].attribute === t || !this.$$p_d[n].attribute && n.toLowerCase() === t - ) || t; - } -}); -function Ko(e, t, n, r) { - var i; - const o = (i = n[e]) == null ? void 0 : i.type; - if (t = o === "Boolean" && typeof t != "boolean" ? t != null : t, !r || !n[e]) - return t; - if (r === "toAttribute") - switch (o) { - case "Object": - case "Array": - return t == null ? null : JSON.stringify(t); - case "Boolean": - return t ? "" : null; - case "Number": - return t ?? null; - default: - return t; - } - else - switch (o) { - case "Object": - case "Array": - return t && JSON.parse(t); - case "Boolean": - return t; - // conversion already handled above - case "Number": - return t != null ? +t : t; - default: - return t; - } -} -function P1(e) { - const t = {}; - return e.childNodes.forEach((n) => { - t[ - /** @type {Element} node */ - n.slot || "default" - ] = !0; - }), t; -} -function re(e, t, n, r, o, i) { - let s = class extends _u { - constructor() { - super(e, n, o), this.$$p_d = t; - } - static get observedAttributes() { - return ti(t).map( - (a) => (t[a].attribute || a).toLowerCase() - ); - } - }; - return ti(t).forEach((a) => { - io(s.prototype, a, { - get() { - return this.$$c && a in this.$$c ? this.$$c[a] : this.$$d[a]; - }, - set(l) { - var f; - l = Ko(a, l, t), this.$$d[a] = l; - var u = this.$$c; - if (u) { - var c = (f = Tn(u, a)) == null ? void 0 : f.get; - c ? u[a] = l : u.$set({ [a]: l }); - } - } - }); - }), r.forEach((a) => { - io(s.prototype, a, { - get() { - var l; - return (l = this.$$c) == null ? void 0 : l[a]; - } - }); - }), e.element = /** @type {any} */ - s, s; -} -function $t(e) { - if (typeof e == "string" || typeof e == "number") return "" + e; - let t = ""; - if (Array.isArray(e)) - for (let n = 0, r; n < e.length; n++) - (r = $t(e[n])) !== "" && (t += (t && " ") + r); - else - for (let n in e) - e[n] && (t += (t && " ") + n); - return t; -} -var N1 = { value: () => { -} }; -function Oi() { - for (var e = 0, t = arguments.length, n = {}, r; e < t; ++e) { - if (!(r = arguments[e] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r); - n[r] = []; - } - return new qo(n); -} -function qo(e) { - this._ = e; -} -function T1(e, t) { - return e.trim().split(/^|\s+/).map(function(n) { - var r = "", o = n.indexOf("."); - if (o >= 0 && (r = n.slice(o + 1), n = n.slice(0, o)), n && !t.hasOwnProperty(n)) throw new Error("unknown type: " + n); - return { type: n, name: r }; - }); -} -qo.prototype = Oi.prototype = { - constructor: qo, - on: function(e, t) { - var n = this._, r = T1(e + "", n), o, i = -1, s = r.length; - if (arguments.length < 2) { - for (; ++i < s; ) if ((o = (e = r[i]).type) && (o = M1(n[o], e.name))) return o; - return; - } - if (t != null && typeof t != "function") throw new Error("invalid callback: " + t); - for (; ++i < s; ) - if (o = (e = r[i]).type) n[o] = Ra(n[o], e.name, t); - else if (t == null) for (o in n) n[o] = Ra(n[o], e.name, null); - return this; - }, - copy: function() { - var e = {}, t = this._; - for (var n in t) e[n] = t[n].slice(); - return new qo(e); - }, - call: function(e, t) { - if ((o = arguments.length - 2) > 0) for (var n = new Array(o), r = 0, o, i; r < o; ++r) n[r] = arguments[r + 2]; - if (!this._.hasOwnProperty(e)) throw new Error("unknown type: " + e); - for (i = this._[e], r = 0, o = i.length; r < o; ++r) i[r].value.apply(t, n); - }, - apply: function(e, t, n) { - if (!this._.hasOwnProperty(e)) throw new Error("unknown type: " + e); - for (var r = this._[e], o = 0, i = r.length; o < i; ++o) r[o].value.apply(t, n); - } -}; -function M1(e, t) { - for (var n = 0, r = e.length, o; n < r; ++n) - if ((o = e[n]).name === t) - return o.value; -} -function Ra(e, t, n) { - for (var r = 0, o = e.length; r < o; ++r) - if (e[r].name === t) { - e[r] = N1, e = e.slice(0, r).concat(e.slice(r + 1)); - break; - } - return n != null && e.push({ name: t, value: n }), e; -} -var ys = "http://www.w3.org/1999/xhtml"; -const Ba = { - svg: "http://www.w3.org/2000/svg", - xhtml: ys, - xlink: "http://www.w3.org/1999/xlink", - xml: "http://www.w3.org/XML/1998/namespace", - xmlns: "http://www.w3.org/2000/xmlns/" -}; -function Li(e) { - var t = e += "", n = t.indexOf(":"); - return n >= 0 && (t = e.slice(0, n)) !== "xmlns" && (e = e.slice(n + 1)), Ba.hasOwnProperty(t) ? { space: Ba[t], local: e } : e; -} -function H1(e) { - return function() { - var t = this.ownerDocument, n = this.namespaceURI; - return n === ys && t.documentElement.namespaceURI === ys ? t.createElement(e) : t.createElementNS(n, e); - }; -} -function D1(e) { - return function() { - return this.ownerDocument.createElementNS(e.space, e.local); - }; -} -function xu(e) { - var t = Li(e); - return (t.local ? D1 : H1)(t); -} -function A1() { -} -function Js(e) { - return e == null ? A1 : function() { - return this.querySelector(e); - }; -} -function V1(e) { - typeof e != "function" && (e = Js(e)); - for (var t = this._groups, n = t.length, r = new Array(n), o = 0; o < n; ++o) - for (var i = t[o], s = i.length, a = r[o] = new Array(s), l, u, c = 0; c < s; ++c) - (l = i[c]) && (u = e.call(l, l.__data__, c, i)) && ("__data__" in l && (u.__data__ = l.__data__), a[c] = u); - return new Rt(r, this._parents); -} -function O1(e) { - return e == null ? [] : Array.isArray(e) ? e : Array.from(e); -} -function L1() { - return []; -} -function bu(e) { - return e == null ? L1 : function() { - return this.querySelectorAll(e); - }; -} -function I1(e) { - return function() { - return O1(e.apply(this, arguments)); - }; -} -function z1(e) { - typeof e == "function" ? e = I1(e) : e = bu(e); - for (var t = this._groups, n = t.length, r = [], o = [], i = 0; i < n; ++i) - for (var s = t[i], a = s.length, l, u = 0; u < a; ++u) - (l = s[u]) && (r.push(e.call(l, l.__data__, u, s)), o.push(l)); - return new Rt(r, o); -} -function Cu(e) { - return function() { - return this.matches(e); - }; -} -function ku(e) { - return function(t) { - return t.matches(e); - }; -} -var R1 = Array.prototype.find; -function B1(e) { - return function() { - return R1.call(this.children, e); - }; -} -function Y1() { - return this.firstElementChild; -} -function Z1(e) { - return this.select(e == null ? Y1 : B1(typeof e == "function" ? e : ku(e))); -} -var X1 = Array.prototype.filter; -function W1() { - return Array.from(this.children); -} -function F1(e) { - return function() { - return X1.call(this.children, e); - }; -} -function K1(e) { - return this.selectAll(e == null ? W1 : F1(typeof e == "function" ? e : ku(e))); -} -function q1(e) { - typeof e != "function" && (e = Cu(e)); - for (var t = this._groups, n = t.length, r = new Array(n), o = 0; o < n; ++o) - for (var i = t[o], s = i.length, a = r[o] = [], l, u = 0; u < s; ++u) - (l = i[u]) && e.call(l, l.__data__, u, i) && a.push(l); - return new Rt(r, this._parents); -} -function Eu(e) { - return new Array(e.length); -} -function G1() { - return new Rt(this._enter || this._groups.map(Eu), this._parents); -} -function ai(e, t) { - this.ownerDocument = e.ownerDocument, this.namespaceURI = e.namespaceURI, this._next = null, this._parent = e, this.__data__ = t; -} -ai.prototype = { - constructor: ai, - appendChild: function(e) { - return this._parent.insertBefore(e, this._next); - }, - insertBefore: function(e, t) { - return this._parent.insertBefore(e, t); - }, - querySelector: function(e) { - return this._parent.querySelector(e); - }, - querySelectorAll: function(e) { - return this._parent.querySelectorAll(e); - } -}; -function U1(e) { - return function() { - return e; - }; -} -function j1(e, t, n, r, o, i) { - for (var s = 0, a, l = t.length, u = i.length; s < u; ++s) - (a = t[s]) ? (a.__data__ = i[s], r[s] = a) : n[s] = new ai(e, i[s]); - for (; s < l; ++s) - (a = t[s]) && (o[s] = a); -} -function J1(e, t, n, r, o, i, s) { - var a, l, u = /* @__PURE__ */ new Map(), c = t.length, f = i.length, d = new Array(c), g; - for (a = 0; a < c; ++a) - (l = t[a]) && (d[a] = g = s.call(l, l.__data__, a, t) + "", u.has(g) ? o[a] = l : u.set(g, l)); - for (a = 0; a < f; ++a) - g = s.call(e, i[a], a, i) + "", (l = u.get(g)) ? (r[a] = l, l.__data__ = i[a], u.delete(g)) : n[a] = new ai(e, i[a]); - for (a = 0; a < c; ++a) - (l = t[a]) && u.get(d[a]) === l && (o[a] = l); -} -function Q1(e) { - return e.__data__; -} -function eg(e, t) { - if (!arguments.length) return Array.from(this, Q1); - var n = t ? J1 : j1, r = this._parents, o = this._groups; - typeof e != "function" && (e = U1(e)); - for (var i = o.length, s = new Array(i), a = new Array(i), l = new Array(i), u = 0; u < i; ++u) { - var c = r[u], f = o[u], d = f.length, g = tg(e.call(c, c && c.__data__, u, r)), p = g.length, x = a[u] = new Array(p), k = s[u] = new Array(p), E = l[u] = new Array(d); - n(c, f, x, k, E, g, t); - for (var m = 0, _ = 0, v, b; m < p; ++m) - if (v = x[m]) { - for (m >= _ && (_ = m + 1); !(b = k[_]) && ++_ < p; ) ; - v._next = b || null; - } - } - return s = new Rt(s, r), s._enter = a, s._exit = l, s; -} -function tg(e) { - return typeof e == "object" && "length" in e ? e : Array.from(e); -} -function ng() { - return new Rt(this._exit || this._groups.map(Eu), this._parents); -} -function rg(e, t, n) { - var r = this.enter(), o = this, i = this.exit(); - return typeof e == "function" ? (r = e(r), r && (r = r.selection())) : r = r.append(e + ""), t != null && (o = t(o), o && (o = o.selection())), n == null ? i.remove() : n(i), r && o ? r.merge(o).order() : o; -} -function og(e) { - for (var t = e.selection ? e.selection() : e, n = this._groups, r = t._groups, o = n.length, i = r.length, s = Math.min(o, i), a = new Array(o), l = 0; l < s; ++l) - for (var u = n[l], c = r[l], f = u.length, d = a[l] = new Array(f), g, p = 0; p < f; ++p) - (g = u[p] || c[p]) && (d[p] = g); - for (; l < o; ++l) - a[l] = n[l]; - return new Rt(a, this._parents); -} -function ig() { - for (var e = this._groups, t = -1, n = e.length; ++t < n; ) - for (var r = e[t], o = r.length - 1, i = r[o], s; --o >= 0; ) - (s = r[o]) && (i && s.compareDocumentPosition(i) ^ 4 && i.parentNode.insertBefore(s, i), i = s); - return this; -} -function sg(e) { - e || (e = ag); - function t(f, d) { - return f && d ? e(f.__data__, d.__data__) : !f - !d; - } - for (var n = this._groups, r = n.length, o = new Array(r), i = 0; i < r; ++i) { - for (var s = n[i], a = s.length, l = o[i] = new Array(a), u, c = 0; c < a; ++c) - (u = s[c]) && (l[c] = u); - l.sort(t); - } - return new Rt(o, this._parents).order(); -} -function ag(e, t) { - return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; -} -function lg() { - var e = arguments[0]; - return arguments[0] = this, e.apply(null, arguments), this; -} -function ug() { - return Array.from(this); -} -function cg() { - for (var e = this._groups, t = 0, n = e.length; t < n; ++t) - for (var r = e[t], o = 0, i = r.length; o < i; ++o) { - var s = r[o]; - if (s) return s; - } - return null; -} -function dg() { - let e = 0; - for (const t of this) ++e; - return e; -} -function fg() { - return !this.node(); -} -function gg(e) { - for (var t = this._groups, n = 0, r = t.length; n < r; ++n) - for (var o = t[n], i = 0, s = o.length, a; i < s; ++i) - (a = o[i]) && e.call(a, a.__data__, i, o); - return this; -} -function hg(e) { - return function() { - this.removeAttribute(e); - }; -} -function vg(e) { - return function() { - this.removeAttributeNS(e.space, e.local); - }; -} -function pg(e, t) { - return function() { - this.setAttribute(e, t); - }; -} -function mg(e, t) { - return function() { - this.setAttributeNS(e.space, e.local, t); - }; -} -function yg(e, t) { - return function() { - var n = t.apply(this, arguments); - n == null ? this.removeAttribute(e) : this.setAttribute(e, n); - }; -} -function wg(e, t) { - return function() { - var n = t.apply(this, arguments); - n == null ? this.removeAttributeNS(e.space, e.local) : this.setAttributeNS(e.space, e.local, n); - }; -} -function _g(e, t) { - var n = Li(e); - if (arguments.length < 2) { - var r = this.node(); - return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n); - } - return this.each((t == null ? n.local ? vg : hg : typeof t == "function" ? n.local ? wg : yg : n.local ? mg : pg)(n, t)); -} -function $u(e) { - return e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView; -} -function xg(e) { - return function() { - this.style.removeProperty(e); - }; -} -function bg(e, t, n) { - return function() { - this.style.setProperty(e, t, n); - }; -} -function Cg(e, t, n) { - return function() { - var r = t.apply(this, arguments); - r == null ? this.style.removeProperty(e) : this.style.setProperty(e, r, n); - }; -} -function kg(e, t, n) { - return arguments.length > 1 ? this.each((t == null ? xg : typeof t == "function" ? Cg : bg)(e, t, n ?? "")) : Hr(this.node(), e); -} -function Hr(e, t) { - return e.style.getPropertyValue(t) || $u(e).getComputedStyle(e, null).getPropertyValue(t); -} -function Eg(e) { - return function() { - delete this[e]; - }; -} -function $g(e, t) { - return function() { - this[e] = t; - }; -} -function Sg(e, t) { - return function() { - var n = t.apply(this, arguments); - n == null ? delete this[e] : this[e] = n; - }; -} -function Pg(e, t) { - return arguments.length > 1 ? this.each((t == null ? Eg : typeof t == "function" ? Sg : $g)(e, t)) : this.node()[e]; -} -function Su(e) { - return e.trim().split(/^|\s+/); -} -function Qs(e) { - return e.classList || new Pu(e); -} -function Pu(e) { - this._node = e, this._names = Su(e.getAttribute("class") || ""); -} -Pu.prototype = { - add: function(e) { - var t = this._names.indexOf(e); - t < 0 && (this._names.push(e), this._node.setAttribute("class", this._names.join(" "))); - }, - remove: function(e) { - var t = this._names.indexOf(e); - t >= 0 && (this._names.splice(t, 1), this._node.setAttribute("class", this._names.join(" "))); - }, - contains: function(e) { - return this._names.indexOf(e) >= 0; - } -}; -function Nu(e, t) { - for (var n = Qs(e), r = -1, o = t.length; ++r < o; ) n.add(t[r]); -} -function Tu(e, t) { - for (var n = Qs(e), r = -1, o = t.length; ++r < o; ) n.remove(t[r]); -} -function Ng(e) { - return function() { - Nu(this, e); - }; -} -function Tg(e) { - return function() { - Tu(this, e); - }; -} -function Mg(e, t) { - return function() { - (t.apply(this, arguments) ? Nu : Tu)(this, e); - }; -} -function Hg(e, t) { - var n = Su(e + ""); - if (arguments.length < 2) { - for (var r = Qs(this.node()), o = -1, i = n.length; ++o < i; ) if (!r.contains(n[o])) return !1; - return !0; - } - return this.each((typeof t == "function" ? Mg : t ? Ng : Tg)(n, t)); -} -function Dg() { - this.textContent = ""; -} -function Ag(e) { - return function() { - this.textContent = e; - }; -} -function Vg(e) { - return function() { - var t = e.apply(this, arguments); - this.textContent = t ?? ""; - }; -} -function Og(e) { - return arguments.length ? this.each(e == null ? Dg : (typeof e == "function" ? Vg : Ag)(e)) : this.node().textContent; -} -function Lg() { - this.innerHTML = ""; -} -function Ig(e) { - return function() { - this.innerHTML = e; - }; -} -function zg(e) { - return function() { - var t = e.apply(this, arguments); - this.innerHTML = t ?? ""; - }; -} -function Rg(e) { - return arguments.length ? this.each(e == null ? Lg : (typeof e == "function" ? zg : Ig)(e)) : this.node().innerHTML; -} -function Bg() { - this.nextSibling && this.parentNode.appendChild(this); -} -function Yg() { - return this.each(Bg); -} -function Zg() { - this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); -} -function Xg() { - return this.each(Zg); -} -function Wg(e) { - var t = typeof e == "function" ? e : xu(e); - return this.select(function() { - return this.appendChild(t.apply(this, arguments)); - }); -} -function Fg() { - return null; -} -function Kg(e, t) { - var n = typeof e == "function" ? e : xu(e), r = t == null ? Fg : typeof t == "function" ? t : Js(t); - return this.select(function() { - return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); - }); -} -function qg() { - var e = this.parentNode; - e && e.removeChild(this); -} -function Gg() { - return this.each(qg); -} -function Ug() { - var e = this.cloneNode(!1), t = this.parentNode; - return t ? t.insertBefore(e, this.nextSibling) : e; -} -function jg() { - var e = this.cloneNode(!0), t = this.parentNode; - return t ? t.insertBefore(e, this.nextSibling) : e; -} -function Jg(e) { - return this.select(e ? jg : Ug); -} -function Qg(e) { - return arguments.length ? this.property("__data__", e) : this.node().__data__; -} -function eh(e) { - return function(t) { - e.call(this, t, this.__data__); - }; -} -function th(e) { - return e.trim().split(/^|\s+/).map(function(t) { - var n = "", r = t.indexOf("."); - return r >= 0 && (n = t.slice(r + 1), t = t.slice(0, r)), { type: t, name: n }; - }); -} -function nh(e) { - return function() { - var t = this.__on; - if (t) { - for (var n = 0, r = -1, o = t.length, i; n < o; ++n) - i = t[n], (!e.type || i.type === e.type) && i.name === e.name ? this.removeEventListener(i.type, i.listener, i.options) : t[++r] = i; - ++r ? t.length = r : delete this.__on; - } - }; -} -function rh(e, t, n) { - return function() { - var r = this.__on, o, i = eh(t); - if (r) { - for (var s = 0, a = r.length; s < a; ++s) - if ((o = r[s]).type === e.type && o.name === e.name) { - this.removeEventListener(o.type, o.listener, o.options), this.addEventListener(o.type, o.listener = i, o.options = n), o.value = t; - return; - } - } - this.addEventListener(e.type, i, n), o = { type: e.type, name: e.name, value: t, listener: i, options: n }, r ? r.push(o) : this.__on = [o]; - }; -} -function oh(e, t, n) { - var r = th(e + ""), o, i = r.length, s; - if (arguments.length < 2) { - var a = this.node().__on; - if (a) { - for (var l = 0, u = a.length, c; l < u; ++l) - for (o = 0, c = a[l]; o < i; ++o) - if ((s = r[o]).type === c.type && s.name === c.name) - return c.value; - } - return; - } - for (a = t ? rh : nh, o = 0; o < i; ++o) this.each(a(r[o], t, n)); - return this; -} -function Mu(e, t, n) { - var r = $u(e), o = r.CustomEvent; - typeof o == "function" ? o = new o(t, n) : (o = r.document.createEvent("Event"), n ? (o.initEvent(t, n.bubbles, n.cancelable), o.detail = n.detail) : o.initEvent(t, !1, !1)), e.dispatchEvent(o); -} -function ih(e, t) { - return function() { - return Mu(this, e, t); - }; -} -function sh(e, t) { - return function() { - return Mu(this, e, t.apply(this, arguments)); - }; -} -function ah(e, t) { - return this.each((typeof t == "function" ? sh : ih)(e, t)); -} -function* lh() { - for (var e = this._groups, t = 0, n = e.length; t < n; ++t) - for (var r = e[t], o = 0, i = r.length, s; o < i; ++o) - (s = r[o]) && (yield s); -} -var Hu = [null]; -function Rt(e, t) { - this._groups = e, this._parents = t; -} -function Eo() { - return new Rt([[document.documentElement]], Hu); -} -function uh() { - return this; -} -Rt.prototype = Eo.prototype = { - constructor: Rt, - select: V1, - selectAll: z1, - selectChild: Z1, - selectChildren: K1, - filter: q1, - data: eg, - enter: G1, - exit: ng, - join: rg, - merge: og, - selection: uh, - order: ig, - sort: sg, - call: lg, - nodes: ug, - node: cg, - size: dg, - empty: fg, - each: gg, - attr: _g, - style: kg, - property: Pg, - classed: Hg, - text: Og, - html: Rg, - raise: Yg, - lower: Xg, - append: Wg, - insert: Kg, - remove: Gg, - clone: Jg, - datum: Qg, - on: oh, - dispatch: ah, - [Symbol.iterator]: lh -}; -function Wt(e) { - return typeof e == "string" ? new Rt([[document.querySelector(e)]], [document.documentElement]) : new Rt([[e]], Hu); -} -function ch(e) { - let t; - for (; t = e.sourceEvent; ) e = t; - return e; -} -function Jt(e, t) { - if (e = ch(e), t === void 0 && (t = e.currentTarget), t) { - var n = t.ownerSVGElement || t; - if (n.createSVGPoint) { - var r = n.createSVGPoint(); - return r.x = e.clientX, r.y = e.clientY, r = r.matrixTransform(t.getScreenCTM().inverse()), [r.x, r.y]; - } - if (t.getBoundingClientRect) { - var o = t.getBoundingClientRect(); - return [e.clientX - o.left - t.clientLeft, e.clientY - o.top - t.clientTop]; - } - } - return [e.pageX, e.pageY]; -} -const dh = { passive: !1 }, co = { capture: !0, passive: !1 }; -function Ji(e) { - e.stopImmediatePropagation(); -} -function xr(e) { - e.preventDefault(), e.stopImmediatePropagation(); -} -function Du(e) { - var t = e.document.documentElement, n = Wt(e).on("dragstart.drag", xr, co); - "onselectstart" in t ? n.on("selectstart.drag", xr, co) : (t.__noselect = t.style.MozUserSelect, t.style.MozUserSelect = "none"); -} -function Au(e, t) { - var n = e.document.documentElement, r = Wt(e).on("dragstart.drag", null); - t && (r.on("click.drag", xr, co), setTimeout(function() { - r.on("click.drag", null); - }, 0)), "onselectstart" in n ? r.on("selectstart.drag", null) : (n.style.MozUserSelect = n.__noselect, delete n.__noselect); -} -const Ro = (e) => () => e; -function ws(e, { - sourceEvent: t, - subject: n, - target: r, - identifier: o, - active: i, - x: s, - y: a, - dx: l, - dy: u, - dispatch: c -}) { - Object.defineProperties(this, { - type: { value: e, enumerable: !0, configurable: !0 }, - sourceEvent: { value: t, enumerable: !0, configurable: !0 }, - subject: { value: n, enumerable: !0, configurable: !0 }, - target: { value: r, enumerable: !0, configurable: !0 }, - identifier: { value: o, enumerable: !0, configurable: !0 }, - active: { value: i, enumerable: !0, configurable: !0 }, - x: { value: s, enumerable: !0, configurable: !0 }, - y: { value: a, enumerable: !0, configurable: !0 }, - dx: { value: l, enumerable: !0, configurable: !0 }, - dy: { value: u, enumerable: !0, configurable: !0 }, - _: { value: c } - }); -} -ws.prototype.on = function() { - var e = this._.on.apply(this._, arguments); - return e === this._ ? this : e; -}; -function fh(e) { - return !e.ctrlKey && !e.button; -} -function gh() { - return this.parentNode; -} -function hh(e, t) { - return t ?? { x: e.x, y: e.y }; -} -function vh() { - return navigator.maxTouchPoints || "ontouchstart" in this; -} -function ph() { - var e = fh, t = gh, n = hh, r = vh, o = {}, i = Oi("start", "drag", "end"), s = 0, a, l, u, c, f = 0; - function d(v) { - v.on("mousedown.drag", g).filter(r).on("touchstart.drag", k).on("touchmove.drag", E, dh).on("touchend.drag touchcancel.drag", m).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)"); - } - function g(v, b) { - if (!(c || !e.call(this, v, b))) { - var N = _(this, t.call(this, v, b), v, b, "mouse"); - N && (Wt(v.view).on("mousemove.drag", p, co).on("mouseup.drag", x, co), Du(v.view), Ji(v), u = !1, a = v.clientX, l = v.clientY, N("start", v)); - } - } - function p(v) { - if (xr(v), !u) { - var b = v.clientX - a, N = v.clientY - l; - u = b * b + N * N > f; - } - o.mouse("drag", v); - } - function x(v) { - Wt(v.view).on("mousemove.drag mouseup.drag", null), Au(v.view, u), xr(v), o.mouse("end", v); - } - function k(v, b) { - if (e.call(this, v, b)) { - var N = v.changedTouches, $ = t.call(this, v, b), T = N.length, A, D; - for (A = 0; A < T; ++A) - (D = _(this, $, v, b, N[A].identifier, N[A])) && (Ji(v), D("start", v, N[A])); - } - } - function E(v) { - var b = v.changedTouches, N = b.length, $, T; - for ($ = 0; $ < N; ++$) - (T = o[b[$].identifier]) && (xr(v), T("drag", v, b[$])); - } - function m(v) { - var b = v.changedTouches, N = b.length, $, T; - for (c && clearTimeout(c), c = setTimeout(function() { - c = null; - }, 500), $ = 0; $ < N; ++$) - (T = o[b[$].identifier]) && (Ji(v), T("end", v, b[$])); - } - function _(v, b, N, $, T, A) { - var D = i.copy(), O = Jt(A || N, b), V, z, S; - if ((S = n.call(v, new ws("beforestart", { - sourceEvent: N, - target: d, - identifier: T, - active: s, - x: O[0], - y: O[1], - dx: 0, - dy: 0, - dispatch: D - }), $)) != null) - return V = S.x - O[0] || 0, z = S.y - O[1] || 0, function H(C, P, M) { - var I = O, B; - switch (C) { - case "start": - o[T] = H, B = s++; - break; - case "end": - delete o[T], --s; - // falls through - case "drag": - O = Jt(M || P, b), B = s; - break; - } - D.call( - C, - v, - new ws(C, { - sourceEvent: P, - subject: S, - target: d, - identifier: T, - active: B, - x: O[0] + V, - y: O[1] + z, - dx: O[0] - I[0], - dy: O[1] - I[1], - dispatch: D - }), - $ - ); - }; - } - return d.filter = function(v) { - return arguments.length ? (e = typeof v == "function" ? v : Ro(!!v), d) : e; - }, d.container = function(v) { - return arguments.length ? (t = typeof v == "function" ? v : Ro(v), d) : t; - }, d.subject = function(v) { - return arguments.length ? (n = typeof v == "function" ? v : Ro(v), d) : n; - }, d.touchable = function(v) { - return arguments.length ? (r = typeof v == "function" ? v : Ro(!!v), d) : r; - }, d.on = function() { - var v = i.on.apply(i, arguments); - return v === i ? d : v; - }, d.clickDistance = function(v) { - return arguments.length ? (f = (v = +v) * v, d) : Math.sqrt(f); - }, d; -} -function ea(e, t, n) { - e.prototype = t.prototype = n, n.constructor = e; -} -function Vu(e, t) { - var n = Object.create(e.prototype); - for (var r in t) n[r] = t[r]; - return n; -} -function $o() { -} -var fo = 0.7, li = 1 / fo, br = "\\s*([+-]?\\d+)\\s*", go = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", fn = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", mh = /^#([0-9a-f]{3,8})$/, yh = new RegExp(`^rgb\\(${br},${br},${br}\\)$`), wh = new RegExp(`^rgb\\(${fn},${fn},${fn}\\)$`), _h = new RegExp(`^rgba\\(${br},${br},${br},${go}\\)$`), xh = new RegExp(`^rgba\\(${fn},${fn},${fn},${go}\\)$`), bh = new RegExp(`^hsl\\(${go},${fn},${fn}\\)$`), Ch = new RegExp(`^hsla\\(${go},${fn},${fn},${go}\\)$`), Ya = { - aliceblue: 15792383, - antiquewhite: 16444375, - aqua: 65535, - aquamarine: 8388564, - azure: 15794175, - beige: 16119260, - bisque: 16770244, - black: 0, - blanchedalmond: 16772045, - blue: 255, - blueviolet: 9055202, - brown: 10824234, - burlywood: 14596231, - cadetblue: 6266528, - chartreuse: 8388352, - chocolate: 13789470, - coral: 16744272, - cornflowerblue: 6591981, - cornsilk: 16775388, - crimson: 14423100, - cyan: 65535, - darkblue: 139, - darkcyan: 35723, - darkgoldenrod: 12092939, - darkgray: 11119017, - darkgreen: 25600, - darkgrey: 11119017, - darkkhaki: 12433259, - darkmagenta: 9109643, - darkolivegreen: 5597999, - darkorange: 16747520, - darkorchid: 10040012, - darkred: 9109504, - darksalmon: 15308410, - darkseagreen: 9419919, - darkslateblue: 4734347, - darkslategray: 3100495, - darkslategrey: 3100495, - darkturquoise: 52945, - darkviolet: 9699539, - deeppink: 16716947, - deepskyblue: 49151, - dimgray: 6908265, - dimgrey: 6908265, - dodgerblue: 2003199, - firebrick: 11674146, - floralwhite: 16775920, - forestgreen: 2263842, - fuchsia: 16711935, - gainsboro: 14474460, - ghostwhite: 16316671, - gold: 16766720, - goldenrod: 14329120, - gray: 8421504, - green: 32768, - greenyellow: 11403055, - grey: 8421504, - honeydew: 15794160, - hotpink: 16738740, - indianred: 13458524, - indigo: 4915330, - ivory: 16777200, - khaki: 15787660, - lavender: 15132410, - lavenderblush: 16773365, - lawngreen: 8190976, - lemonchiffon: 16775885, - lightblue: 11393254, - lightcoral: 15761536, - lightcyan: 14745599, - lightgoldenrodyellow: 16448210, - lightgray: 13882323, - lightgreen: 9498256, - lightgrey: 13882323, - lightpink: 16758465, - lightsalmon: 16752762, - lightseagreen: 2142890, - lightskyblue: 8900346, - lightslategray: 7833753, - lightslategrey: 7833753, - lightsteelblue: 11584734, - lightyellow: 16777184, - lime: 65280, - limegreen: 3329330, - linen: 16445670, - magenta: 16711935, - maroon: 8388608, - mediumaquamarine: 6737322, - mediumblue: 205, - mediumorchid: 12211667, - mediumpurple: 9662683, - mediumseagreen: 3978097, - mediumslateblue: 8087790, - mediumspringgreen: 64154, - mediumturquoise: 4772300, - mediumvioletred: 13047173, - midnightblue: 1644912, - mintcream: 16121850, - mistyrose: 16770273, - moccasin: 16770229, - navajowhite: 16768685, - navy: 128, - oldlace: 16643558, - olive: 8421376, - olivedrab: 7048739, - orange: 16753920, - orangered: 16729344, - orchid: 14315734, - palegoldenrod: 15657130, - palegreen: 10025880, - paleturquoise: 11529966, - palevioletred: 14381203, - papayawhip: 16773077, - peachpuff: 16767673, - peru: 13468991, - pink: 16761035, - plum: 14524637, - powderblue: 11591910, - purple: 8388736, - rebeccapurple: 6697881, - red: 16711680, - rosybrown: 12357519, - royalblue: 4286945, - saddlebrown: 9127187, - salmon: 16416882, - sandybrown: 16032864, - seagreen: 3050327, - seashell: 16774638, - sienna: 10506797, - silver: 12632256, - skyblue: 8900331, - slateblue: 6970061, - slategray: 7372944, - slategrey: 7372944, - snow: 16775930, - springgreen: 65407, - steelblue: 4620980, - tan: 13808780, - teal: 32896, - thistle: 14204888, - tomato: 16737095, - turquoise: 4251856, - violet: 15631086, - wheat: 16113331, - white: 16777215, - whitesmoke: 16119285, - yellow: 16776960, - yellowgreen: 10145074 -}; -ea($o, ho, { - copy(e) { - return Object.assign(new this.constructor(), this, e); - }, - displayable() { - return this.rgb().displayable(); - }, - hex: Za, - // Deprecated! Use color.formatHex. - formatHex: Za, - formatHex8: kh, - formatHsl: Eh, - formatRgb: Xa, - toString: Xa -}); -function Za() { - return this.rgb().formatHex(); -} -function kh() { - return this.rgb().formatHex8(); -} -function Eh() { - return Ou(this).formatHsl(); -} -function Xa() { - return this.rgb().formatRgb(); -} -function ho(e) { - var t, n; - return e = (e + "").trim().toLowerCase(), (t = mh.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? Wa(t) : n === 3 ? new Mt(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? Bo(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? Bo(t >> 12 & 15 | t >> 8 & 240, t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, ((t & 15) << 4 | t & 15) / 255) : null) : (t = yh.exec(e)) ? new Mt(t[1], t[2], t[3], 1) : (t = wh.exec(e)) ? new Mt(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = _h.exec(e)) ? Bo(t[1], t[2], t[3], t[4]) : (t = xh.exec(e)) ? Bo(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = bh.exec(e)) ? qa(t[1], t[2] / 100, t[3] / 100, 1) : (t = Ch.exec(e)) ? qa(t[1], t[2] / 100, t[3] / 100, t[4]) : Ya.hasOwnProperty(e) ? Wa(Ya[e]) : e === "transparent" ? new Mt(NaN, NaN, NaN, 0) : null; -} -function Wa(e) { - return new Mt(e >> 16 & 255, e >> 8 & 255, e & 255, 1); -} -function Bo(e, t, n, r) { - return r <= 0 && (e = t = n = NaN), new Mt(e, t, n, r); -} -function $h(e) { - return e instanceof $o || (e = ho(e)), e ? (e = e.rgb(), new Mt(e.r, e.g, e.b, e.opacity)) : new Mt(); -} -function _s(e, t, n, r) { - return arguments.length === 1 ? $h(e) : new Mt(e, t, n, r ?? 1); -} -function Mt(e, t, n, r) { - this.r = +e, this.g = +t, this.b = +n, this.opacity = +r; -} -ea(Mt, _s, Vu($o, { - brighter(e) { - return e = e == null ? li : Math.pow(li, e), new Mt(this.r * e, this.g * e, this.b * e, this.opacity); - }, - darker(e) { - return e = e == null ? fo : Math.pow(fo, e), new Mt(this.r * e, this.g * e, this.b * e, this.opacity); - }, - rgb() { - return this; - }, - clamp() { - return new Mt(ir(this.r), ir(this.g), ir(this.b), ui(this.opacity)); - }, - displayable() { - return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1; - }, - hex: Fa, - // Deprecated! Use color.formatHex. - formatHex: Fa, - formatHex8: Sh, - formatRgb: Ka, - toString: Ka -})); -function Fa() { - return `#${rr(this.r)}${rr(this.g)}${rr(this.b)}`; -} -function Sh() { - return `#${rr(this.r)}${rr(this.g)}${rr(this.b)}${rr((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; -} -function Ka() { - const e = ui(this.opacity); - return `${e === 1 ? "rgb(" : "rgba("}${ir(this.r)}, ${ir(this.g)}, ${ir(this.b)}${e === 1 ? ")" : `, ${e})`}`; -} -function ui(e) { - return isNaN(e) ? 1 : Math.max(0, Math.min(1, e)); -} -function ir(e) { - return Math.max(0, Math.min(255, Math.round(e) || 0)); -} -function rr(e) { - return e = ir(e), (e < 16 ? "0" : "") + e.toString(16); -} -function qa(e, t, n, r) { - return r <= 0 ? e = t = n = NaN : n <= 0 || n >= 1 ? e = t = NaN : t <= 0 && (e = NaN), new en(e, t, n, r); -} -function Ou(e) { - if (e instanceof en) return new en(e.h, e.s, e.l, e.opacity); - if (e instanceof $o || (e = ho(e)), !e) return new en(); - if (e instanceof en) return e; - e = e.rgb(); - var t = e.r / 255, n = e.g / 255, r = e.b / 255, o = Math.min(t, n, r), i = Math.max(t, n, r), s = NaN, a = i - o, l = (i + o) / 2; - return a ? (t === i ? s = (n - r) / a + (n < r) * 6 : n === i ? s = (r - t) / a + 2 : s = (t - n) / a + 4, a /= l < 0.5 ? i + o : 2 - i - o, s *= 60) : a = l > 0 && l < 1 ? 0 : s, new en(s, a, l, e.opacity); -} -function Ph(e, t, n, r) { - return arguments.length === 1 ? Ou(e) : new en(e, t, n, r ?? 1); -} -function en(e, t, n, r) { - this.h = +e, this.s = +t, this.l = +n, this.opacity = +r; -} -ea(en, Ph, Vu($o, { - brighter(e) { - return e = e == null ? li : Math.pow(li, e), new en(this.h, this.s, this.l * e, this.opacity); - }, - darker(e) { - return e = e == null ? fo : Math.pow(fo, e), new en(this.h, this.s, this.l * e, this.opacity); - }, - rgb() { - var e = this.h % 360 + (this.h < 0) * 360, t = isNaN(e) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * t, o = 2 * n - r; - return new Mt( - Qi(e >= 240 ? e - 240 : e + 120, o, r), - Qi(e, o, r), - Qi(e < 120 ? e + 240 : e - 120, o, r), - this.opacity - ); - }, - clamp() { - return new en(Ga(this.h), Yo(this.s), Yo(this.l), ui(this.opacity)); - }, - displayable() { - return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1; - }, - formatHsl() { - const e = ui(this.opacity); - return `${e === 1 ? "hsl(" : "hsla("}${Ga(this.h)}, ${Yo(this.s) * 100}%, ${Yo(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`; - } -})); -function Ga(e) { - return e = (e || 0) % 360, e < 0 ? e + 360 : e; -} -function Yo(e) { - return Math.max(0, Math.min(1, e || 0)); -} -function Qi(e, t, n) { - return (e < 60 ? t + (n - t) * e / 60 : e < 180 ? n : e < 240 ? t + (n - t) * (240 - e) / 60 : t) * 255; -} -const Lu = (e) => () => e; -function Nh(e, t) { - return function(n) { - return e + n * t; - }; -} -function Th(e, t, n) { - return e = Math.pow(e, n), t = Math.pow(t, n) - e, n = 1 / n, function(r) { - return Math.pow(e + r * t, n); - }; -} -function Mh(e) { - return (e = +e) == 1 ? Iu : function(t, n) { - return n - t ? Th(t, n, e) : Lu(isNaN(t) ? n : t); - }; -} -function Iu(e, t) { - var n = t - e; - return n ? Nh(e, n) : Lu(isNaN(e) ? t : e); -} -const Ua = function e(t) { - var n = Mh(t); - function r(o, i) { - var s = n((o = _s(o)).r, (i = _s(i)).r), a = n(o.g, i.g), l = n(o.b, i.b), u = Iu(o.opacity, i.opacity); - return function(c) { - return o.r = s(c), o.g = a(c), o.b = l(c), o.opacity = u(c), o + ""; - }; - } - return r.gamma = e, r; -}(1); -function Bn(e, t) { - return e = +e, t = +t, function(n) { - return e * (1 - n) + t * n; - }; -} -var xs = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, es = new RegExp(xs.source, "g"); -function Hh(e) { - return function() { - return e; - }; -} -function Dh(e) { - return function(t) { - return e(t) + ""; - }; -} -function Ah(e, t) { - var n = xs.lastIndex = es.lastIndex = 0, r, o, i, s = -1, a = [], l = []; - for (e = e + "", t = t + ""; (r = xs.exec(e)) && (o = es.exec(t)); ) - (i = o.index) > n && (i = t.slice(n, i), a[s] ? a[s] += i : a[++s] = i), (r = r[0]) === (o = o[0]) ? a[s] ? a[s] += o : a[++s] = o : (a[++s] = null, l.push({ i: s, x: Bn(r, o) })), n = es.lastIndex; - return n < t.length && (i = t.slice(n), a[s] ? a[s] += i : a[++s] = i), a.length < 2 ? l[0] ? Dh(l[0].x) : Hh(t) : (t = l.length, function(u) { - for (var c = 0, f; c < t; ++c) a[(f = l[c]).i] = f.x(u); - return a.join(""); - }); -} -var ja = 180 / Math.PI, bs = { - translateX: 0, - translateY: 0, - rotate: 0, - skewX: 0, - scaleX: 1, - scaleY: 1 -}; -function zu(e, t, n, r, o, i) { - var s, a, l; - return (s = Math.sqrt(e * e + t * t)) && (e /= s, t /= s), (l = e * n + t * r) && (n -= e * l, r -= t * l), (a = Math.sqrt(n * n + r * r)) && (n /= a, r /= a, l /= a), e * r < t * n && (e = -e, t = -t, l = -l, s = -s), { - translateX: o, - translateY: i, - rotate: Math.atan2(t, e) * ja, - skewX: Math.atan(l) * ja, - scaleX: s, - scaleY: a - }; -} -var Zo; -function Vh(e) { - const t = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(e + ""); - return t.isIdentity ? bs : zu(t.a, t.b, t.c, t.d, t.e, t.f); -} -function Oh(e) { - return e == null || (Zo || (Zo = document.createElementNS("http://www.w3.org/2000/svg", "g")), Zo.setAttribute("transform", e), !(e = Zo.transform.baseVal.consolidate())) ? bs : (e = e.matrix, zu(e.a, e.b, e.c, e.d, e.e, e.f)); -} -function Ru(e, t, n, r) { - function o(u) { - return u.length ? u.pop() + " " : ""; - } - function i(u, c, f, d, g, p) { - if (u !== f || c !== d) { - var x = g.push("translate(", null, t, null, n); - p.push({ i: x - 4, x: Bn(u, f) }, { i: x - 2, x: Bn(c, d) }); - } else (f || d) && g.push("translate(" + f + t + d + n); - } - function s(u, c, f, d) { - u !== c ? (u - c > 180 ? c += 360 : c - u > 180 && (u += 360), d.push({ i: f.push(o(f) + "rotate(", null, r) - 2, x: Bn(u, c) })) : c && f.push(o(f) + "rotate(" + c + r); - } - function a(u, c, f, d) { - u !== c ? d.push({ i: f.push(o(f) + "skewX(", null, r) - 2, x: Bn(u, c) }) : c && f.push(o(f) + "skewX(" + c + r); - } - function l(u, c, f, d, g, p) { - if (u !== f || c !== d) { - var x = g.push(o(g) + "scale(", null, ",", null, ")"); - p.push({ i: x - 4, x: Bn(u, f) }, { i: x - 2, x: Bn(c, d) }); - } else (f !== 1 || d !== 1) && g.push(o(g) + "scale(" + f + "," + d + ")"); - } - return function(u, c) { - var f = [], d = []; - return u = e(u), c = e(c), i(u.translateX, u.translateY, c.translateX, c.translateY, f, d), s(u.rotate, c.rotate, f, d), a(u.skewX, c.skewX, f, d), l(u.scaleX, u.scaleY, c.scaleX, c.scaleY, f, d), u = c = null, function(g) { - for (var p = -1, x = d.length, k; ++p < x; ) f[(k = d[p]).i] = k.x(g); - return f.join(""); - }; - }; -} -var Lh = Ru(Vh, "px, ", "px)", "deg)"), Ih = Ru(Oh, ", ", ")", ")"), zh = 1e-12; -function Ja(e) { - return ((e = Math.exp(e)) + 1 / e) / 2; -} -function Rh(e) { - return ((e = Math.exp(e)) - 1 / e) / 2; -} -function Bh(e) { - return ((e = Math.exp(2 * e)) - 1) / (e + 1); -} -const Yh = function e(t, n, r) { - function o(i, s) { - var a = i[0], l = i[1], u = i[2], c = s[0], f = s[1], d = s[2], g = c - a, p = f - l, x = g * g + p * p, k, E; - if (x < zh) - E = Math.log(d / u) / t, k = function($) { - return [ - a + $ * g, - l + $ * p, - u * Math.exp(t * $ * E) - ]; - }; - else { - var m = Math.sqrt(x), _ = (d * d - u * u + r * x) / (2 * u * n * m), v = (d * d - u * u - r * x) / (2 * d * n * m), b = Math.log(Math.sqrt(_ * _ + 1) - _), N = Math.log(Math.sqrt(v * v + 1) - v); - E = (N - b) / t, k = function($) { - var T = $ * E, A = Ja(b), D = u / (n * m) * (A * Bh(t * T + b) - Rh(b)); - return [ - a + D * g, - l + D * p, - u * A / Ja(t * T + b) - ]; - }; - } - return k.duration = E * 1e3 * t / Math.SQRT2, k; - } - return o.rho = function(i) { - var s = Math.max(1e-3, +i), a = s * s, l = a * a; - return e(s, a, l); - }, o; -}(Math.SQRT2, 2, 4); -var Dr = 0, to = 0, Jr = 0, Bu = 1e3, ci, no, di = 0, ur = 0, Ii = 0, vo = typeof performance == "object" && performance.now ? performance : Date, Yu = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e) { - setTimeout(e, 17); -}; -function ta() { - return ur || (Yu(Zh), ur = vo.now() + Ii); -} -function Zh() { - ur = 0; -} -function fi() { - this._call = this._time = this._next = null; -} -fi.prototype = Zu.prototype = { - constructor: fi, - restart: function(e, t, n) { - if (typeof e != "function") throw new TypeError("callback is not a function"); - n = (n == null ? ta() : +n) + (t == null ? 0 : +t), !this._next && no !== this && (no ? no._next = this : ci = this, no = this), this._call = e, this._time = n, Cs(); - }, - stop: function() { - this._call && (this._call = null, this._time = 1 / 0, Cs()); - } -}; -function Zu(e, t, n) { - var r = new fi(); - return r.restart(e, t, n), r; -} -function Xh() { - ta(), ++Dr; - for (var e = ci, t; e; ) - (t = ur - e._time) >= 0 && e._call.call(void 0, t), e = e._next; - --Dr; -} -function Qa() { - ur = (di = vo.now()) + Ii, Dr = to = 0; - try { - Xh(); - } finally { - Dr = 0, Fh(), ur = 0; - } -} -function Wh() { - var e = vo.now(), t = e - di; - t > Bu && (Ii -= t, di = e); -} -function Fh() { - for (var e, t = ci, n, r = 1 / 0; t; ) - t._call ? (r > t._time && (r = t._time), e = t, t = t._next) : (n = t._next, t._next = null, t = e ? e._next = n : ci = n); - no = e, Cs(r); -} -function Cs(e) { - if (!Dr) { - to && (to = clearTimeout(to)); - var t = e - ur; - t > 24 ? (e < 1 / 0 && (to = setTimeout(Qa, e - vo.now() - Ii)), Jr && (Jr = clearInterval(Jr))) : (Jr || (di = vo.now(), Jr = setInterval(Wh, Bu)), Dr = 1, Yu(Qa)); - } -} -function el(e, t, n) { - var r = new fi(); - return t = t == null ? 0 : +t, r.restart((o) => { - r.stop(), e(o + t); - }, t, n), r; -} -var Kh = Oi("start", "end", "cancel", "interrupt"), qh = [], Xu = 0, tl = 1, ks = 2, Go = 3, nl = 4, Es = 5, Uo = 6; -function zi(e, t, n, r, o, i) { - var s = e.__transition; - if (!s) e.__transition = {}; - else if (n in s) return; - Gh(e, n, { - name: t, - index: r, - // For context during callback. - group: o, - // For context during callback. - on: Kh, - tween: qh, - time: i.time, - delay: i.delay, - duration: i.duration, - ease: i.ease, - timer: null, - state: Xu - }); -} -function na(e, t) { - var n = an(e, t); - if (n.state > Xu) throw new Error("too late; already scheduled"); - return n; -} -function bn(e, t) { - var n = an(e, t); - if (n.state > Go) throw new Error("too late; already running"); - return n; -} -function an(e, t) { - var n = e.__transition; - if (!n || !(n = n[t])) throw new Error("transition not found"); - return n; -} -function Gh(e, t, n) { - var r = e.__transition, o; - r[t] = n, n.timer = Zu(i, 0, n.time); - function i(u) { - n.state = tl, n.timer.restart(s, n.delay, n.time), n.delay <= u && s(u - n.delay); - } - function s(u) { - var c, f, d, g; - if (n.state !== tl) return l(); - for (c in r) - if (g = r[c], g.name === n.name) { - if (g.state === Go) return el(s); - g.state === nl ? (g.state = Uo, g.timer.stop(), g.on.call("interrupt", e, e.__data__, g.index, g.group), delete r[c]) : +c < t && (g.state = Uo, g.timer.stop(), g.on.call("cancel", e, e.__data__, g.index, g.group), delete r[c]); - } - if (el(function() { - n.state === Go && (n.state = nl, n.timer.restart(a, n.delay, n.time), a(u)); - }), n.state = ks, n.on.call("start", e, e.__data__, n.index, n.group), n.state === ks) { - for (n.state = Go, o = new Array(d = n.tween.length), c = 0, f = -1; c < d; ++c) - (g = n.tween[c].value.call(e, e.__data__, n.index, n.group)) && (o[++f] = g); - o.length = f + 1; - } - } - function a(u) { - for (var c = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = Es, 1), f = -1, d = o.length; ++f < d; ) - o[f].call(e, c); - n.state === Es && (n.on.call("end", e, e.__data__, n.index, n.group), l()); - } - function l() { - n.state = Uo, n.timer.stop(), delete r[t]; - for (var u in r) return; - delete e.__transition; - } -} -function jo(e, t) { - var n = e.__transition, r, o, i = !0, s; - if (n) { - t = t == null ? null : t + ""; - for (s in n) { - if ((r = n[s]).name !== t) { - i = !1; - continue; - } - o = r.state > ks && r.state < Es, r.state = Uo, r.timer.stop(), r.on.call(o ? "interrupt" : "cancel", e, e.__data__, r.index, r.group), delete n[s]; - } - i && delete e.__transition; - } -} -function Uh(e) { - return this.each(function() { - jo(this, e); - }); -} -function jh(e, t) { - var n, r; - return function() { - var o = bn(this, e), i = o.tween; - if (i !== n) { - r = n = i; - for (var s = 0, a = r.length; s < a; ++s) - if (r[s].name === t) { - r = r.slice(), r.splice(s, 1); - break; - } - } - o.tween = r; - }; -} -function Jh(e, t, n) { - var r, o; - if (typeof n != "function") throw new Error(); - return function() { - var i = bn(this, e), s = i.tween; - if (s !== r) { - o = (r = s).slice(); - for (var a = { name: t, value: n }, l = 0, u = o.length; l < u; ++l) - if (o[l].name === t) { - o[l] = a; - break; - } - l === u && o.push(a); - } - i.tween = o; - }; -} -function Qh(e, t) { - var n = this._id; - if (e += "", arguments.length < 2) { - for (var r = an(this.node(), n).tween, o = 0, i = r.length, s; o < i; ++o) - if ((s = r[o]).name === e) - return s.value; - return null; - } - return this.each((t == null ? jh : Jh)(n, e, t)); -} -function ra(e, t, n) { - var r = e._id; - return e.each(function() { - var o = bn(this, r); - (o.value || (o.value = {}))[t] = n.apply(this, arguments); - }), function(o) { - return an(o, r).value[t]; - }; -} -function Wu(e, t) { - var n; - return (typeof t == "number" ? Bn : t instanceof ho ? Ua : (n = ho(t)) ? (t = n, Ua) : Ah)(e, t); -} -function ev(e) { - return function() { - this.removeAttribute(e); - }; -} -function tv(e) { - return function() { - this.removeAttributeNS(e.space, e.local); - }; -} -function nv(e, t, n) { - var r, o = n + "", i; - return function() { - var s = this.getAttribute(e); - return s === o ? null : s === r ? i : i = t(r = s, n); - }; -} -function rv(e, t, n) { - var r, o = n + "", i; - return function() { - var s = this.getAttributeNS(e.space, e.local); - return s === o ? null : s === r ? i : i = t(r = s, n); - }; -} -function ov(e, t, n) { - var r, o, i; - return function() { - var s, a = n(this), l; - return a == null ? void this.removeAttribute(e) : (s = this.getAttribute(e), l = a + "", s === l ? null : s === r && l === o ? i : (o = l, i = t(r = s, a))); - }; -} -function iv(e, t, n) { - var r, o, i; - return function() { - var s, a = n(this), l; - return a == null ? void this.removeAttributeNS(e.space, e.local) : (s = this.getAttributeNS(e.space, e.local), l = a + "", s === l ? null : s === r && l === o ? i : (o = l, i = t(r = s, a))); - }; -} -function sv(e, t) { - var n = Li(e), r = n === "transform" ? Ih : Wu; - return this.attrTween(e, typeof t == "function" ? (n.local ? iv : ov)(n, r, ra(this, "attr." + e, t)) : t == null ? (n.local ? tv : ev)(n) : (n.local ? rv : nv)(n, r, t)); -} -function av(e, t) { - return function(n) { - this.setAttribute(e, t.call(this, n)); - }; -} -function lv(e, t) { - return function(n) { - this.setAttributeNS(e.space, e.local, t.call(this, n)); - }; -} -function uv(e, t) { - var n, r; - function o() { - var i = t.apply(this, arguments); - return i !== r && (n = (r = i) && lv(e, i)), n; - } - return o._value = t, o; -} -function cv(e, t) { - var n, r; - function o() { - var i = t.apply(this, arguments); - return i !== r && (n = (r = i) && av(e, i)), n; - } - return o._value = t, o; -} -function dv(e, t) { - var n = "attr." + e; - if (arguments.length < 2) return (n = this.tween(n)) && n._value; - if (t == null) return this.tween(n, null); - if (typeof t != "function") throw new Error(); - var r = Li(e); - return this.tween(n, (r.local ? uv : cv)(r, t)); -} -function fv(e, t) { - return function() { - na(this, e).delay = +t.apply(this, arguments); - }; -} -function gv(e, t) { - return t = +t, function() { - na(this, e).delay = t; - }; -} -function hv(e) { - var t = this._id; - return arguments.length ? this.each((typeof e == "function" ? fv : gv)(t, e)) : an(this.node(), t).delay; -} -function vv(e, t) { - return function() { - bn(this, e).duration = +t.apply(this, arguments); - }; -} -function pv(e, t) { - return t = +t, function() { - bn(this, e).duration = t; - }; -} -function mv(e) { - var t = this._id; - return arguments.length ? this.each((typeof e == "function" ? vv : pv)(t, e)) : an(this.node(), t).duration; -} -function yv(e, t) { - if (typeof t != "function") throw new Error(); - return function() { - bn(this, e).ease = t; - }; -} -function wv(e) { - var t = this._id; - return arguments.length ? this.each(yv(t, e)) : an(this.node(), t).ease; -} -function _v(e, t) { - return function() { - var n = t.apply(this, arguments); - if (typeof n != "function") throw new Error(); - bn(this, e).ease = n; - }; -} -function xv(e) { - if (typeof e != "function") throw new Error(); - return this.each(_v(this._id, e)); -} -function bv(e) { - typeof e != "function" && (e = Cu(e)); - for (var t = this._groups, n = t.length, r = new Array(n), o = 0; o < n; ++o) - for (var i = t[o], s = i.length, a = r[o] = [], l, u = 0; u < s; ++u) - (l = i[u]) && e.call(l, l.__data__, u, i) && a.push(l); - return new Vn(r, this._parents, this._name, this._id); -} -function Cv(e) { - if (e._id !== this._id) throw new Error(); - for (var t = this._groups, n = e._groups, r = t.length, o = n.length, i = Math.min(r, o), s = new Array(r), a = 0; a < i; ++a) - for (var l = t[a], u = n[a], c = l.length, f = s[a] = new Array(c), d, g = 0; g < c; ++g) - (d = l[g] || u[g]) && (f[g] = d); - for (; a < r; ++a) - s[a] = t[a]; - return new Vn(s, this._parents, this._name, this._id); -} -function kv(e) { - return (e + "").trim().split(/^|\s+/).every(function(t) { - var n = t.indexOf("."); - return n >= 0 && (t = t.slice(0, n)), !t || t === "start"; - }); -} -function Ev(e, t, n) { - var r, o, i = kv(t) ? na : bn; - return function() { - var s = i(this, e), a = s.on; - a !== r && (o = (r = a).copy()).on(t, n), s.on = o; - }; -} -function $v(e, t) { - var n = this._id; - return arguments.length < 2 ? an(this.node(), n).on.on(e) : this.each(Ev(n, e, t)); -} -function Sv(e) { - return function() { - var t = this.parentNode; - for (var n in this.__transition) if (+n !== e) return; - t && t.removeChild(this); - }; -} -function Pv() { - return this.on("end.remove", Sv(this._id)); -} -function Nv(e) { - var t = this._name, n = this._id; - typeof e != "function" && (e = Js(e)); - for (var r = this._groups, o = r.length, i = new Array(o), s = 0; s < o; ++s) - for (var a = r[s], l = a.length, u = i[s] = new Array(l), c, f, d = 0; d < l; ++d) - (c = a[d]) && (f = e.call(c, c.__data__, d, a)) && ("__data__" in c && (f.__data__ = c.__data__), u[d] = f, zi(u[d], t, n, d, u, an(c, n))); - return new Vn(i, this._parents, t, n); -} -function Tv(e) { - var t = this._name, n = this._id; - typeof e != "function" && (e = bu(e)); - for (var r = this._groups, o = r.length, i = [], s = [], a = 0; a < o; ++a) - for (var l = r[a], u = l.length, c, f = 0; f < u; ++f) - if (c = l[f]) { - for (var d = e.call(c, c.__data__, f, l), g, p = an(c, n), x = 0, k = d.length; x < k; ++x) - (g = d[x]) && zi(g, t, n, x, d, p); - i.push(d), s.push(c); - } - return new Vn(i, s, t, n); -} -var Mv = Eo.prototype.constructor; -function Hv() { - return new Mv(this._groups, this._parents); -} -function Dv(e, t) { - var n, r, o; - return function() { - var i = Hr(this, e), s = (this.style.removeProperty(e), Hr(this, e)); - return i === s ? null : i === n && s === r ? o : o = t(n = i, r = s); - }; -} -function Fu(e) { - return function() { - this.style.removeProperty(e); - }; -} -function Av(e, t, n) { - var r, o = n + "", i; - return function() { - var s = Hr(this, e); - return s === o ? null : s === r ? i : i = t(r = s, n); - }; -} -function Vv(e, t, n) { - var r, o, i; - return function() { - var s = Hr(this, e), a = n(this), l = a + ""; - return a == null && (l = a = (this.style.removeProperty(e), Hr(this, e))), s === l ? null : s === r && l === o ? i : (o = l, i = t(r = s, a)); - }; -} -function Ov(e, t) { - var n, r, o, i = "style." + t, s = "end." + i, a; - return function() { - var l = bn(this, e), u = l.on, c = l.value[i] == null ? a || (a = Fu(t)) : void 0; - (u !== n || o !== c) && (r = (n = u).copy()).on(s, o = c), l.on = r; - }; -} -function Lv(e, t, n) { - var r = (e += "") == "transform" ? Lh : Wu; - return t == null ? this.styleTween(e, Dv(e, r)).on("end.style." + e, Fu(e)) : typeof t == "function" ? this.styleTween(e, Vv(e, r, ra(this, "style." + e, t))).each(Ov(this._id, e)) : this.styleTween(e, Av(e, r, t), n).on("end.style." + e, null); -} -function Iv(e, t, n) { - return function(r) { - this.style.setProperty(e, t.call(this, r), n); - }; -} -function zv(e, t, n) { - var r, o; - function i() { - var s = t.apply(this, arguments); - return s !== o && (r = (o = s) && Iv(e, s, n)), r; - } - return i._value = t, i; -} -function Rv(e, t, n) { - var r = "style." + (e += ""); - if (arguments.length < 2) return (r = this.tween(r)) && r._value; - if (t == null) return this.tween(r, null); - if (typeof t != "function") throw new Error(); - return this.tween(r, zv(e, t, n ?? "")); -} -function Bv(e) { - return function() { - this.textContent = e; - }; -} -function Yv(e) { - return function() { - var t = e(this); - this.textContent = t ?? ""; - }; -} -function Zv(e) { - return this.tween("text", typeof e == "function" ? Yv(ra(this, "text", e)) : Bv(e == null ? "" : e + "")); -} -function Xv(e) { - return function(t) { - this.textContent = e.call(this, t); - }; -} -function Wv(e) { - var t, n; - function r() { - var o = e.apply(this, arguments); - return o !== n && (t = (n = o) && Xv(o)), t; - } - return r._value = e, r; -} -function Fv(e) { - var t = "text"; - if (arguments.length < 1) return (t = this.tween(t)) && t._value; - if (e == null) return this.tween(t, null); - if (typeof e != "function") throw new Error(); - return this.tween(t, Wv(e)); -} -function Kv() { - for (var e = this._name, t = this._id, n = Ku(), r = this._groups, o = r.length, i = 0; i < o; ++i) - for (var s = r[i], a = s.length, l, u = 0; u < a; ++u) - if (l = s[u]) { - var c = an(l, t); - zi(l, e, n, u, s, { - time: c.time + c.delay + c.duration, - delay: 0, - duration: c.duration, - ease: c.ease - }); - } - return new Vn(r, this._parents, e, n); -} -function qv() { - var e, t, n = this, r = n._id, o = n.size(); - return new Promise(function(i, s) { - var a = { value: s }, l = { value: function() { - --o === 0 && i(); - } }; - n.each(function() { - var u = bn(this, r), c = u.on; - c !== e && (t = (e = c).copy(), t._.cancel.push(a), t._.interrupt.push(a), t._.end.push(l)), u.on = t; - }), o === 0 && i(); - }); -} -var Gv = 0; -function Vn(e, t, n, r) { - this._groups = e, this._parents = t, this._name = n, this._id = r; -} -function Ku() { - return ++Gv; -} -var kn = Eo.prototype; -Vn.prototype = { - constructor: Vn, - select: Nv, - selectAll: Tv, - selectChild: kn.selectChild, - selectChildren: kn.selectChildren, - filter: bv, - merge: Cv, - selection: Hv, - transition: Kv, - call: kn.call, - nodes: kn.nodes, - node: kn.node, - size: kn.size, - empty: kn.empty, - each: kn.each, - on: $v, - attr: sv, - attrTween: dv, - style: Lv, - styleTween: Rv, - text: Zv, - textTween: Fv, - remove: Pv, - tween: Qh, - delay: hv, - duration: mv, - ease: wv, - easeVarying: xv, - end: qv, - [Symbol.iterator]: kn[Symbol.iterator] -}; -function Uv(e) { - return ((e *= 2) <= 1 ? e * e * e : (e -= 2) * e * e + 2) / 2; -} -var jv = { - time: null, - // Set on use. - delay: 0, - duration: 250, - ease: Uv -}; -function Jv(e, t) { - for (var n; !(n = e.__transition) || !(n = n[t]); ) - if (!(e = e.parentNode)) - throw new Error(`transition ${t} not found`); - return n; -} -function Qv(e) { - var t, n; - e instanceof Vn ? (t = e._id, e = e._name) : (t = Ku(), (n = jv).time = ta(), e = e == null ? null : e + ""); - for (var r = this._groups, o = r.length, i = 0; i < o; ++i) - for (var s = r[i], a = s.length, l, u = 0; u < a; ++u) - (l = s[u]) && zi(l, e, t, u, s, n || Jv(l, t)); - return new Vn(r, this._parents, e, t); -} -Eo.prototype.interrupt = Uh; -Eo.prototype.transition = Qv; -const Xo = (e) => () => e; -function e0(e, { - sourceEvent: t, - target: n, - transform: r, - dispatch: o -}) { - Object.defineProperties(this, { - type: { value: e, enumerable: !0, configurable: !0 }, - sourceEvent: { value: t, enumerable: !0, configurable: !0 }, - target: { value: n, enumerable: !0, configurable: !0 }, - transform: { value: r, enumerable: !0, configurable: !0 }, - _: { value: o } - }); -} -function Sn(e, t, n) { - this.k = e, this.x = t, this.y = n; -} -Sn.prototype = { - constructor: Sn, - scale: function(e) { - return e === 1 ? this : new Sn(this.k * e, this.x, this.y); - }, - translate: function(e, t) { - return e === 0 & t === 0 ? this : new Sn(this.k, this.x + this.k * e, this.y + this.k * t); - }, - apply: function(e) { - return [e[0] * this.k + this.x, e[1] * this.k + this.y]; - }, - applyX: function(e) { - return e * this.k + this.x; - }, - applyY: function(e) { - return e * this.k + this.y; - }, - invert: function(e) { - return [(e[0] - this.x) / this.k, (e[1] - this.y) / this.k]; - }, - invertX: function(e) { - return (e - this.x) / this.k; - }, - invertY: function(e) { - return (e - this.y) / this.k; - }, - rescaleX: function(e) { - return e.copy().domain(e.range().map(this.invertX, this).map(e.invert, e)); - }, - rescaleY: function(e) { - return e.copy().domain(e.range().map(this.invertY, this).map(e.invert, e)); - }, - toString: function() { - return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; - } -}; -var Ri = new Sn(1, 0, 0); -qu.prototype = Sn.prototype; -function qu(e) { - for (; !e.__zoom; ) if (!(e = e.parentNode)) return Ri; - return e.__zoom; -} -function ts(e) { - e.stopImmediatePropagation(); -} -function Qr(e) { - e.preventDefault(), e.stopImmediatePropagation(); -} -function t0(e) { - return (!e.ctrlKey || e.type === "wheel") && !e.button; -} -function n0() { - var e = this; - return e instanceof SVGElement ? (e = e.ownerSVGElement || e, e.hasAttribute("viewBox") ? (e = e.viewBox.baseVal, [[e.x, e.y], [e.x + e.width, e.y + e.height]]) : [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]]) : [[0, 0], [e.clientWidth, e.clientHeight]]; -} -function rl() { - return this.__zoom || Ri; -} -function r0(e) { - return -e.deltaY * (e.deltaMode === 1 ? 0.05 : e.deltaMode ? 1 : 2e-3) * (e.ctrlKey ? 10 : 1); -} -function o0() { - return navigator.maxTouchPoints || "ontouchstart" in this; -} -function i0(e, t, n) { - var r = e.invertX(t[0][0]) - n[0][0], o = e.invertX(t[1][0]) - n[1][0], i = e.invertY(t[0][1]) - n[0][1], s = e.invertY(t[1][1]) - n[1][1]; - return e.translate( - o > r ? (r + o) / 2 : Math.min(0, r) || Math.max(0, o), - s > i ? (i + s) / 2 : Math.min(0, i) || Math.max(0, s) - ); -} -function Gu() { - var e = t0, t = n0, n = i0, r = r0, o = o0, i = [0, 1 / 0], s = [[-1 / 0, -1 / 0], [1 / 0, 1 / 0]], a = 250, l = Yh, u = Oi("start", "zoom", "end"), c, f, d, g = 500, p = 150, x = 0, k = 10; - function E(S) { - S.property("__zoom", rl).on("wheel.zoom", T, { passive: !1 }).on("mousedown.zoom", A).on("dblclick.zoom", D).filter(o).on("touchstart.zoom", O).on("touchmove.zoom", V).on("touchend.zoom touchcancel.zoom", z).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)"); - } - E.transform = function(S, H, C, P) { - var M = S.selection ? S.selection() : S; - M.property("__zoom", rl), S !== M ? b(S, H, C, P) : M.interrupt().each(function() { - N(this, arguments).event(P).start().zoom(null, typeof H == "function" ? H.apply(this, arguments) : H).end(); - }); - }, E.scaleBy = function(S, H, C, P) { - E.scaleTo(S, function() { - var M = this.__zoom.k, I = typeof H == "function" ? H.apply(this, arguments) : H; - return M * I; - }, C, P); - }, E.scaleTo = function(S, H, C, P) { - E.transform(S, function() { - var M = t.apply(this, arguments), I = this.__zoom, B = C == null ? v(M) : typeof C == "function" ? C.apply(this, arguments) : C, F = I.invert(B), K = typeof H == "function" ? H.apply(this, arguments) : H; - return n(_(m(I, K), B, F), M, s); - }, C, P); - }, E.translateBy = function(S, H, C, P) { - E.transform(S, function() { - return n(this.__zoom.translate( - typeof H == "function" ? H.apply(this, arguments) : H, - typeof C == "function" ? C.apply(this, arguments) : C - ), t.apply(this, arguments), s); - }, null, P); - }, E.translateTo = function(S, H, C, P, M) { - E.transform(S, function() { - var I = t.apply(this, arguments), B = this.__zoom, F = P == null ? v(I) : typeof P == "function" ? P.apply(this, arguments) : P; - return n(Ri.translate(F[0], F[1]).scale(B.k).translate( - typeof H == "function" ? -H.apply(this, arguments) : -H, - typeof C == "function" ? -C.apply(this, arguments) : -C - ), I, s); - }, P, M); - }; - function m(S, H) { - return H = Math.max(i[0], Math.min(i[1], H)), H === S.k ? S : new Sn(H, S.x, S.y); - } - function _(S, H, C) { - var P = H[0] - C[0] * S.k, M = H[1] - C[1] * S.k; - return P === S.x && M === S.y ? S : new Sn(S.k, P, M); - } - function v(S) { - return [(+S[0][0] + +S[1][0]) / 2, (+S[0][1] + +S[1][1]) / 2]; - } - function b(S, H, C, P) { - S.on("start.zoom", function() { - N(this, arguments).event(P).start(); - }).on("interrupt.zoom end.zoom", function() { - N(this, arguments).event(P).end(); - }).tween("zoom", function() { - var M = this, I = arguments, B = N(M, I).event(P), F = t.apply(M, I), K = C == null ? v(F) : typeof C == "function" ? C.apply(M, I) : C, oe = Math.max(F[1][0] - F[0][0], F[1][1] - F[0][1]), J = M.__zoom, W = typeof H == "function" ? H.apply(M, I) : H, de = l(J.invert(K).concat(oe / J.k), W.invert(K).concat(oe / W.k)); - return function(we) { - if (we === 1) we = W; - else { - var Ce = de(we), fe = oe / Ce[2]; - we = new Sn(fe, K[0] - Ce[0] * fe, K[1] - Ce[1] * fe); - } - B.zoom(null, we); - }; - }); - } - function N(S, H, C) { - return !C && S.__zooming || new $(S, H); - } - function $(S, H) { - this.that = S, this.args = H, this.active = 0, this.sourceEvent = null, this.extent = t.apply(S, H), this.taps = 0; - } - $.prototype = { - event: function(S) { - return S && (this.sourceEvent = S), this; - }, - start: function() { - return ++this.active === 1 && (this.that.__zooming = this, this.emit("start")), this; - }, - zoom: function(S, H) { - return this.mouse && S !== "mouse" && (this.mouse[1] = H.invert(this.mouse[0])), this.touch0 && S !== "touch" && (this.touch0[1] = H.invert(this.touch0[0])), this.touch1 && S !== "touch" && (this.touch1[1] = H.invert(this.touch1[0])), this.that.__zoom = H, this.emit("zoom"), this; - }, - end: function() { - return --this.active === 0 && (delete this.that.__zooming, this.emit("end")), this; - }, - emit: function(S) { - var H = Wt(this.that).datum(); - u.call( - S, - this.that, - new e0(S, { - sourceEvent: this.sourceEvent, - target: E, - transform: this.that.__zoom, - dispatch: u - }), - H - ); - } - }; - function T(S, ...H) { - if (!e.apply(this, arguments)) return; - var C = N(this, H).event(S), P = this.__zoom, M = Math.max(i[0], Math.min(i[1], P.k * Math.pow(2, r.apply(this, arguments)))), I = Jt(S); - if (C.wheel) - (C.mouse[0][0] !== I[0] || C.mouse[0][1] !== I[1]) && (C.mouse[1] = P.invert(C.mouse[0] = I)), clearTimeout(C.wheel); - else { - if (P.k === M) return; - C.mouse = [I, P.invert(I)], jo(this), C.start(); - } - Qr(S), C.wheel = setTimeout(B, p), C.zoom("mouse", n(_(m(P, M), C.mouse[0], C.mouse[1]), C.extent, s)); - function B() { - C.wheel = null, C.end(); - } - } - function A(S, ...H) { - if (d || !e.apply(this, arguments)) return; - var C = S.currentTarget, P = N(this, H, !0).event(S), M = Wt(S.view).on("mousemove.zoom", K, !0).on("mouseup.zoom", oe, !0), I = Jt(S, C), B = S.clientX, F = S.clientY; - Du(S.view), ts(S), P.mouse = [I, this.__zoom.invert(I)], jo(this), P.start(); - function K(J) { - if (Qr(J), !P.moved) { - var W = J.clientX - B, de = J.clientY - F; - P.moved = W * W + de * de > x; - } - P.event(J).zoom("mouse", n(_(P.that.__zoom, P.mouse[0] = Jt(J, C), P.mouse[1]), P.extent, s)); - } - function oe(J) { - M.on("mousemove.zoom mouseup.zoom", null), Au(J.view, P.moved), Qr(J), P.event(J).end(); - } - } - function D(S, ...H) { - if (e.apply(this, arguments)) { - var C = this.__zoom, P = Jt(S.changedTouches ? S.changedTouches[0] : S, this), M = C.invert(P), I = C.k * (S.shiftKey ? 0.5 : 2), B = n(_(m(C, I), P, M), t.apply(this, H), s); - Qr(S), a > 0 ? Wt(this).transition().duration(a).call(b, B, P, S) : Wt(this).call(E.transform, B, P, S); - } - } - function O(S, ...H) { - if (e.apply(this, arguments)) { - var C = S.touches, P = C.length, M = N(this, H, S.changedTouches.length === P).event(S), I, B, F, K; - for (ts(S), B = 0; B < P; ++B) - F = C[B], K = Jt(F, this), K = [K, this.__zoom.invert(K), F.identifier], M.touch0 ? !M.touch1 && M.touch0[2] !== K[2] && (M.touch1 = K, M.taps = 0) : (M.touch0 = K, I = !0, M.taps = 1 + !!c); - c && (c = clearTimeout(c)), I && (M.taps < 2 && (f = K[0], c = setTimeout(function() { - c = null; - }, g)), jo(this), M.start()); - } - } - function V(S, ...H) { - if (this.__zooming) { - var C = N(this, H).event(S), P = S.changedTouches, M = P.length, I, B, F, K; - for (Qr(S), I = 0; I < M; ++I) - B = P[I], F = Jt(B, this), C.touch0 && C.touch0[2] === B.identifier ? C.touch0[0] = F : C.touch1 && C.touch1[2] === B.identifier && (C.touch1[0] = F); - if (B = C.that.__zoom, C.touch1) { - var oe = C.touch0[0], J = C.touch0[1], W = C.touch1[0], de = C.touch1[1], we = (we = W[0] - oe[0]) * we + (we = W[1] - oe[1]) * we, Ce = (Ce = de[0] - J[0]) * Ce + (Ce = de[1] - J[1]) * Ce; - B = m(B, Math.sqrt(we / Ce)), F = [(oe[0] + W[0]) / 2, (oe[1] + W[1]) / 2], K = [(J[0] + de[0]) / 2, (J[1] + de[1]) / 2]; - } else if (C.touch0) F = C.touch0[0], K = C.touch0[1]; - else return; - C.zoom("touch", n(_(B, F, K), C.extent, s)); - } - } - function z(S, ...H) { - if (this.__zooming) { - var C = N(this, H).event(S), P = S.changedTouches, M = P.length, I, B; - for (ts(S), d && clearTimeout(d), d = setTimeout(function() { - d = null; - }, g), I = 0; I < M; ++I) - B = P[I], C.touch0 && C.touch0[2] === B.identifier ? delete C.touch0 : C.touch1 && C.touch1[2] === B.identifier && delete C.touch1; - if (C.touch1 && !C.touch0 && (C.touch0 = C.touch1, delete C.touch1), C.touch0) C.touch0[1] = this.__zoom.invert(C.touch0[0]); - else if (C.end(), C.taps === 2 && (B = Jt(B, this), Math.hypot(f[0] - B[0], f[1] - B[1]) < k)) { - var F = Wt(this).on("dblclick.zoom"); - F && F.apply(this, arguments); - } - } - } - return E.wheelDelta = function(S) { - return arguments.length ? (r = typeof S == "function" ? S : Xo(+S), E) : r; - }, E.filter = function(S) { - return arguments.length ? (e = typeof S == "function" ? S : Xo(!!S), E) : e; - }, E.touchable = function(S) { - return arguments.length ? (o = typeof S == "function" ? S : Xo(!!S), E) : o; - }, E.extent = function(S) { - return arguments.length ? (t = typeof S == "function" ? S : Xo([[+S[0][0], +S[0][1]], [+S[1][0], +S[1][1]]]), E) : t; - }, E.scaleExtent = function(S) { - return arguments.length ? (i[0] = +S[0], i[1] = +S[1], E) : [i[0], i[1]]; - }, E.translateExtent = function(S) { - return arguments.length ? (s[0][0] = +S[0][0], s[1][0] = +S[1][0], s[0][1] = +S[0][1], s[1][1] = +S[1][1], E) : [[s[0][0], s[0][1]], [s[1][0], s[1][1]]]; - }, E.constrain = function(S) { - return arguments.length ? (n = S, E) : n; - }, E.duration = function(S) { - return arguments.length ? (a = +S, E) : a; - }, E.interpolate = function(S) { - return arguments.length ? (l = S, E) : l; - }, E.on = function() { - var S = u.on.apply(u, arguments); - return S === u ? E : S; - }, E.clickDistance = function(S) { - return arguments.length ? (x = (S = +S) * S, E) : Math.sqrt(x); - }, E.tapDistance = function(S) { - return arguments.length ? (k = +S, E) : k; - }, E; -} -const Ar = { - error001: () => "[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001", - error002: () => "It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.", - error003: (e) => `Node type "${e}" not found. Using fallback type "default".`, - error004: () => "The React Flow parent container needs a width and a height to render the graph.", - error005: () => "Only child nodes can use a parent extent.", - error006: () => "Can't create edge. An edge needs a source and a target.", - error007: (e) => `The old edge with id=${e} does not exist.`, - error009: (e) => `Marker type "${e}" doesn't exist.`, - error008: (e, { id: t, sourceHandle: n, targetHandle: r }) => `Couldn't create edge for ${e} handle id: "${e === "source" ? n : r}", edge id: ${t}.`, - error010: () => "Handle: No node id found. Make sure to only use a Handle inside a custom Node.", - error011: (e) => `Edge type "${e}" not found. Using fallback type "default".`, - error012: (e) => `Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`, - error013: (e = "react") => `It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`, - error014: () => "useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.", - error015: () => "It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs." -}, gi = [ - [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY], - [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY] -]; -var cr; -(function(e) { - e.Strict = "strict", e.Loose = "loose"; -})(cr || (cr = {})); -var Kn; -(function(e) { - e.Free = "free", e.Vertical = "vertical", e.Horizontal = "horizontal"; -})(Kn || (Kn = {})); -var hi; -(function(e) { - e.Partial = "partial", e.Full = "full"; -})(hi || (hi = {})); -const $s = { - inProgress: !1, - isValid: null, - from: null, - fromHandle: null, - fromPosition: null, - fromNode: null, - to: null, - toHandle: null, - toPosition: null, - toNode: null -}; -var Cr; -(function(e) { - e.Bezier = "default", e.Straight = "straight", e.Step = "step", e.SmoothStep = "smoothstep", e.SimpleBezier = "simplebezier"; -})(Cr || (Cr = {})); -var po; -(function(e) { - e.Arrow = "arrow", e.ArrowClosed = "arrowclosed"; -})(po || (po = {})); -var Ee; -(function(e) { - e.Left = "left", e.Top = "top", e.Right = "right", e.Bottom = "bottom"; -})(Ee || (Ee = {})); -const ol = { - [Ee.Left]: Ee.Right, - [Ee.Right]: Ee.Left, - [Ee.Top]: Ee.Bottom, - [Ee.Bottom]: Ee.Top -}; -function s0(e, t) { - if (!e && !t) - return !0; - if (!e || !t || e.size !== t.size) - return !1; - if (!e.size && !t.size) - return !0; - for (const n of e.keys()) - if (!t.has(n)) - return !1; - return !0; -} -function il(e, t, n) { - if (!n) - return; - const r = []; - e.forEach((o, i) => { - t != null && t.has(i) || r.push(o); - }), r.length && n(r); -} -function a0(e) { - return e === null ? null : e ? "valid" : "invalid"; -} -const l0 = (e) => "id" in e && "source" in e && "target" in e, u0 = (e) => "id" in e && "position" in e && !("source" in e) && !("target" in e), oa = (e) => "id" in e && "internals" in e && !("source" in e) && !("target" in e), So = (e, t = [0, 0]) => { - const { width: n, height: r } = Qn(e), o = e.origin ?? t, i = n * o[0], s = r * o[1]; - return { - x: e.position.x - i, - y: e.position.y - s - }; -}, c0 = (e, t = { nodeOrigin: [0, 0], nodeLookup: void 0 }) => { - if (e.length === 0) - return { x: 0, y: 0, width: 0, height: 0 }; - const n = e.reduce((r, o) => { - const i = typeof o == "string"; - let s = !t.nodeLookup && !i ? o : void 0; - t.nodeLookup && (s = i ? t.nodeLookup.get(o) : oa(o) ? o : t.nodeLookup.get(o.id)); - const a = s ? vi(s, t.nodeOrigin) : { x: 0, y: 0, x2: 0, y2: 0 }; - return Bi(r, a); - }, { x: 1 / 0, y: 1 / 0, x2: -1 / 0, y2: -1 / 0 }); - return Yi(n); -}, Po = (e, t = {}) => { - if (e.size === 0) - return { x: 0, y: 0, width: 0, height: 0 }; - let n = { x: 1 / 0, y: 1 / 0, x2: -1 / 0, y2: -1 / 0 }; - return e.forEach((r) => { - if (t.filter === void 0 || t.filter(r)) { - const o = vi(r); - n = Bi(n, o); - } - }), Yi(n); -}, Uu = (e, t, [n, r, o] = [0, 0, 1], i = !1, s = !1) => { - const a = { - ...No(t, [n, r, o]), - width: t.width / o, - height: t.height / o - }, l = []; - for (const u of e.values()) { - const { measured: c, selectable: f = !0, hidden: d = !1 } = u; - if (s && !f || d) - continue; - const g = c.width ?? u.width ?? u.initialWidth ?? null, p = c.height ?? u.height ?? u.initialHeight ?? null, x = mo(a, Or(u)), k = (g ?? 0) * (p ?? 0), E = i && x > 0; - (!u.internals.handleBounds || E || x >= k || u.dragging) && l.push(u); - } - return l; -}, Ss = (e, t) => { - const n = /* @__PURE__ */ new Set(); - return e.forEach((r) => { - n.add(r.id); - }), t.filter((r) => n.has(r.source) || n.has(r.target)); -}; -function sl(e, t) { - const n = /* @__PURE__ */ new Map(), r = t != null && t.nodes ? new Set(t.nodes.map((o) => o.id)) : null; - return e.forEach((o) => { - o.measured.width && o.measured.height && ((t == null ? void 0 : t.includeHiddenNodes) || !o.hidden) && (!r || r.has(o.id)) && n.set(o.id, o); - }), n; -} -async function al({ nodes: e, width: t, height: n, panZoom: r, minZoom: o, maxZoom: i }, s) { - if (e.size === 0) - return Promise.resolve(!1); - const a = Po(e), l = sa(a, t, n, (s == null ? void 0 : s.minZoom) ?? o, (s == null ? void 0 : s.maxZoom) ?? i, (s == null ? void 0 : s.padding) ?? 0.1); - return await r.setViewport(l, { duration: s == null ? void 0 : s.duration }), Promise.resolve(!0); -} -function d0({ nodeId: e, nextPosition: t, nodeLookup: n, nodeOrigin: r = [0, 0], nodeExtent: o, onError: i }) { - const s = n.get(e), a = s.parentId ? n.get(s.parentId) : void 0, { x: l, y: u } = a ? a.internals.positionAbsolute : { x: 0, y: 0 }, c = s.origin ?? r; - let f = o; - if (s.extent === "parent" && !s.expandParent) - if (!a) - i == null || i("005", Ar.error005()); - else { - const g = a.measured.width, p = a.measured.height; - g && p && (f = [ - [l, u], - [l + g, u + p] - ]); - } - else a && Lr(s.extent) && (f = [ - [s.extent[0][0] + l, s.extent[0][1] + u], - [s.extent[1][0] + l, s.extent[1][1] + u] - ]); - const d = Lr(f) ? dr(t, f, s.measured) : t; - return (s.measured.width === void 0 || s.measured.height === void 0) && (i == null || i("015", Ar.error015())), { - position: { - x: d.x - l + (s.measured.width ?? 0) * c[0], - y: d.y - u + (s.measured.height ?? 0) * c[1] - }, - positionAbsolute: d - }; -} -async function ju({ nodesToRemove: e = [], edgesToRemove: t = [], nodes: n, edges: r, onBeforeDelete: o }) { - const i = new Set(e.map((d) => d.id)), s = []; - for (const d of n) { - if (d.deletable === !1) - continue; - const g = i.has(d.id), p = !g && d.parentId && s.find((x) => x.id === d.parentId); - (g || p) && s.push(d); - } - const a = new Set(t.map((d) => d.id)), l = r.filter((d) => d.deletable !== !1), c = Ss(s, l); - for (const d of l) - a.has(d.id) && !c.find((p) => p.id === d.id) && c.push(d); - if (!o) - return { - edges: c, - nodes: s - }; - const f = await o({ - nodes: s, - edges: c - }); - return typeof f == "boolean" ? f ? { edges: c, nodes: s } : { edges: [], nodes: [] } : f; -} -const Vr = (e, t = 0, n = 1) => Math.min(Math.max(e, t), n), dr = (e = { x: 0, y: 0 }, t, n) => ({ - x: Vr(e.x, t[0][0], t[1][0] - ((n == null ? void 0 : n.width) ?? 0)), - y: Vr(e.y, t[0][1], t[1][1] - ((n == null ? void 0 : n.height) ?? 0)) -}); -function Ju(e, t, n) { - const { width: r, height: o } = Qn(n), { x: i, y: s } = n.internals.positionAbsolute; - return dr(e, [ - [i, s], - [i + r, s + o] - ], t); -} -const ll = (e, t, n) => e < t ? Vr(Math.abs(e - t), 1, t) / t : e > n ? -Vr(Math.abs(e - n), 1, t) / t : 0, Qu = (e, t, n = 15, r = 40) => { - const o = ll(e.x, r, t.width - r) * n, i = ll(e.y, r, t.height - r) * n; - return [o, i]; -}, Bi = (e, t) => ({ - x: Math.min(e.x, t.x), - y: Math.min(e.y, t.y), - x2: Math.max(e.x2, t.x2), - y2: Math.max(e.y2, t.y2) -}), Ps = ({ x: e, y: t, width: n, height: r }) => ({ - x: e, - y: t, - x2: e + n, - y2: t + r -}), Yi = ({ x: e, y: t, x2: n, y2: r }) => ({ - x: e, - y: t, - width: n - e, - height: r - t -}), Or = (e, t = [0, 0]) => { - var o, i; - const { x: n, y: r } = oa(e) ? e.internals.positionAbsolute : So(e, t); - return { - x: n, - y: r, - width: ((o = e.measured) == null ? void 0 : o.width) ?? e.width ?? e.initialWidth ?? 0, - height: ((i = e.measured) == null ? void 0 : i.height) ?? e.height ?? e.initialHeight ?? 0 - }; -}, vi = (e, t = [0, 0]) => { - var o, i; - const { x: n, y: r } = oa(e) ? e.internals.positionAbsolute : So(e, t); - return { - x: n, - y: r, - x2: n + (((o = e.measured) == null ? void 0 : o.width) ?? e.width ?? e.initialWidth ?? 0), - y2: r + (((i = e.measured) == null ? void 0 : i.height) ?? e.height ?? e.initialHeight ?? 0) - }; -}, ec = (e, t) => Yi(Bi(Ps(e), Ps(t))), mo = (e, t) => { - const n = Math.max(0, Math.min(e.x + e.width, t.x + t.width) - Math.max(e.x, t.x)), r = Math.max(0, Math.min(e.y + e.height, t.y + t.height) - Math.max(e.y, t.y)); - return Math.ceil(n * r); -}, ul = (e) => Pn(e.width) && Pn(e.height) && Pn(e.x) && Pn(e.y), Pn = (e) => !isNaN(e) && isFinite(e), f0 = (e, t) => { -}, ia = (e, t = [1, 1]) => ({ - x: t[0] * Math.round(e.x / t[0]), - y: t[1] * Math.round(e.y / t[1]) -}), No = ({ x: e, y: t }, [n, r, o], i = !1, s = [1, 1]) => { - const a = { - x: (e - n) / o, - y: (t - r) / o - }; - return i ? ia(a, s) : a; -}, tc = ({ x: e, y: t }, [n, r, o]) => ({ - x: e * o + n, - y: t * o + r -}), sa = (e, t, n, r, o, i) => { - const s = t / (e.width * (1 + i)), a = n / (e.height * (1 + i)), l = Math.min(s, a), u = Vr(l, r, o), c = e.x + e.width / 2, f = e.y + e.height / 2, d = t / 2 - c * u, g = n / 2 - f * u; - return { x: d, y: g, zoom: u }; -}, pi = () => { - var e; - return typeof navigator < "u" && ((e = navigator == null ? void 0 : navigator.userAgent) == null ? void 0 : e.indexOf("Mac")) >= 0; -}; -function Lr(e) { - return e !== void 0 && e !== "parent"; -} -function Qn(e) { - var t, n; - return { - width: ((t = e.measured) == null ? void 0 : t.width) ?? e.width ?? e.initialWidth ?? 0, - height: ((n = e.measured) == null ? void 0 : n.height) ?? e.height ?? e.initialHeight ?? 0 - }; -} -function nc(e) { - var t, n; - return (((t = e.measured) == null ? void 0 : t.width) ?? e.width ?? e.initialWidth) !== void 0 && (((n = e.measured) == null ? void 0 : n.height) ?? e.height ?? e.initialHeight) !== void 0; -} -function g0(e, t = { width: 0, height: 0 }, n, r, o) { - const i = { ...e }, s = r.get(n); - if (s) { - const a = s.origin || o; - i.x += s.internals.positionAbsolute.x - (t.width ?? 0) * a[0], i.y += s.internals.positionAbsolute.y - (t.height ?? 0) * a[1]; - } - return i; -} -function ns(e, { snapGrid: t = [0, 0], snapToGrid: n = !1, transform: r, containerBounds: o }) { - const { x: i, y: s } = Mn(e), a = No({ x: i - ((o == null ? void 0 : o.left) ?? 0), y: s - ((o == null ? void 0 : o.top) ?? 0) }, r), { x: l, y: u } = n ? ia(a, t) : a; - return { - xSnapped: l, - ySnapped: u, - ...a - }; -} -const aa = (e) => ({ - width: e.offsetWidth, - height: e.offsetHeight -}), h0 = (e) => { - var t; - return ((t = e == null ? void 0 : e.getRootNode) == null ? void 0 : t.call(e)) || (window == null ? void 0 : window.document); -}, v0 = ["INPUT", "SELECT", "TEXTAREA"]; -function p0(e) { - var r, o; - const t = ((o = (r = e.composedPath) == null ? void 0 : r.call(e)) == null ? void 0 : o[0]) || e.target; - return (t == null ? void 0 : t.nodeType) !== 1 ? !1 : v0.includes(t.nodeName) || t.hasAttribute("contenteditable") || !!t.closest(".nokey"); -} -const rc = (e) => "clientX" in e, Mn = (e, t) => { - var i, s; - const n = rc(e), r = n ? e.clientX : (i = e.touches) == null ? void 0 : i[0].clientX, o = n ? e.clientY : (s = e.touches) == null ? void 0 : s[0].clientY; - return { - x: r - ((t == null ? void 0 : t.left) ?? 0), - y: o - ((t == null ? void 0 : t.top) ?? 0) - }; -}, cl = (e, t, n, r, o) => { - const i = t.querySelectorAll(`.${e}`); - return !i || !i.length ? null : Array.from(i).map((s) => { - const a = s.getBoundingClientRect(); - return { - id: s.getAttribute("data-handleid"), - type: e, - nodeId: o, - position: s.getAttribute("data-handlepos"), - x: (a.left - n.left) / r, - y: (a.top - n.top) / r, - ...aa(s) - }; - }); -}; -function m0({ sourceX: e, sourceY: t, targetX: n, targetY: r, sourceControlX: o, sourceControlY: i, targetControlX: s, targetControlY: a }) { - const l = e * 0.125 + o * 0.375 + s * 0.375 + n * 0.125, u = t * 0.125 + i * 0.375 + a * 0.375 + r * 0.125, c = Math.abs(l - e), f = Math.abs(u - t); - return [l, u, c, f]; -} -function Wo(e, t) { - return e >= 0 ? 0.5 * e : t * 25 * Math.sqrt(-e); -} -function dl({ pos: e, x1: t, y1: n, x2: r, y2: o, c: i }) { - switch (e) { - case Ee.Left: - return [t - Wo(t - r, i), n]; - case Ee.Right: - return [t + Wo(r - t, i), n]; - case Ee.Top: - return [t, n - Wo(n - o, i)]; - case Ee.Bottom: - return [t, n + Wo(o - n, i)]; - } -} -function oc({ sourceX: e, sourceY: t, sourcePosition: n = Ee.Bottom, targetX: r, targetY: o, targetPosition: i = Ee.Top, curvature: s = 0.25 }) { - const [a, l] = dl({ - pos: n, - x1: e, - y1: t, - x2: r, - y2: o, - c: s - }), [u, c] = dl({ - pos: i, - x1: r, - y1: o, - x2: e, - y2: t, - c: s - }), [f, d, g, p] = m0({ - sourceX: e, - sourceY: t, - targetX: r, - targetY: o, - sourceControlX: a, - sourceControlY: l, - targetControlX: u, - targetControlY: c - }); - return [ - `M${e},${t} C${a},${l} ${u},${c} ${r},${o}`, - f, - d, - g, - p - ]; -} -function ic({ sourceX: e, sourceY: t, targetX: n, targetY: r }) { - const o = Math.abs(n - e) / 2, i = n < e ? n + o : n - o, s = Math.abs(r - t) / 2, a = r < t ? r + s : r - s; - return [i, a, o, s]; -} -function y0({ sourceNode: e, targetNode: t, selected: n = !1, zIndex: r = 0, elevateOnSelect: o = !1 }) { - if (!o) - return r; - const i = n || t.selected || e.selected, s = Math.max(e.internals.z || 0, t.internals.z || 0, 1e3); - return r + (i ? s : 0); -} -function w0({ sourceNode: e, targetNode: t, width: n, height: r, transform: o }) { - const i = Bi(vi(e), vi(t)); - i.x === i.x2 && (i.x2 += 1), i.y === i.y2 && (i.y2 += 1); - const s = { - x: -o[0] / o[2], - y: -o[1] / o[2], - width: n / o[2], - height: r / o[2] - }; - return mo(s, Yi(i)) > 0; -} -const _0 = ({ source: e, sourceHandle: t, target: n, targetHandle: r }) => `xy-edge__${e}${t || ""}-${n}${r || ""}`, x0 = (e, t) => t.some((n) => n.source === e.source && n.target === e.target && (n.sourceHandle === e.sourceHandle || !n.sourceHandle && !e.sourceHandle) && (n.targetHandle === e.targetHandle || !n.targetHandle && !e.targetHandle)), b0 = (e, t) => { - if (!e.source || !e.target) - return t; - let n; - return l0(e) ? n = { ...e } : n = { - ...e, - id: _0(e) - }, x0(n, t) ? t : (n.sourceHandle === null && delete n.sourceHandle, n.targetHandle === null && delete n.targetHandle, t.concat(n)); -}; -function Ns({ sourceX: e, sourceY: t, targetX: n, targetY: r }) { - const [o, i, s, a] = ic({ - sourceX: e, - sourceY: t, - targetX: n, - targetY: r - }); - return [`M ${e},${t}L ${n},${r}`, o, i, s, a]; -} -const fl = { - [Ee.Left]: { x: -1, y: 0 }, - [Ee.Right]: { x: 1, y: 0 }, - [Ee.Top]: { x: 0, y: -1 }, - [Ee.Bottom]: { x: 0, y: 1 } -}, C0 = ({ source: e, sourcePosition: t = Ee.Bottom, target: n }) => t === Ee.Left || t === Ee.Right ? e.x < n.x ? { x: 1, y: 0 } : { x: -1, y: 0 } : e.y < n.y ? { x: 0, y: 1 } : { x: 0, y: -1 }, gl = (e, t) => Math.sqrt(Math.pow(t.x - e.x, 2) + Math.pow(t.y - e.y, 2)); -function k0({ source: e, sourcePosition: t = Ee.Bottom, target: n, targetPosition: r = Ee.Top, center: o, offset: i }) { - const s = fl[t], a = fl[r], l = { x: e.x + s.x * i, y: e.y + s.y * i }, u = { x: n.x + a.x * i, y: n.y + a.y * i }, c = C0({ - source: l, - sourcePosition: t, - target: u - }), f = c.x !== 0 ? "x" : "y", d = c[f]; - let g = [], p, x; - const k = { x: 0, y: 0 }, E = { x: 0, y: 0 }, [m, _, v, b] = ic({ - sourceX: e.x, - sourceY: e.y, - targetX: n.x, - targetY: n.y - }); - if (s[f] * a[f] === -1) { - p = o.x ?? m, x = o.y ?? _; - const $ = [ - { x: p, y: l.y }, - { x: p, y: u.y } - ], T = [ - { x: l.x, y: x }, - { x: u.x, y: x } - ]; - s[f] === d ? g = f === "x" ? $ : T : g = f === "x" ? T : $; - } else { - const $ = [{ x: l.x, y: u.y }], T = [{ x: u.x, y: l.y }]; - if (f === "x" ? g = s.x === d ? T : $ : g = s.y === d ? $ : T, t === r) { - const z = Math.abs(e[f] - n[f]); - if (z <= i) { - const S = Math.min(i - 1, i - z); - s[f] === d ? k[f] = (l[f] > e[f] ? -1 : 1) * S : E[f] = (u[f] > n[f] ? -1 : 1) * S; - } - } - if (t !== r) { - const z = f === "x" ? "y" : "x", S = s[f] === a[z], H = l[z] > u[z], C = l[z] < u[z]; - (s[f] === 1 && (!S && H || S && C) || s[f] !== 1 && (!S && C || S && H)) && (g = f === "x" ? $ : T); - } - const A = { x: l.x + k.x, y: l.y + k.y }, D = { x: u.x + E.x, y: u.y + E.y }, O = Math.max(Math.abs(A.x - g[0].x), Math.abs(D.x - g[0].x)), V = Math.max(Math.abs(A.y - g[0].y), Math.abs(D.y - g[0].y)); - O >= V ? (p = (A.x + D.x) / 2, x = g[0].y) : (p = g[0].x, x = (A.y + D.y) / 2); - } - return [[ - e, - { x: l.x + k.x, y: l.y + k.y }, - ...g, - { x: u.x + E.x, y: u.y + E.y }, - n - ], p, x, v, b]; -} -function E0(e, t, n, r) { - const o = Math.min(gl(e, t) / 2, gl(t, n) / 2, r), { x: i, y: s } = t; - if (e.x === i && i === n.x || e.y === s && s === n.y) - return `L${i} ${s}`; - if (e.y === s) { - const u = e.x < n.x ? -1 : 1, c = e.y < n.y ? 1 : -1; - return `L ${i + o * u},${s}Q ${i},${s} ${i},${s + o * c}`; - } - const a = e.x < n.x ? 1 : -1, l = e.y < n.y ? -1 : 1; - return `L ${i},${s + o * l}Q ${i},${s} ${i + o * a},${s}`; -} -function mi({ sourceX: e, sourceY: t, sourcePosition: n = Ee.Bottom, targetX: r, targetY: o, targetPosition: i = Ee.Top, borderRadius: s = 5, centerX: a, centerY: l, offset: u = 20 }) { - const [c, f, d, g, p] = k0({ - source: { x: e, y: t }, - sourcePosition: n, - target: { x: r, y: o }, - targetPosition: i, - center: { x: a, y: l }, - offset: u - }); - return [c.reduce((k, E, m) => { - let _ = ""; - return m > 0 && m < c.length - 1 ? _ = E0(c[m - 1], E, c[m + 1], s) : _ = `${m === 0 ? "M" : "L"}${E.x} ${E.y}`, k += _, k; - }, ""), f, d, g, p]; -} -function hl(e) { - var t; - return e && !!(e.internals.handleBounds || (t = e.handles) != null && t.length) && !!(e.measured.width || e.width || e.initialWidth); -} -function $0(e) { - var f; - const { sourceNode: t, targetNode: n } = e; - if (!hl(t) || !hl(n)) - return null; - const r = t.internals.handleBounds || vl(t.handles), o = n.internals.handleBounds || vl(n.handles), i = pl((r == null ? void 0 : r.source) ?? [], e.sourceHandle), s = pl( - // when connection type is loose we can define all handles as sources and connect source -> source - e.connectionMode === cr.Strict ? (o == null ? void 0 : o.target) ?? [] : ((o == null ? void 0 : o.target) ?? []).concat((o == null ? void 0 : o.source) ?? []), - e.targetHandle - ); - if (!i || !s) - return (f = e.onError) == null || f.call(e, "008", Ar.error008(i ? "target" : "source", { - id: e.id, - sourceHandle: e.sourceHandle, - targetHandle: e.targetHandle - })), null; - const a = (i == null ? void 0 : i.position) || Ee.Bottom, l = (s == null ? void 0 : s.position) || Ee.Top, u = yo(t, i, a), c = yo(n, s, l); - return { - sourceX: u.x, - sourceY: u.y, - targetX: c.x, - targetY: c.y, - sourcePosition: a, - targetPosition: l - }; -} -function vl(e) { - if (!e) - return null; - const t = [], n = []; - for (const r of e) - r.width = r.width ?? 1, r.height = r.height ?? 1, r.type === "source" ? t.push(r) : r.type === "target" && n.push(r); - return { - source: t, - target: n - }; -} -function yo(e, t, n = Ee.Left, r = !1) { - const o = ((t == null ? void 0 : t.x) ?? 0) + e.internals.positionAbsolute.x, i = ((t == null ? void 0 : t.y) ?? 0) + e.internals.positionAbsolute.y, { width: s, height: a } = t ?? Qn(e); - if (r) - return { x: o + s / 2, y: i + a / 2 }; - switch ((t == null ? void 0 : t.position) ?? n) { - case Ee.Top: - return { x: o + s / 2, y: i }; - case Ee.Right: - return { x: o + s, y: i + a / 2 }; - case Ee.Bottom: - return { x: o + s / 2, y: i + a }; - case Ee.Left: - return { x: o, y: i + a / 2 }; - } -} -function pl(e, t) { - return e && (t ? e.find((n) => n.id === t) : e[0]) || null; -} -function Ts(e, t) { - return e ? typeof e == "string" ? e : `${t ? `${t}__` : ""}${Object.keys(e).sort().map((r) => `${r}=${e[r]}`).join("&")}` : ""; -} -function S0(e, { id: t, defaultColor: n, defaultMarkerStart: r, defaultMarkerEnd: o }) { - const i = /* @__PURE__ */ new Set(); - return e.reduce((s, a) => ([a.markerStart || r, a.markerEnd || o].forEach((l) => { - if (l && typeof l == "object") { - const u = Ts(l, t); - i.has(u) || (s.push({ id: u, color: l.color || n, ...l }), i.add(u)); - } - }), s), []).sort((s, a) => s.id.localeCompare(a.id)); -} -function P0(e, t, n, r, o) { - let i = 0.5; - o === "start" ? i = 0 : o === "end" && (i = 1); - let s = [ - (e.x + e.width * i) * t.zoom + t.x, - e.y * t.zoom + t.y - r - ], a = [-100 * i, -100]; - switch (n) { - case Ee.Right: - s = [ - (e.x + e.width) * t.zoom + t.x + r, - (e.y + e.height * i) * t.zoom + t.y - ], a = [0, -100 * i]; - break; - case Ee.Bottom: - s[1] = (e.y + e.height) * t.zoom + t.y + r, a[1] = 0; - break; - case Ee.Left: - s = [ - e.x * t.zoom + t.x - r, - (e.y + e.height * i) * t.zoom + t.y - ], a = [-100, -100 * i]; - break; - } - return `translate(${s[0]}px, ${s[1]}px) translate(${a[0]}%, ${a[1]}%)`; -} -const la = { - nodeOrigin: [0, 0], - nodeExtent: gi, - elevateNodesOnSelect: !0, - defaults: {} -}, N0 = { - ...la, - checkEquality: !0 -}; -function ua(e, t) { - const n = { ...e }; - for (const r in t) - t[r] !== void 0 && (n[r] = t[r]); - return n; -} -function T0(e, t, n) { - const r = ua(la, n); - for (const o of e.values()) - if (o.parentId) - ca(o, e, t, r); - else { - const i = So(o, r.nodeOrigin), s = Lr(o.extent) ? o.extent : r.nodeExtent, a = dr(i, s, Qn(o)); - o.internals.positionAbsolute = a; - } -} -function sc(e, t, n, r) { - var a, l; - const o = ua(N0, r), i = new Map(t), s = o != null && o.elevateNodesOnSelect ? 1e3 : 0; - t.clear(), n.clear(); - for (const u of e) { - let c = i.get(u.id); - if (o.checkEquality && u === (c == null ? void 0 : c.internals.userNode)) - t.set(u.id, c); - else { - const f = So(u, o.nodeOrigin), d = Lr(u.extent) ? u.extent : o.nodeExtent, g = dr(f, d, Qn(u)); - c = { - ...o.defaults, - ...u, - measured: { - width: (a = u.measured) == null ? void 0 : a.width, - height: (l = u.measured) == null ? void 0 : l.height - }, - internals: { - positionAbsolute: g, - // if user re-initializes the node or removes `measured` for whatever reason, we reset the handleBounds so that the node gets re-measured - handleBounds: u.measured ? c == null ? void 0 : c.internals.handleBounds : void 0, - z: ac(u, s), - userNode: u - } - }, t.set(u.id, c); - } - u.parentId && ca(c, t, n, r); - } -} -function M0(e, t) { - if (!e.parentId) - return; - const n = t.get(e.parentId); - n ? n.set(e.id, e) : t.set(e.parentId, /* @__PURE__ */ new Map([[e.id, e]])); -} -function ca(e, t, n, r) { - const { elevateNodesOnSelect: o, nodeOrigin: i, nodeExtent: s } = ua(la, r), a = e.parentId, l = t.get(a); - if (!l) { - console.warn(`Parent node ${a} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`); - return; - } - M0(e, n); - const u = o ? 1e3 : 0, { x: c, y: f, z: d } = H0(e, l, i, s, u), { positionAbsolute: g } = e.internals, p = c !== g.x || f !== g.y; - (p || d !== e.internals.z) && t.set(e.id, { - ...e, - internals: { - ...e.internals, - positionAbsolute: p ? { x: c, y: f } : g, - z: d - } - }); -} -function ac(e, t) { - return (Pn(e.zIndex) ? e.zIndex : 0) + (e.selected ? t : 0); -} -function H0(e, t, n, r, o) { - const { x: i, y: s } = t.internals.positionAbsolute, a = Qn(e), l = So(e, n), u = Lr(e.extent) ? dr(l, e.extent, a) : l; - let c = dr({ x: i + u.x, y: s + u.y }, r, a); - e.extent === "parent" && (c = Ju(c, a, t)); - const f = ac(e, o), d = t.internals.z ?? 0; - return { - x: c.x, - y: c.y, - z: d > f ? d : f - }; -} -function D0(e, t, n, r = [0, 0]) { - var s; - const o = [], i = /* @__PURE__ */ new Map(); - for (const a of e) { - const l = t.get(a.parentId); - if (!l) - continue; - const u = ((s = i.get(a.parentId)) == null ? void 0 : s.expandedRect) ?? Or(l), c = ec(u, a.rect); - i.set(a.parentId, { expandedRect: c, parent: l }); - } - return i.size > 0 && i.forEach(({ expandedRect: a, parent: l }, u) => { - var _; - const c = l.internals.positionAbsolute, f = Qn(l), d = l.origin ?? r, g = a.x < c.x ? Math.round(Math.abs(c.x - a.x)) : 0, p = a.y < c.y ? Math.round(Math.abs(c.y - a.y)) : 0, x = Math.max(f.width, Math.round(a.width)), k = Math.max(f.height, Math.round(a.height)), E = (x - f.width) * d[0], m = (k - f.height) * d[1]; - (g > 0 || p > 0 || E || m) && (o.push({ - id: u, - type: "position", - position: { - x: l.position.x - g + E, - y: l.position.y - p + m - } - }), (_ = n.get(u)) == null || _.forEach((v) => { - e.some((b) => b.id === v.id) || o.push({ - id: v.id, - type: "position", - position: { - x: v.position.x + g, - y: v.position.y + p - } - }); - })), (f.width < a.width || f.height < a.height || g || p) && o.push({ - id: u, - type: "dimensions", - setAttributes: !0, - dimensions: { - width: x + (g ? d[0] * g - E : 0), - height: k + (p ? d[1] * p - m : 0) - } - }); - }), o; -} -function A0(e, t, n, r, o, i) { - const s = r == null ? void 0 : r.querySelector(".xyflow__viewport"); - let a = !1; - if (!s) - return { changes: [], updatedInternals: a }; - const l = [], u = window.getComputedStyle(s), { m22: c } = new window.DOMMatrixReadOnly(u.transform), f = []; - for (const d of e.values()) { - const g = t.get(d.id); - if (!g) - continue; - if (g.hidden) { - t.set(g.id, { - ...g, - internals: { - ...g.internals, - handleBounds: void 0 - } - }), a = !0; - continue; - } - const p = aa(d.nodeElement), x = g.measured.width !== p.width || g.measured.height !== p.height; - if (!!(p.width && p.height && (x || !g.internals.handleBounds || d.force))) { - const E = d.nodeElement.getBoundingClientRect(), m = Lr(g.extent) ? g.extent : i; - let { positionAbsolute: _ } = g.internals; - g.parentId && g.extent === "parent" ? _ = Ju(_, p, t.get(g.parentId)) : m && (_ = dr(_, m, p)); - const v = { - ...g, - measured: p, - internals: { - ...g.internals, - positionAbsolute: _, - handleBounds: { - source: cl("source", d.nodeElement, E, c, g.id), - target: cl("target", d.nodeElement, E, c, g.id) - } - } - }; - t.set(g.id, v), g.parentId && ca(v, t, n, { nodeOrigin: o }), a = !0, x && (l.push({ - id: g.id, - type: "dimensions", - dimensions: p - }), g.expandParent && g.parentId && f.push({ - id: g.id, - parentId: g.parentId, - rect: Or(v, o) - })); - } - } - if (f.length > 0) { - const d = D0(f, t, n, o); - l.push(...d); - } - return { changes: l, updatedInternals: a }; -} -async function V0({ delta: e, panZoom: t, transform: n, translateExtent: r, width: o, height: i }) { - if (!t || !e.x && !e.y) - return Promise.resolve(!1); - const s = await t.setViewportConstrained({ - x: n[0] + e.x, - y: n[1] + e.y, - zoom: n[2] - }, [ - [0, 0], - [o, i] - ], r), a = !!s && (s.x !== n[0] || s.y !== n[1] || s.k !== n[2]); - return Promise.resolve(a); -} -function ml(e, t, n, r, o, i) { - let s = o; - const a = r.get(s) || /* @__PURE__ */ new Map(); - r.set(s, a.set(n, t)), s = `${o}-${e}`; - const l = r.get(s) || /* @__PURE__ */ new Map(); - if (r.set(s, l.set(n, t)), i) { - s = `${o}-${e}-${i}`; - const u = r.get(s) || /* @__PURE__ */ new Map(); - r.set(s, u.set(n, t)); - } -} -function lc(e, t, n) { - e.clear(), t.clear(); - for (const r of n) { - const { source: o, target: i, sourceHandle: s = null, targetHandle: a = null } = r, l = { edgeId: r.id, source: o, target: i, sourceHandle: s, targetHandle: a }, u = `${o}-${s}--${i}-${a}`, c = `${i}-${a}--${o}-${s}`; - ml("source", l, c, e, o, s), ml("target", l, u, e, i, a), t.set(r.id, r); - } -} -function O0(e, t) { - if (e === null || t === null) - return !1; - const n = Array.isArray(e) ? e : [e], r = Array.isArray(t) ? t : [t]; - if (n.length !== r.length) - return !1; - for (let o = 0; o < n.length; o++) - if (n[o].id !== r[o].id || n[o].type !== r[o].type || !Object.is(n[o].data, r[o].data)) - return !1; - return !0; -} -function uc(e, t) { - if (!e.parentId) - return !1; - const n = t.get(e.parentId); - return n ? n.selected ? !0 : uc(n, t) : !1; -} -function yl(e, t, n) { - var o; - let r = e; - do { - if ((o = r == null ? void 0 : r.matches) != null && o.call(r, t)) - return !0; - if (r === n) - return !1; - r = r == null ? void 0 : r.parentElement; - } while (r); - return !1; -} -function L0(e, t, n, r) { - const o = /* @__PURE__ */ new Map(); - for (const [i, s] of e) - if ((s.selected || s.id === r) && (!s.parentId || !uc(s, e)) && (s.draggable || t && typeof s.draggable > "u")) { - const a = e.get(i); - a && o.set(i, { - id: i, - position: a.position || { x: 0, y: 0 }, - distance: { - x: n.x - a.internals.positionAbsolute.x, - y: n.y - a.internals.positionAbsolute.y - }, - extent: a.extent, - parentId: a.parentId, - origin: a.origin, - expandParent: a.expandParent, - internals: { - positionAbsolute: a.internals.positionAbsolute || { x: 0, y: 0 } - }, - measured: { - width: a.measured.width ?? 0, - height: a.measured.height ?? 0 - } - }); - } - return o; -} -function rs({ nodeId: e, dragItems: t, nodeLookup: n, dragging: r = !0 }) { - var s, a, l; - const o = []; - for (const [u, c] of t) { - const f = (s = n.get(u)) == null ? void 0 : s.internals.userNode; - f && o.push({ - ...f, - position: c.position, - dragging: r - }); - } - if (!e) - return [o[0], o]; - const i = (a = n.get(e)) == null ? void 0 : a.internals.userNode; - return [ - i ? { - ...i, - position: ((l = t.get(e)) == null ? void 0 : l.position) || i.position, - dragging: r - } : o[0], - o - ]; -} -function I0({ onNodeMouseDown: e, getStoreItems: t, onDragStart: n, onDrag: r, onDragStop: o }) { - let i = { x: null, y: null }, s = 0, a = /* @__PURE__ */ new Map(), l = !1, u = { x: 0, y: 0 }, c = null, f = !1, d = null, g = !1; - function p({ noDragClassName: k, handleSelector: E, domNode: m, isSelectable: _, nodeId: v, nodeClickDistance: b = 0 }) { - d = Wt(m); - function N({ x: D, y: O }, V) { - const { nodeLookup: z, nodeExtent: S, snapGrid: H, snapToGrid: C, nodeOrigin: P, onNodeDrag: M, onSelectionDrag: I, onError: B, updateNodePositions: F } = t(); - i = { x: D, y: O }; - let K = !1, oe = { x: 0, y: 0, x2: 0, y2: 0 }; - if (a.size > 1 && S) { - const J = Po(a); - oe = Ps(J); - } - for (const [J, W] of a) { - if (!z.has(J)) - continue; - let de = { x: D - W.distance.x, y: O - W.distance.y }; - C && (de = ia(de, H)); - let we = [ - [S[0][0], S[0][1]], - [S[1][0], S[1][1]] - ]; - if (a.size > 1 && S && !W.extent) { - const { positionAbsolute: ze } = W.internals, ie = ze.x - oe.x + S[0][0], ge = ze.x + W.measured.width - oe.x2 + S[1][0], Ye = ze.y - oe.y + S[0][1], Ae = ze.y + W.measured.height - oe.y2 + S[1][1]; - we = [ - [ie, Ye], - [ge, Ae] - ]; - } - const { position: Ce, positionAbsolute: fe } = d0({ - nodeId: J, - nextPosition: de, - nodeLookup: z, - nodeExtent: we, - nodeOrigin: P, - onError: B - }); - K = K || W.position.x !== Ce.x || W.position.y !== Ce.y, W.position = Ce, W.internals.positionAbsolute = fe; - } - if (K && (F(a, !0), V && (r || M || !v && I))) { - const [J, W] = rs({ - nodeId: v, - dragItems: a, - nodeLookup: z - }); - r == null || r(V, a, J, W), M == null || M(V, J, W), v || I == null || I(V, W); - } - } - async function $() { - if (!c) - return; - const { transform: D, panBy: O, autoPanSpeed: V, autoPanOnNodeDrag: z } = t(); - if (!z) { - l = !1, cancelAnimationFrame(s); - return; - } - const [S, H] = Qu(u, c, V); - (S !== 0 || H !== 0) && (i.x = (i.x ?? 0) - S / D[2], i.y = (i.y ?? 0) - H / D[2], await O({ x: S, y: H }) && N(i, null)), s = requestAnimationFrame($); - } - function T(D) { - var K; - const { nodeLookup: O, multiSelectionActive: V, nodesDraggable: z, transform: S, snapGrid: H, snapToGrid: C, selectNodesOnDrag: P, onNodeDragStart: M, onSelectionDragStart: I, unselectNodesAndEdges: B } = t(); - f = !0, (!P || !_) && !V && v && ((K = O.get(v)) != null && K.selected || B()), _ && P && v && (e == null || e(v)); - const F = ns(D.sourceEvent, { transform: S, snapGrid: H, snapToGrid: C, containerBounds: c }); - if (i = F, a = L0(O, z, F, v), a.size > 0 && (n || M || !v && I)) { - const [oe, J] = rs({ - nodeId: v, - dragItems: a, - nodeLookup: O - }); - n == null || n(D.sourceEvent, a, oe, J), M == null || M(D.sourceEvent, oe, J), v || I == null || I(D.sourceEvent, J); - } - } - const A = ph().clickDistance(b).on("start", (D) => { - const { domNode: O, nodeDragThreshold: V, transform: z, snapGrid: S, snapToGrid: H } = t(); - c = (O == null ? void 0 : O.getBoundingClientRect()) || null, g = !1, V === 0 && T(D), i = ns(D.sourceEvent, { transform: z, snapGrid: S, snapToGrid: H, containerBounds: c }), u = Mn(D.sourceEvent, c); - }).on("drag", (D) => { - const { autoPanOnNodeDrag: O, transform: V, snapGrid: z, snapToGrid: S, nodeDragThreshold: H, nodeLookup: C } = t(), P = ns(D.sourceEvent, { transform: V, snapGrid: z, snapToGrid: S, containerBounds: c }); - if ((D.sourceEvent.type === "touchmove" && D.sourceEvent.touches.length > 1 || // if user deletes a node while dragging, we need to abort the drag to prevent errors - v && !C.has(v)) && (g = !0), !g) { - if (!l && O && f && (l = !0, $()), !f) { - const M = P.xSnapped - (i.x ?? 0), I = P.ySnapped - (i.y ?? 0); - Math.sqrt(M * M + I * I) > H && T(D); - } - (i.x !== P.xSnapped || i.y !== P.ySnapped) && a && f && (u = Mn(D.sourceEvent, c), N(P, D.sourceEvent)); - } - }).on("end", (D) => { - if (!(!f || g) && (l = !1, f = !1, cancelAnimationFrame(s), a.size > 0)) { - const { nodeLookup: O, updateNodePositions: V, onNodeDragStop: z, onSelectionDragStop: S } = t(); - if (V(a, !1), o || z || !v && S) { - const [H, C] = rs({ - nodeId: v, - dragItems: a, - nodeLookup: O, - dragging: !1 - }); - o == null || o(D.sourceEvent, a, H, C), z == null || z(D.sourceEvent, H, C), v || S == null || S(D.sourceEvent, C); - } - } - }).filter((D) => { - const O = D.target; - return !D.button && (!k || !yl(O, `.${k}`, m)) && (!E || yl(O, E, m)); - }); - d.call(A); - } - function x() { - d == null || d.on(".drag", null); - } - return { - update: p, - destroy: x - }; -} -function z0(e, t, n) { - const r = [], o = { - x: e.x - n, - y: e.y - n, - width: n * 2, - height: n * 2 - }; - for (const i of t.values()) - mo(o, Or(i)) > 0 && r.push(i); - return r; -} -const R0 = 250; -function B0(e, t, n, r) { - var a, l; - let o = [], i = 1 / 0; - const s = z0(e, n, t + R0); - for (const u of s) { - const c = [...((a = u.internals.handleBounds) == null ? void 0 : a.source) ?? [], ...((l = u.internals.handleBounds) == null ? void 0 : l.target) ?? []]; - for (const f of c) { - if (r.nodeId === f.nodeId && r.type === f.type && r.id === f.id) - continue; - const { x: d, y: g } = yo(u, f, f.position, !0), p = Math.sqrt(Math.pow(d - e.x, 2) + Math.pow(g - e.y, 2)); - p > t || (p < i ? (o = [{ ...f, x: d, y: g }], i = p) : p === i && o.push({ ...f, x: d, y: g })); - } - } - if (!o.length) - return null; - if (o.length > 1) { - const u = r.type === "source" ? "target" : "source"; - return o.find((c) => c.type === u) ?? o[0]; - } - return o[0]; -} -function cc(e, t, n, r, o, i = !1) { - var u, c, f; - const s = r.get(e); - if (!s) - return null; - const a = o === "strict" ? (u = s.internals.handleBounds) == null ? void 0 : u[t] : [...((c = s.internals.handleBounds) == null ? void 0 : c.source) ?? [], ...((f = s.internals.handleBounds) == null ? void 0 : f.target) ?? []], l = (n ? a == null ? void 0 : a.find((d) => d.id === n) : a == null ? void 0 : a[0]) ?? null; - return l && i ? { ...l, ...yo(s, l, l.position, !0) } : l; -} -function dc(e, t) { - return e || (t != null && t.classList.contains("target") ? "target" : t != null && t.classList.contains("source") ? "source" : null); -} -function Y0(e, t) { - let n = null; - return t ? n = !0 : e && !t && (n = !1), n; -} -const fc = () => !0; -function Z0(e, { connectionMode: t, connectionRadius: n, handleId: r, nodeId: o, edgeUpdaterType: i, isTarget: s, domNode: a, nodeLookup: l, lib: u, autoPanOnConnect: c, flowId: f, panBy: d, cancelConnection: g, onConnectStart: p, onConnect: x, onConnectEnd: k, isValidConnection: E = fc, onReconnectEnd: m, updateConnection: _, getTransform: v, getFromHandle: b, autoPanSpeed: N }) { - const $ = h0(e.target); - let T = 0, A; - const { x: D, y: O } = Mn(e), V = $ == null ? void 0 : $.elementFromPoint(D, O), z = dc(i, V), S = a == null ? void 0 : a.getBoundingClientRect(); - if (!S || !z) - return; - const H = cc(o, z, r, l, t); - if (!H) - return; - let C = Mn(e, S), P = !1, M = null, I = !1, B = null; - function F() { - if (!c || !S) - return; - const [fe, ze] = Qu(C, S, N); - d({ x: fe, y: ze }), T = requestAnimationFrame(F); - } - const K = { - ...H, - nodeId: o, - type: z, - position: H.position - }, oe = l.get(o), W = { - inProgress: !0, - isValid: null, - from: yo(oe, K, Ee.Left, !0), - fromHandle: K, - fromPosition: K.position, - fromNode: oe, - to: C, - toHandle: null, - toPosition: ol[K.position], - toNode: null - }; - _(W); - let de = W; - p == null || p(e, { nodeId: o, handleId: r, handleType: z }); - function we(fe) { - if (!b() || !K) { - Ce(fe); - return; - } - const ze = v(); - C = Mn(fe, S), A = B0(No(C, ze, !1, [1, 1]), n, l, K), P || (F(), P = !0); - const ie = gc(fe, { - handle: A, - connectionMode: t, - fromNodeId: o, - fromHandleId: r, - fromType: s ? "target" : "source", - isValidConnection: E, - doc: $, - lib: u, - flowId: f, - nodeLookup: l - }); - B = ie.handleDomNode, M = ie.connection, I = Y0(!!A, ie.isValid); - const ge = { - // from stays the same - ...de, - isValid: I, - to: A && I ? tc({ x: A.x, y: A.y }, ze) : C, - toHandle: ie.toHandle, - toPosition: I && ie.toHandle ? ie.toHandle.position : ol[K.position], - toNode: ie.toHandle ? l.get(ie.toHandle.nodeId) : null - }; - I && A && de.toHandle && ge.toHandle && de.toHandle.type === ge.toHandle.type && de.toHandle.nodeId === ge.toHandle.nodeId && de.toHandle.id === ge.toHandle.id && de.to.x === ge.to.x && de.to.y === ge.to.y || (_(ge), de = ge); - } - function Ce(fe) { - (A || B) && M && I && (x == null || x(M)); - const { inProgress: ze, ...ie } = de, ge = { - ...ie, - toPosition: de.toHandle ? de.toPosition : null - }; - k == null || k(fe, ge), i && (m == null || m(fe, ge)), g(), cancelAnimationFrame(T), P = !1, I = !1, M = null, B = null, $.removeEventListener("mousemove", we), $.removeEventListener("mouseup", Ce), $.removeEventListener("touchmove", we), $.removeEventListener("touchend", Ce); - } - $.addEventListener("mousemove", we), $.addEventListener("mouseup", Ce), $.addEventListener("touchmove", we), $.addEventListener("touchend", Ce); -} -function gc(e, { handle: t, connectionMode: n, fromNodeId: r, fromHandleId: o, fromType: i, doc: s, lib: a, flowId: l, isValidConnection: u = fc, nodeLookup: c }) { - const f = i === "target", d = t ? s.querySelector(`.${a}-flow__handle[data-id="${l}-${t == null ? void 0 : t.nodeId}-${t == null ? void 0 : t.id}-${t == null ? void 0 : t.type}"]`) : null, { x: g, y: p } = Mn(e), x = s.elementFromPoint(g, p), k = x != null && x.classList.contains(`${a}-flow__handle`) ? x : d, E = { - handleDomNode: k, - isValid: !1, - connection: null, - toHandle: null - }; - if (k) { - const m = dc(void 0, k), _ = k.getAttribute("data-nodeid"), v = k.getAttribute("data-handleid"), b = k.classList.contains("connectable"), N = k.classList.contains("connectableend"); - if (!_ || !m) - return E; - const $ = { - source: f ? _ : r, - sourceHandle: f ? v : o, - target: f ? r : _, - targetHandle: f ? o : v - }; - E.connection = $; - const A = b && N && (n === cr.Strict ? f && m === "source" || !f && m === "target" : _ !== r || v !== o); - E.isValid = A && u($), E.toHandle = cc(_, m, v, c, n, !1); - } - return E; -} -const X0 = { - onPointerDown: Z0, - isValid: gc -}; -function W0({ domNode: e, panZoom: t, getTransform: n, getViewScale: r }) { - const o = Wt(e); - function i({ translateExtent: a, width: l, height: u, zoomStep: c = 10, pannable: f = !0, zoomable: d = !0, inversePan: g = !1 }) { - const p = (_) => { - const v = n(); - if (_.sourceEvent.type !== "wheel" || !t) - return; - const b = -_.sourceEvent.deltaY * (_.sourceEvent.deltaMode === 1 ? 0.05 : _.sourceEvent.deltaMode ? 1 : 2e-3) * c, N = v[2] * Math.pow(2, b); - t.scaleTo(N); - }; - let x = [0, 0]; - const k = (_) => { - (_.sourceEvent.type === "mousedown" || _.sourceEvent.type === "touchstart") && (x = [ - _.sourceEvent.clientX ?? _.sourceEvent.touches[0].clientX, - _.sourceEvent.clientY ?? _.sourceEvent.touches[0].clientY - ]); - }, E = (_) => { - const v = n(); - if (_.sourceEvent.type !== "mousemove" && _.sourceEvent.type !== "touchmove" || !t) - return; - const b = [ - _.sourceEvent.clientX ?? _.sourceEvent.touches[0].clientX, - _.sourceEvent.clientY ?? _.sourceEvent.touches[0].clientY - ], N = [b[0] - x[0], b[1] - x[1]]; - x = b; - const $ = r() * Math.max(v[2], Math.log(v[2])) * (g ? -1 : 1), T = { - x: v[0] - N[0] * $, - y: v[1] - N[1] * $ - }, A = [ - [0, 0], - [l, u] - ]; - t.setViewportConstrained({ - x: T.x, - y: T.y, - zoom: v[2] - }, A, a); - }, m = Gu().on("start", k).on("zoom", f ? E : null).on("zoom.wheel", d ? p : null); - o.call(m, {}); - } - function s() { - o.on("zoom", null); - } - return { - update: i, - destroy: s, - pointer: Jt - }; -} -const F0 = (e, t) => e.x !== t.x || e.y !== t.y || e.zoom !== t.k, Zi = (e) => ({ - x: e.x, - y: e.y, - zoom: e.k -}), os = ({ x: e, y: t, zoom: n }) => Ri.translate(e, t).scale(n), wr = (e, t) => e.target.closest(`.${t}`), hc = (e, t) => t === 2 && Array.isArray(e) && e.includes(2), is = (e, t = 0, n = () => { -}) => { - const r = typeof t == "number" && t > 0; - return r || n(), r ? e.transition().duration(t).on("end", n) : e; -}, vc = (e) => { - const t = e.ctrlKey && pi() ? 10 : 1; - return -e.deltaY * (e.deltaMode === 1 ? 0.05 : e.deltaMode ? 1 : 2e-3) * t; -}; -function K0({ zoomPanValues: e, noWheelClassName: t, d3Selection: n, d3Zoom: r, panOnScrollMode: o, panOnScrollSpeed: i, zoomOnPinch: s, onPanZoomStart: a, onPanZoom: l, onPanZoomEnd: u }) { - return (c) => { - if (wr(c, t)) - return !1; - c.preventDefault(), c.stopImmediatePropagation(); - const f = n.property("__zoom").k || 1; - if (c.ctrlKey && s) { - const k = Jt(c), E = vc(c), m = f * Math.pow(2, E); - r.scaleTo(n, m, k, c); - return; - } - const d = c.deltaMode === 1 ? 20 : 1; - let g = o === Kn.Vertical ? 0 : c.deltaX * d, p = o === Kn.Horizontal ? 0 : c.deltaY * d; - !pi() && c.shiftKey && o !== Kn.Vertical && (g = c.deltaY * d, p = 0), r.translateBy( - n, - -(g / f) * i, - -(p / f) * i, - // @ts-ignore - { internal: !0 } - ); - const x = Zi(n.property("__zoom")); - clearTimeout(e.panScrollTimeout), e.isPanScrolling || (e.isPanScrolling = !0, a == null || a(c, x)), e.isPanScrolling && (l == null || l(c, x), e.panScrollTimeout = setTimeout(() => { - u == null || u(c, x), e.isPanScrolling = !1; - }, 150)); - }; -} -function q0({ noWheelClassName: e, preventScrolling: t, d3ZoomHandler: n }) { - return function(r, o) { - if (!t && r.type === "wheel" && !r.ctrlKey || wr(r, e)) - return null; - r.preventDefault(), n.call(this, r, o); - }; -} -function G0({ zoomPanValues: e, onDraggingChange: t, onPanZoomStart: n }) { - return (r) => { - var i, s, a; - if ((i = r.sourceEvent) != null && i.internal) - return; - const o = Zi(r.transform); - e.mouseButton = ((s = r.sourceEvent) == null ? void 0 : s.button) || 0, e.isZoomingOrPanning = !0, e.prevViewport = o, ((a = r.sourceEvent) == null ? void 0 : a.type) === "mousedown" && t(!0), n && (n == null || n(r.sourceEvent, o)); - }; -} -function U0({ zoomPanValues: e, panOnDrag: t, onPaneContextMenu: n, onTransformChange: r, onPanZoom: o }) { - return (i) => { - var s, a; - e.usedRightMouseButton = !!(n && hc(t, e.mouseButton ?? 0)), (s = i.sourceEvent) != null && s.sync || r([i.transform.x, i.transform.y, i.transform.k]), o && !((a = i.sourceEvent) != null && a.internal) && (o == null || o(i.sourceEvent, Zi(i.transform))); - }; -} -function j0({ zoomPanValues: e, panOnDrag: t, panOnScroll: n, onDraggingChange: r, onPanZoomEnd: o, onPaneContextMenu: i }) { - return (s) => { - var a; - if (!((a = s.sourceEvent) != null && a.internal) && (e.isZoomingOrPanning = !1, i && hc(t, e.mouseButton ?? 0) && !e.usedRightMouseButton && s.sourceEvent && i(s.sourceEvent), e.usedRightMouseButton = !1, r(!1), o && F0(e.prevViewport, s.transform))) { - const l = Zi(s.transform); - e.prevViewport = l, clearTimeout(e.timerId), e.timerId = setTimeout( - () => { - o == null || o(s.sourceEvent, l); - }, - // we need a setTimeout for panOnScroll to supress multiple end events fired during scroll - n ? 150 : 0 - ); - } - }; -} -function J0({ zoomActivationKeyPressed: e, zoomOnScroll: t, zoomOnPinch: n, panOnDrag: r, panOnScroll: o, zoomOnDoubleClick: i, userSelectionActive: s, noWheelClassName: a, noPanClassName: l, lib: u }) { - return (c) => { - var p; - const f = e || t, d = n && c.ctrlKey; - if (c.button === 1 && c.type === "mousedown" && (wr(c, `${u}-flow__node`) || wr(c, `${u}-flow__edge`))) - return !0; - if (!r && !f && !o && !i && !n || s || wr(c, a) && c.type === "wheel" || wr(c, l) && (c.type !== "wheel" || o && c.type === "wheel" && !e) || !n && c.ctrlKey && c.type === "wheel") - return !1; - if (!n && c.type === "touchstart" && ((p = c.touches) == null ? void 0 : p.length) > 1) - return c.preventDefault(), !1; - if (!f && !o && !d && c.type === "wheel" || !r && (c.type === "mousedown" || c.type === "touchstart") || Array.isArray(r) && !r.includes(c.button) && c.type === "mousedown") - return !1; - const g = Array.isArray(r) && r.includes(c.button) || !c.button || c.button <= 1; - return (!c.ctrlKey || c.type === "wheel") && g; - }; -} -function Q0({ domNode: e, minZoom: t, maxZoom: n, paneClickDistance: r, translateExtent: o, viewport: i, onPanZoom: s, onPanZoomStart: a, onPanZoomEnd: l, onDraggingChange: u }) { - const c = { - isZoomingOrPanning: !1, - usedRightMouseButton: !1, - prevViewport: { x: 0, y: 0, zoom: 0 }, - mouseButton: 0, - timerId: void 0, - panScrollTimeout: void 0, - isPanScrolling: !1 - }, f = e.getBoundingClientRect(), d = Gu().clickDistance(!Pn(r) || r < 0 ? 0 : r).scaleExtent([t, n]).translateExtent(o), g = Wt(e).call(d); - _({ - x: i.x, - y: i.y, - zoom: Vr(i.zoom, t, n) - }, [ - [0, 0], - [f.width, f.height] - ], o); - const p = g.on("wheel.zoom"), x = g.on("dblclick.zoom"); - d.wheelDelta(vc); - function k(V, z) { - return g ? new Promise((S) => { - d == null || d.transform(is(g, z == null ? void 0 : z.duration, () => S(!0)), V); - }) : Promise.resolve(!1); - } - function E({ noWheelClassName: V, noPanClassName: z, onPaneContextMenu: S, userSelectionActive: H, panOnScroll: C, panOnDrag: P, panOnScrollMode: M, panOnScrollSpeed: I, preventScrolling: B, zoomOnPinch: F, zoomOnScroll: K, zoomOnDoubleClick: oe, zoomActivationKeyPressed: J, lib: W, onTransformChange: de }) { - H && !c.isZoomingOrPanning && m(); - const Ce = C && !J && !H ? K0({ - zoomPanValues: c, - noWheelClassName: V, - d3Selection: g, - d3Zoom: d, - panOnScrollMode: M, - panOnScrollSpeed: I, - zoomOnPinch: F, - onPanZoomStart: a, - onPanZoom: s, - onPanZoomEnd: l - }) : q0({ - noWheelClassName: V, - preventScrolling: B, - d3ZoomHandler: p - }); - if (g.on("wheel.zoom", Ce, { passive: !1 }), !H) { - const ze = G0({ - zoomPanValues: c, - onDraggingChange: u, - onPanZoomStart: a - }); - d.on("start", ze); - const ie = U0({ - zoomPanValues: c, - panOnDrag: P, - onPaneContextMenu: !!S, - onPanZoom: s, - onTransformChange: de - }); - d.on("zoom", ie); - const ge = j0({ - zoomPanValues: c, - panOnDrag: P, - panOnScroll: C, - onPaneContextMenu: S, - onPanZoomEnd: l, - onDraggingChange: u - }); - d.on("end", ge); - } - const fe = J0({ - zoomActivationKeyPressed: J, - panOnDrag: P, - zoomOnScroll: K, - panOnScroll: C, - zoomOnDoubleClick: oe, - zoomOnPinch: F, - userSelectionActive: H, - noPanClassName: z, - noWheelClassName: V, - lib: W - }); - d.filter(fe), oe ? g.on("dblclick.zoom", x) : g.on("dblclick.zoom", null); - } - function m() { - d.on("zoom", null); - } - async function _(V, z, S) { - const H = os(V), C = d == null ? void 0 : d.constrain()(H, z, S); - return C && await k(C), new Promise((P) => P(C)); - } - async function v(V, z) { - const S = os(V); - return await k(S, z), new Promise((H) => H(S)); - } - function b(V) { - if (g) { - const z = os(V), S = g.property("__zoom"); - (S.k !== V.zoom || S.x !== V.x || S.y !== V.y) && (d == null || d.transform(g, z, null, { sync: !0 })); - } - } - function N() { - const V = g ? qu(g.node()) : { x: 0, y: 0, k: 1 }; - return { x: V.x, y: V.y, zoom: V.k }; - } - function $(V, z) { - return g ? new Promise((S) => { - d == null || d.scaleTo(is(g, z == null ? void 0 : z.duration, () => S(!0)), V); - }) : Promise.resolve(!1); - } - function T(V, z) { - return g ? new Promise((S) => { - d == null || d.scaleBy(is(g, z == null ? void 0 : z.duration, () => S(!0)), V); - }) : Promise.resolve(!1); - } - function A(V) { - d == null || d.scaleExtent(V); - } - function D(V) { - d == null || d.translateExtent(V); - } - function O(V) { - const z = !Pn(V) || V < 0 ? 0 : V; - d == null || d.clickDistance(z); - } - return { - update: E, - destroy: m, - setViewport: v, - setViewportConstrained: _, - getViewport: N, - scaleTo: $, - scaleBy: T, - setScaleExtent: A, - setTranslateExtent: D, - syncViewport: b, - setClickDistance: O - }; -} -var wl; -(function(e) { - e.Line = "line", e.Handle = "handle"; -})(wl || (wl = {})); -var ep = /* @__PURE__ */ ne('
'); -function jn(e, t) { - ue(t, !1); - const [n, r] = tt(), o = () => j(oe, "$connectable", n), i = () => j(Ce, "$connectionRadius", n), s = () => j(de, "$domNode", n), a = () => j(we, "$nodeLookup", n), l = () => j(W, "$connectionMode", n), u = () => j(ie, "$lib", n), c = () => j(he, "$autoPanOnConnect", n), f = () => j(Oe, "$flowId", n), d = () => j(ze, "$isValidConnectionStore", n), g = () => j(Ye, "$onedgecreate", n), p = () => j(Ne, "$onConnectAction", n), x = () => j(qe, "$onConnectStartAction", n), k = () => j(Re, "$onConnectEndAction", n), E = () => j(fe, "$viewport", n), m = () => j(ut, "$connection", n), _ = () => j(se, "$edges", n), v = () => j(ke, "$connectionLookup", n), b = te(), N = te(), $ = te(), T = te(), A = te(), D = te(), O = te(), V = te(); - let z = w(t, "id", 12, void 0), S = w(t, "type", 12, "source"), H = w(t, "position", 28, () => Ee.Top), C = w(t, "style", 12, void 0), P = w(t, "isValidConnection", 12, void 0), M = w(t, "onconnect", 12, void 0), I = w(t, "ondisconnect", 12, void 0), B = w(t, "isConnectable", 12, void 0), F = w(t, "class", 12, void 0); - const K = ar("svelteflow__node_id"), oe = ar("svelteflow__node_connectable"), J = Ke(), { - connectionMode: W, - domNode: de, - nodeLookup: we, - connectionRadius: Ce, - viewport: fe, - isValidConnection: ze, - lib: ie, - addEdge: ge, - onedgecreate: Ye, - panBy: Ae, - cancelConnection: Ze, - updateConnection: ee, - autoPanOnConnect: he, - edges: se, - connectionLookup: ke, - onconnect: Ne, - onconnectstart: qe, - onconnectend: Re, - flowId: Oe, - connection: ut - } = J; - function nt(Pe) { - const ot = rc(Pe); - (ot && Pe.button === 0 || !ot) && X0.onPointerDown(Pe, { - handleId: h($), - nodeId: K, - isTarget: h(b), - connectionRadius: i(), - domNode: s(), - nodeLookup: a(), - connectionMode: l(), - lib: u(), - autoPanOnConnect: c(), - flowId: f(), - isValidConnection: P() ?? d(), - updateConnection: ee, - cancelConnection: Ze, - panBy: Ae, - onConnect: (me) => { - var lt; - const it = g() ? g()(me) : me; - it && (ge(it), (lt = p()) == null || lt(me)); - }, - onConnectStart: (me, it) => { - var lt; - (lt = x()) == null || lt(me, { - nodeId: it.nodeId, - handleId: it.handleId, - handleType: it.handleType - }); - }, - onConnectEnd: (me, it) => { - var lt; - (lt = k()) == null || lt(me, it); - }, - getTransform: () => [ - E().x, - E().y, - E().zoom - ], - getFromHandle: () => m().fromHandle - }); - } - let Q = te(null), Xe = te(); - le(() => U(S()), () => { - G(b, S() === "target"); - }), le( - () => (U(B()), o()), - () => { - G(N, B() !== void 0 ? B() : o()); - } - ), le(() => U(z()), () => { - G($, z() || null); - }), le( - () => (U(M()), U(I()), _(), v(), U(S()), U(z())), - () => { - (M() || I()) && (_(), G(Xe, v().get(`${K}-${S()}${z() ? `-${z()}` : ""}`))); - } - ), le( - () => (h(Q), h(Xe), U(I()), U(M())), - () => { - if (h(Q) && !s0(h(Xe), h(Q))) { - const Pe = h(Xe) ?? /* @__PURE__ */ new Map(); - il(h(Q), Pe, I()), il(Pe, h(Q), M()); - } - G(Q, h(Xe) ?? /* @__PURE__ */ new Map()); - } - ), le(() => m(), () => { - G(T, !!m().fromHandle); - }), le( - () => (m(), U(S()), h($)), - () => { - var Pe, ot, me; - G(A, ((Pe = m().fromHandle) == null ? void 0 : Pe.nodeId) === K && ((ot = m().fromHandle) == null ? void 0 : ot.type) === S() && ((me = m().fromHandle) == null ? void 0 : me.id) === h($)); - } - ), le( - () => (m(), U(S()), h($)), - () => { - var Pe, ot, me; - G(D, ((Pe = m().toHandle) == null ? void 0 : Pe.nodeId) === K && ((ot = m().toHandle) == null ? void 0 : ot.type) === S() && ((me = m().toHandle) == null ? void 0 : me.id) === h($)); - } - ), le( - () => (l(), m(), U(S()), h($)), - () => { - var Pe, ot, me; - G(O, l() === cr.Strict ? ((Pe = m().fromHandle) == null ? void 0 : Pe.type) !== S() : K !== ((ot = m().fromHandle) == null ? void 0 : ot.nodeId) || h($) !== ((me = m().fromHandle) == null ? void 0 : me.id)); - } - ), le(() => (h(D), m()), () => { - G(V, h(D) && m().isValid); - }), gt(), He(); - var ve = ep(); - ae(ve, "data-nodeid", K); - let ln; - var Gt = X(ve); - vt(Gt, t, "default", {}), Z(ve), $e( - (Pe) => { - ae(ve, "data-handleid", h($)), ae(ve, "data-handlepos", H()), ae(ve, "data-id", `${f() ?? ""}-${K ?? ""}-${z() || ""}-${S() ?? ""}`), ln = Ct(ve, 1, _n(Pe), null, ln, { - valid: h(V), - connectingto: h(D), - connectingfrom: h(A), - source: !h(b), - target: h(b), - connectablestart: h(N), - connectableend: h(N), - connectable: h(N), - connectionindicator: h(N) && (!h(T) || h(O)) - }), ae(ve, "style", C()); - }, - [ - () => $t([ - "svelte-flow__handle", - `svelte-flow__handle-${H()}`, - "nodrag", - "nopan", - H(), - F() - ]) - ], - pe - ), Qe("mousedown", ve, nt), Qe("touchstart", ve, nt), L(e, ve); - var un = ce({ - get id() { - return z(); - }, - set id(Pe) { - z(Pe), y(); - }, - get type() { - return S(); - }, - set type(Pe) { - S(Pe), y(); - }, - get position() { - return H(); - }, - set position(Pe) { - H(Pe), y(); - }, - get style() { - return C(); - }, - set style(Pe) { - C(Pe), y(); - }, - get isValidConnection() { - return P(); - }, - set isValidConnection(Pe) { - P(Pe), y(); - }, - get onconnect() { - return M(); - }, - set onconnect(Pe) { - M(Pe), y(); - }, - get ondisconnect() { - return I(); - }, - set ondisconnect(Pe) { - I(Pe), y(); - }, - get isConnectable() { - return B(); - }, - set isConnectable(Pe) { - B(Pe), y(); - }, - get class() { - return F(); - }, - set class(Pe) { - F(Pe), y(); - } - }); - return r(), un; -} -re( - jn, - { - id: {}, - type: {}, - position: {}, - style: {}, - isValidConnection: {}, - onconnect: {}, - ondisconnect: {}, - isConnectable: {}, - class: {} - }, - ["default"], - [], - !0 -); -var tp = /* @__PURE__ */ ne(" ", 1); -function yi(e, t) { - const n = rt(t, [ - "children", - "$$slots", - "$$events", - "$$legacy", - "$$host" - ]); - rt(n, ["data", "targetPosition", "sourcePosition"]), ue(t, !1); - let r = w(t, "data", 28, () => ({ label: "Node" })), o = w(t, "targetPosition", 12, void 0), i = w(t, "sourcePosition", 12, void 0); - He(); - var s = tp(), a = _e(s); - const l = /* @__PURE__ */ pe(() => o() ?? Ee.Top); - jn(a, { - type: "target", - get position() { - return h(l); - } - }); - var u = R(a), c = R(u); - const f = /* @__PURE__ */ pe(() => i() ?? Ee.Bottom); - return jn(c, { - type: "source", - get position() { - return h(f); - } - }), $e(() => { - var d; - return wn(u, ` ${((d = r()) == null ? void 0 : d.label) ?? ""} `); - }), L(e, s), ce({ - get data() { - return r(); - }, - set data(d) { - r(d), y(); - }, - get targetPosition() { - return o(); - }, - set targetPosition(d) { - o(d), y(); - }, - get sourcePosition() { - return i(); - }, - set sourcePosition(d) { - i(d), y(); - } - }); -} -re( - yi, - { - data: {}, - targetPosition: {}, - sourcePosition: {} - }, - [], - [], - !0 -); -var np = /* @__PURE__ */ ne(" ", 1); -function pc(e, t) { - const n = rt(t, [ - "children", - "$$slots", - "$$events", - "$$legacy", - "$$host" - ]); - rt(n, ["data", "sourcePosition"]), ue(t, !1); - let r = w(t, "data", 28, () => ({ label: "Node" })), o = w(t, "sourcePosition", 12, void 0); - He(), Te(); - var i = np(), s = _e(i), a = R(s); - const l = /* @__PURE__ */ pe(() => o() ?? Ee.Bottom); - return jn(a, { - type: "source", - get position() { - return h(l); - } - }), $e(() => { - var u; - return wn(s, `${((u = r()) == null ? void 0 : u.label) ?? ""} `); - }), L(e, i), ce({ - get data() { - return r(); - }, - set data(u) { - r(u), y(); - }, - get sourcePosition() { - return o(); - }, - set sourcePosition(u) { - o(u), y(); - } - }); -} -re(pc, { data: {}, sourcePosition: {} }, [], [], !0); -var rp = /* @__PURE__ */ ne(" ", 1); -function mc(e, t) { - const n = rt(t, [ - "children", - "$$slots", - "$$events", - "$$legacy", - "$$host" - ]); - rt(n, ["data", "targetPosition"]), ue(t, !1); - let r = w(t, "data", 28, () => ({ label: "Node" })), o = w(t, "targetPosition", 12, void 0); - He(), Te(); - var i = rp(), s = _e(i), a = R(s); - const l = /* @__PURE__ */ pe(() => o() ?? Ee.Top); - return jn(a, { - type: "target", - get position() { - return h(l); - } - }), $e(() => { - var u; - return wn(s, `${((u = r()) == null ? void 0 : u.label) ?? ""} `); - }), L(e, i), ce({ - get data() { - return r(); - }, - set data(u) { - r(u), y(); - }, - get targetPosition() { - return o(); - }, - set targetPosition(u) { - o(u), y(); - } - }); -} -re(mc, { data: {}, targetPosition: {} }, [], [], !0); -function yc(e, t) { - const n = rt(t, [ - "children", - "$$slots", - "$$events", - "$$legacy", - "$$host" - ]); - rt(n, []); -} -re(yc, {}, [], [], !0); -function _l(e, t, n) { - if (!t) - return; - const r = n ? t.querySelector(n) : t; - r && r.appendChild(e); -} -function kr(e, { target: t, domNode: n }) { - return _l(e, n, t), { - async update({ target: r, domNode: o }) { - _l(e, o, r); - }, - destroy() { - e.parentNode && e.parentNode.removeChild(e); - } - }; -} -var op = /* @__PURE__ */ ne("
"); -function wc(e, t) { - ue(t, !1); - const [n, r] = tt(), o = () => j(i, "$domNode", n), { domNode: i } = Ke(); - He(); - var s = op(), a = X(s); - vt(a, t, "default", {}), Z(s), ht(s, (l, u) => kr == null ? void 0 : kr(l, u), () => ({ - target: ".svelte-flow__edgelabel-renderer", - domNode: o() - })), L(e, s), ce(), r(); -} -re(wc, {}, ["default"], [], !0); -function _c() { - const { edgeLookup: e, selectionRect: t, selectionRectMode: n, multiselectionKeyPressed: r, addSelectedEdges: o, unselectNodesAndEdges: i, elementsSelectable: s } = Ke(); - return (a) => { - const l = q(e).get(a); - if (!l) { - console.warn("012", Ar.error012(a)); - return; - } - (l.selectable || q(s) && typeof l.selectable > "u") && (t.set(null), n.set(null), l.selected ? l.selected && q(r) && i({ nodes: [], edges: [l] }) : o([a])); - }; -} -var ip = /* @__PURE__ */ ne('
'); -function xc(e, t) { - ue(t, !1); - let n = w(t, "style", 12, void 0), r = w(t, "x", 12, void 0), o = w(t, "y", 12, void 0); - const i = _c(), s = ar("svelteflow__edge_id"); - return He(), wc(e, { - children: (a, l) => { - var u = ip(), c = X(u); - vt(c, t, "default", {}), Z(u), $e(() => { - ae(u, "style", "pointer-events: all;" + n()), at(u, "transform", `translate(-50%, -50%) translate(${r() ?? ""}px,${o() ?? ""}px)`); - }), Qe("keyup", u, () => { - }), Qe("click", u, () => { - s && i(s); - }), L(a, u); - }, - $$slots: { default: !0 } - }), ce({ - get style() { - return n(); - }, - set style(a) { - n(a), y(); - }, - get x() { - return r(); - }, - set x(a) { - r(a), y(); - }, - get y() { - return o(); - }, - set y(a) { - o(a), y(); - } - }); -} -re(xc, { style: {}, x: {}, y: {} }, ["default"], [], !0); -var sp = /* @__PURE__ */ xe(''), ap = /* @__PURE__ */ xe('', 1); -function To(e, t) { - ue(t, !1); - let n = w(t, "id", 12, void 0), r = w(t, "path", 12), o = w(t, "label", 12, void 0), i = w(t, "labelX", 12, void 0), s = w(t, "labelY", 12, void 0), a = w(t, "labelStyle", 12, void 0), l = w(t, "markerStart", 12, void 0), u = w(t, "markerEnd", 12, void 0), c = w(t, "style", 12, void 0), f = w(t, "interactionWidth", 12, 20), d = w(t, "class", 12, void 0), g = f() === void 0 ? 20 : f(); - He(); - var p = ap(), x = _e(p), k = R(x); - { - var E = (v) => { - var b = sp(); - ae(b, "stroke-opacity", 0), ae(b, "stroke-width", g), $e(() => ae(b, "d", r())), L(v, b); - }; - be(k, (v) => { - g && v(E); - }); - } - var m = R(k); - { - var _ = (v) => { - xc(v, { - get x() { - return i(); - }, - get y() { - return s(); - }, - get style() { - return a(); - }, - children: (b, N) => { - Te(); - var $ = Ie(); - $e(() => wn($, o())), L(b, $); - }, - $$slots: { default: !0 } - }); - }; - be(m, (v) => { - o() && v(_); - }); - } - return $e( - (v) => { - ae(x, "id", n()), ae(x, "d", r()), Ct(x, 0, _n(v)), ae(x, "marker-start", l()), ae(x, "marker-end", u()), ae(x, "style", c()); - }, - [ - () => $t(["svelte-flow__edge-path", d()]) - ], - pe - ), L(e, p), ce({ - get id() { - return n(); - }, - set id(v) { - n(v), y(); - }, - get path() { - return r(); - }, - set path(v) { - r(v), y(); - }, - get label() { - return o(); - }, - set label(v) { - o(v), y(); - }, - get labelX() { - return i(); - }, - set labelX(v) { - i(v), y(); - }, - get labelY() { - return s(); - }, - set labelY(v) { - s(v), y(); - }, - get labelStyle() { - return a(); - }, - set labelStyle(v) { - a(v), y(); - }, - get markerStart() { - return l(); - }, - set markerStart(v) { - l(v), y(); - }, - get markerEnd() { - return u(); - }, - set markerEnd(v) { - u(v), y(); - }, - get style() { - return c(); - }, - set style(v) { - c(v), y(); - }, - get interactionWidth() { - return f(); - }, - set interactionWidth(v) { - f(v), y(); - }, - get class() { - return d(); - }, - set class(v) { - d(v), y(); - } - }); -} -re( - To, - { - id: {}, - path: {}, - label: {}, - labelX: {}, - labelY: {}, - labelStyle: {}, - markerStart: {}, - markerEnd: {}, - style: {}, - interactionWidth: {}, - class: {} - }, - [], - [], - !0 -); -function wi(e, t) { - const n = rt(t, [ - "children", - "$$slots", - "$$events", - "$$legacy", - "$$host" - ]); - rt(n, [ - "label", - "labelStyle", - "style", - "markerStart", - "markerEnd", - "interactionWidth", - "sourceX", - "sourceY", - "sourcePosition", - "targetX", - "targetY", - "targetPosition" - ]), ue(t, !1); - const r = te(), o = te(), i = te(); - let s = w(t, "label", 12, void 0), a = w(t, "labelStyle", 12, void 0), l = w(t, "style", 12, void 0), u = w(t, "markerStart", 12, void 0), c = w(t, "markerEnd", 12, void 0), f = w(t, "interactionWidth", 12, void 0), d = w(t, "sourceX", 12), g = w(t, "sourceY", 12), p = w(t, "sourcePosition", 12), x = w(t, "targetX", 12), k = w(t, "targetY", 12), E = w(t, "targetPosition", 12); - return le( - () => (h(r), h(o), h(i), U(d()), U(g()), U(x()), U(k()), U(p()), U(E())), - () => { - ((m) => (G(r, m[0]), G(o, m[1]), G(i, m[2])))(oc({ - sourceX: d(), - sourceY: g(), - targetX: x(), - targetY: k(), - sourcePosition: p(), - targetPosition: E() - })); - } - ), gt(), He(), To(e, { - get path() { - return h(r); - }, - get labelX() { - return h(o); - }, - get labelY() { - return h(i); - }, - get label() { - return s(); - }, - get labelStyle() { - return a(); - }, - get markerStart() { - return u(); - }, - get markerEnd() { - return c(); - }, - get interactionWidth() { - return f(); - }, - get style() { - return l(); - } - }), ce({ - get label() { - return s(); - }, - set label(m) { - s(m), y(); - }, - get labelStyle() { - return a(); - }, - set labelStyle(m) { - a(m), y(); - }, - get style() { - return l(); - }, - set style(m) { - l(m), y(); - }, - get markerStart() { - return u(); - }, - set markerStart(m) { - u(m), y(); - }, - get markerEnd() { - return c(); - }, - set markerEnd(m) { - c(m), y(); - }, - get interactionWidth() { - return f(); - }, - set interactionWidth(m) { - f(m), y(); - }, - get sourceX() { - return d(); - }, - set sourceX(m) { - d(m), y(); - }, - get sourceY() { - return g(); - }, - set sourceY(m) { - g(m), y(); - }, - get sourcePosition() { - return p(); - }, - set sourcePosition(m) { - p(m), y(); - }, - get targetX() { - return x(); - }, - set targetX(m) { - x(m), y(); - }, - get targetY() { - return k(); - }, - set targetY(m) { - k(m), y(); - }, - get targetPosition() { - return E(); - }, - set targetPosition(m) { - E(m), y(); - } - }); -} -re( - wi, - { - label: {}, - labelStyle: {}, - style: {}, - markerStart: {}, - markerEnd: {}, - interactionWidth: {}, - sourceX: {}, - sourceY: {}, - sourcePosition: {}, - targetX: {}, - targetY: {}, - targetPosition: {} - }, - [], - [], - !0 -); -function bc(e, t) { - const n = rt(t, [ - "children", - "$$slots", - "$$events", - "$$legacy", - "$$host" - ]); - rt(n, [ - "label", - "labelStyle", - "style", - "markerStart", - "markerEnd", - "interactionWidth", - "sourceX", - "sourceY", - "sourcePosition", - "targetX", - "targetY", - "targetPosition" - ]), ue(t, !1); - const r = te(), o = te(), i = te(); - let s = w(t, "label", 12, void 0), a = w(t, "labelStyle", 12, void 0), l = w(t, "style", 12, void 0), u = w(t, "markerStart", 12, void 0), c = w(t, "markerEnd", 12, void 0), f = w(t, "interactionWidth", 12, void 0), d = w(t, "sourceX", 12), g = w(t, "sourceY", 12), p = w(t, "sourcePosition", 12), x = w(t, "targetX", 12), k = w(t, "targetY", 12), E = w(t, "targetPosition", 12); - return le( - () => (h(r), h(o), h(i), U(d()), U(g()), U(x()), U(k()), U(p()), U(E())), - () => { - ((m) => (G(r, m[0]), G(o, m[1]), G(i, m[2])))(mi({ - sourceX: d(), - sourceY: g(), - targetX: x(), - targetY: k(), - sourcePosition: p(), - targetPosition: E() - })); - } - ), gt(), He(), To(e, { - get path() { - return h(r); - }, - get labelX() { - return h(o); - }, - get labelY() { - return h(i); - }, - get label() { - return s(); - }, - get labelStyle() { - return a(); - }, - get markerStart() { - return u(); - }, - get markerEnd() { - return c(); - }, - get interactionWidth() { - return f(); - }, - get style() { - return l(); - } - }), ce({ - get label() { - return s(); - }, - set label(m) { - s(m), y(); - }, - get labelStyle() { - return a(); - }, - set labelStyle(m) { - a(m), y(); - }, - get style() { - return l(); - }, - set style(m) { - l(m), y(); - }, - get markerStart() { - return u(); - }, - set markerStart(m) { - u(m), y(); - }, - get markerEnd() { - return c(); - }, - set markerEnd(m) { - c(m), y(); - }, - get interactionWidth() { - return f(); - }, - set interactionWidth(m) { - f(m), y(); - }, - get sourceX() { - return d(); - }, - set sourceX(m) { - d(m), y(); - }, - get sourceY() { - return g(); - }, - set sourceY(m) { - g(m), y(); - }, - get sourcePosition() { - return p(); - }, - set sourcePosition(m) { - p(m), y(); - }, - get targetX() { - return x(); - }, - set targetX(m) { - x(m), y(); - }, - get targetY() { - return k(); - }, - set targetY(m) { - k(m), y(); - }, - get targetPosition() { - return E(); - }, - set targetPosition(m) { - E(m), y(); - } - }); -} -re( - bc, - { - label: {}, - labelStyle: {}, - style: {}, - markerStart: {}, - markerEnd: {}, - interactionWidth: {}, - sourceX: {}, - sourceY: {}, - sourcePosition: {}, - targetX: {}, - targetY: {}, - targetPosition: {} - }, - [], - [], - !0 -); -function Cc(e, t) { - const n = rt(t, [ - "children", - "$$slots", - "$$events", - "$$legacy", - "$$host" - ]); - rt(n, [ - "label", - "labelStyle", - "style", - "markerStart", - "markerEnd", - "interactionWidth", - "sourceX", - "sourceY", - "targetX", - "targetY" - ]), ue(t, !1); - const r = te(), o = te(), i = te(); - let s = w(t, "label", 12, void 0), a = w(t, "labelStyle", 12, void 0), l = w(t, "style", 12, void 0), u = w(t, "markerStart", 12, void 0), c = w(t, "markerEnd", 12, void 0), f = w(t, "interactionWidth", 12, void 0), d = w(t, "sourceX", 12), g = w(t, "sourceY", 12), p = w(t, "targetX", 12), x = w(t, "targetY", 12); - return le( - () => (h(r), h(o), h(i), U(d()), U(g()), U(p()), U(x())), - () => { - ((k) => (G(r, k[0]), G(o, k[1]), G(i, k[2])))(Ns({ - sourceX: d(), - sourceY: g(), - targetX: p(), - targetY: x() - })); - } - ), gt(), He(), To(e, { - get path() { - return h(r); - }, - get labelX() { - return h(o); - }, - get labelY() { - return h(i); - }, - get label() { - return s(); - }, - get labelStyle() { - return a(); - }, - get markerStart() { - return u(); - }, - get markerEnd() { - return c(); - }, - get interactionWidth() { - return f(); - }, - get style() { - return l(); - } - }), ce({ - get label() { - return s(); - }, - set label(k) { - s(k), y(); - }, - get labelStyle() { - return a(); - }, - set labelStyle(k) { - a(k), y(); - }, - get style() { - return l(); - }, - set style(k) { - l(k), y(); - }, - get markerStart() { - return u(); - }, - set markerStart(k) { - u(k), y(); - }, - get markerEnd() { - return c(); - }, - set markerEnd(k) { - c(k), y(); - }, - get interactionWidth() { - return f(); - }, - set interactionWidth(k) { - f(k), y(); - }, - get sourceX() { - return d(); - }, - set sourceX(k) { - d(k), y(); - }, - get sourceY() { - return g(); - }, - set sourceY(k) { - g(k), y(); - }, - get targetX() { - return p(); - }, - set targetX(k) { - p(k), y(); - }, - get targetY() { - return x(); - }, - set targetY(k) { - x(k), y(); - } - }); -} -re( - Cc, - { - label: {}, - labelStyle: {}, - style: {}, - markerStart: {}, - markerEnd: {}, - interactionWidth: {}, - sourceX: {}, - sourceY: {}, - targetX: {}, - targetY: {} - }, - [], - [], - !0 -); -function kc(e, t) { - const n = rt(t, [ - "children", - "$$slots", - "$$events", - "$$legacy", - "$$host" - ]); - rt(n, [ - "label", - "labelStyle", - "style", - "markerStart", - "markerEnd", - "interactionWidth", - "sourceX", - "sourceY", - "sourcePosition", - "targetX", - "targetY", - "targetPosition" - ]), ue(t, !1); - const r = te(), o = te(), i = te(); - let s = w(t, "label", 12, void 0), a = w(t, "labelStyle", 12, void 0), l = w(t, "style", 12, void 0), u = w(t, "markerStart", 12, void 0), c = w(t, "markerEnd", 12, void 0), f = w(t, "interactionWidth", 12, void 0), d = w(t, "sourceX", 12), g = w(t, "sourceY", 12), p = w(t, "sourcePosition", 12), x = w(t, "targetX", 12), k = w(t, "targetY", 12), E = w(t, "targetPosition", 12); - return le( - () => (h(r), h(o), h(i), U(d()), U(g()), U(x()), U(k()), U(p()), U(E())), - () => { - ((m) => (G(r, m[0]), G(o, m[1]), G(i, m[2])))(mi({ - sourceX: d(), - sourceY: g(), - targetX: x(), - targetY: k(), - sourcePosition: p(), - targetPosition: E(), - borderRadius: 0 - })); - } - ), gt(), He(), To(e, { - get path() { - return h(r); - }, - get labelX() { - return h(o); - }, - get labelY() { - return h(i); - }, - get label() { - return s(); - }, - get labelStyle() { - return a(); - }, - get markerStart() { - return u(); - }, - get markerEnd() { - return c(); - }, - get interactionWidth() { - return f(); - }, - get style() { - return l(); - } - }), ce({ - get label() { - return s(); - }, - set label(m) { - s(m), y(); - }, - get labelStyle() { - return a(); - }, - set labelStyle(m) { - a(m), y(); - }, - get style() { - return l(); - }, - set style(m) { - l(m), y(); - }, - get markerStart() { - return u(); - }, - set markerStart(m) { - u(m), y(); - }, - get markerEnd() { - return c(); - }, - set markerEnd(m) { - c(m), y(); - }, - get interactionWidth() { - return f(); - }, - set interactionWidth(m) { - f(m), y(); - }, - get sourceX() { - return d(); - }, - set sourceX(m) { - d(m), y(); - }, - get sourceY() { - return g(); - }, - set sourceY(m) { - g(m), y(); - }, - get sourcePosition() { - return p(); - }, - set sourcePosition(m) { - p(m), y(); - }, - get targetX() { - return x(); - }, - set targetX(m) { - x(m), y(); - }, - get targetY() { - return k(); - }, - set targetY(m) { - k(m), y(); - }, - get targetPosition() { - return E(); - }, - set targetPosition(m) { - E(m), y(); - } - }); -} -re( - kc, - { - label: {}, - labelStyle: {}, - style: {}, - markerStart: {}, - markerEnd: {}, - interactionWidth: {}, - sourceX: {}, - sourceY: {}, - sourcePosition: {}, - targetX: {}, - targetY: {}, - targetPosition: {} - }, - [], - [], - !0 -); -function lp(e, t) { - const n = e.set, r = t.set, o = q(e), i = q(t); - let a = o.length === 0 && i.length > 0 ? i : o; - e.set(a); - const l = (u) => { - const c = n(u); - return a = c, r(a), c; - }; - e.set = t.set = l, e.update = t.update = (u) => l(u(a)); -} -function up(e, t) { - const n = e.set, r = t.set; - let o = q(t); - e.set(o); - const i = (s) => { - n(s), r(s), o = s; - }; - e.set = t.set = i, e.update = t.update = (s) => i(s(o)); -} -const cp = (e, t, n) => { - if (!n) - return; - const r = q(e), o = t.set, i = n.set; - let s = n ? q(n) : { x: 0, y: 0, zoom: 1 }; - t.set(s), t.set = (a) => (o(a), i(a), s = a, a), n.set = (a) => (r == null || r.syncViewport(a), o(a), i(a), s = a, a), t.update = (a) => { - t.set(a(s)); - }, n.update = (a) => { - n.set(a(s)); - }; -}, dp = (e, t, n, r = [0, 0], o = gi) => { - const { subscribe: i, set: s, update: a } = ye([]); - let l = e, u = {}, c = !0; - const f = (x) => (sc(x, t, n, { - elevateNodesOnSelect: c, - nodeOrigin: r, - nodeExtent: o, - defaults: u, - checkEquality: !1 - }), l = x, s(l), l), d = (x) => f(x(l)), g = (x) => { - u = x; - }, p = (x) => { - c = x.elevateNodesOnSelect ?? c; - }; - return f(l), { - subscribe: i, - set: f, - update: d, - setDefaultOptions: g, - setOptions: p - }; -}, fp = (e, t, n, r) => { - const { subscribe: o, set: i, update: s } = ye([]); - let a = e, l = {}; - const u = (d) => { - const g = l ? d.map((p) => ({ ...l, ...p })) : d; - lc(t, n, g), a = g, i(a); - }, c = (d) => u(d(a)), f = (d) => { - l = d; - }; - return u(a), { - subscribe: o, - set: u, - update: c, - setDefaultOptions: f - }; -}, Ec = { - input: pc, - output: mc, - default: yi, - group: yc -}, $c = { - straight: Cc, - smoothstep: bc, - default: wi, - step: kc -}, gp = ({ nodes: e = [], edges: t = [], width: n, height: r, fitView: o, nodeOrigin: i, nodeExtent: s }) => { - const a = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), f = i ?? [0, 0], d = s ?? gi; - sc(e, a, l, { - nodeExtent: d, - nodeOrigin: f, - elevateNodesOnSelect: !1, - checkEquality: !1 - }), lc(u, c, t); - let g = { x: 0, y: 0, zoom: 1 }; - if (o && n && r) { - const p = Po(a, { - filter: (x) => !!((x.width || x.initialWidth) && (x.height || x.initialHeight)) - }); - g = sa(p, n, r, 0.5, 2, 0.1); - } - return { - flowId: ye(null), - nodes: dp(e, a, l, f, d), - nodeLookup: Zt(a), - parentLookup: Zt(l), - edgeLookup: Zt(c), - visibleNodes: Zt([]), - edges: fp(t, u, c), - visibleEdges: Zt([]), - connectionLookup: Zt(u), - height: ye(500), - width: ye(500), - minZoom: ye(0.5), - maxZoom: ye(2), - nodeOrigin: ye(f), - nodeDragThreshold: ye(1), - nodeExtent: ye(d), - translateExtent: ye(gi), - autoPanOnNodeDrag: ye(!0), - autoPanOnConnect: ye(!0), - fitViewOnInit: ye(!1), - fitViewOnInitDone: ye(!1), - fitViewOptions: ye(void 0), - panZoom: ye(null), - snapGrid: ye(null), - dragging: ye(!1), - selectionRect: ye(null), - selectionKeyPressed: ye(!1), - multiselectionKeyPressed: ye(!1), - deleteKeyPressed: ye(!1), - panActivationKeyPressed: ye(!1), - zoomActivationKeyPressed: ye(!1), - selectionRectMode: ye(null), - selectionMode: ye(hi.Partial), - nodeTypes: ye(Ec), - edgeTypes: ye($c), - viewport: ye(g), - connectionMode: ye(cr.Strict), - domNode: ye(null), - connection: Zt($s), - connectionLineType: ye(Cr.Bezier), - connectionRadius: ye(20), - isValidConnection: ye(() => !0), - nodesDraggable: ye(!0), - nodesConnectable: ye(!0), - elementsSelectable: ye(!0), - selectNodesOnDrag: ye(!0), - markers: Zt([]), - defaultMarkerColor: ye("#b1b1b7"), - lib: Zt("svelte"), - onlyRenderVisibleElements: ye(!1), - onerror: ye(f0), - ondelete: ye(void 0), - onedgecreate: ye(void 0), - onconnect: ye(void 0), - onconnectstart: ye(void 0), - onconnectend: ye(void 0), - onbeforedelete: ye(void 0), - nodesInitialized: ye(!1), - edgesInitialized: ye(!1), - viewportInitialized: ye(!1), - initialized: Zt(!1) - }; -}; -function hp(e) { - const t = Fn([ - e.edges, - e.nodes, - e.nodeLookup, - e.onlyRenderVisibleElements, - e.viewport, - e.width, - e.height - ], ([n, , r, o, i, s, a]) => o && s && a ? n.filter((u) => { - const c = r.get(u.source), f = r.get(u.target); - return c && f && w0({ - sourceNode: c, - targetNode: f, - width: s, - height: a, - transform: [i.x, i.y, i.zoom] - }); - }) : n); - return Fn([t, e.nodes, e.nodeLookup, e.connectionMode, e.onerror], ([n, , r, o, i]) => n.reduce((a, l) => { - const u = r.get(l.source), c = r.get(l.target); - if (!u || !c) - return a; - const f = $0({ - id: l.id, - sourceNode: u, - targetNode: c, - sourceHandle: l.sourceHandle || null, - targetHandle: l.targetHandle || null, - connectionMode: o, - onError: i - }); - return f && a.push({ - ...l, - zIndex: y0({ - selected: l.selected, - zIndex: l.zIndex, - sourceNode: u, - targetNode: c, - elevateOnSelect: !1 - }), - ...f - }), a; - }, [])); -} -function vp(e) { - return Fn([ - e.nodeLookup, - e.onlyRenderVisibleElements, - e.width, - e.height, - e.viewport, - e.nodes - ], ([t, n, r, o, i]) => { - const s = [i.x, i.y, i.zoom]; - return n ? Uu(t, { x: 0, y: 0, width: r, height: o }, s, !0) : Array.from(t.values()); - }); -} -const Xi = Symbol(); -function Sc({ nodes: e, edges: t, width: n, height: r, fitView: o, nodeOrigin: i, nodeExtent: s }) { - const a = gp({ - nodes: e, - edges: t, - width: n, - height: r, - fitView: o, - nodeOrigin: i, - nodeExtent: s - }); - function l(C) { - a.nodeTypes.set({ - ...Ec, - ...C - }); - } - function u(C) { - a.edgeTypes.set({ - ...$c, - ...C - }); - } - function c(C) { - const P = q(a.edges); - a.edges.set(b0(C, P)); - } - const f = (C, P = !1) => { - var I; - const M = q(a.nodeLookup); - for (const [B, F] of C) { - const K = (I = M.get(B)) == null ? void 0 : I.internals.userNode; - K && (K.position = F.position, K.dragging = P); - } - a.nodes.update((B) => B); - }; - function d(C) { - var F, K, oe; - const P = q(a.nodeLookup), M = q(a.parentLookup), { changes: I, updatedInternals: B } = A0(C, P, q(a.parentLookup), q(a.domNode), q(a.nodeOrigin)); - if (B) { - if (T0(P, M, { nodeOrigin: i, nodeExtent: s }), !q(a.fitViewOnInitDone) && q(a.fitViewOnInit)) { - const J = q(a.fitViewOptions), W = p({ - ...J, - nodes: J == null ? void 0 : J.nodes - }); - a.fitViewOnInitDone.set(W); - } - for (const J of I) { - const W = (F = P.get(J.id)) == null ? void 0 : F.internals.userNode; - if (W) - switch (J.type) { - case "dimensions": { - const de = { ...W.measured, ...J.dimensions }; - J.setAttributes && (W.width = ((K = J.dimensions) == null ? void 0 : K.width) ?? W.width, W.height = ((oe = J.dimensions) == null ? void 0 : oe.height) ?? W.height), W.measured = de; - break; - } - case "position": - W.position = J.position ?? W.position; - break; - } - } - a.nodes.update((J) => J), q(a.nodesInitialized) || a.nodesInitialized.set(!0); - } - } - function g(C) { - const P = q(a.panZoom), M = q(a.domNode); - if (!P || !M) - return Promise.resolve(!1); - const { width: I, height: B } = aa(M), F = sl(q(a.nodeLookup), C); - return al({ - nodes: F, - width: I, - height: B, - minZoom: q(a.minZoom), - maxZoom: q(a.maxZoom), - panZoom: P - }, C); - } - function p(C) { - const P = q(a.panZoom); - if (!P) - return !1; - const M = sl(q(a.nodeLookup), C); - return al({ - nodes: M, - width: q(a.width), - height: q(a.height), - minZoom: q(a.minZoom), - maxZoom: q(a.maxZoom), - panZoom: P - }, C), M.size > 0; - } - function x(C, P) { - const M = q(a.panZoom); - return M ? M.scaleBy(C, P) : Promise.resolve(!1); - } - function k(C) { - return x(1.2, C); - } - function E(C) { - return x(1 / 1.2, C); - } - function m(C) { - const P = q(a.panZoom); - P && (P.setScaleExtent([C, q(a.maxZoom)]), a.minZoom.set(C)); - } - function _(C) { - const P = q(a.panZoom); - P && (P.setScaleExtent([q(a.minZoom), C]), a.maxZoom.set(C)); - } - function v(C) { - const P = q(a.panZoom); - P && (P.setTranslateExtent(C), a.translateExtent.set(C)); - } - function b(C) { - let P = !1; - return C.forEach((M) => { - M.selected && (M.selected = !1, P = !0); - }), P; - } - function N(C) { - var P; - (P = q(a.panZoom)) == null || P.setClickDistance(C); - } - function $(C) { - b((C == null ? void 0 : C.nodes) || q(a.nodes)) && a.nodes.set(q(a.nodes)), b((C == null ? void 0 : C.edges) || q(a.edges)) && a.edges.set(q(a.edges)); - } - a.deleteKeyPressed.subscribe(async (C) => { - var P; - if (C) { - const M = q(a.nodes), I = q(a.edges), B = M.filter((J) => J.selected), F = I.filter((J) => J.selected), { nodes: K, edges: oe } = await ju({ - nodesToRemove: B, - edgesToRemove: F, - nodes: M, - edges: I, - onBeforeDelete: q(a.onbeforedelete) - }); - (K.length || oe.length) && (a.nodes.update((J) => J.filter((W) => !K.some((de) => de.id === W.id))), a.edges.update((J) => J.filter((W) => !oe.some((de) => de.id === W.id))), (P = q(a.ondelete)) == null || P({ - nodes: K, - edges: oe - })); - } - }); - function T(C) { - const P = q(a.multiselectionKeyPressed); - a.nodes.update((M) => M.map((I) => { - const B = C.includes(I.id), F = P && I.selected || B; - return I.selected = F, I; - })), P || a.edges.update((M) => M.map((I) => (I.selected = !1, I))); - } - function A(C) { - const P = q(a.multiselectionKeyPressed); - a.edges.update((M) => M.map((I) => { - const B = C.includes(I.id), F = P && I.selected || B; - return I.selected = F, I; - })), P || a.nodes.update((M) => M.map((I) => (I.selected = !1, I))); - } - function D(C) { - var M; - const P = (M = q(a.nodes)) == null ? void 0 : M.find((I) => I.id === C); - if (!P) { - console.warn("012", Ar.error012(C)); - return; - } - a.selectionRect.set(null), a.selectionRectMode.set(null), P.selected ? P.selected && q(a.multiselectionKeyPressed) && $({ nodes: [P], edges: [] }) : T([C]); - } - function O(C) { - const P = q(a.viewport); - return V0({ - delta: C, - panZoom: q(a.panZoom), - transform: [P.x, P.y, P.zoom], - translateExtent: q(a.translateExtent), - width: q(a.width), - height: q(a.height) - }); - } - const V = ye($s), z = (C) => { - V.set({ ...C }); - }; - function S() { - V.set($s); - } - function H() { - a.fitViewOnInitDone.set(!1), a.selectionRect.set(null), a.selectionRectMode.set(null), a.snapGrid.set(null), a.isValidConnection.set(() => !0), $(), S(); - } - return { - // state - ...a, - // derived state - visibleEdges: hp(a), - visibleNodes: vp(a), - connection: Fn([V, a.viewport], ([C, P]) => C.inProgress ? { - ...C, - to: No(C.to, [P.x, P.y, P.zoom]) - } : { ...C }), - markers: Fn([a.edges, a.defaultMarkerColor, a.flowId], ([C, P, M]) => S0(C, { defaultColor: P, id: M })), - initialized: (() => { - let C = !1; - const P = q(a.nodes).length, M = q(a.edges).length; - return Fn([a.nodesInitialized, a.edgesInitialized, a.viewportInitialized], ([I, B, F]) => C || (P === 0 ? C = F : M === 0 ? C = F && I : C = F && I && B, C)); - })(), - // actions - syncNodeStores: (C) => lp(a.nodes, C), - syncEdgeStores: (C) => up(a.edges, C), - syncViewport: (C) => cp(a.panZoom, a.viewport, C), - setNodeTypes: l, - setEdgeTypes: u, - addEdge: c, - updateNodePositions: f, - updateNodeInternals: d, - zoomIn: k, - zoomOut: E, - fitView: (C) => g(C), - setMinZoom: m, - setMaxZoom: _, - setTranslateExtent: v, - setPaneClickDistance: N, - unselectNodesAndEdges: $, - addSelectedNodes: T, - addSelectedEdges: A, - handleNodeSelection: D, - panBy: O, - updateConnection: z, - cancelConnection: S, - reset: H - }; -} -function Ke() { - const e = ar(Xi); - if (!e) - throw new Error("In order to use useStore you need to wrap your component in a "); - return e.getStore(); -} -function pp({ nodes: e, edges: t, width: n, height: r, fitView: o, nodeOrigin: i, nodeExtent: s }) { - const a = Sc({ nodes: e, edges: t, width: n, height: r, fitView: o, nodeOrigin: i, nodeExtent: s }); - return Mr(Xi, { - getStore: () => a - }), a; -} -function ss(e, t) { - const { panZoom: n, minZoom: r, maxZoom: o, initialViewport: i, viewport: s, dragging: a, translateExtent: l, paneClickDistance: u } = t, c = Q0({ - domNode: e, - minZoom: r, - maxZoom: o, - translateExtent: l, - viewport: i, - paneClickDistance: u, - onDraggingChange: a.set - }), f = c.getViewport(); - return s.set(f), n.set(c), c.update(t), { - update(d) { - c.update(d); - } - }; -} -var mp = /* @__PURE__ */ ne('
'); -const yp = { - hash: "svelte-4xkw84", - code: ".svelte-flow__zoom.svelte-4xkw84 {width:100%;height:100%;position:absolute;top:0;left:0;z-index:4;}" -}; -function Pc(e, t) { - ue(t, !1), je(e, yp); - const [n, r] = tt(), o = () => j(M, "$panActivationKeyPressed", n), i = () => j(z, "$minZoom", n), s = () => j(S, "$maxZoom", n), a = () => j(I, "$zoomActivationKeyPressed", n), l = () => j(V, "$selectionRect", n), u = () => j(C, "$translateExtent", n), c = () => j(P, "$lib", n), f = te(), d = te(), g = te(); - let p = w(t, "initialViewport", 12, void 0), x = w(t, "onMoveStart", 12, void 0), k = w(t, "onMove", 12, void 0), E = w(t, "onMoveEnd", 12, void 0), m = w(t, "panOnScrollMode", 12), _ = w(t, "preventScrolling", 12), v = w(t, "zoomOnScroll", 12), b = w(t, "zoomOnDoubleClick", 12), N = w(t, "zoomOnPinch", 12), $ = w(t, "panOnDrag", 12), T = w(t, "panOnScroll", 12), A = w(t, "paneClickDistance", 12); - const { - viewport: D, - panZoom: O, - selectionRect: V, - minZoom: z, - maxZoom: S, - dragging: H, - translateExtent: C, - lib: P, - panActivationKeyPressed: M, - zoomActivationKeyPressed: I, - viewportInitialized: B - } = Ke(), F = (W) => D.set({ - x: W[0], - y: W[1], - zoom: W[2] - }); - xn(() => { - si(B, !0); - }), le(() => U(p()), () => { - G(f, p() || { x: 0, y: 0, zoom: 1 }); - }), le( - () => (o(), U($())), - () => { - G(d, o() || $()); - } - ), le( - () => (o(), U(T())), - () => { - G(g, o() || T()); - } - ), gt(), He(); - var K = mp(), oe = X(K); - vt(oe, t, "default", {}), Z(K), ht(K, (W, de) => ss == null ? void 0 : ss(W, de), () => ({ - viewport: D, - minZoom: i(), - maxZoom: s(), - initialViewport: h(f), - dragging: H, - panZoom: O, - onPanZoomStart: x(), - onPanZoom: k(), - onPanZoomEnd: E(), - zoomOnScroll: v(), - zoomOnDoubleClick: b(), - zoomOnPinch: N(), - panOnScroll: h(g), - panOnDrag: h(d), - panOnScrollSpeed: 0.5, - panOnScrollMode: m() || Kn.Free, - zoomActivationKeyPressed: a(), - preventScrolling: typeof _() == "boolean" ? _() : !0, - noPanClassName: "nopan", - noWheelClassName: "nowheel", - userSelectionActive: !!l(), - translateExtent: u(), - lib: c(), - paneClickDistance: A(), - onTransformChange: F - })), L(e, K); - var J = ce({ - get initialViewport() { - return p(); - }, - set initialViewport(W) { - p(W), y(); - }, - get onMoveStart() { - return x(); - }, - set onMoveStart(W) { - x(W), y(); - }, - get onMove() { - return k(); - }, - set onMove(W) { - k(W), y(); - }, - get onMoveEnd() { - return E(); - }, - set onMoveEnd(W) { - E(W), y(); - }, - get panOnScrollMode() { - return m(); - }, - set panOnScrollMode(W) { - m(W), y(); - }, - get preventScrolling() { - return _(); - }, - set preventScrolling(W) { - _(W), y(); - }, - get zoomOnScroll() { - return v(); - }, - set zoomOnScroll(W) { - v(W), y(); - }, - get zoomOnDoubleClick() { - return b(); - }, - set zoomOnDoubleClick(W) { - b(W), y(); - }, - get zoomOnPinch() { - return N(); - }, - set zoomOnPinch(W) { - N(W), y(); - }, - get panOnDrag() { - return $(); - }, - set panOnDrag(W) { - $(W), y(); - }, - get panOnScroll() { - return T(); - }, - set panOnScroll(W) { - T(W), y(); - }, - get paneClickDistance() { - return A(); - }, - set paneClickDistance(W) { - A(W), y(); - } - }); - return r(), J; -} -re( - Pc, - { - initialViewport: {}, - onMoveStart: {}, - onMove: {}, - onMoveEnd: {}, - panOnScrollMode: {}, - preventScrolling: {}, - zoomOnScroll: {}, - zoomOnDoubleClick: {}, - zoomOnPinch: {}, - panOnDrag: {}, - panOnScroll: {}, - paneClickDistance: {} - }, - ["default"], - [], - !0 -); -function xl(e, t) { - return (n) => { - n.target === t && (e == null || e(n)); - }; -} -function bl(e) { - return (t) => { - const n = e.includes(t.id); - return t.selected !== n && (t.selected = n), t; - }; -} -var wp = /* @__PURE__ */ ne("
"); -const _p = { - hash: "svelte-1esy7hx", - code: ".svelte-flow__pane.svelte-1esy7hx {position:absolute;top:0;left:0;width:100%;height:100%;}" -}; -function Nc(e, t) { - ue(t, !1), je(e, _p); - const [n, r] = tt(), o = () => j(S, "$panActivationKeyPressed", n), i = () => j(V, "$selectionKeyPressed", n), s = () => j(D, "$selectionRect", n), a = () => j(A, "$elementsSelectable", n), l = () => j(O, "$selectionRectMode", n), u = () => j(N, "$edges", n), c = () => j(b, "$nodeLookup", n), f = () => j($, "$viewport", n), d = () => j(z, "$selectionMode", n), g = () => j(T, "$dragging", n), p = te(), x = te(), k = te(); - let E = w(t, "panOnDrag", 12, void 0), m = w(t, "selectionOnDrag", 12, void 0); - const _ = Vi(), { - nodes: v, - nodeLookup: b, - edges: N, - viewport: $, - dragging: T, - elementsSelectable: A, - selectionRect: D, - selectionRectMode: O, - selectionKeyPressed: V, - selectionMode: z, - panActivationKeyPressed: S, - unselectNodesAndEdges: H - } = Ke(); - let C = te(), P = null, M = [], I = !1; - function B(ie) { - if (I) { - I = !1; - return; - } - _("paneclick", { event: ie }), H(), O.set(null); - } - function F(ie) { - var Ae, Ze; - if (P = h(C).getBoundingClientRect(), !A || !h(x) || ie.button !== 0 || ie.target !== h(C) || !P) - return; - (Ze = (Ae = ie.target) == null ? void 0 : Ae.setPointerCapture) == null || Ze.call(Ae, ie.pointerId); - const { x: ge, y: Ye } = Mn(ie, P); - H(), D.set({ - width: 0, - height: 0, - startX: ge, - startY: Ye, - x: ge, - y: Ye - }); - } - function K(ie) { - if (!h(x) || !P || !s()) - return; - I = !0; - const ge = Mn(ie, P), Ye = s().startX ?? 0, Ae = s().startY ?? 0, Ze = { - ...s(), - x: ge.x < Ye ? ge.x : Ye, - y: ge.y < Ae ? ge.y : Ae, - width: Math.abs(ge.x - Ye), - height: Math.abs(ge.y - Ae) - }, ee = M.map((Ne) => Ne.id), he = Ss(M, u()).map((Ne) => Ne.id); - M = Uu( - c(), - Ze, - [ - f().x, - f().y, - f().zoom - ], - d() === hi.Partial, - !0 - ); - const se = Ss(M, u()).map((Ne) => Ne.id), ke = M.map((Ne) => Ne.id); - (ee.length !== ke.length || ke.some((Ne) => !ee.includes(Ne))) && v.update((Ne) => Ne.map(bl(ke))), (he.length !== se.length || se.some((Ne) => !he.includes(Ne))) && N.update((Ne) => Ne.map(bl(se))), O.set("user"), D.set(Ze); - } - function oe(ie) { - var ge, Ye; - ie.button === 0 && ((Ye = (ge = ie.target) == null ? void 0 : ge.releasePointerCapture) == null || Ye.call(ge, ie.pointerId), !h(x) && l() === "user" && ie.target === h(C) && (B == null || B(ie)), D.set(null), M.length > 0 && si(O, "nodes"), i() && (I = !1)); - } - const J = (ie) => { - var ge; - if (Array.isArray(h(p)) && ((ge = h(p)) != null && ge.includes(2))) { - ie.preventDefault(); - return; - } - _("panecontextmenu", { event: ie }); - }; - le( - () => (o(), U(E())), - () => { - G(p, o() || E()); - } - ), le( - () => (i(), s(), U(m()), h(p)), - () => { - G(x, i() || s() || m() && h(p) !== !0); - } - ), le( - () => (a(), h(x), l()), - () => { - G(k, a() && (h(x) || l() === "user")); - } - ), gt(), He(); - var W = wp(), de = /* @__PURE__ */ Me(() => h(k) ? void 0 : xl(B, h(C))), we = /* @__PURE__ */ Me(() => xl(J, h(C))); - let Ce; - var fe = X(W); - vt(fe, t, "default", {}), Z(W), An(W, (ie) => G(C, ie), () => h(C)), $e( - (ie) => Ce = Ct(W, 1, "svelte-flow__pane svelte-1esy7hx", null, Ce, { - draggable: ie, - dragging: g(), - selection: h(x) - }), - [ - () => E() === !0 || Array.isArray(E()) && E().includes(0) - ], - pe - ), Qe("click", W, function(...ie) { - var ge; - (ge = h(de)) == null || ge.apply(this, ie); - }), Qe("pointerdown", W, function(...ie) { - var ge; - (ge = h(k) ? F : void 0) == null || ge.apply(this, ie); - }), Qe("pointermove", W, function(...ie) { - var ge; - (ge = h(k) ? K : void 0) == null || ge.apply(this, ie); - }), Qe("pointerup", W, function(...ie) { - var ge; - (ge = h(k) ? oe : void 0) == null || ge.apply(this, ie); - }), Qe("contextmenu", W, function(...ie) { - var ge; - (ge = h(we)) == null || ge.apply(this, ie); - }), L(e, W); - var ze = ce({ - get panOnDrag() { - return E(); - }, - set panOnDrag(ie) { - E(ie), y(); - }, - get selectionOnDrag() { - return m(); - }, - set selectionOnDrag(ie) { - m(ie), y(); - } - }); - return r(), ze; -} -re(Nc, { panOnDrag: {}, selectionOnDrag: {} }, ["default"], [], !0); -var xp = /* @__PURE__ */ ne('
'); -const bp = { - hash: "svelte-1floaup", - code: ".svelte-flow__viewport.svelte-1floaup {width:100%;height:100%;position:absolute;top:0;left:0;}" -}; -function Tc(e, t) { - ue(t, !1), je(e, bp); - const [n, r] = tt(), o = () => j(i, "$viewport", n), { viewport: i } = Ke(); - He(); - var s = xp(), a = X(s); - vt(a, t, "default", {}), Z(s), $e(() => ae(s, "style", `transform: translate(${o().x ?? ""}px, ${o().y ?? ""}px) scale(${o().zoom ?? ""})`)), L(e, s), ce(), r(); -} -re(Tc, {}, ["default"], [], !0); -function Er(e, t) { - const { store: n, onDrag: r, onDragStart: o, onDragStop: i, onNodeMouseDown: s } = t, a = I0({ - onDrag: r, - onDragStart: o, - onDragStop: i, - onNodeMouseDown: s, - getStoreItems: () => { - const u = q(n.snapGrid), c = q(n.viewport); - return { - nodes: q(n.nodes), - nodeLookup: q(n.nodeLookup), - edges: q(n.edges), - nodeExtent: q(n.nodeExtent), - snapGrid: u || [0, 0], - snapToGrid: !!u, - nodeOrigin: q(n.nodeOrigin), - multiSelectionActive: q(n.multiselectionKeyPressed), - domNode: q(n.domNode), - transform: [c.x, c.y, c.zoom], - autoPanOnNodeDrag: q(n.autoPanOnNodeDrag), - nodesDraggable: q(n.nodesDraggable), - selectNodesOnDrag: q(n.selectNodesOnDrag), - nodeDragThreshold: q(n.nodeDragThreshold), - unselectNodesAndEdges: n.unselectNodesAndEdges, - updateNodePositions: n.updateNodePositions, - panBy: n.panBy - }; - } - }); - function l(u, c) { - if (c.disabled) { - a.destroy(); - return; - } - a.update({ - domNode: u, - noDragClassName: c.noDragClass, - handleSelector: c.handleSelector, - nodeId: c.nodeId, - isSelectable: c.isSelectable, - nodeClickDistance: c.nodeClickDistance - }); - } - return l(e, t), { - update(u) { - l(e, u); - }, - destroy() { - a.destroy(); - } - }; -} -function Cp({ width: e, height: t, initialWidth: n, initialHeight: r, measuredWidth: o, measuredHeight: i }) { - if (o === void 0 && i === void 0) { - const s = e ?? n, a = t ?? r; - return { - width: s ? `width:${s}px;` : "", - height: a ? `height:${a}px;` : "" - }; - } - return { - width: e ? `width:${e}px;` : "", - height: t ? `height:${t}px;` : "" - }; -} -var kp = /* @__PURE__ */ ne("
"); -function Mc(e, t) { - ue(t, !1); - const [n, r] = tt(), o = () => j(we, "$nodeTypes", n), i = () => j(ge, "$elementsSelectable", n), s = () => j(Ye, "$nodesDraggable", n), a = () => j(he, "$connectableStore", n), l = te(void 0, !0), u = te(void 0, !0), c = te(void 0, !0), f = te(void 0, !0); - let d = w(t, "node", 13), g = w(t, "id", 13), p = w(t, "data", 29, () => ({})), x = w(t, "selected", 13, !1), k = w(t, "draggable", 13, void 0), E = w(t, "selectable", 13, void 0), m = w(t, "connectable", 13, !0), _ = w(t, "deletable", 13, !0), v = w(t, "hidden", 13, !1), b = w(t, "dragging", 13, !1), N = w(t, "resizeObserver", 13, null), $ = w(t, "style", 13, void 0), T = w(t, "type", 13, "default"), A = w(t, "isParent", 13, !1), D = w(t, "positionX", 13), O = w(t, "positionY", 13), V = w(t, "sourcePosition", 13, void 0), z = w(t, "targetPosition", 13, void 0), S = w(t, "zIndex", 13), H = w(t, "measuredWidth", 13, void 0), C = w(t, "measuredHeight", 13, void 0), P = w(t, "initialWidth", 13, void 0), M = w(t, "initialHeight", 13, void 0), I = w(t, "width", 13, void 0), B = w(t, "height", 13, void 0), F = w(t, "dragHandle", 13, void 0), K = w(t, "initialized", 13, !1), oe = w(t, "parentId", 13, void 0), J = w(t, "nodeClickDistance", 13, void 0), W = w(t, "class", 13, ""); - const de = Ke(), { - nodeTypes: we, - nodeDragThreshold: Ce, - selectNodesOnDrag: fe, - handleNodeSelection: ze, - updateNodeInternals: ie, - elementsSelectable: ge, - nodesDraggable: Ye - } = de; - let Ae = te(void 0, !0), Ze = te(null, !0); - const ee = Vi(), he = ye(m()); - let se = te(void 0, !0), ke = te(void 0, !0), Ne = te(void 0, !0); - Mr("svelteflow__node_id", g()), Mr("svelteflow__node_connectable", he), Us(() => { - var Q; - h(Ze) && ((Q = N()) == null || Q.unobserve(h(Ze))); - }); - function qe(Q) { - E() && (!q(fe) || !k() || q(Ce) > 0) && ze(g()), ee("nodeclick", { node: d().internals.userNode, event: Q }); - } - le(() => U(T()), () => { - G(l, T() || "default"); - }), le(() => (o(), h(l)), () => { - G(u, !!o()[h(l)]); - }), le( - () => (o(), h(l), yi), - () => { - G(c, o()[h(l)] || yi); - } - ), le( - () => (h(u), U(T())), - () => { - h(u) || console.warn("003", Ar.error003(T())); - } - ), le( - () => (U(I()), U(B()), U(P()), U(M()), U(H()), U(C())), - () => { - G(f, Cp({ - width: I(), - height: B(), - initialWidth: P(), - initialHeight: M(), - measuredWidth: H(), - measuredHeight: C() - })); - } - ), le(() => U(m()), () => { - he.set(!!m()); - }), le( - () => (h(se), h(l), h(ke), U(V()), h(Ne), U(z()), U(g()), h(Ae)), - () => { - (h(se) && h(l) !== h(se) || h(ke) && V() !== h(ke) || h(Ne) && z() !== h(Ne)) && requestAnimationFrame(() => ie(/* @__PURE__ */ new Map([ - [ - g(), - { - id: g(), - nodeElement: h(Ae), - force: !0 - } - ] - ]))), G(se, h(l)), G(ke, V()), G(Ne, z()); - } - ), le( - () => (U(N()), h(Ae), h(Ze), U(K())), - () => { - N() && (h(Ae) !== h(Ze) || !K()) && (h(Ze) && N().unobserve(h(Ze)), h(Ae) && N().observe(h(Ae)), G(Ze, h(Ae))); - } - ), gt(), He(!0); - var Re = et(), Oe = _e(Re); - { - var ut = (Q) => { - var Xe = kp(); - let ve; - var ln = X(Xe); - const Gt = /* @__PURE__ */ pe(() => x() ?? !1), un = /* @__PURE__ */ pe(() => E() ?? i() ?? !0), Pe = /* @__PURE__ */ pe(() => _() ?? !0), ot = /* @__PURE__ */ pe(() => k() ?? s() ?? !0); - vu(ln, () => h(c), (me, it) => { - it(me, { - get data() { - return p(); - }, - get id() { - return g(); - }, - get selected() { - return h(Gt); - }, - get selectable() { - return h(un); - }, - get deletable() { - return h(Pe); - }, - get sourcePosition() { - return V(); - }, - get targetPosition() { - return z(); - }, - get zIndex() { - return S(); - }, - get dragging() { - return b(); - }, - get draggable() { - return h(ot); - }, - get dragHandle() { - return F(); - }, - get parentId() { - return oe(); - }, - get type() { - return h(l); - }, - get isConnectable() { - return a(); - }, - get positionAbsoluteX() { - return D(); - }, - get positionAbsoluteY() { - return O(); - }, - get width() { - return I(); - }, - get height() { - return B(); - } - }); - }), Z(Xe), ht(Xe, (me, it) => Er == null ? void 0 : Er(me, it), () => ({ - nodeId: g(), - isSelectable: E(), - disabled: !1, - handleSelector: F(), - noDragClass: "nodrag", - nodeClickDistance: J(), - onNodeMouseDown: ze, - onDrag: (me, it, lt, Yt) => { - ee("nodedrag", { event: me, targetNode: lt, nodes: Yt }); - }, - onDragStart: (me, it, lt, Yt) => { - ee("nodedragstart", { event: me, targetNode: lt, nodes: Yt }); - }, - onDragStop: (me, it, lt, Yt) => { - ee("nodedragstop", { event: me, targetNode: lt, nodes: Yt }); - }, - store: de - })), An(Xe, (me) => G(Ae, me), () => h(Ae)), Ot(() => Qe("click", Xe, qe)), Ot(() => Qe("mouseenter", Xe, (me) => ee("nodemouseenter", { node: d(), event: me }))), Ot(() => Qe("mouseleave", Xe, (me) => ee("nodemouseleave", { node: d(), event: me }))), Ot(() => Qe("mousemove", Xe, (me) => ee("nodemousemove", { node: d(), event: me }))), Ot(() => Qe("contextmenu", Xe, (me) => ee("nodecontextmenu", { node: d(), event: me }))), $e( - (me) => { - ae(Xe, "data-id", g()), ve = Ct(Xe, 1, _n(me), null, ve, { - dragging: b(), - selected: x(), - draggable: k(), - connectable: m(), - selectable: E(), - nopan: k(), - parent: A() - }), ae(Xe, "style", `${$() ?? ""};${h(f).width ?? ""}${h(f).height ?? ""}`), at(Xe, "z-index", S()), at(Xe, "transform", `translate(${D() ?? ""}px, ${O() ?? ""}px)`), at(Xe, "visibility", K() ? "visible" : "hidden"); - }, - [ - () => $t([ - "svelte-flow__node", - `svelte-flow__node-${h(l)}`, - W() - ]) - ], - pe - ), L(Q, Xe); - }; - be(Oe, (Q) => { - v() || Q(ut); - }); - } - L(e, Re); - var nt = ce({ - get node() { - return d(); - }, - set node(Q) { - d(Q), y(); - }, - get id() { - return g(); - }, - set id(Q) { - g(Q), y(); - }, - get data() { - return p(); - }, - set data(Q) { - p(Q), y(); - }, - get selected() { - return x(); - }, - set selected(Q) { - x(Q), y(); - }, - get draggable() { - return k(); - }, - set draggable(Q) { - k(Q), y(); - }, - get selectable() { - return E(); - }, - set selectable(Q) { - E(Q), y(); - }, - get connectable() { - return m(); - }, - set connectable(Q) { - m(Q), y(); - }, - get deletable() { - return _(); - }, - set deletable(Q) { - _(Q), y(); - }, - get hidden() { - return v(); - }, - set hidden(Q) { - v(Q), y(); - }, - get dragging() { - return b(); - }, - set dragging(Q) { - b(Q), y(); - }, - get resizeObserver() { - return N(); - }, - set resizeObserver(Q) { - N(Q), y(); - }, - get style() { - return $(); - }, - set style(Q) { - $(Q), y(); - }, - get type() { - return T(); - }, - set type(Q) { - T(Q), y(); - }, - get isParent() { - return A(); - }, - set isParent(Q) { - A(Q), y(); - }, - get positionX() { - return D(); - }, - set positionX(Q) { - D(Q), y(); - }, - get positionY() { - return O(); - }, - set positionY(Q) { - O(Q), y(); - }, - get sourcePosition() { - return V(); - }, - set sourcePosition(Q) { - V(Q), y(); - }, - get targetPosition() { - return z(); - }, - set targetPosition(Q) { - z(Q), y(); - }, - get zIndex() { - return S(); - }, - set zIndex(Q) { - S(Q), y(); - }, - get measuredWidth() { - return H(); - }, - set measuredWidth(Q) { - H(Q), y(); - }, - get measuredHeight() { - return C(); - }, - set measuredHeight(Q) { - C(Q), y(); - }, - get initialWidth() { - return P(); - }, - set initialWidth(Q) { - P(Q), y(); - }, - get initialHeight() { - return M(); - }, - set initialHeight(Q) { - M(Q), y(); - }, - get width() { - return I(); - }, - set width(Q) { - I(Q), y(); - }, - get height() { - return B(); - }, - set height(Q) { - B(Q), y(); - }, - get dragHandle() { - return F(); - }, - set dragHandle(Q) { - F(Q), y(); - }, - get initialized() { - return K(); - }, - set initialized(Q) { - K(Q), y(); - }, - get parentId() { - return oe(); - }, - set parentId(Q) { - oe(Q), y(); - }, - get nodeClickDistance() { - return J(); - }, - set nodeClickDistance(Q) { - J(Q), y(); - }, - get class() { - return W(); - }, - set class(Q) { - W(Q), y(); - } - }); - return r(), nt; -} -re( - Mc, - { - node: {}, - id: {}, - data: {}, - selected: {}, - draggable: {}, - selectable: {}, - connectable: {}, - deletable: {}, - hidden: {}, - dragging: {}, - resizeObserver: {}, - style: {}, - type: {}, - isParent: {}, - positionX: {}, - positionY: {}, - sourcePosition: {}, - targetPosition: {}, - zIndex: {}, - measuredWidth: {}, - measuredHeight: {}, - initialWidth: {}, - initialHeight: {}, - width: {}, - height: {}, - dragHandle: {}, - initialized: {}, - parentId: {}, - nodeClickDistance: {}, - class: {} - }, - [], - [], - !0 -); -var Ep = /* @__PURE__ */ ne('
'); -const $p = { - hash: "svelte-tf4uy4", - code: ".svelte-flow__nodes.svelte-tf4uy4 {width:100%;height:100%;position:absolute;left:0;top:0;}" -}; -function Hc(e, t) { - ue(t, !1), je(e, $p); - const [n, r] = tt(), o = () => j(c, "$visibleNodes", n), i = () => j(f, "$nodesDraggable", n), s = () => j(g, "$elementsSelectable", n), a = () => j(d, "$nodesConnectable", n), l = () => j(x, "$parentLookup", n); - let u = w(t, "nodeClickDistance", 12, 0); - const { - visibleNodes: c, - nodesDraggable: f, - nodesConnectable: d, - elementsSelectable: g, - updateNodeInternals: p, - parentLookup: x - } = Ke(), k = typeof ResizeObserver > "u" ? null : new ResizeObserver((_) => { - const v = /* @__PURE__ */ new Map(); - _.forEach((b) => { - const N = b.target.getAttribute("data-id"); - v.set(N, { id: N, nodeElement: b.target, force: !0 }); - }), p(v); - }); - Us(() => { - k == null || k.disconnect(); - }), He(); - var E = Ep(); - zt(E, 5, o, (_) => _.id, (_, v) => { - const b = /* @__PURE__ */ pe(() => !!h(v).selected), N = /* @__PURE__ */ pe(() => !!h(v).hidden), $ = /* @__PURE__ */ pe(() => !!(h(v).draggable || i() && typeof h(v).draggable > "u")), T = /* @__PURE__ */ pe(() => !!(h(v).selectable || s() && typeof h(v).selectable > "u")), A = /* @__PURE__ */ pe(() => !!(h(v).connectable || a() && typeof h(v).connectable > "u")), D = /* @__PURE__ */ pe(() => h(v).deletable ?? !0), O = /* @__PURE__ */ pe(() => l().has(h(v).id)), V = /* @__PURE__ */ pe(() => h(v).type ?? "default"), z = /* @__PURE__ */ pe(() => h(v).internals.z ?? 0), S = /* @__PURE__ */ pe(() => nc(h(v))); - Mc(_, { - get node() { - return h(v); - }, - get id() { - return h(v).id; - }, - get data() { - return h(v).data; - }, - get selected() { - return h(b); - }, - get hidden() { - return h(N); - }, - get draggable() { - return h($); - }, - get selectable() { - return h(T); - }, - get connectable() { - return h(A); - }, - get deletable() { - return h(D); - }, - get positionX() { - return h(v).internals.positionAbsolute.x; - }, - get positionY() { - return h(v).internals.positionAbsolute.y; - }, - get isParent() { - return h(O); - }, - get style() { - return h(v).style; - }, - get class() { - return h(v).class; - }, - get type() { - return h(V); - }, - get sourcePosition() { - return h(v).sourcePosition; - }, - get targetPosition() { - return h(v).targetPosition; - }, - get dragging() { - return h(v).dragging; - }, - get zIndex() { - return h(z); - }, - get dragHandle() { - return h(v).dragHandle; - }, - get initialized() { - return h(S); - }, - get width() { - return h(v).width; - }, - get height() { - return h(v).height; - }, - get initialWidth() { - return h(v).initialWidth; - }, - get initialHeight() { - return h(v).initialHeight; - }, - get measuredWidth() { - return h(v).measured.width; - }, - get measuredHeight() { - return h(v).measured.height; - }, - get parentId() { - return h(v).parentId; - }, - resizeObserver: k, - get nodeClickDistance() { - return u(); - }, - $$events: { - nodeclick(H) { - Le.call(this, t, H); - }, - nodemouseenter(H) { - Le.call(this, t, H); - }, - nodemousemove(H) { - Le.call(this, t, H); - }, - nodemouseleave(H) { - Le.call(this, t, H); - }, - nodedrag(H) { - Le.call(this, t, H); - }, - nodedragstart(H) { - Le.call(this, t, H); - }, - nodedragstop(H) { - Le.call(this, t, H); - }, - nodecontextmenu(H) { - Le.call(this, t, H); - } - } - }); - }), Z(E), L(e, E); - var m = ce({ - get nodeClickDistance() { - return u(); - }, - set nodeClickDistance(_) { - u(_), y(); - } - }); - return r(), m; -} -re(Hc, { nodeClickDistance: {} }, [], [], !0); -var Sp = /* @__PURE__ */ xe(''); -function Dc(e, t) { - ue(t, !1); - const [n, r] = tt(), o = () => j(W, "$edgeTypes", n), i = () => j(de, "$flowId", n), s = () => j(we, "$elementsSelectable", n), a = () => j(J, "$edgeLookup", n), l = te(void 0, !0), u = te(void 0, !0), c = te(void 0, !0), f = te(void 0, !0), d = te(void 0, !0); - let g = w(t, "id", 13), p = w(t, "type", 13, "default"), x = w(t, "source", 13, ""), k = w(t, "target", 13, ""), E = w(t, "data", 29, () => ({})), m = w(t, "style", 13, void 0), _ = w(t, "zIndex", 13, void 0), v = w(t, "animated", 13, !1), b = w(t, "selected", 13, !1), N = w(t, "selectable", 13, void 0), $ = w(t, "deletable", 13, void 0), T = w(t, "hidden", 13, !1), A = w(t, "label", 13, void 0), D = w(t, "labelStyle", 13, void 0), O = w(t, "markerStart", 13, void 0), V = w(t, "markerEnd", 13, void 0), z = w(t, "sourceHandle", 13, void 0), S = w(t, "targetHandle", 13, void 0), H = w(t, "sourceX", 13), C = w(t, "sourceY", 13), P = w(t, "targetX", 13), M = w(t, "targetY", 13), I = w(t, "sourcePosition", 13), B = w(t, "targetPosition", 13), F = w(t, "ariaLabel", 13, void 0), K = w(t, "interactionWidth", 13, void 0), oe = w(t, "class", 13, ""); - Mr("svelteflow__edge_id", g()); - const { - edgeLookup: J, - edgeTypes: W, - flowId: de, - elementsSelectable: we - } = Ke(), Ce = Vi(), fe = _c(); - function ze(ee) { - const he = a().get(g()); - he && (fe(g()), Ce("edgeclick", { event: ee, edge: he })); - } - function ie(ee, he) { - const se = a().get(g()); - se && Ce(he, { event: ee, edge: se }); - } - le(() => U(p()), () => { - G(l, p() || "default"); - }), le( - () => (o(), h(l), wi), - () => { - G(u, o()[h(l)] || wi); - } - ), le( - () => (U(O()), i()), - () => { - G(c, O() ? `url('#${Ts(O(), i())}')` : void 0); - } - ), le( - () => (U(V()), i()), - () => { - G(f, V() ? `url('#${Ts(V(), i())}')` : void 0); - } - ), le( - () => (U(N()), s()), - () => { - G(d, N() ?? s()); - } - ), gt(), He(!0); - var ge = et(), Ye = _e(ge); - { - var Ae = (ee) => { - var he = Sp(), se = X(he); - let ke; - var Ne = X(se); - const qe = /* @__PURE__ */ pe(() => $() ?? !0); - vu(Ne, () => h(u), (Re, Oe) => { - Oe(Re, { - get id() { - return g(); - }, - get source() { - return x(); - }, - get target() { - return k(); - }, - get sourceX() { - return H(); - }, - get sourceY() { - return C(); - }, - get targetX() { - return P(); - }, - get targetY() { - return M(); - }, - get sourcePosition() { - return I(); - }, - get targetPosition() { - return B(); - }, - get animated() { - return v(); - }, - get selected() { - return b(); - }, - get label() { - return A(); - }, - get labelStyle() { - return D(); - }, - get data() { - return E(); - }, - get style() { - return m(); - }, - get interactionWidth() { - return K(); - }, - get selectable() { - return h(d); - }, - get deletable() { - return h(qe); - }, - get type() { - return h(l); - }, - get sourceHandleId() { - return z(); - }, - get targetHandleId() { - return S(); - }, - get markerStart() { - return h(c); - }, - get markerEnd() { - return h(f); - } - }); - }), Z(se), Z(he), $e( - (Re) => { - at(he, "z-index", _()), ke = Ct(se, 0, _n(Re), null, ke, { - animated: v(), - selected: b(), - selectable: h(d) - }), ae(se, "data-id", g()), ae(se, "aria-label", F() === null ? void 0 : F() ? F() : `Edge from ${x()} to ${k()}`); - }, - [ - () => $t(["svelte-flow__edge", oe()]) - ], - pe - ), Qe("click", se, ze), Qe("contextmenu", se, (Re) => { - ie(Re, "edgecontextmenu"); - }), Qe("mouseenter", se, (Re) => { - ie(Re, "edgemouseenter"); - }), Qe("mouseleave", se, (Re) => { - ie(Re, "edgemouseleave"); - }), L(ee, he); - }; - be(Ye, (ee) => { - T() || ee(Ae); - }); - } - L(e, ge); - var Ze = ce({ - get id() { - return g(); - }, - set id(ee) { - g(ee), y(); - }, - get type() { - return p(); - }, - set type(ee) { - p(ee), y(); - }, - get source() { - return x(); - }, - set source(ee) { - x(ee), y(); - }, - get target() { - return k(); - }, - set target(ee) { - k(ee), y(); - }, - get data() { - return E(); - }, - set data(ee) { - E(ee), y(); - }, - get style() { - return m(); - }, - set style(ee) { - m(ee), y(); - }, - get zIndex() { - return _(); - }, - set zIndex(ee) { - _(ee), y(); - }, - get animated() { - return v(); - }, - set animated(ee) { - v(ee), y(); - }, - get selected() { - return b(); - }, - set selected(ee) { - b(ee), y(); - }, - get selectable() { - return N(); - }, - set selectable(ee) { - N(ee), y(); - }, - get deletable() { - return $(); - }, - set deletable(ee) { - $(ee), y(); - }, - get hidden() { - return T(); - }, - set hidden(ee) { - T(ee), y(); - }, - get label() { - return A(); - }, - set label(ee) { - A(ee), y(); - }, - get labelStyle() { - return D(); - }, - set labelStyle(ee) { - D(ee), y(); - }, - get markerStart() { - return O(); - }, - set markerStart(ee) { - O(ee), y(); - }, - get markerEnd() { - return V(); - }, - set markerEnd(ee) { - V(ee), y(); - }, - get sourceHandle() { - return z(); - }, - set sourceHandle(ee) { - z(ee), y(); - }, - get targetHandle() { - return S(); - }, - set targetHandle(ee) { - S(ee), y(); - }, - get sourceX() { - return H(); - }, - set sourceX(ee) { - H(ee), y(); - }, - get sourceY() { - return C(); - }, - set sourceY(ee) { - C(ee), y(); - }, - get targetX() { - return P(); - }, - set targetX(ee) { - P(ee), y(); - }, - get targetY() { - return M(); - }, - set targetY(ee) { - M(ee), y(); - }, - get sourcePosition() { - return I(); - }, - set sourcePosition(ee) { - I(ee), y(); - }, - get targetPosition() { - return B(); - }, - set targetPosition(ee) { - B(ee), y(); - }, - get ariaLabel() { - return F(); - }, - set ariaLabel(ee) { - F(ee), y(); - }, - get interactionWidth() { - return K(); - }, - set interactionWidth(ee) { - K(ee), y(); - }, - get class() { - return oe(); - }, - set class(ee) { - oe(ee), y(); - } - }); - return r(), Ze; -} -re( - Dc, - { - id: {}, - type: {}, - source: {}, - target: {}, - data: {}, - style: {}, - zIndex: {}, - animated: {}, - selected: {}, - selectable: {}, - deletable: {}, - hidden: {}, - label: {}, - labelStyle: {}, - markerStart: {}, - markerEnd: {}, - sourceHandle: {}, - targetHandle: {}, - sourceX: {}, - sourceY: {}, - targetX: {}, - targetY: {}, - sourcePosition: {}, - targetPosition: {}, - ariaLabel: {}, - interactionWidth: {}, - class: {} - }, - [], - [], - !0 -); -function Ac(e, t) { - ue(t, !1); - let n = w(t, "onMount", 12, void 0), r = w(t, "onDestroy", 12, void 0); - return xn(() => { - var o; - return (o = n()) == null || o(), r(); - }), He(), ce({ - get onMount() { - return n(); - }, - set onMount(o) { - n(o), y(); - }, - get onDestroy() { - return r(); - }, - set onDestroy(o) { - r(o), y(); - } - }); -} -re(Ac, { onMount: {}, onDestroy: {} }, [], [], !0); -var Pp = /* @__PURE__ */ xe(""); -function Vc(e, t) { - ue(t, !1); - const [n, r] = tt(), o = () => j(i, "$markers", n), { markers: i } = Ke(); - He(); - var s = Pp(); - zt(s, 5, o, (a) => a.id, (a, l) => { - Oc(a, ct(() => h(l))); - }), Z(s), L(e, s), ce(), r(); -} -re(Vc, {}, [], [], !0); -var Np = /* @__PURE__ */ xe(''), Tp = /* @__PURE__ */ xe(''), Mp = /* @__PURE__ */ xe(''); -function Oc(e, t) { - ue(t, !1); - let n = w(t, "id", 12), r = w(t, "type", 12), o = w(t, "width", 12, 12.5), i = w(t, "height", 12, 12.5), s = w(t, "markerUnits", 12, "strokeWidth"), a = w(t, "orient", 12, "auto-start-reverse"), l = w(t, "color", 12, void 0), u = w(t, "strokeWidth", 12, void 0); - He(); - var c = Mp(), f = X(c); - { - var d = (p) => { - var x = Np(); - $e(() => { - ae(x, "stroke", l()), ae(x, "stroke-width", u()); - }), L(p, x); - }, g = (p, x) => { - { - var k = (E) => { - var m = Tp(); - $e(() => { - ae(m, "stroke", l()), ae(m, "stroke-width", u()), ae(m, "fill", l()); - }), L(E, m); - }; - be( - p, - (E) => { - r() === po.ArrowClosed && E(k); - }, - x - ); - } - }; - be(f, (p) => { - r() === po.Arrow ? p(d) : p(g, !1); - }); - } - return Z(c), $e(() => { - ae(c, "id", n()), ae(c, "markerWidth", `${o()}`), ae(c, "markerHeight", `${i()}`), ae(c, "markerUnits", s()), ae(c, "orient", a()); - }), L(e, c), ce({ - get id() { - return n(); - }, - set id(p) { - n(p), y(); - }, - get type() { - return r(); - }, - set type(p) { - r(p), y(); - }, - get width() { - return o(); - }, - set width(p) { - o(p), y(); - }, - get height() { - return i(); - }, - set height(p) { - i(p), y(); - }, - get markerUnits() { - return s(); - }, - set markerUnits(p) { - s(p), y(); - }, - get orient() { - return a(); - }, - set orient(p) { - a(p), y(); - }, - get color() { - return l(); - }, - set color(p) { - l(p), y(); - }, - get strokeWidth() { - return u(); - }, - set strokeWidth(p) { - u(p), y(); - } - }); -} -re( - Oc, - { - id: {}, - type: {}, - width: {}, - height: {}, - markerUnits: {}, - orient: {}, - color: {}, - strokeWidth: {} - }, - [], - [], - !0 -); -var Hp = /* @__PURE__ */ ne('
'); -function Lc(e, t) { - ue(t, !1); - const [n, r] = tt(), o = () => j(a, "$visibleEdges", n), i = () => j(c, "$elementsSelectable", n); - let s = w(t, "defaultEdgeOptions", 12); - const { - visibleEdges: a, - edgesInitialized: l, - edges: { setDefaultOptions: u }, - elementsSelectable: c - } = Ke(); - xn(() => { - s() && u(s()); - }), He(); - var f = Hp(), d = X(f), g = X(d); - Vc(g, {}), Z(d); - var p = R(d, 2); - zt(p, 1, o, (m) => m.id, (m, _) => { - const v = /* @__PURE__ */ pe(() => h(_).selectable ?? i()), b = /* @__PURE__ */ pe(() => h(_).type || "default"); - Dc(m, { - get id() { - return h(_).id; - }, - get source() { - return h(_).source; - }, - get target() { - return h(_).target; - }, - get data() { - return h(_).data; - }, - get style() { - return h(_).style; - }, - get animated() { - return h(_).animated; - }, - get selected() { - return h(_).selected; - }, - get selectable() { - return h(v); - }, - get deletable() { - return h(_).deletable; - }, - get hidden() { - return h(_).hidden; - }, - get label() { - return h(_).label; - }, - get labelStyle() { - return h(_).labelStyle; - }, - get markerStart() { - return h(_).markerStart; - }, - get markerEnd() { - return h(_).markerEnd; - }, - get sourceHandle() { - return h(_).sourceHandle; - }, - get targetHandle() { - return h(_).targetHandle; - }, - get sourceX() { - return h(_).sourceX; - }, - get sourceY() { - return h(_).sourceY; - }, - get targetX() { - return h(_).targetX; - }, - get targetY() { - return h(_).targetY; - }, - get sourcePosition() { - return h(_).sourcePosition; - }, - get targetPosition() { - return h(_).targetPosition; - }, - get ariaLabel() { - return h(_).ariaLabel; - }, - get interactionWidth() { - return h(_).interactionWidth; - }, - get class() { - return h(_).class; - }, - get type() { - return h(b); - }, - get zIndex() { - return h(_).zIndex; - }, - $$events: { - edgeclick(N) { - Le.call(this, t, N); - }, - edgecontextmenu(N) { - Le.call(this, t, N); - }, - edgemouseenter(N) { - Le.call(this, t, N); - }, - edgemouseleave(N) { - Le.call(this, t, N); - } - } - }); - }); - var x = R(p, 2); - { - var k = (m) => { - Ac(m, { - onMount: () => { - si(l, !0); - }, - onDestroy: () => { - si(l, !1); - } - }); - }; - be(x, (m) => { - o().length > 0 && m(k); - }); - } - Z(f), L(e, f); - var E = ce({ - get defaultEdgeOptions() { - return s(); - }, - set defaultEdgeOptions(m) { - s(m), y(); - } - }); - return r(), E; -} -re(Lc, { defaultEdgeOptions: {} }, [], [], !0); -var Dp = /* @__PURE__ */ ne('
'); -const Ap = { - hash: "svelte-1iugwpu", - code: ".svelte-flow__selection.svelte-1iugwpu {position:absolute;top:0;left:0;}" -}; -function da(e, t) { - ue(t, !1), je(e, Ap); - let n = w(t, "x", 12, 0), r = w(t, "y", 12, 0), o = w(t, "width", 12, 0), i = w(t, "height", 12, 0), s = w(t, "isVisible", 12, !0); - var a = et(), l = _e(a); - { - var u = (c) => { - var f = Dp(); - $e(() => { - at(f, "width", typeof o() == "string" ? o() : `${o()}px`), at(f, "height", typeof i() == "string" ? i() : `${i()}px`), at(f, "transform", `translate(${n()}px, ${r()}px)`); - }), L(c, f); - }; - be(l, (c) => { - s() && c(u); - }); - } - return L(e, a), ce({ - get x() { - return n(); - }, - set x(c) { - n(c), y(); - }, - get y() { - return r(); - }, - set y(c) { - r(c), y(); - }, - get width() { - return o(); - }, - set width(c) { - o(c), y(); - }, - get height() { - return i(); - }, - set height(c) { - i(c), y(); - }, - get isVisible() { - return s(); - }, - set isVisible(c) { - s(c), y(); - } - }); -} -re( - da, - { - x: {}, - y: {}, - width: {}, - height: {}, - isVisible: {} - }, - [], - [], - !0 -); -function Ic(e, t) { - ue(t, !1); - const [n, r] = tt(), o = () => j(s, "$selectionRect", n), i = () => j(a, "$selectionRectMode", n), { selectionRect: s, selectionRectMode: a } = Ke(); - He(); - const l = /* @__PURE__ */ pe(() => !!(o() && i() === "user")), u = /* @__PURE__ */ pe(() => { - var g; - return (g = o()) == null ? void 0 : g.width; - }), c = /* @__PURE__ */ pe(() => { - var g; - return (g = o()) == null ? void 0 : g.height; - }), f = /* @__PURE__ */ pe(() => { - var g; - return (g = o()) == null ? void 0 : g.x; - }), d = /* @__PURE__ */ pe(() => { - var g; - return (g = o()) == null ? void 0 : g.y; - }); - da(e, { - get isVisible() { - return h(l); - }, - get width() { - return h(u); - }, - get height() { - return h(c); - }, - get x() { - return h(f); - }, - get y() { - return h(d); - } - }), ce(), r(); -} -re(Ic, {}, [], [], !0); -var Vp = /* @__PURE__ */ ne('
'); -const Op = { - hash: "svelte-5pxri", - code: ".selection-wrapper.svelte-5pxri {position:absolute;top:0;left:0;z-index:7;pointer-events:all;}" -}; -function zc(e, t) { - ue(t, !1), je(e, Op); - const [n, r] = tt(), o = () => j(l, "$selectionRectMode", n), i = () => j(c, "$nodeLookup", n), s = () => j(u, "$nodes", n), a = Ke(), { selectionRectMode: l, nodes: u, nodeLookup: c } = a, f = Vi(); - let d = te(null); - function g(m) { - const _ = s().filter((v) => v.selected); - f("selectioncontextmenu", { nodes: _, event: m }); - } - function p(m) { - const _ = s().filter((v) => v.selected); - f("selectionclick", { nodes: _, event: m }); - } - le( - () => (o(), i(), s()), - () => { - o() === "nodes" && (G(d, Po(i(), { filter: (m) => !!m.selected })), s()); - } - ), gt(), He(); - var x = et(), k = _e(x); - { - var E = (m) => { - var _ = Vp(), v = X(_); - da(v, { width: "100%", height: "100%", x: 0, y: 0 }), Z(_), ht(_, (b, N) => Er == null ? void 0 : Er(b, N), () => ({ - disabled: !1, - store: a, - onDrag: (b, N, $, T) => { - f("nodedrag", { event: b, targetNode: null, nodes: T }); - }, - onDragStart: (b, N, $, T) => { - f("nodedragstart", { event: b, targetNode: null, nodes: T }); - }, - onDragStop: (b, N, $, T) => { - f("nodedragstop", { event: b, targetNode: null, nodes: T }); - } - })), Ot(() => Qe("contextmenu", _, g)), Ot(() => Qe("click", _, p)), Ot(() => Qe("keyup", _, () => { - })), $e(() => ae(_, "style", `width: ${h(d).width ?? ""}px; height: ${h(d).height ?? ""}px; transform: translate(${h(d).x ?? ""}px, ${h(d).y ?? ""}px)`)), L(m, _); - }; - be(k, (m) => { - o() === "nodes" && h(d) && Pn(h(d).x) && Pn(h(d).y) && m(E); - }); - } - L(e, x), ce(), r(); -} -re(zc, {}, [], [], !0); -function We(e, t) { - let { enabled: n = !0, trigger: r, type: o = "keydown" } = t; - function i(s) { - const a = Array.isArray(r) ? r : [r], l = { - alt: s.altKey, - ctrl: s.ctrlKey, - shift: s.shiftKey, - meta: s.metaKey - }; - for (const u of a) { - const c = { - modifier: [], - preventDefault: !1, - enabled: !0, - ...u - }, { modifier: f, key: d, callback: g, preventDefault: p, enabled: x } = c; - if (x) { - if (f.length && !(Array.isArray(f) ? f : [f]).map( - (m) => typeof m == "string" ? [m] : m - ).some( - (m) => m.every((_) => l[_]) - )) - continue; - if (s.key === d) { - p && s.preventDefault(); - const k = { - node: e, - trigger: c, - originalEvent: s - }; - e.dispatchEvent(new CustomEvent("shortcut", { detail: k })), g == null || g(k); - } - } - } - } - return n && e.addEventListener(o, i), { - update: (s) => { - const { enabled: a = !0, type: l = "keydown" } = s; - n && (!a || o !== l) ? e.removeEventListener(o, i) : !n && a && e.addEventListener(l, i), n = a, o = l, r = s.trigger; - }, - destroy: () => { - e.removeEventListener(o, i); - } - }; -} -function Rc(e, t) { - ue(t, !1); - let n = w(t, "selectionKey", 12, "Shift"), r = w(t, "multiSelectionKey", 28, () => pi() ? "Meta" : "Control"), o = w(t, "deleteKey", 12, "Backspace"), i = w(t, "panActivationKey", 12, " "), s = w(t, "zoomActivationKey", 28, () => pi() ? "Meta" : "Control"); - const { - selectionKeyPressed: a, - multiselectionKeyPressed: l, - deleteKeyPressed: u, - panActivationKeyPressed: c, - zoomActivationKeyPressed: f, - selectionRect: d - } = Ke(); - function g(m) { - return m !== null && typeof m == "object"; - } - function p(m) { - return g(m) ? m.modifier || [] : []; - } - function x(m) { - return m == null ? "" : g(m) ? m.key : m; - } - function k(m, _) { - return (Array.isArray(m) ? m : [m]).map((b) => { - const N = x(b); - return { - key: N, - modifier: p(b), - enabled: N !== null, - callback: _ - }; - }); - } - function E() { - d.set(null), a.set(!1), l.set(!1), u.set(!1), c.set(!1), f.set(!1); - } - return He(), Qe("blur", Nt, E), Qe("contextmenu", Nt, E), ht(Nt, (m, _) => We == null ? void 0 : We(m, _), () => ({ - trigger: k(n(), () => a.set(!0)), - type: "keydown" - })), ht(Nt, (m, _) => We == null ? void 0 : We(m, _), () => ({ - trigger: k(n(), () => a.set(!1)), - type: "keyup" - })), ht(Nt, (m, _) => We == null ? void 0 : We(m, _), () => ({ - trigger: k(r(), () => l.set(!0)), - type: "keydown" - })), ht(Nt, (m, _) => We == null ? void 0 : We(m, _), () => ({ - trigger: k(r(), () => l.set(!1)), - type: "keyup" - })), ht(Nt, (m, _) => We == null ? void 0 : We(m, _), () => ({ - trigger: k(o(), (m) => { - !(m.originalEvent.ctrlKey || m.originalEvent.metaKey || m.originalEvent.shiftKey) && !p0(m.originalEvent) && u.set(!0); - }), - type: "keydown" - })), ht(Nt, (m, _) => We == null ? void 0 : We(m, _), () => ({ - trigger: k(o(), () => u.set(!1)), - type: "keyup" - })), ht(Nt, (m, _) => We == null ? void 0 : We(m, _), () => ({ - trigger: k(i(), () => c.set(!0)), - type: "keydown" - })), ht(Nt, (m, _) => We == null ? void 0 : We(m, _), () => ({ - trigger: k(i(), () => c.set(!1)), - type: "keyup" - })), ht(Nt, (m, _) => We == null ? void 0 : We(m, _), () => ({ - trigger: k(s(), () => f.set(!0)), - type: "keydown" - })), ht(Nt, (m, _) => We == null ? void 0 : We(m, _), () => ({ - trigger: k(s(), () => f.set(!1)), - type: "keyup" - })), ce({ - get selectionKey() { - return n(); - }, - set selectionKey(m) { - n(m), y(); - }, - get multiSelectionKey() { - return r(); - }, - set multiSelectionKey(m) { - r(m), y(); - }, - get deleteKey() { - return o(); - }, - set deleteKey(m) { - o(m), y(); - }, - get panActivationKey() { - return i(); - }, - set panActivationKey(m) { - i(m), y(); - }, - get zoomActivationKey() { - return s(); - }, - set zoomActivationKey(m) { - s(m), y(); - } - }); -} -re( - Rc, - { - selectionKey: {}, - multiSelectionKey: {}, - deleteKey: {}, - panActivationKey: {}, - zoomActivationKey: {} - }, - [], - [], - !0 -); -var Lp = /* @__PURE__ */ xe(''), Ip = /* @__PURE__ */ xe(''); -function Bc(e, t) { - ue(t, !1); - const [n, r] = tt(), o = () => j(g, "$connection", n), i = () => j(p, "$connectionLineType", n), s = () => j(f, "$width", n), a = () => j(d, "$height", n); - let l = w(t, "containerStyle", 12, ""), u = w(t, "style", 12, ""), c = w(t, "isCustomComponent", 12, !1); - const { - width: f, - height: d, - connection: g, - connectionLineType: p - } = Ke(); - let x = te(null); - le( - () => (o(), U(c()), i(), h(x), Ns), - () => { - if (o().inProgress && !c()) { - const { from: v, to: b, fromPosition: N, toPosition: $ } = o(), T = { - sourceX: v.x, - sourceY: v.y, - sourcePosition: N, - targetX: b.x, - targetY: b.y, - targetPosition: $ - }; - switch (i()) { - case Cr.Bezier: - ((A) => G(x, A[0]))(oc(T)); - break; - case Cr.Step: - ((A) => G(x, A[0]))(mi({ ...T, borderRadius: 0 })); - break; - case Cr.SmoothStep: - ((A) => G(x, A[0]))(mi(T)); - break; - default: - ((A) => G(x, A[0]))(Ns(T)); - } - } - } - ), gt(), He(); - var k = et(), E = _e(k); - { - var m = (v) => { - var b = Ip(), N = X(b), $ = X(N); - vt($, t, "connectionLine", {}); - var T = R($); - { - var A = (D) => { - var O = Lp(); - $e(() => { - ae(O, "d", h(x)), ae(O, "style", u()); - }), L(D, O); - }; - be(T, (D) => { - c() || D(A); - }); - } - Z(N), Z(b), $e( - (D) => { - ae(b, "width", s()), ae(b, "height", a()), ae(b, "style", l()), Ct(N, 0, _n(D)); - }, - [ - () => $t([ - "svelte-flow__connection", - a0(o().isValid) - ]) - ], - pe - ), L(v, b); - }; - be(E, (v) => { - o().inProgress && v(m); - }); - } - L(e, k); - var _ = ce({ - get containerStyle() { - return l(); - }, - set containerStyle(v) { - l(v), y(); - }, - get style() { - return u(); - }, - set style(v) { - u(v), y(); - }, - get isCustomComponent() { - return c(); - }, - set isCustomComponent(v) { - c(v), y(); - } - }); - return r(), _; -} -re( - Bc, - { - containerStyle: {}, - style: {}, - isCustomComponent: {} - }, - ["connectionLine"], - [], - !0 -); -var zp = /* @__PURE__ */ ne("
"); -function Mo(e, t) { - const n = rt(t, [ - "children", - "$$slots", - "$$events", - "$$legacy", - "$$host" - ]), r = rt(n, ["position", "style", "class"]); - ue(t, !1); - const [o, i] = tt(), s = () => j(f, "$selectionRectMode", o), a = te(); - let l = w(t, "position", 12, "top-right"), u = w(t, "style", 12, void 0), c = w(t, "class", 12, void 0); - const { selectionRectMode: f } = Ke(); - le(() => U(l()), () => { - G(a, `${l()}`.split("-")); - }), gt(), He(); - var d = zp(); - let g; - var p = X(d); - vt(p, t, "default", {}), Z(d), $e( - (k) => { - g = rn(d, g, { - class: k, - style: u(), - ...r - }), at(d, "pointer-events", s() ? "none" : ""); - }, - [ - () => $t([ - "svelte-flow__panel", - c(), - ...h(a) - ]) - ], - pe - ), L(e, d); - var x = ce({ - get position() { - return l(); - }, - set position(k) { - l(k), y(); - }, - get style() { - return u(); - }, - set style(k) { - u(k), y(); - }, - get class() { - return c(); - }, - set class(k) { - c(k), y(); - } - }); - return i(), x; -} -re(Mo, { position: {}, style: {}, class: {} }, ["default"], [], !0); -var Rp = /* @__PURE__ */ ne('Svelte Flow'); -function Yc(e, t) { - ue(t, !1); - let n = w(t, "proOptions", 12, void 0), r = w(t, "position", 12, "bottom-right"); - He(); - var o = et(), i = _e(o); - { - var s = (a) => { - Mo(a, { - get position() { - return r(); - }, - class: "svelte-flow__attribution", - "data-message": "Feel free to remove the attribution or check out how you could support us: https://svelteflow.dev/support-us", - children: (l, u) => { - var c = Rp(); - L(l, c); - }, - $$slots: { default: !0 } - }); - }; - be(i, (a) => { - var l; - (l = n()) != null && l.hideAttribution || a(s); - }); - } - return L(e, o), ce({ - get proOptions() { - return n(); - }, - set proOptions(a) { - n(a), y(); - }, - get position() { - return r(); - }, - set position(a) { - r(a), y(); - } - }); -} -re(Yc, { proOptions: {}, position: {} }, [], [], !0); -function Cl(e, { nodeTypes: t, edgeTypes: n, minZoom: r, maxZoom: o, translateExtent: i, paneClickDistance: s }) { - t !== void 0 && e.setNodeTypes(t), n !== void 0 && e.setEdgeTypes(n), r !== void 0 && e.setMinZoom(r), o !== void 0 && e.setMaxZoom(o), i !== void 0 && e.setTranslateExtent(i), s !== void 0 && e.setPaneClickDistance(s); -} -const Bp = (e) => Object.keys(e); -function kl(e, t) { - Bp(t).forEach((n) => { - const r = t[n]; - r !== void 0 && e[n].set(r); - }); -} -function Yp() { - return typeof window > "u" || !window.matchMedia ? null : window.matchMedia("(prefers-color-scheme: dark)"); -} -function Zp(e = "light") { - return Zt("light", (n) => { - if (e !== "system") { - n(e); - return; - } - const r = Yp(), o = () => n(r != null && r.matches ? "dark" : "light"); - return n(r != null && r.matches ? "dark" : "light"), r == null || r.addEventListener("change", o), () => { - r == null || r.removeEventListener("change", o); - }; - }); -} -var Xp = /* @__PURE__ */ ne('
', 1), Wp = /* @__PURE__ */ ne(" ", 1), Fp = /* @__PURE__ */ ne("
"); -const Kp = { - hash: "svelte-12wlba6", - code: ".svelte-flow.svelte-12wlba6 {width:100%;height:100%;overflow:hidden;position:relative;z-index:0;background-color:var(--background-color, var(--background-color-default));}:root {--background-color-default: #fff;--background-pattern-color-default: #ddd;--minimap-mask-color-default: rgb(240, 240, 240, 0.6);--minimap-mask-stroke-color-default: none;--minimap-mask-stroke-width-default: 1;--controls-button-background-color-default: #fefefe;--controls-button-background-color-hover-default: #f4f4f4;--controls-button-color-default: inherit;--controls-button-color-hover-default: inherit;--controls-button-border-color-default: #eee;}" -}; -function Zc(e, t) { - const n = g1(t), r = rt(t, [ - "children", - "$$slots", - "$$events", - "$$legacy", - "$$host" - ]), o = rt(r, [ - "id", - "nodes", - "edges", - "fitView", - "fitViewOptions", - "minZoom", - "maxZoom", - "initialViewport", - "viewport", - "nodeTypes", - "edgeTypes", - "selectionKey", - "selectionMode", - "panActivationKey", - "multiSelectionKey", - "zoomActivationKey", - "nodesDraggable", - "nodesConnectable", - "nodeDragThreshold", - "elementsSelectable", - "snapGrid", - "deleteKey", - "connectionRadius", - "connectionLineType", - "connectionMode", - "connectionLineStyle", - "connectionLineContainerStyle", - "onMoveStart", - "onMove", - "onMoveEnd", - "isValidConnection", - "translateExtent", - "nodeExtent", - "onlyRenderVisibleElements", - "panOnScrollMode", - "preventScrolling", - "zoomOnScroll", - "zoomOnDoubleClick", - "zoomOnPinch", - "panOnScroll", - "panOnDrag", - "selectionOnDrag", - "autoPanOnConnect", - "autoPanOnNodeDrag", - "onerror", - "ondelete", - "onedgecreate", - "attributionPosition", - "proOptions", - "defaultEdgeOptions", - "width", - "height", - "colorMode", - "onconnect", - "onconnectstart", - "onconnectend", - "onbeforedelete", - "oninit", - "nodeOrigin", - "paneClickDistance", - "nodeClickDistance", - "defaultMarkerColor", - "style", - "class" - ]); - ue(t, !1), je(e, Kp); - const [i, s] = tt(), a = () => j(_(), "$viewport", i), l = () => j(Ui, "$initialized", i), u = () => j(h(c), "$colorModeClass", i), c = te(); - let f = w(t, "id", 12, "1"), d = w(t, "nodes", 12), g = w(t, "edges", 12), p = w(t, "fitView", 12, void 0), x = w(t, "fitViewOptions", 12, void 0), k = w(t, "minZoom", 12, void 0), E = w(t, "maxZoom", 12, void 0), m = w(t, "initialViewport", 12, void 0), _ = w(t, "viewport", 12, void 0), v = w(t, "nodeTypes", 12, void 0), b = w(t, "edgeTypes", 12, void 0), N = w(t, "selectionKey", 12, void 0), $ = w(t, "selectionMode", 12, void 0), T = w(t, "panActivationKey", 12, void 0), A = w(t, "multiSelectionKey", 12, void 0), D = w(t, "zoomActivationKey", 12, void 0), O = w(t, "nodesDraggable", 12, void 0), V = w(t, "nodesConnectable", 12, void 0), z = w(t, "nodeDragThreshold", 12, void 0), S = w(t, "elementsSelectable", 12, void 0), H = w(t, "snapGrid", 12, void 0), C = w(t, "deleteKey", 12, void 0), P = w(t, "connectionRadius", 12, void 0), M = w(t, "connectionLineType", 12, void 0), I = w(t, "connectionMode", 28, () => cr.Strict), B = w(t, "connectionLineStyle", 12, ""), F = w(t, "connectionLineContainerStyle", 12, ""), K = w(t, "onMoveStart", 12, void 0), oe = w(t, "onMove", 12, void 0), J = w(t, "onMoveEnd", 12, void 0), W = w(t, "isValidConnection", 12, void 0), de = w(t, "translateExtent", 12, void 0), we = w(t, "nodeExtent", 12, void 0), Ce = w(t, "onlyRenderVisibleElements", 12, void 0), fe = w(t, "panOnScrollMode", 28, () => Kn.Free), ze = w(t, "preventScrolling", 12, !0), ie = w(t, "zoomOnScroll", 12, !0), ge = w(t, "zoomOnDoubleClick", 12, !0), Ye = w(t, "zoomOnPinch", 12, !0), Ae = w(t, "panOnScroll", 12, !1), Ze = w(t, "panOnDrag", 12, !0), ee = w(t, "selectionOnDrag", 12, void 0), he = w(t, "autoPanOnConnect", 12, !0), se = w(t, "autoPanOnNodeDrag", 12, !0), ke = w(t, "onerror", 12, void 0), Ne = w(t, "ondelete", 12, void 0), qe = w(t, "onedgecreate", 12, void 0), Re = w(t, "attributionPosition", 12, void 0), Oe = w(t, "proOptions", 12, void 0), ut = w(t, "defaultEdgeOptions", 12, void 0), nt = w(t, "width", 12, void 0), Q = w(t, "height", 12, void 0), Xe = w(t, "colorMode", 12, "light"), ve = w(t, "onconnect", 12, void 0), ln = w(t, "onconnectstart", 12, void 0), Gt = w(t, "onconnectend", 12, void 0), un = w(t, "onbeforedelete", 12, void 0), Pe = w(t, "oninit", 12, void 0), ot = w(t, "nodeOrigin", 12, void 0), me = w(t, "paneClickDistance", 12, 0), it = w(t, "nodeClickDistance", 12, 0), lt = w(t, "defaultMarkerColor", 12, "#b1b1b7"), Yt = w(t, "style", 12, void 0), Kr = w(t, "class", 12, void 0), Dt = te(), St = te(), cn = te(); - const Ut = a() || m(), ft = Kf(Xi) ? Ke() : pp({ - nodes: q(d()), - edges: q(g()), - width: nt(), - height: Q(), - fitView: p(), - nodeOrigin: ot(), - nodeExtent: we() - }); - xn(() => (ft.width.set(h(St)), ft.height.set(h(cn)), ft.domNode.set(h(Dt)), ft.syncNodeStores(d()), ft.syncEdgeStores(g()), ft.syncViewport(_()), p() !== void 0 && ft.fitViewOnInit.set(p()), x() && ft.fitViewOptions.set(x()), Cl(ft, { - nodeTypes: v(), - edgeTypes: b(), - minZoom: k(), - maxZoom: E(), - translateExtent: de(), - paneClickDistance: me() - }), () => { - ft.reset(); - })); - const { initialized: Ui } = ft; - let tr = te(!1); - le( - () => (h(St), h(cn)), - () => { - h(St) !== void 0 && h(cn) !== void 0 && (ft.width.set(h(St)), ft.height.set(h(cn))); - } - ), le( - () => (h(tr), l(), U(Pe())), - () => { - var Y; - !h(tr) && l() && ((Y = Pe()) == null || Y(), G(tr, !0)); - } - ), le( - () => (U(f()), U(M()), U(P()), U($()), U(H()), U(lt()), U(O()), U(V()), U(S()), U(Ce()), U(W()), U(he()), U(se()), U(ke()), U(Ne()), U(qe()), U(I()), U(z()), U(ve()), U(ln()), U(Gt()), U(un()), U(ot()), kl), - () => { - const Y = { - flowId: f(), - connectionLineType: M(), - connectionRadius: P(), - selectionMode: $(), - snapGrid: H(), - defaultMarkerColor: lt(), - nodesDraggable: O(), - nodesConnectable: V(), - elementsSelectable: S(), - onlyRenderVisibleElements: Ce(), - isValidConnection: W(), - autoPanOnConnect: he(), - autoPanOnNodeDrag: se(), - onerror: ke(), - ondelete: Ne(), - onedgecreate: qe(), - connectionMode: I(), - nodeDragThreshold: z(), - onconnect: ve(), - onconnectstart: ln(), - onconnectend: Gt(), - onbeforedelete: un(), - nodeOrigin: ot() - }; - kl(ft, Y); - } - ), le( - () => (U(v()), U(b()), U(k()), U(E()), U(de()), U(me())), - () => { - Cl(ft, { - nodeTypes: v(), - edgeTypes: b(), - minZoom: k(), - maxZoom: E(), - translateExtent: de(), - paneClickDistance: me() - }); - } - ), le( - () => U(Xe()), - () => { - x1(G(c, Zp(Xe())), "$colorModeClass", i); - } - ), gt(), He(); - var jt = Fp(); - let Oo; - var Lo = X(jt); - Rc(Lo, { - get selectionKey() { - return N(); - }, - get deleteKey() { - return C(); - }, - get panActivationKey() { - return T(); - }, - get multiSelectionKey() { - return A(); - }, - get zoomActivationKey() { - return D(); - } - }); - var Io = R(Lo, 2); - const Ld = /* @__PURE__ */ pe(() => fe() === void 0 ? Kn.Free : fe()), Id = /* @__PURE__ */ pe(() => ze() === void 0 ? !0 : ze()), zd = /* @__PURE__ */ pe(() => ie() === void 0 ? !0 : ie()), Rd = /* @__PURE__ */ pe(() => ge() === void 0 ? !0 : ge()), Bd = /* @__PURE__ */ pe(() => Ye() === void 0 ? !0 : Ye()), Yd = /* @__PURE__ */ pe(() => Ae() === void 0 ? !1 : Ae()), Zd = /* @__PURE__ */ pe(() => Ze() === void 0 ? !0 : Ze()), Xd = /* @__PURE__ */ pe(() => me() === void 0 ? 0 : me()); - Pc(Io, { - initialViewport: Ut, - get onMoveStart() { - return K(); - }, - get onMove() { - return oe(); - }, - get onMoveEnd() { - return J(); - }, - get panOnScrollMode() { - return h(Ld); - }, - get preventScrolling() { - return h(Id); - }, - get zoomOnScroll() { - return h(zd); - }, - get zoomOnDoubleClick() { - return h(Rd); - }, - get zoomOnPinch() { - return h(Bd); - }, - get panOnScroll() { - return h(Yd); - }, - get panOnDrag() { - return h(Zd); - }, - get paneClickDistance() { - return h(Xd); - }, - children: (Y, iw) => { - const Kd = /* @__PURE__ */ pe(() => Ze() === void 0 ? !0 : Ze()); - Nc(Y, { - get panOnDrag() { - return h(Kd); - }, - get selectionOnDrag() { - return ee(); - }, - $$events: { - paneclick(qr) { - Le.call(this, t, qr); - }, - panecontextmenu(qr) { - Le.call(this, t, qr); - } - }, - children: (qr, sw) => { - var ya = Wp(), wa = _e(ya); - Tc(wa, { - children: (Gd, aw) => { - var _a = Xp(), xa = _e(_a); - Lc(xa, { - get defaultEdgeOptions() { - return ut(); - }, - $$events: { - edgeclick(Ve) { - Le.call(this, t, Ve); - }, - edgecontextmenu(Ve) { - Le.call(this, t, Ve); - }, - edgemouseenter(Ve) { - Le.call(this, t, Ve); - }, - edgemouseleave(Ve) { - Le.call(this, t, Ve); - } - } - }); - var ba = R(xa, 2); - Bc(ba, { - get containerStyle() { - return F(); - }, - get style() { - return B(); - }, - isCustomComponent: n.connectionLine, - $$slots: { - connectionLine: (Ve, lw) => { - var ka = et(), jd = _e(ka); - vt(jd, t, "connectionLine", {}), L(Ve, ka); - } - } - }); - var Ca = R(ba, 6); - Hc(Ca, { - get nodeClickDistance() { - return it(); - }, - $$events: { - nodeclick(Ve) { - Le.call(this, t, Ve); - }, - nodemouseenter(Ve) { - Le.call(this, t, Ve); - }, - nodemousemove(Ve) { - Le.call(this, t, Ve); - }, - nodemouseleave(Ve) { - Le.call(this, t, Ve); - }, - nodedragstart(Ve) { - Le.call(this, t, Ve); - }, - nodedrag(Ve) { - Le.call(this, t, Ve); - }, - nodedragstop(Ve) { - Le.call(this, t, Ve); - }, - nodecontextmenu(Ve) { - Le.call(this, t, Ve); - } - } - }); - var Ud = R(Ca, 2); - zc(Ud, { - $$events: { - selectionclick(Ve) { - Le.call(this, t, Ve); - }, - selectioncontextmenu(Ve) { - Le.call(this, t, Ve); - }, - nodedragstart(Ve) { - Le.call(this, t, Ve); - }, - nodedrag(Ve) { - Le.call(this, t, Ve); - }, - nodedragstop(Ve) { - Le.call(this, t, Ve); - } - } - }), L(Gd, _a); - }, - $$slots: { default: !0 } - }); - var qd = R(wa, 2); - Ic(qd, {}), L(qr, ya); - }, - $$slots: { default: !0 } - }); - }, - $$slots: { default: !0 } - }); - var ma = R(Io, 2); - Yc(ma, { - get proOptions() { - return Oe(); - }, - get position() { - return Re(); - } - }); - var Wd = R(ma, 2); - vt(Wd, t, "default", {}), Z(jt), An(jt, (Y) => G(Dt, Y), () => h(Dt)), $e( - (Y) => Oo = rn( - jt, - Oo, - { - style: Yt(), - class: Y, - "data-testid": "svelte-flow__wrapper", - ...o, - role: "application" - }, - "svelte-12wlba6" - ), - [ - () => $t([ - "svelte-flow", - Kr(), - u() - ]) - ], - pe - ), La(jt, "clientWidth", (Y) => G(St, Y)), La(jt, "clientHeight", (Y) => G(cn, Y)), Qe("dragover", jt, function(Y) { - Le.call(this, t, Y); - }), Qe("drop", jt, function(Y) { - Le.call(this, t, Y); - }), L(e, jt); - var Fd = ce({ - get id() { - return f(); - }, - set id(Y) { - f(Y), y(); - }, - get nodes() { - return d(); - }, - set nodes(Y) { - d(Y), y(); - }, - get edges() { - return g(); - }, - set edges(Y) { - g(Y), y(); - }, - get fitView() { - return p(); - }, - set fitView(Y) { - p(Y), y(); - }, - get fitViewOptions() { - return x(); - }, - set fitViewOptions(Y) { - x(Y), y(); - }, - get minZoom() { - return k(); - }, - set minZoom(Y) { - k(Y), y(); - }, - get maxZoom() { - return E(); - }, - set maxZoom(Y) { - E(Y), y(); - }, - get initialViewport() { - return m(); - }, - set initialViewport(Y) { - m(Y), y(); - }, - get viewport() { - return _(); - }, - set viewport(Y) { - _(Y), y(); - }, - get nodeTypes() { - return v(); - }, - set nodeTypes(Y) { - v(Y), y(); - }, - get edgeTypes() { - return b(); - }, - set edgeTypes(Y) { - b(Y), y(); - }, - get selectionKey() { - return N(); - }, - set selectionKey(Y) { - N(Y), y(); - }, - get selectionMode() { - return $(); - }, - set selectionMode(Y) { - $(Y), y(); - }, - get panActivationKey() { - return T(); - }, - set panActivationKey(Y) { - T(Y), y(); - }, - get multiSelectionKey() { - return A(); - }, - set multiSelectionKey(Y) { - A(Y), y(); - }, - get zoomActivationKey() { - return D(); - }, - set zoomActivationKey(Y) { - D(Y), y(); - }, - get nodesDraggable() { - return O(); - }, - set nodesDraggable(Y) { - O(Y), y(); - }, - get nodesConnectable() { - return V(); - }, - set nodesConnectable(Y) { - V(Y), y(); - }, - get nodeDragThreshold() { - return z(); - }, - set nodeDragThreshold(Y) { - z(Y), y(); - }, - get elementsSelectable() { - return S(); - }, - set elementsSelectable(Y) { - S(Y), y(); - }, - get snapGrid() { - return H(); - }, - set snapGrid(Y) { - H(Y), y(); - }, - get deleteKey() { - return C(); - }, - set deleteKey(Y) { - C(Y), y(); - }, - get connectionRadius() { - return P(); - }, - set connectionRadius(Y) { - P(Y), y(); - }, - get connectionLineType() { - return M(); - }, - set connectionLineType(Y) { - M(Y), y(); - }, - get connectionMode() { - return I(); - }, - set connectionMode(Y) { - I(Y), y(); - }, - get connectionLineStyle() { - return B(); - }, - set connectionLineStyle(Y) { - B(Y), y(); - }, - get connectionLineContainerStyle() { - return F(); - }, - set connectionLineContainerStyle(Y) { - F(Y), y(); - }, - get onMoveStart() { - return K(); - }, - set onMoveStart(Y) { - K(Y), y(); - }, - get onMove() { - return oe(); - }, - set onMove(Y) { - oe(Y), y(); - }, - get onMoveEnd() { - return J(); - }, - set onMoveEnd(Y) { - J(Y), y(); - }, - get isValidConnection() { - return W(); - }, - set isValidConnection(Y) { - W(Y), y(); - }, - get translateExtent() { - return de(); - }, - set translateExtent(Y) { - de(Y), y(); - }, - get nodeExtent() { - return we(); - }, - set nodeExtent(Y) { - we(Y), y(); - }, - get onlyRenderVisibleElements() { - return Ce(); - }, - set onlyRenderVisibleElements(Y) { - Ce(Y), y(); - }, - get panOnScrollMode() { - return fe(); - }, - set panOnScrollMode(Y) { - fe(Y), y(); - }, - get preventScrolling() { - return ze(); - }, - set preventScrolling(Y) { - ze(Y), y(); - }, - get zoomOnScroll() { - return ie(); - }, - set zoomOnScroll(Y) { - ie(Y), y(); - }, - get zoomOnDoubleClick() { - return ge(); - }, - set zoomOnDoubleClick(Y) { - ge(Y), y(); - }, - get zoomOnPinch() { - return Ye(); - }, - set zoomOnPinch(Y) { - Ye(Y), y(); - }, - get panOnScroll() { - return Ae(); - }, - set panOnScroll(Y) { - Ae(Y), y(); - }, - get panOnDrag() { - return Ze(); - }, - set panOnDrag(Y) { - Ze(Y), y(); - }, - get selectionOnDrag() { - return ee(); - }, - set selectionOnDrag(Y) { - ee(Y), y(); - }, - get autoPanOnConnect() { - return he(); - }, - set autoPanOnConnect(Y) { - he(Y), y(); - }, - get autoPanOnNodeDrag() { - return se(); - }, - set autoPanOnNodeDrag(Y) { - se(Y), y(); - }, - get onerror() { - return ke(); - }, - set onerror(Y) { - ke(Y), y(); - }, - get ondelete() { - return Ne(); - }, - set ondelete(Y) { - Ne(Y), y(); - }, - get onedgecreate() { - return qe(); - }, - set onedgecreate(Y) { - qe(Y), y(); - }, - get attributionPosition() { - return Re(); - }, - set attributionPosition(Y) { - Re(Y), y(); - }, - get proOptions() { - return Oe(); - }, - set proOptions(Y) { - Oe(Y), y(); - }, - get defaultEdgeOptions() { - return ut(); - }, - set defaultEdgeOptions(Y) { - ut(Y), y(); - }, - get width() { - return nt(); - }, - set width(Y) { - nt(Y), y(); - }, - get height() { - return Q(); - }, - set height(Y) { - Q(Y), y(); - }, - get colorMode() { - return Xe(); - }, - set colorMode(Y) { - Xe(Y), y(); - }, - get onconnect() { - return ve(); - }, - set onconnect(Y) { - ve(Y), y(); - }, - get onconnectstart() { - return ln(); - }, - set onconnectstart(Y) { - ln(Y), y(); - }, - get onconnectend() { - return Gt(); - }, - set onconnectend(Y) { - Gt(Y), y(); - }, - get onbeforedelete() { - return un(); - }, - set onbeforedelete(Y) { - un(Y), y(); - }, - get oninit() { - return Pe(); - }, - set oninit(Y) { - Pe(Y), y(); - }, - get nodeOrigin() { - return ot(); - }, - set nodeOrigin(Y) { - ot(Y), y(); - }, - get paneClickDistance() { - return me(); - }, - set paneClickDistance(Y) { - me(Y), y(); - }, - get nodeClickDistance() { - return it(); - }, - set nodeClickDistance(Y) { - it(Y), y(); - }, - get defaultMarkerColor() { - return lt(); - }, - set defaultMarkerColor(Y) { - lt(Y), y(); - }, - get style() { - return Yt(); - }, - set style(Y) { - Yt(Y), y(); - }, - get class() { - return Kr(); - }, - set class(Y) { - Kr(Y), y(); - } - }); - return s(), Fd; -} -re( - Zc, - { - id: {}, - nodes: {}, - edges: {}, - fitView: {}, - fitViewOptions: {}, - minZoom: {}, - maxZoom: {}, - initialViewport: {}, - viewport: {}, - nodeTypes: {}, - edgeTypes: {}, - selectionKey: {}, - selectionMode: {}, - panActivationKey: {}, - multiSelectionKey: {}, - zoomActivationKey: {}, - nodesDraggable: {}, - nodesConnectable: {}, - nodeDragThreshold: {}, - elementsSelectable: {}, - snapGrid: {}, - deleteKey: {}, - connectionRadius: {}, - connectionLineType: {}, - connectionMode: {}, - connectionLineStyle: {}, - connectionLineContainerStyle: {}, - onMoveStart: {}, - onMove: {}, - onMoveEnd: {}, - isValidConnection: {}, - translateExtent: {}, - nodeExtent: {}, - onlyRenderVisibleElements: {}, - panOnScrollMode: {}, - preventScrolling: {}, - zoomOnScroll: {}, - zoomOnDoubleClick: {}, - zoomOnPinch: {}, - panOnScroll: {}, - panOnDrag: {}, - selectionOnDrag: {}, - autoPanOnConnect: {}, - autoPanOnNodeDrag: {}, - onerror: {}, - ondelete: {}, - onedgecreate: {}, - attributionPosition: {}, - proOptions: {}, - defaultEdgeOptions: {}, - width: {}, - height: {}, - colorMode: {}, - onconnect: {}, - onconnectstart: {}, - onconnectend: {}, - onbeforedelete: {}, - oninit: {}, - nodeOrigin: {}, - paneClickDistance: {}, - nodeClickDistance: {}, - defaultMarkerColor: {}, - style: {}, - class: {} - }, - ["connectionLine", "default"], - [], - !0 -); -function Xc(e, t) { - ue(t, !1); - let n = w(t, "initialNodes", 12, void 0), r = w(t, "initialEdges", 12, void 0), o = w(t, "initialWidth", 12, void 0), i = w(t, "initialHeight", 12, void 0), s = w(t, "fitView", 12, void 0), a = w(t, "nodeOrigin", 12, void 0); - const l = Sc({ - nodes: n(), - edges: r(), - width: o(), - height: i(), - nodeOrigin: a(), - fitView: s() - }); - Mr(Xi, { getStore: () => l }), Us(() => { - l.reset(); - }), He(); - var u = et(), c = _e(u); - return vt(c, t, "default", {}), L(e, u), ce({ - get initialNodes() { - return n(); - }, - set initialNodes(f) { - n(f), y(); - }, - get initialEdges() { - return r(); - }, - set initialEdges(f) { - r(f), y(); - }, - get initialWidth() { - return o(); - }, - set initialWidth(f) { - o(f), y(); - }, - get initialHeight() { - return i(); - }, - set initialHeight(f) { - i(f), y(); - }, - get fitView() { - return s(); - }, - set fitView(f) { - s(f), y(); - }, - get nodeOrigin() { - return a(); - }, - set nodeOrigin(f) { - a(f), y(); - } - }); -} -re( - Xc, - { - initialNodes: {}, - initialEdges: {}, - initialWidth: {}, - initialHeight: {}, - fitView: {}, - nodeOrigin: {} - }, - ["default"], - [], - !0 -); -var qp = /* @__PURE__ */ ne(""); -function ro(e, t) { - const n = rt(t, [ - "children", - "$$slots", - "$$events", - "$$legacy", - "$$host" - ]), r = rt(n, [ - "class", - "bgColor", - "bgColorHover", - "color", - "colorHover", - "borderColor" - ]); - ue(t, !1); - let o = w(t, "class", 12, void 0), i = w(t, "bgColor", 12, void 0), s = w(t, "bgColorHover", 12, void 0), a = w(t, "color", 12, void 0), l = w(t, "colorHover", 12, void 0), u = w(t, "borderColor", 12, void 0); - He(); - var c = qp(); - let f; - var d = X(c); - return vt(d, t, "default", { class: "button-svg" }), Z(c), $e( - (g) => { - f = rn(c, f, { type: "button", class: g, ...r }), at(c, "--xy-controls-button-background-color-props", i()), at(c, "--xy-controls-button-background-color-hover-props", s()), at(c, "--xy-controls-button-color-props", a()), at(c, "--xy-controls-button-color-hover-props", l()), at(c, "--xy-controls-button-border-color-props", u()); - }, - [ - () => $t([ - "svelte-flow__controls-button", - o() - ]) - ], - pe - ), Qe("click", c, function(g) { - Le.call(this, t, g); - }), L(e, c), ce({ - get class() { - return o(); - }, - set class(g) { - o(g), y(); - }, - get bgColor() { - return i(); - }, - set bgColor(g) { - i(g), y(); - }, - get bgColorHover() { - return s(); - }, - set bgColorHover(g) { - s(g), y(); - }, - get color() { - return a(); - }, - set color(g) { - a(g), y(); - }, - get colorHover() { - return l(); - }, - set colorHover(g) { - l(g), y(); - }, - get borderColor() { - return u(); - }, - set borderColor(g) { - u(g), y(); - } - }); -} -re( - ro, - { - class: {}, - bgColor: {}, - bgColorHover: {}, - color: {}, - colorHover: {}, - borderColor: {} - }, - ["default"], - [], - !0 -); -var Gp = /* @__PURE__ */ xe(''); -function Wc(e) { - var t = Gp(); - L(e, t); -} -re(Wc, {}, [], [], !0); -var Up = /* @__PURE__ */ xe(''); -function Fc(e) { - var t = Up(); - L(e, t); -} -re(Fc, {}, [], [], !0); -var jp = /* @__PURE__ */ xe(''); -function Kc(e) { - var t = jp(); - L(e, t); -} -re(Kc, {}, [], [], !0); -var Jp = /* @__PURE__ */ xe(''); -function qc(e) { - var t = Jp(); - L(e, t); -} -re(qc, {}, [], [], !0); -var Qp = /* @__PURE__ */ xe(''); -function Gc(e) { - var t = Qp(); - L(e, t); -} -re(Gc, {}, [], [], !0); -var e2 = /* @__PURE__ */ ne(" ", 1), t2 = /* @__PURE__ */ ne(" ", 1); -function Uc(e, t) { - ue(t, !1); - const [n, r] = tt(), o = () => j(M, "$nodesDraggable", n), i = () => j(I, "$nodesConnectable", n), s = () => j(B, "$elementsSelectable", n), a = () => j(H, "$viewport", n), l = () => j(C, "$minZoom", n), u = () => j(P, "$maxZoom", n), c = te(), f = te(), d = te(), g = te(); - let p = w(t, "position", 12, "bottom-left"), x = w(t, "showZoom", 12, !0), k = w(t, "showFitView", 12, !0), E = w(t, "showLock", 12, !0), m = w(t, "buttonBgColor", 12, void 0), _ = w(t, "buttonBgColorHover", 12, void 0), v = w(t, "buttonColor", 12, void 0), b = w(t, "buttonColorHover", 12, void 0), N = w(t, "buttonBorderColor", 12, void 0), $ = w(t, "ariaLabel", 12, void 0), T = w(t, "style", 12, void 0), A = w(t, "orientation", 12, "vertical"), D = w(t, "fitViewOptions", 12, void 0), O = w(t, "class", 12, ""); - const { - zoomIn: V, - zoomOut: z, - fitView: S, - viewport: H, - minZoom: C, - maxZoom: P, - nodesDraggable: M, - nodesConnectable: I, - elementsSelectable: B - } = Ke(), F = { - bgColor: m(), - bgColorHover: _(), - color: v(), - colorHover: b(), - borderColor: N() - }, K = () => { - V(); - }, oe = () => { - z(); - }, J = () => { - S(D()); - }, W = () => { - G(c, !h(c)), M.set(h(c)), I.set(h(c)), B.set(h(c)); - }; - le( - () => (o(), i(), s()), - () => { - G(c, o() || i() || s()); - } - ), le(() => (a(), l()), () => { - G(f, a().zoom <= l()); - }), le(() => (a(), u()), () => { - G(d, a().zoom >= u()); - }), le(() => U(A()), () => { - G(g, A() === "horizontal" ? "horizontal" : "vertical"); - }), gt(), He(); - const de = /* @__PURE__ */ pe(() => $t([ - "svelte-flow__controls", - h(g), - O() - ])), we = /* @__PURE__ */ pe(() => $() ?? "Svelte Flow controls"); - Mo(e, { - get class() { - return h(de); - }, - get position() { - return p(); - }, - "data-testid": "svelte-flow__controls", - get "aria-label"() { - return h(we); - }, - get style() { - return T(); - }, - children: (fe, ze) => { - var ie = t2(), ge = _e(ie); - vt(ge, t, "before", {}); - var Ye = R(ge, 2); - { - var Ae = (qe) => { - var Re = e2(), Oe = _e(Re); - ro(Oe, ct( - { - class: "svelte-flow__controls-zoomin", - title: "zoom in", - "aria-label": "zoom in", - get disabled() { - return h(d); - } - }, - F, - { - $$events: { click: K }, - children: (nt, Q) => { - Wc(nt); - }, - $$slots: { default: !0 } - } - )); - var ut = R(Oe, 2); - ro(ut, ct( - { - class: "svelte-flow__controls-zoomout", - title: "zoom out", - "aria-label": "zoom out", - get disabled() { - return h(f); - } - }, - F, - { - $$events: { click: oe }, - children: (nt, Q) => { - Fc(nt); - }, - $$slots: { default: !0 } - } - )), L(qe, Re); - }; - be(Ye, (qe) => { - x() && qe(Ae); - }); - } - var Ze = R(Ye, 2); - { - var ee = (qe) => { - ro(qe, ct( - { - class: "svelte-flow__controls-fitview", - title: "fit view", - "aria-label": "fit view" - }, - F, - { - $$events: { click: J }, - children: (Re, Oe) => { - Kc(Re); - }, - $$slots: { default: !0 } - } - )); - }; - be(Ze, (qe) => { - k() && qe(ee); - }); - } - var he = R(Ze, 2); - { - var se = (qe) => { - ro(qe, ct( - { - class: "svelte-flow__controls-interactive", - title: "toggle interactivity", - "aria-label": "toggle interactivity" - }, - F, - { - $$events: { click: W }, - children: (Re, Oe) => { - var ut = et(), nt = _e(ut); - { - var Q = (ve) => { - Gc(ve); - }, Xe = (ve) => { - qc(ve); - }; - be(nt, (ve) => { - h(c) ? ve(Q) : ve(Xe, !1); - }); - } - L(Re, ut); - }, - $$slots: { default: !0 } - } - )); - }; - be(he, (qe) => { - E() && qe(se); - }); - } - var ke = R(he, 2); - vt(ke, t, "default", {}); - var Ne = R(ke, 2); - vt(Ne, t, "after", {}), L(fe, ie); - }, - $$slots: { default: !0 } - }); - var Ce = ce({ - get position() { - return p(); - }, - set position(fe) { - p(fe), y(); - }, - get showZoom() { - return x(); - }, - set showZoom(fe) { - x(fe), y(); - }, - get showFitView() { - return k(); - }, - set showFitView(fe) { - k(fe), y(); - }, - get showLock() { - return E(); - }, - set showLock(fe) { - E(fe), y(); - }, - get buttonBgColor() { - return m(); - }, - set buttonBgColor(fe) { - m(fe), y(); - }, - get buttonBgColorHover() { - return _(); - }, - set buttonBgColorHover(fe) { - _(fe), y(); - }, - get buttonColor() { - return v(); - }, - set buttonColor(fe) { - v(fe), y(); - }, - get buttonColorHover() { - return b(); - }, - set buttonColorHover(fe) { - b(fe), y(); - }, - get buttonBorderColor() { - return N(); - }, - set buttonBorderColor(fe) { - N(fe), y(); - }, - get ariaLabel() { - return $(); - }, - set ariaLabel(fe) { - $(fe), y(); - }, - get style() { - return T(); - }, - set style(fe) { - T(fe), y(); - }, - get orientation() { - return A(); - }, - set orientation(fe) { - A(fe), y(); - }, - get fitViewOptions() { - return D(); - }, - set fitViewOptions(fe) { - D(fe), y(); - }, - get class() { - return O(); - }, - set class(fe) { - O(fe), y(); - } - }); - return r(), Ce; -} -re( - Uc, - { - position: {}, - showZoom: {}, - showFitView: {}, - showLock: {}, - buttonBgColor: {}, - buttonBgColorHover: {}, - buttonColor: {}, - buttonColorHover: {}, - buttonBorderColor: {}, - ariaLabel: {}, - style: {}, - orientation: {}, - fitViewOptions: {}, - class: {} - }, - ["before", "default", "after"], - [], - !0 -); -var qn; -(function(e) { - e.Lines = "lines", e.Dots = "dots", e.Cross = "cross"; -})(qn || (qn = {})); -var n2 = /* @__PURE__ */ xe(""); -function jc(e, t) { - ue(t, !1); - let n = w(t, "radius", 12, 5), r = w(t, "class", 12, ""); - He(); - var o = n2(); - return $e( - (i) => { - ae(o, "cx", n()), ae(o, "cy", n()), ae(o, "r", n()), Ct(o, 0, _n(i)); - }, - [ - () => $t([ - "svelte-flow__background-pattern", - "dots", - r() - ]) - ], - pe - ), L(e, o), ce({ - get radius() { - return n(); - }, - set radius(i) { - n(i), y(); - }, - get class() { - return r(); - }, - set class(i) { - r(i), y(); - } - }); -} -re(jc, { radius: {}, class: {} }, [], [], !0); -var r2 = /* @__PURE__ */ xe(""); -function Jc(e, t) { - ue(t, !1); - let n = w(t, "lineWidth", 12, 1), r = w(t, "dimensions", 12), o = w(t, "variant", 12, void 0), i = w(t, "class", 12, ""); - He(); - var s = r2(); - return $e( - (a) => { - ae(s, "stroke-width", n()), ae(s, "d", `M${r()[0] / 2} 0 V${r()[1]} M0 ${r()[1] / 2} H${r()[0]}`), Ct(s, 0, _n(a)); - }, - [ - () => $t([ - "svelte-flow__background-pattern", - o(), - i() - ]) - ], - pe - ), L(e, s), ce({ - get lineWidth() { - return n(); - }, - set lineWidth(a) { - n(a), y(); - }, - get dimensions() { - return r(); - }, - set dimensions(a) { - r(a), y(); - }, - get variant() { - return o(); - }, - set variant(a) { - o(a), y(); - }, - get class() { - return i(); - }, - set class(a) { - i(a), y(); - } - }); -} -re( - Jc, - { - lineWidth: {}, - dimensions: {}, - variant: {}, - class: {} - }, - [], - [], - !0 -); -const o2 = { - [qn.Dots]: 1, - [qn.Lines]: 1, - [qn.Cross]: 6 -}; -var i2 = /* @__PURE__ */ xe(''); -const s2 = { - hash: "svelte-1r7pe8d", - code: ".svelte-flow__background.svelte-1r7pe8d {position:absolute;width:100%;height:100%;top:0;left:0;}" -}; -function Qc(e, t) { - ue(t, !1), je(e, s2); - const [n, r] = tt(), o = () => j(b, "$flowId", n), i = () => j(v, "$viewport", n), s = te(), a = te(), l = te(), u = te(), c = te(); - let f = w(t, "id", 12, void 0), d = w(t, "variant", 28, () => qn.Dots), g = w(t, "gap", 12, 20), p = w(t, "size", 12, 1), x = w(t, "lineWidth", 12, 1), k = w(t, "bgColor", 12, void 0), E = w(t, "patternColor", 12, void 0), m = w(t, "patternClass", 12, void 0), _ = w(t, "class", 12, ""); - const { viewport: v, flowId: b } = Ke(), N = p() || o2[d()], $ = d() === qn.Dots, T = d() === qn.Cross, A = Array.isArray(g()) ? g() : [g(), g()]; - le( - () => (o(), U(f())), - () => { - G(s, `background-pattern-${o()}-${f() ? f() : ""}`); - } - ), le(() => i(), () => { - G(a, [ - A[0] * i().zoom || 1, - A[1] * i().zoom || 1 - ]); - }), le(() => i(), () => { - G(l, N * i().zoom); - }), le(() => (h(l), h(a)), () => { - G(u, T ? [h(l), h(l)] : h(a)); - }), le( - () => (h(l), h(u)), - () => { - G(c, $ ? [ - h(l) / 2, - h(l) / 2 - ] : [ - h(u)[0] / 2, - h(u)[1] / 2 - ]); - } - ), gt(), He(); - var D = i2(), O = X(D), V = X(O); - { - var z = (P) => { - const M = /* @__PURE__ */ pe(() => h(l) / 2); - jc(P, { - get radius() { - return h(M); - }, - get class() { - return m(); - } - }); - }, S = (P) => { - Jc(P, { - get dimensions() { - return h(u); - }, - get variant() { - return d(); - }, - get lineWidth() { - return x(); - }, - get class() { - return m(); - } - }); - }; - be(V, (P) => { - $ ? P(z) : P(S, !1); - }); - } - Z(O); - var H = R(O); - Z(D), $e( - (P) => { - Ct(D, 0, _n(P), "svelte-1r7pe8d"), at(D, "--xy-background-color-props", k()), at(D, "--xy-background-pattern-color-props", E()), ae(O, "id", h(s)), ae(O, "x", i().x % h(a)[0]), ae(O, "y", i().y % h(a)[1]), ae(O, "width", h(a)[0]), ae(O, "height", h(a)[1]), ae(O, "patternTransform", `translate(-${h(c)[0]},-${h(c)[1]})`), ae(H, "fill", `url(#${h(s)})`); - }, - [ - () => $t(["svelte-flow__background", _()]) - ], - pe - ), L(e, D); - var C = ce({ - get id() { - return f(); - }, - set id(P) { - f(P), y(); - }, - get variant() { - return d(); - }, - set variant(P) { - d(P), y(); - }, - get gap() { - return g(); - }, - set gap(P) { - g(P), y(); - }, - get size() { - return p(); - }, - set size(P) { - p(P), y(); - }, - get lineWidth() { - return x(); - }, - set lineWidth(P) { - x(P), y(); - }, - get bgColor() { - return k(); - }, - set bgColor(P) { - k(P), y(); - }, - get patternColor() { - return E(); - }, - set patternColor(P) { - E(P), y(); - }, - get patternClass() { - return m(); - }, - set patternClass(P) { - m(P), y(); - }, - get class() { - return _(); - }, - set class(P) { - _(P), y(); - } - }); - return r(), C; -} -re( - Qc, - { - id: {}, - variant: {}, - gap: {}, - size: {}, - lineWidth: {}, - bgColor: {}, - patternColor: {}, - patternClass: {}, - class: {} - }, - [], - [], - !0 -); -var a2 = /* @__PURE__ */ xe(""); -function ed(e, t) { - ue(t, !1); - let n = w(t, "x", 12), r = w(t, "y", 12), o = w(t, "width", 12, 0), i = w(t, "height", 12, 0), s = w(t, "borderRadius", 12, 5), a = w(t, "color", 12, void 0), l = w(t, "shapeRendering", 12), u = w(t, "strokeColor", 12, void 0), c = w(t, "strokeWidth", 12, 2), f = w(t, "selected", 12, !1), d = w(t, "class", 12, ""); - He(); - var g = a2(); - let p; - return $e( - (x) => { - p = Ct(g, 0, _n(x), null, p, { selected: f() }), ae(g, "x", n()), ae(g, "y", r()), ae(g, "rx", s()), ae(g, "ry", s()), ae(g, "width", o()), ae(g, "height", i()), ae(g, "style", `${a() ? `fill: ${a()};` : ""}${u() ? `stroke: ${u()};` : ""}${c() ? `stroke-width: ${c()};` : ""}`), ae(g, "shape-rendering", l()); - }, - [ - () => $t(["svelte-flow__minimap-node", d()]) - ], - pe - ), L(e, g), ce({ - get x() { - return n(); - }, - set x(x) { - n(x), y(); - }, - get y() { - return r(); - }, - set y(x) { - r(x), y(); - }, - get width() { - return o(); - }, - set width(x) { - o(x), y(); - }, - get height() { - return i(); - }, - set height(x) { - i(x), y(); - }, - get borderRadius() { - return s(); - }, - set borderRadius(x) { - s(x), y(); - }, - get color() { - return a(); - }, - set color(x) { - a(x), y(); - }, - get shapeRendering() { - return l(); - }, - set shapeRendering(x) { - l(x), y(); - }, - get strokeColor() { - return u(); - }, - set strokeColor(x) { - u(x), y(); - }, - get strokeWidth() { - return c(); - }, - set strokeWidth(x) { - c(x), y(); - }, - get selected() { - return f(); - }, - set selected(x) { - f(x), y(); - }, - get class() { - return d(); - }, - set class(x) { - d(x), y(); - } - }); -} -re( - ed, - { - x: {}, - y: {}, - width: {}, - height: {}, - borderRadius: {}, - color: {}, - shapeRendering: {}, - strokeColor: {}, - strokeWidth: {}, - selected: {}, - class: {} - }, - [], - [], - !0 -); -function as(e, t) { - const n = W0({ - domNode: e, - panZoom: t.panZoom, - getTransform: () => { - const o = q(t.viewport); - return [o.x, o.y, o.zoom]; - }, - getViewScale: t.getViewScale - }); - function r(o) { - n.update({ - translateExtent: o.translateExtent, - width: o.width, - height: o.height, - inversePan: o.inversePan, - zoomStep: o.zoomStep, - pannable: o.pannable, - zoomable: o.zoomable - }); - } - return { - update: r, - destroy() { - n.destroy(); - } - }; -} -const ls = (e) => e instanceof Function ? e : () => e; -var l2 = /* @__PURE__ */ xe(" "), u2 = /* @__PURE__ */ xe(''); -function td(e, t) { - ue(t, !1); - const [n, r] = tt(), o = () => j(Ze, "$flowId", n), i = () => j(ge, "$viewport", n), s = () => j(Ye, "$containerWidth", n), a = () => j(Ae, "$containerHeight", n), l = () => j(ie, "$nodeLookup", n), u = () => j(ze, "$nodes", n), c = () => j(ee, "$panZoom", n), f = () => j(he, "$translateExtent", n), d = te(), g = te(), p = te(), x = te(), k = te(), E = te(), m = te(), _ = te(), v = te(), b = te(), N = te(), $ = te(), T = te(); - let A = w(t, "position", 12, "bottom-right"), D = w(t, "ariaLabel", 12, "Mini map"), O = w(t, "nodeStrokeColor", 12, "transparent"), V = w(t, "nodeColor", 12, void 0), z = w(t, "nodeClass", 12, ""), S = w(t, "nodeBorderRadius", 12, 5), H = w(t, "nodeStrokeWidth", 12, 2), C = w(t, "bgColor", 12, void 0), P = w(t, "maskColor", 12, void 0), M = w(t, "maskStrokeColor", 12, void 0), I = w(t, "maskStrokeWidth", 12, void 0), B = w(t, "width", 12, void 0), F = w(t, "height", 12, void 0), K = w(t, "pannable", 12, !0), oe = w(t, "zoomable", 12, !0), J = w(t, "inversePan", 12, void 0), W = w(t, "zoomStep", 12, void 0), de = w(t, "style", 12, ""), we = w(t, "class", 12, ""); - const Ce = 200, fe = 150, { - nodes: ze, - nodeLookup: ie, - viewport: ge, - width: Ye, - height: Ae, - flowId: Ze, - panZoom: ee, - translateExtent: he - } = Ke(), se = V() === void 0 ? void 0 : ls(V()), ke = ls(O()), Ne = ls(z()), qe = ( - // @ts-expect-error - TS doesn't know about chrome - typeof window > "u" || window.chrome ? "crispEdges" : "geometricPrecision" - ), Re = `svelte-flow__minimap-desc-${o()}`; - let Oe = te(h(d)); - const ut = () => h(E); - le( - () => (i(), s(), a()), - () => { - G(d, { - x: -i().x / i().zoom, - y: -i().y / i().zoom, - width: s() / i().zoom, - height: a() / i().zoom - }); - } - ), le( - () => (l(), h(d), u()), - () => { - G(Oe, l().size > 0 ? ec(Po(l()), h(d)) : h(d)), u(); - } - ), le(() => U(B()), () => { - G(g, B() ?? Ce); - }), le(() => U(F()), () => { - G(p, F() ?? fe); - }), le( - () => (h(Oe), h(g)), - () => { - G(x, h(Oe).width / h(g)); - } - ), le( - () => (h(Oe), h(p)), - () => { - G(k, h(Oe).height / h(p)); - } - ), le( - () => (h(x), h(k)), - () => { - G(E, Math.max(h(x), h(k))); - } - ), le(() => (h(E), h(g)), () => { - G(m, h(E) * h(g)); - }), le( - () => (h(E), h(p)), - () => { - G(_, h(E) * h(p)); - } - ), le(() => h(E), () => { - G(v, 5 * h(E)); - }), le( - () => (h(Oe), h(m), h(v)), - () => { - G(b, h(Oe).x - (h(m) - h(Oe).width) / 2 - h(v)); - } - ), le( - () => (h(Oe), h(_), h(v)), - () => { - G(N, h(Oe).y - (h(_) - h(Oe).height) / 2 - h(v)); - } - ), le(() => (h(m), h(v)), () => { - G($, h(m) + h(v) * 2); - }), le(() => (h(_), h(v)), () => { - G(T, h(_) + h(v) * 2); - }), gt(), He(); - const nt = /* @__PURE__ */ pe(() => de() + (C() ? `;--xy-minimap-background-color-props:${C()}` : "")), Q = /* @__PURE__ */ pe(() => $t(["svelte-flow__minimap", we()])); - Mo(e, { - get position() { - return A(); - }, - get style() { - return h(nt); - }, - get class() { - return h(Q); - }, - "data-testid": "svelte-flow__minimap", - children: (ve, ln) => { - var Gt = et(), un = _e(Gt); - { - var Pe = (ot) => { - var me = u2(); - ae(me, "aria-labelledby", Re); - var it = X(me); - { - var lt = (Dt) => { - var St = l2(); - ae(St, "id", Re); - var cn = X(St, !0); - Z(St), $e(() => wn(cn, D())), L(Dt, St); - }; - be(it, (Dt) => { - D() && Dt(lt); - }); - } - var Yt = R(it); - zt(Yt, 1, u, (Dt) => Dt.id, (Dt, St) => { - var cn = et(); - const Ut = /* @__PURE__ */ pe(() => l().get(h(St).id)); - var ft = _e(cn); - { - var Ui = (tr) => { - const jt = /* @__PURE__ */ pe(() => Qn(h(Ut))), Oo = /* @__PURE__ */ pe(() => se == null ? void 0 : se(h(Ut))), Lo = /* @__PURE__ */ pe(() => ke(h(Ut))), Io = /* @__PURE__ */ pe(() => Ne(h(Ut))); - ed(tr, ct( - { - get x() { - return h(Ut).internals.positionAbsolute.x; - }, - get y() { - return h(Ut).internals.positionAbsolute.y; - } - }, - () => h(jt), - { - get selected() { - return h(Ut).selected; - }, - get color() { - return h(Oo); - }, - get borderRadius() { - return S(); - }, - get strokeColor() { - return h(Lo); - }, - get strokeWidth() { - return H(); - }, - shapeRendering: qe, - get class() { - return h(Io); - } - } - )); - }; - be(ft, (tr) => { - h(Ut) && nc(h(Ut)) && tr(Ui); - }); - } - L(Dt, cn); - }); - var Kr = R(Yt); - Z(me), ht(me, (Dt, St) => as == null ? void 0 : as(Dt, St), () => ({ - panZoom: c(), - viewport: ge, - getViewScale: ut, - translateExtent: f(), - width: s(), - height: a(), - inversePan: J(), - zoomStep: W(), - pannable: K(), - zoomable: oe() - })), $e(() => { - ae(me, "width", h(g)), ae(me, "height", h(p)), ae(me, "viewBox", `${h(b) ?? ""} ${h(N) ?? ""} ${h($) ?? ""} ${h(T) ?? ""}`), at(me, "--xy-minimap-mask-background-color-props", P()), at(me, "--xy-minimap-mask-stroke-color-props", M()), at(me, "--xy-minimap-mask-stroke-width-props", I() ? I() * h(E) : void 0), ae(Kr, "d", `M${h(b) - h(v)},${h(N) - h(v)}h${h($) + h(v) * 2}v${h(T) + h(v) * 2}h${-h($) - h(v) * 2}z - M${h(d).x ?? ""},${h(d).y ?? ""}h${h(d).width ?? ""}v${h(d).height ?? ""}h${-h(d).width}z`); - }), L(ot, me); - }; - be(un, (ot) => { - c() && ot(Pe); - }); - } - L(ve, Gt); - }, - $$slots: { default: !0 } - }); - var Xe = ce({ - get position() { - return A(); - }, - set position(ve) { - A(ve), y(); - }, - get ariaLabel() { - return D(); - }, - set ariaLabel(ve) { - D(ve), y(); - }, - get nodeStrokeColor() { - return O(); - }, - set nodeStrokeColor(ve) { - O(ve), y(); - }, - get nodeColor() { - return V(); - }, - set nodeColor(ve) { - V(ve), y(); - }, - get nodeClass() { - return z(); - }, - set nodeClass(ve) { - z(ve), y(); - }, - get nodeBorderRadius() { - return S(); - }, - set nodeBorderRadius(ve) { - S(ve), y(); - }, - get nodeStrokeWidth() { - return H(); - }, - set nodeStrokeWidth(ve) { - H(ve), y(); - }, - get bgColor() { - return C(); - }, - set bgColor(ve) { - C(ve), y(); - }, - get maskColor() { - return P(); - }, - set maskColor(ve) { - P(ve), y(); - }, - get maskStrokeColor() { - return M(); - }, - set maskStrokeColor(ve) { - M(ve), y(); - }, - get maskStrokeWidth() { - return I(); - }, - set maskStrokeWidth(ve) { - I(ve), y(); - }, - get width() { - return B(); - }, - set width(ve) { - B(ve), y(); - }, - get height() { - return F(); - }, - set height(ve) { - F(ve), y(); - }, - get pannable() { - return K(); - }, - set pannable(ve) { - K(ve), y(); - }, - get zoomable() { - return oe(); - }, - set zoomable(ve) { - oe(ve), y(); - }, - get inversePan() { - return J(); - }, - set inversePan(ve) { - J(ve), y(); - }, - get zoomStep() { - return W(); - }, - set zoomStep(ve) { - W(ve), y(); - }, - get style() { - return de(); - }, - set style(ve) { - de(ve), y(); - }, - get class() { - return we(); - }, - set class(ve) { - we(ve), y(); - } - }); - return r(), Xe; -} -re( - td, - { - position: {}, - ariaLabel: {}, - nodeStrokeColor: {}, - nodeColor: {}, - nodeClass: {}, - nodeBorderRadius: {}, - nodeStrokeWidth: {}, - bgColor: {}, - maskColor: {}, - maskStrokeColor: {}, - maskStrokeWidth: {}, - width: {}, - height: {}, - pannable: {}, - zoomable: {}, - inversePan: {}, - zoomStep: {}, - style: {}, - class: {} - }, - [], - [], - !0 -); -const El = (e) => u0(e); -function Bt() { - const { zoomIn: e, zoomOut: t, fitView: n, onbeforedelete: r, snapGrid: o, viewport: i, width: s, height: a, minZoom: l, maxZoom: u, panZoom: c, nodes: f, edges: d, domNode: g, nodeLookup: p, nodeOrigin: x, edgeLookup: k, connectionLookup: E } = Ke(), m = (b) => { - var D, O; - const N = q(p), $ = El(b) ? b : N.get(b.id), T = $.parentId ? g0($.position, $.measured, $.parentId, N, q(x)) : $.position, A = { - ...$, - position: T, - width: ((D = $.measured) == null ? void 0 : D.width) ?? $.width, - height: ((O = $.measured) == null ? void 0 : O.height) ?? $.height - }; - return Or(A); - }, _ = (b, N, $ = { replace: !1 }) => { - var D; - const T = (D = q(p).get(b)) == null ? void 0 : D.internals.userNode; - if (!T) - return; - const A = typeof N == "function" ? N(T) : N; - $.replace ? f.update((O) => O.map((V) => V.id === b ? El(A) ? A : { ...V, ...A } : V)) : (Object.assign(T, A), f.update((O) => O)); - }, v = (b) => q(p).get(b); - return { - zoomIn: e, - zoomOut: t, - getInternalNode: v, - getNode: (b) => { - var N; - return (N = v(b)) == null ? void 0 : N.internals.userNode; - }, - getNodes: (b) => b === void 0 ? q(f) : $l(q(p), b), - getEdge: (b) => q(k).get(b), - getEdges: (b) => b === void 0 ? q(d) : $l(q(k), b), - setZoom: (b, N) => { - const $ = q(c); - return $ ? $.scaleTo(b, { duration: N == null ? void 0 : N.duration }) : Promise.resolve(!1); - }, - getZoom: () => q(i).zoom, - setViewport: async (b, N) => { - const $ = q(i), T = q(c); - return T ? (await T.setViewport({ - x: b.x ?? $.x, - y: b.y ?? $.y, - zoom: b.zoom ?? $.zoom - }, { duration: N == null ? void 0 : N.duration }), Promise.resolve(!0)) : Promise.resolve(!1); - }, - getViewport: () => q(i), - setCenter: async (b, N, $) => { - const T = typeof ($ == null ? void 0 : $.zoom) < "u" ? $.zoom : q(u), A = q(c); - return A ? (await A.setViewport({ - x: q(s) / 2 - b * T, - y: q(a) / 2 - N * T, - zoom: T - }, { duration: $ == null ? void 0 : $.duration }), Promise.resolve(!0)) : Promise.resolve(!1); - }, - fitView: n, - fitBounds: async (b, N) => { - const $ = q(c); - if (!$) - return Promise.resolve(!1); - const T = sa(b, q(s), q(a), q(l), q(u), (N == null ? void 0 : N.padding) ?? 0.1); - return await $.setViewport(T, { duration: N == null ? void 0 : N.duration }), Promise.resolve(!0); - }, - getIntersectingNodes: (b, N = !0, $) => { - const T = ul(b), A = T ? b : m(b); - return A ? ($ || q(f)).filter((D) => { - const O = q(p).get(D.id); - if (!O || !T && D.id === b.id) - return !1; - const V = Or(O), z = mo(V, A); - return N && z > 0 || z >= A.width * A.height; - }) : []; - }, - isNodeIntersecting: (b, N, $ = !0) => { - const A = ul(b) ? b : m(b); - if (!A) - return !1; - const D = mo(A, N); - return $ && D > 0 || D >= A.width * A.height; - }, - deleteElements: async ({ nodes: b = [], edges: N = [] }) => { - const { nodes: $, edges: T } = await ju({ - nodesToRemove: b, - edgesToRemove: N, - nodes: q(f), - edges: q(d), - onBeforeDelete: q(r) - }); - return $ && f.update((A) => A.filter((D) => !$.some(({ id: O }) => O === D.id))), T && d.update((A) => A.filter((D) => !T.some(({ id: O }) => O === D.id))), { - deletedNodes: $, - deletedEdges: T - }; - }, - screenToFlowPosition: (b, N = { snapToGrid: !0 }) => { - const $ = q(g); - if (!$) - return b; - const T = N.snapToGrid ? q(o) : !1, { x: A, y: D, zoom: O } = q(i), { x: V, y: z } = $.getBoundingClientRect(), S = { - x: b.x - V, - y: b.y - z - }; - return No(S, [A, D, O], T !== null, T || [1, 1]); - }, - /** - * - * @param position - * @returns - */ - flowToScreenPosition: (b) => { - const N = q(g); - if (!N) - return b; - const { x: $, y: T, zoom: A } = q(i), { x: D, y: O } = N.getBoundingClientRect(), V = tc(b, [$, T, A]); - return { - x: V.x + D, - y: V.y + O - }; - }, - toObject: () => ({ - nodes: q(f).map((b) => ({ - ...b, - // we want to make sure that changes to the nodes object that gets returned by toObject - // do not affect the nodes object - position: { ...b.position }, - data: { ...b.data } - })), - edges: q(d).map((b) => ({ ...b })), - viewport: { ...q(i) } - }), - updateNode: _, - updateNodeData: (b, N, $) => { - var D; - const T = (D = q(p).get(b)) == null ? void 0 : D.internals.userNode; - if (!T) - return; - const A = typeof N == "function" ? N(T) : N; - T.data = $ != null && $.replace ? A : { ...T.data, ...A }, f.update((O) => O); - }, - getNodesBounds: (b) => { - const N = q(p), $ = q(x); - return c0(b, { nodeLookup: N, nodeOrigin: $ }); - }, - getHandleConnections: ({ type: b, id: N, nodeId: $ }) => { - var T; - return Array.from(((T = q(E).get(`${$}-${b}-${N ?? null}`)) == null ? void 0 : T.values()) ?? []); - }, - viewport: i - }; -} -function $l(e, t) { - var r; - const n = []; - for (const o of t) { - const i = e.get(o); - if (i) { - const s = "internals" in i ? (r = i.internals) == null ? void 0 : r.userNode : i; - n.push(s); - } - } - return n; -} -var c2 = /* @__PURE__ */ ne('
'); -function nd(e, t) { - ue(t, !1); - const [n, r] = tt(), o = () => j(_, "$nodes", n), i = () => j(m, "$nodeLookup", n), s = () => j(E, "$viewport", n), a = () => j(k, "$domNode", n), l = te(), u = te(), c = te(); - let f = w(t, "nodeId", 12, void 0), d = w(t, "position", 12, void 0), g = w(t, "align", 12, void 0), p = w(t, "offset", 12, void 0), x = w(t, "isVisible", 12, void 0); - const { domNode: k, viewport: E, nodeLookup: m, nodes: _ } = Ke(), { getNodesBounds: v } = Bt(), b = ar("svelteflow__node_id"); - let N = te(), $ = te([]), T = p() !== void 0 ? p() : 10, A = d() !== void 0 ? d() : Ee.Top, D = g() !== void 0 ? g() : "center"; - le( - () => (o(), U(f()), i()), - () => { - o(); - const H = Array.isArray(f()) ? f() : [f() || b]; - G($, H.reduce( - (C, P) => { - const M = i().get(P); - return M && C.push(M), C; - }, - [] - )); - } - ), le( - () => (h($), s()), - () => { - const H = v(h($)); - H && G(N, P0(H, s(), A, T, D)); - } - ), le(() => h($), () => { - G(l, h($).length === 0 ? 1 : Math.max(...h($).map((H) => (H.internals.z || 5) + 1))); - }), le(() => o(), () => { - G(u, o().filter((H) => H.selected).length); - }), le( - () => (U(x()), h($), h(u)), - () => { - G(c, typeof x() == "boolean" ? x() : h($).length === 1 && h($)[0].selected && h(u) === 1); - } - ), gt(), He(); - var O = et(), V = _e(O); - { - var z = (H) => { - var C = c2(), P = X(C); - vt(P, t, "default", {}), Z(C), ht(C, (M, I) => kr == null ? void 0 : kr(M, I), () => ({ domNode: a() })), $e( - (M) => { - ae(C, "data-id", M), at(C, "position", "absolute"), at(C, "transform", h(N)), at(C, "z-index", h(l)); - }, - [ - () => h($).reduce((M, I) => `${M}${I.id} `, "").trim() - ], - pe - ), L(H, C); - }; - be(V, (H) => { - a() && h(c) && h($) && H(z); - }); - } - L(e, O); - var S = ce({ - get nodeId() { - return f(); - }, - set nodeId(H) { - f(H), y(); - }, - get position() { - return d(); - }, - set position(H) { - d(H), y(); - }, - get align() { - return g(); - }, - set align(H) { - g(H), y(); - }, - get offset() { - return p(); - }, - set offset(H) { - p(H), y(); - }, - get isVisible() { - return x(); - }, - set isVisible(H) { - x(H), y(); - } - }); - return r(), S; -} -re( - nd, - { - nodeId: {}, - position: {}, - align: {}, - offset: {}, - isVisible: {} - }, - ["default"], - [], - !0 -); -function pr(e) { - const { nodes: t, nodeLookup: n } = Ke(); - let r = [], o = !0; - return Fn([t, n], ([, i], s) => { - var c; - const a = [], l = Array.isArray(e), u = l ? e : [e]; - for (const f of u) { - const d = (c = i.get(f)) == null ? void 0 : c.internals.userNode; - d && a.push({ - id: d.id, - type: d.type, - data: d.data - }); - } - (!O0(a, r) || o) && (r = a, s(l ? a : a[0] ?? null), o = !1); - }); -} -const Sl = "tinyflow-component"; -class cw { - constructor(t) { - yt(this, "options"); - yt(this, "rootEl"); - yt(this, "svelteFlowInstance"); - if (typeof t.element != "string" && !(t.element instanceof Element)) - throw new Error("element must be a string or Element"); - this._setOptions(t), this._init(); - } - _init() { - if (typeof this.options.element == "string") { - if (this.rootEl = document.querySelector(this.options.element), !this.rootEl) - throw new Error( - `element not found by document.querySelector('${this.options.element}')` - ); - } else if (this.options.element instanceof Element) - this.rootEl = this.options.element; - else - throw new Error("element must be a string or Element"); - const t = document.createElement(Sl); - t.style.display = "block", t.style.width = "100%", t.style.height = "100%", t.classList.add("tf-theme-light"), t.options = this.options, t.onInit = (n) => { - this.svelteFlowInstance = n; - }, this.rootEl.appendChild(t); - } - _setOptions(t) { - this.options = { - ...t - }; - } - getOptions() { - return this.options; - } - getData() { - return this.svelteFlowInstance.toObject(); - } - setData(t) { - this.options.data = t; - const n = document.createElement(Sl); - n.style.display = "block", n.style.width = "100%", n.style.height = "100%", n.classList.add("tf-theme-light"), n.options = this.options, n.onInit = (r) => { - this.svelteFlowInstance = r; - }, this.destroy(), this.rootEl.appendChild(n); - } - destroy() { - for (; this.rootEl.firstChild; ) - this.rootEl.removeChild(this.rootEl.firstChild); - } -} -const d2 = () => { - const e = ye([]), t = ye([]), n = ye({ x: 250, y: 100, zoom: 1 }); - return { - nodes: e, - edges: t, - viewport: n, - init: (r, o) => { - e.set(r), t.set(o); - }, - addNode: (r) => { - e.update((o) => [...o, r]); - }, - removeNode: (r) => { - e.update((o) => o.filter((i) => i.id !== r)); - }, - updateNode: (r, o) => { - e.update((i) => i.map((s) => s.id === r ? o : s)); - }, - updateNodeData: (r, o) => { - e.update( - (i) => i.map((s) => s.id === r ? { ...s, data: { ...s.data, ...o } } : s) - ); - }, - selectNodeOnly: (r) => { - e.update( - (o) => o.map( - (i) => i.id === r ? { ...i, selected: !0 } : { ...i, selected: !1 } - ) - ); - }, - addEdge: (r) => { - t.update((o) => [...o, r]); - }, - removeEdge: (r) => { - t.update((o) => o.filter((i) => i.id !== r)); - }, - updateEdge: (r, o) => { - t.update((i) => i.map((s) => s.id === r ? o : s)); - }, - updateEdgeData: (r, o) => { - t.update((i) => i.map((s) => s.id === r ? { ...s, data: o } : s)); - } - }; -}, Jo = d2(); -var f2 = /* @__PURE__ */ ne(""); -function Ge(e, t) { - ue(t, !0); - const n = w(t, "children", 7), r = /* @__PURE__ */ Et(t, [ - "$$slots", - "$$events", - "$$legacy", - "$$host", - "children" - ]); - var o = f2(); - let i; - var s = X(o); - return lr(s, () => n() ?? dt), Z(o), $e(() => i = rn(o, i, { - type: "button", - ...r, - class: `tf-btn nopan nodrag ${t.class ?? ""}` - })), L(e, o), ce({ - get children() { - return n(); - }, - set children(a) { - n(a), y(); - } - }); -} -re(Ge, { children: {} }, [], [], !0); -var g2 = /* @__PURE__ */ ne(""); -function rd(e, t) { - ue(t, !0); - const n = /* @__PURE__ */ Et(t, ["$$slots", "$$events", "$$legacy", "$$host"]); - var r = g2(); - mu(r); - let o; - $e(() => o = rn(r, o, { - type: "checkbox", - ...n, - class: `tf-checkbox nopan nodrag ${t.class ?? ""}` - })), L(e, r), ce(); -} -re(rd, {}, [], [], !0); -var h2 = /* @__PURE__ */ ne(""); -function _t(e, t) { - ue(t, !0); - const n = /* @__PURE__ */ Et(t, ["$$slots", "$$events", "$$legacy", "$$host"]); - var r = h2(); - mu(r); - let o; - $e(() => o = rn(r, o, { - type: "text", - ...n, - class: `tf-input nopan nodrag ${t.class ?? ""}` - })), L(e, r), ce(); -} -re(_t, {}, [], [], !0); -var v2 = /* @__PURE__ */ ne(""); -function kt(e, t) { - ue(t, !0); - const n = /* @__PURE__ */ Et(t, ["$$slots", "$$events", "$$legacy", "$$host"]); - var r = v2(); - i1(r); - let o; - $e(() => o = rn(r, o, { - ...n, - class: `tf-textarea nodrag ${t.class ?? ""}` - })), L(e, r), ce(); -} -re(kt, {}, [], [], !0); -var p2 = /* @__PURE__ */ ne('
'), m2 = /* @__PURE__ */ ne("
"); -function od(e, t) { - const n = rt(t, [ - "children", - "$$slots", - "$$events", - "$$legacy", - "$$host" - ]), r = rt(n, ["items", "onChange", "activeIndex"]); - ue(t, !1); - let o = w(t, "items", 28, () => []), i = w(t, "onChange", 12, () => { - }), s = w(t, "activeIndex", 12, 0); - function a(c, f) { - var d; - s(f), (d = i()) == null || d(c, f); - } - He(); - var l = m2(); - let u; - return zt(l, 5, o, Ai, (c, f, d) => { - var g = p2(); - ae(g, "tabindex", d), g.__click = () => a(h(f), d), g.__keydown = (E) => { - (E.key === "Enter" || E.key === " ") && (E.preventDefault(), a(h(f), d)); - }; - var p = X(g); - { - var x = (E) => { - var m = Ie(); - $e(() => wn(m, h(f).label)), L(E, m); - }, k = (E) => { - var m = et(), _ = _e(m); - lr(_, () => h(f).label ?? dt), L(E, m); - }; - be(p, (E) => { - typeof h(f).label == "string" ? E(x) : E(k, !1); - }); - } - Z(g), $e(() => Ct(g, 1, `tf-tabs-item ${(d === s() ? "active" : "") ?? ""}`)), L(c, g); - }), Z(l), $e(() => u = rn(l, u, { - ...r, - class: `tf-tabs ${r.class ?? ""}` - })), L(e, l), ce({ - get items() { - return o(); - }, - set items(c) { - o(c), y(); - }, - get onChange() { - return i(); - }, - set onChange(c) { - i(c), y(); - }, - get activeIndex() { - return s(); - }, - set activeIndex(c) { - s(c), y(); - } - }); -} -Di(["click", "keydown"]); -re(od, { items: {}, onChange: {}, activeIndex: {} }, [], [], !0); -var y2 = (e, t, n) => t(h(n)), w2 = (e, t, n) => { - (e.key === "Enter" || e.key === " ") && (e.preventDefault(), t(h(n))); -}, _2 = /* @__PURE__ */ ne(''), x2 = /* @__PURE__ */ ne('
'), b2 = /* @__PURE__ */ ne('
'), C2 = /* @__PURE__ */ ne('
'), k2 = /* @__PURE__ */ ne("
"); -const E2 = { - hash: "svelte-1jfktzw", - code: ` - /* 定义旋转的 CSS 类 */.rotate-90.svelte-1jfktzw {transform:rotate(90deg);transition:transform 0.3s ease;}` -}; -function id(e, t) { - ue(t, !0), je(e, E2); - let n = w(t, "items", 7), r = w(t, "onChange", 7), o = w(t, "activeKeys", 31, () => Vt([])); - function i(a) { - var l; - o().includes(a.key) ? o(o().filter((u) => u !== a.key)) : (o().push(a.key), o(o())), (l = r()) == null || l(a, o()); - } - var s = k2(); - return zt(s, 21, n, Ai, (a, l, u) => { - var c = C2(), f = X(c); - ae(f, "tabindex", u), f.__click = [y2, i, l], f.__keydown = [w2, i, l]; - var d = X(f); - { - var g = (v) => { - var b = _2(), N = X(b); - Xn(N, { - get target() { - return h(l).icon; - } - }), Z(b), L(v, b); - }; - be(d, (v) => { - h(l).icon && v(g); - }); - } - var p = R(d, 2); - Xn(p, { - get target() { - return h(l).title; - } - }); - var x = R(p, 2); - Z(f); - var k = R(f, 2); - { - var E = (v) => { - var b = x2(), N = X(b); - Xn(N, { - get target() { - return h(l).description; - } - }), Z(b), L(v, b); - }; - be(k, (v) => { - h(l).description && v(E); - }); - } - var m = R(k, 2); - { - var _ = (v) => { - var b = b2(), N = X(b); - Xn(N, { - get target() { - return h(l).content; - } - }), Z(b), L(v, b); - }; - be(m, (v) => { - o().includes(h(l).key) && v(_); - }); - } - Z(c), $e((v) => Ct(x, 1, `tf-collapse-item-title-arrow ${v ?? ""}`, "svelte-1jfktzw"), [ - () => o().includes(h(l).key) ? "rotate-90" : "" - ]), L(a, c); - }), Z(s), $e(() => { - ae(s, "style", t.style), Ct(s, 1, `tf-collapse ${t.class ?? ""}`, "svelte-1jfktzw"); - }), L(e, s), ce({ - get items() { - return n(); - }, - set items(a) { - n(a), y(); - }, - get onChange() { - return r(); - }, - set onChange(a) { - r(a), y(); - }, - get activeKeys() { - return o(); - }, - set activeKeys(a = []) { - o(a), y(); - } - }); -} -Di(["click", "keydown"]); -re(id, { items: {}, onChange: {}, activeKeys: {} }, [], [], !0); -function Xn(e, t) { - ue(t, !0); - let n = w(t, "target", 7); - typeof n() > "u" && n("undefined"); - var r = et(), o = _e(r); - { - var i = (a) => { - var l = et(), u = _e(l); - lr(u, () => n() ?? dt), L(a, l); - }, s = (a) => { - var l = et(), u = _e(l); - hu(u, n), L(a, l); - }; - be(o, (a) => { - typeof n() == "function" ? a(i) : a(s, !1); - }); - } - return L(e, r), ce({ - get target() { - return n(); - }, - set target(a) { - n(a), y(); - } - }); -} -re(Xn, { target: {} }, [], [], !0); -var $2 = (e, t, n) => t(h(n)), S2 = /* @__PURE__ */ xe(''), P2 = /* @__PURE__ */ ne('
'), N2 = /* @__PURE__ */ ne(' ', 1), T2 = /* @__PURE__ */ ne('
'), M2 = /* @__PURE__ */ ne(" ", 1), H2 = /* @__PURE__ */ ne('
'), D2 = /* @__PURE__ */ ne(''), A2 = /* @__PURE__ */ ne("
"); -function pn(e, t) { - ue(t, !0); - const n = (_, v = dt) => { - var b = et(), N = _e(b); - zt(N, 19, v, ($, T) => `${T}_${$.value}`, ($, T) => { - var A = N2(), D = _e(A); - D.__click = [$2, x, T]; - var O = X(D), V = X(O); - { - var z = (P) => { - var M = S2(); - L(P, M); - }; - be(V, (P) => { - h(T).children && h(T).children.length > 0 && P(z); - }); - } - Z(O); - var S = R(O, 2); - Xn(S, { - get target() { - return h(T).label; - } - }), Z(D); - var H = R(D, 2); - { - var C = (P) => { - var M = P2(), I = X(M); - n(I, () => h(T).children), Z(M), L(P, M); - }; - be(H, (P) => { - h(T).children && h(T).children.length > 0 && (l() || c().includes(h(T).value)) && P(C); - }); - } - L($, A); - }), L(_, b); - }; - let r = w(t, "items", 7), o = w(t, "onExpand", 7), i = w(t, "onSelect", 7), s = w(t, "value", 23, () => []), a = w(t, "defaultValue", 23, () => []), l = w(t, "expandAll", 7, !0), u = w(t, "multiple", 7, !1), c = w(t, "expandValue", 23, () => []), f = w(t, "placeholder", 7), d = /* @__PURE__ */ Et(t, [ - "$$slots", - "$$events", - "$$legacy", - "$$host", - "items", - "onExpand", - "onSelect", - "value", - "defaultValue", - "expandAll", - "multiple", - "expandValue", - "placeholder" - ]), g = /* @__PURE__ */ Me(() => { - const _ = [], v = (b) => { - for (let N of b) - s().length > 0 ? s().includes(N.value) && _.push(N) : a().includes(N.value) && _.push(N), N.children && N.children.length > 0 && v(N.children); - }; - return v(r()), _; - }), p; - function x(_) { - var v, b; - if (_.children && _.children.length > 0) { - (v = o()) == null || v(_); - return; - } else - p == null || p.hide(), (b = i()) == null || b(_); - } - var k = A2(); - let E; - var m = X(k); - return An( - Vo(m, { - floating: (v) => { - var b = T2(), N = X(b); - n(N, r), Z(b), L(v, b); - }, - children: (v, b) => { - var N = D2(); - let $; - var T = X(N); - zt( - T, - 23, - () => h(g), - (A, D) => `${D}_${A.value}`, - (A, D, O) => { - var V = et(), z = _e(V); - { - var S = (C) => { - var P = et(), M = _e(P); - { - var I = (B) => { - Xn(B, { - get target() { - return h(D).label; - } - }); - }; - be(M, (B) => { - h(O) === 0 && B(I); - }); - } - L(C, P); - }, H = (C) => { - var P = M2(), M = _e(P); - Xn(M, { - get target() { - return h(D).label; - } - }); - var I = R(M, 2); - { - var B = (F) => { - var K = Ie(","); - L(F, K); - }; - be(I, (F) => { - h(O) < h(g).length - 1 && F(B); - }); - } - L(C, P); - }; - be(z, (C) => { - u() ? C(H, !1) : C(S); - }); - } - L(A, V); - }, - (A) => { - var D = H2(), O = X(D, !0); - Z(D), $e(() => wn(O, f())), L(A, D); - } - ), Z(T), Te(2), Z(N), $e(() => $ = rn(N, $, { - class: "tf-select-input nopan nodrag", - ...d - })), L(v, N); - }, - $$slots: { floating: !0, default: !0 } - }), - (v) => p = v, - () => p - ), Z(k), $e(() => E = rn(k, E, { - ...d, - class: `tf-select ${d.class ?? ""}` - })), L(e, k), ce({ - get items() { - return r(); - }, - set items(_) { - r(_), y(); - }, - get onExpand() { - return o(); - }, - set onExpand(_) { - o(_), y(); - }, - get onSelect() { - return i(); - }, - set onSelect(_) { - i(_), y(); - }, - get value() { - return s(); - }, - set value(_ = []) { - s(_), y(); - }, - get defaultValue() { - return a(); - }, - set defaultValue(_ = []) { - a(_), y(); - }, - get expandAll() { - return l(); - }, - set expandAll(_ = !0) { - l(_), y(); - }, - get multiple() { - return u(); - }, - set multiple(_ = !1) { - u(_), y(); - }, - get expandValue() { - return c(); - }, - set expandValue(_ = []) { - c(_), y(); - }, - get placeholder() { - return f(); - }, - set placeholder(_) { - f(_), y(); - } - }); -} -Di(["click"]); -re( - pn, - { - items: {}, - onExpand: {}, - onSelect: {}, - value: {}, - defaultValue: {}, - expandAll: {}, - multiple: {}, - expandValue: {}, - placeholder: {} - }, - [], - [], - !0 -); -const wo = Math.min, $r = Math.max, _i = Math.round, gn = (e) => ({ - x: e, - y: e -}), V2 = { - left: "right", - right: "left", - bottom: "top", - top: "bottom" -}, O2 = { - start: "end", - end: "start" -}; -function Ms(e, t, n) { - return $r(e, wo(t, n)); -} -function Ho(e, t) { - return typeof e == "function" ? e(t) : e; -} -function fr(e) { - return e.split("-")[0]; -} -function Do(e) { - return e.split("-")[1]; -} -function sd(e) { - return e === "x" ? "y" : "x"; -} -function fa(e) { - return e === "y" ? "height" : "width"; -} -function Ir(e) { - return ["top", "bottom"].includes(fr(e)) ? "y" : "x"; -} -function ga(e) { - return sd(Ir(e)); -} -function L2(e, t, n) { - n === void 0 && (n = !1); - const r = Do(e), o = ga(e), i = fa(o); - let s = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top"; - return t.reference[i] > t.floating[i] && (s = xi(s)), [s, xi(s)]; -} -function I2(e) { - const t = xi(e); - return [Hs(e), t, Hs(t)]; -} -function Hs(e) { - return e.replace(/start|end/g, (t) => O2[t]); -} -function z2(e, t, n) { - const r = ["left", "right"], o = ["right", "left"], i = ["top", "bottom"], s = ["bottom", "top"]; - switch (e) { - case "top": - case "bottom": - return n ? t ? o : r : t ? r : o; - case "left": - case "right": - return t ? i : s; - default: - return []; - } -} -function R2(e, t, n, r) { - const o = Do(e); - let i = z2(fr(e), n === "start", r); - return o && (i = i.map((s) => s + "-" + o), t && (i = i.concat(i.map(Hs)))), i; -} -function xi(e) { - return e.replace(/left|right|bottom|top/g, (t) => V2[t]); -} -function B2(e) { - return { - top: 0, - right: 0, - bottom: 0, - left: 0, - ...e - }; -} -function ad(e) { - return typeof e != "number" ? B2(e) : { - top: e, - right: e, - bottom: e, - left: e - }; -} -function bi(e) { - const { - x: t, - y: n, - width: r, - height: o - } = e; - return { - width: r, - height: o, - top: n, - left: t, - right: t + r, - bottom: n + o, - x: t, - y: n - }; -} -function Pl(e, t, n) { - let { - reference: r, - floating: o - } = e; - const i = Ir(t), s = ga(t), a = fa(s), l = fr(t), u = i === "y", c = r.x + r.width / 2 - o.width / 2, f = r.y + r.height / 2 - o.height / 2, d = r[a] / 2 - o[a] / 2; - let g; - switch (l) { - case "top": - g = { - x: c, - y: r.y - o.height - }; - break; - case "bottom": - g = { - x: c, - y: r.y + r.height - }; - break; - case "right": - g = { - x: r.x + r.width, - y: f - }; - break; - case "left": - g = { - x: r.x - o.width, - y: f - }; - break; - default: - g = { - x: r.x, - y: r.y - }; - } - switch (Do(t)) { - case "start": - g[s] -= d * (n && u ? -1 : 1); - break; - case "end": - g[s] += d * (n && u ? -1 : 1); - break; - } - return g; -} -const Y2 = async (e, t, n) => { - const { - placement: r = "bottom", - strategy: o = "absolute", - middleware: i = [], - platform: s - } = n, a = i.filter(Boolean), l = await (s.isRTL == null ? void 0 : s.isRTL(t)); - let u = await s.getElementRects({ - reference: e, - floating: t, - strategy: o - }), { - x: c, - y: f - } = Pl(u, r, l), d = r, g = {}, p = 0; - for (let x = 0; x < a.length; x++) { - const { - name: k, - fn: E - } = a[x], { - x: m, - y: _, - data: v, - reset: b - } = await E({ - x: c, - y: f, - initialPlacement: r, - placement: d, - strategy: o, - middlewareData: g, - rects: u, - platform: s, - elements: { - reference: e, - floating: t - } - }); - c = m ?? c, f = _ ?? f, g = { - ...g, - [k]: { - ...g[k], - ...v - } - }, b && p <= 50 && (p++, typeof b == "object" && (b.placement && (d = b.placement), b.rects && (u = b.rects === !0 ? await s.getElementRects({ - reference: e, - floating: t, - strategy: o - }) : b.rects), { - x: c, - y: f - } = Pl(u, d, l)), x = -1); - } - return { - x: c, - y: f, - placement: d, - strategy: o, - middlewareData: g - }; -}; -async function ld(e, t) { - var n; - t === void 0 && (t = {}); - const { - x: r, - y: o, - platform: i, - rects: s, - elements: a, - strategy: l - } = e, { - boundary: u = "clippingAncestors", - rootBoundary: c = "viewport", - elementContext: f = "floating", - altBoundary: d = !1, - padding: g = 0 - } = Ho(t, e), p = ad(g), k = a[d ? f === "floating" ? "reference" : "floating" : f], E = bi(await i.getClippingRect({ - element: (n = await (i.isElement == null ? void 0 : i.isElement(k))) == null || n ? k : k.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(a.floating)), - boundary: u, - rootBoundary: c, - strategy: l - })), m = f === "floating" ? { - x: r, - y: o, - width: s.floating.width, - height: s.floating.height - } : s.reference, _ = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(a.floating)), v = await (i.isElement == null ? void 0 : i.isElement(_)) ? await (i.getScale == null ? void 0 : i.getScale(_)) || { - x: 1, - y: 1 - } : { - x: 1, - y: 1 - }, b = bi(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({ - elements: a, - rect: m, - offsetParent: _, - strategy: l - }) : m); - return { - top: (E.top - b.top + p.top) / v.y, - bottom: (b.bottom - E.bottom + p.bottom) / v.y, - left: (E.left - b.left + p.left) / v.x, - right: (b.right - E.right + p.right) / v.x - }; -} -const Z2 = (e) => ({ - name: "arrow", - options: e, - async fn(t) { - const { - x: n, - y: r, - placement: o, - rects: i, - platform: s, - elements: a, - middlewareData: l - } = t, { - element: u, - padding: c = 0 - } = Ho(e, t) || {}; - if (u == null) - return {}; - const f = ad(c), d = { - x: n, - y: r - }, g = ga(o), p = fa(g), x = await s.getDimensions(u), k = g === "y", E = k ? "top" : "left", m = k ? "bottom" : "right", _ = k ? "clientHeight" : "clientWidth", v = i.reference[p] + i.reference[g] - d[g] - i.floating[p], b = d[g] - i.reference[g], N = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(u)); - let $ = N ? N[_] : 0; - (!$ || !await (s.isElement == null ? void 0 : s.isElement(N))) && ($ = a.floating[_] || i.floating[p]); - const T = v / 2 - b / 2, A = $ / 2 - x[p] / 2 - 1, D = wo(f[E], A), O = wo(f[m], A), V = D, z = $ - x[p] - O, S = $ / 2 - x[p] / 2 + T, H = Ms(V, S, z), C = !l.arrow && Do(o) != null && S !== H && i.reference[p] / 2 - (S < V ? D : O) - x[p] / 2 < 0, P = C ? S < V ? S - V : S - z : 0; - return { - [g]: d[g] + P, - data: { - [g]: H, - centerOffset: S - H - P, - ...C && { - alignmentOffset: P - } - }, - reset: C - }; - } -}), X2 = function(e) { - return e === void 0 && (e = {}), { - name: "flip", - options: e, - async fn(t) { - var n, r; - const { - placement: o, - middlewareData: i, - rects: s, - initialPlacement: a, - platform: l, - elements: u - } = t, { - mainAxis: c = !0, - crossAxis: f = !0, - fallbackPlacements: d, - fallbackStrategy: g = "bestFit", - fallbackAxisSideDirection: p = "none", - flipAlignment: x = !0, - ...k - } = Ho(e, t); - if ((n = i.arrow) != null && n.alignmentOffset) - return {}; - const E = fr(o), m = Ir(a), _ = fr(a) === a, v = await (l.isRTL == null ? void 0 : l.isRTL(u.floating)), b = d || (_ || !x ? [xi(a)] : I2(a)), N = p !== "none"; - !d && N && b.push(...R2(a, x, p, v)); - const $ = [a, ...b], T = await ld(t, k), A = []; - let D = ((r = i.flip) == null ? void 0 : r.overflows) || []; - if (c && A.push(T[E]), f) { - const S = L2(o, s, v); - A.push(T[S[0]], T[S[1]]); - } - if (D = [...D, { - placement: o, - overflows: A - }], !A.every((S) => S <= 0)) { - var O, V; - const S = (((O = i.flip) == null ? void 0 : O.index) || 0) + 1, H = $[S]; - if (H) - return { - data: { - index: S, - overflows: D - }, - reset: { - placement: H - } - }; - let C = (V = D.filter((P) => P.overflows[0] <= 0).sort((P, M) => P.overflows[1] - M.overflows[1])[0]) == null ? void 0 : V.placement; - if (!C) - switch (g) { - case "bestFit": { - var z; - const P = (z = D.filter((M) => { - if (N) { - const I = Ir(M.placement); - return I === m || // Create a bias to the `y` side axis due to horizontal - // reading directions favoring greater width. - I === "y"; - } - return !0; - }).map((M) => [M.placement, M.overflows.filter((I) => I > 0).reduce((I, B) => I + B, 0)]).sort((M, I) => M[1] - I[1])[0]) == null ? void 0 : z[0]; - P && (C = P); - break; - } - case "initialPlacement": - C = a; - break; - } - if (o !== C) - return { - reset: { - placement: C - } - }; - } - return {}; - } - }; -}; -async function W2(e, t) { - const { - placement: n, - platform: r, - elements: o - } = e, i = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), s = fr(n), a = Do(n), l = Ir(n) === "y", u = ["left", "top"].includes(s) ? -1 : 1, c = i && l ? -1 : 1, f = Ho(t, e); - let { - mainAxis: d, - crossAxis: g, - alignmentAxis: p - } = typeof f == "number" ? { - mainAxis: f, - crossAxis: 0, - alignmentAxis: null - } : { - mainAxis: f.mainAxis || 0, - crossAxis: f.crossAxis || 0, - alignmentAxis: f.alignmentAxis - }; - return a && typeof p == "number" && (g = a === "end" ? p * -1 : p), l ? { - x: g * c, - y: d * u - } : { - x: d * u, - y: g * c - }; -} -const F2 = function(e) { - return e === void 0 && (e = 0), { - name: "offset", - options: e, - async fn(t) { - var n, r; - const { - x: o, - y: i, - placement: s, - middlewareData: a - } = t, l = await W2(t, e); - return s === ((n = a.offset) == null ? void 0 : n.placement) && (r = a.arrow) != null && r.alignmentOffset ? {} : { - x: o + l.x, - y: i + l.y, - data: { - ...l, - placement: s - } - }; - } - }; -}, K2 = function(e) { - return e === void 0 && (e = {}), { - name: "shift", - options: e, - async fn(t) { - const { - x: n, - y: r, - placement: o - } = t, { - mainAxis: i = !0, - crossAxis: s = !1, - limiter: a = { - fn: (k) => { - let { - x: E, - y: m - } = k; - return { - x: E, - y: m - }; - } - }, - ...l - } = Ho(e, t), u = { - x: n, - y: r - }, c = await ld(t, l), f = Ir(fr(o)), d = sd(f); - let g = u[d], p = u[f]; - if (i) { - const k = d === "y" ? "top" : "left", E = d === "y" ? "bottom" : "right", m = g + c[k], _ = g - c[E]; - g = Ms(m, g, _); - } - if (s) { - const k = f === "y" ? "top" : "left", E = f === "y" ? "bottom" : "right", m = p + c[k], _ = p - c[E]; - p = Ms(m, p, _); - } - const x = a.fn({ - ...t, - [d]: g, - [f]: p - }); - return { - ...x, - data: { - x: x.x - n, - y: x.y - r, - enabled: { - [d]: i, - [f]: s - } - } - }; - } - }; -}; -function Wi() { - return typeof window < "u"; -} -function Fr(e) { - return ud(e) ? (e.nodeName || "").toLowerCase() : "#document"; -} -function It(e) { - var t; - return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window; -} -function In(e) { - var t; - return (t = (ud(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement; -} -function ud(e) { - return Wi() ? e instanceof Node || e instanceof It(e).Node : !1; -} -function on(e) { - return Wi() ? e instanceof Element || e instanceof It(e).Element : !1; -} -function mn(e) { - return Wi() ? e instanceof HTMLElement || e instanceof It(e).HTMLElement : !1; -} -function Nl(e) { - return !Wi() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof It(e).ShadowRoot; -} -function Ao(e) { - const { - overflow: t, - overflowX: n, - overflowY: r, - display: o - } = sn(e); - return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !["inline", "contents"].includes(o); -} -function q2(e) { - return ["table", "td", "th"].includes(Fr(e)); -} -function Fi(e) { - return [":popover-open", ":modal"].some((t) => { - try { - return e.matches(t); - } catch { - return !1; - } - }); -} -function ha(e) { - const t = va(), n = on(e) ? sn(e) : e; - return ["transform", "translate", "scale", "rotate", "perspective"].some((r) => n[r] ? n[r] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((r) => (n.willChange || "").includes(r)) || ["paint", "layout", "strict", "content"].some((r) => (n.contain || "").includes(r)); -} -function G2(e) { - let t = Jn(e); - for (; mn(t) && !zr(t); ) { - if (ha(t)) - return t; - if (Fi(t)) - return null; - t = Jn(t); - } - return null; -} -function va() { - return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none"); -} -function zr(e) { - return ["html", "body", "#document"].includes(Fr(e)); -} -function sn(e) { - return It(e).getComputedStyle(e); -} -function Ki(e) { - return on(e) ? { - scrollLeft: e.scrollLeft, - scrollTop: e.scrollTop - } : { - scrollLeft: e.scrollX, - scrollTop: e.scrollY - }; -} -function Jn(e) { - if (Fr(e) === "html") - return e; - const t = ( - // Step into the shadow DOM of the parent of a slotted node. - e.assignedSlot || // DOM Element detected. - e.parentNode || // ShadowRoot detected. - Nl(e) && e.host || // Fallback. - In(e) - ); - return Nl(t) ? t.host : t; -} -function cd(e) { - const t = Jn(e); - return zr(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : mn(t) && Ao(t) ? t : cd(t); -} -function dd(e, t, n) { - var r; - t === void 0 && (t = []); - const o = cd(e), i = o === ((r = e.ownerDocument) == null ? void 0 : r.body), s = It(o); - return i ? (Ds(s), t.concat(s, s.visualViewport || [], Ao(o) ? o : [], [])) : t.concat(o, dd(o, [])); -} -function Ds(e) { - return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null; -} -function fd(e) { - const t = sn(e); - let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0; - const o = mn(e), i = o ? e.offsetWidth : n, s = o ? e.offsetHeight : r, a = _i(n) !== i || _i(r) !== s; - return a && (n = i, r = s), { - width: n, - height: r, - $: a - }; -} -function gd(e) { - return on(e) ? e : e.contextElement; -} -function Sr(e) { - const t = gd(e); - if (!mn(t)) - return gn(1); - const n = t.getBoundingClientRect(), { - width: r, - height: o, - $: i - } = fd(t); - let s = (i ? _i(n.width) : n.width) / r, a = (i ? _i(n.height) : n.height) / o; - return (!s || !Number.isFinite(s)) && (s = 1), (!a || !Number.isFinite(a)) && (a = 1), { - x: s, - y: a - }; -} -const U2 = /* @__PURE__ */ gn(0); -function hd(e) { - const t = It(e); - return !va() || !t.visualViewport ? U2 : { - x: t.visualViewport.offsetLeft, - y: t.visualViewport.offsetTop - }; -} -function j2(e, t, n) { - return t === void 0 && (t = !1), !n || t && n !== It(e) ? !1 : t; -} -function _o(e, t, n, r) { - t === void 0 && (t = !1), n === void 0 && (n = !1); - const o = e.getBoundingClientRect(), i = gd(e); - let s = gn(1); - t && (r ? on(r) && (s = Sr(r)) : s = Sr(e)); - const a = j2(i, n, r) ? hd(i) : gn(0); - let l = (o.left + a.x) / s.x, u = (o.top + a.y) / s.y, c = o.width / s.x, f = o.height / s.y; - if (i) { - const d = It(i), g = r && on(r) ? It(r) : r; - let p = d, x = Ds(p); - for (; x && r && g !== p; ) { - const k = Sr(x), E = x.getBoundingClientRect(), m = sn(x), _ = E.left + (x.clientLeft + parseFloat(m.paddingLeft)) * k.x, v = E.top + (x.clientTop + parseFloat(m.paddingTop)) * k.y; - l *= k.x, u *= k.y, c *= k.x, f *= k.y, l += _, u += v, p = It(x), x = Ds(p); - } - } - return bi({ - width: c, - height: f, - x: l, - y: u - }); -} -function pa(e, t) { - const n = Ki(e).scrollLeft; - return t ? t.left + n : _o(In(e)).left + n; -} -function vd(e, t, n) { - n === void 0 && (n = !1); - const r = e.getBoundingClientRect(), o = r.left + t.scrollLeft - (n ? 0 : ( - // RTL scrollbar. - pa(e, r) - )), i = r.top + t.scrollTop; - return { - x: o, - y: i - }; -} -function J2(e) { - let { - elements: t, - rect: n, - offsetParent: r, - strategy: o - } = e; - const i = o === "fixed", s = In(r), a = t ? Fi(t.floating) : !1; - if (r === s || a && i) - return n; - let l = { - scrollLeft: 0, - scrollTop: 0 - }, u = gn(1); - const c = gn(0), f = mn(r); - if ((f || !f && !i) && ((Fr(r) !== "body" || Ao(s)) && (l = Ki(r)), mn(r))) { - const g = _o(r); - u = Sr(r), c.x = g.x + r.clientLeft, c.y = g.y + r.clientTop; - } - const d = s && !f && !i ? vd(s, l, !0) : gn(0); - return { - width: n.width * u.x, - height: n.height * u.y, - x: n.x * u.x - l.scrollLeft * u.x + c.x + d.x, - y: n.y * u.y - l.scrollTop * u.y + c.y + d.y - }; -} -function Q2(e) { - return Array.from(e.getClientRects()); -} -function em(e) { - const t = In(e), n = Ki(e), r = e.ownerDocument.body, o = $r(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), i = $r(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight); - let s = -n.scrollLeft + pa(e); - const a = -n.scrollTop; - return sn(r).direction === "rtl" && (s += $r(t.clientWidth, r.clientWidth) - o), { - width: o, - height: i, - x: s, - y: a - }; -} -function tm(e, t) { - const n = It(e), r = In(e), o = n.visualViewport; - let i = r.clientWidth, s = r.clientHeight, a = 0, l = 0; - if (o) { - i = o.width, s = o.height; - const u = va(); - (!u || u && t === "fixed") && (a = o.offsetLeft, l = o.offsetTop); - } - return { - width: i, - height: s, - x: a, - y: l - }; -} -function nm(e, t) { - const n = _o(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, i = mn(e) ? Sr(e) : gn(1), s = e.clientWidth * i.x, a = e.clientHeight * i.y, l = o * i.x, u = r * i.y; - return { - width: s, - height: a, - x: l, - y: u - }; -} -function Tl(e, t, n) { - let r; - if (t === "viewport") - r = tm(e, n); - else if (t === "document") - r = em(In(e)); - else if (on(t)) - r = nm(t, n); - else { - const o = hd(e); - r = { - x: t.x - o.x, - y: t.y - o.y, - width: t.width, - height: t.height - }; - } - return bi(r); -} -function pd(e, t) { - const n = Jn(e); - return n === t || !on(n) || zr(n) ? !1 : sn(n).position === "fixed" || pd(n, t); -} -function rm(e, t) { - const n = t.get(e); - if (n) - return n; - let r = dd(e, []).filter((a) => on(a) && Fr(a) !== "body"), o = null; - const i = sn(e).position === "fixed"; - let s = i ? Jn(e) : e; - for (; on(s) && !zr(s); ) { - const a = sn(s), l = ha(s); - !l && a.position === "fixed" && (o = null), (i ? !l && !o : !l && a.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || Ao(s) && !l && pd(e, s)) ? r = r.filter((c) => c !== s) : o = a, s = Jn(s); - } - return t.set(e, r), r; -} -function om(e) { - let { - element: t, - boundary: n, - rootBoundary: r, - strategy: o - } = e; - const s = [...n === "clippingAncestors" ? Fi(t) ? [] : rm(t, this._c) : [].concat(n), r], a = s[0], l = s.reduce((u, c) => { - const f = Tl(t, c, o); - return u.top = $r(f.top, u.top), u.right = wo(f.right, u.right), u.bottom = wo(f.bottom, u.bottom), u.left = $r(f.left, u.left), u; - }, Tl(t, a, o)); - return { - width: l.right - l.left, - height: l.bottom - l.top, - x: l.left, - y: l.top - }; -} -function im(e) { - const { - width: t, - height: n - } = fd(e); - return { - width: t, - height: n - }; -} -function sm(e, t, n) { - const r = mn(t), o = In(t), i = n === "fixed", s = _o(e, !0, i, t); - let a = { - scrollLeft: 0, - scrollTop: 0 - }; - const l = gn(0); - if (r || !r && !i) - if ((Fr(t) !== "body" || Ao(o)) && (a = Ki(t)), r) { - const d = _o(t, !0, i, t); - l.x = d.x + t.clientLeft, l.y = d.y + t.clientTop; - } else o && (l.x = pa(o)); - const u = o && !r && !i ? vd(o, a) : gn(0), c = s.left + a.scrollLeft - l.x - u.x, f = s.top + a.scrollTop - l.y - u.y; - return { - x: c, - y: f, - width: s.width, - height: s.height - }; -} -function us(e) { - return sn(e).position === "static"; -} -function Ml(e, t) { - if (!mn(e) || sn(e).position === "fixed") - return null; - if (t) - return t(e); - let n = e.offsetParent; - return In(e) === n && (n = n.ownerDocument.body), n; -} -function md(e, t) { - const n = It(e); - if (Fi(e)) - return n; - if (!mn(e)) { - let o = Jn(e); - for (; o && !zr(o); ) { - if (on(o) && !us(o)) - return o; - o = Jn(o); - } - return n; - } - let r = Ml(e, t); - for (; r && q2(r) && us(r); ) - r = Ml(r, t); - return r && zr(r) && us(r) && !ha(r) ? n : r || G2(e) || n; -} -const am = async function(e) { - const t = this.getOffsetParent || md, n = this.getDimensions, r = await n(e.floating); - return { - reference: sm(e.reference, await t(e.floating), e.strategy), - floating: { - x: 0, - y: 0, - width: r.width, - height: r.height - } - }; -}; -function lm(e) { - return sn(e).direction === "rtl"; -} -const um = { - convertOffsetParentRelativeRectToViewportRelativeRect: J2, - getDocumentElement: In, - getClippingRect: om, - getOffsetParent: md, - getElementRects: am, - getClientRects: Q2, - getDimensions: im, - getScale: Sr, - isElement: on, - isRTL: lm -}, cm = F2, dm = K2, fm = X2, gm = Z2, hm = (e, t, n) => { - const r = /* @__PURE__ */ new Map(), o = { - platform: um, - ...n - }, i = { - ...o.platform, - _c: r - }; - return Y2(e, t, { - ...o, - platform: i - }); -}, vm = ({ - trigger: e, - triggerEvent: t, - floatContent: n, - placement: r = "bottom", - offsetOptions: o, - flipOptions: i, - shiftOptions: s, - interactive: a, - showArrow: l -}) => { - if (typeof e == "string") { - const E = document.querySelector(e); - if (E) - e = E; - else - throw new Error("element not found by document.querySelector('" + e + "')"); - } - let u; - if (typeof n == "string") { - const E = document.querySelector(n); - if (E) - u = E; - else - throw new Error("element not found by document.querySelector('" + n + "')"); - } else - u = n; - let c; - l && (c = document.createElement("div"), c.style.position = "absolute", c.style.backgroundColor = "#222", c.style.width = "8px", c.style.height = "8px", c.style.transform = "rotate(45deg)", c.style.display = "none", u.firstElementChild.before(c)); - function f() { - hm(e, u, { - placement: r, - middleware: [ - cm(o), - // 手动偏移配置 - fm(i), - //自动翻转 - dm(s), - //自动偏移(使得浮动元素能够进入视野) - ...l ? [gm({ element: c })] : [] - ] - }).then(({ x: E, y: m, placement: _, middlewareData: v }) => { - if (Object.assign(u.style, { - left: `${E}px`, - top: `${m}px` - }), l) { - const { x: b, y: N } = v.arrow, $ = { - top: "bottom", - right: "left", - bottom: "top", - left: "right" - }[_.split("-")[0]]; - Object.assign(c.style, { - zIndex: -1, - left: b != null ? `${b}px` : "", - top: N != null ? `${N}px` : "", - right: "", - bottom: "", - [$]: "2px" - }); - } - }); - } - let d = !1; - function g() { - u.style.display = "block", u.style.visibility = "block", u.style.position = "absolute", l && (c.style.display = "block"), d = !0, f(); - } - function p() { - u.style.display = "none", l && (c.style.display = "none"), d = !1; - } - function x(E) { - E.stopPropagation(), d ? p() : g(); - } - function k(E) { - u.contains(E.target) || p(); - } - return (!t || t.length == 0) && (t = ["click"]), t.forEach((E) => { - e.addEventListener(E, x); - }), document.addEventListener("click", k), { - destroy() { - t.forEach((E) => { - e.removeEventListener(E, x); - }), document.removeEventListener("click", k); - }, - hide() { - p(); - }, - isVisible() { - return d; - } - }; -}; -var pm = /* @__PURE__ */ ne('
'); -function Vo(e, t) { - ue(t, !0); - const n = w(t, "children", 7), r = w(t, "floating", 7), o = w(t, "placement", 7, "bottom"); - let i, s, a; - xn(() => (a = vm({ - trigger: i, - floatContent: s, - interactive: !0, - placement: o() - }), () => { - a.destroy(); - })); - function l() { - a.hide(); - } - var u = pm(), c = X(u), f = X(c); - lr(f, n), Z(c), An(c, (p) => i = p, () => i); - var d = R(c, 2), g = X(d); - return lr(g, r), Z(d), An(d, (p) => s = p, () => s), Z(u), L(e, u), ce({ - hide: l, - get children() { - return n(); - }, - set children(p) { - n(p), y(); - }, - get floating() { - return r(); - }, - set floating(p) { - r(p), y(); - }, - get placement() { - return o(); - }, - set placement(p = "bottom") { - o(p), y(); - } - }); -} -re(Vo, { children: {}, floating: {}, placement: {} }, [], ["hide"], !0); -function Je(e, t) { - ue(t, !0); - const n = w(t, "children", 7), r = w(t, "level", 7, 1), o = w(t, "mt", 7), i = w(t, "mb", 7); - var s = et(), a = _e(s); - return h1(a, () => `h${r()}`, !1, (l, u) => { - let c; - $e(() => c = rn( - l, - c, - { - class: "tf-heading", - style: `margin-top:${o() || "0"};margin-bottom:${i() || "0"}` - }, - void 0, - l.namespaceURI === Ll, - l.nodeName.includes("-") - )); - var f = et(), d = _e(f); - lr(d, () => n() ?? dt), L(u, f); - }), L(e, s), ce({ - get children() { - return n(); - }, - set children(l) { - n(l), y(); - }, - get level() { - return r(); - }, - set level(l = 1) { - r(l), y(); - }, - get mt() { - return o(); - }, - set mt(l) { - o(l), y(); - }, - get mb() { - return i(); - }, - set mb(l) { - i(l), y(); - } - }); -} -re(Je, { children: {}, level: {}, mt: {}, mb: {} }, [], [], !0); -var mm = /* @__PURE__ */ xe(''); -const ym = { - hash: "svelte-1rvn4a8", - code: ".input-btn-more {border:1px solid transparent;padding:3px;&:hover {background:#eee;border:1px solid transparent;}}" -}; -function qi(e, t) { - ue(t, !0), je(e, ym); - const n = /* @__PURE__ */ Et(t, ["$$slots", "$$events", "$$legacy", "$$host"]); - Ge(e, ct(() => n, { - get class() { - return `input-btn-more ${t.class ?? ""}`; - }, - children: (r, o) => { - var i = mm(); - L(r, i); - }, - $$slots: { default: !0 } - })), ce(); -} -re(qi, {}, [], [], !0); -const wm = () => { - const e = Ke(); - return { - deleteNode: (n) => { - e.nodes.update((r) => r.filter((o) => o.id !== n)), e.edges.update( - (r) => r.filter((o) => o.source !== n && o.target !== n) - ); - } - }; -}, Rr = (e = 16) => { - const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = new Uint8Array(e); - return crypto.getRandomValues(n), Array.from(n, (r) => t[r % t.length]).join(""); -}, _m = () => { - const { nodes: e, nodeLookup: t } = Ke(); - return { - copyNode: (r) => { - var s; - const i = (s = q(t).get(r)) == null ? void 0 : s.internals.userNode; - if (i) { - const a = Rr(), l = { - ...i, - id: a, - position: { - x: i.position.x + 50, - y: i.position.y + 50 - } - }; - e.update((u) => [...u, l]), e.update( - (u) => u.map( - (c) => c.id === a ? { ...c, selected: !0 } : { ...c, selected: !1 } - ) - ); - } - } - }; -}; -var xm = /* @__PURE__ */ xe(''), bm = /* @__PURE__ */ xe(''), Cm = /* @__PURE__ */ xe(''), km = /* @__PURE__ */ ne('
'), Em = /* @__PURE__ */ ne('
TinyFlow.ai
', 1); -const $m = { - hash: "svelte-44dmwv", - code: ".tf-node-toolbar.svelte-44dmwv {display:flex;gap:5px;padding:5px;border-radius:5px;background:#fff;border:1px solid #eee;box-shadow:0 0 5px rgba(0, 0, 0, 0.1);}.tf-node-toolbar-item {border:1px solid transparent;}" -}; -function Cn(e, t) { - ue(t, !0), je(e, $m); - const n = w(t, "data", 7), r = w(t, "id", 7, ""), o = w(t, "icon", 7), i = w(t, "handle", 7), s = w(t, "children", 7), a = w(t, "allowExecute", 7, !0), l = w(t, "allowCopy", 7, !0), u = w(t, "allowDelete", 7, !0), c = w(t, "showSourceHandle", 7, !0), f = w(t, "showTargetHandle", 7, !0); - let d = n().expand ? ["key"] : []; - const { updateNodeData: g } = Bt(), p = [ - { - key: "key", - icon: o(), - title: n().title, - description: n().description, - content: s() - } - ], { deleteNode: x } = wm(), { copyNode: k } = _m(); - var E = Em(), m = _e(E); - { - var _ = (V) => { - nd(V, { - get position() { - return Ee.Top; - }, - align: "end", - children: (z, S) => { - var H = km(), C = X(H); - { - var P = (K) => { - Ge(K, { - class: "tf-node-toolbar-item", - children: (oe, J) => { - var W = xm(); - L(oe, W); - }, - $$slots: { default: !0 } - }); - }; - be(C, (K) => { - a() && K(P); - }); - } - var M = R(C, 2); - { - var I = (K) => { - Ge(K, { - class: "tf-node-toolbar-item", - onclick: () => { - k(r()); - }, - children: (oe, J) => { - var W = bm(); - L(oe, W); - }, - $$slots: { default: !0 } - }); - }; - be(M, (K) => { - l() && K(I); - }); - } - var B = R(M, 2); - { - var F = (K) => { - Ge(K, { - class: "tf-node-toolbar-item", - onclick: () => { - x(r()); - }, - children: (oe, J) => { - var W = Cm(); - L(oe, W); - }, - $$slots: { default: !0 } - }); - }; - be(B, (K) => { - u() && K(F); - }); - } - Z(H), L(z, H); - }, - $$slots: { default: !0 } - }); - }; - be(m, (V) => { - (a() || l() || u()) && V(_); - }); - } - var v = R(m, 2), b = R(X(v), 2), N = X(b); - id(N, { - items: p, - activeKeys: d, - onChange: (V, z) => { - g(r(), { expand: z == null ? void 0 : z.includes("key") }); - } - }), Z(b), Z(v); - var $ = R(v, 2); - { - var T = (V) => { - jn(V, { - type: "target", - get position() { - return Ee.Left; - }, - style: " left: -12px;top: 20px" - }); - }; - be($, (V) => { - f() && V(T); - }); - } - var A = R($, 2); - { - var D = (V) => { - jn(V, { - type: "source", - get position() { - return Ee.Right; - }, - style: "right: -12px;top: 20px" - }); - }; - be(A, (V) => { - c() && V(D); - }); - } - var O = R(A, 2); - return lr(O, () => i() ?? dt), L(e, E), ce({ - get data() { - return n(); - }, - set data(V) { - n(V), y(); - }, - get id() { - return r(); - }, - set id(V = "") { - r(V), y(); - }, - get icon() { - return o(); - }, - set icon(V) { - o(V), y(); - }, - get handle() { - return i(); - }, - set handle(V) { - i(V), y(); - }, - get children() { - return s(); - }, - set children(V) { - s(V), y(); - }, - get allowExecute() { - return a(); - }, - set allowExecute(V = !0) { - a(V), y(); - }, - get allowCopy() { - return l(); - }, - set allowCopy(V = !0) { - l(V), y(); - }, - get allowDelete() { - return u(); - }, - set allowDelete(V = !0) { - u(V), y(); - }, - get showSourceHandle() { - return c(); - }, - set showSourceHandle(V = !0) { - c(V), y(); - }, - get showTargetHandle() { - return f(); - }, - set showTargetHandle(V = !0) { - f(V), y(); - } - }); -} -re( - Cn, - { - data: {}, - id: {}, - icon: {}, - handle: {}, - children: {}, - allowExecute: {}, - allowCopy: {}, - allowDelete: {}, - showSourceHandle: {}, - showTargetHandle: {} - }, - [], - [], - !0 -); -function mt() { - return ar("svelteflow__node_id"); -} -const yd = [ - { - value: "String", - label: "String" - }, - { - value: "Number", - label: "Number" - }, - { - value: "Boolean", - label: "Boolean" - }, - { - value: "File", - label: "File" - }, - { - value: "Object", - label: "Object" - }, - { - value: "Array", - label: "Array" - } -], Sm = [ - { - value: "ref", - label: "引用" - }, - { - value: "input", - label: "固定值" - } -]; -var Pm = /* @__PURE__ */ ne('
参数类型:
默认值:
参数描述:
'), Nm = /* @__PURE__ */ xe(''), Tm = /* @__PURE__ */ ne('
', 1); -const Mm = { - hash: "svelte-laou7w", - code: ".input-item.svelte-laou7w {display:flex;align-items:center;}.input-more-setting.svelte-laou7w {display:flex;flex-direction:column;gap:10px;padding:10px;background:#fff;border:1px solid #ddd;border-radius:5px;width:200px;box-shadow:0 0 10px 2px rgba(0, 0, 0, 0.1);}.input-more-setting.svelte-laou7w .input-more-item:where(.svelte-laou7w) {display:flex;flex-direction:column;gap:3px;font-size:12px;color:#666;}" -}; -function wd(e, t) { - ue(t, !0), je(e, Mm); - const [n, r] = tt(), o = () => j(h(l), "$node", n), i = w(t, "parameter", 7), s = w(t, "index", 7); - let a = mt(), l = /* @__PURE__ */ Me(() => pr(a)), u = /* @__PURE__ */ Me(() => { - var T, A; - return { - ...i(), - ...(A = (T = o()) == null ? void 0 : T.data) == null ? void 0 : A.parameters[s()] - }; - }); - const { updateNodeData: c } = Bt(), f = (T) => { - const A = T.target.value; - c(a, (D) => { - let O = D.data.parameters; - return O[s()].name = A, { parameters: O }; - }); - }, d = (T) => { - const A = T.target.checked; - c(a, (D) => { - let O = D.data.parameters; - return O[s()].required = A, { parameters: O }; - }); - }, g = (T) => { - const A = T.value; - A && c(a, (D) => { - let O = D.data.parameters; - return O[s()].dataType = A, { parameters: O }; - }); - }; - let p; - const x = () => { - c(a, (T) => { - let A = T.data.parameters; - return A.splice(s(), 1), { parameters: [...A] }; - }), p == null || p.hide(); - }; - var k = Tm(), E = _e(k), m = X(E); - _t(m, { - style: "width: 100%;", - get value() { - return h(u).name; - }, - placeholder: "请输入参数名称", - oninput: f - }), Z(E); - var _ = R(E, 2), v = X(_); - rd(v, { - get checked() { - return h(u).required; - }, - onchange: d - }), Z(_); - var b = R(_, 2), N = X(b); - An( - Vo(N, { - placement: "bottom", - floating: (A) => { - var D = Pm(), O = X(D), V = R(X(O)); - const z = /* @__PURE__ */ Me(() => h(u).dataType ? [h(u).dataType] : ["String"]); - pn(V, { - items: yd, - style: "width: 100%", - onSelect: g, - get value() { - return h(z); - } - }), Z(O); - var S = R(O, 2), H = R(X(S)); - kt(H, { rows: 1, style: "width: 100%;" }), Z(S); - var C = R(S, 2), P = R(X(C)); - kt(P, { rows: 3, style: "width: 100%;" }), Z(C); - var M = R(C, 2), I = X(M); - Ge(I, { - onclick: x, - children: (B, F) => { - Te(); - var K = Ie("删除"); - L(B, K); - }, - $$slots: { default: !0 } - }), Z(M), Z(D), L(A, D); - }, - children: (A, D) => { - Ge(A, { - class: "input-btn-more", - children: (O, V) => { - var z = Nm(); - L(O, z); - }, - $$slots: { default: !0 } - }); - }, - $$slots: { floating: !0, default: !0 } - }), - (A) => p = A, - () => p - ), Z(b), L(e, k); - var $ = ce({ - get parameter() { - return i(); - }, - set parameter(T) { - i(T), y(); - }, - get index() { - return s(); - }, - set index(T) { - s(T), y(); - } - }); - return r(), $; -} -re(wd, { parameter: {}, index: {} }, [], [], !0); -var Hm = /* @__PURE__ */ ne('
参数名称
必填
', 1), Dm = /* @__PURE__ */ ne('
无输入参数
'), Am = /* @__PURE__ */ ne('
'); -const Vm = { - hash: "svelte-3n0wca", - code: `.input-container.svelte-3n0wca {display:grid;grid-template-columns:80% 10% 10%;row-gap:5px;column-gap:3px;}.input-container.svelte-3n0wca .none-params:where(.svelte-3n0wca) {font-size:12px;background:#f8f8f8;height:40px;display:flex;justify-content:center;align-items:center;border-radius:5px;width:calc(100% - 5px);grid-column:1 / -1; - /* 从第一列开始到最后一列结束 */}.input-container.svelte-3n0wca .input-header:where(.svelte-3n0wca) {font-size:12px;color:#666;}` -}; -function _d(e, t) { - ue(t, !0), je(e, Vm); - const [n, r] = tt(), o = () => j(h(s), "$node", n); - let i = mt(), s = /* @__PURE__ */ Me(() => pr(i)), a = /* @__PURE__ */ Me(() => { - var d, g; - return [...((g = (d = o()) == null ? void 0 : d.data) == null ? void 0 : g.parameters) || []]; - }); - var l = Am(), u = X(l); - { - var c = (d) => { - var g = Hm(); - Te(4), L(d, g); - }; - be(u, (d) => { - h(a).length !== 0 && d(c); - }); - } - var f = R(u, 2); - zt( - f, - 19, - () => h(a), - (d) => d.id, - (d, g, p) => { - wd(d, { - get parameter() { - return h(g); - }, - get index() { - return h(p); - } - }); - }, - (d) => { - var g = Dm(); - L(d, g); - } - ), Z(l), L(e, l), ce(), r(); -} -re(_d, {}, [], [], !0); -const xd = (e) => { - !e || e.length == 0 || e.forEach((t) => { - t.id || (t.id = Rr()), xd(t.children); - }); -}, zn = () => { - const { updateNodeData: e } = Bt(); - return { - addParameter: (t, n = "parameters", r) => { - xd(r == null ? void 0 : r.children); - const o = { - ...r, - id: Rr() - }; - e(t, (i) => { - let s = i.data[n]; - return s ? s.push(o) : s = [o], { - [n]: [...s] - }; - }); - } - }; -}; -var Om = /* @__PURE__ */ xe(''), Lm = /* @__PURE__ */ xe(''), Im = /* @__PURE__ */ ne('
', 1); -const zm = { - hash: "svelte-r5g35l", - code: ".heading.svelte-r5g35l {display:flex;margin-bottom:10px;}.input-btn-more {border:1px solid transparent;padding:3px;}.input-btn-more:hover {background:#eee;border:1px solid transparent;}" -}; -function bd(e, t) { - ue(t, !0), je(e, zm); - const n = w(t, "data", 7), r = /* @__PURE__ */ Et(t, [ - "$$slots", - "$$events", - "$$legacy", - "$$host", - "data" - ]), o = mt(), { addParameter: i } = zn(); - return Cn(e, ct(() => r, { - get data() { - return n(); - }, - allowExecute: !1, - showTargetHandle: !1, - icon: (a) => { - var l = Om(); - L(a, l); - }, - children: (a, l) => { - var u = Im(), c = _e(u), f = X(c); - Je(f, { - level: 3, - children: (p, x) => { - Te(); - var k = Ie("输入参数"); - L(p, k); - }, - $$slots: { default: !0 } - }); - var d = R(f, 2); - Ge(d, { - class: "input-btn-more", - style: "margin-left: auto", - onclick: () => { - i(o); - }, - children: (p, x) => { - var k = Lm(); - L(p, k); - }, - $$slots: { default: !0 } - }), Z(c); - var g = R(c, 2); - _d(g, {}), L(a, u); - }, - $$slots: { icon: !0, default: !0 } - })), ce({ - get data() { - return n(); - }, - set data(s) { - n(s), y(); - } - }); -} -re(bd, { data: {} }, [], [], !0); -const Cd = (e, t, n) => { - for (let r of n) - r.target === t && r.source && (e.push(r.source), Cd(e, r.source, n)); -}, Hl = (e, t) => { - if (e.type === "startNode") { - const n = e.data.parameters, r = []; - if (n) - for (const o of n) - r.push({ - label: o.name + (t ? ` (Array<${o.dataType || "String"}>)` : ` (${o.dataType || "String"})`), - value: e.id + "." + o.name - }); - return { - label: e.data.title, - value: e.id, - children: r - }; - } else { - if (e.type === "loopNode" && t) - return { - label: e.data.title, - value: e.id, - children: [ - { - label: "loopItem", - value: e.id + ".loop" - }, - { - label: "index (Number)", - value: e.id + ".index" - } - ] - }; - { - const n = e.data.outputDefs; - if (n) { - const r = (o, i) => !o || o.length === 0 ? [] : o.map((s) => ({ - label: s.name + (t ? ` (Array<${s.dataType || "String"}>)` : ` (${s.dataType || "String"})`), - // label: param.name , - value: i + "." + s.name, - children: r(s.children, i + "." + s.name) - })); - return { - label: e.data.title, - value: e.id, - children: r(n, e.id) - }; - } - } - } -}, Rm = (e = !1) => { - const t = mt(), n = pr(t), { nodes: r, edges: o } = Ke(); - return Fn([n, r, o], ([i, s, a]) => { - const l = []; - if (e) { - for (let u of s) - if (u.parentId === i.id) { - const c = Hl(u, u.parentId === i.id); - c && l.push(c); - } - } else { - const u = []; - Cd(u, t, a); - for (let c of s) - if (u.includes(c.id)) { - const f = Hl(c, c.parentId === i.id); - f && l.push(f); - } - } - return l; - }); -}; -var Bm = /* @__PURE__ */ ne('
数据来源:
默认值:
参数描述:
'), Ym = /* @__PURE__ */ ne('
', 1); -const Zm = { - hash: "svelte-laou7w", - code: ".input-item.svelte-laou7w {display:flex;align-items:center;}.input-more-setting.svelte-laou7w {display:flex;flex-direction:column;gap:10px;padding:10px;background:#fff;border:1px solid #ddd;border-radius:5px;width:200px;box-shadow:0 0 10px 2px rgba(0, 0, 0, 0.1);}.input-more-setting.svelte-laou7w .input-more-item:where(.svelte-laou7w) {display:flex;flex-direction:column;gap:3px;font-size:12px;color:#666;}" -}; -function kd(e, t) { - ue(t, !0), je(e, Zm); - const [n, r] = tt(), o = () => j(h(c), "$node", n), i = () => j(v, "$selectItems", n), s = w(t, "parameter", 7), a = w(t, "index", 7), l = w(t, "dataKeyName", 7); - let u = mt(), c = /* @__PURE__ */ Me(() => pr(u)), f = /* @__PURE__ */ Me(() => { - var H; - return { - ...s(), - ...(H = o()) == null ? void 0 : H.data[l()][a()] - }; - }); - const { updateNodeData: d } = Bt(), g = (H, C) => { - d(u, (P) => { - let M = P.data[l()]; - return M[a()] = { ...M[a()], [H]: C }, { [l()]: M }; - }); - }, p = (H) => { - const C = H.target.value; - g("name", C); - }, x = (H) => { - const C = H.target.value; - g("value", C); - }, k = (H) => { - const C = H.value; - g("ref", C); - }, E = (H) => { - const C = H.value; - g("refType", C); - }; - let m; - const _ = () => { - d(u, (H) => { - let C = H.data[l()]; - return C.splice(a(), 1), { [l()]: [...C] }; - }), m == null || m.hide(); - }, v = Rm(); - var b = Ym(), N = _e(b), $ = X(N); - _t($, { - style: "width: 100%;", - get value() { - return h(f).name; - }, - placeholder: "请输入参数名称", - oninput: p - }), Z(N); - var T = R(N, 2), A = X(T); - { - var D = (H) => { - _t(H, { - get value() { - return h(f).value; - }, - placeholder: "请输入参数值", - oninput: x - }); - }, O = (H) => { - const C = /* @__PURE__ */ Me(() => [h(f).ref]); - pn(H, { - get items() { - return i(); - }, - style: "width: 100%", - defaultValue: ["ref"], - get value() { - return h(C); - }, - expandAll: !0, - onSelect: k - }); - }; - be(A, (H) => { - h(f).refType === "input" ? H(D) : H(O, !1); - }); - } - Z(T); - var V = R(T, 2), z = X(V); - An( - Vo(z, { - placement: "bottom", - floating: (C) => { - var P = Bm(), M = X(P), I = R(X(M)); - const B = /* @__PURE__ */ Me(() => h(f).refType ? [h(f).refType] : []); - pn(I, { - items: Sm, - style: "width: 100%", - defaultValue: ["ref"], - get value() { - return h(B); - }, - onSelect: E - }), Z(M); - var F = R(M, 2), K = R(X(F)); - kt(K, { - rows: 1, - style: "width: 100%;", - onchange: (we) => { - const Ce = we.target.value; - g("defaultValue", Ce); - } - }), Z(F); - var oe = R(F, 2), J = R(X(oe)); - kt(J, { - rows: 3, - style: "width: 100%;", - onchange: (we) => { - const Ce = we.target.value; - g("description", Ce); - } - }), Z(oe); - var W = R(oe, 2), de = X(W); - Ge(de, { - onclick: _, - children: (we, Ce) => { - Te(); - var fe = Ie("删除"); - L(we, fe); - }, - $$slots: { default: !0 } - }), Z(W), Z(P), L(C, P); - }, - children: (C, P) => { - qi(C, {}); - }, - $$slots: { floating: !0, default: !0 } - }), - (C) => m = C, - () => m - ), Z(V), L(e, b); - var S = ce({ - get parameter() { - return s(); - }, - set parameter(H) { - s(H), y(); - }, - get index() { - return a(); - }, - set index(H) { - a(H), y(); - }, - get dataKeyName() { - return l(); - }, - set dataKeyName(H) { - l(H), y(); - } - }); - return r(), S; -} -re(kd, { parameter: {}, index: {}, dataKeyName: {} }, [], [], !0); -var Xm = /* @__PURE__ */ ne('
参数名称
参数值
', 1), Wm = /* @__PURE__ */ ne('
'), Fm = /* @__PURE__ */ ne('
'); -const Km = { - hash: "svelte-1sm1mgi", - code: `.input-container.svelte-1sm1mgi {display:grid;grid-template-columns:40% 50% 10%;row-gap:5px;column-gap:3px;}.input-container.svelte-1sm1mgi .none-params:where(.svelte-1sm1mgi) {font-size:12px;background:#f8f8f8;height:40px;display:flex;justify-content:center;align-items:center;border-radius:5px;width:calc(100% - 5px);grid-column:1 / -1; - /* 从第一列开始到最后一列结束 */}.input-container.svelte-1sm1mgi .input-header:where(.svelte-1sm1mgi) {font-size:12px;color:#666;}` -}; -function Ft(e, t) { - ue(t, !0), je(e, Km); - const [n, r] = tt(), o = () => j(h(l), "$node", n), i = w(t, "noneParameterText", 7, "无输入参数"), s = w(t, "dataKeyName", 7, "parameters"); - let a = mt(), l = /* @__PURE__ */ Me(() => pr(a)), u = /* @__PURE__ */ Me(() => { - var x; - return [...((x = o()) == null ? void 0 : x.data[s()]) || []]; - }); - var c = Fm(), f = X(c); - { - var d = (x) => { - var k = Xm(); - Te(4), L(x, k); - }; - be(f, (x) => { - h(u).length !== 0 && x(d); - }); - } - var g = R(f, 2); - zt( - g, - 19, - () => h(u), - (x) => x.id, - (x, k, E) => { - kd(x, { - get parameter() { - return h(k); - }, - get index() { - return h(E); - }, - get dataKeyName() { - return s(); - } - }); - }, - (x) => { - var k = Wm(), E = X(k, !0); - Z(k), $e(() => wn(E, i())), L(x, k); - } - ), Z(c), L(e, c); - var p = ce({ - get noneParameterText() { - return i(); - }, - set noneParameterText(x = "无输入参数") { - i(x), y(); - }, - get dataKeyName() { - return s(); - }, - set dataKeyName(x = "parameters") { - s(x), y(); - } - }); - return r(), p; -} -re(Ft, { noneParameterText: {}, dataKeyName: {} }, [], [], !0); -var qm = /* @__PURE__ */ xe(''), Gm = /* @__PURE__ */ xe(''), Um = /* @__PURE__ */ ne('
', 1); -const jm = { - hash: "svelte-11h445j", - code: ".heading.svelte-11h445j {display:flex;margin-bottom:10px;}" -}; -function Ed(e, t) { - ue(t, !0), je(e, jm); - const n = w(t, "data", 7), r = /* @__PURE__ */ Et(t, [ - "$$slots", - "$$events", - "$$legacy", - "$$host", - "data" - ]), o = mt(), { addParameter: i } = zn(); - return Cn(e, ct( - { - get data() { - return n(); - } - }, - () => r, - { - allowExecute: !1, - showSourceHandle: !1, - icon: (a) => { - var l = qm(); - L(a, l); - }, - children: (a, l) => { - var u = Um(), c = _e(u), f = X(c); - Je(f, { - level: 3, - children: (p, x) => { - Te(); - var k = Ie("输出参数"); - L(p, k); - }, - $$slots: { default: !0 } - }); - var d = R(f, 2); - Ge(d, { - class: "input-btn-more", - style: "margin-left: auto", - onclick: () => { - i(o, "outputDefs"); - }, - children: (p, x) => { - var k = Gm(); - L(p, k); - }, - $$slots: { default: !0 } - }), Z(c); - var g = R(c, 2); - Ft(g, { - noneParameterText: "无输出参数", - dataKeyName: "outputDefs" - }), L(a, u); - }, - $$slots: { icon: !0, default: !0 } - } - )), ce({ - get data() { - return n(); - }, - set data(s) { - n(s), y(); - } - }); -} -re(Ed, { data: {} }, [], [], !0); -const Gi = () => ar("tinyflow_options"); -var Jm = /* @__PURE__ */ xe(''), Qm = /* @__PURE__ */ ne('
'), ey = /* @__PURE__ */ ne('
默认值:
参数描述:
'), ty = /* @__PURE__ */ ne('
', 1); -const ny = { - hash: "svelte-1cfeest", - code: ".input-item.svelte-1cfeest {display:flex;align-items:center;gap:2px;}.input-more-setting.svelte-1cfeest {display:flex;flex-direction:column;gap:10px;padding:10px;background:#fff;border:1px solid #ddd;border-radius:5px;width:200px;box-shadow:0 0 10px 2px rgba(0, 0, 0, 0.1);}.input-more-setting.svelte-1cfeest .input-more-item:where(.svelte-1cfeest) {display:flex;flex-direction:column;gap:3px;font-size:12px;color:#666;}" -}; -function $d(e, t) { - ue(t, !0), je(e, ny); - const [n, r] = tt(), o = () => j(h(u), "$node", n), i = w(t, "parameter", 7), s = w(t, "position", 7), a = w(t, "dataKeyName", 7); - let l = mt(), u = /* @__PURE__ */ Me(() => pr(l)), c = /* @__PURE__ */ Me(() => { - var I; - let P = (I = o()) == null ? void 0 : I.data[a()], M; - if (P && s().length > 0) { - let B = P; - for (let F = 0; F < s().length; F++) { - const K = s()[F]; - F == s().length - 1 ? M = B[K] : B = B[K].children; - } - } - return { ...i(), ...M }; - }); - const { updateNodeData: f } = Bt(), d = (P, M) => { - f(l, (I) => { - const B = I.data[a()]; - if (B && s().length > 0) { - let F = B; - for (let K = 0; K < s().length; K++) { - const oe = s()[K]; - K == s().length - 1 ? F[oe] = { ...F[oe], [P]: M } : F = B[oe].children; - } - } - return { [a()]: B }; - }); - }, g = (P) => { - const M = P.target.value; - d("name", M); - }, p = (P) => { - const M = P.value; - d("dataType", M); - }; - let x; - const k = () => { - f(l, (P) => { - let M = P.data[a()]; - if (M && s().length > 0) { - let I = M; - for (let B = 0; B < s().length; B++) { - const F = s()[B]; - B == s().length - 1 ? I.splice(F, 1) : I = I[F].children; - } - } - return { [a()]: [...M] }; - }), x == null || x.hide(); - }, E = () => { - f(l, (P) => { - let M = P.data[a()]; - if (M && s().length > 0) { - let I = M; - for (let B = 0; B < s().length; B++) { - const F = s()[B]; - B == s().length - 1 ? I[F].children ? I[F].children.push({ - id: Rr(), - name: "newParam", - dataType: "String" - }) : I[F].children = [ - { - id: Rr(), - name: "newParam", - dataType: "String" - } - ] : I = I[F].children; - } - } - return { [a()]: [...M] }; - }); - }; - var m = ty(), _ = _e(m), v = X(_); - { - var b = (P) => { - var M = et(), I = _e(M); - zt(I, 17, s, Ai, (B, F) => { - Te(); - var K = Ie(" "); - L(B, K); - }), L(P, M); - }; - be(v, (P) => { - s().length > 1 && P(b); - }); - } - var N = R(v, 2); - const $ = /* @__PURE__ */ Me(() => h(c).nameDisabled === !0); - _t(N, { - style: "width: 100%;", - get value() { - return h(c).name; - }, - placeholder: "请输入参数名称", - oninput: g, - get disabled() { - return h($); - } - }), Z(_); - var T = R(_, 2), A = X(T); - const D = /* @__PURE__ */ Me(() => h(c).dataType ? [h(c).dataType] : []), O = /* @__PURE__ */ Me(() => h(c).dataTypeDisabled === !0); - pn(A, { - items: yd, - style: "width: 100%", - defaultValue: ["String"], - get value() { - return h(D); - }, - get disabled() { - return h(O); - }, - onSelect: p - }); - var V = R(A, 2); - { - var z = (P) => { - Ge(P, { - class: "input-btn-more", - style: "margin-left: auto", - onclick: E, - children: (M, I) => { - var B = Jm(); - L(M, B); - }, - $$slots: { default: !0 } - }); - }; - be(V, (P) => { - (h(c).dataType === "Object" || h(c).dataType === "Array") && h(c).addChildDisabled !== !0 && P(z); - }); - } - Z(T); - var S = R(T, 2), H = X(S); - An( - Vo(H, { - placement: "bottom", - floating: (M) => { - var I = ey(), B = X(I), F = R(X(B)); - kt(F, { - rows: 1, - style: "width: 100%;", - onchange: (de) => { - const we = de.target.value; - d("defaultValue", we); - } - }), Z(B); - var K = R(B, 2), oe = R(X(K)); - kt(oe, { - rows: 3, - style: "width: 100%;", - onchange: (de) => { - const we = de.target.value; - d("description", we); - } - }), Z(K); - var J = R(K, 2); - { - var W = (de) => { - var we = Qm(), Ce = X(we); - Ge(Ce, { - onclick: k, - children: (fe, ze) => { - Te(); - var ie = Ie("删除"); - L(fe, ie); - }, - $$slots: { default: !0 } - }), Z(we), L(de, we); - }; - be(J, (de) => { - h(c).deleteDisabled !== !0 && de(W); - }); - } - Z(I), L(M, I); - }, - children: (M, I) => { - qi(M, {}); - }, - $$slots: { floating: !0, default: !0 } - }), - (M) => x = M, - () => x - ), Z(S), L(e, m); - var C = ce({ - get parameter() { - return i(); - }, - set parameter(P) { - i(P), y(); - }, - get position() { - return s(); - }, - set position(P) { - s(P), y(); - }, - get dataKeyName() { - return a(); - }, - set dataKeyName(P) { - a(P), y(); - } - }); - return r(), C; -} -re($d, { parameter: {}, position: {}, dataKeyName: {} }, [], [], !0); -var ry = /* @__PURE__ */ ne(" ", 1), oy = /* @__PURE__ */ ne('
'), iy = /* @__PURE__ */ ne('
参数名称
参数类型
', 1), sy = /* @__PURE__ */ ne('
'); -const ay = { - hash: "svelte-1sm1mgi", - code: `.input-container.svelte-1sm1mgi {display:grid;grid-template-columns:40% 50% 10%;row-gap:5px;column-gap:3px;}.input-container.svelte-1sm1mgi .none-params:where(.svelte-1sm1mgi) {font-size:12px;background:#f8f8f8;height:40px;display:flex;justify-content:center;align-items:center;border-radius:5px;width:calc(100% - 5px);grid-column:1 / -1; - /* 从第一列开始到最后一列结束 */}.input-container.svelte-1sm1mgi .input-header:where(.svelte-1sm1mgi) {font-size:12px;color:#666;}` -}; -function er(e, t) { - ue(t, !0), je(e, ay); - const [n, r] = tt(), o = () => j(h(u), "$node", n), i = (k, E = dt, m = dt) => { - var _ = et(), v = _e(_); - zt( - v, - 19, - E, - (b) => `${b.id}_${b.children ? b.children.length : 0}`, - (b, N, $) => { - var T = ry(), A = _e(T); - const D = /* @__PURE__ */ Me(() => [...m(), h($)]); - $d(A, { - get parameter() { - return h(N); - }, - get position() { - return h(D); - }, - get dataKeyName() { - return a(); - } - }); - var O = R(A, 2); - { - var V = (z) => { - var S = /* @__PURE__ */ pe(() => [...m(), h($)]); - i(z, () => h(N).children, () => h(S)); - }; - be(O, (z) => { - h(N).children && z(V); - }); - } - L(b, T); - }, - (b) => { - var N = et(), $ = _e(N); - { - var T = (A) => { - var D = oy(), O = X(D, !0); - Z(D), $e(() => wn(O, s())), L(A, D); - }; - be($, (A) => { - m().length === 0 && A(T); - }); - } - L(b, N); - } - ), L(k, _); - }, s = w(t, "noneParameterText", 7, "无输出参数"), a = w(t, "dataKeyName", 7, "outputDefs"); - let l = mt(), u = /* @__PURE__ */ Me(() => pr(l)), c = /* @__PURE__ */ Me(() => { - var k; - return [...((k = o()) == null ? void 0 : k.data[a()]) || []]; - }); - var f = sy(), d = X(f); - { - var g = (k) => { - var E = iy(); - Te(4), L(k, E); - }; - be(d, (k) => { - h(c).length !== 0 && k(g); - }); - } - var p = R(d, 2); - i(p, () => h(c) || [], () => []), Z(f), L(e, f); - var x = ce({ - get noneParameterText() { - return s(); - }, - set noneParameterText(k = "无输出参数") { - s(k), y(); - }, - get dataKeyName() { - return a(); - }, - set dataKeyName(k = "outputDefs") { - a(k), y(); - } - }); - return r(), x; -} -re(er, { noneParameterText: {}, dataKeyName: {} }, [], [], !0); -var ly = /* @__PURE__ */ xe(''), uy = /* @__PURE__ */ xe(''), cy = /* @__PURE__ */ xe(''), dy = /* @__PURE__ */ ne('
模型
系统提示词
用户提示词
', 1); -const fy = { - hash: "svelte-15t2v24", - code: ".heading.svelte-15t2v24 {display:flex;margin-bottom:10px;}.setting-title.svelte-15t2v24 {font-size:12px;color:#999;margin-bottom:4px;margin-top:10px;}.setting-item.svelte-15t2v24 {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px;}" -}; -function Sd(e, t) { - ue(t, !0), je(e, fy); - const n = w(t, "data", 7), r = /* @__PURE__ */ Et(t, [ - "$$slots", - "$$events", - "$$legacy", - "$$host", - "data" - ]), o = mt(), { addParameter: i } = zn(), s = Gi(); - let a = sr(Vt([])); - xn(async () => { - var c, f; - const u = await ((f = (c = s.provider) == null ? void 0 : c.llm) == null ? void 0 : f.call(c)); - h(a).push(...u || []); - }); - const { updateNodeData: l } = Bt(); - return Cn(e, ct( - { - get data() { - return n(); - } - }, - () => r, - { - icon: (c) => { - var f = ly(); - L(c, f); - }, - children: (c, f) => { - var d = dy(), g = _e(d), p = X(g); - Je(p, { - level: 3, - children: (C, P) => { - Te(); - var M = Ie("输入参数"); - L(C, M); - }, - $$slots: { default: !0 } - }); - var x = R(p, 2); - Ge(x, { - class: "input-btn-more", - style: "margin-left: auto", - onclick: () => { - i(o); - }, - children: (C, P) => { - var M = uy(); - L(C, M); - }, - $$slots: { default: !0 } - }), Z(g); - var k = R(g, 2); - Ft(k, {}); - var E = R(k, 2); - Je(E, { - level: 3, - mt: "10px", - children: (C, P) => { - Te(); - var M = Ie("模型设置"); - L(C, M); - }, - $$slots: { default: !0 } - }); - var m = R(E, 4), _ = X(m); - const v = /* @__PURE__ */ Me(() => n().llmId ? [n().llmId] : []); - pn(_, { - get items() { - return h(a); - }, - style: "width: 100%", - placeholder: "请选择模型", - onSelect: (C) => { - const P = C.value; - l(o, () => ({ llmId: P })); - }, - get value() { - return h(v); - } - }); - var b = R(_, 2); - qi(b, {}), Z(m); - var N = R(m, 4), $ = X(N); - const T = /* @__PURE__ */ Me(() => n().systemPrompt || ""); - kt($, { - rows: 5, - placeholder: "请输入系统提示词", - style: "width: 100%", - get value() { - return h(T); - }, - oninput: (C) => { - l(o, { systemPrompt: C.target.value }); - } - }), Z(N); - var A = R(N, 4), D = X(A); - const O = /* @__PURE__ */ Me(() => n().userPrompt || ""); - kt(D, { - rows: 5, - placeholder: "请输入用户提示词", - style: "width: 100%", - get value() { - return h(O); - }, - oninput: (C) => { - l(o, { userPrompt: C.target.value }); - } - }), Z(A); - var V = R(A, 2), z = X(V); - Je(z, { - level: 3, - mt: "10px", - children: (C, P) => { - Te(); - var M = Ie("输出参数"); - L(C, M); - }, - $$slots: { default: !0 } - }); - var S = R(z, 2); - Ge(S, { - class: "input-btn-more", - style: "margin-left: auto", - onclick: () => { - i(o, "outputDefs"); - }, - children: (C, P) => { - var M = cy(); - L(C, M); - }, - $$slots: { default: !0 } - }), Z(V); - var H = R(V, 2); - er(H, {}), L(c, d); - }, - $$slots: { icon: !0, default: !0 } - } - )), ce({ - get data() { - return n(); - }, - set data(u) { - n(u), y(); - } - }); -} -re(Sd, { data: {} }, [], [], !0); -var gy = /* @__PURE__ */ xe(''), hy = /* @__PURE__ */ xe(''), vy = /* @__PURE__ */ xe(''), py = /* @__PURE__ */ ne('
执行引擎
执行代码
', 1); -const my = { - hash: "svelte-15t2v24", - code: ".heading.svelte-15t2v24 {display:flex;margin-bottom:10px;}.setting-title.svelte-15t2v24 {font-size:12px;color:#999;margin-bottom:4px;margin-top:10px;}.setting-item.svelte-15t2v24 {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px;}" -}; -function Pd(e, t) { - ue(t, !0), je(e, my); - const n = w(t, "data", 7), r = /* @__PURE__ */ Et(t, [ - "$$slots", - "$$events", - "$$legacy", - "$$host", - "data" - ]), o = mt(), { addParameter: i } = zn(), { updateNodeData: s } = Bt(), a = [ - { label: "QLExpress", value: "qlexpress" }, - { label: "Groovy", value: "groovy" } - ]; - return Cn(e, ct( - { - get data() { - return n(); - } - }, - () => r, - { - icon: (u) => { - var c = gy(); - L(u, c); - }, - children: (u, c) => { - var f = py(), d = _e(f), g = X(d); - Je(g, { - level: 3, - children: (O, V) => { - Te(); - var z = Ie("输入参数"); - L(O, z); - }, - $$slots: { default: !0 } - }); - var p = R(g, 2); - Ge(p, { - class: "input-btn-more", - style: "margin-left: auto", - onclick: () => { - i(o); - }, - children: (O, V) => { - var z = hy(); - L(O, z); - }, - $$slots: { default: !0 } - }), Z(d); - var x = R(d, 2); - Ft(x, {}); - var k = R(x, 2); - Je(k, { - level: 3, - mt: "10px", - children: (O, V) => { - Te(); - var z = Ie("代码"); - L(O, z); - }, - $$slots: { default: !0 } - }); - var E = R(k, 4), m = X(E); - const _ = /* @__PURE__ */ Me(() => n().engine ? [n().engine] : ["qlexpress"]); - pn(m, { - items: a, - style: "width: 100%", - placeholder: "请选择执行引擎", - onSelect: (O) => { - const V = O.value; - s(o, () => ({ engine: V })); - }, - get value() { - return h(_); - } - }), Z(E); - var v = R(E, 4), b = X(v); - const N = /* @__PURE__ */ Me(() => n().code || ""); - kt(b, { - rows: 10, - placeholder: "请输入执行代码", - style: "width: 100%", - onchange: (O) => { - s(o, () => ({ code: O.target.value })); - }, - get value() { - return h(N); - } - }), Z(v); - var $ = R(v, 2), T = X($); - Je(T, { - level: 3, - mt: "10px", - children: (O, V) => { - Te(); - var z = Ie("输出参数"); - L(O, z); - }, - $$slots: { default: !0 } - }); - var A = R(T, 2); - Ge(A, { - class: "input-btn-more", - style: "margin-left: auto", - onclick: () => { - i(o, "outputDefs"); - }, - children: (O, V) => { - var z = vy(); - L(O, z); - }, - $$slots: { default: !0 } - }), Z($); - var D = R($, 2); - er(D, {}), L(u, f); - }, - $$slots: { icon: !0, default: !0 } - } - )), ce({ - get data() { - return n(); - }, - set data(l) { - n(l), y(); - } - }); -} -re(Pd, { data: {} }, [], [], !0); -var yy = /* @__PURE__ */ xe(''), wy = /* @__PURE__ */ xe(''), _y = /* @__PURE__ */ ne('
执行代码
', 1); -const xy = { - hash: "svelte-15t2v24", - code: ".heading.svelte-15t2v24 {display:flex;margin-bottom:10px;}.setting-title.svelte-15t2v24 {font-size:12px;color:#999;margin-bottom:4px;margin-top:10px;}.setting-item.svelte-15t2v24 {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px;}" -}; -function Nd(e, t) { - ue(t, !0), je(e, xy); - const n = w(t, "data", 7), r = /* @__PURE__ */ Et(t, [ - "$$slots", - "$$events", - "$$legacy", - "$$host", - "data" - ]), o = mt(), { addParameter: i } = zn(), { updateNodeData: s } = Bt(); - return Nr(() => { - (!n().outputDefs || n().outputDefs.length === 0) && i(o, "outputDefs", { - name: "output", - dataType: "String", - dataTypeDisabled: !0, - deleteDisabled: !0 - }); - }), Cn(e, ct( - { - get data() { - return n(); - } - }, - () => r, - { - icon: (l) => { - var u = yy(); - L(l, u); - }, - children: (l, u) => { - var c = _y(), f = _e(c), d = X(f); - Je(d, { - level: 3, - children: (N, $) => { - Te(); - var T = Ie("输入参数"); - L(N, T); - }, - $$slots: { default: !0 } - }); - var g = R(d, 2); - Ge(g, { - class: "input-btn-more", - style: "margin-left: auto", - onclick: () => { - i(o); - }, - children: (N, $) => { - var T = wy(); - L(N, T); - }, - $$slots: { default: !0 } - }), Z(f); - var p = R(f, 2); - Ft(p, {}); - var x = R(p, 2); - Je(x, { - level: 3, - mt: "10px", - children: (N, $) => { - Te(); - var T = Ie("代码"); - L(N, T); - }, - $$slots: { default: !0 } - }); - var k = R(x, 4), E = X(k); - const m = /* @__PURE__ */ Me(() => n().template || ""); - kt(E, { - rows: 10, - placeholder: "请输入执行代码", - style: "width: 100%", - onchange: (N) => { - s(o, () => ({ template: N.target.value })); - }, - get value() { - return h(m); - } - }), Z(k); - var _ = R(k, 2), v = X(_); - Je(v, { - level: 3, - mt: "10px", - children: (N, $) => { - Te(); - var T = Ie("输出参数"); - L(N, T); - }, - $$slots: { default: !0 } - }), Z(_); - var b = R(_, 2); - er(b, {}), L(l, c); - }, - $$slots: { icon: !0, default: !0 } - } - )), ce({ - get data() { - return n(); - }, - set data(a) { - n(a), y(); - } - }); -} -re(Nd, { data: {} }, [], [], !0); -var by = /* @__PURE__ */ xe(''), Cy = /* @__PURE__ */ xe(''), ky = /* @__PURE__ */ xe(''), Ey = /* @__PURE__ */ xe(''), $y = /* @__PURE__ */ ne('
', 1), Sy = /* @__PURE__ */ xe(''), Py = /* @__PURE__ */ ne('
', 1), Ny = /* @__PURE__ */ ne('
'), Ty = /* @__PURE__ */ ne('
'), My = /* @__PURE__ */ xe(''), Hy = /* @__PURE__ */ ne('
', 1); -const Dy = { - hash: "svelte-1vtcqdz", - code: ".heading.svelte-1vtcqdz {display:flex;margin-bottom:10px;}.radio-group.svelte-1vtcqdz {display:flex;margin:10px 0;}.radio-group.svelte-1vtcqdz label:where(.svelte-1vtcqdz) {display:flex;font-size:14px;}" -}; -function Td(e, t) { - ue(t, !0), je(e, Dy); - const n = w(t, "data", 7), r = /* @__PURE__ */ Et(t, [ - "$$slots", - "$$events", - "$$legacy", - "$$host", - "data" - ]), o = mt(), { addParameter: i } = zn(), { updateNodeData: s } = Bt(); - return Cn(e, ct( - { - get data() { - return n(); - } - }, - () => r, - { - icon: (l) => { - var u = by(); - L(l, u); - }, - children: (l, u) => { - var c = Hy(), f = _e(c), d = X(f), g = X(d); - pn(g, { - items: [ - { value: "get", label: "GET" }, - { value: "post", label: "POST" }, - { value: "put", label: "PUT" }, - { value: "delete", label: "DELETE" }, - { value: "head", label: "HEAD" }, - { value: "patch", label: "PATCH" } - ], - style: "width: 100%", - placeholder: "请选择模型", - value: ["get"] - }), Z(d); - var p = R(d, 2), x = X(p); - _t(x, { placeholder: "请输入url", style: "width: 100%" }), Z(p), Z(f); - var k = R(f, 2), E = X(k); - Je(E, { - level: 3, - children: (he, se) => { - Te(); - var ke = Ie("Http 头信息"); - L(he, ke); - }, - $$slots: { default: !0 } - }); - var m = R(E, 2); - Ge(m, { - class: "input-btn-more", - style: "margin-left: auto", - onclick: () => { - i(o, "headers"); - }, - children: (he, se) => { - var ke = Cy(); - L(he, ke); - }, - $$slots: { default: !0 } - }), Z(k); - var _ = R(k, 2); - Ft(_, { dataKeyName: "headers" }); - var v = R(_, 2), b = X(v); - Je(b, { - level: 3, - children: (he, se) => { - Te(); - var ke = Ie("参数"); - L(he, ke); - }, - $$slots: { default: !0 } - }); - var N = R(b, 2); - Ge(N, { - class: "input-btn-more", - style: "margin-left: auto", - onclick: () => { - i(o, "urlParameters"); - }, - children: (he, se) => { - var ke = ky(); - L(he, ke); - }, - $$slots: { default: !0 } - }), Z(v); - var $ = R(v, 2); - Ft($, { dataKeyName: "urlParameters" }); - var T = R($, 2); - Je(T, { - level: 3, - mt: "10px", - children: (he, se) => { - Te(); - var ke = Ie("Body"); - L(he, ke); - }, - $$slots: { default: !0 } - }); - var A = R(T, 2), D = X(A), O = X(D); - const V = /* @__PURE__ */ Me(() => !n().bodyType); - _t(O, { - type: "radio", - name: "bodyType", - value: "", - get checked() { - return h(V); - }, - onchange: (he) => { - var se; - (se = he.target) != null && se.checked && s(o, { bodyType: "" }); - } - }), Te(), Z(D); - var z = R(D, 2), S = X(z); - const H = /* @__PURE__ */ Me(() => n().bodyType === "form-data"); - _t(S, { - type: "radio", - name: "bodyType", - value: "form-data", - get checked() { - return h(H); - }, - onchange: (he) => { - var se; - (se = he.target) != null && se.checked && s(o, { bodyType: "form-data" }); - } - }), Te(), Z(z); - var C = R(z, 2), P = X(C); - const M = /* @__PURE__ */ Me(() => n().bodyType === "x-www-form-urlencoded"); - _t(P, { - type: "radio", - name: "bodyType", - value: "x-www-form-urlencoded", - get checked() { - return h(M); - }, - onchange: (he) => { - var se; - (se = he.target) != null && se.checked && s(o, { bodyType: "x-www-form-urlencoded" }); - } - }), Te(), Z(C); - var I = R(C, 2), B = X(I); - const F = /* @__PURE__ */ Me(() => n().bodyType === "json"); - _t(B, { - type: "radio", - name: "bodyType", - value: "json", - get checked() { - return h(F); - }, - onchange: (he) => { - var se; - (se = he.target) != null && se.checked && s(o, { bodyType: "json" }); - } - }), Te(), Z(I); - var K = R(I, 2), oe = X(K); - const J = /* @__PURE__ */ Me(() => n().bodyType === "raw"); - _t(oe, { - type: "radio", - name: "bodyType", - value: "raw", - get checked() { - return h(J); - }, - onchange: (he) => { - var se; - (se = he.target) != null && se.checked && s(o, { bodyType: "raw" }); - } - }), Te(), Z(K), Z(A); - var W = R(A, 2); - { - var de = (he) => { - var se = $y(), ke = _e(se), Ne = X(ke); - Je(Ne, { - level: 3, - children: (Oe, ut) => { - Te(); - var nt = Ie("参数"); - L(Oe, nt); - }, - $$slots: { default: !0 } - }); - var qe = R(Ne, 2); - Ge(qe, { - class: "input-btn-more", - style: "margin-left: auto", - onclick: () => { - i(o, "fromData"); - }, - children: (Oe, ut) => { - var nt = Ey(); - L(Oe, nt); - }, - $$slots: { default: !0 } - }), Z(ke); - var Re = R(ke, 2); - Ft(Re, { dataKeyName: "fromData" }), L(he, se); - }; - be(W, (he) => { - n().bodyType === "form-data" && he(de); - }); - } - var we = R(W, 2); - { - var Ce = (he) => { - var se = Py(), ke = _e(se), Ne = X(ke); - Je(Ne, { - level: 3, - children: (Oe, ut) => { - Te(); - var nt = Ie("参数"); - L(Oe, nt); - }, - $$slots: { default: !0 } - }); - var qe = R(Ne, 2); - Ge(qe, { - class: "input-btn-more", - style: "margin-left: auto", - onclick: () => { - i(o, "fromUrlencoded"); - }, - children: (Oe, ut) => { - var nt = Sy(); - L(Oe, nt); - }, - $$slots: { default: !0 } - }), Z(ke); - var Re = R(ke, 2); - Ft(Re, { dataKeyName: "fromUrlencoded" }), L(he, se); - }; - be(we, (he) => { - n().bodyType === "x-www-form-urlencoded" && he(Ce); - }); - } - var fe = R(we, 2); - { - var ze = (he) => { - var se = Ny(), ke = X(se); - kt(ke, { - rows: "5", - style: "width: 100%", - placeholder: "请输入 json 信息", - get value() { - return n().bodyJson; - }, - oninput: (Ne) => { - s(o, { bodyJson: Ne.target.value }); - } - }), Z(se), L(he, se); - }; - be(fe, (he) => { - n().bodyType === "json" && he(ze); - }); - } - var ie = R(fe, 2); - { - var ge = (he) => { - var se = Ty(), ke = X(se); - kt(ke, { - rows: "5", - style: "width: 100%", - placeholder: "请输入请求信息", - get value() { - return n().bodyRaw; - }, - oninput: (Ne) => { - s(o, { bodyRaw: Ne.target.value }); - } - }), Z(se), L(he, se); - }; - be(ie, (he) => { - n().bodyType === "raw" && he(ge); - }); - } - var Ye = R(ie, 2), Ae = X(Ye); - Je(Ae, { - level: 3, - mt: "10px", - children: (he, se) => { - Te(); - var ke = Ie("输出参数"); - L(he, ke); - }, - $$slots: { default: !0 } - }); - var Ze = R(Ae, 2); - Ge(Ze, { - class: "input-btn-more", - style: "margin-left: auto", - onclick: () => { - i(o, "outputDefs"); - }, - children: (he, se) => { - var ke = My(); - L(he, ke); - }, - $$slots: { default: !0 } - }), Z(Ye); - var ee = R(Ye, 2); - er(ee, {}), L(l, c); - }, - $$slots: { icon: !0, default: !0 } - } - )), ce({ - get data() { - return n(); - }, - set data(a) { - n(a), y(); - } - }); -} -re(Td, { data: {} }, [], [], !0); -var Ay = /* @__PURE__ */ xe(''), Vy = /* @__PURE__ */ xe(''), Oy = /* @__PURE__ */ ne('
知识库
获取数据量
', 1); -const Ly = { - hash: "svelte-15t2v24", - code: ".heading.svelte-15t2v24 {display:flex;margin-bottom:10px;}.setting-title.svelte-15t2v24 {font-size:12px;color:#999;margin-bottom:4px;margin-top:10px;}.setting-item.svelte-15t2v24 {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px;}" -}; -function Md(e, t) { - ue(t, !0), je(e, Ly); - const n = w(t, "data", 7), r = /* @__PURE__ */ Et(t, [ - "$$slots", - "$$events", - "$$legacy", - "$$host", - "data" - ]), o = mt(), { addParameter: i } = zn(), s = Gi(); - let a = sr(Vt([])); - xn(async () => { - var c, f; - const u = await ((f = (c = s.provider) == null ? void 0 : c.knowledge) == null ? void 0 : f.call(c)); - h(a).push(...u || []); - }); - const { updateNodeData: l } = Bt(); - return Nr(() => { - (!n().outputDefs || n().outputDefs.length === 0) && i(o, "outputDefs", { - name: "documents", - dataType: "Array", - nameDisabled: !0, - dataTypeDisabled: !0, - addChildDisabled: !0, - children: [ - { - name: "title", - dataType: "String", - nameDisabled: !0, - dataTypeDisabled: !0 - }, - { - name: "content", - dataType: "String", - nameDisabled: !0, - dataTypeDisabled: !0 - }, - { - name: "documentId", - dataType: "Number", - nameDisabled: !0, - dataTypeDisabled: !0 - }, - { - name: "knowledgeId", - dataType: "Number", - nameDisabled: !0, - dataTypeDisabled: !0 - } - ] - }); - }), Cn(e, ct( - { - get data() { - return n(); - } - }, - () => r, - { - icon: (c) => { - var f = Ay(); - L(c, f); - }, - children: (c, f) => { - var d = Oy(), g = _e(d), p = X(g); - Je(p, { - level: 3, - children: (D, O) => { - Te(); - var V = Ie("输入参数"); - L(D, V); - }, - $$slots: { default: !0 } - }); - var x = R(p, 2); - Ge(x, { - class: "input-btn-more", - style: "margin-left: auto", - onclick: () => { - i(o); - }, - children: (D, O) => { - var V = Vy(); - L(D, V); - }, - $$slots: { default: !0 } - }), Z(g); - var k = R(g, 2); - Ft(k, {}); - var E = R(k, 2); - Je(E, { - level: 3, - mt: "10px", - children: (D, O) => { - Te(); - var V = Ie("知识库设置"); - L(D, V); - }, - $$slots: { default: !0 } - }); - var m = R(E, 4), _ = X(m); - const v = /* @__PURE__ */ Me(() => n().knowledgeId ? [n().knowledgeId] : []); - pn(_, { - get items() { - return h(a); - }, - style: "width: 100%", - placeholder: "请选择知识库", - onSelect: (D) => { - const O = D.value; - l(o, () => ({ knowledgeId: O })); - }, - get value() { - return h(v); - } - }), Z(m); - var b = R(m, 4), N = X(b); - _t(N, { placeholder: "搜索的数据条数", style: "width: 100%" }), Z(b); - var $ = R(b, 2), T = X($); - Je(T, { - level: 3, - mt: "10px", - children: (D, O) => { - Te(); - var V = Ie("输出参数"); - L(D, V); - }, - $$slots: { default: !0 } - }), Z($); - var A = R($, 2); - er(A, {}), L(c, d); - }, - $$slots: { icon: !0, default: !0 } - } - )), ce({ - get data() { - return n(); - }, - set data(u) { - n(u), y(); - } - }); -} -re(Md, { data: {} }, [], [], !0); -var Iy = /* @__PURE__ */ xe(''), zy = /* @__PURE__ */ xe(''), Ry = /* @__PURE__ */ ne('
API 服务商
API Key
关键字
数据量
其他参数
', 1); -const By = { - hash: "svelte-15t2v24", - code: ".heading.svelte-15t2v24 {display:flex;margin-bottom:10px;}.setting-title.svelte-15t2v24 {font-size:12px;color:#999;margin-bottom:4px;margin-top:10px;}.setting-item.svelte-15t2v24 {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px;}" -}; -function Hd(e, t) { - ue(t, !0), je(e, By); - const n = w(t, "data", 7), r = /* @__PURE__ */ Et(t, [ - "$$slots", - "$$events", - "$$legacy", - "$$host", - "data" - ]), o = mt(), { addParameter: i } = zn(), s = Gi(); - let a = sr(Vt([])); - xn(async () => { - var c; - const u = await ((c = s.provider) == null ? void 0 : c.knowledge()); - h(a).push(...u || []); - }); - const { updateNodeData: l } = Bt(); - return Nr(() => { - (!n().outputDefs || n().outputDefs.length === 0) && i(o, "outputDefs", { - name: "documents", - dataType: "Array", - nameDisabled: !0, - dataTypeDisabled: !0, - addChildDisabled: !0, - children: [ - { - name: "title", - dataType: "String", - nameDisabled: !0, - dataTypeDisabled: !0 - }, - { - name: "content", - dataType: "String", - nameDisabled: !0, - dataTypeDisabled: !0 - }, - { - name: "documentId", - dataType: "Number", - nameDisabled: !0, - dataTypeDisabled: !0 - }, - { - name: "knowledgeId", - dataType: "Number", - nameDisabled: !0, - dataTypeDisabled: !0 - } - ] - }); - }), Cn(e, ct( - { - get data() { - return n(); - } - }, - () => r, - { - icon: (c) => { - var f = Iy(); - L(c, f); - }, - children: (c, f) => { - var d = Ry(), g = _e(d), p = X(g); - Je(p, { - level: 3, - children: (C, P) => { - Te(); - var M = Ie("输入参数"); - L(C, M); - }, - $$slots: { default: !0 } - }); - var x = R(p, 2); - Ge(x, { - class: "input-btn-more", - style: "margin-left: auto", - onclick: () => { - i(o); - }, - children: (C, P) => { - var M = zy(); - L(C, M); - }, - $$slots: { default: !0 } - }), Z(g); - var k = R(g, 2); - Ft(k, {}); - var E = R(k, 2); - Je(E, { - level: 3, - mt: "10px", - children: (C, P) => { - Te(); - var M = Ie("搜索引擎设置"); - L(C, M); - }, - $$slots: { default: !0 } - }); - var m = R(E, 4), _ = X(m); - const v = /* @__PURE__ */ Me(() => n().knowledgeId ? [n().knowledgeId] : []); - pn(_, { - get items() { - return h(a); - }, - style: "width: 100%", - placeholder: "请选择 API 服务商", - onSelect: (C) => { - const P = C.value; - l(o, () => ({ knowledgeId: P })); - }, - get value() { - return h(v); - } - }), Z(m); - var b = R(m, 4), N = X(b); - _t(N, { - placeholder: "请输入 API Key", - style: "width: 100%" - }), Z(b); - var $ = R(b, 4), T = X($); - _t(T, { placeholder: "请输入关键字", style: "width: 100%" }), Z($); - var A = R($, 4), D = X(A); - _t(D, { placeholder: "搜索的数据条数", style: "width: 100%" }), Z(A); - var O = R(A, 4), V = X(O); - kt(V, { - rows: 3, - placeholder: "请输入其他参数(Property 格式)", - style: "width: 100%" - }), Z(O); - var z = R(O, 2), S = X(z); - Je(S, { - level: 3, - mt: "10px", - children: (C, P) => { - Te(); - var M = Ie("输出参数"); - L(C, M); - }, - $$slots: { default: !0 } - }), Z(z); - var H = R(z, 2); - er(H, {}), L(c, d); - }, - $$slots: { icon: !0, default: !0 } - } - )), ce({ - get data() { - return n(); - }, - set data(u) { - n(u), y(); - } - }); -} -re(Hd, { data: {} }, [], [], !0); -var Yy = /* @__PURE__ */ xe(''), Zy = /* @__PURE__ */ xe(''), Xy = /* @__PURE__ */ ne('
', 1); -const Wy = { - hash: "svelte-md8tgj", - code: ".heading.svelte-md8tgj {display:flex;margin-bottom:10px;}.loop_handle_wrapper ::after {content:'循环体';width:100px;height:20px;background:#000;color:#fff;display:flex;justify-content:center;align-items:center;}" -}; -function Dd(e, t) { - ue(t, !0), je(e, Wy); - const n = w(t, "data", 7), r = /* @__PURE__ */ Et(t, [ - "$$slots", - "$$events", - "$$legacy", - "$$host", - "data" - ]), o = mt(), { addParameter: i } = zn(), s = Gi(); - let a = sr(Vt([])); - return xn(async () => { - var u; - const l = await ((u = s.provider) == null ? void 0 : u.knowledge()); - h(a).push(...l || []); - }), Cn(e, ct( - { - get data() { - return n(); - } - }, - () => r, - { - icon: (c) => { - var f = Yy(); - L(c, f); - }, - handle: (c) => { - jn(c, { - type: "source", - get position() { - return Ee.Bottom; - }, - id: "loop_handle", - style: "bottom: -12px;width: 100px", - class: "loop_handle_wrapper" - }); - }, - children: (c, f) => { - var d = Xy(), g = _e(d), p = X(g); - Je(p, { - level: 3, - children: (v, b) => { - Te(); - var N = Ie("循环变量"); - L(v, N); - }, - $$slots: { default: !0 } - }); - var x = R(p, 2); - Ge(x, { - class: "input-btn-more", - style: "margin-left: auto", - onclick: () => { - i(o); - }, - children: (v, b) => { - var N = Zy(); - L(v, N); - }, - $$slots: { default: !0 } - }), Z(g); - var k = R(g, 2); - Ft(k, {}); - var E = R(k, 2), m = X(E); - Je(m, { - level: 3, - mt: "10px", - children: (v, b) => { - Te(); - var N = Ie("输出参数"); - L(v, N); - }, - $$slots: { default: !0 } - }), Z(E); - var _ = R(E, 2); - er(_, {}), L(c, d); - }, - $$slots: { icon: !0, handle: !0, default: !0 } - } - )), ce({ - get data() { - return n(); - }, - set data(l) { - n(l), y(); - } - }); -} -re(Dd, { data: {} }, [], [], !0); -const Fy = { - startNode: bd, - codeNode: Pd, - llmNode: Sd, - templateNode: Nd, - httpNode: Td, - knowledgeNode: Md, - searchEngineNode: Hd, - loopNode: Dd, - endNode: Ed -}; -var Ky = /* @__PURE__ */ ne(" ", 1); -function Ad(e, t) { - ue(t, !0); - const n = w(t, "icon", 7), r = w(t, "title", 7), o = w(t, "type", 7), i = w(t, "description", 7), s = w(t, "extra", 7); - return Ge(e, { - draggable: !0, - ondragstart: (l) => { - if (!l.dataTransfer) - return null; - const u = { - type: o(), - data: { - title: r(), - description: i(), - systemPrompt: "", - userPrompt: "", - ...s() - } - }; - l.dataTransfer.setData("application/tinyflow", JSON.stringify(u)), l.dataTransfer.effectAllowed = "move"; - }, - children: (l, u) => { - var c = Ky(), f = _e(c); - hu(f, n); - var d = R(f); - $e(() => wn(d, ` ${r() ?? ""}`)), L(l, c); - }, - $$slots: { default: !0 } - }), ce({ - get icon() { - return n(); - }, - set icon(l) { - n(l), y(); - }, - get title() { - return r(); - }, - set title(l) { - r(l), y(); - }, - get type() { - return o(); - }, - set type(l) { - o(l), y(); - }, - get description() { - return i(); - }, - set description(l) { - i(l), y(); - }, - get extra() { - return s(); - }, - set extra(l) { - s(l), y(); - } - }); -} -re( - Ad, - { - icon: {}, - title: {}, - type: {}, - description: {}, - extra: {} - }, - [], - [], - !0 -); -var qy = /* @__PURE__ */ xe(''), Gy = /* @__PURE__ */ xe(''), Uy = /* @__PURE__ */ ne('
'); -function Vd(e) { - let t = sr("base"), n = sr("show"); - const r = [ - { - icon: '', - title: "开始节点", - type: "startNode", - description: "开始定义输入参数" - }, - { - icon: '', - title: "循环", - type: "loopNode", - description: "用于循环执行任务" - }, - { - icon: '', - title: "大模型", - type: "llmNode", - description: "使用大模型处理问题" - }, - { - // icon:'', - icon: '', - title: "知识库", - type: "knowledgeNode", - description: "通过知识库获取内容" - }, - { - icon: '', - title: "搜索引擎", - type: "searchEngineNode", - description: "通过搜索引擎搜索内容" - }, - { - icon: '', - title: "Http 请求", - type: "httpNode", - description: "通过 HTTP 请求获取数据" - }, - { - icon: '', - title: "动态代码", - type: "codeNode", - description: "动态执行代码" - }, - { - icon: '', - title: "内容模板", - type: "templateNode", - description: "通过模板引擎生成内容" - }, - { - icon: '', - title: "结束节点", - type: "endNode", - description: "结束定义输出参数" - } - ], o = [ - { - label: "基础节点", - value: "base" - }, - { - label: "业务工具", - value: "tools" - } - ]; - var i = Uy(), s = X(i), a = X(s), l = X(a); - od(l, { - style: "width: 100%", - items: o, - onChange: (p) => { - G(t, Vt(p.value.toString())); - } - }), Z(a); - var u = R(a, 2), c = X(u); - zt(c, 21, () => r, Ai, (p, x) => { - Ad(p, ct(() => h(x))); - }), Z(c); - var f = R(c, 2), d = X(f); - Ge(d, { - children: (p, x) => { - Te(); - var k = Ie("测试业务按钮"); - L(p, k); - }, - $$slots: { default: !0 } - }), Z(f), Z(u), Z(s); - var g = R(s, 2); - Ge(g, { - onclick: () => { - G(n, Vt(h(n) ? "" : "show")); - }, - children: (p, x) => { - var k = et(), E = _e(k); - { - var m = (v) => { - var b = qy(); - L(v, b); - }, _ = (v) => { - var b = Gy(); - L(v, b); - }; - be(E, (v) => { - h(n) === "show" ? v(m) : v(_, !1); - }); - } - L(p, k); - }, - $$slots: { default: !0 } - }), Z(i), $e(() => { - Ct(i, 1, `tf-toolbar ${h(n) ?? ""}`), ae(c, "style", `display: ${(h(t) === "base" ? "flex" : "none") ?? ""}`), ae(f, "style", `display: ${(h(t) !== "base" ? "flex" : "none") ?? ""}`); - }), L(e, i); -} -re(Vd, {}, [], [], !0); -const jy = () => { - const { nodeLookup: e } = Ke(); - return { - getNode: (n) => { - var o; - return (o = q(e).get(n)) == null ? void 0 : o.internals.userNode; - } - }; -}, Jy = () => { - const { nodes: e } = Ke(); - return { - ensureParentInNodesBefore: (n, r) => { - e.update((o) => { - let i = -1; - for (let l = 0; l < o.length; l++) - if (o[l].id === n) { - i = l; - break; - } - if (i <= 0) - return o; - let s = -1; - for (let l = 0; l < i; l++) - if (o[l].parentId === n || o[l].id === r) { - s = l; - break; - } - if (s == -1) - return o; - const a = o[i]; - for (let l = i; l > s; l--) - o[l] = o[l - 1]; - return o[s] = a, o; - }); - } - }; -}, Qy = () => { - const { edges: e } = Ke(); - return { - getEdgesByTarget: (n) => q(e).filter((o) => o.target === n) - }; -}; -var ew = /* @__PURE__ */ ne('
边属性设置
边条件设置
'), tw = /* @__PURE__ */ ne(" ", 1), nw = /* @__PURE__ */ ne('
'); -const rw = { - hash: "svelte-1oe15vw", - code: ".panel-content.svelte-1oe15vw {padding:10px;background-color:#fff;border-radius:5px;box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);width:200px;border:1px solid #efefef;}.setting-title.svelte-1oe15vw {margin:10px 0;font-size:12px;color:#999;}" -}; -function Od(e, t) { - ue(t, !0), je(e, rw); - const n = w(t, "onInit", 7), r = Bt(); - n()(r); - let o = sr(!1); - const i = (_) => { - _.preventDefault(), _.dataTransfer && (_.dataTransfer.dropEffect = "move"); - }, s = (_) => { - var T; - _.preventDefault(); - const v = r.screenToFlowPosition({ - x: _.clientX - 250, - y: _.clientY - 100 - }), b = (T = _.dataTransfer) == null ? void 0 : T.getData("application/tinyflow"), N = b ? JSON.parse(b) : {}, $ = { - id: `node_${Rr()}`, - position: v, - data: {}, - ...N - }; - Jo.addNode($), Jo.selectNodeOnly($.id); - }, { getNode: a } = jy(), l = (_) => { - const v = a(_.source), b = a(_.target); - if (_.sourceHandle === "loop_handle" || v.parentId) { - const N = r.getEdges(); - for (let $ of N) - if ($.target === _.target) { - const T = a($.source); - if (_.sourceHandle === "loop_handle" && T.parentId !== v.id || v.parentId && T.parentId !== v.parentId) - return !1; - } - } - return !(!v.parentId && b.parentId && b.parentId !== v.id); - }, { ensureParentInNodesBefore: u } = Jy(), c = (_, v) => { - if (!v.isValid) - return; - const b = v.toNode; - if (b.parentId) - return; - const N = v.fromNode, $ = v.fromHandle, T = { position: { ...b.position } }; - if ($.id === "loop_handle" ? T.parentId = N.id : N.parentId && (T.parentId = N.parentId), T.parentId) { - const A = a(T.parentId); - T.position = { - x: b.position.x - A.position.x, - y: b.position.y - A.position.y - }, u(T.parentId, b.id), r.updateNode(b.id, T); - } - }, { getEdgesByTarget: f } = Qy(), d = (_) => { - _.edges.forEach((b) => { - const N = a(b.target); - if (N.parentId) { - const $ = f(b.target), T = a(N.parentId); - if ($.length === 0) - r.updateNode(N.id, { - parentId: void 0, - position: { - x: N.position.x + T.position.x, - y: N.position.y + T.position.y - } - }); - else { - let A = !1; - for (let D = 0; D < $.length; D++) { - const O = $[D], V = a(O.source); - if (V.parentId || V.type === "loopNode") { - A = !0; - break; - } - } - A || r.updateNode(N.id, { - parentId: void 0, - position: { - x: N.position.x + T.position.x, - y: N.position.y + T.position.y - } - }); - } - } - }); - }, g = (_, v) => { - console.log("onconnectstart: ", _, v); - }, p = (_) => { - console.log("onconnect: ", _); - }; - var x = nw(), k = X(x); - Vd(k); - var E = R(k, 2); - const m = /* @__PURE__ */ Me(() => ({ - // animated: true, - // label: 'edge label', - markerEnd: { - type: po.ArrowClosed, - // color: 'red', - width: 20, - height: 20 - } - })); - return Zc(E, ct({ nodeTypes: Fy }, Jo, { - class: "tinyflow-logo", - isValidConnection: l, - onconnectend: c, - onconnectstart: g, - onconnect: p, - connectionRadius: 50, - ondelete: d, - onclick: (_) => { - const v = _.target; - v.classList.contains("svelte-flow__edge-interaction") || v.classList.contains("panel-content") || v.closest(".panel-content") || G(o, !1); - }, - get defaultEdgeOptions() { - return h(m); - }, - $$events: { - drop: s, - dragover: i, - edgeclick: () => { - G(o, !0); - } - }, - children: (_, v) => { - var b = tw(), N = _e(b); - Qc(N, {}); - var $ = R(N, 2); - Uc($, {}); - var T = R($, 2); - td(T, {}); - var A = R(T, 2); - { - var D = (O) => { - Mo(O, { - children: (V, z) => { - var S = ew(), H = R(X(S), 4), C = X(H); - kt(C, { - rows: 3, - placeholder: "请输入边条件", - style: "width: 100%", - oninput: (P) => { - } - }), Z(H), Z(S), L(V, S); - }, - $$slots: { default: !0 } - }); - }; - be(A, (O) => { - h(o) && O(D); - }); - } - L(_, b); - }, - $$slots: { default: !0 } - })), Z(x), L(e, x), ce({ - get onInit() { - return n(); - }, - set onInit(_) { - n(_), y(); - } - }); -} -re(Od, { onInit: {} }, [], [], !0); -function ow(e, t) { - ue(t, !0); - const n = w(t, "options", 7), r = w(t, "onInit", 7), { data: o } = n(); - return Jo.init((o == null ? void 0 : o.nodes) || [], (o == null ? void 0 : o.edges) || []), Mr("tinyflow_options", n()), Xc(e, { - fitView: !0, - children: (i, s) => { - Od(i, { - get onInit() { - return r(); - } - }); - }, - $$slots: { default: !0 } - }), ce({ - get options() { - return n(); - }, - set options(i) { - n(i), y(); - }, - get onInit() { - return r(); - }, - set onInit(i) { - r(i), y(); - } - }); -} -customElements.define("tinyflow-component", re(ow, { options: {}, onInit: {} }, [], [], !1)); -export { - cw as Tinyflow -}; -//# sourceMappingURL=index.js.map diff --git a/packages/ui/dist/index.js.map b/packages/ui/dist/index.js.map deleted file mode 100644 index 7428b1e..0000000 --- a/packages/ui/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":["../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/version.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/disclose-version.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/flags/index.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/flags/legacy.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/constants.js","../../../node_modules/.pnpm/esm-env@1.2.2/node_modules/esm-env/false.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/constants.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/shared/utils.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/task.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/reactivity/equality.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/errors.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/reactivity/sources.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/reactivity/deriveds.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/warnings.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/hydration.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/proxy.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/operations.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/runtime.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/reactivity/effects.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/shared/errors.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/context.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/utils.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/elements/misc.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/elements/events.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/reconciler.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/template.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/render.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/blocks/if.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/blocks/each.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/blocks/html.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/blocks/slot.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/blocks/snippet.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/blocks/svelte-component.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/blocks/svelte-element.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/css.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/elements/actions.js","../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/shared/attributes.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/elements/class.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/elements/attributes.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/elements/style.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/elements/bindings/size.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/elements/bindings/this.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/legacy/lifecycle.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/legacy/misc.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/index-client.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/store/utils.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/store/shared/index.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/reactivity/store.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/reactivity/props.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/legacy/legacy-client.js","../../../node_modules/.pnpm/svelte@5.22.2/node_modules/svelte/src/internal/client/dom/elements/custom-element.js","../../../node_modules/.pnpm/classcat@5.0.5/node_modules/classcat/index.js","../../../node_modules/.pnpm/d3-dispatch@3.0.1/node_modules/d3-dispatch/src/dispatch.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespaces.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespace.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/creator.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selector.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/select.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/array.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selectorAll.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectAll.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/matcher.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChild.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChildren.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/filter.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sparse.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/enter.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/constant.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/data.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/exit.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/join.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/merge.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/order.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sort.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/call.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/nodes.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/node.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/size.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/empty.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/each.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/attr.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/window.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/style.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/property.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/classed.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/text.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/html.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/raise.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/lower.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/append.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/insert.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/remove.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/clone.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/datum.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/on.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/dispatch.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/iterator.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/index.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/select.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/sourceEvent.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/pointer.js","../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/noevent.js","../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/nodrag.js","../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/constant.js","../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/event.js","../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/drag.js","../../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/define.js","../../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/color.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/constant.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/color.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/rgb.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/number.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/string.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/decompose.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/parse.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/index.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/zoom.js","../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timer.js","../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timeout.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/schedule.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/interrupt.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/interrupt.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/tween.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/interpolate.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attr.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attrTween.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/delay.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/duration.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/ease.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/easeVarying.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/filter.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/merge.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/on.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/remove.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/select.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selectAll.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selection.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/style.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/styleTween.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/text.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/textTween.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/transition.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/end.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/index.js","../../../node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/cubic.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/transition.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/index.js","../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/constant.js","../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/event.js","../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/transform.js","../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/noevent.js","../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/zoom.js","../../../node_modules/.pnpm/@xyflow+system@0.0.52/node_modules/@xyflow/system/dist/esm/index.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/components/Handle/Handle.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/components/nodes/DefaultNode.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/components/nodes/InputNode.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/components/nodes/OutputNode.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/actions/portal/index.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/components/EdgeLabelRenderer/EdgeLabelRenderer.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/hooks/useHandleEdgeSelect.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/components/EdgeLabel/EdgeLabel.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/components/BaseEdge/BaseEdge.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/components/edges/BezierEdgeInternal.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/components/edges/SmoothStepEdgeInternal.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/components/edges/StraightEdgeInternal.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/components/edges/StepEdgeInternal.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/store/utils.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/store/initial-store.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/store/visible-edges.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/store/visible-nodes.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/store/index.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/actions/zoom/index.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/container/Zoom/Zoom.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/container/Pane/Pane.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/container/Viewport/Viewport.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/actions/drag/index.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/components/NodeWrapper/utils.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/components/NodeWrapper/NodeWrapper.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/container/NodeRenderer/NodeRenderer.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/components/EdgeWrapper/EdgeWrapper.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/components/CallOnMount/CallOnMount.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/container/EdgeRenderer/MarkerDefinition/MarkerDefinition.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/container/EdgeRenderer/MarkerDefinition/Marker.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/container/EdgeRenderer/EdgeRenderer.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/components/Selection/Selection.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/components/UserSelection/UserSelection.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/components/NodeSelection/NodeSelection.svelte","../../../node_modules/.pnpm/@svelte-put+shortcut@3.1.1_svelte@5.22.2/node_modules/@svelte-put/shortcut/src/shortcut.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/components/KeyHandler/KeyHandler.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/components/ConnectionLine/ConnectionLine.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/container/Panel/Panel.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/components/Attribution/Attribution.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/container/SvelteFlow/utils.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/hooks/useColorModeClass.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/container/SvelteFlow/SvelteFlow.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/components/SvelteFlowProvider/SvelteFlowProvider.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/plugins/Controls/ControlButton.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/plugins/Controls/Controls.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/plugins/Background/types.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/plugins/Background/DotPattern.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/plugins/Background/LinePattern.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/plugins/Background/Background.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/plugins/Minimap/MinimapNode.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/plugins/Minimap/interactive.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/plugins/Minimap/Minimap.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/utils/index.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/hooks/useSvelteFlow.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/plugins/NodeToolbar/NodeToolbar.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.31_svelte@5.22.2/node_modules/@xyflow/svelte/dist/lib/hooks/useNodesData.js","../src/consts.ts","../src/Tinyflow.ts","../src/store/stores.ts","../src/components/base/button.svelte","../src/components/base/checkbox.svelte","../src/components/base/input.svelte","../src/components/base/textarea.svelte","../src/components/base/tabs.svelte","../src/components/base/collapse.svelte","../src/components/base/render.svelte","../src/components/base/select.svelte","../../../node_modules/.pnpm/@floating-ui+utils@0.2.9/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../../../node_modules/.pnpm/@floating-ui+core@1.6.9/node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../../../node_modules/.pnpm/@floating-ui+utils@0.2.9/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../../../node_modules/.pnpm/@floating-ui+dom@1.6.13/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../src/components/utils/createFloating.ts","../src/components/base/floating-trigger.svelte","../src/components/base/heading.svelte","../src/components/base/menu-button.svelte","../src/components/utils/useDeleteNode.ts","../src/components/utils/IdGen.ts","../src/components/utils/useCopyNode.ts","../src/components/core/NodeWrapper.svelte","../src/store/nodeContext.ts","../src/components/utils/Consts.ts","../src/components/core/DefinedParameterItem.svelte","../src/components/core/DefinedParameterList.svelte","../src/components/utils/useAddParameter.ts","../src/components/nodes/StartNode.svelte","../src/components/utils/useRefOptions.ts","../src/components/core/RefParameterItem.svelte","../src/components/core/RefParameterList.svelte","../src/components/nodes/EndNode.svelte","../src/components/utils/NodeUtils.ts","../src/components/core/OutputDefItem.svelte","../src/components/core/OutputDefList.svelte","../src/components/nodes/LLMNode.svelte","../src/components/nodes/CodeNode.svelte","../src/components/nodes/TemplateNode.svelte","../src/components/nodes/HttpNode.svelte","../src/components/nodes/KnowledgeNode.svelte","../src/components/nodes/SearchEngineNode.svelte","../src/components/nodes/LoopNode.svelte","../src/components/nodes/index.ts","../src/components/core/DraggableButton.svelte","../src/components/Toolbar.svelte","../src/components/utils/useGetNode.ts","../src/components/utils/useEnsureParentInNodesBefore.ts","../src/components/utils/useGetEdgesByTarget.ts","../src/components/TinyflowCore.svelte","../src/components/TinyflowComponent.svelte"],"sourcesContent":["// generated during release, do not modify\n\n/**\n * The current version, as set in package.json.\n * @type {string}\n */\nexport const VERSION = '5.22.2';\nexport const PUBLIC_VERSION = '5';\n","import { PUBLIC_VERSION } from '../version.js';\n\nif (typeof window !== 'undefined') {\n\t// @ts-expect-error\n\t((window.__svelte ??= {}).v ??= new Set()).add(PUBLIC_VERSION);\n}\n","export let legacy_mode_flag = false;\nexport let tracing_mode_flag = false;\n\nexport function enable_legacy_mode_flag() {\n\tlegacy_mode_flag = true;\n}\n\nexport function enable_tracing_mode_flag() {\n\ttracing_mode_flag = true;\n}\n","import { enable_legacy_mode_flag } from './index.js';\n\nenable_legacy_mode_flag();\n","export const EACH_ITEM_REACTIVE = 1;\nexport const EACH_INDEX_REACTIVE = 1 << 1;\n/** See EachBlock interface metadata.is_controlled for an explanation what this is */\nexport const EACH_IS_CONTROLLED = 1 << 2;\nexport const EACH_IS_ANIMATED = 1 << 3;\nexport const EACH_ITEM_IMMUTABLE = 1 << 4;\n\nexport const PROPS_IS_IMMUTABLE = 1;\nexport const PROPS_IS_RUNES = 1 << 1;\nexport const PROPS_IS_UPDATED = 1 << 2;\nexport const PROPS_IS_BINDABLE = 1 << 3;\nexport const PROPS_IS_LAZY_INITIAL = 1 << 4;\n\nexport const TRANSITION_IN = 1;\nexport const TRANSITION_OUT = 1 << 1;\nexport const TRANSITION_GLOBAL = 1 << 2;\n\nexport const TEMPLATE_FRAGMENT = 1;\nexport const TEMPLATE_USE_IMPORT_NODE = 1 << 1;\n\nexport const HYDRATION_START = '[';\n/** used to indicate that an `{:else}...` block was rendered */\nexport const HYDRATION_START_ELSE = '[!';\nexport const HYDRATION_END = ']';\nexport const HYDRATION_ERROR = {};\n\nexport const ELEMENT_IS_NAMESPACED = 1;\nexport const ELEMENT_PRESERVE_ATTRIBUTE_CASE = 1 << 1;\n\nexport const UNINITIALIZED = Symbol();\n\n// Dev-time component properties\nexport const FILENAME = Symbol('filename');\nexport const HMR = Symbol('hmr');\n\nexport const NAMESPACE_SVG = 'http://www.w3.org/2000/svg';\nexport const NAMESPACE_MATHML = 'http://www.w3.org/1998/Math/MathML';\n\n// we use a list of ignorable runtime warnings because not every runtime warning\n// can be ignored and we want to keep the validation for svelte-ignore in place\nexport const IGNORABLE_RUNTIME_WARNINGS = /** @type {const} */ ([\n\t'state_snapshot_uncloneable',\n\t'binding_property_non_reactive',\n\t'hydration_attribute_changed',\n\t'hydration_html_changed',\n\t'ownership_invalid_binding',\n\t'ownership_invalid_mutation'\n]);\n\n/**\n * Whitespace inside one of these elements will not result in\n * a whitespace node being created in any circumstances. (This\n * list is almost certainly very incomplete)\n * TODO this is currently unused\n */\nexport const ELEMENTS_WITHOUT_TEXT = ['audio', 'datalist', 'dl', 'optgroup', 'select', 'video'];\n","export default false;\n","export const DERIVED = 1 << 1;\nexport const EFFECT = 1 << 2;\nexport const RENDER_EFFECT = 1 << 3;\nexport const BLOCK_EFFECT = 1 << 4;\nexport const BRANCH_EFFECT = 1 << 5;\nexport const ROOT_EFFECT = 1 << 6;\nexport const BOUNDARY_EFFECT = 1 << 7;\nexport const UNOWNED = 1 << 8;\nexport const DISCONNECTED = 1 << 9;\nexport const CLEAN = 1 << 10;\nexport const DIRTY = 1 << 11;\nexport const MAYBE_DIRTY = 1 << 12;\nexport const INERT = 1 << 13;\nexport const DESTROYED = 1 << 14;\nexport const EFFECT_RAN = 1 << 15;\n/** 'Transparent' effects do not create a transition boundary */\nexport const EFFECT_TRANSPARENT = 1 << 16;\n/** Svelte 4 legacy mode props need to be handled with deriveds and be recognized elsewhere, hence the dedicated flag */\nexport const LEGACY_DERIVED_PROP = 1 << 17;\nexport const INSPECT_EFFECT = 1 << 18;\nexport const HEAD_EFFECT = 1 << 19;\nexport const EFFECT_HAS_DERIVED = 1 << 20;\n\nexport const STATE_SYMBOL = Symbol('$state');\nexport const STATE_SYMBOL_METADATA = Symbol('$state metadata');\nexport const LEGACY_PROPS = Symbol('legacy props');\nexport const LOADING_ATTR_SYMBOL = Symbol('');\n","// Store the references to globals in case someone tries to monkey patch these, causing the below\n// to de-opt (this occurs often when using popular extensions).\nexport var is_array = Array.isArray;\nexport var index_of = Array.prototype.indexOf;\nexport var array_from = Array.from;\nexport var object_keys = Object.keys;\nexport var define_property = Object.defineProperty;\nexport var get_descriptor = Object.getOwnPropertyDescriptor;\nexport var get_descriptors = Object.getOwnPropertyDescriptors;\nexport var object_prototype = Object.prototype;\nexport var array_prototype = Array.prototype;\nexport var get_prototype_of = Object.getPrototypeOf;\n\n/**\n * @param {any} thing\n * @returns {thing is Function}\n */\nexport function is_function(thing) {\n\treturn typeof thing === 'function';\n}\n\nexport const noop = () => {};\n\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\n\n/**\n * @template [T=any]\n * @param {any} value\n * @returns {value is PromiseLike}\n */\nexport function is_promise(value) {\n\treturn typeof value?.then === 'function';\n}\n\n/** @param {Function} fn */\nexport function run(fn) {\n\treturn fn();\n}\n\n/** @param {Array<() => void>} arr */\nexport function run_all(arr) {\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tarr[i]();\n\t}\n}\n\n/**\n * TODO replace with Promise.withResolvers once supported widely enough\n * @template T\n */\nexport function deferred() {\n\t/** @type {(value: T) => void} */\n\tvar resolve;\n\n\t/** @type {(reason: any) => void} */\n\tvar reject;\n\n\t/** @type {Promise} */\n\tvar promise = new Promise((res, rej) => {\n\t\tresolve = res;\n\t\treject = rej;\n\t});\n\n\t// @ts-expect-error\n\treturn { promise, resolve, reject };\n}\n\n/**\n * @template V\n * @param {V} value\n * @param {V | (() => V)} fallback\n * @param {boolean} [lazy]\n * @returns {V}\n */\nexport function fallback(value, fallback, lazy = false) {\n\treturn value === undefined\n\t\t? lazy\n\t\t\t? /** @type {() => V} */ (fallback)()\n\t\t\t: /** @type {V} */ (fallback)\n\t\t: value;\n}\n","import { run_all } from '../../shared/utils.js';\n\n// Fallback for when requestIdleCallback is not available\nconst request_idle_callback =\n\ttypeof requestIdleCallback === 'undefined'\n\t\t? (/** @type {() => void} */ cb) => setTimeout(cb, 1)\n\t\t: requestIdleCallback;\n\n/** @type {Array<() => void>} */\nlet micro_tasks = [];\n\n/** @type {Array<() => void>} */\nlet idle_tasks = [];\n\nfunction run_micro_tasks() {\n\tvar tasks = micro_tasks;\n\tmicro_tasks = [];\n\trun_all(tasks);\n}\n\nfunction run_idle_tasks() {\n\tvar tasks = idle_tasks;\n\tidle_tasks = [];\n\trun_all(tasks);\n}\n\n/**\n * @param {() => void} fn\n */\nexport function queue_micro_task(fn) {\n\tif (micro_tasks.length === 0) {\n\t\tqueueMicrotask(run_micro_tasks);\n\t}\n\n\tmicro_tasks.push(fn);\n}\n\n/**\n * @param {() => void} fn\n */\nexport function queue_idle_task(fn) {\n\tif (idle_tasks.length === 0) {\n\t\trequest_idle_callback(run_idle_tasks);\n\t}\n\n\tidle_tasks.push(fn);\n}\n\n/**\n * Synchronously run any queued tasks.\n */\nexport function flush_tasks() {\n\tif (micro_tasks.length > 0) {\n\t\trun_micro_tasks();\n\t}\n\n\tif (idle_tasks.length > 0) {\n\t\trun_idle_tasks();\n\t}\n}\n","/** @import { Equals } from '#client' */\n/** @type {Equals} */\nexport function equals(value) {\n\treturn value === this.v;\n}\n\n/**\n * @param {unknown} a\n * @param {unknown} b\n * @returns {boolean}\n */\nexport function safe_not_equal(a, b) {\n\treturn a != a\n\t\t? b == b\n\t\t: a !== b || (a !== null && typeof a === 'object') || typeof a === 'function';\n}\n\n/**\n * @param {unknown} a\n * @param {unknown} b\n * @returns {boolean}\n */\nexport function not_equal(a, b) {\n\treturn a !== b;\n}\n\n/** @type {Equals} */\nexport function safe_equals(value) {\n\treturn !safe_not_equal(value, this.v);\n}\n","/* This file is generated by scripts/process-messages/index.js. Do not edit! */\n\nimport { DEV } from 'esm-env';\n\n/**\n * Using `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\n * @returns {never}\n */\nexport function bind_invalid_checkbox_value() {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_invalid_checkbox_value\\nUsing \\`bind:value\\` together with a checkbox input is not allowed. Use \\`bind:checked\\` instead\\nhttps://svelte.dev/e/bind_invalid_checkbox_value`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_invalid_checkbox_value`);\n\t}\n}\n\n/**\n * Component %component% has an export named `%key%` that a consumer component is trying to access using `bind:%key%`, which is disallowed. Instead, use `bind:this` (e.g. `<%name% bind:this={component} />`) and then access the property on the bound component instance (e.g. `component.%key%`)\n * @param {string} component\n * @param {string} key\n * @param {string} name\n * @returns {never}\n */\nexport function bind_invalid_export(component, key, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_invalid_export\\nComponent ${component} has an export named \\`${key}\\` that a consumer component is trying to access using \\`bind:${key}\\`, which is disallowed. Instead, use \\`bind:this\\` (e.g. \\`<${name} bind:this={component} />\\`) and then access the property on the bound component instance (e.g. \\`component.${key}\\`)\\nhttps://svelte.dev/e/bind_invalid_export`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_invalid_export`);\n\t}\n}\n\n/**\n * A component is attempting to bind to a non-bindable property `%key%` belonging to %component% (i.e. `<%name% bind:%key%={...}>`). To mark a property as bindable: `let { %key% = $bindable() } = $props()`\n * @param {string} key\n * @param {string} component\n * @param {string} name\n * @returns {never}\n */\nexport function bind_not_bindable(key, component, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_not_bindable\\nA component is attempting to bind to a non-bindable property \\`${key}\\` belonging to ${component} (i.e. \\`<${name} bind:${key}={...}>\\`). To mark a property as bindable: \\`let { ${key} = $bindable() } = $props()\\`\\nhttps://svelte.dev/e/bind_not_bindable`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_not_bindable`);\n\t}\n}\n\n/**\n * %parent% called `%method%` on an instance of %component%, which is no longer valid in Svelte 5\n * @param {string} parent\n * @param {string} method\n * @param {string} component\n * @returns {never}\n */\nexport function component_api_changed(parent, method, component) {\n\tif (DEV) {\n\t\tconst error = new Error(`component_api_changed\\n${parent} called \\`${method}\\` on an instance of ${component}, which is no longer valid in Svelte 5\\nhttps://svelte.dev/e/component_api_changed`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/component_api_changed`);\n\t}\n}\n\n/**\n * Attempted to instantiate %component% with `new %name%`, which is no longer valid in Svelte 5. If this component is not under your control, set the `compatibility.componentApi` compiler option to `4` to keep it working.\n * @param {string} component\n * @param {string} name\n * @returns {never}\n */\nexport function component_api_invalid_new(component, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`component_api_invalid_new\\nAttempted to instantiate ${component} with \\`new ${name}\\`, which is no longer valid in Svelte 5. If this component is not under your control, set the \\`compatibility.componentApi\\` compiler option to \\`4\\` to keep it working.\\nhttps://svelte.dev/e/component_api_invalid_new`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/component_api_invalid_new`);\n\t}\n}\n\n/**\n * A derived value cannot reference itself recursively\n * @returns {never}\n */\nexport function derived_references_self() {\n\tif (DEV) {\n\t\tconst error = new Error(`derived_references_self\\nA derived value cannot reference itself recursively\\nhttps://svelte.dev/e/derived_references_self`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/derived_references_self`);\n\t}\n}\n\n/**\n * Keyed each block has duplicate key `%value%` at indexes %a% and %b%\n * @param {string} a\n * @param {string} b\n * @param {string | undefined | null} [value]\n * @returns {never}\n */\nexport function each_key_duplicate(a, b, value) {\n\tif (DEV) {\n\t\tconst error = new Error(`each_key_duplicate\\n${value ? `Keyed each block has duplicate key \\`${value}\\` at indexes ${a} and ${b}` : `Keyed each block has duplicate key at indexes ${a} and ${b}`}\\nhttps://svelte.dev/e/each_key_duplicate`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/each_key_duplicate`);\n\t}\n}\n\n/**\n * `%rune%` cannot be used inside an effect cleanup function\n * @param {string} rune\n * @returns {never}\n */\nexport function effect_in_teardown(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_in_teardown\\n\\`${rune}\\` cannot be used inside an effect cleanup function\\nhttps://svelte.dev/e/effect_in_teardown`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_in_teardown`);\n\t}\n}\n\n/**\n * Effect cannot be created inside a `$derived` value that was not itself created inside an effect\n * @returns {never}\n */\nexport function effect_in_unowned_derived() {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_in_unowned_derived\\nEffect cannot be created inside a \\`$derived\\` value that was not itself created inside an effect\\nhttps://svelte.dev/e/effect_in_unowned_derived`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_in_unowned_derived`);\n\t}\n}\n\n/**\n * `%rune%` can only be used inside an effect (e.g. during component initialisation)\n * @param {string} rune\n * @returns {never}\n */\nexport function effect_orphan(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_orphan\\n\\`${rune}\\` can only be used inside an effect (e.g. during component initialisation)\\nhttps://svelte.dev/e/effect_orphan`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_orphan`);\n\t}\n}\n\n/**\n * Maximum update depth exceeded. This can happen when a reactive block or effect repeatedly sets a new value. Svelte limits the number of nested updates to prevent infinite loops\n * @returns {never}\n */\nexport function effect_update_depth_exceeded() {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_update_depth_exceeded\\nMaximum update depth exceeded. This can happen when a reactive block or effect repeatedly sets a new value. Svelte limits the number of nested updates to prevent infinite loops\\nhttps://svelte.dev/e/effect_update_depth_exceeded`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);\n\t}\n}\n\n/**\n * Failed to hydrate the application\n * @returns {never}\n */\nexport function hydration_failed() {\n\tif (DEV) {\n\t\tconst error = new Error(`hydration_failed\\nFailed to hydrate the application\\nhttps://svelte.dev/e/hydration_failed`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/hydration_failed`);\n\t}\n}\n\n/**\n * Could not `{@render}` snippet due to the expression being `null` or `undefined`. Consider using optional chaining `{@render snippet?.()}`\n * @returns {never}\n */\nexport function invalid_snippet() {\n\tif (DEV) {\n\t\tconst error = new Error(`invalid_snippet\\nCould not \\`{@render}\\` snippet due to the expression being \\`null\\` or \\`undefined\\`. Consider using optional chaining \\`{@render snippet?.()}\\`\\nhttps://svelte.dev/e/invalid_snippet`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/invalid_snippet`);\n\t}\n}\n\n/**\n * `%name%(...)` cannot be used in runes mode\n * @param {string} name\n * @returns {never}\n */\nexport function lifecycle_legacy_only(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`lifecycle_legacy_only\\n\\`${name}(...)\\` cannot be used in runes mode\\nhttps://svelte.dev/e/lifecycle_legacy_only`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/lifecycle_legacy_only`);\n\t}\n}\n\n/**\n * Cannot do `bind:%key%={undefined}` when `%key%` has a fallback value\n * @param {string} key\n * @returns {never}\n */\nexport function props_invalid_value(key) {\n\tif (DEV) {\n\t\tconst error = new Error(`props_invalid_value\\nCannot do \\`bind:${key}={undefined}\\` when \\`${key}\\` has a fallback value\\nhttps://svelte.dev/e/props_invalid_value`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/props_invalid_value`);\n\t}\n}\n\n/**\n * Rest element properties of `$props()` such as `%property%` are readonly\n * @param {string} property\n * @returns {never}\n */\nexport function props_rest_readonly(property) {\n\tif (DEV) {\n\t\tconst error = new Error(`props_rest_readonly\\nRest element properties of \\`$props()\\` such as \\`${property}\\` are readonly\\nhttps://svelte.dev/e/props_rest_readonly`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/props_rest_readonly`);\n\t}\n}\n\n/**\n * The `%rune%` rune is only available inside `.svelte` and `.svelte.js/ts` files\n * @param {string} rune\n * @returns {never}\n */\nexport function rune_outside_svelte(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`rune_outside_svelte\\nThe \\`${rune}\\` rune is only available inside \\`.svelte\\` and \\`.svelte.js/ts\\` files\\nhttps://svelte.dev/e/rune_outside_svelte`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/rune_outside_svelte`);\n\t}\n}\n\n/**\n * Property descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\n * @returns {never}\n */\nexport function state_descriptors_fixed() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_descriptors_fixed\\nProperty descriptors defined on \\`$state\\` objects must contain \\`value\\` and always be \\`enumerable\\`, \\`configurable\\` and \\`writable\\`.\\nhttps://svelte.dev/e/state_descriptors_fixed`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_descriptors_fixed`);\n\t}\n}\n\n/**\n * Cannot set prototype of `$state` object\n * @returns {never}\n */\nexport function state_prototype_fixed() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_prototype_fixed\\nCannot set prototype of \\`$state\\` object\\nhttps://svelte.dev/e/state_prototype_fixed`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_prototype_fixed`);\n\t}\n}\n\n/**\n * Reading state that was created inside the same derived is forbidden. Consider using `untrack` to read locally created state\n * @returns {never}\n */\nexport function state_unsafe_local_read() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_unsafe_local_read\\nReading state that was created inside the same derived is forbidden. Consider using \\`untrack\\` to read locally created state\\nhttps://svelte.dev/e/state_unsafe_local_read`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_unsafe_local_read`);\n\t}\n}\n\n/**\n * Updating state inside a derived or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\n * @returns {never}\n */\nexport function state_unsafe_mutation() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_unsafe_mutation\\nUpdating state inside a derived or a template expression is forbidden. If the value should not be reactive, declare it without \\`$state\\`\\nhttps://svelte.dev/e/state_unsafe_mutation`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_unsafe_mutation`);\n\t}\n}","/** @import { Derived, Effect, Reaction, Source, Value } from '#client' */\nimport { DEV } from 'esm-env';\nimport {\n\tactive_reaction,\n\tactive_effect,\n\tuntracked_writes,\n\tget,\n\tschedule_effect,\n\tset_untracked_writes,\n\tset_signal_status,\n\tuntrack,\n\tincrement_write_version,\n\tupdate_effect,\n\tderived_sources,\n\tset_derived_sources,\n\tcheck_dirtiness,\n\tuntracking\n} from '../runtime.js';\nimport { equals, safe_equals } from './equality.js';\nimport {\n\tCLEAN,\n\tDERIVED,\n\tDIRTY,\n\tBRANCH_EFFECT,\n\tINSPECT_EFFECT,\n\tUNOWNED,\n\tMAYBE_DIRTY,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT\n} from '../constants.js';\nimport * as e from '../errors.js';\nimport { legacy_mode_flag, tracing_mode_flag } from '../../flags/index.js';\nimport { get_stack } from '../dev/tracing.js';\nimport { component_context, is_runes } from '../context.js';\n\nexport let inspect_effects = new Set();\n\n/**\n * @param {Set} v\n */\nexport function set_inspect_effects(v) {\n\tinspect_effects = v;\n}\n\n/**\n * @template V\n * @param {V} v\n * @param {Error | null} [stack]\n * @returns {Source}\n */\nexport function source(v, stack) {\n\t/** @type {Value} */\n\tvar signal = {\n\t\tf: 0, // TODO ideally we could skip this altogether, but it causes type errors\n\t\tv,\n\t\treactions: null,\n\t\tequals,\n\t\trv: 0,\n\t\twv: 0\n\t};\n\n\tif (DEV && tracing_mode_flag) {\n\t\tsignal.created = stack ?? get_stack('CreatedAt');\n\t\tsignal.debug = null;\n\t}\n\n\treturn signal;\n}\n\n/**\n * @template V\n * @param {V} v\n */\nexport function state(v) {\n\treturn push_derived_source(source(v));\n}\n\n/**\n * @template V\n * @param {V} initial_value\n * @param {boolean} [immutable]\n * @returns {Source}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function mutable_source(initial_value, immutable = false) {\n\tconst s = source(initial_value);\n\tif (!immutable) {\n\t\ts.equals = safe_equals;\n\t}\n\n\t// bind the signal to the component context, in case we need to\n\t// track updates to trigger beforeUpdate/afterUpdate callbacks\n\tif (legacy_mode_flag && component_context !== null && component_context.l !== null) {\n\t\t(component_context.l.s ??= []).push(s);\n\t}\n\n\treturn s;\n}\n\n/**\n * @template V\n * @param {V} v\n * @param {boolean} [immutable]\n * @returns {Source}\n */\nexport function mutable_state(v, immutable = false) {\n\treturn push_derived_source(mutable_source(v, immutable));\n}\n\n/**\n * @template V\n * @param {Source} source\n */\n/*#__NO_SIDE_EFFECTS__*/\nfunction push_derived_source(source) {\n\tif (active_reaction !== null && !untracking && (active_reaction.f & DERIVED) !== 0) {\n\t\tif (derived_sources === null) {\n\t\t\tset_derived_sources([source]);\n\t\t} else {\n\t\t\tderived_sources.push(source);\n\t\t}\n\t}\n\n\treturn source;\n}\n\n/**\n * @template V\n * @param {Value} source\n * @param {V} value\n */\nexport function mutate(source, value) {\n\tset(\n\t\tsource,\n\t\tuntrack(() => get(source))\n\t);\n\treturn value;\n}\n\n/**\n * @template V\n * @param {Source} source\n * @param {V} value\n * @returns {V}\n */\nexport function set(source, value) {\n\tif (\n\t\tactive_reaction !== null &&\n\t\t!untracking &&\n\t\tis_runes() &&\n\t\t(active_reaction.f & (DERIVED | BLOCK_EFFECT)) !== 0 &&\n\t\t// If the source was created locally within the current derived, then\n\t\t// we allow the mutation.\n\t\t(derived_sources === null || !derived_sources.includes(source))\n\t) {\n\t\te.state_unsafe_mutation();\n\t}\n\n\treturn internal_set(source, value);\n}\n\n/**\n * @template V\n * @param {Source} source\n * @param {V} value\n * @returns {V}\n */\nexport function internal_set(source, value) {\n\tif (!source.equals(value)) {\n\t\tvar old_value = source.v;\n\t\tsource.v = value;\n\t\tsource.wv = increment_write_version();\n\n\t\tif (DEV && tracing_mode_flag) {\n\t\t\tsource.updated = get_stack('UpdatedAt');\n\t\t\tif (active_effect != null) {\n\t\t\t\tsource.trace_need_increase = true;\n\t\t\t\tsource.trace_v ??= old_value;\n\t\t\t}\n\t\t}\n\n\t\tmark_reactions(source, DIRTY);\n\n\t\t// It's possible that the current reaction might not have up-to-date dependencies\n\t\t// whilst it's actively running. So in the case of ensuring it registers the reaction\n\t\t// properly for itself, we need to ensure the current effect actually gets\n\t\t// scheduled. i.e: `$effect(() => x++)`\n\t\tif (\n\t\t\tis_runes() &&\n\t\t\tactive_effect !== null &&\n\t\t\t(active_effect.f & CLEAN) !== 0 &&\n\t\t\t(active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0\n\t\t) {\n\t\t\tif (untracked_writes === null) {\n\t\t\t\tset_untracked_writes([source]);\n\t\t\t} else {\n\t\t\t\tuntracked_writes.push(source);\n\t\t\t}\n\t\t}\n\n\t\tif (DEV && inspect_effects.size > 0) {\n\t\t\tconst inspects = Array.from(inspect_effects);\n\n\t\t\tfor (const effect of inspects) {\n\t\t\t\t// Mark clean inspect-effects as maybe dirty and then check their dirtiness\n\t\t\t\t// instead of just updating the effects - this way we avoid overfiring.\n\t\t\t\tif ((effect.f & CLEAN) !== 0) {\n\t\t\t\t\tset_signal_status(effect, MAYBE_DIRTY);\n\t\t\t\t}\n\t\t\t\tif (check_dirtiness(effect)) {\n\t\t\t\t\tupdate_effect(effect);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tinspect_effects.clear();\n\t\t}\n\t}\n\n\treturn value;\n}\n\n/**\n * @template {number | bigint} T\n * @param {Source} source\n * @param {1 | -1} [d]\n * @returns {T}\n */\nexport function update(source, d = 1) {\n\tvar value = get(source);\n\tvar result = d === 1 ? value++ : value--;\n\n\tset(source, value);\n\n\t// @ts-expect-error\n\treturn result;\n}\n\n/**\n * @template {number | bigint} T\n * @param {Source} source\n * @param {1 | -1} [d]\n * @returns {T}\n */\nexport function update_pre(source, d = 1) {\n\tvar value = get(source);\n\n\t// @ts-expect-error\n\treturn set(source, d === 1 ? ++value : --value);\n}\n\n/**\n * @param {Value} signal\n * @param {number} status should be DIRTY or MAYBE_DIRTY\n * @returns {void}\n */\nfunction mark_reactions(signal, status) {\n\tvar reactions = signal.reactions;\n\tif (reactions === null) return;\n\n\tvar runes = is_runes();\n\tvar length = reactions.length;\n\n\tfor (var i = 0; i < length; i++) {\n\t\tvar reaction = reactions[i];\n\t\tvar flags = reaction.f;\n\n\t\t// Skip any effects that are already dirty\n\t\tif ((flags & DIRTY) !== 0) continue;\n\n\t\t// In legacy mode, skip the current effect to prevent infinite loops\n\t\tif (!runes && reaction === active_effect) continue;\n\n\t\t// Inspect effects need to run immediately, so that the stack trace makes sense\n\t\tif (DEV && (flags & INSPECT_EFFECT) !== 0) {\n\t\t\tinspect_effects.add(reaction);\n\t\t\tcontinue;\n\t\t}\n\n\t\tset_signal_status(reaction, status);\n\n\t\t// If the signal a) was previously clean or b) is an unowned derived, then mark it\n\t\tif ((flags & (CLEAN | UNOWNED)) !== 0) {\n\t\t\tif ((flags & DERIVED) !== 0) {\n\t\t\t\tmark_reactions(/** @type {Derived} */ (reaction), MAYBE_DIRTY);\n\t\t\t} else {\n\t\t\t\tschedule_effect(/** @type {Effect} */ (reaction));\n\t\t\t}\n\t\t}\n\t}\n}\n","/** @import { Derived, Effect } from '#client' */\nimport { DEV } from 'esm-env';\nimport { CLEAN, DERIVED, DIRTY, EFFECT_HAS_DERIVED, MAYBE_DIRTY, UNOWNED } from '../constants.js';\nimport {\n\tactive_reaction,\n\tactive_effect,\n\tset_signal_status,\n\tskip_reaction,\n\tupdate_reaction,\n\tincrement_write_version,\n\tset_active_effect\n} from '../runtime.js';\nimport { equals, safe_equals } from './equality.js';\nimport * as e from '../errors.js';\nimport { destroy_effect } from './effects.js';\nimport { inspect_effects, set_inspect_effects } from './sources.js';\nimport { get_stack } from '../dev/tracing.js';\nimport { tracing_mode_flag } from '../../flags/index.js';\nimport { component_context } from '../context.js';\n\n/**\n * @template V\n * @param {() => V} fn\n * @returns {Derived}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function derived(fn) {\n\tvar flags = DERIVED | DIRTY;\n\tvar parent_derived =\n\t\tactive_reaction !== null && (active_reaction.f & DERIVED) !== 0\n\t\t\t? /** @type {Derived} */ (active_reaction)\n\t\t\t: null;\n\n\tif (active_effect === null || (parent_derived !== null && (parent_derived.f & UNOWNED) !== 0)) {\n\t\tflags |= UNOWNED;\n\t} else {\n\t\t// Since deriveds are evaluated lazily, any effects created inside them are\n\t\t// created too late to ensure that the parent effect is added to the tree\n\t\tactive_effect.f |= EFFECT_HAS_DERIVED;\n\t}\n\n\t/** @type {Derived} */\n\tconst signal = {\n\t\tctx: component_context,\n\t\tdeps: null,\n\t\teffects: null,\n\t\tequals,\n\t\tf: flags,\n\t\tfn,\n\t\treactions: null,\n\t\trv: 0,\n\t\tv: /** @type {V} */ (null),\n\t\twv: 0,\n\t\tparent: parent_derived ?? active_effect\n\t};\n\n\tif (DEV && tracing_mode_flag) {\n\t\tsignal.created = get_stack('CreatedAt');\n\t}\n\n\treturn signal;\n}\n\n/**\n * @template V\n * @param {() => V} fn\n * @returns {Derived}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function derived_safe_equal(fn) {\n\tconst signal = derived(fn);\n\tsignal.equals = safe_equals;\n\treturn signal;\n}\n\n/**\n * @param {Derived} derived\n * @returns {void}\n */\nexport function destroy_derived_effects(derived) {\n\tvar effects = derived.effects;\n\n\tif (effects !== null) {\n\t\tderived.effects = null;\n\n\t\tfor (var i = 0; i < effects.length; i += 1) {\n\t\t\tdestroy_effect(/** @type {Effect} */ (effects[i]));\n\t\t}\n\t}\n}\n\n/**\n * The currently updating deriveds, used to detect infinite recursion\n * in dev mode and provide a nicer error than 'too much recursion'\n * @type {Derived[]}\n */\nlet stack = [];\n\n/**\n * @param {Derived} derived\n * @returns {Effect | null}\n */\nfunction get_derived_parent_effect(derived) {\n\tvar parent = derived.parent;\n\twhile (parent !== null) {\n\t\tif ((parent.f & DERIVED) === 0) {\n\t\t\treturn /** @type {Effect} */ (parent);\n\t\t}\n\t\tparent = parent.parent;\n\t}\n\treturn null;\n}\n\n/**\n * @template T\n * @param {Derived} derived\n * @returns {T}\n */\nfunction execute_derived(derived) {\n\tvar value;\n\tvar prev_active_effect = active_effect;\n\n\tset_active_effect(get_derived_parent_effect(derived));\n\n\tif (DEV) {\n\t\tlet prev_inspect_effects = inspect_effects;\n\t\tset_inspect_effects(new Set());\n\t\ttry {\n\t\t\tif (stack.includes(derived)) {\n\t\t\t\te.derived_references_self();\n\t\t\t}\n\n\t\t\tstack.push(derived);\n\n\t\t\tdestroy_derived_effects(derived);\n\t\t\tvalue = update_reaction(derived);\n\t\t} finally {\n\t\t\tset_active_effect(prev_active_effect);\n\t\t\tset_inspect_effects(prev_inspect_effects);\n\t\t\tstack.pop();\n\t\t}\n\t} else {\n\t\ttry {\n\t\t\tdestroy_derived_effects(derived);\n\t\t\tvalue = update_reaction(derived);\n\t\t} finally {\n\t\t\tset_active_effect(prev_active_effect);\n\t\t}\n\t}\n\n\treturn value;\n}\n\n/**\n * @param {Derived} derived\n * @returns {void}\n */\nexport function update_derived(derived) {\n\tvar value = execute_derived(derived);\n\tvar status =\n\t\t(skip_reaction || (derived.f & UNOWNED) !== 0) && derived.deps !== null ? MAYBE_DIRTY : CLEAN;\n\n\tset_signal_status(derived, status);\n\n\tif (!derived.equals(value)) {\n\t\tderived.v = value;\n\t\tderived.wv = increment_write_version();\n\t}\n}\n","/* This file is generated by scripts/process-messages/index.js. Do not edit! */\n\nimport { DEV } from 'esm-env';\n\nvar bold = 'font-weight: bold';\nvar normal = 'font-weight: normal';\n\n/**\n * Assignment to `%property%` property (%location%) will evaluate to the right-hand side, not the value of `%property%` following the assignment. This may result in unexpected behaviour.\n * @param {string} property\n * @param {string} location\n */\nexport function assignment_value_stale(property, location) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] assignment_value_stale\\n%cAssignment to \\`${property}\\` property (${location}) will evaluate to the right-hand side, not the value of \\`${property}\\` following the assignment. This may result in unexpected behaviour.\\nhttps://svelte.dev/e/assignment_value_stale`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/assignment_value_stale`);\n\t}\n}\n\n/**\n * `%binding%` (%location%) is binding to a non-reactive property\n * @param {string} binding\n * @param {string | undefined | null} [location]\n */\nexport function binding_property_non_reactive(binding, location) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] binding_property_non_reactive\\n%c${location ? `\\`${binding}\\` (${location}) is binding to a non-reactive property` : `\\`${binding}\\` is binding to a non-reactive property`}\\nhttps://svelte.dev/e/binding_property_non_reactive`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/binding_property_non_reactive`);\n\t}\n}\n\n/**\n * Your `console.%method%` contained `$state` proxies. Consider using `$inspect(...)` or `$state.snapshot(...)` instead\n * @param {string} method\n */\nexport function console_log_state(method) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] console_log_state\\n%cYour \\`console.${method}\\` contained \\`$state\\` proxies. Consider using \\`$inspect(...)\\` or \\`$state.snapshot(...)\\` instead\\nhttps://svelte.dev/e/console_log_state`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/console_log_state`);\n\t}\n}\n\n/**\n * %handler% should be a function. Did you mean to %suggestion%?\n * @param {string} handler\n * @param {string} suggestion\n */\nexport function event_handler_invalid(handler, suggestion) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] event_handler_invalid\\n%c${handler} should be a function. Did you mean to ${suggestion}?\\nhttps://svelte.dev/e/event_handler_invalid`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/event_handler_invalid`);\n\t}\n}\n\n/**\n * The `%attribute%` attribute on `%html%` changed its value between server and client renders. The client value, `%value%`, will be ignored in favour of the server value\n * @param {string} attribute\n * @param {string} html\n * @param {string} value\n */\nexport function hydration_attribute_changed(attribute, html, value) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] hydration_attribute_changed\\n%cThe \\`${attribute}\\` attribute on \\`${html}\\` changed its value between server and client renders. The client value, \\`${value}\\`, will be ignored in favour of the server value\\nhttps://svelte.dev/e/hydration_attribute_changed`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/hydration_attribute_changed`);\n\t}\n}\n\n/**\n * The value of an `{@html ...}` block %location% changed between server and client renders. The client value will be ignored in favour of the server value\n * @param {string | undefined | null} [location]\n */\nexport function hydration_html_changed(location) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] hydration_html_changed\\n%c${location ? `The value of an \\`{@html ...}\\` block ${location} changed between server and client renders. The client value will be ignored in favour of the server value` : 'The value of an `{@html ...}` block changed between server and client renders. The client value will be ignored in favour of the server value'}\\nhttps://svelte.dev/e/hydration_html_changed`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/hydration_html_changed`);\n\t}\n}\n\n/**\n * Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near %location%\n * @param {string | undefined | null} [location]\n */\nexport function hydration_mismatch(location) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] hydration_mismatch\\n%c${location ? `Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${location}` : 'Hydration failed because the initial UI does not match what was rendered on the server'}\\nhttps://svelte.dev/e/hydration_mismatch`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/hydration_mismatch`);\n\t}\n}\n\n/**\n * The `render` function passed to `createRawSnippet` should return HTML for a single element\n */\nexport function invalid_raw_snippet_render() {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] invalid_raw_snippet_render\\n%cThe \\`render\\` function passed to \\`createRawSnippet\\` should return HTML for a single element\\nhttps://svelte.dev/e/invalid_raw_snippet_render`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/invalid_raw_snippet_render`);\n\t}\n}\n\n/**\n * Detected a migrated `$:` reactive block in `%filename%` that both accesses and updates the same reactive value. This may cause recursive updates when converted to an `$effect`.\n * @param {string} filename\n */\nexport function legacy_recursive_reactive_block(filename) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] legacy_recursive_reactive_block\\n%cDetected a migrated \\`$:\\` reactive block in \\`${filename}\\` that both accesses and updates the same reactive value. This may cause recursive updates when converted to an \\`$effect\\`.\\nhttps://svelte.dev/e/legacy_recursive_reactive_block`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/legacy_recursive_reactive_block`);\n\t}\n}\n\n/**\n * Tried to unmount a component that was not mounted\n */\nexport function lifecycle_double_unmount() {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] lifecycle_double_unmount\\n%cTried to unmount a component that was not mounted\\nhttps://svelte.dev/e/lifecycle_double_unmount`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/lifecycle_double_unmount`);\n\t}\n}\n\n/**\n * %parent% passed a value to %child% with `bind:`, but the value is owned by %owner%. Consider creating a binding between %owner% and %parent%\n * @param {string} parent\n * @param {string} child\n * @param {string} owner\n */\nexport function ownership_invalid_binding(parent, child, owner) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] ownership_invalid_binding\\n%c${parent} passed a value to ${child} with \\`bind:\\`, but the value is owned by ${owner}. Consider creating a binding between ${owner} and ${parent}\\nhttps://svelte.dev/e/ownership_invalid_binding`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/ownership_invalid_binding`);\n\t}\n}\n\n/**\n * %component% mutated a value owned by %owner%. This is strongly discouraged. Consider passing values to child components with `bind:`, or use a callback instead\n * @param {string | undefined | null} [component]\n * @param {string | undefined | null} [owner]\n */\nexport function ownership_invalid_mutation(component, owner) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] ownership_invalid_mutation\\n%c${component ? `${component} mutated a value owned by ${owner}. This is strongly discouraged. Consider passing values to child components with \\`bind:\\`, or use a callback instead` : 'Mutating a value outside the component that created it is strongly discouraged. Consider passing values to child components with `bind:`, or use a callback instead'}\\nhttps://svelte.dev/e/ownership_invalid_mutation`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/ownership_invalid_mutation`);\n\t}\n}\n\n/**\n * Reactive `$state(...)` proxies and the values they proxy have different identities. Because of this, comparisons with `%operator%` will produce unexpected results\n * @param {string} operator\n */\nexport function state_proxy_equality_mismatch(operator) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] state_proxy_equality_mismatch\\n%cReactive \\`$state(...)\\` proxies and the values they proxy have different identities. Because of this, comparisons with \\`${operator}\\` will produce unexpected results\\nhttps://svelte.dev/e/state_proxy_equality_mismatch`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/state_proxy_equality_mismatch`);\n\t}\n}\n\n/**\n * The `slide` transition does not work correctly for elements with `display: %value%`\n * @param {string} value\n */\nexport function transition_slide_display(value) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] transition_slide_display\\n%cThe \\`slide\\` transition does not work correctly for elements with \\`display: ${value}\\`\\nhttps://svelte.dev/e/transition_slide_display`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/transition_slide_display`);\n\t}\n}","/** @import { TemplateNode } from '#client' */\n\nimport {\n\tHYDRATION_END,\n\tHYDRATION_ERROR,\n\tHYDRATION_START,\n\tHYDRATION_START_ELSE\n} from '../../../constants.js';\nimport * as w from '../warnings.js';\nimport { get_next_sibling } from './operations.js';\n\n/**\n * Use this variable to guard everything related to hydration code so it can be treeshaken out\n * if the user doesn't use the `hydrate` method and these code paths are therefore not needed.\n */\nexport let hydrating = false;\n\n/** @param {boolean} value */\nexport function set_hydrating(value) {\n\thydrating = value;\n}\n\n/**\n * The node that is currently being hydrated. This starts out as the first node inside the opening\n * comment, and updates each time a component calls `$.child(...)` or `$.sibling(...)`.\n * When entering a block (e.g. `{#if ...}`), `hydrate_node` is the block opening comment; by the\n * time we leave the block it is the closing comment, which serves as the block's anchor.\n * @type {TemplateNode}\n */\nexport let hydrate_node;\n\n/** @param {TemplateNode} node */\nexport function set_hydrate_node(node) {\n\tif (node === null) {\n\t\tw.hydration_mismatch();\n\t\tthrow HYDRATION_ERROR;\n\t}\n\n\treturn (hydrate_node = node);\n}\n\nexport function hydrate_next() {\n\treturn set_hydrate_node(/** @type {TemplateNode} */ (get_next_sibling(hydrate_node)));\n}\n\n/** @param {TemplateNode} node */\nexport function reset(node) {\n\tif (!hydrating) return;\n\n\t// If the node has remaining siblings, something has gone wrong\n\tif (get_next_sibling(hydrate_node) !== null) {\n\t\tw.hydration_mismatch();\n\t\tthrow HYDRATION_ERROR;\n\t}\n\n\thydrate_node = node;\n}\n\n/**\n * @param {HTMLTemplateElement} template\n */\nexport function hydrate_template(template) {\n\tif (hydrating) {\n\t\t// @ts-expect-error TemplateNode doesn't include DocumentFragment, but it's actually fine\n\t\thydrate_node = template.content;\n\t}\n}\n\nexport function next(count = 1) {\n\tif (hydrating) {\n\t\tvar i = count;\n\t\tvar node = hydrate_node;\n\n\t\twhile (i--) {\n\t\t\tnode = /** @type {TemplateNode} */ (get_next_sibling(node));\n\t\t}\n\n\t\thydrate_node = node;\n\t}\n}\n\n/**\n * Removes all nodes starting at `hydrate_node` up until the next hydration end comment\n */\nexport function remove_nodes() {\n\tvar depth = 0;\n\tvar node = hydrate_node;\n\n\twhile (true) {\n\t\tif (node.nodeType === 8) {\n\t\t\tvar data = /** @type {Comment} */ (node).data;\n\n\t\t\tif (data === HYDRATION_END) {\n\t\t\t\tif (depth === 0) return node;\n\t\t\t\tdepth -= 1;\n\t\t\t} else if (data === HYDRATION_START || data === HYDRATION_START_ELSE) {\n\t\t\t\tdepth += 1;\n\t\t\t}\n\t\t}\n\n\t\tvar next = /** @type {TemplateNode} */ (get_next_sibling(node));\n\t\tnode.remove();\n\t\tnode = next;\n\t}\n}\n","/** @import { ProxyMetadata, Source } from '#client' */\nimport { DEV } from 'esm-env';\nimport { get, active_effect } from './runtime.js';\nimport { component_context } from './context.js';\nimport {\n\tarray_prototype,\n\tget_descriptor,\n\tget_prototype_of,\n\tis_array,\n\tobject_prototype\n} from '../shared/utils.js';\nimport { check_ownership, widen_ownership } from './dev/ownership.js';\nimport { source, set } from './reactivity/sources.js';\nimport { STATE_SYMBOL, STATE_SYMBOL_METADATA } from './constants.js';\nimport { UNINITIALIZED } from '../../constants.js';\nimport * as e from './errors.js';\nimport { get_stack } from './dev/tracing.js';\nimport { tracing_mode_flag } from '../flags/index.js';\n\n/**\n * @template T\n * @param {T} value\n * @param {ProxyMetadata | null} [parent]\n * @param {Source} [prev] dev mode only\n * @returns {T}\n */\nexport function proxy(value, parent = null, prev) {\n\t/** @type {Error | null} */\n\tvar stack = null;\n\tif (DEV && tracing_mode_flag) {\n\t\tstack = get_stack('CreatedAt');\n\t}\n\t// if non-proxyable, or is already a proxy, return `value`\n\tif (typeof value !== 'object' || value === null || STATE_SYMBOL in value) {\n\t\treturn value;\n\t}\n\n\tconst prototype = get_prototype_of(value);\n\n\tif (prototype !== object_prototype && prototype !== array_prototype) {\n\t\treturn value;\n\t}\n\n\t/** @type {Map>} */\n\tvar sources = new Map();\n\tvar is_proxied_array = is_array(value);\n\tvar version = source(0);\n\n\tif (is_proxied_array) {\n\t\t// We need to create the length source eagerly to ensure that\n\t\t// mutations to the array are properly synced with our proxy\n\t\tsources.set('length', source(/** @type {any[]} */ (value).length, stack));\n\t}\n\n\t/** @type {ProxyMetadata} */\n\tvar metadata;\n\n\tif (DEV) {\n\t\tmetadata = {\n\t\t\tparent,\n\t\t\towners: null\n\t\t};\n\n\t\tif (prev) {\n\t\t\t// Reuse owners from previous state; necessary because reassignment is not guaranteed to have correct component context.\n\t\t\t// If no previous proxy exists we play it safe and assume ownerless state\n\t\t\t// @ts-expect-error\n\t\t\tconst prev_owners = prev.v?.[STATE_SYMBOL_METADATA]?.owners;\n\t\t\tmetadata.owners = prev_owners ? new Set(prev_owners) : null;\n\t\t} else {\n\t\t\tmetadata.owners =\n\t\t\t\tparent === null\n\t\t\t\t\t? component_context !== null\n\t\t\t\t\t\t? new Set([component_context.function])\n\t\t\t\t\t\t: null\n\t\t\t\t\t: new Set();\n\t\t}\n\t}\n\n\treturn new Proxy(/** @type {any} */ (value), {\n\t\tdefineProperty(_, prop, descriptor) {\n\t\t\tif (\n\t\t\t\t!('value' in descriptor) ||\n\t\t\t\tdescriptor.configurable === false ||\n\t\t\t\tdescriptor.enumerable === false ||\n\t\t\t\tdescriptor.writable === false\n\t\t\t) {\n\t\t\t\t// we disallow non-basic descriptors, because unless they are applied to the\n\t\t\t\t// target object — which we avoid, so that state can be forked — we will run\n\t\t\t\t// afoul of the various invariants\n\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/getOwnPropertyDescriptor#invariants\n\t\t\t\te.state_descriptors_fixed();\n\t\t\t}\n\n\t\t\tvar s = sources.get(prop);\n\n\t\t\tif (s === undefined) {\n\t\t\t\ts = source(descriptor.value, stack);\n\t\t\t\tsources.set(prop, s);\n\t\t\t} else {\n\t\t\t\tset(s, proxy(descriptor.value, metadata));\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\tdeleteProperty(target, prop) {\n\t\t\tvar s = sources.get(prop);\n\n\t\t\tif (s === undefined) {\n\t\t\t\tif (prop in target) {\n\t\t\t\t\tsources.set(prop, source(UNINITIALIZED, stack));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// When working with arrays, we need to also ensure we update the length when removing\n\t\t\t\t// an indexed property\n\t\t\t\tif (is_proxied_array && typeof prop === 'string') {\n\t\t\t\t\tvar ls = /** @type {Source} */ (sources.get('length'));\n\t\t\t\t\tvar n = Number(prop);\n\n\t\t\t\t\tif (Number.isInteger(n) && n < ls.v) {\n\t\t\t\t\t\tset(ls, n);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tset(s, UNINITIALIZED);\n\t\t\t\tupdate_version(version);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\tget(target, prop, receiver) {\n\t\t\tif (DEV && prop === STATE_SYMBOL_METADATA) {\n\t\t\t\treturn metadata;\n\t\t\t}\n\n\t\t\tif (prop === STATE_SYMBOL) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar exists = prop in target;\n\n\t\t\t// create a source, but only if it's an own property and not a prototype property\n\t\t\tif (s === undefined && (!exists || get_descriptor(target, prop)?.writable)) {\n\t\t\t\ts = source(proxy(exists ? target[prop] : UNINITIALIZED, metadata), stack);\n\t\t\t\tsources.set(prop, s);\n\t\t\t}\n\n\t\t\tif (s !== undefined) {\n\t\t\t\tvar v = get(s);\n\n\t\t\t\t// In case of something like `foo = bar.map(...)`, foo would have ownership\n\t\t\t\t// of the array itself, while the individual items would have ownership\n\t\t\t\t// of the component that created bar. That means if we later do `foo[0].baz = 42`,\n\t\t\t\t// we could get a false-positive ownership violation, since the two proxies\n\t\t\t\t// are not connected to each other via the parent metadata relationship.\n\t\t\t\t// For this reason, we need to widen the ownership of the children\n\t\t\t\t// upon access when we detect they are not connected.\n\t\t\t\tif (DEV) {\n\t\t\t\t\t/** @type {ProxyMetadata | undefined} */\n\t\t\t\t\tvar prop_metadata = v?.[STATE_SYMBOL_METADATA];\n\t\t\t\t\tif (prop_metadata && prop_metadata?.parent !== metadata) {\n\t\t\t\t\t\twiden_ownership(metadata, prop_metadata);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn v === UNINITIALIZED ? undefined : v;\n\t\t\t}\n\n\t\t\treturn Reflect.get(target, prop, receiver);\n\t\t},\n\n\t\tgetOwnPropertyDescriptor(target, prop) {\n\t\t\tvar descriptor = Reflect.getOwnPropertyDescriptor(target, prop);\n\n\t\t\tif (descriptor && 'value' in descriptor) {\n\t\t\t\tvar s = sources.get(prop);\n\t\t\t\tif (s) descriptor.value = get(s);\n\t\t\t} else if (descriptor === undefined) {\n\t\t\t\tvar source = sources.get(prop);\n\t\t\t\tvar value = source?.v;\n\n\t\t\t\tif (source !== undefined && value !== UNINITIALIZED) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\twritable: true\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn descriptor;\n\t\t},\n\n\t\thas(target, prop) {\n\t\t\tif (DEV && prop === STATE_SYMBOL_METADATA) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (prop === STATE_SYMBOL) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar has = (s !== undefined && s.v !== UNINITIALIZED) || Reflect.has(target, prop);\n\n\t\t\tif (\n\t\t\t\ts !== undefined ||\n\t\t\t\t(active_effect !== null && (!has || get_descriptor(target, prop)?.writable))\n\t\t\t) {\n\t\t\t\tif (s === undefined) {\n\t\t\t\t\ts = source(has ? proxy(target[prop], metadata) : UNINITIALIZED, stack);\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t}\n\n\t\t\t\tvar value = get(s);\n\t\t\t\tif (value === UNINITIALIZED) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn has;\n\t\t},\n\n\t\tset(target, prop, value, receiver) {\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar has = prop in target;\n\n\t\t\t// variable.length = value -> clear all signals with index >= value\n\t\t\tif (is_proxied_array && prop === 'length') {\n\t\t\t\tfor (var i = value; i < /** @type {Source} */ (s).v; i += 1) {\n\t\t\t\t\tvar other_s = sources.get(i + '');\n\t\t\t\t\tif (other_s !== undefined) {\n\t\t\t\t\t\tset(other_s, UNINITIALIZED);\n\t\t\t\t\t} else if (i in target) {\n\t\t\t\t\t\t// If the item exists in the original, we need to create a uninitialized source,\n\t\t\t\t\t\t// else a later read of the property would result in a source being created with\n\t\t\t\t\t\t// the value of the original item at that index.\n\t\t\t\t\t\tother_s = source(UNINITIALIZED, stack);\n\t\t\t\t\t\tsources.set(i + '', other_s);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we haven't yet created a source for this property, we need to ensure\n\t\t\t// we do so otherwise if we read it later, then the write won't be tracked and\n\t\t\t// the heuristics of effects will be different vs if we had read the proxied\n\t\t\t// object property before writing to that property.\n\t\t\tif (s === undefined) {\n\t\t\t\tif (!has || get_descriptor(target, prop)?.writable) {\n\t\t\t\t\ts = source(undefined, stack);\n\t\t\t\t\tset(s, proxy(value, metadata));\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thas = s.v !== UNINITIALIZED;\n\t\t\t\tset(s, proxy(value, metadata));\n\t\t\t}\n\n\t\t\tif (DEV) {\n\t\t\t\t/** @type {ProxyMetadata | undefined} */\n\t\t\t\tvar prop_metadata = value?.[STATE_SYMBOL_METADATA];\n\t\t\t\tif (prop_metadata && prop_metadata?.parent !== metadata) {\n\t\t\t\t\twiden_ownership(metadata, prop_metadata);\n\t\t\t\t}\n\t\t\t\tcheck_ownership(metadata);\n\t\t\t}\n\n\t\t\tvar descriptor = Reflect.getOwnPropertyDescriptor(target, prop);\n\n\t\t\t// Set the new value before updating any signals so that any listeners get the new value\n\t\t\tif (descriptor?.set) {\n\t\t\t\tdescriptor.set.call(receiver, value);\n\t\t\t}\n\n\t\t\tif (!has) {\n\t\t\t\t// If we have mutated an array directly, we might need to\n\t\t\t\t// signal that length has also changed. Do it before updating metadata\n\t\t\t\t// to ensure that iterating over the array as a result of a metadata update\n\t\t\t\t// will not cause the length to be out of sync.\n\t\t\t\tif (is_proxied_array && typeof prop === 'string') {\n\t\t\t\t\tvar ls = /** @type {Source} */ (sources.get('length'));\n\t\t\t\t\tvar n = Number(prop);\n\n\t\t\t\t\tif (Number.isInteger(n) && n >= ls.v) {\n\t\t\t\t\t\tset(ls, n + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tupdate_version(version);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\townKeys(target) {\n\t\t\tget(version);\n\n\t\t\tvar own_keys = Reflect.ownKeys(target).filter((key) => {\n\t\t\t\tvar source = sources.get(key);\n\t\t\t\treturn source === undefined || source.v !== UNINITIALIZED;\n\t\t\t});\n\n\t\t\tfor (var [key, source] of sources) {\n\t\t\t\tif (source.v !== UNINITIALIZED && !(key in target)) {\n\t\t\t\t\town_keys.push(key);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn own_keys;\n\t\t},\n\n\t\tsetPrototypeOf() {\n\t\t\te.state_prototype_fixed();\n\t\t}\n\t});\n}\n\n/**\n * @param {Source} signal\n * @param {1 | -1} [d]\n */\nfunction update_version(signal, d = 1) {\n\tset(signal, signal.v + d);\n}\n\n/**\n * @param {any} value\n */\nexport function get_proxied_value(value) {\n\tif (value !== null && typeof value === 'object' && STATE_SYMBOL in value) {\n\t\treturn value[STATE_SYMBOL];\n\t}\n\n\treturn value;\n}\n\n/**\n * @param {any} a\n * @param {any} b\n */\nexport function is(a, b) {\n\treturn Object.is(get_proxied_value(a), get_proxied_value(b));\n}\n","/** @import { TemplateNode } from '#client' */\nimport { hydrate_node, hydrating, set_hydrate_node } from './hydration.js';\nimport { DEV } from 'esm-env';\nimport { init_array_prototype_warnings } from '../dev/equality.js';\nimport { get_descriptor } from '../../shared/utils.js';\n\n// export these for reference in the compiled code, making global name deduplication unnecessary\n/** @type {Window} */\nexport var $window;\n\n/** @type {Document} */\nexport var $document;\n\n/** @type {boolean} */\nexport var is_firefox;\n\n/** @type {() => Node | null} */\nvar first_child_getter;\n/** @type {() => Node | null} */\nvar next_sibling_getter;\n\n/**\n * Initialize these lazily to avoid issues when using the runtime in a server context\n * where these globals are not available while avoiding a separate server entry point\n */\nexport function init_operations() {\n\tif ($window !== undefined) {\n\t\treturn;\n\t}\n\n\t$window = window;\n\t$document = document;\n\tis_firefox = /Firefox/.test(navigator.userAgent);\n\n\tvar element_prototype = Element.prototype;\n\tvar node_prototype = Node.prototype;\n\n\t// @ts-ignore\n\tfirst_child_getter = get_descriptor(node_prototype, 'firstChild').get;\n\t// @ts-ignore\n\tnext_sibling_getter = get_descriptor(node_prototype, 'nextSibling').get;\n\n\t// the following assignments improve perf of lookups on DOM nodes\n\t// @ts-expect-error\n\telement_prototype.__click = undefined;\n\t// @ts-expect-error\n\telement_prototype.__className = undefined;\n\t// @ts-expect-error\n\telement_prototype.__attributes = null;\n\t// @ts-expect-error\n\telement_prototype.__styles = null;\n\t// @ts-expect-error\n\telement_prototype.__e = undefined;\n\n\t// @ts-expect-error\n\tText.prototype.__t = undefined;\n\n\tif (DEV) {\n\t\t// @ts-expect-error\n\t\telement_prototype.__svelte_meta = null;\n\n\t\tinit_array_prototype_warnings();\n\t}\n}\n\n/**\n * @param {string} value\n * @returns {Text}\n */\nexport function create_text(value = '') {\n\treturn document.createTextNode(value);\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n * @returns {Node | null}\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function get_first_child(node) {\n\treturn first_child_getter.call(node);\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n * @returns {Node | null}\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function get_next_sibling(node) {\n\treturn next_sibling_getter.call(node);\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @template {Node} N\n * @param {N} node\n * @param {boolean} is_text\n * @returns {Node | null}\n */\nexport function child(node, is_text) {\n\tif (!hydrating) {\n\t\treturn get_first_child(node);\n\t}\n\n\tvar child = /** @type {TemplateNode} */ (get_first_child(hydrate_node));\n\n\t// Child can be null if we have an element with a single child, like `

{text}

`, where `text` is empty\n\tif (child === null) {\n\t\tchild = hydrate_node.appendChild(create_text());\n\t} else if (is_text && child.nodeType !== 3) {\n\t\tvar text = create_text();\n\t\tchild?.before(text);\n\t\tset_hydrate_node(text);\n\t\treturn text;\n\t}\n\n\tset_hydrate_node(child);\n\treturn child;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {DocumentFragment | TemplateNode[]} fragment\n * @param {boolean} is_text\n * @returns {Node | null}\n */\nexport function first_child(fragment, is_text) {\n\tif (!hydrating) {\n\t\t// when not hydrating, `fragment` is a `DocumentFragment` (the result of calling `open_frag`)\n\t\tvar first = /** @type {DocumentFragment} */ (get_first_child(/** @type {Node} */ (fragment)));\n\n\t\t// TODO prevent user comments with the empty string when preserveComments is true\n\t\tif (first instanceof Comment && first.data === '') return get_next_sibling(first);\n\n\t\treturn first;\n\t}\n\n\t// if an {expression} is empty during SSR, there might be no\n\t// text node to hydrate — we must therefore create one\n\tif (is_text && hydrate_node?.nodeType !== 3) {\n\t\tvar text = create_text();\n\n\t\thydrate_node?.before(text);\n\t\tset_hydrate_node(text);\n\t\treturn text;\n\t}\n\n\treturn hydrate_node;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {TemplateNode} node\n * @param {number} count\n * @param {boolean} is_text\n * @returns {Node | null}\n */\nexport function sibling(node, count = 1, is_text = false) {\n\tlet next_sibling = hydrating ? hydrate_node : node;\n\tvar last_sibling;\n\n\twhile (count--) {\n\t\tlast_sibling = next_sibling;\n\t\tnext_sibling = /** @type {TemplateNode} */ (get_next_sibling(next_sibling));\n\t}\n\n\tif (!hydrating) {\n\t\treturn next_sibling;\n\t}\n\n\tvar type = next_sibling?.nodeType;\n\n\t// if a sibling {expression} is empty during SSR, there might be no\n\t// text node to hydrate — we must therefore create one\n\tif (is_text && type !== 3) {\n\t\tvar text = create_text();\n\t\t// If the next sibling is `null` and we're handling text then it's because\n\t\t// the SSR content was empty for the text, so we need to generate a new text\n\t\t// node and insert it after the last sibling\n\t\tif (next_sibling === null) {\n\t\t\tlast_sibling?.after(text);\n\t\t} else {\n\t\t\tnext_sibling.before(text);\n\t\t}\n\t\tset_hydrate_node(text);\n\t\treturn text;\n\t}\n\n\tset_hydrate_node(next_sibling);\n\treturn /** @type {TemplateNode} */ (next_sibling);\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n * @returns {void}\n */\nexport function clear_text_content(node) {\n\tnode.textContent = '';\n}\n","/** @import { ComponentContext, Derived, Effect, Reaction, Signal, Source, Value } from '#client' */\nimport { DEV } from 'esm-env';\nimport { define_property, get_descriptors, get_prototype_of, index_of } from '../shared/utils.js';\nimport {\n\tdestroy_block_effect_children,\n\tdestroy_effect_children,\n\texecute_effect_teardown,\n\tunlink_effect\n} from './reactivity/effects.js';\nimport {\n\tEFFECT,\n\tDIRTY,\n\tMAYBE_DIRTY,\n\tCLEAN,\n\tDERIVED,\n\tUNOWNED,\n\tDESTROYED,\n\tINERT,\n\tBRANCH_EFFECT,\n\tSTATE_SYMBOL,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT,\n\tLEGACY_DERIVED_PROP,\n\tDISCONNECTED,\n\tBOUNDARY_EFFECT\n} from './constants.js';\nimport { flush_tasks } from './dom/task.js';\nimport { internal_set } from './reactivity/sources.js';\nimport { destroy_derived_effects, update_derived } from './reactivity/deriveds.js';\nimport * as e from './errors.js';\nimport { FILENAME } from '../../constants.js';\nimport { tracing_mode_flag } from '../flags/index.js';\nimport { tracing_expressions, get_stack } from './dev/tracing.js';\nimport {\n\tcomponent_context,\n\tdev_current_component_function,\n\tis_runes,\n\tset_component_context,\n\tset_dev_current_component_function\n} from './context.js';\nimport { is_firefox } from './dom/operations.js';\n\n// Used for DEV time error handling\n/** @param {WeakSet} value */\nconst handled_errors = new WeakSet();\nlet is_throwing_error = false;\n\nlet is_flushing = false;\n\n/** @type {Effect | null} */\nlet last_scheduled_effect = null;\n\nlet is_updating_effect = false;\n\nexport let is_destroying_effect = false;\n\n/** @param {boolean} value */\nexport function set_is_destroying_effect(value) {\n\tis_destroying_effect = value;\n}\n\n// Handle effect queues\n\n/** @type {Effect[]} */\nlet queued_root_effects = [];\n\n/** @type {Effect[]} Stack of effects, dev only */\nlet dev_effect_stack = [];\n// Handle signal reactivity tree dependencies and reactions\n\n/** @type {null | Reaction} */\nexport let active_reaction = null;\n\nexport let untracking = false;\n\n/** @param {null | Reaction} reaction */\nexport function set_active_reaction(reaction) {\n\tactive_reaction = reaction;\n}\n\n/** @type {null | Effect} */\nexport let active_effect = null;\n\n/** @param {null | Effect} effect */\nexport function set_active_effect(effect) {\n\tactive_effect = effect;\n}\n\n/**\n * When sources are created within a derived, we record them so that we can safely allow\n * local mutations to these sources without the side-effect error being invoked unnecessarily.\n * @type {null | Source[]}\n */\nexport let derived_sources = null;\n\n/**\n * @param {Source[] | null} sources\n */\nexport function set_derived_sources(sources) {\n\tderived_sources = sources;\n}\n\n/**\n * The dependencies of the reaction that is currently being executed. In many cases,\n * the dependencies are unchanged between runs, and so this will be `null` unless\n * and until a new dependency is accessed — we track this via `skipped_deps`\n * @type {null | Value[]}\n */\nlet new_deps = null;\n\nlet skipped_deps = 0;\n\n/**\n * Tracks writes that the effect it's executed in doesn't listen to yet,\n * so that the dependency can be added to the effect later on if it then reads it\n * @type {null | Source[]}\n */\nexport let untracked_writes = null;\n\n/** @param {null | Source[]} value */\nexport function set_untracked_writes(value) {\n\tuntracked_writes = value;\n}\n\n/**\n * @type {number} Used by sources and deriveds for handling updates.\n * Version starts from 1 so that unowned deriveds differentiate between a created effect and a run one for tracing\n **/\nlet write_version = 1;\n\n/** @type {number} Used to version each read of a source of derived to avoid duplicating depedencies inside a reaction */\nlet read_version = 0;\n\n// If we are working with a get() chain that has no active container,\n// to prevent memory leaks, we skip adding the reaction.\nexport let skip_reaction = false;\n// Handle collecting all signals which are read during a specific time frame\n/** @type {Set | null} */\nexport let captured_signals = null;\n\n/** @param {Set | null} value */\nexport function set_captured_signals(value) {\n\tcaptured_signals = value;\n}\n\nexport function increment_write_version() {\n\treturn ++write_version;\n}\n\n/**\n * Determines whether a derived or effect is dirty.\n * If it is MAYBE_DIRTY, will set the status to CLEAN\n * @param {Reaction} reaction\n * @returns {boolean}\n */\nexport function check_dirtiness(reaction) {\n\tvar flags = reaction.f;\n\n\tif ((flags & DIRTY) !== 0) {\n\t\treturn true;\n\t}\n\n\tif ((flags & MAYBE_DIRTY) !== 0) {\n\t\tvar dependencies = reaction.deps;\n\t\tvar is_unowned = (flags & UNOWNED) !== 0;\n\n\t\tif (dependencies !== null) {\n\t\t\tvar i;\n\t\t\tvar dependency;\n\t\t\tvar is_disconnected = (flags & DISCONNECTED) !== 0;\n\t\t\tvar is_unowned_connected = is_unowned && active_effect !== null && !skip_reaction;\n\t\t\tvar length = dependencies.length;\n\n\t\t\t// If we are working with a disconnected or an unowned signal that is now connected (due to an active effect)\n\t\t\t// then we need to re-connect the reaction to the dependency\n\t\t\tif (is_disconnected || is_unowned_connected) {\n\t\t\t\tvar derived = /** @type {Derived} */ (reaction);\n\t\t\t\tvar parent = derived.parent;\n\n\t\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\t\tdependency = dependencies[i];\n\n\t\t\t\t\t// We always re-add all reactions (even duplicates) if the derived was\n\t\t\t\t\t// previously disconnected, however we don't if it was unowned as we\n\t\t\t\t\t// de-duplicate dependencies in that case\n\t\t\t\t\tif (is_disconnected || !dependency?.reactions?.includes(derived)) {\n\t\t\t\t\t\t(dependency.reactions ??= []).push(derived);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (is_disconnected) {\n\t\t\t\t\tderived.f ^= DISCONNECTED;\n\t\t\t\t}\n\t\t\t\t// If the unowned derived is now fully connected to the graph again (it's unowned and reconnected, has a parent\n\t\t\t\t// and the parent is not unowned), then we can mark it as connected again, removing the need for the unowned\n\t\t\t\t// flag\n\t\t\t\tif (is_unowned_connected && parent !== null && (parent.f & UNOWNED) === 0) {\n\t\t\t\t\tderived.f ^= UNOWNED;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\tdependency = dependencies[i];\n\n\t\t\t\tif (check_dirtiness(/** @type {Derived} */ (dependency))) {\n\t\t\t\t\tupdate_derived(/** @type {Derived} */ (dependency));\n\t\t\t\t}\n\n\t\t\t\tif (dependency.wv > reaction.wv) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Unowned signals should never be marked as clean unless they\n\t\t// are used within an active_effect without skip_reaction\n\t\tif (!is_unowned || (active_effect !== null && !skip_reaction)) {\n\t\t\tset_signal_status(reaction, CLEAN);\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * @param {unknown} error\n * @param {Effect} effect\n */\nfunction propagate_error(error, effect) {\n\t/** @type {Effect | null} */\n\tvar current = effect;\n\n\twhile (current !== null) {\n\t\tif ((current.f & BOUNDARY_EFFECT) !== 0) {\n\t\t\ttry {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tcurrent.fn(error);\n\t\t\t\treturn;\n\t\t\t} catch {\n\t\t\t\t// Remove boundary flag from effect\n\t\t\t\tcurrent.f ^= BOUNDARY_EFFECT;\n\t\t\t}\n\t\t}\n\n\t\tcurrent = current.parent;\n\t}\n\n\tis_throwing_error = false;\n\tthrow error;\n}\n\n/**\n * @param {Effect} effect\n */\nfunction should_rethrow_error(effect) {\n\treturn (\n\t\t(effect.f & DESTROYED) === 0 &&\n\t\t(effect.parent === null || (effect.parent.f & BOUNDARY_EFFECT) === 0)\n\t);\n}\n\nexport function reset_is_throwing_error() {\n\tis_throwing_error = false;\n}\n\n/**\n * @param {unknown} error\n * @param {Effect} effect\n * @param {Effect | null} previous_effect\n * @param {ComponentContext | null} component_context\n */\nexport function handle_error(error, effect, previous_effect, component_context) {\n\tif (is_throwing_error) {\n\t\tif (previous_effect === null) {\n\t\t\tis_throwing_error = false;\n\t\t}\n\n\t\tif (should_rethrow_error(effect)) {\n\t\t\tthrow error;\n\t\t}\n\n\t\treturn;\n\t}\n\n\tif (previous_effect !== null) {\n\t\tis_throwing_error = true;\n\t}\n\n\tif (\n\t\t!DEV ||\n\t\tcomponent_context === null ||\n\t\t!(error instanceof Error) ||\n\t\thandled_errors.has(error)\n\t) {\n\t\tpropagate_error(error, effect);\n\t\treturn;\n\t}\n\n\thandled_errors.add(error);\n\n\tconst component_stack = [];\n\n\tconst effect_name = effect.fn?.name;\n\n\tif (effect_name) {\n\t\tcomponent_stack.push(effect_name);\n\t}\n\n\t/** @type {ComponentContext | null} */\n\tlet current_context = component_context;\n\n\twhile (current_context !== null) {\n\t\tif (DEV) {\n\t\t\t/** @type {string} */\n\t\t\tvar filename = current_context.function?.[FILENAME];\n\n\t\t\tif (filename) {\n\t\t\t\tconst file = filename.split('/').pop();\n\t\t\t\tcomponent_stack.push(file);\n\t\t\t}\n\t\t}\n\n\t\tcurrent_context = current_context.p;\n\t}\n\n\tconst indent = is_firefox ? ' ' : '\\t';\n\tdefine_property(error, 'message', {\n\t\tvalue: error.message + `\\n${component_stack.map((name) => `\\n${indent}in ${name}`).join('')}\\n`\n\t});\n\tdefine_property(error, 'component_stack', {\n\t\tvalue: component_stack\n\t});\n\n\tconst stack = error.stack;\n\n\t// Filter out internal files from callstack\n\tif (stack) {\n\t\tconst lines = stack.split('\\n');\n\t\tconst new_lines = [];\n\t\tfor (let i = 0; i < lines.length; i++) {\n\t\t\tconst line = lines[i];\n\t\t\tif (line.includes('svelte/src/internal')) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tnew_lines.push(line);\n\t\t}\n\t\tdefine_property(error, 'stack', {\n\t\t\tvalue: new_lines.join('\\n')\n\t\t});\n\t}\n\n\tpropagate_error(error, effect);\n\n\tif (should_rethrow_error(effect)) {\n\t\tthrow error;\n\t}\n}\n\n/**\n * @param {Value} signal\n * @param {Effect} effect\n * @param {boolean} [root]\n */\nfunction schedule_possible_effect_self_invalidation(signal, effect, root = true) {\n\tvar reactions = signal.reactions;\n\tif (reactions === null) return;\n\n\tfor (var i = 0; i < reactions.length; i++) {\n\t\tvar reaction = reactions[i];\n\t\tif ((reaction.f & DERIVED) !== 0) {\n\t\t\tschedule_possible_effect_self_invalidation(/** @type {Derived} */ (reaction), effect, false);\n\t\t} else if (effect === reaction) {\n\t\t\tif (root) {\n\t\t\t\tset_signal_status(reaction, DIRTY);\n\t\t\t} else if ((reaction.f & CLEAN) !== 0) {\n\t\t\t\tset_signal_status(reaction, MAYBE_DIRTY);\n\t\t\t}\n\t\t\tschedule_effect(/** @type {Effect} */ (reaction));\n\t\t}\n\t}\n}\n\n/**\n * @template V\n * @param {Reaction} reaction\n * @returns {V}\n */\nexport function update_reaction(reaction) {\n\tvar previous_deps = new_deps;\n\tvar previous_skipped_deps = skipped_deps;\n\tvar previous_untracked_writes = untracked_writes;\n\tvar previous_reaction = active_reaction;\n\tvar previous_skip_reaction = skip_reaction;\n\tvar prev_derived_sources = derived_sources;\n\tvar previous_component_context = component_context;\n\tvar previous_untracking = untracking;\n\tvar flags = reaction.f;\n\n\tnew_deps = /** @type {null | Value[]} */ (null);\n\tskipped_deps = 0;\n\tuntracked_writes = null;\n\tskip_reaction =\n\t\t(flags & UNOWNED) !== 0 && (untracking || !is_updating_effect || active_reaction === null);\n\tactive_reaction = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) === 0 ? reaction : null;\n\n\tderived_sources = null;\n\tset_component_context(reaction.ctx);\n\tuntracking = false;\n\tread_version++;\n\n\ttry {\n\t\tvar result = /** @type {Function} */ (0, reaction.fn)();\n\t\tvar deps = reaction.deps;\n\n\t\tif (new_deps !== null) {\n\t\t\tvar i;\n\n\t\t\tremove_reactions(reaction, skipped_deps);\n\n\t\t\tif (deps !== null && skipped_deps > 0) {\n\t\t\t\tdeps.length = skipped_deps + new_deps.length;\n\t\t\t\tfor (i = 0; i < new_deps.length; i++) {\n\t\t\t\t\tdeps[skipped_deps + i] = new_deps[i];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treaction.deps = deps = new_deps;\n\t\t\t}\n\n\t\t\tif (!skip_reaction) {\n\t\t\t\tfor (i = skipped_deps; i < deps.length; i++) {\n\t\t\t\t\t(deps[i].reactions ??= []).push(reaction);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (deps !== null && skipped_deps < deps.length) {\n\t\t\tremove_reactions(reaction, skipped_deps);\n\t\t\tdeps.length = skipped_deps;\n\t\t}\n\n\t\t// If we're inside an effect and we have untracked writes, then we need to\n\t\t// ensure that if any of those untracked writes result in re-invalidation\n\t\t// of the current effect, then that happens accordingly\n\t\tif (\n\t\t\tis_runes() &&\n\t\t\tuntracked_writes !== null &&\n\t\t\t!untracking &&\n\t\t\tdeps !== null &&\n\t\t\t(reaction.f & (DERIVED | MAYBE_DIRTY | DIRTY)) === 0\n\t\t) {\n\t\t\tfor (i = 0; i < /** @type {Source[]} */ (untracked_writes).length; i++) {\n\t\t\t\tschedule_possible_effect_self_invalidation(\n\t\t\t\t\tuntracked_writes[i],\n\t\t\t\t\t/** @type {Effect} */ (reaction)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// If we are returning to an previous reaction then\n\t\t// we need to increment the read version to ensure that\n\t\t// any dependencies in this reaction aren't marked with\n\t\t// the same version\n\t\tif (previous_reaction !== null) {\n\t\t\tread_version++;\n\t\t}\n\n\t\treturn result;\n\t} finally {\n\t\tnew_deps = previous_deps;\n\t\tskipped_deps = previous_skipped_deps;\n\t\tuntracked_writes = previous_untracked_writes;\n\t\tactive_reaction = previous_reaction;\n\t\tskip_reaction = previous_skip_reaction;\n\t\tderived_sources = prev_derived_sources;\n\t\tset_component_context(previous_component_context);\n\t\tuntracking = previous_untracking;\n\t}\n}\n\n/**\n * @template V\n * @param {Reaction} signal\n * @param {Value} dependency\n * @returns {void}\n */\nfunction remove_reaction(signal, dependency) {\n\tlet reactions = dependency.reactions;\n\tif (reactions !== null) {\n\t\tvar index = index_of.call(reactions, signal);\n\t\tif (index !== -1) {\n\t\t\tvar new_length = reactions.length - 1;\n\t\t\tif (new_length === 0) {\n\t\t\t\treactions = dependency.reactions = null;\n\t\t\t} else {\n\t\t\t\t// Swap with last element and then remove.\n\t\t\t\treactions[index] = reactions[new_length];\n\t\t\t\treactions.pop();\n\t\t\t}\n\t\t}\n\t}\n\t// If the derived has no reactions, then we can disconnect it from the graph,\n\t// allowing it to either reconnect in the future, or be GC'd by the VM.\n\tif (\n\t\treactions === null &&\n\t\t(dependency.f & DERIVED) !== 0 &&\n\t\t// Destroying a child effect while updating a parent effect can cause a dependency to appear\n\t\t// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`\n\t\t// allows us to skip the expensive work of disconnecting and immediately reconnecting it\n\t\t(new_deps === null || !new_deps.includes(dependency))\n\t) {\n\t\tset_signal_status(dependency, MAYBE_DIRTY);\n\t\t// If we are working with a derived that is owned by an effect, then mark it as being\n\t\t// disconnected.\n\t\tif ((dependency.f & (UNOWNED | DISCONNECTED)) === 0) {\n\t\t\tdependency.f ^= DISCONNECTED;\n\t\t}\n\t\t// Disconnect any reactions owned by this reaction\n\t\tdestroy_derived_effects(/** @type {Derived} **/ (dependency));\n\t\tremove_reactions(/** @type {Derived} **/ (dependency), 0);\n\t}\n}\n\n/**\n * @param {Reaction} signal\n * @param {number} start_index\n * @returns {void}\n */\nexport function remove_reactions(signal, start_index) {\n\tvar dependencies = signal.deps;\n\tif (dependencies === null) return;\n\n\tfor (var i = start_index; i < dependencies.length; i++) {\n\t\tremove_reaction(signal, dependencies[i]);\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @returns {void}\n */\nexport function update_effect(effect) {\n\tvar flags = effect.f;\n\n\tif ((flags & DESTROYED) !== 0) {\n\t\treturn;\n\t}\n\n\tset_signal_status(effect, CLEAN);\n\n\tvar previous_effect = active_effect;\n\tvar previous_component_context = component_context;\n\tvar was_updating_effect = is_updating_effect;\n\n\tactive_effect = effect;\n\tis_updating_effect = true;\n\n\tif (DEV) {\n\t\tvar previous_component_fn = dev_current_component_function;\n\t\tset_dev_current_component_function(effect.component_function);\n\t}\n\n\ttry {\n\t\tif ((flags & BLOCK_EFFECT) !== 0) {\n\t\t\tdestroy_block_effect_children(effect);\n\t\t} else {\n\t\t\tdestroy_effect_children(effect);\n\t\t}\n\n\t\texecute_effect_teardown(effect);\n\t\tvar teardown = update_reaction(effect);\n\t\teffect.teardown = typeof teardown === 'function' ? teardown : null;\n\t\teffect.wv = write_version;\n\n\t\tvar deps = effect.deps;\n\n\t\t// In DEV, we need to handle a case where $inspect.trace() might\n\t\t// incorrectly state a source dependency has not changed when it has.\n\t\t// That's beacuse that source was changed by the same effect, causing\n\t\t// the versions to match. We can avoid this by incrementing the version\n\t\tif (DEV && tracing_mode_flag && (effect.f & DIRTY) !== 0 && deps !== null) {\n\t\t\tfor (let i = 0; i < deps.length; i++) {\n\t\t\t\tvar dep = deps[i];\n\t\t\t\tif (dep.trace_need_increase) {\n\t\t\t\t\tdep.wv = increment_write_version();\n\t\t\t\t\tdep.trace_need_increase = undefined;\n\t\t\t\t\tdep.trace_v = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (DEV) {\n\t\t\tdev_effect_stack.push(effect);\n\t\t}\n\t} catch (error) {\n\t\thandle_error(error, effect, previous_effect, previous_component_context || effect.ctx);\n\t} finally {\n\t\tis_updating_effect = was_updating_effect;\n\t\tactive_effect = previous_effect;\n\n\t\tif (DEV) {\n\t\t\tset_dev_current_component_function(previous_component_fn);\n\t\t}\n\t}\n}\n\nfunction log_effect_stack() {\n\t// eslint-disable-next-line no-console\n\tconsole.error(\n\t\t'Last ten effects were: ',\n\t\tdev_effect_stack.slice(-10).map((d) => d.fn)\n\t);\n\tdev_effect_stack = [];\n}\n\nfunction infinite_loop_guard() {\n\ttry {\n\t\te.effect_update_depth_exceeded();\n\t} catch (error) {\n\t\tif (DEV) {\n\t\t\t// stack is garbage, ignore. Instead add a console.error message.\n\t\t\tdefine_property(error, 'stack', {\n\t\t\t\tvalue: ''\n\t\t\t});\n\t\t}\n\t\t// Try and handle the error so it can be caught at a boundary, that's\n\t\t// if there's an effect available from when it was last scheduled\n\t\tif (last_scheduled_effect !== null) {\n\t\t\tif (DEV) {\n\t\t\t\ttry {\n\t\t\t\t\thandle_error(error, last_scheduled_effect, null, null);\n\t\t\t\t} catch (e) {\n\t\t\t\t\t// Only log the effect stack if the error is re-thrown\n\t\t\t\t\tlog_effect_stack();\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thandle_error(error, last_scheduled_effect, null, null);\n\t\t\t}\n\t\t} else {\n\t\t\tif (DEV) {\n\t\t\t\tlog_effect_stack();\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t}\n}\n\nfunction flush_queued_root_effects() {\n\tvar was_updating_effect = is_updating_effect;\n\n\ttry {\n\t\tvar flush_count = 0;\n\t\tis_updating_effect = true;\n\n\t\twhile (queued_root_effects.length > 0) {\n\t\t\tif (flush_count++ > 1000) {\n\t\t\t\tinfinite_loop_guard();\n\t\t\t}\n\n\t\t\tvar root_effects = queued_root_effects;\n\t\t\tvar length = root_effects.length;\n\n\t\t\tqueued_root_effects = [];\n\n\t\t\tfor (var i = 0; i < length; i++) {\n\t\t\t\tvar root = root_effects[i];\n\n\t\t\t\tif ((root.f & CLEAN) === 0) {\n\t\t\t\t\troot.f ^= CLEAN;\n\t\t\t\t}\n\n\t\t\t\tvar collected_effects = process_effects(root);\n\t\t\t\tflush_queued_effects(collected_effects);\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tis_flushing = false;\n\t\tis_updating_effect = was_updating_effect;\n\n\t\tlast_scheduled_effect = null;\n\t\tif (DEV) {\n\t\t\tdev_effect_stack = [];\n\t\t}\n\t}\n}\n\n/**\n * @param {Array} effects\n * @returns {void}\n */\nfunction flush_queued_effects(effects) {\n\tvar length = effects.length;\n\tif (length === 0) return;\n\n\tfor (var i = 0; i < length; i++) {\n\t\tvar effect = effects[i];\n\n\t\tif ((effect.f & (DESTROYED | INERT)) === 0) {\n\t\t\ttry {\n\t\t\t\tif (check_dirtiness(effect)) {\n\t\t\t\t\tupdate_effect(effect);\n\n\t\t\t\t\t// Effects with no dependencies or teardown do not get added to the effect tree.\n\t\t\t\t\t// Deferred effects (e.g. `$effect(...)`) _are_ added to the tree because we\n\t\t\t\t\t// don't know if we need to keep them until they are executed. Doing the check\n\t\t\t\t\t// here (rather than in `update_effect`) allows us to skip the work for\n\t\t\t\t\t// immediate effects.\n\t\t\t\t\tif (effect.deps === null && effect.first === null && effect.nodes_start === null) {\n\t\t\t\t\t\tif (effect.teardown === null) {\n\t\t\t\t\t\t\t// remove this effect from the graph\n\t\t\t\t\t\t\tunlink_effect(effect);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// keep the effect in the graph, but free up some memory\n\t\t\t\t\t\t\teffect.fn = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\thandle_error(error, effect, null, effect.ctx);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * @param {Effect} signal\n * @returns {void}\n */\nexport function schedule_effect(signal) {\n\tif (!is_flushing) {\n\t\tis_flushing = true;\n\t\tqueueMicrotask(flush_queued_root_effects);\n\t}\n\n\tvar effect = (last_scheduled_effect = signal);\n\n\twhile (effect.parent !== null) {\n\t\teffect = effect.parent;\n\t\tvar flags = effect.f;\n\n\t\tif ((flags & (ROOT_EFFECT | BRANCH_EFFECT)) !== 0) {\n\t\t\tif ((flags & CLEAN) === 0) return;\n\t\t\teffect.f ^= CLEAN;\n\t\t}\n\t}\n\n\tqueued_root_effects.push(effect);\n}\n\n/**\n *\n * This function both runs render effects and collects user effects in topological order\n * from the starting effect passed in. Effects will be collected when they match the filtered\n * bitwise flag passed in only. The collected effects array will be populated with all the user\n * effects to be flushed.\n *\n * @param {Effect} root\n * @returns {Effect[]}\n */\nfunction process_effects(root) {\n\t/** @type {Effect[]} */\n\tvar effects = [];\n\n\tvar effect = root.first;\n\n\twhile (effect !== null) {\n\t\tvar flags = effect.f;\n\t\tvar is_branch = (flags & BRANCH_EFFECT) !== 0;\n\t\tvar is_skippable_branch = is_branch && (flags & CLEAN) !== 0;\n\n\t\tif (!is_skippable_branch && (flags & INERT) === 0) {\n\t\t\tif ((flags & EFFECT) !== 0) {\n\t\t\t\teffects.push(effect);\n\t\t\t} else if (is_branch) {\n\t\t\t\teffect.f ^= CLEAN;\n\t\t\t} else {\n\t\t\t\t// Ensure we set the effect to be the active reaction\n\t\t\t\t// to ensure that unowned deriveds are correctly tracked\n\t\t\t\t// because we're flushing the current effect\n\t\t\t\tvar previous_active_reaction = active_reaction;\n\t\t\t\ttry {\n\t\t\t\t\tactive_reaction = effect;\n\t\t\t\t\tif (check_dirtiness(effect)) {\n\t\t\t\t\t\tupdate_effect(effect);\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\thandle_error(error, effect, null, effect.ctx);\n\t\t\t\t} finally {\n\t\t\t\t\tactive_reaction = previous_active_reaction;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar child = effect.first;\n\n\t\t\tif (child !== null) {\n\t\t\t\teffect = child;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tvar parent = effect.parent;\n\t\teffect = effect.next;\n\n\t\twhile (effect === null && parent !== null) {\n\t\t\teffect = parent.next;\n\t\t\tparent = parent.parent;\n\t\t}\n\t}\n\n\treturn effects;\n}\n\n/**\n * Synchronously flush any pending updates.\n * Returns void if no callback is provided, otherwise returns the result of calling the callback.\n * @template [T=void]\n * @param {(() => T) | undefined} [fn]\n * @returns {T}\n */\nexport function flushSync(fn) {\n\tvar result;\n\n\tif (fn) {\n\t\tis_flushing = true;\n\t\tflush_queued_root_effects();\n\t\tresult = fn();\n\t}\n\n\tflush_tasks();\n\n\twhile (queued_root_effects.length > 0) {\n\t\tis_flushing = true;\n\t\tflush_queued_root_effects();\n\t\tflush_tasks();\n\t}\n\n\treturn /** @type {T} */ (result);\n}\n\n/**\n * Returns a promise that resolves once any pending state changes have been applied.\n * @returns {Promise}\n */\nexport async function tick() {\n\tawait Promise.resolve();\n\t// By calling flushSync we guarantee that any pending state changes are applied after one tick.\n\t// TODO look into whether we can make flushing subsequent updates synchronously in the future.\n\tflushSync();\n}\n\n/**\n * @template V\n * @param {Value} signal\n * @returns {V}\n */\nexport function get(signal) {\n\tvar flags = signal.f;\n\tvar is_derived = (flags & DERIVED) !== 0;\n\n\tif (captured_signals !== null) {\n\t\tcaptured_signals.add(signal);\n\t}\n\n\t// Register the dependency on the current reaction signal.\n\tif (active_reaction !== null && !untracking) {\n\t\tif (derived_sources !== null && derived_sources.includes(signal)) {\n\t\t\te.state_unsafe_local_read();\n\t\t}\n\t\tvar deps = active_reaction.deps;\n\t\tif (signal.rv < read_version) {\n\t\t\tsignal.rv = read_version;\n\t\t\t// If the signal is accessing the same dependencies in the same\n\t\t\t// order as it did last time, increment `skipped_deps`\n\t\t\t// rather than updating `new_deps`, which creates GC cost\n\t\t\tif (new_deps === null && deps !== null && deps[skipped_deps] === signal) {\n\t\t\t\tskipped_deps++;\n\t\t\t} else if (new_deps === null) {\n\t\t\t\tnew_deps = [signal];\n\t\t\t} else if (!skip_reaction || !new_deps.includes(signal)) {\n\t\t\t\t// Normally we can push duplicated dependencies to `new_deps`, but if we're inside\n\t\t\t\t// an unowned derived because skip_reaction is true, then we need to ensure that\n\t\t\t\t// we don't have duplicates\n\t\t\t\tnew_deps.push(signal);\n\t\t\t}\n\t\t}\n\t} else if (\n\t\tis_derived &&\n\t\t/** @type {Derived} */ (signal).deps === null &&\n\t\t/** @type {Derived} */ (signal).effects === null\n\t) {\n\t\tvar derived = /** @type {Derived} */ (signal);\n\t\tvar parent = derived.parent;\n\n\t\tif (parent !== null && (parent.f & UNOWNED) === 0) {\n\t\t\t// If the derived is owned by another derived then mark it as unowned\n\t\t\t// as the derived value might have been referenced in a different context\n\t\t\t// since and thus its parent might not be its true owner anymore\n\t\t\tderived.f ^= UNOWNED;\n\t\t}\n\t}\n\n\tif (is_derived) {\n\t\tderived = /** @type {Derived} */ (signal);\n\n\t\tif (check_dirtiness(derived)) {\n\t\t\tupdate_derived(derived);\n\t\t}\n\t}\n\n\tif (\n\t\tDEV &&\n\t\ttracing_mode_flag &&\n\t\ttracing_expressions !== null &&\n\t\tactive_reaction !== null &&\n\t\ttracing_expressions.reaction === active_reaction\n\t) {\n\t\t// Used when mapping state between special blocks like `each`\n\t\tif (signal.debug) {\n\t\t\tsignal.debug();\n\t\t} else if (signal.created) {\n\t\t\tvar entry = tracing_expressions.entries.get(signal);\n\n\t\t\tif (entry === undefined) {\n\t\t\t\tentry = { read: [] };\n\t\t\t\ttracing_expressions.entries.set(signal, entry);\n\t\t\t}\n\n\t\t\tentry.read.push(get_stack('TracedAt'));\n\t\t}\n\t}\n\n\treturn signal.v;\n}\n\n/**\n * Like `get`, but checks for `undefined`. Used for `var` declarations because they can be accessed before being declared\n * @template V\n * @param {Value | undefined} signal\n * @returns {V | undefined}\n */\nexport function safe_get(signal) {\n\treturn signal && get(signal);\n}\n\n/**\n * Capture an array of all the signals that are read when `fn` is called\n * @template T\n * @param {() => T} fn\n */\nfunction capture_signals(fn) {\n\tvar previous_captured_signals = captured_signals;\n\tcaptured_signals = new Set();\n\n\tvar captured = captured_signals;\n\tvar signal;\n\n\ttry {\n\t\tuntrack(fn);\n\t\tif (previous_captured_signals !== null) {\n\t\t\tfor (signal of captured_signals) {\n\t\t\t\tprevious_captured_signals.add(signal);\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tcaptured_signals = previous_captured_signals;\n\t}\n\n\treturn captured;\n}\n\n/**\n * Invokes a function and captures all signals that are read during the invocation,\n * then invalidates them.\n * @param {() => any} fn\n */\nexport function invalidate_inner_signals(fn) {\n\tvar captured = capture_signals(() => untrack(fn));\n\n\tfor (var signal of captured) {\n\t\t// Go one level up because derived signals created as part of props in legacy mode\n\t\tif ((signal.f & LEGACY_DERIVED_PROP) !== 0) {\n\t\t\tfor (const dep of /** @type {Derived} */ (signal).deps || []) {\n\t\t\t\tif ((dep.f & DERIVED) === 0) {\n\t\t\t\t\t// Use internal_set instead of set here and below to avoid mutation validation\n\t\t\t\t\tinternal_set(dep, dep.v);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tinternal_set(signal, signal.v);\n\t\t}\n\t}\n}\n\n/**\n * When used inside a [`$derived`](https://svelte.dev/docs/svelte/$derived) or [`$effect`](https://svelte.dev/docs/svelte/$effect),\n * any state read inside `fn` will not be treated as a dependency.\n *\n * ```ts\n * $effect(() => {\n * // this will run when `data` changes, but not when `time` changes\n * save(data, {\n * timestamp: untrack(() => time)\n * });\n * });\n * ```\n * @template T\n * @param {() => T} fn\n * @returns {T}\n */\nexport function untrack(fn) {\n\tvar previous_untracking = untracking;\n\ttry {\n\t\tuntracking = true;\n\t\treturn fn();\n\t} finally {\n\t\tuntracking = previous_untracking;\n\t}\n}\n\nconst STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN);\n\n/**\n * @param {Signal} signal\n * @param {number} status\n * @returns {void}\n */\nexport function set_signal_status(signal, status) {\n\tsignal.f = (signal.f & STATUS_MASK) | status;\n}\n\n/**\n * @param {Record} obj\n * @param {string[]} keys\n * @returns {Record}\n */\nexport function exclude_from_object(obj, keys) {\n\t/** @type {Record} */\n\tvar result = {};\n\n\tfor (var key in obj) {\n\t\tif (!keys.includes(key)) {\n\t\t\tresult[key] = obj[key];\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Possibly traverse an object and read all its properties so that they're all reactive in case this is `$state`.\n * Does only check first level of an object for performance reasons (heuristic should be good for 99% of all cases).\n * @param {any} value\n * @returns {void}\n */\nexport function deep_read_state(value) {\n\tif (typeof value !== 'object' || !value || value instanceof EventTarget) {\n\t\treturn;\n\t}\n\n\tif (STATE_SYMBOL in value) {\n\t\tdeep_read(value);\n\t} else if (!Array.isArray(value)) {\n\t\tfor (let key in value) {\n\t\t\tconst prop = value[key];\n\t\t\tif (typeof prop === 'object' && prop && STATE_SYMBOL in prop) {\n\t\t\t\tdeep_read(prop);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Deeply traverse an object and read all its properties\n * so that they're all reactive in case this is `$state`\n * @param {any} value\n * @param {Set} visited\n * @returns {void}\n */\nexport function deep_read(value, visited = new Set()) {\n\tif (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\t// We don't want to traverse DOM elements\n\t\t!(value instanceof EventTarget) &&\n\t\t!visited.has(value)\n\t) {\n\t\tvisited.add(value);\n\t\t// When working with a possible SvelteDate, this\n\t\t// will ensure we capture changes to it.\n\t\tif (value instanceof Date) {\n\t\t\tvalue.getTime();\n\t\t}\n\t\tfor (let key in value) {\n\t\t\ttry {\n\t\t\t\tdeep_read(value[key], visited);\n\t\t\t} catch (e) {\n\t\t\t\t// continue\n\t\t\t}\n\t\t}\n\t\tconst proto = get_prototype_of(value);\n\t\tif (\n\t\t\tproto !== Object.prototype &&\n\t\t\tproto !== Array.prototype &&\n\t\t\tproto !== Map.prototype &&\n\t\t\tproto !== Set.prototype &&\n\t\t\tproto !== Date.prototype\n\t\t) {\n\t\t\tconst descriptors = get_descriptors(proto);\n\t\t\tfor (let key in descriptors) {\n\t\t\t\tconst get = descriptors[key].get;\n\t\t\t\tif (get) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tget.call(value);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t// continue\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","/** @import { ComponentContext, ComponentContextLegacy, Derived, Effect, TemplateNode, TransitionManager } from '#client' */\nimport {\n\tcheck_dirtiness,\n\tactive_effect,\n\tactive_reaction,\n\tupdate_effect,\n\tget,\n\tis_destroying_effect,\n\tremove_reactions,\n\tschedule_effect,\n\tset_active_reaction,\n\tset_is_destroying_effect,\n\tset_signal_status,\n\tuntrack,\n\tuntracking\n} from '../runtime.js';\nimport {\n\tDIRTY,\n\tBRANCH_EFFECT,\n\tRENDER_EFFECT,\n\tEFFECT,\n\tDESTROYED,\n\tINERT,\n\tEFFECT_RAN,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT,\n\tEFFECT_TRANSPARENT,\n\tDERIVED,\n\tUNOWNED,\n\tCLEAN,\n\tINSPECT_EFFECT,\n\tHEAD_EFFECT,\n\tMAYBE_DIRTY,\n\tEFFECT_HAS_DERIVED,\n\tBOUNDARY_EFFECT\n} from '../constants.js';\nimport { set } from './sources.js';\nimport * as e from '../errors.js';\nimport { DEV } from 'esm-env';\nimport { define_property } from '../../shared/utils.js';\nimport { get_next_sibling } from '../dom/operations.js';\nimport { derived } from './deriveds.js';\nimport { component_context, dev_current_component_function } from '../context.js';\n\n/**\n * @param {'$effect' | '$effect.pre' | '$inspect'} rune\n */\nexport function validate_effect(rune) {\n\tif (active_effect === null && active_reaction === null) {\n\t\te.effect_orphan(rune);\n\t}\n\n\tif (active_reaction !== null && (active_reaction.f & UNOWNED) !== 0 && active_effect === null) {\n\t\te.effect_in_unowned_derived();\n\t}\n\n\tif (is_destroying_effect) {\n\t\te.effect_in_teardown(rune);\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {Effect} parent_effect\n */\nfunction push_effect(effect, parent_effect) {\n\tvar parent_last = parent_effect.last;\n\tif (parent_last === null) {\n\t\tparent_effect.last = parent_effect.first = effect;\n\t} else {\n\t\tparent_last.next = effect;\n\t\teffect.prev = parent_last;\n\t\tparent_effect.last = effect;\n\t}\n}\n\n/**\n * @param {number} type\n * @param {null | (() => void | (() => void))} fn\n * @param {boolean} sync\n * @param {boolean} push\n * @returns {Effect}\n */\nfunction create_effect(type, fn, sync, push = true) {\n\tvar is_root = (type & ROOT_EFFECT) !== 0;\n\tvar parent_effect = active_effect;\n\n\tif (DEV) {\n\t\t// Ensure the parent is never an inspect effect\n\t\twhile (parent_effect !== null && (parent_effect.f & INSPECT_EFFECT) !== 0) {\n\t\t\tparent_effect = parent_effect.parent;\n\t\t}\n\t}\n\n\t/** @type {Effect} */\n\tvar effect = {\n\t\tctx: component_context,\n\t\tdeps: null,\n\t\tnodes_start: null,\n\t\tnodes_end: null,\n\t\tf: type | DIRTY,\n\t\tfirst: null,\n\t\tfn,\n\t\tlast: null,\n\t\tnext: null,\n\t\tparent: is_root ? null : parent_effect,\n\t\tprev: null,\n\t\tteardown: null,\n\t\ttransitions: null,\n\t\twv: 0\n\t};\n\n\tif (DEV) {\n\t\teffect.component_function = dev_current_component_function;\n\t}\n\n\tif (sync) {\n\t\ttry {\n\t\t\tupdate_effect(effect);\n\t\t\teffect.f |= EFFECT_RAN;\n\t\t} catch (e) {\n\t\t\tdestroy_effect(effect);\n\t\t\tthrow e;\n\t\t}\n\t} else if (fn !== null) {\n\t\tschedule_effect(effect);\n\t}\n\n\t// if an effect has no dependencies, no DOM and no teardown function,\n\t// don't bother adding it to the effect tree\n\tvar inert =\n\t\tsync &&\n\t\teffect.deps === null &&\n\t\teffect.first === null &&\n\t\teffect.nodes_start === null &&\n\t\teffect.teardown === null &&\n\t\t(effect.f & (EFFECT_HAS_DERIVED | BOUNDARY_EFFECT)) === 0;\n\n\tif (!inert && !is_root && push) {\n\t\tif (parent_effect !== null) {\n\t\t\tpush_effect(effect, parent_effect);\n\t\t}\n\n\t\t// if we're in a derived, add the effect there too\n\t\tif (active_reaction !== null && (active_reaction.f & DERIVED) !== 0) {\n\t\t\tvar derived = /** @type {Derived} */ (active_reaction);\n\t\t\t(derived.effects ??= []).push(effect);\n\t\t}\n\t}\n\n\treturn effect;\n}\n\n/**\n * Internal representation of `$effect.tracking()`\n * @returns {boolean}\n */\nexport function effect_tracking() {\n\treturn active_reaction !== null && !untracking;\n}\n\n/**\n * @param {() => void} fn\n */\nexport function teardown(fn) {\n\tconst effect = create_effect(RENDER_EFFECT, null, false);\n\tset_signal_status(effect, CLEAN);\n\teffect.teardown = fn;\n\treturn effect;\n}\n\n/**\n * Internal representation of `$effect(...)`\n * @param {() => void | (() => void)} fn\n */\nexport function user_effect(fn) {\n\tvalidate_effect('$effect');\n\n\t// Non-nested `$effect(...)` in a component should be deferred\n\t// until the component is mounted\n\tvar defer =\n\t\tactive_effect !== null &&\n\t\t(active_effect.f & BRANCH_EFFECT) !== 0 &&\n\t\tcomponent_context !== null &&\n\t\t!component_context.m;\n\n\tif (DEV) {\n\t\tdefine_property(fn, 'name', {\n\t\t\tvalue: '$effect'\n\t\t});\n\t}\n\n\tif (defer) {\n\t\tvar context = /** @type {ComponentContext} */ (component_context);\n\t\t(context.e ??= []).push({\n\t\t\tfn,\n\t\t\teffect: active_effect,\n\t\t\treaction: active_reaction\n\t\t});\n\t} else {\n\t\tvar signal = effect(fn);\n\t\treturn signal;\n\t}\n}\n\n/**\n * Internal representation of `$effect.pre(...)`\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function user_pre_effect(fn) {\n\tvalidate_effect('$effect.pre');\n\tif (DEV) {\n\t\tdefine_property(fn, 'name', {\n\t\t\tvalue: '$effect.pre'\n\t\t});\n\t}\n\treturn render_effect(fn);\n}\n\n/** @param {() => void | (() => void)} fn */\nexport function inspect_effect(fn) {\n\treturn create_effect(INSPECT_EFFECT, fn, true);\n}\n\n/**\n * Internal representation of `$effect.root(...)`\n * @param {() => void | (() => void)} fn\n * @returns {() => void}\n */\nexport function effect_root(fn) {\n\tconst effect = create_effect(ROOT_EFFECT, fn, true);\n\n\treturn () => {\n\t\tdestroy_effect(effect);\n\t};\n}\n\n/**\n * An effect root whose children can transition out\n * @param {() => void} fn\n * @returns {(options?: { outro?: boolean }) => Promise}\n */\nexport function component_root(fn) {\n\tconst effect = create_effect(ROOT_EFFECT, fn, true);\n\n\treturn (options = {}) => {\n\t\treturn new Promise((fulfil) => {\n\t\t\tif (options.outro) {\n\t\t\t\tpause_effect(effect, () => {\n\t\t\t\t\tdestroy_effect(effect);\n\t\t\t\t\tfulfil(undefined);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tdestroy_effect(effect);\n\t\t\t\tfulfil(undefined);\n\t\t\t}\n\t\t});\n\t};\n}\n\n/**\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function effect(fn) {\n\treturn create_effect(EFFECT, fn, false);\n}\n\n/**\n * Internal representation of `$: ..`\n * @param {() => any} deps\n * @param {() => void | (() => void)} fn\n */\nexport function legacy_pre_effect(deps, fn) {\n\tvar context = /** @type {ComponentContextLegacy} */ (component_context);\n\n\t/** @type {{ effect: null | Effect, ran: boolean }} */\n\tvar token = { effect: null, ran: false };\n\tcontext.l.r1.push(token);\n\n\ttoken.effect = render_effect(() => {\n\t\tdeps();\n\n\t\t// If this legacy pre effect has already run before the end of the reset, then\n\t\t// bail out to emulate the same behavior.\n\t\tif (token.ran) return;\n\n\t\ttoken.ran = true;\n\t\tset(context.l.r2, true);\n\t\tuntrack(fn);\n\t});\n}\n\nexport function legacy_pre_effect_reset() {\n\tvar context = /** @type {ComponentContextLegacy} */ (component_context);\n\n\trender_effect(() => {\n\t\tif (!get(context.l.r2)) return;\n\n\t\t// Run dirty `$:` statements\n\t\tfor (var token of context.l.r1) {\n\t\t\tvar effect = token.effect;\n\n\t\t\t// If the effect is CLEAN, then make it MAYBE_DIRTY. This ensures we traverse through\n\t\t\t// the effects dependencies and correctly ensure each dependency is up-to-date.\n\t\t\tif ((effect.f & CLEAN) !== 0) {\n\t\t\t\tset_signal_status(effect, MAYBE_DIRTY);\n\t\t\t}\n\n\t\t\tif (check_dirtiness(effect)) {\n\t\t\t\tupdate_effect(effect);\n\t\t\t}\n\n\t\t\ttoken.ran = false;\n\t\t}\n\n\t\tcontext.l.r2.v = false; // set directly to avoid rerunning this effect\n\t});\n}\n\n/**\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function render_effect(fn) {\n\treturn create_effect(RENDER_EFFECT, fn, true);\n}\n\n/**\n * @param {(...expressions: any) => void | (() => void)} fn\n * @param {Array<() => any>} thunks\n * @returns {Effect}\n */\nexport function template_effect(fn, thunks = [], d = derived) {\n\tconst deriveds = thunks.map(d);\n\tconst effect = () => fn(...deriveds.map(get));\n\n\tif (DEV) {\n\t\tdefine_property(effect, 'name', {\n\t\t\tvalue: '{expression}'\n\t\t});\n\t}\n\n\treturn block(effect);\n}\n\n/**\n * @param {(() => void)} fn\n * @param {number} flags\n */\nexport function block(fn, flags = 0) {\n\treturn create_effect(RENDER_EFFECT | BLOCK_EFFECT | flags, fn, true);\n}\n\n/**\n * @param {(() => void)} fn\n * @param {boolean} [push]\n */\nexport function branch(fn, push = true) {\n\treturn create_effect(RENDER_EFFECT | BRANCH_EFFECT, fn, true, push);\n}\n\n/**\n * @param {Effect} effect\n */\nexport function execute_effect_teardown(effect) {\n\tvar teardown = effect.teardown;\n\tif (teardown !== null) {\n\t\tconst previously_destroying_effect = is_destroying_effect;\n\t\tconst previous_reaction = active_reaction;\n\t\tset_is_destroying_effect(true);\n\t\tset_active_reaction(null);\n\t\ttry {\n\t\t\tteardown.call(null);\n\t\t} finally {\n\t\t\tset_is_destroying_effect(previously_destroying_effect);\n\t\t\tset_active_reaction(previous_reaction);\n\t\t}\n\t}\n}\n\n/**\n * @param {Effect} signal\n * @param {boolean} remove_dom\n * @returns {void}\n */\nexport function destroy_effect_children(signal, remove_dom = false) {\n\tvar effect = signal.first;\n\tsignal.first = signal.last = null;\n\n\twhile (effect !== null) {\n\t\tvar next = effect.next;\n\t\tdestroy_effect(effect, remove_dom);\n\t\teffect = next;\n\t}\n}\n\n/**\n * @param {Effect} signal\n * @returns {void}\n */\nexport function destroy_block_effect_children(signal) {\n\tvar effect = signal.first;\n\n\twhile (effect !== null) {\n\t\tvar next = effect.next;\n\t\tif ((effect.f & BRANCH_EFFECT) === 0) {\n\t\t\tdestroy_effect(effect);\n\t\t}\n\t\teffect = next;\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {boolean} [remove_dom]\n * @returns {void}\n */\nexport function destroy_effect(effect, remove_dom = true) {\n\tvar removed = false;\n\n\tif ((remove_dom || (effect.f & HEAD_EFFECT) !== 0) && effect.nodes_start !== null) {\n\t\t/** @type {TemplateNode | null} */\n\t\tvar node = effect.nodes_start;\n\t\tvar end = effect.nodes_end;\n\n\t\twhile (node !== null) {\n\t\t\t/** @type {TemplateNode | null} */\n\t\t\tvar next = node === end ? null : /** @type {TemplateNode} */ (get_next_sibling(node));\n\n\t\t\tnode.remove();\n\t\t\tnode = next;\n\t\t}\n\n\t\tremoved = true;\n\t}\n\n\tdestroy_effect_children(effect, remove_dom && !removed);\n\tremove_reactions(effect, 0);\n\tset_signal_status(effect, DESTROYED);\n\n\tvar transitions = effect.transitions;\n\n\tif (transitions !== null) {\n\t\tfor (const transition of transitions) {\n\t\t\ttransition.stop();\n\t\t}\n\t}\n\n\texecute_effect_teardown(effect);\n\n\tvar parent = effect.parent;\n\n\t// If the parent doesn't have any children, then skip this work altogether\n\tif (parent !== null && parent.first !== null) {\n\t\tunlink_effect(effect);\n\t}\n\n\tif (DEV) {\n\t\teffect.component_function = null;\n\t}\n\n\t// `first` and `child` are nulled out in destroy_effect_children\n\t// we don't null out `parent` so that error propagation can work correctly\n\teffect.next =\n\t\teffect.prev =\n\t\teffect.teardown =\n\t\teffect.ctx =\n\t\teffect.deps =\n\t\teffect.fn =\n\t\teffect.nodes_start =\n\t\teffect.nodes_end =\n\t\t\tnull;\n}\n\n/**\n * Detach an effect from the effect tree, freeing up memory and\n * reducing the amount of work that happens on subsequent traversals\n * @param {Effect} effect\n */\nexport function unlink_effect(effect) {\n\tvar parent = effect.parent;\n\tvar prev = effect.prev;\n\tvar next = effect.next;\n\n\tif (prev !== null) prev.next = next;\n\tif (next !== null) next.prev = prev;\n\n\tif (parent !== null) {\n\t\tif (parent.first === effect) parent.first = next;\n\t\tif (parent.last === effect) parent.last = prev;\n\t}\n}\n\n/**\n * When a block effect is removed, we don't immediately destroy it or yank it\n * out of the DOM, because it might have transitions. Instead, we 'pause' it.\n * It stays around (in memory, and in the DOM) until outro transitions have\n * completed, and if the state change is reversed then we _resume_ it.\n * A paused effect does not update, and the DOM subtree becomes inert.\n * @param {Effect} effect\n * @param {() => void} [callback]\n */\nexport function pause_effect(effect, callback) {\n\t/** @type {TransitionManager[]} */\n\tvar transitions = [];\n\n\tpause_children(effect, transitions, true);\n\n\trun_out_transitions(transitions, () => {\n\t\tdestroy_effect(effect);\n\t\tif (callback) callback();\n\t});\n}\n\n/**\n * @param {TransitionManager[]} transitions\n * @param {() => void} fn\n */\nexport function run_out_transitions(transitions, fn) {\n\tvar remaining = transitions.length;\n\tif (remaining > 0) {\n\t\tvar check = () => --remaining || fn();\n\t\tfor (var transition of transitions) {\n\t\t\ttransition.out(check);\n\t\t}\n\t} else {\n\t\tfn();\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {TransitionManager[]} transitions\n * @param {boolean} local\n */\nexport function pause_children(effect, transitions, local) {\n\tif ((effect.f & INERT) !== 0) return;\n\teffect.f ^= INERT;\n\n\tif (effect.transitions !== null) {\n\t\tfor (const transition of effect.transitions) {\n\t\t\tif (transition.is_global || local) {\n\t\t\t\ttransitions.push(transition);\n\t\t\t}\n\t\t}\n\t}\n\n\tvar child = effect.first;\n\n\twhile (child !== null) {\n\t\tvar sibling = child.next;\n\t\tvar transparent = (child.f & EFFECT_TRANSPARENT) !== 0 || (child.f & BRANCH_EFFECT) !== 0;\n\t\t// TODO we don't need to call pause_children recursively with a linked list in place\n\t\t// it's slightly more involved though as we have to account for `transparent` changing\n\t\t// through the tree.\n\t\tpause_children(child, transitions, transparent ? local : false);\n\t\tchild = sibling;\n\t}\n}\n\n/**\n * The opposite of `pause_effect`. We call this if (for example)\n * `x` becomes falsy then truthy: `{#if x}...{/if}`\n * @param {Effect} effect\n */\nexport function resume_effect(effect) {\n\tresume_children(effect, true);\n}\n\n/**\n * @param {Effect} effect\n * @param {boolean} local\n */\nfunction resume_children(effect, local) {\n\tif ((effect.f & INERT) === 0) return;\n\teffect.f ^= INERT;\n\n\t// Ensure the effect is marked as clean again so that any dirty child\n\t// effects can schedule themselves for execution\n\tif ((effect.f & CLEAN) === 0) {\n\t\teffect.f ^= CLEAN;\n\t}\n\n\t// If a dependency of this effect changed while it was paused,\n\t// schedule the effect to update\n\tif (check_dirtiness(effect)) {\n\t\tset_signal_status(effect, DIRTY);\n\t\tschedule_effect(effect);\n\t}\n\n\tvar child = effect.first;\n\n\twhile (child !== null) {\n\t\tvar sibling = child.next;\n\t\tvar transparent = (child.f & EFFECT_TRANSPARENT) !== 0 || (child.f & BRANCH_EFFECT) !== 0;\n\t\t// TODO we don't need to call resume_children recursively with a linked list in place\n\t\t// it's slightly more involved though as we have to account for `transparent` changing\n\t\t// through the tree.\n\t\tresume_children(child, transparent ? local : false);\n\t\tchild = sibling;\n\t}\n\n\tif (effect.transitions !== null) {\n\t\tfor (const transition of effect.transitions) {\n\t\t\tif (transition.is_global || local) {\n\t\t\t\ttransition.in();\n\t\t\t}\n\t\t}\n\t}\n}\n","/* This file is generated by scripts/process-messages/index.js. Do not edit! */\n\nimport { DEV } from 'esm-env';\n\n/**\n * Cannot use `{@render children(...)}` if the parent component uses `let:` directives. Consider using a named snippet instead\n * @returns {never}\n */\nexport function invalid_default_snippet() {\n\tif (DEV) {\n\t\tconst error = new Error(`invalid_default_snippet\\nCannot use \\`{@render children(...)}\\` if the parent component uses \\`let:\\` directives. Consider using a named snippet instead\\nhttps://svelte.dev/e/invalid_default_snippet`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/invalid_default_snippet`);\n\t}\n}\n\n/**\n * `%name%(...)` can only be used during component initialisation\n * @param {string} name\n * @returns {never}\n */\nexport function lifecycle_outside_component(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`lifecycle_outside_component\\n\\`${name}(...)\\` can only be used during component initialisation\\nhttps://svelte.dev/e/lifecycle_outside_component`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/lifecycle_outside_component`);\n\t}\n}\n\n/**\n * `%name%` is not a store with a `subscribe` method\n * @param {string} name\n * @returns {never}\n */\nexport function store_invalid_shape(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`store_invalid_shape\\n\\`${name}\\` is not a store with a \\`subscribe\\` method\\nhttps://svelte.dev/e/store_invalid_shape`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/store_invalid_shape`);\n\t}\n}\n\n/**\n * The `this` prop on `` must be a string, if defined\n * @returns {never}\n */\nexport function svelte_element_invalid_this_value() {\n\tif (DEV) {\n\t\tconst error = new Error(`svelte_element_invalid_this_value\\nThe \\`this\\` prop on \\`\\` must be a string, if defined\\nhttps://svelte.dev/e/svelte_element_invalid_this_value`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/svelte_element_invalid_this_value`);\n\t}\n}","/** @import { ComponentContext } from '#client' */\n\nimport { DEV } from 'esm-env';\nimport { add_owner } from './dev/ownership.js';\nimport { lifecycle_outside_component } from '../shared/errors.js';\nimport { source } from './reactivity/sources.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction,\n\tuntrack\n} from './runtime.js';\nimport { effect } from './reactivity/effects.js';\nimport { legacy_mode_flag } from '../flags/index.js';\n\n/** @type {ComponentContext | null} */\nexport let component_context = null;\n\n/** @param {ComponentContext | null} context */\nexport function set_component_context(context) {\n\tcomponent_context = context;\n}\n\n/**\n * The current component function. Different from current component context:\n * ```html\n * \n * \n * \n * \n * ```\n * @type {ComponentContext['function']}\n */\nexport let dev_current_component_function = null;\n\n/** @param {ComponentContext['function']} fn */\nexport function set_dev_current_component_function(fn) {\n\tdev_current_component_function = fn;\n}\n\n/**\n * Retrieves the context that belongs to the closest parent component with the specified `key`.\n * Must be called during component initialisation.\n *\n * @template T\n * @param {any} key\n * @returns {T}\n */\nexport function getContext(key) {\n\tconst context_map = get_or_init_context_map('getContext');\n\tconst result = /** @type {T} */ (context_map.get(key));\n\treturn result;\n}\n\n/**\n * Associates an arbitrary `context` object with the current component and the specified `key`\n * and returns that object. The context is then available to children of the component\n * (including slotted content) with `getContext`.\n *\n * Like lifecycle functions, this must be called during component initialisation.\n *\n * @template T\n * @param {any} key\n * @param {T} context\n * @returns {T}\n */\nexport function setContext(key, context) {\n\tconst context_map = get_or_init_context_map('setContext');\n\n\tif (DEV) {\n\t\t// When state is put into context, we treat as if it's global from now on.\n\t\t// We do for performance reasons (it's for example very expensive to call\n\t\t// getContext on a big object many times when part of a list component)\n\t\t// and danger of false positives.\n\t\tuntrack(() => add_owner(context, null, true));\n\t}\n\n\tcontext_map.set(key, context);\n\treturn context;\n}\n\n/**\n * Checks whether a given `key` has been set in the context of a parent component.\n * Must be called during component initialisation.\n *\n * @param {any} key\n * @returns {boolean}\n */\nexport function hasContext(key) {\n\tconst context_map = get_or_init_context_map('hasContext');\n\treturn context_map.has(key);\n}\n\n/**\n * Retrieves the whole context map that belongs to the closest parent component.\n * Must be called during component initialisation. Useful, for example, if you\n * programmatically create a component and want to pass the existing context to it.\n *\n * @template {Map} [T=Map]\n * @returns {T}\n */\nexport function getAllContexts() {\n\tconst context_map = get_or_init_context_map('getAllContexts');\n\treturn /** @type {T} */ (context_map);\n}\n\n/**\n * @param {Record} props\n * @param {any} runes\n * @param {Function} [fn]\n * @returns {void}\n */\nexport function push(props, runes = false, fn) {\n\tcomponent_context = {\n\t\tp: component_context,\n\t\tc: null,\n\t\te: null,\n\t\tm: false,\n\t\ts: props,\n\t\tx: null,\n\t\tl: null\n\t};\n\n\tif (legacy_mode_flag && !runes) {\n\t\tcomponent_context.l = {\n\t\t\ts: null,\n\t\t\tu: null,\n\t\t\tr1: [],\n\t\t\tr2: source(false)\n\t\t};\n\t}\n\n\tif (DEV) {\n\t\t// component function\n\t\tcomponent_context.function = fn;\n\t\tdev_current_component_function = fn;\n\t}\n}\n\n/**\n * @template {Record} T\n * @param {T} [component]\n * @returns {T}\n */\nexport function pop(component) {\n\tconst context_stack_item = component_context;\n\tif (context_stack_item !== null) {\n\t\tif (component !== undefined) {\n\t\t\tcontext_stack_item.x = component;\n\t\t}\n\t\tconst component_effects = context_stack_item.e;\n\t\tif (component_effects !== null) {\n\t\t\tvar previous_effect = active_effect;\n\t\t\tvar previous_reaction = active_reaction;\n\t\t\tcontext_stack_item.e = null;\n\t\t\ttry {\n\t\t\t\tfor (var i = 0; i < component_effects.length; i++) {\n\t\t\t\t\tvar component_effect = component_effects[i];\n\t\t\t\t\tset_active_effect(component_effect.effect);\n\t\t\t\t\tset_active_reaction(component_effect.reaction);\n\t\t\t\t\teffect(component_effect.fn);\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tset_active_effect(previous_effect);\n\t\t\t\tset_active_reaction(previous_reaction);\n\t\t\t}\n\t\t}\n\t\tcomponent_context = context_stack_item.p;\n\t\tif (DEV) {\n\t\t\tdev_current_component_function = context_stack_item.p?.function ?? null;\n\t\t}\n\t\tcontext_stack_item.m = true;\n\t}\n\t// Micro-optimization: Don't set .a above to the empty object\n\t// so it can be garbage-collected when the return here is unused\n\treturn component || /** @type {T} */ ({});\n}\n\n/** @returns {boolean} */\nexport function is_runes() {\n\treturn !legacy_mode_flag || (component_context !== null && component_context.l === null);\n}\n\n/**\n * @param {string} name\n * @returns {Map}\n */\nfunction get_or_init_context_map(name) {\n\tif (component_context === null) {\n\t\tlifecycle_outside_component(name);\n\t}\n\n\treturn (component_context.c ??= new Map(get_parent_context(component_context) || undefined));\n}\n\n/**\n * @param {ComponentContext} component_context\n * @returns {Map | null}\n */\nfunction get_parent_context(component_context) {\n\tlet parent = component_context.p;\n\twhile (parent !== null) {\n\t\tconst context_map = parent.c;\n\t\tif (context_map !== null) {\n\t\t\treturn context_map;\n\t\t}\n\t\tparent = parent.p;\n\t}\n\treturn null;\n}\n","const regex_return_characters = /\\r/g;\n\n/**\n * @param {string} str\n * @returns {string}\n */\nexport function hash(str) {\n\tstr = str.replace(regex_return_characters, '');\n\tlet hash = 5381;\n\tlet i = str.length;\n\n\twhile (i--) hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n\treturn (hash >>> 0).toString(36);\n}\n\nconst VOID_ELEMENT_NAMES = [\n\t'area',\n\t'base',\n\t'br',\n\t'col',\n\t'command',\n\t'embed',\n\t'hr',\n\t'img',\n\t'input',\n\t'keygen',\n\t'link',\n\t'meta',\n\t'param',\n\t'source',\n\t'track',\n\t'wbr'\n];\n\n/**\n * Returns `true` if `name` is of a void element\n * @param {string} name\n */\nexport function is_void(name) {\n\treturn VOID_ELEMENT_NAMES.includes(name) || name.toLowerCase() === '!doctype';\n}\n\nconst RESERVED_WORDS = [\n\t'arguments',\n\t'await',\n\t'break',\n\t'case',\n\t'catch',\n\t'class',\n\t'const',\n\t'continue',\n\t'debugger',\n\t'default',\n\t'delete',\n\t'do',\n\t'else',\n\t'enum',\n\t'eval',\n\t'export',\n\t'extends',\n\t'false',\n\t'finally',\n\t'for',\n\t'function',\n\t'if',\n\t'implements',\n\t'import',\n\t'in',\n\t'instanceof',\n\t'interface',\n\t'let',\n\t'new',\n\t'null',\n\t'package',\n\t'private',\n\t'protected',\n\t'public',\n\t'return',\n\t'static',\n\t'super',\n\t'switch',\n\t'this',\n\t'throw',\n\t'true',\n\t'try',\n\t'typeof',\n\t'var',\n\t'void',\n\t'while',\n\t'with',\n\t'yield'\n];\n\n/**\n * Returns `true` if `word` is a reserved JavaScript keyword\n * @param {string} word\n */\nexport function is_reserved(word) {\n\treturn RESERVED_WORDS.includes(word);\n}\n\n/**\n * @param {string} name\n */\nexport function is_capture_event(name) {\n\treturn name.endsWith('capture') && name !== 'gotpointercapture' && name !== 'lostpointercapture';\n}\n\n/** List of Element events that will be delegated */\nconst DELEGATED_EVENTS = [\n\t'beforeinput',\n\t'click',\n\t'change',\n\t'dblclick',\n\t'contextmenu',\n\t'focusin',\n\t'focusout',\n\t'input',\n\t'keydown',\n\t'keyup',\n\t'mousedown',\n\t'mousemove',\n\t'mouseout',\n\t'mouseover',\n\t'mouseup',\n\t'pointerdown',\n\t'pointermove',\n\t'pointerout',\n\t'pointerover',\n\t'pointerup',\n\t'touchend',\n\t'touchmove',\n\t'touchstart'\n];\n\n/**\n * Returns `true` if `event_name` is a delegated event\n * @param {string} event_name\n */\nexport function is_delegated(event_name) {\n\treturn DELEGATED_EVENTS.includes(event_name);\n}\n\n/**\n * Attributes that are boolean, i.e. they are present or not present.\n */\nconst DOM_BOOLEAN_ATTRIBUTES = [\n\t'allowfullscreen',\n\t'async',\n\t'autofocus',\n\t'autoplay',\n\t'checked',\n\t'controls',\n\t'default',\n\t'disabled',\n\t'formnovalidate',\n\t'hidden',\n\t'indeterminate',\n\t'inert',\n\t'ismap',\n\t'loop',\n\t'multiple',\n\t'muted',\n\t'nomodule',\n\t'novalidate',\n\t'open',\n\t'playsinline',\n\t'readonly',\n\t'required',\n\t'reversed',\n\t'seamless',\n\t'selected',\n\t'webkitdirectory',\n\t'defer',\n\t'disablepictureinpicture',\n\t'disableremoteplayback'\n];\n\n/**\n * Returns `true` if `name` is a boolean attribute\n * @param {string} name\n */\nexport function is_boolean_attribute(name) {\n\treturn DOM_BOOLEAN_ATTRIBUTES.includes(name);\n}\n\n/**\n * @type {Record}\n * List of attribute names that should be aliased to their property names\n * because they behave differently between setting them as an attribute and\n * setting them as a property.\n */\nconst ATTRIBUTE_ALIASES = {\n\t// no `class: 'className'` because we handle that separately\n\tformnovalidate: 'formNoValidate',\n\tismap: 'isMap',\n\tnomodule: 'noModule',\n\tplaysinline: 'playsInline',\n\treadonly: 'readOnly',\n\tdefaultvalue: 'defaultValue',\n\tdefaultchecked: 'defaultChecked',\n\tsrcobject: 'srcObject',\n\tnovalidate: 'noValidate',\n\tallowfullscreen: 'allowFullscreen',\n\tdisablepictureinpicture: 'disablePictureInPicture',\n\tdisableremoteplayback: 'disableRemotePlayback'\n};\n\n/**\n * @param {string} name\n */\nexport function normalize_attribute(name) {\n\tname = name.toLowerCase();\n\treturn ATTRIBUTE_ALIASES[name] ?? name;\n}\n\nconst DOM_PROPERTIES = [\n\t...DOM_BOOLEAN_ATTRIBUTES,\n\t'formNoValidate',\n\t'isMap',\n\t'noModule',\n\t'playsInline',\n\t'readOnly',\n\t'value',\n\t'volume',\n\t'defaultValue',\n\t'defaultChecked',\n\t'srcObject',\n\t'noValidate',\n\t'allowFullscreen',\n\t'disablePictureInPicture',\n\t'disableRemotePlayback'\n];\n\n/**\n * @param {string} name\n */\nexport function is_dom_property(name) {\n\treturn DOM_PROPERTIES.includes(name);\n}\n\nconst NON_STATIC_PROPERTIES = ['autofocus', 'muted', 'defaultValue', 'defaultChecked'];\n\n/**\n * Returns `true` if the given attribute cannot be set through the template\n * string, i.e. needs some kind of JavaScript handling to work.\n * @param {string} name\n */\nexport function cannot_be_set_statically(name) {\n\treturn NON_STATIC_PROPERTIES.includes(name);\n}\n\n/**\n * Subset of delegated events which should be passive by default.\n * These two are already passive via browser defaults on window, document and body.\n * But since\n * - we're delegating them\n * - they happen often\n * - they apply to mobile which is generally less performant\n * we're marking them as passive by default for other elements, too.\n */\nconst PASSIVE_EVENTS = ['touchstart', 'touchmove'];\n\n/**\n * Returns `true` if `name` is a passive event\n * @param {string} name\n */\nexport function is_passive_event(name) {\n\treturn PASSIVE_EVENTS.includes(name);\n}\n\nconst CONTENT_EDITABLE_BINDINGS = ['textContent', 'innerHTML', 'innerText'];\n\n/** @param {string} name */\nexport function is_content_editable_binding(name) {\n\treturn CONTENT_EDITABLE_BINDINGS.includes(name);\n}\n\nconst LOAD_ERROR_ELEMENTS = [\n\t'body',\n\t'embed',\n\t'iframe',\n\t'img',\n\t'link',\n\t'object',\n\t'script',\n\t'style',\n\t'track'\n];\n\n/**\n * Returns `true` if the element emits `load` and `error` events\n * @param {string} name\n */\nexport function is_load_error_element(name) {\n\treturn LOAD_ERROR_ELEMENTS.includes(name);\n}\n\nconst SVG_ELEMENTS = [\n\t'altGlyph',\n\t'altGlyphDef',\n\t'altGlyphItem',\n\t'animate',\n\t'animateColor',\n\t'animateMotion',\n\t'animateTransform',\n\t'circle',\n\t'clipPath',\n\t'color-profile',\n\t'cursor',\n\t'defs',\n\t'desc',\n\t'discard',\n\t'ellipse',\n\t'feBlend',\n\t'feColorMatrix',\n\t'feComponentTransfer',\n\t'feComposite',\n\t'feConvolveMatrix',\n\t'feDiffuseLighting',\n\t'feDisplacementMap',\n\t'feDistantLight',\n\t'feDropShadow',\n\t'feFlood',\n\t'feFuncA',\n\t'feFuncB',\n\t'feFuncG',\n\t'feFuncR',\n\t'feGaussianBlur',\n\t'feImage',\n\t'feMerge',\n\t'feMergeNode',\n\t'feMorphology',\n\t'feOffset',\n\t'fePointLight',\n\t'feSpecularLighting',\n\t'feSpotLight',\n\t'feTile',\n\t'feTurbulence',\n\t'filter',\n\t'font',\n\t'font-face',\n\t'font-face-format',\n\t'font-face-name',\n\t'font-face-src',\n\t'font-face-uri',\n\t'foreignObject',\n\t'g',\n\t'glyph',\n\t'glyphRef',\n\t'hatch',\n\t'hatchpath',\n\t'hkern',\n\t'image',\n\t'line',\n\t'linearGradient',\n\t'marker',\n\t'mask',\n\t'mesh',\n\t'meshgradient',\n\t'meshpatch',\n\t'meshrow',\n\t'metadata',\n\t'missing-glyph',\n\t'mpath',\n\t'path',\n\t'pattern',\n\t'polygon',\n\t'polyline',\n\t'radialGradient',\n\t'rect',\n\t'set',\n\t'solidcolor',\n\t'stop',\n\t'svg',\n\t'switch',\n\t'symbol',\n\t'text',\n\t'textPath',\n\t'tref',\n\t'tspan',\n\t'unknown',\n\t'use',\n\t'view',\n\t'vkern'\n];\n\n/** @param {string} name */\nexport function is_svg(name) {\n\treturn SVG_ELEMENTS.includes(name);\n}\n\nconst MATHML_ELEMENTS = [\n\t'annotation',\n\t'annotation-xml',\n\t'maction',\n\t'math',\n\t'merror',\n\t'mfrac',\n\t'mi',\n\t'mmultiscripts',\n\t'mn',\n\t'mo',\n\t'mover',\n\t'mpadded',\n\t'mphantom',\n\t'mprescripts',\n\t'mroot',\n\t'mrow',\n\t'ms',\n\t'mspace',\n\t'msqrt',\n\t'mstyle',\n\t'msub',\n\t'msubsup',\n\t'msup',\n\t'mtable',\n\t'mtd',\n\t'mtext',\n\t'mtr',\n\t'munder',\n\t'munderover',\n\t'semantics'\n];\n\n/** @param {string} name */\nexport function is_mathml(name) {\n\treturn MATHML_ELEMENTS.includes(name);\n}\n\nconst RUNES = /** @type {const} */ ([\n\t'$state',\n\t'$state.raw',\n\t'$state.snapshot',\n\t'$props',\n\t'$props.id',\n\t'$bindable',\n\t'$derived',\n\t'$derived.by',\n\t'$effect',\n\t'$effect.pre',\n\t'$effect.tracking',\n\t'$effect.root',\n\t'$inspect',\n\t'$inspect().with',\n\t'$inspect.trace',\n\t'$host'\n]);\n\n/**\n * @param {string} name\n * @returns {name is RUNES[number]}\n */\nexport function is_rune(name) {\n\treturn RUNES.includes(/** @type {RUNES[number]} */ (name));\n}\n\n/** List of elements that require raw contents and should not have SSR comments put in them */\nconst RAW_TEXT_ELEMENTS = /** @type {const} */ (['textarea', 'script', 'style', 'title']);\n\n/** @param {string} name */\nexport function is_raw_text_element(name) {\n\treturn RAW_TEXT_ELEMENTS.includes(/** @type {RAW_TEXT_ELEMENTS[number]} */ (name));\n}\n\n/**\n * Prevent devtools trying to make `location` a clickable link by inserting a zero-width space\n * @param {string | undefined} location\n */\nexport function sanitize_location(location) {\n\treturn location?.replace(/\\//g, '/\\u200b');\n}\n","import { hydrating } from '../hydration.js';\nimport { clear_text_content, get_first_child } from '../operations.js';\nimport { queue_micro_task } from '../task.js';\n\n/**\n * @param {HTMLElement} dom\n * @param {boolean} value\n * @returns {void}\n */\nexport function autofocus(dom, value) {\n\tif (value) {\n\t\tconst body = document.body;\n\t\tdom.autofocus = true;\n\n\t\tqueue_micro_task(() => {\n\t\t\tif (document.activeElement === body) {\n\t\t\t\tdom.focus();\n\t\t\t}\n\t\t});\n\t}\n}\n\n/**\n * The child of a textarea actually corresponds to the defaultValue property, so we need\n * to remove it upon hydration to avoid a bug when someone resets the form value.\n * @param {HTMLTextAreaElement} dom\n * @returns {void}\n */\nexport function remove_textarea_child(dom) {\n\tif (hydrating && get_first_child(dom) !== null) {\n\t\tclear_text_content(dom);\n\t}\n}\n\nlet listening_to_form_reset = false;\n\nexport function add_form_reset_listener() {\n\tif (!listening_to_form_reset) {\n\t\tlistening_to_form_reset = true;\n\t\tdocument.addEventListener(\n\t\t\t'reset',\n\t\t\t(evt) => {\n\t\t\t\t// Needs to happen one tick later or else the dom properties of the form\n\t\t\t\t// elements have not updated to their reset values yet\n\t\t\t\tPromise.resolve().then(() => {\n\t\t\t\t\tif (!evt.defaultPrevented) {\n\t\t\t\t\t\tfor (const e of /**@type {HTMLFormElement} */ (evt.target).elements) {\n\t\t\t\t\t\t\t// @ts-expect-error\n\t\t\t\t\t\t\te.__on_r?.();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\t// In the capture phase to guarantee we get noticed of it (no possiblity of stopPropagation)\n\t\t\t{ capture: true }\n\t\t);\n\t}\n}\n","import { teardown } from '../../../reactivity/effects.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../../runtime.js';\nimport { add_form_reset_listener } from '../misc.js';\n\n/**\n * Fires the handler once immediately (unless corresponding arg is set to `false`),\n * then listens to the given events until the render effect context is destroyed\n * @param {EventTarget} target\n * @param {Array} events\n * @param {(event?: Event) => void} handler\n * @param {any} call_handler_immediately\n */\nexport function listen(target, events, handler, call_handler_immediately = true) {\n\tif (call_handler_immediately) {\n\t\thandler();\n\t}\n\n\tfor (var name of events) {\n\t\ttarget.addEventListener(name, handler);\n\t}\n\n\tteardown(() => {\n\t\tfor (var name of events) {\n\t\t\ttarget.removeEventListener(name, handler);\n\t\t}\n\t});\n}\n\n/**\n * @template T\n * @param {() => T} fn\n */\nexport function without_reactive_context(fn) {\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\ttry {\n\t\treturn fn();\n\t} finally {\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t}\n}\n\n/**\n * Listen to the given event, and then instantiate a global form reset listener if not already done,\n * to notify all bindings when the form is reset\n * @param {HTMLElement} element\n * @param {string} event\n * @param {(is_reset?: true) => void} handler\n * @param {(is_reset?: true) => void} [on_reset]\n */\nexport function listen_to_event_and_reset_event(element, event, handler, on_reset = handler) {\n\telement.addEventListener(event, () => without_reactive_context(handler));\n\t// @ts-expect-error\n\tconst prev = element.__on_r;\n\tif (prev) {\n\t\t// special case for checkbox that can have multiple binds (group & checked)\n\t\t// @ts-expect-error\n\t\telement.__on_r = () => {\n\t\t\tprev();\n\t\t\ton_reset(true);\n\t\t};\n\t} else {\n\t\t// @ts-expect-error\n\t\telement.__on_r = () => on_reset(true);\n\t}\n\n\tadd_form_reset_listener();\n}\n","/** @import { Location } from 'locate-character' */\nimport { teardown } from '../../reactivity/effects.js';\nimport { define_property, is_array } from '../../../shared/utils.js';\nimport { hydrating } from '../hydration.js';\nimport { queue_micro_task } from '../task.js';\nimport { FILENAME } from '../../../../constants.js';\nimport * as w from '../../warnings.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../runtime.js';\nimport { without_reactive_context } from './bindings/shared.js';\n\n/** @type {Set} */\nexport const all_registered_events = new Set();\n\n/** @type {Set<(events: Array) => void>} */\nexport const root_event_handles = new Set();\n\n/**\n * SSR adds onload and onerror attributes to catch those events before the hydration.\n * This function detects those cases, removes the attributes and replays the events.\n * @param {HTMLElement} dom\n */\nexport function replay_events(dom) {\n\tif (!hydrating) return;\n\n\tif (dom.onload) {\n\t\tdom.removeAttribute('onload');\n\t}\n\tif (dom.onerror) {\n\t\tdom.removeAttribute('onerror');\n\t}\n\t// @ts-expect-error\n\tconst event = dom.__e;\n\tif (event !== undefined) {\n\t\t// @ts-expect-error\n\t\tdom.__e = undefined;\n\t\tqueueMicrotask(() => {\n\t\t\tif (dom.isConnected) {\n\t\t\t\tdom.dispatchEvent(event);\n\t\t\t}\n\t\t});\n\t}\n}\n\n/**\n * @param {string} event_name\n * @param {EventTarget} dom\n * @param {EventListener} [handler]\n * @param {AddEventListenerOptions} [options]\n */\nexport function create_event(event_name, dom, handler, options = {}) {\n\t/**\n\t * @this {EventTarget}\n\t */\n\tfunction target_handler(/** @type {Event} */ event) {\n\t\tif (!options.capture) {\n\t\t\t// Only call in the bubble phase, else delegated events would be called before the capturing events\n\t\t\thandle_event_propagation.call(dom, event);\n\t\t}\n\t\tif (!event.cancelBubble) {\n\t\t\treturn without_reactive_context(() => {\n\t\t\t\treturn handler?.call(this, event);\n\t\t\t});\n\t\t}\n\t}\n\n\t// Chrome has a bug where pointer events don't work when attached to a DOM element that has been cloned\n\t// with cloneNode() and the DOM element is disconnected from the document. To ensure the event works, we\n\t// defer the attachment till after it's been appended to the document. TODO: remove this once Chrome fixes\n\t// this bug. The same applies to wheel events and touch events.\n\tif (\n\t\tevent_name.startsWith('pointer') ||\n\t\tevent_name.startsWith('touch') ||\n\t\tevent_name === 'wheel'\n\t) {\n\t\tqueue_micro_task(() => {\n\t\t\tdom.addEventListener(event_name, target_handler, options);\n\t\t});\n\t} else {\n\t\tdom.addEventListener(event_name, target_handler, options);\n\t}\n\n\treturn target_handler;\n}\n\n/**\n * Attaches an event handler to an element and returns a function that removes the handler. Using this\n * rather than `addEventListener` will preserve the correct order relative to handlers added declaratively\n * (with attributes like `onclick`), which use event delegation for performance reasons\n *\n * @param {EventTarget} element\n * @param {string} type\n * @param {EventListener} handler\n * @param {AddEventListenerOptions} [options]\n */\nexport function on(element, type, handler, options = {}) {\n\tvar target_handler = create_event(type, element, handler, options);\n\n\treturn () => {\n\t\telement.removeEventListener(type, target_handler, options);\n\t};\n}\n\n/**\n * @param {string} event_name\n * @param {Element} dom\n * @param {EventListener} [handler]\n * @param {boolean} [capture]\n * @param {boolean} [passive]\n * @returns {void}\n */\nexport function event(event_name, dom, handler, capture, passive) {\n\tvar options = { capture, passive };\n\tvar target_handler = create_event(event_name, dom, handler, options);\n\n\t// @ts-ignore\n\tif (dom === document.body || dom === window || dom === document) {\n\t\tteardown(() => {\n\t\t\tdom.removeEventListener(event_name, target_handler, options);\n\t\t});\n\t}\n}\n\n/**\n * @param {Array} events\n * @returns {void}\n */\nexport function delegate(events) {\n\tfor (var i = 0; i < events.length; i++) {\n\t\tall_registered_events.add(events[i]);\n\t}\n\n\tfor (var fn of root_event_handles) {\n\t\tfn(events);\n\t}\n}\n\n/**\n * @this {EventTarget}\n * @param {Event} event\n * @returns {void}\n */\nexport function handle_event_propagation(event) {\n\tvar handler_element = this;\n\tvar owner_document = /** @type {Node} */ (handler_element).ownerDocument;\n\tvar event_name = event.type;\n\tvar path = event.composedPath?.() || [];\n\tvar current_target = /** @type {null | Element} */ (path[0] || event.target);\n\n\t// composedPath contains list of nodes the event has propagated through.\n\t// We check __root to skip all nodes below it in case this is a\n\t// parent of the __root node, which indicates that there's nested\n\t// mounted apps. In this case we don't want to trigger events multiple times.\n\tvar path_idx = 0;\n\n\t// @ts-expect-error is added below\n\tvar handled_at = event.__root;\n\n\tif (handled_at) {\n\t\tvar at_idx = path.indexOf(handled_at);\n\t\tif (\n\t\t\tat_idx !== -1 &&\n\t\t\t(handler_element === document || handler_element === /** @type {any} */ (window))\n\t\t) {\n\t\t\t// This is the fallback document listener or a window listener, but the event was already handled\n\t\t\t// -> ignore, but set handle_at to document/window so that we're resetting the event\n\t\t\t// chain in case someone manually dispatches the same event object again.\n\t\t\t// @ts-expect-error\n\t\t\tevent.__root = handler_element;\n\t\t\treturn;\n\t\t}\n\n\t\t// We're deliberately not skipping if the index is higher, because\n\t\t// someone could create an event programmatically and emit it multiple times,\n\t\t// in which case we want to handle the whole propagation chain properly each time.\n\t\t// (this will only be a false negative if the event is dispatched multiple times and\n\t\t// the fallback document listener isn't reached in between, but that's super rare)\n\t\tvar handler_idx = path.indexOf(handler_element);\n\t\tif (handler_idx === -1) {\n\t\t\t// handle_idx can theoretically be -1 (happened in some JSDOM testing scenarios with an event listener on the window object)\n\t\t\t// so guard against that, too, and assume that everything was handled at this point.\n\t\t\treturn;\n\t\t}\n\n\t\tif (at_idx <= handler_idx) {\n\t\t\tpath_idx = at_idx;\n\t\t}\n\t}\n\n\tcurrent_target = /** @type {Element} */ (path[path_idx] || event.target);\n\t// there can only be one delegated event per element, and we either already handled the current target,\n\t// or this is the very first target in the chain which has a non-delegated listener, in which case it's safe\n\t// to handle a possible delegated event on it later (through the root delegation listener for example).\n\tif (current_target === handler_element) return;\n\n\t// Proxy currentTarget to correct target\n\tdefine_property(event, 'currentTarget', {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\treturn current_target || owner_document;\n\t\t}\n\t});\n\n\t// This started because of Chromium issue https://chromestatus.com/feature/5128696823545856,\n\t// where removal or moving of of the DOM can cause sync `blur` events to fire, which can cause logic\n\t// to run inside the current `active_reaction`, which isn't what we want at all. However, on reflection,\n\t// it's probably best that all event handled by Svelte have this behaviour, as we don't really want\n\t// an event handler to run in the context of another reaction or effect.\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\n\ttry {\n\t\t/**\n\t\t * @type {unknown}\n\t\t */\n\t\tvar throw_error;\n\t\t/**\n\t\t * @type {unknown[]}\n\t\t */\n\t\tvar other_errors = [];\n\n\t\twhile (current_target !== null) {\n\t\t\t/** @type {null | Element} */\n\t\t\tvar parent_element =\n\t\t\t\tcurrent_target.assignedSlot ||\n\t\t\t\tcurrent_target.parentNode ||\n\t\t\t\t/** @type {any} */ (current_target).host ||\n\t\t\t\tnull;\n\n\t\t\ttry {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tvar delegated = current_target['__' + event_name];\n\n\t\t\t\tif (\n\t\t\t\t\tdelegated !== undefined &&\n\t\t\t\t\t(!(/** @type {any} */ (current_target).disabled) ||\n\t\t\t\t\t\t// DOM could've been updated already by the time this is reached, so we check this as well\n\t\t\t\t\t\t// -> the target could not have been disabled because it emits the event in the first place\n\t\t\t\t\t\tevent.target === current_target)\n\t\t\t\t) {\n\t\t\t\t\tif (is_array(delegated)) {\n\t\t\t\t\t\tvar [fn, ...data] = delegated;\n\t\t\t\t\t\tfn.apply(current_target, [event, ...data]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdelegated.call(current_target, event);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (throw_error) {\n\t\t\t\t\tother_errors.push(error);\n\t\t\t\t} else {\n\t\t\t\t\tthrow_error = error;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (event.cancelBubble || parent_element === handler_element || parent_element === null) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcurrent_target = parent_element;\n\t\t}\n\n\t\tif (throw_error) {\n\t\t\tfor (let error of other_errors) {\n\t\t\t\t// Throw the rest of the errors, one-by-one on a microtask\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tthrow error;\n\t\t\t\t});\n\t\t\t}\n\t\t\tthrow throw_error;\n\t\t}\n\t} finally {\n\t\t// @ts-expect-error is used above\n\t\tevent.__root = handler_element;\n\t\t// @ts-ignore remove proxy on currentTarget\n\t\tdelete event.currentTarget;\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t}\n}\n\n/**\n * In dev, warn if an event handler is not a function, as it means the\n * user probably called the handler or forgot to add a `() =>`\n * @param {() => (event: Event, ...args: any) => void} thunk\n * @param {EventTarget} element\n * @param {[Event, ...any]} args\n * @param {any} component\n * @param {[number, number]} [loc]\n * @param {boolean} [remove_parens]\n */\nexport function apply(\n\tthunk,\n\telement,\n\targs,\n\tcomponent,\n\tloc,\n\thas_side_effects = false,\n\tremove_parens = false\n) {\n\tlet handler;\n\tlet error;\n\n\ttry {\n\t\thandler = thunk();\n\t} catch (e) {\n\t\terror = e;\n\t}\n\n\tif (typeof handler === 'function') {\n\t\thandler.apply(element, args);\n\t} else if (has_side_effects || handler != null || error) {\n\t\tconst filename = component?.[FILENAME];\n\t\tconst location = loc ? ` at ${filename}:${loc[0]}:${loc[1]}` : ` in ${filename}`;\n\n\t\tconst event_name = args[0].type;\n\t\tconst description = `\\`${event_name}\\` handler${location}`;\n\t\tconst suggestion = remove_parens ? 'remove the trailing `()`' : 'add a leading `() =>`';\n\n\t\tw.event_handler_invalid(description, suggestion);\n\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t}\n\t}\n}\n","/** @param {string} html */\nexport function create_fragment_from_html(html) {\n\tvar elem = document.createElement('template');\n\telem.innerHTML = html;\n\treturn elem.content;\n}\n","/** @import { Effect, TemplateNode } from '#client' */\nimport { hydrate_next, hydrate_node, hydrating, set_hydrate_node } from './hydration.js';\nimport { create_text, get_first_child, is_firefox } from './operations.js';\nimport { create_fragment_from_html } from './reconciler.js';\nimport { active_effect } from '../runtime.js';\nimport { TEMPLATE_FRAGMENT, TEMPLATE_USE_IMPORT_NODE } from '../../../constants.js';\n\n/**\n * @param {TemplateNode} start\n * @param {TemplateNode | null} end\n */\nexport function assign_nodes(start, end) {\n\tvar effect = /** @type {Effect} */ (active_effect);\n\tif (effect.nodes_start === null) {\n\t\teffect.nodes_start = start;\n\t\teffect.nodes_end = end;\n\t}\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function template(content, flags) {\n\tvar is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;\n\tvar use_import_node = (flags & TEMPLATE_USE_IMPORT_NODE) !== 0;\n\n\t/** @type {Node} */\n\tvar node;\n\n\t/**\n\t * Whether or not the first item is a text/element node. If not, we need to\n\t * create an additional comment node to act as `effect.nodes.start`\n\t */\n\tvar has_start = !content.startsWith('');\n\n\treturn () => {\n\t\tif (hydrating) {\n\t\t\tassign_nodes(hydrate_node, null);\n\t\t\treturn hydrate_node;\n\t\t}\n\n\t\tif (node === undefined) {\n\t\t\tnode = create_fragment_from_html(has_start ? content : '' + content);\n\t\t\tif (!is_fragment) node = /** @type {Node} */ (get_first_child(node));\n\t\t}\n\n\t\tvar clone = /** @type {TemplateNode} */ (\n\t\t\tuse_import_node || is_firefox ? document.importNode(node, true) : node.cloneNode(true)\n\t\t);\n\n\t\tif (is_fragment) {\n\t\t\tvar start = /** @type {TemplateNode} */ (get_first_child(clone));\n\t\t\tvar end = /** @type {TemplateNode} */ (clone.lastChild);\n\n\t\t\tassign_nodes(start, end);\n\t\t} else {\n\t\t\tassign_nodes(clone, clone);\n\t\t}\n\n\t\treturn clone;\n\t};\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function template_with_script(content, flags) {\n\tvar fn = template(content, flags);\n\treturn () => run_scripts(/** @type {Element | DocumentFragment} */ (fn()));\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n * @param {'svg' | 'math'} ns\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function ns_template(content, flags, ns = 'svg') {\n\t/**\n\t * Whether or not the first item is a text/element node. If not, we need to\n\t * create an additional comment node to act as `effect.nodes.start`\n\t */\n\tvar has_start = !content.startsWith('');\n\n\tvar is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;\n\tvar wrapped = `<${ns}>${has_start ? content : '' + content}`;\n\n\t/** @type {Element | DocumentFragment} */\n\tvar node;\n\n\treturn () => {\n\t\tif (hydrating) {\n\t\t\tassign_nodes(hydrate_node, null);\n\t\t\treturn hydrate_node;\n\t\t}\n\n\t\tif (!node) {\n\t\t\tvar fragment = /** @type {DocumentFragment} */ (create_fragment_from_html(wrapped));\n\t\t\tvar root = /** @type {Element} */ (get_first_child(fragment));\n\n\t\t\tif (is_fragment) {\n\t\t\t\tnode = document.createDocumentFragment();\n\t\t\t\twhile (get_first_child(root)) {\n\t\t\t\t\tnode.appendChild(/** @type {Node} */ (get_first_child(root)));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnode = /** @type {Element} */ (get_first_child(root));\n\t\t\t}\n\t\t}\n\n\t\tvar clone = /** @type {TemplateNode} */ (node.cloneNode(true));\n\n\t\tif (is_fragment) {\n\t\t\tvar start = /** @type {TemplateNode} */ (get_first_child(clone));\n\t\t\tvar end = /** @type {TemplateNode} */ (clone.lastChild);\n\n\t\t\tassign_nodes(start, end);\n\t\t} else {\n\t\t\tassign_nodes(clone, clone);\n\t\t}\n\n\t\treturn clone;\n\t};\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function svg_template_with_script(content, flags) {\n\tvar fn = ns_template(content, flags);\n\treturn () => run_scripts(/** @type {Element | DocumentFragment} */ (fn()));\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function mathml_template(content, flags) {\n\treturn ns_template(content, flags, 'math');\n}\n\n/**\n * Creating a document fragment from HTML that contains script tags will not execute\n * the scripts. We need to replace the script tags with new ones so that they are executed.\n * @param {Element | DocumentFragment} node\n * @returns {Node | Node[]}\n */\nfunction run_scripts(node) {\n\t// scripts were SSR'd, in which case they will run\n\tif (hydrating) return node;\n\n\tconst is_fragment = node.nodeType === 11;\n\tconst scripts =\n\t\t/** @type {HTMLElement} */ (node).tagName === 'SCRIPT'\n\t\t\t? [/** @type {HTMLScriptElement} */ (node)]\n\t\t\t: node.querySelectorAll('script');\n\tconst effect = /** @type {Effect} */ (active_effect);\n\n\tfor (const script of scripts) {\n\t\tconst clone = document.createElement('script');\n\t\tfor (var attribute of script.attributes) {\n\t\t\tclone.setAttribute(attribute.name, attribute.value);\n\t\t}\n\n\t\tclone.textContent = script.textContent;\n\n\t\t// The script has changed - if it's at the edges, the effect now points at dead nodes\n\t\tif (is_fragment ? node.firstChild === script : node === script) {\n\t\t\teffect.nodes_start = clone;\n\t\t}\n\t\tif (is_fragment ? node.lastChild === script : node === script) {\n\t\t\teffect.nodes_end = clone;\n\t\t}\n\n\t\tscript.replaceWith(clone);\n\t}\n\treturn node;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {any} value\n */\nexport function text(value = '') {\n\tif (!hydrating) {\n\t\tvar t = create_text(value + '');\n\t\tassign_nodes(t, t);\n\t\treturn t;\n\t}\n\n\tvar node = hydrate_node;\n\n\tif (node.nodeType !== 3) {\n\t\t// if an {expression} is empty during SSR, we need to insert an empty text node\n\t\tnode.before((node = create_text()));\n\t\tset_hydrate_node(node);\n\t}\n\n\tassign_nodes(node, node);\n\treturn node;\n}\n\nexport function comment() {\n\t// we're not delegating to `template` here for performance reasons\n\tif (hydrating) {\n\t\tassign_nodes(hydrate_node, null);\n\t\treturn hydrate_node;\n\t}\n\n\tvar frag = document.createDocumentFragment();\n\tvar start = document.createComment('');\n\tvar anchor = create_text();\n\tfrag.append(start, anchor);\n\n\tassign_nodes(start, anchor);\n\n\treturn frag;\n}\n\n/**\n * Assign the created (or in hydration mode, traversed) dom elements to the current block\n * and insert the elements into the dom (in client mode).\n * @param {Text | Comment | Element} anchor\n * @param {DocumentFragment | Element} dom\n */\nexport function append(anchor, dom) {\n\tif (hydrating) {\n\t\t/** @type {Effect} */ (active_effect).nodes_end = hydrate_node;\n\t\thydrate_next();\n\t\treturn;\n\t}\n\n\tif (anchor === null) {\n\t\t// edge case — void `` with content\n\t\treturn;\n\t}\n\n\tanchor.before(/** @type {Node} */ (dom));\n}\n\n/**\n * Create (or hydrate) an unique UID for the component instance.\n */\nexport function props_id() {\n\tif (\n\t\thydrating &&\n\t\thydrate_node &&\n\t\thydrate_node.nodeType === 8 &&\n\t\thydrate_node.textContent?.startsWith(`#`)\n\t) {\n\t\tconst id = hydrate_node.textContent.substring(1);\n\t\thydrate_next();\n\t\treturn id;\n\t}\n\n\t// @ts-expect-error This way we ensure the id is unique even across Svelte runtimes\n\t(window.__svelte ??= {}).uid ??= 1;\n\n\t// @ts-expect-error\n\treturn `c${window.__svelte.uid++}`;\n}\n","/** @import { ComponentContext, Effect, TemplateNode } from '#client' */\n/** @import { Component, ComponentType, SvelteComponent, MountOptions } from '../../index.js' */\nimport { DEV } from 'esm-env';\nimport {\n\tclear_text_content,\n\tcreate_text,\n\tget_first_child,\n\tget_next_sibling,\n\tinit_operations\n} from './dom/operations.js';\nimport { HYDRATION_END, HYDRATION_ERROR, HYDRATION_START } from '../../constants.js';\nimport { active_effect } from './runtime.js';\nimport { push, pop, component_context } from './context.js';\nimport { component_root, branch } from './reactivity/effects.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tset_hydrate_node,\n\tset_hydrating\n} from './dom/hydration.js';\nimport { array_from } from '../shared/utils.js';\nimport {\n\tall_registered_events,\n\thandle_event_propagation,\n\troot_event_handles\n} from './dom/elements/events.js';\nimport { reset_head_anchor } from './dom/blocks/svelte-head.js';\nimport * as w from './warnings.js';\nimport * as e from './errors.js';\nimport { assign_nodes } from './dom/template.js';\nimport { is_passive_event } from '../../utils.js';\n\n/**\n * This is normally true — block effects should run their intro transitions —\n * but is false during hydration (unless `options.intro` is `true`) and\n * when creating the children of a `` that just changed tag\n */\nexport let should_intro = true;\n\n/** @param {boolean} value */\nexport function set_should_intro(value) {\n\tshould_intro = value;\n}\n\n/**\n * @param {Element} text\n * @param {string} value\n * @returns {void}\n */\nexport function set_text(text, value) {\n\t// For objects, we apply string coercion (which might make things like $state array references in the template reactive) before diffing\n\tvar str = value == null ? '' : typeof value === 'object' ? value + '' : value;\n\t// @ts-expect-error\n\tif (str !== (text.__t ??= text.nodeValue)) {\n\t\t// @ts-expect-error\n\t\ttext.__t = str;\n\t\ttext.nodeValue = str + '';\n\t}\n}\n\n/**\n * Mounts a component to the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component.\n * Transitions will play during the initial render unless the `intro` option is set to `false`.\n *\n * @template {Record} Props\n * @template {Record} Exports\n * @param {ComponentType> | Component} component\n * @param {MountOptions} options\n * @returns {Exports}\n */\nexport function mount(component, options) {\n\treturn _mount(component, options);\n}\n\n/**\n * Hydrates a component on the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component\n *\n * @template {Record} Props\n * @template {Record} Exports\n * @param {ComponentType> | Component} component\n * @param {{} extends Props ? {\n * \t\ttarget: Document | Element | ShadowRoot;\n * \t\tprops?: Props;\n * \t\tevents?: Record any>;\n * \tcontext?: Map;\n * \t\tintro?: boolean;\n * \t\trecover?: boolean;\n * \t} : {\n * \t\ttarget: Document | Element | ShadowRoot;\n * \t\tprops: Props;\n * \t\tevents?: Record any>;\n * \tcontext?: Map;\n * \t\tintro?: boolean;\n * \t\trecover?: boolean;\n * \t}} options\n * @returns {Exports}\n */\nexport function hydrate(component, options) {\n\tinit_operations();\n\toptions.intro = options.intro ?? false;\n\tconst target = options.target;\n\tconst was_hydrating = hydrating;\n\tconst previous_hydrate_node = hydrate_node;\n\n\ttry {\n\t\tvar anchor = /** @type {TemplateNode} */ (get_first_child(target));\n\t\twhile (\n\t\t\tanchor &&\n\t\t\t(anchor.nodeType !== 8 || /** @type {Comment} */ (anchor).data !== HYDRATION_START)\n\t\t) {\n\t\t\tanchor = /** @type {TemplateNode} */ (get_next_sibling(anchor));\n\t\t}\n\n\t\tif (!anchor) {\n\t\t\tthrow HYDRATION_ERROR;\n\t\t}\n\n\t\tset_hydrating(true);\n\t\tset_hydrate_node(/** @type {Comment} */ (anchor));\n\t\thydrate_next();\n\n\t\tconst instance = _mount(component, { ...options, anchor });\n\n\t\tif (\n\t\t\thydrate_node === null ||\n\t\t\thydrate_node.nodeType !== 8 ||\n\t\t\t/** @type {Comment} */ (hydrate_node).data !== HYDRATION_END\n\t\t) {\n\t\t\tw.hydration_mismatch();\n\t\t\tthrow HYDRATION_ERROR;\n\t\t}\n\n\t\tset_hydrating(false);\n\n\t\treturn /** @type {Exports} */ (instance);\n\t} catch (error) {\n\t\tif (error === HYDRATION_ERROR) {\n\t\t\tif (options.recover === false) {\n\t\t\t\te.hydration_failed();\n\t\t\t}\n\n\t\t\t// If an error occured above, the operations might not yet have been initialised.\n\t\t\tinit_operations();\n\t\t\tclear_text_content(target);\n\n\t\t\tset_hydrating(false);\n\t\t\treturn mount(component, options);\n\t\t}\n\n\t\tthrow error;\n\t} finally {\n\t\tset_hydrating(was_hydrating);\n\t\tset_hydrate_node(previous_hydrate_node);\n\t\treset_head_anchor();\n\t}\n}\n\n/** @type {Map} */\nconst document_listeners = new Map();\n\n/**\n * @template {Record} Exports\n * @param {ComponentType> | Component} Component\n * @param {MountOptions} options\n * @returns {Exports}\n */\nfunction _mount(Component, { target, anchor, props = {}, events, context, intro = true }) {\n\tinit_operations();\n\n\tvar registered_events = new Set();\n\n\t/** @param {Array} events */\n\tvar event_handle = (events) => {\n\t\tfor (var i = 0; i < events.length; i++) {\n\t\t\tvar event_name = events[i];\n\n\t\t\tif (registered_events.has(event_name)) continue;\n\t\t\tregistered_events.add(event_name);\n\n\t\t\tvar passive = is_passive_event(event_name);\n\n\t\t\t// Add the event listener to both the container and the document.\n\t\t\t// The container listener ensures we catch events from within in case\n\t\t\t// the outer content stops propagation of the event.\n\t\t\ttarget.addEventListener(event_name, handle_event_propagation, { passive });\n\n\t\t\tvar n = document_listeners.get(event_name);\n\n\t\t\tif (n === undefined) {\n\t\t\t\t// The document listener ensures we catch events that originate from elements that were\n\t\t\t\t// manually moved outside of the container (e.g. via manual portals).\n\t\t\t\tdocument.addEventListener(event_name, handle_event_propagation, { passive });\n\t\t\t\tdocument_listeners.set(event_name, 1);\n\t\t\t} else {\n\t\t\t\tdocument_listeners.set(event_name, n + 1);\n\t\t\t}\n\t\t}\n\t};\n\n\tevent_handle(array_from(all_registered_events));\n\troot_event_handles.add(event_handle);\n\n\t/** @type {Exports} */\n\t// @ts-expect-error will be defined because the render effect runs synchronously\n\tvar component = undefined;\n\n\tvar unmount = component_root(() => {\n\t\tvar anchor_node = anchor ?? target.appendChild(create_text());\n\n\t\tbranch(() => {\n\t\t\tif (context) {\n\t\t\t\tpush({});\n\t\t\t\tvar ctx = /** @type {ComponentContext} */ (component_context);\n\t\t\t\tctx.c = context;\n\t\t\t}\n\n\t\t\tif (events) {\n\t\t\t\t// We can't spread the object or else we'd lose the state proxy stuff, if it is one\n\t\t\t\t/** @type {any} */ (props).$$events = events;\n\t\t\t}\n\n\t\t\tif (hydrating) {\n\t\t\t\tassign_nodes(/** @type {TemplateNode} */ (anchor_node), null);\n\t\t\t}\n\n\t\t\tshould_intro = intro;\n\t\t\t// @ts-expect-error the public typings are not what the actual function looks like\n\t\t\tcomponent = Component(anchor_node, props) || {};\n\t\t\tshould_intro = true;\n\n\t\t\tif (hydrating) {\n\t\t\t\t/** @type {Effect} */ (active_effect).nodes_end = hydrate_node;\n\t\t\t}\n\n\t\t\tif (context) {\n\t\t\t\tpop();\n\t\t\t}\n\t\t});\n\n\t\treturn () => {\n\t\t\tfor (var event_name of registered_events) {\n\t\t\t\ttarget.removeEventListener(event_name, handle_event_propagation);\n\n\t\t\t\tvar n = /** @type {number} */ (document_listeners.get(event_name));\n\n\t\t\t\tif (--n === 0) {\n\t\t\t\t\tdocument.removeEventListener(event_name, handle_event_propagation);\n\t\t\t\t\tdocument_listeners.delete(event_name);\n\t\t\t\t} else {\n\t\t\t\t\tdocument_listeners.set(event_name, n);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\troot_event_handles.delete(event_handle);\n\n\t\t\tif (anchor_node !== anchor) {\n\t\t\t\tanchor_node.parentNode?.removeChild(anchor_node);\n\t\t\t}\n\t\t};\n\t});\n\n\tmounted_components.set(component, unmount);\n\treturn component;\n}\n\n/**\n * References of the components that were mounted or hydrated.\n * Uses a `WeakMap` to avoid memory leaks.\n */\nlet mounted_components = new WeakMap();\n\n/**\n * Unmounts a component that was previously mounted using `mount` or `hydrate`.\n *\n * Since 5.13.0, if `options.outro` is `true`, [transitions](https://svelte.dev/docs/svelte/transition) will play before the component is removed from the DOM.\n *\n * Returns a `Promise` that resolves after transitions have completed if `options.outro` is true, or immediately otherwise (prior to 5.13.0, returns `void`).\n *\n * ```js\n * import { mount, unmount } from 'svelte';\n * import App from './App.svelte';\n *\n * const app = mount(App, { target: document.body });\n *\n * // later...\n * unmount(app, { outro: true });\n * ```\n * @param {Record} component\n * @param {{ outro?: boolean }} [options]\n * @returns {Promise}\n */\nexport function unmount(component, options) {\n\tconst fn = mounted_components.get(component);\n\n\tif (fn) {\n\t\tmounted_components.delete(component);\n\t\treturn fn(options);\n\t}\n\n\tif (DEV) {\n\t\tw.lifecycle_double_unmount();\n\t}\n\n\treturn Promise.resolve();\n}\n","/** @import { Effect, TemplateNode } from '#client' */\nimport { EFFECT_TRANSPARENT } from '../../constants.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tremove_nodes,\n\tset_hydrate_node,\n\tset_hydrating\n} from '../hydration.js';\nimport { block, branch, pause_effect, resume_effect } from '../../reactivity/effects.js';\nimport { HYDRATION_START, HYDRATION_START_ELSE, UNINITIALIZED } from '../../../../constants.js';\n\n/**\n * @param {TemplateNode} node\n * @param {(branch: (fn: (anchor: Node, elseif?: [number,number]) => void, flag?: boolean) => void) => void} fn\n * @param {[number,number]} [elseif]\n * @returns {void}\n */\nexport function if_block(node, fn, [root_index, hydrate_index] = [0, 0]) {\n\tif (hydrating && root_index === 0) {\n\t\thydrate_next();\n\t}\n\n\tvar anchor = node;\n\n\t/** @type {Effect | null} */\n\tvar consequent_effect = null;\n\n\t/** @type {Effect | null} */\n\tvar alternate_effect = null;\n\n\t/** @type {UNINITIALIZED | boolean | null} */\n\tvar condition = UNINITIALIZED;\n\n\tvar flags = root_index > 0 ? EFFECT_TRANSPARENT : 0;\n\n\tvar has_branch = false;\n\n\tconst set_branch = (\n\t\t/** @type {(anchor: Node, elseif?: [number,number]) => void} */ fn,\n\t\tflag = true\n\t) => {\n\t\thas_branch = true;\n\t\tupdate_branch(flag, fn);\n\t};\n\n\tconst update_branch = (\n\t\t/** @type {boolean | null} */ new_condition,\n\t\t/** @type {null | ((anchor: Node, elseif?: [number,number]) => void)} */ fn\n\t) => {\n\t\tif (condition === (condition = new_condition)) return;\n\n\t\t/** Whether or not there was a hydration mismatch. Needs to be a `let` or else it isn't treeshaken out */\n\t\tlet mismatch = false;\n\n\t\tif (hydrating && hydrate_index !== -1) {\n\t\t\tif (root_index === 0) {\n\t\t\t\tconst data = /** @type {Comment} */ (anchor).data;\n\t\t\t\tif (data === HYDRATION_START) {\n\t\t\t\t\thydrate_index = 0;\n\t\t\t\t} else if (data === HYDRATION_START_ELSE) {\n\t\t\t\t\thydrate_index = Infinity;\n\t\t\t\t} else {\n\t\t\t\t\thydrate_index = parseInt(data.substring(1));\n\t\t\t\t\tif (hydrate_index !== hydrate_index) {\n\t\t\t\t\t\t// if hydrate_index is NaN\n\t\t\t\t\t\t// we set an invalid index to force mismatch\n\t\t\t\t\t\thydrate_index = condition ? Infinity : -1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst is_else = hydrate_index > root_index;\n\n\t\t\tif (!!condition === is_else) {\n\t\t\t\t// Hydration mismatch: remove everything inside the anchor and start fresh.\n\t\t\t\t// This could happen with `{#if browser}...{/if}`, for example\n\t\t\t\tanchor = remove_nodes();\n\n\t\t\t\tset_hydrate_node(anchor);\n\t\t\t\tset_hydrating(false);\n\t\t\t\tmismatch = true;\n\t\t\t\thydrate_index = -1; // ignore hydration in next else if\n\t\t\t}\n\t\t}\n\n\t\tif (condition) {\n\t\t\tif (consequent_effect) {\n\t\t\t\tresume_effect(consequent_effect);\n\t\t\t} else if (fn) {\n\t\t\t\tconsequent_effect = branch(() => fn(anchor));\n\t\t\t}\n\n\t\t\tif (alternate_effect) {\n\t\t\t\tpause_effect(alternate_effect, () => {\n\t\t\t\t\talternate_effect = null;\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tif (alternate_effect) {\n\t\t\t\tresume_effect(alternate_effect);\n\t\t\t} else if (fn) {\n\t\t\t\talternate_effect = branch(() => fn(anchor, [root_index + 1, hydrate_index]));\n\t\t\t}\n\n\t\t\tif (consequent_effect) {\n\t\t\t\tpause_effect(consequent_effect, () => {\n\t\t\t\t\tconsequent_effect = null;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (mismatch) {\n\t\t\t// continue in hydration mode\n\t\t\tset_hydrating(true);\n\t\t}\n\t};\n\n\tblock(() => {\n\t\thas_branch = false;\n\t\tfn(set_branch);\n\t\tif (!has_branch) {\n\t\t\tupdate_branch(null, null);\n\t\t}\n\t}, flags);\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n","/** @import { EachItem, EachState, Effect, MaybeSource, Source, TemplateNode, TransitionManager, Value } from '#client' */\nimport {\n\tEACH_INDEX_REACTIVE,\n\tEACH_IS_ANIMATED,\n\tEACH_IS_CONTROLLED,\n\tEACH_ITEM_IMMUTABLE,\n\tEACH_ITEM_REACTIVE,\n\tHYDRATION_END,\n\tHYDRATION_START_ELSE\n} from '../../../../constants.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tremove_nodes,\n\tset_hydrate_node,\n\tset_hydrating\n} from '../hydration.js';\nimport {\n\tclear_text_content,\n\tcreate_text,\n\tget_first_child,\n\tget_next_sibling\n} from '../operations.js';\nimport {\n\tblock,\n\tbranch,\n\tdestroy_effect,\n\trun_out_transitions,\n\tpause_children,\n\tpause_effect,\n\tresume_effect\n} from '../../reactivity/effects.js';\nimport { source, mutable_source, internal_set } from '../../reactivity/sources.js';\nimport { array_from, is_array } from '../../../shared/utils.js';\nimport { INERT } from '../../constants.js';\nimport { queue_micro_task } from '../task.js';\nimport { active_effect, active_reaction, get } from '../../runtime.js';\nimport { DEV } from 'esm-env';\nimport { derived_safe_equal } from '../../reactivity/deriveds.js';\n\n/**\n * The row of a keyed each block that is currently updating. We track this\n * so that `animate:` directives have something to attach themselves to\n * @type {EachItem | null}\n */\nexport let current_each_item = null;\n\n/** @param {EachItem | null} item */\nexport function set_current_each_item(item) {\n\tcurrent_each_item = item;\n}\n\n/**\n * @param {any} _\n * @param {number} i\n */\nexport function index(_, i) {\n\treturn i;\n}\n\n/**\n * Pause multiple effects simultaneously, and coordinate their\n * subsequent destruction. Used in each blocks\n * @param {EachState} state\n * @param {EachItem[]} items\n * @param {null | Node} controlled_anchor\n * @param {Map} items_map\n */\nfunction pause_effects(state, items, controlled_anchor, items_map) {\n\t/** @type {TransitionManager[]} */\n\tvar transitions = [];\n\tvar length = items.length;\n\n\tfor (var i = 0; i < length; i++) {\n\t\tpause_children(items[i].e, transitions, true);\n\t}\n\n\tvar is_controlled = length > 0 && transitions.length === 0 && controlled_anchor !== null;\n\t// If we have a controlled anchor, it means that the each block is inside a single\n\t// DOM element, so we can apply a fast-path for clearing the contents of the element.\n\tif (is_controlled) {\n\t\tvar parent_node = /** @type {Element} */ (\n\t\t\t/** @type {Element} */ (controlled_anchor).parentNode\n\t\t);\n\t\tclear_text_content(parent_node);\n\t\tparent_node.append(/** @type {Element} */ (controlled_anchor));\n\t\titems_map.clear();\n\t\tlink(state, items[0].prev, items[length - 1].next);\n\t}\n\n\trun_out_transitions(transitions, () => {\n\t\tfor (var i = 0; i < length; i++) {\n\t\t\tvar item = items[i];\n\t\t\tif (!is_controlled) {\n\t\t\t\titems_map.delete(item.k);\n\t\t\t\tlink(state, item.prev, item.next);\n\t\t\t}\n\t\t\tdestroy_effect(item.e, !is_controlled);\n\t\t}\n\t});\n}\n\n/**\n * @template V\n * @param {Element | Comment} node The next sibling node, or the parent node if this is a 'controlled' block\n * @param {number} flags\n * @param {() => V[]} get_collection\n * @param {(value: V, index: number) => any} get_key\n * @param {(anchor: Node, item: MaybeSource, index: MaybeSource) => void} render_fn\n * @param {null | ((anchor: Node) => void)} fallback_fn\n * @returns {void}\n */\nexport function each(node, flags, get_collection, get_key, render_fn, fallback_fn = null) {\n\tvar anchor = node;\n\n\t/** @type {EachState} */\n\tvar state = { flags, items: new Map(), first: null };\n\n\tvar is_controlled = (flags & EACH_IS_CONTROLLED) !== 0;\n\n\tif (is_controlled) {\n\t\tvar parent_node = /** @type {Element} */ (node);\n\n\t\tanchor = hydrating\n\t\t\t? set_hydrate_node(/** @type {Comment | Text} */ (get_first_child(parent_node)))\n\t\t\t: parent_node.appendChild(create_text());\n\t}\n\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\t/** @type {Effect | null} */\n\tvar fallback = null;\n\n\tvar was_empty = false;\n\n\t// TODO: ideally we could use derived for runes mode but because of the ability\n\t// to use a store which can be mutated, we can't do that here as mutating a store\n\t// will still result in the collection array being the same from the store\n\tvar each_array = derived_safe_equal(() => {\n\t\tvar collection = get_collection();\n\n\t\treturn is_array(collection) ? collection : collection == null ? [] : array_from(collection);\n\t});\n\n\tblock(() => {\n\t\tvar array = get(each_array);\n\t\tvar length = array.length;\n\n\t\tif (was_empty && length === 0) {\n\t\t\t// ignore updates if the array is empty,\n\t\t\t// and it already was empty on previous run\n\t\t\treturn;\n\t\t}\n\t\twas_empty = length === 0;\n\n\t\t/** `true` if there was a hydration mismatch. Needs to be a `let` or else it isn't treeshaken out */\n\t\tlet mismatch = false;\n\n\t\tif (hydrating) {\n\t\t\tvar is_else = /** @type {Comment} */ (anchor).data === HYDRATION_START_ELSE;\n\n\t\t\tif (is_else !== (length === 0)) {\n\t\t\t\t// hydration mismatch — remove the server-rendered DOM and start over\n\t\t\t\tanchor = remove_nodes();\n\n\t\t\t\tset_hydrate_node(anchor);\n\t\t\t\tset_hydrating(false);\n\t\t\t\tmismatch = true;\n\t\t\t}\n\t\t}\n\n\t\t// this is separate to the previous block because `hydrating` might change\n\t\tif (hydrating) {\n\t\t\t/** @type {EachItem | null} */\n\t\t\tvar prev = null;\n\n\t\t\t/** @type {EachItem} */\n\t\t\tvar item;\n\n\t\t\tfor (var i = 0; i < length; i++) {\n\t\t\t\tif (\n\t\t\t\t\thydrate_node.nodeType === 8 &&\n\t\t\t\t\t/** @type {Comment} */ (hydrate_node).data === HYDRATION_END\n\t\t\t\t) {\n\t\t\t\t\t// The server rendered fewer items than expected,\n\t\t\t\t\t// so break out and continue appending non-hydrated items\n\t\t\t\t\tanchor = /** @type {Comment} */ (hydrate_node);\n\t\t\t\t\tmismatch = true;\n\t\t\t\t\tset_hydrating(false);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tvar value = array[i];\n\t\t\t\tvar key = get_key(value, i);\n\t\t\t\titem = create_item(\n\t\t\t\t\thydrate_node,\n\t\t\t\t\tstate,\n\t\t\t\t\tprev,\n\t\t\t\t\tnull,\n\t\t\t\t\tvalue,\n\t\t\t\t\tkey,\n\t\t\t\t\ti,\n\t\t\t\t\trender_fn,\n\t\t\t\t\tflags,\n\t\t\t\t\tget_collection\n\t\t\t\t);\n\t\t\t\tstate.items.set(key, item);\n\n\t\t\t\tprev = item;\n\t\t\t}\n\n\t\t\t// remove excess nodes\n\t\t\tif (length > 0) {\n\t\t\t\tset_hydrate_node(remove_nodes());\n\t\t\t}\n\t\t}\n\n\t\tif (!hydrating) {\n\t\t\treconcile(array, state, anchor, render_fn, flags, get_key, get_collection);\n\t\t}\n\n\t\tif (fallback_fn !== null) {\n\t\t\tif (length === 0) {\n\t\t\t\tif (fallback) {\n\t\t\t\t\tresume_effect(fallback);\n\t\t\t\t} else {\n\t\t\t\t\tfallback = branch(() => fallback_fn(anchor));\n\t\t\t\t}\n\t\t\t} else if (fallback !== null) {\n\t\t\t\tpause_effect(fallback, () => {\n\t\t\t\t\tfallback = null;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (mismatch) {\n\t\t\t// continue in hydration mode\n\t\t\tset_hydrating(true);\n\t\t}\n\n\t\t// When we mount the each block for the first time, the collection won't be\n\t\t// connected to this effect as the effect hasn't finished running yet and its deps\n\t\t// won't be assigned. However, it's possible that when reconciling the each block\n\t\t// that a mutation occurred and it's made the collection MAYBE_DIRTY, so reading the\n\t\t// collection again can provide consistency to the reactive graph again as the deriveds\n\t\t// will now be `CLEAN`.\n\t\tget(each_array);\n\t});\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n\n/**\n * Add, remove, or reorder items output by an each block as its input changes\n * @template V\n * @param {Array} array\n * @param {EachState} state\n * @param {Element | Comment | Text} anchor\n * @param {(anchor: Node, item: MaybeSource, index: number | Source, collection: () => V[]) => void} render_fn\n * @param {number} flags\n * @param {(value: V, index: number) => any} get_key\n * @param {() => V[]} get_collection\n * @returns {void}\n */\nfunction reconcile(array, state, anchor, render_fn, flags, get_key, get_collection) {\n\tvar is_animated = (flags & EACH_IS_ANIMATED) !== 0;\n\tvar should_update = (flags & (EACH_ITEM_REACTIVE | EACH_INDEX_REACTIVE)) !== 0;\n\n\tvar length = array.length;\n\tvar items = state.items;\n\tvar first = state.first;\n\tvar current = first;\n\n\t/** @type {undefined | Set} */\n\tvar seen;\n\n\t/** @type {EachItem | null} */\n\tvar prev = null;\n\n\t/** @type {undefined | Set} */\n\tvar to_animate;\n\n\t/** @type {EachItem[]} */\n\tvar matched = [];\n\n\t/** @type {EachItem[]} */\n\tvar stashed = [];\n\n\t/** @type {V} */\n\tvar value;\n\n\t/** @type {any} */\n\tvar key;\n\n\t/** @type {EachItem | undefined} */\n\tvar item;\n\n\t/** @type {number} */\n\tvar i;\n\n\tif (is_animated) {\n\t\tfor (i = 0; i < length; i += 1) {\n\t\t\tvalue = array[i];\n\t\t\tkey = get_key(value, i);\n\t\t\titem = items.get(key);\n\n\t\t\tif (item !== undefined) {\n\t\t\t\titem.a?.measure();\n\t\t\t\t(to_animate ??= new Set()).add(item);\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (i = 0; i < length; i += 1) {\n\t\tvalue = array[i];\n\t\tkey = get_key(value, i);\n\t\titem = items.get(key);\n\n\t\tif (item === undefined) {\n\t\t\tvar child_anchor = current ? /** @type {TemplateNode} */ (current.e.nodes_start) : anchor;\n\n\t\t\tprev = create_item(\n\t\t\t\tchild_anchor,\n\t\t\t\tstate,\n\t\t\t\tprev,\n\t\t\t\tprev === null ? state.first : prev.next,\n\t\t\t\tvalue,\n\t\t\t\tkey,\n\t\t\t\ti,\n\t\t\t\trender_fn,\n\t\t\t\tflags,\n\t\t\t\tget_collection\n\t\t\t);\n\n\t\t\titems.set(key, prev);\n\n\t\t\tmatched = [];\n\t\t\tstashed = [];\n\n\t\t\tcurrent = prev.next;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (should_update) {\n\t\t\tupdate_item(item, value, i, flags);\n\t\t}\n\n\t\tif ((item.e.f & INERT) !== 0) {\n\t\t\tresume_effect(item.e);\n\t\t\tif (is_animated) {\n\t\t\t\titem.a?.unfix();\n\t\t\t\t(to_animate ??= new Set()).delete(item);\n\t\t\t}\n\t\t}\n\n\t\tif (item !== current) {\n\t\t\tif (seen !== undefined && seen.has(item)) {\n\t\t\t\tif (matched.length < stashed.length) {\n\t\t\t\t\t// more efficient to move later items to the front\n\t\t\t\t\tvar start = stashed[0];\n\t\t\t\t\tvar j;\n\n\t\t\t\t\tprev = start.prev;\n\n\t\t\t\t\tvar a = matched[0];\n\t\t\t\t\tvar b = matched[matched.length - 1];\n\n\t\t\t\t\tfor (j = 0; j < matched.length; j += 1) {\n\t\t\t\t\t\tmove(matched[j], start, anchor);\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (j = 0; j < stashed.length; j += 1) {\n\t\t\t\t\t\tseen.delete(stashed[j]);\n\t\t\t\t\t}\n\n\t\t\t\t\tlink(state, a.prev, b.next);\n\t\t\t\t\tlink(state, prev, a);\n\t\t\t\t\tlink(state, b, start);\n\n\t\t\t\t\tcurrent = start;\n\t\t\t\t\tprev = b;\n\t\t\t\t\ti -= 1;\n\n\t\t\t\t\tmatched = [];\n\t\t\t\t\tstashed = [];\n\t\t\t\t} else {\n\t\t\t\t\t// more efficient to move earlier items to the back\n\t\t\t\t\tseen.delete(item);\n\t\t\t\t\tmove(item, current, anchor);\n\n\t\t\t\t\tlink(state, item.prev, item.next);\n\t\t\t\t\tlink(state, item, prev === null ? state.first : prev.next);\n\t\t\t\t\tlink(state, prev, item);\n\n\t\t\t\t\tprev = item;\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tmatched = [];\n\t\t\tstashed = [];\n\n\t\t\twhile (current !== null && current.k !== key) {\n\t\t\t\t// If the each block isn't inert and an item has an effect that is already inert,\n\t\t\t\t// skip over adding it to our seen Set as the item is already being handled\n\t\t\t\tif ((current.e.f & INERT) === 0) {\n\t\t\t\t\t(seen ??= new Set()).add(current);\n\t\t\t\t}\n\t\t\t\tstashed.push(current);\n\t\t\t\tcurrent = current.next;\n\t\t\t}\n\n\t\t\tif (current === null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\titem = current;\n\t\t}\n\n\t\tmatched.push(item);\n\t\tprev = item;\n\t\tcurrent = item.next;\n\t}\n\n\tif (current !== null || seen !== undefined) {\n\t\tvar to_destroy = seen === undefined ? [] : array_from(seen);\n\n\t\twhile (current !== null) {\n\t\t\t// If the each block isn't inert, then inert effects are currently outroing and will be removed once the transition is finished\n\t\t\tif ((current.e.f & INERT) === 0) {\n\t\t\t\tto_destroy.push(current);\n\t\t\t}\n\t\t\tcurrent = current.next;\n\t\t}\n\n\t\tvar destroy_length = to_destroy.length;\n\n\t\tif (destroy_length > 0) {\n\t\t\tvar controlled_anchor = (flags & EACH_IS_CONTROLLED) !== 0 && length === 0 ? anchor : null;\n\n\t\t\tif (is_animated) {\n\t\t\t\tfor (i = 0; i < destroy_length; i += 1) {\n\t\t\t\t\tto_destroy[i].a?.measure();\n\t\t\t\t}\n\n\t\t\t\tfor (i = 0; i < destroy_length; i += 1) {\n\t\t\t\t\tto_destroy[i].a?.fix();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpause_effects(state, to_destroy, controlled_anchor, items);\n\t\t}\n\t}\n\n\tif (is_animated) {\n\t\tqueue_micro_task(() => {\n\t\t\tif (to_animate === undefined) return;\n\t\t\tfor (item of to_animate) {\n\t\t\t\titem.a?.apply();\n\t\t\t}\n\t\t});\n\t}\n\n\t/** @type {Effect} */ (active_effect).first = state.first && state.first.e;\n\t/** @type {Effect} */ (active_effect).last = prev && prev.e;\n}\n\n/**\n * @param {EachItem} item\n * @param {any} value\n * @param {number} index\n * @param {number} type\n * @returns {void}\n */\nfunction update_item(item, value, index, type) {\n\tif ((type & EACH_ITEM_REACTIVE) !== 0) {\n\t\tinternal_set(item.v, value);\n\t}\n\n\tif ((type & EACH_INDEX_REACTIVE) !== 0) {\n\t\tinternal_set(/** @type {Value} */ (item.i), index);\n\t} else {\n\t\titem.i = index;\n\t}\n}\n\n/**\n * @template V\n * @param {Node} anchor\n * @param {EachState} state\n * @param {EachItem | null} prev\n * @param {EachItem | null} next\n * @param {V} value\n * @param {unknown} key\n * @param {number} index\n * @param {(anchor: Node, item: V | Source, index: number | Value, collection: () => V[]) => void} render_fn\n * @param {number} flags\n * @param {() => V[]} get_collection\n * @returns {EachItem}\n */\nfunction create_item(\n\tanchor,\n\tstate,\n\tprev,\n\tnext,\n\tvalue,\n\tkey,\n\tindex,\n\trender_fn,\n\tflags,\n\tget_collection\n) {\n\tvar previous_each_item = current_each_item;\n\tvar reactive = (flags & EACH_ITEM_REACTIVE) !== 0;\n\tvar mutable = (flags & EACH_ITEM_IMMUTABLE) === 0;\n\n\tvar v = reactive ? (mutable ? mutable_source(value) : source(value)) : value;\n\tvar i = (flags & EACH_INDEX_REACTIVE) === 0 ? index : source(index);\n\n\tif (DEV && reactive) {\n\t\t// For tracing purposes, we need to link the source signal we create with the\n\t\t// collection + index so that tracing works as intended\n\t\t/** @type {Value} */ (v).debug = () => {\n\t\t\tvar collection_index = typeof i === 'number' ? index : i.v;\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unused-expressions\n\t\t\tget_collection()[collection_index];\n\t\t};\n\t}\n\n\t/** @type {EachItem} */\n\tvar item = {\n\t\ti,\n\t\tv,\n\t\tk: key,\n\t\ta: null,\n\t\t// @ts-expect-error\n\t\te: null,\n\t\tprev,\n\t\tnext\n\t};\n\n\tcurrent_each_item = item;\n\n\ttry {\n\t\titem.e = branch(() => render_fn(anchor, v, i, get_collection), hydrating);\n\n\t\titem.e.prev = prev && prev.e;\n\t\titem.e.next = next && next.e;\n\n\t\tif (prev === null) {\n\t\t\tstate.first = item;\n\t\t} else {\n\t\t\tprev.next = item;\n\t\t\tprev.e.next = item.e;\n\t\t}\n\n\t\tif (next !== null) {\n\t\t\tnext.prev = item;\n\t\t\tnext.e.prev = item.e;\n\t\t}\n\n\t\treturn item;\n\t} finally {\n\t\tcurrent_each_item = previous_each_item;\n\t}\n}\n\n/**\n * @param {EachItem} item\n * @param {EachItem | null} next\n * @param {Text | Element | Comment} anchor\n */\nfunction move(item, next, anchor) {\n\tvar end = item.next ? /** @type {TemplateNode} */ (item.next.e.nodes_start) : anchor;\n\n\tvar dest = next ? /** @type {TemplateNode} */ (next.e.nodes_start) : anchor;\n\tvar node = /** @type {TemplateNode} */ (item.e.nodes_start);\n\n\twhile (node !== end) {\n\t\tvar next_node = /** @type {TemplateNode} */ (get_next_sibling(node));\n\t\tdest.before(node);\n\t\tnode = next_node;\n\t}\n}\n\n/**\n * @param {EachState} state\n * @param {EachItem | null} prev\n * @param {EachItem | null} next\n */\nfunction link(state, prev, next) {\n\tif (prev === null) {\n\t\tstate.first = next;\n\t} else {\n\t\tprev.next = next;\n\t\tprev.e.next = next && next.e;\n\t}\n\n\tif (next !== null) {\n\t\tnext.prev = prev;\n\t\tnext.e.prev = prev && prev.e;\n\t}\n}\n","/** @import { Effect, TemplateNode } from '#client' */\nimport { FILENAME, HYDRATION_ERROR } from '../../../../constants.js';\nimport { block, branch, destroy_effect } from '../../reactivity/effects.js';\nimport { hydrate_next, hydrate_node, hydrating, set_hydrate_node } from '../hydration.js';\nimport { create_fragment_from_html } from '../reconciler.js';\nimport { assign_nodes } from '../template.js';\nimport * as w from '../../warnings.js';\nimport { hash, sanitize_location } from '../../../../utils.js';\nimport { DEV } from 'esm-env';\nimport { dev_current_component_function } from '../../context.js';\nimport { get_first_child, get_next_sibling } from '../operations.js';\n\n/**\n * @param {Element} element\n * @param {string | null} server_hash\n * @param {string} value\n */\nfunction check_hash(element, server_hash, value) {\n\tif (!server_hash || server_hash === hash(String(value ?? ''))) return;\n\n\tlet location;\n\n\t// @ts-expect-error\n\tconst loc = element.__svelte_meta?.loc;\n\tif (loc) {\n\t\tlocation = `near ${loc.file}:${loc.line}:${loc.column}`;\n\t} else if (dev_current_component_function?.[FILENAME]) {\n\t\tlocation = `in ${dev_current_component_function[FILENAME]}`;\n\t}\n\n\tw.hydration_html_changed(sanitize_location(location));\n}\n\n/**\n * @param {Element | Text | Comment} node\n * @param {() => string} get_value\n * @param {boolean} svg\n * @param {boolean} mathml\n * @param {boolean} [skip_warning]\n * @returns {void}\n */\nexport function html(node, get_value, svg, mathml, skip_warning) {\n\tvar anchor = node;\n\n\tvar value = '';\n\n\t/** @type {Effect | undefined} */\n\tvar effect;\n\n\tblock(() => {\n\t\tif (value === (value = get_value() ?? '')) {\n\t\t\tif (hydrating) {\n\t\t\t\thydrate_next();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (effect !== undefined) {\n\t\t\tdestroy_effect(effect);\n\t\t\teffect = undefined;\n\t\t}\n\n\t\tif (value === '') return;\n\n\t\teffect = branch(() => {\n\t\t\tif (hydrating) {\n\t\t\t\t// We're deliberately not trying to repair mismatches between server and client,\n\t\t\t\t// as it's costly and error-prone (and it's an edge case to have a mismatch anyway)\n\t\t\t\tvar hash = /** @type {Comment} */ (hydrate_node).data;\n\t\t\t\tvar next = hydrate_next();\n\t\t\t\tvar last = next;\n\n\t\t\t\twhile (\n\t\t\t\t\tnext !== null &&\n\t\t\t\t\t(next.nodeType !== 8 || /** @type {Comment} */ (next).data !== '')\n\t\t\t\t) {\n\t\t\t\t\tlast = next;\n\t\t\t\t\tnext = /** @type {TemplateNode} */ (get_next_sibling(next));\n\t\t\t\t}\n\n\t\t\t\tif (next === null) {\n\t\t\t\t\tw.hydration_mismatch();\n\t\t\t\t\tthrow HYDRATION_ERROR;\n\t\t\t\t}\n\n\t\t\t\tif (DEV && !skip_warning) {\n\t\t\t\t\tcheck_hash(/** @type {Element} */ (next.parentNode), hash, value);\n\t\t\t\t}\n\n\t\t\t\tassign_nodes(hydrate_node, last);\n\t\t\t\tanchor = set_hydrate_node(next);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar html = value + '';\n\t\t\tif (svg) html = `${html}`;\n\t\t\telse if (mathml) html = `${html}`;\n\n\t\t\t// Don't use create_fragment_with_script_from_html here because that would mean script tags are executed.\n\t\t\t// @html is basically `.innerHTML = ...` and that doesn't execute scripts either due to security reasons.\n\t\t\t/** @type {DocumentFragment | Element} */\n\t\t\tvar node = create_fragment_from_html(html);\n\n\t\t\tif (svg || mathml) {\n\t\t\t\tnode = /** @type {Element} */ (get_first_child(node));\n\t\t\t}\n\n\t\t\tassign_nodes(\n\t\t\t\t/** @type {TemplateNode} */ (get_first_child(node)),\n\t\t\t\t/** @type {TemplateNode} */ (node.lastChild)\n\t\t\t);\n\n\t\t\tif (svg || mathml) {\n\t\t\t\twhile (get_first_child(node)) {\n\t\t\t\t\tanchor.before(/** @type {Node} */ (get_first_child(node)));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tanchor.before(node);\n\t\t\t}\n\t\t});\n\t});\n}\n","import { hydrate_next, hydrating } from '../hydration.js';\n\n/**\n * @param {Comment} anchor\n * @param {Record} $$props\n * @param {string} name\n * @param {Record} slot_props\n * @param {null | ((anchor: Comment) => void)} fallback_fn\n */\nexport function slot(anchor, $$props, name, slot_props, fallback_fn) {\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\tvar slot_fn = $$props.$$slots?.[name];\n\t// Interop: Can use snippets to fill slots\n\tvar is_interop = false;\n\tif (slot_fn === true) {\n\t\tslot_fn = $$props[name === 'default' ? 'children' : name];\n\t\tis_interop = true;\n\t}\n\n\tif (slot_fn === undefined) {\n\t\tif (fallback_fn !== null) {\n\t\t\tfallback_fn(anchor);\n\t\t}\n\t} else {\n\t\tslot_fn(anchor, is_interop ? () => slot_props : slot_props);\n\t}\n}\n\n/**\n * @param {Record} props\n * @returns {Record}\n */\nexport function sanitize_slots(props) {\n\t/** @type {Record} */\n\tconst sanitized = {};\n\tif (props.children) sanitized.default = true;\n\tfor (const key in props.$$slots) {\n\t\tsanitized[key] = true;\n\t}\n\treturn sanitized;\n}\n","/** @import { Snippet } from 'svelte' */\n/** @import { Effect, TemplateNode } from '#client' */\n/** @import { Getters } from '#shared' */\nimport { EFFECT_TRANSPARENT } from '../../constants.js';\nimport { branch, block, destroy_effect, teardown } from '../../reactivity/effects.js';\nimport {\n\tdev_current_component_function,\n\tset_dev_current_component_function\n} from '../../context.js';\nimport { hydrate_next, hydrate_node, hydrating } from '../hydration.js';\nimport { create_fragment_from_html } from '../reconciler.js';\nimport { assign_nodes } from '../template.js';\nimport * as w from '../../warnings.js';\nimport * as e from '../../errors.js';\nimport { DEV } from 'esm-env';\nimport { get_first_child, get_next_sibling } from '../operations.js';\nimport { noop } from '../../../shared/utils.js';\n\n/**\n * @template {(node: TemplateNode, ...args: any[]) => void} SnippetFn\n * @param {TemplateNode} node\n * @param {() => SnippetFn | null | undefined} get_snippet\n * @param {(() => any)[]} args\n * @returns {void}\n */\nexport function snippet(node, get_snippet, ...args) {\n\tvar anchor = node;\n\n\t/** @type {SnippetFn | null | undefined} */\n\t// @ts-ignore\n\tvar snippet = noop;\n\n\t/** @type {Effect | null} */\n\tvar snippet_effect;\n\n\tblock(() => {\n\t\tif (snippet === (snippet = get_snippet())) return;\n\n\t\tif (snippet_effect) {\n\t\t\tdestroy_effect(snippet_effect);\n\t\t\tsnippet_effect = null;\n\t\t}\n\n\t\tif (DEV && snippet == null) {\n\t\t\te.invalid_snippet();\n\t\t}\n\n\t\tsnippet_effect = branch(() => /** @type {SnippetFn} */ (snippet)(anchor, ...args));\n\t}, EFFECT_TRANSPARENT);\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n\n/**\n * In development, wrap the snippet function so that it passes validation, and so that the\n * correct component context is set for ownership checks\n * @param {any} component\n * @param {(node: TemplateNode, ...args: any[]) => void} fn\n */\nexport function wrap_snippet(component, fn) {\n\treturn (/** @type {TemplateNode} */ node, /** @type {any[]} */ ...args) => {\n\t\tvar previous_component_function = dev_current_component_function;\n\t\tset_dev_current_component_function(component);\n\n\t\ttry {\n\t\t\treturn fn(node, ...args);\n\t\t} finally {\n\t\t\tset_dev_current_component_function(previous_component_function);\n\t\t}\n\t};\n}\n\n/**\n * Create a snippet programmatically\n * @template {unknown[]} Params\n * @param {(...params: Getters) => {\n * render: () => string\n * setup?: (element: Element) => void | (() => void)\n * }} fn\n * @returns {Snippet}\n */\nexport function createRawSnippet(fn) {\n\t// @ts-expect-error the types are a lie\n\treturn (/** @type {TemplateNode} */ anchor, /** @type {Getters} */ ...params) => {\n\t\tvar snippet = fn(...params);\n\n\t\t/** @type {Element} */\n\t\tvar element;\n\n\t\tif (hydrating) {\n\t\t\telement = /** @type {Element} */ (hydrate_node);\n\t\t\thydrate_next();\n\t\t} else {\n\t\t\tvar html = snippet.render().trim();\n\t\t\tvar fragment = create_fragment_from_html(html);\n\t\t\telement = /** @type {Element} */ (get_first_child(fragment));\n\n\t\t\tif (DEV && (get_next_sibling(element) !== null || element.nodeType !== 1)) {\n\t\t\t\tw.invalid_raw_snippet_render();\n\t\t\t}\n\n\t\t\tanchor.before(element);\n\t\t}\n\n\t\tconst result = snippet.setup?.(element);\n\t\tassign_nodes(element, element);\n\n\t\tif (typeof result === 'function') {\n\t\t\tteardown(result);\n\t\t}\n\t};\n}\n","/** @import { TemplateNode, Dom, Effect } from '#client' */\nimport { EFFECT_TRANSPARENT } from '../../constants.js';\nimport { block, branch, pause_effect } from '../../reactivity/effects.js';\nimport { hydrate_next, hydrate_node, hydrating } from '../hydration.js';\n\n/**\n * @template P\n * @template {(props: P) => void} C\n * @param {TemplateNode} node\n * @param {() => C} get_component\n * @param {(anchor: TemplateNode, component: C) => Dom | void} render_fn\n * @returns {void}\n */\nexport function component(node, get_component, render_fn) {\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\tvar anchor = node;\n\n\t/** @type {C} */\n\tvar component;\n\n\t/** @type {Effect | null} */\n\tvar effect;\n\n\tblock(() => {\n\t\tif (component === (component = get_component())) return;\n\n\t\tif (effect) {\n\t\t\tpause_effect(effect);\n\t\t\teffect = null;\n\t\t}\n\n\t\tif (component) {\n\t\t\teffect = branch(() => render_fn(anchor, component));\n\t\t}\n\t}, EFFECT_TRANSPARENT);\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n","/** @import { Effect, TemplateNode } from '#client' */\nimport { FILENAME, NAMESPACE_SVG } from '../../../../constants.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tset_hydrate_node,\n\tset_hydrating\n} from '../hydration.js';\nimport { create_text, get_first_child } from '../operations.js';\nimport {\n\tblock,\n\tbranch,\n\tdestroy_effect,\n\tpause_effect,\n\tresume_effect\n} from '../../reactivity/effects.js';\nimport { set_should_intro } from '../../render.js';\nimport { current_each_item, set_current_each_item } from './each.js';\nimport { active_effect } from '../../runtime.js';\nimport { component_context } from '../../context.js';\nimport { DEV } from 'esm-env';\nimport { EFFECT_TRANSPARENT } from '../../constants.js';\nimport { assign_nodes } from '../template.js';\nimport { is_raw_text_element } from '../../../../utils.js';\n\n/**\n * @param {Comment | Element} node\n * @param {() => string} get_tag\n * @param {boolean} is_svg\n * @param {undefined | ((element: Element, anchor: Node | null) => void)} render_fn,\n * @param {undefined | (() => string)} get_namespace\n * @param {undefined | [number, number]} location\n * @returns {void}\n */\nexport function element(node, get_tag, is_svg, render_fn, get_namespace, location) {\n\tlet was_hydrating = hydrating;\n\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\tvar filename = DEV && location && component_context?.function[FILENAME];\n\n\t/** @type {string | null} */\n\tvar tag;\n\n\t/** @type {string | null} */\n\tvar current_tag;\n\n\t/** @type {null | Element} */\n\tvar element = null;\n\n\tif (hydrating && hydrate_node.nodeType === 1) {\n\t\telement = /** @type {Element} */ (hydrate_node);\n\t\thydrate_next();\n\t}\n\n\tvar anchor = /** @type {TemplateNode} */ (hydrating ? hydrate_node : node);\n\n\t/** @type {Effect | null} */\n\tvar effect;\n\n\t/**\n\t * The keyed `{#each ...}` item block, if any, that this element is inside.\n\t * We track this so we can set it when changing the element, allowing any\n\t * `animate:` directive to bind itself to the correct block\n\t */\n\tvar each_item_block = current_each_item;\n\n\tblock(() => {\n\t\tconst next_tag = get_tag() || null;\n\t\tvar ns = get_namespace ? get_namespace() : is_svg || next_tag === 'svg' ? NAMESPACE_SVG : null;\n\n\t\t// Assumption: Noone changes the namespace but not the tag (what would that even mean?)\n\t\tif (next_tag === tag) return;\n\n\t\t// See explanation of `each_item_block` above\n\t\tvar previous_each_item = current_each_item;\n\t\tset_current_each_item(each_item_block);\n\n\t\tif (effect) {\n\t\t\tif (next_tag === null) {\n\t\t\t\t// start outro\n\t\t\t\tpause_effect(effect, () => {\n\t\t\t\t\teffect = null;\n\t\t\t\t\tcurrent_tag = null;\n\t\t\t\t});\n\t\t\t} else if (next_tag === current_tag) {\n\t\t\t\t// same tag as is currently rendered — abort outro\n\t\t\t\tresume_effect(effect);\n\t\t\t} else {\n\t\t\t\t// tag is changing — destroy immediately, render contents without intro transitions\n\t\t\t\tdestroy_effect(effect);\n\t\t\t\tset_should_intro(false);\n\t\t\t}\n\t\t}\n\n\t\tif (next_tag && next_tag !== current_tag) {\n\t\t\teffect = branch(() => {\n\t\t\t\telement = hydrating\n\t\t\t\t\t? /** @type {Element} */ (element)\n\t\t\t\t\t: ns\n\t\t\t\t\t\t? document.createElementNS(ns, next_tag)\n\t\t\t\t\t\t: document.createElement(next_tag);\n\n\t\t\t\tif (DEV && location) {\n\t\t\t\t\t// @ts-expect-error\n\t\t\t\t\telement.__svelte_meta = {\n\t\t\t\t\t\tloc: {\n\t\t\t\t\t\t\tfile: filename,\n\t\t\t\t\t\t\tline: location[0],\n\t\t\t\t\t\t\tcolumn: location[1]\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tassign_nodes(element, element);\n\n\t\t\t\tif (render_fn) {\n\t\t\t\t\tif (hydrating && is_raw_text_element(next_tag)) {\n\t\t\t\t\t\t// prevent hydration glitches\n\t\t\t\t\t\telement.append(document.createComment(''));\n\t\t\t\t\t}\n\n\t\t\t\t\t// If hydrating, use the existing ssr comment as the anchor so that the\n\t\t\t\t\t// inner open and close methods can pick up the existing nodes correctly\n\t\t\t\t\tvar child_anchor = /** @type {TemplateNode} */ (\n\t\t\t\t\t\thydrating ? get_first_child(element) : element.appendChild(create_text())\n\t\t\t\t\t);\n\n\t\t\t\t\tif (hydrating) {\n\t\t\t\t\t\tif (child_anchor === null) {\n\t\t\t\t\t\t\tset_hydrating(false);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tset_hydrate_node(child_anchor);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// `child_anchor` is undefined if this is a void element, but we still\n\t\t\t\t\t// need to call `render_fn` in order to run actions etc. If the element\n\t\t\t\t\t// contains children, it's a user error (which is warned on elsewhere)\n\t\t\t\t\t// and the DOM will be silently discarded\n\t\t\t\t\trender_fn(element, child_anchor);\n\t\t\t\t}\n\n\t\t\t\t// we do this after calling `render_fn` so that child effects don't override `nodes.end`\n\t\t\t\t/** @type {Effect} */ (active_effect).nodes_end = element;\n\n\t\t\t\tanchor.before(element);\n\t\t\t});\n\t\t}\n\n\t\ttag = next_tag;\n\t\tif (tag) current_tag = tag;\n\t\tset_should_intro(true);\n\n\t\tset_current_each_item(previous_each_item);\n\t}, EFFECT_TRANSPARENT);\n\n\tif (was_hydrating) {\n\t\tset_hydrating(true);\n\t\tset_hydrate_node(anchor);\n\t}\n}\n","import { DEV } from 'esm-env';\nimport { queue_micro_task } from './task.js';\nimport { register_style } from '../dev/css.js';\n\n/**\n * @param {Node} anchor\n * @param {{ hash: string, code: string }} css\n */\nexport function append_styles(anchor, css) {\n\t// Use `queue_micro_task` to ensure `anchor` is in the DOM, otherwise getRootNode() will yield wrong results\n\tqueue_micro_task(() => {\n\t\tvar root = anchor.getRootNode();\n\n\t\tvar target = /** @type {ShadowRoot} */ (root).host\n\t\t\t? /** @type {ShadowRoot} */ (root)\n\t\t\t: /** @type {Document} */ (root).head ?? /** @type {Document} */ (root.ownerDocument).head;\n\n\t\t// Always querying the DOM is roughly the same perf as additionally checking for presence in a map first assuming\n\t\t// that you'll get cache hits half of the time, so we just always query the dom for simplicity and code savings.\n\t\tif (!target.querySelector('#' + css.hash)) {\n\t\t\tconst style = document.createElement('style');\n\t\t\tstyle.id = css.hash;\n\t\t\tstyle.textContent = css.code;\n\n\t\t\ttarget.appendChild(style);\n\n\t\t\tif (DEV) {\n\t\t\t\tregister_style(css.hash, style);\n\t\t\t}\n\t\t}\n\t});\n}\n","/** @import { ActionPayload } from '#client' */\nimport { effect, render_effect } from '../../reactivity/effects.js';\nimport { safe_not_equal } from '../../reactivity/equality.js';\nimport { deep_read_state, untrack } from '../../runtime.js';\n\n/**\n * @template P\n * @param {Element} dom\n * @param {(dom: Element, value?: P) => ActionPayload

} action\n * @param {() => P} [get_value]\n * @returns {void}\n */\nexport function action(dom, action, get_value) {\n\teffect(() => {\n\t\tvar payload = untrack(() => action(dom, get_value?.()) || {});\n\n\t\tif (get_value && payload?.update) {\n\t\t\tvar inited = false;\n\t\t\t/** @type {P} */\n\t\t\tvar prev = /** @type {any} */ ({}); // initialize with something so it's never equal on first run\n\n\t\t\trender_effect(() => {\n\t\t\t\tvar value = get_value();\n\n\t\t\t\t// Action's update method is coarse-grained, i.e. when anything in the passed value changes, update.\n\t\t\t\t// This works in legacy mode because of mutable_source being updated as a whole, but when using $state\n\t\t\t\t// together with actions and mutation, it wouldn't notice the change without a deep read.\n\t\t\t\tdeep_read_state(value);\n\n\t\t\t\tif (inited && safe_not_equal(prev, value)) {\n\t\t\t\t\tprev = value;\n\t\t\t\t\t/** @type {Function} */ (payload.update)(value);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tinited = true;\n\t\t}\n\n\t\tif (payload?.destroy) {\n\t\t\treturn () => /** @type {Function} */ (payload.destroy)();\n\t\t}\n\t});\n}\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t` should be rendered as `

` and _not_\n * `
`, which is equivalent to `
`. There\n * may be other odd cases that need to be added to this list in future\n * @type {Record>}\n */\nconst replacements = {\n\ttranslate: new Map([\n\t\t[true, 'yes'],\n\t\t[false, 'no']\n\t])\n};\n\n/**\n * @template V\n * @param {string} name\n * @param {V} value\n * @param {boolean} [is_boolean]\n * @returns {string}\n */\nexport function attr(name, value, is_boolean = false) {\n\tif (value == null || (!value && is_boolean) || (value === '' && name === 'class')) return '';\n\tconst normalized = (name in replacements && replacements[name].get(value)) || value;\n\tconst assignment = is_boolean ? '' : `=\"${escape_html(normalized, true)}\"`;\n\treturn ` ${name}${assignment}`;\n}\n\n/**\n * Small wrapper around clsx to preserve Svelte's (weird) handling of falsy values.\n * TODO Svelte 6 revisit this, and likely turn all falsy values into the empty string (what clsx also does)\n * @param {any} value\n */\nexport function clsx(value) {\n\tif (typeof value === 'object') {\n\t\treturn _clsx(value);\n\t} else {\n\t\treturn value ?? '';\n\t}\n}\n\nconst whitespace = [...' \\t\\n\\r\\f\\u00a0\\u000b\\ufeff'];\n\n/**\n * @param {any} value\n * @param {string | null} [hash]\n * @param {Record} [directives]\n * @returns {string | null}\n */\nexport function to_class(value, hash, directives) {\n\tvar classname = value == null ? '' : '' + value;\n\n\tif (hash) {\n\t\tclassname = classname ? classname + ' ' + hash : hash;\n\t}\n\n\tif (directives) {\n\t\tfor (var key in directives) {\n\t\t\tif (directives[key]) {\n\t\t\t\tclassname = classname ? classname + ' ' + key : key;\n\t\t\t} else if (classname.length) {\n\t\t\t\tvar len = key.length;\n\t\t\t\tvar a = 0;\n\n\t\t\t\twhile ((a = classname.indexOf(key, a)) >= 0) {\n\t\t\t\t\tvar b = a + len;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t(a === 0 || whitespace.includes(classname[a - 1])) &&\n\t\t\t\t\t\t(b === classname.length || whitespace.includes(classname[b]))\n\t\t\t\t\t) {\n\t\t\t\t\t\tclassname = (a === 0 ? '' : classname.substring(0, a)) + classname.substring(b + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ta = b;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn classname === '' ? null : classname;\n}\n","import { to_class } from '../../../shared/attributes.js';\nimport { hydrating } from '../hydration.js';\n\n/**\n * @param {Element} dom\n * @param {boolean | number} is_html\n * @param {string | null} value\n * @param {string} [hash]\n * @param {Record} [prev_classes]\n * @param {Record} [next_classes]\n * @returns {Record | undefined}\n */\nexport function set_class(dom, is_html, value, hash, prev_classes, next_classes) {\n\t// @ts-expect-error need to add __className to patched prototype\n\tvar prev = dom.__className;\n\n\tif (hydrating || prev !== value) {\n\t\tvar next_class_name = to_class(value, hash, next_classes);\n\n\t\tif (!hydrating || next_class_name !== dom.getAttribute('class')) {\n\t\t\t// Removing the attribute when the value is only an empty string causes\n\t\t\t// performance issues vs simply making the className an empty string. So\n\t\t\t// we should only remove the class if the the value is nullish\n\t\t\t// and there no hash/directives :\n\t\t\tif (next_class_name == null) {\n\t\t\t\tdom.removeAttribute('class');\n\t\t\t} else if (is_html) {\n\t\t\t\tdom.className = next_class_name;\n\t\t\t} else {\n\t\t\t\tdom.setAttribute('class', next_class_name);\n\t\t\t}\n\t\t}\n\n\t\t// @ts-expect-error need to add __className to patched prototype\n\t\tdom.__className = value;\n\t} else if (next_classes) {\n\t\tfor (var key in next_classes) {\n\t\t\tvar is_present = !!next_classes[key];\n\n\t\t\tif (prev_classes == null || is_present !== !!prev_classes[key]) {\n\t\t\t\tdom.classList.toggle(key, is_present);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn next_classes;\n}\n","import { DEV } from 'esm-env';\nimport { hydrating, set_hydrating } from '../hydration.js';\nimport { get_descriptors, get_prototype_of } from '../../../shared/utils.js';\nimport { create_event, delegate } from './events.js';\nimport { add_form_reset_listener, autofocus } from './misc.js';\nimport * as w from '../../warnings.js';\nimport { LOADING_ATTR_SYMBOL } from '../../constants.js';\nimport { queue_idle_task } from '../task.js';\nimport { is_capture_event, is_delegated, normalize_attribute } from '../../../../utils.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../runtime.js';\nimport { clsx } from '../../../shared/attributes.js';\nimport { set_class } from './class.js';\n\nexport const CLASS = Symbol('class');\nexport const STYLE = Symbol('style');\n\n/**\n * The value/checked attribute in the template actually corresponds to the defaultValue property, so we need\n * to remove it upon hydration to avoid a bug when someone resets the form value.\n * @param {HTMLInputElement} input\n * @returns {void}\n */\nexport function remove_input_defaults(input) {\n\tif (!hydrating) return;\n\n\tvar already_removed = false;\n\n\t// We try and remove the default attributes later, rather than sync during hydration.\n\t// Doing it sync during hydration has a negative impact on performance, but deferring the\n\t// work in an idle task alleviates this greatly. If a form reset event comes in before\n\t// the idle callback, then we ensure the input defaults are cleared just before.\n\tvar remove_defaults = () => {\n\t\tif (already_removed) return;\n\t\talready_removed = true;\n\n\t\t// Remove the attributes but preserve the values\n\t\tif (input.hasAttribute('value')) {\n\t\t\tvar value = input.value;\n\t\t\tset_attribute(input, 'value', null);\n\t\t\tinput.value = value;\n\t\t}\n\n\t\tif (input.hasAttribute('checked')) {\n\t\t\tvar checked = input.checked;\n\t\t\tset_attribute(input, 'checked', null);\n\t\t\tinput.checked = checked;\n\t\t}\n\t};\n\n\t// @ts-expect-error\n\tinput.__on_r = remove_defaults;\n\tqueue_idle_task(remove_defaults);\n\tadd_form_reset_listener();\n}\n\n/**\n * @param {Element} element\n * @param {any} value\n */\nexport function set_value(element, value) {\n\t// @ts-expect-error\n\tvar attributes = (element.__attributes ??= {});\n\n\tif (\n\t\tattributes.value ===\n\t\t\t(attributes.value =\n\t\t\t\t// treat null and undefined the same for the initial value\n\t\t\t\tvalue ?? undefined) ||\n\t\t// @ts-expect-error\n\t\t// `progress` elements always need their value set when it's `0`\n\t\t(element.value === value && (value !== 0 || element.nodeName !== 'PROGRESS'))\n\t) {\n\t\treturn;\n\t}\n\n\t// @ts-expect-error\n\telement.value = value ?? '';\n}\n\n/**\n * @param {Element} element\n * @param {boolean} checked\n */\nexport function set_checked(element, checked) {\n\t// @ts-expect-error\n\tvar attributes = (element.__attributes ??= {});\n\n\tif (\n\t\tattributes.checked ===\n\t\t(attributes.checked =\n\t\t\t// treat null and undefined the same for the initial value\n\t\t\tchecked ?? undefined)\n\t) {\n\t\treturn;\n\t}\n\n\t// @ts-expect-error\n\telement.checked = checked;\n}\n\n/**\n * Sets the `selected` attribute on an `option` element.\n * Not set through the property because that doesn't reflect to the DOM,\n * which means it wouldn't be taken into account when a form is reset.\n * @param {HTMLOptionElement} element\n * @param {boolean} selected\n */\nexport function set_selected(element, selected) {\n\tif (selected) {\n\t\t// The selected option could've changed via user selection, and\n\t\t// setting the value without this check would set it back.\n\t\tif (!element.hasAttribute('selected')) {\n\t\t\telement.setAttribute('selected', '');\n\t\t}\n\t} else {\n\t\telement.removeAttribute('selected');\n\t}\n}\n\n/**\n * Applies the default checked property without influencing the current checked property.\n * @param {HTMLInputElement} element\n * @param {boolean} checked\n */\nexport function set_default_checked(element, checked) {\n\tconst existing_value = element.checked;\n\telement.defaultChecked = checked;\n\telement.checked = existing_value;\n}\n\n/**\n * Applies the default value property without influencing the current value property.\n * @param {HTMLInputElement | HTMLTextAreaElement} element\n * @param {string} value\n */\nexport function set_default_value(element, value) {\n\tconst existing_value = element.value;\n\telement.defaultValue = value;\n\telement.value = existing_value;\n}\n\n/**\n * @param {Element} element\n * @param {string} attribute\n * @param {string | null} value\n * @param {boolean} [skip_warning]\n */\nexport function set_attribute(element, attribute, value, skip_warning) {\n\t// @ts-expect-error\n\tvar attributes = (element.__attributes ??= {});\n\n\tif (hydrating) {\n\t\tattributes[attribute] = element.getAttribute(attribute);\n\n\t\tif (\n\t\t\tattribute === 'src' ||\n\t\t\tattribute === 'srcset' ||\n\t\t\t(attribute === 'href' && element.nodeName === 'LINK')\n\t\t) {\n\t\t\tif (!skip_warning) {\n\t\t\t\tcheck_src_in_dev_hydration(element, attribute, value ?? '');\n\t\t\t}\n\n\t\t\t// If we reset these attributes, they would result in another network request, which we want to avoid.\n\t\t\t// We assume they are the same between client and server as checking if they are equal is expensive\n\t\t\t// (we can't just compare the strings as they can be different between client and server but result in the\n\t\t\t// same url, so we would need to create hidden anchor elements to compare them)\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (attributes[attribute] === (attributes[attribute] = value)) return;\n\n\tif (attribute === 'style' && '__styles' in element) {\n\t\t// reset styles to force style: directive to update\n\t\telement.__styles = {};\n\t}\n\n\tif (attribute === 'loading') {\n\t\t// @ts-expect-error\n\t\telement[LOADING_ATTR_SYMBOL] = value;\n\t}\n\n\tif (value == null) {\n\t\telement.removeAttribute(attribute);\n\t} else if (typeof value !== 'string' && get_setters(element).includes(attribute)) {\n\t\t// @ts-ignore\n\t\telement[attribute] = value;\n\t} else {\n\t\telement.setAttribute(attribute, value);\n\t}\n}\n\n/**\n * @param {Element} dom\n * @param {string} attribute\n * @param {string} value\n */\nexport function set_xlink_attribute(dom, attribute, value) {\n\tdom.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\n\n/**\n * @param {HTMLElement} node\n * @param {string} prop\n * @param {any} value\n */\nexport function set_custom_element_data(node, prop, value) {\n\t// We need to ensure that setting custom element props, which can\n\t// invoke lifecycle methods on other custom elements, does not also\n\t// associate those lifecycle methods with the current active reaction\n\t// or effect\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\t// If we're hydrating but the custom element is from Svelte, and it already scaffolded,\n\t// then it might run block logic in hydration mode, which we have to prevent.\n\tlet was_hydrating = hydrating;\n\tif (hydrating) {\n\t\tset_hydrating(false);\n\t}\n\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\ttry {\n\t\tif (\n\t\t\t// Don't compute setters for custom elements while they aren't registered yet,\n\t\t\t// because during their upgrade/instantiation they might add more setters.\n\t\t\t// Instead, fall back to a simple \"an object, then set as property\" heuristic.\n\t\t\tsetters_cache.has(node.nodeName) ||\n\t\t\t// customElements may not be available in browser extension contexts\n\t\t\t!customElements ||\n\t\t\tcustomElements.get(node.tagName.toLowerCase())\n\t\t\t\t? get_setters(node).includes(prop)\n\t\t\t\t: value && typeof value === 'object'\n\t\t) {\n\t\t\t// @ts-expect-error\n\t\t\tnode[prop] = value;\n\t\t} else {\n\t\t\t// We did getters etc checks already, stringify before passing to set_attribute\n\t\t\t// to ensure it doesn't invoke the same logic again, and potentially populating\n\t\t\t// the setters cache too early.\n\t\t\tset_attribute(node, prop, value == null ? value : String(value));\n\t\t}\n\t} finally {\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t\tif (was_hydrating) {\n\t\t\tset_hydrating(true);\n\t\t}\n\t}\n}\n\n/**\n * Spreads attributes onto a DOM element, taking into account the currently set attributes\n * @param {Element & ElementCSSInlineStyle} element\n * @param {Record | undefined} prev\n * @param {Record} next New attributes - this function mutates this object\n * @param {string} [css_hash]\n * @param {boolean} [preserve_attribute_case]\n * @param {boolean} [is_custom_element]\n * @param {boolean} [skip_warning]\n * @returns {Record}\n */\nexport function set_attributes(\n\telement,\n\tprev,\n\tnext,\n\tcss_hash,\n\tpreserve_attribute_case = false,\n\tis_custom_element = false,\n\tskip_warning = false\n) {\n\t// If we're hydrating but the custom element is from Svelte, and it already scaffolded,\n\t// then it might run block logic in hydration mode, which we have to prevent.\n\tlet is_hydrating_custom_element = hydrating && is_custom_element;\n\tif (is_hydrating_custom_element) {\n\t\tset_hydrating(false);\n\t}\n\n\tvar current = prev || {};\n\tvar is_option_element = element.tagName === 'OPTION';\n\n\tfor (var key in prev) {\n\t\tif (!(key in next)) {\n\t\t\tnext[key] = null;\n\t\t}\n\t}\n\n\tif (next.class) {\n\t\tnext.class = clsx(next.class);\n\t} else if (css_hash || next[CLASS]) {\n\t\tnext.class = null; /* force call to set_class() */\n\t}\n\n\tvar setters = get_setters(element);\n\n\t// @ts-expect-error\n\tvar attributes = /** @type {Record} **/ (element.__attributes ??= {});\n\n\t// since key is captured we use const\n\tfor (const key in next) {\n\t\t// let instead of var because referenced in a closure\n\t\tlet value = next[key];\n\n\t\t// Up here because we want to do this for the initial value, too, even if it's undefined,\n\t\t// and this wouldn't be reached in case of undefined because of the equality check below\n\t\tif (is_option_element && key === 'value' && value == null) {\n\t\t\t// The
\n","\n\n\n{data?.label}\n\n","\n\n{data?.label}\n\n","\n\n{data?.label}\n\n","function tryToMount(node, domNode, target) {\n if (!domNode) {\n return;\n }\n const targetEl = target ? domNode.querySelector(target) : domNode;\n if (targetEl) {\n targetEl.appendChild(node);\n }\n}\nexport default function (node, { target, domNode }) {\n tryToMount(node, domNode, target);\n return {\n async update({ target, domNode }) {\n tryToMount(node, domNode, target);\n },\n destroy() {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n }\n };\n}\n","\n\n
\n \n
\n","import { get } from 'svelte/store';\nimport { errorMessages } from '@xyflow/system';\nimport { useStore } from '../store';\nexport function useHandleEdgeSelect() {\n const { edgeLookup, selectionRect, selectionRectMode, multiselectionKeyPressed, addSelectedEdges, unselectNodesAndEdges, elementsSelectable } = useStore();\n return (id) => {\n const edge = get(edgeLookup).get(id);\n if (!edge) {\n console.warn('012', errorMessages['error012'](id));\n return;\n }\n const selectable = edge.selectable || (get(elementsSelectable) && typeof edge.selectable === 'undefined');\n if (selectable) {\n selectionRect.set(null);\n selectionRectMode.set(null);\n if (!edge.selected) {\n addSelectedEdges([id]);\n }\n else if (edge.selected && get(multiselectionKeyPressed)) {\n unselectNodesAndEdges({ nodes: [], edges: [edge] });\n }\n }\n };\n}\n","\n\n\n {}}\n on:click={() => {\n if (id) handleEdgeSelect(id);\n }}\n >\n \n
\n\n","\n\n\n\n{#if interactionWidthValue}\n \n{/if}\n\n{#if label}\n \n {label}\n \n{/if}\n","\n\n\n","\n\n\n","\n\n\n","\n\n\n","import { writable, get } from 'svelte/store';\nimport { adoptUserNodes, updateConnectionLookup, infiniteExtent } from '@xyflow/system';\n// we need to sync the user nodes and the internal nodes so that the user can receive the updates\n// made by Svelte Flow (like dragging or selecting a node).\nexport function syncNodeStores(nodesStore, userNodesStore) {\n const nodesStoreSetter = nodesStore.set;\n const userNodesStoreSetter = userNodesStore.set;\n const currentNodesStore = get(nodesStore);\n const currentUserNodesStore = get(userNodesStore);\n // depending how the user initializes the nodes, we need to decide if we want to use\n // the user nodes or the internal nodes for initialization. A user can use a SvelteFlowProvider\n // without providing any nodes, in that case we want to use the nodes passed by the user.\n // By default we are using the store nodes, because they already have the absolute positions.\n const initWithUserNodes = currentNodesStore.length === 0 && currentUserNodesStore.length > 0;\n let val = initWithUserNodes ? currentUserNodesStore : currentNodesStore;\n nodesStore.set(val);\n const _set = (nds) => {\n const updatedNodes = nodesStoreSetter(nds);\n val = updatedNodes;\n userNodesStoreSetter(val);\n return updatedNodes;\n };\n nodesStore.set = userNodesStore.set = _set;\n nodesStore.update = userNodesStore.update = (fn) => _set(fn(val));\n}\n// same for edges\nexport function syncEdgeStores(edgesStore, userEdgesStore) {\n const nodesStoreSetter = edgesStore.set;\n const userEdgesStoreSetter = userEdgesStore.set;\n let val = get(userEdgesStore);\n edgesStore.set(val);\n const _set = (eds) => {\n nodesStoreSetter(eds);\n userEdgesStoreSetter(eds);\n val = eds;\n };\n edgesStore.set = userEdgesStore.set = _set;\n edgesStore.update = userEdgesStore.update = (fn) => _set(fn(val));\n}\n// it is possible to pass a viewport store to SvelteFlow for having more control\n// if that's the case we need to sync the internal viewport with the user viewport\nexport const syncViewportStores = (panZoomStore, viewportStore, userViewportStore) => {\n if (!userViewportStore) {\n return;\n }\n const panZoom = get(panZoomStore);\n const viewportStoreSetter = viewportStore.set;\n const userViewportStoreSetter = userViewportStore.set;\n let val = userViewportStore ? get(userViewportStore) : { x: 0, y: 0, zoom: 1 };\n viewportStore.set(val);\n viewportStore.set = (vp) => {\n viewportStoreSetter(vp);\n userViewportStoreSetter(vp);\n val = vp;\n return vp;\n };\n userViewportStore.set = (vp) => {\n panZoom?.syncViewport(vp);\n viewportStoreSetter(vp);\n userViewportStoreSetter(vp);\n val = vp;\n return vp;\n };\n viewportStore.update = (fn) => {\n viewportStore.set(fn(val));\n };\n userViewportStore.update = (fn) => {\n userViewportStore.set(fn(val));\n };\n};\n// we are creating a custom store for the internals nodes in order to update the zIndex and positionAbsolute.\n// The user only passes in relative positions, so we need to calculate the absolute positions based on the parent nodes.\nexport const createNodesStore = (nodes, nodeLookup, parentLookup, nodeOrigin = [0, 0], nodeExtent = infiniteExtent) => {\n const { subscribe, set, update } = writable([]);\n let value = nodes;\n let defaults = {};\n let elevateNodesOnSelect = true;\n const _set = (nds) => {\n adoptUserNodes(nds, nodeLookup, parentLookup, {\n elevateNodesOnSelect,\n nodeOrigin,\n nodeExtent,\n defaults,\n checkEquality: false\n });\n value = nds;\n set(value);\n return value;\n };\n const _update = (fn) => _set(fn(value));\n const setDefaultOptions = (options) => {\n defaults = options;\n };\n const setOptions = (options) => {\n elevateNodesOnSelect = options.elevateNodesOnSelect ?? elevateNodesOnSelect;\n };\n _set(value);\n return {\n subscribe,\n set: _set,\n update: _update,\n setDefaultOptions,\n setOptions\n };\n};\nexport const createEdgesStore = (edges, connectionLookup, edgeLookup, defaultOptions) => {\n const { subscribe, set, update } = writable([]);\n let value = edges;\n let defaults = defaultOptions || {};\n const _set = (eds) => {\n const nextEdges = defaults ? eds.map((edge) => ({ ...defaults, ...edge })) : eds;\n updateConnectionLookup(connectionLookup, edgeLookup, nextEdges);\n value = nextEdges;\n set(value);\n };\n const _update = (fn) => _set(fn(value));\n const setDefaultOptions = (options) => {\n defaults = options;\n };\n _set(value);\n return {\n subscribe,\n set: _set,\n update: _update,\n setDefaultOptions\n };\n};\n","import { readable, writable } from 'svelte/store';\nimport { infiniteExtent, SelectionMode, ConnectionMode, ConnectionLineType, devWarn, adoptUserNodes, getViewportForBounds, updateConnectionLookup, initialConnection, getInternalNodesBounds } from '@xyflow/system';\nimport DefaultNode from '../components/nodes/DefaultNode.svelte';\nimport InputNode from '../components/nodes/InputNode.svelte';\nimport OutputNode from '../components/nodes/OutputNode.svelte';\nimport GroupNode from '../components/nodes/GroupNode.svelte';\nimport { BezierEdgeInternal, SmoothStepEdgeInternal, StraightEdgeInternal, StepEdgeInternal } from '../components/edges';\nimport { createNodesStore, createEdgesStore } from './utils';\nexport const initialNodeTypes = {\n input: InputNode,\n output: OutputNode,\n default: DefaultNode,\n group: GroupNode\n};\nexport const initialEdgeTypes = {\n straight: StraightEdgeInternal,\n smoothstep: SmoothStepEdgeInternal,\n default: BezierEdgeInternal,\n step: StepEdgeInternal\n};\nexport const getInitialStore = ({ nodes = [], edges = [], width, height, fitView, nodeOrigin, nodeExtent }) => {\n const nodeLookup = new Map();\n const parentLookup = new Map();\n const connectionLookup = new Map();\n const edgeLookup = new Map();\n const storeNodeOrigin = nodeOrigin ?? [0, 0];\n const storeNodeExtent = nodeExtent ?? infiniteExtent;\n adoptUserNodes(nodes, nodeLookup, parentLookup, {\n nodeExtent: storeNodeExtent,\n nodeOrigin: storeNodeOrigin,\n elevateNodesOnSelect: false,\n checkEquality: false\n });\n updateConnectionLookup(connectionLookup, edgeLookup, edges);\n let viewport = { x: 0, y: 0, zoom: 1 };\n if (fitView && width && height) {\n const bounds = getInternalNodesBounds(nodeLookup, {\n filter: (node) => !!((node.width || node.initialWidth) && (node.height || node.initialHeight))\n });\n viewport = getViewportForBounds(bounds, width, height, 0.5, 2, 0.1);\n }\n return {\n flowId: writable(null),\n nodes: createNodesStore(nodes, nodeLookup, parentLookup, storeNodeOrigin, storeNodeExtent),\n nodeLookup: readable(nodeLookup),\n parentLookup: readable(parentLookup),\n edgeLookup: readable(edgeLookup),\n visibleNodes: readable([]),\n edges: createEdgesStore(edges, connectionLookup, edgeLookup),\n visibleEdges: readable([]),\n connectionLookup: readable(connectionLookup),\n height: writable(500),\n width: writable(500),\n minZoom: writable(0.5),\n maxZoom: writable(2),\n nodeOrigin: writable(storeNodeOrigin),\n nodeDragThreshold: writable(1),\n nodeExtent: writable(storeNodeExtent),\n translateExtent: writable(infiniteExtent),\n autoPanOnNodeDrag: writable(true),\n autoPanOnConnect: writable(true),\n fitViewOnInit: writable(false),\n fitViewOnInitDone: writable(false),\n fitViewOptions: writable(undefined),\n panZoom: writable(null),\n snapGrid: writable(null),\n dragging: writable(false),\n selectionRect: writable(null),\n selectionKeyPressed: writable(false),\n multiselectionKeyPressed: writable(false),\n deleteKeyPressed: writable(false),\n panActivationKeyPressed: writable(false),\n zoomActivationKeyPressed: writable(false),\n selectionRectMode: writable(null),\n selectionMode: writable(SelectionMode.Partial),\n nodeTypes: writable(initialNodeTypes),\n edgeTypes: writable(initialEdgeTypes),\n viewport: writable(viewport),\n connectionMode: writable(ConnectionMode.Strict),\n domNode: writable(null),\n connection: readable(initialConnection),\n connectionLineType: writable(ConnectionLineType.Bezier),\n connectionRadius: writable(20),\n isValidConnection: writable(() => true),\n nodesDraggable: writable(true),\n nodesConnectable: writable(true),\n elementsSelectable: writable(true),\n selectNodesOnDrag: writable(true),\n markers: readable([]),\n defaultMarkerColor: writable('#b1b1b7'),\n lib: readable('svelte'),\n onlyRenderVisibleElements: writable(false),\n onerror: writable(devWarn),\n ondelete: writable(undefined),\n onedgecreate: writable(undefined),\n onconnect: writable(undefined),\n onconnectstart: writable(undefined),\n onconnectend: writable(undefined),\n onbeforedelete: writable(undefined),\n nodesInitialized: writable(false),\n edgesInitialized: writable(false),\n viewportInitialized: writable(false),\n initialized: readable(false)\n };\n};\n","import { derived } from 'svelte/store';\nimport { isEdgeVisible, getEdgePosition, getElevatedEdgeZIndex } from '@xyflow/system';\nexport function getVisibleEdges(store) {\n const visibleEdges = derived([\n store.edges,\n store.nodes,\n store.nodeLookup,\n store.onlyRenderVisibleElements,\n store.viewport,\n store.width,\n store.height\n ], ([edges, , nodeLookup, onlyRenderVisibleElements, viewport, width, height]) => {\n const visibleEdges = onlyRenderVisibleElements && width && height\n ? edges.filter((edge) => {\n const sourceNode = nodeLookup.get(edge.source);\n const targetNode = nodeLookup.get(edge.target);\n return (sourceNode &&\n targetNode &&\n isEdgeVisible({\n sourceNode,\n targetNode,\n width,\n height,\n transform: [viewport.x, viewport.y, viewport.zoom]\n }));\n })\n : edges;\n return visibleEdges;\n });\n return derived([visibleEdges, store.nodes, store.nodeLookup, store.connectionMode, store.onerror], ([visibleEdges, , nodeLookup, connectionMode, onerror]) => {\n const layoutedEdges = visibleEdges.reduce((res, edge) => {\n const sourceNode = nodeLookup.get(edge.source);\n const targetNode = nodeLookup.get(edge.target);\n if (!sourceNode || !targetNode) {\n return res;\n }\n const edgePosition = getEdgePosition({\n id: edge.id,\n sourceNode,\n targetNode,\n sourceHandle: edge.sourceHandle || null,\n targetHandle: edge.targetHandle || null,\n connectionMode,\n onError: onerror\n });\n if (edgePosition) {\n res.push({\n ...edge,\n zIndex: getElevatedEdgeZIndex({\n selected: edge.selected,\n zIndex: edge.zIndex,\n sourceNode,\n targetNode,\n elevateOnSelect: false\n }),\n ...edgePosition\n });\n }\n return res;\n }, []);\n return layoutedEdges;\n });\n}\n","import { derived } from 'svelte/store';\nimport { getNodesInside } from '@xyflow/system';\nexport function getVisibleNodes(store) {\n return derived([\n store.nodeLookup,\n store.onlyRenderVisibleElements,\n store.width,\n store.height,\n store.viewport,\n store.nodes\n ], ([nodeLookup, onlyRenderVisibleElements, width, height, viewport]) => {\n const transform = [viewport.x, viewport.y, viewport.zoom];\n return onlyRenderVisibleElements\n ? getNodesInside(nodeLookup, { x: 0, y: 0, width, height }, transform, true)\n : Array.from(nodeLookup.values());\n });\n}\n","import { getContext, setContext } from 'svelte';\nimport { derived, get, writable } from 'svelte/store';\nimport { createMarkerIds, fitView as fitViewSystem, getElementsToRemove, panBy as panBySystem, updateNodeInternals as updateNodeInternalsSystem, addEdge as addEdgeUtil, initialConnection, errorMessages, pointToRendererPoint, getFitViewNodes, updateAbsolutePositions, getDimensions } from '@xyflow/system';\nimport { initialEdgeTypes, initialNodeTypes, getInitialStore } from './initial-store';\nimport { syncNodeStores, syncEdgeStores, syncViewportStores } from './utils';\nimport { getVisibleEdges } from './visible-edges';\nimport { getVisibleNodes } from './visible-nodes';\nexport const key = Symbol();\nexport function createStore({ nodes, edges, width, height, fitView: fitViewOnCreate, nodeOrigin, nodeExtent }) {\n const store = getInitialStore({\n nodes,\n edges,\n width,\n height,\n fitView: fitViewOnCreate,\n nodeOrigin,\n nodeExtent\n });\n function setNodeTypes(nodeTypes) {\n store.nodeTypes.set({\n ...initialNodeTypes,\n ...nodeTypes\n });\n }\n function setEdgeTypes(edgeTypes) {\n store.edgeTypes.set({\n ...initialEdgeTypes,\n ...edgeTypes\n });\n }\n function addEdge(edgeParams) {\n const edges = get(store.edges);\n store.edges.set(addEdgeUtil(edgeParams, edges));\n }\n const updateNodePositions = (nodeDragItems, dragging = false) => {\n const nodeLookup = get(store.nodeLookup);\n for (const [id, dragItem] of nodeDragItems) {\n const node = nodeLookup.get(id)?.internals.userNode;\n if (!node) {\n continue;\n }\n node.position = dragItem.position;\n node.dragging = dragging;\n }\n store.nodes.update((nds) => nds);\n };\n function updateNodeInternals(updates) {\n const nodeLookup = get(store.nodeLookup);\n const parentLookup = get(store.parentLookup);\n const { changes, updatedInternals } = updateNodeInternalsSystem(updates, nodeLookup, get(store.parentLookup), get(store.domNode), get(store.nodeOrigin));\n if (!updatedInternals) {\n return;\n }\n updateAbsolutePositions(nodeLookup, parentLookup, { nodeOrigin, nodeExtent });\n if (!get(store.fitViewOnInitDone) && get(store.fitViewOnInit)) {\n const fitViewOptions = get(store.fitViewOptions);\n const fitViewOnInitDone = fitViewSync({\n ...fitViewOptions,\n nodes: fitViewOptions?.nodes\n });\n store.fitViewOnInitDone.set(fitViewOnInitDone);\n }\n for (const change of changes) {\n const node = nodeLookup.get(change.id)?.internals.userNode;\n if (!node) {\n continue;\n }\n switch (change.type) {\n case 'dimensions': {\n const measured = { ...node.measured, ...change.dimensions };\n if (change.setAttributes) {\n node.width = change.dimensions?.width ?? node.width;\n node.height = change.dimensions?.height ?? node.height;\n }\n node.measured = measured;\n break;\n }\n case 'position':\n node.position = change.position ?? node.position;\n break;\n }\n }\n store.nodes.update((nds) => nds);\n if (!get(store.nodesInitialized)) {\n store.nodesInitialized.set(true);\n }\n }\n function fitView(options) {\n const panZoom = get(store.panZoom);\n const domNode = get(store.domNode);\n if (!panZoom || !domNode) {\n return Promise.resolve(false);\n }\n const { width, height } = getDimensions(domNode);\n const fitViewNodes = getFitViewNodes(get(store.nodeLookup), options);\n return fitViewSystem({\n nodes: fitViewNodes,\n width,\n height,\n minZoom: get(store.minZoom),\n maxZoom: get(store.maxZoom),\n panZoom\n }, options);\n }\n function fitViewSync(options) {\n const panZoom = get(store.panZoom);\n if (!panZoom) {\n return false;\n }\n const fitViewNodes = getFitViewNodes(get(store.nodeLookup), options);\n fitViewSystem({\n nodes: fitViewNodes,\n width: get(store.width),\n height: get(store.height),\n minZoom: get(store.minZoom),\n maxZoom: get(store.maxZoom),\n panZoom\n }, options);\n return fitViewNodes.size > 0;\n }\n function zoomBy(factor, options) {\n const panZoom = get(store.panZoom);\n if (!panZoom) {\n return Promise.resolve(false);\n }\n return panZoom.scaleBy(factor, options);\n }\n function zoomIn(options) {\n return zoomBy(1.2, options);\n }\n function zoomOut(options) {\n return zoomBy(1 / 1.2, options);\n }\n function setMinZoom(minZoom) {\n const panZoom = get(store.panZoom);\n if (panZoom) {\n panZoom.setScaleExtent([minZoom, get(store.maxZoom)]);\n store.minZoom.set(minZoom);\n }\n }\n function setMaxZoom(maxZoom) {\n const panZoom = get(store.panZoom);\n if (panZoom) {\n panZoom.setScaleExtent([get(store.minZoom), maxZoom]);\n store.maxZoom.set(maxZoom);\n }\n }\n function setTranslateExtent(extent) {\n const panZoom = get(store.panZoom);\n if (panZoom) {\n panZoom.setTranslateExtent(extent);\n store.translateExtent.set(extent);\n }\n }\n function resetSelectedElements(elements) {\n let elementsChanged = false;\n elements.forEach((element) => {\n if (element.selected) {\n element.selected = false;\n elementsChanged = true;\n }\n });\n return elementsChanged;\n }\n function setPaneClickDistance(distance) {\n get(store.panZoom)?.setClickDistance(distance);\n }\n function unselectNodesAndEdges(params) {\n const resetNodes = resetSelectedElements(params?.nodes || get(store.nodes));\n if (resetNodes)\n store.nodes.set(get(store.nodes));\n const resetEdges = resetSelectedElements(params?.edges || get(store.edges));\n if (resetEdges)\n store.edges.set(get(store.edges));\n }\n store.deleteKeyPressed.subscribe(async (deleteKeyPressed) => {\n if (deleteKeyPressed) {\n const nodes = get(store.nodes);\n const edges = get(store.edges);\n const selectedNodes = nodes.filter((node) => node.selected);\n const selectedEdges = edges.filter((edge) => edge.selected);\n const { nodes: matchingNodes, edges: matchingEdges } = await getElementsToRemove({\n nodesToRemove: selectedNodes,\n edgesToRemove: selectedEdges,\n nodes,\n edges,\n onBeforeDelete: get(store.onbeforedelete)\n });\n if (matchingNodes.length || matchingEdges.length) {\n store.nodes.update((nds) => nds.filter((node) => !matchingNodes.some((mN) => mN.id === node.id)));\n store.edges.update((eds) => eds.filter((edge) => !matchingEdges.some((mE) => mE.id === edge.id)));\n get(store.ondelete)?.({\n nodes: matchingNodes,\n edges: matchingEdges\n });\n }\n }\n });\n function addSelectedNodes(ids) {\n const isMultiSelection = get(store.multiselectionKeyPressed);\n store.nodes.update((ns) => ns.map((node) => {\n const nodeWillBeSelected = ids.includes(node.id);\n const selected = isMultiSelection\n ? node.selected || nodeWillBeSelected\n : nodeWillBeSelected;\n // we need to mutate the node here in order to have the correct selected state in the drag handler\n node.selected = selected;\n return node;\n }));\n if (!isMultiSelection) {\n store.edges.update((es) => es.map((edge) => {\n edge.selected = false;\n return edge;\n }));\n }\n }\n function addSelectedEdges(ids) {\n const isMultiSelection = get(store.multiselectionKeyPressed);\n store.edges.update((edges) => edges.map((edge) => {\n const edgeWillBeSelected = ids.includes(edge.id);\n const selected = isMultiSelection\n ? edge.selected || edgeWillBeSelected\n : edgeWillBeSelected;\n edge.selected = selected;\n return edge;\n }));\n if (!isMultiSelection) {\n store.nodes.update((ns) => ns.map((node) => {\n node.selected = false;\n return node;\n }));\n }\n }\n function handleNodeSelection(id) {\n const node = get(store.nodes)?.find((n) => n.id === id);\n if (!node) {\n console.warn('012', errorMessages['error012'](id));\n return;\n }\n store.selectionRect.set(null);\n store.selectionRectMode.set(null);\n if (!node.selected) {\n addSelectedNodes([id]);\n }\n else if (node.selected && get(store.multiselectionKeyPressed)) {\n unselectNodesAndEdges({ nodes: [node], edges: [] });\n }\n }\n function panBy(delta) {\n const viewport = get(store.viewport);\n return panBySystem({\n delta,\n panZoom: get(store.panZoom),\n transform: [viewport.x, viewport.y, viewport.zoom],\n translateExtent: get(store.translateExtent),\n width: get(store.width),\n height: get(store.height)\n });\n }\n const _connection = writable(initialConnection);\n const updateConnection = (newConnection) => {\n _connection.set({ ...newConnection });\n };\n function cancelConnection() {\n _connection.set(initialConnection);\n }\n function reset() {\n store.fitViewOnInitDone.set(false);\n store.selectionRect.set(null);\n store.selectionRectMode.set(null);\n store.snapGrid.set(null);\n store.isValidConnection.set(() => true);\n unselectNodesAndEdges();\n cancelConnection();\n }\n return {\n // state\n ...store,\n // derived state\n visibleEdges: getVisibleEdges(store),\n visibleNodes: getVisibleNodes(store),\n connection: derived([_connection, store.viewport], ([connection, viewport]) => {\n return connection.inProgress\n ? {\n ...connection,\n to: pointToRendererPoint(connection.to, [viewport.x, viewport.y, viewport.zoom])\n }\n : { ...connection };\n }),\n markers: derived([store.edges, store.defaultMarkerColor, store.flowId], ([edges, defaultColor, id]) => createMarkerIds(edges, { defaultColor, id })),\n initialized: (() => {\n let initialized = false;\n const initialNodesLength = get(store.nodes).length;\n const initialEdgesLength = get(store.edges).length;\n return derived([store.nodesInitialized, store.edgesInitialized, store.viewportInitialized], ([nodesInitialized, edgesInitialized, viewportInitialized]) => {\n // If it was already initialized, return true from then on\n if (initialized)\n return initialized;\n // if it hasn't been initialised check if it's now\n if (initialNodesLength === 0) {\n initialized = viewportInitialized;\n }\n else if (initialEdgesLength === 0) {\n initialized = viewportInitialized && nodesInitialized;\n }\n else {\n initialized = viewportInitialized && nodesInitialized && edgesInitialized;\n }\n return initialized;\n });\n })(),\n // actions\n syncNodeStores: (nodes) => syncNodeStores(store.nodes, nodes),\n syncEdgeStores: (edges) => syncEdgeStores(store.edges, edges),\n syncViewport: (viewport) => syncViewportStores(store.panZoom, store.viewport, viewport),\n setNodeTypes,\n setEdgeTypes,\n addEdge,\n updateNodePositions,\n updateNodeInternals,\n zoomIn,\n zoomOut,\n fitView: (options) => fitView(options),\n setMinZoom,\n setMaxZoom,\n setTranslateExtent,\n setPaneClickDistance,\n unselectNodesAndEdges,\n addSelectedNodes,\n addSelectedEdges,\n handleNodeSelection,\n panBy,\n updateConnection,\n cancelConnection,\n reset\n };\n}\nexport function useStore() {\n const store = getContext(key);\n if (!store) {\n throw new Error('In order to use useStore you need to wrap your component in a ');\n }\n return store.getStore();\n}\nexport function createStoreContext({ nodes, edges, width, height, fitView, nodeOrigin, nodeExtent }) {\n const store = createStore({ nodes, edges, width, height, fitView, nodeOrigin, nodeExtent });\n setContext(key, {\n getStore: () => store\n });\n return store;\n}\n","import { PanOnScrollMode, XYPanZoom } from '@xyflow/system';\nexport default function zoom(domNode, params) {\n const { panZoom, minZoom, maxZoom, initialViewport, viewport, dragging, translateExtent, paneClickDistance } = params;\n const panZoomInstance = XYPanZoom({\n domNode,\n minZoom,\n maxZoom,\n translateExtent,\n viewport: initialViewport,\n paneClickDistance,\n onDraggingChange: dragging.set\n });\n const currentViewport = panZoomInstance.getViewport();\n viewport.set(currentViewport);\n panZoom.set(panZoomInstance);\n panZoomInstance.update(params);\n return {\n update(params) {\n panZoomInstance.update(params);\n }\n };\n}\n","\n\n\n \n
\n\n\n","\n\n\n\n\n\n\n \n\n\n\n","\n\n\n \n\n\n\n","import { get } from 'svelte/store';\nimport { XYDrag } from '@xyflow/system';\nexport default function drag(domNode, params) {\n const { store, onDrag, onDragStart, onDragStop, onNodeMouseDown } = params;\n const dragInstance = XYDrag({\n onDrag,\n onDragStart,\n onDragStop,\n onNodeMouseDown,\n getStoreItems: () => {\n const snapGrid = get(store.snapGrid);\n const vp = get(store.viewport);\n return {\n nodes: get(store.nodes),\n nodeLookup: get(store.nodeLookup),\n edges: get(store.edges),\n nodeExtent: get(store.nodeExtent),\n snapGrid: snapGrid ? snapGrid : [0, 0],\n snapToGrid: !!snapGrid,\n nodeOrigin: get(store.nodeOrigin),\n multiSelectionActive: get(store.multiselectionKeyPressed),\n domNode: get(store.domNode),\n transform: [vp.x, vp.y, vp.zoom],\n autoPanOnNodeDrag: get(store.autoPanOnNodeDrag),\n nodesDraggable: get(store.nodesDraggable),\n selectNodesOnDrag: get(store.selectNodesOnDrag),\n nodeDragThreshold: get(store.nodeDragThreshold),\n unselectNodesAndEdges: store.unselectNodesAndEdges,\n updateNodePositions: store.updateNodePositions,\n panBy: store.panBy\n };\n }\n });\n function updateDrag(domNode, params) {\n if (params.disabled) {\n dragInstance.destroy();\n return;\n }\n dragInstance.update({\n domNode,\n noDragClassName: params.noDragClass,\n handleSelector: params.handleSelector,\n nodeId: params.nodeId,\n isSelectable: params.isSelectable,\n nodeClickDistance: params.nodeClickDistance\n });\n }\n updateDrag(domNode, params);\n return {\n update(params) {\n updateDrag(domNode, params);\n },\n destroy() {\n dragInstance.destroy();\n }\n };\n}\n","export function getNodeInlineStyleDimensions({ width, height, initialWidth, initialHeight, measuredWidth, measuredHeight }) {\n if (measuredWidth === undefined && measuredHeight === undefined) {\n const styleWidth = width ?? initialWidth;\n const styleHeight = height ?? initialHeight;\n return {\n width: styleWidth ? `width:${styleWidth}px;` : '',\n height: styleHeight ? `height:${styleHeight}px;` : ''\n };\n }\n return {\n width: width ? `width:${width}px;` : '',\n height: height ? `height:${height}px;` : ''\n };\n}\n","\n\n\n\n\n\n{#if !hidden}\n {\n dispatchNodeEvent('nodedrag', { event, targetNode, nodes });\n },\n onDragStart: (event, _, targetNode, nodes) => {\n dispatchNodeEvent('nodedragstart', { event, targetNode, nodes });\n },\n onDragStop: (event, _, targetNode, nodes) => {\n dispatchNodeEvent('nodedragstop', { event, targetNode, nodes });\n },\n store\n }}\n bind:this={nodeRef}\n data-id={id}\n class={cc(['svelte-flow__node', `svelte-flow__node-${nodeType}`, className])}\n class:dragging\n class:selected\n class:draggable\n class:connectable\n class:selectable\n class:nopan={draggable}\n class:parent={isParent}\n style:z-index={zIndex}\n style:transform=\"translate({positionX}px, {positionY}px)\"\n style:visibility={initialized ? 'visible' : 'hidden'}\n style=\"{style ?? ''};{inlineStyleDimensions.width}{inlineStyleDimensions.height}\"\n on:click={onSelectNodeHandler}\n on:mouseenter={(event) => dispatchNodeEvent('nodemouseenter', { node, event })}\n on:mouseleave={(event) => dispatchNodeEvent('nodemouseleave', { node, event })}\n on:mousemove={(event) => dispatchNodeEvent('nodemousemove', { node, event })}\n on:contextmenu={(event) => dispatchNodeEvent('nodecontextmenu', { node, event })}\n >\n \n \n{/if}\n","\n\n
\n {#each $visibleNodes as node (node.id)}\n
\n\n\n","\n\n\n\n\n\n{#if !hidden}\n \n {\n onMouseEvent(e, 'edgecontextmenu');\n }}\n on:mouseenter={(e) => {\n onMouseEvent(e, 'edgemouseenter');\n }}\n on:mouseleave={(e) => {\n onMouseEvent(e, 'edgemouseleave');\n }}\n aria-label={ariaLabel === null\n ? undefined\n : ariaLabel\n ? ariaLabel\n : `Edge from ${source} to ${target}`}\n role=\"img\"\n >\n \n \n \n{/if}\n","\n","\n\n\n {#each $markers as marker (marker.id)}\n \n {/each}\n\n","\n\n\n {#if type === MarkerType.Arrow}\n \n {:else if type === MarkerType.ArrowClosed}\n \n {/if}\n\n","\n\n
\n \n \n \n\n {#each $visibleEdges as edge (edge.id)}\n
\n","\n\n{#if isVisible}\n \n{/if}\n\n\n","\n\n\n","\n\n{#if $selectionRectMode === 'nodes' && bounds && isNumeric(bounds.x) && isNumeric(bounds.y)}\n {\n dispatch('nodedrag', { event, targetNode: null, nodes });\n },\n onDragStart: (event, _, __, nodes) => {\n dispatch('nodedragstart', { event, targetNode: null, nodes });\n },\n onDragStop: (event, _, __, nodes) => {\n dispatch('nodedragstop', { event, targetNode: null, nodes });\n }\n }}\n on:contextmenu={onContextMenu}\n on:click={onClick}\n role=\"button\"\n tabindex=\"-1\"\n on:keyup={() => {}}\n >\n \n \n{/if}\n\n\n","/**\n * Listen for keyboard event and trigger `shortcut` {@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent | CustomEvent }\n * @example Typical usage\n *\n * ```svelte\n * \n *\n * \n * ```\n *\n *\n *\n * As with any svelte action, `shortcut` should be use with element and not component.\n *\n * ```html\n * <-- correct usage-->\n *
\n *\n * <-- incorrect usage-->\n * \n * ```\n *\n * You can either:\n *\n * - pass multiple callbacks to their associated triggers, or\n *\n * - pass one single handler to the `on:shortcut` event, in which case you should\n * provide an ID to each trigger to be able to distinguish what trigger was activated\n * in the event handler.\n *\n * Either way, only use `callback` or `on:shortcut` and not both to\n * avoid handler duplication.\n * @param {HTMLElement} node - HTMLElement to add event listener to\n * @param {import('./public').ShortcutParameter} param - svelte action parameters\n * @returns {import('./public').ShortcutActionReturn}\n */\nexport function shortcut(node, param) {\n\tlet { enabled = true, trigger, type = 'keydown' } = param;\n\n\t/**\n\t * @param {KeyboardEvent} event\n\t */\n\tfunction handler(event) {\n\t\tconst normalizedTriggers = Array.isArray(trigger) ? trigger : [trigger];\n\t\t/** @type {Record} */\n\t\tconst modifiedMap = {\n\t\t\talt: event.altKey,\n\t\t\tctrl: event.ctrlKey,\n\t\t\tshift: event.shiftKey,\n\t\t\tmeta: event.metaKey,\n\t\t};\n\t\tfor (const trigger of normalizedTriggers) {\n\t\t\tconst mergedTrigger = {\n\t\t\t\tmodifier: [],\n\t\t\t\tpreventDefault: false,\n\t\t\t\tenabled: true,\n\t\t\t\t...trigger,\n\t\t\t};\n\t\t\tconst { modifier, key, callback, preventDefault, enabled: triggerEnabled } = mergedTrigger;\n\t\t\tif (triggerEnabled) {\n\t\t\t\tif (modifier.length) {\n\t\t\t\t\tconst modifierDefs = (Array.isArray(modifier) ? modifier : [modifier]).map((def) =>\n\t\t\t\t\t\ttypeof def === 'string' ? [def] : def,\n\t\t\t\t\t);\n\t\t\t\t\tconst modified = modifierDefs.some((def) =>\n\t\t\t\t\t\tdef.every((modifier) => modifiedMap[modifier]),\n\t\t\t\t\t);\n\t\t\t\t\tif (!modified) continue;\n\t\t\t\t}\n\t\t\t\tif (event.key === key) {\n\t\t\t\t\tif (preventDefault) event.preventDefault();\n\t\t\t\t\t/** @type {import('./public').ShortcutEventDetail} */\n\t\t\t\t\tconst detail = {\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\ttrigger: mergedTrigger,\n\t\t\t\t\t\toriginalEvent: event,\n\t\t\t\t\t};\n\t\t\t\t\tnode.dispatchEvent(new CustomEvent('shortcut', { detail }));\n\t\t\t\t\tcallback?.(detail);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (enabled) node.addEventListener(type, handler);\n\n\treturn {\n\t\tupdate: (update) => {\n\t\t\tconst { enabled: newEnabled = true, type: newType = 'keydown' } = update;\n\n\t\t\tif (enabled && (!newEnabled || type !== newType)) {\n\t\t\t\tnode.removeEventListener(type, handler);\n\t\t\t} else if (!enabled && newEnabled) {\n\t\t\t\tnode.addEventListener(newType, handler);\n\t\t\t}\n\n\t\t\tenabled = newEnabled;\n\t\t\ttype = newType;\n\t\t\ttrigger = update.trigger;\n\t\t},\n\t\tdestroy: () => {\n\t\t\tnode.removeEventListener(type, handler);\n\t\t},\n\t};\n}\n","\n\n selectionKeyPressed.set(true)),\n type: 'keydown'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(selectionKey, () => selectionKeyPressed.set(false)),\n type: 'keyup'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(multiSelectionKey, () => multiselectionKeyPressed.set(true)),\n type: 'keydown'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(multiSelectionKey, () => multiselectionKeyPressed.set(false)),\n type: 'keyup'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(deleteKey, (detail) => {\n const isModifierKey =\n detail.originalEvent.ctrlKey ||\n detail.originalEvent.metaKey ||\n detail.originalEvent.shiftKey;\n if (!isModifierKey && !isInputDOMNode(detail.originalEvent)) {\n deleteKeyPressed.set(true);\n }\n }),\n type: 'keydown'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(deleteKey, () => deleteKeyPressed.set(false)),\n type: 'keyup'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(panActivationKey, () => panActivationKeyPressed.set(true)),\n type: 'keydown'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(panActivationKey, () => panActivationKeyPressed.set(false)),\n type: 'keyup'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(zoomActivationKey, () => zoomActivationKeyPressed.set(true)),\n type: 'keydown'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(zoomActivationKey, () => zoomActivationKeyPressed.set(false)),\n type: 'keyup'\n }}\n/>\n","\n\n{#if $connection.inProgress}\n \n \n \n \n {#if !isCustomComponent}\n \n {/if}\n \n \n{/if}\n","\n\n\n \n
\n","\n\n{#if !proOptions?.hideAttribution}\n \n \n Svelte Flow\n \n \n{/if}\n","// this is helper function for updating the store\n// for props where we need to call a specific store action\nexport function updateStore(store, { nodeTypes, edgeTypes, minZoom, maxZoom, translateExtent, paneClickDistance }) {\n if (nodeTypes !== undefined) {\n store.setNodeTypes(nodeTypes);\n }\n if (edgeTypes !== undefined) {\n store.setEdgeTypes(edgeTypes);\n }\n if (minZoom !== undefined) {\n store.setMinZoom(minZoom);\n }\n if (maxZoom !== undefined) {\n store.setMaxZoom(maxZoom);\n }\n if (translateExtent !== undefined) {\n store.setTranslateExtent(translateExtent);\n }\n if (paneClickDistance !== undefined) {\n store.setPaneClickDistance(paneClickDistance);\n }\n}\nconst getKeys = (obj) => Object.keys(obj);\nexport function updateStoreByKeys(store, keys) {\n getKeys(keys).forEach((prop) => {\n const update = keys[prop];\n if (update !== undefined) {\n // @ts-expect-error @todo: how to fix this TS error?\n store[prop].set(update);\n }\n });\n}\n","import { readable } from 'svelte/store';\nfunction getMediaQuery() {\n if (typeof window === 'undefined' || !window.matchMedia) {\n return null;\n }\n return window.matchMedia('(prefers-color-scheme: dark)');\n}\n/**\n * Hook for receiving the current color mode class 'dark' or 'light'.\n *\n * @internal\n * @param colorMode - The color mode to use ('dark', 'light' or 'system')\n */\nexport function useColorModeClass(colorMode = 'light') {\n const colorModeClass = readable('light', (set) => {\n if (colorMode !== 'system') {\n set(colorMode);\n return;\n }\n const mediaQuery = getMediaQuery();\n const updateColorModeClass = () => set(mediaQuery?.matches ? 'dark' : 'light');\n set(mediaQuery?.matches ? 'dark' : 'light');\n mediaQuery?.addEventListener('change', updateColorModeClass);\n return () => {\n mediaQuery?.removeEventListener('change', updateColorModeClass);\n };\n });\n return colorModeClass;\n}\n","\n\n\n \n \n \n \n \n \n \n \n
\n
\n \n \n \n \n \n \n \n \n
\n\n\n","\n\n\n","\n\n\n \n\n","\n\n\n \n {#if showZoom}\n \n \n \n \n \n \n {/if}\n {#if showFitView}\n \n \n \n {/if}\n {#if showLock}\n \n {#if isInteractive}{:else}{/if}\n \n {/if}\n \n \n\n","export var BackgroundVariant;\n(function (BackgroundVariant) {\n BackgroundVariant[\"Lines\"] = \"lines\";\n BackgroundVariant[\"Dots\"] = \"dots\";\n BackgroundVariant[\"Cross\"] = \"cross\";\n})(BackgroundVariant || (BackgroundVariant = {}));\n","\n\n\n","\n\n\n","\n\n\n\n\n \n {#if isDots}\n \n {:else}\n \n {/if}\n \n \n\n\n\n","\n\n\n","import { get } from 'svelte/store';\nimport { XYMinimap } from '@xyflow/system';\nexport default function interactive(domNode, params) {\n const minimap = XYMinimap({\n domNode,\n panZoom: params.panZoom,\n getTransform: () => {\n const viewport = get(params.viewport);\n return [viewport.x, viewport.y, viewport.zoom];\n },\n getViewScale: params.getViewScale\n });\n function update(params) {\n minimap.update({\n translateExtent: params.translateExtent,\n width: params.width,\n height: params.height,\n inversePan: params.inversePan,\n zoomStep: params.zoomStep,\n pannable: params.pannable,\n zoomable: params.zoomable\n });\n }\n return {\n update,\n destroy() {\n minimap.destroy();\n }\n };\n}\n","\n\n\n\n\n {#if $panZoom}\n \n {#if ariaLabel}{ariaLabel}{/if}\n\n {#each $nodes as userNode (userNode.id)}\n {@const node = $nodeLookup.get(userNode.id)}\n {#if node && nodeHasDimensions(node)}\n {@const nodeDimesions = getNodeDimensions(node)}\n \n {/if}\n {/each}\n \n \n {/if}\n\n","import { isNodeBase, isEdgeBase } from '@xyflow/system';\n/**\n * Test whether an object is useable as a Node\n * @public\n * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true\n * @param element - The element to test\n * @returns A boolean indicating whether the element is an Node\n */\nexport const isNode = (element) => isNodeBase(element);\n/**\n * Test whether an object is useable as an Edge\n * @public\n * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true\n * @param element - The element to test\n * @returns A boolean indicating whether the element is an Edge\n */\nexport const isEdge = (element) => isEdgeBase(element);\n","import { get } from 'svelte/store';\nimport { getOverlappingArea, isRectObject, nodeToRect, pointToRendererPoint, getViewportForBounds, getElementsToRemove, rendererPointToPoint, evaluateAbsolutePosition, getNodesBounds } from '@xyflow/system';\nimport { useStore } from '../store';\nimport { isNode } from '../utils';\n/**\n * Hook for accessing the ReactFlow instance.\n *\n * @public\n *\n * @returns helper functions\n */\nexport function useSvelteFlow() {\n const { zoomIn, zoomOut, fitView, onbeforedelete, snapGrid, viewport, width, height, minZoom, maxZoom, panZoom, nodes, edges, domNode, nodeLookup, nodeOrigin, edgeLookup, connectionLookup } = useStore();\n const getNodeRect = (node) => {\n const $nodeLookup = get(nodeLookup);\n const nodeToUse = isNode(node) ? node : $nodeLookup.get(node.id);\n const position = nodeToUse.parentId\n ? evaluateAbsolutePosition(nodeToUse.position, nodeToUse.measured, nodeToUse.parentId, $nodeLookup, get(nodeOrigin))\n : nodeToUse.position;\n const nodeWithPosition = {\n ...nodeToUse,\n position,\n width: nodeToUse.measured?.width ?? nodeToUse.width,\n height: nodeToUse.measured?.height ?? nodeToUse.height\n };\n return nodeToRect(nodeWithPosition);\n };\n const updateNode = (id, nodeUpdate, options = { replace: false }) => {\n const node = get(nodeLookup).get(id)?.internals.userNode;\n if (!node) {\n return;\n }\n const nextNode = typeof nodeUpdate === 'function' ? nodeUpdate(node) : nodeUpdate;\n if (options.replace) {\n nodes.update((nds) => nds.map((node) => {\n if (node.id === id) {\n return isNode(nextNode) ? nextNode : { ...node, ...nextNode };\n }\n return node;\n }));\n }\n else {\n Object.assign(node, nextNode);\n nodes.update((nds) => nds);\n }\n };\n const getInternalNode = (id) => get(nodeLookup).get(id);\n return {\n zoomIn,\n zoomOut,\n getInternalNode,\n getNode: (id) => getInternalNode(id)?.internals.userNode,\n getNodes: (ids) => (ids === undefined ? get(nodes) : getElements(get(nodeLookup), ids)),\n getEdge: (id) => get(edgeLookup).get(id),\n getEdges: (ids) => (ids === undefined ? get(edges) : getElements(get(edgeLookup), ids)),\n setZoom: (zoomLevel, options) => {\n const currentPanZoom = get(panZoom);\n return currentPanZoom\n ? currentPanZoom.scaleTo(zoomLevel, { duration: options?.duration })\n : Promise.resolve(false);\n },\n getZoom: () => get(viewport).zoom,\n setViewport: async (nextViewport, options) => {\n const currentViewport = get(viewport);\n const currentPanZoom = get(panZoom);\n if (!currentPanZoom) {\n return Promise.resolve(false);\n }\n await currentPanZoom.setViewport({\n x: nextViewport.x ?? currentViewport.x,\n y: nextViewport.y ?? currentViewport.y,\n zoom: nextViewport.zoom ?? currentViewport.zoom\n }, { duration: options?.duration });\n return Promise.resolve(true);\n },\n getViewport: () => get(viewport),\n setCenter: async (x, y, options) => {\n const nextZoom = typeof options?.zoom !== 'undefined' ? options.zoom : get(maxZoom);\n const currentPanZoom = get(panZoom);\n if (!currentPanZoom) {\n return Promise.resolve(false);\n }\n await currentPanZoom.setViewport({\n x: get(width) / 2 - x * nextZoom,\n y: get(height) / 2 - y * nextZoom,\n zoom: nextZoom\n }, { duration: options?.duration });\n return Promise.resolve(true);\n },\n fitView,\n fitBounds: async (bounds, options) => {\n const currentPanZoom = get(panZoom);\n if (!currentPanZoom) {\n return Promise.resolve(false);\n }\n const viewport = getViewportForBounds(bounds, get(width), get(height), get(minZoom), get(maxZoom), options?.padding ?? 0.1);\n await currentPanZoom.setViewport(viewport, { duration: options?.duration });\n return Promise.resolve(true);\n },\n getIntersectingNodes: (nodeOrRect, partially = true, nodesToIntersect) => {\n const isRect = isRectObject(nodeOrRect);\n const nodeRect = isRect ? nodeOrRect : getNodeRect(nodeOrRect);\n if (!nodeRect) {\n return [];\n }\n return (nodesToIntersect || get(nodes)).filter((n) => {\n const internalNode = get(nodeLookup).get(n.id);\n if (!internalNode || (!isRect && n.id === nodeOrRect.id)) {\n return false;\n }\n const currNodeRect = nodeToRect(internalNode);\n const overlappingArea = getOverlappingArea(currNodeRect, nodeRect);\n const partiallyVisible = partially && overlappingArea > 0;\n return partiallyVisible || overlappingArea >= nodeRect.width * nodeRect.height;\n });\n },\n isNodeIntersecting: (nodeOrRect, area, partially = true) => {\n const isRect = isRectObject(nodeOrRect);\n const nodeRect = isRect ? nodeOrRect : getNodeRect(nodeOrRect);\n if (!nodeRect) {\n return false;\n }\n const overlappingArea = getOverlappingArea(nodeRect, area);\n const partiallyVisible = partially && overlappingArea > 0;\n return partiallyVisible || overlappingArea >= nodeRect.width * nodeRect.height;\n },\n deleteElements: async ({ nodes: nodesToRemove = [], edges: edgesToRemove = [] }) => {\n const { nodes: matchingNodes, edges: matchingEdges } = await getElementsToRemove({\n nodesToRemove,\n edgesToRemove,\n nodes: get(nodes),\n edges: get(edges),\n onBeforeDelete: get(onbeforedelete)\n });\n if (matchingNodes) {\n nodes.update((nds) => nds.filter((node) => !matchingNodes.some(({ id }) => id === node.id)));\n }\n if (matchingEdges) {\n edges.update((eds) => eds.filter((edge) => !matchingEdges.some(({ id }) => id === edge.id)));\n }\n return {\n deletedNodes: matchingNodes,\n deletedEdges: matchingEdges\n };\n },\n screenToFlowPosition: (position, options = { snapToGrid: true }) => {\n const _domNode = get(domNode);\n if (!_domNode) {\n return position;\n }\n const _snapGrid = options.snapToGrid ? get(snapGrid) : false;\n const { x, y, zoom } = get(viewport);\n const { x: domX, y: domY } = _domNode.getBoundingClientRect();\n const correctedPosition = {\n x: position.x - domX,\n y: position.y - domY\n };\n return pointToRendererPoint(correctedPosition, [x, y, zoom], _snapGrid !== null, _snapGrid || [1, 1]);\n },\n /**\n *\n * @param position\n * @returns\n */\n flowToScreenPosition: (position) => {\n const _domNode = get(domNode);\n if (!_domNode) {\n return position;\n }\n const { x, y, zoom } = get(viewport);\n const { x: domX, y: domY } = _domNode.getBoundingClientRect();\n const rendererPosition = rendererPointToPoint(position, [x, y, zoom]);\n return {\n x: rendererPosition.x + domX,\n y: rendererPosition.y + domY\n };\n },\n toObject: () => {\n return {\n nodes: get(nodes).map((node) => ({\n ...node,\n // we want to make sure that changes to the nodes object that gets returned by toObject\n // do not affect the nodes object\n position: { ...node.position },\n data: { ...node.data }\n })),\n edges: get(edges).map((edge) => ({ ...edge })),\n viewport: { ...get(viewport) }\n };\n },\n updateNode,\n updateNodeData: (id, dataUpdate, options) => {\n const node = get(nodeLookup).get(id)?.internals.userNode;\n if (!node) {\n return;\n }\n const nextData = typeof dataUpdate === 'function' ? dataUpdate(node) : dataUpdate;\n node.data = options?.replace ? nextData : { ...node.data, ...nextData };\n nodes.update((nds) => nds);\n },\n getNodesBounds: (nodes) => {\n const _nodeLookup = get(nodeLookup);\n const _nodeOrigin = get(nodeOrigin);\n return getNodesBounds(nodes, { nodeLookup: _nodeLookup, nodeOrigin: _nodeOrigin });\n },\n getHandleConnections: ({ type, id, nodeId }) => Array.from(get(connectionLookup)\n .get(`${nodeId}-${type}-${id ?? null}`)\n ?.values() ?? []),\n viewport\n };\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction getElements(lookup, ids) {\n const result = [];\n for (const id of ids) {\n const item = lookup.get(id);\n if (item) {\n const element = 'internals' in item ? item.internals?.userNode : item;\n result.push(element);\n }\n }\n return result;\n}\n","\n\n{#if $domNode && isActive && toolbarNodes}\n `${acc}${node.id} `, '').trim()}\n class=\"svelte-flow__node-toolbar\"\n use:portal={{ domNode: $domNode }}\n style:position=\"absolute\"\n style:transform\n style:z-index={zIndex}\n >\n \n
\n{/if}\n","import { derived } from 'svelte/store';\nimport { shallowNodeData } from '@xyflow/system';\nimport { useStore } from '../store';\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function useNodesData(nodeIds) {\n const { nodes, nodeLookup } = useStore();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let prevNodesData = [];\n let initialRun = true;\n return derived([nodes, nodeLookup], ([, nodeLookup], set) => {\n const nextNodesData = [];\n const isArrayOfIds = Array.isArray(nodeIds);\n const _nodeIds = isArrayOfIds ? nodeIds : [nodeIds];\n for (const nodeId of _nodeIds) {\n const node = nodeLookup.get(nodeId)?.internals.userNode;\n if (node) {\n nextNodesData.push({\n id: node.id,\n type: node.type,\n data: node.data\n });\n }\n }\n if (!shallowNodeData(nextNodesData, prevNodesData) || initialRun) {\n prevNodesData = nextNodesData;\n set(isArrayOfIds ? nextNodesData : nextNodesData[0] ?? null);\n initialRun = false;\n }\n });\n}\n","export const componentName = 'tinyflow-component';\n","import { type useSvelteFlow } from '@xyflow/svelte';\nimport { componentName } from './consts';\n\nexport type TinyflowData = Partial['toObject']>>;\ntype FlowInstance = ReturnType;\n\nexport type Item = {\n value: number | string;\n label: string;\n children?: Item[];\n};\n\nexport type TinyflowOptions = {\n element: string | Element;\n data?: TinyflowData;\n provider?: {\n llm?: () => Item[] | Promise;\n knowledge?: () => Item[] | Promise;\n };\n};\n\nexport class Tinyflow {\n private options!: TinyflowOptions;\n private rootEl!: Element;\n private svelteFlowInstance!: FlowInstance;\n\n constructor(options: TinyflowOptions) {\n if (typeof options.element !== 'string' && !(options.element instanceof Element)) {\n throw new Error('element must be a string or Element');\n }\n this._setOptions(options);\n this._init();\n }\n\n private _init() {\n if (typeof this.options.element === 'string') {\n this.rootEl = document.querySelector(this.options.element)!;\n if (!this.rootEl) {\n throw new Error(\n `element not found by document.querySelector('${this.options.element}')`\n );\n }\n } else if (this.options.element instanceof Element) {\n this.rootEl = this.options.element;\n } else {\n throw new Error('element must be a string or Element');\n }\n\n const tinyflowEl = document.createElement(componentName) as HTMLElement & {\n options: TinyflowOptions;\n onInit: (svelteFlowInstance: FlowInstance) => void;\n };\n tinyflowEl.style.display = 'block';\n tinyflowEl.style.width = '100%';\n tinyflowEl.style.height = '100%';\n tinyflowEl.classList.add('tf-theme-light');\n\n tinyflowEl.options = this.options;\n tinyflowEl.onInit = (svelteFlowInstance: FlowInstance) => {\n this.svelteFlowInstance = svelteFlowInstance;\n };\n\n this.rootEl.appendChild(tinyflowEl);\n }\n\n private _setOptions(options: TinyflowOptions) {\n this.options = {\n ...options\n };\n }\n\n getOptions() {\n return this.options;\n }\n\n getData() {\n return this.svelteFlowInstance.toObject();\n }\n\n setData(data: TinyflowData) {\n this.options.data = data;\n\n const tinyflowEl = document.createElement(componentName) as HTMLElement & {\n options: TinyflowOptions;\n onInit: (svelteFlowInstance: FlowInstance) => void;\n };\n tinyflowEl.style.display = 'block';\n tinyflowEl.style.width = '100%';\n tinyflowEl.style.height = '100%';\n tinyflowEl.classList.add('tf-theme-light');\n\n tinyflowEl.options = this.options;\n tinyflowEl.onInit = (svelteFlowInstance: FlowInstance) => {\n this.svelteFlowInstance = svelteFlowInstance;\n };\n\n this.destroy();\n this.rootEl.appendChild(tinyflowEl);\n }\n\n destroy() {\n while (this.rootEl.firstChild) {\n this.rootEl.removeChild(this.rootEl.firstChild);\n }\n }\n}\n","import { writable } from 'svelte/store';\nimport { type Edge, type Node, type Viewport } from '@xyflow/svelte';\n\nconst createStore = () => {\n const nodesInternal = writable([] as Node[]);\n const edgesInternal = writable([] as Edge[]);\n const viewport = writable({ x: 250, y: 100, zoom: 1 } as Viewport);\n\n return {\n nodes: nodesInternal,\n edges: edgesInternal,\n viewport,\n init: (nodes: Node[], edges: Edge[]) => {\n nodesInternal.set(nodes);\n edgesInternal.set(edges);\n },\n addNode: (node: Node) => {\n nodesInternal.update((nodes) => [...nodes, node]);\n },\n removeNode: (id: string) => {\n nodesInternal.update((nodes) => nodes.filter((node) => node.id !== id));\n },\n updateNode: (id: string, node: Node) => {\n nodesInternal.update((nodes) => nodes.map((n) => (n.id === id ? node : n)));\n },\n updateNodeData: (id: string, data: Node['data']) => {\n nodesInternal.update((nodes) =>\n nodes.map((n) => (n.id === id ? { ...n, data: { ...n.data, ...data } } : n))\n );\n },\n selectNodeOnly: (id: string) => {\n nodesInternal.update((nodes) =>\n nodes.map((n) =>\n n.id === id ? { ...n, selected: true } : { ...n, selected: false }\n )\n );\n },\n addEdge: (edge: Edge) => {\n edgesInternal.update((edges) => [...edges, edge]);\n },\n removeEdge: (id: string) => {\n edgesInternal.update((edges) => edges.filter((edge) => edge.id !== id));\n },\n updateEdge: (id: string, edge: Edge) => {\n edgesInternal.update((edges) => edges.map((e) => (e.id === id ? edge : e)));\n },\n updateEdgeData: (id: string, data: Edge['data']) => {\n edgesInternal.update((edges) => edges.map((e) => (e.id === id ? { ...e, data } : e)));\n }\n };\n};\n\nexport const store = createStore();\n","\n\n","\n\n","\n\n","\n\n","\n
\n {#each items as item, index}\n
handlerOnChange(item,index)}\n onkeydown={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handlerOnChange(item,index);\n }\n }}\n >\n {#if typeof item.label === 'string'}\n {item.label}\n {:else }\n {@render item.label?.()}\n {/if}\n
\n {/each}\n
\n","\n
\n {#each items as item, index}\n
\n
handlerOnChange(item)}\n onkeydown={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handlerOnChange(item);\n }\n }}\n >\n {#if item.icon}\n \n \n \n {/if}\n\n \n\n \n \n \n
\n {#if item.description}\n
\n \n
\n {/if}\n\n {#if activeKeys.includes(item.key)}\n
\n \n
\n {/if}\n
\n {/each}\n
\n\n\n\n","\n\n\n{#if typeof target === 'function'}\n {@render target?.()}\n{:else }\n {@html target}\n{/if}\n\n","\n\n\n{#snippet selectItems(items: Item[])}\n {#each items as item, index (`${index}_${item.value}`)}\n \n {#if (item.children && item.children.length > 0 && (expandAll || expandValue.includes(item.value)))}\n
\n {@render selectItems(item.children)}\n
\n {/if}\n {/each}\n\n{/snippet}\n\n\n
\n \n \n\n {#snippet floating()}\n
\n {@render selectItems(items)}\n
\n {/snippet}\n
\n
\n","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nconst oppositeAlignmentMap = {\n start: 'end',\n end: 'start'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);\n}\nfunction getSideList(side, isStart, rtl) {\n const lr = ['left', 'right'];\n const rl = ['right', 'left'];\n const tb = ['top', 'bottom'];\n const bt = ['bottom', 'top'];\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rl : lr;\n return isStart ? lr : rl;\n case 'left':\n case 'right':\n return isStart ? tb : bt;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case 'start':\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case 'end':\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const validMiddleware = middleware.filter(Boolean);\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let middlewareData = {};\n let resetCount = 0;\n for (let i = 0; i < validMiddleware.length; i++) {\n const {\n name,\n fn\n } = validMiddleware[i];\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData = {\n ...middlewareData,\n [name]: {\n ...middlewareData[name],\n ...data\n }\n };\n if (reset && resetCount <= 50) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min$1 = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min$1, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min, mainAxisCoord, max);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min, crossAxisCoord, max);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: 0,\n crossAxis: 0,\n ...rawOffset\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = ['top', 'left'].includes(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n var _state$middlewareData, _state$middlewareData2;\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const noShift = !state.middlewareData.shift;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {\n availableWidth = maximumClippingWidth;\n }\n if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {\n availableHeight = maximumClippingHeight;\n }\n if (noShift && !alignment) {\n const xMin = max(overflow.left, 0);\n const xMax = max(overflow.right, 0);\n const yMin = max(overflow.top, 0);\n const yMax = max(overflow.bottom, 0);\n if (isYAxis) {\n availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n } else {\n availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);\n}\nfunction isTableElement(element) {\n return ['table', 'td', 'th'].includes(getNodeName(element));\n}\nfunction isTopLayer(element) {\n return [':popover-open', ':modal'].some(selector => {\n try {\n return element.matches(selector);\n } catch (e) {\n return false;\n }\n });\n}\nfunction isContainingBlock(elementOrCss) {\n const webkit = isWebKit();\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (typeof CSS === 'undefined' || !CSS.supports) return false;\n return CSS.supports('-webkit-backdrop-filter', 'none');\n}\nfunction isLastTraversableNode(node) {\n return ['html', 'body', '#document'].includes(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n }\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","import { rectToClientRect, detectOverflow as detectOverflow$1, offset as offset$1, autoPlacement as autoPlacement$1, shift as shift$1, flip as flip$1, size as size$1, hide as hide$1, arrow as arrow$1, inline as inline$1, limitShift as limitShift$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\n// If has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {\n if (ignoreScrollbarX === void 0) {\n ignoreScrollbarX = false;\n }\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :\n // RTL scrollbar.\n getWindowScrollBarX(documentElement, htmlRect));\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isHTMLElement(offsetParent)) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport') {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration.\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstClippingAncestor = clippingAncestors[0];\n const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n return {\n width: clippingRect.right - clippingRect.left,\n height: clippingRect.bottom - clippingRect.top,\n x: clippingRect.left,\n y: clippingRect.top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n // If the scrollbar appears on the left (e.g. RTL systems). Use\n // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n\n // Firefox returns the element as the offsetParent if it's non-static,\n // while Chrome and Safari return the element. The element must\n // be used to perform the correct calculations even if the element is\n // non-static.\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\nfunction rectsAreEqual(a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const elementRectForRootMargin = element.getBoundingClientRect();\n const {\n left,\n top,\n width,\n height\n } = elementRectForRootMargin;\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped, the ratio is 0. Throttle the refresh\n // to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n // It's possible that even though the ratio is reported as 1, the\n // element is not actually fully within the IntersectionObserver's root\n // area anymore. This can happen under performance constraints. This may\n // be a bug in the browser's IntersectionObserver implementation. To\n // work around this, we compare the element's bounding rect now with\n // what it was at the time we created the IntersectionObserver. If they\n // are not equal then the element moved, so we refresh.\n refresh();\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle