{"ast":null,"code":"\"use client\";\n\nimport React from 'react';\nimport HolderOutlined from \"@ant-design/icons/es/icons/HolderOutlined\";\nimport classNames from 'classnames';\nimport RcTree from 'rc-tree';\nimport initCollapseMotion from '../_util/motion';\nimport { ConfigContext } from '../config-provider';\nimport { useToken } from '../theme/internal';\nimport useStyle from './style';\nimport dropIndicatorRender from './utils/dropIndicator';\nimport SwitcherIconCom from './utils/iconUtil';\nconst Tree = /*#__PURE__*/React.forwardRef((props, ref) => {\n  var _a;\n  const {\n    getPrefixCls,\n    direction,\n    virtual,\n    tree\n  } = React.useContext(ConfigContext);\n  const {\n    prefixCls: customizePrefixCls,\n    className,\n    showIcon = false,\n    showLine,\n    switcherIcon,\n    blockNode = false,\n    children,\n    checkable = false,\n    selectable = true,\n    draggable,\n    motion: customMotion,\n    style\n  } = props;\n  const prefixCls = getPrefixCls('tree', customizePrefixCls);\n  const rootPrefixCls = getPrefixCls();\n  const motion = customMotion !== null && customMotion !== void 0 ? customMotion : Object.assign(Object.assign({}, initCollapseMotion(rootPrefixCls)), {\n    motionAppear: false\n  });\n  const newProps = Object.assign(Object.assign({}, props), {\n    checkable,\n    selectable,\n    showIcon,\n    motion,\n    blockNode,\n    showLine: Boolean(showLine),\n    dropIndicatorRender\n  });\n  const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n  const [, token] = useToken();\n  const itemHeight = token.paddingXS / 2 + (((_a = token.Tree) === null || _a === void 0 ? void 0 : _a.titleHeight) || token.controlHeightSM);\n  const draggableConfig = React.useMemo(() => {\n    if (!draggable) {\n      return false;\n    }\n    let mergedDraggable = {};\n    switch (typeof draggable) {\n      case 'function':\n        mergedDraggable.nodeDraggable = draggable;\n        break;\n      case 'object':\n        mergedDraggable = Object.assign({}, draggable);\n        break;\n      default:\n        break;\n      // Do nothing\n    }\n    if (mergedDraggable.icon !== false) {\n      mergedDraggable.icon = mergedDraggable.icon || /*#__PURE__*/React.createElement(HolderOutlined, null);\n    }\n    return mergedDraggable;\n  }, [draggable]);\n  const renderSwitcherIcon = nodeProps => ( /*#__PURE__*/React.createElement(SwitcherIconCom, {\n    prefixCls: prefixCls,\n    switcherIcon: switcherIcon,\n    treeNodeProps: nodeProps,\n    showLine: showLine\n  }));\n  return wrapCSSVar( /*#__PURE__*/\n  // @ts-ignore\n  React.createElement(RcTree, Object.assign({\n    itemHeight: itemHeight,\n    ref: ref,\n    virtual: virtual\n  }, newProps, {\n    // newProps may contain style so declare style below it\n    style: Object.assign(Object.assign({}, tree === null || tree === void 0 ? void 0 : tree.style), style),\n    prefixCls: prefixCls,\n    className: classNames({\n      [`${prefixCls}-icon-hide`]: !showIcon,\n      [`${prefixCls}-block-node`]: blockNode,\n      [`${prefixCls}-unselectable`]: !selectable,\n      [`${prefixCls}-rtl`]: direction === 'rtl'\n    }, tree === null || tree === void 0 ? void 0 : tree.className, className, hashId, cssVarCls),\n    direction: direction,\n    checkable: checkable ? /*#__PURE__*/React.createElement(\"span\", {\n      className: `${prefixCls}-checkbox-inner`\n    }) : checkable,\n    selectable: selectable,\n    switcherIcon: renderSwitcherIcon,\n    draggable: draggableConfig\n  }), children));\n});\nif (process.env.NODE_ENV !== 'production') {\n  Tree.displayName = 'Tree';\n}\nexport default Tree;","map":{"version":3,"names":["React","HolderOutlined","classNames","RcTree","initCollapseMotion","ConfigContext","useToken","useStyle","dropIndicatorRender","SwitcherIconCom","Tree","forwardRef","props","ref","_a","getPrefixCls","direction","virtual","tree","useContext","prefixCls","customizePrefixCls","className","showIcon","showLine","switcherIcon","blockNode","children","checkable","selectable","draggable","motion","customMotion","style","rootPrefixCls","Object","assign","motionAppear","newProps","Boolean","wrapCSSVar","hashId","cssVarCls","token","itemHeight","paddingXS","titleHeight","controlHeightSM","draggableConfig","useMemo","mergedDraggable","nodeDraggable","icon","createElement","renderSwitcherIcon","nodeProps","treeNodeProps","process","env","NODE_ENV","displayName"],"sources":["/Users/shanyi/Desktop/Projects/UC_Trains_Voice/react-demo/node_modules/antd/es/tree/Tree.js"],"sourcesContent":["\"use client\";\n\nimport React from 'react';\nimport HolderOutlined from \"@ant-design/icons/es/icons/HolderOutlined\";\nimport classNames from 'classnames';\nimport RcTree from 'rc-tree';\nimport initCollapseMotion from '../_util/motion';\nimport { ConfigContext } from '../config-provider';\nimport { useToken } from '../theme/internal';\nimport useStyle from './style';\nimport dropIndicatorRender from './utils/dropIndicator';\nimport SwitcherIconCom from './utils/iconUtil';\nconst Tree = /*#__PURE__*/React.forwardRef((props, ref) => {\n  var _a;\n  const {\n    getPrefixCls,\n    direction,\n    virtual,\n    tree\n  } = React.useContext(ConfigContext);\n  const {\n    prefixCls: customizePrefixCls,\n    className,\n    showIcon = false,\n    showLine,\n    switcherIcon,\n    blockNode = false,\n    children,\n    checkable = false,\n    selectable = true,\n    draggable,\n    motion: customMotion,\n    style\n  } = props;\n  const prefixCls = getPrefixCls('tree', customizePrefixCls);\n  const rootPrefixCls = getPrefixCls();\n  const motion = customMotion !== null && customMotion !== void 0 ? customMotion : Object.assign(Object.assign({}, initCollapseMotion(rootPrefixCls)), {\n    motionAppear: false\n  });\n  const newProps = Object.assign(Object.assign({}, props), {\n    checkable,\n    selectable,\n    showIcon,\n    motion,\n    blockNode,\n    showLine: Boolean(showLine),\n    dropIndicatorRender\n  });\n  const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n  const [, token] = useToken();\n  const itemHeight = token.paddingXS / 2 + (((_a = token.Tree) === null || _a === void 0 ? void 0 : _a.titleHeight) || token.controlHeightSM);\n  const draggableConfig = React.useMemo(() => {\n    if (!draggable) {\n      return false;\n    }\n    let mergedDraggable = {};\n    switch (typeof draggable) {\n      case 'function':\n        mergedDraggable.nodeDraggable = draggable;\n        break;\n      case 'object':\n        mergedDraggable = Object.assign({}, draggable);\n        break;\n      default:\n        break;\n      // Do nothing\n    }\n    if (mergedDraggable.icon !== false) {\n      mergedDraggable.icon = mergedDraggable.icon || /*#__PURE__*/React.createElement(HolderOutlined, null);\n    }\n    return mergedDraggable;\n  }, [draggable]);\n  const renderSwitcherIcon = nodeProps => ( /*#__PURE__*/React.createElement(SwitcherIconCom, {\n    prefixCls: prefixCls,\n    switcherIcon: switcherIcon,\n    treeNodeProps: nodeProps,\n    showLine: showLine\n  }));\n  return wrapCSSVar(\n  /*#__PURE__*/\n  // @ts-ignore\n  React.createElement(RcTree, Object.assign({\n    itemHeight: itemHeight,\n    ref: ref,\n    virtual: virtual\n  }, newProps, {\n    // newProps may contain style so declare style below it\n    style: Object.assign(Object.assign({}, tree === null || tree === void 0 ? void 0 : tree.style), style),\n    prefixCls: prefixCls,\n    className: classNames({\n      [`${prefixCls}-icon-hide`]: !showIcon,\n      [`${prefixCls}-block-node`]: blockNode,\n      [`${prefixCls}-unselectable`]: !selectable,\n      [`${prefixCls}-rtl`]: direction === 'rtl'\n    }, tree === null || tree === void 0 ? void 0 : tree.className, className, hashId, cssVarCls),\n    direction: direction,\n    checkable: checkable ? /*#__PURE__*/React.createElement(\"span\", {\n      className: `${prefixCls}-checkbox-inner`\n    }) : checkable,\n    selectable: selectable,\n    switcherIcon: renderSwitcherIcon,\n    draggable: draggableConfig\n  }), children));\n});\nif (process.env.NODE_ENV !== 'production') {\n  Tree.displayName = 'Tree';\n}\nexport default Tree;"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,cAAc,MAAM,2CAA2C;AACtE,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,MAAM,MAAM,SAAS;AAC5B,OAAOC,kBAAkB,MAAM,iBAAiB;AAChD,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,OAAOC,QAAQ,MAAM,SAAS;AAC9B,OAAOC,mBAAmB,MAAM,uBAAuB;AACvD,OAAOC,eAAe,MAAM,kBAAkB;AAC9C,MAAMC,IAAI,GAAG,aAAaV,KAAK,CAACW,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EACzD,IAAIC,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