authscape 1.0.605 → 1.0.607

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
@@ -5776,6 +5776,544 @@ function Pricing(_ref) {
5776
5776
  }
5777
5777
  "use strict";
5778
5778
 
5779
+ 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); }
5780
+ Object.defineProperty(exports, "__esModule", {
5781
+ value: true
5782
+ });
5783
+ exports.AddDomain = AddDomain;
5784
+ var _react = _interopRequireWildcard(require("react"));
5785
+ var _system = require("@mui/system");
5786
+ var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
5787
+ var _Button = _interopRequireDefault(require("@mui/material/Button"));
5788
+ var _styles = require("@mui/material/styles");
5789
+ var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
5790
+ var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
5791
+ var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
5792
+ var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
5793
+ var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
5794
+ var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
5795
+ var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
5796
+ var _Stepper = _interopRequireDefault(require("@mui/material/Stepper"));
5797
+ var _Step = _interopRequireDefault(require("@mui/material/Step"));
5798
+ var _StepLabel = _interopRequireDefault(require("@mui/material/StepLabel"));
5799
+ var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
5800
+ var _FmdBadRounded = _interopRequireDefault(require("@mui/icons-material/FmdBadRounded"));
5801
+ var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
5802
+ var _Select = _interopRequireDefault(require("@mui/material/Select"));
5803
+ var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
5804
+ var _parseDomain = require("parse-domain");
5805
+ var _ContentCopyRounded = _interopRequireDefault(require("@mui/icons-material/ContentCopyRounded"));
5806
+ var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
5807
+ var _material = require("@mui/material");
5808
+ var _excluded = ["children", "onClose"];
5809
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
5810
+ 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); }
5811
+ 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; }
5812
+ 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); }
5813
+ 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; }
5814
+ 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; }
5815
+ 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; }
5816
+ 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); } }
5817
+ 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); }); }; }
5818
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
5819
+ 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."); }
5820
+ 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); }
5821
+ 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; }
5822
+ 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; } }
5823
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import { apiService } from 'authscape';
5824
+ function AddDomain(_ref) {
5825
+ var open = _ref.open,
5826
+ azureWebsite = _ref.azureWebsite,
5827
+ azureTxtValue = _ref.azureTxtValue,
5828
+ handleClose = _ref.handleClose;
5829
+ var steps = ['Enter a domain', 'Setup DNS Record', 'Go Live'];
5830
+ var _useState = (0, _react.useState)(0),
5831
+ _useState2 = _slicedToArray(_useState, 2),
5832
+ activeStep = _useState2[0],
5833
+ setActiveStep = _useState2[1];
5834
+ var _useState3 = (0, _react.useState)({}),
5835
+ _useState4 = _slicedToArray(_useState3, 2),
5836
+ completed = _useState4[0],
5837
+ setCompleted = _useState4[1];
5838
+ var _useState5 = (0, _react.useState)(null),
5839
+ _useState6 = _slicedToArray(_useState5, 2),
5840
+ domain = _useState6[0],
5841
+ setDomain = _useState6[1];
5842
+ var _useState7 = (0, _react.useState)(null),
5843
+ _useState8 = _slicedToArray(_useState7, 2),
5844
+ subDomains = _useState8[0],
5845
+ setSubDomains = _useState8[1];
5846
+ var _useState9 = (0, _react.useState)(null),
5847
+ _useState10 = _slicedToArray(_useState9, 2),
5848
+ topLevelDomains = _useState10[0],
5849
+ setTopLevelDomains = _useState10[1];
5850
+ var _useState11 = (0, _react.useState)(null),
5851
+ _useState12 = _slicedToArray(_useState11, 2),
5852
+ fullDomain = _useState12[0],
5853
+ setFullDomain = _useState12[1];
5854
+ var _useState13 = (0, _react.useState)(null),
5855
+ _useState14 = _slicedToArray(_useState13, 2),
5856
+ errorMessage = _useState14[0],
5857
+ setErrorMessage = _useState14[1];
5858
+ var refDomain = (0, _react.useRef)(null);
5859
+ var refCNameTarget = (0, _react.useRef)(null);
5860
+ var reftxtTarget = (0, _react.useRef)(null);
5861
+ var refCNameName = (0, _react.useRef)(null);
5862
+ var reftxtName = (0, _react.useRef)(null);
5863
+ var totalSteps = function totalSteps() {
5864
+ return steps.length;
5865
+ };
5866
+ var completedSteps = function completedSteps() {
5867
+ return Object.keys(completed).length;
5868
+ };
5869
+ var isLastStep = function isLastStep() {
5870
+ return activeStep === totalSteps() - 1;
5871
+ };
5872
+ var allStepsCompleted = function allStepsCompleted() {
5873
+ return completedSteps() === totalSteps();
5874
+ };
5875
+ var handleNext = function handleNext() {
5876
+ var newActiveStep = isLastStep() && !allStepsCompleted() ?
5877
+ // It's the last step, but not all steps have been completed,
5878
+ // find the first step that has been completed
5879
+ steps.findIndex(function (step, i) {
5880
+ return !(i in completed);
5881
+ }) : activeStep + 1;
5882
+ setActiveStep(newActiveStep);
5883
+ };
5884
+ var handleBack = function handleBack() {
5885
+ setActiveStep(function (prevActiveStep) {
5886
+ return prevActiveStep - 1;
5887
+ });
5888
+ };
5889
+ var handleStep = function handleStep(step) {
5890
+ return function () {
5891
+ setActiveStep(step);
5892
+ };
5893
+ };
5894
+ var handleComplete = function handleComplete() {
5895
+ var newCompleted = completed;
5896
+ newCompleted[activeStep] = true;
5897
+ setCompleted(newCompleted);
5898
+ handleNext();
5899
+ };
5900
+ var BootstrapDialog = (0, _styles.styled)(_Dialog["default"])(function (_ref2) {
5901
+ var theme = _ref2.theme;
5902
+ return {
5903
+ '& .MuiDialogContent-root': {
5904
+ padding: theme.spacing(2)
5905
+ },
5906
+ '& .MuiDialogActions-root': {
5907
+ padding: theme.spacing(1)
5908
+ }
5909
+ };
5910
+ });
5911
+ var handleReset = function handleReset() {
5912
+ setActiveStep(0);
5913
+ setCompleted({});
5914
+ };
5915
+ var createTheDomainRequest = /*#__PURE__*/function () {
5916
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
5917
+ var response, aStep;
5918
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
5919
+ while (1) switch (_context.prev = _context.next) {
5920
+ case 0:
5921
+ if (!(fullDomain == null || fullDomain == "")) {
5922
+ _context.next = 2;
5923
+ break;
5924
+ }
5925
+ return _context.abrupt("return");
5926
+ case 2:
5927
+ _context.next = 4;
5928
+ return apiService().post("/PrivateLabel/GenerateDomain", {
5929
+ hostName: fullDomain
5930
+ });
5931
+ case 4:
5932
+ response = _context.sent;
5933
+ if (response != null && response.status == 200) {
5934
+ if (handleClose != null) {
5935
+ handleClose();
5936
+ }
5937
+ } else {
5938
+ aStep = activeStep - 1;
5939
+ setActiveStep(aStep);
5940
+ setErrorMessage(response.data);
5941
+ }
5942
+ case 6:
5943
+ case "end":
5944
+ return _context.stop();
5945
+ }
5946
+ }, _callee);
5947
+ }));
5948
+ return function createTheDomainRequest() {
5949
+ return _ref3.apply(this, arguments);
5950
+ };
5951
+ }();
5952
+ (0, _react.useEffect)(function () {
5953
+ if (activeStep == 2) {
5954
+ createTheDomainRequest();
5955
+ }
5956
+ }, [activeStep]);
5957
+ var copyToClipboard = /*#__PURE__*/function () {
5958
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(text) {
5959
+ var permissions;
5960
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
5961
+ while (1) switch (_context2.prev = _context2.next) {
5962
+ case 0:
5963
+ _context2.prev = 0;
5964
+ _context2.next = 3;
5965
+ return navigator.permissions.query({
5966
+ name: "clipboard-write"
5967
+ });
5968
+ case 3:
5969
+ permissions = _context2.sent;
5970
+ if (!(permissions.state === "granted" || permissions.state === "prompt")) {
5971
+ _context2.next = 9;
5972
+ break;
5973
+ }
5974
+ _context2.next = 7;
5975
+ return navigator.clipboard.writeText(text);
5976
+ case 7:
5977
+ _context2.next = 10;
5978
+ break;
5979
+ case 9:
5980
+ throw new Error("Can't access the clipboard. Check your browser permissions.");
5981
+ case 10:
5982
+ _context2.next = 15;
5983
+ break;
5984
+ case 12:
5985
+ _context2.prev = 12;
5986
+ _context2.t0 = _context2["catch"](0);
5987
+ alert('Error copying to clipboard:', _context2.t0);
5988
+ case 15:
5989
+ case "end":
5990
+ return _context2.stop();
5991
+ }
5992
+ }, _callee2, null, [[0, 12]]);
5993
+ }));
5994
+ return function copyToClipboard(_x2) {
5995
+ return _ref4.apply(this, arguments);
5996
+ };
5997
+ }();
5998
+ function BootstrapDialogTitle(props) {
5999
+ var children = props.children,
6000
+ onClose = props.onClose,
6001
+ other = _objectWithoutProperties(props, _excluded);
6002
+ return /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], _extends({
6003
+ sx: {
6004
+ m: 0,
6005
+ p: 2
6006
+ }
6007
+ }, other), children, onClose ? /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
6008
+ "aria-label": "close",
6009
+ onClick: onClose,
6010
+ sx: {
6011
+ position: 'absolute',
6012
+ right: 8,
6013
+ top: 8,
6014
+ color: function color(theme) {
6015
+ return theme.palette.grey[500];
6016
+ }
6017
+ }
6018
+ }, /*#__PURE__*/_react["default"].createElement(_Close["default"], null)) : null);
6019
+ }
6020
+ return /*#__PURE__*/_react["default"].createElement(BootstrapDialog, {
6021
+ onClose: handleClose,
6022
+ "aria-labelledby": "customized-dialog-title",
6023
+ sx: {
6024
+ backgroundColor: "rgba(0, 0, 0, 0.6)"
6025
+ },
6026
+ fullWidth: true,
6027
+ maxWidth: "md",
6028
+ open: open
6029
+ }, /*#__PURE__*/_react["default"].createElement(_system.Box, {
6030
+ sx: {
6031
+ padding: 4
6032
+ }
6033
+ }, /*#__PURE__*/_react["default"].createElement(_Stepper["default"], {
6034
+ activeStep: activeStep,
6035
+ alternativeLabel: true
6036
+ }, steps.map(function (label) {
6037
+ return /*#__PURE__*/_react["default"].createElement(_Step["default"], {
6038
+ key: label
6039
+ }, /*#__PURE__*/_react["default"].createElement(_StepLabel["default"], {
6040
+ sx: {
6041
+ color: "#fff"
6042
+ }
6043
+ }, label));
6044
+ })), activeStep == 0 && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(BootstrapDialogTitle, {
6045
+ id: "customized-dialog-title",
6046
+ onClose: handleClose,
6047
+ sx: {
6048
+ textAlign: "center",
6049
+ fontSize: 30,
6050
+ marginTop: 2,
6051
+ lineHeight: 1
6052
+ }
6053
+ }, "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"], {
6054
+ inputRef: refDomain,
6055
+ id: "domainTxt",
6056
+ label: "Enter subdomain URL e.g catalog.mydomain.com",
6057
+ fullWidth: true,
6058
+ variant: "outlined",
6059
+ sx: {
6060
+ color: "white",
6061
+ marginTop: 2
6062
+ }
6063
+ })), /*#__PURE__*/_react["default"].createElement(_system.Box, {
6064
+ sx: {
6065
+ marginTop: 2
6066
+ }
6067
+ }, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
6068
+ gutterBottom: true,
6069
+ sx: {
6070
+ textAlign: "center",
6071
+ fontSize: 14
6072
+ }
6073
+ }, /*#__PURE__*/_react["default"].createElement(_FmdBadRounded["default"], {
6074
+ sx: {
6075
+ color: "#1976d2",
6076
+ position: "relative",
6077
+ top: 8
6078
+ }
6079
+ }), " 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"], {
6080
+ variant: "contained",
6081
+ onClick: function onClick() {
6082
+ if (refDomain.current.value == "") {
6083
+ return;
6084
+ }
6085
+ setFullDomain(refDomain.current.value);
6086
+ var domainLand = (0, _parseDomain.parseDomain)(refDomain.current.value);
6087
+ setDomain(domainLand.domain);
6088
+ setSubDomains(domainLand.subDomains);
6089
+ setTopLevelDomains(domainLand.topLevelDomains);
6090
+ handleNext();
6091
+ }
6092
+ }, "Next: Setup DNS"))), activeStep == 1 && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(BootstrapDialogTitle, {
6093
+ id: "customized-dialog-title",
6094
+ onClose: handleClose,
6095
+ sx: {
6096
+ textAlign: "center",
6097
+ fontSize: 30,
6098
+ marginTop: 2
6099
+ }
6100
+ }, "Configure your DNS"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
6101
+ gutterBottom: true,
6102
+ sx: {
6103
+ textAlign: "center",
6104
+ fontSize: 14
6105
+ }
6106
+ }, "Add a CNAME and TXT Record to your domain by visiting your DNS provider.")), /*#__PURE__*/_react["default"].createElement(_system.Box, {
6107
+ sx: {
6108
+ backgroundColor: "#f7f7f7",
6109
+ marginTop: 5,
6110
+ paddingLeft: 4,
6111
+ paddingRight: 4
6112
+ }
6113
+ }, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
6114
+ container: true,
6115
+ spacing: 2,
6116
+ fullWidth: true
6117
+ }, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
6118
+ item: true,
6119
+ xs: 2
6120
+ }, "Type", /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
6121
+ fullWidth: true,
6122
+ sx: {
6123
+ paddingTop: 2
6124
+ }
6125
+ }, /*#__PURE__*/_react["default"].createElement(_Select["default"], {
6126
+ value: 1,
6127
+ readOnly: true
6128
+ }, /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
6129
+ value: 1
6130
+ }, "CNAME")))), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
6131
+ item: true,
6132
+ xs: 5
6133
+ }, "Name", /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
6134
+ inputRef: refCNameName,
6135
+ id: "NameDomainTxt",
6136
+ label: "",
6137
+ fullWidth: true,
6138
+ value: subDomains,
6139
+ variant: "outlined",
6140
+ sx: {
6141
+ color: "white",
6142
+ paddingTop: 2
6143
+ }
6144
+ }), /*#__PURE__*/_react["default"].createElement(_system.Box, {
6145
+ sx: {
6146
+ textAlign: "center",
6147
+ paddingTop: 1
6148
+ }
6149
+ }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
6150
+ startIcon: /*#__PURE__*/_react["default"].createElement(_ContentCopyRounded["default"], null),
6151
+ sx: {
6152
+ width: "100%"
6153
+ },
6154
+ variant: "contained",
6155
+ onClick: function onClick() {
6156
+ copyToClipboard(refCNameName.current.value);
6157
+ }
6158
+ }, "Copy"))), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
6159
+ item: true,
6160
+ xs: 5
6161
+ }, "Target", /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
6162
+ inputRef: refCNameTarget,
6163
+ id: "targetDomainTxt",
6164
+ label: "",
6165
+ fullWidth: true,
6166
+ value: azureWebsite,
6167
+ variant: "outlined",
6168
+ sx: {
6169
+ color: "white",
6170
+ paddingTop: 2
6171
+ }
6172
+ }), /*#__PURE__*/_react["default"].createElement(_system.Box, {
6173
+ sx: {
6174
+ textAlign: "center",
6175
+ paddingTop: 1
6176
+ }
6177
+ }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
6178
+ startIcon: /*#__PURE__*/_react["default"].createElement(_ContentCopyRounded["default"], null),
6179
+ sx: {
6180
+ width: "100%"
6181
+ },
6182
+ variant: "contained",
6183
+ onClick: function onClick() {
6184
+ copyToClipboard(refCNameTarget.current.value);
6185
+ }
6186
+ }, "Copy"))))), /*#__PURE__*/_react["default"].createElement(_system.Box, {
6187
+ sx: {
6188
+ backgroundColor: "#f7f7f7",
6189
+ paddingLeft: 4,
6190
+ paddingRight: 4,
6191
+ marginTop: 2,
6192
+ paddingBottom: 4
6193
+ }
6194
+ }, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
6195
+ container: true,
6196
+ spacing: 2,
6197
+ fullWidth: true
6198
+ }, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
6199
+ item: true,
6200
+ xs: 2
6201
+ }, "Type", /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
6202
+ fullWidth: true,
6203
+ sx: {
6204
+ paddingTop: 2
6205
+ }
6206
+ }, /*#__PURE__*/_react["default"].createElement(_Select["default"], {
6207
+ value: 1,
6208
+ readOnly: true
6209
+ }, /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
6210
+ value: 1
6211
+ }, "TXT")))), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
6212
+ item: true,
6213
+ xs: 5
6214
+ }, "Name", /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
6215
+ inputRef: reftxtName,
6216
+ id: "NameDomain2Txt",
6217
+ label: "",
6218
+ fullWidth: true,
6219
+ value: "asuid." + subDomains,
6220
+ variant: "outlined",
6221
+ sx: {
6222
+ color: "white",
6223
+ marginTop: 2
6224
+ }
6225
+ }), /*#__PURE__*/_react["default"].createElement(_system.Box, {
6226
+ sx: {
6227
+ textAlign: "center",
6228
+ paddingTop: 1
6229
+ }
6230
+ }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
6231
+ startIcon: /*#__PURE__*/_react["default"].createElement(_ContentCopyRounded["default"], null),
6232
+ sx: {
6233
+ width: "100%"
6234
+ },
6235
+ variant: "contained",
6236
+ onClick: function onClick() {
6237
+ copyToClipboard(reftxtName.current.value);
6238
+ }
6239
+ }, "Copy"))), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
6240
+ item: true,
6241
+ xs: 5
6242
+ }, "Target", /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
6243
+ inputRef: reftxtTarget,
6244
+ id: "targetDomain2Txt",
6245
+ label: "",
6246
+ fullWidth: true,
6247
+ value: azureTxtValue,
6248
+ variant: "outlined",
6249
+ sx: {
6250
+ color: "white",
6251
+ marginTop: 2
6252
+ }
6253
+ }), /*#__PURE__*/_react["default"].createElement(_system.Box, {
6254
+ sx: {
6255
+ textAlign: "center",
6256
+ paddingTop: 1
6257
+ }
6258
+ }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
6259
+ startIcon: /*#__PURE__*/_react["default"].createElement(_ContentCopyRounded["default"], null),
6260
+ sx: {
6261
+ width: "100%"
6262
+ },
6263
+ variant: "contained",
6264
+ onClick: function onClick() {
6265
+ copyToClipboard(reftxtTarget.current.value);
6266
+ }
6267
+ }, "Copy")))))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
6268
+ variant: "contained",
6269
+ onClick: function onClick() {
6270
+ handleNext();
6271
+ }
6272
+ }, "Go Live"))), activeStep == 2 && /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(BootstrapDialogTitle, {
6273
+ id: "customized-dialog-title",
6274
+ onClose: handleClose,
6275
+ sx: {
6276
+ textAlign: "center",
6277
+ fontSize: 30,
6278
+ marginTop: 4
6279
+ }
6280
+ }, "Creating your private label experience"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_system.Box, {
6281
+ sx: {
6282
+ paddingTop: 2,
6283
+ textAlign: "center"
6284
+ }
6285
+ }, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
6286
+ gutterBottom: true,
6287
+ sx: {
6288
+ textAlign: "center",
6289
+ fontSize: 18
6290
+ }
6291
+ }, "Please wait while we complete a few things on our side."), /*#__PURE__*/_react["default"].createElement(_system.Box, {
6292
+ sx: {
6293
+ paddingTop: 2
6294
+ }
6295
+ }, /*#__PURE__*/_react["default"].createElement(_CircularProgress["default"], {
6296
+ color: "inherit"
6297
+ })))))), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
6298
+ open: errorMessage != null ? true : false,
6299
+ onClose: function onClose() {
6300
+ setErrorMessage(null);
6301
+ },
6302
+ "aria-labelledby": "alert-dialog-title",
6303
+ "aria-describedby": "alert-dialog-description"
6304
+ }, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
6305
+ id: "alert-dialog-title"
6306
+ }, "Issue Detected"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_material.DialogContentText, {
6307
+ id: "alert-dialog-description"
6308
+ }, errorMessage)), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
6309
+ onClick: function onClick() {
6310
+ setErrorMessage(null);
6311
+ },
6312
+ autoFocus: true
6313
+ }, "OK"))));
6314
+ }
6315
+ "use strict";
6316
+
5779
6317
  Object.defineProperty(exports, "__esModule", {
5780
6318
  value: true
5781
6319
  });
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "authscape",
3
- "version": "1.0.605",
3
+ "version": "1.0.607",
4
4
  "description": "",
5
5
  "main": "index.js",
6
+ "type": "module",
6
7
  "scripts": {
7
8
  "test": "echo \"Error: no test specified\" && exit 1",
8
9
  "build": "npx babel src --out-file index.js"
@@ -0,0 +1,390 @@
1
+ import React, {useEffect, useRef, useState} from 'react';
2
+ import { Box } from '@mui/system';
3
+ import Grid from '@mui/material/Grid';
4
+ import Button from '@mui/material/Button';
5
+ import { styled } from '@mui/material/styles';
6
+ import Dialog from '@mui/material/Dialog';
7
+ import DialogTitle from '@mui/material/DialogTitle';
8
+ import DialogContent from '@mui/material/DialogContent';
9
+ import DialogActions from '@mui/material/DialogActions';
10
+ import IconButton from '@mui/material/IconButton';
11
+ import CloseIcon from '@mui/icons-material/Close';
12
+ import Typography from '@mui/material/Typography';
13
+ import Stepper from '@mui/material/Stepper';
14
+ import Step from '@mui/material/Step';
15
+ import StepLabel from '@mui/material/StepLabel';
16
+ import TextField from '@mui/material/TextField';
17
+ import FmdBadRoundedIcon from '@mui/icons-material/FmdBadRounded';
18
+ import FormControl from '@mui/material/FormControl';
19
+ import Select from '@mui/material/Select';
20
+ import MenuItem from '@mui/material/MenuItem';
21
+ import { parseDomain, ParseResultType } from "parse-domain";
22
+ import ContentCopyRoundedIcon from '@mui/icons-material/ContentCopyRounded';
23
+ // import { apiService } from 'authscape';
24
+ import CircularProgress from '@mui/material/CircularProgress';
25
+ import { DialogContentText } from '@mui/material';
26
+
27
+ export function AddDomain({open, azureWebsite, azureTxtValue, handleClose}) {
28
+
29
+ const steps = ['Enter a domain', 'Setup DNS Record', 'Go Live'];
30
+
31
+ const [activeStep, setActiveStep] = useState(0);
32
+ const [completed, setCompleted] = useState({});
33
+
34
+ const [domain, setDomain] = useState(null);
35
+ const [subDomains, setSubDomains] = useState(null);
36
+ const [topLevelDomains , setTopLevelDomains ] = useState(null);
37
+
38
+ const [fullDomain, setFullDomain] = useState(null);
39
+ const [errorMessage, setErrorMessage] = useState(null);
40
+
41
+ const refDomain = useRef(null);
42
+
43
+ const refCNameTarget = useRef(null);
44
+ const reftxtTarget = useRef(null);
45
+
46
+ const refCNameName = useRef(null);
47
+ const reftxtName = useRef(null);
48
+
49
+ const totalSteps = () => {
50
+ return steps.length;
51
+ };
52
+
53
+ const completedSteps = () => {
54
+ return Object.keys(completed).length;
55
+ };
56
+
57
+ const isLastStep = () => {
58
+ return activeStep === totalSteps() - 1;
59
+ };
60
+
61
+ const allStepsCompleted = () => {
62
+ return completedSteps() === totalSteps();
63
+ };
64
+
65
+ const handleNext = () => {
66
+ const newActiveStep =
67
+ isLastStep() && !allStepsCompleted()
68
+ ? // It's the last step, but not all steps have been completed,
69
+ // find the first step that has been completed
70
+ steps.findIndex((step, i) => !(i in completed))
71
+ : activeStep + 1;
72
+ setActiveStep(newActiveStep);
73
+ };
74
+
75
+ const handleBack = () => {
76
+ setActiveStep((prevActiveStep) => prevActiveStep - 1);
77
+
78
+
79
+ };
80
+
81
+ const handleStep = (step) => () => {
82
+ setActiveStep(step);
83
+ };
84
+
85
+ const handleComplete = () => {
86
+ const newCompleted = completed;
87
+ newCompleted[activeStep] = true;
88
+ setCompleted(newCompleted);
89
+ handleNext();
90
+ };
91
+
92
+ const BootstrapDialog = styled(Dialog)(({ theme }) => ({
93
+ '& .MuiDialogContent-root': {
94
+ padding: theme.spacing(2),
95
+ },
96
+ '& .MuiDialogActions-root': {
97
+ padding: theme.spacing(1),
98
+ },
99
+ }));
100
+
101
+ const handleReset = () => {
102
+ setActiveStep(0);
103
+ setCompleted({});
104
+ };
105
+
106
+ const createTheDomainRequest = async () => {
107
+
108
+ if (fullDomain == null || fullDomain == "")
109
+ {
110
+ return;
111
+ }
112
+
113
+ let response = await apiService().post("/PrivateLabel/GenerateDomain", {
114
+ hostName: fullDomain
115
+ });
116
+
117
+ if (response != null && response.status == 200)
118
+ {
119
+ if (handleClose != null)
120
+ {
121
+ handleClose();
122
+ }
123
+ }
124
+ else
125
+ {
126
+ let aStep = activeStep - 1;
127
+ setActiveStep(aStep);
128
+ setErrorMessage(response.data);
129
+ }
130
+ }
131
+
132
+
133
+ useEffect(() => {
134
+
135
+ if (activeStep == 2)
136
+ {
137
+ createTheDomainRequest();
138
+ }
139
+
140
+ }, [activeStep]);
141
+
142
+
143
+ const copyToClipboard = async (text) => {
144
+ try {
145
+ const permissions = await navigator.permissions.query({name: "clipboard-write"})
146
+ if (permissions.state === "granted" || permissions.state === "prompt") {
147
+ await navigator.clipboard.writeText(text);
148
+ //alert('Copied to clipboard!');
149
+ } else {
150
+ throw new Error("Can't access the clipboard. Check your browser permissions.")
151
+ }
152
+ } catch (error) {
153
+ alert('Error copying to clipboard:', error);
154
+ }
155
+ };
156
+
157
+ function BootstrapDialogTitle(props) {
158
+ const { children, onClose, ...other } = props;
159
+
160
+ return (
161
+ <DialogTitle sx={{ m: 0, p: 2 }} {...other}>
162
+ {children}
163
+ {onClose ? (
164
+ <IconButton
165
+ aria-label="close"
166
+ onClick={onClose}
167
+ sx={{
168
+ position: 'absolute',
169
+ right: 8,
170
+ top: 8,
171
+ color: (theme) => theme.palette.grey[500],
172
+ }}
173
+ >
174
+ <CloseIcon />
175
+ </IconButton>
176
+ ) : null}
177
+ </DialogTitle>
178
+ );
179
+ }
180
+
181
+ return (
182
+ <BootstrapDialog onClose={handleClose} aria-labelledby="customized-dialog-title" sx={{backgroundColor: "rgba(0, 0, 0, 0.6)"}} fullWidth={true} maxWidth={"md"} open={open}>
183
+ <Box sx={{padding:4}}>
184
+
185
+ <Stepper activeStep={activeStep} alternativeLabel>
186
+ {steps.map((label) => (
187
+ <Step key={label}>
188
+ <StepLabel sx={{color:"#fff"}}>{label}</StepLabel>
189
+ </Step>
190
+ ))}
191
+ </Stepper>
192
+
193
+ {activeStep == 0 &&
194
+ <>
195
+ <BootstrapDialogTitle id="customized-dialog-title" onClose={handleClose} sx={{textAlign:"center", fontSize:30, marginTop:2, lineHeight: 1}}>
196
+ What domain would you like to connect to {process.env.companyName}?
197
+ </BootstrapDialogTitle>
198
+ <DialogContent>
199
+
200
+ <Box>
201
+ <TextField inputRef={refDomain} id="domainTxt" label="Enter subdomain URL e.g catalog.mydomain.com" fullWidth={true} variant="outlined" sx={{color:"white", marginTop:2 }} />
202
+ </Box>
203
+ <Box sx={{marginTop:2}}>
204
+ <Typography gutterBottom sx={{textAlign:"center", fontSize:14}}>
205
+ <FmdBadRoundedIcon sx={{color:"#1976d2", position:"relative", top:8}} /> You must own the domain and have the ability to add records
206
+ </Typography>
207
+ </Box>
208
+
209
+ </DialogContent>
210
+ <DialogActions>
211
+ <Button variant="contained" onClick={() => {
212
+
213
+ if (refDomain.current.value == "")
214
+ {
215
+ return;
216
+ }
217
+
218
+ setFullDomain(refDomain.current.value);
219
+
220
+ var domainLand = parseDomain(refDomain.current.value);
221
+ setDomain(domainLand.domain);
222
+ setSubDomains(domainLand.subDomains);
223
+ setTopLevelDomains(domainLand.topLevelDomains);
224
+
225
+ handleNext();
226
+ }}>
227
+ Next: Setup DNS
228
+ </Button>
229
+ </DialogActions>
230
+ </>
231
+ }
232
+
233
+
234
+
235
+
236
+ {activeStep == 1 &&
237
+ <>
238
+ <BootstrapDialogTitle id="customized-dialog-title" onClose={handleClose} sx={{textAlign:"center", fontSize:30, marginTop:2}}>
239
+ Configure your DNS
240
+ </BootstrapDialogTitle>
241
+ <DialogContent>
242
+
243
+ <Box>
244
+ <Typography gutterBottom sx={{textAlign:"center", fontSize:14}}>
245
+ Add a CNAME and TXT Record to your domain by visiting your DNS provider.
246
+ </Typography>
247
+ </Box>
248
+
249
+ <Box sx={{backgroundColor:"#f7f7f7", marginTop:5, paddingLeft:4, paddingRight:4}}>
250
+ <Grid container spacing={2} fullWidth={true} >
251
+ <Grid item xs={2}>
252
+ Type
253
+
254
+ <FormControl fullWidth sx={{paddingTop:2}}>
255
+ <Select
256
+ value={1} readOnly={true}>
257
+ <MenuItem value={1}>CNAME</MenuItem>
258
+ </Select>
259
+ </FormControl>
260
+
261
+ </Grid>
262
+ <Grid item xs={5}>
263
+ Name
264
+ <TextField inputRef={refCNameName} id="NameDomainTxt" label="" fullWidth={true} value={subDomains} variant="outlined" sx={{color:"white", paddingTop:2 }} />
265
+
266
+ <Box sx={{textAlign:"center", paddingTop:1}}>
267
+ <Button startIcon={<ContentCopyRoundedIcon/>} sx={{width:"100%"}} variant="contained" onClick={() => {
268
+ copyToClipboard(refCNameName.current.value);
269
+ }}>
270
+ Copy
271
+ </Button>
272
+ </Box>
273
+
274
+ </Grid>
275
+ <Grid item xs={5}>
276
+ Target
277
+ <TextField inputRef={refCNameTarget} id="targetDomainTxt" label="" fullWidth={true} value={azureWebsite} variant="outlined" sx={{color:"white", paddingTop:2 }} />
278
+
279
+ <Box sx={{textAlign:"center", paddingTop:1}}>
280
+ <Button startIcon={<ContentCopyRoundedIcon/>} sx={{width:"100%"}} variant="contained" onClick={() => {
281
+ copyToClipboard(refCNameTarget.current.value);
282
+ }}>
283
+ Copy
284
+ </Button>
285
+ </Box>
286
+
287
+ </Grid>
288
+ </Grid>
289
+ </Box>
290
+
291
+ <Box sx={{backgroundColor:"#f7f7f7", paddingLeft:4, paddingRight:4, marginTop:2, paddingBottom:4}}>
292
+ <Grid container spacing={2} fullWidth={true} >
293
+ <Grid item xs={2}>
294
+ Type
295
+
296
+ <FormControl fullWidth sx={{paddingTop:2}}>
297
+ <Select
298
+ value={1} readOnly={true}>
299
+ <MenuItem value={1}>TXT</MenuItem>
300
+ </Select>
301
+ </FormControl>
302
+
303
+ </Grid>
304
+ <Grid item xs={5}>
305
+ Name
306
+ <TextField inputRef={reftxtName} id="NameDomain2Txt" label="" fullWidth={true} value={"asuid." + subDomains} variant="outlined" sx={{color:"white", marginTop:2 }} />
307
+
308
+ <Box sx={{textAlign:"center", paddingTop:1}}>
309
+ <Button startIcon={<ContentCopyRoundedIcon/>} sx={{width:"100%"}} variant="contained" onClick={() => {
310
+ copyToClipboard(reftxtName.current.value);
311
+ }}>
312
+ Copy
313
+ </Button>
314
+ </Box>
315
+ </Grid>
316
+ <Grid item xs={5}>
317
+ Target
318
+ <TextField inputRef={reftxtTarget} id="targetDomain2Txt" label="" fullWidth={true} value={azureTxtValue} variant="outlined" sx={{color:"white", marginTop:2 }} />
319
+
320
+ <Box sx={{textAlign:"center", paddingTop:1}}>
321
+ <Button startIcon={<ContentCopyRoundedIcon/>} sx={{width:"100%"}} variant="contained" onClick={() => {
322
+ copyToClipboard(reftxtTarget.current.value);
323
+ }}>
324
+ Copy
325
+ </Button>
326
+ </Box>
327
+ </Grid>
328
+ </Grid>
329
+ </Box>
330
+
331
+
332
+ </DialogContent>
333
+ <DialogActions>
334
+ <Button variant="contained" onClick={() => {
335
+ handleNext();
336
+ }}>
337
+ Go Live
338
+ </Button>
339
+ </DialogActions>
340
+ </>
341
+ }
342
+
343
+ {activeStep == 2 &&
344
+ <Box>
345
+ <BootstrapDialogTitle id="customized-dialog-title" onClose={handleClose} sx={{textAlign:"center", fontSize:30, marginTop:4}}>
346
+ Creating your private label experience
347
+ </BootstrapDialogTitle>
348
+ <DialogContent>
349
+ <Box sx={{paddingTop:2, textAlign:"center"}}>
350
+ <Typography gutterBottom sx={{textAlign:"center", fontSize:18}}>
351
+ Please wait while we complete a few things on our side.
352
+ </Typography>
353
+ <Box sx={{paddingTop:2}}>
354
+ <CircularProgress color="inherit" />
355
+ </Box>
356
+ </Box>
357
+ </DialogContent>
358
+ </Box>
359
+ }
360
+
361
+ </Box>
362
+
363
+
364
+ <Dialog
365
+ open={errorMessage != null ? true : false}
366
+ onClose={() => {
367
+ setErrorMessage(null);
368
+ }}
369
+ aria-labelledby="alert-dialog-title"
370
+ aria-describedby="alert-dialog-description">
371
+ <DialogTitle id="alert-dialog-title">
372
+ {"Issue Detected"}
373
+ </DialogTitle>
374
+ <DialogContent>
375
+ <DialogContentText id="alert-dialog-description">
376
+ {errorMessage}
377
+ </DialogContentText>
378
+ </DialogContent>
379
+ <DialogActions>
380
+ <Button onClick={() => {
381
+ setErrorMessage(null);
382
+ }} autoFocus>
383
+ OK
384
+ </Button>
385
+ </DialogActions>
386
+ </Dialog>
387
+
388
+ </BootstrapDialog>
389
+ )
390
+ }