UNPKG

@foreverrbum/ethsign

Version:

This package will allow you to electronically sign documents within your application

566 lines (460 loc) 28.7 kB
"use strict"; function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _react = _interopRequireWildcard(require("react")); var _webviewer = _interopRequireDefault(require("@pdftron/webviewer")); var _dashboard = require("../../helpers/dashboard"); var _reactIntl = require("react-intl"); var _PrepareSignatureFields = _interopRequireDefault(require("../PDF/PrepareSignatureFields")); var _pdf = require("../../helpers/pdf"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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); } 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; } 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); } } 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); }); }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } 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."); } 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); } 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; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var Prepare = function Prepare(props) { var ethAccount = props.ethAccount, ethAlias = props.ethAlias, handleWebviewer = props.handleWebviewer, file = props.file, filename = props.filename, handleProgress = props.handleProgress, resubmit = props.resubmit, signers = props.signers, annotations = props.annotations, handleAnnotations = props.handleAnnotations, handleAnnotList = props.handleAnnotList, updateStoredData = props.updateStoredData; var _useState = (0, _react.useState)(null), _useState2 = _slicedToArray(_useState, 2), instance = _useState2[0], setInstance = _useState2[1]; var _useState3 = (0, _react.useState)(null), _useState4 = _slicedToArray(_useState3, 2), activeSigFieldTool = _useState4[0], handleActiveSigFieldTool = _useState4[1]; var _useIntl = (0, _reactIntl.useIntl)(), formatMessage = _useIntl.formatMessage, locale = _useIntl.locale; var viewer = (0, _react.useRef)(null); (0, _react.useEffect)(function () { if (file == null) { (0, _dashboard.storeNotif)(formatMessage({ id: 'NO_FILE_UPLOADED' }), formatMessage({ id: 'PDF_NEEDS_TO_BE_UPLOADED_FIRST' }), 'danger'); } (0, _webviewer.default)({ licenseKey: 'Buildblock Tech Pte. Ltd.:OEM:EthSign::B+:AMS(20220926):60A5E4AD0457F80A7360B13AC982537860615F858748CDEA9BF51DE6240C48AE4AB4B6F5C7', path: '/webviewer/lib', disabledElements: ['header', 'toolsHeader'] }, viewer.current).then(function (instance) { if (locale == "zh") { instance.setLanguage('zh_cn'); } handleWebviewer(instance); if (file != null) { instance.loadDocument(file, { filename: filename.name + filename.ext }); } var Annotations = instance.Annotations, Tools = instance.Tools, annotManager = instance.annotManager, docViewer = instance.docViewer, CoreControls = instance.CoreControls; instance.openElements(['leftPanel']); annotManager.setCurrentUser(ethAlias ? ethAlias : ethAccount); // new code signers.map(function (signer, index) { var SigFieldTxtAnnotation = /*#__PURE__*/function (_Annotations$CustomAn) { _inherits(SigFieldTxtAnnotation, _Annotations$CustomAn); var _super = _createSuper(SigFieldTxtAnnotation); function SigFieldTxtAnnotation() { var _this; _classCallCheck(this, SigFieldTxtAnnotation); _this = _super.call(this, 'SigFieldTxt'); // provide the custom XFDF element name var page_idx = docViewer.getCurrentPage(); var rotation = docViewer.getCompleteRotation(page_idx) * -90; _this.PageRotation = rotation; // TODO: add index in Sending.js _this.Subject = "SignatureField"; _this.Signer = { address: signer.address, rotation: rotation, alias: signer.alias, avatar: signer.avatar }; _this.Index = 0; _this.Address = signer.alias ? (0, _dashboard.truncate)(signer.alias) : (0, _dashboard.truncate)(signer.address); _this.Signed = false; _this.vertices = []; var numVertices = 4; for (var i = 0; i < numVertices; ++i) { _this.vertices.push(new CoreControls.Math.Point()); } _this.selectionModel = SigFieldSelectionModel; return _this; } _createClass(SigFieldTxtAnnotation, [{ key: "serialize", value: function serialize(element, pageMatrix) { this.setCustomData('vertices', this.vertices); var el = _get(_getPrototypeOf(SigFieldTxtAnnotation.prototype), "serialize", this).call(this, element, pageMatrix); // create an attribute to save the vertices list el.setAttribute('Signer', JSON.stringify(this.Signer)); el.setAttribute('Index', this.Index); el.setAttribute('Address', this.Address); el.setAttribute('Signed', this.Signed); return el; } }, { key: "deserialize", value: function deserialize(element, pageMatrix) { _get(_getPrototypeOf(SigFieldTxtAnnotation.prototype), "deserialize", this).call(this, element, pageMatrix); this.Signer = JSON.parse(element.getAttribute('Signer')); this.Index = element.getAttribute('Index'); this.Address = element.getAttribute('Address'); this.Signed = element.getAttribute('Signed'); var storedVertices = this.getCustomData('vertices'); this.vertices = storedVertices.map(function (v) { return new CoreControls.Math.Point(v.x, v.y); }); } }, { key: "draw", value: function draw(ctx, pageMatrix) { this.setStyles(ctx, pageMatrix); ctx.beginPath(); ctx.setLineDash([5, 3]); ctx.moveTo(this.vertices[0].x, this.vertices[0].y); ctx.lineTo(this.vertices[1].x, this.vertices[1].y); ctx.lineTo(this.vertices[2].x, this.vertices[2].y); ctx.lineTo(this.vertices[3].x, this.vertices[3].y); ctx.closePath(); ctx.stroke(); ctx.fillStyle = "black"; var zoom = docViewer.getZoom(); var textAnnot = this.Address + " Signs Here"; ctx.save(); ctx.textBaseline = 'middle'; ctx.textAlign = 'center'; ctx.rotate(this.PageRotation / 180 * Math.PI); if (this.PageRotation == -90 || this.PageRotation == -270) { var textHeight = this.Height / 11; ctx.font = "".concat(textHeight, "px san-serif"); if (this.PageRotation == -90) { ctx.fillText(textAnnot, -this.vertices[0].y - this.Height / 2, this.vertices[0].x + this.Width / 2); } else { ctx.fillText(textAnnot, this.vertices[0].y + this.Height / 2, -this.vertices[0].x - this.Width / 2); } } else { var _textHeight = this.Width / 11; ctx.font = "".concat(_textHeight, "px san-serif"); if (this.PageRotation == -180) { ctx.fillText(textAnnot, -this.vertices[0].x + (this.Width / 2 - this.Width), -this.vertices[0].y + this.Height / 2 - this.Height); } else { ctx.fillText(textAnnot, this.vertices[0].x + this.Width / 2, this.vertices[0].y + this.Height / 2); } } ctx.stroke(); } }, { key: "resize", value: function resize(rect) { var annotRect = this.getRect(); var deltaX = rect.x1 - annotRect.x1; var deltaY = rect.y1 - annotRect.y1; this.vertices = this.vertices.map(function (vertex) { vertex.translate(deltaX, deltaY); return vertex; }); this.setRect(rect); } }]); return SigFieldTxtAnnotation; }(Annotations.CustomAnnotation); // this is necessary to set the elementName before instantiation SigFieldTxtAnnotation.prototype.elementName = 'SigFieldTxt'; SigFieldTxtAnnotation.SerializationType = Annotations.CustomAnnotation.SerializationTypes.CUSTOM; // register the annotation type so that it can be saved to XFDF files annotManager.registerAnnotationType(SigFieldTxtAnnotation.prototype.elementName, SigFieldTxtAnnotation); var SigFieldTxtCreateTool = /*#__PURE__*/function (_Tools$GenericAnnotat) { _inherits(SigFieldTxtCreateTool, _Tools$GenericAnnotat); var _super2 = _createSuper(SigFieldTxtCreateTool); function SigFieldTxtCreateTool(docViewer) { _classCallCheck(this, SigFieldTxtCreateTool); // TriangleAnnotation is the clßßass (function) for our annotation we defined previously return _super2.call(this, docViewer, SigFieldTxtAnnotation); } _createClass(SigFieldTxtCreateTool, [{ key: "mouseLeftDown", value: function mouseLeftDown(e) { _get(_getPrototypeOf(SigFieldTxtCreateTool.prototype), "mouseLeftDown", this).call(this, e); if (this.annotation) { var zoom = docViewer.getZoom(); this.annotation.Width = 68 / zoom; this.annotation.Height = 34 / zoom; this.annotation.Y = this.annotation.Y - this.annotation.Height; this.annotation.vertices[0].x = this.annotation.X; this.annotation.vertices[0].y = this.annotation.Y; this.annotation.vertices[1].x = this.annotation.X + this.annotation.Width; this.annotation.vertices[1].y = this.annotation.Y; this.annotation.vertices[2].x = this.annotation.X + this.annotation.Width; this.annotation.vertices[2].y = this.annotation.Y + this.annotation.Height; this.annotation.vertices[3].x = this.annotation.X; this.annotation.vertices[3].y = this.annotation.Y + this.annotation.Height; // update the annotation appearance annotManager.redrawAnnotation(this.annotation); } } }, { key: "mouseMove", value: function mouseMove(e) { _get(_getPrototypeOf(SigFieldTxtCreateTool.prototype), "mouseMove", this).call(this, e); if (this.annotation) { var zoom = docViewer.getZoom(); var initialHeight = 34 / zoom; var intiialWidth = 68 / zoom; this.annotation.Width = this.annotation.Width + intiialWidth; this.annotation.Height = this.annotation.Height + initialHeight; this.annotation.Y = this.annotation.Y - initialHeight; this.annotation.vertices[0].x = this.annotation.X; this.annotation.vertices[0].y = this.annotation.Y; this.annotation.vertices[1].x = this.annotation.X + this.annotation.Width; this.annotation.vertices[1].y = this.annotation.Y; this.annotation.vertices[2].x = this.annotation.X + this.annotation.Width; this.annotation.vertices[2].y = this.annotation.Y + this.annotation.Height; this.annotation.vertices[3].x = this.annotation.X; this.annotation.vertices[3].y = this.annotation.Y + this.annotation.Height; SigFieldTxtTool.cursor = "none"; // update the annotation appearance annotManager.redrawAnnotation(this.annotation); } } }]); return SigFieldTxtCreateTool; }(Tools.GenericAnnotationCreateTool); ; var SigFieldControlHandle = /*#__PURE__*/function (_Annotations$ControlH) { _inherits(SigFieldControlHandle, _Annotations$ControlH); var _super3 = _createSuper(SigFieldControlHandle); function SigFieldControlHandle(annotation, index) { var _this2; _classCallCheck(this, SigFieldControlHandle); _this2 = _super3.call(this); _this2.annotation = annotation; _this2.index = index; return _this2; } _createClass(SigFieldControlHandle, [{ key: "getDimensions", value: function getDimensions(annotation, selectionBox, zoom) { var x = annotation.vertices[this.index].x; var y = annotation.vertices[this.index].y; var width = Annotations.ControlHandle.handleWidth / zoom; var height = Annotations.ControlHandle.handleHeight / zoom; var minX = Number.MAX_VALUE; var maxX = -Number.MAX_VALUE; var minY = Number.MAX_VALUE; var maxY = -Number.MAX_VALUE; for (var i = 0; i < annotation.vertices.length; ++i) { var vertex = annotation.vertices[i]; minX = Math.min(minX, vertex.x); maxX = Math.max(maxX, vertex.x); minY = Math.min(minY, vertex.y); maxY = Math.max(maxY, vertex.y); } x -= width * 0.5; y -= height * 0.5; return new CoreControls.Math.Rect(x, y, x + width, y + height); } }, { key: "move", value: function move(annotation, deltaX, deltaY, fromPoint, toPoint) { annotation.vertices[this.index].x += deltaX; annotation.vertices[this.index].y += deltaY; var minX = Number.MAX_VALUE; var maxX = -Number.MAX_VALUE; var minY = Number.MAX_VALUE; var maxY = -Number.MAX_VALUE; if (this.index == 0) { annotation.vertices[1].y += deltaY; annotation.vertices[3].x += deltaX; } else if (this.index == 1) { annotation.vertices[0].y += deltaY; annotation.vertices[2].x += deltaX; } else if (this.index == 2) { annotation.vertices[3].y += deltaY; annotation.vertices[1].x += deltaX; } else if (this.index == 3) { annotation.vertices[2].y += deltaY; annotation.vertices[0].x += deltaX; } for (var i = 0; i < annotation.vertices.length; ++i) { var vertex = annotation.vertices[i]; minX = Math.min(minX, vertex.x); maxX = Math.max(maxX, vertex.x); minY = Math.min(minY, vertex.y); maxY = Math.max(maxY, vertex.y); } annotation.vertices[0].x = minX; annotation.vertices[0].y = minY; annotation.vertices[1].x = maxX; annotation.vertices[1].y = minY; annotation.vertices[2].x = maxX; annotation.vertices[2].y = maxY; annotation.vertices[3].x = minX; annotation.vertices[3].y = maxY; var rect = new Annotations.Rect(minX, minY, maxX, maxY); annotation.setRect(rect); return true; } }]); return SigFieldControlHandle; }(Annotations.ControlHandle); var SigFieldSelectionModel = /*#__PURE__*/function (_Annotations$Selectio) { _inherits(SigFieldSelectionModel, _Annotations$Selectio); var _super4 = _createSuper(SigFieldSelectionModel); function SigFieldSelectionModel(annotation, canModify) { var _this3; _classCallCheck(this, SigFieldSelectionModel); _this3 = _super4.call(this, annotation, canModify); if (canModify) { var controlHandles = _this3.getControlHandles(); controlHandles.push(new SigFieldControlHandle(annotation, 0)); controlHandles.push(new SigFieldControlHandle(annotation, 1)); controlHandles.push(new SigFieldControlHandle(annotation, 2)); controlHandles.push(new SigFieldControlHandle(annotation, 3)); } return _this3; } return SigFieldSelectionModel; }(Annotations.SelectionModel); var SigFieldTxtToolName = 'AnnotationCreateSigFieldTxt' + index; var SigFieldTxtTool = new SigFieldTxtCreateTool(docViewer); SigFieldTxtTool.cursor = "url(/files/sign_here_68.png) 0 68,url(/files/sign_here_32.png) 0 32,crosshair"; instance.registerTool({ toolName: SigFieldTxtToolName, toolObject: SigFieldTxtTool, buttonImage: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor">' + '<path d="M12 7.77L18.39 18H5.61L12 7.77M12 4L2 20h20L12 4z"/>' + '<path fill="none" d="M0 0h24v24H0V0z"/>' + '</svg>', buttonName: 'SigFieldTxtToolButton', tooltip: 'SigFieldTxt' }, SigFieldTxtAnnotation); instance.setHeaderItems(function (header) { header.getHeader('toolbarGroup-Shapes').get('freeHandToolGroupButton').insertBefore({ type: 'toolButton', toolName: SigFieldTxtToolName }); }); }); annotManager.on('annotationChanged', /*#__PURE__*/function () { var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(annotations, action, _ref) { var imported, annotList, _annotList, signatures, curTool; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: imported = _ref.imported; if (!imported) { _context.next = 7; break; } annotList = instance.annotManager.getAnnotationsList(); handleAnnotList(annotList); return _context.abrupt("return"); case 7: _annotList = instance.annotManager.getAnnotationsList(); handleAnnotList(_annotList); _context.next = 11; return (0, _pdf.updateXFDF)(instance, _annotList, handleAnnotations, updateStoredData); case 11: if (action == 'add') { signatures = annotations.filter(function (annot) { return annot.Subject == "SignatureField"; }); if (signatures.length > 0) { curTool = docViewer.getToolMode(); curTool.cursor = "url(/files/sign_here_68.png) 0 68,url(/files/sign_here_32.png) 0 32,crosshair"; } instance.setToolMode((0, _pdf.getDefaultTool)()); handleActiveSigFieldTool(null); annotManager.selectAnnotations(annotations); } case 12: case "end": return _context.stop(); } } }, _callee); })); return function (_x, _x2, _x3) { return _ref2.apply(this, arguments); }; }()); docViewer.on('documentLoaded', function () { instance.annotManager.importAnnotations(annotations); setInstance(instance); }); }); }, []); return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", { className: "bg-gray-400 flex-grow flex flex-col" }, /*#__PURE__*/_react.default.createElement("div", { className: "mx-auto flex-grow flex flex h-full w-full text-gray-300 text-15" }, /*#__PURE__*/_react.default.createElement("div", { className: "flex-grow", ref: viewer }), /*#__PURE__*/_react.default.createElement(_PrepareSignatureFields.default, { instance: instance, signers: signers, handleActiveSigFieldTool: handleActiveSigFieldTool, activeSigFieldTool: activeSigFieldTool, ethAccount: ethAccount }))), /*#__PURE__*/_react.default.createElement("nav", { className: "box-shadow-footer z-10 sticky bottom-0 bg-gray-40" }, /*#__PURE__*/_react.default.createElement("div", { className: "max-w-7xl mx-auto px-2 " }, /*#__PURE__*/_react.default.createElement("div", { className: "relative flex items-center justify-between h-16" }, /*#__PURE__*/_react.default.createElement("div", { className: "flex w-full" }, /*#__PURE__*/_react.default.createElement("div", { className: "flex-1" }), /*#__PURE__*/_react.default.createElement("div", { className: "flex flex-grow justify-center items-center text-gray-80 font-medium" }, filename && filename.name + filename.ext), /*#__PURE__*/_react.default.createElement("div", { className: "select-none flex flex-1 justify-end" }, /*#__PURE__*/_react.default.createElement("button", { className: "focus:outline-none text-white mr-5 w-28 py-2 font-medium bg-gray-300 hover:bg-gray-600 rounded-sm", onClick: function onClick() { handleProgress(resubmit ? 0 : 1); } }, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, { id: "BACK" })), /*#__PURE__*/_react.default.createElement("button", { className: "select-none focus:outline-none text-white w-28 py-2 font-medium bg-orange-500 hover:bg-orange-600 rounded-sm", onClick: function onClick() { handleProgress(resubmit ? 2 : 3); } }, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, { id: "NEXT" })))))))); }; var _default = Prepare; exports.default = _default;