authscape 1.0.620 → 1.0.624

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -2577,19 +2577,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2577
2577
  Object.defineProperty(exports, "__esModule", {
2578
2578
  value: true
2579
2579
  });
2580
- exports.AssignMapping = AssignMapping;
2580
+ exports.NextImage = void 0;
2581
2581
  var _react = _interopRequireWildcard(require("react"));
2582
- var _system = require("@mui/system");
2583
- var _Container = _interopRequireDefault(require("@mui/material/Container"));
2584
- var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
2585
- var _material = require("@mui/material");
2586
- var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
2587
- var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
2588
- var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
2589
- var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
2590
- var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
2591
- var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
2592
- var _ArrowRightAltRounded = _interopRequireDefault(require("@mui/icons-material/ArrowRightAltRounded"));
2582
+ var _image = _interopRequireDefault(require("next/image"));
2593
2583
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
2594
2584
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
2595
2585
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -2601,3775 +2591,430 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructur
2601
2591
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
2602
2592
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
2603
2593
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
2604
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import { apiService } from 'authscape';
2605
- // import MappedColumn from './MappedColumn';
2606
- // import ConditionBasedTool from './conditionBasedTool';
2607
- // import SpreadsheetViewer from '../spreadsheetViewer';
2608
- function AssignMapping(_ref) {
2609
- var currentUser = _ref.currentUser,
2610
- documentComponentId = _ref.documentComponentId,
2611
- _ref$setIsLoading = _ref.setIsLoading,
2612
- setIsLoading = _ref$setIsLoading === void 0 ? null : _ref$setIsLoading,
2613
- _ref$onCancel = _ref.onCancel,
2614
- onCancel = _ref$onCancel === void 0 ? null : _ref$onCancel,
2615
- _ref$onPublished = _ref.onPublished,
2616
- onPublished = _ref$onPublished === void 0 ? null : _ref$onPublished;
2617
- var _useState = (0, _react.useState)(documentComponentId),
2594
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2595
+ var NextImage = function NextImage(_ref) {
2596
+ var src = _ref.src,
2597
+ alt = _ref.alt,
2598
+ _ref$width = _ref.width,
2599
+ width = _ref$width === void 0 ? 200 : _ref$width,
2600
+ _ref$height = _ref.height,
2601
+ height = _ref$height === void 0 ? 200 : _ref$height,
2602
+ _ref$objectFit = _ref.objectFit,
2603
+ objectFit = _ref$objectFit === void 0 ? "contain" : _ref$objectFit,
2604
+ _ref$enableAuth = _ref.enableAuth,
2605
+ enableAuth = _ref$enableAuth === void 0 ? false : _ref$enableAuth;
2606
+ var _useState = (0, _react.useState)(false),
2618
2607
  _useState2 = _slicedToArray(_useState, 2),
2619
- documentId = _useState2[0],
2620
- setDocumentId = _useState2[1];
2608
+ imageError = _useState2[0],
2609
+ setImageError = _useState2[1];
2621
2610
  var _useState3 = (0, _react.useState)(null),
2622
2611
  _useState4 = _slicedToArray(_useState3, 2),
2623
- fromColumnOptions = _useState4[0],
2624
- setFromColumnOptions = _useState4[1];
2625
- var _useState5 = (0, _react.useState)(null),
2626
- _useState6 = _slicedToArray(_useState5, 2),
2627
- toColumnOptions = _useState6[0],
2628
- setToColumnOptions = _useState6[1];
2629
- var _useState7 = (0, _react.useState)(null),
2630
- _useState8 = _slicedToArray(_useState7, 2),
2631
- documentType = _useState8[0],
2632
- setDocumentType = _useState8[1];
2633
- var _useState9 = (0, _react.useState)(null),
2634
- _useState10 = _slicedToArray(_useState9, 2),
2635
- documentName = _useState10[0],
2636
- setDocumentName = _useState10[1];
2637
- var _useState11 = (0, _react.useState)(1),
2638
- _useState12 = _slicedToArray(_useState11, 2),
2639
- urlTick = _useState12[0],
2640
- setURLTick = _useState12[1];
2641
- var _useState13 = (0, _react.useState)(null),
2642
- _useState14 = _slicedToArray(_useState13, 2),
2643
- spreadSheetAddress = _useState14[0],
2644
- setSpreadSheetAddress = _useState14[1];
2645
- var _useState15 = (0, _react.useState)(false),
2646
- _useState16 = _slicedToArray(_useState15, 2),
2647
- showPreviewDialog = _useState16[0],
2648
- setShowPreviewDialog = _useState16[1];
2649
- var _useState17 = (0, _react.useState)(null),
2650
- _useState18 = _slicedToArray(_useState17, 2),
2651
- advanceQuery = _useState18[0],
2652
- setAdvanceQuery = _useState18[1];
2653
- var spreadSheetRef = (0, _react.useRef)(null);
2654
- var fetchMappingTo = /*#__PURE__*/function () {
2655
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
2656
- var response;
2657
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2658
- while (1) switch (_context.prev = _context.next) {
2659
- case 0:
2660
- _context.next = 2;
2661
- return apiService().get("/DocumentMapping/GetMappedDynamicFieldsForCompany?companyId=" + currentUser.companyId + "&documentId=" + documentComponentId);
2662
- case 2:
2663
- response = _context.sent;
2664
- if (response != null) {
2665
- setToColumnOptions(response.data);
2666
- }
2667
- case 4:
2668
- case "end":
2669
- return _context.stop();
2670
- }
2671
- }, _callee);
2672
- }));
2673
- return function fetchMappingTo() {
2674
- return _ref2.apply(this, arguments);
2675
- };
2676
- }();
2677
- var fetchMappingFrom = /*#__PURE__*/function () {
2678
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
2679
- var response;
2680
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2681
- while (1) switch (_context2.prev = _context2.next) {
2682
- case 0:
2683
- _context2.next = 2;
2684
- return apiService().post("/DocumentMapping/GetMapping", {
2685
- documentComponentId: documentComponentId,
2686
- companyId: currentUser.companyId
2687
- });
2688
- case 2:
2689
- response = _context2.sent;
2690
- if (response != null) {
2691
- setFromColumnOptions(response.data.documentMappings);
2692
- setDocumentName(response.data.name);
2693
- setDocumentType(response.data.documentType);
2694
- }
2695
- case 4:
2696
- case "end":
2697
- return _context2.stop();
2698
- }
2699
- }, _callee2);
2700
- }));
2701
- return function fetchMappingFrom() {
2702
- return _ref3.apply(this, arguments);
2703
- };
2704
- }();
2612
+ imageSrc = _useState4[0],
2613
+ setImageSrc = _useState4[1];
2705
2614
  (0, _react.useEffect)(function () {
2706
- if (documentComponentId != null) {
2707
- if (setIsLoading != null) {
2708
- setIsLoading(true);
2709
- }
2710
- setSpreadSheetAddress("/DocumentMappingPreview/PreviewMappedData?companyId=" + currentUser.companyId + "&documentComponentId=" + documentComponentId);
2615
+ if (enableAuth) {
2711
2616
  var fetchData = /*#__PURE__*/function () {
2712
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
2713
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
2714
- while (1) switch (_context3.prev = _context3.next) {
2617
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
2618
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2619
+ while (1) switch (_context.prev = _context.next) {
2715
2620
  case 0:
2716
- _context3.next = 2;
2717
- return fetchMappingFrom();
2621
+ _context.next = 2;
2622
+ return apiService().DownloadFile(src, "", function (data) {
2623
+ setImageSrc(data);
2624
+ }, true);
2718
2625
  case 2:
2719
- _context3.next = 4;
2720
- return fetchMappingTo();
2721
- case 4:
2722
- if (setIsLoading != null) {
2723
- setIsLoading(false);
2724
- }
2725
- case 5:
2726
2626
  case "end":
2727
- return _context3.stop();
2627
+ return _context.stop();
2728
2628
  }
2729
- }, _callee3);
2629
+ }, _callee);
2730
2630
  }));
2731
2631
  return function fetchData() {
2732
- return _ref4.apply(this, arguments);
2632
+ return _ref2.apply(this, arguments);
2733
2633
  };
2734
2634
  }();
2735
2635
  fetchData();
2736
2636
  }
2737
- }, [documentComponentId]);
2738
- return /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_Container["default"], {
2739
- maxWidth: "xl",
2740
- sx: {
2741
- marginTop: 2
2742
- }
2743
- }, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
2744
- container: true,
2745
- spacing: 2
2746
- }, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
2747
- item: true,
2748
- xs: 6
2749
- }, /*#__PURE__*/_react["default"].createElement(_system.Box, {
2750
- sx: {
2751
- position: "sticky",
2752
- top: 20
2753
- }
2754
- }, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
2755
- variant: "h4",
2756
- gutterBottom: true,
2757
- sx: {
2758
- paddingBottom: 2
2759
- }
2760
- }, "File Uploaded: ", /*#__PURE__*/_react["default"].createElement("br", null), " ", documentName), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
2761
- variant: "subtitle1",
2762
- gutterBottom: true,
2763
- sx: {
2764
- paddingBottom: 2
2765
- }
2766
- }, "You have ", fromColumnOptions != null && fromColumnOptions.length, " columns that can be created or mapped"), /*#__PURE__*/_react["default"].createElement(_material.Button, {
2767
- variant: "outlined",
2768
- sx: {
2769
- marginRight: 2
2770
- },
2771
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
2772
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
2773
- while (1) switch (_context4.prev = _context4.next) {
2774
- case 0:
2775
- if (onCancel != null) {
2776
- onCancel();
2777
- }
2778
- case 1:
2779
- case "end":
2780
- return _context4.stop();
2781
- }
2782
- }, _callee4);
2783
- }))
2784
- }, "Cancel"), /*#__PURE__*/_react["default"].createElement(_material.Button, {
2785
- variant: "contained",
2786
- endIcon: /*#__PURE__*/_react["default"].createElement(_ArrowRightAltRounded["default"], null),
2787
- sx: {
2788
- marginRight: 2
2789
- },
2790
- onClick: function onClick() {
2791
- setShowPreviewDialog(true);
2792
- }
2793
- }, "Next, Preview your mapping"))), /*#__PURE__*/_react["default"].createElement(_material.Grid, {
2794
- item: true,
2795
- xs: 5
2796
- }, fromColumnOptions != null && fromColumnOptions.map(function (column) {
2797
- return /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(MappedColumn, {
2798
- companyId: currentUser.companyId,
2799
- documentId: documentId,
2800
- documentType: documentType,
2801
- documentMappingId: column.id,
2802
- name: column.name,
2803
- toName: column.toName,
2804
- isMapped: column.toName == null || column.toName == "" ? true : false,
2805
- toOptions: toColumnOptions,
2806
- onResponse: function onResponse() {
2807
- fetchMappingFrom();
2808
- fetchMappingTo();
2809
- }
2810
- }));
2811
- })))), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
2812
- open: showPreviewDialog,
2813
- onClose: function onClose() {
2814
- setShowPreviewDialog(false);
2637
+ }, [enableAuth]);
2638
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, enableAuth && imageSrc != null && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_image["default"], {
2639
+ src: imageError ? process.env.fallbackImageSrc : imageSrc,
2640
+ alt: alt,
2641
+ width: width,
2642
+ height: height,
2643
+ style: {
2644
+ objectFit: objectFit
2815
2645
  },
2816
- fullWidth: true,
2817
- maxWidth: "xl",
2818
- "aria-labelledby": "alert-dialog-title",
2819
- "aria-describedby": "alert-dialog-description"
2820
- }, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
2821
- id: "alert-dialog-title",
2822
- sx: {
2823
- fontSize: "25px",
2824
- paddingTop: 4
2825
- }
2826
- }, "Preview your mapping"), /*#__PURE__*/_react["default"].createElement(_system.Box, {
2827
- sx: {
2828
- paddingLeft: 3
2646
+ onError: function onError() {
2647
+ return setImageError(true);
2829
2648
  }
2830
- }, "Ensure that the data uploaded is accurately mapped and all (Required) fields are completed."), /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
2831
- "aria-label": "close",
2832
- onClick: function onClick() {
2833
- setShowPreviewDialog(false);
2649
+ })), !enableAuth && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_image["default"], {
2650
+ src: imageError ? process.env.fallbackImageSrc : src,
2651
+ alt: alt,
2652
+ width: width,
2653
+ height: height,
2654
+ style: {
2655
+ objectFit: objectFit
2834
2656
  },
2835
- sx: {
2836
- position: 'absolute',
2837
- right: 8,
2838
- top: 8,
2839
- color: function color(theme) {
2840
- return theme.palette.grey[500];
2841
- }
2842
- }
2843
- }, /*#__PURE__*/_react["default"].createElement(_Close["default"], null)), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_system.Box, {
2844
- sx: {
2845
- paddingBottom: 1
2846
- }
2847
- }, /*#__PURE__*/_react["default"].createElement(ConditionBasedTool, {
2848
- toColumnOptions: toColumnOptions,
2849
- documentId: documentId,
2850
- onConditionApplied: function onConditionApplied(currentQuery) {
2851
- var incrementNum = urlTick + 1;
2852
- setURLTick(incrementNum);
2853
- setAdvanceQuery(currentQuery);
2854
-
2855
- // setSpreadSheetAddress("/DocumentMappingPreview/PreviewMappedData?companyId=" + currentUser.companyId + "&documentComponentId=" + documentComponentId + "&tick=" + incrementNum);
2856
- }
2857
- })), spreadSheetAddress != null && /*#__PURE__*/_react["default"].createElement(SpreadsheetViewer, {
2858
- ref: spreadSheetRef,
2859
- url: spreadSheetAddress,
2860
- advanceQuery: advanceQuery,
2861
- currentUser: currentUser,
2862
- hideToolbar: true,
2863
- loadedUser: true
2864
- })), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_material.Button, {
2865
- onClick: function onClick() {
2866
- setShowPreviewDialog(false);
2657
+ onError: function onError() {
2658
+ return setImageError(true);
2867
2659
  }
2868
- }, "Cancel"), /*#__PURE__*/_react["default"].createElement(_material.Button, {
2869
- variant: "contained",
2870
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
2871
- var publishedRows, response;
2872
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
2873
- while (1) switch (_context5.prev = _context5.next) {
2874
- case 0:
2875
- if (setIsLoading != null) {
2876
- setIsLoading(true);
2877
- }
2878
- publishedRows = spreadSheetRef.current.getRows();
2879
- _context5.next = 4;
2880
- return apiService().post("/DocumentMapping/Publish", {
2881
- companyId: currentUser.companyId,
2882
- documentId: documentId,
2883
- publishedRows: publishedRows
2884
- });
2885
- case 4:
2886
- response = _context5.sent;
2887
- if (response != null && response.status == 200) {
2888
- setShowPreviewDialog(false);
2889
- if (onPublished != null) {
2890
- onPublished();
2891
- }
2892
- } else {
2893
- alert(JSON.stringify(response.data));
2894
- }
2895
- if (setIsLoading != null) {
2896
- setIsLoading(false);
2897
- }
2898
- case 7:
2899
- case "end":
2900
- return _context5.stop();
2901
- }
2902
- }, _callee5);
2903
- }))
2904
- }, "Publish"))));
2905
- }
2660
+ })));
2661
+ };
2662
+ exports.NextImage = NextImage;
2906
2663
  "use strict";
2907
2664
 
2908
2665
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2909
2666
  Object.defineProperty(exports, "__esModule", {
2910
2667
  value: true
2911
2668
  });
2912
- exports.ConditionBasedTool = ConditionBasedTool;
2669
+ exports.PageToPDF = void 0;
2913
2670
  var _react = _interopRequireWildcard(require("react"));
2671
+ var _Box = _interopRequireDefault(require("@mui/material/Box"));
2672
+ var _html2canvas = _interopRequireDefault(require("html2canvas"));
2673
+ var _jspdf = require("jspdf");
2914
2674
  var _Button = _interopRequireDefault(require("@mui/material/Button"));
2915
- var _system = require("@mui/system");
2916
- var _Accordion = _interopRequireDefault(require("@mui/material/Accordion"));
2917
- var _AccordionSummary = _interopRequireDefault(require("@mui/material/AccordionSummary"));
2918
- var _AccordionDetails = _interopRequireDefault(require("@mui/material/AccordionDetails"));
2919
- var _ExpandMore = _interopRequireDefault(require("@mui/icons-material/ExpandMore"));
2920
- var _reactQuerybuilder = require("react-querybuilder");
2675
+ var _DownloadRounded = _interopRequireDefault(require("@mui/icons-material/DownloadRounded"));
2921
2676
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
2922
2677
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
2923
2678
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
2924
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
2925
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
2926
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
2927
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2928
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
2929
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
2930
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
2931
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
2932
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import { apiService, FileUploader} from 'authscape';
2933
- function ConditionBasedTool(_ref) {
2934
- var toColumnOptions = _ref.toColumnOptions,
2935
- documentId = _ref.documentId,
2936
- onConditionApplied = _ref.onConditionApplied;
2937
- var _useState = (0, _react.useState)(null),
2938
- _useState2 = _slicedToArray(_useState, 2),
2939
- currentQuery = _useState2[0],
2940
- setCurrentQuery = _useState2[1];
2941
-
2942
- // const fields = [
2943
- // { name: 'firstName', label: 'First Name' },
2944
- // { name: 'lastName', label: 'Last Name' }
2945
- // ];
2946
-
2947
- (0, _react.useEffect)(function () {
2948
- if (documentId != null) {
2949
- var fetchData = /*#__PURE__*/function () {
2950
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
2951
- var response;
2952
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2953
- while (1) switch (_context.prev = _context.next) {
2954
- case 0:
2955
- _context.next = 2;
2956
- return apiService().get("/DocumentMapping/GetRules?documentComponentId=" + documentId);
2957
- case 2:
2958
- response = _context.sent;
2959
- if (response != null && response.status == 200) {
2960
- if (response.data != null && response.data != "") {
2961
- setCurrentQuery(response.data);
2962
- } else {
2963
- setCurrentQuery(null);
2964
- }
2965
- }
2966
- case 4:
2967
- case "end":
2968
- return _context.stop();
2969
- }
2970
- }, _callee);
2971
- }));
2972
- return function fetchData() {
2973
- return _ref2.apply(this, arguments);
2974
- };
2975
- }();
2976
- fetchData();
2977
- }
2978
- }, [documentId]);
2979
- var getFields = function getFields() {
2980
- var fields = [];
2981
- for (var index = 0; index < toColumnOptions.length; index++) {
2982
- var toColumn = toColumnOptions[index];
2983
- if (toColumn.isMapped)
2984
- // only show filters that are mapped
2985
- {
2986
- fields.push({
2987
- name: toColumn.name,
2988
- label: toColumn.visibleName
2989
- });
2990
- }
2991
- }
2992
- return fields;
2993
- };
2994
- var customOperators = [{
2995
- name: 'contains',
2996
- label: 'Contains'
2997
- }, {
2998
- name: 'notContains',
2999
- label: 'Does not contain'
3000
- }];
3001
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_Accordion["default"], null, /*#__PURE__*/_react["default"].createElement(_AccordionSummary["default"], {
3002
- expandIcon: /*#__PURE__*/_react["default"].createElement(_ExpandMore["default"], null),
3003
- "aria-controls": "panel1-content",
3004
- id: "panel1-header"
3005
- }, "Advance filtering"), /*#__PURE__*/_react["default"].createElement(_AccordionDetails["default"], null, /*#__PURE__*/_react["default"].createElement(_reactQuerybuilder.QueryBuilder, {
3006
- fields: getFields(),
3007
- operators: customOperators,
3008
- query: currentQuery,
3009
- onQueryChange: setCurrentQuery
3010
- }), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
3011
- variant: "contained",
3012
- sx: {
3013
- marginTop: 1
3014
- },
3015
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
3016
- var response;
3017
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3018
- while (1) switch (_context2.prev = _context2.next) {
3019
- case 0:
3020
- _context2.next = 2;
3021
- return apiService().put("/DocumentMapping/ApplyFilterForViewer", {
3022
- documentComponentId: documentId,
3023
- rules: JSON.stringify(currentQuery)
3024
- });
3025
- case 2:
3026
- response = _context2.sent;
3027
- if (response != null && response.status == 200) {
3028
- onConditionApplied(currentQuery);
3029
- }
3030
- case 4:
3031
- case "end":
3032
- return _context2.stop();
3033
- }
3034
- }, _callee2);
3035
- }))
3036
- }, "Apply Filter")))));
3037
- }
2679
+ var PageToPDF = function PageToPDF(_ref) {
2680
+ var _ref$buttonText = _ref.buttonText,
2681
+ buttonText = _ref$buttonText === void 0 ? "Download" : _ref$buttonText,
2682
+ _ref$startIcon = _ref.startIcon,
2683
+ startIcon = _ref$startIcon === void 0 ? /*#__PURE__*/_react["default"].createElement(_DownloadRounded["default"], null) : _ref$startIcon,
2684
+ _ref$variant = _ref.variant,
2685
+ variant = _ref$variant === void 0 ? "contained" : _ref$variant,
2686
+ elementById = _ref.elementById,
2687
+ _ref$scale = _ref.scale,
2688
+ scale = _ref$scale === void 0 ? 2 : _ref$scale,
2689
+ _ref$showHideClassEle = _ref.showHideClassElements,
2690
+ showHideClassElements = _ref$showHideClassEle === void 0 ? [] : _ref$showHideClassEle,
2691
+ _ref$fileName = _ref.fileName,
2692
+ fileName = _ref$fileName === void 0 ? "download" : _ref$fileName;
2693
+ var onHideElements = function onHideElements() {
2694
+ for (var index = 0; index < showHideClassElements.length; index++) {
2695
+ var element = showHideClassElements[index];
2696
+ var elements = document.getElementsByClassName(element);
2697
+ for (var i = 0; i < elements.length; i++) {
2698
+ elements[i].style.display = "none";
2699
+ }
2700
+ }
2701
+ };
2702
+ var onShowElements = function onShowElements() {
2703
+ for (var index = 0; index < showHideClassElements.length; index++) {
2704
+ var element = showHideClassElements[index];
2705
+ var elements = document.getElementsByClassName(element);
2706
+ for (var i = 0; i < elements.length; i++) {
2707
+ elements[i].style.display = "block";
2708
+ }
2709
+ }
2710
+ };
2711
+ var printElement = function printElement() {
2712
+ onHideElements();
2713
+ var input = document.getElementById(elementById);
2714
+ (0, _html2canvas["default"])(input, {
2715
+ backgroundColor: null,
2716
+ scale: scale
2717
+ }).then(function (canvas) {
2718
+ var imgData = canvas.toDataURL("image/png", 1.0);
2719
+ var pdf = new _jspdf.jsPDF();
2720
+ var pdfWidth = pdf.internal.pageSize.getWidth();
2721
+ var pdfHeight = pdf.internal.pageSize.getHeight();
2722
+ var imgWidth = canvas.width;
2723
+ var imgHeight = canvas.height;
2724
+ var scaleFactor = Math.min(pdfWidth / imgWidth, pdfHeight / imgHeight);
2725
+ var scaledWidth = imgWidth * scaleFactor;
2726
+ var scaledHeight = imgHeight * scaleFactor;
2727
+ var x = (pdfWidth - scaledWidth) / 2;
2728
+ var y = 0; // Set y coordinate to 0 to align to the top
2729
+ pdf.addImage(imgData, "PNG", x, y, scaledWidth, scaledHeight);
2730
+ pdf.save(fileName + ".pdf");
2731
+ });
2732
+ onShowElements();
2733
+ };
2734
+ return /*#__PURE__*/_react["default"].createElement(_Box["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
2735
+ startIcon: startIcon,
2736
+ variant: variant,
2737
+ onClick: function onClick() {
2738
+ printElement();
2739
+ }
2740
+ }, buttonText));
2741
+ };
2742
+ exports.PageToPDF = PageToPDF;
3038
2743
  "use strict";
3039
2744
 
3040
2745
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3041
2746
  Object.defineProperty(exports, "__esModule", {
3042
2747
  value: true
3043
2748
  });
3044
- exports.Datasources = Datasources;
2749
+ exports.Pricing = Pricing;
3045
2750
  var _react = _interopRequireWildcard(require("react"));
3046
- var _Button = _interopRequireDefault(require("@mui/material/Button"));
3047
2751
  var _system = require("@mui/system");
3048
- var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
3049
- var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
3050
- var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
3051
- var _DialogContentText = _interopRequireDefault(require("@mui/material/DialogContentText"));
3052
- var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
3053
- var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
2752
+ var _material = require("@mui/material");
2753
+ var _ChevronRightRounded = _interopRequireDefault(require("@mui/icons-material/ChevronRightRounded"));
3054
2754
  var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
3055
2755
  var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
3056
2756
  var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
3057
2757
  var _Select = _interopRequireDefault(require("@mui/material/Select"));
3058
- var _Radio = _interopRequireDefault(require("@mui/material/Radio"));
3059
- var _RadioGroup = _interopRequireDefault(require("@mui/material/RadioGroup"));
3060
- var _FormControlLabel = _interopRequireDefault(require("@mui/material/FormControlLabel"));
3061
- var _FormLabel = _interopRequireDefault(require("@mui/material/FormLabel"));
2758
+ var _reactHookForm = require("react-hook-form");
3062
2759
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
3063
2760
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
3064
2761
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
3065
2762
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
3066
2763
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
3067
2764
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
3068
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3069
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3070
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
3071
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
3072
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
3073
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import {apiService, authService, StripeConnect, ReactDraft, EditableDatagrid, FileUploader} from 'authscape';
3074
- function Datasources(_ref) {
3075
- var _ref$disableTraining = _ref.disableTraining,
3076
- disableTraining = _ref$disableTraining === void 0 ? false : _ref$disableTraining;
3077
- var documentColumns = [{
3078
- field: 'name',
3079
- headerName: 'Name',
3080
- width: 150,
3081
- editable: false
3082
- }, {
3083
- field: "type",
3084
- type: "actions",
3085
- width: 200,
3086
- flex: 1,
3087
- headerName: "Data Source",
3088
- getActions: function getActions(_ref2) {
3089
- var id = _ref2.id,
3090
- row = _ref2.row;
3091
- return [/*#__PURE__*/_react["default"].createElement(_system.Box, {
3092
- sx: {
3093
- textAlign: "left"
3094
- }
3095
- }, row.type == 0 ? "Database" : "", row.type == 1 ? "Dynamic Mapping" : "", row.type == 2 ? "Custom Model" : "")];
3096
- }
3097
- }, {
3098
- field: "Detail",
3099
- type: "actions",
3100
- width: 200,
3101
- flex: 1,
3102
- headerName: "Mapping To",
3103
- getActions: function getActions(_ref3) {
3104
- var id = _ref3.id,
3105
- row = _ref3.row;
3106
- return [/*#__PURE__*/_react["default"].createElement(_system.Box, {
3107
- sx: {
3108
- textAlign: "left"
3109
- }
3110
- }, row.type == 0 ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, "Table: ", row.tableName) : "", row.type == 1 ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, "Database driven mapping") : "", row.type == 2 ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, "Type Name: ", row.typeName, /*#__PURE__*/_react["default"].createElement("br", null), " Assembly Fullname: ", row.assemblyFullName) : "")];
2765
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2766
+ function Pricing(_ref) {
2767
+ var _ref$title = _ref.title,
2768
+ title = _ref$title === void 0 ? null : _ref$title,
2769
+ _ref$tiers = _ref.tiers,
2770
+ tiers = _ref$tiers === void 0 ? [] : _ref$tiers,
2771
+ _ref$features = _ref.features,
2772
+ features = _ref$features === void 0 ? null : _ref$features,
2773
+ _ref$onButtonClicked = _ref.onButtonClicked,
2774
+ onButtonClicked = _ref$onButtonClicked === void 0 ? null : _ref$onButtonClicked;
2775
+ var _useForm = (0, _reactHookForm.useForm)(),
2776
+ control = _useForm.control,
2777
+ register = _useForm.register,
2778
+ handleSubmit = _useForm.handleSubmit,
2779
+ errors = _useForm.formState.errors,
2780
+ watch = _useForm.watch,
2781
+ setValue = _useForm.setValue;
2782
+ var calculateQty = function calculateQty(qty) {
2783
+ var newMax = qty.minQty + qty.maxQty;
2784
+ var menuItemArray = [];
2785
+ var newIndex = 1;
2786
+ for (var index = qty.minQty; index < newMax; index++) {
2787
+ menuItemArray[newIndex] = newIndex;
2788
+ newIndex++;
3111
2789
  }
3112
- }
3113
- // {
3114
- // field: "actions",
3115
- // type: "actions",
3116
- // width: 200,
3117
- // headerName: "Archive",
3118
- // cellClassName: "actions",
3119
- // getActions: ({ id, row }) => {
3120
- // return [
3121
- // <GridActionsCellItem key={id}
3122
- // icon={<DeleteRoundedIcon />}
3123
- // label="Archive"
3124
- // className="textPrimary"
3125
- // onClick={async () => {
3126
-
3127
- // let documentMappingId = "";
3128
- // let documentComponentId = "";
3129
-
3130
- // // archive the column
3131
- // await apiService().delete("/DocumentMapping/RemoveColumnFromDocumentComponent?documentMappingId=" + documentMappingId + "&documentComponentId=" + documentComponentId)
3132
-
3133
- // }}
3134
- // />,
3135
- // ];
3136
- // },
3137
- // }
3138
- ];
3139
-
3140
- var refDatabaseTableSelect = (0, _react.useRef)(null);
3141
- var refNewDocTypeName = (0, _react.useRef)(null);
3142
- var _useState = (0, _react.useState)(0),
3143
- _useState2 = _slicedToArray(_useState, 2),
3144
- dataGridRefreshKey = _useState2[0],
3145
- setDataGridRefreshKey = _useState2[1];
3146
- var _useState3 = (0, _react.useState)(null),
3147
- _useState4 = _slicedToArray(_useState3, 2),
3148
- document = _useState4[0],
3149
- setDocument = _useState4[1];
3150
- var _useState5 = (0, _react.useState)(false),
3151
- _useState6 = _slicedToArray(_useState5, 2),
3152
- showDatasource = _useState6[0],
3153
- setShowDatasource = _useState6[1];
3154
- var _useState7 = (0, _react.useState)(null),
3155
- _useState8 = _slicedToArray(_useState7, 2),
3156
- databaseTables = _useState8[0],
3157
- setDatabaseTables = _useState8[1];
3158
- var _useState9 = (0, _react.useState)("database"),
3159
- _useState10 = _slicedToArray(_useState9, 2),
3160
- mappingType = _useState10[0],
3161
- setMappingType = _useState10[1];
3162
- var refTypeName = (0, _react.useRef)(null);
3163
- var refAssemblyFullName = (0, _react.useRef)(null);
3164
- (0, _react.useEffect)(function () {
3165
- var fetchData = /*#__PURE__*/function () {
3166
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3167
- var response;
3168
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3169
- while (1) switch (_context.prev = _context.next) {
3170
- case 0:
3171
- _context.next = 2;
3172
- return apiService().get("/DocumentMapping/GetTablesFromDatabase");
3173
- case 2:
3174
- response = _context.sent;
3175
- if (response != null && response.status == 200) {
3176
- setDatabaseTables(response.data);
3177
- }
3178
- case 4:
3179
- case "end":
3180
- return _context.stop();
3181
- }
3182
- }, _callee);
3183
- }));
3184
- return function fetchData() {
3185
- return _ref4.apply(this, arguments);
3186
- };
3187
- }();
3188
- fetchData();
3189
- }, []);
2790
+ return menuItemArray;
2791
+ };
3190
2792
  return /*#__PURE__*/_react["default"].createElement(_system.Box, {
3191
2793
  sx: {
3192
- marginTop: 6
3193
- }
3194
- }, /*#__PURE__*/_react["default"].createElement(_system.Box, null, !disableTraining && /*#__PURE__*/_react["default"].createElement(_system.Box, {
3195
- sx: {
3196
- textAlign: "right",
3197
- marginBottom: 2
3198
- }
3199
- }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
3200
- variant: "contained",
3201
- onClick: function onClick() {
3202
- setShowDatasource(true);
3203
- }
3204
- }, "Add Data Source")), /*#__PURE__*/_react["default"].createElement(EditableDatagrid, {
3205
- key: dataGridRefreshKey,
3206
- loadedUser: true,
3207
- url: "/DocumentMapping/GetDocumentTypes",
3208
- columns: documentColumns
3209
- })), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
3210
- open: showDatasource,
3211
- onClose: function onClose() {
3212
- setShowDatasource(false);
3213
- },
3214
- "aria-labelledby": "alert-dialog-title",
3215
- "aria-describedby": "alert-dialog-description"
3216
- }, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
3217
- id: "alert-dialog-title"
3218
- }, "Data Source"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
3219
- id: "alert-dialog-description"
3220
- }, "A data source is a place or system where data is stored and collected. It can be a database, file, web service, or sensor. Data is extracted, transformed, and used for analysis and other purposes. Managing data sources is crucial for data-driven decision-making."), /*#__PURE__*/_react["default"].createElement(_system.Box, {
3221
- sx: {
3222
- marginTop: 3
3223
- }
3224
- }, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
3225
- inputRef: refNewDocTypeName,
3226
- label: "Name for data source",
3227
- variant: "outlined",
3228
- fullWidth: true
3229
- })), /*#__PURE__*/_react["default"].createElement(_system.Box, {
3230
- sx: {
3231
- marginTop: 2
3232
- }
3233
- }, /*#__PURE__*/_react["default"].createElement(_FormControl["default"], null, /*#__PURE__*/_react["default"].createElement(_FormLabel["default"], {
3234
- id: "demo-row-radio-buttons-group-label"
3235
- }, "How the data will connect:"), /*#__PURE__*/_react["default"].createElement(_RadioGroup["default"], {
3236
- value: mappingType,
3237
- row: true,
3238
- "aria-labelledby": "demo-row-radio-buttons-group-label",
3239
- name: "row-radio-buttons-group",
3240
- onChange: function onChange(env) {
3241
- setMappingType(env.currentTarget.value);
3242
- }
3243
- }, /*#__PURE__*/_react["default"].createElement(_FormControlLabel["default"], {
3244
- value: "database",
3245
- control: /*#__PURE__*/_react["default"].createElement(_Radio["default"], null),
3246
- label: "Database"
3247
- }), /*#__PURE__*/_react["default"].createElement(_FormControlLabel["default"], {
3248
- value: "mappingTable",
3249
- control: /*#__PURE__*/_react["default"].createElement(_Radio["default"], null),
3250
- label: "Dynamic Mapping Table"
3251
- }), /*#__PURE__*/_react["default"].createElement(_FormControlLabel["default"], {
3252
- value: "customModelMapping",
3253
- control: /*#__PURE__*/_react["default"].createElement(_Radio["default"], null),
3254
- label: "Custom Model"
3255
- })))), mappingType == "database" && /*#__PURE__*/_react["default"].createElement(_system.Box, {
3256
- sx: {
3257
- marginTop: 2
3258
- }
3259
- }, /*#__PURE__*/_react["default"].createElement(_system.Box, {
3260
- sx: {
3261
- minWidth: 120
3262
- }
3263
- }, /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
3264
- fullWidth: true
3265
- }, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
3266
- id: "demo-simple-select-label"
3267
- }, "Database Tables"), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
3268
- inputRef: refDatabaseTableSelect,
3269
- labelId: "demo-simple-select-label",
3270
- label: "Age"
3271
- }, databaseTables != null && databaseTables.map(function (table, index) {
3272
- return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
3273
- value: table.tableName
3274
- }, table.tableName);
3275
- }))))), mappingType == "customModelMapping" && /*#__PURE__*/_react["default"].createElement(_system.Box, {
3276
- sx: {
3277
- marginTop: 2
3278
- }
3279
- }, /*#__PURE__*/_react["default"].createElement(_system.Box, {
3280
- sx: {
3281
- minWidth: 120
3282
- }
3283
- }, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
3284
- inputRef: refTypeName,
3285
- label: "Type Name (Example: API.Controllers.InvoiceUpload)",
3286
- variant: "outlined",
3287
- fullWidth: true,
3288
- sx: {
3289
- marginTop: 1
3290
- }
3291
- }), /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
3292
- inputRef: refAssemblyFullName,
3293
- label: "Assembly Full Name (Example: API)",
3294
- variant: "outlined",
3295
- fullWidth: true,
3296
- sx: {
3297
- marginTop: 1
3298
- }
3299
- })))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
3300
- onClick: function onClick() {
3301
- setShowDatasource(false);
3302
- }
3303
- }, "Cancel"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
3304
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
3305
- var response, _response;
3306
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3307
- while (1) switch (_context2.prev = _context2.next) {
3308
- case 0:
3309
- if (!(mappingType == "customModelMapping")) {
3310
- _context2.next = 7;
3311
- break;
3312
- }
3313
- _context2.next = 3;
3314
- return apiService().post("/DocumentMapping/AddDataSource", {
3315
- name: refNewDocTypeName.current.value,
3316
- dataTable: refNewDocTypeName.current.value,
3317
- documentType: 2,
3318
- typeName: refTypeName.current.value,
3319
- assemblyFullName: refAssemblyFullName.current.value
3320
- });
3321
- case 3:
3322
- response = _context2.sent;
3323
- if (response != null && response.data.error != null) {
3324
- alert(response.data.error);
3325
- } else {
3326
- if (response != null && (response.status == 204 || response.status == 200)) {
3327
- setDataGridRefreshKey(dataGridRefreshKey + 1);
3328
- setShowDatasource(false);
3329
- }
3330
- }
3331
- _context2.next = 11;
3332
- break;
3333
- case 7:
3334
- _context2.next = 9;
3335
- return apiService().post("/DocumentMapping/AddDataSource", {
3336
- name: refNewDocTypeName.current.value,
3337
- dataTable: refDatabaseTableSelect.current != null ? refDatabaseTableSelect.current.value : "",
3338
- documentType: mappingType == "database" ? 0 : 1
3339
- });
3340
- case 9:
3341
- _response = _context2.sent;
3342
- if (_response != null && (_response.status == 204 || _response.status == 200)) {
3343
- setDataGridRefreshKey(dataGridRefreshKey + 1);
3344
- setShowDatasource(false);
3345
- }
3346
- case 11:
3347
- case "end":
3348
- return _context2.stop();
3349
- }
3350
- }, _callee2);
3351
- }))
3352
- }, "Add Data Source"))));
3353
- }
3354
- "use strict";
3355
-
3356
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3357
- Object.defineProperty(exports, "__esModule", {
3358
- value: true
3359
- });
3360
- exports.FileMapping = FileMapping;
3361
- var _react = _interopRequireWildcard(require("react"));
3362
- var _system = require("@mui/system");
3363
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
3364
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
3365
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3366
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3367
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
3368
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
3369
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
3370
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
3371
- // import ManageMappingDocuments from './manageMappingDocuments';
3372
- // import AssignMapping from './AssignMapping';
3373
-
3374
- function FileMapping(_ref) {
3375
- var currentUser = _ref.currentUser,
3376
- _ref$fileUploadName = _ref.fileUploadName,
3377
- fileUploadName = _ref$fileUploadName === void 0 ? "Upload Document" : _ref$fileUploadName,
3378
- _ref$hideDocumentMana = _ref.hideDocumentManager,
3379
- hideDocumentManager = _ref$hideDocumentMana === void 0 ? false : _ref$hideDocumentMana,
3380
- _ref$setIsLoading = _ref.setIsLoading,
3381
- setIsLoading = _ref$setIsLoading === void 0 ? null : _ref$setIsLoading,
3382
- _ref$documentTypeId = _ref.documentTypeId,
3383
- documentTypeId = _ref$documentTypeId === void 0 ? null : _ref$documentTypeId,
3384
- _ref$onOpened = _ref.onOpened,
3385
- onOpened = _ref$onOpened === void 0 ? null : _ref$onOpened,
3386
- _ref$onPublished = _ref.onPublished,
3387
- _onPublished = _ref$onPublished === void 0 ? null : _ref$onPublished,
3388
- _ref$onCanceled = _ref.onCanceled,
3389
- onCanceled = _ref$onCanceled === void 0 ? null : _ref$onCanceled,
3390
- _ref$onArchived = _ref.onArchived,
3391
- onArchived = _ref$onArchived === void 0 ? null : _ref$onArchived;
3392
- var _useState = (0, _react.useState)(null),
3393
- _useState2 = _slicedToArray(_useState, 2),
3394
- documentComponentId = _useState2[0],
3395
- setDocumentComponentId = _useState2[1];
3396
- (0, _react.useEffect)(function () {
3397
- if (documentComponentId != null) {
3398
- if (onOpened != null) {
3399
- onOpened(documentComponentId);
3400
- }
3401
- }
3402
- }, [documentComponentId]);
3403
- return /*#__PURE__*/_react["default"].createElement(_system.Box, null, documentComponentId == null && /*#__PURE__*/_react["default"].createElement(ManageMappingDocuments, {
3404
- fileUploadName: fileUploadName,
3405
- documentTypeId: documentTypeId,
3406
- hideDocumentManager: hideDocumentManager,
3407
- companyId: currentUser != null ? currentUser.companyId : null,
3408
- onManageField: function onManageField(documentComponentId) {
3409
- setDocumentComponentId(documentComponentId);
3410
- },
3411
- onArchive: function onArchive(documentComponentId) {
3412
- //alert(documentComponentId);
3413
- if (onArchived != null) {
3414
- onArchived(documentComponentId);
3415
- }
2794
+ paddingTop: 2
3416
2795
  }
3417
- }), documentComponentId != null && /*#__PURE__*/_react["default"].createElement(AssignMapping, {
3418
- currentUser: currentUser,
3419
- setIsLoading: setIsLoading,
3420
- documentComponentId: documentComponentId,
3421
- onCancel: function onCancel() {
3422
- setDocumentComponentId(null);
3423
- if (onCanceled != null) {
3424
- onCanceled(documentComponentId);
3425
- }
3426
- },
3427
- onPublished: function onPublished() {
3428
- setDocumentComponentId(null);
3429
- if (_onPublished != null) {
3430
- _onPublished(documentComponentId);
2796
+ }, /*#__PURE__*/_react["default"].createElement("form", null, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
2797
+ container: true,
2798
+ spacing: 0,
2799
+ justifyContent: "center",
2800
+ alignItems: "stretch",
2801
+ direction: "row"
2802
+ }, title != null && /*#__PURE__*/_react["default"].createElement(_material.Grid, {
2803
+ item: true,
2804
+ xs: 12,
2805
+ sm: 6,
2806
+ md: 3,
2807
+ key: "plans"
2808
+ }, /*#__PURE__*/_react["default"].createElement(_material.Typography, {
2809
+ variant: "h4",
2810
+ gutterBottom: true
2811
+ }, title)), tiers.map(function (tier) {
2812
+ return /*#__PURE__*/_react["default"].createElement(_material.Grid, {
2813
+ item: true,
2814
+ xs: 12,
2815
+ sm: 6,
2816
+ md: 3,
2817
+ key: tier.title
2818
+ }, /*#__PURE__*/_react["default"].createElement(_system.Box, {
2819
+ sx: {
2820
+ paddingBottom: 2,
2821
+ padding: 2
3431
2822
  }
3432
- }
3433
- }));
3434
- }
3435
- "use strict";
3436
-
3437
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3438
- Object.defineProperty(exports, "__esModule", {
3439
- value: true
3440
- });
3441
- exports.ManageMappingDocuments = ManageMappingDocuments;
3442
- var _react = _interopRequireWildcard(require("react"));
3443
- var _Button = _interopRequireDefault(require("@mui/material/Button"));
3444
- var _system = require("@mui/system");
3445
- var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
3446
- var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
3447
- var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
3448
- var _DialogContentText = _interopRequireDefault(require("@mui/material/DialogContentText"));
3449
- var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
3450
- var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
3451
- var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
3452
- var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
3453
- var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
3454
- var _Select = _interopRequireDefault(require("@mui/material/Select"));
3455
- var _xDataGrid = require("@mui/x-data-grid");
3456
- var _DeleteRounded = _interopRequireDefault(require("@mui/icons-material/DeleteRounded"));
3457
- var _ListRounded = _interopRequireDefault(require("@mui/icons-material/ListRounded"));
3458
- var _PublishRounded = _interopRequireDefault(require("@mui/icons-material/PublishRounded"));
3459
- var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
3460
- var _DownloadRounded = _interopRequireDefault(require("@mui/icons-material/DownloadRounded"));
3461
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
3462
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
3463
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
3464
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
3465
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
3466
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
3467
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3468
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3469
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
3470
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
3471
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
3472
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import {apiService, authService, StripeConnect, ReactDraft, EditableDatagrid, FileUploader} from 'authscape';
3473
- function ManageMappingDocuments(_ref) {
3474
- var fileUploadName = _ref.fileUploadName,
3475
- _ref$hideDocumentMana = _ref.hideDocumentManager,
3476
- hideDocumentManager = _ref$hideDocumentMana === void 0 ? false : _ref$hideDocumentMana,
3477
- _ref$documentTypeId = _ref.documentTypeId,
3478
- documentTypeId = _ref$documentTypeId === void 0 ? null : _ref$documentTypeId,
3479
- _ref$companyId = _ref.companyId,
3480
- companyId = _ref$companyId === void 0 ? null : _ref$companyId,
3481
- _ref$locationId = _ref.locationId,
3482
- locationId = _ref$locationId === void 0 ? null : _ref$locationId,
3483
- _ref$userId = _ref.userId,
3484
- userId = _ref$userId === void 0 ? null : _ref$userId,
3485
- _ref$onManageField = _ref.onManageField,
3486
- onManageField = _ref$onManageField === void 0 ? null : _ref$onManageField,
3487
- _ref$onArchive = _ref.onArchive,
3488
- onArchive = _ref$onArchive === void 0 ? null : _ref$onArchive;
3489
- var _useState = (0, _react.useState)(null),
3490
- _useState2 = _slicedToArray(_useState, 2),
3491
- document = _useState2[0],
3492
- setDocument = _useState2[1];
3493
- var _useState3 = (0, _react.useState)(false),
3494
- _useState4 = _slicedToArray(_useState3, 2),
3495
- addColumnDialog = _useState4[0],
3496
- setAddColumnDialog = _useState4[1];
3497
- var _useState5 = (0, _react.useState)(false),
3498
- _useState6 = _slicedToArray(_useState5, 2),
3499
- showAddNewDocument = _useState6[0],
3500
- setShowAddNewDocument = _useState6[1];
3501
- var _useState7 = (0, _react.useState)(false),
3502
- _useState8 = _slicedToArray(_useState7, 2),
3503
- showTrainingDocument = _useState8[0],
3504
- setShowTrainingDocument = _useState8[1];
3505
- var _useState9 = (0, _react.useState)(''),
3506
- _useState10 = _slicedToArray(_useState9, 2),
3507
- columnName = _useState10[0],
3508
- setColumnName = _useState10[1];
3509
- var _useState11 = (0, _react.useState)(null),
3510
- _useState12 = _slicedToArray(_useState11, 2),
3511
- selectedAddedColumn = _useState12[0],
3512
- setSelectedAddedColumn = _useState12[1];
3513
- var _useState13 = (0, _react.useState)(null),
3514
- _useState14 = _slicedToArray(_useState13, 2),
3515
- documentMappingColumns = _useState14[0],
3516
- setDocumentMappingColumns = _useState14[1];
3517
- var _useState15 = (0, _react.useState)(null),
3518
- _useState16 = _slicedToArray(_useState15, 2),
3519
- toColumnOptions = _useState16[0],
3520
- setToColumnOptions = _useState16[1];
3521
- var _useState17 = (0, _react.useState)(null),
3522
- _useState18 = _slicedToArray(_useState17, 2),
3523
- removeDocument = _useState18[0],
3524
- setRemoveDocument = _useState18[1];
3525
- var _useState19 = (0, _react.useState)(null),
3526
- _useState20 = _slicedToArray(_useState19, 2),
3527
- selectedDocumentComponentId = _useState20[0],
3528
- setSelectedDocumentComponentId = _useState20[1];
3529
- var _useState21 = (0, _react.useState)(0),
3530
- _useState22 = _slicedToArray(_useState21, 2),
3531
- dataGridRefreshKey = _useState22[0],
3532
- setDataGridRefreshKey = _useState22[1];
3533
- var _useState23 = (0, _react.useState)(0),
3534
- _useState24 = _slicedToArray(_useState23, 2),
3535
- dataGridMappingRefreshKey = _useState24[0],
3536
- setDataGridMappingRefreshKey = _useState24[1];
3537
- var _useState25 = (0, _react.useState)(null),
3538
- _useState26 = _slicedToArray(_useState25, 2),
3539
- selectedDocument = _useState26[0],
3540
- setSelectedDocument = _useState26[1];
3541
- var _useState27 = (0, _react.useState)(0),
3542
- _useState28 = _slicedToArray(_useState27, 2),
3543
- status = _useState28[0],
3544
- setStatus = _useState28[1];
3545
- var _useState29 = (0, _react.useState)([]),
3546
- _useState30 = _slicedToArray(_useState29, 2),
3547
- componentTypes = _useState30[0],
3548
- setComponentTypes = _useState30[1];
3549
- var refHeaderRowInput = (0, _react.useRef)(null);
3550
- var fileUploaderRef = (0, _react.useRef)(null);
3551
- var refNewDocumentName = (0, _react.useRef)(null);
3552
- var refSelectDocumentType = (0, _react.useRef)(null);
3553
- var refNewColumnFileColumn = (0, _react.useRef)(null);
3554
- var documentColumns = [{
3555
- field: 'name',
3556
- flex: 1,
3557
- headerName: 'Document Name',
3558
- width: 150,
3559
- editable: false
3560
- }, {
3561
- field: 'documentTypeName',
3562
- flex: 1,
3563
- headerName: 'Document Type',
3564
- width: 150,
3565
- editable: false
3566
- }, {
3567
- field: "actions",
3568
- type: "actions",
3569
- width: 200,
3570
- flex: 1,
3571
- headerName: "",
3572
- cellClassName: "actions",
3573
- getActions: function getActions(_ref2) {
3574
- var id = _ref2.id,
3575
- row = _ref2.row;
3576
- return [/*#__PURE__*/_react["default"].createElement(_Button["default"], {
3577
- variant: "text",
3578
- startIcon: /*#__PURE__*/_react["default"].createElement(_ListRounded["default"], null),
3579
- onClick: function onClick() {
3580
- if (onManageField != null) {
3581
- onManageField(row.id);
3582
- }
3583
- }
3584
- }, "Manage Fields"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
3585
- variant: "text",
3586
- startIcon: /*#__PURE__*/_react["default"].createElement(_DownloadRounded["default"], null),
3587
- onClick: function onClick() {
3588
- window.open("https://view.officeapps.live.com/op/view.aspx?src=" + row.fileUri + "&wdOrigin=BROWSELINK");
2823
+ }, /*#__PURE__*/_react["default"].createElement(_system.Box, {
2824
+ sx: {
2825
+ textAlign: "center",
2826
+ paddingTop: 2
2827
+ }
2828
+ }, tier.image != null && /*#__PURE__*/_react["default"].createElement("img", {
2829
+ src: tier.image,
2830
+ width: 200,
2831
+ height: 200
2832
+ }), /*#__PURE__*/_react["default"].createElement(_material.Typography, {
2833
+ variant: "h3",
2834
+ component: "h2",
2835
+ sx: {
2836
+ paddingTop: 3
2837
+ }
2838
+ }, tier.title), tier.subTitle && /*#__PURE__*/_react["default"].createElement(_material.Typography, {
2839
+ variant: "h6",
2840
+ component: "h2",
2841
+ sx: {
2842
+ paddingTop: 2
2843
+ }
2844
+ }, tier.subTitle), /*#__PURE__*/_react["default"].createElement(_material.Grid, {
2845
+ container: true,
2846
+ spacing: 0
2847
+ }, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
2848
+ item: true,
2849
+ xs: tier.qty != null ? 6 : 12,
2850
+ sx: {
2851
+ padding: 4
2852
+ }
2853
+ }, /*#__PURE__*/_react["default"].createElement(_system.Box, {
2854
+ component: "span",
2855
+ sx: {
2856
+ fontSize: 30,
2857
+ fontWeight: "bold"
2858
+ }
2859
+ }, "$", tier.price), tier.duration != null && /*#__PURE__*/_react["default"].createElement(_system.Box, {
2860
+ component: "span"
2861
+ }, "/ ", tier.duration)), tier.qty != null && /*#__PURE__*/_react["default"].createElement(_material.Grid, {
2862
+ item: true,
2863
+ xs: 6,
2864
+ sx: {
2865
+ padding: 4
2866
+ }
2867
+ }, /*#__PURE__*/_react["default"].createElement(_reactHookForm.Controller, {
2868
+ name: "qty-" + tier.id,
2869
+ control: control,
2870
+ rules: {
2871
+ required: false
2872
+ },
2873
+ render: function render(_ref2) {
2874
+ var renderField = _ref2.renderField;
2875
+ return /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
2876
+ fullWidth: true
2877
+ }, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
2878
+ id: "demo-simple-select-label"
2879
+ }, "Quantity"), /*#__PURE__*/_react["default"].createElement(_Select["default"], _extends({}, register("qty-" + tier.id, {
2880
+ required: false
2881
+ }), renderField, {
2882
+ labelId: "demo-simple-select-label",
2883
+ id: "demo-simple-select",
2884
+ defaultValue: 1,
2885
+ label: "Quantity"
2886
+ }), calculateQty(tier.qty).map(function (menuItem, index) {
2887
+ return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
2888
+ key: index,
2889
+ value: menuItem
2890
+ }, menuItem);
2891
+ })));
2892
+ }
2893
+ }))), tier.modifiers != null && /*#__PURE__*/_react["default"].createElement(_system.Box, {
2894
+ sx: {
2895
+ paddingBottom: 2
2896
+ }
2897
+ }, tier.modifiers.map(function (modifier, index) {
2898
+ return /*#__PURE__*/_react["default"].createElement(_reactHookForm.Controller, {
2899
+ name: "modifier-" + tier.id + modifier.name,
2900
+ control: control,
2901
+ rules: {
2902
+ required: false
2903
+ },
2904
+ render: function render(_ref3) {
2905
+ var renderField = _ref3.renderField;
2906
+ return /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
2907
+ fullWidth: true,
2908
+ key: index,
2909
+ sx: {
2910
+ marginTop: 2
2911
+ }
2912
+ }, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
2913
+ id: "demo-simple-select-label"
2914
+ }, modifier.name), /*#__PURE__*/_react["default"].createElement(_Select["default"], _extends({}, register("modifier-" + tier.id + "-" + modifier.name, {
2915
+ required: false
2916
+ }), renderField, {
2917
+ labelId: "demo-simple-select-label",
2918
+ id: "demo-simple-select",
2919
+ defaultValue: 0,
2920
+ label: modifier.name
2921
+ }), modifier.options.map(function (mod, index) {
2922
+ return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
2923
+ key: index,
2924
+ value: index
2925
+ }, mod);
2926
+ })));
3589
2927
  }
3590
- }, "Download File"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
3591
- variant: "text",
3592
- startIcon: /*#__PURE__*/_react["default"].createElement(_DeleteRounded["default"], null),
3593
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3594
- var documentMappingId;
2928
+ });
2929
+ })), /*#__PURE__*/_react["default"].createElement(_material.Button, {
2930
+ fullWidth: true,
2931
+ variant: tier.buttonVariant,
2932
+ endIcon: /*#__PURE__*/_react["default"].createElement(_ChevronRightRounded["default"], null),
2933
+ sx: {
2934
+ height: 50
2935
+ },
2936
+ onClick: handleSubmit( /*#__PURE__*/function () {
2937
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
2938
+ var modifiers, qty, index, modifier;
3595
2939
  return _regeneratorRuntime().wrap(function _callee$(_context) {
3596
2940
  while (1) switch (_context.prev = _context.next) {
3597
2941
  case 0:
3598
- documentMappingId = row.id;
3599
- setRemoveDocument({
3600
- companyId: companyId,
3601
- documentMappingId: documentMappingId
3602
- });
3603
- case 2:
2942
+ modifiers = {};
2943
+ qty = null;
2944
+ if (tier.modifiers != null) {
2945
+ for (index = 0; index < tier.modifiers.length; index++) {
2946
+ modifier = tier.modifiers[index]; // assign the modifier as a property
2947
+ modifiers[modifier.name] = data["modifier-" + tier.id + "-" + modifier.name];
2948
+ }
2949
+ }
2950
+ if (tier.qty != null) {
2951
+ qty = parseInt(data["qty-" + tier.id]);
2952
+ }
2953
+ if (onButtonClicked != null) {
2954
+ onButtonClicked({
2955
+ id: tier.id,
2956
+ modifiers: modifiers,
2957
+ qty: qty
2958
+ });
2959
+ }
2960
+ case 5:
3604
2961
  case "end":
3605
2962
  return _context.stop();
3606
2963
  }
3607
2964
  }, _callee);
3608
- }))
3609
- }, "Remove")];
3610
- }
3611
- }];
3612
- (0, _react.useEffect)(function () {
3613
- if (document != null) {
3614
- var fetchData = /*#__PURE__*/function () {
3615
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
3616
- var response;
3617
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3618
- while (1) switch (_context3.prev = _context3.next) {
3619
- case 0:
3620
- _context3.next = 2;
3621
- return apiService().get("/DocumentMapping/GetMappingFieldsForDocument?documentId=" + document.id);
3622
- case 2:
3623
- response = _context3.sent;
3624
- if (response != null) {
3625
- setToColumnOptions(response.data);
3626
- setDocumentMappingColumns([{
3627
- field: 'name',
3628
- flex: 1,
3629
- headerName: 'File Column',
3630
- width: 150,
3631
- editable: true
3632
- }, {
3633
- field: 'toName',
3634
- headerName: 'Upload To',
3635
- flex: 1,
3636
- width: 150,
3637
- editable: true,
3638
- type: 'singleSelect',
3639
- valueOptions: response.data
3640
- }, {
3641
- field: "actions",
3642
- type: "actions",
3643
- width: 200,
3644
- headerName: "Archive Fields",
3645
- cellClassName: "actions",
3646
- getActions: function getActions(_ref5) {
3647
- var id = _ref5.id,
3648
- row = _ref5.row;
3649
- return [/*#__PURE__*/_react["default"].createElement(_xDataGrid.GridActionsCellItem, {
3650
- key: id,
3651
- icon: /*#__PURE__*/_react["default"].createElement(_DeleteRounded["default"], null),
3652
- label: "Archive",
3653
- className: "textPrimary",
3654
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
3655
- var documentMappingId, documentComponentId, response;
3656
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3657
- while (1) switch (_context2.prev = _context2.next) {
3658
- case 0:
3659
- documentMappingId = row.id;
3660
- documentComponentId = row.documentComponentId; // archive the column
3661
- _context2.next = 4;
3662
- return apiService()["delete"]("/DocumentMapping/RemoveColumnFromDocumentComponent?documentMappingId=" + documentMappingId + "&documentComponentId=" + documentComponentId);
3663
- case 4:
3664
- response = _context2.sent;
3665
- if (response != null && response.status == 200) {
3666
- setDataGridMappingRefreshKey(dataGridMappingRefreshKey + 1);
3667
- }
3668
- case 6:
3669
- case "end":
3670
- return _context2.stop();
3671
- }
3672
- }, _callee2);
3673
- }))
3674
- })];
3675
- }
3676
- }]);
3677
- }
3678
- case 4:
3679
- case "end":
3680
- return _context3.stop();
3681
- }
3682
- }, _callee3);
3683
2965
  }));
3684
- return function fetchData() {
2966
+ return function (_x) {
3685
2967
  return _ref4.apply(this, arguments);
3686
2968
  };
3687
- }();
3688
- fetchData();
3689
- }
3690
- }, [document]);
3691
- (0, _react.useEffect)(function () {
3692
- if (showAddNewDocument && documentTypeId == null) {
3693
- // get all document types
3694
- var fetchData = /*#__PURE__*/function () {
3695
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
3696
- var response;
3697
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3698
- while (1) switch (_context4.prev = _context4.next) {
3699
- case 0:
3700
- _context4.next = 2;
3701
- return apiService().post("/DocumentMapping/GetDocumentTypes");
3702
- case 2:
3703
- response = _context4.sent;
3704
- if (response != null && response.status == 200) {
3705
- setComponentTypes(response.data.data);
3706
- }
3707
- case 4:
3708
- case "end":
3709
- return _context4.stop();
3710
- }
3711
- }, _callee4);
3712
- }));
3713
- return function fetchData() {
3714
- return _ref7.apply(this, arguments);
3715
- };
3716
- }();
3717
- fetchData();
3718
- }
3719
- }, [showAddNewDocument, documentTypeId]);
3720
- var GetHeaderRowData = /*#__PURE__*/function () {
3721
- var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(documentComponentId) {
3722
- var response;
3723
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
3724
- while (1) switch (_context5.prev = _context5.next) {
3725
- case 0:
3726
- _context5.next = 2;
3727
- return apiService().get("/DocumentMapping/GetHeaderRow?documentComponentId=" + documentComponentId);
3728
- case 2:
3729
- response = _context5.sent;
3730
- if (response != null && response.status == 200) {
3731
- refHeaderRowInput.current.value = response.data;
3732
- }
3733
- case 4:
3734
- case "end":
3735
- return _context5.stop();
3736
- }
3737
- }, _callee5);
3738
- }));
3739
- return function GetHeaderRowData(_x2) {
3740
- return _ref8.apply(this, arguments);
3741
- };
3742
- }();
3743
- (0, _react.useEffect)(function () {
3744
- if (status != null) {
3745
- setDataGridRefreshKey(dataGridRefreshKey + 1);
3746
- }
3747
- }, [status]);
3748
- return /*#__PURE__*/_react["default"].createElement(_system.Box, null, !hideDocumentManager && /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
3749
- container: true,
3750
- spacing: 2,
3751
- sx: {
3752
- paddingBottom: 2
3753
- }
3754
- }, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
3755
- item: true,
3756
- xs: 3
3757
- }, /*#__PURE__*/_react["default"].createElement(_system.Box, {
3758
- sx: {
3759
- minWidth: 120
3760
- }
3761
- }, /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
3762
- fullWidth: true
3763
- }, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
3764
- id: "demo-simple-select-label"
3765
- }, "Status"), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
3766
- labelId: "demo-simple-select-label",
3767
- id: "demo-simple-select",
3768
- value: status,
3769
- label: "Status",
3770
- onChange: function onChange(event) {
3771
- setStatus(event.target.value);
3772
- }
3773
- }, /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
3774
- value: 0
3775
- }, "Open"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
3776
- value: 2
3777
- }, "Published"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
3778
- value: 1
3779
- }, "Archived"))))), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
3780
- item: true,
3781
- xs: 9
3782
- }, /*#__PURE__*/_react["default"].createElement(_system.Box, {
3783
- sx: {
3784
- textAlign: "right",
3785
- marginBottom: 2
3786
- }
3787
- }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
3788
- variant: "contained",
3789
- onClick: function onClick() {
3790
- setShowAddNewDocument(true);
3791
- }
3792
- }, fileUploadName)))), /*#__PURE__*/_react["default"].createElement(EditableDatagrid, {
3793
- key: dataGridRefreshKey,
3794
- loadedUser: true,
3795
- params: {
3796
- companyId: companyId,
3797
- userId: userId,
3798
- locationId: locationId,
3799
- status: status
3800
- },
3801
- url: "/DocumentMapping/GetDocumentComponents",
3802
- columns: documentColumns
3803
- })), hideDocumentManager && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
3804
- variant: "contained",
3805
- onClick: function onClick() {
3806
- setShowAddNewDocument(true);
3807
- }
3808
- }, fileUploadName), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
3809
- open: showAddNewDocument,
3810
- onClose: function onClose() {
3811
- setShowAddNewDocument(false);
3812
- },
3813
- fullWidth: true,
3814
- "aria-labelledby": "alert-dialog-title",
3815
- "aria-describedby": "alert-dialog-description"
3816
- }, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
3817
- id: "alert-dialog-title"
3818
- }, "Upload Document"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, documentTypeId == null && /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
3819
- id: "alert-dialog-description",
3820
- sx: {
3821
- paddingBottom: 2
3822
- }
3823
- }, "Please select the type of document, then click \"Choose a file\""), documentTypeId == null && /*#__PURE__*/_react["default"].createElement(_system.Box, {
3824
- sx: {
3825
- marginTop: 2
3826
- }
3827
- }, /*#__PURE__*/_react["default"].createElement(_system.Box, {
3828
- sx: {
3829
- minWidth: 120
3830
- }
3831
- }, /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
3832
- fullWidth: true
3833
- }, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
3834
- id: "demo-simple-select-label"
3835
- }, "Document Type"), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
3836
- labelId: "demo-simple-select-label",
3837
- id: "demo-simple-select",
3838
- inputRef: refSelectDocumentType,
3839
- onChange: function onChange(val) {
3840
- var _selectedDocument = componentTypes.find(function (s) {
3841
- return s.id == val.target.value;
3842
- });
3843
- setSelectedDocument(_selectedDocument);
3844
- },
3845
- label: "DocumentType"
3846
- }, componentTypes != null && componentTypes.map(function (componentType) {
3847
- return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
3848
- value: componentType.id
3849
- }, componentType.name);
3850
- }))))), (selectedDocument != null || selectedDocument == null && documentTypeId != null) && /*#__PURE__*/_react["default"].createElement(_system.Box, {
3851
- sx: {
3852
- textAlign: "center",
3853
- width: "100%",
3854
- display: "flex",
3855
- alignItems: "center",
3856
- paddingTop: 2
3857
- }
3858
- }, /*#__PURE__*/_react["default"].createElement(FileUploader, {
3859
- refOveride: fileUploaderRef,
3860
- params: {
3861
- documentTypeId: documentTypeId == null ? selectedDocument.id : documentTypeId,
3862
- companyId: companyId
3863
- },
3864
- url: "/DocumentMapping/SyncDocument",
3865
- multiple: true,
3866
- variant: "custom",
3867
- onUploadCompleted: function onUploadCompleted(responses) {
3868
- if (responses.length > 0) {
3869
- var row = responses[0].data;
3870
- if (onManageField != null) {
3871
- onManageField(row.id);
3872
- }
3873
- }
3874
- setShowAddNewDocument(false);
3875
- }
3876
- }, /*#__PURE__*/_react["default"].createElement(_system.Box, {
3877
- sx: {
3878
- display: "flex",
3879
- alignItems: "center"
3880
- }
3881
- }, /*#__PURE__*/_react["default"].createElement(_system.Box, {
3882
- htmlFor: "file-upload",
3883
- sx: {
3884
- border: "2px dashed #aaa",
3885
- padding: 20,
3886
- textAlign: "center",
3887
- cursor: "pointer"
3888
- }
3889
- }, 'Choose a file'))))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
3890
- onClick: function onClick() {
3891
- setShowAddNewDocument(false);
3892
- }
3893
- }, "Cancel"))), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
3894
- open: showTrainingDocument,
3895
- onClose: function onClose() {
3896
- setShowTrainingDocument(false);
3897
- },
3898
- fullWidth: true,
3899
- "aria-labelledby": "alert-dialog-title",
3900
- "aria-describedby": "alert-dialog-description"
3901
- }, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
3902
- id: "alert-dialog-title"
3903
- }, "Setup Mapping"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
3904
- id: "alert-dialog-description"
3905
- }, "If you'd like to submit a file, we can assist in configuring the fields to match the formatting of your document."), document != null && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(FileUploader, {
3906
- refOveride: fileUploaderRef,
3907
- url: "/DocumentMapping/TrainDocument",
3908
- params: {
3909
- documentComponentId: document.id,
3910
- companyId: companyId,
3911
- locationId: locationId,
3912
- userId: userId
3913
- },
3914
- multiple: false,
3915
- variant: "custom",
3916
- onUploadCompleted: function onUploadCompleted() {
3917
- setDataGridMappingRefreshKey(dataGridMappingRefreshKey + 1);
3918
-
3919
- // setUpdate(!update);
3920
- // handleClose();
3921
- }
3922
- }, /*#__PURE__*/_react["default"].createElement(_system.Box, {
3923
- sx: {
3924
- marginTop: 2,
3925
- borderRadius: 2,
3926
- backgroundColor: "#f5f5f5",
3927
- border: "1px solid lightgray",
3928
- cursor: "pointer",
3929
- padding: 2
3930
- }
3931
- }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
3932
- id: "FileUploader",
3933
- "aria-controls": open ? 'demo-customized-menu' : undefined,
3934
- "aria-haspopup": "true",
3935
- "aria-expanded": open ? 'true' : undefined,
3936
- variant: "text",
3937
- disableElevation: true,
3938
- startIcon: /*#__PURE__*/_react["default"].createElement(_PublishRounded["default"], null),
3939
- sx: {
3940
- marginLeft: 1
3941
- }
3942
- }, "Upload Sample File"))))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
3943
- onClick: function onClick() {
3944
- setShowTrainingDocument(false);
3945
- }
3946
- }, "No, thank you"))), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
3947
- open: addColumnDialog,
3948
- onClose: function onClose() {
3949
- setAddColumnDialog(false);
3950
- },
3951
- fullWidth: true,
3952
- "aria-labelledby": "alert-dialog-title",
3953
- "aria-describedby": "alert-dialog-description"
3954
- }, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
3955
- id: "alert-dialog-title"
3956
- }, "Add Column"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
3957
- id: "alert-dialog-description"
3958
- }, "Include a column for document mapping"), /*#__PURE__*/_react["default"].createElement(_system.Box, {
3959
- sx: {
3960
- marginTop: 2
3961
- }
3962
- }, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
3963
- inputRef: refNewColumnFileColumn,
3964
- id: "outlined-basic",
3965
- label: "File Column",
3966
- fullWidth: true,
3967
- variant: "outlined"
3968
- })), /*#__PURE__*/_react["default"].createElement(_system.Box, {
3969
- sx: {
3970
- marginTop: 4
3971
- }
3972
- }, /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
3973
- fullWidth: true
3974
- }, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
3975
- id: "demo-simple-select-label"
3976
- }, "Column Name"), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
3977
- labelId: "demo-simple-select-label",
3978
- id: "demo-simple-select",
3979
- value: selectedAddedColumn,
3980
- label: "Column Name",
3981
- onChange: function onChange(data) {
3982
- setSelectedAddedColumn(data.target.value);
3983
- }
3984
- })))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
3985
- onClick: function onClick() {
3986
- setAddColumnDialog(false);
3987
- }
3988
- }, "Cancel"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
3989
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
3990
- var response;
3991
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
3992
- while (1) switch (_context6.prev = _context6.next) {
3993
- case 0:
3994
- _context6.next = 2;
3995
- return apiService().post("/DocumentMapping/AddNewField", {
3996
- tableName: document.name,
3997
- fieldName: refNewColumnFileColumn.current.value,
3998
- fileColumn: selectedAddedColumn,
3999
- companyId: companyId,
4000
- locationId: locationId,
4001
- userId: userId
4002
- });
4003
- case 2:
4004
- response = _context6.sent;
4005
- if (response != null && response.status == 200) {
4006
- setDataGridMappingRefreshKey(dataGridMappingRefreshKey + 1);
4007
- setAddColumnDialog(false);
4008
- }
4009
- case 4:
4010
- case "end":
4011
- return _context6.stop();
4012
- }
4013
- }, _callee6);
4014
- })),
4015
- autoFocus: true
4016
- }, "Add Column"))), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
4017
- open: removeDocument != null ? true : false,
4018
- onClose: function onClose() {
4019
- setRemoveDocument(null);
4020
- },
4021
- fullWidth: true,
4022
- "aria-labelledby": "alert-dialog-title",
4023
- "aria-describedby": "alert-dialog-description"
4024
- }, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
4025
- id: "alert-dialog-title"
4026
- }, "Remove the document"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
4027
- id: "alert-dialog-description"
4028
- }, "Are you sure you want to remove this document?")), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
4029
- onClick: function onClick() {
4030
- setRemoveDocument(null);
4031
- }
4032
- }, "Cancel"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
4033
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
4034
- var response;
4035
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
4036
- while (1) switch (_context7.prev = _context7.next) {
4037
- case 0:
4038
- response = null;
4039
- if (!(companyId != null)) {
4040
- _context7.next = 7;
4041
- break;
4042
- }
4043
- _context7.next = 4;
4044
- return apiService()["delete"]("/DocumentMapping/RemoveDocument?companyId=" + removeDocument.companyId + "&documentId=" + removeDocument.documentMappingId);
4045
- case 4:
4046
- response = _context7.sent;
4047
- _context7.next = 10;
4048
- break;
4049
- case 7:
4050
- _context7.next = 9;
4051
- return apiService()["delete"]("/DocumentMapping/RemoveDocument?documentId=" + removeDocument.documentMappingId);
4052
- case 9:
4053
- response = _context7.sent;
4054
- case 10:
4055
- if (response != null && response.status == 200) {
4056
- setDataGridRefreshKey(dataGridRefreshKey + 1);
4057
- setRemoveDocument(null);
4058
- if (onArchive != null) {
4059
- onArchive(removeDocument.documentMappingId);
4060
- }
4061
- }
4062
- case 11:
4063
- case "end":
4064
- return _context7.stop();
4065
- }
4066
- }, _callee7);
4067
- }))
4068
- }, "Remove Document"))));
4069
- }
4070
- "use strict";
4071
-
4072
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4073
- Object.defineProperty(exports, "__esModule", {
4074
- value: true
4075
- });
4076
- exports.MappedColumn = MappedColumn;
4077
- var _react = _interopRequireWildcard(require("react"));
4078
- var _Card = _interopRequireDefault(require("@mui/material/Card"));
4079
- var _CardActions = _interopRequireDefault(require("@mui/material/CardActions"));
4080
- var _CardContent = _interopRequireDefault(require("@mui/material/CardContent"));
4081
- var _system = require("@mui/system");
4082
- var _Button = _interopRequireDefault(require("@mui/material/Button"));
4083
- var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
4084
- var _Link = _interopRequireDefault(require("@mui/icons-material/Link"));
4085
- var _LinkOff = _interopRequireDefault(require("@mui/icons-material/LinkOff"));
4086
- var _Stack = _interopRequireDefault(require("@mui/material/Stack"));
4087
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
4088
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
4089
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
4090
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
4091
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4092
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } // import NewMappingColumn from './newMappingColumn';
4093
- // import MatchExistingMappedColumn from './matchExisting';
4094
- // import { apiService } from 'authscape';
4095
-
4096
- function MappedColumn(_ref) {
4097
- var companyId = _ref.companyId,
4098
- documentId = _ref.documentId,
4099
- documentType = _ref.documentType,
4100
- documentMappingId = _ref.documentMappingId,
4101
- name = _ref.name,
4102
- toName = _ref.toName,
4103
- isMapped = _ref.isMapped,
4104
- toOptions = _ref.toOptions,
4105
- onResponse = _ref.onResponse;
4106
- var notMatchedColor = "#ffe5e5";
4107
- var matchedColor = "#fff";
4108
- return /*#__PURE__*/_react["default"].createElement(_Card["default"], {
4109
- sx: {
4110
- marginTop: 1
4111
- }
4112
- }, /*#__PURE__*/_react["default"].createElement(_CardContent["default"], {
4113
- sx: {
4114
- position: "relative",
4115
- backgroundColor: isMapped ? notMatchedColor : matchedColor
4116
- }
4117
- }, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
4118
- gutterBottom: true,
4119
- variant: "h5",
4120
- component: "div"
4121
- }, name), /*#__PURE__*/_react["default"].createElement(_system.Box, {
4122
- sx: {
4123
- position: "absolute",
4124
- top: "10px",
4125
- right: "10px"
4126
- }
4127
- }, isMapped ? /*#__PURE__*/_react["default"].createElement(_Stack["default"], {
4128
- direction: "row",
4129
- spacing: 1
4130
- }, /*#__PURE__*/_react["default"].createElement(_LinkOff["default"], null), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
4131
- variant: "body2",
4132
- sx: {
4133
- paddingTop: 0.5
4134
- }
4135
- }, "Not Matched")) : /*#__PURE__*/_react["default"].createElement(_Stack["default"], {
4136
- direction: "row",
4137
- spacing: 1
4138
- }, /*#__PURE__*/_react["default"].createElement(_Link["default"], null), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
4139
- variant: "body2",
4140
- sx: {
4141
- paddingTop: 0.5
4142
- }
4143
- }, "Matched"))), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
4144
- variant: "body2",
4145
- color: "text.secondary"
4146
- }, !isMapped && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, "This column is matched with ", toName), isMapped && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, "This column is not matched. If not matched it will not import"))), /*#__PURE__*/_react["default"].createElement(_CardActions["default"], {
4147
- sx: {
4148
- backgroundColor: isMapped ? notMatchedColor : matchedColor
4149
- }
4150
- }, !isMapped ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
4151
- startIcon: /*#__PURE__*/_react["default"].createElement(_LinkOff["default"], null),
4152
- size: "small",
4153
- sx: {
4154
- paddingLeft: 3
4155
- },
4156
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
4157
- var response;
4158
- return _regeneratorRuntime().wrap(function _callee$(_context) {
4159
- while (1) switch (_context.prev = _context.next) {
4160
- case 0:
4161
- _context.next = 2;
4162
- return apiService()["delete"]("/DocumentMapping/RemoveMatch?companyId=" + companyId + "&documentId=" + documentId + "&documentMappingId=" + documentMappingId);
4163
- case 2:
4164
- response = _context.sent;
4165
- if (response != null && response.status == 200) {
4166
- onResponse();
4167
- }
4168
- case 4:
4169
- case "end":
4170
- return _context.stop();
4171
- }
4172
- }, _callee);
4173
- }))
4174
- }, "Remove Match")) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(MatchExistingMappedColumn, {
4175
- companyId: companyId,
4176
- documentId: documentId,
4177
- documentMappingId: documentMappingId,
4178
- fromName: name,
4179
- toOptions: toOptions,
4180
- onResponse: onResponse
4181
- }), /*#__PURE__*/_react["default"].createElement(NewMappingColumn, {
4182
- name: name,
4183
- companyId: companyId,
4184
- documentType: documentType,
4185
- documentId: documentId,
4186
- documentMappingId: documentMappingId,
4187
- onResponse: onResponse
4188
- }))));
4189
- }
4190
- "use strict";
4191
-
4192
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4193
- Object.defineProperty(exports, "__esModule", {
4194
- value: true
4195
- });
4196
- exports.MatchExistingMappedColumn = MatchExistingMappedColumn;
4197
- var _react = _interopRequireWildcard(require("react"));
4198
- var _Button = _interopRequireDefault(require("@mui/material/Button"));
4199
- var _system = require("@mui/system");
4200
- var _LinkRounded = _interopRequireDefault(require("@mui/icons-material/LinkRounded"));
4201
- var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
4202
- var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
4203
- var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
4204
- var _DialogContentText = _interopRequireDefault(require("@mui/material/DialogContentText"));
4205
- var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
4206
- var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
4207
- var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
4208
- var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
4209
- var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
4210
- var _Select = _interopRequireDefault(require("@mui/material/Select"));
4211
- var _Checkbox = _interopRequireDefault(require("@mui/material/Checkbox"));
4212
- var _FormControlLabel = _interopRequireDefault(require("@mui/material/FormControlLabel"));
4213
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
4214
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
4215
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
4216
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
4217
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4218
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
4219
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4220
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4221
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4222
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4223
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
4224
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
4225
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import {apiService, authService, StripeConnect, ReactDraft, EditableDatagrid, FileUploader} from 'authscape';
4226
- function MatchExistingMappedColumn(_ref) {
4227
- var companyId = _ref.companyId,
4228
- documentId = _ref.documentId,
4229
- documentMappingId = _ref.documentMappingId,
4230
- fromName = _ref.fromName,
4231
- toOptions = _ref.toOptions,
4232
- onResponse = _ref.onResponse;
4233
- var _useState = (0, _react.useState)(false),
4234
- _useState2 = _slicedToArray(_useState, 2),
4235
- createNewOpen = _useState2[0],
4236
- setCreateNewOpen = _useState2[1];
4237
- var _useState3 = (0, _react.useState)(false),
4238
- _useState4 = _slicedToArray(_useState3, 2),
4239
- onlyAddRowIfFound = _useState4[0],
4240
- setOnlyAddRowIfFound = _useState4[1];
4241
- var _useState5 = (0, _react.useState)(true),
4242
- _useState6 = _slicedToArray(_useState5, 2),
4243
- rememberForNextTime = _useState6[0],
4244
- setRememberForNextTime = _useState6[1];
4245
- var _useState7 = (0, _react.useState)(null),
4246
- _useState8 = _slicedToArray(_useState7, 2),
4247
- selectedToColumn = _useState8[0],
4248
- setSelectedToColumn = _useState8[1];
4249
- var handleClose = function handleClose() {
4250
- setCreateNewOpen(false);
4251
- };
4252
- var checkboxRememberLabel = {
4253
- inputProps: {
4254
- 'aria-label': 'Checkbox Remember'
4255
- }
4256
- };
4257
- var SelectedExistingColumns = function SelectedExistingColumns(_ref2) {
4258
- var toOptions = _ref2.toOptions;
4259
- return /*#__PURE__*/_react["default"].createElement(_system.Box, {
4260
- sx: {
4261
- minWidth: 120
4262
- }
4263
- }, /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
4264
- fullWidth: true
4265
- }, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
4266
- id: "demo-simple-select-label"
4267
- }, "Match to column"), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
4268
- labelId: "demo-simple-select-label",
4269
- id: "demo-simple-select",
4270
- value: selectedToColumn,
4271
- label: "Age",
4272
- onChange: function onChange(event) {
4273
- setSelectedToColumn(event.target.value);
4274
- }
4275
- }, toOptions != null && toOptions.map(function (toOption) {
4276
- var isRequiredMessage = "";
4277
- if (toOption.isRequired) {
4278
- isRequiredMessage = " (Required)";
4279
- }
4280
- return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
4281
- value: toOption.name
4282
- }, toOption.visibleName, " ", isRequiredMessage);
4283
- }))));
4284
- };
4285
- return /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
4286
- open: createNewOpen,
4287
- onClose: handleClose,
4288
- fullWidth: true,
4289
- "aria-labelledby": "alert-dialog-title",
4290
- "aria-describedby": "alert-dialog-description"
4291
- }, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
4292
- id: "alert-dialog-title"
4293
- }, "Match existing column"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
4294
- id: "alert-dialog-description"
4295
- }, "***Inform the user about what it means to match existing columns***"), /*#__PURE__*/_react["default"].createElement(_system.Box, {
4296
- sx: {
4297
- paddingTop: 2
4298
- }
4299
- }, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
4300
- id: "outlined-basic",
4301
- label: "File Column Name",
4302
- defaultValue: fromName,
4303
- variant: "outlined",
4304
- disabled: true,
4305
- fullWidth: true
4306
- })), /*#__PURE__*/_react["default"].createElement(_system.Box, {
4307
- sx: {
4308
- paddingTop: 2
4309
- }
4310
- }, /*#__PURE__*/_react["default"].createElement(SelectedExistingColumns, {
4311
- toOptions: toOptions
4312
- })), /*#__PURE__*/_react["default"].createElement(_system.Box, {
4313
- sx: {
4314
- paddingTop: 2
4315
- }
4316
- }, /*#__PURE__*/_react["default"].createElement(_FormControlLabel["default"], {
4317
- value: "end",
4318
- control: /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], _extends({}, checkboxRememberLabel, {
4319
- defaultChecked: true,
4320
- onChange: function onChange(event) {
4321
- setRememberForNextTime(event.target.checked);
4322
- }
4323
- })),
4324
- label: "Remember match for next time",
4325
- labelPlacement: "end"
4326
- }))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
4327
- onClick: handleClose
4328
- }, "Cancel"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
4329
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
4330
- var response;
4331
- return _regeneratorRuntime().wrap(function _callee$(_context) {
4332
- while (1) switch (_context.prev = _context.next) {
4333
- case 0:
4334
- _context.next = 2;
4335
- return apiService().put("/DocumentMapping/AssignMapping", {
4336
- companyId: companyId,
4337
- documentId: documentId,
4338
- fileColumnName: fromName,
4339
- documentMappingId: documentMappingId,
4340
- matchedColumn: selectedToColumn,
4341
- onlyAddRowIfColumnFound: onlyAddRowIfFound,
4342
- rememberForNextTime: rememberForNextTime
4343
- });
4344
- case 2:
4345
- response = _context.sent;
4346
- if (response != null && response.status == 200) {
4347
- onResponse();
4348
- handleClose();
4349
- }
4350
- case 4:
4351
- case "end":
4352
- return _context.stop();
4353
- }
4354
- }, _callee);
4355
- })),
4356
- autoFocus: true
4357
- }, "Match Existing"))), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
4358
- startIcon: /*#__PURE__*/_react["default"].createElement(_LinkRounded["default"], null),
4359
- size: "small",
4360
- sx: {
4361
- paddingLeft: 3
4362
- },
4363
- onClick: function onClick() {
4364
- setCreateNewOpen(true);
4365
- }
4366
- }, "Match Existing"));
4367
- }
4368
- "use strict";
4369
-
4370
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4371
- Object.defineProperty(exports, "__esModule", {
4372
- value: true
4373
- });
4374
- exports.NewMappingColumn = NewMappingColumn;
4375
- var _react = _interopRequireWildcard(require("react"));
4376
- var _Card = _interopRequireDefault(require("@mui/material/Card"));
4377
- var _CardContent = _interopRequireDefault(require("@mui/material/CardContent"));
4378
- var _Button = _interopRequireDefault(require("@mui/material/Button"));
4379
- var _system = require("@mui/system");
4380
- var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
4381
- var _AddRounded = _interopRequireDefault(require("@mui/icons-material/AddRounded"));
4382
- var _LinkRounded = _interopRequireDefault(require("@mui/icons-material/LinkRounded"));
4383
- var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
4384
- var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
4385
- var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
4386
- var _DialogContentText = _interopRequireDefault(require("@mui/material/DialogContentText"));
4387
- var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
4388
- var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
4389
- var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
4390
- var _LocalParkingRounded = _interopRequireDefault(require("@mui/icons-material/LocalParkingRounded"));
4391
- var _TextFieldsRounded = _interopRequireDefault(require("@mui/icons-material/TextFieldsRounded"));
4392
- var _IntegrationInstructionsRounded = _interopRequireDefault(require("@mui/icons-material/IntegrationInstructionsRounded"));
4393
- var _ListAltRounded = _interopRequireDefault(require("@mui/icons-material/ListAltRounded"));
4394
- var _CalendarMonthRounded = _interopRequireDefault(require("@mui/icons-material/CalendarMonthRounded"));
4395
- var _CheckBoxRounded = _interopRequireDefault(require("@mui/icons-material/CheckBoxRounded"));
4396
- var _InsertPhotoRounded = _interopRequireDefault(require("@mui/icons-material/InsertPhotoRounded"));
4397
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
4398
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
4399
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
4400
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
4401
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4402
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
4403
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4404
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4405
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4406
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
4407
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
4408
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
4409
- // import { apiService } from 'authscape';
4410
-
4411
- function NewMappingColumn(_ref) {
4412
- var name = _ref.name,
4413
- companyId = _ref.companyId,
4414
- documentType = _ref.documentType,
4415
- documentId = _ref.documentId,
4416
- documentMappingId = _ref.documentMappingId,
4417
- onResponse = _ref.onResponse;
4418
- var newColumnNameRef = (0, _react.useRef)(null);
4419
- var newColumnDescriptionRef = (0, _react.useRef)(null);
4420
- var _useState = (0, _react.useState)(false),
4421
- _useState2 = _slicedToArray(_useState, 2),
4422
- createNewOpen = _useState2[0],
4423
- setCreateNewOpen = _useState2[1];
4424
- var _useState3 = (0, _react.useState)(null),
4425
- _useState4 = _slicedToArray(_useState3, 2),
4426
- selectedAttributeId = _useState4[0],
4427
- setSelectedAttributeId = _useState4[1];
4428
- var handleClose = function handleClose() {
4429
- setCreateNewOpen(false);
4430
- };
4431
- var AttributeTypeComponent = function AttributeTypeComponent(_ref2) {
4432
- var id = _ref2.id,
4433
- icon = _ref2.icon,
4434
- text = _ref2.text;
4435
- return /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
4436
- item: true,
4437
- xs: 3
4438
- }, /*#__PURE__*/_react["default"].createElement(_Card["default"], {
4439
- sx: {
4440
- textAlign: "center",
4441
- cursor: "pointer",
4442
- backgroundColor: selectedAttributeId == id ? "#e5e5e5" : "none"
4443
- },
4444
- onClick: function onClick() {
4445
- setSelectedAttributeId(id);
4446
- }
4447
- }, /*#__PURE__*/_react["default"].createElement(_CardContent["default"], null, icon, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
4448
- variant: "body2",
4449
- color: "text.secondary",
4450
- sx: {
4451
- paddingTop: 1
4452
- }
4453
- }, text))));
4454
- };
4455
- return /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
4456
- open: createNewOpen,
4457
- onClose: handleClose,
4458
- fullWidth: true,
4459
- "aria-labelledby": "alert-dialog-title",
4460
- "aria-describedby": "alert-dialog-description"
4461
- }, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
4462
- id: "alert-dialog-title"
4463
- }, "Match to new column"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
4464
- id: "alert-dialog-description"
4465
- }, "inform the user about adding a new columna and what that means here..."), /*#__PURE__*/_react["default"].createElement(_system.Box, {
4466
- sx: {
4467
- paddingTop: 2
4468
- }
4469
- }, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
4470
- inputRef: newColumnNameRef,
4471
- defaultValue: name,
4472
- id: "outlined-basic",
4473
- label: "Name",
4474
- variant: "outlined",
4475
- fullWidth: true
4476
- })), /*#__PURE__*/_react["default"].createElement(_system.Box, {
4477
- sx: {
4478
- paddingTop: 2
4479
- }
4480
- }, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
4481
- inputRef: newColumnDescriptionRef,
4482
- id: "outlined-basic",
4483
- label: "Description (optional)",
4484
- variant: "outlined",
4485
- fullWidth: true
4486
- })), /*#__PURE__*/_react["default"].createElement(_system.Box, {
4487
- sx: {
4488
- paddingTop: 2
4489
- }
4490
- }, /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
4491
- variant: "body1",
4492
- gutterBottom: true
4493
- }, "Select how this column will be formatted")), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
4494
- container: true,
4495
- spacing: 2,
4496
- sx: {
4497
- paddingTop: 2
4498
- }
4499
- }, /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
4500
- id: 0,
4501
- icon: /*#__PURE__*/_react["default"].createElement(_TextFieldsRounded["default"], null),
4502
- text: "text"
4503
- }), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
4504
- id: 1,
4505
- icon: /*#__PURE__*/_react["default"].createElement(_LocalParkingRounded["default"], null),
4506
- text: "Paragraph"
4507
- }), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
4508
- id: 2,
4509
- icon: /*#__PURE__*/_react["default"].createElement(_IntegrationInstructionsRounded["default"], null),
4510
- text: "HTML"
4511
- }), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
4512
- id: 3,
4513
- icon: /*#__PURE__*/_react["default"].createElement(_system.Box, null, 123),
4514
- text: "Integer"
4515
- }), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
4516
- id: 4,
4517
- icon: /*#__PURE__*/_react["default"].createElement(_system.Box, null, 10.23),
4518
- text: "Decimal"
4519
- }), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
4520
- id: 5,
4521
- icon: /*#__PURE__*/_react["default"].createElement(_ListAltRounded["default"], null),
4522
- text: "Dropdown"
4523
- }), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
4524
- id: 6,
4525
- icon: /*#__PURE__*/_react["default"].createElement(_CalendarMonthRounded["default"], null),
4526
- text: "Date"
4527
- }), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
4528
- id: 7,
4529
- icon: /*#__PURE__*/_react["default"].createElement(_LinkRounded["default"], null),
4530
- text: "URL"
4531
- }), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
4532
- id: 8,
4533
- icon: /*#__PURE__*/_react["default"].createElement(_CheckBoxRounded["default"], null),
4534
- text: "Boolean"
4535
- }), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
4536
- id: 9,
4537
- icon: /*#__PURE__*/_react["default"].createElement(_InsertPhotoRounded["default"], null),
4538
- text: "Photo"
4539
- })))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
4540
- onClick: handleClose
4541
- }, "Cancel"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
4542
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
4543
- var response;
4544
- return _regeneratorRuntime().wrap(function _callee$(_context) {
4545
- while (1) switch (_context.prev = _context.next) {
4546
- case 0:
4547
- _context.next = 2;
4548
- return apiService().post("/DocumentMapping/AddNewColumnAndMapping", {
4549
- companyId: companyId,
4550
- documentId: documentId,
4551
- documentMappingId: documentMappingId,
4552
- newColumn: newColumnNameRef.current.value,
4553
- description: newColumnDescriptionRef.current.value,
4554
- attributeFieldType: selectedAttributeId
4555
- });
4556
- case 2:
4557
- response = _context.sent;
4558
- if (response != null && response.status == 200) {
4559
- handleClose();
4560
- onResponse();
4561
- }
4562
- case 4:
4563
- case "end":
4564
- return _context.stop();
4565
- }
4566
- }, _callee);
4567
- })),
4568
- autoFocus: true
4569
- }, "Create"))), documentType != null && documentType == 1 && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
4570
- startIcon: /*#__PURE__*/_react["default"].createElement(_AddRounded["default"], null),
4571
- size: "small",
4572
- sx: {
4573
- paddingLeft: 3
4574
- },
4575
- onClick: function onClick() {
4576
- setCreateNewOpen(true);
4577
- }
4578
- }, "Create New Column"));
4579
- }
4580
- "use strict";
4581
-
4582
- Object.defineProperty(exports, "__esModule", {
4583
- value: true
4584
- });
4585
- exports.SortableColumn = SortableColumn;
4586
- var _react = _interopRequireDefault(require("react"));
4587
- var _sortable = require("@dnd-kit/sortable");
4588
- var _utilities = require("@dnd-kit/utilities");
4589
- var _material = require("@mui/material");
4590
- var _Menu = _interopRequireDefault(require("@mui/icons-material/Menu"));
4591
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
4592
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4593
- function SortableColumn(props) {
4594
- var _useSortable = (0, _sortable.useSortable)({
4595
- id: props.id
4596
- }),
4597
- attributes = _useSortable.attributes,
4598
- listeners = _useSortable.listeners,
4599
- setNodeRef = _useSortable.setNodeRef,
4600
- transform = _useSortable.transform,
4601
- transition = _useSortable.transition;
4602
- var style = {
4603
- transform: _utilities.CSS.Transform.toString(transform),
4604
- transition: transition
4605
- };
4606
- return /*#__PURE__*/_react["default"].createElement("div", _extends({
4607
- ref: setNodeRef,
4608
- style: style
4609
- }, attributes, listeners), /*#__PURE__*/_react["default"].createElement(_material.ListItem, {
4610
- disablePadding: true
4611
- }, /*#__PURE__*/_react["default"].createElement(_material.ListItemButton, null, /*#__PURE__*/_react["default"].createElement(_material.ListItemIcon, null, /*#__PURE__*/_react["default"].createElement(_Menu["default"], null)), /*#__PURE__*/_react["default"].createElement(_material.ListItemText, {
4612
- primary: props.id
4613
- }))));
4614
- }
4615
- "use strict";
4616
-
4617
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4618
- Object.defineProperty(exports, "__esModule", {
4619
- value: true
4620
- });
4621
- exports.UploadMappedFile = UploadMappedFile;
4622
- var _react = _interopRequireWildcard(require("react"));
4623
- var _Button = _interopRequireDefault(require("@mui/material/Button"));
4624
- var _system = require("@mui/system");
4625
- var _PublishRounded = _interopRequireDefault(require("@mui/icons-material/PublishRounded"));
4626
- var _Menu = _interopRequireDefault(require("@mui/material/Menu"));
4627
- var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
4628
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
4629
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
4630
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
4631
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
4632
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4633
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
4634
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4635
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4636
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4637
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
4638
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
4639
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import { apiService, FileUploader} from 'authscape';
4640
- function UploadMappedFile(_ref) {
4641
- var loadedUser = _ref.loadedUser,
4642
- _ref$url = _ref.url,
4643
- url = _ref$url === void 0 ? null : _ref$url,
4644
- _ref$companyId = _ref.companyId,
4645
- companyId = _ref$companyId === void 0 ? null : _ref$companyId,
4646
- _ref$locationId = _ref.locationId,
4647
- locationId = _ref$locationId === void 0 ? null : _ref$locationId,
4648
- _ref$userId = _ref.userId,
4649
- userId = _ref$userId === void 0 ? null : _ref$userId;
4650
- var _useState = (0, _react.useState)(null),
4651
- _useState2 = _slicedToArray(_useState, 2),
4652
- documentComponentOptions = _useState2[0],
4653
- setDocumentComponentOptions = _useState2[1];
4654
- var _useState3 = (0, _react.useState)(null),
4655
- _useState4 = _slicedToArray(_useState3, 2),
4656
- selectedDocumentComponentId = _useState4[0],
4657
- setSelectedDocumentComponentId = _useState4[1];
4658
- var _useState5 = (0, _react.useState)(null),
4659
- _useState6 = _slicedToArray(_useState5, 2),
4660
- anchorEl = _useState6[0],
4661
- setAnchorEl = _useState6[1];
4662
- var open = Boolean(anchorEl);
4663
- var handleClose = function handleClose() {
4664
- setAnchorEl(null);
4665
- };
4666
- var fileUploaderRef = (0, _react.useRef)(null);
4667
- (0, _react.useEffect)(function () {
4668
- if (selectedDocumentComponentId != null) {
4669
- // trigger the file uploader, make sure param is filled in
4670
- fileUploaderRef.current.click();
4671
- }
4672
- }, [selectedDocumentComponentId]);
4673
- (0, _react.useEffect)(function () {
4674
- if (loadedUser) {
4675
- var fetchData = /*#__PURE__*/function () {
4676
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
4677
- var _params, response;
4678
- return _regeneratorRuntime().wrap(function _callee$(_context) {
4679
- while (1) switch (_context.prev = _context.next) {
4680
- case 0:
4681
- _params = {};
4682
- if (companyId != null) {
4683
- _params.companyId = companyId;
4684
- }
4685
- if (userId != null) {
4686
- _params.userId = userId;
4687
- }
4688
- if (locationId != null) {
4689
- _params.locationId = locationId;
4690
- }
4691
- _context.next = 6;
4692
- return apiService().post("/DocumentMapping/GetDocumentComponents", _params);
4693
- case 6:
4694
- response = _context.sent;
4695
- if (response != null && response.status == 200) {
4696
- setDocumentComponentOptions(response.data.data);
4697
- }
4698
- case 8:
4699
- case "end":
4700
- return _context.stop();
4701
- }
4702
- }, _callee);
4703
- }));
4704
- return function fetchData() {
4705
- return _ref2.apply(this, arguments);
4706
- };
4707
- }();
4708
- fetchData();
4709
- }
4710
- }, [loadedUser]);
4711
- return /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(FileUploader, {
4712
- refOveride: fileUploaderRef,
4713
- params: {
4714
- documentComponentId: selectedDocumentComponentId,
4715
- companyId: companyId,
4716
- locationId: locationId,
4717
- userId: userId
4718
- },
4719
- url: url,
4720
- multiple: false,
4721
- variant: "custom",
4722
- onUploadCompleted: function onUploadCompleted() {
4723
- setSelectedDocumentComponentId(null); // we need an onUploadCancelled
4724
- }
4725
- }), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
4726
- id: "demo-positioned-button",
4727
- "aria-controls": open ? 'demo-positioned-menu' : undefined,
4728
- "aria-haspopup": "true",
4729
- "aria-expanded": open ? 'true' : undefined,
4730
- startIcon: /*#__PURE__*/_react["default"].createElement(_PublishRounded["default"], null),
4731
- sx: {
4732
- marginLeft: 1
4733
- },
4734
- onClick: function onClick(event) {
4735
- setAnchorEl(event.currentTarget);
4736
- }
4737
- }, "Upload File(s)"), /*#__PURE__*/_react["default"].createElement(_Menu["default"], {
4738
- id: "basic-menu",
4739
- anchorEl: anchorEl,
4740
- open: open,
4741
- onClose: handleClose,
4742
- MenuListProps: {
4743
- 'aria-labelledby': 'basic-button'
4744
- }
4745
- }, documentComponentOptions != null && documentComponentOptions.map(function (documentComponent) {
4746
- return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
4747
- onClick: function onClick() {
4748
- // assigns the param document component id
4749
- setSelectedDocumentComponentId(documentComponent.id);
4750
-
4751
- // close the menu
4752
- handleClose();
4753
- }
4754
- }, documentComponent.name + " (" + documentComponent.documentTypeName + ")");
4755
- })));
4756
- }
4757
- "use strict";
4758
-
4759
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4760
- Object.defineProperty(exports, "__esModule", {
4761
- value: true
4762
- });
4763
- exports.NextImage = void 0;
4764
- var _react = _interopRequireWildcard(require("react"));
4765
- var _image = _interopRequireDefault(require("next/image"));
4766
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
4767
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
4768
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
4769
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
4770
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4771
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
4772
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4773
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4774
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4775
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
4776
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
4777
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
4778
- var NextImage = function NextImage(_ref) {
4779
- var src = _ref.src,
4780
- alt = _ref.alt,
4781
- _ref$width = _ref.width,
4782
- width = _ref$width === void 0 ? 200 : _ref$width,
4783
- _ref$height = _ref.height,
4784
- height = _ref$height === void 0 ? 200 : _ref$height,
4785
- _ref$objectFit = _ref.objectFit,
4786
- objectFit = _ref$objectFit === void 0 ? "contain" : _ref$objectFit,
4787
- _ref$enableAuth = _ref.enableAuth,
4788
- enableAuth = _ref$enableAuth === void 0 ? false : _ref$enableAuth;
4789
- var _useState = (0, _react.useState)(false),
4790
- _useState2 = _slicedToArray(_useState, 2),
4791
- imageError = _useState2[0],
4792
- setImageError = _useState2[1];
4793
- var _useState3 = (0, _react.useState)(null),
4794
- _useState4 = _slicedToArray(_useState3, 2),
4795
- imageSrc = _useState4[0],
4796
- setImageSrc = _useState4[1];
4797
- (0, _react.useEffect)(function () {
4798
- if (enableAuth) {
4799
- var fetchData = /*#__PURE__*/function () {
4800
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
4801
- return _regeneratorRuntime().wrap(function _callee$(_context) {
4802
- while (1) switch (_context.prev = _context.next) {
4803
- case 0:
4804
- _context.next = 2;
4805
- return apiService().DownloadFile(src, "", function (data) {
4806
- setImageSrc(data);
4807
- }, true);
4808
- case 2:
4809
- case "end":
4810
- return _context.stop();
4811
- }
4812
- }, _callee);
4813
- }));
4814
- return function fetchData() {
4815
- return _ref2.apply(this, arguments);
4816
- };
4817
- }();
4818
- fetchData();
4819
- }
4820
- }, [enableAuth]);
4821
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, enableAuth && imageSrc != null && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_image["default"], {
4822
- src: imageError ? process.env.fallbackImageSrc : imageSrc,
4823
- alt: alt,
4824
- width: width,
4825
- height: height,
4826
- style: {
4827
- objectFit: objectFit
4828
- },
4829
- onError: function onError() {
4830
- return setImageError(true);
4831
- }
4832
- })), !enableAuth && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_image["default"], {
4833
- src: imageError ? process.env.fallbackImageSrc : src,
4834
- alt: alt,
4835
- width: width,
4836
- height: height,
4837
- style: {
4838
- objectFit: objectFit
4839
- },
4840
- onError: function onError() {
4841
- return setImageError(true);
4842
- }
4843
- })));
4844
- };
4845
- exports.NextImage = NextImage;
4846
- "use strict";
4847
-
4848
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4849
- Object.defineProperty(exports, "__esModule", {
4850
- value: true
4851
- });
4852
- exports.PageToPDF = void 0;
4853
- var _react = _interopRequireWildcard(require("react"));
4854
- var _Box = _interopRequireDefault(require("@mui/material/Box"));
4855
- var _html2canvas = _interopRequireDefault(require("html2canvas"));
4856
- var _jspdf = require("jspdf");
4857
- var _Button = _interopRequireDefault(require("@mui/material/Button"));
4858
- var _DownloadRounded = _interopRequireDefault(require("@mui/icons-material/DownloadRounded"));
4859
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
4860
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
4861
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
4862
- var PageToPDF = function PageToPDF(_ref) {
4863
- var _ref$buttonText = _ref.buttonText,
4864
- buttonText = _ref$buttonText === void 0 ? "Download" : _ref$buttonText,
4865
- _ref$startIcon = _ref.startIcon,
4866
- startIcon = _ref$startIcon === void 0 ? /*#__PURE__*/_react["default"].createElement(_DownloadRounded["default"], null) : _ref$startIcon,
4867
- _ref$variant = _ref.variant,
4868
- variant = _ref$variant === void 0 ? "contained" : _ref$variant,
4869
- elementById = _ref.elementById,
4870
- _ref$scale = _ref.scale,
4871
- scale = _ref$scale === void 0 ? 2 : _ref$scale,
4872
- _ref$showHideClassEle = _ref.showHideClassElements,
4873
- showHideClassElements = _ref$showHideClassEle === void 0 ? [] : _ref$showHideClassEle,
4874
- _ref$fileName = _ref.fileName,
4875
- fileName = _ref$fileName === void 0 ? "download" : _ref$fileName;
4876
- var onHideElements = function onHideElements() {
4877
- for (var index = 0; index < showHideClassElements.length; index++) {
4878
- var element = showHideClassElements[index];
4879
- var elements = document.getElementsByClassName(element);
4880
- for (var i = 0; i < elements.length; i++) {
4881
- elements[i].style.display = "none";
4882
- }
4883
- }
4884
- };
4885
- var onShowElements = function onShowElements() {
4886
- for (var index = 0; index < showHideClassElements.length; index++) {
4887
- var element = showHideClassElements[index];
4888
- var elements = document.getElementsByClassName(element);
4889
- for (var i = 0; i < elements.length; i++) {
4890
- elements[i].style.display = "block";
4891
- }
4892
- }
4893
- };
4894
- var printElement = function printElement() {
4895
- onHideElements();
4896
- var input = document.getElementById(elementById);
4897
- (0, _html2canvas["default"])(input, {
4898
- backgroundColor: null,
4899
- scale: scale
4900
- }).then(function (canvas) {
4901
- var imgData = canvas.toDataURL("image/png", 1.0);
4902
- var pdf = new _jspdf.jsPDF();
4903
- var pdfWidth = pdf.internal.pageSize.getWidth();
4904
- var pdfHeight = pdf.internal.pageSize.getHeight();
4905
- var imgWidth = canvas.width;
4906
- var imgHeight = canvas.height;
4907
- var scaleFactor = Math.min(pdfWidth / imgWidth, pdfHeight / imgHeight);
4908
- var scaledWidth = imgWidth * scaleFactor;
4909
- var scaledHeight = imgHeight * scaleFactor;
4910
- var x = (pdfWidth - scaledWidth) / 2;
4911
- var y = 0; // Set y coordinate to 0 to align to the top
4912
- pdf.addImage(imgData, "PNG", x, y, scaledWidth, scaledHeight);
4913
- pdf.save(fileName + ".pdf");
4914
- });
4915
- onShowElements();
4916
- };
4917
- return /*#__PURE__*/_react["default"].createElement(_Box["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
4918
- startIcon: startIcon,
4919
- variant: variant,
4920
- onClick: function onClick() {
4921
- printElement();
4922
- }
4923
- }, buttonText));
4924
- };
4925
- exports.PageToPDF = PageToPDF;
4926
- "use strict";
4927
-
4928
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4929
- Object.defineProperty(exports, "__esModule", {
4930
- value: true
4931
- });
4932
- exports.Pricing = Pricing;
4933
- var _react = _interopRequireWildcard(require("react"));
4934
- var _system = require("@mui/system");
4935
- var _material = require("@mui/material");
4936
- var _ChevronRightRounded = _interopRequireDefault(require("@mui/icons-material/ChevronRightRounded"));
4937
- var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
4938
- var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
4939
- var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
4940
- var _Select = _interopRequireDefault(require("@mui/material/Select"));
4941
- var _reactHookForm = require("react-hook-form");
4942
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
4943
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
4944
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
4945
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
4946
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4947
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
4948
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4949
- function Pricing(_ref) {
4950
- var _ref$title = _ref.title,
4951
- title = _ref$title === void 0 ? null : _ref$title,
4952
- _ref$tiers = _ref.tiers,
4953
- tiers = _ref$tiers === void 0 ? [] : _ref$tiers,
4954
- _ref$features = _ref.features,
4955
- features = _ref$features === void 0 ? null : _ref$features,
4956
- _ref$onButtonClicked = _ref.onButtonClicked,
4957
- onButtonClicked = _ref$onButtonClicked === void 0 ? null : _ref$onButtonClicked;
4958
- var _useForm = (0, _reactHookForm.useForm)(),
4959
- control = _useForm.control,
4960
- register = _useForm.register,
4961
- handleSubmit = _useForm.handleSubmit,
4962
- errors = _useForm.formState.errors,
4963
- watch = _useForm.watch,
4964
- setValue = _useForm.setValue;
4965
- var calculateQty = function calculateQty(qty) {
4966
- var newMax = qty.minQty + qty.maxQty;
4967
- var menuItemArray = [];
4968
- var newIndex = 1;
4969
- for (var index = qty.minQty; index < newMax; index++) {
4970
- menuItemArray[newIndex] = newIndex;
4971
- newIndex++;
4972
- }
4973
- return menuItemArray;
4974
- };
4975
- return /*#__PURE__*/_react["default"].createElement(_system.Box, {
4976
- sx: {
4977
- paddingTop: 2
4978
- }
4979
- }, /*#__PURE__*/_react["default"].createElement("form", null, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
4980
- container: true,
4981
- spacing: 0,
4982
- justifyContent: "center",
4983
- alignItems: "stretch",
4984
- direction: "row"
4985
- }, title != null && /*#__PURE__*/_react["default"].createElement(_material.Grid, {
4986
- item: true,
4987
- xs: 12,
4988
- sm: 6,
4989
- md: 3,
4990
- key: "plans"
4991
- }, /*#__PURE__*/_react["default"].createElement(_material.Typography, {
4992
- variant: "h4",
4993
- gutterBottom: true
4994
- }, title)), tiers.map(function (tier) {
4995
- return /*#__PURE__*/_react["default"].createElement(_material.Grid, {
4996
- item: true,
4997
- xs: 12,
4998
- sm: 6,
4999
- md: 3,
5000
- key: tier.title
5001
- }, /*#__PURE__*/_react["default"].createElement(_system.Box, {
5002
- sx: {
5003
- paddingBottom: 2,
5004
- padding: 2
5005
- }
5006
- }, /*#__PURE__*/_react["default"].createElement(_system.Box, {
5007
- sx: {
5008
- textAlign: "center",
5009
- paddingTop: 2
5010
- }
5011
- }, tier.image != null && /*#__PURE__*/_react["default"].createElement("img", {
5012
- src: tier.image,
5013
- width: 200,
5014
- height: 200
5015
- }), /*#__PURE__*/_react["default"].createElement(_material.Typography, {
5016
- variant: "h3",
5017
- component: "h2",
5018
- sx: {
5019
- paddingTop: 3
5020
- }
5021
- }, tier.title), tier.subTitle && /*#__PURE__*/_react["default"].createElement(_material.Typography, {
5022
- variant: "h6",
5023
- component: "h2",
5024
- sx: {
5025
- paddingTop: 2
5026
- }
5027
- }, tier.subTitle), /*#__PURE__*/_react["default"].createElement(_material.Grid, {
5028
- container: true,
5029
- spacing: 0
5030
- }, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
5031
- item: true,
5032
- xs: tier.qty != null ? 6 : 12,
5033
- sx: {
5034
- padding: 4
5035
- }
5036
- }, /*#__PURE__*/_react["default"].createElement(_system.Box, {
5037
- component: "span",
5038
- sx: {
5039
- fontSize: 30,
5040
- fontWeight: "bold"
5041
- }
5042
- }, "$", tier.price), tier.duration != null && /*#__PURE__*/_react["default"].createElement(_system.Box, {
5043
- component: "span"
5044
- }, "/ ", tier.duration)), tier.qty != null && /*#__PURE__*/_react["default"].createElement(_material.Grid, {
5045
- item: true,
5046
- xs: 6,
5047
- sx: {
5048
- padding: 4
5049
- }
5050
- }, /*#__PURE__*/_react["default"].createElement(_reactHookForm.Controller, {
5051
- name: "qty-" + tier.id,
5052
- control: control,
5053
- rules: {
5054
- required: false
5055
- },
5056
- render: function render(_ref2) {
5057
- var renderField = _ref2.renderField;
5058
- return /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
5059
- fullWidth: true
5060
- }, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
5061
- id: "demo-simple-select-label"
5062
- }, "Quantity"), /*#__PURE__*/_react["default"].createElement(_Select["default"], _extends({}, register("qty-" + tier.id, {
5063
- required: false
5064
- }), renderField, {
5065
- labelId: "demo-simple-select-label",
5066
- id: "demo-simple-select",
5067
- defaultValue: 1,
5068
- label: "Quantity"
5069
- }), calculateQty(tier.qty).map(function (menuItem, index) {
5070
- return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
5071
- key: index,
5072
- value: menuItem
5073
- }, menuItem);
5074
- })));
5075
- }
5076
- }))), tier.modifiers != null && /*#__PURE__*/_react["default"].createElement(_system.Box, {
5077
- sx: {
5078
- paddingBottom: 2
5079
- }
5080
- }, tier.modifiers.map(function (modifier, index) {
5081
- return /*#__PURE__*/_react["default"].createElement(_reactHookForm.Controller, {
5082
- name: "modifier-" + tier.id + modifier.name,
5083
- control: control,
5084
- rules: {
5085
- required: false
5086
- },
5087
- render: function render(_ref3) {
5088
- var renderField = _ref3.renderField;
5089
- return /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
5090
- fullWidth: true,
5091
- key: index,
5092
- sx: {
5093
- marginTop: 2
5094
- }
5095
- }, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
5096
- id: "demo-simple-select-label"
5097
- }, modifier.name), /*#__PURE__*/_react["default"].createElement(_Select["default"], _extends({}, register("modifier-" + tier.id + "-" + modifier.name, {
5098
- required: false
5099
- }), renderField, {
5100
- labelId: "demo-simple-select-label",
5101
- id: "demo-simple-select",
5102
- defaultValue: 0,
5103
- label: modifier.name
5104
- }), modifier.options.map(function (mod, index) {
5105
- return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
5106
- key: index,
5107
- value: index
5108
- }, mod);
5109
- })));
5110
- }
5111
- });
5112
- })), /*#__PURE__*/_react["default"].createElement(_material.Button, {
5113
- fullWidth: true,
5114
- variant: tier.buttonVariant,
5115
- endIcon: /*#__PURE__*/_react["default"].createElement(_ChevronRightRounded["default"], null),
5116
- sx: {
5117
- height: 50
5118
- },
5119
- onClick: handleSubmit( /*#__PURE__*/function () {
5120
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
5121
- var modifiers, qty, index, modifier;
5122
- return _regeneratorRuntime().wrap(function _callee$(_context) {
5123
- while (1) switch (_context.prev = _context.next) {
5124
- case 0:
5125
- modifiers = {};
5126
- qty = null;
5127
- if (tier.modifiers != null) {
5128
- for (index = 0; index < tier.modifiers.length; index++) {
5129
- modifier = tier.modifiers[index]; // assign the modifier as a property
5130
- modifiers[modifier.name] = data["modifier-" + tier.id + "-" + modifier.name];
5131
- }
5132
- }
5133
- if (tier.qty != null) {
5134
- qty = parseInt(data["qty-" + tier.id]);
5135
- }
5136
- if (onButtonClicked != null) {
5137
- onButtonClicked({
5138
- id: tier.id,
5139
- modifiers: modifiers,
5140
- qty: qty
5141
- });
5142
- }
5143
- case 5:
5144
- case "end":
5145
- return _context.stop();
5146
- }
5147
- }, _callee);
5148
- }));
5149
- return function (_x) {
5150
- return _ref4.apply(this, arguments);
5151
- };
5152
- }())
5153
- }, tier.buttonText), /*#__PURE__*/_react["default"].createElement(_material.Typography, {
5154
- variant: "body2",
5155
- sx: {
5156
- paddingTop: 2,
5157
- fontSize: 16,
5158
- textAlign: "left",
5159
- lineHeight: "1.5rem"
5160
- }
5161
- }, /*#__PURE__*/_react["default"].createElement("div", {
5162
- dangerouslySetInnerHTML: {
5163
- __html: tier.description
5164
- }
5165
- })))));
5166
- })), features != null && /*#__PURE__*/_react["default"].createElement(_system.Box, {
5167
- sx: {
5168
- paddingTop: 1
5169
- }
5170
- }, features.map(function (feature) {
5171
- return /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_system.Box, {
5172
- sx: {
5173
- backgroundColor: "lightgray",
5174
- padding: 1,
5175
- borderRadius: 2
5176
- }
5177
- }, /*#__PURE__*/_react["default"].createElement(_material.Typography, {
5178
- variant: "h5",
5179
- gutterBottom: true
5180
- }, feature.name)), /*#__PURE__*/_react["default"].createElement(_material.Grid, {
5181
- container: true,
5182
- spacing: 0,
5183
- justifyContent: "center"
5184
- }, feature.subfeatures.map(function (subfeature, subFeatureIndex) {
5185
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, subfeature.map(function (item, index) {
5186
- return /*#__PURE__*/_react["default"].createElement(_material.Grid, {
5187
- item: true,
5188
- xs: 3,
5189
- key: subfeature
5190
- }, /*#__PURE__*/_react["default"].createElement(_system.Box, {
5191
- sx: {
5192
- padding: 2,
5193
- height: 60,
5194
- paddingTop: subFeatureIndex == 0 ? 3 : 2,
5195
- textAlign: index == 0 ? "left" : "center"
5196
- }
5197
- }, item), feature.subfeatures.length - 1 != subFeatureIndex ? /*#__PURE__*/_react["default"].createElement("hr", null) : "");
5198
- }));
5199
- })));
5200
- }))));
5201
- }
5202
- "use strict";
5203
-
5204
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
5205
- Object.defineProperty(exports, "__esModule", {
5206
- value: true
5207
- });
5208
- exports.AddDomain = AddDomain;
5209
- var _react = _interopRequireWildcard(require("react"));
5210
- var _system = require("@mui/system");
5211
- var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
5212
- var _Button = _interopRequireDefault(require("@mui/material/Button"));
5213
- var _styles = require("@mui/material/styles");
5214
- var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
5215
- var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
5216
- var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
5217
- var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
5218
- var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
5219
- var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
5220
- var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
5221
- var _Stepper = _interopRequireDefault(require("@mui/material/Stepper"));
5222
- var _Step = _interopRequireDefault(require("@mui/material/Step"));
5223
- var _StepLabel = _interopRequireDefault(require("@mui/material/StepLabel"));
5224
- var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
5225
- var _FmdBadRounded = _interopRequireDefault(require("@mui/icons-material/FmdBadRounded"));
5226
- var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
5227
- var _Select = _interopRequireDefault(require("@mui/material/Select"));
5228
- var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
5229
- var _ContentCopyRounded = _interopRequireDefault(require("@mui/icons-material/ContentCopyRounded"));
5230
- var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
5231
- var _material = require("@mui/material");
5232
- var _excluded = ["children", "onClose"];
5233
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
5234
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
5235
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
5236
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
5237
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
5238
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5239
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
5240
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
5241
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5242
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
5243
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5244
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5245
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5246
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
5247
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import { apiService } from 'authscape';
5248
- function AddDomain(_ref) {
5249
- var open = _ref.open,
5250
- azureWebsite = _ref.azureWebsite,
5251
- azureTxtValue = _ref.azureTxtValue,
5252
- handleClose = _ref.handleClose;
5253
- var steps = ['Enter a domain', 'Setup DNS Record', 'Go Live'];
5254
- var _useState = (0, _react.useState)(0),
5255
- _useState2 = _slicedToArray(_useState, 2),
5256
- activeStep = _useState2[0],
5257
- setActiveStep = _useState2[1];
5258
- var _useState3 = (0, _react.useState)({}),
5259
- _useState4 = _slicedToArray(_useState3, 2),
5260
- completed = _useState4[0],
5261
- setCompleted = _useState4[1];
5262
-
5263
- // const [domain, setDomain] = useState(null);
5264
- var _useState5 = (0, _react.useState)(null),
5265
- _useState6 = _slicedToArray(_useState5, 2),
5266
- subDomains = _useState6[0],
5267
- setSubDomains = _useState6[1];
5268
- // const [topLevelDomains , setTopLevelDomains ] = useState(null);
5269
-
5270
- var _useState7 = (0, _react.useState)(null),
5271
- _useState8 = _slicedToArray(_useState7, 2),
5272
- fullDomain = _useState8[0],
5273
- setFullDomain = _useState8[1];
5274
- var _useState9 = (0, _react.useState)(null),
5275
- _useState10 = _slicedToArray(_useState9, 2),
5276
- errorMessage = _useState10[0],
5277
- setErrorMessage = _useState10[1];
5278
- var refDomain = (0, _react.useRef)(null);
5279
- var refCNameTarget = (0, _react.useRef)(null);
5280
- var reftxtTarget = (0, _react.useRef)(null);
5281
- var refCNameName = (0, _react.useRef)(null);
5282
- var reftxtName = (0, _react.useRef)(null);
5283
- var totalSteps = function totalSteps() {
5284
- return steps.length;
5285
- };
5286
- var completedSteps = function completedSteps() {
5287
- return Object.keys(completed).length;
5288
- };
5289
- var isLastStep = function isLastStep() {
5290
- return activeStep === totalSteps() - 1;
5291
- };
5292
- var allStepsCompleted = function allStepsCompleted() {
5293
- return completedSteps() === totalSteps();
5294
- };
5295
- var handleNext = function handleNext() {
5296
- var newActiveStep = isLastStep() && !allStepsCompleted() ?
5297
- // It's the last step, but not all steps have been completed,
5298
- // find the first step that has been completed
5299
- steps.findIndex(function (step, i) {
5300
- return !(i in completed);
5301
- }) : activeStep + 1;
5302
- setActiveStep(newActiveStep);
5303
- };
5304
- var handleBack = function handleBack() {
5305
- setActiveStep(function (prevActiveStep) {
5306
- return prevActiveStep - 1;
5307
- });
5308
- };
5309
- var getSubdomain = function getSubdomain(hostName) {
5310
- var host = hostName; // e.g., subdomain.example.com
5311
- var parts = host.split('.');
5312
- if (parts.length > 2) {
5313
- return parts[0]; // This will be 'subdomain'
5314
- }
5315
-
5316
- return null; // No subdomain found
5317
- };
5318
-
5319
- var handleStep = function handleStep(step) {
5320
- return function () {
5321
- setActiveStep(step);
5322
- };
5323
- };
5324
- var handleComplete = function handleComplete() {
5325
- var newCompleted = completed;
5326
- newCompleted[activeStep] = true;
5327
- setCompleted(newCompleted);
5328
- handleNext();
5329
- };
5330
- var BootstrapDialog = (0, _styles.styled)(_Dialog["default"])(function (_ref2) {
5331
- var theme = _ref2.theme;
5332
- return {
5333
- '& .MuiDialogContent-root': {
5334
- padding: theme.spacing(2)
5335
- },
5336
- '& .MuiDialogActions-root': {
5337
- padding: theme.spacing(1)
5338
- }
5339
- };
5340
- });
5341
- var handleReset = function handleReset() {
5342
- setActiveStep(0);
5343
- setCompleted({});
5344
- };
5345
- var createTheDomainRequest = /*#__PURE__*/function () {
5346
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
5347
- var response, aStep;
5348
- return _regeneratorRuntime().wrap(function _callee$(_context) {
5349
- while (1) switch (_context.prev = _context.next) {
5350
- case 0:
5351
- if (!(fullDomain == null || fullDomain == "")) {
5352
- _context.next = 2;
5353
- break;
5354
- }
5355
- return _context.abrupt("return");
5356
- case 2:
5357
- _context.next = 4;
5358
- return apiService().post("/PrivateLabel/GenerateDomain", {
5359
- hostName: fullDomain
5360
- });
5361
- case 4:
5362
- response = _context.sent;
5363
- if (response != null && response.status == 200) {
5364
- if (handleClose != null) {
5365
- handleClose();
5366
- }
5367
- } else {
5368
- aStep = activeStep - 1;
5369
- setActiveStep(aStep);
5370
- setErrorMessage(response.data);
5371
- }
5372
- case 6:
5373
- case "end":
5374
- return _context.stop();
5375
- }
5376
- }, _callee);
5377
- }));
5378
- return function createTheDomainRequest() {
5379
- return _ref3.apply(this, arguments);
5380
- };
5381
- }();
5382
- (0, _react.useEffect)(function () {
5383
- if (activeStep == 2) {
5384
- createTheDomainRequest();
5385
- }
5386
- }, [activeStep]);
5387
- var copyToClipboard = /*#__PURE__*/function () {
5388
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(text) {
5389
- var permissions;
5390
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
5391
- while (1) switch (_context2.prev = _context2.next) {
5392
- case 0:
5393
- _context2.prev = 0;
5394
- _context2.next = 3;
5395
- return navigator.permissions.query({
5396
- name: "clipboard-write"
5397
- });
5398
- case 3:
5399
- permissions = _context2.sent;
5400
- if (!(permissions.state === "granted" || permissions.state === "prompt")) {
5401
- _context2.next = 9;
5402
- break;
5403
- }
5404
- _context2.next = 7;
5405
- return navigator.clipboard.writeText(text);
5406
- case 7:
5407
- _context2.next = 10;
5408
- break;
5409
- case 9:
5410
- throw new Error("Can't access the clipboard. Check your browser permissions.");
5411
- case 10:
5412
- _context2.next = 15;
5413
- break;
5414
- case 12:
5415
- _context2.prev = 12;
5416
- _context2.t0 = _context2["catch"](0);
5417
- alert('Error copying to clipboard:', _context2.t0);
5418
- case 15:
5419
- case "end":
5420
- return _context2.stop();
5421
- }
5422
- }, _callee2, null, [[0, 12]]);
5423
- }));
5424
- return function copyToClipboard(_x2) {
5425
- return _ref4.apply(this, arguments);
5426
- };
5427
- }();
5428
- function BootstrapDialogTitle(props) {
5429
- var children = props.children,
5430
- onClose = props.onClose,
5431
- other = _objectWithoutProperties(props, _excluded);
5432
- return /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], _extends({
5433
- sx: {
5434
- m: 0,
5435
- p: 2
5436
- }
5437
- }, other), children, onClose ? /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
5438
- "aria-label": "close",
5439
- onClick: onClose,
5440
- sx: {
5441
- position: 'absolute',
5442
- right: 8,
5443
- top: 8,
5444
- color: function color(theme) {
5445
- return theme.palette.grey[500];
5446
- }
5447
- }
5448
- }, /*#__PURE__*/_react["default"].createElement(_Close["default"], null)) : null);
5449
- }
5450
- return /*#__PURE__*/_react["default"].createElement(BootstrapDialog, {
5451
- onClose: handleClose,
5452
- "aria-labelledby": "customized-dialog-title",
5453
- sx: {
5454
- backgroundColor: "rgba(0, 0, 0, 0.6)"
5455
- },
5456
- fullWidth: true,
5457
- maxWidth: "md",
5458
- open: open
5459
- }, /*#__PURE__*/_react["default"].createElement(_system.Box, {
5460
- sx: {
5461
- padding: 4
5462
- }
5463
- }, /*#__PURE__*/_react["default"].createElement(_Stepper["default"], {
5464
- activeStep: activeStep,
5465
- alternativeLabel: true
5466
- }, steps.map(function (label) {
5467
- return /*#__PURE__*/_react["default"].createElement(_Step["default"], {
5468
- key: label
5469
- }, /*#__PURE__*/_react["default"].createElement(_StepLabel["default"], {
5470
- sx: {
5471
- color: "#fff"
5472
- }
5473
- }, label));
5474
- })), activeStep == 0 && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(BootstrapDialogTitle, {
5475
- id: "customized-dialog-title",
5476
- onClose: handleClose,
5477
- sx: {
5478
- textAlign: "center",
5479
- fontSize: 30,
5480
- marginTop: 2,
5481
- lineHeight: 1
5482
- }
5483
- }, "What domain would you like to connect to ", process.env.companyName, "?"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
5484
- inputRef: refDomain,
5485
- id: "domainTxt",
5486
- label: "Enter subdomain URL e.g catalog.mydomain.com",
5487
- fullWidth: true,
5488
- variant: "outlined",
5489
- sx: {
5490
- color: "white",
5491
- marginTop: 2
5492
- }
5493
- })), /*#__PURE__*/_react["default"].createElement(_system.Box, {
5494
- sx: {
5495
- marginTop: 2
5496
- }
5497
- }, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
5498
- gutterBottom: true,
5499
- sx: {
5500
- textAlign: "center",
5501
- fontSize: 14
5502
- }
5503
- }, /*#__PURE__*/_react["default"].createElement(_FmdBadRounded["default"], {
5504
- sx: {
5505
- color: "#1976d2",
5506
- position: "relative",
5507
- top: 8
5508
- }
5509
- }), " You must own the domain and have the ability to add records"))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
5510
- variant: "contained",
5511
- onClick: function onClick() {
5512
- if (refDomain.current.value == "") {
5513
- return;
5514
- }
5515
- setFullDomain(refDomain.current.value);
5516
- var _subDomain = getSubdomain(refDomain.current.value);
5517
- setSubDomains(_subDomain);
5518
-
5519
- // var domainLand = parseDomain(refDomain.current.value);
5520
- // setDomain(domainLand.domain);
5521
- // setSubDomains(domainLand.subDomains);
5522
- // setTopLevelDomains(domainLand.topLevelDomains);
5523
-
5524
- handleNext();
5525
- }
5526
- }, "Next: Setup DNS"))), activeStep == 1 && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(BootstrapDialogTitle, {
5527
- id: "customized-dialog-title",
5528
- onClose: handleClose,
5529
- sx: {
5530
- textAlign: "center",
5531
- fontSize: 30,
5532
- marginTop: 2
5533
- }
5534
- }, "Configure your DNS"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
5535
- gutterBottom: true,
5536
- sx: {
5537
- textAlign: "center",
5538
- fontSize: 14
5539
- }
5540
- }, "Add a CNAME and TXT Record to your domain by visiting your DNS provider.")), /*#__PURE__*/_react["default"].createElement(_system.Box, {
5541
- sx: {
5542
- backgroundColor: "#f7f7f7",
5543
- marginTop: 5,
5544
- paddingLeft: 4,
5545
- paddingRight: 4
5546
- }
5547
- }, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
5548
- container: true,
5549
- spacing: 2,
5550
- fullWidth: true
5551
- }, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
5552
- item: true,
5553
- xs: 2
5554
- }, "Type", /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
5555
- fullWidth: true,
5556
- sx: {
5557
- paddingTop: 2
5558
- }
5559
- }, /*#__PURE__*/_react["default"].createElement(_Select["default"], {
5560
- value: 1,
5561
- readOnly: true
5562
- }, /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
5563
- value: 1
5564
- }, "CNAME")))), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
5565
- item: true,
5566
- xs: 5
5567
- }, "Name", /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
5568
- inputRef: refCNameName,
5569
- id: "NameDomainTxt",
5570
- label: "",
5571
- fullWidth: true,
5572
- value: subDomains,
5573
- variant: "outlined",
5574
- sx: {
5575
- color: "white",
5576
- paddingTop: 2
5577
- }
5578
- }), /*#__PURE__*/_react["default"].createElement(_system.Box, {
5579
- sx: {
5580
- textAlign: "center",
5581
- paddingTop: 1
5582
- }
5583
- }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
5584
- startIcon: /*#__PURE__*/_react["default"].createElement(_ContentCopyRounded["default"], null),
5585
- sx: {
5586
- width: "100%"
5587
- },
5588
- variant: "contained",
5589
- onClick: function onClick() {
5590
- copyToClipboard(refCNameName.current.value);
5591
- }
5592
- }, "Copy"))), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
5593
- item: true,
5594
- xs: 5
5595
- }, "Target", /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
5596
- inputRef: refCNameTarget,
5597
- id: "targetDomainTxt",
5598
- label: "",
5599
- fullWidth: true,
5600
- value: azureWebsite,
5601
- variant: "outlined",
5602
- sx: {
5603
- color: "white",
5604
- paddingTop: 2
5605
- }
5606
- }), /*#__PURE__*/_react["default"].createElement(_system.Box, {
5607
- sx: {
5608
- textAlign: "center",
5609
- paddingTop: 1
5610
- }
5611
- }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
5612
- startIcon: /*#__PURE__*/_react["default"].createElement(_ContentCopyRounded["default"], null),
5613
- sx: {
5614
- width: "100%"
5615
- },
5616
- variant: "contained",
5617
- onClick: function onClick() {
5618
- copyToClipboard(refCNameTarget.current.value);
5619
- }
5620
- }, "Copy"))))), /*#__PURE__*/_react["default"].createElement(_system.Box, {
5621
- sx: {
5622
- backgroundColor: "#f7f7f7",
5623
- paddingLeft: 4,
5624
- paddingRight: 4,
5625
- marginTop: 2,
5626
- paddingBottom: 4
5627
- }
5628
- }, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
5629
- container: true,
5630
- spacing: 2,
5631
- fullWidth: true
5632
- }, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
5633
- item: true,
5634
- xs: 2
5635
- }, "Type", /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
5636
- fullWidth: true,
5637
- sx: {
5638
- paddingTop: 2
5639
- }
5640
- }, /*#__PURE__*/_react["default"].createElement(_Select["default"], {
5641
- value: 1,
5642
- readOnly: true
5643
- }, /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
5644
- value: 1
5645
- }, "TXT")))), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
5646
- item: true,
5647
- xs: 5
5648
- }, "Name", /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
5649
- inputRef: reftxtName,
5650
- id: "NameDomain2Txt",
5651
- label: "",
5652
- fullWidth: true,
5653
- value: "asuid." + subDomains,
5654
- variant: "outlined",
5655
- sx: {
5656
- color: "white",
5657
- marginTop: 2
5658
- }
5659
- }), /*#__PURE__*/_react["default"].createElement(_system.Box, {
5660
- sx: {
5661
- textAlign: "center",
5662
- paddingTop: 1
5663
- }
5664
- }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
5665
- startIcon: /*#__PURE__*/_react["default"].createElement(_ContentCopyRounded["default"], null),
5666
- sx: {
5667
- width: "100%"
5668
- },
5669
- variant: "contained",
5670
- onClick: function onClick() {
5671
- copyToClipboard(reftxtName.current.value);
5672
- }
5673
- }, "Copy"))), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
5674
- item: true,
5675
- xs: 5
5676
- }, "Target", /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
5677
- inputRef: reftxtTarget,
5678
- id: "targetDomain2Txt",
5679
- label: "",
5680
- fullWidth: true,
5681
- value: azureTxtValue,
5682
- variant: "outlined",
5683
- sx: {
5684
- color: "white",
5685
- marginTop: 2
5686
- }
5687
- }), /*#__PURE__*/_react["default"].createElement(_system.Box, {
5688
- sx: {
5689
- textAlign: "center",
5690
- paddingTop: 1
5691
- }
5692
- }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
5693
- startIcon: /*#__PURE__*/_react["default"].createElement(_ContentCopyRounded["default"], null),
5694
- sx: {
5695
- width: "100%"
5696
- },
5697
- variant: "contained",
5698
- onClick: function onClick() {
5699
- copyToClipboard(reftxtTarget.current.value);
5700
- }
5701
- }, "Copy")))))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
5702
- variant: "contained",
5703
- onClick: function onClick() {
5704
- handleNext();
5705
- }
5706
- }, "Go Live"))), activeStep == 2 && /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(BootstrapDialogTitle, {
5707
- id: "customized-dialog-title",
5708
- onClose: handleClose,
5709
- sx: {
5710
- textAlign: "center",
5711
- fontSize: 30,
5712
- marginTop: 4
5713
- }
5714
- }, "Creating your private label experience"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_system.Box, {
5715
- sx: {
5716
- paddingTop: 2,
5717
- textAlign: "center"
5718
- }
5719
- }, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
5720
- gutterBottom: true,
5721
- sx: {
5722
- textAlign: "center",
5723
- fontSize: 18
5724
- }
5725
- }, "Please wait while we complete a few things on our side."), /*#__PURE__*/_react["default"].createElement(_system.Box, {
5726
- sx: {
5727
- paddingTop: 2
5728
- }
5729
- }, /*#__PURE__*/_react["default"].createElement(_CircularProgress["default"], {
5730
- color: "inherit"
5731
- })))))), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
5732
- open: errorMessage != null ? true : false,
5733
- onClose: function onClose() {
5734
- setErrorMessage(null);
5735
- },
5736
- "aria-labelledby": "alert-dialog-title",
5737
- "aria-describedby": "alert-dialog-description"
5738
- }, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
5739
- id: "alert-dialog-title"
5740
- }, "Issue Detected"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_material.DialogContentText, {
5741
- id: "alert-dialog-description"
5742
- }, errorMessage)), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
5743
- onClick: function onClick() {
5744
- setErrorMessage(null);
5745
- },
5746
- autoFocus: true
5747
- }, "OK"))));
5748
- }
5749
- "use strict";
5750
-
5751
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
5752
- Object.defineProperty(exports, "__esModule", {
5753
- value: true
5754
- });
5755
- exports.PrivateLabelEditor = PrivateLabelEditor;
5756
- var _react = _interopRequireWildcard(require("react"));
5757
- var _react2 = _interopRequireWildcard(require("@monaco-editor/react"));
5758
- var _Button = _interopRequireDefault(require("@mui/material/Button"));
5759
- var _Check = _interopRequireDefault(require("@mui/icons-material/Check"));
5760
- var _Tabs = _interopRequireDefault(require("@mui/material/Tabs"));
5761
- var _Tab = _interopRequireDefault(require("@mui/material/Tab"));
5762
- var _Box = _interopRequireDefault(require("@mui/material/Box"));
5763
- var _material = require("@mui/material");
5764
- var _xDataGrid = require("@mui/x-data-grid");
5765
- var _PublishRounded = _interopRequireDefault(require("@mui/icons-material/PublishRounded"));
5766
- var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
5767
- var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
5768
- var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
5769
- var _Select = _interopRequireDefault(require("@mui/material/Select"));
5770
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
5771
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
5772
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
5773
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
5774
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
5775
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5776
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
5777
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5778
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5779
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5780
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
5781
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
5782
- // remove after NPM
5783
- // import {FileUploader, apiService, ColorPicker, Dropzone} from 'authscape';
5784
- // import AddDomain from "./AddDomainModal";
5785
-
5786
- function PrivateLabelEditor(_ref) {
5787
- var loadedUser = _ref.loadedUser,
5788
- notification = _ref.notification,
5789
- _ref$showAllDomains = _ref.showAllDomains,
5790
- showAllDomains = _ref$showAllDomains === void 0 ? false : _ref$showAllDomains,
5791
- _ref$companyId = _ref.companyId,
5792
- companyId = _ref$companyId === void 0 ? null : _ref$companyId,
5793
- _ref$azureWebsite = _ref.azureWebsite,
5794
- azureWebsite = _ref$azureWebsite === void 0 ? "" : _ref$azureWebsite,
5795
- _ref$azureTxtValue = _ref.azureTxtValue,
5796
- azureTxtValue = _ref$azureTxtValue === void 0 ? "" : _ref$azureTxtValue;
5797
- var monaco = (0, _react2.useMonaco)();
5798
- var cssEditorRef = (0, _react.useRef)(null);
5799
- var htmlEditorRef = (0, _react.useRef)(null);
5800
- var _useState = (0, _react.useState)(null),
5801
- _useState2 = _slicedToArray(_useState, 2),
5802
- data = _useState2[0],
5803
- setData = _useState2[1];
5804
- var _useState3 = (0, _react.useState)(0),
5805
- _useState4 = _slicedToArray(_useState3, 2),
5806
- value = _useState4[0],
5807
- setValue = _useState4[1];
5808
- var _useState5 = (0, _react.useState)([]),
5809
- _useState6 = _slicedToArray(_useState5, 2),
5810
- fonts = _useState6[0],
5811
- setFonts = _useState6[1];
5812
- var _useState7 = (0, _react.useState)([]),
5813
- _useState8 = _slicedToArray(_useState7, 2),
5814
- oEMDomainList = _useState8[0],
5815
- setOEMDomainList = _useState8[1];
5816
- var _useState9 = (0, _react.useState)([]),
5817
- _useState10 = _slicedToArray(_useState9, 2),
5818
- dnsFields = _useState10[0],
5819
- setDnsFields = _useState10[1];
5820
- var _useState11 = (0, _react.useState)(null),
5821
- _useState12 = _slicedToArray(_useState11, 2),
5822
- selectedFont = _useState12[0],
5823
- setSelectedFont = _useState12[1];
5824
- var _useState13 = (0, _react.useState)(null),
5825
- _useState14 = _slicedToArray(_useState13, 2),
5826
- fontUri = _useState14[0],
5827
- setFontUri = _useState14[1];
5828
- var _useState15 = (0, _react.useState)(null),
5829
- _useState16 = _slicedToArray(_useState15, 2),
5830
- oEMDomain = _useState16[0],
5831
- setOEMDomain = _useState16[1];
5832
- var _useState17 = (0, _react.useState)(''),
5833
- _useState18 = _slicedToArray(_useState17, 2),
5834
- stateBaseUri = _useState18[0],
5835
- setBaseUri = _useState18[1];
5836
- var _useState19 = (0, _react.useState)(false),
5837
- _useState20 = _slicedToArray(_useState19, 2),
5838
- isNewAccount = _useState20[0],
5839
- setIsNewAccount = _useState20[1];
5840
- var handleChange = function handleChange(event, newValue) {
5841
- setValue(newValue);
5842
- };
5843
- var GetBaseUrl = function GetBaseUrl() {
5844
- return window.location.protocol + "//" + window.location.host;
5845
- };
5846
- var loadDNSFields = /*#__PURE__*/function () {
5847
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
5848
- var _domain,
5849
- domain,
5850
- responseFields,
5851
- _args = arguments;
5852
- return _regeneratorRuntime().wrap(function _callee$(_context) {
5853
- while (1) switch (_context.prev = _context.next) {
5854
- case 0:
5855
- _domain = _args.length > 0 && _args[0] !== undefined ? _args[0] : null;
5856
- domain = null;
5857
- if (_domain != null) {
5858
- domain = _domain;
5859
- } else {
5860
- domain = GetBaseUrl();
5861
- }
5862
- _context.next = 5;
5863
- return apiService().get("/PrivateLabel/GetFields?domain=" + domain + (companyId != null ? "&companyId=" + companyId : ""));
5864
- case 5:
5865
- responseFields = _context.sent;
5866
- if (responseFields != null && responseFields.status == 200) {
5867
- setDnsFields(responseFields.data);
5868
- }
5869
- case 7:
5870
- case "end":
5871
- return _context.stop();
5872
- }
5873
- }, _callee);
5874
- }));
5875
- return function loadDNSFields() {
5876
- return _ref2.apply(this, arguments);
5877
- };
5878
- }();
5879
- (0, _react.useEffect)(function () {
5880
- if (oEMDomain != null) {
5881
- loadDNSFields(oEMDomain);
5882
- }
5883
- }, [oEMDomain]);
5884
- var FetchOEMData = /*#__PURE__*/function () {
5885
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
5886
- var response, _response, _response2;
5887
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
5888
- while (1) switch (_context2.prev = _context2.next) {
5889
- case 0:
5890
- _context2.next = 2;
5891
- return apiService().get("/PrivateLabel/GetFonts");
5892
- case 2:
5893
- response = _context2.sent;
5894
- if (response != null && response.status == 200) {
5895
- setFonts(response.data);
5896
- }
5897
- if (!showAllDomains) {
5898
- _context2.next = 11;
5899
- break;
5900
- }
5901
- _context2.next = 7;
5902
- return apiService().get("/PrivateLabel/GetAllDomains");
5903
- case 7:
5904
- _response = _context2.sent;
5905
- if (_response != null && _response.status == 200) {
5906
- setOEMDomainList(_response.data);
5907
- if (_response.data.length > 0) {
5908
- setOEMDomain(_response.data[0].name);
5909
- } else {
5910
- setIsNewAccount(true);
5911
- }
5912
- }
5913
- _context2.next = 15;
5914
- break;
5915
- case 11:
5916
- _context2.next = 13;
5917
- return apiService().get("/PrivateLabel/GetAllDomainsUser");
5918
- case 13:
5919
- _response2 = _context2.sent;
5920
- if (_response2 != null && _response2.status == 200) {
5921
- setOEMDomainList(_response2.data);
5922
- if (_response2.data.length > 0) {
5923
- setOEMDomain(_response2.data[0].name);
5924
- } else {
5925
- setIsNewAccount(true);
5926
- }
5927
- }
5928
- case 15:
5929
- case "end":
5930
- return _context2.stop();
5931
- }
5932
- }, _callee2);
5933
- }));
5934
- return function FetchOEMData() {
5935
- return _ref3.apply(this, arguments);
5936
- };
5937
- }();
5938
- (0, _react.useEffect)(function () {
5939
- if (loadedUser) {
5940
- FetchOEMData();
5941
- }
5942
- }, [loadedUser]);
5943
- var _React$useState = _react["default"].useState({
5944
- page: 0,
5945
- pageSize: 12
5946
- }),
5947
- _React$useState2 = _slicedToArray(_React$useState, 2),
5948
- paginationModel = _React$useState2[0],
5949
- setPaginationModel = _React$useState2[1];
5950
- function handleCSSEditorDidMount(editor, monaco) {
5951
- cssEditorRef.current = editor;
5952
- }
5953
- function handleHtmlEditorDidMount(editor, monaco) {
5954
- htmlEditorRef.current = editor;
5955
- }
5956
- var columns = [{
5957
- field: "label",
5958
- headerName: "Fonts",
5959
- editable: false,
5960
- width: 300,
5961
- renderCell: function renderCell(params) {
5962
- var RenderData = function RenderData(row) {
5963
- // const { id, value, field } = params;
5964
- // const apiRef = useGridApiContext();
5965
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Box["default"], {
5966
- sx: {
5967
- fontFamily: row.value,
5968
- fontSize: 20,
5969
- cursor: "pointer"
5970
- }
5971
- }, row.value), /*#__PURE__*/_react["default"].createElement("link", {
5972
- href: "https://fonts.googleapis.com/css2?family=" + row.value,
5973
- rel: "stylesheet"
5974
- }));
5975
- };
5976
- return RenderData(params);
5977
- }
5978
- }];
5979
- (0, _react.useEffect)(function () {
5980
- var fetchData = /*#__PURE__*/function () {
5981
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
5982
- var response;
5983
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
5984
- while (1) switch (_context3.prev = _context3.next) {
5985
- case 0:
5986
- // if (monaco) {
5987
- // //console.log("here is the monaco instance:", monaco);
5988
- // }
5989
-
5990
- setData(null);
5991
- _context3.next = 3;
5992
- return apiService().get("/PrivateLabel/GetEditorData?domain=" + oEMDomain + (companyId != null ? "&companyId=" + companyId : ""));
5993
- case 3:
5994
- response = _context3.sent;
5995
- if (response.status == 200) {
5996
- setData(response.data);
5997
- setSelectedFont(response.data.fontFamily);
5998
- setFontUri(response.data.fontUrl);
5999
- }
6000
- case 5:
6001
- case "end":
6002
- return _context3.stop();
6003
- }
6004
- }, _callee3);
6005
- }));
6006
- return function fetchData() {
6007
- return _ref4.apply(this, arguments);
6008
- };
6009
- }();
6010
- fetchData();
6011
- }, [monaco, oEMDomain]);
6012
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Box["default"], {
6013
- sx: {
6014
- width: '100%'
6015
- }
6016
- }, selectedFont != null && fontUri == null && /*#__PURE__*/_react["default"].createElement("link", {
6017
- href: "https://fonts.googleapis.com/css2?family=" + selectedFont,
6018
- rel: "stylesheet"
6019
- }), /*#__PURE__*/_react["default"].createElement(_Box["default"], {
6020
- sx: {
6021
- paddingTop: 6
6022
- }
6023
- }, oEMDomain != null && /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
6024
- fullWidth: true
6025
- }, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
6026
- id: "demo-simple-select-label"
6027
- }, "Website Domain"), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
6028
- labelId: "demo-simple-select-label",
6029
- id: "demo-simple-select",
6030
- defaultValue: oEMDomain,
6031
- label: "Website Domain",
6032
- onChange: function onChange(val) {
6033
- setOEMDomain(val.target.value);
6034
- }
6035
- }, oEMDomainList.map(function (dns) {
6036
- return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
6037
- value: dns.name
6038
- }, dns.name);
6039
- })))), /*#__PURE__*/_react["default"].createElement(_Box["default"], {
6040
- sx: {
6041
- borderBottom: 1,
6042
- borderColor: 'divider',
6043
- paddingTop: 2
6044
- }
6045
- }, /*#__PURE__*/_react["default"].createElement(_Tabs["default"], {
6046
- value: value,
6047
- onChange: handleChange,
6048
- "aria-label": "basic tabs example"
6049
- }, /*#__PURE__*/_react["default"].createElement(_Tab["default"], {
6050
- label: "App Icon / Colors"
6051
- }), /*#__PURE__*/_react["default"].createElement(_Tab["default"], {
6052
- label: "Fonts"
6053
- }), /*#__PURE__*/_react["default"].createElement(_Tab["default"], {
6054
- label: "Style Sheet Editor"
6055
- }), /*#__PURE__*/_react["default"].createElement(_Tab["default"], {
6056
- label: "HTML Import Editor"
6057
- }))), /*#__PURE__*/_react["default"].createElement(_Box["default"], null, /*#__PURE__*/_react["default"].createElement(_Box["default"], {
6058
- sx: {
6059
- padding: 2
6060
- }
6061
- }, value == 0 && /*#__PURE__*/_react["default"].createElement(_Box["default"], null, data != null && /*#__PURE__*/_react["default"].createElement(_Box["default"], null, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
6062
- container: true,
6063
- spacing: 2
6064
- }, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
6065
- item: true,
6066
- xs: 4
6067
- }, /*#__PURE__*/_react["default"].createElement(_Box["default"], {
6068
- sx: {
6069
- paddingBottom: 4
6070
- }
6071
- }, /*#__PURE__*/_react["default"].createElement(Dropzone, {
6072
- image: "/DefaultNoImage.svg",
6073
- text: "Drag 'n' drop your app icon here",
6074
- onDrop: /*#__PURE__*/function () {
6075
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(file) {
6076
- var data, response;
6077
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
6078
- while (1) switch (_context4.prev = _context4.next) {
6079
- case 0:
6080
- data = new FormData();
6081
- data.append("file", file);
6082
- data.append("domain", stateBaseUri);
6083
- _context4.next = 5;
6084
- return apiService().post("/PrivateLabel/UploadAppIcon", data);
6085
- case 5:
6086
- response = _context4.sent;
6087
- if (response != null && response.status == 200) {
6088
- window.location.reload();
6089
- }
6090
- case 7:
6091
- case "end":
6092
- return _context4.stop();
6093
- }
6094
- }, _callee4);
6095
- }));
6096
- return function (_x2) {
6097
- return _ref5.apply(this, arguments);
6098
- };
6099
- }()
6100
- }))), /*#__PURE__*/_react["default"].createElement(_material.Grid, {
6101
- item: true,
6102
- xs: 8
6103
- }, /*#__PURE__*/_react["default"].createElement(_Box["default"], {
2969
+ }())
2970
+ }, tier.buttonText), /*#__PURE__*/_react["default"].createElement(_material.Typography, {
2971
+ variant: "body2",
2972
+ sx: {
2973
+ paddingTop: 2,
2974
+ fontSize: 16,
2975
+ textAlign: "left",
2976
+ lineHeight: "1.5rem"
2977
+ }
2978
+ }, /*#__PURE__*/_react["default"].createElement("div", {
2979
+ dangerouslySetInnerHTML: {
2980
+ __html: tier.description
2981
+ }
2982
+ })))));
2983
+ })), features != null && /*#__PURE__*/_react["default"].createElement(_system.Box, {
6104
2984
  sx: {
6105
- paddingBottom: 2,
6106
- fontWeight: "bold",
6107
- fontSize: 16
2985
+ paddingTop: 1
6108
2986
  }
6109
- }, "Adjust the colors for your site"), /*#__PURE__*/_react["default"].createElement(_Box["default"], null, dnsFields != null && dnsFields.map(function (dnsField, index) {
6110
- return /*#__PURE__*/_react["default"].createElement(_Box["default"], {
6111
- key: index
6112
- }, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
2987
+ }, features.map(function (feature) {
2988
+ return /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_system.Box, {
2989
+ sx: {
2990
+ backgroundColor: "lightgray",
2991
+ padding: 1,
2992
+ borderRadius: 2
2993
+ }
2994
+ }, /*#__PURE__*/_react["default"].createElement(_material.Typography, {
2995
+ variant: "h5",
2996
+ gutterBottom: true
2997
+ }, feature.name)), /*#__PURE__*/_react["default"].createElement(_material.Grid, {
6113
2998
  container: true,
6114
- spacing: 2
6115
- }, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
6116
- item: true,
6117
- xs: 3
6118
- }, dnsField.name), /*#__PURE__*/_react["default"].createElement(_material.Grid, {
6119
- item: true,
6120
- xs: 9
6121
- }, /*#__PURE__*/_react["default"].createElement(ColorPicker, {
6122
- name: dnsField.name,
6123
- defaultColor: dnsField.value,
6124
- onColorChanged: /*#__PURE__*/function () {
6125
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(name, hex) {
6126
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
6127
- while (1) switch (_context5.prev = _context5.next) {
6128
- case 0:
6129
- _context5.next = 2;
6130
- return apiService().post("/PrivateLabel/SetFieldValue", {
6131
- id: dnsField.id,
6132
- fieldId: dnsField.fieldId,
6133
- value: hex
6134
- });
6135
- case 2:
6136
- notification(dnsField.name + " Saved");
6137
- case 3:
6138
- case "end":
6139
- return _context5.stop();
6140
- }
6141
- }, _callee5);
6142
- }));
6143
- return function (_x3, _x4) {
6144
- return _ref6.apply(this, arguments);
6145
- };
6146
- }()
6147
- }))));
6148
- })))))), value == 1 && /*#__PURE__*/_react["default"].createElement(_Box["default"], {
6149
- value: value,
6150
- index: 1
6151
- }, data != null && /*#__PURE__*/_react["default"].createElement(_Box["default"], null, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
6152
- container: true,
6153
- spacing: 2
6154
- }, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
6155
- item: true,
6156
- xs: 6
6157
- }, loadedUser == true && /*#__PURE__*/_react["default"].createElement(_Box["default"], null, /*#__PURE__*/_react["default"].createElement(_xDataGrid.DataGrid, {
6158
- rows: fonts,
6159
- columns: columns,
6160
- sx: {
6161
- height: "80vh",
6162
- width: "100%"
6163
- },
6164
- pagination: true,
6165
- disableSelectionOnClick: true,
6166
- onPaginationModelChange: setPaginationModel,
6167
- paginationModel: paginationModel
6168
- //pageSizeOptions={[5]}
6169
- // rowCount={100}
6170
- // rowSelectionModel={selectedFont}
6171
- ,
6172
- onRowClick: /*#__PURE__*/function () {
6173
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
6174
- var response;
6175
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
6176
- while (1) switch (_context6.prev = _context6.next) {
6177
- case 0:
6178
- _context6.next = 2;
6179
- return apiService().post("/PrivateLabel/SetFont", {
6180
- companyId: companyId,
6181
- domain: oEMDomain,
6182
- value: params.row.label
6183
- });
6184
- case 2:
6185
- response = _context6.sent;
6186
- if (response != null && response.status == 200) {
6187
- setSelectedFont(params.row.label);
6188
- setFontUri(null);
6189
- notification("Font saved!");
6190
- }
6191
- case 4:
6192
- case "end":
6193
- return _context6.stop();
2999
+ spacing: 0,
3000
+ justifyContent: "center"
3001
+ }, feature.subfeatures.map(function (subfeature, subFeatureIndex) {
3002
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, subfeature.map(function (item, index) {
3003
+ return /*#__PURE__*/_react["default"].createElement(_material.Grid, {
3004
+ item: true,
3005
+ xs: 3,
3006
+ key: subfeature
3007
+ }, /*#__PURE__*/_react["default"].createElement(_system.Box, {
3008
+ sx: {
3009
+ padding: 2,
3010
+ height: 60,
3011
+ paddingTop: subFeatureIndex == 0 ? 3 : 2,
3012
+ textAlign: index == 0 ? "left" : "center"
6194
3013
  }
6195
- }, _callee6);
3014
+ }, item), feature.subfeatures.length - 1 != subFeatureIndex ? /*#__PURE__*/_react["default"].createElement("hr", null) : "");
6196
3015
  }));
6197
- return function (_x5) {
6198
- return _ref7.apply(this, arguments);
6199
- };
6200
- }()
6201
- }))), /*#__PURE__*/_react["default"].createElement(_material.Grid, {
6202
- item: true,
6203
- xs: 6
6204
- }, /*#__PURE__*/_react["default"].createElement(FileUploader, {
6205
- url: "/PrivateLabel/UploadCustomFont",
6206
- accept: ".otf,.ttf,.woff",
6207
- params: {
6208
- domain: stateBaseUri
6209
- },
6210
- multiple: true,
6211
- variant: "custom",
6212
- onUploadCompleted: function onUploadCompleted() {
6213
- window.location.reload();
6214
- }
6215
- }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
6216
- color: "primary",
6217
- variant: "contained",
6218
- fullWidth: true,
6219
- sx: {
6220
- height: 50
6221
- },
6222
- startIcon: /*#__PURE__*/_react["default"].createElement(_PublishRounded["default"], null)
6223
- }, /*#__PURE__*/_react["default"].createElement(_Box["default"], null, "Upload Font"), "\xA0", /*#__PURE__*/_react["default"].createElement(_Box["default"], {
6224
- sx: {
6225
- textAlign: "center"
6226
- }
6227
- }, /*#__PURE__*/_react["default"].createElement("small", null, "(.OTF, .TTF, OR .WOFF)")))), /*#__PURE__*/_react["default"].createElement(_Box["default"], {
6228
- sx: {
6229
- marginTop: 4
6230
- }
6231
- }, "Font Selected:"), /*#__PURE__*/_react["default"].createElement(_Box["default"], {
6232
- sx: {
6233
- marginBottom: 2,
6234
- fontWeight: "bold",
6235
- fontSize: 20
6236
- }
6237
- }, " ", selectedFont), /*#__PURE__*/_react["default"].createElement("hr", null), /*#__PURE__*/_react["default"].createElement(_Box["default"], {
6238
- sx: {
6239
- fontFamily: selectedFont
6240
- }
6241
- }, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ut ultricies odio. Nunc ut quam turpis. In hac habitasse platea dictumst. Suspendisse potenti. Nullam malesuada, purus id sagittis vestibulum, massa tellus gravida elit, vitae ultrices tortor nulla ac nunc. Aenean tempus semper est vel convallis. Sed feugiat, risus eu tincidunt eleifend, purus metus vulputate nulla, et condimentum sapien erat in nisi. Nunc non malesuada libero. Donec tempus tincidunt mi at vulputate. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse potenti. Etiam nec eleifend orci. Suspendisse in est vel nunc rhoncus bibendum vitae id felis. Integer bibendum dolor elit, at tincidunt lacus tempor ac. Maecenas lobortis, mauris at condimentum feugiat, nulla orci condimentum massa, sed facilisis tellus ligula vitae metus. Aliquam erat volutpat. Quisque dignissim felis augue, at semper nisl posuere ut. Proin fringilla diam vitae faucibus finibus.", /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement("br", null), "Aenean tempus semper est vel convallis. Sed feugiat, risus eu tincidunt eleifend, purus metus vulputate nulla, et condimentum sapien erat in nisi. Nunc non malesuada libero. Donec tempus tincidunt mi at vulputate. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse potenti"))))), value == 2 && /*#__PURE__*/_react["default"].createElement(_Box["default"], {
6242
- value: value,
6243
- index: 3
6244
- }, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
6245
- container: true,
6246
- spacing: 2
6247
- }, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
6248
- item: true,
6249
- xs: 6
6250
- }, /*#__PURE__*/_react["default"].createElement("h4", {
6251
- style: {
6252
- marginBottom: "0px"
6253
- }
6254
- }, "Global CSS edits"), /*#__PURE__*/_react["default"].createElement("small", null, "You can make edits to your stylesheet")), /*#__PURE__*/_react["default"].createElement(_material.Grid, {
6255
- item: true,
6256
- xs: 6,
6257
- sx: {
6258
- textAlign: "right"
6259
- }
6260
- }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
6261
- startIcon: /*#__PURE__*/_react["default"].createElement(_Check["default"], null),
6262
- sx: {
6263
- marginTop: 4
6264
- },
6265
- variant: "contained",
6266
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
6267
- var response;
6268
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
6269
- while (1) switch (_context7.prev = _context7.next) {
6270
- case 0:
6271
- _context7.next = 2;
6272
- return apiService().post("/PrivateLabel/SetGlobalCSS", {
6273
- companyId: companyId,
6274
- domain: oEMDomain,
6275
- value: cssEditorRef.current.getValue()
6276
- });
6277
- case 2:
6278
- response = _context7.sent;
6279
- if (response != null && response.status == 200) {
6280
- notification("CSS Saved!");
6281
- }
6282
- case 4:
6283
- case "end":
6284
- return _context7.stop();
6285
- }
6286
- }, _callee7);
6287
- }))
6288
- }, "Save Changes"))), /*#__PURE__*/_react["default"].createElement(_Box["default"], {
6289
- sx: {
6290
- paddingTop: 1
6291
- }
6292
- }, data != null && /*#__PURE__*/_react["default"].createElement(_react2["default"], {
6293
- height: "70vh",
6294
- onMount: handleCSSEditorDidMount,
6295
- defaultLanguage: "css",
6296
- theme: "vs-dark",
6297
- defaultValue: data == null || data.prettyCSS == null ? "" : data.prettyCSS
6298
- }))), value == 3 && /*#__PURE__*/_react["default"].createElement(_Box["default"], {
6299
- value: value,
6300
- index: 4
6301
- }, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
6302
- container: true,
6303
- spacing: 2
6304
- }, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
6305
- item: true,
6306
- xs: 6
6307
- }, /*#__PURE__*/_react["default"].createElement("h4", {
6308
- style: {
6309
- marginBottom: "0px"
6310
- }
6311
- }, "HTML import Edits"), /*#__PURE__*/_react["default"].createElement("small", null, "You can add imports such as google analytics or clarity")), /*#__PURE__*/_react["default"].createElement(_material.Grid, {
6312
- item: true,
6313
- xs: 6,
6314
- sx: {
6315
- textAlign: "right"
6316
- }
6317
- }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
6318
- startIcon: /*#__PURE__*/_react["default"].createElement(_Check["default"], null),
6319
- sx: {
6320
- marginTop: 4
6321
- },
6322
- variant: "contained",
6323
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
6324
- var response;
6325
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
6326
- while (1) switch (_context8.prev = _context8.next) {
6327
- case 0:
6328
- _context8.next = 2;
6329
- return apiService().post("/PrivateLabel/SetGlobalHTML", {
6330
- companyId: companyId,
6331
- domain: oEMDomain,
6332
- value: htmlEditorRef.current.getValue()
6333
- });
6334
- case 2:
6335
- response = _context8.sent;
6336
- if (response != null && response.status == 200) {
6337
- notification("HTML saved!");
6338
- }
6339
- case 4:
6340
- case "end":
6341
- return _context8.stop();
6342
- }
6343
- }, _callee8);
6344
- }))
6345
- }, "Save Changes"))), /*#__PURE__*/_react["default"].createElement(_Box["default"], {
6346
- sx: {
6347
- paddingTop: 1
6348
- }
6349
- }, data != null && /*#__PURE__*/_react["default"].createElement(_react2["default"], {
6350
- height: "70vh",
6351
- onMount: handleHtmlEditorDidMount,
6352
- defaultLanguage: "html",
6353
- theme: "vs-dark",
6354
- defaultValue: data == null || data.prettyHTML == null ? "" : data.prettyHTML
6355
- }))))), /*#__PURE__*/_react["default"].createElement(AddDomain, {
6356
- open: isNewAccount,
6357
- azureWebsite: azureWebsite,
6358
- azureTxtValue: azureTxtValue,
6359
- handleClose: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
6360
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
6361
- while (1) switch (_context9.prev = _context9.next) {
6362
- case 0:
6363
- setIsNewAccount(false);
6364
- _context9.next = 3;
6365
- return FetchOEMData();
6366
- case 3:
6367
- case "end":
6368
- return _context9.stop();
6369
- }
6370
- }, _callee9);
6371
- }))
6372
- })));
3016
+ })));
3017
+ }))));
6373
3018
  }
6374
3019
  "use strict";
6375
3020