irr-gh 0.1.25 → 0.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/irr-gh.css +1 -1
- package/dist/irr-gh.js +79 -19
- package/dist/irr-gh.umd.cjs +2 -2
- package/package.json +1 -1
package/dist/irr-gh.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.irrigation-config-panel[data-v-4ab4bf56]{position:absolute;top:12px;right:12px;width:300px;background:#fff;border-radius:8px;box-shadow:0 2px 12px #00000026;z-index:10;border:1px solid rgba(0,0,0,.1);max-height:calc(100% - 24px);display:flex;flex-direction:column}.irrigation-config-panel__header[data-v-4ab4bf56]{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid #f0f0f0}.irrigation-config-panel__title[data-v-4ab4bf56]{font-size:14px;font-weight:600;color:#262626}.irrigation-config-panel__close[data-v-4ab4bf56]{width:24px;height:24px;display:flex;align-items:center;justify-content:center;border:none;background:transparent;cursor:pointer;border-radius:4px;color:#8c8c8c;transition:all .2s}.irrigation-config-panel__close[data-v-4ab4bf56]:hover{background:#f5f5f5;color:#262626}.irrigation-config-panel__tabs[data-v-4ab4bf56]{display:flex;border-bottom:1px solid #f0f0f0}.irrigation-config-panel__tab[data-v-4ab4bf56]{flex:1;padding:10px 16px;border:none;background:transparent;cursor:pointer;font-size:13px;color:#595959;transition:all .2s;position:relative}.irrigation-config-panel__tab[data-v-4ab4bf56]:hover{color:#262626;background:#f5f5f5}.irrigation-config-panel__tab.active[data-v-4ab4bf56]{color:#1890ff;font-weight:500}.irrigation-config-panel__tab.active[data-v-4ab4bf56]:after{content:"";position:absolute;bottom:0;left:0;right:0;height:2px;background:#1890ff}.irrigation-config-panel__content[data-v-4ab4bf56]{flex:1;padding:16px;overflow-y:auto;max-height:400px}.irrigation-config-panel__section[data-v-4ab4bf56]{margin-bottom:16px}.irrigation-config-panel__section[data-v-4ab4bf56]:last-child{margin-bottom:0}.irrigation-config-panel__section-title[data-v-4ab4bf56]{font-size:13px;font-weight:600;color:#262626;margin:0 0 12px;padding-bottom:8px;border-bottom:1px solid #f0f0f0}.irrigation-config-panel__item[data-v-4ab4bf56]{margin-bottom:12px}.irrigation-config-panel__item[data-v-4ab4bf56]:last-child{margin-bottom:0}.irrigation-config-panel__label[data-v-4ab4bf56]{display:block;font-size:12px;color:#595959;margin-bottom:6px}.irrigation-config-panel__control[data-v-4ab4bf56]{display:flex;align-items:center;gap:8px}.irrigation-config-panel__control input[type=color][data-v-4ab4bf56]{width:32px;height:32px;border:1px solid #d9d9d9;border-radius:4px;cursor:pointer;padding:2px}.irrigation-config-panel__control input[type=range][data-v-4ab4bf56]{flex:1;height:4px;-webkit-appearance:none;appearance:none;background:#f0f0f0;border-radius:2px;outline:none}.irrigation-config-panel__control input[type=range][data-v-4ab4bf56]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:14px;height:14px;background:#1890ff;border-radius:50%;cursor:pointer}.irrigation-config-panel__control select[data-v-4ab4bf56]{flex:1;height:32px;padding:0 8px;border:1px solid #d9d9d9;border-radius:4px;font-size:13px;background:#fff;cursor:pointer}.irrigation-config-panel__text-input[data-v-4ab4bf56]{flex:1;height:32px;padding:0 8px;border:1px solid #d9d9d9;border-radius:4px;font-size:13px}.irrigation-config-panel__text-input[data-v-4ab4bf56]:focus{outline:none;border-color:#1890ff}.irrigation-config-panel__value[data-v-4ab4bf56]{font-size:12px;color:#8c8c8c;min-width:40px;text-align:right}.irrigation-config-panel__footer[data-v-4ab4bf56]{padding:12px 16px;border-top:1px solid #f0f0f0;display:flex;justify-content:center}.irrigation-config-panel__reset-btn[data-v-4ab4bf56]{padding:8px 24px;border:1px solid #d9d9d9;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;color:#595959;transition:all .2s}.irrigation-config-panel__reset-btn[data-v-4ab4bf56]:hover{border-color:#ff4d4f;color:#ff4d4f;background:#fff1f0}@media(max-width:768px){.irrigation-config-panel[data-v-4ab4bf56]{width:calc(100% - 24px);max-height:60%;inset:auto 12px 12px}}.element-editor-overlay[data-v-3d348d7d]{position:fixed;inset:0;background:#00000073;z-index:1000;display:flex;align-items:center;justify-content:center}.element-editor[data-v-3d348d7d]{background:#fff;border-radius:8px;box-shadow:0 4px 12px #00000026;width:360px;max-height:80vh;display:flex;flex-direction:column}.element-editor__header[data-v-3d348d7d]{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #f0f0f0}.element-editor__title[data-v-3d348d7d]{font-size:16px;font-weight:600;color:#262626}.element-editor__close[data-v-3d348d7d]{width:28px;height:28px;display:flex;align-items:center;justify-content:center;border:none;background:transparent;cursor:pointer;border-radius:4px;color:#8c8c8c;transition:all .2s}.element-editor__close[data-v-3d348d7d]:hover{background:#f5f5f5;color:#262626}.element-editor__content[data-v-3d348d7d]{flex:1;padding:16px 20px;overflow-y:auto}.element-editor__section[data-v-3d348d7d]{margin-bottom:20px}.element-editor__section[data-v-3d348d7d]:last-child{margin-bottom:0}.element-editor__section-title[data-v-3d348d7d]{font-size:14px;font-weight:600;color:#262626;margin:0 0 12px;padding-bottom:8px;border-bottom:1px solid #f0f0f0}.element-editor__item[data-v-3d348d7d]{margin-bottom:14px}.element-editor__item[data-v-3d348d7d]:last-child{margin-bottom:0}.element-editor__label[data-v-3d348d7d]{display:block;font-size:13px;color:#595959;margin-bottom:6px}.element-editor__control[data-v-3d348d7d]{display:flex;align-items:center;gap:10px}.element-editor__control input[type=color][data-v-3d348d7d]{width:36px;height:36px;border:1px solid #d9d9d9;border-radius:4px;cursor:pointer;padding:2px}.element-editor__control input[type=range][data-v-3d348d7d]{flex:1;height:4px;-webkit-appearance:none;appearance:none;background:#f0f0f0;border-radius:2px;outline:none}.element-editor__control input[type=range][data-v-3d348d7d]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;background:#1890ff;border-radius:50%;cursor:pointer}.element-editor__control input[type=checkbox][data-v-3d348d7d]{width:18px;height:18px;cursor:pointer}.element-editor__control select[data-v-3d348d7d]{flex:1;height:36px;padding:0 12px;border:1px solid #d9d9d9;border-radius:4px;font-size:14px;background:#fff;cursor:pointer}.element-editor__text-input[data-v-3d348d7d]{flex:1;height:36px;padding:0 12px;border:1px solid #d9d9d9;border-radius:4px;font-size:14px}.element-editor__text-input[data-v-3d348d7d]:focus{outline:none;border-color:#1890ff}.element-editor__value[data-v-3d348d7d]{font-size:13px;color:#8c8c8c;min-width:45px;text-align:right}.element-editor__footer[data-v-3d348d7d]{padding:16px 20px;border-top:1px solid #f0f0f0;display:flex;justify-content:flex-end}.element-editor__confirm-btn[data-v-3d348d7d]{padding:8px 24px;background:#1890ff;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:14px;transition:all .2s}.element-editor__confirm-btn[data-v-3d348d7d]:hover{background:#40a9ff}.evolution-timeline[data-v-e89b8bda]{position:absolute;bottom:20px;left:50%;transform:translate(-50%);background:#fffffff2;border:1px solid #d9d9d9;border-radius:8px;padding:12px 16px;box-shadow:0 2px 8px #00000026;z-index:100;min-width:400px;-webkit-user-select:none;user-select:none}.timeline-controls[data-v-e89b8bda]{display:flex;align-items:center;gap:8px}.control-btn[data-v-e89b8bda]{width:32px;height:32px;border:1px solid #d9d9d9;border-radius:4px;background:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:12px;transition:all .2s}.control-btn[data-v-e89b8bda]:hover:not(:disabled){border-color:#1890ff;color:#1890ff}.control-btn[data-v-e89b8bda]:disabled{opacity:.5;cursor:not-allowed}.control-btn.active[data-v-e89b8bda]{background:#1890ff;border-color:#1890ff;color:#fff}.play-btn[data-v-e89b8bda]{width:40px;background:#1890ff;border-color:#1890ff;color:#fff}.play-btn[data-v-e89b8bda]:hover{background:#40a9ff;border-color:#40a9ff;color:#fff}.icon-play[data-v-e89b8bda],.icon-pause[data-v-e89b8bda]{font-size:14px}.timeline-track[data-v-e89b8bda]{flex:1;height:24px;position:relative;cursor:pointer;padding:8px 0}.track-bg[data-v-e89b8bda]{position:absolute;top:50%;left:0;right:0;height:4px;background:#e8e8e8;border-radius:2px;transform:translateY(-50%)}.track-progress[data-v-e89b8bda]{position:absolute;top:50%;left:0;height:4px;background:#1890ff;border-radius:2px;transform:translateY(-50%);transition:width .2s}.track-points[data-v-e89b8bda]{position:absolute;inset:0}.track-point[data-v-e89b8bda]{position:absolute;transform:translate(-50%);cursor:pointer;display:flex;flex-direction:column;align-items:center}.point-dot[data-v-e89b8bda]{width:12px;height:12px;border-radius:50%;background:#fff;border:2px solid #d9d9d9;transition:all .2s;margin-top:6px}.track-point:hover .point-dot[data-v-e89b8bda]{border-color:#1890ff;transform:scale(1.2)}.track-point.passed .point-dot[data-v-e89b8bda]{background:#1890ff;border-color:#1890ff}.track-point.active .point-dot[data-v-e89b8bda]{background:#1890ff;border-color:#1890ff;transform:scale(1.3);box-shadow:0 0 0 3px #1890ff33}.point-label[data-v-e89b8bda]{font-size:10px;color:#666;margin-top:4px;white-space:nowrap}.track-point.active .point-label[data-v-e89b8bda]{color:#1890ff;font-weight:700}.speed-control select[data-v-e89b8bda]{height:32px;padding:0 8px;border:1px solid #d9d9d9;border-radius:4px;background:#fff;cursor:pointer;font-size:12px}.speed-control select[data-v-e89b8bda]:hover{border-color:#1890ff}.loop-btn[data-v-e89b8bda]{font-size:14px}.timeline-info[data-v-e89b8bda]{display:flex;justify-content:space-between;margin-top:8px;padding-top:8px;border-top:1px solid #f0f0f0;font-size:12px;color:#666}.current-label[data-v-e89b8bda]{color:#1890ff;font-weight:500}.irrigation-toolbar[data-v-51f467d7]{position:absolute;top:12px;left:12px;padding:12px 16px;background:#fff;border-radius:8px;box-shadow:0 2px 8px #0000001a;display:flex;gap:24px;z-index:10;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:1px solid rgba(0,0,0,.1)}.irrigation-toolbar__section[data-v-51f467d7]{display:flex;align-items:center;gap:8px}.irrigation-toolbar__label[data-v-51f467d7]{color:#666;font-size:14px;white-space:nowrap}.irrigation-toolbar button[data-v-51f467d7]{padding:8px 12px;border:1px solid #d9d9d9;background:#fff;border-radius:4px;cursor:pointer;font-size:14px;transition:all .2s;display:flex;align-items:center;gap:4px;min-height:32px}.irrigation-toolbar button[data-v-51f467d7]:hover:not(:disabled){border-color:#1890ff;color:#1890ff;background:#f0f9ff}.irrigation-toolbar button[data-v-51f467d7]:active:not(:disabled){background:#e6f7ff}.irrigation-toolbar button[data-v-51f467d7]:disabled{opacity:.5;cursor:not-allowed}.irrigation-toolbar button.is-active[data-v-51f467d7]{border-color:#1890ff;color:#1890ff;background:#e6f7ff}.irrigation-toolbar__icon[data-v-51f467d7]{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.irrigation-toolbar__btn-text[data-v-51f467d7]{font-size:12px;white-space:nowrap}@media(max-width:768px){.irrigation-toolbar__btn-text[data-v-51f467d7]{display:none}.irrigation-toolbar button[data-v-51f467d7]{padding:8px;min-height:auto}.irrigation-toolbar[data-v-51f467d7]{gap:12px;padding:8px}.irrigation-toolbar__section[data-v-51f467d7]{gap:6px}}.irrigation-graph[data-v-4aae68e6]{position:relative;width:100%;height:100%;overflow:hidden}.irrigation-graph__canvas[data-v-4aae68e6]{position:relative;width:100%;height:100%}.irrigation-graph__loading[data-v-4aae68e6]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#fffc;z-index:20}
|
|
1
|
+
.irrigation-config-panel[data-v-4ab4bf56]{position:absolute;top:12px;right:12px;width:300px;background:#fff;border-radius:8px;box-shadow:0 2px 12px #00000026;z-index:10;border:1px solid rgba(0,0,0,.1);max-height:calc(100% - 24px);display:flex;flex-direction:column}.irrigation-config-panel__header[data-v-4ab4bf56]{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid #f0f0f0}.irrigation-config-panel__title[data-v-4ab4bf56]{font-size:14px;font-weight:600;color:#262626}.irrigation-config-panel__close[data-v-4ab4bf56]{width:24px;height:24px;display:flex;align-items:center;justify-content:center;border:none;background:transparent;cursor:pointer;border-radius:4px;color:#8c8c8c;transition:all .2s}.irrigation-config-panel__close[data-v-4ab4bf56]:hover{background:#f5f5f5;color:#262626}.irrigation-config-panel__tabs[data-v-4ab4bf56]{display:flex;border-bottom:1px solid #f0f0f0}.irrigation-config-panel__tab[data-v-4ab4bf56]{flex:1;padding:10px 16px;border:none;background:transparent;cursor:pointer;font-size:13px;color:#595959;transition:all .2s;position:relative}.irrigation-config-panel__tab[data-v-4ab4bf56]:hover{color:#262626;background:#f5f5f5}.irrigation-config-panel__tab.active[data-v-4ab4bf56]{color:#1890ff;font-weight:500}.irrigation-config-panel__tab.active[data-v-4ab4bf56]:after{content:"";position:absolute;bottom:0;left:0;right:0;height:2px;background:#1890ff}.irrigation-config-panel__content[data-v-4ab4bf56]{flex:1;padding:16px;overflow-y:auto;max-height:400px}.irrigation-config-panel__section[data-v-4ab4bf56]{margin-bottom:16px}.irrigation-config-panel__section[data-v-4ab4bf56]:last-child{margin-bottom:0}.irrigation-config-panel__section-title[data-v-4ab4bf56]{font-size:13px;font-weight:600;color:#262626;margin:0 0 12px;padding-bottom:8px;border-bottom:1px solid #f0f0f0}.irrigation-config-panel__item[data-v-4ab4bf56]{margin-bottom:12px}.irrigation-config-panel__item[data-v-4ab4bf56]:last-child{margin-bottom:0}.irrigation-config-panel__label[data-v-4ab4bf56]{display:block;font-size:12px;color:#595959;margin-bottom:6px}.irrigation-config-panel__control[data-v-4ab4bf56]{display:flex;align-items:center;gap:8px}.irrigation-config-panel__control input[type=color][data-v-4ab4bf56]{width:32px;height:32px;border:1px solid #d9d9d9;border-radius:4px;cursor:pointer;padding:2px}.irrigation-config-panel__control input[type=range][data-v-4ab4bf56]{flex:1;height:4px;-webkit-appearance:none;appearance:none;background:#f0f0f0;border-radius:2px;outline:none}.irrigation-config-panel__control input[type=range][data-v-4ab4bf56]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:14px;height:14px;background:#1890ff;border-radius:50%;cursor:pointer}.irrigation-config-panel__control select[data-v-4ab4bf56]{flex:1;height:32px;padding:0 8px;border:1px solid #d9d9d9;border-radius:4px;font-size:13px;background:#fff;cursor:pointer}.irrigation-config-panel__text-input[data-v-4ab4bf56]{flex:1;height:32px;padding:0 8px;border:1px solid #d9d9d9;border-radius:4px;font-size:13px}.irrigation-config-panel__text-input[data-v-4ab4bf56]:focus{outline:none;border-color:#1890ff}.irrigation-config-panel__value[data-v-4ab4bf56]{font-size:12px;color:#8c8c8c;min-width:40px;text-align:right}.irrigation-config-panel__footer[data-v-4ab4bf56]{padding:12px 16px;border-top:1px solid #f0f0f0;display:flex;justify-content:center}.irrigation-config-panel__reset-btn[data-v-4ab4bf56]{padding:8px 24px;border:1px solid #d9d9d9;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;color:#595959;transition:all .2s}.irrigation-config-panel__reset-btn[data-v-4ab4bf56]:hover{border-color:#ff4d4f;color:#ff4d4f;background:#fff1f0}@media(max-width:768px){.irrigation-config-panel[data-v-4ab4bf56]{width:calc(100% - 24px);max-height:60%;inset:auto 12px 12px}}.element-editor-overlay[data-v-22b8de4b]{position:fixed;inset:0;background:#00000073;z-index:1000;display:flex;align-items:center;justify-content:center}.element-editor[data-v-22b8de4b]{background:#fff;border-radius:8px;box-shadow:0 4px 12px #00000026;width:360px;max-height:80vh;display:flex;flex-direction:column}.element-editor__header[data-v-22b8de4b]{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #f0f0f0}.element-editor__title[data-v-22b8de4b]{font-size:16px;font-weight:600;color:#262626}.element-editor__close[data-v-22b8de4b]{width:28px;height:28px;display:flex;align-items:center;justify-content:center;border:none;background:transparent;cursor:pointer;border-radius:4px;color:#8c8c8c;transition:all .2s}.element-editor__close[data-v-22b8de4b]:hover{background:#f5f5f5;color:#262626}.element-editor__content[data-v-22b8de4b]{flex:1;padding:16px 20px;overflow-y:auto}.element-editor__section[data-v-22b8de4b]{margin-bottom:20px}.element-editor__section[data-v-22b8de4b]:last-child{margin-bottom:0}.element-editor__section-title[data-v-22b8de4b]{font-size:14px;font-weight:600;color:#262626;margin:0 0 12px;padding-bottom:8px;border-bottom:1px solid #f0f0f0}.element-editor__item[data-v-22b8de4b]{margin-bottom:14px}.element-editor__item[data-v-22b8de4b]:last-child{margin-bottom:0}.element-editor__label[data-v-22b8de4b]{display:block;font-size:13px;color:#595959;margin-bottom:6px}.element-editor__control[data-v-22b8de4b]{display:flex;align-items:center;gap:10px}.element-editor__control input[type=color][data-v-22b8de4b]{width:36px;height:36px;border:1px solid #d9d9d9;border-radius:4px;cursor:pointer;padding:2px}.element-editor__control input[type=range][data-v-22b8de4b]{flex:1;height:4px;-webkit-appearance:none;appearance:none;background:#f0f0f0;border-radius:2px;outline:none}.element-editor__control input[type=range][data-v-22b8de4b]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;background:#1890ff;border-radius:50%;cursor:pointer}.element-editor__control input[type=checkbox][data-v-22b8de4b]{width:18px;height:18px;cursor:pointer}.element-editor__control select[data-v-22b8de4b]{flex:1;height:36px;padding:0 12px;border:1px solid #d9d9d9;border-radius:4px;font-size:14px;background:#fff;cursor:pointer}.element-editor__text-input[data-v-22b8de4b]{flex:1;height:36px;padding:0 12px;border:1px solid #d9d9d9;border-radius:4px;font-size:14px}.element-editor__text-input[data-v-22b8de4b]:focus{outline:none;border-color:#1890ff}.element-editor__value[data-v-22b8de4b]{font-size:13px;color:#8c8c8c;min-width:45px;text-align:right}.element-editor__footer[data-v-22b8de4b]{padding:16px 20px;border-top:1px solid #f0f0f0;display:flex;justify-content:flex-end}.element-editor__confirm-btn[data-v-22b8de4b]{padding:8px 24px;background:#1890ff;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:14px;transition:all .2s}.element-editor__confirm-btn[data-v-22b8de4b]:hover{background:#40a9ff}.evolution-timeline[data-v-e89b8bda]{position:absolute;bottom:20px;left:50%;transform:translate(-50%);background:#fffffff2;border:1px solid #d9d9d9;border-radius:8px;padding:12px 16px;box-shadow:0 2px 8px #00000026;z-index:100;min-width:400px;-webkit-user-select:none;user-select:none}.timeline-controls[data-v-e89b8bda]{display:flex;align-items:center;gap:8px}.control-btn[data-v-e89b8bda]{width:32px;height:32px;border:1px solid #d9d9d9;border-radius:4px;background:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:12px;transition:all .2s}.control-btn[data-v-e89b8bda]:hover:not(:disabled){border-color:#1890ff;color:#1890ff}.control-btn[data-v-e89b8bda]:disabled{opacity:.5;cursor:not-allowed}.control-btn.active[data-v-e89b8bda]{background:#1890ff;border-color:#1890ff;color:#fff}.play-btn[data-v-e89b8bda]{width:40px;background:#1890ff;border-color:#1890ff;color:#fff}.play-btn[data-v-e89b8bda]:hover{background:#40a9ff;border-color:#40a9ff;color:#fff}.icon-play[data-v-e89b8bda],.icon-pause[data-v-e89b8bda]{font-size:14px}.timeline-track[data-v-e89b8bda]{flex:1;height:24px;position:relative;cursor:pointer;padding:8px 0}.track-bg[data-v-e89b8bda]{position:absolute;top:50%;left:0;right:0;height:4px;background:#e8e8e8;border-radius:2px;transform:translateY(-50%)}.track-progress[data-v-e89b8bda]{position:absolute;top:50%;left:0;height:4px;background:#1890ff;border-radius:2px;transform:translateY(-50%);transition:width .2s}.track-points[data-v-e89b8bda]{position:absolute;inset:0}.track-point[data-v-e89b8bda]{position:absolute;transform:translate(-50%);cursor:pointer;display:flex;flex-direction:column;align-items:center}.point-dot[data-v-e89b8bda]{width:12px;height:12px;border-radius:50%;background:#fff;border:2px solid #d9d9d9;transition:all .2s;margin-top:6px}.track-point:hover .point-dot[data-v-e89b8bda]{border-color:#1890ff;transform:scale(1.2)}.track-point.passed .point-dot[data-v-e89b8bda]{background:#1890ff;border-color:#1890ff}.track-point.active .point-dot[data-v-e89b8bda]{background:#1890ff;border-color:#1890ff;transform:scale(1.3);box-shadow:0 0 0 3px #1890ff33}.point-label[data-v-e89b8bda]{font-size:10px;color:#666;margin-top:4px;white-space:nowrap}.track-point.active .point-label[data-v-e89b8bda]{color:#1890ff;font-weight:700}.speed-control select[data-v-e89b8bda]{height:32px;padding:0 8px;border:1px solid #d9d9d9;border-radius:4px;background:#fff;cursor:pointer;font-size:12px}.speed-control select[data-v-e89b8bda]:hover{border-color:#1890ff}.loop-btn[data-v-e89b8bda]{font-size:14px}.timeline-info[data-v-e89b8bda]{display:flex;justify-content:space-between;margin-top:8px;padding-top:8px;border-top:1px solid #f0f0f0;font-size:12px;color:#666}.current-label[data-v-e89b8bda]{color:#1890ff;font-weight:500}.irrigation-toolbar[data-v-51f467d7]{position:absolute;top:12px;left:12px;padding:12px 16px;background:#fff;border-radius:8px;box-shadow:0 2px 8px #0000001a;display:flex;gap:24px;z-index:10;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:1px solid rgba(0,0,0,.1)}.irrigation-toolbar__section[data-v-51f467d7]{display:flex;align-items:center;gap:8px}.irrigation-toolbar__label[data-v-51f467d7]{color:#666;font-size:14px;white-space:nowrap}.irrigation-toolbar button[data-v-51f467d7]{padding:8px 12px;border:1px solid #d9d9d9;background:#fff;border-radius:4px;cursor:pointer;font-size:14px;transition:all .2s;display:flex;align-items:center;gap:4px;min-height:32px}.irrigation-toolbar button[data-v-51f467d7]:hover:not(:disabled){border-color:#1890ff;color:#1890ff;background:#f0f9ff}.irrigation-toolbar button[data-v-51f467d7]:active:not(:disabled){background:#e6f7ff}.irrigation-toolbar button[data-v-51f467d7]:disabled{opacity:.5;cursor:not-allowed}.irrigation-toolbar button.is-active[data-v-51f467d7]{border-color:#1890ff;color:#1890ff;background:#e6f7ff}.irrigation-toolbar__icon[data-v-51f467d7]{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.irrigation-toolbar__btn-text[data-v-51f467d7]{font-size:12px;white-space:nowrap}@media(max-width:768px){.irrigation-toolbar__btn-text[data-v-51f467d7]{display:none}.irrigation-toolbar button[data-v-51f467d7]{padding:8px;min-height:auto}.irrigation-toolbar[data-v-51f467d7]{gap:12px;padding:8px}.irrigation-toolbar__section[data-v-51f467d7]{gap:6px}}.irrigation-graph[data-v-4aae68e6]{position:relative;width:100%;height:100%;overflow:hidden}.irrigation-graph__canvas[data-v-4aae68e6]{position:relative;width:100%;height:100%}.irrigation-graph__loading[data-v-4aae68e6]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#fffc;z-index:20}
|
package/dist/irr-gh.js
CHANGED
|
@@ -19711,7 +19711,7 @@ class ld {
|
|
|
19711
19711
|
background: #fff;
|
|
19712
19712
|
border-radius: 4px;
|
|
19713
19713
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
19714
|
-
z-index:
|
|
19714
|
+
z-index: 99999;
|
|
19715
19715
|
min-width: 120px;
|
|
19716
19716
|
padding: 4px 0;
|
|
19717
19717
|
font-size: 14px;
|
|
@@ -22634,7 +22634,10 @@ const IF = {
|
|
|
22634
22634
|
N("input", {
|
|
22635
22635
|
type: "checkbox",
|
|
22636
22636
|
checked: n.labelVisible,
|
|
22637
|
-
onChange: h[0] || (h[0] = (g) => u(
|
|
22637
|
+
onChange: h[0] || (h[0] = (g) => u(
|
|
22638
|
+
"labelVisible",
|
|
22639
|
+
g.target.checked
|
|
22640
|
+
))
|
|
22638
22641
|
}, null, 40, nx)
|
|
22639
22642
|
])
|
|
22640
22643
|
]),
|
|
@@ -22644,13 +22647,19 @@ const IF = {
|
|
|
22644
22647
|
N("input", {
|
|
22645
22648
|
type: "color",
|
|
22646
22649
|
value: n.labelFill,
|
|
22647
|
-
onInput: h[1] || (h[1] = (g) => u(
|
|
22650
|
+
onInput: h[1] || (h[1] = (g) => u(
|
|
22651
|
+
"labelFill",
|
|
22652
|
+
g.target.value
|
|
22653
|
+
))
|
|
22648
22654
|
}, null, 40, sx),
|
|
22649
22655
|
N("input", {
|
|
22650
22656
|
type: "text",
|
|
22651
22657
|
class: "element-editor__text-input",
|
|
22652
22658
|
value: n.labelFill,
|
|
22653
|
-
onChange: h[2] || (h[2] = (g) => u(
|
|
22659
|
+
onChange: h[2] || (h[2] = (g) => u(
|
|
22660
|
+
"labelFill",
|
|
22661
|
+
g.target.value
|
|
22662
|
+
))
|
|
22654
22663
|
}, null, 40, ox)
|
|
22655
22664
|
])
|
|
22656
22665
|
]),
|
|
@@ -22659,9 +22668,12 @@ const IF = {
|
|
|
22659
22668
|
N("div", ux, [
|
|
22660
22669
|
N("select", {
|
|
22661
22670
|
value: n.labelPlacement,
|
|
22662
|
-
onChange: h[3] || (h[3] = (g) => u(
|
|
22671
|
+
onChange: h[3] || (h[3] = (g) => u(
|
|
22672
|
+
"labelPlacement",
|
|
22673
|
+
g.target.value
|
|
22674
|
+
))
|
|
22663
22675
|
}, [...h[20] || (h[20] = [
|
|
22664
|
-
Ec('<option value="top" data-v-
|
|
22676
|
+
Ec('<option value="top" data-v-22b8de4b>顶部</option><option value="bottom" data-v-22b8de4b>底部</option><option value="left" data-v-22b8de4b>左侧</option><option value="right" data-v-22b8de4b>右侧</option><option value="center" data-v-22b8de4b>中心</option>', 5)
|
|
22665
22677
|
])], 40, cx)
|
|
22666
22678
|
])
|
|
22667
22679
|
]),
|
|
@@ -22673,7 +22685,12 @@ const IF = {
|
|
|
22673
22685
|
min: "10",
|
|
22674
22686
|
max: "32",
|
|
22675
22687
|
value: n.labelFontSize,
|
|
22676
|
-
onInput: h[4] || (h[4] = (g) => u(
|
|
22688
|
+
onInput: h[4] || (h[4] = (g) => u(
|
|
22689
|
+
"labelFontSize",
|
|
22690
|
+
Number(
|
|
22691
|
+
g.target.value
|
|
22692
|
+
)
|
|
22693
|
+
))
|
|
22677
22694
|
}, null, 40, dx),
|
|
22678
22695
|
N("span", gx, ce(n.labelFontSize) + "px", 1)
|
|
22679
22696
|
])
|
|
@@ -22686,7 +22703,12 @@ const IF = {
|
|
|
22686
22703
|
min: "-50",
|
|
22687
22704
|
max: "50",
|
|
22688
22705
|
value: n.labelOffset?.[0] ?? 0,
|
|
22689
|
-
onInput: h[5] || (h[5] = (g) => f(
|
|
22706
|
+
onInput: h[5] || (h[5] = (g) => f(
|
|
22707
|
+
0,
|
|
22708
|
+
Number(
|
|
22709
|
+
g.target.value
|
|
22710
|
+
)
|
|
22711
|
+
))
|
|
22690
22712
|
}, null, 40, px),
|
|
22691
22713
|
N("span", yx, ce(n.labelOffset?.[0] ?? 0) + "px", 1)
|
|
22692
22714
|
])
|
|
@@ -22699,7 +22721,12 @@ const IF = {
|
|
|
22699
22721
|
min: "-50",
|
|
22700
22722
|
max: "50",
|
|
22701
22723
|
value: n.labelOffset?.[1] ?? 0,
|
|
22702
|
-
onInput: h[6] || (h[6] = (g) => f(
|
|
22724
|
+
onInput: h[6] || (h[6] = (g) => f(
|
|
22725
|
+
1,
|
|
22726
|
+
Number(
|
|
22727
|
+
g.target.value
|
|
22728
|
+
)
|
|
22729
|
+
))
|
|
22703
22730
|
}, null, 40, Cx),
|
|
22704
22731
|
N("span", Qx, ce(n.labelOffset?.[1] ?? 0) + "px", 1)
|
|
22705
22732
|
])
|
|
@@ -22714,13 +22741,19 @@ const IF = {
|
|
|
22714
22741
|
N("input", {
|
|
22715
22742
|
type: "color",
|
|
22716
22743
|
value: i.stroke,
|
|
22717
|
-
onInput: h[7] || (h[7] = (g) => c(
|
|
22744
|
+
onInput: h[7] || (h[7] = (g) => c(
|
|
22745
|
+
"stroke",
|
|
22746
|
+
g.target.value
|
|
22747
|
+
))
|
|
22718
22748
|
}, null, 40, Ux),
|
|
22719
22749
|
N("input", {
|
|
22720
22750
|
type: "text",
|
|
22721
22751
|
class: "element-editor__text-input",
|
|
22722
22752
|
value: i.stroke,
|
|
22723
|
-
onChange: h[8] || (h[8] = (g) => c(
|
|
22753
|
+
onChange: h[8] || (h[8] = (g) => c(
|
|
22754
|
+
"stroke",
|
|
22755
|
+
g.target.value
|
|
22756
|
+
))
|
|
22724
22757
|
}, null, 40, bx)
|
|
22725
22758
|
])
|
|
22726
22759
|
]),
|
|
@@ -22732,7 +22765,12 @@ const IF = {
|
|
|
22732
22765
|
min: "1",
|
|
22733
22766
|
max: "10",
|
|
22734
22767
|
value: i.lineWidth,
|
|
22735
|
-
onInput: h[9] || (h[9] = (g) => c(
|
|
22768
|
+
onInput: h[9] || (h[9] = (g) => c(
|
|
22769
|
+
"lineWidth",
|
|
22770
|
+
Number(
|
|
22771
|
+
g.target.value
|
|
22772
|
+
)
|
|
22773
|
+
))
|
|
22736
22774
|
}, null, 40, Tx),
|
|
22737
22775
|
N("span", Mx, ce(i.lineWidth) + "px", 1)
|
|
22738
22776
|
])
|
|
@@ -22746,7 +22784,10 @@ const IF = {
|
|
|
22746
22784
|
N("input", {
|
|
22747
22785
|
type: "checkbox",
|
|
22748
22786
|
checked: i.labelVisible,
|
|
22749
|
-
onChange: h[10] || (h[10] = (g) => c(
|
|
22787
|
+
onChange: h[10] || (h[10] = (g) => c(
|
|
22788
|
+
"labelVisible",
|
|
22789
|
+
g.target.checked
|
|
22790
|
+
))
|
|
22750
22791
|
}, null, 40, Nx)
|
|
22751
22792
|
])
|
|
22752
22793
|
]),
|
|
@@ -22755,7 +22796,10 @@ const IF = {
|
|
|
22755
22796
|
N("div", Ox, [
|
|
22756
22797
|
N("select", {
|
|
22757
22798
|
value: i.labelPlacement,
|
|
22758
|
-
onChange: h[11] || (h[11] = (g) => c(
|
|
22799
|
+
onChange: h[11] || (h[11] = (g) => c(
|
|
22800
|
+
"labelPlacement",
|
|
22801
|
+
g.target.value
|
|
22802
|
+
))
|
|
22759
22803
|
}, [...h[30] || (h[30] = [
|
|
22760
22804
|
N("option", { value: "start" }, "起点", -1),
|
|
22761
22805
|
N("option", { value: "center" }, "中心", -1),
|
|
@@ -22769,13 +22813,19 @@ const IF = {
|
|
|
22769
22813
|
N("input", {
|
|
22770
22814
|
type: "color",
|
|
22771
22815
|
value: i.labelFill,
|
|
22772
|
-
onInput: h[12] || (h[12] = (g) => c(
|
|
22816
|
+
onInput: h[12] || (h[12] = (g) => c(
|
|
22817
|
+
"labelFill",
|
|
22818
|
+
g.target.value
|
|
22819
|
+
))
|
|
22773
22820
|
}, null, 40, _x),
|
|
22774
22821
|
N("input", {
|
|
22775
22822
|
type: "text",
|
|
22776
22823
|
class: "element-editor__text-input",
|
|
22777
22824
|
value: i.labelFill,
|
|
22778
|
-
onChange: h[13] || (h[13] = (g) => c(
|
|
22825
|
+
onChange: h[13] || (h[13] = (g) => c(
|
|
22826
|
+
"labelFill",
|
|
22827
|
+
g.target.value
|
|
22828
|
+
))
|
|
22779
22829
|
}, null, 40, Gx)
|
|
22780
22830
|
])
|
|
22781
22831
|
]),
|
|
@@ -22787,7 +22837,12 @@ const IF = {
|
|
|
22787
22837
|
min: "10",
|
|
22788
22838
|
max: "32",
|
|
22789
22839
|
value: i.labelFontSize,
|
|
22790
|
-
onInput: h[14] || (h[14] = (g) => c(
|
|
22840
|
+
onInput: h[14] || (h[14] = (g) => c(
|
|
22841
|
+
"labelFontSize",
|
|
22842
|
+
Number(
|
|
22843
|
+
g.target.value
|
|
22844
|
+
)
|
|
22845
|
+
))
|
|
22791
22846
|
}, null, 40, Wx),
|
|
22792
22847
|
N("span", Xx, ce(i.labelFontSize) + "px", 1)
|
|
22793
22848
|
])
|
|
@@ -22800,7 +22855,12 @@ const IF = {
|
|
|
22800
22855
|
min: "-50",
|
|
22801
22856
|
max: "50",
|
|
22802
22857
|
value: i.labelOffset,
|
|
22803
|
-
onInput: h[15] || (h[15] = (g) => c(
|
|
22858
|
+
onInput: h[15] || (h[15] = (g) => c(
|
|
22859
|
+
"labelOffset",
|
|
22860
|
+
Number(
|
|
22861
|
+
g.target.value
|
|
22862
|
+
)
|
|
22863
|
+
))
|
|
22804
22864
|
}, null, 40, $x),
|
|
22805
22865
|
N("span", Zx, ce(i.labelOffset) + "px", 1)
|
|
22806
22866
|
])
|
|
@@ -22817,7 +22877,7 @@ const IF = {
|
|
|
22817
22877
|
])
|
|
22818
22878
|
])) : de("", !0);
|
|
22819
22879
|
}
|
|
22820
|
-
}), jx = /* @__PURE__ */ Xn(qx, [["__scopeId", "data-v-
|
|
22880
|
+
}), jx = /* @__PURE__ */ Xn(qx, [["__scopeId", "data-v-22b8de4b"]]), AU = {
|
|
22821
22881
|
key: 0,
|
|
22822
22882
|
class: "evolution-timeline"
|
|
22823
22883
|
}, eU = { class: "timeline-controls" }, tU = ["title"], rU = {
|
package/dist/irr-gh.umd.cjs
CHANGED
|
@@ -31,7 +31,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
31
31
|
background: #fff;
|
|
32
32
|
border-radius: 4px;
|
|
33
33
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
34
|
-
z-index:
|
|
34
|
+
z-index: 99999;
|
|
35
35
|
min-width: 120px;
|
|
36
36
|
padding: 4px 0;
|
|
37
37
|
font-size: 14px;
|
|
@@ -56,4 +56,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
56
56
|
<head><title>灌溉概化图</title></head>
|
|
57
57
|
<body>${A.innerHTML}</body>
|
|
58
58
|
</html>
|
|
59
|
-
`),t.document.close(),t.print())}class $o{graph=null;container=null;options;state={loading:!1,rendered:!1,zoom:1,selectedNodes:[],selectedEdges:[]};eventHandlers=new Map;dataPanelManager=null;evolutionManager=null;bufferLayerRenderer=null;contextMenuManager=null;bufferNodeSync=null;currentData=null;constructor(t){this.options=t,Xh(),_h(),Kh()}async init(){const t=typeof this.options.container=="string"?document.getElementById(this.options.container):this.options.container;if(!t)throw new Error("Container not found");this.container=t;const e=dl(this.options);return this.graph=new We.Graph({container:t,width:this.options.width||t.clientWidth,height:this.options.height||t.clientHeight,autoFit:this.options.fitView?"view":void 0,padding:this.options.fitViewPadding,background:"transparent",layout:hd(this.options.layout),behaviors:e,plugins:nF(this.options,this.currentData),node:{type:r=>r.nodeShape||"circle",style:r=>{const n=r,i=n.style||{},a=n.nodeShape==="image";if(n.nodeShape==="buffer-polygon")return{...i,zIndex:i.zIndex??-999,labelText:"",label:!1,icon:!1,badge:!1,port:!1,halo:!1};if(a&&i.img){const o=i.width||48,l=i.height||48,u={src:i.img,width:o,height:l,size:[o,l],labelText:n.data?.label||""};return i.fill&&(u.fill=i.fill),i.stroke&&(u.stroke=i.stroke),i.labelFill&&(u.labelFill=i.labelFill),i.labelFontSize&&(u.labelFontSize=i.labelFontSize||16),i.labelPlacement&&(u.labelPlacement=i.labelPlacement),u.zIndex=10,u}return{fill:i.fill||"#fff",stroke:i.stroke||"#1890ff",lineWidth:i.lineWidth??2,radius:i.radius??4,size:i.width?[i.width,i.height||i.width]:void 0,labelText:n.data?.label||"",...i}}},edge:{type:r=>{const n=r;return n.style?.router?"polyline":n.edgeShape||"band-edge"},style:r=>{const n=r,i=n.style||{},a={stroke:"#1890ff",lineWidth:2,endArrow:!0};!a.labelText&&n.data?.label&&(a.labelText=n.data.label),a.labelText&&(Object.assign(a,{labelFontSize:16,labelFill:"#666",labelBackgroundFill:"rgba(255, 255, 255, 0.9)",labelBackgroundRadius:4,labelPadding:[2,6]}),i.labelFontSize!==void 0&&(a.labelFontSize=i.labelFontSize),i.labelFill!==void 0&&(a.labelFill=i.labelFill),i.labelBackgroundFill!==void 0&&(a.labelBackgroundFill=i.labelBackgroundFill),i.labelBackgroundRadius!==void 0&&(a.labelBackgroundRadius=i.labelBackgroundRadius),i.labelPadding!==void 0&&(a.labelPadding=i.labelPadding)),Object.assign(a,i),i.router&&(a.router={type:"orth",offset:20,...typeof i.router=="object"?i.router:{}});const s=n.style;return s&&typeof s=="object"&&Object.assign(a,s),a}},combo:{type:"irrigation-combo",style:r=>{const n=r.style||{};return{padding:n.padding||[20,20,20,20],labelText:n.labelText||r.data?.label||"",labelPlacement:n.labelPlacement||"top",labelFontSize:n.labelFontSize||12,fill:n.fill||"#f3f9ff",stroke:n.stroke||"#1890ff",lineWidth:n.lineWidth||2,radius:n.radius||8,labelFill:"#333",labelBackground:!0,labelBackgroundFill:"#fff",labelBackgroundOpacity:.8,labelBackgroundRadius:4,labelBackgroundPadding:[2,4]}}}}),aF(this.graph,this.eventHandlers),this.dataPanelManager=new ld(this.options.dataPanel||{enabled:!1}),this.dataPanelManager.mount(this.graph,t),this.options.evolution?.enabled&&(this.evolutionManager=new ka(this.options.evolution),this.evolutionManager.mount(this.graph,this.dataPanelManager)),this.options.contextMenu?.enabled!==!1&&(this.contextMenuManager=new Jo(this.options.contextMenu),this.contextMenuManager.mount(this.graph,t)),this.options.enableMinimap&&this.listenCanvasResize(),this.state.rendered=!0,this.graph}async render(t){this.graph||await this.init(),this.currentData=t,this.state.loading=!0;try{await this.graph.setData(t),await this.graph.render(),t.groups&&t.groups.length>0&&(this.bufferNodeSync||(this.bufferNodeSync=new od),this.bufferNodeSync.init(this.graph,t.groups,t.edges||[])),this.dataPanelManager&&setTimeout(()=>{this.dataPanelManager?.updateConfig({})},100)}finally{this.state.loading=!1}}async updateData(t){if(!this.graph)return;const e=this.graph.getData(),r={nodes:t.nodes??e.nodes,edges:t.edges??e.edges,combos:t.combos??e.combos};await this.graph.setData(r),await this.graph.render()}async addNode(t){this.graph&&(await this.graph.addNodeData([t]),await this.graph.draw())}async addEdge(t){this.graph&&(await this.graph.addEdgeData([t]),await this.graph.draw())}async removeNode(t){this.graph&&(await this.graph.removeNodeData([t]),await this.graph.draw())}async removeEdge(t){this.graph&&(await this.graph.removeEdgeData([t]),await this.graph.draw())}async updateNode(t,e){this.graph&&(await this.graph.updateNodeData([{id:t,...e}]),await this.graph.draw())}async updateEdge(t,e){this.graph&&(await this.graph.updateEdgeData([{id:t,...e}]),await this.graph.draw())}zoomTo(t){this.graph&&(this.graph.zoomTo(t),this.state.zoom=t)}zoomIn(){const t=Math.min(this.state.zoom*1.2,5);this.zoomTo(t)}zoomOut(){const t=Math.max(this.state.zoom/1.2,.1);this.zoomTo(t)}fitView(){this.graph&&this.graph.fitView()}focusNode(t){this.graph&&this.graph.focusElement(t)}getData(){return dd(this.graph,this.currentData?.groups)}save(){return uF(this.graph)}async load(t){await cF(this.graph,t)}async toImage(t){return gd(this.graph,t)}async downloadImage(t){await fF(this.graph,t)}print(){hF(this.container)}getState(){return{...this.state}}getSelectedNodes(){return[...this.state.selectedNodes]}getSelectedEdges(){return[...this.state.selectedEdges]}async setLayout(t){if(!this.graph)return;const e=hd(t);this.graph.setLayout(e),await this.graph.layout()}getGraph(){return this.graph}getDataPanelManager(){return this.dataPanelManager}getEvolutionManager(){return this.evolutionManager}setEvolutionData(t){this.evolutionManager||(this.evolutionManager=new ka(this.options.evolution||{enabled:!0}),this.graph&&this.container&&this.evolutionManager.mount(this.graph,this.dataPanelManager||void 0)),this.evolutionManager.setData(t)}enableDataPanel(t){if(this.dataPanelManager&&(t&&this.dataPanelManager.updateConfig(t),this.dataPanelManager.enable(),this.graph)){const e=this.graph.getPlugins(),r=e.filter(n=>n.type!=="tooltip");r.length!==e.length&&this.graph.setPlugins(r)}}disableDataPanel(){if(this.dataPanelManager&&(this.dataPanelManager.disable(),this.graph&&this.options.tooltip?.enabled!==!1)){const t=this.graph.getPlugins();t.some(r=>r.type==="tooltip")||this.graph.setPlugins([...t,iF(this.options)])}}resize(t,e){if(!this.graph||!this.container)return;const r=t||this.container.clientWidth,n=e||this.container.clientHeight;this.graph.setSize(r,n)}resizeTimer=null;listenCanvasResize(){if(!this.graph||!this.container)return;new ResizeObserver(()=>{this.resizeTimer&&clearTimeout(this.resizeTimer),this.resizeTimer=window.setTimeout(()=>{this.updateMinimapPosition(),this.resizeTimer=null},150)}).observe(this.container)}updateMinimapPosition(){if(!this.container)return;const t=document.querySelector(".g6-minimap"),e=t?.offsetWidth||0,r=t?.offsetHeight||0;t&&(t.style.top=`calc(100% - ${r}px)`,t.style.left=`calc(100% - ${e}px)`)}destroy(){this.evolutionManager&&(this.evolutionManager.unmount(),this.evolutionManager=null),this.dataPanelManager&&(this.dataPanelManager.unmount(),this.dataPanelManager=null),this.contextMenuManager&&(this.contextMenuManager.unmount(),this.contextMenuManager=null),this.bufferLayerRenderer&&(this.bufferLayerRenderer.destroy(),this.bufferLayerRenderer=null),this.bufferNodeSync&&(this.bufferNodeSync.destroy(),this.bufferNodeSync=null),this.resizeTimer&&(clearTimeout(this.resizeTimer),this.resizeTimer=null),this.graph&&(this.graph.destroy(),this.graph=null),this.eventHandlers.clear(),this.state.rendered=!1}on(t,e){oF(this.eventHandlers,t,e)}off(t,e){lF(this.eventHandlers,t,e)}getContextMenuManager(){return this.contextMenuManager}enableContextMenu(){this.contextMenuManager&&this.contextMenuManager.enable()}disableContextMenu(){this.contextMenuManager&&this.contextMenuManager.disable()}onContextMenu(t){this.contextMenuManager&&this.contextMenuManager.on(t)}offContextMenu(t){this.contextMenuManager&&this.contextMenuManager.off(t)}}function dF(A){return new $o(A)}const gF={generateAuxNodes:!0,defaultNodeSpacing:1e3,auxNodePrefix:"aux"};class BF{canalMap=new Map;canalChildren=new Map;existingPointsByCanalId=new Map;canalNodeMap=new Map;buildIndices(t){return this.clear(),this.buildCanalIndices(t.canals),this.buildPointIndices(t.points),this.buildCanalNodeMap(t),{canalMap:this.canalMap,canalChildren:this.canalChildren,existingPointsByCanalId:this.existingPointsByCanalId,canalNodeMap:this.canalNodeMap}}clear(){this.canalMap.clear(),this.canalChildren.clear(),this.existingPointsByCanalId.clear(),this.canalNodeMap.clear()}buildCanalIndices(t){for(const e of t)if(this.canalMap.set(e.id,e),e.parentId){const r=this.canalChildren.get(e.parentId)||[];r.push(e),r.sort((n,i)=>(n.forkChainage||0)-(i.forkChainage||0)),this.canalChildren.set(e.parentId,r)}}buildPointIndices(t){for(const e of t){e.ctrlTargetId&&(e.canalId=e.ctrlTargetId,e.chainage=-1);const r=this.existingPointsByCanalId.get(e.canalId)||[];r.push(e),this.existingPointsByCanalId.set(e.canalId,r)}for(const[e,r]of this.existingPointsByCanalId)r.sort((n,i)=>n.chainage-i.chainage),this.existingPointsByCanalId.set(e,r)}getCanalMap(){return this.canalMap}buildCanalNodeMap(t){const e=new Map;for(const r of t.canals)if(r.targetId){const n=e.get(r.targetId)||[];n.push({sourceCanalId:r.id,targetChainage:r.targetChainage||0}),e.set(r.targetId,n)}for(const r of t.canals){const n=[],i=this.existingPointsByCanalId.get(r.id)||[];for(const o of i)n.push({chainage:o.chainage,existingNode:o});const a=this.canalChildren.get(r.id)||[];for(const o of a)if(o.bankSide==="center"){const l=o.forkChainage||r.endChainage||1e4;n.push({chainage:l,auxType:"stream",linkTarget:{targetCanalId:o.id,targetChainage:o.startChainage||0}})}else{const l=o.forkChainage||0;n.push({chainage:l,auxType:"fork",branchId:o.id})}if(r.targetId&&this.canalMap.get(r.targetId)){const l=r.endChainage||1e4;n.push({chainage:l,auxType:"afflux",linkTarget:{targetCanalId:r.targetId,targetChainage:r.targetChainage||0}})}if(n.sort((o,l)=>o.chainage-l.chainage),(!r.parentId||r.parentId==="0")&&((e.get(r.id)||[]).some(u=>u.targetChainage===(r.startChainage||0))||n.unshift({chainage:r.startChainage||0,auxType:"start"})),n.length>0){const o=["end","stream","afflux"];n.every(u=>!o.includes(u.auxType))&&n.push({chainage:r.endChainage||0,auxType:"end"})}else!a.some(l=>l.bankSide==="center")&&!r.targetId&&n.push({chainage:r.endChainage||1e4,auxType:"end"});this.canalNodeMap.set(r.id,n)}this.formatCanalNodeMap()}detectJunctionNodes(){const t=new Map;for(const[e,r]of this.canalNodeMap)for(const n of r)if(n.auxType==="stream"&&n.linkTarget){const i=`${n.linkTarget.targetCanalId}:${n.linkTarget.targetChainage}`,a=t.get(i);a?(a.count++,a.sourceCanals.push(e)):t.set(i,{count:1,sourceCanals:[e],targetCanalId:n.linkTarget.targetCanalId,targetChainage:n.linkTarget.targetChainage})}for(const[e,r]of t){const n=this.canalNodeMap.get(r.targetCanalId);if(!n)continue;const i=r.targetChainage,a=n.find(l=>l.chainage===i),s=this.canalMap.get(r.targetCanalId),o=r.sourceCanals.length===1&&s?.parentId===r.sourceCanals[0];r.count>1?a&&!a.existingNode?a.auxType="afflux":a||(n.push({chainage:i,auxType:"afflux"}),n.sort((l,u)=>l.chainage-u.chainage)):o||a||(n.push({chainage:i,auxType:"stream",linkTarget:{targetCanalId:r.sourceCanals[0],targetChainage:0}}),n.sort((l,u)=>l.chainage-u.chainage))}}formatCanalNodeMap(){for(const[t,e]of this.canalNodeMap)for(const r of e)if((r.auxType==="stream"||r.auxType==="afflux")&&r.linkTarget){const n=t,i=r.chainage,a=r.linkTarget.targetCanalId,s=r.linkTarget.targetChainage,[o,l,u,c]=n<a?[n,i,a,s]:[a,s,n,i],f=`aux-${r.auxType}-${o}-${l}-${u}-${c}`;r.sharedNodeId=f;const d=this.canalNodeMap.get(a);d&&(d.push({chainage:s,auxType:r.auxType,sharedNodeId:f,linkTarget:{targetCanalId:t,targetChainage:i}}),d.sort((h,g)=>h.chainage-g.chainage))}}}var Kr=(A=>(A.Entity="entity",A.Aux="aux",A))(Kr||{});let vF=class{config;canalMap;constructor(t,e){this.config=t,this.canalMap=e}createAuxNode(t,e){const r=e.auxType,i={id:e.sharedNodeId||this.generateAuxNodeId(t,e),name:this.generateAuxNodeName(t,e),type:Kr.Aux,auxType:r,canalId:t.id,chainage:e.chainage,autoGenerated:!0};switch(r){case"fork":e.branchId&&(i.branchId=e.branchId);break;case"stream":case"afflux":e.linkTarget&&(i.properties={isCrossCanalConnection:!0,targetCanalId:e.linkTarget.targetCanalId,targetChainage:e.linkTarget.targetChainage});break}return i}generateAuxNodeId(t,e){const r=this.config.auxNodePrefix;switch(e.auxType){case"start":return`${r}-start-${t.id}`;case"end":return`${r}-end-${t.id}`;case"fork":return`${r}-fork-${e.branchId||t.id}`;case"afflux":return`${r}-afflux-${t.id}-${e.chainage}`;case"stream":return`${r}-link-${t.id}-${e.chainage}`;default:return`${r}-${t.id}-${e.chainage}`}}generateAuxNodeName(t,e){const r=e.auxType;switch(r){case"start":return`${t.name}起点`;case"end":return`${t.name}终点`;case"fork":return`${(e.branchId?this.canalMap.get(e.branchId):null)?.name||"支渠"}分叉`;case"afflux":case"stream":{const i=(e.linkTarget?.targetCanalId?this.canalMap.get(e.linkTarget.targetCanalId):null)?.name||"目标渠";return`${t.name}-${i} ${r=="afflux"?"汇合点":"连接点"}`}default:return`辅助节点-${e.chainage}`}}};class pF{config;nodeFactory;canalNodeMap;canalMap;constructor(t,e,r,n){this.config=t,this.nodeFactory=e,this.canalNodeMap=r,this.canalMap=n}generateAllPoints(){const t=[],e=new Set;for(const[r,n]of this.canalNodeMap){const i=this.canalMap.get(r);if(i){for(const a of n)if(a.existingNode)e.has(a.existingNode.id)||(t.push(a.existingNode),e.add(a.existingNode.id));else if(a.auxType&&this.config.generateAuxNodes){const s=this.nodeFactory.createAuxNode(i,a);e.has(s.id)||(t.push(s),e.add(s.id))}}}return t}getPointsForCanal(t){const e=[],r=this.canalNodeMap.get(t),n=this.canalMap.get(t);if(!r||!n)return e;for(const i of r)if(i.existingNode)e.push(i.existingNode);else if(i.auxType&&this.config.generateAuxNodes){const a=this.nodeFactory.createAuxNode(n,i);e.push(a)}return e}}class Zo{config;indexBuilder;constructor(t){this.config={...gF,...t},this.indexBuilder=new BF}preprocess(t){const e=this.indexBuilder.buildIndices(t),r=new vF(this.config,e.canalMap),i=new pF(this.config,r,e.canalNodeMap,e.canalMap).generateAllPoints();return{canals:t.canals,points:i,combos:t.combos||[],groups:t.groups||[]}}}function mF(A){return new Zo(A)}function Bd(A,t){return new Zo(t).preprocess(A)}function vd(A){return A.points.length<A.canals.length*2||!A.points.some(e=>e.type==="aux")&&A.canals.length>0}const lr={fill:"#655a45",fillOpacity:.3,stroke:"#FFAA00",strokeOpacity:1,lineWidth:2,lineDash:[6,4],bufferWidth:30};class yF{constructor(t,e,r){this.groupEntities=t,this.existingEdges=e,this.existingNodes=r}transform(){const t=[];for(const e of this.groupEntities){const r=this.createBufferNode(e);r&&t.push(r)}return t}createBufferNode(t){const e=t.memberIds||[];if(e.length===0)return null;const r=this.buildNodePositions(),n=t.style?.bandWidth||lr.bufferWidth,i=Wo({memberIds:e,edges:this.existingEdges.map(s=>({source:String(s.source),target:String(s.target)})),nodePositions:r,bufferWidth:n});if(!i)return null;const a=t.style||{};return{id:`buffer-polygon-${t.id}`,nodeShape:"buffer-polygon",data:{label:"",groupId:t.id,groupName:t.name,memberIds:e,isBufferPolygon:!0},style:{x:i.centerX,y:i.centerY,pathData:i.pathData,fill:a.fill||lr.fill,fillOpacity:a.fillOpacity??lr.fillOpacity,stroke:a.stroke||lr.stroke,strokeOpacity:a.strokeOpacity??lr.strokeOpacity,lineWidth:a.lineWidth??lr.lineWidth,lineDash:a.lineDash||lr.lineDash,zIndex:a.zIndex??-999}}}buildNodePositions(){const t=new Map;for(const e of this.existingNodes){const r=String(e.id),n=e.style,i=n?.x??0,a=n?.y??0;t.set(r,[i,a])}return t}}class wF{constructor(t){this.indexBuilder=t}transform(){const t=[];for(const[e,r]of this.indexBuilder.comboEntities){const n={id:e,type:"rect",comboType:r.name.includes("调度节点")?"area-group":"custom",data:{label:r.name},draggable:!0,style:{padding:[20,20,20,20],labelText:r.name,labelPlacement:"top",labelFontSize:14,fill:"#f0f5ff",fillOpacity:1,stroke:"#adc6ff",lineWidth:2,radius:10}},i=this.indexBuilder.comboToComboMap.get(e);i&&(n.combo=i);const a=r.style;if(a){const s=["fill","fillOpacity","stroke","strokeOpacity","lineWidth","lineDash","opacity","radius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","width","height","labelPlacement","labelFill","labelFontSize","labelOpacity"],o={};for(const l of s)l in a&&a[l]!==void 0&&(o[l]=a[l]);n.style={...n.style||{},...o},"draggable"in a&&typeof a.draggable=="boolean"&&(n.draggable=a.draggable)}t.push(n)}return t}}class CF{constructor(t,e=!0){this.indexBuilder=t,this.autoGenerateEdges=e}transform(t,e=[]){const r=new Set;if(e.forEach(s=>{s.id&&r.add(s.id)}),!this.autoGenerateEdges)return[];const n=this.generateChannelEdges(r),i=this.generateForkEdges(t.points,r),a=this.generateStreamEdges(t.points,r);return[...n,...i,...a]}generateChannelEdges(t){const e=[];for(const[r,n]of this.indexBuilder.pointsByCanalId){const i=this.indexBuilder.canalMap.get(r),a=i?.name||"";for(let s=0;s<n.length-1;s++){const o=n[s],l=n[s+1];if(!this.isValidEdge(o.id,l.id,t))continue;const u=this.shouldShowArrow(o,l),c=this.shouldShowLabel(l);e.push(this.createEdge(`edge-${o.id}-${l.id}`,o.id,l.id,"flow",!1,void 0,c?a:"",i?.style,u))}}return e}generateForkEdges(t,e){const r=[];for(const n of t){if(n.type!=="aux"||n.auxType!=="fork")continue;const i=n;if(!i.branchId)continue;const a=this.indexBuilder.canalMap.get(i.branchId),s=this.indexBuilder.pointsByCanalId.get(i.branchId);if(!s||s.length===0||!a)continue;const o=s[0].id;if(!this.isValidEdge(i.id,o,e))continue;const l=a.bankSide!=="center",u=a.bankSide==="left"?"up":"down",c=this.shouldShowArrow(i,s[0]),f=this.shouldShowLabel(s[0]);r.push(this.createEdge(`edge-${i.id}-${o}`,i.id,o,"flow",l,u,f?a.name:"",a.style,c))}return r}generateStreamEdges(t,e){const r=[];for(const n of t){if(n.type!=="aux"||n.auxType!=="stream")continue;const i=n,a=i.properties;if(!a?.targetCanalId||typeof a.targetCanalId!="string")continue;const s=a.targetCanalId,o=a.targetChainage||0,l=this.indexBuilder.pointsByCanalId.get(s);if(!l||l.length===0)continue;let u=l.find(h=>h.chainage===o);const c=this.indexBuilder.canalMap.get(s),f=c?.parentId===i.canalId;if(!u&&f&&(u=l[0]),!u||!this.isValidEdge(i.id,u.id,e))continue;const d=this.shouldShowLabel(u);r.push(this.createEdge(`edge-${i.id}-${u.id}`,i.id,u.id,"flow",!1,void 0,d&&c?.name||"",c?.style,!1))}return r}isValidEdge(t,e,r){return r.has(t)&&r.has(e)&&t!==e}shouldShowArrow(t,e){if(e.type!=="aux")return!1;const r=e;if((r.auxType||r.auxiliaryType)==="end"){const i=e.canalId;return!(this.indexBuilder.canalChildren.get(i)||[]).some(o=>o.bankSide==="center"&&o.forkChainage===e.chainage)}else if(r.auxType==="afflux")return r.canalId!==t?.canalId;return!1}shouldShowLabel(t){if(t.type!=="aux")return!1;const e=t,r=e.auxType||e.auxiliaryType;return r==="end"||r==="stream"||r==="afflux"}createEdge(t,e,r,n,i=!1,a,s,o,l=!1){const c={...Wh(n),endArrow:l,label:!!s,labelText:s||"",labelFontSize:o?.labelFontSize??16,labelFill:"#666",labelBackgroundFill:"rgba(255, 255, 255, 0.8)",labelBackgroundRadius:4,labelPadding:[2,6],...o};return c.flyMarker?.enabled&&(c.animate={type:"fly-marker",repeat:c.flyMarker.iterations??1/0,duration:c.flyMarker.duration??3e3,delay:c.flyMarker.delay??0,marker:{size:c.flyMarker.markerSize??5,fill:c.flyMarker.markerColor??"red"}}),{id:t,source:e,target:r,data:{label:s||""},edgeShape:c.shape||"line",connectionType:n||"flow",style:c}}}class qo{constructor(t=[],e=[],r=[]){this.groupEntities=t,this.existingEdges=e;for(const n of r)this.nodeMap.set(n.id,n)}static DEFAULT_STYLE={fill:"#FFAA00",fillOpacity:1,stroke:"#FFAA00",strokeOpacity:1,bandWidth:20,lineWidth:2,lineDash:[5,5],zIndex:-999};nodeMap=new Map;transform(){return[]}getGroupAuxNodeIds(){const t=new Set;for(const e of this.groupEntities){const r=new Set(e.memberIds||[]);if(r.size===0)continue;const n=this.buildExpandedNodeSet(r);for(const i of n)r.has(i)||t.add(i)}return t}createGroupEdges(t){const e=new Set(t.memberIds||[]);if(e.size===0)return[];const r=this.buildExpandedNodeSet(e);return this.findInternalEdges(r).map((i,a)=>this.cloneEdgeWithGroupStyle(i,t,a))}buildAdjacencyList(){const t=new Map;for(const e of this.existingEdges){const r=e.source,n=e.target;t.has(r)||t.set(r,new Set),t.has(n)||t.set(n,new Set),t.get(r).add(n),t.get(n).add(r)}return t}findPathBFS(t,e,r){if(e===r)return[e];if(!t.has(e)||!t.has(r))return[];const n=new Set,i=[{node:e,path:[e]}];for(n.add(e);i.length>0;){const{node:a,path:s}=i.shift(),o=t.get(a)||new Set;for(const l of o){if(l===r)return[...s,l];n.has(l)||(n.add(l),i.push({node:l,path:[...s,l]}))}}return[]}buildExpandedNodeSet(t){const e=new Set(t),r=[...t];if(r.length<2)return e;const n=this.buildAdjacencyList();for(let i=0;i<r.length;i++)for(let a=i+1;a<r.length;a++){const s=r[i],o=r[a],l=this.findPathBFS(n,s,o);if(l.length>0)for(const u of l)t.has(u)||e.add(u)}return e}findInternalEdges(t){return this.existingEdges.filter(e=>{const r=e.source,n=e.target;return t.has(r)&&t.has(n)})}cloneEdgeWithGroupStyle(t,e,r){const n=e.style||{},i={...qo.DEFAULT_STYLE,...n};return{id:`group-${e.id}-edge-${r}`,source:t.source,target:t.target,edgeShape:"band-edge",style:{fill:i.fill,fillOpacity:i.fillOpacity,bandWidth:i.bandWidth,lineWidth:i.lineWidth,stroke:i.stroke,strokeOpacity:i.strokeOpacity,lineDash:i.lineDash,endArrow:!1,startArrow:!1,...t.style?.router?{router:t.style.router}:{},zIndex:i.zIndex},data:{...t.data,groupId:e.id,isGroupEdge:!0,label:void 0}}}}class EF{canalMap=new Map;canalChildren=new Map;pointsByCanalId=new Map;nodeToComboMap=new Map;comboToComboMap=new Map;comboEntities=new Map;clear(){this.canalMap.clear(),this.canalChildren.clear(),this.pointsByCanalId.clear(),this.nodeToComboMap.clear(),this.comboToComboMap.clear(),this.comboEntities.clear()}build(t){this.clear();for(const e of t.canals)if(this.canalMap.set(e.id,e),e.parentId){const r=this.canalChildren.get(e.parentId)||[];r.push(e),this.canalChildren.set(e.parentId,r)}for(const e of t.points){const r=e.canalId;if(r){const i=this.pointsByCanalId.get(r)||[];i.push(e),this.pointsByCanalId.set(r,i)}const n=e.props||e.properties;if(n?.isCrossCanalConnection&&n.targetCanalId){const i=n.targetCanalId,a=this.pointsByCanalId.get(i)||[];a.find(s=>s.id===e.id)||(a.push(e),this.pointsByCanalId.set(i,a))}}if(t.combos){for(const e of t.combos)if(this.comboEntities.set(e.id,e),e.memberIds)for(const r of e.memberIds)this.nodeToComboMap.set(r,e.id)}for(const[e,r]of this.pointsByCanalId)r.sort((n,i)=>{const a=s=>{if(s.canalId===e)return s.chainage;const o=s.props||s.properties;return o?.isCrossCanalConnection&&o.targetCanalId===e?o.targetChainage:s.chainage};return a(n)-a(i)}),this.pointsByCanalId.set(e,r)}}class QF{constructor(t){this.nodeToComboMap=t}createNode(t,e){const r=this.getNodeShape(t),n=t.type===Kr.Aux?"auxiliary":t.subtype||"dispatchNode",i=zh(n);if(t.type===Kr.Aux){const l=t,c=(l.auxType||l.auxiliaryType)==="end",f=e?.stroke||Kt,d=e?.lineWidth!==void 0?e.lineWidth:Rt,h={id:t.id,data:{label:""},businessData:t,nodeShape:"rect",style:{...i,fill:c?"transparent":f,stroke:c?"transparent":f,lineWidth:0,radius:0,width:d,height:d}},g=this.nodeToComboMap.get(t.id);return g&&(h.combo=g),h}const a=t.style;if(a){const l=a.shape||r,u=t.props||{},c={id:t.id,data:{label:u.labelText||t.name,labelPlacement:u.labelPlacement,labelMaxWidth:u.labelMaxWidth,labelBackground:u.labelBackground,labelBackgroundFill:u.labelBackgroundFill,labelBackgroundFillOpacity:u.labelBackgroundFillOpacity,labelBackgroundRadius:u.labelBackgroundRadius,labelWordWrap:u.labelWordWrap,labelMaxLines:u.labelMaxLines},businessData:t,nodeShape:l,style:{...i,fill:a.fill||i.fill,stroke:a.stroke||i.stroke,lineWidth:a.lineWidth??i.lineWidth,radius:a.radius??i.radius,width:a.width||i.width,height:a.height||i.height,img:a.img||i.img,...a}},f=this.nodeToComboMap.get(t.id);return f&&(c.combo=f),c}const s={id:t.id,data:{label:t.name},businessData:t,nodeShape:r,style:{...i}},o=this.nodeToComboMap.get(t.id);return o&&(s.combo=o),s}getNodeShape(t){return t.type===Kr.Aux?"rect":{pumpStation:"rect",reservoir:"circle",sluice:"rect",dispatchUnit:"diamond",dispatchNode:"circle"}[t.subtype||""]||"circle"}}class FF{constructor(t,e,r,n,i){this.indexBuilder=t,this.nodeFactory=e,this.spacing=r,this.layoutDirection=n,this.centerPosition=i}canalNodeInfos=new Map;getCanalNodeInfos(){return this.canalNodeInfos}transformAndPosition(t){this.canalNodeInfos.clear();const e=[];t.points.forEach(g=>{g.style||(g.style={shape:"circle",width:24,height:24})});const r=t.canals.filter(g=>!g.parentId||g.parentId==="0"),n=r.find(g=>g.base)||r[0];if(!n)return e;const a=(this.indexBuilder.pointsByCanalId.get(n.id)||[]).length,s=this.centerPosition.x,o=this.centerPosition.y;let l,u,c=this.layoutDirection==="horizontal"?"horizontal":"down";n.direction==="reverse"&&(c=this.layoutDirection==="horizontal"?"horizontal-left":"up");const f=n.config?.space??this.spacing.main;if(this.layoutDirection==="horizontal"){const g=(a-1)*f;l=s-g/2,u=o}else{const g=(a-1)*f;l=s,u=o-g/2}this.processCanal(n,l,u,c,e,1);const d=r.filter(g=>g.id!==n.id);let h=!0;for(;d.length>0&&h;){h=!1;for(let g=0;g<d.length;g++){const p=d[g];if(!p)continue;let w,v;for(const m of this.indexBuilder.canalMap.values())if(m.targetId===p.id){w=m,v=this.canalNodeInfos.get(m.id);break}if(w&&!v)continue;let y=l,E=u,F=!1;if(v&&v.nodes.length>0){const m=v.nodes[v.nodes.length-1];if(m){const C=m.style;y=C.x,E=C.y,w.targetChainage,F=!0}}let U="down",T=y,B=E;if(F&&w&&v){const m=v.direction,C=w.targetBankSide;m==="up"?U=C==="right"?"horizontal":"horizontal-left":m==="down"?U=C==="right"?"horizontal-left":"horizontal":m==="horizontal"?U=C==="right"?"down":"up":m==="horizontal-left"&&(U=C==="right"?"up":"down"),p.direction==="reverse"&&(U==="horizontal"?U="horizontal-left":U==="horizontal-left"?U="horizontal":U==="up"?U="down":U==="down"&&(U="up"));const x=(this.indexBuilder.pointsByCanalId.get(p.id)||[]).findIndex(b=>(b.props||b.properties)?.isCrossCanalConnection),I=x>=0?x:0,H=p.config?.space??this.spacing.branch;U==="horizontal"||U==="horizontal-left"?(B=E,U==="horizontal"?T=y-I*H:T=y+I*H):(T=y,U==="down"?B=E-I*H:B=E+I*H)}else{const m=p.config?.space??this.spacing.branch;this.layoutDirection==="horizontal"?(U="down",p.direction==="reverse"&&(U="up"),T=y+m*3,B=u):(U="horizontal",p.direction==="reverse"&&(U="horizontal-left"),T=l,B=E+m*3)}this.processCanal(p,T,B,U,e,2),d.splice(g,1),g--,h=!0}}for(const g of d)this.processCanal(g,l+300,u+300,this.layoutDirection==="horizontal"?"down":"horizontal",e,2);return e}processCanal(t,e,r,n,i,a=1){const s=this.indexBuilder.pointsByCanalId.get(t.id)||[],o=[];let l=e,u=r;const f=this.isMainDirection(n)?this.spacing.main:this.spacing.branch,d=t.config?.space??f;for(let p=0;p<s.length;p++){const w=s[p],v=t.style,y=this.nodeFactory.createNode(w,v);if(y.style={...y.style||{},x:l,y:u},n==="horizontal"?l+=d:n==="horizontal-left"?l-=d:n==="up"?u-=d:u+=d,o.push(y),i.push(y),w.type==="aux"&&w.auxType==="fork"){const E=w;if(E.branchId){const F=this.indexBuilder.canalMap.get(E.branchId);if(F){const U=F.bankSide==="center",T=this.calculateBranchDirection(n,F),B=y.style.x,m=y.style.y,C=F.config?.space,{branchStartX:S,branchStartY:x}=this.calculateBranchStartPosition(B,m,T,U,C);this.processCanal(F,S,x,T,i,a+1)}}}}this.canalNodeInfos.set(t.id,{canalId:t.id,nodes:o,startX:e,startY:r,direction:n,level:a});const g=(this.indexBuilder.canalChildren.get(t.id)||[]).filter(p=>p.bankSide==="center");for(const p of g){const w=o[o.length-1];if(w){const v=w.style.x,y=w.style.y,E=this.calculateBranchDirection(n,p),F=p.config?.space,{branchStartX:U,branchStartY:T}=this.calculateBranchStartPosition(v,y,E,!0,F);this.processCanal(p,U,T,E,i,a)}}}isMainDirection(t){return this.layoutDirection==="horizontal"?t==="horizontal"||t==="horizontal-left":t==="up"||t==="down"}calculateBranchDirection(t,e){const r=e.bankSide,n=e.direction==="reverse";if(r==="center"){if(n)switch(t){case"horizontal":return"horizontal-left";case"horizontal-left":return"horizontal";case"up":return"down";case"down":return"up"}return t}let i;return t==="horizontal"||t==="horizontal-left"?(t==="horizontal"?i=r==="left"?"up":"down":i=r==="left"?"down":"up",n&&(i=i==="up"?"down":"up"),i):(t==="down"?i=r==="left"?"horizontal":"horizontal-left":i=r==="left"?"horizontal-left":"horizontal",n&&(i=i==="horizontal-left"?"horizontal":"horizontal-left"),i)}calculateBranchStartPosition(t,e,r,n=!1,i){let a=t,s=e;const o=n?this.spacing.main:this.spacing.branch,l=i??o;switch(r){case"up":s-=l;break;case"down":s+=l;break;case"horizontal":a+=l;break;case"horizontal-left":a-=l;break}return{branchStartX:a,branchStartY:s}}}const pd={main:150,branch:120,branchOffset:80},jo={spacing:pd,autoGenerateAuxiliary:!0,autoGenerateEdges:!0,centerPosition:{x:600,y:400},layoutDirection:"horizontal"};class La{config;spacing;layoutDirection;indexBuilder;nodeFactory;edgeFactory;comboFactory;constructor(t){this.config={...jo,...t,spacing:{...pd,...t?.spacing},centerPosition:t?.centerPosition||jo.centerPosition,layoutDirection:t?.layoutDirection||jo.layoutDirection},this.spacing=this.config.spacing,this.layoutDirection=this.config.layoutDirection,this.indexBuilder=new EF,this.nodeFactory=new QF(this.indexBuilder.nodeToComboMap),this.edgeFactory=new CF(this.indexBuilder,this.config.autoGenerateEdges),this.comboFactory=new wF(this.indexBuilder)}transform(t){let e=t;this.config.autoGenerateAuxiliary&&vd(t)&&(e=Bd(t,this.config.preprocessConfig)),this.indexBuilder.build(e);const n=new FF(this.indexBuilder,this.nodeFactory,this.spacing,this.layoutDirection,this.config.centerPosition).transformAndPosition(e),i=this.edgeFactory.transform(e,n);this.adjustEndNodeTransparency(n,i);const a=this.comboFactory.transform(),s=new qo(e.groups||[],i,n),o=s.transform();s.getGroupAuxNodeIds();const l=[...i,...o],c=new yF(e.groups||[],l,n).transform();return{nodes:[...n,...c],edges:l,combos:a,groups:e.groups}}adjustEndNodeTransparency(t,e){for(const r of t){const n=r.businessData;if(!n||!((n.auxType||n.auxiliaryType)==="end"))continue;const s=e.filter(l=>l.source===r.id);if(s.length===0)continue;const o=s[0]?.style;if(o&&r.style){const l=o.stroke||Kt,u=o.lineWidth||Rt;r.style.fill=l,r.style.stroke=l,r.style.width=u,r.style.height=u}}}hexToRgb(t){const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}rgbToHex(t,e,r){const n=i=>Math.round(i).toString(16).padStart(2,"0");return`#${n(t)}${n(e)}${n(r)}`}blendWithGroupColor(t){const e=this.hexToRgb(t),r=this.hexToRgb("#FFAA00"),n=.3;if(!e||!r)return"#FFAA00";const i=e.r*(1-n)+r.r*n,a=e.g*(1-n)+r.g*n,s=e.b*(1-n)+r.b*n;return this.rgbToHex(i,a,s)}applyGroupStyleToAuxNodes(t,e,r){if(e.size===0)return;const n=r[0]?.style||{},i=n.strokeOpacity??1,a=n.lineWidth||20,s=new Map;for(const o of t)s.set(o.id,o);for(const o of e){const l=s.get(o);if(!l||!l.style)continue;const u=l.businessData;if(!(u?.auxType||u?.auxiliaryType))continue;const f=l.style.fill||"#1890ff";this.blendWithGroupColor(f),l.style.fill="#17bb6f",l.style.stroke="#FFAA00",l.style.strokeOpacity=i,l.style.lineWidth=5,l.style.width=a-5,l.style.height=a-5}}setSpacing(t){this.spacing={...this.spacing,...t},this.config.spacing=this.spacing}setLayoutDirection(t){this.layoutDirection=t,this.config.layoutDirection=t}setCenterPosition(t,e){this.config.centerPosition={x:t,y:e}}getConfig(){return{...this.config}}getLayoutDirection(){return this.layoutDirection}}function UF(A){return new La(A)}function xF(A,t){return new La(t).transform(A)}function md(A,t,e){return new La({layoutDirection:t,centerPosition:e}).transform(A)}function yd(A){const{container:t,width:e,height:r,data:n,graphData:i,options:a={},autoInit:s=!0,layoutDirection:o="horizontal"}=A,l=Q.shallowRef(null),u=Q.shallowRef(null),c=Q.ref(!1),f=Q.ref(!1),d=Q.ref(o),h=Q.ref({loading:!1,rendered:!1,zoom:1,selectedNodes:[],selectedEdges:[]});async function g(){if(!(!t.value||c.value)){f.value=!0;try{l.value=new $o({container:t.value,width:e,height:r,...a}),u.value=await l.value.init(),c.value=!0,i?await p(i):n&&await w(n,d.value)}catch(D){throw console.error("Failed to initialize graph:",D),D}finally{f.value=!1}}}async function p(D){if(l.value){f.value=!0;try{await l.value.render(D),h.value=l.value.getState()}finally{f.value=!1}}}async function w(D,j){const JA=j??d.value;d.value=JA;const wA=t.value,_A=wA?wA.clientWidth/2:600,DA=wA?wA.clientHeight/2:400,hA=md(D,JA,{x:_A,y:DA});await p(hA)}async function v(D,j){await w(D,j)}async function y(D){l.value&&await l.value.updateData(D)}async function E(D){l.value&&await l.value.addNode(D)}async function F(D){l.value&&await l.value.addEdge(D)}async function U(D){l.value&&await l.value.removeNode(D)}async function T(D){l.value&&await l.value.removeEdge(D)}async function B(D,j){l.value&&await l.value.updateNode(D,j)}async function m(D,j){l.value&&await l.value.updateEdge(D,j)}function C(){l.value?.zoomIn(),l.value&&(h.value=l.value.getState())}function S(){l.value?.zoomOut(),l.value&&(h.value=l.value.getState())}function x(D){l.value?.zoomTo(D),l.value&&(h.value=l.value.getState())}function I(){l.value?.fitView()}function H(D){l.value?.focusNode(D)}function b(){return l.value?.getData()||{nodes:[],edges:[],combos:[]}}function k(){return l.value?.save()||"{}"}async function M(D){l.value&&await l.value.load(D)}async function L(D){return l.value?.toImage(D)||""}async function N(D){await l.value?.downloadImage(D)}function O(){l.value?.print()}async function z(D){l.value&&await l.value.setLayout(D)}function $(D,j){l.value?.resize(D,j)}function eA(D,j){l.value?.on(D,j)}function tA(D,j){l.value?.off(D,j)}function Z(){l.value?.destroy(),l.value=null,u.value=null,c.value=!1}return Q.onMounted(()=>{s&&t.value&&g()}),Q.onUnmounted(()=>{Z()}),Q.watch(t,D=>{D&&s&&!c.value&&g()}),{manager:l,graph:u,state:h,initialized:c,loading:f,init:g,render:p,renderFromData:w,changeLayoutDirection:v,updateData:y,addNode:E,addEdge:F,removeNode:U,removeEdge:T,updateNode:B,updateEdge:m,zoomIn:C,zoomOut:S,zoomTo:x,fitView:I,focusNode:H,getData:b,save:k,load:M,toImage:L,downloadImage:N,print:O,setLayout:z,resize:$,on:eA,off:tA,destroy:Z}}const bF={key:0,class:"irrigation-config-panel"},IF={class:"irrigation-config-panel__tabs"},SF={class:"irrigation-config-panel__content"},TF={key:0,class:"irrigation-config-panel__section"},MF={class:"irrigation-config-panel__item"},HF={class:"irrigation-config-panel__control"},kF=["value"],LF=["value"],NF={class:"irrigation-config-panel__item"},DF={class:"irrigation-config-panel__control"},PF=["value"],OF={class:"irrigation-config-panel__value"},RF={key:1,class:"irrigation-config-panel__section"},KF={class:"irrigation-config-panel__item"},_F={class:"irrigation-config-panel__control"},GF=["value"],VF=["value"],zF={class:"irrigation-config-panel__item"},WF={class:"irrigation-config-panel__control"},XF=["value"],YF={class:"irrigation-config-panel__value"},JF=Q.defineComponent({__name:"index",props:{visible:{type:Boolean,default:!1},activeTab:{default:"node"},config:{default:()=>({node:{...Ct},edge:{...Et}})}},emits:["close","tabChange","change","reset"],setup(A,{emit:t}){const e=A,r=t,n=Q.computed(()=>e.config?.node||{...Ct}),i=Q.computed(()=>e.config?.edge||{...Et});function a(){r("close")}function s(l){r("tabChange",l)}function o(l,u,c){r("change",{type:l,path:u,value:c})}return(l,u)=>A.visible?(Q.openBlock(),Q.createElementBlock("div",bF,[Q.createElementVNode("div",{class:"irrigation-config-panel__header"},[u[9]||(u[9]=Q.createElementVNode("span",{class:"irrigation-config-panel__title"},"样式配置",-1)),Q.createElementVNode("button",{class:"irrigation-config-panel__close",onClick:a},[...u[8]||(u[8]=[Q.createElementVNode("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},[Q.createElementVNode("line",{x1:"4",y1:"4",x2:"20",y2:"20",stroke:"currentColor","stroke-width":"2"}),Q.createElementVNode("line",{x1:"20",y1:"4",x2:"4",y2:"20",stroke:"currentColor","stroke-width":"2"})],-1)])])]),Q.createElementVNode("div",IF,[Q.createElementVNode("button",{class:Q.normalizeClass(["irrigation-config-panel__tab",{active:A.activeTab==="node"}]),onClick:u[0]||(u[0]=c=>s("node"))}," 节点 ",2),Q.createElementVNode("button",{class:Q.normalizeClass(["irrigation-config-panel__tab",{active:A.activeTab==="edge"}]),onClick:u[1]||(u[1]=c=>s("edge"))}," 边 ",2)]),Q.createElementVNode("div",SF,[A.activeTab==="node"?(Q.openBlock(),Q.createElementBlock("div",TF,[u[12]||(u[12]=Q.createElementVNode("h4",{class:"irrigation-config-panel__section-title"},"标签样式",-1)),Q.createElementVNode("div",MF,[u[10]||(u[10]=Q.createElementVNode("label",{class:"irrigation-config-panel__label"},"文字颜色",-1)),Q.createElementVNode("div",HF,[Q.createElementVNode("input",{type:"color",value:n.value.label?.fill,onInput:u[2]||(u[2]=c=>o("node","label.fill",c.target.value))},null,40,kF),Q.createElementVNode("input",{type:"text",class:"irrigation-config-panel__text-input",value:n.value.label?.fill,onChange:u[3]||(u[3]=c=>o("node","label.fill",c.target.value))},null,40,LF)])]),Q.createElementVNode("div",NF,[u[11]||(u[11]=Q.createElementVNode("label",{class:"irrigation-config-panel__label"},"字体大小",-1)),Q.createElementVNode("div",DF,[Q.createElementVNode("input",{type:"range",min:"10",max:"32",value:n.value.label?.fontSize,onInput:u[4]||(u[4]=c=>o("node","label.fontSize",Number(c.target.value)))},null,40,PF),Q.createElementVNode("span",OF,Q.toDisplayString(n.value.label?.fontSize)+"px",1)])])])):Q.createCommentVNode("",!0),A.activeTab==="edge"?(Q.openBlock(),Q.createElementBlock("div",RF,[u[15]||(u[15]=Q.createElementVNode("h4",{class:"irrigation-config-panel__section-title"},"标签样式",-1)),Q.createElementVNode("div",KF,[u[13]||(u[13]=Q.createElementVNode("label",{class:"irrigation-config-panel__label"},"文字颜色",-1)),Q.createElementVNode("div",_F,[Q.createElementVNode("input",{type:"color",value:i.value.label?.fill,onInput:u[5]||(u[5]=c=>o("edge","label.fill",c.target.value))},null,40,GF),Q.createElementVNode("input",{type:"text",class:"irrigation-config-panel__text-input",value:i.value.label?.fill,onChange:u[6]||(u[6]=c=>o("edge","label.fill",c.target.value))},null,40,VF)])]),Q.createElementVNode("div",zF,[u[14]||(u[14]=Q.createElementVNode("label",{class:"irrigation-config-panel__label"},"字体大小",-1)),Q.createElementVNode("div",WF,[Q.createElementVNode("input",{type:"range",min:"10",max:"32",value:i.value.label?.fontSize,onInput:u[7]||(u[7]=c=>o("edge","label.fontSize",Number(c.target.value)))},null,40,XF),Q.createElementVNode("span",YF,Q.toDisplayString(i.value.label?.fontSize)+"px",1)])])])):Q.createCommentVNode("",!0)])])):Q.createCommentVNode("",!0)}}),Dn=(A,t)=>{const e=A.__vccOpts||A;for(const[r,n]of t)e[r]=n;return e},$F=Dn(JF,[["__scopeId","data-v-4ab4bf56"]]),ZF={class:"element-editor__header"},qF={class:"element-editor__title"},jF={class:"element-editor__content"},AU={key:0,class:"element-editor__section"},eU={class:"element-editor__item"},tU={class:"element-editor__control"},rU=["checked"],nU={class:"element-editor__item"},iU={class:"element-editor__control"},aU=["value"],sU=["value"],oU={class:"element-editor__item"},lU={class:"element-editor__control"},uU=["value"],cU={class:"element-editor__item"},fU={class:"element-editor__control"},hU=["value"],dU={class:"element-editor__value"},gU={class:"element-editor__item"},BU={class:"element-editor__control"},vU=["value"],pU={class:"element-editor__value"},mU={class:"element-editor__item"},yU={class:"element-editor__control"},wU=["value"],CU={class:"element-editor__value"},EU={class:"element-editor__section"},QU={class:"element-editor__item"},FU={class:"element-editor__control"},UU=["value"],xU=["value"],bU={class:"element-editor__item"},IU={class:"element-editor__control"},SU=["value"],TU={class:"element-editor__value"},MU={class:"element-editor__section"},HU={class:"element-editor__item"},kU={class:"element-editor__control"},LU=["checked"],NU={class:"element-editor__item"},DU={class:"element-editor__control"},PU=["value"],OU={class:"element-editor__item"},RU={class:"element-editor__control"},KU=["value"],_U=["value"],GU={class:"element-editor__item"},VU={class:"element-editor__control"},zU=["value"],WU={class:"element-editor__value"},XU={class:"element-editor__item"},YU={class:"element-editor__control"},JU=["value"],$U={class:"element-editor__value"},ZU=Dn(Q.defineComponent({__name:"ElementEditor",props:{visible:{type:Boolean,default:!1},elementType:{default:"node"},elementId:{default:""},nodeConfig:{default:()=>({labelVisible:!0,labelFill:"#000000",labelPlacement:"bottom",labelFontSize:12,labelOffset:[0,0]})},edgeConfig:{default:()=>({labelVisible:!0,stroke:"#1890ff",lineWidth:2,labelPlacement:"center",labelFill:"#666666",labelFontSize:12,labelOffset:0})}},emits:["close","confirm","change"],setup(A,{emit:t}){const e=A,r=t,n=Q.reactive({labelVisible:!0,labelFill:"#000000",labelPlacement:"bottom",labelFontSize:12,labelOffset:[0,0]}),i=Q.reactive({labelVisible:!0,stroke:"#1890ff",lineWidth:2,labelPlacement:"center",labelFill:"#666666",labelFontSize:12,labelOffset:0}),a=Q.computed(()=>e.elementType==="node"?"编辑节点":"编辑边线");Q.watch(()=>e.visible,d=>{d&&(e.elementType==="node"?(Object.assign(n,e.nodeConfig),n.labelOffset||(n.labelOffset=[0,0])):Object.assign(i,e.edgeConfig))},{immediate:!0});function s(){r("close")}function o(){r("close")}function l(){const d=e.elementType==="node"?{...n}:{...i};r("confirm",{type:e.elementType,id:e.elementId,config:d})}function u(d,h){n[d]=h,r("change",{type:"node",id:e.elementId,config:{...n}})}function c(d,h){i[d]=h,r("change",{type:"edge",id:e.elementId,config:{...i}})}function f(d,h){n.labelOffset||(n.labelOffset=[0,0]),n.labelOffset[d]=h,r("change",{type:"node",id:e.elementId,config:{...n}})}return(d,h)=>A.visible?(Q.openBlock(),Q.createElementBlock("div",{key:0,class:"element-editor-overlay",onClick:o},[Q.createElementVNode("div",{class:"element-editor",onClick:h[16]||(h[16]=Q.withModifiers(()=>{},["stop"]))},[Q.createElementVNode("div",ZF,[Q.createElementVNode("span",qF,Q.toDisplayString(a.value),1),Q.createElementVNode("button",{class:"element-editor__close",onClick:s},[...h[17]||(h[17]=[Q.createElementVNode("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},[Q.createElementVNode("line",{x1:"4",y1:"4",x2:"20",y2:"20",stroke:"currentColor","stroke-width":"2"}),Q.createElementVNode("line",{x1:"20",y1:"4",x2:"4",y2:"20",stroke:"currentColor","stroke-width":"2"})],-1)])])]),Q.createElementVNode("div",jF,[A.elementType==="node"?(Q.openBlock(),Q.createElementBlock("div",AU,[h[25]||(h[25]=Q.createElementVNode("h4",{class:"element-editor__section-title"},"标签设置",-1)),Q.createElementVNode("div",eU,[h[18]||(h[18]=Q.createElementVNode("label",{class:"element-editor__label"},"显示标签",-1)),Q.createElementVNode("div",tU,[Q.createElementVNode("input",{type:"checkbox",checked:n.labelVisible,onChange:h[0]||(h[0]=g=>u("labelVisible",g.target.checked))},null,40,rU)])]),Q.createElementVNode("div",nU,[h[19]||(h[19]=Q.createElementVNode("label",{class:"element-editor__label"},"文字颜色",-1)),Q.createElementVNode("div",iU,[Q.createElementVNode("input",{type:"color",value:n.labelFill,onInput:h[1]||(h[1]=g=>u("labelFill",g.target.value))},null,40,aU),Q.createElementVNode("input",{type:"text",class:"element-editor__text-input",value:n.labelFill,onChange:h[2]||(h[2]=g=>u("labelFill",g.target.value))},null,40,sU)])]),Q.createElementVNode("div",oU,[h[21]||(h[21]=Q.createElementVNode("label",{class:"element-editor__label"},"标签位置",-1)),Q.createElementVNode("div",lU,[Q.createElementVNode("select",{value:n.labelPlacement,onChange:h[3]||(h[3]=g=>u("labelPlacement",g.target.value))},[...h[20]||(h[20]=[Q.createStaticVNode('<option value="top" data-v-3d348d7d>顶部</option><option value="bottom" data-v-3d348d7d>底部</option><option value="left" data-v-3d348d7d>左侧</option><option value="right" data-v-3d348d7d>右侧</option><option value="center" data-v-3d348d7d>中心</option>',5)])],40,uU)])]),Q.createElementVNode("div",cU,[h[22]||(h[22]=Q.createElementVNode("label",{class:"element-editor__label"},"字体大小",-1)),Q.createElementVNode("div",fU,[Q.createElementVNode("input",{type:"range",min:"10",max:"32",value:n.labelFontSize,onInput:h[4]||(h[4]=g=>u("labelFontSize",Number(g.target.value)))},null,40,hU),Q.createElementVNode("span",dU,Q.toDisplayString(n.labelFontSize)+"px",1)])]),Q.createElementVNode("div",gU,[h[23]||(h[23]=Q.createElementVNode("label",{class:"element-editor__label"},"标签间距 X",-1)),Q.createElementVNode("div",BU,[Q.createElementVNode("input",{type:"range",min:"-50",max:"50",value:n.labelOffset?.[0]??0,onInput:h[5]||(h[5]=g=>f(0,Number(g.target.value)))},null,40,vU),Q.createElementVNode("span",pU,Q.toDisplayString(n.labelOffset?.[0]??0)+"px",1)])]),Q.createElementVNode("div",mU,[h[24]||(h[24]=Q.createElementVNode("label",{class:"element-editor__label"},"标签间距 Y",-1)),Q.createElementVNode("div",yU,[Q.createElementVNode("input",{type:"range",min:"-50",max:"50",value:n.labelOffset?.[1]??0,onInput:h[6]||(h[6]=g=>f(1,Number(g.target.value)))},null,40,wU),Q.createElementVNode("span",CU,Q.toDisplayString(n.labelOffset?.[1]??0)+"px",1)])])])):Q.createCommentVNode("",!0),A.elementType==="edge"?(Q.openBlock(),Q.createElementBlock(Q.Fragment,{key:1},[Q.createElementVNode("div",EU,[h[28]||(h[28]=Q.createElementVNode("h4",{class:"element-editor__section-title"},"边线样式",-1)),Q.createElementVNode("div",QU,[h[26]||(h[26]=Q.createElementVNode("label",{class:"element-editor__label"},"边线颜色",-1)),Q.createElementVNode("div",FU,[Q.createElementVNode("input",{type:"color",value:i.stroke,onInput:h[7]||(h[7]=g=>c("stroke",g.target.value))},null,40,UU),Q.createElementVNode("input",{type:"text",class:"element-editor__text-input",value:i.stroke,onChange:h[8]||(h[8]=g=>c("stroke",g.target.value))},null,40,xU)])]),Q.createElementVNode("div",bU,[h[27]||(h[27]=Q.createElementVNode("label",{class:"element-editor__label"},"边线宽度",-1)),Q.createElementVNode("div",IU,[Q.createElementVNode("input",{type:"range",min:"1",max:"10",value:i.lineWidth,onInput:h[9]||(h[9]=g=>c("lineWidth",Number(g.target.value)))},null,40,SU),Q.createElementVNode("span",TU,Q.toDisplayString(i.lineWidth)+"px",1)])])]),Q.createElementVNode("div",MU,[h[35]||(h[35]=Q.createElementVNode("h4",{class:"element-editor__section-title"},"标签设置",-1)),Q.createElementVNode("div",HU,[h[29]||(h[29]=Q.createElementVNode("label",{class:"element-editor__label"},"显示标签",-1)),Q.createElementVNode("div",kU,[Q.createElementVNode("input",{type:"checkbox",checked:i.labelVisible,onChange:h[10]||(h[10]=g=>c("labelVisible",g.target.checked))},null,40,LU)])]),Q.createElementVNode("div",NU,[h[31]||(h[31]=Q.createElementVNode("label",{class:"element-editor__label"},"标签位置",-1)),Q.createElementVNode("div",DU,[Q.createElementVNode("select",{value:i.labelPlacement,onChange:h[11]||(h[11]=g=>c("labelPlacement",g.target.value))},[...h[30]||(h[30]=[Q.createElementVNode("option",{value:"start"},"起点",-1),Q.createElementVNode("option",{value:"center"},"中心",-1),Q.createElementVNode("option",{value:"end"},"终点",-1)])],40,PU)])]),Q.createElementVNode("div",OU,[h[32]||(h[32]=Q.createElementVNode("label",{class:"element-editor__label"},"文字颜色",-1)),Q.createElementVNode("div",RU,[Q.createElementVNode("input",{type:"color",value:i.labelFill,onInput:h[12]||(h[12]=g=>c("labelFill",g.target.value))},null,40,KU),Q.createElementVNode("input",{type:"text",class:"element-editor__text-input",value:i.labelFill,onChange:h[13]||(h[13]=g=>c("labelFill",g.target.value))},null,40,_U)])]),Q.createElementVNode("div",GU,[h[33]||(h[33]=Q.createElementVNode("label",{class:"element-editor__label"},"字体大小",-1)),Q.createElementVNode("div",VU,[Q.createElementVNode("input",{type:"range",min:"10",max:"32",value:i.labelFontSize,onInput:h[14]||(h[14]=g=>c("labelFontSize",Number(g.target.value)))},null,40,zU),Q.createElementVNode("span",WU,Q.toDisplayString(i.labelFontSize)+"px",1)])]),Q.createElementVNode("div",XU,[h[34]||(h[34]=Q.createElementVNode("label",{class:"element-editor__label"},"标签偏移",-1)),Q.createElementVNode("div",YU,[Q.createElementVNode("input",{type:"range",min:"-50",max:"50",value:i.labelOffset,onInput:h[15]||(h[15]=g=>c("labelOffset",Number(g.target.value)))},null,40,JU),Q.createElementVNode("span",$U,Q.toDisplayString(i.labelOffset)+"px",1)])])])],64)):Q.createCommentVNode("",!0)]),Q.createElementVNode("div",{class:"element-editor__footer"},[Q.createElementVNode("button",{class:"element-editor__confirm-btn",onClick:l}," 确定 ")])])])):Q.createCommentVNode("",!0)}}),[["__scopeId","data-v-3d348d7d"]]),qU={key:0,class:"evolution-timeline"},jU={class:"timeline-controls"},Ax=["title"],ex={key:0,class:"icon-pause"},tx={key:1,class:"icon-play"},rx=["disabled"],nx={class:"track-points"},ix=["onClick","title"],ax={key:0,class:"point-label"},sx=["disabled"],ox={class:"speed-control"},lx={key:0,class:"timeline-info"},ux={class:"current-label"},cx={class:"progress-text"},Al=Dn(Q.defineComponent({__name:"EvolutionTimeline",props:{manager:{},visible:{type:Boolean,default:!0},showLabels:{type:Boolean,default:!0},showInfo:{type:Boolean,default:!0}},emits:["change","play","pause","stop"],setup(A,{emit:t}){const e=A,r=t,n=Q.ref(0),i=Q.ref(!1),a=Q.ref(!1),s=Q.ref(0),o=Q.ref([]),l=Q.ref("1"),u=Q.ref(2e3),c=Q.ref(null),f=Q.computed(()=>s.value<=1?0:n.value/(s.value-1)*100),d=Q.computed(()=>n.value>0||a.value),h=Q.computed(()=>n.value<s.value-1||a.value),g=Q.computed(()=>o.value[n.value]||null);function p(b){return s.value<=1?50:b/(s.value-1)*100}function w(b){if(!b)return"";try{return new Date(b).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"})}catch{return String(b)}}function v(){e.manager&&(i.value?e.manager.pause():e.manager.play())}function y(){e.manager&&(a.value=!a.value,e.manager.setLoop(a.value))}function E(){e.manager?.prev()}function F(){e.manager?.next()}function U(){e.manager?.stop()}function T(){if(!e.manager)return;const b=parseFloat(l.value),k=u.value/b;e.manager.setSpeed(k)}function B(b){if(!e.manager||!c.value||s.value<=1)return;const k=c.value.getBoundingClientRect(),M=(b.clientX-k.left)/k.width,L=Math.round(M*(s.value-1));e.manager.jumpTo(L)}function m(b){e.manager?.jumpTo(b)}function C(){if(!e.manager)return;const b=e.manager.getState();n.value=b.currentIndex,i.value=b.isPlaying,a.value=b.loop,s.value=b.totalPoints,u.value=b.interval,o.value=e.manager.getTimePoints();const k=u.value/b.interval;l.value=String(k)}function S(b){n.value=b.currentIndex,i.value=b.isPlaying,s.value=b.totalPoints,r("change",b)}function x(){i.value=!0,r("play")}function I(){i.value=!1,r("pause")}function H(){i.value=!1,n.value=0,r("stop")}return Q.watch(()=>e.manager,(b,k)=>{k&&(k.off("change",S),k.off("play",x),k.off("pause",I),k.off("stop",H)),b&&(b.on("change",S),b.on("play",x),b.on("pause",I),b.on("stop",H),C())},{immediate:!0}),Q.onMounted(()=>{C()}),Q.onUnmounted(()=>{e.manager&&(e.manager.off("change",S),e.manager.off("play",x),e.manager.off("pause",I),e.manager.off("stop",H))}),(b,k)=>A.visible?(Q.openBlock(),Q.createElementBlock("div",qU,[Q.createElementVNode("div",jU,[Q.createElementVNode("button",{class:"control-btn play-btn",onClick:v,title:i.value?"暂停":"播放"},[i.value?(Q.openBlock(),Q.createElementBlock("span",ex,"❚❚")):(Q.openBlock(),Q.createElementBlock("span",tx,"▶"))],8,Ax),Q.createElementVNode("button",{class:"control-btn",onClick:E,title:"上一帧",disabled:!d.value}," ◀◀ ",8,rx),Q.createElementVNode("div",{class:"timeline-track",ref_key:"trackRef",ref:c,onClick:B},[k[2]||(k[2]=Q.createElementVNode("div",{class:"track-bg"},null,-1)),Q.createElementVNode("div",{class:"track-progress",style:Q.normalizeStyle({width:f.value+"%"})},null,4),Q.createElementVNode("div",nx,[(Q.openBlock(!0),Q.createElementBlock(Q.Fragment,null,Q.renderList(o.value,(M,L)=>(Q.openBlock(),Q.createElementBlock("div",{key:L,class:Q.normalizeClass(["track-point",{active:L===n.value,passed:L<n.value}]),style:Q.normalizeStyle({left:p(L)+"%"}),onClick:Q.withModifiers(N=>m(L),["stop"]),title:M.label||w(M.timestamp)},[k[1]||(k[1]=Q.createElementVNode("div",{class:"point-dot"},null,-1)),A.showLabels?(Q.openBlock(),Q.createElementBlock("div",ax,Q.toDisplayString(M.label||w(M.timestamp)),1)):Q.createCommentVNode("",!0)],14,ix))),128))])],512),Q.createElementVNode("button",{class:"control-btn",onClick:F,title:"下一帧",disabled:!h.value}," ▶▶ ",8,sx),Q.createElementVNode("button",{class:"control-btn",onClick:U,title:"停止"}," ■ "),Q.createElementVNode("div",ox,[Q.withDirectives(Q.createElementVNode("select",{"onUpdate:modelValue":k[0]||(k[0]=M=>l.value=M),onChange:T,title:"播放速度"},[...k[3]||(k[3]=[Q.createElementVNode("option",{value:"0.5"},"0.5x",-1),Q.createElementVNode("option",{value:"1"},"1x",-1),Q.createElementVNode("option",{value:"2"},"2x",-1),Q.createElementVNode("option",{value:"4"},"4x",-1)])],544),[[Q.vModelSelect,l.value]])]),Q.createElementVNode("button",{class:Q.normalizeClass(["control-btn loop-btn",{active:a.value}]),onClick:y,title:"循环播放"}," 🔁 ",2)]),A.showInfo?(Q.openBlock(),Q.createElementBlock("div",lx,[Q.createElementVNode("span",ux,Q.toDisplayString(g.value?.label||w(g.value?.timestamp)||"--"),1),Q.createElementVNode("span",cx,Q.toDisplayString(n.value+1)+" / "+Q.toDisplayString(s.value),1)])):Q.createCommentVNode("",!0)])):Q.createCommentVNode("",!0)}}),[["__scopeId","data-v-e89b8bda"]]),fx={class:"irrigation-toolbar"},hx={key:0,class:"irrigation-toolbar__section"},dx=["disabled"],gx={class:"irrigation-toolbar__btn-text"},Bx={class:"irrigation-toolbar__section"},vx=["disabled"],px={class:"irrigation-toolbar__section"},mx=["disabled"],yx={class:"irrigation-toolbar__section"},wx=["disabled"],Cx=["disabled"],Ex=Dn(Q.defineComponent({__name:"Toolbar",props:{enabledActions:{default:()=>({zoomIn:!0,zoomOut:!0,fitView:!0,export:!0,print:!0,layout:!0,config:!1})},configActive:{type:Boolean,default:!1}},emits:["action"],setup(A,{emit:t}){const e=t,r=(n,i)=>{e("action",n,i)};return(n,i)=>(Q.openBlock(),Q.createElementBlock("div",fx,[A.enabledActions.config?(Q.openBlock(),Q.createElementBlock("div",hx,[i[7]||(i[7]=Q.createElementVNode("span",{class:"irrigation-toolbar__label"},"配置:",-1)),Q.createElementVNode("button",{onClick:i[0]||(i[0]=()=>r("toggleConfig")),disabled:!A.enabledActions.config,class:Q.normalizeClass({"is-active":A.configActive})},[i[6]||(i[6]=Q.createElementVNode("svg",{class:"irrigation-toolbar__icon",viewBox:"0 0 24 24",width:"16",height:"16"},[Q.createElementVNode("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",fill:"none","stroke-width":"2"}),Q.createElementVNode("path",{d:"M12 1v6m0 6v6m4.22-10.22l4.24-4.24M6.34 17.66l-4.24 4.24M23 12h-6m-6 0H1m20.24 4.24l-4.24-4.24M6.34 6.34L2.1 2.1",stroke:"currentColor",fill:"none","stroke-width":"2"})],-1)),Q.createElementVNode("span",gx,Q.toDisplayString(A.configActive?"关闭配置":"配置"),1)],10,dx)])):Q.createCommentVNode("",!0),Q.createElementVNode("div",Bx,[i[9]||(i[9]=Q.createElementVNode("span",{class:"irrigation-toolbar__label"},"视图:",-1)),Q.createElementVNode("button",{onClick:i[1]||(i[1]=()=>r("fitView")),disabled:!A.enabledActions.fitView},[...i[8]||(i[8]=[Q.createElementVNode("svg",{class:"irrigation-toolbar__icon",viewBox:"0 0 24 24",width:"16",height:"16"},[Q.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"2",stroke:"currentColor",fill:"none","stroke-width":"2"}),Q.createElementVNode("path",{d:"M8 12h8M12 8v8",stroke:"currentColor","stroke-width":"2"})],-1),Q.createElementVNode("span",{class:"irrigation-toolbar__btn-text"},"适应",-1)])],8,vx)]),Q.createElementVNode("div",px,[i[12]||(i[12]=Q.createElementVNode("span",{class:"irrigation-toolbar__label"},"操作:",-1)),A.enabledActions.getData?(Q.openBlock(),Q.createElementBlock("button",{key:0,onClick:i[2]||(i[2]=()=>r("getData"))},[...i[10]||(i[10]=[Q.createElementVNode("svg",{class:"irrigation-toolbar__icon",viewBox:"0 0 24 24",width:"16",height:"16"},[Q.createElementVNode("path",{d:"M4 4h16v16H4z",stroke:"currentColor",fill:"none","stroke-width":"2"}),Q.createElementVNode("path",{d:"M8 12h8M8 16h8M8 8h8",stroke:"currentColor",fill:"none","stroke-width":"2"})],-1),Q.createElementVNode("span",{class:"irrigation-toolbar__btn-text"},"获取数据",-1)])])):Q.createCommentVNode("",!0),Q.createElementVNode("button",{onClick:i[3]||(i[3]=()=>r("export")),disabled:!A.enabledActions.export},[...i[11]||(i[11]=[Q.createStaticVNode('<svg class="irrigation-toolbar__icon" viewBox="0 0 24 24" width="16" height="16" data-v-51f467d7><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" stroke="currentColor" fill="none" stroke-width="2" data-v-51f467d7></path><polyline points="7 10 12 15 17 10" stroke="currentColor" fill="none" stroke-width="2" data-v-51f467d7></polyline><line x1="12" y1="15" x2="12" y2="3" stroke="currentColor" stroke-width="2" data-v-51f467d7></line></svg><span class="irrigation-toolbar__btn-text" data-v-51f467d7>导出</span>',2)])],8,mx)]),Q.createElementVNode("div",yx,[i[15]||(i[15]=Q.createElementVNode("span",{class:"irrigation-toolbar__label"},"布局:",-1)),Q.createElementVNode("button",{onClick:i[4]||(i[4]=()=>r("layoutHorizontal")),disabled:!A.enabledActions.layout},[...i[13]||(i[13]=[Q.createElementVNode("svg",{class:"irrigation-toolbar__icon",viewBox:"0 0 24 24",width:"16",height:"16"},[Q.createElementVNode("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2",stroke:"currentColor",fill:"none","stroke-width":"2"}),Q.createElementVNode("line",{x1:"12",y1:"3",x2:"12",y2:"21",stroke:"currentColor","stroke-width":"2"})],-1),Q.createElementVNode("span",{class:"irrigation-toolbar__btn-text"},"横向",-1)])],8,wx),Q.createElementVNode("button",{onClick:i[5]||(i[5]=()=>r("layoutVertical")),disabled:!A.enabledActions.layout},[...i[14]||(i[14]=[Q.createElementVNode("svg",{class:"irrigation-toolbar__icon",viewBox:"0 0 24 24",width:"16",height:"16"},[Q.createElementVNode("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2",stroke:"currentColor",fill:"none","stroke-width":"2"}),Q.createElementVNode("line",{x1:"3",y1:"12",x2:"21",y2:"12",stroke:"currentColor","stroke-width":"2"})],-1),Q.createElementVNode("span",{class:"irrigation-toolbar__btn-text"},"纵向",-1)])],8,Cx)])]))}}),[["__scopeId","data-v-51f467d7"]]),Qx={key:1,class:"irrigation-graph__loading"},wd=Dn(Q.defineComponent({__name:"IrrigationGraph",props:{width:{default:void 0},height:{default:void 0},data:{},graphData:{},layout:{},theme:{},tooltip:{},dataPanel:{},enableDrag:{type:Boolean,default:!0},enableZoom:{type:Boolean,default:!0},enableBrush:{type:Boolean,default:!1},enableMinimap:{type:Boolean,default:!1},fixElementSize:{type:Boolean,default:!1},fitView:{type:Boolean,default:!0},autoResize:{type:Boolean,default:!0},fitViewPadding:{},readonly:{type:Boolean,default:!1},showToolbar:{type:Boolean,default:!1},enabledToolbarActions:{default:()=>({zoomIn:!0,zoomOut:!0,fitView:!0,save:!0,export:!0,print:!0,layout:!0,getData:void 0})},evolution:{},evolutionData:{}},emits:["ready","itemClick","itemDblClick","itemContextMenu","selectionChange","canvasClick","dataChange","evolutionChange"],setup(A,{expose:t,emit:e}){const r=A,n=e,i=Q.ref(null),a=Q.ref(r.data),s=Q.ref("horizontal"),o=Q.shallowRef(null);let l=null;const u=Q.computed(()=>r.evolution?.enabled&&o.value!==null),c=Q.ref(!1),f=Q.ref("node"),d=Q.ref(""),h=Q.reactive({labelVisible:!0,labelFill:"#000000",labelPlacement:"bottom",labelFontSize:12,labelOffset:[0,0]}),g=Q.reactive({labelVisible:!0,stroke:"#1890ff",lineWidth:2,labelPlacement:"center",labelFill:"#666666",labelFontSize:12,labelOffset:0}),{manager:p,graph:w,state:v,initialized:y,loading:E,init:F,render:U,renderFromData:T,changeLayoutDirection:B,updateData:m,addNode:C,addEdge:S,removeNode:x,removeEdge:I,updateNode:H,updateEdge:b,zoomIn:k,zoomOut:M,zoomTo:L,fitView:N,resize:O,focusNode:z,getData:$,save:eA,load:tA,toImage:Z,downloadImage:D,print:j,setLayout:JA,on:wA,off:_A,destroy:DA}=yd({container:i,width:r.width,height:r.height,data:r.data,graphData:r.graphData,options:{layout:r.layout,theme:r.theme,tooltip:r.tooltip,dataPanel:r.dataPanel,enableDrag:r.enableDrag,enableZoom:r.enableZoom,enableBrush:r.enableBrush,enableMinimap:r.enableMinimap,fixElementSize:r.fixElementSize,fitView:r.fitView,fitViewPadding:r.fitViewPadding,evolution:r.evolution},autoInit:!1}),{configPanelVisible:hA,configActiveTab:PA,globalConfig:xA,toggleConfigPanel:rA,closeConfigPanel:LA,handleConfigTabChange:_r,handleConfigChange:Gr,handleConfigReset:Gt,updateNodeStyle:ur,updateEdgeStyle:cr}=Pd({manager:p,currentData:a,emit:(X,jA)=>n("dataChange",jA)}),Vr=Q.computed(()=>({width:r.width?`${r.width}px`:"100%",height:r.height?`${r.height}px`:"100%"}));function mt(){p.value&&(wA("node:click",X=>{n("itemClick",{type:"node",item:X.itemData})}),wA("node:dblclick",X=>{n("itemDblClick",{type:"node",item:X.itemData})}),wA("node:contextmenu",X=>{n("itemContextMenu",{type:"node",item:X.itemData,event:X.originalEvent})}),wA("edge:click",X=>{n("itemClick",{type:"edge",item:X.itemData})}),wA("edge:dblclick",X=>{n("itemDblClick",{type:"edge",item:X.itemData})}),wA("edge:contextmenu",X=>{n("itemContextMenu",{type:"edge",item:X.itemData,event:X.originalEvent})}),wA("combo:click",X=>{n("itemClick",{type:"combo",item:X.itemData})}),wA("combo:dblclick",X=>{n("itemDblClick",{type:"combo",item:X.itemData})}),wA("canvas:click",X=>{n("canvasClick",X.originalEvent)}),p.value.onContextMenu(fr))}function fr(X){X.menuValue==="edit"&&Ve(X.targetType,X.targetId,X.targetData)}function Ve(X,jA,hr){if(f.value=X,d.value=jA,X==="node"){const sA=hr.style||{};h.labelVisible=sA.label!==!1&&sA.label!=="",h.labelFill=sA.labelFill||"#000000",h.labelPlacement=sA.labelPlacement||"bottom",h.labelFontSize=sA.labelFontSize||12,h.labelOffset=sA.labelOffset||[0,0]}else{const sA=hr.style||{};g.labelVisible=sA.label!==!1&&sA.label!=="",g.stroke=sA.stroke||"#1890ff",g.lineWidth=sA.lineWidth||2,g.labelPlacement=sA.labelPlacement||"center",g.labelFill=sA.labelFill||"#666666",g.labelFontSize=sA.labelFontSize||12,g.labelOffset=sA.labelOffset||0}c.value=!0}function ze(){c.value=!1}async function yt(X){const{type:jA,id:hr,config:dr}=X;if(jA==="node"){const sA=dr,Pn={label:sA.labelVisible,labelFill:sA.labelFill,labelPlacement:sA.labelPlacement,labelFontSize:sA.labelFontSize,labelOffset:sA.labelOffset};await ur(hr,Pn)}else{const sA=dr,Pn={stroke:sA.stroke,lineWidth:sA.lineWidth,label:sA.labelVisible,labelPlacement:sA.labelPlacement,labelFill:sA.labelFill,labelFontSize:sA.labelFontSize,labelOffset:sA.labelOffset};await cr(hr,Pn)}c.value=!1}const wt={zoomIn:()=>k(),zoomOut:()=>M(),fitView:()=>N(),export:()=>D({fileName:"irrigation-graph"}),print:()=>j(),layoutHorizontal:()=>XA("horizontal"),layoutVertical:()=>XA("vertical"),toggleConfig:()=>rA(),getData:()=>{const X=$();r.enabledToolbarActions.getData?.(X)}};function qA(X){const jA=wt[X];jA?jA():console.warn(`[Toolbar] Unknown action: ${X}`)}async function XA(X){const jA=r.data??a.value;if(!jA){console.warn("No data available for layout change");return}s.value=X,a.value=jA,await B(jA,X),n("dataChange",$()),setTimeout(()=>{N()},100)}function Na(X){X.preventDefault()}Q.onMounted(async()=>{if(i.value&&(await F(),mt(),p.value&&(o.value=p.value.getEvolutionManager()),i.value.addEventListener("contextmenu",Na),n("ready",w.value),r.autoResize&&i.value)){const X=_a(()=>{O()},100);l=new ResizeObserver(()=>{X()}),l.observe(i.value)}}),Q.onUnmounted(()=>{l&&(l.disconnect(),l=null),i.value&&i.value.removeEventListener("contextmenu",Na),DA()}),Q.watch(()=>r.data,async X=>{X&&y.value&&(a.value=X,await T(X,s.value),n("dataChange",$()))},{deep:!0}),Q.watch(()=>r.dataPanel,X=>{p.value&&(X?.enabled?p.value.enableDataPanel(X):p.value.disableDataPanel())},{deep:!0}),Q.watch(()=>r.graphData,async X=>{X&&y.value&&(await U(X),n("dataChange",$()))},{deep:!0}),Q.watch(()=>r.evolutionData,X=>{X&&p.value&&(p.value.setEvolutionData(X),o.value=p.value.getEvolutionManager())},{deep:!0});function Da(X){n("evolutionChange",X)}function Pa(X){p.value&&(p.value.setEvolutionData(X),o.value=p.value.getEvolutionManager())}function el(){return o.value}return t({graph:w,manager:p,state:v,initialized:y,loading:E,currentLayoutDirection:s,render:U,renderFromData:T,changeLayout:XA,changeLayoutDirection:B,updateData:m,addNode:C,addEdge:S,removeNode:x,removeEdge:I,updateNode:H,updateEdge:b,getData:$,zoomIn:k,zoomOut:M,zoomTo:L,fitView:N,focusNode:z,resize:O,setLayout:JA,save:eA,load:tA,toImage:Z,downloadImage:D,print:j,on:wA,off:_A,layoutUtils:bd,evolutionManager:o,setEvolutionData:Pa,getEvolutionManager:el,destroy:DA}),(X,jA)=>(Q.openBlock(),Q.createElementBlock("div",{class:"irrigation-graph",style:Q.normalizeStyle(Vr.value)},[Q.renderSlot(X.$slots,"toolbar",{zoomIn:Q.unref(k),zoomOut:Q.unref(M),fitView:Q.unref(N)},void 0,!0),r.showToolbar?(Q.openBlock(),Q.createBlock(Ex,{key:0,"enabled-actions":r.enabledToolbarActions,"config-active":Q.unref(hA),onAction:qA},null,8,["enabled-actions","config-active"])):Q.createCommentVNode("",!0),Q.createElementVNode("div",{ref_key:"containerRef",ref:i,class:"irrigation-graph__canvas"},null,512),Q.unref(E)?(Q.openBlock(),Q.createElementBlock("div",Qx,[Q.renderSlot(X.$slots,"loading",{},()=>[jA[0]||(jA[0]=Q.createElementVNode("span",null,"加载中...",-1))],!0)])):Q.createCommentVNode("",!0),u.value?(Q.openBlock(),Q.createBlock(Al,{key:2,manager:o.value,visible:!0,onChange:Da},null,8,["manager"])):Q.createCommentVNode("",!0),Q.createVNode($F,{visible:Q.unref(hA),"active-tab":Q.unref(PA),config:Q.unref(xA),onClose:Q.unref(LA),onTabChange:Q.unref(_r),onChange:Q.unref(Gr),onReset:Q.unref(Gt)},null,8,["visible","active-tab","config","onClose","onTabChange","onChange","onReset"]),Q.createVNode(ZU,{visible:c.value,"element-type":f.value,"element-id":d.value,"node-config":h,"edge-config":g,onClose:ze,onConfirm:yt},null,8,["visible","element-type","element-id","node-config","edge-config"]),Q.renderSlot(X.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-4aae68e6"]]),Fx={install(A){A.component("IrrigationGraph",wd),A.component("EvolutionTimeline",Al)}};V.BufferNodeSyncController=od,V.ContextMenuManager=Jo,V.DEFAULT_ALARM_STYLES=fd,V.DEFAULT_EDGE_CONFIG=Et,V.DEFAULT_GLOBAL_CONFIG=Dd,V.DEFAULT_LABEL_CONFIG=Va,V.DEFAULT_NODE_CONFIG=Ct,V.DataPanelManager=ld,V.DataPreprocessor=Zo,V.DataTransformer=La,V.EvolutionManager=ka,V.EvolutionTimeline=Al,V.IrrigationCombo=Rh,V.IrrigationGraph=wd,V.IrrigationGraphManager=$o,V.PRESET_GRADIENTS=AF,V.PRESET_THEMES=Lo,V.PointNodeType=Kr,V.StyleUpdater=Xo,V.alignNodesHorizontally=rl,V.alignNodesVertically=nl,V.autoAdjustSpacing=ol,V.buildExpandedNodeSet=Vo,V.calculateEdgeGradient=ud,V.centerNodesToPosition=Ra,V.computeBufferPolygon=zo,V.computeBufferPolygonResult=Wo,V.copyToClipboard=Td,V.createBehaviors=dl,V.createContextMenuManager=rF,V.createDataPanelPlugin=ZQ,V.createEdgeConfig=dQ,V.createEdgeGradientStroke=cd,V.createEvolutionManager=tF,V.createGraphManager=dF,V.createNodeConfig=wQ,V.createPreprocessor=mF,V.createStyleUpdater=eF,V.createTheme=BQ,V.createTransformer=UF,V.debounce=_a,V.deepClone=Hd,V.default=Fx,V.deserializeGraphData=hl,V.distance=Ga,V.distributeNodesHorizontally=il,V.distributeNodesVertically=al,V.downloadJSON=Id,V.flipNodes=ll,V.generateId=Md,V.getConnectedNodes=sl,V.getDefaultEdgeStyle=Wh,V.getDefaultNodeStyle=zh,V.getEdgeDefaultStyle=hQ,V.getEdgeTypeName=fQ,V.getNodeDefaultStyle=yQ,V.getNodePosition=bA,V.getNodeTypeName=mQ,V.getNodesBoundingBox=Vt,V.getNodesByCanalId=Ka,V.mergeEdgeStyle=pQ,V.mergeNodeStyle=vQ,V.moveNodes=Rn,V.needsPreprocessing=vd,V.pointToSegmentDistance=Ld,V.preprocessData=Bd,V.readJSONFile=Sd,V.registerBufferPolygonNode=Gh,V.registerCustomCombos=Kh,V.registerCustomEdges=_h,V.registerCustomNodes=Xh,V.rotateNodes90=ul,V.serializeGraphData=fl,V.setNodePosition=pe,V.throttle=kd,V.transformData=xF,V.transformDataWithLayout=md,V.useIrrigationGraph=yd,V.validateGraphData=Nd,Object.defineProperties(V,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
59
|
+
`),t.document.close(),t.print())}class $o{graph=null;container=null;options;state={loading:!1,rendered:!1,zoom:1,selectedNodes:[],selectedEdges:[]};eventHandlers=new Map;dataPanelManager=null;evolutionManager=null;bufferLayerRenderer=null;contextMenuManager=null;bufferNodeSync=null;currentData=null;constructor(t){this.options=t,Xh(),_h(),Kh()}async init(){const t=typeof this.options.container=="string"?document.getElementById(this.options.container):this.options.container;if(!t)throw new Error("Container not found");this.container=t;const e=dl(this.options);return this.graph=new We.Graph({container:t,width:this.options.width||t.clientWidth,height:this.options.height||t.clientHeight,autoFit:this.options.fitView?"view":void 0,padding:this.options.fitViewPadding,background:"transparent",layout:hd(this.options.layout),behaviors:e,plugins:nF(this.options,this.currentData),node:{type:r=>r.nodeShape||"circle",style:r=>{const n=r,i=n.style||{},a=n.nodeShape==="image";if(n.nodeShape==="buffer-polygon")return{...i,zIndex:i.zIndex??-999,labelText:"",label:!1,icon:!1,badge:!1,port:!1,halo:!1};if(a&&i.img){const o=i.width||48,l=i.height||48,u={src:i.img,width:o,height:l,size:[o,l],labelText:n.data?.label||""};return i.fill&&(u.fill=i.fill),i.stroke&&(u.stroke=i.stroke),i.labelFill&&(u.labelFill=i.labelFill),i.labelFontSize&&(u.labelFontSize=i.labelFontSize||16),i.labelPlacement&&(u.labelPlacement=i.labelPlacement),u.zIndex=10,u}return{fill:i.fill||"#fff",stroke:i.stroke||"#1890ff",lineWidth:i.lineWidth??2,radius:i.radius??4,size:i.width?[i.width,i.height||i.width]:void 0,labelText:n.data?.label||"",...i}}},edge:{type:r=>{const n=r;return n.style?.router?"polyline":n.edgeShape||"band-edge"},style:r=>{const n=r,i=n.style||{},a={stroke:"#1890ff",lineWidth:2,endArrow:!0};!a.labelText&&n.data?.label&&(a.labelText=n.data.label),a.labelText&&(Object.assign(a,{labelFontSize:16,labelFill:"#666",labelBackgroundFill:"rgba(255, 255, 255, 0.9)",labelBackgroundRadius:4,labelPadding:[2,6]}),i.labelFontSize!==void 0&&(a.labelFontSize=i.labelFontSize),i.labelFill!==void 0&&(a.labelFill=i.labelFill),i.labelBackgroundFill!==void 0&&(a.labelBackgroundFill=i.labelBackgroundFill),i.labelBackgroundRadius!==void 0&&(a.labelBackgroundRadius=i.labelBackgroundRadius),i.labelPadding!==void 0&&(a.labelPadding=i.labelPadding)),Object.assign(a,i),i.router&&(a.router={type:"orth",offset:20,...typeof i.router=="object"?i.router:{}});const s=n.style;return s&&typeof s=="object"&&Object.assign(a,s),a}},combo:{type:"irrigation-combo",style:r=>{const n=r.style||{};return{padding:n.padding||[20,20,20,20],labelText:n.labelText||r.data?.label||"",labelPlacement:n.labelPlacement||"top",labelFontSize:n.labelFontSize||12,fill:n.fill||"#f3f9ff",stroke:n.stroke||"#1890ff",lineWidth:n.lineWidth||2,radius:n.radius||8,labelFill:"#333",labelBackground:!0,labelBackgroundFill:"#fff",labelBackgroundOpacity:.8,labelBackgroundRadius:4,labelBackgroundPadding:[2,4]}}}}),aF(this.graph,this.eventHandlers),this.dataPanelManager=new ld(this.options.dataPanel||{enabled:!1}),this.dataPanelManager.mount(this.graph,t),this.options.evolution?.enabled&&(this.evolutionManager=new ka(this.options.evolution),this.evolutionManager.mount(this.graph,this.dataPanelManager)),this.options.contextMenu?.enabled!==!1&&(this.contextMenuManager=new Jo(this.options.contextMenu),this.contextMenuManager.mount(this.graph,t)),this.options.enableMinimap&&this.listenCanvasResize(),this.state.rendered=!0,this.graph}async render(t){this.graph||await this.init(),this.currentData=t,this.state.loading=!0;try{await this.graph.setData(t),await this.graph.render(),t.groups&&t.groups.length>0&&(this.bufferNodeSync||(this.bufferNodeSync=new od),this.bufferNodeSync.init(this.graph,t.groups,t.edges||[])),this.dataPanelManager&&setTimeout(()=>{this.dataPanelManager?.updateConfig({})},100)}finally{this.state.loading=!1}}async updateData(t){if(!this.graph)return;const e=this.graph.getData(),r={nodes:t.nodes??e.nodes,edges:t.edges??e.edges,combos:t.combos??e.combos};await this.graph.setData(r),await this.graph.render()}async addNode(t){this.graph&&(await this.graph.addNodeData([t]),await this.graph.draw())}async addEdge(t){this.graph&&(await this.graph.addEdgeData([t]),await this.graph.draw())}async removeNode(t){this.graph&&(await this.graph.removeNodeData([t]),await this.graph.draw())}async removeEdge(t){this.graph&&(await this.graph.removeEdgeData([t]),await this.graph.draw())}async updateNode(t,e){this.graph&&(await this.graph.updateNodeData([{id:t,...e}]),await this.graph.draw())}async updateEdge(t,e){this.graph&&(await this.graph.updateEdgeData([{id:t,...e}]),await this.graph.draw())}zoomTo(t){this.graph&&(this.graph.zoomTo(t),this.state.zoom=t)}zoomIn(){const t=Math.min(this.state.zoom*1.2,5);this.zoomTo(t)}zoomOut(){const t=Math.max(this.state.zoom/1.2,.1);this.zoomTo(t)}fitView(){this.graph&&this.graph.fitView()}focusNode(t){this.graph&&this.graph.focusElement(t)}getData(){return dd(this.graph,this.currentData?.groups)}save(){return uF(this.graph)}async load(t){await cF(this.graph,t)}async toImage(t){return gd(this.graph,t)}async downloadImage(t){await fF(this.graph,t)}print(){hF(this.container)}getState(){return{...this.state}}getSelectedNodes(){return[...this.state.selectedNodes]}getSelectedEdges(){return[...this.state.selectedEdges]}async setLayout(t){if(!this.graph)return;const e=hd(t);this.graph.setLayout(e),await this.graph.layout()}getGraph(){return this.graph}getDataPanelManager(){return this.dataPanelManager}getEvolutionManager(){return this.evolutionManager}setEvolutionData(t){this.evolutionManager||(this.evolutionManager=new ka(this.options.evolution||{enabled:!0}),this.graph&&this.container&&this.evolutionManager.mount(this.graph,this.dataPanelManager||void 0)),this.evolutionManager.setData(t)}enableDataPanel(t){if(this.dataPanelManager&&(t&&this.dataPanelManager.updateConfig(t),this.dataPanelManager.enable(),this.graph)){const e=this.graph.getPlugins(),r=e.filter(n=>n.type!=="tooltip");r.length!==e.length&&this.graph.setPlugins(r)}}disableDataPanel(){if(this.dataPanelManager&&(this.dataPanelManager.disable(),this.graph&&this.options.tooltip?.enabled!==!1)){const t=this.graph.getPlugins();t.some(r=>r.type==="tooltip")||this.graph.setPlugins([...t,iF(this.options)])}}resize(t,e){if(!this.graph||!this.container)return;const r=t||this.container.clientWidth,n=e||this.container.clientHeight;this.graph.setSize(r,n)}resizeTimer=null;listenCanvasResize(){if(!this.graph||!this.container)return;new ResizeObserver(()=>{this.resizeTimer&&clearTimeout(this.resizeTimer),this.resizeTimer=window.setTimeout(()=>{this.updateMinimapPosition(),this.resizeTimer=null},150)}).observe(this.container)}updateMinimapPosition(){if(!this.container)return;const t=document.querySelector(".g6-minimap"),e=t?.offsetWidth||0,r=t?.offsetHeight||0;t&&(t.style.top=`calc(100% - ${r}px)`,t.style.left=`calc(100% - ${e}px)`)}destroy(){this.evolutionManager&&(this.evolutionManager.unmount(),this.evolutionManager=null),this.dataPanelManager&&(this.dataPanelManager.unmount(),this.dataPanelManager=null),this.contextMenuManager&&(this.contextMenuManager.unmount(),this.contextMenuManager=null),this.bufferLayerRenderer&&(this.bufferLayerRenderer.destroy(),this.bufferLayerRenderer=null),this.bufferNodeSync&&(this.bufferNodeSync.destroy(),this.bufferNodeSync=null),this.resizeTimer&&(clearTimeout(this.resizeTimer),this.resizeTimer=null),this.graph&&(this.graph.destroy(),this.graph=null),this.eventHandlers.clear(),this.state.rendered=!1}on(t,e){oF(this.eventHandlers,t,e)}off(t,e){lF(this.eventHandlers,t,e)}getContextMenuManager(){return this.contextMenuManager}enableContextMenu(){this.contextMenuManager&&this.contextMenuManager.enable()}disableContextMenu(){this.contextMenuManager&&this.contextMenuManager.disable()}onContextMenu(t){this.contextMenuManager&&this.contextMenuManager.on(t)}offContextMenu(t){this.contextMenuManager&&this.contextMenuManager.off(t)}}function dF(A){return new $o(A)}const gF={generateAuxNodes:!0,defaultNodeSpacing:1e3,auxNodePrefix:"aux"};class BF{canalMap=new Map;canalChildren=new Map;existingPointsByCanalId=new Map;canalNodeMap=new Map;buildIndices(t){return this.clear(),this.buildCanalIndices(t.canals),this.buildPointIndices(t.points),this.buildCanalNodeMap(t),{canalMap:this.canalMap,canalChildren:this.canalChildren,existingPointsByCanalId:this.existingPointsByCanalId,canalNodeMap:this.canalNodeMap}}clear(){this.canalMap.clear(),this.canalChildren.clear(),this.existingPointsByCanalId.clear(),this.canalNodeMap.clear()}buildCanalIndices(t){for(const e of t)if(this.canalMap.set(e.id,e),e.parentId){const r=this.canalChildren.get(e.parentId)||[];r.push(e),r.sort((n,i)=>(n.forkChainage||0)-(i.forkChainage||0)),this.canalChildren.set(e.parentId,r)}}buildPointIndices(t){for(const e of t){e.ctrlTargetId&&(e.canalId=e.ctrlTargetId,e.chainage=-1);const r=this.existingPointsByCanalId.get(e.canalId)||[];r.push(e),this.existingPointsByCanalId.set(e.canalId,r)}for(const[e,r]of this.existingPointsByCanalId)r.sort((n,i)=>n.chainage-i.chainage),this.existingPointsByCanalId.set(e,r)}getCanalMap(){return this.canalMap}buildCanalNodeMap(t){const e=new Map;for(const r of t.canals)if(r.targetId){const n=e.get(r.targetId)||[];n.push({sourceCanalId:r.id,targetChainage:r.targetChainage||0}),e.set(r.targetId,n)}for(const r of t.canals){const n=[],i=this.existingPointsByCanalId.get(r.id)||[];for(const o of i)n.push({chainage:o.chainage,existingNode:o});const a=this.canalChildren.get(r.id)||[];for(const o of a)if(o.bankSide==="center"){const l=o.forkChainage||r.endChainage||1e4;n.push({chainage:l,auxType:"stream",linkTarget:{targetCanalId:o.id,targetChainage:o.startChainage||0}})}else{const l=o.forkChainage||0;n.push({chainage:l,auxType:"fork",branchId:o.id})}if(r.targetId&&this.canalMap.get(r.targetId)){const l=r.endChainage||1e4;n.push({chainage:l,auxType:"afflux",linkTarget:{targetCanalId:r.targetId,targetChainage:r.targetChainage||0}})}if(n.sort((o,l)=>o.chainage-l.chainage),(!r.parentId||r.parentId==="0")&&((e.get(r.id)||[]).some(u=>u.targetChainage===(r.startChainage||0))||n.unshift({chainage:r.startChainage||0,auxType:"start"})),n.length>0){const o=["end","stream","afflux"];n.every(u=>!o.includes(u.auxType))&&n.push({chainage:r.endChainage||0,auxType:"end"})}else!a.some(l=>l.bankSide==="center")&&!r.targetId&&n.push({chainage:r.endChainage||1e4,auxType:"end"});this.canalNodeMap.set(r.id,n)}this.formatCanalNodeMap()}detectJunctionNodes(){const t=new Map;for(const[e,r]of this.canalNodeMap)for(const n of r)if(n.auxType==="stream"&&n.linkTarget){const i=`${n.linkTarget.targetCanalId}:${n.linkTarget.targetChainage}`,a=t.get(i);a?(a.count++,a.sourceCanals.push(e)):t.set(i,{count:1,sourceCanals:[e],targetCanalId:n.linkTarget.targetCanalId,targetChainage:n.linkTarget.targetChainage})}for(const[e,r]of t){const n=this.canalNodeMap.get(r.targetCanalId);if(!n)continue;const i=r.targetChainage,a=n.find(l=>l.chainage===i),s=this.canalMap.get(r.targetCanalId),o=r.sourceCanals.length===1&&s?.parentId===r.sourceCanals[0];r.count>1?a&&!a.existingNode?a.auxType="afflux":a||(n.push({chainage:i,auxType:"afflux"}),n.sort((l,u)=>l.chainage-u.chainage)):o||a||(n.push({chainage:i,auxType:"stream",linkTarget:{targetCanalId:r.sourceCanals[0],targetChainage:0}}),n.sort((l,u)=>l.chainage-u.chainage))}}formatCanalNodeMap(){for(const[t,e]of this.canalNodeMap)for(const r of e)if((r.auxType==="stream"||r.auxType==="afflux")&&r.linkTarget){const n=t,i=r.chainage,a=r.linkTarget.targetCanalId,s=r.linkTarget.targetChainage,[o,l,u,c]=n<a?[n,i,a,s]:[a,s,n,i],f=`aux-${r.auxType}-${o}-${l}-${u}-${c}`;r.sharedNodeId=f;const d=this.canalNodeMap.get(a);d&&(d.push({chainage:s,auxType:r.auxType,sharedNodeId:f,linkTarget:{targetCanalId:t,targetChainage:i}}),d.sort((h,g)=>h.chainage-g.chainage))}}}var Kr=(A=>(A.Entity="entity",A.Aux="aux",A))(Kr||{});let vF=class{config;canalMap;constructor(t,e){this.config=t,this.canalMap=e}createAuxNode(t,e){const r=e.auxType,i={id:e.sharedNodeId||this.generateAuxNodeId(t,e),name:this.generateAuxNodeName(t,e),type:Kr.Aux,auxType:r,canalId:t.id,chainage:e.chainage,autoGenerated:!0};switch(r){case"fork":e.branchId&&(i.branchId=e.branchId);break;case"stream":case"afflux":e.linkTarget&&(i.properties={isCrossCanalConnection:!0,targetCanalId:e.linkTarget.targetCanalId,targetChainage:e.linkTarget.targetChainage});break}return i}generateAuxNodeId(t,e){const r=this.config.auxNodePrefix;switch(e.auxType){case"start":return`${r}-start-${t.id}`;case"end":return`${r}-end-${t.id}`;case"fork":return`${r}-fork-${e.branchId||t.id}`;case"afflux":return`${r}-afflux-${t.id}-${e.chainage}`;case"stream":return`${r}-link-${t.id}-${e.chainage}`;default:return`${r}-${t.id}-${e.chainage}`}}generateAuxNodeName(t,e){const r=e.auxType;switch(r){case"start":return`${t.name}起点`;case"end":return`${t.name}终点`;case"fork":return`${(e.branchId?this.canalMap.get(e.branchId):null)?.name||"支渠"}分叉`;case"afflux":case"stream":{const i=(e.linkTarget?.targetCanalId?this.canalMap.get(e.linkTarget.targetCanalId):null)?.name||"目标渠";return`${t.name}-${i} ${r=="afflux"?"汇合点":"连接点"}`}default:return`辅助节点-${e.chainage}`}}};class pF{config;nodeFactory;canalNodeMap;canalMap;constructor(t,e,r,n){this.config=t,this.nodeFactory=e,this.canalNodeMap=r,this.canalMap=n}generateAllPoints(){const t=[],e=new Set;for(const[r,n]of this.canalNodeMap){const i=this.canalMap.get(r);if(i){for(const a of n)if(a.existingNode)e.has(a.existingNode.id)||(t.push(a.existingNode),e.add(a.existingNode.id));else if(a.auxType&&this.config.generateAuxNodes){const s=this.nodeFactory.createAuxNode(i,a);e.has(s.id)||(t.push(s),e.add(s.id))}}}return t}getPointsForCanal(t){const e=[],r=this.canalNodeMap.get(t),n=this.canalMap.get(t);if(!r||!n)return e;for(const i of r)if(i.existingNode)e.push(i.existingNode);else if(i.auxType&&this.config.generateAuxNodes){const a=this.nodeFactory.createAuxNode(n,i);e.push(a)}return e}}class Zo{config;indexBuilder;constructor(t){this.config={...gF,...t},this.indexBuilder=new BF}preprocess(t){const e=this.indexBuilder.buildIndices(t),r=new vF(this.config,e.canalMap),i=new pF(this.config,r,e.canalNodeMap,e.canalMap).generateAllPoints();return{canals:t.canals,points:i,combos:t.combos||[],groups:t.groups||[]}}}function mF(A){return new Zo(A)}function Bd(A,t){return new Zo(t).preprocess(A)}function vd(A){return A.points.length<A.canals.length*2||!A.points.some(e=>e.type==="aux")&&A.canals.length>0}const lr={fill:"#655a45",fillOpacity:.3,stroke:"#FFAA00",strokeOpacity:1,lineWidth:2,lineDash:[6,4],bufferWidth:30};class yF{constructor(t,e,r){this.groupEntities=t,this.existingEdges=e,this.existingNodes=r}transform(){const t=[];for(const e of this.groupEntities){const r=this.createBufferNode(e);r&&t.push(r)}return t}createBufferNode(t){const e=t.memberIds||[];if(e.length===0)return null;const r=this.buildNodePositions(),n=t.style?.bandWidth||lr.bufferWidth,i=Wo({memberIds:e,edges:this.existingEdges.map(s=>({source:String(s.source),target:String(s.target)})),nodePositions:r,bufferWidth:n});if(!i)return null;const a=t.style||{};return{id:`buffer-polygon-${t.id}`,nodeShape:"buffer-polygon",data:{label:"",groupId:t.id,groupName:t.name,memberIds:e,isBufferPolygon:!0},style:{x:i.centerX,y:i.centerY,pathData:i.pathData,fill:a.fill||lr.fill,fillOpacity:a.fillOpacity??lr.fillOpacity,stroke:a.stroke||lr.stroke,strokeOpacity:a.strokeOpacity??lr.strokeOpacity,lineWidth:a.lineWidth??lr.lineWidth,lineDash:a.lineDash||lr.lineDash,zIndex:a.zIndex??-999}}}buildNodePositions(){const t=new Map;for(const e of this.existingNodes){const r=String(e.id),n=e.style,i=n?.x??0,a=n?.y??0;t.set(r,[i,a])}return t}}class wF{constructor(t){this.indexBuilder=t}transform(){const t=[];for(const[e,r]of this.indexBuilder.comboEntities){const n={id:e,type:"rect",comboType:r.name.includes("调度节点")?"area-group":"custom",data:{label:r.name},draggable:!0,style:{padding:[20,20,20,20],labelText:r.name,labelPlacement:"top",labelFontSize:14,fill:"#f0f5ff",fillOpacity:1,stroke:"#adc6ff",lineWidth:2,radius:10}},i=this.indexBuilder.comboToComboMap.get(e);i&&(n.combo=i);const a=r.style;if(a){const s=["fill","fillOpacity","stroke","strokeOpacity","lineWidth","lineDash","opacity","radius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","width","height","labelPlacement","labelFill","labelFontSize","labelOpacity"],o={};for(const l of s)l in a&&a[l]!==void 0&&(o[l]=a[l]);n.style={...n.style||{},...o},"draggable"in a&&typeof a.draggable=="boolean"&&(n.draggable=a.draggable)}t.push(n)}return t}}class CF{constructor(t,e=!0){this.indexBuilder=t,this.autoGenerateEdges=e}transform(t,e=[]){const r=new Set;if(e.forEach(s=>{s.id&&r.add(s.id)}),!this.autoGenerateEdges)return[];const n=this.generateChannelEdges(r),i=this.generateForkEdges(t.points,r),a=this.generateStreamEdges(t.points,r);return[...n,...i,...a]}generateChannelEdges(t){const e=[];for(const[r,n]of this.indexBuilder.pointsByCanalId){const i=this.indexBuilder.canalMap.get(r),a=i?.name||"";for(let s=0;s<n.length-1;s++){const o=n[s],l=n[s+1];if(!this.isValidEdge(o.id,l.id,t))continue;const u=this.shouldShowArrow(o,l),c=this.shouldShowLabel(l);e.push(this.createEdge(`edge-${o.id}-${l.id}`,o.id,l.id,"flow",!1,void 0,c?a:"",i?.style,u))}}return e}generateForkEdges(t,e){const r=[];for(const n of t){if(n.type!=="aux"||n.auxType!=="fork")continue;const i=n;if(!i.branchId)continue;const a=this.indexBuilder.canalMap.get(i.branchId),s=this.indexBuilder.pointsByCanalId.get(i.branchId);if(!s||s.length===0||!a)continue;const o=s[0].id;if(!this.isValidEdge(i.id,o,e))continue;const l=a.bankSide!=="center",u=a.bankSide==="left"?"up":"down",c=this.shouldShowArrow(i,s[0]),f=this.shouldShowLabel(s[0]);r.push(this.createEdge(`edge-${i.id}-${o}`,i.id,o,"flow",l,u,f?a.name:"",a.style,c))}return r}generateStreamEdges(t,e){const r=[];for(const n of t){if(n.type!=="aux"||n.auxType!=="stream")continue;const i=n,a=i.properties;if(!a?.targetCanalId||typeof a.targetCanalId!="string")continue;const s=a.targetCanalId,o=a.targetChainage||0,l=this.indexBuilder.pointsByCanalId.get(s);if(!l||l.length===0)continue;let u=l.find(h=>h.chainage===o);const c=this.indexBuilder.canalMap.get(s),f=c?.parentId===i.canalId;if(!u&&f&&(u=l[0]),!u||!this.isValidEdge(i.id,u.id,e))continue;const d=this.shouldShowLabel(u);r.push(this.createEdge(`edge-${i.id}-${u.id}`,i.id,u.id,"flow",!1,void 0,d&&c?.name||"",c?.style,!1))}return r}isValidEdge(t,e,r){return r.has(t)&&r.has(e)&&t!==e}shouldShowArrow(t,e){if(e.type!=="aux")return!1;const r=e;if((r.auxType||r.auxiliaryType)==="end"){const i=e.canalId;return!(this.indexBuilder.canalChildren.get(i)||[]).some(o=>o.bankSide==="center"&&o.forkChainage===e.chainage)}else if(r.auxType==="afflux")return r.canalId!==t?.canalId;return!1}shouldShowLabel(t){if(t.type!=="aux")return!1;const e=t,r=e.auxType||e.auxiliaryType;return r==="end"||r==="stream"||r==="afflux"}createEdge(t,e,r,n,i=!1,a,s,o,l=!1){const c={...Wh(n),endArrow:l,label:!!s,labelText:s||"",labelFontSize:o?.labelFontSize??16,labelFill:"#666",labelBackgroundFill:"rgba(255, 255, 255, 0.8)",labelBackgroundRadius:4,labelPadding:[2,6],...o};return c.flyMarker?.enabled&&(c.animate={type:"fly-marker",repeat:c.flyMarker.iterations??1/0,duration:c.flyMarker.duration??3e3,delay:c.flyMarker.delay??0,marker:{size:c.flyMarker.markerSize??5,fill:c.flyMarker.markerColor??"red"}}),{id:t,source:e,target:r,data:{label:s||""},edgeShape:c.shape||"line",connectionType:n||"flow",style:c}}}class qo{constructor(t=[],e=[],r=[]){this.groupEntities=t,this.existingEdges=e;for(const n of r)this.nodeMap.set(n.id,n)}static DEFAULT_STYLE={fill:"#FFAA00",fillOpacity:1,stroke:"#FFAA00",strokeOpacity:1,bandWidth:20,lineWidth:2,lineDash:[5,5],zIndex:-999};nodeMap=new Map;transform(){return[]}getGroupAuxNodeIds(){const t=new Set;for(const e of this.groupEntities){const r=new Set(e.memberIds||[]);if(r.size===0)continue;const n=this.buildExpandedNodeSet(r);for(const i of n)r.has(i)||t.add(i)}return t}createGroupEdges(t){const e=new Set(t.memberIds||[]);if(e.size===0)return[];const r=this.buildExpandedNodeSet(e);return this.findInternalEdges(r).map((i,a)=>this.cloneEdgeWithGroupStyle(i,t,a))}buildAdjacencyList(){const t=new Map;for(const e of this.existingEdges){const r=e.source,n=e.target;t.has(r)||t.set(r,new Set),t.has(n)||t.set(n,new Set),t.get(r).add(n),t.get(n).add(r)}return t}findPathBFS(t,e,r){if(e===r)return[e];if(!t.has(e)||!t.has(r))return[];const n=new Set,i=[{node:e,path:[e]}];for(n.add(e);i.length>0;){const{node:a,path:s}=i.shift(),o=t.get(a)||new Set;for(const l of o){if(l===r)return[...s,l];n.has(l)||(n.add(l),i.push({node:l,path:[...s,l]}))}}return[]}buildExpandedNodeSet(t){const e=new Set(t),r=[...t];if(r.length<2)return e;const n=this.buildAdjacencyList();for(let i=0;i<r.length;i++)for(let a=i+1;a<r.length;a++){const s=r[i],o=r[a],l=this.findPathBFS(n,s,o);if(l.length>0)for(const u of l)t.has(u)||e.add(u)}return e}findInternalEdges(t){return this.existingEdges.filter(e=>{const r=e.source,n=e.target;return t.has(r)&&t.has(n)})}cloneEdgeWithGroupStyle(t,e,r){const n=e.style||{},i={...qo.DEFAULT_STYLE,...n};return{id:`group-${e.id}-edge-${r}`,source:t.source,target:t.target,edgeShape:"band-edge",style:{fill:i.fill,fillOpacity:i.fillOpacity,bandWidth:i.bandWidth,lineWidth:i.lineWidth,stroke:i.stroke,strokeOpacity:i.strokeOpacity,lineDash:i.lineDash,endArrow:!1,startArrow:!1,...t.style?.router?{router:t.style.router}:{},zIndex:i.zIndex},data:{...t.data,groupId:e.id,isGroupEdge:!0,label:void 0}}}}class EF{canalMap=new Map;canalChildren=new Map;pointsByCanalId=new Map;nodeToComboMap=new Map;comboToComboMap=new Map;comboEntities=new Map;clear(){this.canalMap.clear(),this.canalChildren.clear(),this.pointsByCanalId.clear(),this.nodeToComboMap.clear(),this.comboToComboMap.clear(),this.comboEntities.clear()}build(t){this.clear();for(const e of t.canals)if(this.canalMap.set(e.id,e),e.parentId){const r=this.canalChildren.get(e.parentId)||[];r.push(e),this.canalChildren.set(e.parentId,r)}for(const e of t.points){const r=e.canalId;if(r){const i=this.pointsByCanalId.get(r)||[];i.push(e),this.pointsByCanalId.set(r,i)}const n=e.props||e.properties;if(n?.isCrossCanalConnection&&n.targetCanalId){const i=n.targetCanalId,a=this.pointsByCanalId.get(i)||[];a.find(s=>s.id===e.id)||(a.push(e),this.pointsByCanalId.set(i,a))}}if(t.combos){for(const e of t.combos)if(this.comboEntities.set(e.id,e),e.memberIds)for(const r of e.memberIds)this.nodeToComboMap.set(r,e.id)}for(const[e,r]of this.pointsByCanalId)r.sort((n,i)=>{const a=s=>{if(s.canalId===e)return s.chainage;const o=s.props||s.properties;return o?.isCrossCanalConnection&&o.targetCanalId===e?o.targetChainage:s.chainage};return a(n)-a(i)}),this.pointsByCanalId.set(e,r)}}class QF{constructor(t){this.nodeToComboMap=t}createNode(t,e){const r=this.getNodeShape(t),n=t.type===Kr.Aux?"auxiliary":t.subtype||"dispatchNode",i=zh(n);if(t.type===Kr.Aux){const l=t,c=(l.auxType||l.auxiliaryType)==="end",f=e?.stroke||Kt,d=e?.lineWidth!==void 0?e.lineWidth:Rt,h={id:t.id,data:{label:""},businessData:t,nodeShape:"rect",style:{...i,fill:c?"transparent":f,stroke:c?"transparent":f,lineWidth:0,radius:0,width:d,height:d}},g=this.nodeToComboMap.get(t.id);return g&&(h.combo=g),h}const a=t.style;if(a){const l=a.shape||r,u=t.props||{},c={id:t.id,data:{label:u.labelText||t.name,labelPlacement:u.labelPlacement,labelMaxWidth:u.labelMaxWidth,labelBackground:u.labelBackground,labelBackgroundFill:u.labelBackgroundFill,labelBackgroundFillOpacity:u.labelBackgroundFillOpacity,labelBackgroundRadius:u.labelBackgroundRadius,labelWordWrap:u.labelWordWrap,labelMaxLines:u.labelMaxLines},businessData:t,nodeShape:l,style:{...i,fill:a.fill||i.fill,stroke:a.stroke||i.stroke,lineWidth:a.lineWidth??i.lineWidth,radius:a.radius??i.radius,width:a.width||i.width,height:a.height||i.height,img:a.img||i.img,...a}},f=this.nodeToComboMap.get(t.id);return f&&(c.combo=f),c}const s={id:t.id,data:{label:t.name},businessData:t,nodeShape:r,style:{...i}},o=this.nodeToComboMap.get(t.id);return o&&(s.combo=o),s}getNodeShape(t){return t.type===Kr.Aux?"rect":{pumpStation:"rect",reservoir:"circle",sluice:"rect",dispatchUnit:"diamond",dispatchNode:"circle"}[t.subtype||""]||"circle"}}class FF{constructor(t,e,r,n,i){this.indexBuilder=t,this.nodeFactory=e,this.spacing=r,this.layoutDirection=n,this.centerPosition=i}canalNodeInfos=new Map;getCanalNodeInfos(){return this.canalNodeInfos}transformAndPosition(t){this.canalNodeInfos.clear();const e=[];t.points.forEach(g=>{g.style||(g.style={shape:"circle",width:24,height:24})});const r=t.canals.filter(g=>!g.parentId||g.parentId==="0"),n=r.find(g=>g.base)||r[0];if(!n)return e;const a=(this.indexBuilder.pointsByCanalId.get(n.id)||[]).length,s=this.centerPosition.x,o=this.centerPosition.y;let l,u,c=this.layoutDirection==="horizontal"?"horizontal":"down";n.direction==="reverse"&&(c=this.layoutDirection==="horizontal"?"horizontal-left":"up");const f=n.config?.space??this.spacing.main;if(this.layoutDirection==="horizontal"){const g=(a-1)*f;l=s-g/2,u=o}else{const g=(a-1)*f;l=s,u=o-g/2}this.processCanal(n,l,u,c,e,1);const d=r.filter(g=>g.id!==n.id);let h=!0;for(;d.length>0&&h;){h=!1;for(let g=0;g<d.length;g++){const p=d[g];if(!p)continue;let w,v;for(const m of this.indexBuilder.canalMap.values())if(m.targetId===p.id){w=m,v=this.canalNodeInfos.get(m.id);break}if(w&&!v)continue;let y=l,E=u,F=!1;if(v&&v.nodes.length>0){const m=v.nodes[v.nodes.length-1];if(m){const C=m.style;y=C.x,E=C.y,w.targetChainage,F=!0}}let U="down",T=y,B=E;if(F&&w&&v){const m=v.direction,C=w.targetBankSide;m==="up"?U=C==="right"?"horizontal":"horizontal-left":m==="down"?U=C==="right"?"horizontal-left":"horizontal":m==="horizontal"?U=C==="right"?"down":"up":m==="horizontal-left"&&(U=C==="right"?"up":"down"),p.direction==="reverse"&&(U==="horizontal"?U="horizontal-left":U==="horizontal-left"?U="horizontal":U==="up"?U="down":U==="down"&&(U="up"));const x=(this.indexBuilder.pointsByCanalId.get(p.id)||[]).findIndex(b=>(b.props||b.properties)?.isCrossCanalConnection),I=x>=0?x:0,H=p.config?.space??this.spacing.branch;U==="horizontal"||U==="horizontal-left"?(B=E,U==="horizontal"?T=y-I*H:T=y+I*H):(T=y,U==="down"?B=E-I*H:B=E+I*H)}else{const m=p.config?.space??this.spacing.branch;this.layoutDirection==="horizontal"?(U="down",p.direction==="reverse"&&(U="up"),T=y+m*3,B=u):(U="horizontal",p.direction==="reverse"&&(U="horizontal-left"),T=l,B=E+m*3)}this.processCanal(p,T,B,U,e,2),d.splice(g,1),g--,h=!0}}for(const g of d)this.processCanal(g,l+300,u+300,this.layoutDirection==="horizontal"?"down":"horizontal",e,2);return e}processCanal(t,e,r,n,i,a=1){const s=this.indexBuilder.pointsByCanalId.get(t.id)||[],o=[];let l=e,u=r;const f=this.isMainDirection(n)?this.spacing.main:this.spacing.branch,d=t.config?.space??f;for(let p=0;p<s.length;p++){const w=s[p],v=t.style,y=this.nodeFactory.createNode(w,v);if(y.style={...y.style||{},x:l,y:u},n==="horizontal"?l+=d:n==="horizontal-left"?l-=d:n==="up"?u-=d:u+=d,o.push(y),i.push(y),w.type==="aux"&&w.auxType==="fork"){const E=w;if(E.branchId){const F=this.indexBuilder.canalMap.get(E.branchId);if(F){const U=F.bankSide==="center",T=this.calculateBranchDirection(n,F),B=y.style.x,m=y.style.y,C=F.config?.space,{branchStartX:S,branchStartY:x}=this.calculateBranchStartPosition(B,m,T,U,C);this.processCanal(F,S,x,T,i,a+1)}}}}this.canalNodeInfos.set(t.id,{canalId:t.id,nodes:o,startX:e,startY:r,direction:n,level:a});const g=(this.indexBuilder.canalChildren.get(t.id)||[]).filter(p=>p.bankSide==="center");for(const p of g){const w=o[o.length-1];if(w){const v=w.style.x,y=w.style.y,E=this.calculateBranchDirection(n,p),F=p.config?.space,{branchStartX:U,branchStartY:T}=this.calculateBranchStartPosition(v,y,E,!0,F);this.processCanal(p,U,T,E,i,a)}}}isMainDirection(t){return this.layoutDirection==="horizontal"?t==="horizontal"||t==="horizontal-left":t==="up"||t==="down"}calculateBranchDirection(t,e){const r=e.bankSide,n=e.direction==="reverse";if(r==="center"){if(n)switch(t){case"horizontal":return"horizontal-left";case"horizontal-left":return"horizontal";case"up":return"down";case"down":return"up"}return t}let i;return t==="horizontal"||t==="horizontal-left"?(t==="horizontal"?i=r==="left"?"up":"down":i=r==="left"?"down":"up",n&&(i=i==="up"?"down":"up"),i):(t==="down"?i=r==="left"?"horizontal":"horizontal-left":i=r==="left"?"horizontal-left":"horizontal",n&&(i=i==="horizontal-left"?"horizontal":"horizontal-left"),i)}calculateBranchStartPosition(t,e,r,n=!1,i){let a=t,s=e;const o=n?this.spacing.main:this.spacing.branch,l=i??o;switch(r){case"up":s-=l;break;case"down":s+=l;break;case"horizontal":a+=l;break;case"horizontal-left":a-=l;break}return{branchStartX:a,branchStartY:s}}}const pd={main:150,branch:120,branchOffset:80},jo={spacing:pd,autoGenerateAuxiliary:!0,autoGenerateEdges:!0,centerPosition:{x:600,y:400},layoutDirection:"horizontal"};class La{config;spacing;layoutDirection;indexBuilder;nodeFactory;edgeFactory;comboFactory;constructor(t){this.config={...jo,...t,spacing:{...pd,...t?.spacing},centerPosition:t?.centerPosition||jo.centerPosition,layoutDirection:t?.layoutDirection||jo.layoutDirection},this.spacing=this.config.spacing,this.layoutDirection=this.config.layoutDirection,this.indexBuilder=new EF,this.nodeFactory=new QF(this.indexBuilder.nodeToComboMap),this.edgeFactory=new CF(this.indexBuilder,this.config.autoGenerateEdges),this.comboFactory=new wF(this.indexBuilder)}transform(t){let e=t;this.config.autoGenerateAuxiliary&&vd(t)&&(e=Bd(t,this.config.preprocessConfig)),this.indexBuilder.build(e);const n=new FF(this.indexBuilder,this.nodeFactory,this.spacing,this.layoutDirection,this.config.centerPosition).transformAndPosition(e),i=this.edgeFactory.transform(e,n);this.adjustEndNodeTransparency(n,i);const a=this.comboFactory.transform(),s=new qo(e.groups||[],i,n),o=s.transform();s.getGroupAuxNodeIds();const l=[...i,...o],c=new yF(e.groups||[],l,n).transform();return{nodes:[...n,...c],edges:l,combos:a,groups:e.groups}}adjustEndNodeTransparency(t,e){for(const r of t){const n=r.businessData;if(!n||!((n.auxType||n.auxiliaryType)==="end"))continue;const s=e.filter(l=>l.source===r.id);if(s.length===0)continue;const o=s[0]?.style;if(o&&r.style){const l=o.stroke||Kt,u=o.lineWidth||Rt;r.style.fill=l,r.style.stroke=l,r.style.width=u,r.style.height=u}}}hexToRgb(t){const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}rgbToHex(t,e,r){const n=i=>Math.round(i).toString(16).padStart(2,"0");return`#${n(t)}${n(e)}${n(r)}`}blendWithGroupColor(t){const e=this.hexToRgb(t),r=this.hexToRgb("#FFAA00"),n=.3;if(!e||!r)return"#FFAA00";const i=e.r*(1-n)+r.r*n,a=e.g*(1-n)+r.g*n,s=e.b*(1-n)+r.b*n;return this.rgbToHex(i,a,s)}applyGroupStyleToAuxNodes(t,e,r){if(e.size===0)return;const n=r[0]?.style||{},i=n.strokeOpacity??1,a=n.lineWidth||20,s=new Map;for(const o of t)s.set(o.id,o);for(const o of e){const l=s.get(o);if(!l||!l.style)continue;const u=l.businessData;if(!(u?.auxType||u?.auxiliaryType))continue;const f=l.style.fill||"#1890ff";this.blendWithGroupColor(f),l.style.fill="#17bb6f",l.style.stroke="#FFAA00",l.style.strokeOpacity=i,l.style.lineWidth=5,l.style.width=a-5,l.style.height=a-5}}setSpacing(t){this.spacing={...this.spacing,...t},this.config.spacing=this.spacing}setLayoutDirection(t){this.layoutDirection=t,this.config.layoutDirection=t}setCenterPosition(t,e){this.config.centerPosition={x:t,y:e}}getConfig(){return{...this.config}}getLayoutDirection(){return this.layoutDirection}}function UF(A){return new La(A)}function xF(A,t){return new La(t).transform(A)}function md(A,t,e){return new La({layoutDirection:t,centerPosition:e}).transform(A)}function yd(A){const{container:t,width:e,height:r,data:n,graphData:i,options:a={},autoInit:s=!0,layoutDirection:o="horizontal"}=A,l=Q.shallowRef(null),u=Q.shallowRef(null),c=Q.ref(!1),f=Q.ref(!1),d=Q.ref(o),h=Q.ref({loading:!1,rendered:!1,zoom:1,selectedNodes:[],selectedEdges:[]});async function g(){if(!(!t.value||c.value)){f.value=!0;try{l.value=new $o({container:t.value,width:e,height:r,...a}),u.value=await l.value.init(),c.value=!0,i?await p(i):n&&await w(n,d.value)}catch(D){throw console.error("Failed to initialize graph:",D),D}finally{f.value=!1}}}async function p(D){if(l.value){f.value=!0;try{await l.value.render(D),h.value=l.value.getState()}finally{f.value=!1}}}async function w(D,j){const JA=j??d.value;d.value=JA;const wA=t.value,_A=wA?wA.clientWidth/2:600,DA=wA?wA.clientHeight/2:400,hA=md(D,JA,{x:_A,y:DA});await p(hA)}async function v(D,j){await w(D,j)}async function y(D){l.value&&await l.value.updateData(D)}async function E(D){l.value&&await l.value.addNode(D)}async function F(D){l.value&&await l.value.addEdge(D)}async function U(D){l.value&&await l.value.removeNode(D)}async function T(D){l.value&&await l.value.removeEdge(D)}async function B(D,j){l.value&&await l.value.updateNode(D,j)}async function m(D,j){l.value&&await l.value.updateEdge(D,j)}function C(){l.value?.zoomIn(),l.value&&(h.value=l.value.getState())}function S(){l.value?.zoomOut(),l.value&&(h.value=l.value.getState())}function x(D){l.value?.zoomTo(D),l.value&&(h.value=l.value.getState())}function I(){l.value?.fitView()}function H(D){l.value?.focusNode(D)}function b(){return l.value?.getData()||{nodes:[],edges:[],combos:[]}}function k(){return l.value?.save()||"{}"}async function M(D){l.value&&await l.value.load(D)}async function L(D){return l.value?.toImage(D)||""}async function N(D){await l.value?.downloadImage(D)}function O(){l.value?.print()}async function z(D){l.value&&await l.value.setLayout(D)}function $(D,j){l.value?.resize(D,j)}function eA(D,j){l.value?.on(D,j)}function tA(D,j){l.value?.off(D,j)}function Z(){l.value?.destroy(),l.value=null,u.value=null,c.value=!1}return Q.onMounted(()=>{s&&t.value&&g()}),Q.onUnmounted(()=>{Z()}),Q.watch(t,D=>{D&&s&&!c.value&&g()}),{manager:l,graph:u,state:h,initialized:c,loading:f,init:g,render:p,renderFromData:w,changeLayoutDirection:v,updateData:y,addNode:E,addEdge:F,removeNode:U,removeEdge:T,updateNode:B,updateEdge:m,zoomIn:C,zoomOut:S,zoomTo:x,fitView:I,focusNode:H,getData:b,save:k,load:M,toImage:L,downloadImage:N,print:O,setLayout:z,resize:$,on:eA,off:tA,destroy:Z}}const bF={key:0,class:"irrigation-config-panel"},IF={class:"irrigation-config-panel__tabs"},SF={class:"irrigation-config-panel__content"},TF={key:0,class:"irrigation-config-panel__section"},MF={class:"irrigation-config-panel__item"},HF={class:"irrigation-config-panel__control"},kF=["value"],LF=["value"],NF={class:"irrigation-config-panel__item"},DF={class:"irrigation-config-panel__control"},PF=["value"],OF={class:"irrigation-config-panel__value"},RF={key:1,class:"irrigation-config-panel__section"},KF={class:"irrigation-config-panel__item"},_F={class:"irrigation-config-panel__control"},GF=["value"],VF=["value"],zF={class:"irrigation-config-panel__item"},WF={class:"irrigation-config-panel__control"},XF=["value"],YF={class:"irrigation-config-panel__value"},JF=Q.defineComponent({__name:"index",props:{visible:{type:Boolean,default:!1},activeTab:{default:"node"},config:{default:()=>({node:{...Ct},edge:{...Et}})}},emits:["close","tabChange","change","reset"],setup(A,{emit:t}){const e=A,r=t,n=Q.computed(()=>e.config?.node||{...Ct}),i=Q.computed(()=>e.config?.edge||{...Et});function a(){r("close")}function s(l){r("tabChange",l)}function o(l,u,c){r("change",{type:l,path:u,value:c})}return(l,u)=>A.visible?(Q.openBlock(),Q.createElementBlock("div",bF,[Q.createElementVNode("div",{class:"irrigation-config-panel__header"},[u[9]||(u[9]=Q.createElementVNode("span",{class:"irrigation-config-panel__title"},"样式配置",-1)),Q.createElementVNode("button",{class:"irrigation-config-panel__close",onClick:a},[...u[8]||(u[8]=[Q.createElementVNode("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},[Q.createElementVNode("line",{x1:"4",y1:"4",x2:"20",y2:"20",stroke:"currentColor","stroke-width":"2"}),Q.createElementVNode("line",{x1:"20",y1:"4",x2:"4",y2:"20",stroke:"currentColor","stroke-width":"2"})],-1)])])]),Q.createElementVNode("div",IF,[Q.createElementVNode("button",{class:Q.normalizeClass(["irrigation-config-panel__tab",{active:A.activeTab==="node"}]),onClick:u[0]||(u[0]=c=>s("node"))}," 节点 ",2),Q.createElementVNode("button",{class:Q.normalizeClass(["irrigation-config-panel__tab",{active:A.activeTab==="edge"}]),onClick:u[1]||(u[1]=c=>s("edge"))}," 边 ",2)]),Q.createElementVNode("div",SF,[A.activeTab==="node"?(Q.openBlock(),Q.createElementBlock("div",TF,[u[12]||(u[12]=Q.createElementVNode("h4",{class:"irrigation-config-panel__section-title"},"标签样式",-1)),Q.createElementVNode("div",MF,[u[10]||(u[10]=Q.createElementVNode("label",{class:"irrigation-config-panel__label"},"文字颜色",-1)),Q.createElementVNode("div",HF,[Q.createElementVNode("input",{type:"color",value:n.value.label?.fill,onInput:u[2]||(u[2]=c=>o("node","label.fill",c.target.value))},null,40,kF),Q.createElementVNode("input",{type:"text",class:"irrigation-config-panel__text-input",value:n.value.label?.fill,onChange:u[3]||(u[3]=c=>o("node","label.fill",c.target.value))},null,40,LF)])]),Q.createElementVNode("div",NF,[u[11]||(u[11]=Q.createElementVNode("label",{class:"irrigation-config-panel__label"},"字体大小",-1)),Q.createElementVNode("div",DF,[Q.createElementVNode("input",{type:"range",min:"10",max:"32",value:n.value.label?.fontSize,onInput:u[4]||(u[4]=c=>o("node","label.fontSize",Number(c.target.value)))},null,40,PF),Q.createElementVNode("span",OF,Q.toDisplayString(n.value.label?.fontSize)+"px",1)])])])):Q.createCommentVNode("",!0),A.activeTab==="edge"?(Q.openBlock(),Q.createElementBlock("div",RF,[u[15]||(u[15]=Q.createElementVNode("h4",{class:"irrigation-config-panel__section-title"},"标签样式",-1)),Q.createElementVNode("div",KF,[u[13]||(u[13]=Q.createElementVNode("label",{class:"irrigation-config-panel__label"},"文字颜色",-1)),Q.createElementVNode("div",_F,[Q.createElementVNode("input",{type:"color",value:i.value.label?.fill,onInput:u[5]||(u[5]=c=>o("edge","label.fill",c.target.value))},null,40,GF),Q.createElementVNode("input",{type:"text",class:"irrigation-config-panel__text-input",value:i.value.label?.fill,onChange:u[6]||(u[6]=c=>o("edge","label.fill",c.target.value))},null,40,VF)])]),Q.createElementVNode("div",zF,[u[14]||(u[14]=Q.createElementVNode("label",{class:"irrigation-config-panel__label"},"字体大小",-1)),Q.createElementVNode("div",WF,[Q.createElementVNode("input",{type:"range",min:"10",max:"32",value:i.value.label?.fontSize,onInput:u[7]||(u[7]=c=>o("edge","label.fontSize",Number(c.target.value)))},null,40,XF),Q.createElementVNode("span",YF,Q.toDisplayString(i.value.label?.fontSize)+"px",1)])])])):Q.createCommentVNode("",!0)])])):Q.createCommentVNode("",!0)}}),Dn=(A,t)=>{const e=A.__vccOpts||A;for(const[r,n]of t)e[r]=n;return e},$F=Dn(JF,[["__scopeId","data-v-4ab4bf56"]]),ZF={class:"element-editor__header"},qF={class:"element-editor__title"},jF={class:"element-editor__content"},AU={key:0,class:"element-editor__section"},eU={class:"element-editor__item"},tU={class:"element-editor__control"},rU=["checked"],nU={class:"element-editor__item"},iU={class:"element-editor__control"},aU=["value"],sU=["value"],oU={class:"element-editor__item"},lU={class:"element-editor__control"},uU=["value"],cU={class:"element-editor__item"},fU={class:"element-editor__control"},hU=["value"],dU={class:"element-editor__value"},gU={class:"element-editor__item"},BU={class:"element-editor__control"},vU=["value"],pU={class:"element-editor__value"},mU={class:"element-editor__item"},yU={class:"element-editor__control"},wU=["value"],CU={class:"element-editor__value"},EU={class:"element-editor__section"},QU={class:"element-editor__item"},FU={class:"element-editor__control"},UU=["value"],xU=["value"],bU={class:"element-editor__item"},IU={class:"element-editor__control"},SU=["value"],TU={class:"element-editor__value"},MU={class:"element-editor__section"},HU={class:"element-editor__item"},kU={class:"element-editor__control"},LU=["checked"],NU={class:"element-editor__item"},DU={class:"element-editor__control"},PU=["value"],OU={class:"element-editor__item"},RU={class:"element-editor__control"},KU=["value"],_U=["value"],GU={class:"element-editor__item"},VU={class:"element-editor__control"},zU=["value"],WU={class:"element-editor__value"},XU={class:"element-editor__item"},YU={class:"element-editor__control"},JU=["value"],$U={class:"element-editor__value"},ZU=Dn(Q.defineComponent({__name:"ElementEditor",props:{visible:{type:Boolean,default:!1},elementType:{default:"node"},elementId:{default:""},nodeConfig:{default:()=>({labelVisible:!0,labelFill:"#000000",labelPlacement:"bottom",labelFontSize:12,labelOffset:[0,0]})},edgeConfig:{default:()=>({labelVisible:!0,stroke:"#1890ff",lineWidth:2,labelPlacement:"center",labelFill:"#666666",labelFontSize:12,labelOffset:0})}},emits:["close","confirm","change"],setup(A,{emit:t}){const e=A,r=t,n=Q.reactive({labelVisible:!0,labelFill:"#000000",labelPlacement:"bottom",labelFontSize:12,labelOffset:[0,0]}),i=Q.reactive({labelVisible:!0,stroke:"#1890ff",lineWidth:2,labelPlacement:"center",labelFill:"#666666",labelFontSize:12,labelOffset:0}),a=Q.computed(()=>e.elementType==="node"?"编辑节点":"编辑边线");Q.watch(()=>e.visible,d=>{d&&(e.elementType==="node"?(Object.assign(n,e.nodeConfig),n.labelOffset||(n.labelOffset=[0,0])):Object.assign(i,e.edgeConfig))},{immediate:!0});function s(){r("close")}function o(){r("close")}function l(){const d=e.elementType==="node"?{...n}:{...i};r("confirm",{type:e.elementType,id:e.elementId,config:d})}function u(d,h){n[d]=h,r("change",{type:"node",id:e.elementId,config:{...n}})}function c(d,h){i[d]=h,r("change",{type:"edge",id:e.elementId,config:{...i}})}function f(d,h){n.labelOffset||(n.labelOffset=[0,0]),n.labelOffset[d]=h,r("change",{type:"node",id:e.elementId,config:{...n}})}return(d,h)=>A.visible?(Q.openBlock(),Q.createElementBlock("div",{key:0,class:"element-editor-overlay",onClick:o},[Q.createElementVNode("div",{class:"element-editor",onClick:h[16]||(h[16]=Q.withModifiers(()=>{},["stop"]))},[Q.createElementVNode("div",ZF,[Q.createElementVNode("span",qF,Q.toDisplayString(a.value),1),Q.createElementVNode("button",{class:"element-editor__close",onClick:s},[...h[17]||(h[17]=[Q.createElementVNode("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},[Q.createElementVNode("line",{x1:"4",y1:"4",x2:"20",y2:"20",stroke:"currentColor","stroke-width":"2"}),Q.createElementVNode("line",{x1:"20",y1:"4",x2:"4",y2:"20",stroke:"currentColor","stroke-width":"2"})],-1)])])]),Q.createElementVNode("div",jF,[A.elementType==="node"?(Q.openBlock(),Q.createElementBlock("div",AU,[h[25]||(h[25]=Q.createElementVNode("h4",{class:"element-editor__section-title"},"标签设置",-1)),Q.createElementVNode("div",eU,[h[18]||(h[18]=Q.createElementVNode("label",{class:"element-editor__label"},"显示标签",-1)),Q.createElementVNode("div",tU,[Q.createElementVNode("input",{type:"checkbox",checked:n.labelVisible,onChange:h[0]||(h[0]=g=>u("labelVisible",g.target.checked))},null,40,rU)])]),Q.createElementVNode("div",nU,[h[19]||(h[19]=Q.createElementVNode("label",{class:"element-editor__label"},"文字颜色",-1)),Q.createElementVNode("div",iU,[Q.createElementVNode("input",{type:"color",value:n.labelFill,onInput:h[1]||(h[1]=g=>u("labelFill",g.target.value))},null,40,aU),Q.createElementVNode("input",{type:"text",class:"element-editor__text-input",value:n.labelFill,onChange:h[2]||(h[2]=g=>u("labelFill",g.target.value))},null,40,sU)])]),Q.createElementVNode("div",oU,[h[21]||(h[21]=Q.createElementVNode("label",{class:"element-editor__label"},"标签位置",-1)),Q.createElementVNode("div",lU,[Q.createElementVNode("select",{value:n.labelPlacement,onChange:h[3]||(h[3]=g=>u("labelPlacement",g.target.value))},[...h[20]||(h[20]=[Q.createStaticVNode('<option value="top" data-v-22b8de4b>顶部</option><option value="bottom" data-v-22b8de4b>底部</option><option value="left" data-v-22b8de4b>左侧</option><option value="right" data-v-22b8de4b>右侧</option><option value="center" data-v-22b8de4b>中心</option>',5)])],40,uU)])]),Q.createElementVNode("div",cU,[h[22]||(h[22]=Q.createElementVNode("label",{class:"element-editor__label"},"字体大小",-1)),Q.createElementVNode("div",fU,[Q.createElementVNode("input",{type:"range",min:"10",max:"32",value:n.labelFontSize,onInput:h[4]||(h[4]=g=>u("labelFontSize",Number(g.target.value)))},null,40,hU),Q.createElementVNode("span",dU,Q.toDisplayString(n.labelFontSize)+"px",1)])]),Q.createElementVNode("div",gU,[h[23]||(h[23]=Q.createElementVNode("label",{class:"element-editor__label"},"标签间距 X",-1)),Q.createElementVNode("div",BU,[Q.createElementVNode("input",{type:"range",min:"-50",max:"50",value:n.labelOffset?.[0]??0,onInput:h[5]||(h[5]=g=>f(0,Number(g.target.value)))},null,40,vU),Q.createElementVNode("span",pU,Q.toDisplayString(n.labelOffset?.[0]??0)+"px",1)])]),Q.createElementVNode("div",mU,[h[24]||(h[24]=Q.createElementVNode("label",{class:"element-editor__label"},"标签间距 Y",-1)),Q.createElementVNode("div",yU,[Q.createElementVNode("input",{type:"range",min:"-50",max:"50",value:n.labelOffset?.[1]??0,onInput:h[6]||(h[6]=g=>f(1,Number(g.target.value)))},null,40,wU),Q.createElementVNode("span",CU,Q.toDisplayString(n.labelOffset?.[1]??0)+"px",1)])])])):Q.createCommentVNode("",!0),A.elementType==="edge"?(Q.openBlock(),Q.createElementBlock(Q.Fragment,{key:1},[Q.createElementVNode("div",EU,[h[28]||(h[28]=Q.createElementVNode("h4",{class:"element-editor__section-title"},"边线样式",-1)),Q.createElementVNode("div",QU,[h[26]||(h[26]=Q.createElementVNode("label",{class:"element-editor__label"},"边线颜色",-1)),Q.createElementVNode("div",FU,[Q.createElementVNode("input",{type:"color",value:i.stroke,onInput:h[7]||(h[7]=g=>c("stroke",g.target.value))},null,40,UU),Q.createElementVNode("input",{type:"text",class:"element-editor__text-input",value:i.stroke,onChange:h[8]||(h[8]=g=>c("stroke",g.target.value))},null,40,xU)])]),Q.createElementVNode("div",bU,[h[27]||(h[27]=Q.createElementVNode("label",{class:"element-editor__label"},"边线宽度",-1)),Q.createElementVNode("div",IU,[Q.createElementVNode("input",{type:"range",min:"1",max:"10",value:i.lineWidth,onInput:h[9]||(h[9]=g=>c("lineWidth",Number(g.target.value)))},null,40,SU),Q.createElementVNode("span",TU,Q.toDisplayString(i.lineWidth)+"px",1)])])]),Q.createElementVNode("div",MU,[h[35]||(h[35]=Q.createElementVNode("h4",{class:"element-editor__section-title"},"标签设置",-1)),Q.createElementVNode("div",HU,[h[29]||(h[29]=Q.createElementVNode("label",{class:"element-editor__label"},"显示标签",-1)),Q.createElementVNode("div",kU,[Q.createElementVNode("input",{type:"checkbox",checked:i.labelVisible,onChange:h[10]||(h[10]=g=>c("labelVisible",g.target.checked))},null,40,LU)])]),Q.createElementVNode("div",NU,[h[31]||(h[31]=Q.createElementVNode("label",{class:"element-editor__label"},"标签位置",-1)),Q.createElementVNode("div",DU,[Q.createElementVNode("select",{value:i.labelPlacement,onChange:h[11]||(h[11]=g=>c("labelPlacement",g.target.value))},[...h[30]||(h[30]=[Q.createElementVNode("option",{value:"start"},"起点",-1),Q.createElementVNode("option",{value:"center"},"中心",-1),Q.createElementVNode("option",{value:"end"},"终点",-1)])],40,PU)])]),Q.createElementVNode("div",OU,[h[32]||(h[32]=Q.createElementVNode("label",{class:"element-editor__label"},"文字颜色",-1)),Q.createElementVNode("div",RU,[Q.createElementVNode("input",{type:"color",value:i.labelFill,onInput:h[12]||(h[12]=g=>c("labelFill",g.target.value))},null,40,KU),Q.createElementVNode("input",{type:"text",class:"element-editor__text-input",value:i.labelFill,onChange:h[13]||(h[13]=g=>c("labelFill",g.target.value))},null,40,_U)])]),Q.createElementVNode("div",GU,[h[33]||(h[33]=Q.createElementVNode("label",{class:"element-editor__label"},"字体大小",-1)),Q.createElementVNode("div",VU,[Q.createElementVNode("input",{type:"range",min:"10",max:"32",value:i.labelFontSize,onInput:h[14]||(h[14]=g=>c("labelFontSize",Number(g.target.value)))},null,40,zU),Q.createElementVNode("span",WU,Q.toDisplayString(i.labelFontSize)+"px",1)])]),Q.createElementVNode("div",XU,[h[34]||(h[34]=Q.createElementVNode("label",{class:"element-editor__label"},"标签偏移",-1)),Q.createElementVNode("div",YU,[Q.createElementVNode("input",{type:"range",min:"-50",max:"50",value:i.labelOffset,onInput:h[15]||(h[15]=g=>c("labelOffset",Number(g.target.value)))},null,40,JU),Q.createElementVNode("span",$U,Q.toDisplayString(i.labelOffset)+"px",1)])])])],64)):Q.createCommentVNode("",!0)]),Q.createElementVNode("div",{class:"element-editor__footer"},[Q.createElementVNode("button",{class:"element-editor__confirm-btn",onClick:l}," 确定 ")])])])):Q.createCommentVNode("",!0)}}),[["__scopeId","data-v-22b8de4b"]]),qU={key:0,class:"evolution-timeline"},jU={class:"timeline-controls"},Ax=["title"],ex={key:0,class:"icon-pause"},tx={key:1,class:"icon-play"},rx=["disabled"],nx={class:"track-points"},ix=["onClick","title"],ax={key:0,class:"point-label"},sx=["disabled"],ox={class:"speed-control"},lx={key:0,class:"timeline-info"},ux={class:"current-label"},cx={class:"progress-text"},Al=Dn(Q.defineComponent({__name:"EvolutionTimeline",props:{manager:{},visible:{type:Boolean,default:!0},showLabels:{type:Boolean,default:!0},showInfo:{type:Boolean,default:!0}},emits:["change","play","pause","stop"],setup(A,{emit:t}){const e=A,r=t,n=Q.ref(0),i=Q.ref(!1),a=Q.ref(!1),s=Q.ref(0),o=Q.ref([]),l=Q.ref("1"),u=Q.ref(2e3),c=Q.ref(null),f=Q.computed(()=>s.value<=1?0:n.value/(s.value-1)*100),d=Q.computed(()=>n.value>0||a.value),h=Q.computed(()=>n.value<s.value-1||a.value),g=Q.computed(()=>o.value[n.value]||null);function p(b){return s.value<=1?50:b/(s.value-1)*100}function w(b){if(!b)return"";try{return new Date(b).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"})}catch{return String(b)}}function v(){e.manager&&(i.value?e.manager.pause():e.manager.play())}function y(){e.manager&&(a.value=!a.value,e.manager.setLoop(a.value))}function E(){e.manager?.prev()}function F(){e.manager?.next()}function U(){e.manager?.stop()}function T(){if(!e.manager)return;const b=parseFloat(l.value),k=u.value/b;e.manager.setSpeed(k)}function B(b){if(!e.manager||!c.value||s.value<=1)return;const k=c.value.getBoundingClientRect(),M=(b.clientX-k.left)/k.width,L=Math.round(M*(s.value-1));e.manager.jumpTo(L)}function m(b){e.manager?.jumpTo(b)}function C(){if(!e.manager)return;const b=e.manager.getState();n.value=b.currentIndex,i.value=b.isPlaying,a.value=b.loop,s.value=b.totalPoints,u.value=b.interval,o.value=e.manager.getTimePoints();const k=u.value/b.interval;l.value=String(k)}function S(b){n.value=b.currentIndex,i.value=b.isPlaying,s.value=b.totalPoints,r("change",b)}function x(){i.value=!0,r("play")}function I(){i.value=!1,r("pause")}function H(){i.value=!1,n.value=0,r("stop")}return Q.watch(()=>e.manager,(b,k)=>{k&&(k.off("change",S),k.off("play",x),k.off("pause",I),k.off("stop",H)),b&&(b.on("change",S),b.on("play",x),b.on("pause",I),b.on("stop",H),C())},{immediate:!0}),Q.onMounted(()=>{C()}),Q.onUnmounted(()=>{e.manager&&(e.manager.off("change",S),e.manager.off("play",x),e.manager.off("pause",I),e.manager.off("stop",H))}),(b,k)=>A.visible?(Q.openBlock(),Q.createElementBlock("div",qU,[Q.createElementVNode("div",jU,[Q.createElementVNode("button",{class:"control-btn play-btn",onClick:v,title:i.value?"暂停":"播放"},[i.value?(Q.openBlock(),Q.createElementBlock("span",ex,"❚❚")):(Q.openBlock(),Q.createElementBlock("span",tx,"▶"))],8,Ax),Q.createElementVNode("button",{class:"control-btn",onClick:E,title:"上一帧",disabled:!d.value}," ◀◀ ",8,rx),Q.createElementVNode("div",{class:"timeline-track",ref_key:"trackRef",ref:c,onClick:B},[k[2]||(k[2]=Q.createElementVNode("div",{class:"track-bg"},null,-1)),Q.createElementVNode("div",{class:"track-progress",style:Q.normalizeStyle({width:f.value+"%"})},null,4),Q.createElementVNode("div",nx,[(Q.openBlock(!0),Q.createElementBlock(Q.Fragment,null,Q.renderList(o.value,(M,L)=>(Q.openBlock(),Q.createElementBlock("div",{key:L,class:Q.normalizeClass(["track-point",{active:L===n.value,passed:L<n.value}]),style:Q.normalizeStyle({left:p(L)+"%"}),onClick:Q.withModifiers(N=>m(L),["stop"]),title:M.label||w(M.timestamp)},[k[1]||(k[1]=Q.createElementVNode("div",{class:"point-dot"},null,-1)),A.showLabels?(Q.openBlock(),Q.createElementBlock("div",ax,Q.toDisplayString(M.label||w(M.timestamp)),1)):Q.createCommentVNode("",!0)],14,ix))),128))])],512),Q.createElementVNode("button",{class:"control-btn",onClick:F,title:"下一帧",disabled:!h.value}," ▶▶ ",8,sx),Q.createElementVNode("button",{class:"control-btn",onClick:U,title:"停止"}," ■ "),Q.createElementVNode("div",ox,[Q.withDirectives(Q.createElementVNode("select",{"onUpdate:modelValue":k[0]||(k[0]=M=>l.value=M),onChange:T,title:"播放速度"},[...k[3]||(k[3]=[Q.createElementVNode("option",{value:"0.5"},"0.5x",-1),Q.createElementVNode("option",{value:"1"},"1x",-1),Q.createElementVNode("option",{value:"2"},"2x",-1),Q.createElementVNode("option",{value:"4"},"4x",-1)])],544),[[Q.vModelSelect,l.value]])]),Q.createElementVNode("button",{class:Q.normalizeClass(["control-btn loop-btn",{active:a.value}]),onClick:y,title:"循环播放"}," 🔁 ",2)]),A.showInfo?(Q.openBlock(),Q.createElementBlock("div",lx,[Q.createElementVNode("span",ux,Q.toDisplayString(g.value?.label||w(g.value?.timestamp)||"--"),1),Q.createElementVNode("span",cx,Q.toDisplayString(n.value+1)+" / "+Q.toDisplayString(s.value),1)])):Q.createCommentVNode("",!0)])):Q.createCommentVNode("",!0)}}),[["__scopeId","data-v-e89b8bda"]]),fx={class:"irrigation-toolbar"},hx={key:0,class:"irrigation-toolbar__section"},dx=["disabled"],gx={class:"irrigation-toolbar__btn-text"},Bx={class:"irrigation-toolbar__section"},vx=["disabled"],px={class:"irrigation-toolbar__section"},mx=["disabled"],yx={class:"irrigation-toolbar__section"},wx=["disabled"],Cx=["disabled"],Ex=Dn(Q.defineComponent({__name:"Toolbar",props:{enabledActions:{default:()=>({zoomIn:!0,zoomOut:!0,fitView:!0,export:!0,print:!0,layout:!0,config:!1})},configActive:{type:Boolean,default:!1}},emits:["action"],setup(A,{emit:t}){const e=t,r=(n,i)=>{e("action",n,i)};return(n,i)=>(Q.openBlock(),Q.createElementBlock("div",fx,[A.enabledActions.config?(Q.openBlock(),Q.createElementBlock("div",hx,[i[7]||(i[7]=Q.createElementVNode("span",{class:"irrigation-toolbar__label"},"配置:",-1)),Q.createElementVNode("button",{onClick:i[0]||(i[0]=()=>r("toggleConfig")),disabled:!A.enabledActions.config,class:Q.normalizeClass({"is-active":A.configActive})},[i[6]||(i[6]=Q.createElementVNode("svg",{class:"irrigation-toolbar__icon",viewBox:"0 0 24 24",width:"16",height:"16"},[Q.createElementVNode("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",fill:"none","stroke-width":"2"}),Q.createElementVNode("path",{d:"M12 1v6m0 6v6m4.22-10.22l4.24-4.24M6.34 17.66l-4.24 4.24M23 12h-6m-6 0H1m20.24 4.24l-4.24-4.24M6.34 6.34L2.1 2.1",stroke:"currentColor",fill:"none","stroke-width":"2"})],-1)),Q.createElementVNode("span",gx,Q.toDisplayString(A.configActive?"关闭配置":"配置"),1)],10,dx)])):Q.createCommentVNode("",!0),Q.createElementVNode("div",Bx,[i[9]||(i[9]=Q.createElementVNode("span",{class:"irrigation-toolbar__label"},"视图:",-1)),Q.createElementVNode("button",{onClick:i[1]||(i[1]=()=>r("fitView")),disabled:!A.enabledActions.fitView},[...i[8]||(i[8]=[Q.createElementVNode("svg",{class:"irrigation-toolbar__icon",viewBox:"0 0 24 24",width:"16",height:"16"},[Q.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"2",stroke:"currentColor",fill:"none","stroke-width":"2"}),Q.createElementVNode("path",{d:"M8 12h8M12 8v8",stroke:"currentColor","stroke-width":"2"})],-1),Q.createElementVNode("span",{class:"irrigation-toolbar__btn-text"},"适应",-1)])],8,vx)]),Q.createElementVNode("div",px,[i[12]||(i[12]=Q.createElementVNode("span",{class:"irrigation-toolbar__label"},"操作:",-1)),A.enabledActions.getData?(Q.openBlock(),Q.createElementBlock("button",{key:0,onClick:i[2]||(i[2]=()=>r("getData"))},[...i[10]||(i[10]=[Q.createElementVNode("svg",{class:"irrigation-toolbar__icon",viewBox:"0 0 24 24",width:"16",height:"16"},[Q.createElementVNode("path",{d:"M4 4h16v16H4z",stroke:"currentColor",fill:"none","stroke-width":"2"}),Q.createElementVNode("path",{d:"M8 12h8M8 16h8M8 8h8",stroke:"currentColor",fill:"none","stroke-width":"2"})],-1),Q.createElementVNode("span",{class:"irrigation-toolbar__btn-text"},"获取数据",-1)])])):Q.createCommentVNode("",!0),Q.createElementVNode("button",{onClick:i[3]||(i[3]=()=>r("export")),disabled:!A.enabledActions.export},[...i[11]||(i[11]=[Q.createStaticVNode('<svg class="irrigation-toolbar__icon" viewBox="0 0 24 24" width="16" height="16" data-v-51f467d7><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" stroke="currentColor" fill="none" stroke-width="2" data-v-51f467d7></path><polyline points="7 10 12 15 17 10" stroke="currentColor" fill="none" stroke-width="2" data-v-51f467d7></polyline><line x1="12" y1="15" x2="12" y2="3" stroke="currentColor" stroke-width="2" data-v-51f467d7></line></svg><span class="irrigation-toolbar__btn-text" data-v-51f467d7>导出</span>',2)])],8,mx)]),Q.createElementVNode("div",yx,[i[15]||(i[15]=Q.createElementVNode("span",{class:"irrigation-toolbar__label"},"布局:",-1)),Q.createElementVNode("button",{onClick:i[4]||(i[4]=()=>r("layoutHorizontal")),disabled:!A.enabledActions.layout},[...i[13]||(i[13]=[Q.createElementVNode("svg",{class:"irrigation-toolbar__icon",viewBox:"0 0 24 24",width:"16",height:"16"},[Q.createElementVNode("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2",stroke:"currentColor",fill:"none","stroke-width":"2"}),Q.createElementVNode("line",{x1:"12",y1:"3",x2:"12",y2:"21",stroke:"currentColor","stroke-width":"2"})],-1),Q.createElementVNode("span",{class:"irrigation-toolbar__btn-text"},"横向",-1)])],8,wx),Q.createElementVNode("button",{onClick:i[5]||(i[5]=()=>r("layoutVertical")),disabled:!A.enabledActions.layout},[...i[14]||(i[14]=[Q.createElementVNode("svg",{class:"irrigation-toolbar__icon",viewBox:"0 0 24 24",width:"16",height:"16"},[Q.createElementVNode("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2",stroke:"currentColor",fill:"none","stroke-width":"2"}),Q.createElementVNode("line",{x1:"3",y1:"12",x2:"21",y2:"12",stroke:"currentColor","stroke-width":"2"})],-1),Q.createElementVNode("span",{class:"irrigation-toolbar__btn-text"},"纵向",-1)])],8,Cx)])]))}}),[["__scopeId","data-v-51f467d7"]]),Qx={key:1,class:"irrigation-graph__loading"},wd=Dn(Q.defineComponent({__name:"IrrigationGraph",props:{width:{default:void 0},height:{default:void 0},data:{},graphData:{},layout:{},theme:{},tooltip:{},dataPanel:{},enableDrag:{type:Boolean,default:!0},enableZoom:{type:Boolean,default:!0},enableBrush:{type:Boolean,default:!1},enableMinimap:{type:Boolean,default:!1},fixElementSize:{type:Boolean,default:!1},fitView:{type:Boolean,default:!0},autoResize:{type:Boolean,default:!0},fitViewPadding:{},readonly:{type:Boolean,default:!1},showToolbar:{type:Boolean,default:!1},enabledToolbarActions:{default:()=>({zoomIn:!0,zoomOut:!0,fitView:!0,save:!0,export:!0,print:!0,layout:!0,getData:void 0})},evolution:{},evolutionData:{}},emits:["ready","itemClick","itemDblClick","itemContextMenu","selectionChange","canvasClick","dataChange","evolutionChange"],setup(A,{expose:t,emit:e}){const r=A,n=e,i=Q.ref(null),a=Q.ref(r.data),s=Q.ref("horizontal"),o=Q.shallowRef(null);let l=null;const u=Q.computed(()=>r.evolution?.enabled&&o.value!==null),c=Q.ref(!1),f=Q.ref("node"),d=Q.ref(""),h=Q.reactive({labelVisible:!0,labelFill:"#000000",labelPlacement:"bottom",labelFontSize:12,labelOffset:[0,0]}),g=Q.reactive({labelVisible:!0,stroke:"#1890ff",lineWidth:2,labelPlacement:"center",labelFill:"#666666",labelFontSize:12,labelOffset:0}),{manager:p,graph:w,state:v,initialized:y,loading:E,init:F,render:U,renderFromData:T,changeLayoutDirection:B,updateData:m,addNode:C,addEdge:S,removeNode:x,removeEdge:I,updateNode:H,updateEdge:b,zoomIn:k,zoomOut:M,zoomTo:L,fitView:N,resize:O,focusNode:z,getData:$,save:eA,load:tA,toImage:Z,downloadImage:D,print:j,setLayout:JA,on:wA,off:_A,destroy:DA}=yd({container:i,width:r.width,height:r.height,data:r.data,graphData:r.graphData,options:{layout:r.layout,theme:r.theme,tooltip:r.tooltip,dataPanel:r.dataPanel,enableDrag:r.enableDrag,enableZoom:r.enableZoom,enableBrush:r.enableBrush,enableMinimap:r.enableMinimap,fixElementSize:r.fixElementSize,fitView:r.fitView,fitViewPadding:r.fitViewPadding,evolution:r.evolution},autoInit:!1}),{configPanelVisible:hA,configActiveTab:PA,globalConfig:xA,toggleConfigPanel:rA,closeConfigPanel:LA,handleConfigTabChange:_r,handleConfigChange:Gr,handleConfigReset:Gt,updateNodeStyle:ur,updateEdgeStyle:cr}=Pd({manager:p,currentData:a,emit:(X,jA)=>n("dataChange",jA)}),Vr=Q.computed(()=>({width:r.width?`${r.width}px`:"100%",height:r.height?`${r.height}px`:"100%"}));function mt(){p.value&&(wA("node:click",X=>{n("itemClick",{type:"node",item:X.itemData})}),wA("node:dblclick",X=>{n("itemDblClick",{type:"node",item:X.itemData})}),wA("node:contextmenu",X=>{n("itemContextMenu",{type:"node",item:X.itemData,event:X.originalEvent})}),wA("edge:click",X=>{n("itemClick",{type:"edge",item:X.itemData})}),wA("edge:dblclick",X=>{n("itemDblClick",{type:"edge",item:X.itemData})}),wA("edge:contextmenu",X=>{n("itemContextMenu",{type:"edge",item:X.itemData,event:X.originalEvent})}),wA("combo:click",X=>{n("itemClick",{type:"combo",item:X.itemData})}),wA("combo:dblclick",X=>{n("itemDblClick",{type:"combo",item:X.itemData})}),wA("canvas:click",X=>{n("canvasClick",X.originalEvent)}),p.value.onContextMenu(fr))}function fr(X){X.menuValue==="edit"&&Ve(X.targetType,X.targetId,X.targetData)}function Ve(X,jA,hr){if(f.value=X,d.value=jA,X==="node"){const sA=hr.style||{};h.labelVisible=sA.label!==!1&&sA.label!=="",h.labelFill=sA.labelFill||"#000000",h.labelPlacement=sA.labelPlacement||"bottom",h.labelFontSize=sA.labelFontSize||12,h.labelOffset=sA.labelOffset||[0,0]}else{const sA=hr.style||{};g.labelVisible=sA.label!==!1&&sA.label!=="",g.stroke=sA.stroke||"#1890ff",g.lineWidth=sA.lineWidth||2,g.labelPlacement=sA.labelPlacement||"center",g.labelFill=sA.labelFill||"#666666",g.labelFontSize=sA.labelFontSize||12,g.labelOffset=sA.labelOffset||0}c.value=!0}function ze(){c.value=!1}async function yt(X){const{type:jA,id:hr,config:dr}=X;if(jA==="node"){const sA=dr,Pn={label:sA.labelVisible,labelFill:sA.labelFill,labelPlacement:sA.labelPlacement,labelFontSize:sA.labelFontSize,labelOffset:sA.labelOffset};await ur(hr,Pn)}else{const sA=dr,Pn={stroke:sA.stroke,lineWidth:sA.lineWidth,label:sA.labelVisible,labelPlacement:sA.labelPlacement,labelFill:sA.labelFill,labelFontSize:sA.labelFontSize,labelOffset:sA.labelOffset};await cr(hr,Pn)}c.value=!1}const wt={zoomIn:()=>k(),zoomOut:()=>M(),fitView:()=>N(),export:()=>D({fileName:"irrigation-graph"}),print:()=>j(),layoutHorizontal:()=>XA("horizontal"),layoutVertical:()=>XA("vertical"),toggleConfig:()=>rA(),getData:()=>{const X=$();r.enabledToolbarActions.getData?.(X)}};function qA(X){const jA=wt[X];jA?jA():console.warn(`[Toolbar] Unknown action: ${X}`)}async function XA(X){const jA=r.data??a.value;if(!jA){console.warn("No data available for layout change");return}s.value=X,a.value=jA,await B(jA,X),n("dataChange",$()),setTimeout(()=>{N()},100)}function Na(X){X.preventDefault()}Q.onMounted(async()=>{if(i.value&&(await F(),mt(),p.value&&(o.value=p.value.getEvolutionManager()),i.value.addEventListener("contextmenu",Na),n("ready",w.value),r.autoResize&&i.value)){const X=_a(()=>{O()},100);l=new ResizeObserver(()=>{X()}),l.observe(i.value)}}),Q.onUnmounted(()=>{l&&(l.disconnect(),l=null),i.value&&i.value.removeEventListener("contextmenu",Na),DA()}),Q.watch(()=>r.data,async X=>{X&&y.value&&(a.value=X,await T(X,s.value),n("dataChange",$()))},{deep:!0}),Q.watch(()=>r.dataPanel,X=>{p.value&&(X?.enabled?p.value.enableDataPanel(X):p.value.disableDataPanel())},{deep:!0}),Q.watch(()=>r.graphData,async X=>{X&&y.value&&(await U(X),n("dataChange",$()))},{deep:!0}),Q.watch(()=>r.evolutionData,X=>{X&&p.value&&(p.value.setEvolutionData(X),o.value=p.value.getEvolutionManager())},{deep:!0});function Da(X){n("evolutionChange",X)}function Pa(X){p.value&&(p.value.setEvolutionData(X),o.value=p.value.getEvolutionManager())}function el(){return o.value}return t({graph:w,manager:p,state:v,initialized:y,loading:E,currentLayoutDirection:s,render:U,renderFromData:T,changeLayout:XA,changeLayoutDirection:B,updateData:m,addNode:C,addEdge:S,removeNode:x,removeEdge:I,updateNode:H,updateEdge:b,getData:$,zoomIn:k,zoomOut:M,zoomTo:L,fitView:N,focusNode:z,resize:O,setLayout:JA,save:eA,load:tA,toImage:Z,downloadImage:D,print:j,on:wA,off:_A,layoutUtils:bd,evolutionManager:o,setEvolutionData:Pa,getEvolutionManager:el,destroy:DA}),(X,jA)=>(Q.openBlock(),Q.createElementBlock("div",{class:"irrigation-graph",style:Q.normalizeStyle(Vr.value)},[Q.renderSlot(X.$slots,"toolbar",{zoomIn:Q.unref(k),zoomOut:Q.unref(M),fitView:Q.unref(N)},void 0,!0),r.showToolbar?(Q.openBlock(),Q.createBlock(Ex,{key:0,"enabled-actions":r.enabledToolbarActions,"config-active":Q.unref(hA),onAction:qA},null,8,["enabled-actions","config-active"])):Q.createCommentVNode("",!0),Q.createElementVNode("div",{ref_key:"containerRef",ref:i,class:"irrigation-graph__canvas"},null,512),Q.unref(E)?(Q.openBlock(),Q.createElementBlock("div",Qx,[Q.renderSlot(X.$slots,"loading",{},()=>[jA[0]||(jA[0]=Q.createElementVNode("span",null,"加载中...",-1))],!0)])):Q.createCommentVNode("",!0),u.value?(Q.openBlock(),Q.createBlock(Al,{key:2,manager:o.value,visible:!0,onChange:Da},null,8,["manager"])):Q.createCommentVNode("",!0),Q.createVNode($F,{visible:Q.unref(hA),"active-tab":Q.unref(PA),config:Q.unref(xA),onClose:Q.unref(LA),onTabChange:Q.unref(_r),onChange:Q.unref(Gr),onReset:Q.unref(Gt)},null,8,["visible","active-tab","config","onClose","onTabChange","onChange","onReset"]),Q.createVNode(ZU,{visible:c.value,"element-type":f.value,"element-id":d.value,"node-config":h,"edge-config":g,onClose:ze,onConfirm:yt},null,8,["visible","element-type","element-id","node-config","edge-config"]),Q.renderSlot(X.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-4aae68e6"]]),Fx={install(A){A.component("IrrigationGraph",wd),A.component("EvolutionTimeline",Al)}};V.BufferNodeSyncController=od,V.ContextMenuManager=Jo,V.DEFAULT_ALARM_STYLES=fd,V.DEFAULT_EDGE_CONFIG=Et,V.DEFAULT_GLOBAL_CONFIG=Dd,V.DEFAULT_LABEL_CONFIG=Va,V.DEFAULT_NODE_CONFIG=Ct,V.DataPanelManager=ld,V.DataPreprocessor=Zo,V.DataTransformer=La,V.EvolutionManager=ka,V.EvolutionTimeline=Al,V.IrrigationCombo=Rh,V.IrrigationGraph=wd,V.IrrigationGraphManager=$o,V.PRESET_GRADIENTS=AF,V.PRESET_THEMES=Lo,V.PointNodeType=Kr,V.StyleUpdater=Xo,V.alignNodesHorizontally=rl,V.alignNodesVertically=nl,V.autoAdjustSpacing=ol,V.buildExpandedNodeSet=Vo,V.calculateEdgeGradient=ud,V.centerNodesToPosition=Ra,V.computeBufferPolygon=zo,V.computeBufferPolygonResult=Wo,V.copyToClipboard=Td,V.createBehaviors=dl,V.createContextMenuManager=rF,V.createDataPanelPlugin=ZQ,V.createEdgeConfig=dQ,V.createEdgeGradientStroke=cd,V.createEvolutionManager=tF,V.createGraphManager=dF,V.createNodeConfig=wQ,V.createPreprocessor=mF,V.createStyleUpdater=eF,V.createTheme=BQ,V.createTransformer=UF,V.debounce=_a,V.deepClone=Hd,V.default=Fx,V.deserializeGraphData=hl,V.distance=Ga,V.distributeNodesHorizontally=il,V.distributeNodesVertically=al,V.downloadJSON=Id,V.flipNodes=ll,V.generateId=Md,V.getConnectedNodes=sl,V.getDefaultEdgeStyle=Wh,V.getDefaultNodeStyle=zh,V.getEdgeDefaultStyle=hQ,V.getEdgeTypeName=fQ,V.getNodeDefaultStyle=yQ,V.getNodePosition=bA,V.getNodeTypeName=mQ,V.getNodesBoundingBox=Vt,V.getNodesByCanalId=Ka,V.mergeEdgeStyle=pQ,V.mergeNodeStyle=vQ,V.moveNodes=Rn,V.needsPreprocessing=vd,V.pointToSegmentDistance=Ld,V.preprocessData=Bd,V.readJSONFile=Sd,V.registerBufferPolygonNode=Gh,V.registerCustomCombos=Kh,V.registerCustomEdges=_h,V.registerCustomNodes=Xh,V.rotateNodes90=ul,V.serializeGraphData=fl,V.setNodePosition=pe,V.throttle=kd,V.transformData=xF,V.transformDataWithLayout=md,V.useIrrigationGraph=yd,V.validateGraphData=Nd,Object.defineProperties(V,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|