function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
import { getTopologyElementKindCategories, getTopologyElementKinds, TOPOLOGY_AP_KIND, TOPOLOGY_ROUTER_KIND, TOPOLOGY_SWITCH_KIND } from "./topologyElementKinds";
import { TOPOLOGY_MAIN_CANVAS_ID } from "./topologyFloorPlanConstants";
export function getTopologyFloorMapShellConfig() {
  return {
    canvases: [{
      id: TOPOLOGY_MAIN_CANVAS_ID,
      name: 'Actual Topology',
      order: 0,
      enabled: true,
      mapLayer: {
        showGrid: false,
        backgroundColor: '#ffffff'
      }
    }],
    canvasUi: {
      canCreate: true,
      canEdit: true
    },
    elementKindCategories: getTopologyElementKindCategories(),
    elementKinds: getTopologyElementKinds(),
    sceneElements: [{
      instanceId: 'gw-1',
      canvasId: TOPOLOGY_MAIN_CANVAS_ID,
      x: 360,
      y: 40,
      width: 120,
      height: 88,
      elementKind: TOPOLOGY_ROUTER_KIND,
      name: 'Gateway',
      dataBinding: {
        dataSourceKey: 'devices',
        recordId: 'gw-1'
      }
    }, {
      instanceId: 'sw-core',
      canvasId: TOPOLOGY_MAIN_CANVAS_ID,
      x: 340,
      y: 180,
      width: 140,
      height: 88,
      elementKind: TOPOLOGY_SWITCH_KIND,
      name: 'MainRack_CoreSW',
      dataBinding: {
        dataSourceKey: 'devices',
        recordId: 'sw-core'
      }
    }, {
      instanceId: 'sw-sub',
      canvasId: TOPOLOGY_MAIN_CANVAS_ID,
      x: 160,
      y: 320,
      width: 120,
      height: 88,
      elementKind: TOPOLOGY_SWITCH_KIND,
      name: 'SubRack_Switch',
      dataBinding: {
        dataSourceKey: 'devices',
        recordId: 'sw-sub'
      }
    }, {
      instanceId: 'ap-group',
      canvasId: TOPOLOGY_MAIN_CANVAS_ID,
      x: 520,
      y: 320,
      width: 100,
      height: 88,
      elementKind: TOPOLOGY_AP_KIND,
      name: 'AP Group',
      dataBinding: {
        dataSourceKey: 'devices',
        recordId: 'ap-group'
      }
    }],
    edges: [{
      id: 'e-gw-sw',
      sourceId: 'gw-1',
      targetId: 'sw-core',
      sourceAnchor: 'bottom',
      targetAnchor: 'top',
      sourceLabel: 'WAN',
      targetLabel: 'Gi48',
      status: 'online'
    }, {
      id: 'e-sw-sub',
      sourceId: 'sw-core',
      targetId: 'sw-sub',
      sourceAnchor: 'left',
      targetAnchor: 'top',
      sourceLabel: 'Gi1',
      targetLabel: 'Te51',
      status: 'online'
    }, {
      id: 'e-sw-ap',
      sourceId: 'sw-core',
      targetId: 'ap-group',
      sourceAnchor: 'right',
      targetAnchor: 'top',
      sourceLabel: 'Gi2',
      targetLabel: 'Po1',
      status: 'online'
    }]
  };
}
export var topologyMockDevices = [{
  id: 'gw-1',
  name: 'Gateway',
  model: 'EG310GH-E',
  status: 'online',
  ip: '192.168.1.1'
}, {
  id: 'sw-core',
  name: 'MainRack_CoreSW',
  model: 'Core SW',
  status: 'online',
  ip: '192.168.1.10'
}, {
  id: 'sw-sub',
  name: 'SubRack_Switch',
  status: 'offline',
  ip: '192.168.1.11'
}, {
  id: 'ap-group',
  name: 'AP Group',
  status: 'online',
  ip: '192.168.1.20'
}];
export function getTopologyMockDataSources(devices) {
  return {
    devices: (devices !== null && devices !== void 0 ? devices : topologyMockDevices).map(function (d) {
      return _objectSpread({}, d);
    })
  };
}