You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
5681 lines
241 KiB
5681 lines
241 KiB
(self["webpackChunk"] = self["webpackChunk"] || []).push([[58],{
|
|
|
|
/***/ 88917:
|
|
/*!************************************************************************!*\
|
|
!*** ./node_modules/_node-menu-bar@1.0.0@node-menu-bar/dist/style.css ***!
|
|
\************************************************************************/
|
|
/***/ (function() {
|
|
|
|
"use strict";
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 78673:
|
|
/*!**********************************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/switch/index.js + 2 modules ***!
|
|
\**********************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ es_switch; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.5.1@@ant-design/icons/es/icons/LoadingOutlined.js + 1 modules
|
|
var LoadingOutlined = __webpack_require__(42141);
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.0@@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(5891);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.0@@babel/runtime/helpers/esm/defineProperty.js
|
|
var defineProperty = __webpack_require__(80962);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.0@@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
|
|
var slicedToArray = __webpack_require__(29043);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.0@@babel/runtime/helpers/esm/objectWithoutProperties.js
|
|
var objectWithoutProperties = __webpack_require__(19149);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.43.0@rc-util/es/hooks/useMergedState.js
|
|
var useMergedState = __webpack_require__(71366);
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.43.0@rc-util/es/KeyCode.js
|
|
var KeyCode = __webpack_require__(20287);
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-switch@4.1.0@rc-switch/es/index.js
|
|
|
|
|
|
|
|
|
|
var _excluded = ["prefixCls", "className", "checked", "defaultChecked", "disabled", "loadingIcon", "checkedChildren", "unCheckedChildren", "onClick", "onChange", "onKeyDown"];
|
|
|
|
|
|
|
|
|
|
var Switch = /*#__PURE__*/_react_17_0_2_react.forwardRef(function (_ref, ref) {
|
|
var _classNames;
|
|
var _ref$prefixCls = _ref.prefixCls,
|
|
prefixCls = _ref$prefixCls === void 0 ? 'rc-switch' : _ref$prefixCls,
|
|
className = _ref.className,
|
|
checked = _ref.checked,
|
|
defaultChecked = _ref.defaultChecked,
|
|
disabled = _ref.disabled,
|
|
loadingIcon = _ref.loadingIcon,
|
|
checkedChildren = _ref.checkedChildren,
|
|
unCheckedChildren = _ref.unCheckedChildren,
|
|
onClick = _ref.onClick,
|
|
onChange = _ref.onChange,
|
|
onKeyDown = _ref.onKeyDown,
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(_ref, _excluded);
|
|
var _useMergedState = (0,useMergedState/* default */.Z)(false, {
|
|
value: checked,
|
|
defaultValue: defaultChecked
|
|
}),
|
|
_useMergedState2 = (0,slicedToArray/* default */.Z)(_useMergedState, 2),
|
|
innerChecked = _useMergedState2[0],
|
|
setInnerChecked = _useMergedState2[1];
|
|
function triggerChange(newChecked, event) {
|
|
var mergedChecked = innerChecked;
|
|
if (!disabled) {
|
|
mergedChecked = newChecked;
|
|
setInnerChecked(mergedChecked);
|
|
onChange === null || onChange === void 0 ? void 0 : onChange(mergedChecked, event);
|
|
}
|
|
return mergedChecked;
|
|
}
|
|
function onInternalKeyDown(e) {
|
|
if (e.which === KeyCode/* default */.Z.LEFT) {
|
|
triggerChange(false, e);
|
|
} else if (e.which === KeyCode/* default */.Z.RIGHT) {
|
|
triggerChange(true, e);
|
|
}
|
|
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
}
|
|
function onInternalClick(e) {
|
|
var ret = triggerChange(!innerChecked, e);
|
|
// [Legacy] trigger onClick with value
|
|
onClick === null || onClick === void 0 ? void 0 : onClick(ret, e);
|
|
}
|
|
var switchClassName = _classnames_2_5_1_classnames_default()(prefixCls, className, (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-checked"), innerChecked), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-disabled"), disabled), _classNames));
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("button", (0,esm_extends/* default */.Z)({}, restProps, {
|
|
type: "button",
|
|
role: "switch",
|
|
"aria-checked": innerChecked,
|
|
disabled: disabled,
|
|
className: switchClassName,
|
|
ref: ref,
|
|
onKeyDown: onInternalKeyDown,
|
|
onClick: onInternalClick
|
|
}), loadingIcon, /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
className: "".concat(prefixCls, "-inner")
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
className: "".concat(prefixCls, "-inner-checked")
|
|
}, checkedChildren), /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
className: "".concat(prefixCls, "-inner-unchecked")
|
|
}, unCheckedChildren)));
|
|
});
|
|
Switch.displayName = 'Switch';
|
|
/* harmony default export */ var es = (Switch);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/wave/index.js + 4 modules
|
|
var wave = __webpack_require__(14088);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
var context = __webpack_require__(36355);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/DisabledContext.js
|
|
var DisabledContext = __webpack_require__(1684);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/hooks/useSize.js
|
|
var useSize = __webpack_require__(19716);
|
|
// EXTERNAL MODULE: ./node_modules/_@ctrl_tinycolor@3.6.1@@ctrl/tinycolor/dist/module/index.js
|
|
var dist_module = __webpack_require__(64993);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/index.js
|
|
var style = __webpack_require__(17313);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/genComponentStyleHook.js
|
|
var genComponentStyleHook = __webpack_require__(83116);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/statistic.js
|
|
var statistic = __webpack_require__(37613);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/switch/style/index.js
|
|
|
|
|
|
|
|
const genSwitchSmallStyle = token => {
|
|
const {
|
|
componentCls,
|
|
trackHeightSM,
|
|
trackPadding,
|
|
trackMinWidthSM,
|
|
innerMinMarginSM,
|
|
innerMaxMarginSM,
|
|
handleSizeSM
|
|
} = token;
|
|
const switchInnerCls = `${componentCls}-inner`;
|
|
return {
|
|
[componentCls]: {
|
|
[`&${componentCls}-small`]: {
|
|
minWidth: trackMinWidthSM,
|
|
height: trackHeightSM,
|
|
lineHeight: `${trackHeightSM}px`,
|
|
[`${componentCls}-inner`]: {
|
|
paddingInlineStart: innerMaxMarginSM,
|
|
paddingInlineEnd: innerMinMarginSM,
|
|
[`${switchInnerCls}-checked`]: {
|
|
marginInlineStart: `calc(-100% + ${handleSizeSM + trackPadding * 2}px - ${innerMaxMarginSM * 2}px)`,
|
|
marginInlineEnd: `calc(100% - ${handleSizeSM + trackPadding * 2}px + ${innerMaxMarginSM * 2}px)`
|
|
},
|
|
[`${switchInnerCls}-unchecked`]: {
|
|
marginTop: -trackHeightSM,
|
|
marginInlineStart: 0,
|
|
marginInlineEnd: 0
|
|
}
|
|
},
|
|
[`${componentCls}-handle`]: {
|
|
width: handleSizeSM,
|
|
height: handleSizeSM
|
|
},
|
|
[`${componentCls}-loading-icon`]: {
|
|
top: (handleSizeSM - token.switchLoadingIconSize) / 2,
|
|
fontSize: token.switchLoadingIconSize
|
|
},
|
|
[`&${componentCls}-checked`]: {
|
|
[`${componentCls}-inner`]: {
|
|
paddingInlineStart: innerMinMarginSM,
|
|
paddingInlineEnd: innerMaxMarginSM,
|
|
[`${switchInnerCls}-checked`]: {
|
|
marginInlineStart: 0,
|
|
marginInlineEnd: 0
|
|
},
|
|
[`${switchInnerCls}-unchecked`]: {
|
|
marginInlineStart: `calc(100% - ${handleSizeSM + trackPadding * 2}px + ${innerMaxMarginSM * 2}px)`,
|
|
marginInlineEnd: `calc(-100% + ${handleSizeSM + trackPadding * 2}px - ${innerMaxMarginSM * 2}px)`
|
|
}
|
|
},
|
|
[`${componentCls}-handle`]: {
|
|
insetInlineStart: `calc(100% - ${handleSizeSM + trackPadding}px)`
|
|
}
|
|
},
|
|
[`&:not(${componentCls}-disabled):active`]: {
|
|
[`&:not(${componentCls}-checked) ${switchInnerCls}`]: {
|
|
[`${switchInnerCls}-unchecked`]: {
|
|
marginInlineStart: token.marginXXS / 2,
|
|
marginInlineEnd: -token.marginXXS / 2
|
|
}
|
|
},
|
|
[`&${componentCls}-checked ${switchInnerCls}`]: {
|
|
[`${switchInnerCls}-checked`]: {
|
|
marginInlineStart: -token.marginXXS / 2,
|
|
marginInlineEnd: token.marginXXS / 2
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const genSwitchLoadingStyle = token => {
|
|
const {
|
|
componentCls,
|
|
handleSize
|
|
} = token;
|
|
return {
|
|
[componentCls]: {
|
|
[`${componentCls}-loading-icon${token.iconCls}`]: {
|
|
position: 'relative',
|
|
top: (handleSize - token.fontSize) / 2,
|
|
color: token.switchLoadingIconColor,
|
|
verticalAlign: 'top'
|
|
},
|
|
[`&${componentCls}-checked ${componentCls}-loading-icon`]: {
|
|
color: token.switchColor
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const genSwitchHandleStyle = token => {
|
|
const {
|
|
componentCls,
|
|
motion,
|
|
trackPadding,
|
|
handleBg,
|
|
handleShadow,
|
|
handleSize
|
|
} = token;
|
|
const switchHandleCls = `${componentCls}-handle`;
|
|
return {
|
|
[componentCls]: {
|
|
[switchHandleCls]: {
|
|
position: 'absolute',
|
|
top: trackPadding,
|
|
insetInlineStart: trackPadding,
|
|
width: handleSize,
|
|
height: handleSize,
|
|
transition: `all ${token.switchDuration} ease-in-out`,
|
|
'&::before': {
|
|
position: 'absolute',
|
|
top: 0,
|
|
insetInlineEnd: 0,
|
|
bottom: 0,
|
|
insetInlineStart: 0,
|
|
backgroundColor: handleBg,
|
|
borderRadius: handleSize / 2,
|
|
boxShadow: handleShadow,
|
|
transition: `all ${token.switchDuration} ease-in-out`,
|
|
content: '""'
|
|
}
|
|
},
|
|
[`&${componentCls}-checked ${switchHandleCls}`]: {
|
|
insetInlineStart: `calc(100% - ${handleSize + trackPadding}px)`
|
|
},
|
|
[`&:not(${componentCls}-disabled):active`]: motion ? {
|
|
[`${switchHandleCls}::before`]: {
|
|
insetInlineEnd: token.switchHandleActiveInset,
|
|
insetInlineStart: 0
|
|
},
|
|
[`&${componentCls}-checked ${switchHandleCls}::before`]: {
|
|
insetInlineEnd: 0,
|
|
insetInlineStart: token.switchHandleActiveInset
|
|
}
|
|
} : /* istanbul ignore next */
|
|
{}
|
|
}
|
|
};
|
|
};
|
|
const genSwitchInnerStyle = token => {
|
|
const {
|
|
componentCls,
|
|
trackHeight,
|
|
trackPadding,
|
|
innerMinMargin,
|
|
innerMaxMargin,
|
|
handleSize
|
|
} = token;
|
|
const switchInnerCls = `${componentCls}-inner`;
|
|
return {
|
|
[componentCls]: {
|
|
[switchInnerCls]: {
|
|
display: 'block',
|
|
overflow: 'hidden',
|
|
borderRadius: 100,
|
|
height: '100%',
|
|
paddingInlineStart: innerMaxMargin,
|
|
paddingInlineEnd: innerMinMargin,
|
|
transition: `padding-inline-start ${token.switchDuration} ease-in-out, padding-inline-end ${token.switchDuration} ease-in-out`,
|
|
[`${switchInnerCls}-checked, ${switchInnerCls}-unchecked`]: {
|
|
display: 'block',
|
|
color: token.colorTextLightSolid,
|
|
fontSize: token.fontSizeSM,
|
|
transition: `margin-inline-start ${token.switchDuration} ease-in-out, margin-inline-end ${token.switchDuration} ease-in-out`,
|
|
pointerEvents: 'none'
|
|
},
|
|
[`${switchInnerCls}-checked`]: {
|
|
marginInlineStart: `calc(-100% + ${handleSize + trackPadding * 2}px - ${innerMaxMargin * 2}px)`,
|
|
marginInlineEnd: `calc(100% - ${handleSize + trackPadding * 2}px + ${innerMaxMargin * 2}px)`
|
|
},
|
|
[`${switchInnerCls}-unchecked`]: {
|
|
marginTop: -trackHeight,
|
|
marginInlineStart: 0,
|
|
marginInlineEnd: 0
|
|
}
|
|
},
|
|
[`&${componentCls}-checked ${switchInnerCls}`]: {
|
|
paddingInlineStart: innerMinMargin,
|
|
paddingInlineEnd: innerMaxMargin,
|
|
[`${switchInnerCls}-checked`]: {
|
|
marginInlineStart: 0,
|
|
marginInlineEnd: 0
|
|
},
|
|
[`${switchInnerCls}-unchecked`]: {
|
|
marginInlineStart: `calc(100% - ${handleSize + trackPadding * 2}px + ${innerMaxMargin * 2}px)`,
|
|
marginInlineEnd: `calc(-100% + ${handleSize + trackPadding * 2}px - ${innerMaxMargin * 2}px)`
|
|
}
|
|
},
|
|
[`&:not(${componentCls}-disabled):active`]: {
|
|
[`&:not(${componentCls}-checked) ${switchInnerCls}`]: {
|
|
[`${switchInnerCls}-unchecked`]: {
|
|
marginInlineStart: trackPadding * 2,
|
|
marginInlineEnd: -trackPadding * 2
|
|
}
|
|
},
|
|
[`&${componentCls}-checked ${switchInnerCls}`]: {
|
|
[`${switchInnerCls}-checked`]: {
|
|
marginInlineStart: -trackPadding * 2,
|
|
marginInlineEnd: trackPadding * 2
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const genSwitchStyle = token => {
|
|
const {
|
|
componentCls,
|
|
trackHeight,
|
|
trackMinWidth
|
|
} = token;
|
|
return {
|
|
[componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
position: 'relative',
|
|
display: 'inline-block',
|
|
boxSizing: 'border-box',
|
|
minWidth: trackMinWidth,
|
|
height: trackHeight,
|
|
lineHeight: `${trackHeight}px`,
|
|
verticalAlign: 'middle',
|
|
background: token.colorTextQuaternary,
|
|
border: '0',
|
|
borderRadius: 100,
|
|
cursor: 'pointer',
|
|
transition: `all ${token.motionDurationMid}`,
|
|
userSelect: 'none',
|
|
[`&:hover:not(${componentCls}-disabled)`]: {
|
|
background: token.colorTextTertiary
|
|
}
|
|
}), (0,style/* genFocusStyle */.Qy)(token)), {
|
|
[`&${componentCls}-checked`]: {
|
|
background: token.switchColor,
|
|
[`&:hover:not(${componentCls}-disabled)`]: {
|
|
background: token.colorPrimaryHover
|
|
}
|
|
},
|
|
[`&${componentCls}-loading, &${componentCls}-disabled`]: {
|
|
cursor: 'not-allowed',
|
|
opacity: token.switchDisabledOpacity,
|
|
'*': {
|
|
boxShadow: 'none',
|
|
cursor: 'not-allowed'
|
|
}
|
|
},
|
|
// rtl style
|
|
[`&${componentCls}-rtl`]: {
|
|
direction: 'rtl'
|
|
}
|
|
})
|
|
};
|
|
};
|
|
// ============================== Export ==============================
|
|
/* harmony default export */ var switch_style = ((0,genComponentStyleHook/* default */.Z)('Switch', token => {
|
|
const switchToken = (0,statistic/* merge */.TS)(token, {
|
|
switchDuration: token.motionDurationMid,
|
|
switchColor: token.colorPrimary,
|
|
switchDisabledOpacity: token.opacityLoading,
|
|
switchLoadingIconSize: token.fontSizeIcon * 0.75,
|
|
switchLoadingIconColor: `rgba(0, 0, 0, ${token.opacityLoading})`,
|
|
switchHandleActiveInset: '-30%'
|
|
});
|
|
return [genSwitchStyle(switchToken),
|
|
// inner style
|
|
genSwitchInnerStyle(switchToken),
|
|
// handle style
|
|
genSwitchHandleStyle(switchToken),
|
|
// loading style
|
|
genSwitchLoadingStyle(switchToken),
|
|
// small style
|
|
genSwitchSmallStyle(switchToken)];
|
|
}, token => {
|
|
const {
|
|
fontSize,
|
|
lineHeight,
|
|
controlHeight,
|
|
colorWhite
|
|
} = token;
|
|
const height = fontSize * lineHeight;
|
|
const heightSM = controlHeight / 2;
|
|
const padding = 2; // Fixed value
|
|
const handleSize = height - padding * 2;
|
|
const handleSizeSM = heightSM - padding * 2;
|
|
return {
|
|
trackHeight: height,
|
|
trackHeightSM: heightSM,
|
|
trackMinWidth: handleSize * 2 + padding * 4,
|
|
trackMinWidthSM: handleSizeSM * 2 + padding * 2,
|
|
trackPadding: padding,
|
|
handleBg: colorWhite,
|
|
handleSize,
|
|
handleSizeSM,
|
|
handleShadow: `0 2px 4px 0 ${new dist_module/* TinyColor */.C('#00230b').setAlpha(0.2).toRgbString()}`,
|
|
innerMinMargin: handleSize / 2,
|
|
innerMaxMargin: handleSize + padding + padding * 2,
|
|
innerMinMarginSM: handleSizeSM / 2,
|
|
innerMaxMarginSM: handleSizeSM + padding + padding * 2
|
|
};
|
|
}));
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/switch/index.js
|
|
"use client";
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const switch_Switch = /*#__PURE__*/_react_17_0_2_react.forwardRef((props, ref) => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
size: customizeSize,
|
|
disabled: customDisabled,
|
|
loading,
|
|
className,
|
|
rootClassName,
|
|
style
|
|
} = props,
|
|
restProps = __rest(props, ["prefixCls", "size", "disabled", "loading", "className", "rootClassName", "style"]);
|
|
false ? 0 : void 0;
|
|
const {
|
|
getPrefixCls,
|
|
direction,
|
|
switch: SWITCH
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
// ===================== Disabled =====================
|
|
const disabled = _react_17_0_2_react.useContext(DisabledContext/* default */.Z);
|
|
const mergedDisabled = (customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled) || loading;
|
|
const prefixCls = getPrefixCls('switch', customizePrefixCls);
|
|
const loadingIcon = /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: `${prefixCls}-handle`
|
|
}, loading && /*#__PURE__*/_react_17_0_2_react.createElement(LoadingOutlined/* default */.Z, {
|
|
className: `${prefixCls}-loading-icon`
|
|
}));
|
|
// Style
|
|
const [wrapSSR, hashId] = switch_style(prefixCls);
|
|
const mergedSize = (0,useSize/* default */.Z)(customizeSize);
|
|
const classes = _classnames_2_5_1_classnames_default()(SWITCH === null || SWITCH === void 0 ? void 0 : SWITCH.className, {
|
|
[`${prefixCls}-small`]: mergedSize === 'small',
|
|
[`${prefixCls}-loading`]: loading,
|
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
}, className, rootClassName, hashId);
|
|
const mergedStyle = Object.assign(Object.assign({}, SWITCH === null || SWITCH === void 0 ? void 0 : SWITCH.style), style);
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(wave/* default */.Z, {
|
|
component: "Switch"
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(es, Object.assign({}, restProps, {
|
|
prefixCls: prefixCls,
|
|
className: classes,
|
|
style: mergedStyle,
|
|
disabled: mergedDisabled,
|
|
ref: ref,
|
|
loadingIcon: loadingIcon
|
|
}))));
|
|
});
|
|
switch_Switch.__ANT_SWITCH = true;
|
|
if (false) {}
|
|
/* harmony default export */ var es_switch = (switch_Switch);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 99498:
|
|
/*!*********************************************************************************!*\
|
|
!*** ./node_modules/_codemirror@5.58.2@codemirror/addon/display/placeholder.js ***!
|
|
\*********************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
|
|
|
(function(mod) {
|
|
if (true) // CommonJS
|
|
mod(__webpack_require__(/*! ../../lib/codemirror */ 89780));
|
|
else {}
|
|
})(function(CodeMirror) {
|
|
CodeMirror.defineOption("placeholder", "", function(cm, val, old) {
|
|
var prev = old && old != CodeMirror.Init;
|
|
if (val && !prev) {
|
|
cm.on("blur", onBlur);
|
|
cm.on("change", onChange);
|
|
cm.on("swapDoc", onChange);
|
|
CodeMirror.on(cm.getInputField(), "compositionupdate", cm.state.placeholderCompose = function() { onComposition(cm) })
|
|
onChange(cm);
|
|
} else if (!val && prev) {
|
|
cm.off("blur", onBlur);
|
|
cm.off("change", onChange);
|
|
cm.off("swapDoc", onChange);
|
|
CodeMirror.off(cm.getInputField(), "compositionupdate", cm.state.placeholderCompose)
|
|
clearPlaceholder(cm);
|
|
var wrapper = cm.getWrapperElement();
|
|
wrapper.className = wrapper.className.replace(" CodeMirror-empty", "");
|
|
}
|
|
|
|
if (val && !cm.hasFocus()) onBlur(cm);
|
|
});
|
|
|
|
function clearPlaceholder(cm) {
|
|
if (cm.state.placeholder) {
|
|
cm.state.placeholder.parentNode.removeChild(cm.state.placeholder);
|
|
cm.state.placeholder = null;
|
|
}
|
|
}
|
|
function setPlaceholder(cm) {
|
|
clearPlaceholder(cm);
|
|
var elt = cm.state.placeholder = document.createElement("pre");
|
|
elt.style.cssText = "height: 0; overflow: visible";
|
|
elt.style.direction = cm.getOption("direction");
|
|
elt.className = "CodeMirror-placeholder CodeMirror-line-like";
|
|
var placeHolder = cm.getOption("placeholder")
|
|
if (typeof placeHolder == "string") placeHolder = document.createTextNode(placeHolder)
|
|
elt.appendChild(placeHolder)
|
|
cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild);
|
|
}
|
|
|
|
function onComposition(cm) {
|
|
setTimeout(function() {
|
|
var empty = false, input = cm.getInputField()
|
|
if (input.nodeName == "TEXTAREA")
|
|
empty = !input.value
|
|
else if (cm.lineCount() == 1)
|
|
empty = !/[^\u200b]/.test(input.querySelector(".CodeMirror-line").textContent)
|
|
if (empty) setPlaceholder(cm)
|
|
else clearPlaceholder(cm)
|
|
}, 20)
|
|
}
|
|
|
|
function onBlur(cm) {
|
|
if (isEmpty(cm)) setPlaceholder(cm);
|
|
}
|
|
function onChange(cm) {
|
|
var wrapper = cm.getWrapperElement(), empty = isEmpty(cm);
|
|
wrapper.className = wrapper.className.replace(" CodeMirror-empty", "") + (empty ? " CodeMirror-empty" : "");
|
|
|
|
if (empty) setPlaceholder(cm);
|
|
else clearPlaceholder(cm);
|
|
}
|
|
|
|
function isEmpty(cm) {
|
|
return (cm.lineCount() === 1) && (cm.getLine(0) === "");
|
|
}
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 25717:
|
|
/*!********************************************************************************!*\
|
|
!*** ./node_modules/_codemirror@5.58.2@codemirror/addon/edit/closebrackets.js ***!
|
|
\********************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
|
|
|
(function(mod) {
|
|
if (true) // CommonJS
|
|
mod(__webpack_require__(/*! ../../lib/codemirror */ 89780));
|
|
else {}
|
|
})(function(CodeMirror) {
|
|
var defaults = {
|
|
pairs: "()[]{}''\"\"",
|
|
closeBefore: ")]}'\":;>",
|
|
triples: "",
|
|
explode: "[]{}"
|
|
};
|
|
|
|
var Pos = CodeMirror.Pos;
|
|
|
|
CodeMirror.defineOption("autoCloseBrackets", false, function(cm, val, old) {
|
|
if (old && old != CodeMirror.Init) {
|
|
cm.removeKeyMap(keyMap);
|
|
cm.state.closeBrackets = null;
|
|
}
|
|
if (val) {
|
|
ensureBound(getOption(val, "pairs"))
|
|
cm.state.closeBrackets = val;
|
|
cm.addKeyMap(keyMap);
|
|
}
|
|
});
|
|
|
|
function getOption(conf, name) {
|
|
if (name == "pairs" && typeof conf == "string") return conf;
|
|
if (typeof conf == "object" && conf[name] != null) return conf[name];
|
|
return defaults[name];
|
|
}
|
|
|
|
var keyMap = {Backspace: handleBackspace, Enter: handleEnter};
|
|
function ensureBound(chars) {
|
|
for (var i = 0; i < chars.length; i++) {
|
|
var ch = chars.charAt(i), key = "'" + ch + "'"
|
|
if (!keyMap[key]) keyMap[key] = handler(ch)
|
|
}
|
|
}
|
|
ensureBound(defaults.pairs + "`")
|
|
|
|
function handler(ch) {
|
|
return function(cm) { return handleChar(cm, ch); };
|
|
}
|
|
|
|
function getConfig(cm) {
|
|
var deflt = cm.state.closeBrackets;
|
|
if (!deflt || deflt.override) return deflt;
|
|
var mode = cm.getModeAt(cm.getCursor());
|
|
return mode.closeBrackets || deflt;
|
|
}
|
|
|
|
function handleBackspace(cm) {
|
|
var conf = getConfig(cm);
|
|
if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass;
|
|
|
|
var pairs = getOption(conf, "pairs");
|
|
var ranges = cm.listSelections();
|
|
for (var i = 0; i < ranges.length; i++) {
|
|
if (!ranges[i].empty()) return CodeMirror.Pass;
|
|
var around = charsAround(cm, ranges[i].head);
|
|
if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass;
|
|
}
|
|
for (var i = ranges.length - 1; i >= 0; i--) {
|
|
var cur = ranges[i].head;
|
|
cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1), "+delete");
|
|
}
|
|
}
|
|
|
|
function handleEnter(cm) {
|
|
var conf = getConfig(cm);
|
|
var explode = conf && getOption(conf, "explode");
|
|
if (!explode || cm.getOption("disableInput")) return CodeMirror.Pass;
|
|
|
|
var ranges = cm.listSelections();
|
|
for (var i = 0; i < ranges.length; i++) {
|
|
if (!ranges[i].empty()) return CodeMirror.Pass;
|
|
var around = charsAround(cm, ranges[i].head);
|
|
if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass;
|
|
}
|
|
cm.operation(function() {
|
|
var linesep = cm.lineSeparator() || "\n";
|
|
cm.replaceSelection(linesep + linesep, null);
|
|
cm.execCommand("goCharLeft");
|
|
ranges = cm.listSelections();
|
|
for (var i = 0; i < ranges.length; i++) {
|
|
var line = ranges[i].head.line;
|
|
cm.indentLine(line, null, true);
|
|
cm.indentLine(line + 1, null, true);
|
|
}
|
|
});
|
|
}
|
|
|
|
function contractSelection(sel) {
|
|
var inverted = CodeMirror.cmpPos(sel.anchor, sel.head) > 0;
|
|
return {anchor: new Pos(sel.anchor.line, sel.anchor.ch + (inverted ? -1 : 1)),
|
|
head: new Pos(sel.head.line, sel.head.ch + (inverted ? 1 : -1))};
|
|
}
|
|
|
|
function handleChar(cm, ch) {
|
|
var conf = getConfig(cm);
|
|
if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass;
|
|
|
|
var pairs = getOption(conf, "pairs");
|
|
var pos = pairs.indexOf(ch);
|
|
if (pos == -1) return CodeMirror.Pass;
|
|
|
|
var closeBefore = getOption(conf,"closeBefore");
|
|
|
|
var triples = getOption(conf, "triples");
|
|
|
|
var identical = pairs.charAt(pos + 1) == ch;
|
|
var ranges = cm.listSelections();
|
|
var opening = pos % 2 == 0;
|
|
|
|
var type;
|
|
for (var i = 0; i < ranges.length; i++) {
|
|
var range = ranges[i], cur = range.head, curType;
|
|
var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1));
|
|
if (opening && !range.empty()) {
|
|
curType = "surround";
|
|
} else if ((identical || !opening) && next == ch) {
|
|
if (identical && stringStartsAfter(cm, cur))
|
|
curType = "both";
|
|
else if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch)
|
|
curType = "skipThree";
|
|
else
|
|
curType = "skip";
|
|
} else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 &&
|
|
cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch) {
|
|
if (cur.ch > 2 && /\bstring/.test(cm.getTokenTypeAt(Pos(cur.line, cur.ch - 2)))) return CodeMirror.Pass;
|
|
curType = "addFour";
|
|
} else if (identical) {
|
|
var prev = cur.ch == 0 ? " " : cm.getRange(Pos(cur.line, cur.ch - 1), cur)
|
|
if (!CodeMirror.isWordChar(next) && prev != ch && !CodeMirror.isWordChar(prev)) curType = "both";
|
|
else return CodeMirror.Pass;
|
|
} else if (opening && (next.length === 0 || /\s/.test(next) || closeBefore.indexOf(next) > -1)) {
|
|
curType = "both";
|
|
} else {
|
|
return CodeMirror.Pass;
|
|
}
|
|
if (!type) type = curType;
|
|
else if (type != curType) return CodeMirror.Pass;
|
|
}
|
|
|
|
var left = pos % 2 ? pairs.charAt(pos - 1) : ch;
|
|
var right = pos % 2 ? ch : pairs.charAt(pos + 1);
|
|
cm.operation(function() {
|
|
if (type == "skip") {
|
|
cm.execCommand("goCharRight");
|
|
} else if (type == "skipThree") {
|
|
for (var i = 0; i < 3; i++)
|
|
cm.execCommand("goCharRight");
|
|
} else if (type == "surround") {
|
|
var sels = cm.getSelections();
|
|
for (var i = 0; i < sels.length; i++)
|
|
sels[i] = left + sels[i] + right;
|
|
cm.replaceSelections(sels, "around");
|
|
sels = cm.listSelections().slice();
|
|
for (var i = 0; i < sels.length; i++)
|
|
sels[i] = contractSelection(sels[i]);
|
|
cm.setSelections(sels);
|
|
} else if (type == "both") {
|
|
cm.replaceSelection(left + right, null);
|
|
cm.triggerElectric(left + right);
|
|
cm.execCommand("goCharLeft");
|
|
} else if (type == "addFour") {
|
|
cm.replaceSelection(left + left + left + left, "before");
|
|
cm.execCommand("goCharRight");
|
|
}
|
|
});
|
|
}
|
|
|
|
function charsAround(cm, pos) {
|
|
var str = cm.getRange(Pos(pos.line, pos.ch - 1),
|
|
Pos(pos.line, pos.ch + 1));
|
|
return str.length == 2 ? str : null;
|
|
}
|
|
|
|
function stringStartsAfter(cm, pos) {
|
|
var token = cm.getTokenAt(Pos(pos.line, pos.ch + 1))
|
|
return /\bstring/.test(token.type) && token.start == pos.ch &&
|
|
(pos.ch == 0 || !/\bstring/.test(cm.getTokenTypeAt(pos)))
|
|
}
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 6313:
|
|
/*!***************************************************************************!*\
|
|
!*** ./node_modules/_codemirror@5.58.2@codemirror/addon/edit/closetag.js ***!
|
|
\***************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
|
|
|
/**
|
|
* Tag-closer extension for CodeMirror.
|
|
*
|
|
* This extension adds an "autoCloseTags" option that can be set to
|
|
* either true to get the default behavior, or an object to further
|
|
* configure its behavior.
|
|
*
|
|
* These are supported options:
|
|
*
|
|
* `whenClosing` (default true)
|
|
* Whether to autoclose when the '/' of a closing tag is typed.
|
|
* `whenOpening` (default true)
|
|
* Whether to autoclose the tag when the final '>' of an opening
|
|
* tag is typed.
|
|
* `dontCloseTags` (default is empty tags for HTML, none for XML)
|
|
* An array of tag names that should not be autoclosed.
|
|
* `indentTags` (default is block tags for HTML, none for XML)
|
|
* An array of tag names that should, when opened, cause a
|
|
* blank line to be added inside the tag, and the blank line and
|
|
* closing line to be indented.
|
|
* `emptyTags` (default is none)
|
|
* An array of XML tag names that should be autoclosed with '/>'.
|
|
*
|
|
* See demos/closetag.html for a usage example.
|
|
*/
|
|
|
|
(function(mod) {
|
|
if (true) // CommonJS
|
|
mod(__webpack_require__(/*! ../../lib/codemirror */ 89780), __webpack_require__(/*! ../fold/xml-fold */ 32855));
|
|
else {}
|
|
})(function(CodeMirror) {
|
|
CodeMirror.defineOption("autoCloseTags", false, function(cm, val, old) {
|
|
if (old != CodeMirror.Init && old)
|
|
cm.removeKeyMap("autoCloseTags");
|
|
if (!val) return;
|
|
var map = {name: "autoCloseTags"};
|
|
if (typeof val != "object" || val.whenClosing !== false)
|
|
map["'/'"] = function(cm) { return autoCloseSlash(cm); };
|
|
if (typeof val != "object" || val.whenOpening !== false)
|
|
map["'>'"] = function(cm) { return autoCloseGT(cm); };
|
|
cm.addKeyMap(map);
|
|
});
|
|
|
|
var htmlDontClose = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param",
|
|
"source", "track", "wbr"];
|
|
var htmlIndent = ["applet", "blockquote", "body", "button", "div", "dl", "fieldset", "form", "frameset", "h1", "h2", "h3", "h4",
|
|
"h5", "h6", "head", "html", "iframe", "layer", "legend", "object", "ol", "p", "select", "table", "ul"];
|
|
|
|
function autoCloseGT(cm) {
|
|
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
|
var ranges = cm.listSelections(), replacements = [];
|
|
var opt = cm.getOption("autoCloseTags");
|
|
for (var i = 0; i < ranges.length; i++) {
|
|
if (!ranges[i].empty()) return CodeMirror.Pass;
|
|
var pos = ranges[i].head, tok = cm.getTokenAt(pos);
|
|
var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
|
|
var tagInfo = inner.mode.xmlCurrentTag && inner.mode.xmlCurrentTag(state)
|
|
var tagName = tagInfo && tagInfo.name
|
|
if (!tagName) return CodeMirror.Pass
|
|
|
|
var html = inner.mode.configuration == "html";
|
|
var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose);
|
|
var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent);
|
|
|
|
if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch);
|
|
var lowerTagName = tagName.toLowerCase();
|
|
// Don't process the '>' at the end of an end-tag or self-closing tag
|
|
if (!tagName ||
|
|
tok.type == "string" && (tok.end != pos.ch || !/[\"\']/.test(tok.string.charAt(tok.string.length - 1)) || tok.string.length == 1) ||
|
|
tok.type == "tag" && tagInfo.close ||
|
|
tok.string.indexOf("/") == (pos.ch - tok.start - 1) || // match something like <someTagName />
|
|
dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1 ||
|
|
closingTagExists(cm, inner.mode.xmlCurrentContext && inner.mode.xmlCurrentContext(state) || [], tagName, pos, true))
|
|
return CodeMirror.Pass;
|
|
|
|
var emptyTags = typeof opt == "object" && opt.emptyTags;
|
|
if (emptyTags && indexOf(emptyTags, tagName) > -1) {
|
|
replacements[i] = { text: "/>", newPos: CodeMirror.Pos(pos.line, pos.ch + 2) };
|
|
continue;
|
|
}
|
|
|
|
var indent = indentTags && indexOf(indentTags, lowerTagName) > -1;
|
|
replacements[i] = {indent: indent,
|
|
text: ">" + (indent ? "\n\n" : "") + "</" + tagName + ">",
|
|
newPos: indent ? CodeMirror.Pos(pos.line + 1, 0) : CodeMirror.Pos(pos.line, pos.ch + 1)};
|
|
}
|
|
|
|
var dontIndentOnAutoClose = (typeof opt == "object" && opt.dontIndentOnAutoClose);
|
|
for (var i = ranges.length - 1; i >= 0; i--) {
|
|
var info = replacements[i];
|
|
cm.replaceRange(info.text, ranges[i].head, ranges[i].anchor, "+insert");
|
|
var sel = cm.listSelections().slice(0);
|
|
sel[i] = {head: info.newPos, anchor: info.newPos};
|
|
cm.setSelections(sel);
|
|
if (!dontIndentOnAutoClose && info.indent) {
|
|
cm.indentLine(info.newPos.line, null, true);
|
|
cm.indentLine(info.newPos.line + 1, null, true);
|
|
}
|
|
}
|
|
}
|
|
|
|
function autoCloseCurrent(cm, typingSlash) {
|
|
var ranges = cm.listSelections(), replacements = [];
|
|
var head = typingSlash ? "/" : "</";
|
|
var opt = cm.getOption("autoCloseTags");
|
|
var dontIndentOnAutoClose = (typeof opt == "object" && opt.dontIndentOnSlash);
|
|
for (var i = 0; i < ranges.length; i++) {
|
|
if (!ranges[i].empty()) return CodeMirror.Pass;
|
|
var pos = ranges[i].head, tok = cm.getTokenAt(pos);
|
|
var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
|
|
if (typingSlash && (tok.type == "string" || tok.string.charAt(0) != "<" ||
|
|
tok.start != pos.ch - 1))
|
|
return CodeMirror.Pass;
|
|
// Kludge to get around the fact that we are not in XML mode
|
|
// when completing in JS/CSS snippet in htmlmixed mode. Does not
|
|
// work for other XML embedded languages (there is no general
|
|
// way to go from a mixed mode to its current XML state).
|
|
var replacement, mixed = inner.mode.name != "xml" && cm.getMode().name == "htmlmixed"
|
|
if (mixed && inner.mode.name == "javascript") {
|
|
replacement = head + "script";
|
|
} else if (mixed && inner.mode.name == "css") {
|
|
replacement = head + "style";
|
|
} else {
|
|
var context = inner.mode.xmlCurrentContext && inner.mode.xmlCurrentContext(state)
|
|
if (!context || (context.length && closingTagExists(cm, context, context[context.length - 1], pos)))
|
|
return CodeMirror.Pass;
|
|
replacement = head + context[context.length - 1]
|
|
}
|
|
if (cm.getLine(pos.line).charAt(tok.end) != ">") replacement += ">";
|
|
replacements[i] = replacement;
|
|
}
|
|
cm.replaceSelections(replacements);
|
|
ranges = cm.listSelections();
|
|
if (!dontIndentOnAutoClose) {
|
|
for (var i = 0; i < ranges.length; i++)
|
|
if (i == ranges.length - 1 || ranges[i].head.line < ranges[i + 1].head.line)
|
|
cm.indentLine(ranges[i].head.line);
|
|
}
|
|
}
|
|
|
|
function autoCloseSlash(cm) {
|
|
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
|
return autoCloseCurrent(cm, true);
|
|
}
|
|
|
|
CodeMirror.commands.closeTag = function(cm) { return autoCloseCurrent(cm); };
|
|
|
|
function indexOf(collection, elt) {
|
|
if (collection.indexOf) return collection.indexOf(elt);
|
|
for (var i = 0, e = collection.length; i < e; ++i)
|
|
if (collection[i] == elt) return i;
|
|
return -1;
|
|
}
|
|
|
|
// If xml-fold is loaded, we use its functionality to try and verify
|
|
// whether a given tag is actually unclosed.
|
|
function closingTagExists(cm, context, tagName, pos, newTag) {
|
|
if (!CodeMirror.scanForClosingTag) return false;
|
|
var end = Math.min(cm.lastLine() + 1, pos.line + 500);
|
|
var nextClose = CodeMirror.scanForClosingTag(cm, pos, null, end);
|
|
if (!nextClose || nextClose.tag != tagName) return false;
|
|
// If the immediate wrapping context contains onCx instances of
|
|
// the same tag, a closing tag only exists if there are at least
|
|
// that many closing tags of that type following.
|
|
var onCx = newTag ? 1 : 0
|
|
for (var i = context.length - 1; i >= 0; i--) {
|
|
if (context[i] == tagName) ++onCx
|
|
else break
|
|
}
|
|
pos = nextClose.to;
|
|
for (var i = 1; i < onCx; i++) {
|
|
var next = CodeMirror.scanForClosingTag(cm, pos, null, end);
|
|
if (!next || next.tag != tagName) return false;
|
|
pos = next.to;
|
|
}
|
|
return true;
|
|
}
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 32855:
|
|
/*!***************************************************************************!*\
|
|
!*** ./node_modules/_codemirror@5.58.2@codemirror/addon/fold/xml-fold.js ***!
|
|
\***************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
|
|
|
(function(mod) {
|
|
if (true) // CommonJS
|
|
mod(__webpack_require__(/*! ../../lib/codemirror */ 89780));
|
|
else {}
|
|
})(function(CodeMirror) {
|
|
"use strict";
|
|
|
|
var Pos = CodeMirror.Pos;
|
|
function cmp(a, b) { return a.line - b.line || a.ch - b.ch; }
|
|
|
|
var nameStartChar = "A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
|
|
var nameChar = nameStartChar + "\-\:\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
|
|
var xmlTagStart = new RegExp("<(/?)([" + nameStartChar + "][" + nameChar + "]*)", "g");
|
|
|
|
function Iter(cm, line, ch, range) {
|
|
this.line = line; this.ch = ch;
|
|
this.cm = cm; this.text = cm.getLine(line);
|
|
this.min = range ? Math.max(range.from, cm.firstLine()) : cm.firstLine();
|
|
this.max = range ? Math.min(range.to - 1, cm.lastLine()) : cm.lastLine();
|
|
}
|
|
|
|
function tagAt(iter, ch) {
|
|
var type = iter.cm.getTokenTypeAt(Pos(iter.line, ch));
|
|
return type && /\btag\b/.test(type);
|
|
}
|
|
|
|
function nextLine(iter) {
|
|
if (iter.line >= iter.max) return;
|
|
iter.ch = 0;
|
|
iter.text = iter.cm.getLine(++iter.line);
|
|
return true;
|
|
}
|
|
function prevLine(iter) {
|
|
if (iter.line <= iter.min) return;
|
|
iter.text = iter.cm.getLine(--iter.line);
|
|
iter.ch = iter.text.length;
|
|
return true;
|
|
}
|
|
|
|
function toTagEnd(iter) {
|
|
for (;;) {
|
|
var gt = iter.text.indexOf(">", iter.ch);
|
|
if (gt == -1) { if (nextLine(iter)) continue; else return; }
|
|
if (!tagAt(iter, gt + 1)) { iter.ch = gt + 1; continue; }
|
|
var lastSlash = iter.text.lastIndexOf("/", gt);
|
|
var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt));
|
|
iter.ch = gt + 1;
|
|
return selfClose ? "selfClose" : "regular";
|
|
}
|
|
}
|
|
function toTagStart(iter) {
|
|
for (;;) {
|
|
var lt = iter.ch ? iter.text.lastIndexOf("<", iter.ch - 1) : -1;
|
|
if (lt == -1) { if (prevLine(iter)) continue; else return; }
|
|
if (!tagAt(iter, lt + 1)) { iter.ch = lt; continue; }
|
|
xmlTagStart.lastIndex = lt;
|
|
iter.ch = lt;
|
|
var match = xmlTagStart.exec(iter.text);
|
|
if (match && match.index == lt) return match;
|
|
}
|
|
}
|
|
|
|
function toNextTag(iter) {
|
|
for (;;) {
|
|
xmlTagStart.lastIndex = iter.ch;
|
|
var found = xmlTagStart.exec(iter.text);
|
|
if (!found) { if (nextLine(iter)) continue; else return; }
|
|
if (!tagAt(iter, found.index + 1)) { iter.ch = found.index + 1; continue; }
|
|
iter.ch = found.index + found[0].length;
|
|
return found;
|
|
}
|
|
}
|
|
function toPrevTag(iter) {
|
|
for (;;) {
|
|
var gt = iter.ch ? iter.text.lastIndexOf(">", iter.ch - 1) : -1;
|
|
if (gt == -1) { if (prevLine(iter)) continue; else return; }
|
|
if (!tagAt(iter, gt + 1)) { iter.ch = gt; continue; }
|
|
var lastSlash = iter.text.lastIndexOf("/", gt);
|
|
var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt));
|
|
iter.ch = gt + 1;
|
|
return selfClose ? "selfClose" : "regular";
|
|
}
|
|
}
|
|
|
|
function findMatchingClose(iter, tag) {
|
|
var stack = [];
|
|
for (;;) {
|
|
var next = toNextTag(iter), end, startLine = iter.line, startCh = iter.ch - (next ? next[0].length : 0);
|
|
if (!next || !(end = toTagEnd(iter))) return;
|
|
if (end == "selfClose") continue;
|
|
if (next[1]) { // closing tag
|
|
for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == next[2]) {
|
|
stack.length = i;
|
|
break;
|
|
}
|
|
if (i < 0 && (!tag || tag == next[2])) return {
|
|
tag: next[2],
|
|
from: Pos(startLine, startCh),
|
|
to: Pos(iter.line, iter.ch)
|
|
};
|
|
} else { // opening tag
|
|
stack.push(next[2]);
|
|
}
|
|
}
|
|
}
|
|
function findMatchingOpen(iter, tag) {
|
|
var stack = [];
|
|
for (;;) {
|
|
var prev = toPrevTag(iter);
|
|
if (!prev) return;
|
|
if (prev == "selfClose") { toTagStart(iter); continue; }
|
|
var endLine = iter.line, endCh = iter.ch;
|
|
var start = toTagStart(iter);
|
|
if (!start) return;
|
|
if (start[1]) { // closing tag
|
|
stack.push(start[2]);
|
|
} else { // opening tag
|
|
for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == start[2]) {
|
|
stack.length = i;
|
|
break;
|
|
}
|
|
if (i < 0 && (!tag || tag == start[2])) return {
|
|
tag: start[2],
|
|
from: Pos(iter.line, iter.ch),
|
|
to: Pos(endLine, endCh)
|
|
};
|
|
}
|
|
}
|
|
}
|
|
|
|
CodeMirror.registerHelper("fold", "xml", function(cm, start) {
|
|
var iter = new Iter(cm, start.line, 0);
|
|
for (;;) {
|
|
var openTag = toNextTag(iter)
|
|
if (!openTag || iter.line != start.line) return
|
|
var end = toTagEnd(iter)
|
|
if (!end) return
|
|
if (!openTag[1] && end != "selfClose") {
|
|
var startPos = Pos(iter.line, iter.ch);
|
|
var endPos = findMatchingClose(iter, openTag[2]);
|
|
return endPos && cmp(endPos.from, startPos) > 0 ? {from: startPos, to: endPos.from} : null
|
|
}
|
|
}
|
|
});
|
|
CodeMirror.findMatchingTag = function(cm, pos, range) {
|
|
var iter = new Iter(cm, pos.line, pos.ch, range);
|
|
if (iter.text.indexOf(">") == -1 && iter.text.indexOf("<") == -1) return;
|
|
var end = toTagEnd(iter), to = end && Pos(iter.line, iter.ch);
|
|
var start = end && toTagStart(iter);
|
|
if (!end || !start || cmp(iter, pos) > 0) return;
|
|
var here = {from: Pos(iter.line, iter.ch), to: to, tag: start[2]};
|
|
if (end == "selfClose") return {open: here, close: null, at: "open"};
|
|
|
|
if (start[1]) { // closing tag
|
|
return {open: findMatchingOpen(iter, start[2]), close: here, at: "close"};
|
|
} else { // opening tag
|
|
iter = new Iter(cm, to.line, to.ch, range);
|
|
return {open: here, close: findMatchingClose(iter, start[2]), at: "open"};
|
|
}
|
|
};
|
|
|
|
CodeMirror.findEnclosingTag = function(cm, pos, range, tag) {
|
|
var iter = new Iter(cm, pos.line, pos.ch, range);
|
|
for (;;) {
|
|
var open = findMatchingOpen(iter, tag);
|
|
if (!open) break;
|
|
var forward = new Iter(cm, pos.line, pos.ch, range);
|
|
var close = findMatchingClose(forward, open.tag);
|
|
if (close) return {open: open, close: close};
|
|
}
|
|
};
|
|
|
|
// Used by addon/edit/closetag.js
|
|
CodeMirror.scanForClosingTag = function(cm, pos, name, end) {
|
|
var iter = new Iter(cm, pos.line, pos.ch, end ? {from: 0, to: end} : null);
|
|
return findMatchingClose(iter, name);
|
|
};
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 25419:
|
|
/*!******************************************************************************!*\
|
|
!*** ./node_modules/_codemirror@5.58.2@codemirror/mode/markdown/markdown.js ***!
|
|
\******************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
|
|
|
(function(mod) {
|
|
if (true) // CommonJS
|
|
mod(__webpack_require__(/*! ../../lib/codemirror */ 89780), __webpack_require__(/*! ../xml/xml */ 15525), __webpack_require__(/*! ../meta */ 98101));
|
|
else {}
|
|
})(function(CodeMirror) {
|
|
"use strict";
|
|
|
|
CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|
|
|
var htmlMode = CodeMirror.getMode(cmCfg, "text/html");
|
|
var htmlModeMissing = htmlMode.name == "null"
|
|
|
|
function getMode(name) {
|
|
if (CodeMirror.findModeByName) {
|
|
var found = CodeMirror.findModeByName(name);
|
|
if (found) name = found.mime || found.mimes[0];
|
|
}
|
|
var mode = CodeMirror.getMode(cmCfg, name);
|
|
return mode.name == "null" ? null : mode;
|
|
}
|
|
|
|
// Should characters that affect highlighting be highlighted separate?
|
|
// Does not include characters that will be output (such as `1.` and `-` for lists)
|
|
if (modeCfg.highlightFormatting === undefined)
|
|
modeCfg.highlightFormatting = false;
|
|
|
|
// Maximum number of nested blockquotes. Set to 0 for infinite nesting.
|
|
// Excess `>` will emit `error` token.
|
|
if (modeCfg.maxBlockquoteDepth === undefined)
|
|
modeCfg.maxBlockquoteDepth = 0;
|
|
|
|
// Turn on task lists? ("- [ ] " and "- [x] ")
|
|
if (modeCfg.taskLists === undefined) modeCfg.taskLists = false;
|
|
|
|
// Turn on strikethrough syntax
|
|
if (modeCfg.strikethrough === undefined)
|
|
modeCfg.strikethrough = false;
|
|
|
|
if (modeCfg.emoji === undefined)
|
|
modeCfg.emoji = false;
|
|
|
|
if (modeCfg.fencedCodeBlockHighlighting === undefined)
|
|
modeCfg.fencedCodeBlockHighlighting = true;
|
|
|
|
if (modeCfg.fencedCodeBlockDefaultMode === undefined)
|
|
modeCfg.fencedCodeBlockDefaultMode = 'text/plain';
|
|
|
|
if (modeCfg.xml === undefined)
|
|
modeCfg.xml = true;
|
|
|
|
// Allow token types to be overridden by user-provided token types.
|
|
if (modeCfg.tokenTypeOverrides === undefined)
|
|
modeCfg.tokenTypeOverrides = {};
|
|
|
|
var tokenTypes = {
|
|
header: "header",
|
|
code: "comment",
|
|
quote: "quote",
|
|
list1: "variable-2",
|
|
list2: "variable-3",
|
|
list3: "keyword",
|
|
hr: "hr",
|
|
image: "image",
|
|
imageAltText: "image-alt-text",
|
|
imageMarker: "image-marker",
|
|
formatting: "formatting",
|
|
linkInline: "link",
|
|
linkEmail: "link",
|
|
linkText: "link",
|
|
linkHref: "string",
|
|
em: "em",
|
|
strong: "strong",
|
|
strikethrough: "strikethrough",
|
|
emoji: "builtin"
|
|
};
|
|
|
|
for (var tokenType in tokenTypes) {
|
|
if (tokenTypes.hasOwnProperty(tokenType) && modeCfg.tokenTypeOverrides[tokenType]) {
|
|
tokenTypes[tokenType] = modeCfg.tokenTypeOverrides[tokenType];
|
|
}
|
|
}
|
|
|
|
var hrRE = /^([*\-_])(?:\s*\1){2,}\s*$/
|
|
, listRE = /^(?:[*\-+]|^[0-9]+([.)]))\s+/
|
|
, taskListRE = /^\[(x| )\](?=\s)/i // Must follow listRE
|
|
, atxHeaderRE = modeCfg.allowAtxHeaderWithoutSpace ? /^(#+)/ : /^(#+)(?: |$)/
|
|
, setextHeaderRE = /^ {0,3}(?:\={1,}|-{2,})\s*$/
|
|
, textRE = /^[^#!\[\]*_\\<>` "'(~:]+/
|
|
, fencedCodeRE = /^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/
|
|
, linkDefRE = /^\s*\[[^\]]+?\]:.*$/ // naive link-definition
|
|
, punctuation = /[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/
|
|
, expandedTab = " " // CommonMark specifies tab as 4 spaces
|
|
|
|
function switchInline(stream, state, f) {
|
|
state.f = state.inline = f;
|
|
return f(stream, state);
|
|
}
|
|
|
|
function switchBlock(stream, state, f) {
|
|
state.f = state.block = f;
|
|
return f(stream, state);
|
|
}
|
|
|
|
function lineIsEmpty(line) {
|
|
return !line || !/\S/.test(line.string)
|
|
}
|
|
|
|
// Blocks
|
|
|
|
function blankLine(state) {
|
|
// Reset linkTitle state
|
|
state.linkTitle = false;
|
|
state.linkHref = false;
|
|
state.linkText = false;
|
|
// Reset EM state
|
|
state.em = false;
|
|
// Reset STRONG state
|
|
state.strong = false;
|
|
// Reset strikethrough state
|
|
state.strikethrough = false;
|
|
// Reset state.quote
|
|
state.quote = 0;
|
|
// Reset state.indentedCode
|
|
state.indentedCode = false;
|
|
if (state.f == htmlBlock) {
|
|
var exit = htmlModeMissing
|
|
if (!exit) {
|
|
var inner = CodeMirror.innerMode(htmlMode, state.htmlState)
|
|
exit = inner.mode.name == "xml" && inner.state.tagStart === null &&
|
|
(!inner.state.context && inner.state.tokenize.isInText)
|
|
}
|
|
if (exit) {
|
|
state.f = inlineNormal;
|
|
state.block = blockNormal;
|
|
state.htmlState = null;
|
|
}
|
|
}
|
|
// Reset state.trailingSpace
|
|
state.trailingSpace = 0;
|
|
state.trailingSpaceNewLine = false;
|
|
// Mark this line as blank
|
|
state.prevLine = state.thisLine
|
|
state.thisLine = {stream: null}
|
|
return null;
|
|
}
|
|
|
|
function blockNormal(stream, state) {
|
|
var firstTokenOnLine = stream.column() === state.indentation;
|
|
var prevLineLineIsEmpty = lineIsEmpty(state.prevLine.stream);
|
|
var prevLineIsIndentedCode = state.indentedCode;
|
|
var prevLineIsHr = state.prevLine.hr;
|
|
var prevLineIsList = state.list !== false;
|
|
var maxNonCodeIndentation = (state.listStack[state.listStack.length - 1] || 0) + 3;
|
|
|
|
state.indentedCode = false;
|
|
|
|
var lineIndentation = state.indentation;
|
|
// compute once per line (on first token)
|
|
if (state.indentationDiff === null) {
|
|
state.indentationDiff = state.indentation;
|
|
if (prevLineIsList) {
|
|
state.list = null;
|
|
// While this list item's marker's indentation is less than the deepest
|
|
// list item's content's indentation,pop the deepest list item
|
|
// indentation off the stack, and update block indentation state
|
|
while (lineIndentation < state.listStack[state.listStack.length - 1]) {
|
|
state.listStack.pop();
|
|
if (state.listStack.length) {
|
|
state.indentation = state.listStack[state.listStack.length - 1];
|
|
// less than the first list's indent -> the line is no longer a list
|
|
} else {
|
|
state.list = false;
|
|
}
|
|
}
|
|
if (state.list !== false) {
|
|
state.indentationDiff = lineIndentation - state.listStack[state.listStack.length - 1]
|
|
}
|
|
}
|
|
}
|
|
|
|
// not comprehensive (currently only for setext detection purposes)
|
|
var allowsInlineContinuation = (
|
|
!prevLineLineIsEmpty && !prevLineIsHr && !state.prevLine.header &&
|
|
(!prevLineIsList || !prevLineIsIndentedCode) &&
|
|
!state.prevLine.fencedCodeEnd
|
|
);
|
|
|
|
var isHr = (state.list === false || prevLineIsHr || prevLineLineIsEmpty) &&
|
|
state.indentation <= maxNonCodeIndentation && stream.match(hrRE);
|
|
|
|
var match = null;
|
|
if (state.indentationDiff >= 4 && (prevLineIsIndentedCode || state.prevLine.fencedCodeEnd ||
|
|
state.prevLine.header || prevLineLineIsEmpty)) {
|
|
stream.skipToEnd();
|
|
state.indentedCode = true;
|
|
return tokenTypes.code;
|
|
} else if (stream.eatSpace()) {
|
|
return null;
|
|
} else if (firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(atxHeaderRE)) && match[1].length <= 6) {
|
|
state.quote = 0;
|
|
state.header = match[1].length;
|
|
state.thisLine.header = true;
|
|
if (modeCfg.highlightFormatting) state.formatting = "header";
|
|
state.f = state.inline;
|
|
return getType(state);
|
|
} else if (state.indentation <= maxNonCodeIndentation && stream.eat('>')) {
|
|
state.quote = firstTokenOnLine ? 1 : state.quote + 1;
|
|
if (modeCfg.highlightFormatting) state.formatting = "quote";
|
|
stream.eatSpace();
|
|
return getType(state);
|
|
} else if (!isHr && !state.setext && firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(listRE))) {
|
|
var listType = match[1] ? "ol" : "ul";
|
|
|
|
state.indentation = lineIndentation + stream.current().length;
|
|
state.list = true;
|
|
state.quote = 0;
|
|
|
|
// Add this list item's content's indentation to the stack
|
|
state.listStack.push(state.indentation);
|
|
// Reset inline styles which shouldn't propagate aross list items
|
|
state.em = false;
|
|
state.strong = false;
|
|
state.code = false;
|
|
state.strikethrough = false;
|
|
|
|
if (modeCfg.taskLists && stream.match(taskListRE, false)) {
|
|
state.taskList = true;
|
|
}
|
|
state.f = state.inline;
|
|
if (modeCfg.highlightFormatting) state.formatting = ["list", "list-" + listType];
|
|
return getType(state);
|
|
} else if (firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(fencedCodeRE, true))) {
|
|
state.quote = 0;
|
|
state.fencedEndRE = new RegExp(match[1] + "+ *$");
|
|
// try switching mode
|
|
state.localMode = modeCfg.fencedCodeBlockHighlighting && getMode(match[2] || modeCfg.fencedCodeBlockDefaultMode );
|
|
if (state.localMode) state.localState = CodeMirror.startState(state.localMode);
|
|
state.f = state.block = local;
|
|
if (modeCfg.highlightFormatting) state.formatting = "code-block";
|
|
state.code = -1
|
|
return getType(state);
|
|
// SETEXT has lowest block-scope precedence after HR, so check it after
|
|
// the others (code, blockquote, list...)
|
|
} else if (
|
|
// if setext set, indicates line after ---/===
|
|
state.setext || (
|
|
// line before ---/===
|
|
(!allowsInlineContinuation || !prevLineIsList) && !state.quote && state.list === false &&
|
|
!state.code && !isHr && !linkDefRE.test(stream.string) &&
|
|
(match = stream.lookAhead(1)) && (match = match.match(setextHeaderRE))
|
|
)
|
|
) {
|
|
if ( !state.setext ) {
|
|
state.header = match[0].charAt(0) == '=' ? 1 : 2;
|
|
state.setext = state.header;
|
|
} else {
|
|
state.header = state.setext;
|
|
// has no effect on type so we can reset it now
|
|
state.setext = 0;
|
|
stream.skipToEnd();
|
|
if (modeCfg.highlightFormatting) state.formatting = "header";
|
|
}
|
|
state.thisLine.header = true;
|
|
state.f = state.inline;
|
|
return getType(state);
|
|
} else if (isHr) {
|
|
stream.skipToEnd();
|
|
state.hr = true;
|
|
state.thisLine.hr = true;
|
|
return tokenTypes.hr;
|
|
} else if (stream.peek() === '[') {
|
|
return switchInline(stream, state, footnoteLink);
|
|
}
|
|
|
|
return switchInline(stream, state, state.inline);
|
|
}
|
|
|
|
function htmlBlock(stream, state) {
|
|
var style = htmlMode.token(stream, state.htmlState);
|
|
if (!htmlModeMissing) {
|
|
var inner = CodeMirror.innerMode(htmlMode, state.htmlState)
|
|
if ((inner.mode.name == "xml" && inner.state.tagStart === null &&
|
|
(!inner.state.context && inner.state.tokenize.isInText)) ||
|
|
(state.md_inside && stream.current().indexOf(">") > -1)) {
|
|
state.f = inlineNormal;
|
|
state.block = blockNormal;
|
|
state.htmlState = null;
|
|
}
|
|
}
|
|
return style;
|
|
}
|
|
|
|
function local(stream, state) {
|
|
var currListInd = state.listStack[state.listStack.length - 1] || 0;
|
|
var hasExitedList = state.indentation < currListInd;
|
|
var maxFencedEndInd = currListInd + 3;
|
|
if (state.fencedEndRE && state.indentation <= maxFencedEndInd && (hasExitedList || stream.match(state.fencedEndRE))) {
|
|
if (modeCfg.highlightFormatting) state.formatting = "code-block";
|
|
var returnType;
|
|
if (!hasExitedList) returnType = getType(state)
|
|
state.localMode = state.localState = null;
|
|
state.block = blockNormal;
|
|
state.f = inlineNormal;
|
|
state.fencedEndRE = null;
|
|
state.code = 0
|
|
state.thisLine.fencedCodeEnd = true;
|
|
if (hasExitedList) return switchBlock(stream, state, state.block);
|
|
return returnType;
|
|
} else if (state.localMode) {
|
|
return state.localMode.token(stream, state.localState);
|
|
} else {
|
|
stream.skipToEnd();
|
|
return tokenTypes.code;
|
|
}
|
|
}
|
|
|
|
// Inline
|
|
function getType(state) {
|
|
var styles = [];
|
|
|
|
if (state.formatting) {
|
|
styles.push(tokenTypes.formatting);
|
|
|
|
if (typeof state.formatting === "string") state.formatting = [state.formatting];
|
|
|
|
for (var i = 0; i < state.formatting.length; i++) {
|
|
styles.push(tokenTypes.formatting + "-" + state.formatting[i]);
|
|
|
|
if (state.formatting[i] === "header") {
|
|
styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.header);
|
|
}
|
|
|
|
// Add `formatting-quote` and `formatting-quote-#` for blockquotes
|
|
// Add `error` instead if the maximum blockquote nesting depth is passed
|
|
if (state.formatting[i] === "quote") {
|
|
if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) {
|
|
styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.quote);
|
|
} else {
|
|
styles.push("error");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (state.taskOpen) {
|
|
styles.push("meta");
|
|
return styles.length ? styles.join(' ') : null;
|
|
}
|
|
if (state.taskClosed) {
|
|
styles.push("property");
|
|
return styles.length ? styles.join(' ') : null;
|
|
}
|
|
|
|
if (state.linkHref) {
|
|
styles.push(tokenTypes.linkHref, "url");
|
|
} else { // Only apply inline styles to non-url text
|
|
if (state.strong) { styles.push(tokenTypes.strong); }
|
|
if (state.em) { styles.push(tokenTypes.em); }
|
|
if (state.strikethrough) { styles.push(tokenTypes.strikethrough); }
|
|
if (state.emoji) { styles.push(tokenTypes.emoji); }
|
|
if (state.linkText) { styles.push(tokenTypes.linkText); }
|
|
if (state.code) { styles.push(tokenTypes.code); }
|
|
if (state.image) { styles.push(tokenTypes.image); }
|
|
if (state.imageAltText) { styles.push(tokenTypes.imageAltText, "link"); }
|
|
if (state.imageMarker) { styles.push(tokenTypes.imageMarker); }
|
|
}
|
|
|
|
if (state.header) { styles.push(tokenTypes.header, tokenTypes.header + "-" + state.header); }
|
|
|
|
if (state.quote) {
|
|
styles.push(tokenTypes.quote);
|
|
|
|
// Add `quote-#` where the maximum for `#` is modeCfg.maxBlockquoteDepth
|
|
if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) {
|
|
styles.push(tokenTypes.quote + "-" + state.quote);
|
|
} else {
|
|
styles.push(tokenTypes.quote + "-" + modeCfg.maxBlockquoteDepth);
|
|
}
|
|
}
|
|
|
|
if (state.list !== false) {
|
|
var listMod = (state.listStack.length - 1) % 3;
|
|
if (!listMod) {
|
|
styles.push(tokenTypes.list1);
|
|
} else if (listMod === 1) {
|
|
styles.push(tokenTypes.list2);
|
|
} else {
|
|
styles.push(tokenTypes.list3);
|
|
}
|
|
}
|
|
|
|
if (state.trailingSpaceNewLine) {
|
|
styles.push("trailing-space-new-line");
|
|
} else if (state.trailingSpace) {
|
|
styles.push("trailing-space-" + (state.trailingSpace % 2 ? "a" : "b"));
|
|
}
|
|
|
|
return styles.length ? styles.join(' ') : null;
|
|
}
|
|
|
|
function handleText(stream, state) {
|
|
if (stream.match(textRE, true)) {
|
|
return getType(state);
|
|
}
|
|
return undefined;
|
|
}
|
|
|
|
function inlineNormal(stream, state) {
|
|
var style = state.text(stream, state);
|
|
if (typeof style !== 'undefined')
|
|
return style;
|
|
|
|
if (state.list) { // List marker (*, +, -, 1., etc)
|
|
state.list = null;
|
|
return getType(state);
|
|
}
|
|
|
|
if (state.taskList) {
|
|
var taskOpen = stream.match(taskListRE, true)[1] === " ";
|
|
if (taskOpen) state.taskOpen = true;
|
|
else state.taskClosed = true;
|
|
if (modeCfg.highlightFormatting) state.formatting = "task";
|
|
state.taskList = false;
|
|
return getType(state);
|
|
}
|
|
|
|
state.taskOpen = false;
|
|
state.taskClosed = false;
|
|
|
|
if (state.header && stream.match(/^#+$/, true)) {
|
|
if (modeCfg.highlightFormatting) state.formatting = "header";
|
|
return getType(state);
|
|
}
|
|
|
|
var ch = stream.next();
|
|
|
|
// Matches link titles present on next line
|
|
if (state.linkTitle) {
|
|
state.linkTitle = false;
|
|
var matchCh = ch;
|
|
if (ch === '(') {
|
|
matchCh = ')';
|
|
}
|
|
matchCh = (matchCh+'').replace(/([.?*+^\[\]\\(){}|-])/g, "\\$1");
|
|
var regex = '^\\s*(?:[^' + matchCh + '\\\\]+|\\\\\\\\|\\\\.)' + matchCh;
|
|
if (stream.match(new RegExp(regex), true)) {
|
|
return tokenTypes.linkHref;
|
|
}
|
|
}
|
|
|
|
// If this block is changed, it may need to be updated in GFM mode
|
|
if (ch === '`') {
|
|
var previousFormatting = state.formatting;
|
|
if (modeCfg.highlightFormatting) state.formatting = "code";
|
|
stream.eatWhile('`');
|
|
var count = stream.current().length
|
|
if (state.code == 0 && (!state.quote || count == 1)) {
|
|
state.code = count
|
|
return getType(state)
|
|
} else if (count == state.code) { // Must be exact
|
|
var t = getType(state)
|
|
state.code = 0
|
|
return t
|
|
} else {
|
|
state.formatting = previousFormatting
|
|
return getType(state)
|
|
}
|
|
} else if (state.code) {
|
|
return getType(state);
|
|
}
|
|
|
|
if (ch === '\\') {
|
|
stream.next();
|
|
if (modeCfg.highlightFormatting) {
|
|
var type = getType(state);
|
|
var formattingEscape = tokenTypes.formatting + "-escape";
|
|
return type ? type + " " + formattingEscape : formattingEscape;
|
|
}
|
|
}
|
|
|
|
if (ch === '!' && stream.match(/\[[^\]]*\] ?(?:\(|\[)/, false)) {
|
|
state.imageMarker = true;
|
|
state.image = true;
|
|
if (modeCfg.highlightFormatting) state.formatting = "image";
|
|
return getType(state);
|
|
}
|
|
|
|
if (ch === '[' && state.imageMarker && stream.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/, false)) {
|
|
state.imageMarker = false;
|
|
state.imageAltText = true
|
|
if (modeCfg.highlightFormatting) state.formatting = "image";
|
|
return getType(state);
|
|
}
|
|
|
|
if (ch === ']' && state.imageAltText) {
|
|
if (modeCfg.highlightFormatting) state.formatting = "image";
|
|
var type = getType(state);
|
|
state.imageAltText = false;
|
|
state.image = false;
|
|
state.inline = state.f = linkHref;
|
|
return type;
|
|
}
|
|
|
|
if (ch === '[' && !state.image) {
|
|
if (state.linkText && stream.match(/^.*?\]/)) return getType(state)
|
|
state.linkText = true;
|
|
if (modeCfg.highlightFormatting) state.formatting = "link";
|
|
return getType(state);
|
|
}
|
|
|
|
if (ch === ']' && state.linkText) {
|
|
if (modeCfg.highlightFormatting) state.formatting = "link";
|
|
var type = getType(state);
|
|
state.linkText = false;
|
|
state.inline = state.f = stream.match(/\(.*?\)| ?\[.*?\]/, false) ? linkHref : inlineNormal
|
|
return type;
|
|
}
|
|
|
|
if (ch === '<' && stream.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/, false)) {
|
|
state.f = state.inline = linkInline;
|
|
if (modeCfg.highlightFormatting) state.formatting = "link";
|
|
var type = getType(state);
|
|
if (type){
|
|
type += " ";
|
|
} else {
|
|
type = "";
|
|
}
|
|
return type + tokenTypes.linkInline;
|
|
}
|
|
|
|
if (ch === '<' && stream.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/, false)) {
|
|
state.f = state.inline = linkInline;
|
|
if (modeCfg.highlightFormatting) state.formatting = "link";
|
|
var type = getType(state);
|
|
if (type){
|
|
type += " ";
|
|
} else {
|
|
type = "";
|
|
}
|
|
return type + tokenTypes.linkEmail;
|
|
}
|
|
|
|
if (modeCfg.xml && ch === '<' && stream.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i, false)) {
|
|
var end = stream.string.indexOf(">", stream.pos);
|
|
if (end != -1) {
|
|
var atts = stream.string.substring(stream.start, end);
|
|
if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts)) state.md_inside = true;
|
|
}
|
|
stream.backUp(1);
|
|
state.htmlState = CodeMirror.startState(htmlMode);
|
|
return switchBlock(stream, state, htmlBlock);
|
|
}
|
|
|
|
if (modeCfg.xml && ch === '<' && stream.match(/^\/\w*?>/)) {
|
|
state.md_inside = false;
|
|
return "tag";
|
|
} else if (ch === "*" || ch === "_") {
|
|
var len = 1, before = stream.pos == 1 ? " " : stream.string.charAt(stream.pos - 2)
|
|
while (len < 3 && stream.eat(ch)) len++
|
|
var after = stream.peek() || " "
|
|
// See http://spec.commonmark.org/0.27/#emphasis-and-strong-emphasis
|
|
var leftFlanking = !/\s/.test(after) && (!punctuation.test(after) || /\s/.test(before) || punctuation.test(before))
|
|
var rightFlanking = !/\s/.test(before) && (!punctuation.test(before) || /\s/.test(after) || punctuation.test(after))
|
|
var setEm = null, setStrong = null
|
|
if (len % 2) { // Em
|
|
if (!state.em && leftFlanking && (ch === "*" || !rightFlanking || punctuation.test(before)))
|
|
setEm = true
|
|
else if (state.em == ch && rightFlanking && (ch === "*" || !leftFlanking || punctuation.test(after)))
|
|
setEm = false
|
|
}
|
|
if (len > 1) { // Strong
|
|
if (!state.strong && leftFlanking && (ch === "*" || !rightFlanking || punctuation.test(before)))
|
|
setStrong = true
|
|
else if (state.strong == ch && rightFlanking && (ch === "*" || !leftFlanking || punctuation.test(after)))
|
|
setStrong = false
|
|
}
|
|
if (setStrong != null || setEm != null) {
|
|
if (modeCfg.highlightFormatting) state.formatting = setEm == null ? "strong" : setStrong == null ? "em" : "strong em"
|
|
if (setEm === true) state.em = ch
|
|
if (setStrong === true) state.strong = ch
|
|
var t = getType(state)
|
|
if (setEm === false) state.em = false
|
|
if (setStrong === false) state.strong = false
|
|
return t
|
|
}
|
|
} else if (ch === ' ') {
|
|
if (stream.eat('*') || stream.eat('_')) { // Probably surrounded by spaces
|
|
if (stream.peek() === ' ') { // Surrounded by spaces, ignore
|
|
return getType(state);
|
|
} else { // Not surrounded by spaces, back up pointer
|
|
stream.backUp(1);
|
|
}
|
|
}
|
|
}
|
|
|
|
if (modeCfg.strikethrough) {
|
|
if (ch === '~' && stream.eatWhile(ch)) {
|
|
if (state.strikethrough) {// Remove strikethrough
|
|
if (modeCfg.highlightFormatting) state.formatting = "strikethrough";
|
|
var t = getType(state);
|
|
state.strikethrough = false;
|
|
return t;
|
|
} else if (stream.match(/^[^\s]/, false)) {// Add strikethrough
|
|
state.strikethrough = true;
|
|
if (modeCfg.highlightFormatting) state.formatting = "strikethrough";
|
|
return getType(state);
|
|
}
|
|
} else if (ch === ' ') {
|
|
if (stream.match(/^~~/, true)) { // Probably surrounded by space
|
|
if (stream.peek() === ' ') { // Surrounded by spaces, ignore
|
|
return getType(state);
|
|
} else { // Not surrounded by spaces, back up pointer
|
|
stream.backUp(2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (modeCfg.emoji && ch === ":" && stream.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)) {
|
|
state.emoji = true;
|
|
if (modeCfg.highlightFormatting) state.formatting = "emoji";
|
|
var retType = getType(state);
|
|
state.emoji = false;
|
|
return retType;
|
|
}
|
|
|
|
if (ch === ' ') {
|
|
if (stream.match(/^ +$/, false)) {
|
|
state.trailingSpace++;
|
|
} else if (state.trailingSpace) {
|
|
state.trailingSpaceNewLine = true;
|
|
}
|
|
}
|
|
|
|
return getType(state);
|
|
}
|
|
|
|
function linkInline(stream, state) {
|
|
var ch = stream.next();
|
|
|
|
if (ch === ">") {
|
|
state.f = state.inline = inlineNormal;
|
|
if (modeCfg.highlightFormatting) state.formatting = "link";
|
|
var type = getType(state);
|
|
if (type){
|
|
type += " ";
|
|
} else {
|
|
type = "";
|
|
}
|
|
return type + tokenTypes.linkInline;
|
|
}
|
|
|
|
stream.match(/^[^>]+/, true);
|
|
|
|
return tokenTypes.linkInline;
|
|
}
|
|
|
|
function linkHref(stream, state) {
|
|
// Check if space, and return NULL if so (to avoid marking the space)
|
|
if(stream.eatSpace()){
|
|
return null;
|
|
}
|
|
var ch = stream.next();
|
|
if (ch === '(' || ch === '[') {
|
|
state.f = state.inline = getLinkHrefInside(ch === "(" ? ")" : "]");
|
|
if (modeCfg.highlightFormatting) state.formatting = "link-string";
|
|
state.linkHref = true;
|
|
return getType(state);
|
|
}
|
|
return 'error';
|
|
}
|
|
|
|
var linkRE = {
|
|
")": /^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,
|
|
"]": /^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/
|
|
}
|
|
|
|
function getLinkHrefInside(endChar) {
|
|
return function(stream, state) {
|
|
var ch = stream.next();
|
|
|
|
if (ch === endChar) {
|
|
state.f = state.inline = inlineNormal;
|
|
if (modeCfg.highlightFormatting) state.formatting = "link-string";
|
|
var returnState = getType(state);
|
|
state.linkHref = false;
|
|
return returnState;
|
|
}
|
|
|
|
stream.match(linkRE[endChar])
|
|
state.linkHref = true;
|
|
return getType(state);
|
|
};
|
|
}
|
|
|
|
function footnoteLink(stream, state) {
|
|
if (stream.match(/^([^\]\\]|\\.)*\]:/, false)) {
|
|
state.f = footnoteLinkInside;
|
|
stream.next(); // Consume [
|
|
if (modeCfg.highlightFormatting) state.formatting = "link";
|
|
state.linkText = true;
|
|
return getType(state);
|
|
}
|
|
return switchInline(stream, state, inlineNormal);
|
|
}
|
|
|
|
function footnoteLinkInside(stream, state) {
|
|
if (stream.match(/^\]:/, true)) {
|
|
state.f = state.inline = footnoteUrl;
|
|
if (modeCfg.highlightFormatting) state.formatting = "link";
|
|
var returnType = getType(state);
|
|
state.linkText = false;
|
|
return returnType;
|
|
}
|
|
|
|
stream.match(/^([^\]\\]|\\.)+/, true);
|
|
|
|
return tokenTypes.linkText;
|
|
}
|
|
|
|
function footnoteUrl(stream, state) {
|
|
// Check if space, and return NULL if so (to avoid marking the space)
|
|
if(stream.eatSpace()){
|
|
return null;
|
|
}
|
|
// Match URL
|
|
stream.match(/^[^\s]+/, true);
|
|
// Check for link title
|
|
if (stream.peek() === undefined) { // End of line, set flag to check next line
|
|
state.linkTitle = true;
|
|
} else { // More content on line, check if link title
|
|
stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true);
|
|
}
|
|
state.f = state.inline = inlineNormal;
|
|
return tokenTypes.linkHref + " url";
|
|
}
|
|
|
|
var mode = {
|
|
startState: function() {
|
|
return {
|
|
f: blockNormal,
|
|
|
|
prevLine: {stream: null},
|
|
thisLine: {stream: null},
|
|
|
|
block: blockNormal,
|
|
htmlState: null,
|
|
indentation: 0,
|
|
|
|
inline: inlineNormal,
|
|
text: handleText,
|
|
|
|
formatting: false,
|
|
linkText: false,
|
|
linkHref: false,
|
|
linkTitle: false,
|
|
code: 0,
|
|
em: false,
|
|
strong: false,
|
|
header: 0,
|
|
setext: 0,
|
|
hr: false,
|
|
taskList: false,
|
|
list: false,
|
|
listStack: [],
|
|
quote: 0,
|
|
trailingSpace: 0,
|
|
trailingSpaceNewLine: false,
|
|
strikethrough: false,
|
|
emoji: false,
|
|
fencedEndRE: null
|
|
};
|
|
},
|
|
|
|
copyState: function(s) {
|
|
return {
|
|
f: s.f,
|
|
|
|
prevLine: s.prevLine,
|
|
thisLine: s.thisLine,
|
|
|
|
block: s.block,
|
|
htmlState: s.htmlState && CodeMirror.copyState(htmlMode, s.htmlState),
|
|
indentation: s.indentation,
|
|
|
|
localMode: s.localMode,
|
|
localState: s.localMode ? CodeMirror.copyState(s.localMode, s.localState) : null,
|
|
|
|
inline: s.inline,
|
|
text: s.text,
|
|
formatting: false,
|
|
linkText: s.linkText,
|
|
linkTitle: s.linkTitle,
|
|
linkHref: s.linkHref,
|
|
code: s.code,
|
|
em: s.em,
|
|
strong: s.strong,
|
|
strikethrough: s.strikethrough,
|
|
emoji: s.emoji,
|
|
header: s.header,
|
|
setext: s.setext,
|
|
hr: s.hr,
|
|
taskList: s.taskList,
|
|
list: s.list,
|
|
listStack: s.listStack.slice(0),
|
|
quote: s.quote,
|
|
indentedCode: s.indentedCode,
|
|
trailingSpace: s.trailingSpace,
|
|
trailingSpaceNewLine: s.trailingSpaceNewLine,
|
|
md_inside: s.md_inside,
|
|
fencedEndRE: s.fencedEndRE
|
|
};
|
|
},
|
|
|
|
token: function(stream, state) {
|
|
|
|
// Reset state.formatting
|
|
state.formatting = false;
|
|
|
|
if (stream != state.thisLine.stream) {
|
|
state.header = 0;
|
|
state.hr = false;
|
|
|
|
if (stream.match(/^\s*$/, true)) {
|
|
blankLine(state);
|
|
return null;
|
|
}
|
|
|
|
state.prevLine = state.thisLine
|
|
state.thisLine = {stream: stream}
|
|
|
|
// Reset state.taskList
|
|
state.taskList = false;
|
|
|
|
// Reset state.trailingSpace
|
|
state.trailingSpace = 0;
|
|
state.trailingSpaceNewLine = false;
|
|
|
|
if (!state.localState) {
|
|
state.f = state.block;
|
|
if (state.f != htmlBlock) {
|
|
var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, expandedTab).length;
|
|
state.indentation = indentation;
|
|
state.indentationDiff = null;
|
|
if (indentation > 0) return null;
|
|
}
|
|
}
|
|
}
|
|
return state.f(stream, state);
|
|
},
|
|
|
|
innerMode: function(state) {
|
|
if (state.block == htmlBlock) return {state: state.htmlState, mode: htmlMode};
|
|
if (state.localState) return {state: state.localState, mode: state.localMode};
|
|
return {state: state, mode: mode};
|
|
},
|
|
|
|
indent: function(state, textAfter, line) {
|
|
if (state.block == htmlBlock && htmlMode.indent) return htmlMode.indent(state.htmlState, textAfter, line)
|
|
if (state.localState && state.localMode.indent) return state.localMode.indent(state.localState, textAfter, line)
|
|
return CodeMirror.Pass
|
|
},
|
|
|
|
blankLine: blankLine,
|
|
|
|
getType: getType,
|
|
|
|
blockCommentStart: "<!--",
|
|
blockCommentEnd: "-->",
|
|
closeBrackets: "()[]{}''\"\"``",
|
|
fold: "markdown"
|
|
};
|
|
return mode;
|
|
}, "xml");
|
|
|
|
CodeMirror.defineMIME("text/markdown", "markdown");
|
|
|
|
CodeMirror.defineMIME("text/x-markdown", "markdown");
|
|
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 98101:
|
|
/*!*****************************************************************!*\
|
|
!*** ./node_modules/_codemirror@5.58.2@codemirror/mode/meta.js ***!
|
|
\*****************************************************************/
|
|
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
|
|
|
(function(mod) {
|
|
if (true) // CommonJS
|
|
mod(__webpack_require__(/*! ../lib/codemirror */ 89780));
|
|
else {}
|
|
})(function(CodeMirror) {
|
|
"use strict";
|
|
|
|
CodeMirror.modeInfo = [
|
|
{name: "APL", mime: "text/apl", mode: "apl", ext: ["dyalog", "apl"]},
|
|
{name: "PGP", mimes: ["application/pgp", "application/pgp-encrypted", "application/pgp-keys", "application/pgp-signature"], mode: "asciiarmor", ext: ["asc", "pgp", "sig"]},
|
|
{name: "ASN.1", mime: "text/x-ttcn-asn", mode: "asn.1", ext: ["asn", "asn1"]},
|
|
{name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk", file: /^extensions\.conf$/i},
|
|
{name: "Brainfuck", mime: "text/x-brainfuck", mode: "brainfuck", ext: ["b", "bf"]},
|
|
{name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h", "ino"]},
|
|
{name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]},
|
|
{name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy"]},
|
|
{name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp", "cs"]},
|
|
{name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj", "cljc", "cljx"]},
|
|
{name: "ClojureScript", mime: "text/x-clojurescript", mode: "clojure", ext: ["cljs"]},
|
|
{name: "Closure Stylesheets (GSS)", mime: "text/x-gss", mode: "css", ext: ["gss"]},
|
|
{name: "CMake", mime: "text/x-cmake", mode: "cmake", ext: ["cmake", "cmake.in"], file: /^CMakeLists\.txt$/},
|
|
{name: "CoffeeScript", mimes: ["application/vnd.coffeescript", "text/coffeescript", "text/x-coffeescript"], mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"]},
|
|
{name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"]},
|
|
{name: "Cypher", mime: "application/x-cypher-query", mode: "cypher", ext: ["cyp", "cypher"]},
|
|
{name: "Cython", mime: "text/x-cython", mode: "python", ext: ["pyx", "pxd", "pxi"]},
|
|
{name: "Crystal", mime: "text/x-crystal", mode: "crystal", ext: ["cr"]},
|
|
{name: "CSS", mime: "text/css", mode: "css", ext: ["css"]},
|
|
{name: "CQL", mime: "text/x-cassandra", mode: "sql", ext: ["cql"]},
|
|
{name: "D", mime: "text/x-d", mode: "d", ext: ["d"]},
|
|
{name: "Dart", mimes: ["application/dart", "text/x-dart"], mode: "dart", ext: ["dart"]},
|
|
{name: "diff", mime: "text/x-diff", mode: "diff", ext: ["diff", "patch"]},
|
|
{name: "Django", mime: "text/x-django", mode: "django"},
|
|
{name: "Dockerfile", mime: "text/x-dockerfile", mode: "dockerfile", file: /^Dockerfile$/},
|
|
{name: "DTD", mime: "application/xml-dtd", mode: "dtd", ext: ["dtd"]},
|
|
{name: "Dylan", mime: "text/x-dylan", mode: "dylan", ext: ["dylan", "dyl", "intr"]},
|
|
{name: "EBNF", mime: "text/x-ebnf", mode: "ebnf"},
|
|
{name: "ECL", mime: "text/x-ecl", mode: "ecl", ext: ["ecl"]},
|
|
{name: "edn", mime: "application/edn", mode: "clojure", ext: ["edn"]},
|
|
{name: "Eiffel", mime: "text/x-eiffel", mode: "eiffel", ext: ["e"]},
|
|
{name: "Elm", mime: "text/x-elm", mode: "elm", ext: ["elm"]},
|
|
{name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]},
|
|
{name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"]},
|
|
{name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]},
|
|
{name: "Esper", mime: "text/x-esper", mode: "sql"},
|
|
{name: "Factor", mime: "text/x-factor", mode: "factor", ext: ["factor"]},
|
|
{name: "FCL", mime: "text/x-fcl", mode: "fcl"},
|
|
{name: "Forth", mime: "text/x-forth", mode: "forth", ext: ["forth", "fth", "4th"]},
|
|
{name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90", "f95"]},
|
|
{name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"], alias: ["fsharp"]},
|
|
{name: "Gas", mime: "text/x-gas", mode: "gas", ext: ["s"]},
|
|
{name: "Gherkin", mime: "text/x-feature", mode: "gherkin", ext: ["feature"]},
|
|
{name: "GitHub Flavored Markdown", mime: "text/x-gfm", mode: "gfm", file: /^(readme|contributing|history)\.md$/i},
|
|
{name: "Go", mime: "text/x-go", mode: "go", ext: ["go"]},
|
|
{name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy", "gradle"], file: /^Jenkinsfile$/},
|
|
{name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"]},
|
|
{name: "Haskell", mime: "text/x-haskell", mode: "haskell", ext: ["hs"]},
|
|
{name: "Haskell (Literate)", mime: "text/x-literate-haskell", mode: "haskell-literate", ext: ["lhs"]},
|
|
{name: "Haxe", mime: "text/x-haxe", mode: "haxe", ext: ["hx"]},
|
|
{name: "HXML", mime: "text/x-hxml", mode: "haxe", ext: ["hxml"]},
|
|
{name: "ASP.NET", mime: "application/x-aspx", mode: "htmlembedded", ext: ["aspx"], alias: ["asp", "aspx"]},
|
|
{name: "HTML", mime: "text/html", mode: "htmlmixed", ext: ["html", "htm", "handlebars", "hbs"], alias: ["xhtml"]},
|
|
{name: "HTTP", mime: "message/http", mode: "http"},
|
|
{name: "IDL", mime: "text/x-idl", mode: "idl", ext: ["pro"]},
|
|
{name: "Pug", mime: "text/x-pug", mode: "pug", ext: ["jade", "pug"], alias: ["jade"]},
|
|
{name: "Java", mime: "text/x-java", mode: "clike", ext: ["java"]},
|
|
{name: "Java Server Pages", mime: "application/x-jsp", mode: "htmlembedded", ext: ["jsp"], alias: ["jsp"]},
|
|
{name: "JavaScript", mimes: ["text/javascript", "text/ecmascript", "application/javascript", "application/x-javascript", "application/ecmascript"],
|
|
mode: "javascript", ext: ["js"], alias: ["ecmascript", "js", "node"]},
|
|
{name: "JSON", mimes: ["application/json", "application/x-json"], mode: "javascript", ext: ["json", "map"], alias: ["json5"]},
|
|
{name: "JSON-LD", mime: "application/ld+json", mode: "javascript", ext: ["jsonld"], alias: ["jsonld"]},
|
|
{name: "JSX", mime: "text/jsx", mode: "jsx", ext: ["jsx"]},
|
|
{name: "Jinja2", mime: "text/jinja2", mode: "jinja2", ext: ["j2", "jinja", "jinja2"]},
|
|
{name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"]},
|
|
{name: "Kotlin", mime: "text/x-kotlin", mode: "clike", ext: ["kt"]},
|
|
{name: "LESS", mime: "text/x-less", mode: "css", ext: ["less"]},
|
|
{name: "LiveScript", mime: "text/x-livescript", mode: "livescript", ext: ["ls"], alias: ["ls"]},
|
|
{name: "Lua", mime: "text/x-lua", mode: "lua", ext: ["lua"]},
|
|
{name: "Markdown", mime: "text/x-markdown", mode: "markdown", ext: ["markdown", "md", "mkd"]},
|
|
{name: "mIRC", mime: "text/mirc", mode: "mirc"},
|
|
{name: "MariaDB SQL", mime: "text/x-mariadb", mode: "sql"},
|
|
{name: "Mathematica", mime: "text/x-mathematica", mode: "mathematica", ext: ["m", "nb", "wl", "wls"]},
|
|
{name: "Modelica", mime: "text/x-modelica", mode: "modelica", ext: ["mo"]},
|
|
{name: "MUMPS", mime: "text/x-mumps", mode: "mumps", ext: ["mps"]},
|
|
{name: "MS SQL", mime: "text/x-mssql", mode: "sql"},
|
|
{name: "mbox", mime: "application/mbox", mode: "mbox", ext: ["mbox"]},
|
|
{name: "MySQL", mime: "text/x-mysql", mode: "sql"},
|
|
{name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i},
|
|
{name: "NSIS", mime: "text/x-nsis", mode: "nsis", ext: ["nsh", "nsi"]},
|
|
{name: "NTriples", mimes: ["application/n-triples", "application/n-quads", "text/n-triples"],
|
|
mode: "ntriples", ext: ["nt", "nq"]},
|
|
{name: "Objective-C", mime: "text/x-objectivec", mode: "clike", ext: ["m"], alias: ["objective-c", "objc"]},
|
|
{name: "Objective-C++", mime: "text/x-objectivec++", mode: "clike", ext: ["mm"], alias: ["objective-c++", "objc++"]},
|
|
{name: "OCaml", mime: "text/x-ocaml", mode: "mllike", ext: ["ml", "mli", "mll", "mly"]},
|
|
{name: "Octave", mime: "text/x-octave", mode: "octave", ext: ["m"]},
|
|
{name: "Oz", mime: "text/x-oz", mode: "oz", ext: ["oz"]},
|
|
{name: "Pascal", mime: "text/x-pascal", mode: "pascal", ext: ["p", "pas"]},
|
|
{name: "PEG.js", mime: "null", mode: "pegjs", ext: ["jsonld"]},
|
|
{name: "Perl", mime: "text/x-perl", mode: "perl", ext: ["pl", "pm"]},
|
|
{name: "PHP", mimes: ["text/x-php", "application/x-httpd-php", "application/x-httpd-php-open"], mode: "php", ext: ["php", "php3", "php4", "php5", "php7", "phtml"]},
|
|
{name: "Pig", mime: "text/x-pig", mode: "pig", ext: ["pig"]},
|
|
{name: "Plain Text", mime: "text/plain", mode: "null", ext: ["txt", "text", "conf", "def", "list", "log"]},
|
|
{name: "PLSQL", mime: "text/x-plsql", mode: "sql", ext: ["pls"]},
|
|
{name: "PostgreSQL", mime: "text/x-pgsql", mode: "sql"},
|
|
{name: "PowerShell", mime: "application/x-powershell", mode: "powershell", ext: ["ps1", "psd1", "psm1"]},
|
|
{name: "Properties files", mime: "text/x-properties", mode: "properties", ext: ["properties", "ini", "in"], alias: ["ini", "properties"]},
|
|
{name: "ProtoBuf", mime: "text/x-protobuf", mode: "protobuf", ext: ["proto"]},
|
|
{name: "Python", mime: "text/x-python", mode: "python", ext: ["BUILD", "bzl", "py", "pyw"], file: /^(BUCK|BUILD)$/},
|
|
{name: "Puppet", mime: "text/x-puppet", mode: "puppet", ext: ["pp"]},
|
|
{name: "Q", mime: "text/x-q", mode: "q", ext: ["q"]},
|
|
{name: "R", mime: "text/x-rsrc", mode: "r", ext: ["r", "R"], alias: ["rscript"]},
|
|
{name: "reStructuredText", mime: "text/x-rst", mode: "rst", ext: ["rst"], alias: ["rst"]},
|
|
{name: "RPM Changes", mime: "text/x-rpm-changes", mode: "rpm"},
|
|
{name: "RPM Spec", mime: "text/x-rpm-spec", mode: "rpm", ext: ["spec"]},
|
|
{name: "Ruby", mime: "text/x-ruby", mode: "ruby", ext: ["rb"], alias: ["jruby", "macruby", "rake", "rb", "rbx"]},
|
|
{name: "Rust", mime: "text/x-rustsrc", mode: "rust", ext: ["rs"]},
|
|
{name: "SAS", mime: "text/x-sas", mode: "sas", ext: ["sas"]},
|
|
{name: "Sass", mime: "text/x-sass", mode: "sass", ext: ["sass"]},
|
|
{name: "Scala", mime: "text/x-scala", mode: "clike", ext: ["scala"]},
|
|
{name: "Scheme", mime: "text/x-scheme", mode: "scheme", ext: ["scm", "ss"]},
|
|
{name: "SCSS", mime: "text/x-scss", mode: "css", ext: ["scss"]},
|
|
{name: "Shell", mimes: ["text/x-sh", "application/x-sh"], mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"], file: /^PKGBUILD$/},
|
|
{name: "Sieve", mime: "application/sieve", mode: "sieve", ext: ["siv", "sieve"]},
|
|
{name: "Slim", mimes: ["text/x-slim", "application/x-slim"], mode: "slim", ext: ["slim"]},
|
|
{name: "Smalltalk", mime: "text/x-stsrc", mode: "smalltalk", ext: ["st"]},
|
|
{name: "Smarty", mime: "text/x-smarty", mode: "smarty", ext: ["tpl"]},
|
|
{name: "Solr", mime: "text/x-solr", mode: "solr"},
|
|
{name: "SML", mime: "text/x-sml", mode: "mllike", ext: ["sml", "sig", "fun", "smackspec"]},
|
|
{name: "Soy", mime: "text/x-soy", mode: "soy", ext: ["soy"], alias: ["closure template"]},
|
|
{name: "SPARQL", mime: "application/sparql-query", mode: "sparql", ext: ["rq", "sparql"], alias: ["sparul"]},
|
|
{name: "Spreadsheet", mime: "text/x-spreadsheet", mode: "spreadsheet", alias: ["excel", "formula"]},
|
|
{name: "SQL", mime: "text/x-sql", mode: "sql", ext: ["sql"]},
|
|
{name: "SQLite", mime: "text/x-sqlite", mode: "sql"},
|
|
{name: "Squirrel", mime: "text/x-squirrel", mode: "clike", ext: ["nut"]},
|
|
{name: "Stylus", mime: "text/x-styl", mode: "stylus", ext: ["styl"]},
|
|
{name: "Swift", mime: "text/x-swift", mode: "swift", ext: ["swift"]},
|
|
{name: "sTeX", mime: "text/x-stex", mode: "stex"},
|
|
{name: "LaTeX", mime: "text/x-latex", mode: "stex", ext: ["text", "ltx", "tex"], alias: ["tex"]},
|
|
{name: "SystemVerilog", mime: "text/x-systemverilog", mode: "verilog", ext: ["v", "sv", "svh"]},
|
|
{name: "Tcl", mime: "text/x-tcl", mode: "tcl", ext: ["tcl"]},
|
|
{name: "Textile", mime: "text/x-textile", mode: "textile", ext: ["textile"]},
|
|
{name: "TiddlyWiki", mime: "text/x-tiddlywiki", mode: "tiddlywiki"},
|
|
{name: "Tiki wiki", mime: "text/tiki", mode: "tiki"},
|
|
{name: "TOML", mime: "text/x-toml", mode: "toml", ext: ["toml"]},
|
|
{name: "Tornado", mime: "text/x-tornado", mode: "tornado"},
|
|
{name: "troff", mime: "text/troff", mode: "troff", ext: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]},
|
|
{name: "TTCN", mime: "text/x-ttcn", mode: "ttcn", ext: ["ttcn", "ttcn3", "ttcnpp"]},
|
|
{name: "TTCN_CFG", mime: "text/x-ttcn-cfg", mode: "ttcn-cfg", ext: ["cfg"]},
|
|
{name: "Turtle", mime: "text/turtle", mode: "turtle", ext: ["ttl"]},
|
|
{name: "TypeScript", mime: "application/typescript", mode: "javascript", ext: ["ts"], alias: ["ts"]},
|
|
{name: "TypeScript-JSX", mime: "text/typescript-jsx", mode: "jsx", ext: ["tsx"], alias: ["tsx"]},
|
|
{name: "Twig", mime: "text/x-twig", mode: "twig"},
|
|
{name: "Web IDL", mime: "text/x-webidl", mode: "webidl", ext: ["webidl"]},
|
|
{name: "VB.NET", mime: "text/x-vb", mode: "vb", ext: ["vb"]},
|
|
{name: "VBScript", mime: "text/vbscript", mode: "vbscript", ext: ["vbs"]},
|
|
{name: "Velocity", mime: "text/velocity", mode: "velocity", ext: ["vtl"]},
|
|
{name: "Verilog", mime: "text/x-verilog", mode: "verilog", ext: ["v"]},
|
|
{name: "VHDL", mime: "text/x-vhdl", mode: "vhdl", ext: ["vhd", "vhdl"]},
|
|
{name: "Vue.js Component", mimes: ["script/x-vue", "text/x-vue"], mode: "vue", ext: ["vue"]},
|
|
{name: "XML", mimes: ["application/xml", "text/xml"], mode: "xml", ext: ["xml", "xsl", "xsd", "svg"], alias: ["rss", "wsdl", "xsd"]},
|
|
{name: "XQuery", mime: "application/xquery", mode: "xquery", ext: ["xy", "xquery"]},
|
|
{name: "Yacas", mime: "text/x-yacas", mode: "yacas", ext: ["ys"]},
|
|
{name: "YAML", mimes: ["text/x-yaml", "text/yaml"], mode: "yaml", ext: ["yaml", "yml"], alias: ["yml"]},
|
|
{name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]},
|
|
{name: "mscgen", mime: "text/x-mscgen", mode: "mscgen", ext: ["mscgen", "mscin", "msc"]},
|
|
{name: "xu", mime: "text/x-xu", mode: "mscgen", ext: ["xu"]},
|
|
{name: "msgenny", mime: "text/x-msgenny", mode: "mscgen", ext: ["msgenny"]},
|
|
{name: "WebAssembly", mime: "text/webassembly", mode: "wast", ext: ["wat", "wast"]},
|
|
];
|
|
// Ensure all modes have a mime property for backwards compatibility
|
|
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
|
|
var info = CodeMirror.modeInfo[i];
|
|
if (info.mimes) info.mime = info.mimes[0];
|
|
}
|
|
|
|
CodeMirror.findModeByMIME = function(mime) {
|
|
mime = mime.toLowerCase();
|
|
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
|
|
var info = CodeMirror.modeInfo[i];
|
|
if (info.mime == mime) return info;
|
|
if (info.mimes) for (var j = 0; j < info.mimes.length; j++)
|
|
if (info.mimes[j] == mime) return info;
|
|
}
|
|
if (/\+xml$/.test(mime)) return CodeMirror.findModeByMIME("application/xml")
|
|
if (/\+json$/.test(mime)) return CodeMirror.findModeByMIME("application/json")
|
|
};
|
|
|
|
CodeMirror.findModeByExtension = function(ext) {
|
|
ext = ext.toLowerCase();
|
|
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
|
|
var info = CodeMirror.modeInfo[i];
|
|
if (info.ext) for (var j = 0; j < info.ext.length; j++)
|
|
if (info.ext[j] == ext) return info;
|
|
}
|
|
};
|
|
|
|
CodeMirror.findModeByFileName = function(filename) {
|
|
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
|
|
var info = CodeMirror.modeInfo[i];
|
|
if (info.file && info.file.test(filename)) return info;
|
|
}
|
|
var dot = filename.lastIndexOf(".");
|
|
var ext = dot > -1 && filename.substring(dot + 1, filename.length);
|
|
if (ext) return CodeMirror.findModeByExtension(ext);
|
|
};
|
|
|
|
CodeMirror.findModeByName = function(name) {
|
|
name = name.toLowerCase();
|
|
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
|
|
var info = CodeMirror.modeInfo[i];
|
|
if (info.name.toLowerCase() == name) return info;
|
|
if (info.alias) for (var j = 0; j < info.alias.length; j++)
|
|
if (info.alias[j].toLowerCase() == name) return info;
|
|
}
|
|
};
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 67549:
|
|
/*!**********************************************************************!*\
|
|
!*** ./node_modules/_codemirror@5.58.2@codemirror/mode/stex/stex.js ***!
|
|
\**********************************************************************/
|
|
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
|
|
|
/*
|
|
* Author: Constantin Jucovschi (c.jucovschi@jacobs-university.de)
|
|
* Licence: MIT
|
|
*/
|
|
|
|
(function(mod) {
|
|
if (true) // CommonJS
|
|
mod(__webpack_require__(/*! ../../lib/codemirror */ 89780));
|
|
else {}
|
|
})(function(CodeMirror) {
|
|
"use strict";
|
|
|
|
CodeMirror.defineMode("stex", function(_config, parserConfig) {
|
|
"use strict";
|
|
|
|
function pushCommand(state, command) {
|
|
state.cmdState.push(command);
|
|
}
|
|
|
|
function peekCommand(state) {
|
|
if (state.cmdState.length > 0) {
|
|
return state.cmdState[state.cmdState.length - 1];
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
function popCommand(state) {
|
|
var plug = state.cmdState.pop();
|
|
if (plug) {
|
|
plug.closeBracket();
|
|
}
|
|
}
|
|
|
|
// returns the non-default plugin closest to the end of the list
|
|
function getMostPowerful(state) {
|
|
var context = state.cmdState;
|
|
for (var i = context.length - 1; i >= 0; i--) {
|
|
var plug = context[i];
|
|
if (plug.name == "DEFAULT") {
|
|
continue;
|
|
}
|
|
return plug;
|
|
}
|
|
return { styleIdentifier: function() { return null; } };
|
|
}
|
|
|
|
function addPluginPattern(pluginName, cmdStyle, styles) {
|
|
return function () {
|
|
this.name = pluginName;
|
|
this.bracketNo = 0;
|
|
this.style = cmdStyle;
|
|
this.styles = styles;
|
|
this.argument = null; // \begin and \end have arguments that follow. These are stored in the plugin
|
|
|
|
this.styleIdentifier = function() {
|
|
return this.styles[this.bracketNo - 1] || null;
|
|
};
|
|
this.openBracket = function() {
|
|
this.bracketNo++;
|
|
return "bracket";
|
|
};
|
|
this.closeBracket = function() {};
|
|
};
|
|
}
|
|
|
|
var plugins = {};
|
|
|
|
plugins["importmodule"] = addPluginPattern("importmodule", "tag", ["string", "builtin"]);
|
|
plugins["documentclass"] = addPluginPattern("documentclass", "tag", ["", "atom"]);
|
|
plugins["usepackage"] = addPluginPattern("usepackage", "tag", ["atom"]);
|
|
plugins["begin"] = addPluginPattern("begin", "tag", ["atom"]);
|
|
plugins["end"] = addPluginPattern("end", "tag", ["atom"]);
|
|
|
|
plugins["label" ] = addPluginPattern("label" , "tag", ["atom"]);
|
|
plugins["ref" ] = addPluginPattern("ref" , "tag", ["atom"]);
|
|
plugins["eqref" ] = addPluginPattern("eqref" , "tag", ["atom"]);
|
|
plugins["cite" ] = addPluginPattern("cite" , "tag", ["atom"]);
|
|
plugins["bibitem" ] = addPluginPattern("bibitem" , "tag", ["atom"]);
|
|
plugins["Bibitem" ] = addPluginPattern("Bibitem" , "tag", ["atom"]);
|
|
plugins["RBibitem" ] = addPluginPattern("RBibitem" , "tag", ["atom"]);
|
|
|
|
plugins["DEFAULT"] = function () {
|
|
this.name = "DEFAULT";
|
|
this.style = "tag";
|
|
|
|
this.styleIdentifier = this.openBracket = this.closeBracket = function() {};
|
|
};
|
|
|
|
function setState(state, f) {
|
|
state.f = f;
|
|
}
|
|
|
|
// called when in a normal (no environment) context
|
|
function normal(source, state) {
|
|
var plug;
|
|
// Do we look like '\command' ? If so, attempt to apply the plugin 'command'
|
|
if (source.match(/^\\[a-zA-Z@]+/)) {
|
|
var cmdName = source.current().slice(1);
|
|
plug = plugins.hasOwnProperty(cmdName) ? plugins[cmdName] : plugins["DEFAULT"];
|
|
plug = new plug();
|
|
pushCommand(state, plug);
|
|
setState(state, beginParams);
|
|
return plug.style;
|
|
}
|
|
|
|
// escape characters
|
|
if (source.match(/^\\[$&%#{}_]/)) {
|
|
return "tag";
|
|
}
|
|
|
|
// white space control characters
|
|
if (source.match(/^\\[,;!\/\\]/)) {
|
|
return "tag";
|
|
}
|
|
|
|
// find if we're starting various math modes
|
|
if (source.match("\\[")) {
|
|
setState(state, function(source, state){ return inMathMode(source, state, "\\]"); });
|
|
return "keyword";
|
|
}
|
|
if (source.match("\\(")) {
|
|
setState(state, function(source, state){ return inMathMode(source, state, "\\)"); });
|
|
return "keyword";
|
|
}
|
|
if (source.match("$$")) {
|
|
setState(state, function(source, state){ return inMathMode(source, state, "$$"); });
|
|
return "keyword";
|
|
}
|
|
if (source.match("$")) {
|
|
setState(state, function(source, state){ return inMathMode(source, state, "$"); });
|
|
return "keyword";
|
|
}
|
|
|
|
var ch = source.next();
|
|
if (ch == "%") {
|
|
source.skipToEnd();
|
|
return "comment";
|
|
} else if (ch == '}' || ch == ']') {
|
|
plug = peekCommand(state);
|
|
if (plug) {
|
|
plug.closeBracket(ch);
|
|
setState(state, beginParams);
|
|
} else {
|
|
return "error";
|
|
}
|
|
return "bracket";
|
|
} else if (ch == '{' || ch == '[') {
|
|
plug = plugins["DEFAULT"];
|
|
plug = new plug();
|
|
pushCommand(state, plug);
|
|
return "bracket";
|
|
} else if (/\d/.test(ch)) {
|
|
source.eatWhile(/[\w.%]/);
|
|
return "atom";
|
|
} else {
|
|
source.eatWhile(/[\w\-_]/);
|
|
plug = getMostPowerful(state);
|
|
if (plug.name == 'begin') {
|
|
plug.argument = source.current();
|
|
}
|
|
return plug.styleIdentifier();
|
|
}
|
|
}
|
|
|
|
function inMathMode(source, state, endModeSeq) {
|
|
if (source.eatSpace()) {
|
|
return null;
|
|
}
|
|
if (endModeSeq && source.match(endModeSeq)) {
|
|
setState(state, normal);
|
|
return "keyword";
|
|
}
|
|
if (source.match(/^\\[a-zA-Z@]+/)) {
|
|
return "tag";
|
|
}
|
|
if (source.match(/^[a-zA-Z]+/)) {
|
|
return "variable-2";
|
|
}
|
|
// escape characters
|
|
if (source.match(/^\\[$&%#{}_]/)) {
|
|
return "tag";
|
|
}
|
|
// white space control characters
|
|
if (source.match(/^\\[,;!\/]/)) {
|
|
return "tag";
|
|
}
|
|
// special math-mode characters
|
|
if (source.match(/^[\^_&]/)) {
|
|
return "tag";
|
|
}
|
|
// non-special characters
|
|
if (source.match(/^[+\-<>|=,\/@!*:;'"`~#?]/)) {
|
|
return null;
|
|
}
|
|
if (source.match(/^(\d+\.\d*|\d*\.\d+|\d+)/)) {
|
|
return "number";
|
|
}
|
|
var ch = source.next();
|
|
if (ch == "{" || ch == "}" || ch == "[" || ch == "]" || ch == "(" || ch == ")") {
|
|
return "bracket";
|
|
}
|
|
|
|
if (ch == "%") {
|
|
source.skipToEnd();
|
|
return "comment";
|
|
}
|
|
return "error";
|
|
}
|
|
|
|
function beginParams(source, state) {
|
|
var ch = source.peek(), lastPlug;
|
|
if (ch == '{' || ch == '[') {
|
|
lastPlug = peekCommand(state);
|
|
lastPlug.openBracket(ch);
|
|
source.eat(ch);
|
|
setState(state, normal);
|
|
return "bracket";
|
|
}
|
|
if (/[ \t\r]/.test(ch)) {
|
|
source.eat(ch);
|
|
return null;
|
|
}
|
|
setState(state, normal);
|
|
popCommand(state);
|
|
|
|
return normal(source, state);
|
|
}
|
|
|
|
return {
|
|
startState: function() {
|
|
var f = parserConfig.inMathMode ? function(source, state){ return inMathMode(source, state); } : normal;
|
|
return {
|
|
cmdState: [],
|
|
f: f
|
|
};
|
|
},
|
|
copyState: function(s) {
|
|
return {
|
|
cmdState: s.cmdState.slice(),
|
|
f: s.f
|
|
};
|
|
},
|
|
token: function(stream, state) {
|
|
return state.f(stream, state);
|
|
},
|
|
blankLine: function(state) {
|
|
state.f = normal;
|
|
state.cmdState.length = 0;
|
|
},
|
|
lineComment: "%"
|
|
};
|
|
});
|
|
|
|
CodeMirror.defineMIME("text/x-stex", "stex");
|
|
CodeMirror.defineMIME("text/x-latex", "stex");
|
|
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 15525:
|
|
/*!********************************************************************!*\
|
|
!*** ./node_modules/_codemirror@5.58.2@codemirror/mode/xml/xml.js ***!
|
|
\********************************************************************/
|
|
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
|
|
|
(function(mod) {
|
|
if (true) // CommonJS
|
|
mod(__webpack_require__(/*! ../../lib/codemirror */ 89780));
|
|
else {}
|
|
})(function(CodeMirror) {
|
|
"use strict";
|
|
|
|
var htmlConfig = {
|
|
autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
|
|
'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
|
|
'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
|
|
'track': true, 'wbr': true, 'menuitem': true},
|
|
implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
|
|
'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
|
|
'th': true, 'tr': true},
|
|
contextGrabbers: {
|
|
'dd': {'dd': true, 'dt': true},
|
|
'dt': {'dd': true, 'dt': true},
|
|
'li': {'li': true},
|
|
'option': {'option': true, 'optgroup': true},
|
|
'optgroup': {'optgroup': true},
|
|
'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
|
|
'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
|
|
'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
|
|
'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
|
|
'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
|
|
'rp': {'rp': true, 'rt': true},
|
|
'rt': {'rp': true, 'rt': true},
|
|
'tbody': {'tbody': true, 'tfoot': true},
|
|
'td': {'td': true, 'th': true},
|
|
'tfoot': {'tbody': true},
|
|
'th': {'td': true, 'th': true},
|
|
'thead': {'tbody': true, 'tfoot': true},
|
|
'tr': {'tr': true}
|
|
},
|
|
doNotIndent: {"pre": true},
|
|
allowUnquoted: true,
|
|
allowMissing: true,
|
|
caseFold: true
|
|
}
|
|
|
|
var xmlConfig = {
|
|
autoSelfClosers: {},
|
|
implicitlyClosed: {},
|
|
contextGrabbers: {},
|
|
doNotIndent: {},
|
|
allowUnquoted: false,
|
|
allowMissing: false,
|
|
allowMissingTagName: false,
|
|
caseFold: false
|
|
}
|
|
|
|
CodeMirror.defineMode("xml", function(editorConf, config_) {
|
|
var indentUnit = editorConf.indentUnit
|
|
var config = {}
|
|
var defaults = config_.htmlMode ? htmlConfig : xmlConfig
|
|
for (var prop in defaults) config[prop] = defaults[prop]
|
|
for (var prop in config_) config[prop] = config_[prop]
|
|
|
|
// Return variables for tokenizers
|
|
var type, setStyle;
|
|
|
|
function inText(stream, state) {
|
|
function chain(parser) {
|
|
state.tokenize = parser;
|
|
return parser(stream, state);
|
|
}
|
|
|
|
var ch = stream.next();
|
|
if (ch == "<") {
|
|
if (stream.eat("!")) {
|
|
if (stream.eat("[")) {
|
|
if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
|
|
else return null;
|
|
} else if (stream.match("--")) {
|
|
return chain(inBlock("comment", "-->"));
|
|
} else if (stream.match("DOCTYPE", true, true)) {
|
|
stream.eatWhile(/[\w\._\-]/);
|
|
return chain(doctype(1));
|
|
} else {
|
|
return null;
|
|
}
|
|
} else if (stream.eat("?")) {
|
|
stream.eatWhile(/[\w\._\-]/);
|
|
state.tokenize = inBlock("meta", "?>");
|
|
return "meta";
|
|
} else {
|
|
type = stream.eat("/") ? "closeTag" : "openTag";
|
|
state.tokenize = inTag;
|
|
return "tag bracket";
|
|
}
|
|
} else if (ch == "&") {
|
|
var ok;
|
|
if (stream.eat("#")) {
|
|
if (stream.eat("x")) {
|
|
ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");
|
|
} else {
|
|
ok = stream.eatWhile(/[\d]/) && stream.eat(";");
|
|
}
|
|
} else {
|
|
ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";");
|
|
}
|
|
return ok ? "atom" : "error";
|
|
} else {
|
|
stream.eatWhile(/[^&<]/);
|
|
return null;
|
|
}
|
|
}
|
|
inText.isInText = true;
|
|
|
|
function inTag(stream, state) {
|
|
var ch = stream.next();
|
|
if (ch == ">" || (ch == "/" && stream.eat(">"))) {
|
|
state.tokenize = inText;
|
|
type = ch == ">" ? "endTag" : "selfcloseTag";
|
|
return "tag bracket";
|
|
} else if (ch == "=") {
|
|
type = "equals";
|
|
return null;
|
|
} else if (ch == "<") {
|
|
state.tokenize = inText;
|
|
state.state = baseState;
|
|
state.tagName = state.tagStart = null;
|
|
var next = state.tokenize(stream, state);
|
|
return next ? next + " tag error" : "tag error";
|
|
} else if (/[\'\"]/.test(ch)) {
|
|
state.tokenize = inAttribute(ch);
|
|
state.stringStartCol = stream.column();
|
|
return state.tokenize(stream, state);
|
|
} else {
|
|
stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);
|
|
return "word";
|
|
}
|
|
}
|
|
|
|
function inAttribute(quote) {
|
|
var closure = function(stream, state) {
|
|
while (!stream.eol()) {
|
|
if (stream.next() == quote) {
|
|
state.tokenize = inTag;
|
|
break;
|
|
}
|
|
}
|
|
return "string";
|
|
};
|
|
closure.isInAttribute = true;
|
|
return closure;
|
|
}
|
|
|
|
function inBlock(style, terminator) {
|
|
return function(stream, state) {
|
|
while (!stream.eol()) {
|
|
if (stream.match(terminator)) {
|
|
state.tokenize = inText;
|
|
break;
|
|
}
|
|
stream.next();
|
|
}
|
|
return style;
|
|
}
|
|
}
|
|
|
|
function doctype(depth) {
|
|
return function(stream, state) {
|
|
var ch;
|
|
while ((ch = stream.next()) != null) {
|
|
if (ch == "<") {
|
|
state.tokenize = doctype(depth + 1);
|
|
return state.tokenize(stream, state);
|
|
} else if (ch == ">") {
|
|
if (depth == 1) {
|
|
state.tokenize = inText;
|
|
break;
|
|
} else {
|
|
state.tokenize = doctype(depth - 1);
|
|
return state.tokenize(stream, state);
|
|
}
|
|
}
|
|
}
|
|
return "meta";
|
|
};
|
|
}
|
|
|
|
function Context(state, tagName, startOfLine) {
|
|
this.prev = state.context;
|
|
this.tagName = tagName;
|
|
this.indent = state.indented;
|
|
this.startOfLine = startOfLine;
|
|
if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))
|
|
this.noIndent = true;
|
|
}
|
|
function popContext(state) {
|
|
if (state.context) state.context = state.context.prev;
|
|
}
|
|
function maybePopContext(state, nextTagName) {
|
|
var parentTagName;
|
|
while (true) {
|
|
if (!state.context) {
|
|
return;
|
|
}
|
|
parentTagName = state.context.tagName;
|
|
if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||
|
|
!config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
|
|
return;
|
|
}
|
|
popContext(state);
|
|
}
|
|
}
|
|
|
|
function baseState(type, stream, state) {
|
|
if (type == "openTag") {
|
|
state.tagStart = stream.column();
|
|
return tagNameState;
|
|
} else if (type == "closeTag") {
|
|
return closeTagNameState;
|
|
} else {
|
|
return baseState;
|
|
}
|
|
}
|
|
function tagNameState(type, stream, state) {
|
|
if (type == "word") {
|
|
state.tagName = stream.current();
|
|
setStyle = "tag";
|
|
return attrState;
|
|
} else if (config.allowMissingTagName && type == "endTag") {
|
|
setStyle = "tag bracket";
|
|
return attrState(type, stream, state);
|
|
} else {
|
|
setStyle = "error";
|
|
return tagNameState;
|
|
}
|
|
}
|
|
function closeTagNameState(type, stream, state) {
|
|
if (type == "word") {
|
|
var tagName = stream.current();
|
|
if (state.context && state.context.tagName != tagName &&
|
|
config.implicitlyClosed.hasOwnProperty(state.context.tagName))
|
|
popContext(state);
|
|
if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {
|
|
setStyle = "tag";
|
|
return closeState;
|
|
} else {
|
|
setStyle = "tag error";
|
|
return closeStateErr;
|
|
}
|
|
} else if (config.allowMissingTagName && type == "endTag") {
|
|
setStyle = "tag bracket";
|
|
return closeState(type, stream, state);
|
|
} else {
|
|
setStyle = "error";
|
|
return closeStateErr;
|
|
}
|
|
}
|
|
|
|
function closeState(type, _stream, state) {
|
|
if (type != "endTag") {
|
|
setStyle = "error";
|
|
return closeState;
|
|
}
|
|
popContext(state);
|
|
return baseState;
|
|
}
|
|
function closeStateErr(type, stream, state) {
|
|
setStyle = "error";
|
|
return closeState(type, stream, state);
|
|
}
|
|
|
|
function attrState(type, _stream, state) {
|
|
if (type == "word") {
|
|
setStyle = "attribute";
|
|
return attrEqState;
|
|
} else if (type == "endTag" || type == "selfcloseTag") {
|
|
var tagName = state.tagName, tagStart = state.tagStart;
|
|
state.tagName = state.tagStart = null;
|
|
if (type == "selfcloseTag" ||
|
|
config.autoSelfClosers.hasOwnProperty(tagName)) {
|
|
maybePopContext(state, tagName);
|
|
} else {
|
|
maybePopContext(state, tagName);
|
|
state.context = new Context(state, tagName, tagStart == state.indented);
|
|
}
|
|
return baseState;
|
|
}
|
|
setStyle = "error";
|
|
return attrState;
|
|
}
|
|
function attrEqState(type, stream, state) {
|
|
if (type == "equals") return attrValueState;
|
|
if (!config.allowMissing) setStyle = "error";
|
|
return attrState(type, stream, state);
|
|
}
|
|
function attrValueState(type, stream, state) {
|
|
if (type == "string") return attrContinuedState;
|
|
if (type == "word" && config.allowUnquoted) {setStyle = "string"; return attrState;}
|
|
setStyle = "error";
|
|
return attrState(type, stream, state);
|
|
}
|
|
function attrContinuedState(type, stream, state) {
|
|
if (type == "string") return attrContinuedState;
|
|
return attrState(type, stream, state);
|
|
}
|
|
|
|
return {
|
|
startState: function(baseIndent) {
|
|
var state = {tokenize: inText,
|
|
state: baseState,
|
|
indented: baseIndent || 0,
|
|
tagName: null, tagStart: null,
|
|
context: null}
|
|
if (baseIndent != null) state.baseIndent = baseIndent
|
|
return state
|
|
},
|
|
|
|
token: function(stream, state) {
|
|
if (!state.tagName && stream.sol())
|
|
state.indented = stream.indentation();
|
|
|
|
if (stream.eatSpace()) return null;
|
|
type = null;
|
|
var style = state.tokenize(stream, state);
|
|
if ((style || type) && style != "comment") {
|
|
setStyle = null;
|
|
state.state = state.state(type || style, stream, state);
|
|
if (setStyle)
|
|
style = setStyle == "error" ? style + " error" : setStyle;
|
|
}
|
|
return style;
|
|
},
|
|
|
|
indent: function(state, textAfter, fullLine) {
|
|
var context = state.context;
|
|
// Indent multi-line strings (e.g. css).
|
|
if (state.tokenize.isInAttribute) {
|
|
if (state.tagStart == state.indented)
|
|
return state.stringStartCol + 1;
|
|
else
|
|
return state.indented + indentUnit;
|
|
}
|
|
if (context && context.noIndent) return CodeMirror.Pass;
|
|
if (state.tokenize != inTag && state.tokenize != inText)
|
|
return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
|
|
// Indent the starts of attribute names.
|
|
if (state.tagName) {
|
|
if (config.multilineTagIndentPastTag !== false)
|
|
return state.tagStart + state.tagName.length + 2;
|
|
else
|
|
return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1);
|
|
}
|
|
if (config.alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
|
|
var tagAfter = textAfter && /^<(\/)?([\w_:\.-]*)/.exec(textAfter);
|
|
if (tagAfter && tagAfter[1]) { // Closing tag spotted
|
|
while (context) {
|
|
if (context.tagName == tagAfter[2]) {
|
|
context = context.prev;
|
|
break;
|
|
} else if (config.implicitlyClosed.hasOwnProperty(context.tagName)) {
|
|
context = context.prev;
|
|
} else {
|
|
break;
|
|
}
|
|
}
|
|
} else if (tagAfter) { // Opening tag spotted
|
|
while (context) {
|
|
var grabbers = config.contextGrabbers[context.tagName];
|
|
if (grabbers && grabbers.hasOwnProperty(tagAfter[2]))
|
|
context = context.prev;
|
|
else
|
|
break;
|
|
}
|
|
}
|
|
while (context && context.prev && !context.startOfLine)
|
|
context = context.prev;
|
|
if (context) return context.indent + indentUnit;
|
|
else return state.baseIndent || 0;
|
|
},
|
|
|
|
electricInput: /<\/[\s\w:]+>$/,
|
|
blockCommentStart: "<!--",
|
|
blockCommentEnd: "-->",
|
|
|
|
configuration: config.htmlMode ? "html" : "xml",
|
|
helperType: config.htmlMode ? "html" : "xml",
|
|
|
|
skipAttribute: function(state) {
|
|
if (state.state == attrValueState)
|
|
state.state = attrState
|
|
},
|
|
|
|
xmlCurrentTag: function(state) {
|
|
return state.tagName ? {name: state.tagName, close: state.type == "closeTag"} : null
|
|
},
|
|
|
|
xmlCurrentContext: function(state) {
|
|
var context = []
|
|
for (var cx = state.context; cx; cx = cx.prev)
|
|
if (cx.tagName) context.push(cx.tagName)
|
|
return context.reverse()
|
|
}
|
|
};
|
|
});
|
|
|
|
CodeMirror.defineMIME("text/xml", "xml");
|
|
CodeMirror.defineMIME("application/xml", "xml");
|
|
if (!CodeMirror.mimeModes.hasOwnProperty("text/html"))
|
|
CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});
|
|
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 63518:
|
|
/*!************************************************************************!*\
|
|
!*** ./node_modules/_mind-elixir@4.3.1@mind-elixir/dist/MindElixir.js ***!
|
|
\************************************************************************/
|
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ Z: function() { return /* binding */ A; }
|
|
/* harmony export */ });
|
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".mind-elixir{--gap: 30px;--root-radius: 30px;--main-radius: 20px;--root-color: #ffffff;--root-bgcolor: #4c4f69;--root-border-color: rgba(0, 0, 0, 0);--main-color: #444446;--main-bgcolor: #ffffff;--topic-padding: 3px;--color: #777777;--bgcolor: #f6f6f6;--selected: #4dc4ff;--panel-color: #444446;--panel-bgcolor: #ffffff;--panel-border-color: #eaeaea;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0);font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif}.mind-elixir .hyper-link{text-decoration:none;margin-left:.3em}.map-container{-webkit-user-select:none;user-select:none;height:100%;width:100%;overflow:scroll;font-size:15px}.map-container *{box-sizing:border-box}.map-container::-webkit-scrollbar{width:0px;height:0px}.map-container .selected{outline:2px solid var(--selected);outline-offset:1px}.map-container .lhs{direction:rtl}.map-container .lhs me-tpc{direction:ltr}.map-container .map-canvas{height:20000px;width:20000px;position:relative;-webkit-user-select:none;user-select:none;transition:transform .3s;transform:scale(1);background-color:var(--bgcolor)}.map-container .map-canvas me-nodes{position:absolute;display:flex;justify-content:center;align-items:center;height:fit-content;width:fit-content}.map-container .map-canvas me-root{position:relative}.map-container .map-canvas me-root me-tpc{display:block;font-size:25px;color:var(--root-color);padding:10px var(--gap);border-radius:var(--root-radius);border:var(--root-border-color) 2px solid;white-space:pre-wrap;background-color:var(--root-bgcolor)}.map-container me-main>me-wrapper{position:relative;margin:45px 65px}.map-container me-main>me-wrapper>me-parent{margin:10px;padding:0}.map-container me-main>me-wrapper>me-parent>me-tpc{border-radius:var(--main-radius);background-color:var(--main-bgcolor);border:2px solid var(--main-color);color:var(--main-color);padding:8px 25px}.map-container me-wrapper{display:block;pointer-events:none;width:fit-content}.map-container me-children,.map-container me-parent{display:inline-block;vertical-align:middle}.map-container me-parent{position:relative;cursor:pointer;padding:6px var(--gap);margin-top:10px}.map-container me-parent me-tpc{position:relative;display:block;border-radius:3px;color:var(--color);pointer-events:all;max-width:35em;white-space:pre-wrap;padding:var(--topic-padding)}.map-container me-parent me-tpc .insert-preview{position:absolute;width:100%;left:0;z-index:9}.map-container me-parent me-tpc .show{background:#7ad5ff;pointer-events:none;opacity:.7}.map-container me-parent me-tpc .before{height:14px;top:-14px}.map-container me-parent me-tpc .in{height:100%;top:0}.map-container me-parent me-tpc .after{height:14px;bottom:-14px}.map-container me-parent me-epd{position:absolute;height:18px;width:18px;opacity:.8;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdD0iMTY1NjY1NDcxNzI0MiIgY2xhc3M9Imljb24iIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIHZlcnNpb249IjEuMSIKICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+CiAgICA8cGF0aCBkPSJNNTEyIDc0LjY2NjY2N0MyNzAuOTMzMzMzIDc0LjY2NjY2NyA3NC42NjY2NjcgMjcwLjkzMzMzMyA3NC42NjY2NjcgNTEyUzI3MC45MzMzMzMgOTQ5LjMzMzMzMyA1MTIgOTQ5LjMzMzMzMyA5NDkuMzMzMzMzIDc1My4wNjY2NjcgOTQ5LjMzMzMzMyA1MTIgNzUzLjA2NjY2NyA3NC42NjY2NjcgNTEyIDc0LjY2NjY2N3oiIHN0cm9rZS13aWR0aD0iNTQiIHN0cm9rZT0nYmxhY2snIGZpbGw9J3doaXRlJyA+PC9wYXRoPgogICAgPHBhdGggZD0iTTY4Mi42NjY2NjcgNDgwaC0xMzguNjY2NjY3VjM0MS4zMzMzMzNjMC0xNy4wNjY2NjctMTQuOTMzMzMzLTMyLTMyLTMycy0zMiAxNC45MzMzMzMtMzIgMzJ2MTM4LjY2NjY2N0gzNDEuMzMzMzMzYy0xNy4wNjY2NjcgMC0zMiAxNC45MzMzMzMtMzIgMzJzMTQuOTMzMzMzIDMyIDMyIDMyaDEzOC42NjY2NjdWNjgyLjY2NjY2N2MwIDE3LjA2NjY2NyAxNC45MzMzMzMgMzIgMzIgMzJzMzItMTQuOTMzMzMzIDMyLTMydi0xMzguNjY2NjY3SDY4Mi42NjY2NjdjMTcuMDY2NjY3IDAgMzItMTQuOTMzMzMzIDMyLTMycy0xNC45MzMzMzMtMzItMzItMzJ6Ij48L3BhdGg+Cjwvc3ZnPg==);background-repeat:no-repeat;background-size:contain;background-position:center;pointer-events:all;z-index:9}.map-container me-parent me-epd.minus{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdD0iMTY1NjY1NTU2NDk4NSIgY2xhc3M9Imljb24iIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIHZlcnNpb249IjEuMSIKICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+CiAgICA8cGF0aCBkPSJNNTEyIDc0LjY2NjY2N0MyNzAuOTMzMzMzIDc0LjY2NjY2NyA3NC42NjY2NjcgMjcwLjkzMzMzMyA3NC42NjY2NjcgNTEyUzI3MC45MzMzMzMgOTQ5LjMzMzMzMyA1MTIgOTQ5LjMzMzMzMyA5NDkuMzMzMzMzIDc1My4wNjY2NjcgOTQ5LjMzMzMzMyA1MTIgNzUzLjA2NjY2NyA3NC42NjY2NjcgNTEyIDc0LjY2NjY2N3oiIHN0cm9rZS13aWR0aD0iNTQiIHN0cm9rZT0nYmxhY2snIGZpbGw9J3doaXRlJyA+PC9wYXRoPgogICAgPHBhdGggZD0iTTY4Mi42NjY2NjcgNTQ0SDM0MS4zMzMzMzNjLTE3LjA2NjY2NyAwLTMyLTE0LjkzMzMzMy0zMi0zMnMxNC45MzMzMzMtMzIgMzItMzJoMzQxLjMzMzMzNGMxNy4wNjY2NjcgMCAzMiAxNC45MzMzMzMgMzIgMzJzLTE0LjkzMzMzMyAzMi0zMiAzMnoiPjwvcGF0aD4KPC9zdmc+)!important;transition:opacity .3s;opacity:0}.map-container me-parent me-epd.minus:hover{opacity:.8}.map-container .icon{width:1em;height:1em;vertical-align:-.15em;fill:currentColor;overflow:hidden}.map-container .lines,.map-container .summary,.map-container .subLines,.map-container .topiclinks,.map-container .linkcontroller{position:absolute;height:102%;width:100%;top:0;left:0}.map-container .topiclinks,.map-container .linkcontroller,.map-container .summary{pointer-events:none}.map-container .topiclinks text,.map-container .linkcontroller text,.map-container .summary text{pointer-events:all}.map-container .topiclinks .selected,.map-container .linkcontroller .selected,.map-container .summary .selected{pointer-events:none}.map-container .lines,.map-container .subLines{pointer-events:none;z-index:-1}.map-container .topiclinks *,.map-container .linkcontroller *{z-index:100}.map-container .topiclinks g{cursor:pointer}.map-container #input-box{position:absolute;top:0;left:0;width:max-content;max-width:35em;z-index:11;direction:ltr;-webkit-user-select:auto;user-select:auto;pointer-events:auto;background-color:var(--bgcolor)}.map-container me-tpc>*{pointer-events:none}.map-container me-tpc>a{pointer-events:auto}.map-container me-tpc>img{display:block;margin-bottom:8px;object-fit:cover}.map-container me-tpc>.text{display:inline-block}.map-container .circle{position:absolute;height:10px;width:10px;margin-top:-5px;margin-left:-5px;border-radius:100%;background:#757575;border:2px solid #ffffff;cursor:pointer}.map-container .tags{direction:ltr}.map-container .tags span{display:inline-block;border-radius:3px;padding:2px 4px;background:#d6f0f8;color:#276f86;margin:2px 4px 0 0;font-size:12px;line-height:1.3em}.map-container .icons{display:inline-block;direction:ltr;margin-right:10px}.map-container .icons span{display:inline-block;line-height:1.3em}.map-container .mind-elixir-ghost{position:fixed;top:-100%;left:-100%;box-sizing:content-box;opacity:.5;background-color:#f6f6f6;max-width:200px;width:fit-content;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:8px 16px;border-radius:6px;border:#666666 2px solid}.map-container .selection-area{background:#4f90f22d;border:1px solid #4f90f2}.mind-elixir .context-menu{position:fixed;top:0;left:0;width:100%;height:100%;z-index:99}.mind-elixir .context-menu .menu-list{position:fixed;list-style:none;margin:0;padding:0;color:var(--panel-color);box-shadow:0 12px 15px #0003;border-radius:5px;overflow:hidden}.mind-elixir .context-menu .menu-list li{min-width:200px;overflow:hidden;white-space:nowrap;padding:6px 10px;background:var(--panel-bgcolor);border-bottom:1px solid var(--panel-border-color);cursor:pointer}.mind-elixir .context-menu .menu-list li span{line-height:20px}.mind-elixir .context-menu .menu-list li a{color:#333;text-decoration:none}.mind-elixir .context-menu .menu-list li.disabled{display:none}.mind-elixir .context-menu .menu-list li:hover{filter:brightness(.95)}.mind-elixir .context-menu .menu-list li:last-child{border-bottom:0}.mind-elixir .context-menu .menu-list li span:last-child{float:right}.mind-elixir .context-menu .key{font-size:10px;background-color:#f1f1f1;color:#333;padding:2px 5px;border-radius:3px}.mind-elixir .tips{position:absolute;bottom:20px;left:50%;transform:translate(-50%);color:var(--panel-color);font-weight:bolder}.mind-elixir-toolbar{font-family:iconfont;position:absolute;color:var(--panel-color);background:var(--panel-bgcolor);padding:10px;border-radius:5px;box-shadow:0 1px 2px #0003}.mind-elixir-toolbar svg{display:inline-block}.mind-elixir-toolbar span:active{opacity:.5}.mind-elixir-toolbar.rb{right:20px;bottom:20px}.mind-elixir-toolbar.rb span+span{margin-left:10px}.mind-elixir-toolbar.lt{font-size:20px;left:20px;top:20px}.mind-elixir-toolbar.lt span{display:block}.mind-elixir-toolbar.lt span+span{margin-top:10px}")),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
|
|
(function(e) {
|
|
var t, n, o, s, i, r, c = '<svg><symbol id="icon-edit" viewBox="0 0 1024 1024"><path d="M423.765333 128a42.666667 42.666667 0 0 1 3.2 85.205333L423.765333 213.333333H234.666667a64 64 0 0 0-63.872 60.245334L170.666667 277.333333v512a64 64 0 0 0 60.245333 63.872L234.666667 853.333333h512a64 64 0 0 0 63.872-60.245333L810.666667 789.333333v-189.098666a42.666667 42.666667 0 0 1 85.205333-3.2l0.128 3.2V789.333333a149.333333 149.333333 0 0 1-144.213333 149.248L746.666667 938.666667h-512a149.333333 149.333333 0 0 1-149.248-144.213334L85.333333 789.333333v-512a149.333333 149.333333 0 0 1 144.213334-149.248L234.666667 128h189.098666z m324.949334-53.248a42.666667 42.666667 0 0 1 60.330666 0l150.869334 150.869333a42.666667 42.666667 0 0 1 0 60.330667l-329.386667 329.386667a42.666667 42.666667 0 0 1-29.44 12.458666l-153.386667 2.517334a42.666667 42.666667 0 0 1-43.349333-43.349334l2.56-153.386666a42.666667 42.666667 0 0 1 12.458667-29.44z m30.165333 90.496L491.946667 452.266667l-1.493334 91.989333 92.032-1.493333 286.976-286.976-90.538666-90.538667z" ></path></symbol><symbol id="icon-rising" viewBox="0 0 1024 1024"><path d="M553.173333 803.84h-64l0.021334-474.581333-224.021334 224-45.269333-45.226667L521.6 206.293333l301.717333 301.696-45.269333 45.269334-224.853333-224.896v475.477333z" ></path></symbol><symbol id="icon-falling" viewBox="0 0 1024 1024"><path d="M553.173333 238.314667h-64l0.021334 474.602666-224.021334-224-45.269333 45.226667L521.6 835.861333l301.717333-301.717333-45.269333-45.226667-224.853333 224.853334V238.336z" ></path></symbol><symbol id="icon-shanchu2" viewBox="0 0 1024 1024"><path d="M516.60601807 107.93026734c-82.64382935 0-149.71865844 65.51751709-152.5729065 147.77160644H171.37136841c-21.40603638 0-38.92044068 17.38504028-38.92044068 38.92126465 0 21.40686036 17.38504028 38.92208862 38.92126466 38.92208862h42.94308471v435.40136719c0 81.73498536 55.39828492 148.55026245 123.90106201 148.55026245h348.99444581c68.37341309 0 123.90106201-66.42553711 123.901062-148.55026245V333.80477906h38.92126465c21.40686036 0 38.92126464-17.38586426 38.92126465-38.92208863 0-21.40686036-17.38504028-38.92126464-38.92126465-38.92126465H668.91854859C666.45321656 173.44860839 599.24902344 107.93109131 516.60601807 107.93109131z m-79.65939331 147.77160644c2.85424805-42.16442872 37.2354126-74.85809326 79.78875732-74.85809326s76.93450927 32.82302857 79.39984131 74.85809326H436.94662476z m-98.86047364 589.01165771c-24.2611084 0-50.98754883-31.13717651-50.98754883-75.76693725V333.80477906h450.97036744V769.33551026c0 44.50039673-26.72644043 75.76776123-50.98754884 75.76776122H338.08615112v-0.38973999z m0 0" ></path><path d="M390.37063599 751.17263794c17.77313232 0 32.43411255-17.7739563 32.43411255-40.08883667V482.35504151c0-22.31488037-14.53079224-40.08966065-32.43411255-40.08966065-17.77478027 0-32.43493653 17.77478027-32.43493653 40.08966065v228.72875976c0 22.18469239 14.27124023 40.08883667 32.43493653 40.08883667z m117.41308594 0c17.7739563 0 32.43411255-17.7739563 32.43411255-40.08883667V482.35504151c0-22.31488037-14.53079224-40.08966065-32.43411255-40.08966065-17.7739563 0-32.43493653 17.77478027-32.43493653 40.08966065v228.72875976c0 22.18469239 14.66098023 40.08883667 32.43493653 40.08883667z m123.51049804 0c17.7739563 0 32.43493653-17.7739563 32.43493652-40.08883667V482.35504151c0-22.31488037-14.53079224-40.08966065-32.43493652-40.08966065-17.7739563 0-32.43411255 17.77478027-32.43411255 40.08966065v228.72875976c0 22.18469239 14.14105224 40.08883667 32.43411255 40.08883667z m0 0" ></path></symbol><symbol id="icon-zijiedian" viewBox="0 0 1024 1024"><path d="M312.208 472c19.568-157.856 153.432-280 315.656-280 175.68 0 318.112 143.272 318.112 320S803.552 832 627.864 832c-162.224 0-296.08-122.144-315.656-280H120a40 40 0 0 1 0-80h192.208zM632 752c132.552 0 240-107.448 240-240 0-132.552-107.448-240-240-240-132.552 0-240 107.448-240 240 0 132.552 107.448 240 240 240z m-40-280v-80a40 40 0 0 1 80 0v80h80a40 40 0 0 1 0 80h-80v80a40 40 0 0 1-80 0v-80h-80a40 40 0 0 1 0-80h80z" ></path></symbol><symbol id="icon-tongjijiedian-" viewBox="0 0 1024 1024"><path d="M803.84 131.626667H410.24A59.733333 59.733333 0 0 0 350.506667 192v45.226667H199.68a51.626667 51.626667 0 0 0-51.626667 51.626666v465.92a51.626667 51.626667 0 0 0 51.626667 51.626667h187.52v-55.466667h-162.133333a21.333333 21.333333 0 0 1-21.333334-21.333333V313.386667a21.333333 21.333333 0 0 1 21.333334-21.333334h125.653333v64a59.733333 59.733333 0 0 0 59.733333 59.733334h393.386667a59.733333 59.733333 0 0 0 59.733333-59.733334V192a59.733333 59.733333 0 0 0-59.733333-60.373333z m4.266667 224.64a4.266667 4.266667 0 0 1-4.266667 4.266666H410.24a4.266667 4.266667 0 0 1-4.266667-4.266666V192a4.266667 4.266667 0 0 1 4.266667-4.266667h393.6a4.266667 4.266667 0 0 1 4.266667 4.266667zM716.16 749.44h-81.28v-81.493333a27.733333 27.733333 0 0 0-55.466667 0v81.28h-81.493333a27.733333 27.733333 0 1 0 0 55.466666h81.28v81.28a27.733333 27.733333 0 1 0 55.466667 0v-81.066666h81.28a27.733333 27.733333 0 0 0 0-55.466667z" ></path></symbol><symbol id="icon-close" viewBox="0 0 1024 1024"><path d="M557.312 513.248l265.28-263.904c12.544-12.48 12.608-32.704 0.128-45.248-12.512-12.576-32.704-12.608-45.248-0.128L512.128 467.904l-263.04-263.84c-12.448-12.48-32.704-12.544-45.248-0.064-12.512 12.48-12.544 32.736-0.064 45.28l262.976 263.776L201.6 776.8c-12.544 12.48-12.608 32.704-0.128 45.248a31.937 31.937 0 0 0 22.688 9.44c8.16 0 16.32-3.104 22.56-9.312l265.216-263.808 265.44 266.24c6.24 6.272 14.432 9.408 22.656 9.408a31.94 31.94 0 0 0 22.592-9.344c12.512-12.48 12.544-32.704 0.064-45.248L557.312 513.248z" fill="" ></path></symbol><symbol id="icon-menu" viewBox="0 0 1024 1024"><path d="M109.714 292.571h804.572c21.943 0 36.571-21.942 36.571-43.885 0-14.629-14.628-29.257-36.571-29.257H109.714c-21.943 0-36.571 14.628-36.571 36.571 0 14.629 14.628 36.571 36.571 36.571zM914.286 512H109.714c-21.943 0-36.571 14.629-36.571 36.571 0 14.629 14.628 36.572 36.571 36.572h804.572c21.943 0 36.571-21.943 36.571-43.886 0-14.628-14.628-29.257-36.571-29.257z m0 292.571H109.714c-21.943 0-36.571 14.629-36.571 36.572s14.628 36.571 36.571 36.571h804.572c21.943 0 36.571-21.943 36.571-36.571 0-21.943-14.628-36.572-36.571-36.572z" ></path></symbol><symbol id="icon-right" viewBox="0 0 1024 1024"><path d="M385 560.69999999L385 738.9c0 36.90000001 26.4 68.5 61.3 68.5l150.2 0c1.5 0 3-0.1 4.5-0.3 10.2 38.7 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-42 0-77.3 28.6-87.5 67.39999999-1.4-0.3-2.9-0.4-4.5-0.39999999L446.3 760.4c-6.8 0-14.3-8.9-14.3-21.49999999l0-427.00000001c0-12.7 7.40000001-21.5 14.30000001-21.5l150.19999999 0c1.5 0 3-0.2 4.5-0.4 10.2 38.8 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.4 0-49.9-40.5-90.6-90.5-90.59999999-42 0-77.3 28.6-87.5 67.39999999-1.4-0.2-2.9-0.4-4.49999999-0.4L446.3 243.3c-34.80000001 0-61.3 31.6-61.3 68.50000001L385 513.7l-79.1 0c-10.4-38.5-45.49999999-67-87.4-67-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c41.79999999 0 77.00000001-28.4 87.4-67L385 560.69999999z" fill="" ></path></symbol><symbol id="icon-left" viewBox="0 0 1024 1024"><path d="M639 463.30000001L639 285.1c0-36.90000001-26.4-68.5-61.3-68.5l-150.2 0c-1.5 0-3 0.1-4.5 0.3-10.2-38.7-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c42 0 77.3-28.6 87.5-67.39999999 1.4 0.3 2.9 0.4 4.5 0.39999999L577.7 263.6c6.8 0 14.3 8.9 14.3 21.49999999l0 427.00000001c0 12.7-7.40000001 21.5-14.30000001 21.5l-150.19999999 0c-1.5 0-3 0.2-4.5 0.4-10.2-38.8-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.4 0 49.9 40.5 90.6 90.5 90.59999999 42 0 77.3-28.6 87.5-67.39999999 1.4 0.2 2.9 0.4 4.49999999 0.4L577.7 780.7c34.80000001 0 61.3-31.6 61.3-68.50000001L639 510.3l79.1 0c10.4 38.5 45.49999999 67 87.4 67 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-41.79999999 0-77.00000001 28.4-87.4 67L639 463.30000001z" fill="" ></path></symbol><symbol id="icon-side" viewBox="0 0 1024 1024"><path d="M851.91168 328.45312c-59.97056 0-108.6208 48.47104-108.91264 108.36992l-137.92768 38.4a109.14304 109.14304 0 0 0-63.46752-46.58688l1.39264-137.11872c47.29344-11.86816 82.31936-54.66624 82.31936-105.64096 0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.76288-108.91776 108.91776c0 49.18784 32.60928 90.75712 77.38368 104.27392l-1.41312 138.87488a109.19936 109.19936 0 0 0-63.50336 48.55808l-138.93632-39.48544 0.01024-0.72704c0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.75776-108.91776 108.91776c0 60.15488 48.76288 108.91264 108.91776 108.91264 39.3984 0 73.91232-20.92032 93.03552-52.2496l139.19232 39.552-0.00512 0.2304c0 25.8304 9.00096 49.5616 24.02816 68.23424l-90.14272 132.63872a108.7488 108.7488 0 0 0-34.2528-5.504c-60.15488 0-108.91776 48.768-108.91776 108.91776 0 60.16 48.76288 108.91776 108.91776 108.91776 60.16 0 108.92288-48.75776 108.92288-108.91776 0-27.14624-9.9328-51.968-26.36288-71.04l89.04704-131.03104a108.544 108.544 0 0 0 37.6832 6.70208 108.672 108.672 0 0 0 36.48512-6.272l93.13792 132.57216a108.48256 108.48256 0 0 0-24.69888 69.0688c0 60.16 48.768 108.92288 108.91776 108.92288 60.16 0 108.91776-48.76288 108.91776-108.92288 0-60.14976-48.75776-108.91776-108.91776-108.91776a108.80512 108.80512 0 0 0-36.69504 6.3488l-93.07136-132.48a108.48768 108.48768 0 0 0 24.79616-72.22784l136.09984-37.888c18.99008 31.93856 53.84192 53.3504 93.69088 53.3504 60.16 0 108.92288-48.75776 108.92288-108.91264-0.00512-60.15488-48.77312-108.92288-108.92288-108.92288z" ></path></symbol><symbol id="icon-B" viewBox="0 0 1024 1024"><path d="M98.067692 65.457231H481.28c75.854769 0 132.411077 3.150769 169.668923 9.452307 37.336615 6.301538 70.656 19.534769 100.036923 39.620924 29.459692 20.007385 53.956923 46.710154 73.570462 80.029538 19.692308 33.398154 29.459692 70.734769 29.459692 112.167385 0 44.898462-12.130462 86.094769-36.233846 123.588923a224.886154 224.886154 0 0 1-98.461539 84.283077c58.368 17.092923 103.266462 46.08 134.695385 87.04 31.350154 40.96 47.025231 89.088 47.025231 144.462769 0 43.638154-10.082462 86.016-30.404923 127.212308-20.243692 41.196308-47.891692 74.043077-83.02277 98.697846-35.052308 24.654769-78.296615 39.778462-129.732923 45.449846-32.295385 3.465846-110.119385 5.671385-233.472 6.537846H98.067692V65.457231z m193.536 159.507692V446.621538h126.818462c75.460923 0 122.328615-1.024 140.603077-3.229538 33.083077-3.938462 59.155692-15.36 78.139077-34.343385 18.904615-18.904615 28.435692-43.874462 28.435692-74.830769 0-29.696-8.192-53.720615-24.497231-72.310154-16.384-18.510769-40.644923-29.696-72.940307-33.634461-19.140923-2.205538-74.279385-3.308308-165.415385-3.308308h-111.064615z m0 381.243077v256.315077h179.2c69.710769 0 113.979077-1.969231 132.726154-5.907692 28.750769-5.198769 52.145231-17.959385 70.262154-38.281847 18.116923-20.243692 27.096615-47.340308 27.096615-81.368615 0-28.750769-6.931692-53.169231-20.873846-73.255385a118.232615 118.232615 0 0 0-60.494769-43.795692c-26.387692-9.137231-83.574154-13.705846-171.638154-13.705846H291.603692z" ></path></symbol><symbol id="icon-a" viewBox="0 0 1024 1024"><path d="M757.76 665.6q0 20.48 1.536 34.304t7.68 22.016 18.944 12.288 34.304 4.096q-3.072 25.6-15.36 44.032-11.264 16.384-33.28 29.696t-62.976 13.312q-11.264 0-20.48-0.512t-17.408-2.56l-6.144-2.048-1.024 0q-4.096-1.024-10.24-4.096-2.048-2.048-4.096-2.048-1.024-1.024-2.048-1.024-14.336-8.192-23.552-17.408t-14.336-17.408q-6.144-10.24-9.216-20.48-63.488 75.776-178.176 75.776-48.128 0-88.064-15.36t-69.12-44.032-45.056-68.096-15.872-88.576 16.896-89.088 47.616-67.584 74.24-42.496 96.768-14.848q48.128 0 88.576 17.408t66.048 49.152q0-8.192 0.512-16.384t0.512-15.36q0-71.68-39.936-104.448t-128-32.768q-43.008 0-84.992 6.656t-84.992 17.92q14.336-28.672 25.088-47.616t24.064-29.184q30.72-24.576 158.72-24.576 79.872 0 135.168 13.824t90.624 43.52 51.2 75.264 15.872 108.032l0 200.704zM487.424 743.424q50.176 0 79.872-33.28t29.696-95.744q0-61.44-28.672-93.696t-76.8-32.256q-52.224 0-82.944 33.28t-30.72 94.72q0 58.368 31.744 92.672t77.824 34.304z" ></path></symbol><symbol id="icon-full" viewBox="0 0 1024 1024"><path d="M639.328 416c8.032 0 16.096-3.008 22.304-9.056l202.624-197.184-0.8 143.808c-0.096 17.696 14.144 32.096 31.808 32.192 0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808l1.248-222.208c0-0.672-0.352-1.248-0.384-1.92 0.032-0.512 0.288-0.896 0.288-1.408 0.032-17.664-14.272-32-31.968-32.032L671.552 96l-0.032 0c-17.664 0-31.968 14.304-32 31.968C639.488 145.632 653.824 160 671.488 160l151.872 0.224-206.368 200.8c-12.672 12.32-12.928 32.608-0.64 45.248C622.656 412.736 630.976 416 639.328 416z" ></path><path d="M896.032 639.552 896.032 639.552c-17.696 0-32 14.304-32.032 31.968l-0.224 151.872-200.832-206.4c-12.32-12.64-32.576-12.96-45.248-0.64-12.672 12.352-12.928 32.608-0.64 45.248l197.184 202.624-143.808-0.8c-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808-0.096 17.696 14.144 32.096 31.808 32.192l222.24 1.248c0.064 0 0.128 0 0.192 0 0.64 0 1.12-0.32 1.76-0.352 0.512 0.032 0.896 0.288 1.408 0.288l0.032 0c17.664 0 31.968-14.304 32-31.968L928 671.584C928.032 653.952 913.728 639.584 896.032 639.552z" ></path><path d="M209.76 159.744l143.808 0.8c0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808 0.096-17.696-14.144-32.096-31.808-32.192L131.68 95.328c-0.064 0-0.128 0-0.192 0-0.672 0-1.248 0.352-1.888 0.384-0.448 0-0.8-0.256-1.248-0.256 0 0-0.032 0-0.032 0-17.664 0-31.968 14.304-32 31.968L96 352.448c-0.032 17.664 14.272 32 31.968 32.032 0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968l0.224-151.936 200.832 206.4c6.272 6.464 14.624 9.696 22.944 9.696 8.032 0 16.096-3.008 22.304-9.056 12.672-12.32 12.96-32.608 0.64-45.248L209.76 159.744z" ></path><path d="M362.368 617.056l-202.624 197.184 0.8-143.808c0.096-17.696-14.144-32.096-31.808-32.192-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808l-1.248 222.24c0 0.704 0.352 1.312 0.384 2.016 0 0.448-0.256 0.832-0.256 1.312-0.032 17.664 14.272 32 31.968 32.032L352.448 928c0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968s-14.272-32-31.968-32.032l-151.936-0.224 206.4-200.832c12.672-12.352 12.96-32.608 0.64-45.248S375.008 604.704 362.368 617.056z" ></path></symbol><symbol id="icon-add" viewBox="0 0 1024 1024"><path d="M863.328 482.56l-317.344-1.12L545.984 162.816c0-17.664-14.336-32-32-32s-32 14.336-32 32l0 318.4L159.616 480.064c-0.032 0-0.064 0-0.096 0-17.632 0-31.936 14.24-32 31.904C127.424 529.632 141.728 544 159.392 544.064l322.592 1.152 0 319.168c0 17.696 14.336 32 32 32s32-14.304 32-32l0-318.944 317.088 1.12c0.064 0 0.096 0 0.128 0 17.632 0 31.936-14.24 32-31.904C895.264 496.992 880.96 482.624 863.328 482.56z" ></path></symbol><symbol id="icon-move" viewBox="0 0 1024 1024"><path d="M863.744 544 163.424 544c-17.664 0-32-14.336-32-32s14.336-32 32-32l700.32 0c17.696 0 32 14.336 32 32S881.44 544 863.744 544z" ></path></symbol><symbol id="icon-living" viewBox="0 0 1024 1024"><path d="M514.133333 488.533333m-106.666666 0a106.666667 106.666667 0 1 0 213.333333 0 106.666667 106.666667 0 1 0-213.333333 0Z" fill="" ></path><path d="M512 64C264.533333 64 64 264.533333 64 512c0 236.8 183.466667 428.8 416 445.866667v-134.4c-53.333333-59.733333-200.533333-230.4-200.533333-334.933334 0-130.133333 104.533333-234.666667 234.666666-234.666666s234.666667 104.533333 234.666667 234.666666c0 61.866667-49.066667 153.6-145.066667 270.933334l-59.733333 68.266666V960C776.533333 942.933333 960 748.8 960 512c0-247.466667-200.533333-448-448-448z" fill="" ></path></symbol></svg>', l = (l = document.getElementsByTagName("script"))[l.length - 1].getAttribute("data-injectcss");
|
|
if (l && !e.__iconfont__svg__cssinject__) {
|
|
e.__iconfont__svg__cssinject__ = !0;
|
|
try {
|
|
document.write(
|
|
"<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>"
|
|
);
|
|
} catch {
|
|
}
|
|
}
|
|
function u() {
|
|
i || (i = !0, o());
|
|
}
|
|
t = function() {
|
|
var d, a, p, g;
|
|
(g = document.createElement("div")).innerHTML = c, c = null, (p = g.getElementsByTagName("svg")[0]) && (p.setAttribute("aria-hidden", "true"), p.style.position = "absolute", p.style.width = 0, p.style.height = 0, p.style.overflow = "hidden", d = p, (a = document.body).firstChild ? (g = d, (p = a.firstChild).parentNode.insertBefore(g, p)) : a.appendChild(d));
|
|
}, document.addEventListener ? ~["complete", "loaded", "interactive"].indexOf(document.readyState) ? setTimeout(t, 0) : (n = function() {
|
|
document.removeEventListener("DOMContentLoaded", n, !1), t();
|
|
}, document.addEventListener("DOMContentLoaded", n, !1)) : document.attachEvent && (o = t, s = e.document, i = !1, (r = function() {
|
|
try {
|
|
s.documentElement.doScroll("left");
|
|
} catch {
|
|
return void setTimeout(r, 50);
|
|
}
|
|
u();
|
|
})(), s.onreadystatechange = function() {
|
|
s.readyState == "complete" && (s.onreadystatechange = null, u());
|
|
});
|
|
})(window);
|
|
const T = 0, z = 1, re = 2, $e = {
|
|
name: "Latte",
|
|
type: "light",
|
|
palette: ["#dd7878", "#ea76cb", "#8839ef", "#e64553", "#fe640b", "#df8e1d", "#40a02b", "#209fb5", "#1e66f5", "#7287fd"],
|
|
cssVar: {
|
|
"--gap": "30px",
|
|
"--main-color": "#444446",
|
|
"--main-bgcolor": "#ffffff",
|
|
"--color": "#777777",
|
|
"--bgcolor": "#f6f6f6",
|
|
"--panel-color": "#444446",
|
|
"--panel-bgcolor": "#ffffff",
|
|
"--panel-border-color": "#eaeaea"
|
|
}
|
|
}, Oe = {
|
|
name: "Dark",
|
|
type: "dark",
|
|
palette: ["#848FA0", "#748BE9", "#D2F9FE", "#4145A5", "#789AFA", "#706CF4", "#EF987F", "#775DD5", "#FCEECF", "#DA7FBC"],
|
|
cssVar: {
|
|
"--main-color": "#ffffff",
|
|
"--main-bgcolor": "#4c4f69",
|
|
"--color": "#cccccc",
|
|
"--bgcolor": "#252526",
|
|
"--panel-color": "#ffffff",
|
|
"--panel-bgcolor": "#2d3748",
|
|
"--panel-border-color": "#696969"
|
|
}
|
|
};
|
|
function ne(e) {
|
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/"/g, """);
|
|
}
|
|
const oe = function(e, t) {
|
|
if (t.id === e)
|
|
return t;
|
|
if (t.children && t.children.length) {
|
|
for (let n = 0; n < t.children.length; n++) {
|
|
const o = oe(e, t.children[n]);
|
|
if (o)
|
|
return o;
|
|
}
|
|
return null;
|
|
} else
|
|
return null;
|
|
}, D = (e, t) => {
|
|
if (e.parent = t, e.children)
|
|
for (let n = 0; n < e.children.length; n++)
|
|
D(e.children[n], e);
|
|
};
|
|
function he(e) {
|
|
if (e.id = X(), e.children)
|
|
for (let t = 0; t < e.children.length; t++)
|
|
he(e.children[t]);
|
|
}
|
|
const tt = (e, t) => {
|
|
let n = Date.now();
|
|
return function(...o) {
|
|
Date.now() - n < t || (e(...o), n = Date.now());
|
|
};
|
|
};
|
|
function Pe(e, t, n, o) {
|
|
const s = o - t, i = e - n;
|
|
let r = Math.atan(Math.abs(s) / Math.abs(i)) / 3.14 * 180;
|
|
i < 0 && s > 0 && (r = 180 - r), i < 0 && s < 0 && (r = 180 + r), i > 0 && s < 0 && (r = 360 - r);
|
|
const c = 15, l = 30, u = r + l, d = r - l;
|
|
return {
|
|
x1: n + Math.cos(Math.PI * u / 180) * c,
|
|
y1: o - Math.sin(Math.PI * u / 180) * c,
|
|
x2: n + Math.cos(Math.PI * d / 180) * c,
|
|
y2: o - Math.sin(Math.PI * d / 180) * c
|
|
};
|
|
}
|
|
function X() {
|
|
return ((/* @__PURE__ */ new Date()).getTime().toString(16) + Math.random().toString(16).substr(2)).substr(2, 16);
|
|
}
|
|
const nt = function() {
|
|
const e = X();
|
|
return {
|
|
topic: this.newTopicName,
|
|
id: e
|
|
};
|
|
};
|
|
function ue(e) {
|
|
return JSON.parse(
|
|
JSON.stringify(e, (n, o) => {
|
|
if (n !== "parent")
|
|
return o;
|
|
})
|
|
);
|
|
}
|
|
const $ = (e, t) => {
|
|
let n = 0, o = 0;
|
|
for (; t && t !== e; )
|
|
n += t.offsetLeft, o += t.offsetTop, t = t.offsetParent;
|
|
return { offsetLeft: n, offsetTop: o };
|
|
}, N = (e, t) => {
|
|
for (const n in t)
|
|
e.setAttribute(n, t[n]);
|
|
}, le = (e) => e ? e.tagName === "ME-TPC" : !1, ce = (e) => e.filter((t) => {
|
|
for (let n = 0; n < e.length; n++) {
|
|
if (t === e[n])
|
|
continue;
|
|
if (e[n].parentElement.parentElement.contains(t))
|
|
return !1;
|
|
}
|
|
return !0;
|
|
}), k = {
|
|
moved: !1,
|
|
// diffrentiate click and move
|
|
mousedown: !1,
|
|
onMove(e, t) {
|
|
if (this.mousedown) {
|
|
this.moved = !0;
|
|
const n = e.movementX, o = e.movementY;
|
|
t.scrollTo(t.scrollLeft - n, t.scrollTop - o);
|
|
}
|
|
},
|
|
clear() {
|
|
this.moved = !1, this.mousedown = !1;
|
|
}
|
|
};
|
|
function ot(e) {
|
|
e.map.addEventListener("click", (t) => {
|
|
var o, s;
|
|
if (t.button !== 0)
|
|
return;
|
|
if ((o = e.helper1) != null && o.moved) {
|
|
e.helper1.clear();
|
|
return;
|
|
}
|
|
if ((s = e.helper2) != null && s.moved) {
|
|
e.helper2.clear();
|
|
return;
|
|
}
|
|
if (k.moved) {
|
|
k.clear();
|
|
return;
|
|
}
|
|
e.clearSelection();
|
|
const n = t.target;
|
|
if (n.tagName === "ME-EPD")
|
|
e.expandNode(n.previousSibling);
|
|
else if (le(n))
|
|
e.selectNode(n, !1, t);
|
|
else if (e.editable)
|
|
n.tagName === "text" ? n.dataset.type === "custom-link" ? e.selectArrow(n.parentElement) : e.selectSummary(n.parentElement) : n.className;
|
|
else
|
|
return;
|
|
}), e.map.addEventListener("dblclick", (t) => {
|
|
if (!e.editable)
|
|
return;
|
|
const n = t.target;
|
|
le(n) ? e.beginEdit(n) : n.tagName === "text" && (n.dataset.type === "custom-link" ? e.editArrowLabel(n.parentElement) : e.editSummary(n.parentElement));
|
|
}), e.map.addEventListener("mousemove", (t) => {
|
|
t.target.contentEditable !== "true" && k.onMove(t, e.container);
|
|
}), e.map.addEventListener("mousedown", (t) => {
|
|
const n = e.mouseSelectionButton === 0 ? 2 : 0;
|
|
t.button === n && t.target.contentEditable !== "true" && (k.moved = !1, k.mousedown = !0);
|
|
}), e.map.addEventListener("mouseleave", (t) => {
|
|
const n = e.mouseSelectionButton === 0 ? 2 : 0;
|
|
t.button === n && k.clear();
|
|
}), e.map.addEventListener("mouseup", (t) => {
|
|
const n = e.mouseSelectionButton === 0 ? 2 : 0;
|
|
t.button === n && k.clear();
|
|
});
|
|
}
|
|
const st = {
|
|
create() {
|
|
return {
|
|
handlers: {},
|
|
showHandler: function() {
|
|
},
|
|
addListener: function(e, t) {
|
|
this.handlers[e] === void 0 && (this.handlers[e] = []), this.handlers[e].push(t);
|
|
},
|
|
fire: function(e, ...t) {
|
|
if (this.handlers[e] instanceof Array) {
|
|
const n = this.handlers[e];
|
|
for (let o = 0; o < n.length; o++)
|
|
n[o](...t);
|
|
}
|
|
},
|
|
removeListener: function(e, t) {
|
|
if (!this.handlers[e])
|
|
return;
|
|
const n = this.handlers[e];
|
|
if (!t)
|
|
n.length = 0;
|
|
else if (n.length)
|
|
for (let o = 0; o < n.length; o++)
|
|
n[o] === t && this.handlers[e].splice(o, 1);
|
|
}
|
|
};
|
|
}
|
|
}, se = document, it = function() {
|
|
this.nodes.innerHTML = "";
|
|
const e = this.createTopic(this.nodeData);
|
|
fe(e, this.nodeData), e.draggable = !1;
|
|
const t = se.createElement("me-root");
|
|
t.appendChild(e);
|
|
const n = this.nodeData.children || [];
|
|
if (this.direction === re) {
|
|
let o = 0, s = 0;
|
|
n.map((i) => {
|
|
i.direction === T ? o += 1 : i.direction === z ? s += 1 : o <= s ? (i.direction = T, o += 1) : (i.direction = z, s += 1);
|
|
});
|
|
}
|
|
rt(this, n, t);
|
|
}, rt = function(e, t, n) {
|
|
const o = se.createElement("me-main");
|
|
o.className = "lhs";
|
|
const s = se.createElement("me-main");
|
|
s.className = "rhs";
|
|
for (let i = 0; i < t.length; i++) {
|
|
const r = t[i], { grp: c } = e.createWrapper(r);
|
|
e.direction === re ? r.direction === T ? o.appendChild(c) : s.appendChild(c) : e.direction === T ? o.appendChild(c) : s.appendChild(c);
|
|
}
|
|
e.nodes.appendChild(o), e.nodes.appendChild(n), e.nodes.appendChild(s), e.nodes.appendChild(e.lines);
|
|
}, ct = function(e, t) {
|
|
const n = se.createElement("me-children");
|
|
for (let o = 0; o < t.length; o++) {
|
|
const s = t[o], { grp: i } = e.createWrapper(s);
|
|
n.appendChild(i);
|
|
}
|
|
return n;
|
|
}, _ = document, C = (e, t) => {
|
|
const o = (t ? t.mindElixirBox : _).querySelector(`[data-nodeid=me${e}]`);
|
|
if (!o)
|
|
throw new Error(`FindEle: Node ${e} not found, maybe it's collapsed.`);
|
|
return o;
|
|
}, fe = function(e, t) {
|
|
if (e.innerHTML = "", t.style && (e.style.color = t.style.color || "", e.style.background = t.style.background || "", e.style.fontSize = t.style.fontSize + "px", e.style.fontWeight = t.style.fontWeight || "normal"), t.dangerouslySetInnerHTML) {
|
|
e.innerHTML = t.dangerouslySetInnerHTML;
|
|
return;
|
|
}
|
|
if (t.image) {
|
|
const n = t.image;
|
|
if (n.url && n.width && n.height) {
|
|
const o = _.createElement("img");
|
|
o.src = n.url, o.style.width = n.width + "px", o.style.height = n.height + "px", n.fit && (o.style.objectFit = n.fit), e.appendChild(o), e.image = o;
|
|
}
|
|
} else
|
|
e.image && (e.image = void 0);
|
|
{
|
|
const n = _.createElement("span");
|
|
n.className = "text", n.textContent = t.topic, e.appendChild(n), e.text = n;
|
|
}
|
|
if (t.hyperLink) {
|
|
const n = _.createElement("a");
|
|
n.className = "hyper-link", n.target = "_blank", n.innerText = "🔗", n.href = t.hyperLink, e.appendChild(n), e.link = n;
|
|
} else
|
|
e.link && (e.link = void 0);
|
|
if (t.icons && t.icons.length) {
|
|
const n = _.createElement("span");
|
|
n.className = "icons", n.innerHTML = t.icons.map((o) => `<span>${ne(o)}</span>`).join(""), e.appendChild(n), e.icons = n;
|
|
} else
|
|
e.icons && (e.icons = void 0);
|
|
if (t.tags && t.tags.length) {
|
|
const n = _.createElement("div");
|
|
n.className = "tags", n.innerHTML = t.tags.map((o) => `<span>${ne(o)}</span>`).join(""), e.appendChild(n), e.tags = n;
|
|
} else
|
|
e.tags && (e.tags = void 0);
|
|
}, lt = function(e, t) {
|
|
const n = _.createElement("me-wrapper"), { p: o, tpc: s } = this.createParent(e);
|
|
if (n.appendChild(o), !t && e.children && e.children.length > 0) {
|
|
const i = pe(e.expanded);
|
|
if (o.appendChild(i), e.expanded !== !1) {
|
|
const r = ct(this, e.children);
|
|
n.appendChild(r);
|
|
}
|
|
}
|
|
return { grp: n, top: o, tpc: s };
|
|
}, at = function(e) {
|
|
const t = _.createElement("me-parent"), n = this.createTopic(e);
|
|
return fe(n, e), t.appendChild(n), { p: t, tpc: n };
|
|
}, dt = function(e) {
|
|
const t = _.createElement("me-children");
|
|
return t.append(...e), t;
|
|
}, ht = function(e) {
|
|
const t = _.createElement("me-tpc");
|
|
return t.nodeObj = e, t.dataset.nodeid = "me" + e.id, t.draggable = this.draggable, t;
|
|
};
|
|
function Be(e) {
|
|
const t = _.createRange();
|
|
t.selectNodeContents(e);
|
|
const n = window.getSelection();
|
|
n && (n.removeAllRanges(), n.addRange(t));
|
|
}
|
|
const ut = function(e) {
|
|
if (!e)
|
|
return;
|
|
const t = _.createElement("div"), n = e.text.textContent;
|
|
e.appendChild(t), t.id = "input-box", t.textContent = n, t.contentEditable = "true", t.spellcheck = !1;
|
|
const o = getComputedStyle(e);
|
|
t.style.cssText = `min-width:${e.offsetWidth - 8}px;
|
|
color:${o.color};
|
|
padding:${o.padding};
|
|
margin:${o.margin};
|
|
font:${o.font};
|
|
background-color:${o.backgroundColor !== "rgba(0, 0, 0, 0)" && o.backgroundColor};
|
|
border-radius:${o.borderRadius};`, this.direction === T && (t.style.right = "0"), t.focus(), Be(t), this.bus.fire("operation", {
|
|
name: "beginEdit",
|
|
obj: e.nodeObj
|
|
}), t.addEventListener("keydown", (s) => {
|
|
s.stopPropagation();
|
|
const i = s.key;
|
|
if (i === "Enter" || i === "Tab") {
|
|
if (s.shiftKey)
|
|
return;
|
|
s.preventDefault(), t == null || t.blur(), this.map.focus();
|
|
}
|
|
}), t.addEventListener("blur", () => {
|
|
var r;
|
|
if (!t)
|
|
return;
|
|
const s = e.nodeObj, i = ((r = t.textContent) == null ? void 0 : r.trim()) || "";
|
|
i === "" ? s.topic = n : s.topic = i, t.remove(), i !== n && (e.text.textContent = s.topic, this.linkDiv(), this.bus.fire("operation", {
|
|
name: "finishEdit",
|
|
obj: s,
|
|
origin: n
|
|
}));
|
|
});
|
|
}, pe = function(e) {
|
|
const t = _.createElement("me-epd");
|
|
return t.expanded = e !== !1, t.className = e !== !1 ? "minus" : "", t;
|
|
}, I = document, K = "http://www.w3.org/2000/svg", He = function(e, t, n) {
|
|
const o = I.createElementNS(K, "path");
|
|
return N(o, {
|
|
d: e,
|
|
stroke: t || "#666",
|
|
fill: "none",
|
|
"stroke-width": n
|
|
}), o;
|
|
}, Y = function(e) {
|
|
const t = I.createElementNS(K, "svg");
|
|
return t.setAttribute("class", e), t.setAttribute("overflow", "visible"), t;
|
|
}, ye = function() {
|
|
const e = I.createElementNS(K, "line");
|
|
return e.setAttribute("stroke", "#bbb"), e.setAttribute("fill", "none"), e.setAttribute("stroke-width", "2"), e;
|
|
}, ft = function(e, t) {
|
|
const n = {
|
|
stroke: "rgb(235, 95, 82)",
|
|
fill: "none",
|
|
"stroke-linecap": "cap",
|
|
"stroke-width": "2"
|
|
}, o = I.createElementNS(K, "g"), s = I.createElementNS(K, "path"), i = I.createElementNS(K, "path");
|
|
return N(i, {
|
|
d: t,
|
|
...n
|
|
}), N(s, {
|
|
d: e,
|
|
...n,
|
|
"stroke-dasharray": "8,2"
|
|
}), o.appendChild(s), o.appendChild(i), o;
|
|
}, ze = function(e, t, n) {
|
|
if (!t)
|
|
return;
|
|
const o = document.createElement("div");
|
|
e.nodes.appendChild(o);
|
|
const s = t.innerHTML;
|
|
o.id = "input-box", o.textContent = s, o.contentEditable = "true", o.spellcheck = !1;
|
|
const i = t.getAttribute("x"), r = t.getAttribute("y");
|
|
o.style.cssText = `min-width:88px;position:absolute;left:${i}px;top:${r}px;`;
|
|
const c = t.getAttribute("text-anchor");
|
|
c === "end" ? o.style.cssText += "transform: translate(-100%, -100%);" : c === "middle" ? o.style.cssText += "transform: translate(-50%, -100%);" : o.style.cssText += "transform: translate(0, -100%);", o.focus(), Be(o), o.addEventListener("keydown", (l) => {
|
|
l.stopPropagation();
|
|
const u = l.key;
|
|
if (u === "Enter" || u === "Tab") {
|
|
if (l.shiftKey)
|
|
return;
|
|
l.preventDefault(), o.blur(), e.map.focus();
|
|
}
|
|
}), o.addEventListener("blur", () => {
|
|
o && n(o);
|
|
});
|
|
}, pt = function(e) {
|
|
const t = this.map.querySelector("me-root"), n = t.offsetTop, o = t.offsetLeft, s = t.offsetWidth, i = t.offsetHeight;
|
|
this.nodes.style.top = `${1e4 - this.nodes.offsetHeight / 2}px`, this.nodes.style.left = `${1e4 - o - s / 2}px`;
|
|
const r = this.map.querySelectorAll("me-main > me-wrapper");
|
|
this.lines.innerHTML = "";
|
|
for (let c = 0; c < r.length; c++) {
|
|
const l = r[c], u = l.querySelector("me-tpc"), { offsetLeft: d, offsetTop: a } = $(this.nodes, u), p = u.offsetWidth, g = u.offsetHeight, f = l.parentNode.className, m = this.generateMainBranch({ pT: n, pL: o, pW: s, pH: i, cT: a, cL: d, cW: p, cH: g, direction: f, containerHeight: this.nodes.offsetHeight }), h = this.theme.palette, v = u.nodeObj.branchColor || h[c % h.length];
|
|
u.style.borderColor = v, this.lines.appendChild(He(m, v, "3"));
|
|
const y = l.children[0].children[1];
|
|
if (y && (y.style.top = (y.parentNode.offsetHeight - y.offsetHeight) / 2 + "px", f === "lhs" ? y.style.left = "-10px" : y.style.right = "-10px"), e && e !== l)
|
|
continue;
|
|
const b = Y("subLines"), x = l.lastChild;
|
|
x.tagName === "svg" && x.remove(), l.appendChild(b), Re(this, b, v, l, f, !0);
|
|
}
|
|
this.renderArrow(), this.renderSummary(), this.bus.fire("linkDiv");
|
|
}, Re = function(e, t, n, o, s, i) {
|
|
const r = o.firstChild, c = o.children[1].children;
|
|
if (c.length === 0)
|
|
return;
|
|
const l = r.offsetTop, u = r.offsetLeft, d = r.offsetWidth, a = r.offsetHeight;
|
|
for (let p = 0; p < c.length; p++) {
|
|
const g = c[p], f = g.firstChild, m = f.offsetTop, h = f.offsetLeft, v = f.offsetWidth, y = f.offsetHeight, b = f.firstChild.nodeObj.branchColor || n, x = e.generateSubBranch({ pT: l, pL: u, pW: d, pH: a, cT: m, cL: h, cW: v, cH: y, direction: s, isFirst: i });
|
|
t.appendChild(He(x, b, "2"));
|
|
const w = f.children[1];
|
|
if (w) {
|
|
if (w.style.bottom = -(w.offsetHeight / 2) + "px", s === "lhs" ? w.style.left = "10px" : s === "rhs" && (w.style.right = "10px"), !w.expanded)
|
|
continue;
|
|
} else
|
|
continue;
|
|
Re(e, t, b, g, s);
|
|
}
|
|
}, be = {
|
|
addChild: "插入子节点",
|
|
addParent: "插入父节点",
|
|
addSibling: "插入同级节点",
|
|
removeNode: "删除节点",
|
|
focus: "专注",
|
|
cancelFocus: "取消专注",
|
|
moveUp: "上移",
|
|
moveDown: "下移",
|
|
link: "连接",
|
|
clickTips: "请点击目标节点",
|
|
summary: "摘要"
|
|
}, xe = {
|
|
cn: be,
|
|
zh_CN: be,
|
|
zh_TW: {
|
|
addChild: "插入子節點",
|
|
addParent: "插入父節點",
|
|
addSibling: "插入同級節點",
|
|
removeNode: "刪除節點",
|
|
focus: "專注",
|
|
cancelFocus: "取消專注",
|
|
moveUp: "上移",
|
|
moveDown: "下移",
|
|
link: "連接",
|
|
clickTips: "請點擊目標節點",
|
|
summary: "摘要"
|
|
},
|
|
en: {
|
|
addChild: "Add child",
|
|
addParent: "Add parent",
|
|
addSibling: "Add sibling",
|
|
removeNode: "Remove node",
|
|
focus: "Focus Mode",
|
|
cancelFocus: "Cancel Focus Mode",
|
|
moveUp: "Move up",
|
|
moveDown: "Move down",
|
|
link: "Link",
|
|
clickTips: "Please click the target node",
|
|
summary: "Summary"
|
|
},
|
|
ru: {
|
|
addChild: "Добавить дочерний элемент",
|
|
addParent: "Добавить родительский элемент",
|
|
addSibling: "Добавить на этом уровне",
|
|
removeNode: "Удалить узел",
|
|
focus: "Режим фокусировки",
|
|
cancelFocus: "Отменить режим фокусировки",
|
|
moveUp: "Поднять выше",
|
|
moveDown: "Опустить ниже",
|
|
link: "Ссылка",
|
|
clickTips: "Пожалуйста, нажмите на целевой узел",
|
|
summary: "Описание"
|
|
},
|
|
ja: {
|
|
addChild: "子ノードを追加する",
|
|
addParent: "親ノードを追加します",
|
|
addSibling: "兄弟ノードを追加する",
|
|
removeNode: "ノードを削除",
|
|
focus: "集中",
|
|
cancelFocus: "集中解除",
|
|
moveUp: "上へ移動",
|
|
moveDown: "下へ移動",
|
|
link: "コネクト",
|
|
clickTips: "ターゲットノードをクリックしてください",
|
|
summary: "概要"
|
|
},
|
|
pt: {
|
|
addChild: "Adicionar item filho",
|
|
addParent: "Adicionar item pai",
|
|
addSibling: "Adicionar item irmao",
|
|
removeNode: "Remover item",
|
|
focus: "Modo Foco",
|
|
cancelFocus: "Cancelar Modo Foco",
|
|
moveUp: "Mover para cima",
|
|
moveDown: "Mover para baixo",
|
|
link: "Link",
|
|
clickTips: "Favor clicar no item alvo",
|
|
summary: "Resumo"
|
|
},
|
|
it: {
|
|
addChild: "Aggiungi figlio",
|
|
addParent: "Aggiungi genitore",
|
|
addSibling: "Aggiungi fratello",
|
|
removeNode: "Rimuovi nodo",
|
|
focus: "Modalità Focus",
|
|
cancelFocus: "Annulla Modalità Focus",
|
|
moveUp: "Sposta su",
|
|
moveDown: "Sposta giù",
|
|
link: "Collega",
|
|
clickTips: "Si prega di fare clic sul nodo di destinazione",
|
|
summary: "Unisci nodi"
|
|
},
|
|
es: {
|
|
addChild: "Agregar hijo",
|
|
addParent: "Agregar padre",
|
|
addSibling: "Agregar hermano",
|
|
removeNode: "Eliminar nodo",
|
|
focus: "Modo Enfoque",
|
|
cancelFocus: "Cancelar Modo Enfoque",
|
|
moveUp: "Mover hacia arriba",
|
|
moveDown: "Mover hacia abajo",
|
|
link: "Enlace",
|
|
clickTips: "Por favor haga clic en el nodo de destino",
|
|
summary: "Resumen"
|
|
},
|
|
fr: {
|
|
addChild: "Ajout enfant",
|
|
addParent: "Ajout parent",
|
|
addSibling: "Ajout voisin",
|
|
removeNode: "Supprimer",
|
|
focus: "Cibler",
|
|
cancelFocus: "Retour",
|
|
moveUp: "Monter",
|
|
moveDown: "Descendre",
|
|
link: "Lier",
|
|
clickTips: "Cliquer sur le noeud cible",
|
|
summary: "Annoter"
|
|
},
|
|
ko: {
|
|
addChild: "자식 추가",
|
|
addParent: "부모 추가",
|
|
addSibling: "형제 추가",
|
|
removeNode: "노드 삭제",
|
|
focus: "포커스 모드",
|
|
cancelFocus: "포커스 모드 취소",
|
|
moveUp: "위로 이동",
|
|
moveDown: "아래로 이동",
|
|
link: "연결",
|
|
clickTips: "대상 노드를 클릭하십시오",
|
|
summary: "요약"
|
|
}
|
|
};
|
|
function mt(e, t) {
|
|
const n = (b) => {
|
|
const x = document.createElement("div");
|
|
return x.innerText = b, x.className = "tips", x;
|
|
}, o = (b, x, w) => {
|
|
const S = document.createElement("li");
|
|
return S.id = b, S.innerHTML = `<span>${ne(x)}</span><span ${w ? 'class="key"' : ""}>${ne(w)}</span>`, S;
|
|
}, s = xe[e.locale] ? e.locale : "en", i = xe[s], r = o("cm-add_child", i.addChild, "Tab"), c = o("cm-add_parent", i.addParent, "Ctrl + Enter"), l = o("cm-add_sibling", i.addSibling, "Enter"), u = o("cm-remove_child", i.removeNode, "Delete"), d = o("cm-fucus", i.focus, ""), a = o("cm-unfucus", i.cancelFocus, ""), p = o("cm-up", i.moveUp, "PgUp"), g = o("cm-down", i.moveDown, "Pgdn"), f = o("cm-link", i.link, ""), m = o("cm-summary", i.summary, ""), h = document.createElement("ul");
|
|
if (h.className = "menu-list", h.appendChild(r), h.appendChild(c), h.appendChild(l), h.appendChild(u), (!t || t.focus) && (h.appendChild(d), h.appendChild(a)), h.appendChild(p), h.appendChild(g), h.appendChild(m), (!t || t.link) && h.appendChild(f), t && t.extend)
|
|
for (let b = 0; b < t.extend.length; b++) {
|
|
const x = t.extend[b], w = o(x.name, x.name, x.key || "");
|
|
h.appendChild(w), w.onclick = (S) => {
|
|
x.onclick(S);
|
|
};
|
|
}
|
|
const v = document.createElement("div");
|
|
v.className = "context-menu", v.appendChild(h), v.hidden = !0, e.container.append(v);
|
|
let y = !0;
|
|
return e.container.oncontextmenu = function(b) {
|
|
if (b.preventDefault(), !e.editable)
|
|
return;
|
|
const x = b.target;
|
|
if (le(x)) {
|
|
x.parentElement.tagName === "ME-ROOT" ? y = !0 : y = !1, y ? (d.className = "disabled", p.className = "disabled", g.className = "disabled", c.className = "disabled", l.className = "disabled", u.className = "disabled") : (d.className = "", p.className = "", g.className = "", c.className = "", l.className = "", u.className = ""), e.currentNodes || e.selectNode(x), v.hidden = !1, k.mousedown && (k.mousedown = !1), h.style.top = "", h.style.bottom = "", h.style.left = "", h.style.right = "";
|
|
const w = h.getBoundingClientRect(), S = h.offsetHeight, O = h.offsetWidth, W = b.clientY - w.top, P = b.clientX - w.left;
|
|
S + W > window.innerHeight ? (h.style.top = "", h.style.bottom = "0px") : (h.style.bottom = "", h.style.top = W + 15 + "px"), O + P > window.innerWidth ? (h.style.left = "", h.style.right = "0px") : (h.style.right = "", h.style.left = P + 10 + "px");
|
|
}
|
|
}, v.onclick = (b) => {
|
|
b.target === v && (v.hidden = !0);
|
|
}, r.onclick = () => {
|
|
e.addChild(), v.hidden = !0;
|
|
}, c.onclick = () => {
|
|
e.insertParent(), v.hidden = !0;
|
|
}, l.onclick = () => {
|
|
y || (e.insertSibling("after"), v.hidden = !0);
|
|
}, u.onclick = () => {
|
|
y || (e.removeNode(), v.hidden = !0);
|
|
}, d.onclick = () => {
|
|
y || (e.focusNode(e.currentNode), v.hidden = !0);
|
|
}, a.onclick = () => {
|
|
e.cancelFocus(), v.hidden = !0;
|
|
}, p.onclick = () => {
|
|
y || (e.moveUpNode(), v.hidden = !0);
|
|
}, g.onclick = () => {
|
|
y || (e.moveDownNode(), v.hidden = !0);
|
|
}, f.onclick = () => {
|
|
v.hidden = !0;
|
|
const b = e.currentNode, x = n(i.clickTips);
|
|
e.container.appendChild(x), e.map.addEventListener(
|
|
"click",
|
|
(w) => {
|
|
w.preventDefault(), x.remove();
|
|
const S = w.target;
|
|
(S.parentElement.tagName === "ME-PARENT" || S.parentElement.tagName === "ME-ROOT") && e.createArrow(b, S);
|
|
},
|
|
{
|
|
once: !0
|
|
}
|
|
);
|
|
}, m.onclick = () => {
|
|
v.hidden = !0, e.createSummary(), e.unselectNodes();
|
|
}, () => {
|
|
r.onclick = null, c.onclick = null, l.onclick = null, u.onclick = null, d.onclick = null, a.onclick = null, p.onclick = null, g.onclick = null, f.onclick = null, m.onclick = null, v.onclick = null, e.container.oncontextmenu = null;
|
|
};
|
|
}
|
|
const gt = (e) => {
|
|
const t = e.map.querySelectorAll(".lhs>me-wrapper>me-parent>me-tpc");
|
|
e.selectNode(t[Math.ceil(t.length / 2) - 1]);
|
|
}, vt = (e) => {
|
|
const t = e.map.querySelectorAll(".rhs>me-wrapper>me-parent>me-tpc");
|
|
e.selectNode(t[Math.ceil(t.length / 2) - 1]);
|
|
}, yt = (e) => {
|
|
e.selectNode(e.map.querySelector("me-root>me-tpc"));
|
|
}, bt = function(e, t) {
|
|
const n = t.parentElement.parentElement.parentElement.previousSibling;
|
|
if (n) {
|
|
const o = n.firstChild;
|
|
e.selectNode(o);
|
|
}
|
|
}, xt = function(e, t) {
|
|
const n = t.parentElement.nextSibling;
|
|
if (n && n.firstChild) {
|
|
const o = n.firstChild.firstChild.firstChild;
|
|
e.selectNode(o);
|
|
}
|
|
}, we = function(e, t) {
|
|
var i, r;
|
|
const n = e.currentNode || ((i = e.currentNodes) == null ? void 0 : i[0]);
|
|
if (!n)
|
|
return;
|
|
const o = n.nodeObj, s = n.offsetParent.offsetParent.parentElement;
|
|
o.parent ? s.className === t ? xt(e, n) : (r = o.parent) != null && r.parent ? bt(e, n) : yt(e) : t === "lhs" ? gt(e) : vt(e);
|
|
}, Ee = function(e, t) {
|
|
var r;
|
|
const n = e.currentNode || ((r = e.currentNodes) == null ? void 0 : r[0]);
|
|
if (!n || !n.nodeObj.parent)
|
|
return;
|
|
const s = t + "Sibling", i = n.parentElement.parentElement[s];
|
|
i && e.selectNode(i.firstChild.firstChild);
|
|
}, Z = function(e, t, n = 1) {
|
|
switch (t) {
|
|
case "in":
|
|
if (e.scaleVal * n > 1.6)
|
|
return;
|
|
e.scale(e.scaleVal += 0.2);
|
|
break;
|
|
case "out":
|
|
if (e.scaleVal * n < 0.6)
|
|
return;
|
|
e.scale(e.scaleVal -= 0.2);
|
|
}
|
|
};
|
|
function wt(e) {
|
|
const t = () => {
|
|
e.currentArrow ? e.removeArrow() : e.currentSummary ? e.removeSummary(e.currentSummary.summaryObj.id) : e.currentNode ? e.removeNode() : e.currentNodes && e.removeNodes(e.currentNodes);
|
|
}, n = {
|
|
Enter: (o) => {
|
|
o.shiftKey ? e.insertSibling("before") : o.ctrlKey ? e.insertParent() : e.insertSibling("after");
|
|
},
|
|
Tab: () => {
|
|
e.addChild();
|
|
},
|
|
F1: () => {
|
|
e.toCenter();
|
|
},
|
|
F2: () => {
|
|
e.beginEdit();
|
|
},
|
|
ArrowUp: (o) => {
|
|
if (o.altKey)
|
|
e.moveUpNode();
|
|
else {
|
|
if (o.metaKey || o.ctrlKey)
|
|
return e.initSide();
|
|
Ee(e, "previous");
|
|
}
|
|
},
|
|
ArrowDown: (o) => {
|
|
o.altKey ? e.moveDownNode() : Ee(e, "next");
|
|
},
|
|
ArrowLeft: (o) => {
|
|
if (o.metaKey || o.ctrlKey)
|
|
return e.initLeft();
|
|
we(e, "lhs");
|
|
},
|
|
ArrowRight: (o) => {
|
|
if (o.metaKey || o.ctrlKey)
|
|
return e.initRight();
|
|
we(e, "rhs");
|
|
},
|
|
PageUp: () => e.moveUpNode(),
|
|
PageDown: () => {
|
|
e.moveDownNode();
|
|
},
|
|
c: (o) => {
|
|
(o.metaKey || o.ctrlKey) && (e.currentNode ? e.waitCopy = [e.currentNode] : e.currentNodes && (e.waitCopy = e.currentNodes));
|
|
},
|
|
x: (o) => {
|
|
(o.metaKey || o.ctrlKey) && (e.currentNode ? e.waitCopy = [e.currentNode] : e.currentNodes && (e.waitCopy = e.currentNodes), t());
|
|
},
|
|
v: (o) => {
|
|
!e.waitCopy || !e.currentNode || (o.metaKey || o.ctrlKey) && (e.waitCopy.length === 1 ? e.copyNode(e.waitCopy[0], e.currentNode) : e.copyNodes(e.waitCopy, e.currentNode));
|
|
},
|
|
"+": (o) => {
|
|
(o.metaKey || o.ctrlKey) && Z(e, "in");
|
|
},
|
|
"-": (o) => {
|
|
(o.metaKey || o.ctrlKey) && Z(e, "out");
|
|
},
|
|
0: (o) => {
|
|
(o.metaKey || o.ctrlKey) && e.scale(1);
|
|
},
|
|
Delete: t,
|
|
Backspace: t
|
|
};
|
|
e.map.onkeydown = (o) => {
|
|
if (o.preventDefault(), !e.editable || o.target !== o.currentTarget)
|
|
return;
|
|
const s = n[o.key];
|
|
s && s(o);
|
|
}, e.map.onwheel = (o) => {
|
|
if (o.ctrlKey || o.metaKey) {
|
|
o.preventDefault();
|
|
const s = Math.abs(o.deltaY / 100);
|
|
o.deltaY < 0 ? Z(e, "in", s) : e.scaleVal - 0.2 > 0 && Z(e, "out", s), o.stopPropagation();
|
|
}
|
|
};
|
|
}
|
|
const ae = document, Et = function(e, t) {
|
|
if (!t)
|
|
return de(e), e;
|
|
let n = e.querySelector(".insert-preview");
|
|
const o = `insert-preview ${t} show`;
|
|
return n || (n = ae.createElement("div"), e.appendChild(n)), n.className = o, e;
|
|
}, de = function(e) {
|
|
if (!e)
|
|
return;
|
|
const t = e.querySelectorAll(".insert-preview");
|
|
for (const n of t || [])
|
|
n.remove();
|
|
}, Ne = function(e, t) {
|
|
for (const n of t) {
|
|
const o = n.parentElement.parentElement.contains(e);
|
|
if (!(e && e.tagName === "ME-TPC" && e !== n && !o && e.nodeObj.parent))
|
|
return !1;
|
|
}
|
|
return !0;
|
|
}, Nt = function(e) {
|
|
const t = document.createElement("div");
|
|
return t.className = "mind-elixir-ghost", e.map.appendChild(t), t;
|
|
};
|
|
function Ct(e) {
|
|
let t = null, n = null, o = null;
|
|
const s = Nt(e), i = 12;
|
|
e.map.addEventListener("dragstart", (r) => {
|
|
var l, u;
|
|
const c = r.target;
|
|
if ((c == null ? void 0 : c.tagName) !== "ME-TPC") {
|
|
r.preventDefault();
|
|
return;
|
|
}
|
|
(l = e.currentNodes) != null && l.includes(c) || (e.unselectNodes(), e.selectNode(c)), e.currentNodes ? (t = e.currentNodes, s.innerHTML = e.currentNodes.length + " nodes") : (t = [c], s.innerHTML = c.innerHTML);
|
|
for (const d of t)
|
|
d.parentElement.parentElement.style.opacity = "0.5";
|
|
(u = r.dataTransfer) == null || u.setDragImage(s, 0, 0), k.clear();
|
|
}), e.map.addEventListener("dragend", async (r) => {
|
|
if (!t)
|
|
return;
|
|
for (const l of t)
|
|
l.parentElement.parentElement.style.opacity = "1";
|
|
const c = r.target;
|
|
c.style.opacity = "", o && (de(o), n === "before" ? e.moveNodeBefore(t, o) : n === "after" ? e.moveNodeAfter(t, o) : n === "in" && e.moveNodeIn(t, o), t = null);
|
|
}), e.map.addEventListener(
|
|
"dragover",
|
|
tt(function(r) {
|
|
if (!t)
|
|
return;
|
|
de(o);
|
|
const c = ae.elementFromPoint(r.clientX, r.clientY - i);
|
|
if (Ne(c, t)) {
|
|
o = c;
|
|
const l = c.getBoundingClientRect().y;
|
|
r.clientY > l + c.clientHeight ? n = "after" : n = "in";
|
|
} else {
|
|
const l = ae.elementFromPoint(r.clientX, r.clientY + i);
|
|
if (Ne(l, t)) {
|
|
o = l;
|
|
const u = l.getBoundingClientRect().y;
|
|
r.clientY < u ? n = "before" : n = "in";
|
|
} else
|
|
n = o = null;
|
|
}
|
|
o && Et(o, n);
|
|
}, 100)
|
|
);
|
|
}
|
|
const St = function(e) {
|
|
return ["createSummary", "removeSummary", "finishEditSummary"].includes(e.name) ? {
|
|
type: "summary",
|
|
value: e.obj.id
|
|
} : ["createArrow", "removeArrow", "finishEditArrowLabel"].includes(e.name) ? {
|
|
type: "arrow",
|
|
value: e.obj.id
|
|
} : ["removeNodes", "copyNodes", "moveNodeBefore", "moveNodeAfter", "moveNodeIn"].includes(e.name) ? {
|
|
type: "nodes",
|
|
value: e.objs.map((t) => t.id)
|
|
} : {
|
|
type: "node",
|
|
value: e.obj.id
|
|
};
|
|
};
|
|
function _t(e) {
|
|
let t = [], n = -1, o = e.getData();
|
|
e.bus.addListener("operation", (s) => {
|
|
if (s.name === "beginEdit")
|
|
return;
|
|
t = t.slice(0, n + 1);
|
|
const i = e.getData();
|
|
t.push({ prev: o, currentObject: St(s), next: i }), o = i, n = t.length - 1;
|
|
}), e.undo = function() {
|
|
if (n > -1) {
|
|
const s = t[n];
|
|
o = s.prev, e.refresh(s.prev);
|
|
try {
|
|
s.currentObject.type === "node" ? e.selectNode(C(s.currentObject.value)) : s.currentObject.type === "nodes" && e.selectNodes(s.currentObject.value.map((i) => C(i)));
|
|
} catch {
|
|
} finally {
|
|
n--;
|
|
}
|
|
}
|
|
}, e.redo = function() {
|
|
if (n < t.length - 1) {
|
|
n++;
|
|
const s = t[n];
|
|
o = s.next, e.refresh(s.next), s.currentObject.type === "node" ? e.selectNode(C(s.currentObject.value)) : s.currentObject.type === "nodes" && e.selectNodes(s.currentObject.value.map((i) => C(i)));
|
|
}
|
|
}, e.map.addEventListener("keydown", (s) => {
|
|
(s.metaKey || s.ctrlKey) && s.shiftKey && s.key === "Z" ? e.redo() : (s.metaKey || s.ctrlKey) && s.key === "z" && e.undo();
|
|
});
|
|
}
|
|
const R = (e, t) => {
|
|
const n = document.createElement("span");
|
|
return n.id = e, n.innerHTML = `<svg class="icon" aria-hidden="true">
|
|
<use xlink:href="#icon-${t}"></use>
|
|
</svg>`, n;
|
|
};
|
|
function Mt(e) {
|
|
const t = document.createElement("div"), n = R("fullscreen", "full"), o = R("toCenter", "living"), s = R("zoomout", "move"), i = R("zoomin", "add"), r = document.createElement("span");
|
|
return r.innerText = "100%", t.appendChild(n), t.appendChild(o), t.appendChild(s), t.appendChild(i), t.className = "mind-elixir-toolbar rb", n.onclick = () => {
|
|
e.mindElixirBox.requestFullscreen();
|
|
}, o.onclick = () => {
|
|
e.toCenter();
|
|
}, s.onclick = () => {
|
|
e.scaleVal < 0.6 || e.scale(e.scaleVal - 0.2);
|
|
}, i.onclick = () => {
|
|
e.scaleVal > 1.6 || e.scale(e.scaleVal + 0.2);
|
|
}, t;
|
|
}
|
|
function kt(e) {
|
|
const t = document.createElement("div"), n = R("tbltl", "left"), o = R("tbltr", "right"), s = R("tblts", "side");
|
|
return t.appendChild(n), t.appendChild(o), t.appendChild(s), t.className = "mind-elixir-toolbar lt", n.onclick = () => {
|
|
e.initLeft();
|
|
}, o.onclick = () => {
|
|
e.initRight();
|
|
}, s.onclick = () => {
|
|
e.initSide();
|
|
}, t;
|
|
}
|
|
function Tt(e) {
|
|
e.container.append(Mt(e)), e.container.append(kt(e));
|
|
}
|
|
/*! @viselect/vanilla v3.6.0 MIT | https://github.com/Simonwep/selection/tree/master/packages/vanilla */
|
|
var Lt = Object.defineProperty, At = (e, t, n) => t in e ? Lt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, E = (e, t, n) => At(e, typeof t != "symbol" ? t + "" : t, n);
|
|
class jt {
|
|
constructor() {
|
|
E(this, "_listeners", /* @__PURE__ */ new Map()), E(this, "on", this.addEventListener), E(this, "off", this.removeEventListener), E(this, "emit", this.dispatchEvent);
|
|
}
|
|
addEventListener(t, n) {
|
|
const o = this._listeners.get(t) ?? /* @__PURE__ */ new Set();
|
|
return this._listeners.set(t, o), o.add(n), this;
|
|
}
|
|
removeEventListener(t, n) {
|
|
var o;
|
|
return (o = this._listeners.get(t)) == null || o.delete(n), this;
|
|
}
|
|
dispatchEvent(t, ...n) {
|
|
let o = !0;
|
|
for (const s of this._listeners.get(t) ?? [])
|
|
o = s(...n) !== !1 && o;
|
|
return o;
|
|
}
|
|
unbindAllListeners() {
|
|
this._listeners.clear();
|
|
}
|
|
}
|
|
const Ce = (e, t = "px") => typeof e == "number" ? e + t : e;
|
|
function j({ style: e }, t, n) {
|
|
if (typeof t == "object")
|
|
for (const [o, s] of Object.entries(t))
|
|
s !== void 0 && (e[o] = Ce(s));
|
|
else
|
|
n !== void 0 && (e[t] = Ce(n));
|
|
}
|
|
const Fe = (e) => (t, n, o, s = {}) => {
|
|
t instanceof HTMLCollection || t instanceof NodeList ? t = Array.from(t) : Array.isArray(t) || (t = [t]), Array.isArray(n) || (n = [n]);
|
|
for (const i of t)
|
|
if (i)
|
|
for (const r of n)
|
|
i[e](r, o, { capture: !1, ...s });
|
|
return [t, n, o, s];
|
|
}, B = Fe("addEventListener"), L = Fe("removeEventListener"), Q = (e) => {
|
|
var t;
|
|
const { clientX: n, clientY: o, target: s } = ((t = e.touches) == null ? void 0 : t[0]) ?? e;
|
|
return { x: n, y: o, target: s };
|
|
};
|
|
function Se(e, t, n = "touch") {
|
|
switch (n) {
|
|
case "center": {
|
|
const o = t.left + t.width / 2, s = t.top + t.height / 2;
|
|
return o >= e.left && o <= e.right && s >= e.top && s <= e.bottom;
|
|
}
|
|
case "cover":
|
|
return t.left >= e.left && t.top >= e.top && t.right <= e.right && t.bottom <= e.bottom;
|
|
case "touch":
|
|
return e.right >= t.left && e.left <= t.right && e.bottom >= t.top && e.top <= t.bottom;
|
|
}
|
|
}
|
|
function F(e, t = document) {
|
|
const n = Array.isArray(e) ? e : [e];
|
|
let o = [];
|
|
for (let s = 0, i = n.length; s < i; s++) {
|
|
const r = n[s];
|
|
typeof r == "string" ? o = o.concat(Array.from(t.querySelectorAll(r))) : r instanceof Element && o.push(r);
|
|
}
|
|
return o;
|
|
}
|
|
const Dt = () => matchMedia("(hover: none), (pointer: coarse)").matches, $t = () => "safari" in window, Ot = (e) => {
|
|
let t, n = -1, o = !1;
|
|
return {
|
|
next(...s) {
|
|
t = s, o || (o = !0, n = requestAnimationFrame(() => {
|
|
e(...t), o = !1;
|
|
}));
|
|
},
|
|
cancel() {
|
|
cancelAnimationFrame(n), o = !1;
|
|
}
|
|
};
|
|
};
|
|
function Pt(e, t) {
|
|
for (const n of t) {
|
|
if (typeof n == "number")
|
|
return e.button === n;
|
|
if (typeof n == "object") {
|
|
const o = n.button === e.button, s = n.modifiers.every((i) => {
|
|
switch (i) {
|
|
case "alt":
|
|
return e.altKey;
|
|
case "ctrl":
|
|
return e.ctrlKey || e.metaKey;
|
|
case "shift":
|
|
return e.shiftKey;
|
|
}
|
|
});
|
|
return o && s;
|
|
}
|
|
}
|
|
return !1;
|
|
}
|
|
const { abs: H, max: _e, min: Me, ceil: ke } = Math, Te = (e = []) => ({
|
|
stored: e,
|
|
selected: [],
|
|
touched: [],
|
|
changed: { added: [], removed: [] }
|
|
});
|
|
class qe extends jt {
|
|
constructor(t) {
|
|
var n, o, s, i, r;
|
|
super(), E(this, "_options"), E(this, "_selection", Te()), E(this, "_area"), E(this, "_clippingElement"), E(this, "_targetElement"), E(this, "_targetBoundary"), E(this, "_targetBoundaryScrolled", !0), E(this, "_targetRect"), E(this, "_selectables", []), E(this, "_latestElement"), E(this, "_areaLocation", { y1: 0, x2: 0, y2: 0, x1: 0 }), E(this, "_areaRect", new DOMRect()), E(this, "_singleClick", !0), E(this, "_frame"), E(this, "_scrollAvailable", !0), E(this, "_scrollingActive", !1), E(this, "_scrollSpeed", { x: 0, y: 0 }), E(this, "_scrollDelta", { x: 0, y: 0 }), E(this, "disable", this._toggleStartEvents.bind(this, !1)), E(this, "enable", this._toggleStartEvents), this._options = {
|
|
selectionAreaClass: "selection-area",
|
|
selectionContainerClass: void 0,
|
|
selectables: [],
|
|
document: window.document,
|
|
startAreas: ["html"],
|
|
boundaries: ["html"],
|
|
container: "body",
|
|
...t,
|
|
behaviour: {
|
|
overlap: "invert",
|
|
intersect: "touch",
|
|
triggers: [0],
|
|
...t.behaviour,
|
|
startThreshold: (n = t.behaviour) != null && n.startThreshold ? typeof t.behaviour.startThreshold == "number" ? t.behaviour.startThreshold : { x: 10, y: 10, ...t.behaviour.startThreshold } : { x: 10, y: 10 },
|
|
scrolling: {
|
|
speedDivider: 10,
|
|
manualSpeed: 750,
|
|
...(o = t.behaviour) == null ? void 0 : o.scrolling,
|
|
startScrollMargins: {
|
|
x: 0,
|
|
y: 0,
|
|
...(i = (s = t.behaviour) == null ? void 0 : s.scrolling) == null ? void 0 : i.startScrollMargins
|
|
}
|
|
}
|
|
},
|
|
features: {
|
|
range: !0,
|
|
touch: !0,
|
|
deselectOnBlur: !1,
|
|
...t.features,
|
|
singleTap: {
|
|
allow: !0,
|
|
intersect: "native",
|
|
...(r = t.features) == null ? void 0 : r.singleTap
|
|
}
|
|
}
|
|
};
|
|
for (const d of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))
|
|
typeof this[d] == "function" && (this[d] = this[d].bind(this));
|
|
const { document: c, selectionAreaClass: l, selectionContainerClass: u } = this._options;
|
|
this._area = c.createElement("div"), this._clippingElement = c.createElement("div"), this._clippingElement.appendChild(this._area), this._area.classList.add(l), u && this._clippingElement.classList.add(u), j(this._area, {
|
|
willChange: "top, left, bottom, right, width, height",
|
|
top: 0,
|
|
left: 0,
|
|
position: "fixed"
|
|
}), j(this._clippingElement, {
|
|
overflow: "hidden",
|
|
position: "fixed",
|
|
transform: "translate3d(0, 0, 0)",
|
|
// https://stackoverflow.com/a/38268846
|
|
pointerEvents: "none",
|
|
zIndex: "1"
|
|
}), this._frame = Ot((d) => {
|
|
this._recalculateSelectionAreaRect(), this._updateElementSelection(), this._emitEvent("move", d), this._redrawSelectionArea();
|
|
}), this.enable();
|
|
}
|
|
_toggleStartEvents(t = !0) {
|
|
const { document: n, features: o } = this._options, s = t ? B : L;
|
|
s(n, "mousedown", this._onTapStart), o.touch && s(n, "touchstart", this._onTapStart, { passive: !1 });
|
|
}
|
|
_onTapStart(t, n = !1) {
|
|
const { x: o, y: s, target: i } = Q(t), { document: r, startAreas: c, boundaries: l, features: u, behaviour: d } = this._options, a = i.getBoundingClientRect();
|
|
if (t instanceof MouseEvent && !Pt(t, d.triggers))
|
|
return;
|
|
const p = F(c, r), g = F(l, r);
|
|
this._targetElement = g.find(
|
|
(v) => Se(v.getBoundingClientRect(), a)
|
|
);
|
|
const f = t.composedPath(), m = p.find((v) => f.includes(v));
|
|
if (this._targetBoundary = g.find((v) => f.includes(v)), !this._targetElement || !m || !this._targetBoundary || !n && this._emitEvent("beforestart", t) === !1)
|
|
return;
|
|
this._areaLocation = { x1: o, y1: s, x2: 0, y2: 0 };
|
|
const h = r.scrollingElement ?? r.body;
|
|
this._scrollDelta = { x: h.scrollLeft, y: h.scrollTop }, this._singleClick = !0, this.clearSelection(!1, !0), B(r, ["touchmove", "mousemove"], this._delayedTapMove, { passive: !1 }), B(r, ["mouseup", "touchcancel", "touchend"], this._onTapStop), B(r, "scroll", this._onScroll), u.deselectOnBlur && (this._targetBoundaryScrolled = !1, B(this._targetBoundary, "scroll", this._onStartAreaScroll));
|
|
}
|
|
_onSingleTap(t) {
|
|
const { singleTap: { intersect: n }, range: o } = this._options.features, s = Q(t);
|
|
let i;
|
|
if (n === "native")
|
|
i = s.target;
|
|
else if (n === "touch") {
|
|
this.resolveSelectables();
|
|
const { x: c, y: l } = s;
|
|
i = this._selectables.find((u) => {
|
|
const { right: d, left: a, top: p, bottom: g } = u.getBoundingClientRect();
|
|
return c < d && c > a && l < g && l > p;
|
|
});
|
|
}
|
|
if (!i)
|
|
return;
|
|
for (this.resolveSelectables(); !this._selectables.includes(i); )
|
|
if (i.parentElement)
|
|
i = i.parentElement;
|
|
else {
|
|
this._targetBoundaryScrolled || this.clearSelection();
|
|
return;
|
|
}
|
|
const { stored: r } = this._selection;
|
|
if (this._emitEvent("start", t), t.shiftKey && o && this._latestElement) {
|
|
const c = this._latestElement, [l, u] = c.compareDocumentPosition(i) & 4 ? [i, c] : [c, i], d = [...this._selectables.filter(
|
|
(a) => a.compareDocumentPosition(l) & 4 && a.compareDocumentPosition(u) & 2
|
|
), l, u];
|
|
this.select(d), this._latestElement = c;
|
|
} else
|
|
r.includes(i) && (r.length === 1 || t.ctrlKey || r.every((c) => this._selection.stored.includes(c))) ? this.deselect(i) : (this.select(i), this._latestElement = i);
|
|
}
|
|
_delayedTapMove(t) {
|
|
const { container: n, document: o, behaviour: { startThreshold: s } } = this._options, { x1: i, y1: r } = this._areaLocation, { x: c, y: l } = Q(t);
|
|
if (
|
|
// Single number for both coordinates
|
|
typeof s == "number" && H(c + l - (i + r)) >= s || // Different x and y threshold
|
|
typeof s == "object" && H(c - i) >= s.x || H(l - r) >= s.y
|
|
) {
|
|
if (L(o, ["mousemove", "touchmove"], this._delayedTapMove, { passive: !1 }), this._emitEvent("beforedrag", t) === !1) {
|
|
L(o, ["mouseup", "touchcancel", "touchend"], this._onTapStop);
|
|
return;
|
|
}
|
|
B(o, ["mousemove", "touchmove"], this._onTapMove, { passive: !1 }), j(this._area, "display", "block"), F(n, o)[0].appendChild(this._clippingElement), this.resolveSelectables(), this._singleClick = !1, this._targetRect = this._targetElement.getBoundingClientRect(), this._scrollAvailable = this._targetElement.scrollHeight !== this._targetElement.clientHeight || this._targetElement.scrollWidth !== this._targetElement.clientWidth, this._scrollAvailable && (B(this._targetElement, "wheel", this._manualScroll, { passive: !1 }), this._selectables = this._selectables.filter((u) => this._targetElement.contains(u))), this._setupSelectionArea(), this._emitEvent("start", t), this._onTapMove(t);
|
|
}
|
|
this._handleMoveEvent(t);
|
|
}
|
|
_setupSelectionArea() {
|
|
const { _clippingElement: t, _targetElement: n, _area: o } = this, s = this._targetRect = n.getBoundingClientRect();
|
|
this._scrollAvailable ? (j(t, {
|
|
top: s.top,
|
|
left: s.left,
|
|
width: s.width,
|
|
height: s.height
|
|
}), j(o, {
|
|
marginTop: -s.top,
|
|
marginLeft: -s.left
|
|
})) : (j(t, {
|
|
top: 0,
|
|
left: 0,
|
|
width: "100%",
|
|
height: "100%"
|
|
}), j(o, {
|
|
marginTop: 0,
|
|
marginLeft: 0
|
|
}));
|
|
}
|
|
_onTapMove(t) {
|
|
const { _scrollSpeed: n, _areaLocation: o, _options: s, _frame: i } = this, { speedDivider: r } = s.behaviour.scrolling, c = this._targetElement, { x: l, y: u } = Q(t);
|
|
if (o.x2 = l, o.y2 = u, this._scrollAvailable && !this._scrollingActive && (n.y || n.x)) {
|
|
this._scrollingActive = !0;
|
|
const d = () => {
|
|
if (!n.x && !n.y) {
|
|
this._scrollingActive = !1;
|
|
return;
|
|
}
|
|
const { scrollTop: a, scrollLeft: p } = c;
|
|
n.y && (c.scrollTop += ke(n.y / r), o.y1 -= c.scrollTop - a), n.x && (c.scrollLeft += ke(n.x / r), o.x1 -= c.scrollLeft - p), i.next(t), requestAnimationFrame(d);
|
|
};
|
|
requestAnimationFrame(d);
|
|
} else
|
|
i.next(t);
|
|
this._handleMoveEvent(t);
|
|
}
|
|
_handleMoveEvent(t) {
|
|
const { features: n } = this._options;
|
|
(n.touch && Dt() || this._scrollAvailable && $t()) && t.preventDefault();
|
|
}
|
|
_onScroll() {
|
|
const { _scrollDelta: t, _options: { document: n } } = this, { scrollTop: o, scrollLeft: s } = n.scrollingElement ?? n.body;
|
|
this._areaLocation.x1 += t.x - s, this._areaLocation.y1 += t.y - o, t.x = s, t.y = o, this._setupSelectionArea(), this._frame.next(null);
|
|
}
|
|
_onStartAreaScroll() {
|
|
this._targetBoundaryScrolled = !0, L(this._targetElement, "scroll", this._onStartAreaScroll);
|
|
}
|
|
_manualScroll(t) {
|
|
const { manualSpeed: n } = this._options.behaviour.scrolling, o = t.deltaY ? t.deltaY > 0 ? 1 : -1 : 0, s = t.deltaX ? t.deltaX > 0 ? 1 : -1 : 0;
|
|
this._scrollSpeed.y += o * n, this._scrollSpeed.x += s * n, this._onTapMove(t), t.preventDefault();
|
|
}
|
|
_recalculateSelectionAreaRect() {
|
|
const { _scrollSpeed: t, _areaLocation: n, _targetElement: o, _options: s } = this, { scrollTop: i, scrollHeight: r, clientHeight: c, scrollLeft: l, scrollWidth: u, clientWidth: d } = o, a = this._targetRect, { x1: p, y1: g } = n;
|
|
let { x2: f, y2: m } = n;
|
|
const { behaviour: { scrolling: { startScrollMargins: h } } } = s;
|
|
f < a.left + h.x ? (t.x = l ? -H(a.left - f + h.x) : 0, f = f < a.left ? a.left : f) : f > a.right - h.x ? (t.x = u - l - d ? H(a.left + a.width - f - h.x) : 0, f = f > a.right ? a.right : f) : t.x = 0, m < a.top + h.y ? (t.y = i ? -H(a.top - m + h.y) : 0, m = m < a.top ? a.top : m) : m > a.bottom - h.y ? (t.y = r - i - c ? H(a.top + a.height - m - h.y) : 0, m = m > a.bottom ? a.bottom : m) : t.y = 0;
|
|
const v = Me(p, f), y = Me(g, m), b = _e(p, f), x = _e(g, m);
|
|
this._areaRect = new DOMRect(v, y, b - v, x - y);
|
|
}
|
|
_redrawSelectionArea() {
|
|
const { x: t, y: n, width: o, height: s } = this._areaRect, { style: i } = this._area;
|
|
i.left = `${t}px`, i.top = `${n}px`, i.width = `${o}px`, i.height = `${s}px`;
|
|
}
|
|
_onTapStop(t, n) {
|
|
var o;
|
|
const { document: s, features: i } = this._options, { _singleClick: r } = this;
|
|
L(this._targetElement, "scroll", this._onStartAreaScroll), L(s, ["mousemove", "touchmove"], this._delayedTapMove), L(s, ["touchmove", "mousemove"], this._onTapMove), L(s, ["mouseup", "touchcancel", "touchend"], this._onTapStop), L(s, "scroll", this._onScroll), this._keepSelection(), t && r && i.singleTap.allow ? this._onSingleTap(t) : !r && !n && (this._updateElementSelection(), this._emitEvent("stop", t)), this._scrollSpeed.x = 0, this._scrollSpeed.y = 0, L(this._targetElement, "wheel", this._manualScroll, { passive: !0 }), this._clippingElement.remove(), (o = this._frame) == null || o.cancel(), j(this._area, "display", "none");
|
|
}
|
|
_updateElementSelection() {
|
|
const { _selectables: t, _options: n, _selection: o, _areaRect: s } = this, { stored: i, selected: r, touched: c } = o, { intersect: l, overlap: u } = n.behaviour, d = u === "invert", a = [], p = [], g = [];
|
|
for (let m = 0; m < t.length; m++) {
|
|
const h = t[m];
|
|
if (Se(s, h.getBoundingClientRect(), l)) {
|
|
if (r.includes(h))
|
|
i.includes(h) && !c.includes(h) && c.push(h);
|
|
else if (d && i.includes(h)) {
|
|
g.push(h);
|
|
continue;
|
|
} else
|
|
p.push(h);
|
|
a.push(h);
|
|
}
|
|
}
|
|
d && p.push(...i.filter((m) => !r.includes(m)));
|
|
const f = u === "keep";
|
|
for (let m = 0; m < r.length; m++) {
|
|
const h = r[m];
|
|
!a.includes(h) && !// Check if the user wants to keep previously selected elements, e.g.,
|
|
// not make them part of the current selection as soon as they're touched.
|
|
(f && i.includes(h)) && g.push(h);
|
|
}
|
|
o.selected = a, o.changed = { added: p, removed: g }, this._latestElement = void 0;
|
|
}
|
|
_emitEvent(t, n) {
|
|
return this.emit(t, {
|
|
event: n,
|
|
store: this._selection,
|
|
selection: this
|
|
});
|
|
}
|
|
_keepSelection() {
|
|
const { _options: t, _selection: n } = this, { selected: o, changed: s, touched: i, stored: r } = n, c = o.filter((l) => !r.includes(l));
|
|
switch (t.behaviour.overlap) {
|
|
case "drop": {
|
|
n.stored = [
|
|
...c,
|
|
...r.filter((l) => !i.includes(l))
|
|
// Elements not touched
|
|
];
|
|
break;
|
|
}
|
|
case "invert": {
|
|
n.stored = [
|
|
...c,
|
|
...r.filter((l) => !s.removed.includes(l))
|
|
// Elements not removed from selection
|
|
];
|
|
break;
|
|
}
|
|
case "keep": {
|
|
n.stored = [
|
|
...r,
|
|
...o.filter((l) => !r.includes(l))
|
|
// Newly added
|
|
];
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
/**
|
|
* Manually triggers the start of a selection
|
|
* @param evt A MouseEvent / TouchEvent-like object
|
|
* @param silent If beforestart should be fired,
|
|
*/
|
|
trigger(t, n = !0) {
|
|
this._onTapStart(t, n);
|
|
}
|
|
/**
|
|
* Can be used if during a selection elements have been added.
|
|
* Will update everything that can be selected.
|
|
*/
|
|
resolveSelectables() {
|
|
this._selectables = F(this._options.selectables, this._options.document);
|
|
}
|
|
/**
|
|
* Same as deselecting, but for all elements currently selected.
|
|
* @param includeStored If the store should also get cleared
|
|
* @param quiet If move / stop events should be fired
|
|
*/
|
|
clearSelection(t = !0, n = !1) {
|
|
const { selected: o, stored: s, changed: i } = this._selection;
|
|
i.added = [], i.removed.push(
|
|
...o,
|
|
...t ? s : []
|
|
), n || (this._emitEvent("move", null), this._emitEvent("stop", null)), this._selection = Te(t ? [] : s);
|
|
}
|
|
/**
|
|
* @returns {Array} Selected elements
|
|
*/
|
|
getSelection() {
|
|
return this._selection.stored;
|
|
}
|
|
/**
|
|
* @returns {HTMLElement} The selection area element
|
|
*/
|
|
getSelectionArea() {
|
|
return this._area;
|
|
}
|
|
/**
|
|
* Cancel the current selection process, pass true to fire a stop event after cancel.
|
|
*/
|
|
cancel(t = !1) {
|
|
this._onTapStop(null, !t);
|
|
}
|
|
/**
|
|
* Unbinds all events and removes the area-element.
|
|
*/
|
|
destroy() {
|
|
this.cancel(), this.disable(), this._clippingElement.remove(), super.unbindAllListeners();
|
|
}
|
|
/**
|
|
* Adds elements to the selection
|
|
* @param query - CSS Query, can be an array of queries
|
|
* @param quiet - If this should not trigger the move event
|
|
*/
|
|
select(t, n = !1) {
|
|
const { changed: o, selected: s, stored: i } = this._selection, r = F(t, this._options.document).filter(
|
|
(c) => !s.includes(c) && !i.includes(c)
|
|
);
|
|
return i.push(...r), s.push(...r), o.added.push(...r), o.removed = [], this._latestElement = void 0, n || (this._emitEvent("move", null), this._emitEvent("stop", null)), r;
|
|
}
|
|
/**
|
|
* Removes a particular element from the selection.
|
|
* @param query - CSS Query, can be an array of queries
|
|
* @param quiet - If this should not trigger the move event
|
|
*/
|
|
deselect(t, n = !1) {
|
|
const { selected: o, stored: s, changed: i } = this._selection, r = F(t, this._options.document).filter(
|
|
(c) => o.includes(c) || s.includes(c)
|
|
);
|
|
r.length && (this._selection.stored = s.filter((c) => !r.includes(c)), this._selection.selected = o.filter((c) => !r.includes(c)), this._selection.changed.added = [], this._selection.changed.removed.push(
|
|
...r.filter((c) => !i.removed.includes(c))
|
|
), this._latestElement = void 0, n || (this._emitEvent("move", null), this._emitEvent("stop", null)));
|
|
}
|
|
}
|
|
E(qe, "version", "3.6.0");
|
|
function Bt(e) {
|
|
const t = e.mouseSelectionButton === 2 ? [2] : [0], n = new qe({
|
|
selectables: [".map-container me-tpc"],
|
|
boundaries: [e.container],
|
|
container: e.selectionContainer,
|
|
behaviour: {
|
|
triggers: t,
|
|
// Scroll configuration.
|
|
scrolling: {
|
|
// On scrollable areas the number on px per frame is devided by this amount.
|
|
// Default is 10 to provide a enjoyable scroll experience.
|
|
speedDivider: 10,
|
|
// Browsers handle mouse-wheel events differently, this number will be used as
|
|
// numerator to calculate the mount of px while scrolling manually: manualScrollSpeed / scrollSpeedDivider.
|
|
manualSpeed: 750,
|
|
// This property defines the virtual inset margins from the borders of the container
|
|
// component that, when crossed by the mouse/touch, trigger the scrolling. Useful for
|
|
// fullscreen containers.
|
|
startScrollMargins: { x: 10, y: 10 }
|
|
}
|
|
}
|
|
}).on("beforestart", ({ event: o }) => {
|
|
if (o.target.tagName === "ME-TPC" || o.target.id === "input-box" || o.target.className === "circle")
|
|
return !1;
|
|
const s = n.getSelectionArea();
|
|
return s.style.background = "#4f90f22d", s.style.border = "1px solid #4f90f2", s.parentElement && (s.parentElement.style.zIndex = "9999"), !0;
|
|
}).on("start", ({ event: o }) => {
|
|
!o.ctrlKey && !o.metaKey && (e.clearSelection(), n.clearSelection(!0, !0));
|
|
}).on(
|
|
"move",
|
|
({
|
|
store: {
|
|
changed: { added: o, removed: s }
|
|
}
|
|
}) => {
|
|
k.moved = !0;
|
|
for (const i of o)
|
|
i.classList.add("selected");
|
|
for (const i of s)
|
|
i.classList.remove("selected");
|
|
}
|
|
).on("stop", ({ store: { stored: o } }) => {
|
|
e.selectNodes(o);
|
|
});
|
|
e.selection = n;
|
|
}
|
|
const Ht = function(e, t = !0) {
|
|
this.theme = e;
|
|
const n = this.theme.cssVar, o = Object.keys(n);
|
|
this.mindElixirBox.style.cssText = "";
|
|
for (let s = 0; s < o.length; s++) {
|
|
const i = o[s];
|
|
this.mindElixirBox.style.setProperty(i, n[i]);
|
|
}
|
|
e.cssVar["--gap"] || this.mindElixirBox.style.setProperty("--gap", "30px"), t && this.refresh();
|
|
}, V = (e) => {
|
|
var o;
|
|
const t = (o = e.parent) == null ? void 0 : o.children, n = (t == null ? void 0 : t.indexOf(e)) ?? 0;
|
|
return { siblings: t, index: n };
|
|
};
|
|
function zt(e) {
|
|
const { siblings: t, index: n } = V(e);
|
|
if (t === void 0)
|
|
return;
|
|
const o = t[n];
|
|
n === 0 ? (t[n] = t[t.length - 1], t[t.length - 1] = o) : (t[n] = t[n - 1], t[n - 1] = o);
|
|
}
|
|
function Rt(e) {
|
|
const { siblings: t, index: n } = V(e);
|
|
if (t === void 0)
|
|
return;
|
|
const o = t[n];
|
|
n === t.length - 1 ? (t[n] = t[0], t[0] = o) : (t[n] = t[n + 1], t[n + 1] = o);
|
|
}
|
|
function me(e) {
|
|
const { siblings: t, index: n } = V(e);
|
|
return t === void 0 ? 0 : (t.splice(n, 1), t.length);
|
|
}
|
|
function Ft(e, t, n) {
|
|
const { siblings: o, index: s } = V(n);
|
|
o !== void 0 && (t === "before" ? o.splice(s, 0, e) : o.splice(s + 1, 0, e));
|
|
}
|
|
function qt(e, t) {
|
|
const { siblings: n, index: o } = V(e);
|
|
n !== void 0 && (n[o] = t, t.children = [e]);
|
|
}
|
|
function Ie(e, t, n) {
|
|
if (me(t), e === "in")
|
|
n.children ? n.children.push(t) : n.children = [t];
|
|
else {
|
|
t.direction !== void 0 && (t.direction = n.direction);
|
|
const { siblings: o, index: s } = V(n);
|
|
if (o === void 0)
|
|
return;
|
|
e === "before" ? o.splice(s, 0, t) : o.splice(s + 1, 0, t);
|
|
}
|
|
}
|
|
const It = function(e, t) {
|
|
var n, o;
|
|
if (e === T)
|
|
return T;
|
|
if (e === z)
|
|
return z;
|
|
if (e === re) {
|
|
const s = ((n = document.querySelector(".lhs")) == null ? void 0 : n.childElementCount) || 0, i = ((o = document.querySelector(".rhs")) == null ? void 0 : o.childElementCount) || 0;
|
|
return s <= i ? (t.direction = T, T) : (t.direction = z, z);
|
|
}
|
|
}, Ke = function(e, t, n) {
|
|
var i, r;
|
|
const o = n.children[0].children[0], s = t.parentElement;
|
|
if (s.tagName === "ME-PARENT") {
|
|
if (G(o), s.children[1])
|
|
s.nextSibling.appendChild(n);
|
|
else {
|
|
const c = e.createChildren([n]);
|
|
s.appendChild(pe(!0)), s.insertAdjacentElement("afterend", c);
|
|
}
|
|
e.linkDiv(n.offsetParent);
|
|
} else
|
|
s.tagName === "ME-ROOT" && (It(e.direction, o.nodeObj) === T ? (i = e.container.querySelector(".lhs")) == null || i.appendChild(n) : (r = e.container.querySelector(".rhs")) == null || r.appendChild(n), e.linkDiv());
|
|
}, Ve = function(e, t) {
|
|
const n = e.parentNode;
|
|
if (t === 0) {
|
|
const o = n.parentNode.parentNode;
|
|
o.tagName !== "ME-MAIN" && o.previousSibling.children[1].remove();
|
|
}
|
|
n.parentNode.remove();
|
|
}, We = {
|
|
before: "beforebegin",
|
|
after: "afterend"
|
|
}, G = function(e) {
|
|
const n = e.parentElement.parentElement.lastElementChild;
|
|
(n == null ? void 0 : n.tagName) === "svg" && (n == null || n.remove());
|
|
}, Kt = function(e, t) {
|
|
const n = e.nodeObj, o = ue(n);
|
|
o.style && t.style && (t.style = Object.assign(o.style, t.style));
|
|
const s = Object.assign(n, t);
|
|
fe(e, s), this.linkDiv(), this.bus.fire("operation", {
|
|
name: "reshapeNode",
|
|
obj: s,
|
|
origin: o
|
|
});
|
|
}, ge = function(e, t, n) {
|
|
if (!t)
|
|
return null;
|
|
const o = t.nodeObj;
|
|
o.expanded === !1 && (e.expandNode(t, !0), t = C(o.id));
|
|
const s = n || e.generateNewObj();
|
|
o.children ? o.children.push(s) : o.children = [s], D(e.nodeData);
|
|
const { grp: i, top: r } = e.createWrapper(s);
|
|
return Ke(e, t, i), { newTop: r, newNodeObj: s };
|
|
}, Vt = function(e, t, n) {
|
|
var u, d, a;
|
|
const o = t || this.currentNode;
|
|
if (!o)
|
|
return;
|
|
const s = o.nodeObj;
|
|
if (s.parent) {
|
|
if (!((u = s.parent) != null && u.parent) && ((a = (d = s.parent) == null ? void 0 : d.children) == null ? void 0 : a.length) === 1) {
|
|
this.addChild(C(s.parent.id), n);
|
|
return;
|
|
}
|
|
} else {
|
|
this.addChild();
|
|
return;
|
|
}
|
|
const i = n || this.generateNewObj();
|
|
Ft(i, e, s), D(this.nodeData);
|
|
const r = o.parentElement, { grp: c, top: l } = this.createWrapper(i);
|
|
r.parentElement.insertAdjacentElement(We[e], c), this.linkDiv(c.offsetParent), n || this.editTopic(l.firstChild), this.selectNode(l.firstChild, !0), this.bus.fire("operation", {
|
|
name: "insertSibling",
|
|
type: e,
|
|
obj: i
|
|
});
|
|
}, Wt = function(e, t) {
|
|
const n = e || this.currentNode;
|
|
if (!n)
|
|
return;
|
|
G(n);
|
|
const o = n.nodeObj;
|
|
if (!o.parent)
|
|
return;
|
|
const s = t || this.generateNewObj();
|
|
qt(o, s), D(this.nodeData);
|
|
const i = n.parentElement.parentElement, { grp: r, top: c } = this.createWrapper(s, !0);
|
|
c.appendChild(pe(!0)), i.insertAdjacentElement("afterend", r);
|
|
const l = this.createChildren([i]);
|
|
c.insertAdjacentElement("afterend", l), this.linkDiv(), t || this.editTopic(c.firstChild), this.selectNode(c.firstChild, !0), this.bus.fire("operation", {
|
|
name: "insertParent",
|
|
obj: s
|
|
});
|
|
}, Ut = function(e, t) {
|
|
const n = e || this.currentNode;
|
|
if (!n)
|
|
return;
|
|
const o = ge(this, n, t);
|
|
if (!o)
|
|
return;
|
|
const { newTop: s, newNodeObj: i } = o;
|
|
this.bus.fire("operation", {
|
|
name: "addChild",
|
|
obj: i
|
|
}), t || this.editTopic(s.firstChild), this.selectNode(s.firstChild, !0);
|
|
}, Yt = function(e, t) {
|
|
const n = ue(e.nodeObj);
|
|
he(n);
|
|
const o = ge(this, t, n);
|
|
if (!o)
|
|
return;
|
|
const { newNodeObj: s } = o;
|
|
this.selectNode(C(s.id)), this.bus.fire("operation", {
|
|
name: "copyNode",
|
|
obj: s
|
|
});
|
|
}, Xt = function(e, t) {
|
|
e = ce(e);
|
|
const n = [];
|
|
for (let o = 0; o < e.length; o++) {
|
|
const s = e[o], i = ue(s.nodeObj);
|
|
he(i);
|
|
const r = ge(this, t, i);
|
|
if (!r)
|
|
return;
|
|
const { newNodeObj: c } = r;
|
|
n.push(c);
|
|
}
|
|
this.selectNodes(n.map((o) => C(o.id))), this.bus.fire("operation", {
|
|
name: "copyNodes",
|
|
objs: n
|
|
});
|
|
}, Gt = function(e) {
|
|
const t = e || this.currentNode;
|
|
if (!t)
|
|
return;
|
|
const n = t.nodeObj;
|
|
zt(n);
|
|
const o = t.parentNode.parentNode;
|
|
o.parentNode.insertBefore(o, o.previousSibling), this.linkDiv(), this.bus.fire("operation", {
|
|
name: "moveUpNode",
|
|
obj: n
|
|
});
|
|
}, Jt = function(e) {
|
|
const t = e || this.currentNode;
|
|
if (!t)
|
|
return;
|
|
const n = t.nodeObj;
|
|
Rt(n);
|
|
const o = t.parentNode.parentNode;
|
|
o.nextSibling ? o.nextSibling.insertAdjacentElement("afterend", o) : o.parentNode.prepend(o), this.linkDiv(), this.bus.fire("operation", {
|
|
name: "moveDownNode",
|
|
obj: n
|
|
});
|
|
}, Zt = function(e) {
|
|
var r;
|
|
const t = e || this.currentNode;
|
|
if (!t)
|
|
return;
|
|
const n = t.nodeObj;
|
|
if (!n.parent)
|
|
throw new Error("Can not remove root node");
|
|
const o = n.parent.children, s = o.findIndex((c) => c === n), i = me(n);
|
|
if (Ve(t, i), o.length !== 0) {
|
|
const c = o[s] || o[s - 1];
|
|
this.selectNode(C(c.id));
|
|
} else
|
|
this.selectNode(C(n.parent.id));
|
|
this.linkDiv(), this.bus.fire("operation", {
|
|
name: "removeNode",
|
|
obj: n,
|
|
originIndex: s,
|
|
originParentId: (r = n == null ? void 0 : n.parent) == null ? void 0 : r.id
|
|
});
|
|
}, Qt = function(e) {
|
|
e = ce(e);
|
|
for (const t of e) {
|
|
const n = t.nodeObj;
|
|
if (!n.parent)
|
|
continue;
|
|
const o = me(n);
|
|
Ve(t, o);
|
|
}
|
|
this.linkDiv(), this.bus.fire("operation", {
|
|
name: "removeNodes",
|
|
objs: e.map((t) => t.nodeObj)
|
|
});
|
|
}, en = function(e, t) {
|
|
e = ce(e);
|
|
const n = t.nodeObj;
|
|
n.expanded === !1 && (this.expandNode(t, !0), t = C(n.id));
|
|
for (const o of e) {
|
|
const s = o.nodeObj;
|
|
Ie("in", s, n), D(this.nodeData);
|
|
const i = o.parentElement;
|
|
Ke(this, t, i.parentElement);
|
|
}
|
|
this.linkDiv(), this.bus.fire("operation", {
|
|
name: "moveNodeIn",
|
|
objs: e.map((o) => o.nodeObj),
|
|
toObj: n
|
|
});
|
|
}, Ue = (e, t, n, o) => {
|
|
e = ce(e), t === "after" && (e = e.reverse());
|
|
const s = n.nodeObj;
|
|
for (const i of e) {
|
|
const r = i.nodeObj;
|
|
Ie(t, r, s), D(o.nodeData), G(i);
|
|
const c = i.parentElement.parentNode;
|
|
n.parentElement.parentNode.insertAdjacentElement(We[t], c);
|
|
}
|
|
o.linkDiv(), o.bus.fire("operation", {
|
|
name: t === "before" ? "moveNodeBefore" : "moveNodeAfter",
|
|
objs: e.map((i) => i.nodeObj),
|
|
toObj: s
|
|
});
|
|
}, tn = function(e, t) {
|
|
Ue(e, "before", t, this);
|
|
}, nn = function(e, t) {
|
|
Ue(e, "after", t, this);
|
|
}, on = function(e) {
|
|
const t = e || this.currentNode;
|
|
t && (t.nodeObj.dangerouslySetInnerHTML || this.editTopic(t));
|
|
}, sn = function(e, t) {
|
|
e.text.textContent = t, e.nodeObj.topic = t, this.linkDiv();
|
|
}, Ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
__proto__: null,
|
|
addChild: Ut,
|
|
beginEdit: on,
|
|
copyNode: Yt,
|
|
copyNodes: Xt,
|
|
insertParent: Wt,
|
|
insertSibling: Vt,
|
|
moveDownNode: Jt,
|
|
moveNodeAfter: nn,
|
|
moveNodeBefore: tn,
|
|
moveNodeIn: en,
|
|
moveUpNode: Gt,
|
|
removeNode: Zt,
|
|
removeNodes: Qt,
|
|
reshapeNode: Kt,
|
|
rmSubline: G,
|
|
setNodeTopic: sn
|
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
function Xe(e) {
|
|
return {
|
|
nodeData: e.isFocusMode ? e.nodeDataBackup : e.nodeData,
|
|
arrows: e.arrows,
|
|
summaries: e.summaries,
|
|
direction: e.direction,
|
|
theme: e.theme
|
|
};
|
|
}
|
|
const rn = function(e, t, n) {
|
|
if (e) {
|
|
if (this.clearSelection(), typeof e == "string") {
|
|
const o = C(e);
|
|
return o ? this.selectNode(o) : void 0;
|
|
}
|
|
e.className = "selected", e.scrollIntoView({ block: "nearest", inline: "nearest" }), this.currentNode = e, t ? this.bus.fire("selectNewNode", e.nodeObj) : this.bus.fire("selectNode", e.nodeObj, n);
|
|
}
|
|
}, cn = function() {
|
|
this.currentNode && (this.currentNode.className = ""), this.currentNode = null, this.bus.fire("unselectNode");
|
|
}, ln = function(e) {
|
|
this.clearSelection();
|
|
for (const t of e)
|
|
t.className = "selected";
|
|
this.currentNodes = e, this.bus.fire(
|
|
"selectNodes",
|
|
e.map((t) => t.nodeObj)
|
|
);
|
|
}, an = function() {
|
|
if (this.currentNodes)
|
|
for (const e of this.currentNodes)
|
|
e.classList.remove("selected");
|
|
this.currentNodes = null, this.bus.fire("unselectNodes");
|
|
}, dn = function() {
|
|
this.unselectNode(), this.unselectNodes(), this.unselectSummary(), this.unselectArrow();
|
|
}, hn = function() {
|
|
const e = Xe(this);
|
|
return JSON.stringify(e, (t, n) => {
|
|
if (!(t === "parent" && typeof n != "string"))
|
|
return n;
|
|
});
|
|
}, un = function() {
|
|
return JSON.parse(this.getDataString());
|
|
}, fn = function() {
|
|
const e = Xe(this).nodeData;
|
|
let t = "# " + e.topic + `
|
|
|
|
`;
|
|
function n(o, s) {
|
|
for (let i = 0; i < o.length; i++)
|
|
s <= 6 ? t += "".padStart(s, "#") + " " + o[i].topic + `
|
|
|
|
` : t += "".padStart(s - 7, " ") + "- " + o[i].topic + `
|
|
`, o[i].children && n(o[i].children || [], s + 1);
|
|
}
|
|
return n(e.children || [], 2), t;
|
|
}, pn = function() {
|
|
this.editable = !0;
|
|
}, mn = function() {
|
|
this.editable = !1;
|
|
}, gn = function(e) {
|
|
this.scaleVal = e, this.map.style.transform = "scale(" + e + ")", this.bus.fire("scale", e);
|
|
}, vn = function() {
|
|
this.container.scrollTo(1e4 - this.container.offsetWidth / 2, 1e4 - this.container.offsetHeight / 2);
|
|
}, yn = function(e) {
|
|
e(this);
|
|
}, bn = function(e) {
|
|
e.nodeObj.parent && (this.tempDirection === null && (this.tempDirection = this.direction), this.isFocusMode || (this.nodeDataBackup = this.nodeData, this.isFocusMode = !0), this.nodeData = e.nodeObj, this.initRight(), this.toCenter());
|
|
}, xn = function() {
|
|
this.isFocusMode = !1, this.tempDirection !== null && (this.nodeData = this.nodeDataBackup, this.direction = this.tempDirection, this.tempDirection = null, this.refresh(), this.toCenter());
|
|
}, wn = function() {
|
|
this.direction = 0, this.refresh();
|
|
}, En = function() {
|
|
this.direction = 1, this.refresh();
|
|
}, Nn = function() {
|
|
this.direction = 2, this.refresh();
|
|
}, Cn = function(e) {
|
|
this.locale = e, this.refresh();
|
|
}, Sn = function(e, t) {
|
|
const n = e.nodeObj;
|
|
typeof t == "boolean" ? n.expanded = t : n.expanded !== !1 ? n.expanded = !1 : n.expanded = !0;
|
|
const o = e.parentNode, s = o.children[1];
|
|
if (s.expanded = n.expanded, s.className = n.expanded ? "minus" : "", G(e), n.expanded) {
|
|
const i = this.createChildren(
|
|
n.children.map((r) => this.createWrapper(r).grp)
|
|
);
|
|
o.parentNode.appendChild(i);
|
|
} else
|
|
o.parentNode.children[1].remove();
|
|
this.linkDiv(), this.bus.fire("expandNode", n);
|
|
}, _n = function(e) {
|
|
e && (e = JSON.parse(JSON.stringify(e)), this.nodeData = e.nodeData, this.arrows = e.arrows || [], this.summaries = e.summaries || []), D(this.nodeData), this.layout(), this.linkDiv();
|
|
}, Mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
__proto__: null,
|
|
cancelFocus: xn,
|
|
clearSelection: dn,
|
|
disableEdit: mn,
|
|
enableEdit: pn,
|
|
expandNode: Sn,
|
|
focusNode: bn,
|
|
getData: un,
|
|
getDataMd: fn,
|
|
getDataString: hn,
|
|
initLeft: wn,
|
|
initRight: En,
|
|
initSide: Nn,
|
|
install: yn,
|
|
refresh: _n,
|
|
scale: gn,
|
|
selectNode: rn,
|
|
selectNodes: ln,
|
|
setLocale: Cn,
|
|
toCenter: vn,
|
|
unselectNode: cn,
|
|
unselectNodes: an
|
|
}, Symbol.toStringTag, { value: "Module" })), kn = function(e) {
|
|
return {
|
|
dom: e,
|
|
moved: !1,
|
|
// diffrentiate click and move
|
|
mousedown: !1,
|
|
handleMouseMove(t) {
|
|
this.mousedown && (this.moved = !0, this.cb && this.cb(t.movementX, t.movementY));
|
|
},
|
|
handleMouseDown(t) {
|
|
t.button === 0 && (this.mousedown = !0);
|
|
},
|
|
handleClear(t) {
|
|
this.mousedown = !1;
|
|
},
|
|
cb: null,
|
|
init(t, n) {
|
|
this.cb = n, this.handleClear = this.handleClear.bind(this), this.handleMouseMove = this.handleMouseMove.bind(this), this.handleMouseDown = this.handleMouseDown.bind(this), t.addEventListener("mousemove", this.handleMouseMove), t.addEventListener("mouseleave", this.handleClear), t.addEventListener("mouseup", this.handleClear), this.dom.addEventListener("mousedown", this.handleMouseDown);
|
|
},
|
|
destory(t) {
|
|
t.removeEventListener("mousemove", this.handleMouseMove), t.removeEventListener("mouseleave", this.handleClear), t.removeEventListener("mouseup", this.handleClear), this.dom.removeEventListener("mousedown", this.handleMouseDown);
|
|
},
|
|
clear() {
|
|
this.moved = !1, this.mousedown = !1;
|
|
}
|
|
};
|
|
}, Le = {
|
|
create: kn
|
|
};
|
|
function ie(e, t, n) {
|
|
const { offsetLeft: o, offsetTop: s } = $(e.nodes, t), i = t.offsetWidth, r = t.offsetHeight, c = o + i / 2, l = s + r / 2, u = c + n.x, d = l + n.y;
|
|
return {
|
|
w: i,
|
|
h: r,
|
|
cx: c,
|
|
cy: l,
|
|
ctrlX: u,
|
|
ctrlY: d
|
|
};
|
|
}
|
|
function q(e) {
|
|
let t, n;
|
|
const o = (e.cy - e.ctrlY) / (e.ctrlX - e.cx);
|
|
return o > e.h / e.w || o < -e.h / e.w ? e.cy - e.ctrlY < 0 ? (t = e.cx - e.h / 2 / o, n = e.cy + e.h / 2) : (t = e.cx + e.h / 2 / o, n = e.cy - e.h / 2) : e.cx - e.ctrlX < 0 ? (t = e.cx + e.w / 2, n = e.cy - e.w * o / 2) : (t = e.cx - e.w / 2, n = e.cy + e.w * o / 2), {
|
|
x: t,
|
|
y: n
|
|
};
|
|
}
|
|
const Tn = function(e, t, n, o) {
|
|
const s = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
return N(s, {
|
|
"text-anchor": "middle",
|
|
x: t + "",
|
|
y: n + "",
|
|
fill: o || "#666"
|
|
}), s.dataset.type = "custom-link", s.innerHTML = e, s;
|
|
}, Ge = function(e, t, n, o, s) {
|
|
if (!t || !n)
|
|
return;
|
|
performance.now();
|
|
const i = ie(e, t, o.delta1), r = ie(e, n, o.delta2), { x: c, y: l } = q(i), { ctrlX: u, ctrlY: d } = i, { ctrlX: a, ctrlY: p } = r, { x: g, y: f } = q(r), m = Pe(a, p, g, f), h = ft(
|
|
`M ${c} ${l} C ${u} ${d} ${a} ${p} ${g} ${f}`,
|
|
`M ${m.x1} ${m.y1} L ${g} ${f} L ${m.x2} ${m.y2}`
|
|
), v = c / 8 + u * 3 / 8 + a * 3 / 8 + g / 8, y = l / 8 + d * 3 / 8 + p * 3 / 8 + f / 8, b = Tn(o.label, v, y, e.theme.cssVar["--color"]);
|
|
h.appendChild(b), h.arrowObj = o, h.dataset.linkid = o.id, e.linkSvgGroup.appendChild(h), s || (e.arrows.push(o), e.currentArrow = h, Ze(e, o, i, r)), performance.now();
|
|
}, Ln = function(e, t) {
|
|
const n = {
|
|
id: X(),
|
|
label: "Custom Link",
|
|
from: e.nodeObj.id,
|
|
to: t.nodeObj.id,
|
|
delta1: {
|
|
x: 0,
|
|
y: -200
|
|
},
|
|
delta2: {
|
|
x: 0,
|
|
y: -200
|
|
}
|
|
};
|
|
Ge(this, e, t, n), this.bus.fire("operation", {
|
|
name: "createArrow",
|
|
obj: n
|
|
});
|
|
}, An = function(e) {
|
|
let t;
|
|
if (e ? t = e : t = this.currentArrow, !t)
|
|
return;
|
|
Je(this);
|
|
const n = t.arrowObj.id;
|
|
this.arrows = this.arrows.filter((o) => o.id !== n), t.remove(), this.bus.fire("operation", {
|
|
name: "removeArrow",
|
|
obj: {
|
|
id: n
|
|
}
|
|
});
|
|
}, jn = function(e) {
|
|
this.currentArrow = e;
|
|
const t = e.arrowObj, n = C(t.from), o = C(t.to), s = ie(this, n, t.delta1), i = ie(this, o, t.delta2);
|
|
Ze(this, t, s, i);
|
|
}, Dn = function() {
|
|
this.currentArrow = null, Je(this);
|
|
}, Je = function(e) {
|
|
e.linkController.style.display = "none", e.P2.style.display = "none", e.P3.style.display = "none";
|
|
}, Ze = function(e, t, n, o) {
|
|
var p;
|
|
e.linkController.style.display = "initial", e.P2.style.display = "initial", e.P3.style.display = "initial", e.nodes.appendChild(e.linkController), e.nodes.appendChild(e.P2), e.nodes.appendChild(e.P3);
|
|
let { x: s, y: i } = q(n), { ctrlX: r, ctrlY: c } = n, { ctrlX: l, ctrlY: u } = o, { x: d, y: a } = q(o);
|
|
e.P2.style.cssText = `top:${c}px;left:${r}px;`, e.P3.style.cssText = `top:${u}px;left:${l}px;`, N(e.line1, {
|
|
x1: s + "",
|
|
y1: i + "",
|
|
x2: r + "",
|
|
y2: c + ""
|
|
}), N(e.line2, {
|
|
x1: l + "",
|
|
y1: u + "",
|
|
x2: d + "",
|
|
y2: a + ""
|
|
}), e.helper1 && (e.helper1.destory(e.map), (p = e.helper2) == null || p.destory(e.map)), e.helper1 = Le.create(e.P2), e.helper2 = Le.create(e.P3), e.helper1.init(e.map, (g, f) => {
|
|
var y;
|
|
r = r + g / e.scaleVal, c = c + f / e.scaleVal;
|
|
const m = q({ ...n, ctrlX: r, ctrlY: c });
|
|
s = m.x, i = m.y;
|
|
const h = s / 8 + r * 3 / 8 + l * 3 / 8 + d / 8, v = i / 8 + c * 3 / 8 + u * 3 / 8 + a / 8;
|
|
e.P2.style.top = c + "px", e.P2.style.left = r + "px", (y = e.currentArrow) == null || y.children[0].setAttribute("d", `M ${s} ${i} C ${r} ${c} ${l} ${u} ${d} ${a}`), N(e.currentArrow.children[2], {
|
|
x: h + "",
|
|
y: v + ""
|
|
}), N(e.line1, {
|
|
x1: s + "",
|
|
y1: i + "",
|
|
x2: r + "",
|
|
y2: c + ""
|
|
}), t.delta1.x = r - n.cx, t.delta1.y = c - n.cy;
|
|
}), e.helper2.init(e.map, (g, f) => {
|
|
var b, x;
|
|
l = l + g / e.scaleVal, u = u + f / e.scaleVal;
|
|
const m = q({ ...o, ctrlX: l, ctrlY: u });
|
|
d = m.x, a = m.y;
|
|
const h = s / 8 + r * 3 / 8 + l * 3 / 8 + d / 8, v = i / 8 + c * 3 / 8 + u * 3 / 8 + a / 8, y = Pe(l, u, d, a);
|
|
e.P3.style.top = u + "px", e.P3.style.left = l + "px", (b = e.currentArrow) == null || b.children[0].setAttribute("d", `M ${s} ${i} C ${r} ${c} ${l} ${u} ${d} ${a}`), (x = e.currentArrow) == null || x.children[1].setAttribute("d", `M ${y.x1} ${y.y1} L ${d} ${a} L ${y.x2} ${y.y2}`), N(e.currentArrow.children[2], {
|
|
x: h + "",
|
|
y: v + ""
|
|
}), N(e.line2, {
|
|
x1: l + "",
|
|
y1: u + "",
|
|
x2: d + "",
|
|
y2: a + ""
|
|
}), t.delta2.x = l - o.cx, t.delta2.y = u - o.cy;
|
|
});
|
|
};
|
|
function $n() {
|
|
this.linkSvgGroup.innerHTML = "";
|
|
for (let e = 0; e < this.arrows.length; e++) {
|
|
const t = this.arrows[e];
|
|
try {
|
|
Ge(this, C(t.from), C(t.to), t, !0);
|
|
} catch {
|
|
}
|
|
}
|
|
this.nodes.appendChild(this.linkSvgGroup);
|
|
}
|
|
function On(e) {
|
|
if (!e)
|
|
return;
|
|
const t = e.children[2];
|
|
ze(this, t, (n) => {
|
|
var i;
|
|
const o = e.arrowObj, s = ((i = n.textContent) == null ? void 0 : i.trim()) || "";
|
|
s === "" ? o.label = origin : o.label = s, n.remove(), s !== origin && (t.innerHTML = o.label, this.linkDiv(), this.bus.fire("operation", {
|
|
name: "finishEditArrowLabel",
|
|
obj: o
|
|
}));
|
|
});
|
|
}
|
|
function Pn() {
|
|
this.arrows = this.arrows.filter((e) => oe(e.from, this.nodeData) && oe(e.to, this.nodeData));
|
|
}
|
|
const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
__proto__: null,
|
|
createArrow: Ln,
|
|
editArrowLabel: On,
|
|
removeArrow: An,
|
|
renderArrow: $n,
|
|
selectArrow: jn,
|
|
tidyArrow: Pn,
|
|
unselectArrow: Dn
|
|
}, Symbol.toStringTag, { value: "Module" })), Hn = function(e) {
|
|
var l, u;
|
|
if (e.length === 0)
|
|
throw new Error("No selected node.");
|
|
if (e.length === 1) {
|
|
const d = e[0].nodeObj, a = e[0].nodeObj.parent;
|
|
if (!a)
|
|
throw new Error("Can not select root node.");
|
|
const p = a.children.findIndex((g) => d === g);
|
|
return {
|
|
parent: a.id,
|
|
start: p,
|
|
end: p
|
|
};
|
|
}
|
|
let t = 0;
|
|
const n = e.map((d) => {
|
|
let a = d.nodeObj;
|
|
const p = [];
|
|
for (; a.parent; ) {
|
|
const g = a.parent, f = g.children, m = f == null ? void 0 : f.indexOf(a);
|
|
a = g, p.unshift({ node: a, index: m });
|
|
}
|
|
return p.length > t && (t = p.length), p;
|
|
});
|
|
let o = 0;
|
|
e:
|
|
for (; o < t; o++) {
|
|
const d = (l = n[0][o]) == null ? void 0 : l.node;
|
|
for (let a = 1; a < n.length; a++)
|
|
if (((u = n[a][o]) == null ? void 0 : u.node) !== d)
|
|
break e;
|
|
}
|
|
if (!o)
|
|
throw new Error("Can not select root node.");
|
|
const s = n.map((d) => d[o - 1].index).sort(), i = s[0] || 0, r = s[s.length - 1] || 0, c = n[0][o - 1].node;
|
|
if (!c.parent)
|
|
throw new Error("Please select nodes in the same main topic.");
|
|
return {
|
|
parent: c.id,
|
|
start: i,
|
|
end: r
|
|
};
|
|
}, zn = function(e) {
|
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
return t.setAttribute("id", e), t;
|
|
}, Ae = function(e, t) {
|
|
const n = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
return N(n, {
|
|
d: e,
|
|
stroke: t || "#666",
|
|
fill: "none",
|
|
"stroke-linecap": "round",
|
|
"stroke-width": "2"
|
|
}), n;
|
|
}, je = function(e, t, n, o, s) {
|
|
const i = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
return N(i, {
|
|
"text-anchor": o,
|
|
x: t + "",
|
|
y: n + "",
|
|
fill: s || "#666"
|
|
}), i.innerHTML = e, i;
|
|
}, Rn = (e) => C(e).parentElement.parentElement, Fn = function({ parent: e, start: t }) {
|
|
var i, r;
|
|
const n = C(e), o = n.nodeObj;
|
|
let s;
|
|
return o.parent ? s = (i = n.closest("me-main")) == null ? void 0 : i.className : s = (r = C(o.children[t].id).closest("me-main")) == null ? void 0 : r.className, s;
|
|
}, Qe = function(e, t) {
|
|
var S;
|
|
const { id: n, text: o, parent: s, start: i, end: r } = t, c = e.nodes, u = C(s).nodeObj, d = Fn(t);
|
|
let a = 1 / 0, p = 0, g = 0, f = 0;
|
|
for (let O = i; O <= r; O++) {
|
|
const W = (S = u.children) == null ? void 0 : S[O];
|
|
if (!W)
|
|
return e.removeSummary(n), null;
|
|
const P = Rn(W.id), { offsetLeft: J, offsetTop: ve } = $(c, P);
|
|
O === i && (g = ve + 20), O === r && (f = ve + P.offsetHeight - 20), J < a && (a = J), P.offsetWidth + J > p && (p = P.offsetWidth + J);
|
|
}
|
|
let m, h;
|
|
const v = g + 10, y = f + 10, b = (v + y) / 2, x = e.theme.cssVar["--color"];
|
|
d === "lhs" ? (m = Ae(`M ${a + 10} ${v} c -5 0 -10 5 -10 10 L ${a} ${y - 10} c 0 5 5 10 10 10 M ${a} ${b} h -10`, x), h = je(o, a - 20, b + 6, "end", x)) : (m = Ae(`M ${p - 10} ${v} c 5 0 10 5 10 10 L ${p} ${y - 10} c 0 5 -5 10 -10 10 M ${p} ${b} h 10`, x), h = je(o, p + 20, b + 6, "start", x));
|
|
const w = zn("s-" + n);
|
|
return w.appendChild(m), w.appendChild(h), w.summaryObj = t, e.summarySvg.appendChild(w), w;
|
|
}, qn = function() {
|
|
let e = [];
|
|
this.currentNode ? e = [this.currentNode] : this.currentNodes && (e = this.currentNodes);
|
|
const { parent: t, start: n, end: o } = Hn(e), s = { id: X(), parent: t, start: n, end: o, text: "summary" }, i = Qe(this, s);
|
|
this.summaries.push(s), this.editSummary(i), this.bus.fire("operation", {
|
|
name: "createSummary",
|
|
obj: s
|
|
});
|
|
}, In = function(e) {
|
|
var n;
|
|
const t = this.summaries.findIndex((o) => o.id === e);
|
|
t > -1 && (this.summaries.splice(t, 1), (n = document.querySelector("#s-" + e)) == null || n.remove()), this.bus.fire("operation", {
|
|
name: "removeSummary",
|
|
obj: { id: e }
|
|
});
|
|
}, Kn = function(e) {
|
|
const t = e.children[1].getBBox(), n = 6, o = 3, s = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
N(s, {
|
|
x: t.x - n + "",
|
|
y: t.y - n + "",
|
|
width: t.width + n * 2 + "",
|
|
height: t.height + n * 2 + "",
|
|
rx: o + "",
|
|
stroke: this.theme.cssVar["--selected"] || "#4dc4ff",
|
|
"stroke-width": "2",
|
|
fill: "none"
|
|
}), s.classList.add("selected"), e.appendChild(s), this.currentSummary = e;
|
|
}, Vn = function() {
|
|
var e, t;
|
|
(t = (e = this.currentSummary) == null ? void 0 : e.querySelector("rect")) == null || t.remove(), this.currentSummary = null;
|
|
}, Wn = function() {
|
|
this.summarySvg.innerHTML = "", this.summaries.forEach((e) => {
|
|
try {
|
|
Qe(this, e);
|
|
} catch {
|
|
}
|
|
}), this.nodes.insertAdjacentElement("beforeend", this.summarySvg);
|
|
}, Un = function(e) {
|
|
if (!e)
|
|
return;
|
|
const t = e.childNodes[1];
|
|
ze(this, t, (n) => {
|
|
var i;
|
|
const o = e.summaryObj, s = ((i = n.textContent) == null ? void 0 : i.trim()) || "";
|
|
s === "" ? o.text = origin : o.text = s, n.remove(), s !== origin && (t.innerHTML = o.text, this.linkDiv(), this.bus.fire("operation", {
|
|
name: "finishEditSummary",
|
|
obj: o
|
|
}));
|
|
});
|
|
}, Yn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
__proto__: null,
|
|
createSummary: qn,
|
|
editSummary: Un,
|
|
removeSummary: In,
|
|
renderSummary: Wn,
|
|
selectSummary: Kn,
|
|
unselectSummary: Vn
|
|
}, Symbol.toStringTag, { value: "Module" })), M = "http://www.w3.org/2000/svg";
|
|
function Xn(e, t) {
|
|
const n = document.createElementNS(M, "svg");
|
|
return N(n, {
|
|
version: "1.1",
|
|
xmlns: M,
|
|
height: e,
|
|
width: t
|
|
}), n;
|
|
}
|
|
function Gn(e, t) {
|
|
return (parseInt(e) - parseInt(t)) / 2;
|
|
}
|
|
function Jn(e, t, n, o) {
|
|
const s = document.createElementNS(M, "g");
|
|
let i = "";
|
|
return e.text ? i = e.text.textContent : i = e.childNodes[0].textContent, i.split(`
|
|
`).forEach((c, l) => {
|
|
const u = document.createElementNS(M, "text");
|
|
N(u, {
|
|
x: n + parseInt(t.paddingLeft) + "",
|
|
y: o + parseInt(t.paddingTop) + Gn(t.lineHeight, t.fontSize) * (l + 1) + parseFloat(t.fontSize) * (l + 1) + "",
|
|
"text-anchor": "start",
|
|
"font-family": t.fontFamily,
|
|
"font-size": `${t.fontSize}`,
|
|
"font-weight": `${t.fontWeight}`,
|
|
fill: `${t.color}`
|
|
}), u.innerHTML = c, s.appendChild(u);
|
|
}), s;
|
|
}
|
|
function Zn(e, t, n, o) {
|
|
var c;
|
|
let s = "";
|
|
(c = e.nodeObj) != null && c.dangerouslySetInnerHTML ? s = e.nodeObj.dangerouslySetInnerHTML : e.text ? s = e.text.textContent : s = e.childNodes[0].textContent;
|
|
const i = document.createElementNS(M, "foreignObject");
|
|
N(i, {
|
|
x: n + parseInt(t.paddingLeft) + "",
|
|
y: o + parseInt(t.paddingTop) + "",
|
|
width: t.width,
|
|
height: t.height
|
|
});
|
|
const r = document.createElement("div");
|
|
return N(r, {
|
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
style: `font-family: ${t.fontFamily}; font-size: ${t.fontSize}; font-weight: ${t.fontWeight}; color: ${t.color}; white-space: pre-wrap;`
|
|
}), r.innerHTML = s, i.appendChild(r), i;
|
|
}
|
|
function Qn(e, t) {
|
|
const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = $(e.nodes, t), i = document.createElementNS(M, "rect");
|
|
return N(i, {
|
|
x: o + "",
|
|
y: s + "",
|
|
rx: n.borderRadius,
|
|
ry: n.borderRadius,
|
|
width: n.width,
|
|
height: n.height,
|
|
fill: n.backgroundColor,
|
|
stroke: n.borderColor,
|
|
"stroke-width": n.borderWidth
|
|
}), i;
|
|
}
|
|
function ee(e, t, n = !1) {
|
|
const o = getComputedStyle(t), { offsetLeft: s, offsetTop: i } = $(e.nodes, t), r = document.createElementNS(M, "rect");
|
|
N(r, {
|
|
x: s + "",
|
|
y: i + "",
|
|
rx: o.borderRadius,
|
|
ry: o.borderRadius,
|
|
width: o.width,
|
|
height: o.height,
|
|
fill: o.backgroundColor,
|
|
stroke: o.borderColor,
|
|
"stroke-width": o.borderWidth
|
|
});
|
|
const c = document.createElementNS(M, "g");
|
|
c.appendChild(r);
|
|
let l;
|
|
return n ? l = Zn(t, o, s, i) : l = Jn(t, o, s, i), c.appendChild(l), c;
|
|
}
|
|
function eo(e, t) {
|
|
const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = $(e.nodes, t), i = document.createElementNS(M, "a"), r = document.createElementNS(M, "text");
|
|
return N(r, {
|
|
x: o + "",
|
|
y: s + parseInt(n.fontSize) + "",
|
|
"text-anchor": "start",
|
|
"font-family": n.fontFamily,
|
|
"font-size": `${n.fontSize}`,
|
|
"font-weight": `${n.fontWeight}`,
|
|
fill: `${n.color}`
|
|
}), r.innerHTML = t.textContent, i.appendChild(r), i.setAttribute("href", t.href), i;
|
|
}
|
|
function to(e, t) {
|
|
const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = $(e.nodes, t), i = document.createElementNS(M, "image");
|
|
return N(i, {
|
|
x: o + "",
|
|
y: s + "",
|
|
width: n.width + "",
|
|
height: n.height + "",
|
|
href: t.src
|
|
}), i;
|
|
}
|
|
const te = 100, no = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">', oo = (e, t = !1) => {
|
|
var a, p, g;
|
|
const n = e.nodes, o = n.offsetHeight + te * 2, s = n.offsetWidth + te * 2, i = Xn(o + "px", s + "px"), r = document.createElementNS(M, "svg"), c = document.createElementNS(M, "rect");
|
|
N(c, {
|
|
x: "0",
|
|
y: "0",
|
|
width: `${s}`,
|
|
height: `${o}`,
|
|
fill: e.theme.cssVar["--bgcolor"]
|
|
}), i.appendChild(c), n.querySelectorAll(".subLines").forEach((f) => {
|
|
const m = f.cloneNode(!0), { offsetLeft: h, offsetTop: v } = $(n, f.parentElement);
|
|
m.setAttribute("x", `${h}`), m.setAttribute("y", `${v}`), r.appendChild(m);
|
|
});
|
|
const l = (a = n.querySelector(".lines")) == null ? void 0 : a.cloneNode(!0);
|
|
l && r.appendChild(l);
|
|
const u = (p = n.querySelector(".topiclinks")) == null ? void 0 : p.cloneNode(!0);
|
|
u && r.appendChild(u);
|
|
const d = (g = n.querySelector(".summary")) == null ? void 0 : g.cloneNode(!0);
|
|
return d && r.appendChild(d), n.querySelectorAll("me-tpc").forEach((f) => {
|
|
f.nodeObj.dangerouslySetInnerHTML ? r.appendChild(ee(e, f, !t)) : (r.appendChild(Qn(e, f)), r.appendChild(ee(e, f.text, !t)));
|
|
}), n.querySelectorAll(".tags > span").forEach((f) => {
|
|
r.appendChild(ee(e, f));
|
|
}), n.querySelectorAll(".icons > span").forEach((f) => {
|
|
r.appendChild(ee(e, f));
|
|
}), n.querySelectorAll(".hyper-link").forEach((f) => {
|
|
r.appendChild(eo(e, f));
|
|
}), n.querySelectorAll("img").forEach((f) => {
|
|
r.appendChild(to(e, f));
|
|
}), N(r, {
|
|
x: te + "",
|
|
y: te + "",
|
|
overflow: "visible"
|
|
}), i.appendChild(r), i;
|
|
}, so = (e, t) => (t && e.insertAdjacentHTML("afterbegin", "<style>" + t + "</style>"), no + e.outerHTML);
|
|
function io(e) {
|
|
return new Promise((t, n) => {
|
|
const o = new FileReader();
|
|
o.onload = (s) => {
|
|
t(s.target.result);
|
|
}, o.onerror = (s) => {
|
|
n(s);
|
|
}, o.readAsDataURL(e);
|
|
});
|
|
}
|
|
const ro = function(e = !1, t) {
|
|
const n = oo(this, e), o = so(n, t);
|
|
return new Blob([o], { type: "image/svg+xml" });
|
|
}, co = async function(e = !1, t) {
|
|
const n = this.exportSvg(e, t), o = await io(n);
|
|
return new Promise((s, i) => {
|
|
const r = new Image();
|
|
r.setAttribute("crossOrigin", "anonymous"), r.onload = () => {
|
|
const c = document.createElement("canvas");
|
|
c.width = r.width, c.height = r.height, c.getContext("2d").drawImage(r, 0, 0), c.toBlob(s, "image/png", 1);
|
|
}, r.src = o, r.onerror = i;
|
|
});
|
|
}, lo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
__proto__: null,
|
|
exportPng: co,
|
|
exportSvg: ro
|
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
function ao(e, t) {
|
|
return async function(...n) {
|
|
const o = this.before[t];
|
|
o && !await o.apply(this, n) || e.apply(this, n);
|
|
};
|
|
}
|
|
const De = Object.keys(Ye), et = {};
|
|
for (let e = 0; e < De.length; e++) {
|
|
const t = De[e];
|
|
et[t] = ao(Ye[t], t);
|
|
}
|
|
const ho = {
|
|
getObjById: oe,
|
|
generateNewObj: nt,
|
|
layout: it,
|
|
linkDiv: pt,
|
|
editTopic: ut,
|
|
createWrapper: lt,
|
|
createParent: at,
|
|
createChildren: dt,
|
|
createTopic: ht,
|
|
findEle: C,
|
|
changeTheme: Ht,
|
|
...Mn,
|
|
...et,
|
|
...Bn,
|
|
...Yn,
|
|
...lo,
|
|
init(e) {
|
|
if (!e || !e.nodeData)
|
|
return new Error("MindElixir: `data` is required");
|
|
e.direction !== void 0 && (this.direction = e.direction), this.changeTheme(e.theme || this.theme, !1), this.nodeData = e.nodeData, D(this.nodeData), this.arrows = e.arrows || [], this.summaries = e.summaries || [], this.tidyArrow(), this.toolBar && Tt(this), this.keypress && wt(this), this.editable && Bt(this), this.contextMenu && this.disposable.push(mt(this, this.contextMenuOption)), this.draggable && Ct(this), this.allowUndo && _t(this), this.toCenter(), this.layout(), this.linkDiv();
|
|
},
|
|
destroy() {
|
|
var e, t;
|
|
this.disposable.forEach((n) => n()), (e = this.mindElixirBox) == null || e.remove(), this.mindElixirBox = void 0, this.nodeData = void 0, this.arrows = void 0, this.summaries = void 0, this.currentArrow = void 0, this.currentNode = void 0, this.currentNodes = void 0, this.currentSummary = void 0, this.waitCopy = void 0, this.theme = void 0, this.direction = void 0, this.bus = void 0, this.container = void 0, this.map = void 0, this.lines = void 0, this.linkController = void 0, this.linkSvgGroup = void 0, this.P2 = void 0, this.P3 = void 0, this.line1 = void 0, this.line2 = void 0, this.nodes = void 0, (t = this.selection) == null || t.destroy(), this.selection = void 0;
|
|
}
|
|
};
|
|
function uo({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction: l, containerHeight: u }) {
|
|
let d = t + n / 2;
|
|
const a = e + o / 2;
|
|
let p;
|
|
l === "lhs" ? p = i + r : p = i;
|
|
const g = s + c / 2, m = (1 - Math.abs(g - a) / u) * 0.25 * (n / 2);
|
|
return l === "lhs" ? d = d - n / 10 - m : d = d + n / 10 + m, `M ${d} ${a} Q ${d} ${g} ${p} ${g}`;
|
|
}
|
|
function fo({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction: l, isFirst: u }) {
|
|
const d = parseInt(this.mindElixirBox.style.getPropertyValue("--gap"));
|
|
let a = 0, p = 0;
|
|
u ? a = e + o / 2 : a = e + o;
|
|
const g = s + c;
|
|
let f = 0, m = 0, h = 0;
|
|
const v = Math.abs(a - g) / 300 * d;
|
|
return l === "lhs" ? (h = t, f = h + d, m = h - d, p = i + d, `M ${f} ${a} C ${h} ${a} ${h + v} ${g} ${m} ${g} H ${p}`) : (h = t + n, f = h - d, m = h + d, p = i + r - d, `M ${f} ${a} C ${h} ${a} ${h - v} ${g} ${m} ${g} H ${p}`);
|
|
}
|
|
const po = "4.3.1", U = document;
|
|
function A({
|
|
el: e,
|
|
direction: t,
|
|
locale: n,
|
|
draggable: o,
|
|
editable: s,
|
|
contextMenu: i,
|
|
contextMenuOption: r,
|
|
toolBar: c,
|
|
keypress: l,
|
|
mouseSelectionButton: u,
|
|
selectionContainer: d,
|
|
before: a,
|
|
newTopicName: p,
|
|
allowUndo: g,
|
|
generateMainBranch: f,
|
|
generateSubBranch: m,
|
|
overflowHidden: h,
|
|
theme: v
|
|
}) {
|
|
let y = null;
|
|
const b = Object.prototype.toString.call(e);
|
|
if (b === "[object HTMLDivElement]" ? y = e : b === "[object String]" && (y = document.querySelector(e)), !y)
|
|
throw new Error("MindElixir: el is not a valid element");
|
|
y.className += " mind-elixir", y.innerHTML = "", this.mindElixirBox = y, this.disposable = [], this.before = a || {}, this.locale = n || "en", this.contextMenuOption = r, this.contextMenu = i === void 0 ? !0 : i, this.toolBar = c === void 0 ? !0 : c, this.keypress = l === void 0 ? !0 : l, this.mouseSelectionButton = u || 0, this.direction = typeof t == "number" ? t : 1, this.draggable = o === void 0 ? !0 : o, this.newTopicName = p || "new node", this.editable = s === void 0 ? !0 : s, this.allowUndo = g === void 0 ? !1 : g, this.currentNode = null, this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.generateMainBranch = f || uo, this.generateSubBranch = m || fo, this.overflowHidden = h || !1, this.bus = st.create(), this.container = U.createElement("div"), this.selectionContainer = d || this.container, this.container.className = "map-container";
|
|
const x = window.matchMedia("(prefers-color-scheme: dark)");
|
|
this.theme = v || (x.matches ? Oe : $e);
|
|
const w = U.createElement("div");
|
|
w.className = "map-canvas", this.map = w, this.map.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.mindElixirBox.appendChild(this.container), this.nodes = U.createElement("me-nodes"), this.nodes.className = "main-node-container", this.lines = Y("lines"), this.summarySvg = Y("summary"), this.linkController = Y("linkcontroller"), this.P2 = U.createElement("div"), this.P3 = U.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = ye(), this.line2 = ye(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.linkSvgGroup = Y("topiclinks"), this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : ot(this);
|
|
}
|
|
A.prototype = ho;
|
|
A.LEFT = T;
|
|
A.RIGHT = z;
|
|
A.SIDE = re;
|
|
A.THEME = $e;
|
|
A.DARK_THEME = Oe;
|
|
A.version = po;
|
|
A.E = C;
|
|
A.new = (e) => ({
|
|
nodeData: {
|
|
id: X(),
|
|
topic: e || "new topic",
|
|
children: []
|
|
}
|
|
});
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 99113:
|
|
/*!***************************************************************************!*\
|
|
!*** ./node_modules/_node-menu-bar@1.0.0@node-menu-bar/dist/node-menu.js ***!
|
|
\***************************************************************************/
|
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ Z: function() { return /* binding */ k; }
|
|
/* harmony export */ });
|
|
window._iconfont_svg_string_4003484 = '<svg><symbol id="icon-a" viewBox="0 0 1024 1024"><path d="M757.76 665.6q0 20.48 1.536 34.304t7.68 22.016 18.944 12.288 34.304 4.096q-3.072 25.6-15.36 44.032-11.264 16.384-33.28 29.696t-62.976 13.312q-11.264 0-20.48-0.512t-17.408-2.56l-6.144-2.048-1.024 0q-4.096-1.024-10.24-4.096-2.048-2.048-4.096-2.048-1.024-1.024-2.048-1.024-14.336-8.192-23.552-17.408t-14.336-17.408q-6.144-10.24-9.216-20.48-63.488 75.776-178.176 75.776-48.128 0-88.064-15.36t-69.12-44.032-45.056-68.096-15.872-88.576 16.896-89.088 47.616-67.584 74.24-42.496 96.768-14.848q48.128 0 88.576 17.408t66.048 49.152q0-8.192 0.512-16.384t0.512-15.36q0-71.68-39.936-104.448t-128-32.768q-43.008 0-84.992 6.656t-84.992 17.92q14.336-28.672 25.088-47.616t24.064-29.184q30.72-24.576 158.72-24.576 79.872 0 135.168 13.824t90.624 43.52 51.2 75.264 15.872 108.032l0 200.704zM487.424 743.424q50.176 0 79.872-33.28t29.696-95.744q0-61.44-28.672-93.696t-76.8-32.256q-52.224 0-82.944 33.28t-30.72 94.72q0 58.368 31.744 92.672t77.824 34.304z" ></path></symbol><symbol id="icon-close" viewBox="0 0 1024 1024"><path d="M557.312 513.248l265.28-263.904c12.544-12.48 12.608-32.704 0.128-45.248-12.512-12.576-32.704-12.608-45.248-0.128L512.128 467.904l-263.04-263.84c-12.448-12.48-32.704-12.544-45.248-0.064-12.512 12.48-12.544 32.736-0.064 45.28l262.976 263.776L201.6 776.8c-12.544 12.48-12.608 32.704-0.128 45.248a31.937 31.937 0 0 0 22.688 9.44c8.16 0 16.32-3.104 22.56-9.312l265.216-263.808 265.44 266.24c6.24 6.272 14.432 9.408 22.656 9.408a31.94 31.94 0 0 0 22.592-9.344c12.512-12.48 12.544-32.704 0.064-45.248L557.312 513.248z" fill="" ></path></symbol><symbol id="icon-menu" viewBox="0 0 1024 1024"><path d="M109.714 292.571h804.572c21.943 0 36.571-21.942 36.571-43.885 0-14.629-14.628-29.257-36.571-29.257H109.714c-21.943 0-36.571 14.628-36.571 36.571 0 14.629 14.628 36.571 36.571 36.571zM914.286 512H109.714c-21.943 0-36.571 14.629-36.571 36.571 0 14.629 14.628 36.572 36.571 36.572h804.572c21.943 0 36.571-21.943 36.571-43.886 0-14.628-14.628-29.257-36.571-29.257z m0 292.571H109.714c-21.943 0-36.571 14.629-36.571 36.572s14.628 36.571 36.571 36.571h804.572c21.943 0 36.571-21.943 36.571-36.571 0-21.943-14.628-36.572-36.571-36.572z" ></path></symbol><symbol id="icon-B" viewBox="0 0 1024 1024"><path d="M98.067692 65.457231H481.28c75.854769 0 132.411077 3.150769 169.668923 9.452307 37.336615 6.301538 70.656 19.534769 100.036923 39.620924 29.459692 20.007385 53.956923 46.710154 73.570462 80.029538 19.692308 33.398154 29.459692 70.734769 29.459692 112.167385 0 44.898462-12.130462 86.094769-36.233846 123.588923a224.886154 224.886154 0 0 1-98.461539 84.283077c58.368 17.092923 103.266462 46.08 134.695385 87.04 31.350154 40.96 47.025231 89.088 47.025231 144.462769 0 43.638154-10.082462 86.016-30.404923 127.212308-20.243692 41.196308-47.891692 74.043077-83.02277 98.697846-35.052308 24.654769-78.296615 39.778462-129.732923 45.449846-32.295385 3.465846-110.119385 5.671385-233.472 6.537846H98.067692V65.457231z m193.536 159.507692V446.621538h126.818462c75.460923 0 122.328615-1.024 140.603077-3.229538 33.083077-3.938462 59.155692-15.36 78.139077-34.343385 18.904615-18.904615 28.435692-43.874462 28.435692-74.830769 0-29.696-8.192-53.720615-24.497231-72.310154-16.384-18.510769-40.644923-29.696-72.940307-33.634461-19.140923-2.205538-74.279385-3.308308-165.415385-3.308308h-111.064615z m0 381.243077v256.315077h179.2c69.710769 0 113.979077-1.969231 132.726154-5.907692 28.750769-5.198769 52.145231-17.959385 70.262154-38.281847 18.116923-20.243692 27.096615-47.340308 27.096615-81.368615 0-28.750769-6.931692-53.169231-20.873846-73.255385a118.232615 118.232615 0 0 0-60.494769-43.795692c-26.387692-9.137231-83.574154-13.705846-171.638154-13.705846H291.603692z" ></path></symbol></svg>', function(u) {
|
|
var n = (n = document.getElementsByTagName("script"))[n.length - 1], l = n.getAttribute("data-injectcss"), n = n.getAttribute("data-disable-injectsvg");
|
|
if (!n) {
|
|
var g, p, E, r, m, t = function(s, c) {
|
|
c.parentNode.insertBefore(s, c);
|
|
};
|
|
if (l && !u.__iconfont__svg__cssinject__) {
|
|
u.__iconfont__svg__cssinject__ = !0;
|
|
try {
|
|
document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>");
|
|
} catch (s) {
|
|
console && console.log(s);
|
|
}
|
|
}
|
|
g = function() {
|
|
var s, c = document.createElement("div");
|
|
c.innerHTML = u._iconfont_svg_string_4003484, (c = c.getElementsByTagName("svg")[0]) && (c.setAttribute("aria-hidden", "true"), c.style.position = "absolute", c.style.width = 0, c.style.height = 0, c.style.overflow = "hidden", c = c, (s = document.body).firstChild ? t(c, s.firstChild) : s.appendChild(c));
|
|
}, document.addEventListener ? ~["complete", "loaded", "interactive"].indexOf(document.readyState) ? setTimeout(g, 0) : (p = function() {
|
|
document.removeEventListener("DOMContentLoaded", p, !1), g();
|
|
}, document.addEventListener("DOMContentLoaded", p, !1)) : document.attachEvent && (E = g, r = u.document, m = !1, h(), r.onreadystatechange = function() {
|
|
r.readyState == "complete" && (r.onreadystatechange = null, C());
|
|
});
|
|
}
|
|
function C() {
|
|
m || (m = !0, E());
|
|
}
|
|
function h() {
|
|
try {
|
|
r.documentElement.doScroll("left");
|
|
} catch {
|
|
return void setTimeout(h, 50);
|
|
}
|
|
C();
|
|
}
|
|
}(window);
|
|
const N = {
|
|
addChild: "\u63D2\u5165\u5B50\u8282\u70B9",
|
|
addParent: "\u63D2\u5165\u7236\u8282\u70B9",
|
|
addSibling: "\u63D2\u5165\u540C\u7EA7\u8282\u70B9",
|
|
removeNode: "\u5220\u9664\u8282\u70B9",
|
|
focus: "\u4E13\u6CE8",
|
|
cancelFocus: "\u53D6\u6D88\u4E13\u6CE8",
|
|
moveUp: "\u4E0A\u79FB",
|
|
moveDown: "\u4E0B\u79FB",
|
|
link: "\u8FDE\u63A5",
|
|
clickTips: "\u8BF7\u70B9\u51FB\u76EE\u6807\u8282\u70B9",
|
|
font: "\u6587\u5B57",
|
|
background: "\u80CC\u666F",
|
|
tag: "\u6807\u7B7E",
|
|
icon: "\u56FE\u6807",
|
|
tagsSeparate: "\u591A\u4E2A\u6807\u7B7E\u534A\u89D2\u9017\u53F7\u5206\u9694",
|
|
iconsSeparate: "\u591A\u4E2A\u56FE\u6807\u534A\u89D2\u9017\u53F7\u5206\u9694",
|
|
url: "\u94FE\u63A5",
|
|
memo: "\u5907\u5FD8\u5F55"
|
|
}, i = {
|
|
cn: N,
|
|
zh_CN: N,
|
|
zh_TW: {
|
|
addChild: "\u63D2\u5165\u5B50\u7BC0\u9EDE",
|
|
addParent: "\u63D2\u5165\u7236\u7BC0\u9EDE",
|
|
addSibling: "\u63D2\u5165\u540C\u7D1A\u7BC0\u9EDE",
|
|
removeNode: "\u522A\u9664\u7BC0\u9EDE",
|
|
focus: "\u5C08\u6CE8",
|
|
cancelFocus: "\u53D6\u6D88\u5C08\u6CE8",
|
|
moveUp: "\u4E0A\u79FB",
|
|
moveDown: "\u4E0B\u79FB",
|
|
link: "\u9023\u63A5",
|
|
clickTips: "\u8ACB\u9EDE\u64CA\u76EE\u6A19\u7BC0\u9EDE",
|
|
font: "\u6587\u5B57",
|
|
background: "\u80CC\u666F",
|
|
tag: "\u6A19\u7C3D",
|
|
icon: "\u5716\u6A19",
|
|
tagsSeparate: "\u591A\u500B\u6A19\u7C3D\u534A\u89D2\u9017\u865F\u5206\u9694",
|
|
iconsSeparate: "\u591A\u500B\u5716\u6A19\u534A\u89D2\u9017\u865F\u5206\u9694",
|
|
url: "URL"
|
|
},
|
|
en: {
|
|
addChild: "Add child",
|
|
addParent: "Add parent",
|
|
addSibling: "Add sibling",
|
|
removeNode: "Remove node",
|
|
focus: "Focus Mode",
|
|
cancelFocus: "Cancel Focus Mode",
|
|
moveUp: "Move up",
|
|
moveDown: "Move down",
|
|
link: "Link",
|
|
clickTips: "Please click the target node",
|
|
font: "Font",
|
|
background: "Background",
|
|
tag: "Tag",
|
|
icon: "Icon",
|
|
tagsSeparate: "Separate tags by comma",
|
|
iconsSeparate: "Separate icons by comma",
|
|
url: "URL"
|
|
},
|
|
ru: {
|
|
addChild: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0439 \u044D\u043B\u0435\u043C\u0435\u043D\u0442",
|
|
addParent: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0440\u043E\u0434\u0438\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0439 \u044D\u043B\u0435\u043C\u0435\u043D\u0442",
|
|
addSibling: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043D\u0430 \u044D\u0442\u043E\u043C \u0443\u0440\u043E\u0432\u043D\u0435",
|
|
removeNode: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0443\u0437\u0435\u043B",
|
|
focus: "\u0420\u0435\u0436\u0438\u043C \u0444\u043E\u043A\u0443\u0441\u0438\u0440\u043E\u0432\u043A\u0438",
|
|
cancelFocus: "\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u0440\u0435\u0436\u0438\u043C \u0444\u043E\u043A\u0443\u0441\u0438\u0440\u043E\u0432\u043A\u0438",
|
|
moveUp: "\u041F\u043E\u0434\u043D\u044F\u0442\u044C \u0432\u044B\u0448\u0435",
|
|
moveDown: "\u041E\u043F\u0443\u0441\u0442\u0438\u0442\u044C \u043D\u0438\u0436\u0435",
|
|
link: "\u0421\u0441\u044B\u043B\u043A\u0430",
|
|
clickTips: "\u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u043D\u0430\u0436\u043C\u0438\u0442\u0435 \u043D\u0430 \u0446\u0435\u043B\u0435\u0432\u043E\u0439 \u0443\u0437\u0435\u043B",
|
|
font: "\u0426\u0432\u0435\u0442 \u0448\u0440\u0438\u0444\u0442\u0430",
|
|
background: "\u0426\u0432\u0435\u0442 \u0444\u043E\u043D\u0430",
|
|
tag: "\u0422\u0435\u0433",
|
|
icon: "\u0418\u043A\u043E\u043D\u043A\u0430",
|
|
tagsSeparate: "\u0420\u0430\u0437\u0434\u0435\u043B\u044F\u0439\u0442\u0435 \u0442\u0435\u0433\u0438 \u0437\u0430\u043F\u044F\u0442\u043E\u0439",
|
|
iconsSeparate: "\u0420\u0430\u0437\u0434\u0435\u043B\u044F\u0439\u0442\u0435 \u0438\u043A\u043E\u043D\u043A\u0438 \u0437\u0430\u043F\u044F\u0442\u043E\u0439"
|
|
},
|
|
ja: {
|
|
addChild: "\u5B50\u30CE\u30FC\u30C9\u3092\u8FFD\u52A0\u3059\u308B",
|
|
addParent: "\u89AA\u30CE\u30FC\u30C9\u3092\u8FFD\u52A0\u3057\u307E\u3059",
|
|
addSibling: "\u5144\u5F1F\u30CE\u30FC\u30C9\u3092\u8FFD\u52A0\u3059\u308B",
|
|
removeNode: "\u30CE\u30FC\u30C9\u3092\u524A\u9664",
|
|
focus: "\u96C6\u4E2D",
|
|
cancelFocus: "\u96C6\u4E2D\u89E3\u9664",
|
|
moveUp: "\u4E0A\u3078\u79FB\u52D5",
|
|
moveDown: "\u4E0B\u3078\u79FB\u52D5",
|
|
link: "\u30B3\u30CD\u30AF\u30C8",
|
|
clickTips: "\u30BF\u30FC\u30B2\u30C3\u30C8\u30CE\u30FC\u30C9\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
font: "\u30D5\u30A9\u30F3\u30C8",
|
|
background: "\u30D0\u30C3\u30AF\u30B0\u30E9\u30A6\u30F3\u30C9",
|
|
tag: "\u30BF\u30B0",
|
|
icon: "\u30A2\u30A4\u30B3\u30F3",
|
|
tagsSeparate: "\u8907\u6570\u30BF\u30B0\u306F\u30AB\u30F3\u30DE\u533A\u5207\u308A",
|
|
iconsSeparate: "\u8907\u6570\u30A2\u30A4\u30B3\u30F3\u306F\u30AB\u30F3\u30DE\u533A\u5207\u308A",
|
|
url: "URL"
|
|
},
|
|
pt: {
|
|
addChild: "Adicionar item filho",
|
|
addParent: "Adicionar item pai",
|
|
addSibling: "Adicionar item irmao",
|
|
removeNode: "Remover item",
|
|
focus: "Modo Foco",
|
|
cancelFocus: "Cancelar Modo Foco",
|
|
moveUp: "Mover para cima",
|
|
moveDown: "Mover para baixo",
|
|
link: "Link",
|
|
clickTips: "Favor clicar no item alvo",
|
|
font: "Fonte",
|
|
background: "Cor de fundo",
|
|
tag: "Tag",
|
|
icon: "Icone",
|
|
tagsSeparate: "Separe tags por virgula",
|
|
iconsSeparate: "Separe icones por virgula",
|
|
url: "URL"
|
|
}
|
|
}, v = (u, l) => {
|
|
const n = document.createElement("div");
|
|
return n.id = u, n.innerHTML = l, n;
|
|
}, S = [
|
|
"#2c3e50",
|
|
"#34495e",
|
|
"#7f8c8d",
|
|
"#94a5a6",
|
|
"#bdc3c7",
|
|
"#ecf0f1",
|
|
"#8e44ad",
|
|
"#9b59b6",
|
|
"#2980b9",
|
|
"#3298db",
|
|
"#c0392c",
|
|
"#e74c3c",
|
|
"#d35400",
|
|
"#f39c11",
|
|
"#f1c40e",
|
|
"#17a085",
|
|
"#27ae61",
|
|
"#2ecc71"
|
|
];
|
|
function k(u) {
|
|
console.log("install node menu");
|
|
function l(e, a) {
|
|
const o = u.container.querySelectorAll(e);
|
|
[].forEach.call(o, function(d) {
|
|
d.classList.remove(a);
|
|
});
|
|
}
|
|
const n = i[u.locale] ? u.locale : "en", g = v(
|
|
"nm-style",
|
|
`
|
|
<div class="nm-fontsize-container">
|
|
${["15", "24", "32"].map((e) => `<div class="size" data-size="${e}">
|
|
<svg class="icon" style="width: ${e}px;height: ${e}px" aria-hidden="true">
|
|
<use xlink:href="#icon-a"></use>
|
|
</svg></div>`).join("")}<div class="bold"><svg class="icon" aria-hidden="true">
|
|
<use xlink:href="#icon-B"></use>
|
|
</svg></div>
|
|
</div>
|
|
<div class="nm-fontcolor-container">
|
|
${S.map((e) => `<div class="split6"><div class="palette" data-color="${e}" style="background-color: ${e};"></div></div>`).join("")}
|
|
</div>
|
|
<div class="bof">
|
|
<span class="font">${i[n].font}</span>
|
|
<span class="background">${i[n].background}</span>
|
|
</div>`
|
|
), p = v(
|
|
"nm-tag",
|
|
`${i[n].tag}<input class="nm-tag" tabindex="-1" placeholder="${i[n].tagsSeparate}" />`
|
|
), E = v(
|
|
"nm-icon",
|
|
`${i[n].icon}<input class="nm-icon" tabindex="-1" placeholder="${i[n].iconsSeparate}" />`
|
|
), r = v(
|
|
"nm-url",
|
|
`${i[n].url}<input class="nm-url" tabindex="-1" />`
|
|
), m = v(
|
|
"nm-memo",
|
|
`${i[n].memo || "Memo"}<textarea class="nm-memo" rows="5" tabindex="-1" />`
|
|
), t = document.createElement("div");
|
|
t.className = "node-menu", t.innerHTML = `
|
|
<div class="button-container"><svg class="icon" aria-hidden="true">
|
|
<use xlink:href="#icon-close"></use>
|
|
</svg></div>
|
|
`, t.appendChild(g), t.appendChild(p), t.appendChild(E), t.appendChild(r), t.appendChild(m), t.hidden = !0, u.container.append(t);
|
|
const C = t.querySelectorAll(".size"), h = t.querySelector(".bold"), s = t.querySelector(".button-container"), c = t.querySelector(".font"), A = u.container.querySelector(".nm-tag"), B = u.container.querySelector(".nm-icon"), y = u.container.querySelector(".nm-url"), D = u.container.querySelector(".nm-memo");
|
|
let f;
|
|
u.findEle, t.onclick = (e) => {
|
|
if (!u.currentNode)
|
|
return;
|
|
const a = u.currentNode.nodeObj, o = e.target;
|
|
if (o.className === "palette") {
|
|
l(".palette", "nmenu-selected"), o.className = "palette nmenu-selected";
|
|
const d = o.dataset.color, F = { style: {} };
|
|
f === "font" ? F.style.color = d : f === "background" && (F.style.background = d), console.log(F), u.reshapeNode(u.currentNode, F);
|
|
} else
|
|
o.className === "background" ? (l(".palette", "nmenu-selected"), f = "background", o.className = "background selected", o.previousElementSibling.className = "font", a.style && a.style.background && (t.querySelector(
|
|
'.palette[data-color="' + a.style.background + '"]'
|
|
).className = "palette nmenu-selected")) : o.className === "font" && (l(".palette", "nmenu-selected"), f = "font", o.className = "font selected", o.nextElementSibling.className = "background", a.style && a.style.color && (t.querySelector(
|
|
'.palette[data-color="' + a.style.color + '"]'
|
|
).className = "palette nmenu-selected"));
|
|
}, Array.from(C).map((e) => {
|
|
e.onclick = (a) => {
|
|
l(".size", "size-selected");
|
|
const o = a.currentTarget;
|
|
o.className = "size size-selected", u.reshapeNode(u.currentNode, {
|
|
style: { fontSize: o.dataset.size }
|
|
});
|
|
};
|
|
}), h.onclick = (e) => {
|
|
var o, d;
|
|
let a = "";
|
|
((d = (o = u.currentNode.nodeObj) == null ? void 0 : o.style) == null ? void 0 : d.fontWeight) === "bold" ? e.currentTarget.className = "bold" : (a = "bold", e.currentTarget.className = "bold size-selected"), u.reshapeNode(u.currentNode, { style: { fontWeight: a } });
|
|
}, A.onchange = (e) => {
|
|
if (!!u.currentNode && typeof e.target.value == "string") {
|
|
const a = e.target.value.split(",");
|
|
u.reshapeNode(u.currentNode, { tags: a.filter((o) => o) });
|
|
}
|
|
}, B.onchange = (e) => {
|
|
if (!!u.currentNode && typeof e.target.value == "string") {
|
|
const a = e.target.value.split(",");
|
|
u.reshapeNode(u.currentNode, {
|
|
icons: a.filter((o) => o)
|
|
});
|
|
}
|
|
}, y.onchange = (e) => {
|
|
!u.currentNode || u.reshapeNode(u.currentNode, { hyperLink: e.target.value });
|
|
}, D.onchange = (e) => {
|
|
!u.currentNode || (u.currentNode.nodeObj.memo = e.target.value, u.bus.fire("operation", {
|
|
name: "updateMemo",
|
|
obj: u.currentNode.nodeObj
|
|
}));
|
|
};
|
|
let b = "open";
|
|
s.onclick = (e) => {
|
|
t.classList.toggle("close"), b === "open" ? (b = "close", s.innerHTML = '<svg class="icon" aria-hidden="true"><use xlink:href="#icon-menu"></use></svg>') : (b = "open", s.innerHTML = '<svg class="icon" aria-hidden="true"><use xlink:href="#icon-close"></use></svg>');
|
|
}, u.bus.addListener("unselectNode", function() {
|
|
t.hidden = !0;
|
|
}), u.bus.addListener("selectNode", function(e, a) {
|
|
!a || (t.hidden = !1, l(".palette", "nmenu-selected"), l(".size", "size-selected"), l(".bold", "size-selected"), f = "font", c.className = "font selected", c.nextElementSibling.className = "background", e.style && (e.style.fontSize && (t.querySelector(
|
|
'.size[data-size="' + e.style.fontSize + '"]'
|
|
).className = "size size-selected"), e.style.fontWeight && (t.querySelector(".bold").className = "bold size-selected"), e.style.color && (t.querySelector(
|
|
'.palette[data-color="' + e.style.color + '"]'
|
|
).className = "palette nmenu-selected")), e.tags ? A.value = e.tags.join(",") : A.value = "", e.icons ? B.value = e.icons.join(",") : B.value = "", y.value = e.hyperLink || "", D.value = e.memo || "");
|
|
});
|
|
}
|
|
|
|
|
|
|
|
/***/ })
|
|
|
|
}]); |