/******/ (() => { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ "./node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js":
/*!***********************************************************************!*\
  !*** ./node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   HiddenText: () => (/* binding */ HiddenText),
/* harmony export */   LiveRegion: () => (/* binding */ LiveRegion),
/* harmony export */   useAnnouncement: () => (/* binding */ useAnnouncement)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);


const hiddenStyles = {
  display: 'none'
};
function HiddenText(_ref) {
  let {
    id,
    value
  } = _ref;
  return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
    id: id,
    style: hiddenStyles
  }, value);
}

function LiveRegion(_ref) {
  let {
    id,
    announcement,
    ariaLiveType = "assertive"
  } = _ref;
  // Hide element visually but keep it readable by screen readers
  const visuallyHidden = {
    position: 'fixed',
    top: 0,
    left: 0,
    width: 1,
    height: 1,
    margin: -1,
    border: 0,
    padding: 0,
    overflow: 'hidden',
    clip: 'rect(0 0 0 0)',
    clipPath: 'inset(100%)',
    whiteSpace: 'nowrap'
  };
  return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
    id: id,
    style: visuallyHidden,
    role: "status",
    "aria-live": ariaLiveType,
    "aria-atomic": true
  }, announcement);
}

function useAnnouncement() {
  const [announcement, setAnnouncement] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)('');
  const announce = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(value => {
    if (value != null) {
      setAnnouncement(value);
    }
  }, []);
  return {
    announce,
    announcement
  };
}


//# sourceMappingURL=accessibility.esm.js.map


/***/ }),

/***/ "./node_modules/@dnd-kit/core/dist/core.esm.js":
/*!*****************************************************!*\
  !*** ./node_modules/@dnd-kit/core/dist/core.esm.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AutoScrollActivator: () => (/* binding */ AutoScrollActivator),
/* harmony export */   DndContext: () => (/* binding */ DndContext),
/* harmony export */   DragOverlay: () => (/* binding */ DragOverlay),
/* harmony export */   KeyboardCode: () => (/* binding */ KeyboardCode),
/* harmony export */   KeyboardSensor: () => (/* binding */ KeyboardSensor),
/* harmony export */   MeasuringFrequency: () => (/* binding */ MeasuringFrequency),
/* harmony export */   MeasuringStrategy: () => (/* binding */ MeasuringStrategy),
/* harmony export */   MouseSensor: () => (/* binding */ MouseSensor),
/* harmony export */   PointerSensor: () => (/* binding */ PointerSensor),
/* harmony export */   TouchSensor: () => (/* binding */ TouchSensor),
/* harmony export */   TraversalOrder: () => (/* binding */ TraversalOrder),
/* harmony export */   applyModifiers: () => (/* binding */ applyModifiers),
/* harmony export */   closestCenter: () => (/* binding */ closestCenter),
/* harmony export */   closestCorners: () => (/* binding */ closestCorners),
/* harmony export */   defaultAnnouncements: () => (/* binding */ defaultAnnouncements),
/* harmony export */   defaultCoordinates: () => (/* binding */ defaultCoordinates),
/* harmony export */   defaultDropAnimation: () => (/* binding */ defaultDropAnimationConfiguration),
/* harmony export */   defaultDropAnimationSideEffects: () => (/* binding */ defaultDropAnimationSideEffects),
/* harmony export */   defaultKeyboardCoordinateGetter: () => (/* binding */ defaultKeyboardCoordinateGetter),
/* harmony export */   defaultScreenReaderInstructions: () => (/* binding */ defaultScreenReaderInstructions),
/* harmony export */   getClientRect: () => (/* binding */ getClientRect),
/* harmony export */   getFirstCollision: () => (/* binding */ getFirstCollision),
/* harmony export */   getScrollableAncestors: () => (/* binding */ getScrollableAncestors),
/* harmony export */   pointerWithin: () => (/* binding */ pointerWithin),
/* harmony export */   rectIntersection: () => (/* binding */ rectIntersection),
/* harmony export */   useDndContext: () => (/* binding */ useDndContext),
/* harmony export */   useDndMonitor: () => (/* binding */ useDndMonitor),
/* harmony export */   useDraggable: () => (/* binding */ useDraggable),
/* harmony export */   useDroppable: () => (/* binding */ useDroppable),
/* harmony export */   useSensor: () => (/* binding */ useSensor),
/* harmony export */   useSensors: () => (/* binding */ useSensors)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "react-dom");
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @dnd-kit/utilities */ "./node_modules/@dnd-kit/utilities/dist/utilities.esm.js");
/* harmony import */ var _dnd_kit_accessibility__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @dnd-kit/accessibility */ "./node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js");





const DndMonitorContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);

function useDndMonitor(listener) {
  const registerListener = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(DndMonitorContext);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (!registerListener) {
      throw new Error('useDndMonitor must be used within a children of <DndContext>');
    }

    const unsubscribe = registerListener(listener);
    return unsubscribe;
  }, [listener, registerListener]);
}

function useDndMonitorProvider() {
  const [listeners] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => new Set());
  const registerListener = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(listener => {
    listeners.add(listener);
    return () => listeners.delete(listener);
  }, [listeners]);
  const dispatch = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(_ref => {
    let {
      type,
      event
    } = _ref;
    listeners.forEach(listener => {
      var _listener$type;

      return (_listener$type = listener[type]) == null ? void 0 : _listener$type.call(listener, event);
    });
  }, [listeners]);
  return [dispatch, registerListener];
}

const defaultScreenReaderInstructions = {
  draggable: "\n    To pick up a draggable item, press the space bar.\n    While dragging, use the arrow keys to move the item.\n    Press space again to drop the item in its new position, or press escape to cancel.\n  "
};
const defaultAnnouncements = {
  onDragStart(_ref) {
    let {
      active
    } = _ref;
    return "Picked up draggable item " + active.id + ".";
  },

  onDragOver(_ref2) {
    let {
      active,
      over
    } = _ref2;

    if (over) {
      return "Draggable item " + active.id + " was moved over droppable area " + over.id + ".";
    }

    return "Draggable item " + active.id + " is no longer over a droppable area.";
  },

  onDragEnd(_ref3) {
    let {
      active,
      over
    } = _ref3;

    if (over) {
      return "Draggable item " + active.id + " was dropped over droppable area " + over.id;
    }

    return "Draggable item " + active.id + " was dropped.";
  },

  onDragCancel(_ref4) {
    let {
      active
    } = _ref4;
    return "Dragging was cancelled. Draggable item " + active.id + " was dropped.";
  }

};

function Accessibility(_ref) {
  let {
    announcements = defaultAnnouncements,
    container,
    hiddenTextDescribedById,
    screenReaderInstructions = defaultScreenReaderInstructions
  } = _ref;
  const {
    announce,
    announcement
  } = (0,_dnd_kit_accessibility__WEBPACK_IMPORTED_MODULE_3__.useAnnouncement)();
  const liveRegionId = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useUniqueId)("DndLiveRegion");
  const [mounted, setMounted] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    setMounted(true);
  }, []);
  useDndMonitor((0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({
    onDragStart(_ref2) {
      let {
        active
      } = _ref2;
      announce(announcements.onDragStart({
        active
      }));
    },

    onDragMove(_ref3) {
      let {
        active,
        over
      } = _ref3;

      if (announcements.onDragMove) {
        announce(announcements.onDragMove({
          active,
          over
        }));
      }
    },

    onDragOver(_ref4) {
      let {
        active,
        over
      } = _ref4;
      announce(announcements.onDragOver({
        active,
        over
      }));
    },

    onDragEnd(_ref5) {
      let {
        active,
        over
      } = _ref5;
      announce(announcements.onDragEnd({
        active,
        over
      }));
    },

    onDragCancel(_ref6) {
      let {
        active,
        over
      } = _ref6;
      announce(announcements.onDragCancel({
        active,
        over
      }));
    }

  }), [announce, announcements]));

  if (!mounted) {
    return null;
  }

  const markup = react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_dnd_kit_accessibility__WEBPACK_IMPORTED_MODULE_3__.HiddenText, {
    id: hiddenTextDescribedById,
    value: screenReaderInstructions.draggable
  }), react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_dnd_kit_accessibility__WEBPACK_IMPORTED_MODULE_3__.LiveRegion, {
    id: liveRegionId,
    announcement: announcement
  }));
  return container ? (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal)(markup, container) : markup;
}

var Action;

(function (Action) {
  Action["DragStart"] = "dragStart";
  Action["DragMove"] = "dragMove";
  Action["DragEnd"] = "dragEnd";
  Action["DragCancel"] = "dragCancel";
  Action["DragOver"] = "dragOver";
  Action["RegisterDroppable"] = "registerDroppable";
  Action["SetDroppableDisabled"] = "setDroppableDisabled";
  Action["UnregisterDroppable"] = "unregisterDroppable";
})(Action || (Action = {}));

function noop() {}

function useSensor(sensor, options) {
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({
    sensor,
    options: options != null ? options : {}
  }), // eslint-disable-next-line react-hooks/exhaustive-deps
  [sensor, options]);
}

function useSensors() {
  for (var _len = arguments.length, sensors = new Array(_len), _key = 0; _key < _len; _key++) {
    sensors[_key] = arguments[_key];
  }

  return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => [...sensors].filter(sensor => sensor != null), // eslint-disable-next-line react-hooks/exhaustive-deps
  [...sensors]);
}

const defaultCoordinates = /*#__PURE__*/Object.freeze({
  x: 0,
  y: 0
});

/**
 * Returns the distance between two points
 */
function distanceBetween(p1, p2) {
  return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
}

function getRelativeTransformOrigin(event, rect) {
  const eventCoordinates = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getEventCoordinates)(event);

  if (!eventCoordinates) {
    return '0 0';
  }

  const transformOrigin = {
    x: (eventCoordinates.x - rect.left) / rect.width * 100,
    y: (eventCoordinates.y - rect.top) / rect.height * 100
  };
  return transformOrigin.x + "% " + transformOrigin.y + "%";
}

/**
 * Sort collisions from smallest to greatest value
 */
function sortCollisionsAsc(_ref, _ref2) {
  let {
    data: {
      value: a
    }
  } = _ref;
  let {
    data: {
      value: b
    }
  } = _ref2;
  return a - b;
}
/**
 * Sort collisions from greatest to smallest value
 */

function sortCollisionsDesc(_ref3, _ref4) {
  let {
    data: {
      value: a
    }
  } = _ref3;
  let {
    data: {
      value: b
    }
  } = _ref4;
  return b - a;
}
/**
 * Returns the coordinates of the corners of a given rectangle:
 * [TopLeft {x, y}, TopRight {x, y}, BottomLeft {x, y}, BottomRight {x, y}]
 */

function cornersOfRectangle(_ref5) {
  let {
    left,
    top,
    height,
    width
  } = _ref5;
  return [{
    x: left,
    y: top
  }, {
    x: left + width,
    y: top
  }, {
    x: left,
    y: top + height
  }, {
    x: left + width,
    y: top + height
  }];
}
function getFirstCollision(collisions, property) {
  if (!collisions || collisions.length === 0) {
    return null;
  }

  const [firstCollision] = collisions;
  return property ? firstCollision[property] : firstCollision;
}

/**
 * Returns the coordinates of the center of a given ClientRect
 */

function centerOfRectangle(rect, left, top) {
  if (left === void 0) {
    left = rect.left;
  }

  if (top === void 0) {
    top = rect.top;
  }

  return {
    x: left + rect.width * 0.5,
    y: top + rect.height * 0.5
  };
}
/**
 * Returns the closest rectangles from an array of rectangles to the center of a given
 * rectangle.
 */


const closestCenter = _ref => {
  let {
    collisionRect,
    droppableRects,
    droppableContainers
  } = _ref;
  const centerRect = centerOfRectangle(collisionRect, collisionRect.left, collisionRect.top);
  const collisions = [];

  for (const droppableContainer of droppableContainers) {
    const {
      id
    } = droppableContainer;
    const rect = droppableRects.get(id);

    if (rect) {
      const distBetween = distanceBetween(centerOfRectangle(rect), centerRect);
      collisions.push({
        id,
        data: {
          droppableContainer,
          value: distBetween
        }
      });
    }
  }

  return collisions.sort(sortCollisionsAsc);
};

/**
 * Returns the closest rectangles from an array of rectangles to the corners of
 * another rectangle.
 */

const closestCorners = _ref => {
  let {
    collisionRect,
    droppableRects,
    droppableContainers
  } = _ref;
  const corners = cornersOfRectangle(collisionRect);
  const collisions = [];

  for (const droppableContainer of droppableContainers) {
    const {
      id
    } = droppableContainer;
    const rect = droppableRects.get(id);

    if (rect) {
      const rectCorners = cornersOfRectangle(rect);
      const distances = corners.reduce((accumulator, corner, index) => {
        return accumulator + distanceBetween(rectCorners[index], corner);
      }, 0);
      const effectiveDistance = Number((distances / 4).toFixed(4));
      collisions.push({
        id,
        data: {
          droppableContainer,
          value: effectiveDistance
        }
      });
    }
  }

  return collisions.sort(sortCollisionsAsc);
};

/**
 * Returns the intersecting rectangle area between two rectangles
 */

function getIntersectionRatio(entry, target) {
  const top = Math.max(target.top, entry.top);
  const left = Math.max(target.left, entry.left);
  const right = Math.min(target.left + target.width, entry.left + entry.width);
  const bottom = Math.min(target.top + target.height, entry.top + entry.height);
  const width = right - left;
  const height = bottom - top;

  if (left < right && top < bottom) {
    const targetArea = target.width * target.height;
    const entryArea = entry.width * entry.height;
    const intersectionArea = width * height;
    const intersectionRatio = intersectionArea / (targetArea + entryArea - intersectionArea);
    return Number(intersectionRatio.toFixed(4));
  } // Rectangles do not overlap, or overlap has an area of zero (edge/corner overlap)


  return 0;
}
/**
 * Returns the rectangles that has the greatest intersection area with a given
 * rectangle in an array of rectangles.
 */

const rectIntersection = _ref => {
  let {
    collisionRect,
    droppableRects,
    droppableContainers
  } = _ref;
  const collisions = [];

  for (const droppableContainer of droppableContainers) {
    const {
      id
    } = droppableContainer;
    const rect = droppableRects.get(id);

    if (rect) {
      const intersectionRatio = getIntersectionRatio(rect, collisionRect);

      if (intersectionRatio > 0) {
        collisions.push({
          id,
          data: {
            droppableContainer,
            value: intersectionRatio
          }
        });
      }
    }
  }

  return collisions.sort(sortCollisionsDesc);
};

/**
 * Check if a given point is contained within a bounding rectangle
 */

function isPointWithinRect(point, rect) {
  const {
    top,
    left,
    bottom,
    right
  } = rect;
  return top <= point.y && point.y <= bottom && left <= point.x && point.x <= right;
}
/**
 * Returns the rectangles that the pointer is hovering over
 */


const pointerWithin = _ref => {
  let {
    droppableContainers,
    droppableRects,
    pointerCoordinates
  } = _ref;

  if (!pointerCoordinates) {
    return [];
  }

  const collisions = [];

  for (const droppableContainer of droppableContainers) {
    const {
      id
    } = droppableContainer;
    const rect = droppableRects.get(id);

    if (rect && isPointWithinRect(pointerCoordinates, rect)) {
      /* There may be more than a single rectangle intersecting
       * with the pointer coordinates. In order to sort the
       * colliding rectangles, we measure the distance between
       * the pointer and the corners of the intersecting rectangle
       */
      const corners = cornersOfRectangle(rect);
      const distances = corners.reduce((accumulator, corner) => {
        return accumulator + distanceBetween(pointerCoordinates, corner);
      }, 0);
      const effectiveDistance = Number((distances / 4).toFixed(4));
      collisions.push({
        id,
        data: {
          droppableContainer,
          value: effectiveDistance
        }
      });
    }
  }

  return collisions.sort(sortCollisionsAsc);
};

function adjustScale(transform, rect1, rect2) {
  return { ...transform,
    scaleX: rect1 && rect2 ? rect1.width / rect2.width : 1,
    scaleY: rect1 && rect2 ? rect1.height / rect2.height : 1
  };
}

function getRectDelta(rect1, rect2) {
  return rect1 && rect2 ? {
    x: rect1.left - rect2.left,
    y: rect1.top - rect2.top
  } : defaultCoordinates;
}

function createRectAdjustmentFn(modifier) {
  return function adjustClientRect(rect) {
    for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      adjustments[_key - 1] = arguments[_key];
    }

    return adjustments.reduce((acc, adjustment) => ({ ...acc,
      top: acc.top + modifier * adjustment.y,
      bottom: acc.bottom + modifier * adjustment.y,
      left: acc.left + modifier * adjustment.x,
      right: acc.right + modifier * adjustment.x
    }), { ...rect
    });
  };
}
const getAdjustedRect = /*#__PURE__*/createRectAdjustmentFn(1);

function parseTransform(transform) {
  if (transform.startsWith('matrix3d(')) {
    const transformArray = transform.slice(9, -1).split(/, /);
    return {
      x: +transformArray[12],
      y: +transformArray[13],
      scaleX: +transformArray[0],
      scaleY: +transformArray[5]
    };
  } else if (transform.startsWith('matrix(')) {
    const transformArray = transform.slice(7, -1).split(/, /);
    return {
      x: +transformArray[4],
      y: +transformArray[5],
      scaleX: +transformArray[0],
      scaleY: +transformArray[3]
    };
  }

  return null;
}

function inverseTransform(rect, transform, transformOrigin) {
  const parsedTransform = parseTransform(transform);

  if (!parsedTransform) {
    return rect;
  }

  const {
    scaleX,
    scaleY,
    x: translateX,
    y: translateY
  } = parsedTransform;
  const x = rect.left - translateX - (1 - scaleX) * parseFloat(transformOrigin);
  const y = rect.top - translateY - (1 - scaleY) * parseFloat(transformOrigin.slice(transformOrigin.indexOf(' ') + 1));
  const w = scaleX ? rect.width / scaleX : rect.width;
  const h = scaleY ? rect.height / scaleY : rect.height;
  return {
    width: w,
    height: h,
    top: y,
    right: x + w,
    bottom: y + h,
    left: x
  };
}

const defaultOptions = {
  ignoreTransform: false
};
/**
 * Returns the bounding client rect of an element relative to the viewport.
 */

function getClientRect(element, options) {
  if (options === void 0) {
    options = defaultOptions;
  }

  let rect = element.getBoundingClientRect();

  if (options.ignoreTransform) {
    const {
      transform,
      transformOrigin
    } = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(element).getComputedStyle(element);

    if (transform) {
      rect = inverseTransform(rect, transform, transformOrigin);
    }
  }

  const {
    top,
    left,
    width,
    height,
    bottom,
    right
  } = rect;
  return {
    top,
    left,
    width,
    height,
    bottom,
    right
  };
}
/**
 * Returns the bounding client rect of an element relative to the viewport.
 *
 * @remarks
 * The ClientRect returned by this method does not take into account transforms
 * applied to the element it measures.
 *
 */

function getTransformAgnosticClientRect(element) {
  return getClientRect(element, {
    ignoreTransform: true
  });
}

function getWindowClientRect(element) {
  const width = element.innerWidth;
  const height = element.innerHeight;
  return {
    top: 0,
    left: 0,
    right: width,
    bottom: height,
    width,
    height
  };
}

function isFixed(node, computedStyle) {
  if (computedStyle === void 0) {
    computedStyle = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(node).getComputedStyle(node);
  }

  return computedStyle.position === 'fixed';
}

function isScrollable(element, computedStyle) {
  if (computedStyle === void 0) {
    computedStyle = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(element).getComputedStyle(element);
  }

  const overflowRegex = /(auto|scroll|overlay)/;
  const properties = ['overflow', 'overflowX', 'overflowY'];
  return properties.some(property => {
    const value = computedStyle[property];
    return typeof value === 'string' ? overflowRegex.test(value) : false;
  });
}

function getScrollableAncestors(element, limit) {
  const scrollParents = [];

  function findScrollableAncestors(node) {
    if (limit != null && scrollParents.length >= limit) {
      return scrollParents;
    }

    if (!node) {
      return scrollParents;
    }

    if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isDocument)(node) && node.scrollingElement != null && !scrollParents.includes(node.scrollingElement)) {
      scrollParents.push(node.scrollingElement);
      return scrollParents;
    }

    if (!(0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(node) || (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isSVGElement)(node)) {
      return scrollParents;
    }

    if (scrollParents.includes(node)) {
      return scrollParents;
    }

    const computedStyle = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(element).getComputedStyle(node);

    if (node !== element) {
      if (isScrollable(node, computedStyle)) {
        scrollParents.push(node);
      }
    }

    if (isFixed(node, computedStyle)) {
      return scrollParents;
    }

    return findScrollableAncestors(node.parentNode);
  }

  if (!element) {
    return scrollParents;
  }

  return findScrollableAncestors(element);
}
function getFirstScrollableAncestor(node) {
  const [firstScrollableAncestor] = getScrollableAncestors(node, 1);
  return firstScrollableAncestor != null ? firstScrollableAncestor : null;
}

function getScrollableElement(element) {
  if (!_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.canUseDOM || !element) {
    return null;
  }

  if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isWindow)(element)) {
    return element;
  }

  if (!(0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isNode)(element)) {
    return null;
  }

  if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isDocument)(element) || element === (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(element).scrollingElement) {
    return window;
  }

  if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(element)) {
    return element;
  }

  return null;
}

function getScrollXCoordinate(element) {
  if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isWindow)(element)) {
    return element.scrollX;
  }

  return element.scrollLeft;
}
function getScrollYCoordinate(element) {
  if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isWindow)(element)) {
    return element.scrollY;
  }

  return element.scrollTop;
}
function getScrollCoordinates(element) {
  return {
    x: getScrollXCoordinate(element),
    y: getScrollYCoordinate(element)
  };
}

var Direction;

(function (Direction) {
  Direction[Direction["Forward"] = 1] = "Forward";
  Direction[Direction["Backward"] = -1] = "Backward";
})(Direction || (Direction = {}));

function isDocumentScrollingElement(element) {
  if (!_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.canUseDOM || !element) {
    return false;
  }

  return element === document.scrollingElement;
}

function getScrollPosition(scrollingContainer) {
  const minScroll = {
    x: 0,
    y: 0
  };
  const dimensions = isDocumentScrollingElement(scrollingContainer) ? {
    height: window.innerHeight,
    width: window.innerWidth
  } : {
    height: scrollingContainer.clientHeight,
    width: scrollingContainer.clientWidth
  };
  const maxScroll = {
    x: scrollingContainer.scrollWidth - dimensions.width,
    y: scrollingContainer.scrollHeight - dimensions.height
  };
  const isTop = scrollingContainer.scrollTop <= minScroll.y;
  const isLeft = scrollingContainer.scrollLeft <= minScroll.x;
  const isBottom = scrollingContainer.scrollTop >= maxScroll.y;
  const isRight = scrollingContainer.scrollLeft >= maxScroll.x;
  return {
    isTop,
    isLeft,
    isBottom,
    isRight,
    maxScroll,
    minScroll
  };
}

const defaultThreshold = {
  x: 0.2,
  y: 0.2
};
function getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, _ref, acceleration, thresholdPercentage) {
  let {
    top,
    left,
    right,
    bottom
  } = _ref;

  if (acceleration === void 0) {
    acceleration = 10;
  }

  if (thresholdPercentage === void 0) {
    thresholdPercentage = defaultThreshold;
  }

  const {
    isTop,
    isBottom,
    isLeft,
    isRight
  } = getScrollPosition(scrollContainer);
  const direction = {
    x: 0,
    y: 0
  };
  const speed = {
    x: 0,
    y: 0
  };
  const threshold = {
    height: scrollContainerRect.height * thresholdPercentage.y,
    width: scrollContainerRect.width * thresholdPercentage.x
  };

  if (!isTop && top <= scrollContainerRect.top + threshold.height) {
    // Scroll Up
    direction.y = Direction.Backward;
    speed.y = acceleration * Math.abs((scrollContainerRect.top + threshold.height - top) / threshold.height);
  } else if (!isBottom && bottom >= scrollContainerRect.bottom - threshold.height) {
    // Scroll Down
    direction.y = Direction.Forward;
    speed.y = acceleration * Math.abs((scrollContainerRect.bottom - threshold.height - bottom) / threshold.height);
  }

  if (!isRight && right >= scrollContainerRect.right - threshold.width) {
    // Scroll Right
    direction.x = Direction.Forward;
    speed.x = acceleration * Math.abs((scrollContainerRect.right - threshold.width - right) / threshold.width);
  } else if (!isLeft && left <= scrollContainerRect.left + threshold.width) {
    // Scroll Left
    direction.x = Direction.Backward;
    speed.x = acceleration * Math.abs((scrollContainerRect.left + threshold.width - left) / threshold.width);
  }

  return {
    direction,
    speed
  };
}

function getScrollElementRect(element) {
  if (element === document.scrollingElement) {
    const {
      innerWidth,
      innerHeight
    } = window;
    return {
      top: 0,
      left: 0,
      right: innerWidth,
      bottom: innerHeight,
      width: innerWidth,
      height: innerHeight
    };
  }

  const {
    top,
    left,
    right,
    bottom
  } = element.getBoundingClientRect();
  return {
    top,
    left,
    right,
    bottom,
    width: element.clientWidth,
    height: element.clientHeight
  };
}

function getScrollOffsets(scrollableAncestors) {
  return scrollableAncestors.reduce((acc, node) => {
    return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(acc, getScrollCoordinates(node));
  }, defaultCoordinates);
}
function getScrollXOffset(scrollableAncestors) {
  return scrollableAncestors.reduce((acc, node) => {
    return acc + getScrollXCoordinate(node);
  }, 0);
}
function getScrollYOffset(scrollableAncestors) {
  return scrollableAncestors.reduce((acc, node) => {
    return acc + getScrollYCoordinate(node);
  }, 0);
}

function scrollIntoViewIfNeeded(element, measure) {
  if (measure === void 0) {
    measure = getClientRect;
  }

  if (!element) {
    return;
  }

  const {
    top,
    left,
    bottom,
    right
  } = measure(element);
  const firstScrollableAncestor = getFirstScrollableAncestor(element);

  if (!firstScrollableAncestor) {
    return;
  }

  if (bottom <= 0 || right <= 0 || top >= window.innerHeight || left >= window.innerWidth) {
    element.scrollIntoView({
      block: 'center',
      inline: 'center'
    });
  }
}

const properties = [['x', ['left', 'right'], getScrollXOffset], ['y', ['top', 'bottom'], getScrollYOffset]];
class Rect {
  constructor(rect, element) {
    this.rect = void 0;
    this.width = void 0;
    this.height = void 0;
    this.top = void 0;
    this.bottom = void 0;
    this.right = void 0;
    this.left = void 0;
    const scrollableAncestors = getScrollableAncestors(element);
    const scrollOffsets = getScrollOffsets(scrollableAncestors);
    this.rect = { ...rect
    };
    this.width = rect.width;
    this.height = rect.height;

    for (const [axis, keys, getScrollOffset] of properties) {
      for (const key of keys) {
        Object.defineProperty(this, key, {
          get: () => {
            const currentOffsets = getScrollOffset(scrollableAncestors);
            const scrollOffsetsDeltla = scrollOffsets[axis] - currentOffsets;
            return this.rect[key] + scrollOffsetsDeltla;
          },
          enumerable: true
        });
      }
    }

    Object.defineProperty(this, 'rect', {
      enumerable: false
    });
  }

}

class Listeners {
  constructor(target) {
    this.target = void 0;
    this.listeners = [];

    this.removeAll = () => {
      this.listeners.forEach(listener => {
        var _this$target;

        return (_this$target = this.target) == null ? void 0 : _this$target.removeEventListener(...listener);
      });
    };

    this.target = target;
  }

  add(eventName, handler, options) {
    var _this$target2;

    (_this$target2 = this.target) == null ? void 0 : _this$target2.addEventListener(eventName, handler, options);
    this.listeners.push([eventName, handler, options]);
  }

}

function getEventListenerTarget(target) {
  // If the `event.target` element is removed from the document events will still be targeted
  // at it, and hence won't always bubble up to the window or document anymore.
  // If there is any risk of an element being removed while it is being dragged,
  // the best practice is to attach the event listeners directly to the target.
  // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget
  const {
    EventTarget
  } = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(target);
  return target instanceof EventTarget ? target : (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(target);
}

function hasExceededDistance(delta, measurement) {
  const dx = Math.abs(delta.x);
  const dy = Math.abs(delta.y);

  if (typeof measurement === 'number') {
    return Math.sqrt(dx ** 2 + dy ** 2) > measurement;
  }

  if ('x' in measurement && 'y' in measurement) {
    return dx > measurement.x && dy > measurement.y;
  }

  if ('x' in measurement) {
    return dx > measurement.x;
  }

  if ('y' in measurement) {
    return dy > measurement.y;
  }

  return false;
}

var EventName;

(function (EventName) {
  EventName["Click"] = "click";
  EventName["DragStart"] = "dragstart";
  EventName["Keydown"] = "keydown";
  EventName["ContextMenu"] = "contextmenu";
  EventName["Resize"] = "resize";
  EventName["SelectionChange"] = "selectionchange";
  EventName["VisibilityChange"] = "visibilitychange";
})(EventName || (EventName = {}));

function preventDefault(event) {
  event.preventDefault();
}
function stopPropagation(event) {
  event.stopPropagation();
}

var KeyboardCode;

(function (KeyboardCode) {
  KeyboardCode["Space"] = "Space";
  KeyboardCode["Down"] = "ArrowDown";
  KeyboardCode["Right"] = "ArrowRight";
  KeyboardCode["Left"] = "ArrowLeft";
  KeyboardCode["Up"] = "ArrowUp";
  KeyboardCode["Esc"] = "Escape";
  KeyboardCode["Enter"] = "Enter";
  KeyboardCode["Tab"] = "Tab";
})(KeyboardCode || (KeyboardCode = {}));

const defaultKeyboardCodes = {
  start: [KeyboardCode.Space, KeyboardCode.Enter],
  cancel: [KeyboardCode.Esc],
  end: [KeyboardCode.Space, KeyboardCode.Enter, KeyboardCode.Tab]
};
const defaultKeyboardCoordinateGetter = (event, _ref) => {
  let {
    currentCoordinates
  } = _ref;

  switch (event.code) {
    case KeyboardCode.Right:
      return { ...currentCoordinates,
        x: currentCoordinates.x + 25
      };

    case KeyboardCode.Left:
      return { ...currentCoordinates,
        x: currentCoordinates.x - 25
      };

    case KeyboardCode.Down:
      return { ...currentCoordinates,
        y: currentCoordinates.y + 25
      };

    case KeyboardCode.Up:
      return { ...currentCoordinates,
        y: currentCoordinates.y - 25
      };
  }

  return undefined;
};

class KeyboardSensor {
  constructor(props) {
    this.props = void 0;
    this.autoScrollEnabled = false;
    this.referenceCoordinates = void 0;
    this.listeners = void 0;
    this.windowListeners = void 0;
    this.props = props;
    const {
      event: {
        target
      }
    } = props;
    this.props = props;
    this.listeners = new Listeners((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(target));
    this.windowListeners = new Listeners((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(target));
    this.handleKeyDown = this.handleKeyDown.bind(this);
    this.handleCancel = this.handleCancel.bind(this);
    this.attach();
  }

  attach() {
    this.handleStart();
    this.windowListeners.add(EventName.Resize, this.handleCancel);
    this.windowListeners.add(EventName.VisibilityChange, this.handleCancel);
    setTimeout(() => this.listeners.add(EventName.Keydown, this.handleKeyDown));
  }

  handleStart() {
    const {
      activeNode,
      onStart
    } = this.props;
    const node = activeNode.node.current;

    if (node) {
      scrollIntoViewIfNeeded(node);
    }

    onStart(defaultCoordinates);
  }

  handleKeyDown(event) {
    if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isKeyboardEvent)(event)) {
      const {
        active,
        context,
        options
      } = this.props;
      const {
        keyboardCodes = defaultKeyboardCodes,
        coordinateGetter = defaultKeyboardCoordinateGetter,
        scrollBehavior = 'smooth'
      } = options;
      const {
        code
      } = event;

      if (keyboardCodes.end.includes(code)) {
        this.handleEnd(event);
        return;
      }

      if (keyboardCodes.cancel.includes(code)) {
        this.handleCancel(event);
        return;
      }

      const {
        collisionRect
      } = context.current;
      const currentCoordinates = collisionRect ? {
        x: collisionRect.left,
        y: collisionRect.top
      } : defaultCoordinates;

      if (!this.referenceCoordinates) {
        this.referenceCoordinates = currentCoordinates;
      }

      const newCoordinates = coordinateGetter(event, {
        active,
        context: context.current,
        currentCoordinates
      });

      if (newCoordinates) {
        const coordinatesDelta = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.subtract)(newCoordinates, currentCoordinates);
        const scrollDelta = {
          x: 0,
          y: 0
        };
        const {
          scrollableAncestors
        } = context.current;

        for (const scrollContainer of scrollableAncestors) {
          const direction = event.code;
          const {
            isTop,
            isRight,
            isLeft,
            isBottom,
            maxScroll,
            minScroll
          } = getScrollPosition(scrollContainer);
          const scrollElementRect = getScrollElementRect(scrollContainer);
          const clampedCoordinates = {
            x: Math.min(direction === KeyboardCode.Right ? scrollElementRect.right - scrollElementRect.width / 2 : scrollElementRect.right, Math.max(direction === KeyboardCode.Right ? scrollElementRect.left : scrollElementRect.left + scrollElementRect.width / 2, newCoordinates.x)),
            y: Math.min(direction === KeyboardCode.Down ? scrollElementRect.bottom - scrollElementRect.height / 2 : scrollElementRect.bottom, Math.max(direction === KeyboardCode.Down ? scrollElementRect.top : scrollElementRect.top + scrollElementRect.height / 2, newCoordinates.y))
          };
          const canScrollX = direction === KeyboardCode.Right && !isRight || direction === KeyboardCode.Left && !isLeft;
          const canScrollY = direction === KeyboardCode.Down && !isBottom || direction === KeyboardCode.Up && !isTop;

          if (canScrollX && clampedCoordinates.x !== newCoordinates.x) {
            const newScrollCoordinates = scrollContainer.scrollLeft + coordinatesDelta.x;
            const canScrollToNewCoordinates = direction === KeyboardCode.Right && newScrollCoordinates <= maxScroll.x || direction === KeyboardCode.Left && newScrollCoordinates >= minScroll.x;

            if (canScrollToNewCoordinates && !coordinatesDelta.y) {
              // We don't need to update coordinates, the scroll adjustment alone will trigger
              // logic to auto-detect the new container we are over
              scrollContainer.scrollTo({
                left: newScrollCoordinates,
                behavior: scrollBehavior
              });
              return;
            }

            if (canScrollToNewCoordinates) {
              scrollDelta.x = scrollContainer.scrollLeft - newScrollCoordinates;
            } else {
              scrollDelta.x = direction === KeyboardCode.Right ? scrollContainer.scrollLeft - maxScroll.x : scrollContainer.scrollLeft - minScroll.x;
            }

            if (scrollDelta.x) {
              scrollContainer.scrollBy({
                left: -scrollDelta.x,
                behavior: scrollBehavior
              });
            }

            break;
          } else if (canScrollY && clampedCoordinates.y !== newCoordinates.y) {
            const newScrollCoordinates = scrollContainer.scrollTop + coordinatesDelta.y;
            const canScrollToNewCoordinates = direction === KeyboardCode.Down && newScrollCoordinates <= maxScroll.y || direction === KeyboardCode.Up && newScrollCoordinates >= minScroll.y;

            if (canScrollToNewCoordinates && !coordinatesDelta.x) {
              // We don't need to update coordinates, the scroll adjustment alone will trigger
              // logic to auto-detect the new container we are over
              scrollContainer.scrollTo({
                top: newScrollCoordinates,
                behavior: scrollBehavior
              });
              return;
            }

            if (canScrollToNewCoordinates) {
              scrollDelta.y = scrollContainer.scrollTop - newScrollCoordinates;
            } else {
              scrollDelta.y = direction === KeyboardCode.Down ? scrollContainer.scrollTop - maxScroll.y : scrollContainer.scrollTop - minScroll.y;
            }

            if (scrollDelta.y) {
              scrollContainer.scrollBy({
                top: -scrollDelta.y,
                behavior: scrollBehavior
              });
            }

            break;
          }
        }

        this.handleMove(event, (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.subtract)(newCoordinates, this.referenceCoordinates), scrollDelta));
      }
    }
  }

  handleMove(event, coordinates) {
    const {
      onMove
    } = this.props;
    event.preventDefault();
    onMove(coordinates);
  }

  handleEnd(event) {
    const {
      onEnd
    } = this.props;
    event.preventDefault();
    this.detach();
    onEnd();
  }

  handleCancel(event) {
    const {
      onCancel
    } = this.props;
    event.preventDefault();
    this.detach();
    onCancel();
  }

  detach() {
    this.listeners.removeAll();
    this.windowListeners.removeAll();
  }

}
KeyboardSensor.activators = [{
  eventName: 'onKeyDown',
  handler: (event, _ref, _ref2) => {
    let {
      keyboardCodes = defaultKeyboardCodes,
      onActivation
    } = _ref;
    let {
      active
    } = _ref2;
    const {
      code
    } = event.nativeEvent;

    if (keyboardCodes.start.includes(code)) {
      const activator = active.activatorNode.current;

      if (activator && event.target !== activator) {
        return false;
      }

      event.preventDefault();
      onActivation == null ? void 0 : onActivation({
        event: event.nativeEvent
      });
      return true;
    }

    return false;
  }
}];

function isDistanceConstraint(constraint) {
  return Boolean(constraint && 'distance' in constraint);
}

function isDelayConstraint(constraint) {
  return Boolean(constraint && 'delay' in constraint);
}

class AbstractPointerSensor {
  constructor(props, events, listenerTarget) {
    var _getEventCoordinates;

    if (listenerTarget === void 0) {
      listenerTarget = getEventListenerTarget(props.event.target);
    }

    this.props = void 0;
    this.events = void 0;
    this.autoScrollEnabled = true;
    this.document = void 0;
    this.activated = false;
    this.initialCoordinates = void 0;
    this.timeoutId = null;
    this.listeners = void 0;
    this.documentListeners = void 0;
    this.windowListeners = void 0;
    this.props = props;
    this.events = events;
    const {
      event
    } = props;
    const {
      target
    } = event;
    this.props = props;
    this.events = events;
    this.document = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(target);
    this.documentListeners = new Listeners(this.document);
    this.listeners = new Listeners(listenerTarget);
    this.windowListeners = new Listeners((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(target));
    this.initialCoordinates = (_getEventCoordinates = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getEventCoordinates)(event)) != null ? _getEventCoordinates : defaultCoordinates;
    this.handleStart = this.handleStart.bind(this);
    this.handleMove = this.handleMove.bind(this);
    this.handleEnd = this.handleEnd.bind(this);
    this.handleCancel = this.handleCancel.bind(this);
    this.handleKeydown = this.handleKeydown.bind(this);
    this.removeTextSelection = this.removeTextSelection.bind(this);
    this.attach();
  }

  attach() {
    const {
      events,
      props: {
        options: {
          activationConstraint,
          bypassActivationConstraint
        }
      }
    } = this;
    this.listeners.add(events.move.name, this.handleMove, {
      passive: false
    });
    this.listeners.add(events.end.name, this.handleEnd);

    if (events.cancel) {
      this.listeners.add(events.cancel.name, this.handleCancel);
    }

    this.windowListeners.add(EventName.Resize, this.handleCancel);
    this.windowListeners.add(EventName.DragStart, preventDefault);
    this.windowListeners.add(EventName.VisibilityChange, this.handleCancel);
    this.windowListeners.add(EventName.ContextMenu, preventDefault);
    this.documentListeners.add(EventName.Keydown, this.handleKeydown);

    if (activationConstraint) {
      if (bypassActivationConstraint != null && bypassActivationConstraint({
        event: this.props.event,
        activeNode: this.props.activeNode,
        options: this.props.options
      })) {
        return this.handleStart();
      }

      if (isDelayConstraint(activationConstraint)) {
        this.timeoutId = setTimeout(this.handleStart, activationConstraint.delay);
        this.handlePending(activationConstraint);
        return;
      }

      if (isDistanceConstraint(activationConstraint)) {
        this.handlePending(activationConstraint);
        return;
      }
    }

    this.handleStart();
  }

  detach() {
    this.listeners.removeAll();
    this.windowListeners.removeAll(); // Wait until the next event loop before removing document listeners
    // This is necessary because we listen for `click` and `selection` events on the document

    setTimeout(this.documentListeners.removeAll, 50);

    if (this.timeoutId !== null) {
      clearTimeout(this.timeoutId);
      this.timeoutId = null;
    }
  }

  handlePending(constraint, offset) {
    const {
      active,
      onPending
    } = this.props;
    onPending(active, constraint, this.initialCoordinates, offset);
  }

  handleStart() {
    const {
      initialCoordinates
    } = this;
    const {
      onStart
    } = this.props;

    if (initialCoordinates) {
      this.activated = true; // Stop propagation of click events once activation constraints are met

      this.documentListeners.add(EventName.Click, stopPropagation, {
        capture: true
      }); // Remove any text selection from the document

      this.removeTextSelection(); // Prevent further text selection while dragging

      this.documentListeners.add(EventName.SelectionChange, this.removeTextSelection);
      onStart(initialCoordinates);
    }
  }

  handleMove(event) {
    var _getEventCoordinates2;

    const {
      activated,
      initialCoordinates,
      props
    } = this;
    const {
      onMove,
      options: {
        activationConstraint
      }
    } = props;

    if (!initialCoordinates) {
      return;
    }

    const coordinates = (_getEventCoordinates2 = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getEventCoordinates)(event)) != null ? _getEventCoordinates2 : defaultCoordinates;
    const delta = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.subtract)(initialCoordinates, coordinates); // Constraint validation

    if (!activated && activationConstraint) {
      if (isDistanceConstraint(activationConstraint)) {
        if (activationConstraint.tolerance != null && hasExceededDistance(delta, activationConstraint.tolerance)) {
          return this.handleCancel();
        }

        if (hasExceededDistance(delta, activationConstraint.distance)) {
          return this.handleStart();
        }
      }

      if (isDelayConstraint(activationConstraint)) {
        if (hasExceededDistance(delta, activationConstraint.tolerance)) {
          return this.handleCancel();
        }
      }

      this.handlePending(activationConstraint, delta);
      return;
    }

    if (event.cancelable) {
      event.preventDefault();
    }

    onMove(coordinates);
  }

  handleEnd() {
    const {
      onAbort,
      onEnd
    } = this.props;
    this.detach();

    if (!this.activated) {
      onAbort(this.props.active);
    }

    onEnd();
  }

  handleCancel() {
    const {
      onAbort,
      onCancel
    } = this.props;
    this.detach();

    if (!this.activated) {
      onAbort(this.props.active);
    }

    onCancel();
  }

  handleKeydown(event) {
    if (event.code === KeyboardCode.Esc) {
      this.handleCancel();
    }
  }

  removeTextSelection() {
    var _this$document$getSel;

    (_this$document$getSel = this.document.getSelection()) == null ? void 0 : _this$document$getSel.removeAllRanges();
  }

}

const events = {
  cancel: {
    name: 'pointercancel'
  },
  move: {
    name: 'pointermove'
  },
  end: {
    name: 'pointerup'
  }
};
class PointerSensor extends AbstractPointerSensor {
  constructor(props) {
    const {
      event
    } = props; // Pointer events stop firing if the target is unmounted while dragging
    // Therefore we attach listeners to the owner document instead

    const listenerTarget = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(event.target);
    super(props, events, listenerTarget);
  }

}
PointerSensor.activators = [{
  eventName: 'onPointerDown',
  handler: (_ref, _ref2) => {
    let {
      nativeEvent: event
    } = _ref;
    let {
      onActivation
    } = _ref2;

    if (!event.isPrimary || event.button !== 0) {
      return false;
    }

    onActivation == null ? void 0 : onActivation({
      event
    });
    return true;
  }
}];

const events$1 = {
  move: {
    name: 'mousemove'
  },
  end: {
    name: 'mouseup'
  }
};
var MouseButton;

(function (MouseButton) {
  MouseButton[MouseButton["RightClick"] = 2] = "RightClick";
})(MouseButton || (MouseButton = {}));

class MouseSensor extends AbstractPointerSensor {
  constructor(props) {
    super(props, events$1, (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(props.event.target));
  }

}
MouseSensor.activators = [{
  eventName: 'onMouseDown',
  handler: (_ref, _ref2) => {
    let {
      nativeEvent: event
    } = _ref;
    let {
      onActivation
    } = _ref2;

    if (event.button === MouseButton.RightClick) {
      return false;
    }

    onActivation == null ? void 0 : onActivation({
      event
    });
    return true;
  }
}];

const events$2 = {
  cancel: {
    name: 'touchcancel'
  },
  move: {
    name: 'touchmove'
  },
  end: {
    name: 'touchend'
  }
};
class TouchSensor extends AbstractPointerSensor {
  constructor(props) {
    super(props, events$2);
  }

  static setup() {
    // Adding a non-capture and non-passive `touchmove` listener in order
    // to force `event.preventDefault()` calls to work in dynamically added
    // touchmove event handlers. This is required for iOS Safari.
    window.addEventListener(events$2.move.name, noop, {
      capture: false,
      passive: false
    });
    return function teardown() {
      window.removeEventListener(events$2.move.name, noop);
    }; // We create a new handler because the teardown function of another sensor
    // could remove our event listener if we use a referentially equal listener.

    function noop() {}
  }

}
TouchSensor.activators = [{
  eventName: 'onTouchStart',
  handler: (_ref, _ref2) => {
    let {
      nativeEvent: event
    } = _ref;
    let {
      onActivation
    } = _ref2;
    const {
      touches
    } = event;

    if (touches.length > 1) {
      return false;
    }

    onActivation == null ? void 0 : onActivation({
      event
    });
    return true;
  }
}];

var AutoScrollActivator;

(function (AutoScrollActivator) {
  AutoScrollActivator[AutoScrollActivator["Pointer"] = 0] = "Pointer";
  AutoScrollActivator[AutoScrollActivator["DraggableRect"] = 1] = "DraggableRect";
})(AutoScrollActivator || (AutoScrollActivator = {}));

var TraversalOrder;

(function (TraversalOrder) {
  TraversalOrder[TraversalOrder["TreeOrder"] = 0] = "TreeOrder";
  TraversalOrder[TraversalOrder["ReversedTreeOrder"] = 1] = "ReversedTreeOrder";
})(TraversalOrder || (TraversalOrder = {}));

function useAutoScroller(_ref) {
  let {
    acceleration,
    activator = AutoScrollActivator.Pointer,
    canScroll,
    draggingRect,
    enabled,
    interval = 5,
    order = TraversalOrder.TreeOrder,
    pointerCoordinates,
    scrollableAncestors,
    scrollableAncestorRects,
    delta,
    threshold
  } = _ref;
  const scrollIntent = useScrollIntent({
    delta,
    disabled: !enabled
  });
  const [setAutoScrollInterval, clearAutoScrollInterval] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useInterval)();
  const scrollSpeed = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({
    x: 0,
    y: 0
  });
  const scrollDirection = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({
    x: 0,
    y: 0
  });
  const rect = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
    switch (activator) {
      case AutoScrollActivator.Pointer:
        return pointerCoordinates ? {
          top: pointerCoordinates.y,
          bottom: pointerCoordinates.y,
          left: pointerCoordinates.x,
          right: pointerCoordinates.x
        } : null;

      case AutoScrollActivator.DraggableRect:
        return draggingRect;
    }
  }, [activator, draggingRect, pointerCoordinates]);
  const scrollContainerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
  const autoScroll = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    const scrollContainer = scrollContainerRef.current;

    if (!scrollContainer) {
      return;
    }

    const scrollLeft = scrollSpeed.current.x * scrollDirection.current.x;
    const scrollTop = scrollSpeed.current.y * scrollDirection.current.y;
    scrollContainer.scrollBy(scrollLeft, scrollTop);
  }, []);
  const sortedScrollableAncestors = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => order === TraversalOrder.TreeOrder ? [...scrollableAncestors].reverse() : scrollableAncestors, [order, scrollableAncestors]);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (!enabled || !scrollableAncestors.length || !rect) {
      clearAutoScrollInterval();
      return;
    }

    for (const scrollContainer of sortedScrollableAncestors) {
      if ((canScroll == null ? void 0 : canScroll(scrollContainer)) === false) {
        continue;
      }

      const index = scrollableAncestors.indexOf(scrollContainer);
      const scrollContainerRect = scrollableAncestorRects[index];

      if (!scrollContainerRect) {
        continue;
      }

      const {
        direction,
        speed
      } = getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, rect, acceleration, threshold);

      for (const axis of ['x', 'y']) {
        if (!scrollIntent[axis][direction[axis]]) {
          speed[axis] = 0;
          direction[axis] = 0;
        }
      }

      if (speed.x > 0 || speed.y > 0) {
        clearAutoScrollInterval();
        scrollContainerRef.current = scrollContainer;
        setAutoScrollInterval(autoScroll, interval);
        scrollSpeed.current = speed;
        scrollDirection.current = direction;
        return;
      }
    }

    scrollSpeed.current = {
      x: 0,
      y: 0
    };
    scrollDirection.current = {
      x: 0,
      y: 0
    };
    clearAutoScrollInterval();
  }, // eslint-disable-next-line react-hooks/exhaustive-deps
  [acceleration, autoScroll, canScroll, clearAutoScrollInterval, enabled, interval, // eslint-disable-next-line react-hooks/exhaustive-deps
  JSON.stringify(rect), // eslint-disable-next-line react-hooks/exhaustive-deps
  JSON.stringify(scrollIntent), setAutoScrollInterval, scrollableAncestors, sortedScrollableAncestors, scrollableAncestorRects, // eslint-disable-next-line react-hooks/exhaustive-deps
  JSON.stringify(threshold)]);
}
const defaultScrollIntent = {
  x: {
    [Direction.Backward]: false,
    [Direction.Forward]: false
  },
  y: {
    [Direction.Backward]: false,
    [Direction.Forward]: false
  }
};

function useScrollIntent(_ref2) {
  let {
    delta,
    disabled
  } = _ref2;
  const previousDelta = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.usePrevious)(delta);
  return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(previousIntent => {
    if (disabled || !previousDelta || !previousIntent) {
      // Reset scroll intent tracking when auto-scrolling is disabled
      return defaultScrollIntent;
    }

    const direction = {
      x: Math.sign(delta.x - previousDelta.x),
      y: Math.sign(delta.y - previousDelta.y)
    }; // Keep track of the user intent to scroll in each direction for both axis

    return {
      x: {
        [Direction.Backward]: previousIntent.x[Direction.Backward] || direction.x === -1,
        [Direction.Forward]: previousIntent.x[Direction.Forward] || direction.x === 1
      },
      y: {
        [Direction.Backward]: previousIntent.y[Direction.Backward] || direction.y === -1,
        [Direction.Forward]: previousIntent.y[Direction.Forward] || direction.y === 1
      }
    };
  }, [disabled, delta, previousDelta]);
}

function useCachedNode(draggableNodes, id) {
  const draggableNode = id != null ? draggableNodes.get(id) : undefined;
  const node = draggableNode ? draggableNode.node.current : null;
  return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(cachedNode => {
    var _ref;

    if (id == null) {
      return null;
    } // In some cases, the draggable node can unmount while dragging
    // This is the case for virtualized lists. In those situations,
    // we fall back to the last known value for that node.


    return (_ref = node != null ? node : cachedNode) != null ? _ref : null;
  }, [node, id]);
}

function useCombineActivators(sensors, getSyntheticHandler) {
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => sensors.reduce((accumulator, sensor) => {
    const {
      sensor: Sensor
    } = sensor;
    const sensorActivators = Sensor.activators.map(activator => ({
      eventName: activator.eventName,
      handler: getSyntheticHandler(activator.handler, sensor)
    }));
    return [...accumulator, ...sensorActivators];
  }, []), [sensors, getSyntheticHandler]);
}

var MeasuringStrategy;

(function (MeasuringStrategy) {
  MeasuringStrategy[MeasuringStrategy["Always"] = 0] = "Always";
  MeasuringStrategy[MeasuringStrategy["BeforeDragging"] = 1] = "BeforeDragging";
  MeasuringStrategy[MeasuringStrategy["WhileDragging"] = 2] = "WhileDragging";
})(MeasuringStrategy || (MeasuringStrategy = {}));

var MeasuringFrequency;

(function (MeasuringFrequency) {
  MeasuringFrequency["Optimized"] = "optimized";
})(MeasuringFrequency || (MeasuringFrequency = {}));

const defaultValue = /*#__PURE__*/new Map();
function useDroppableMeasuring(containers, _ref) {
  let {
    dragging,
    dependencies,
    config
  } = _ref;
  const [queue, setQueue] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
  const {
    frequency,
    measure,
    strategy
  } = config;
  const containersRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(containers);
  const disabled = isDisabled();
  const disabledRef = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(disabled);
  const measureDroppableContainers = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (ids) {
    if (ids === void 0) {
      ids = [];
    }

    if (disabledRef.current) {
      return;
    }

    setQueue(value => {
      if (value === null) {
        return ids;
      }

      return value.concat(ids.filter(id => !value.includes(id)));
    });
  }, [disabledRef]);
  const timeoutId = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
  const droppableRects = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(previousValue => {
    if (disabled && !dragging) {
      return defaultValue;
    }

    if (!previousValue || previousValue === defaultValue || containersRef.current !== containers || queue != null) {
      const map = new Map();

      for (let container of containers) {
        if (!container) {
          continue;
        }

        if (queue && queue.length > 0 && !queue.includes(container.id) && container.rect.current) {
          // This container does not need to be re-measured
          map.set(container.id, container.rect.current);
          continue;
        }

        const node = container.node.current;
        const rect = node ? new Rect(measure(node), node) : null;
        container.rect.current = rect;

        if (rect) {
          map.set(container.id, rect);
        }
      }

      return map;
    }

    return previousValue;
  }, [containers, queue, dragging, disabled, measure]);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    containersRef.current = containers;
  }, [containers]);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (disabled) {
      return;
    }

    measureDroppableContainers();
  }, // eslint-disable-next-line react-hooks/exhaustive-deps
  [dragging, disabled]);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (queue && queue.length > 0) {
      setQueue(null);
    }
  }, //eslint-disable-next-line react-hooks/exhaustive-deps
  [JSON.stringify(queue)]);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (disabled || typeof frequency !== 'number' || timeoutId.current !== null) {
      return;
    }

    timeoutId.current = setTimeout(() => {
      measureDroppableContainers();
      timeoutId.current = null;
    }, frequency);
  }, // eslint-disable-next-line react-hooks/exhaustive-deps
  [frequency, disabled, measureDroppableContainers, ...dependencies]);
  return {
    droppableRects,
    measureDroppableContainers,
    measuringScheduled: queue != null
  };

  function isDisabled() {
    switch (strategy) {
      case MeasuringStrategy.Always:
        return false;

      case MeasuringStrategy.BeforeDragging:
        return dragging;

      default:
        return !dragging;
    }
  }
}

function useInitialValue(value, computeFn) {
  return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(previousValue => {
    if (!value) {
      return null;
    }

    if (previousValue) {
      return previousValue;
    }

    return typeof computeFn === 'function' ? computeFn(value) : value;
  }, [computeFn, value]);
}

function useInitialRect(node, measure) {
  return useInitialValue(node, measure);
}

/**
 * Returns a new MutationObserver instance.
 * If `MutationObserver` is undefined in the execution environment, returns `undefined`.
 */

function useMutationObserver(_ref) {
  let {
    callback,
    disabled
  } = _ref;
  const handleMutations = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useEvent)(callback);
  const mutationObserver = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
    if (disabled || typeof window === 'undefined' || typeof window.MutationObserver === 'undefined') {
      return undefined;
    }

    const {
      MutationObserver
    } = window;
    return new MutationObserver(handleMutations);
  }, [handleMutations, disabled]);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    return () => mutationObserver == null ? void 0 : mutationObserver.disconnect();
  }, [mutationObserver]);
  return mutationObserver;
}

/**
 * Returns a new ResizeObserver instance bound to the `onResize` callback.
 * If `ResizeObserver` is undefined in the execution environment, returns `undefined`.
 */

function useResizeObserver(_ref) {
  let {
    callback,
    disabled
  } = _ref;
  const handleResize = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useEvent)(callback);
  const resizeObserver = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
    if (disabled || typeof window === 'undefined' || typeof window.ResizeObserver === 'undefined') {
      return undefined;
    }

    const {
      ResizeObserver
    } = window;
    return new ResizeObserver(handleResize);
  }, // eslint-disable-next-line react-hooks/exhaustive-deps
  [disabled]);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    return () => resizeObserver == null ? void 0 : resizeObserver.disconnect();
  }, [resizeObserver]);
  return resizeObserver;
}

function defaultMeasure(element) {
  return new Rect(getClientRect(element), element);
}

function useRect(element, measure, fallbackRect) {
  if (measure === void 0) {
    measure = defaultMeasure;
  }

  const [rect, setRect] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);

  function measureRect() {
    setRect(currentRect => {
      if (!element) {
        return null;
      }

      if (element.isConnected === false) {
        var _ref;

        // Fall back to last rect we measured if the element is
        // no longer connected to the DOM.
        return (_ref = currentRect != null ? currentRect : fallbackRect) != null ? _ref : null;
      }

      const newRect = measure(element);

      if (JSON.stringify(currentRect) === JSON.stringify(newRect)) {
        return currentRect;
      }

      return newRect;
    });
  }

  const mutationObserver = useMutationObserver({
    callback(records) {
      if (!element) {
        return;
      }

      for (const record of records) {
        const {
          type,
          target
        } = record;

        if (type === 'childList' && target instanceof HTMLElement && target.contains(element)) {
          measureRect();
          break;
        }
      }
    }

  });
  const resizeObserver = useResizeObserver({
    callback: measureRect
  });
  (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => {
    measureRect();

    if (element) {
      resizeObserver == null ? void 0 : resizeObserver.observe(element);
      mutationObserver == null ? void 0 : mutationObserver.observe(document.body, {
        childList: true,
        subtree: true
      });
    } else {
      resizeObserver == null ? void 0 : resizeObserver.disconnect();
      mutationObserver == null ? void 0 : mutationObserver.disconnect();
    }
  }, [element]);
  return rect;
}

function useRectDelta(rect) {
  const initialRect = useInitialValue(rect);
  return getRectDelta(rect, initialRect);
}

const defaultValue$1 = [];
function useScrollableAncestors(node) {
  const previousNode = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(node);
  const ancestors = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(previousValue => {
    if (!node) {
      return defaultValue$1;
    }

    if (previousValue && previousValue !== defaultValue$1 && node && previousNode.current && node.parentNode === previousNode.current.parentNode) {
      return previousValue;
    }

    return getScrollableAncestors(node);
  }, [node]);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    previousNode.current = node;
  }, [node]);
  return ancestors;
}

function useScrollOffsets(elements) {
  const [scrollCoordinates, setScrollCoordinates] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
  const prevElements = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(elements); // To-do: Throttle the handleScroll callback

  const handleScroll = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(event => {
    const scrollingElement = getScrollableElement(event.target);

    if (!scrollingElement) {
      return;
    }

    setScrollCoordinates(scrollCoordinates => {
      if (!scrollCoordinates) {
        return null;
      }

      scrollCoordinates.set(scrollingElement, getScrollCoordinates(scrollingElement));
      return new Map(scrollCoordinates);
    });
  }, []);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    const previousElements = prevElements.current;

    if (elements !== previousElements) {
      cleanup(previousElements);
      const entries = elements.map(element => {
        const scrollableElement = getScrollableElement(element);

        if (scrollableElement) {
          scrollableElement.addEventListener('scroll', handleScroll, {
            passive: true
          });
          return [scrollableElement, getScrollCoordinates(scrollableElement)];
        }

        return null;
      }).filter(entry => entry != null);
      setScrollCoordinates(entries.length ? new Map(entries) : null);
      prevElements.current = elements;
    }

    return () => {
      cleanup(elements);
      cleanup(previousElements);
    };

    function cleanup(elements) {
      elements.forEach(element => {
        const scrollableElement = getScrollableElement(element);
        scrollableElement == null ? void 0 : scrollableElement.removeEventListener('scroll', handleScroll);
      });
    }
  }, [handleScroll, elements]);
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
    if (elements.length) {
      return scrollCoordinates ? Array.from(scrollCoordinates.values()).reduce((acc, coordinates) => (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(acc, coordinates), defaultCoordinates) : getScrollOffsets(elements);
    }

    return defaultCoordinates;
  }, [elements, scrollCoordinates]);
}

function useScrollOffsetsDelta(scrollOffsets, dependencies) {
  if (dependencies === void 0) {
    dependencies = [];
  }

  const initialScrollOffsets = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    initialScrollOffsets.current = null;
  }, // eslint-disable-next-line react-hooks/exhaustive-deps
  dependencies);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    const hasScrollOffsets = scrollOffsets !== defaultCoordinates;

    if (hasScrollOffsets && !initialScrollOffsets.current) {
      initialScrollOffsets.current = scrollOffsets;
    }

    if (!hasScrollOffsets && initialScrollOffsets.current) {
      initialScrollOffsets.current = null;
    }
  }, [scrollOffsets]);
  return initialScrollOffsets.current ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.subtract)(scrollOffsets, initialScrollOffsets.current) : defaultCoordinates;
}

function useSensorSetup(sensors) {
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (!_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.canUseDOM) {
      return;
    }

    const teardownFns = sensors.map(_ref => {
      let {
        sensor
      } = _ref;
      return sensor.setup == null ? void 0 : sensor.setup();
    });
    return () => {
      for (const teardown of teardownFns) {
        teardown == null ? void 0 : teardown();
      }
    };
  }, // TO-DO: Sensors length could theoretically change which would not be a valid dependency
  // eslint-disable-next-line react-hooks/exhaustive-deps
  sensors.map(_ref2 => {
    let {
      sensor
    } = _ref2;
    return sensor;
  }));
}

function useSyntheticListeners(listeners, id) {
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
    return listeners.reduce((acc, _ref) => {
      let {
        eventName,
        handler
      } = _ref;

      acc[eventName] = event => {
        handler(event, id);
      };

      return acc;
    }, {});
  }, [listeners, id]);
}

function useWindowRect(element) {
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => element ? getWindowClientRect(element) : null, [element]);
}

const defaultValue$2 = [];
function useRects(elements, measure) {
  if (measure === void 0) {
    measure = getClientRect;
  }

  const [firstElement] = elements;
  const windowRect = useWindowRect(firstElement ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(firstElement) : null);
  const [rects, setRects] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(defaultValue$2);

  function measureRects() {
    setRects(() => {
      if (!elements.length) {
        return defaultValue$2;
      }

      return elements.map(element => isDocumentScrollingElement(element) ? windowRect : new Rect(measure(element), element));
    });
  }

  const resizeObserver = useResizeObserver({
    callback: measureRects
  });
  (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => {
    resizeObserver == null ? void 0 : resizeObserver.disconnect();
    measureRects();
    elements.forEach(element => resizeObserver == null ? void 0 : resizeObserver.observe(element));
  }, [elements]);
  return rects;
}

function getMeasurableNode(node) {
  if (!node) {
    return null;
  }

  if (node.children.length > 1) {
    return node;
  }

  const firstChild = node.children[0];
  return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(firstChild) ? firstChild : node;
}

function useDragOverlayMeasuring(_ref) {
  let {
    measure
  } = _ref;
  const [rect, setRect] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
  const handleResize = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(entries => {
    for (const {
      target
    } of entries) {
      if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(target)) {
        setRect(rect => {
          const newRect = measure(target);
          return rect ? { ...rect,
            width: newRect.width,
            height: newRect.height
          } : newRect;
        });
        break;
      }
    }
  }, [measure]);
  const resizeObserver = useResizeObserver({
    callback: handleResize
  });
  const handleNodeChange = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(element => {
    const node = getMeasurableNode(element);
    resizeObserver == null ? void 0 : resizeObserver.disconnect();

    if (node) {
      resizeObserver == null ? void 0 : resizeObserver.observe(node);
    }

    setRect(node ? measure(node) : null);
  }, [measure, resizeObserver]);
  const [nodeRef, setRef] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useNodeRef)(handleNodeChange);
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({
    nodeRef,
    rect,
    setRef
  }), [rect, nodeRef, setRef]);
}

const defaultSensors = [{
  sensor: PointerSensor,
  options: {}
}, {
  sensor: KeyboardSensor,
  options: {}
}];
const defaultData = {
  current: {}
};
const defaultMeasuringConfiguration = {
  draggable: {
    measure: getTransformAgnosticClientRect
  },
  droppable: {
    measure: getTransformAgnosticClientRect,
    strategy: MeasuringStrategy.WhileDragging,
    frequency: MeasuringFrequency.Optimized
  },
  dragOverlay: {
    measure: getClientRect
  }
};

class DroppableContainersMap extends Map {
  get(id) {
    var _super$get;

    return id != null ? (_super$get = super.get(id)) != null ? _super$get : undefined : undefined;
  }

  toArray() {
    return Array.from(this.values());
  }

  getEnabled() {
    return this.toArray().filter(_ref => {
      let {
        disabled
      } = _ref;
      return !disabled;
    });
  }

  getNodeFor(id) {
    var _this$get$node$curren, _this$get;

    return (_this$get$node$curren = (_this$get = this.get(id)) == null ? void 0 : _this$get.node.current) != null ? _this$get$node$curren : undefined;
  }

}

const defaultPublicContext = {
  activatorEvent: null,
  active: null,
  activeNode: null,
  activeNodeRect: null,
  collisions: null,
  containerNodeRect: null,
  draggableNodes: /*#__PURE__*/new Map(),
  droppableRects: /*#__PURE__*/new Map(),
  droppableContainers: /*#__PURE__*/new DroppableContainersMap(),
  over: null,
  dragOverlay: {
    nodeRef: {
      current: null
    },
    rect: null,
    setRef: noop
  },
  scrollableAncestors: [],
  scrollableAncestorRects: [],
  measuringConfiguration: defaultMeasuringConfiguration,
  measureDroppableContainers: noop,
  windowRect: null,
  measuringScheduled: false
};
const defaultInternalContext = {
  activatorEvent: null,
  activators: [],
  active: null,
  activeNodeRect: null,
  ariaDescribedById: {
    draggable: ''
  },
  dispatch: noop,
  draggableNodes: /*#__PURE__*/new Map(),
  over: null,
  measureDroppableContainers: noop
};
const InternalContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(defaultInternalContext);
const PublicContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(defaultPublicContext);

function getInitialState() {
  return {
    draggable: {
      active: null,
      initialCoordinates: {
        x: 0,
        y: 0
      },
      nodes: new Map(),
      translate: {
        x: 0,
        y: 0
      }
    },
    droppable: {
      containers: new DroppableContainersMap()
    }
  };
}
function reducer(state, action) {
  switch (action.type) {
    case Action.DragStart:
      return { ...state,
        draggable: { ...state.draggable,
          initialCoordinates: action.initialCoordinates,
          active: action.active
        }
      };

    case Action.DragMove:
      if (state.draggable.active == null) {
        return state;
      }

      return { ...state,
        draggable: { ...state.draggable,
          translate: {
            x: action.coordinates.x - state.draggable.initialCoordinates.x,
            y: action.coordinates.y - state.draggable.initialCoordinates.y
          }
        }
      };

    case Action.DragEnd:
    case Action.DragCancel:
      return { ...state,
        draggable: { ...state.draggable,
          active: null,
          initialCoordinates: {
            x: 0,
            y: 0
          },
          translate: {
            x: 0,
            y: 0
          }
        }
      };

    case Action.RegisterDroppable:
      {
        const {
          element
        } = action;
        const {
          id
        } = element;
        const containers = new DroppableContainersMap(state.droppable.containers);
        containers.set(id, element);
        return { ...state,
          droppable: { ...state.droppable,
            containers
          }
        };
      }

    case Action.SetDroppableDisabled:
      {
        const {
          id,
          key,
          disabled
        } = action;
        const element = state.droppable.containers.get(id);

        if (!element || key !== element.key) {
          return state;
        }

        const containers = new DroppableContainersMap(state.droppable.containers);
        containers.set(id, { ...element,
          disabled
        });
        return { ...state,
          droppable: { ...state.droppable,
            containers
          }
        };
      }

    case Action.UnregisterDroppable:
      {
        const {
          id,
          key
        } = action;
        const element = state.droppable.containers.get(id);

        if (!element || key !== element.key) {
          return state;
        }

        const containers = new DroppableContainersMap(state.droppable.containers);
        containers.delete(id);
        return { ...state,
          droppable: { ...state.droppable,
            containers
          }
        };
      }

    default:
      {
        return state;
      }
  }
}

function RestoreFocus(_ref) {
  let {
    disabled
  } = _ref;
  const {
    active,
    activatorEvent,
    draggableNodes
  } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(InternalContext);
  const previousActivatorEvent = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.usePrevious)(activatorEvent);
  const previousActiveId = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.usePrevious)(active == null ? void 0 : active.id); // Restore keyboard focus on the activator node

  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (disabled) {
      return;
    }

    if (!activatorEvent && previousActivatorEvent && previousActiveId != null) {
      if (!(0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isKeyboardEvent)(previousActivatorEvent)) {
        return;
      }

      if (document.activeElement === previousActivatorEvent.target) {
        // No need to restore focus
        return;
      }

      const draggableNode = draggableNodes.get(previousActiveId);

      if (!draggableNode) {
        return;
      }

      const {
        activatorNode,
        node
      } = draggableNode;

      if (!activatorNode.current && !node.current) {
        return;
      }

      requestAnimationFrame(() => {
        for (const element of [activatorNode.current, node.current]) {
          if (!element) {
            continue;
          }

          const focusableNode = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.findFirstFocusableNode)(element);

          if (focusableNode) {
            focusableNode.focus();
            break;
          }
        }
      });
    }
  }, [activatorEvent, disabled, draggableNodes, previousActiveId, previousActivatorEvent]);
  return null;
}

function applyModifiers(modifiers, _ref) {
  let {
    transform,
    ...args
  } = _ref;
  return modifiers != null && modifiers.length ? modifiers.reduce((accumulator, modifier) => {
    return modifier({
      transform: accumulator,
      ...args
    });
  }, transform) : transform;
}

function useMeasuringConfiguration(config) {
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({
    draggable: { ...defaultMeasuringConfiguration.draggable,
      ...(config == null ? void 0 : config.draggable)
    },
    droppable: { ...defaultMeasuringConfiguration.droppable,
      ...(config == null ? void 0 : config.droppable)
    },
    dragOverlay: { ...defaultMeasuringConfiguration.dragOverlay,
      ...(config == null ? void 0 : config.dragOverlay)
    }
  }), // eslint-disable-next-line react-hooks/exhaustive-deps
  [config == null ? void 0 : config.draggable, config == null ? void 0 : config.droppable, config == null ? void 0 : config.dragOverlay]);
}

function useLayoutShiftScrollCompensation(_ref) {
  let {
    activeNode,
    measure,
    initialRect,
    config = true
  } = _ref;
  const initialized = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);
  const {
    x,
    y
  } = typeof config === 'boolean' ? {
    x: config,
    y: config
  } : config;
  (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => {
    const disabled = !x && !y;

    if (disabled || !activeNode) {
      initialized.current = false;
      return;
    }

    if (initialized.current || !initialRect) {
      // Return early if layout shift scroll compensation was already attempted
      // or if there is no initialRect to compare to.
      return;
    } // Get the most up to date node ref for the active draggable


    const node = activeNode == null ? void 0 : activeNode.node.current;

    if (!node || node.isConnected === false) {
      // Return early if there is no attached node ref or if the node is
      // disconnected from the document.
      return;
    }

    const rect = measure(node);
    const rectDelta = getRectDelta(rect, initialRect);

    if (!x) {
      rectDelta.x = 0;
    }

    if (!y) {
      rectDelta.y = 0;
    } // Only perform layout shift scroll compensation once


    initialized.current = true;

    if (Math.abs(rectDelta.x) > 0 || Math.abs(rectDelta.y) > 0) {
      const firstScrollableAncestor = getFirstScrollableAncestor(node);

      if (firstScrollableAncestor) {
        firstScrollableAncestor.scrollBy({
          top: rectDelta.y,
          left: rectDelta.x
        });
      }
    }
  }, [activeNode, x, y, initialRect, measure]);
}

const ActiveDraggableContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({ ...defaultCoordinates,
  scaleX: 1,
  scaleY: 1
});
var Status;

(function (Status) {
  Status[Status["Uninitialized"] = 0] = "Uninitialized";
  Status[Status["Initializing"] = 1] = "Initializing";
  Status[Status["Initialized"] = 2] = "Initialized";
})(Status || (Status = {}));

const DndContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(function DndContext(_ref) {
  var _sensorContext$curren, _dragOverlay$nodeRef$, _dragOverlay$rect, _over$rect;

  let {
    id,
    accessibility,
    autoScroll = true,
    children,
    sensors = defaultSensors,
    collisionDetection = rectIntersection,
    measuring,
    modifiers,
    ...props
  } = _ref;
  const store = (0,react__WEBPACK_IMPORTED_MODULE_0__.useReducer)(reducer, undefined, getInitialState);
  const [state, dispatch] = store;
  const [dispatchMonitorEvent, registerMonitorListener] = useDndMonitorProvider();
  const [status, setStatus] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(Status.Uninitialized);
  const isInitialized = status === Status.Initialized;
  const {
    draggable: {
      active: activeId,
      nodes: draggableNodes,
      translate
    },
    droppable: {
      containers: droppableContainers
    }
  } = state;
  const node = activeId != null ? draggableNodes.get(activeId) : null;
  const activeRects = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({
    initial: null,
    translated: null
  });
  const active = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
    var _node$data;

    return activeId != null ? {
      id: activeId,
      // It's possible for the active node to unmount while dragging
      data: (_node$data = node == null ? void 0 : node.data) != null ? _node$data : defaultData,
      rect: activeRects
    } : null;
  }, [activeId, node]);
  const activeRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
  const [activeSensor, setActiveSensor] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
  const [activatorEvent, setActivatorEvent] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
  const latestProps = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(props, Object.values(props));
  const draggableDescribedById = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useUniqueId)("DndDescribedBy", id);
  const enabledDroppableContainers = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => droppableContainers.getEnabled(), [droppableContainers]);
  const measuringConfiguration = useMeasuringConfiguration(measuring);
  const {
    droppableRects,
    measureDroppableContainers,
    measuringScheduled
  } = useDroppableMeasuring(enabledDroppableContainers, {
    dragging: isInitialized,
    dependencies: [translate.x, translate.y],
    config: measuringConfiguration.droppable
  });
  const activeNode = useCachedNode(draggableNodes, activeId);
  const activationCoordinates = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => activatorEvent ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getEventCoordinates)(activatorEvent) : null, [activatorEvent]);
  const autoScrollOptions = getAutoScrollerOptions();
  const initialActiveNodeRect = useInitialRect(activeNode, measuringConfiguration.draggable.measure);
  useLayoutShiftScrollCompensation({
    activeNode: activeId != null ? draggableNodes.get(activeId) : null,
    config: autoScrollOptions.layoutShiftCompensation,
    initialRect: initialActiveNodeRect,
    measure: measuringConfiguration.draggable.measure
  });
  const activeNodeRect = useRect(activeNode, measuringConfiguration.draggable.measure, initialActiveNodeRect);
  const containerNodeRect = useRect(activeNode ? activeNode.parentElement : null);
  const sensorContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({
    activatorEvent: null,
    active: null,
    activeNode,
    collisionRect: null,
    collisions: null,
    droppableRects,
    draggableNodes,
    draggingNode: null,
    draggingNodeRect: null,
    droppableContainers,
    over: null,
    scrollableAncestors: [],
    scrollAdjustedTranslate: null
  });
  const overNode = droppableContainers.getNodeFor((_sensorContext$curren = sensorContext.current.over) == null ? void 0 : _sensorContext$curren.id);
  const dragOverlay = useDragOverlayMeasuring({
    measure: measuringConfiguration.dragOverlay.measure
  }); // Use the rect of the drag overlay if it is mounted

  const draggingNode = (_dragOverlay$nodeRef$ = dragOverlay.nodeRef.current) != null ? _dragOverlay$nodeRef$ : activeNode;
  const draggingNodeRect = isInitialized ? (_dragOverlay$rect = dragOverlay.rect) != null ? _dragOverlay$rect : activeNodeRect : null;
  const usesDragOverlay = Boolean(dragOverlay.nodeRef.current && dragOverlay.rect); // The delta between the previous and new position of the draggable node
  // is only relevant when there is no drag overlay

  const nodeRectDelta = useRectDelta(usesDragOverlay ? null : activeNodeRect); // Get the window rect of the dragging node

  const windowRect = useWindowRect(draggingNode ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(draggingNode) : null); // Get scrollable ancestors of the dragging node

  const scrollableAncestors = useScrollableAncestors(isInitialized ? overNode != null ? overNode : activeNode : null);
  const scrollableAncestorRects = useRects(scrollableAncestors); // Apply modifiers

  const modifiedTranslate = applyModifiers(modifiers, {
    transform: {
      x: translate.x - nodeRectDelta.x,
      y: translate.y - nodeRectDelta.y,
      scaleX: 1,
      scaleY: 1
    },
    activatorEvent,
    active,
    activeNodeRect,
    containerNodeRect,
    draggingNodeRect,
    over: sensorContext.current.over,
    overlayNodeRect: dragOverlay.rect,
    scrollableAncestors,
    scrollableAncestorRects,
    windowRect
  });
  const pointerCoordinates = activationCoordinates ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(activationCoordinates, translate) : null;
  const scrollOffsets = useScrollOffsets(scrollableAncestors); // Represents the scroll delta since dragging was initiated

  const scrollAdjustment = useScrollOffsetsDelta(scrollOffsets); // Represents the scroll delta since the last time the active node rect was measured

  const activeNodeScrollDelta = useScrollOffsetsDelta(scrollOffsets, [activeNodeRect]);
  const scrollAdjustedTranslate = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(modifiedTranslate, scrollAdjustment);
  const collisionRect = draggingNodeRect ? getAdjustedRect(draggingNodeRect, modifiedTranslate) : null;
  const collisions = active && collisionRect ? collisionDetection({
    active,
    collisionRect,
    droppableRects,
    droppableContainers: enabledDroppableContainers,
    pointerCoordinates
  }) : null;
  const overId = getFirstCollision(collisions, 'id');
  const [over, setOver] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); // When there is no drag overlay used, we need to account for the
  // window scroll delta

  const appliedTranslate = usesDragOverlay ? modifiedTranslate : (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(modifiedTranslate, activeNodeScrollDelta);
  const transform = adjustScale(appliedTranslate, (_over$rect = over == null ? void 0 : over.rect) != null ? _over$rect : null, activeNodeRect);
  const activeSensorRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
  const instantiateSensor = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((event, _ref2) => {
    let {
      sensor: Sensor,
      options
    } = _ref2;

    if (activeRef.current == null) {
      return;
    }

    const activeNode = draggableNodes.get(activeRef.current);

    if (!activeNode) {
      return;
    }

    const activatorEvent = event.nativeEvent;
    const sensorInstance = new Sensor({
      active: activeRef.current,
      activeNode,
      event: activatorEvent,
      options,
      // Sensors need to be instantiated with refs for arguments that change over time
      // otherwise they are frozen in time with the stale arguments
      context: sensorContext,

      onAbort(id) {
        const draggableNode = draggableNodes.get(id);

        if (!draggableNode) {
          return;
        }

        const {
          onDragAbort
        } = latestProps.current;
        const event = {
          id
        };
        onDragAbort == null ? void 0 : onDragAbort(event);
        dispatchMonitorEvent({
          type: 'onDragAbort',
          event
        });
      },

      onPending(id, constraint, initialCoordinates, offset) {
        const draggableNode = draggableNodes.get(id);

        if (!draggableNode) {
          return;
        }

        const {
          onDragPending
        } = latestProps.current;
        const event = {
          id,
          constraint,
          initialCoordinates,
          offset
        };
        onDragPending == null ? void 0 : onDragPending(event);
        dispatchMonitorEvent({
          type: 'onDragPending',
          event
        });
      },

      onStart(initialCoordinates) {
        const id = activeRef.current;

        if (id == null) {
          return;
        }

        const draggableNode = draggableNodes.get(id);

        if (!draggableNode) {
          return;
        }

        const {
          onDragStart
        } = latestProps.current;
        const event = {
          activatorEvent,
          active: {
            id,
            data: draggableNode.data,
            rect: activeRects
          }
        };
        (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.unstable_batchedUpdates)(() => {
          onDragStart == null ? void 0 : onDragStart(event);
          setStatus(Status.Initializing);
          dispatch({
            type: Action.DragStart,
            initialCoordinates,
            active: id
          });
          dispatchMonitorEvent({
            type: 'onDragStart',
            event
          });
          setActiveSensor(activeSensorRef.current);
          setActivatorEvent(activatorEvent);
        });
      },

      onMove(coordinates) {
        dispatch({
          type: Action.DragMove,
          coordinates
        });
      },

      onEnd: createHandler(Action.DragEnd),
      onCancel: createHandler(Action.DragCancel)
    });
    activeSensorRef.current = sensorInstance;

    function createHandler(type) {
      return async function handler() {
        const {
          active,
          collisions,
          over,
          scrollAdjustedTranslate
        } = sensorContext.current;
        let event = null;

        if (active && scrollAdjustedTranslate) {
          const {
            cancelDrop
          } = latestProps.current;
          event = {
            activatorEvent,
            active: active,
            collisions,
            delta: scrollAdjustedTranslate,
            over
          };

          if (type === Action.DragEnd && typeof cancelDrop === 'function') {
            const shouldCancel = await Promise.resolve(cancelDrop(event));

            if (shouldCancel) {
              type = Action.DragCancel;
            }
          }
        }

        activeRef.current = null;
        (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.unstable_batchedUpdates)(() => {
          dispatch({
            type
          });
          setStatus(Status.Uninitialized);
          setOver(null);
          setActiveSensor(null);
          setActivatorEvent(null);
          activeSensorRef.current = null;
          const eventName = type === Action.DragEnd ? 'onDragEnd' : 'onDragCancel';

          if (event) {
            const handler = latestProps.current[eventName];
            handler == null ? void 0 : handler(event);
            dispatchMonitorEvent({
              type: eventName,
              event
            });
          }
        });
      };
    }
  }, // eslint-disable-next-line react-hooks/exhaustive-deps
  [draggableNodes]);
  const bindActivatorToSensorInstantiator = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((handler, sensor) => {
    return (event, active) => {
      const nativeEvent = event.nativeEvent;
      const activeDraggableNode = draggableNodes.get(active);

      if ( // Another sensor is already instantiating
      activeRef.current !== null || // No active draggable
      !activeDraggableNode || // Event has already been captured
      nativeEvent.dndKit || nativeEvent.defaultPrevented) {
        return;
      }

      const activationContext = {
        active: activeDraggableNode
      };
      const shouldActivate = handler(event, sensor.options, activationContext);

      if (shouldActivate === true) {
        nativeEvent.dndKit = {
          capturedBy: sensor.sensor
        };
        activeRef.current = active;
        instantiateSensor(event, sensor);
      }
    };
  }, [draggableNodes, instantiateSensor]);
  const activators = useCombineActivators(sensors, bindActivatorToSensorInstantiator);
  useSensorSetup(sensors);
  (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => {
    if (activeNodeRect && status === Status.Initializing) {
      setStatus(Status.Initialized);
    }
  }, [activeNodeRect, status]);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    const {
      onDragMove
    } = latestProps.current;
    const {
      active,
      activatorEvent,
      collisions,
      over
    } = sensorContext.current;

    if (!active || !activatorEvent) {
      return;
    }

    const event = {
      active,
      activatorEvent,
      collisions,
      delta: {
        x: scrollAdjustedTranslate.x,
        y: scrollAdjustedTranslate.y
      },
      over
    };
    (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.unstable_batchedUpdates)(() => {
      onDragMove == null ? void 0 : onDragMove(event);
      dispatchMonitorEvent({
        type: 'onDragMove',
        event
      });
    });
  }, // eslint-disable-next-line react-hooks/exhaustive-deps
  [scrollAdjustedTranslate.x, scrollAdjustedTranslate.y]);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    const {
      active,
      activatorEvent,
      collisions,
      droppableContainers,
      scrollAdjustedTranslate
    } = sensorContext.current;

    if (!active || activeRef.current == null || !activatorEvent || !scrollAdjustedTranslate) {
      return;
    }

    const {
      onDragOver
    } = latestProps.current;
    const overContainer = droppableContainers.get(overId);
    const over = overContainer && overContainer.rect.current ? {
      id: overContainer.id,
      rect: overContainer.rect.current,
      data: overContainer.data,
      disabled: overContainer.disabled
    } : null;
    const event = {
      active,
      activatorEvent,
      collisions,
      delta: {
        x: scrollAdjustedTranslate.x,
        y: scrollAdjustedTranslate.y
      },
      over
    };
    (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.unstable_batchedUpdates)(() => {
      setOver(over);
      onDragOver == null ? void 0 : onDragOver(event);
      dispatchMonitorEvent({
        type: 'onDragOver',
        event
      });
    });
  }, // eslint-disable-next-line react-hooks/exhaustive-deps
  [overId]);
  (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => {
    sensorContext.current = {
      activatorEvent,
      active,
      activeNode,
      collisionRect,
      collisions,
      droppableRects,
      draggableNodes,
      draggingNode,
      draggingNodeRect,
      droppableContainers,
      over,
      scrollableAncestors,
      scrollAdjustedTranslate
    };
    activeRects.current = {
      initial: draggingNodeRect,
      translated: collisionRect
    };
  }, [active, activeNode, collisions, collisionRect, draggableNodes, draggingNode, draggingNodeRect, droppableRects, droppableContainers, over, scrollableAncestors, scrollAdjustedTranslate]);
  useAutoScroller({ ...autoScrollOptions,
    delta: translate,
    draggingRect: collisionRect,
    pointerCoordinates,
    scrollableAncestors,
    scrollableAncestorRects
  });
  const publicContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
    const context = {
      active,
      activeNode,
      activeNodeRect,
      activatorEvent,
      collisions,
      containerNodeRect,
      dragOverlay,
      draggableNodes,
      droppableContainers,
      droppableRects,
      over,
      measureDroppableContainers,
      scrollableAncestors,
      scrollableAncestorRects,
      measuringConfiguration,
      measuringScheduled,
      windowRect
    };
    return context;
  }, [active, activeNode, activeNodeRect, activatorEvent, collisions, containerNodeRect, dragOverlay, draggableNodes, droppableContainers, droppableRects, over, measureDroppableContainers, scrollableAncestors, scrollableAncestorRects, measuringConfiguration, measuringScheduled, windowRect]);
  const internalContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
    const context = {
      activatorEvent,
      activators,
      active,
      activeNodeRect,
      ariaDescribedById: {
        draggable: draggableDescribedById
      },
      dispatch,
      draggableNodes,
      over,
      measureDroppableContainers
    };
    return context;
  }, [activatorEvent, activators, active, activeNodeRect, dispatch, draggableDescribedById, draggableNodes, over, measureDroppableContainers]);
  return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(DndMonitorContext.Provider, {
    value: registerMonitorListener
  }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(InternalContext.Provider, {
    value: internalContext
  }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(PublicContext.Provider, {
    value: publicContext
  }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ActiveDraggableContext.Provider, {
    value: transform
  }, children)), react__WEBPACK_IMPORTED_MODULE_0___default().createElement(RestoreFocus, {
    disabled: (accessibility == null ? void 0 : accessibility.restoreFocus) === false
  })), react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Accessibility, { ...accessibility,
    hiddenTextDescribedById: draggableDescribedById
  }));

  function getAutoScrollerOptions() {
    const activeSensorDisablesAutoscroll = (activeSensor == null ? void 0 : activeSensor.autoScrollEnabled) === false;
    const autoScrollGloballyDisabled = typeof autoScroll === 'object' ? autoScroll.enabled === false : autoScroll === false;
    const enabled = isInitialized && !activeSensorDisablesAutoscroll && !autoScrollGloballyDisabled;

    if (typeof autoScroll === 'object') {
      return { ...autoScroll,
        enabled
      };
    }

    return {
      enabled
    };
  }
});

const NullContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);
const defaultRole = 'button';
const ID_PREFIX = 'Draggable';
function useDraggable(_ref) {
  let {
    id,
    data,
    disabled = false,
    attributes
  } = _ref;
  const key = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useUniqueId)(ID_PREFIX);
  const {
    activators,
    activatorEvent,
    active,
    activeNodeRect,
    ariaDescribedById,
    draggableNodes,
    over
  } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(InternalContext);
  const {
    role = defaultRole,
    roleDescription = 'draggable',
    tabIndex = 0
  } = attributes != null ? attributes : {};
  const isDragging = (active == null ? void 0 : active.id) === id;
  const transform = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(isDragging ? ActiveDraggableContext : NullContext);
  const [node, setNodeRef] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useNodeRef)();
  const [activatorNode, setActivatorNodeRef] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useNodeRef)();
  const listeners = useSyntheticListeners(activators, id);
  const dataRef = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(data);
  (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => {
    draggableNodes.set(id, {
      id,
      key,
      node,
      activatorNode,
      data: dataRef
    });
    return () => {
      const node = draggableNodes.get(id);

      if (node && node.key === key) {
        draggableNodes.delete(id);
      }
    };
  }, // eslint-disable-next-line react-hooks/exhaustive-deps
  [draggableNodes, id]);
  const memoizedAttributes = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({
    role,
    tabIndex,
    'aria-disabled': disabled,
    'aria-pressed': isDragging && role === defaultRole ? true : undefined,
    'aria-roledescription': roleDescription,
    'aria-describedby': ariaDescribedById.draggable
  }), [disabled, role, tabIndex, isDragging, roleDescription, ariaDescribedById.draggable]);
  return {
    active,
    activatorEvent,
    activeNodeRect,
    attributes: memoizedAttributes,
    isDragging,
    listeners: disabled ? undefined : listeners,
    node,
    over,
    setNodeRef,
    setActivatorNodeRef,
    transform
  };
}

function useDndContext() {
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(PublicContext);
}

const ID_PREFIX$1 = 'Droppable';
const defaultResizeObserverConfig = {
  timeout: 25
};
function useDroppable(_ref) {
  let {
    data,
    disabled = false,
    id,
    resizeObserverConfig
  } = _ref;
  const key = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useUniqueId)(ID_PREFIX$1);
  const {
    active,
    dispatch,
    over,
    measureDroppableContainers
  } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(InternalContext);
  const previous = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({
    disabled
  });
  const resizeObserverConnected = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);
  const rect = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
  const callbackId = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
  const {
    disabled: resizeObserverDisabled,
    updateMeasurementsFor,
    timeout: resizeObserverTimeout
  } = { ...defaultResizeObserverConfig,
    ...resizeObserverConfig
  };
  const ids = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(updateMeasurementsFor != null ? updateMeasurementsFor : id);
  const handleResize = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    if (!resizeObserverConnected.current) {
      // ResizeObserver invokes the `handleResize` callback as soon as `observe` is called,
      // assuming the element is rendered and displayed.
      resizeObserverConnected.current = true;
      return;
    }

    if (callbackId.current != null) {
      clearTimeout(callbackId.current);
    }

    callbackId.current = setTimeout(() => {
      measureDroppableContainers(Array.isArray(ids.current) ? ids.current : [ids.current]);
      callbackId.current = null;
    }, resizeObserverTimeout);
  }, //eslint-disable-next-line react-hooks/exhaustive-deps
  [resizeObserverTimeout]);
  const resizeObserver = useResizeObserver({
    callback: handleResize,
    disabled: resizeObserverDisabled || !active
  });
  const handleNodeChange = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((newElement, previousElement) => {
    if (!resizeObserver) {
      return;
    }

    if (previousElement) {
      resizeObserver.unobserve(previousElement);
      resizeObserverConnected.current = false;
    }

    if (newElement) {
      resizeObserver.observe(newElement);
    }
  }, [resizeObserver]);
  const [nodeRef, setNodeRef] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useNodeRef)(handleNodeChange);
  const dataRef = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(data);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (!resizeObserver || !nodeRef.current) {
      return;
    }

    resizeObserver.disconnect();
    resizeObserverConnected.current = false;
    resizeObserver.observe(nodeRef.current);
  }, [nodeRef, resizeObserver]);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    dispatch({
      type: Action.RegisterDroppable,
      element: {
        id,
        key,
        disabled,
        node: nodeRef,
        rect,
        data: dataRef
      }
    });
    return () => dispatch({
      type: Action.UnregisterDroppable,
      key,
      id
    });
  }, // eslint-disable-next-line react-hooks/exhaustive-deps
  [id]);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (disabled !== previous.current.disabled) {
      dispatch({
        type: Action.SetDroppableDisabled,
        id,
        key,
        disabled
      });
      previous.current.disabled = disabled;
    }
  }, [id, key, disabled, dispatch]);
  return {
    active,
    rect,
    isOver: (over == null ? void 0 : over.id) === id,
    node: nodeRef,
    over,
    setNodeRef
  };
}

function AnimationManager(_ref) {
  let {
    animation,
    children
  } = _ref;
  const [clonedChildren, setClonedChildren] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
  const [element, setElement] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
  const previousChildren = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.usePrevious)(children);

  if (!children && !clonedChildren && previousChildren) {
    setClonedChildren(previousChildren);
  }

  (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => {
    if (!element) {
      return;
    }

    const key = clonedChildren == null ? void 0 : clonedChildren.key;
    const id = clonedChildren == null ? void 0 : clonedChildren.props.id;

    if (key == null || id == null) {
      setClonedChildren(null);
      return;
    }

    Promise.resolve(animation(id, element)).then(() => {
      setClonedChildren(null);
    });
  }, [animation, clonedChildren, element]);
  return react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, children, clonedChildren ? (0,react__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(clonedChildren, {
    ref: setElement
  }) : null);
}

const defaultTransform = {
  x: 0,
  y: 0,
  scaleX: 1,
  scaleY: 1
};
function NullifiedContextProvider(_ref) {
  let {
    children
  } = _ref;
  return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(InternalContext.Provider, {
    value: defaultInternalContext
  }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ActiveDraggableContext.Provider, {
    value: defaultTransform
  }, children));
}

const baseStyles = {
  position: 'fixed',
  touchAction: 'none'
};

const defaultTransition = activatorEvent => {
  const isKeyboardActivator = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isKeyboardEvent)(activatorEvent);
  return isKeyboardActivator ? 'transform 250ms ease' : undefined;
};

const PositionedOverlay = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)((_ref, ref) => {
  let {
    as,
    activatorEvent,
    adjustScale,
    children,
    className,
    rect,
    style,
    transform,
    transition = defaultTransition
  } = _ref;

  if (!rect) {
    return null;
  }

  const scaleAdjustedTransform = adjustScale ? transform : { ...transform,
    scaleX: 1,
    scaleY: 1
  };
  const styles = { ...baseStyles,
    width: rect.width,
    height: rect.height,
    top: rect.top,
    left: rect.left,
    transform: _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.CSS.Transform.toString(scaleAdjustedTransform),
    transformOrigin: adjustScale && activatorEvent ? getRelativeTransformOrigin(activatorEvent, rect) : undefined,
    transition: typeof transition === 'function' ? transition(activatorEvent) : transition,
    ...style
  };
  return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(as, {
    className,
    style: styles,
    ref
  }, children);
});

const defaultDropAnimationSideEffects = options => _ref => {
  let {
    active,
    dragOverlay
  } = _ref;
  const originalStyles = {};
  const {
    styles,
    className
  } = options;

  if (styles != null && styles.active) {
    for (const [key, value] of Object.entries(styles.active)) {
      if (value === undefined) {
        continue;
      }

      originalStyles[key] = active.node.style.getPropertyValue(key);
      active.node.style.setProperty(key, value);
    }
  }

  if (styles != null && styles.dragOverlay) {
    for (const [key, value] of Object.entries(styles.dragOverlay)) {
      if (value === undefined) {
        continue;
      }

      dragOverlay.node.style.setProperty(key, value);
    }
  }

  if (className != null && className.active) {
    active.node.classList.add(className.active);
  }

  if (className != null && className.dragOverlay) {
    dragOverlay.node.classList.add(className.dragOverlay);
  }

  return function cleanup() {
    for (const [key, value] of Object.entries(originalStyles)) {
      active.node.style.setProperty(key, value);
    }

    if (className != null && className.active) {
      active.node.classList.remove(className.active);
    }
  };
};

const defaultKeyframeResolver = _ref2 => {
  let {
    transform: {
      initial,
      final
    }
  } = _ref2;
  return [{
    transform: _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.CSS.Transform.toString(initial)
  }, {
    transform: _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.CSS.Transform.toString(final)
  }];
};

const defaultDropAnimationConfiguration = {
  duration: 250,
  easing: 'ease',
  keyframes: defaultKeyframeResolver,
  sideEffects: /*#__PURE__*/defaultDropAnimationSideEffects({
    styles: {
      active: {
        opacity: '0'
      }
    }
  })
};
function useDropAnimation(_ref3) {
  let {
    config,
    draggableNodes,
    droppableContainers,
    measuringConfiguration
  } = _ref3;
  return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useEvent)((id, node) => {
    if (config === null) {
      return;
    }

    const activeDraggable = draggableNodes.get(id);

    if (!activeDraggable) {
      return;
    }

    const activeNode = activeDraggable.node.current;

    if (!activeNode) {
      return;
    }

    const measurableNode = getMeasurableNode(node);

    if (!measurableNode) {
      return;
    }

    const {
      transform
    } = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(node).getComputedStyle(node);
    const parsedTransform = parseTransform(transform);

    if (!parsedTransform) {
      return;
    }

    const animation = typeof config === 'function' ? config : createDefaultDropAnimation(config);
    scrollIntoViewIfNeeded(activeNode, measuringConfiguration.draggable.measure);
    return animation({
      active: {
        id,
        data: activeDraggable.data,
        node: activeNode,
        rect: measuringConfiguration.draggable.measure(activeNode)
      },
      draggableNodes,
      dragOverlay: {
        node,
        rect: measuringConfiguration.dragOverlay.measure(measurableNode)
      },
      droppableContainers,
      measuringConfiguration,
      transform: parsedTransform
    });
  });
}

function createDefaultDropAnimation(options) {
  const {
    duration,
    easing,
    sideEffects,
    keyframes
  } = { ...defaultDropAnimationConfiguration,
    ...options
  };
  return _ref4 => {
    let {
      active,
      dragOverlay,
      transform,
      ...rest
    } = _ref4;

    if (!duration) {
      // Do not animate if animation duration is zero.
      return;
    }

    const delta = {
      x: dragOverlay.rect.left - active.rect.left,
      y: dragOverlay.rect.top - active.rect.top
    };
    const scale = {
      scaleX: transform.scaleX !== 1 ? active.rect.width * transform.scaleX / dragOverlay.rect.width : 1,
      scaleY: transform.scaleY !== 1 ? active.rect.height * transform.scaleY / dragOverlay.rect.height : 1
    };
    const finalTransform = {
      x: transform.x - delta.x,
      y: transform.y - delta.y,
      ...scale
    };
    const animationKeyframes = keyframes({ ...rest,
      active,
      dragOverlay,
      transform: {
        initial: transform,
        final: finalTransform
      }
    });
    const [firstKeyframe] = animationKeyframes;
    const lastKeyframe = animationKeyframes[animationKeyframes.length - 1];

    if (JSON.stringify(firstKeyframe) === JSON.stringify(lastKeyframe)) {
      // The start and end keyframes are the same, infer that there is no animation needed.
      return;
    }

    const cleanup = sideEffects == null ? void 0 : sideEffects({
      active,
      dragOverlay,
      ...rest
    });
    const animation = dragOverlay.node.animate(animationKeyframes, {
      duration,
      easing,
      fill: 'forwards'
    });
    return new Promise(resolve => {
      animation.onfinish = () => {
        cleanup == null ? void 0 : cleanup();
        resolve();
      };
    });
  };
}

let key = 0;
function useKey(id) {
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
    if (id == null) {
      return;
    }

    key++;
    return key;
  }, [id]);
}

const DragOverlay = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().memo(_ref => {
  let {
    adjustScale = false,
    children,
    dropAnimation: dropAnimationConfig,
    style,
    transition,
    modifiers,
    wrapperElement = 'div',
    className,
    zIndex = 999
  } = _ref;
  const {
    activatorEvent,
    active,
    activeNodeRect,
    containerNodeRect,
    draggableNodes,
    droppableContainers,
    dragOverlay,
    over,
    measuringConfiguration,
    scrollableAncestors,
    scrollableAncestorRects,
    windowRect
  } = useDndContext();
  const transform = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(ActiveDraggableContext);
  const key = useKey(active == null ? void 0 : active.id);
  const modifiedTransform = applyModifiers(modifiers, {
    activatorEvent,
    active,
    activeNodeRect,
    containerNodeRect,
    draggingNodeRect: dragOverlay.rect,
    over,
    overlayNodeRect: dragOverlay.rect,
    scrollableAncestors,
    scrollableAncestorRects,
    transform,
    windowRect
  });
  const initialRect = useInitialValue(activeNodeRect);
  const dropAnimation = useDropAnimation({
    config: dropAnimationConfig,
    draggableNodes,
    droppableContainers,
    measuringConfiguration
  }); // We need to wait for the active node to be measured before connecting the drag overlay ref
  // otherwise collisions can be computed against a mispositioned drag overlay

  const ref = initialRect ? dragOverlay.setRef : undefined;
  return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(NullifiedContextProvider, null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AnimationManager, {
    animation: dropAnimation
  }, active && key ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement(PositionedOverlay, {
    key: key,
    id: active.id,
    ref: ref,
    as: wrapperElement,
    activatorEvent: activatorEvent,
    adjustScale: adjustScale,
    className: className,
    transition: transition,
    rect: initialRect,
    style: {
      zIndex,
      ...style
    },
    transform: modifiedTransform
  }, children) : null));
});


//# sourceMappingURL=core.esm.js.map


/***/ }),

/***/ "./node_modules/@dnd-kit/sortable/dist/sortable.esm.js":
/*!*************************************************************!*\
  !*** ./node_modules/@dnd-kit/sortable/dist/sortable.esm.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   SortableContext: () => (/* binding */ SortableContext),
/* harmony export */   arrayMove: () => (/* binding */ arrayMove),
/* harmony export */   arraySwap: () => (/* binding */ arraySwap),
/* harmony export */   defaultAnimateLayoutChanges: () => (/* binding */ defaultAnimateLayoutChanges),
/* harmony export */   defaultNewIndexGetter: () => (/* binding */ defaultNewIndexGetter),
/* harmony export */   hasSortableData: () => (/* binding */ hasSortableData),
/* harmony export */   horizontalListSortingStrategy: () => (/* binding */ horizontalListSortingStrategy),
/* harmony export */   rectSortingStrategy: () => (/* binding */ rectSortingStrategy),
/* harmony export */   rectSwappingStrategy: () => (/* binding */ rectSwappingStrategy),
/* harmony export */   sortableKeyboardCoordinates: () => (/* binding */ sortableKeyboardCoordinates),
/* harmony export */   useSortable: () => (/* binding */ useSortable),
/* harmony export */   verticalListSortingStrategy: () => (/* binding */ verticalListSortingStrategy)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dnd-kit/core */ "./node_modules/@dnd-kit/core/dist/core.esm.js");
/* harmony import */ var _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @dnd-kit/utilities */ "./node_modules/@dnd-kit/utilities/dist/utilities.esm.js");




/**
 * Move an array item to a different position. Returns a new array with the item moved to the new position.
 */
function arrayMove(array, from, to) {
  const newArray = array.slice();
  newArray.splice(to < 0 ? newArray.length + to : to, 0, newArray.splice(from, 1)[0]);
  return newArray;
}

/**
 * Swap an array item to a different position. Returns a new array with the item swapped to the new position.
 */
function arraySwap(array, from, to) {
  const newArray = array.slice();
  newArray[from] = array[to];
  newArray[to] = array[from];
  return newArray;
}

function getSortedRects(items, rects) {
  return items.reduce((accumulator, id, index) => {
    const rect = rects.get(id);

    if (rect) {
      accumulator[index] = rect;
    }

    return accumulator;
  }, Array(items.length));
}

function isValidIndex(index) {
  return index !== null && index >= 0;
}

function itemsEqual(a, b) {
  if (a === b) {
    return true;
  }

  if (a.length !== b.length) {
    return false;
  }

  for (let i = 0; i < a.length; i++) {
    if (a[i] !== b[i]) {
      return false;
    }
  }

  return true;
}

function normalizeDisabled(disabled) {
  if (typeof disabled === 'boolean') {
    return {
      draggable: disabled,
      droppable: disabled
    };
  }

  return disabled;
}

// To-do: We should be calculating scale transformation
const defaultScale = {
  scaleX: 1,
  scaleY: 1
};
const horizontalListSortingStrategy = _ref => {
  var _rects$activeIndex;

  let {
    rects,
    activeNodeRect: fallbackActiveRect,
    activeIndex,
    overIndex,
    index
  } = _ref;
  const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;

  if (!activeNodeRect) {
    return null;
  }

  const itemGap = getItemGap(rects, index, activeIndex);

  if (index === activeIndex) {
    const newIndexRect = rects[overIndex];

    if (!newIndexRect) {
      return null;
    }

    return {
      x: activeIndex < overIndex ? newIndexRect.left + newIndexRect.width - (activeNodeRect.left + activeNodeRect.width) : newIndexRect.left - activeNodeRect.left,
      y: 0,
      ...defaultScale
    };
  }

  if (index > activeIndex && index <= overIndex) {
    return {
      x: -activeNodeRect.width - itemGap,
      y: 0,
      ...defaultScale
    };
  }

  if (index < activeIndex && index >= overIndex) {
    return {
      x: activeNodeRect.width + itemGap,
      y: 0,
      ...defaultScale
    };
  }

  return {
    x: 0,
    y: 0,
    ...defaultScale
  };
};

function getItemGap(rects, index, activeIndex) {
  const currentRect = rects[index];
  const previousRect = rects[index - 1];
  const nextRect = rects[index + 1];

  if (!currentRect || !previousRect && !nextRect) {
    return 0;
  }

  if (activeIndex < index) {
    return previousRect ? currentRect.left - (previousRect.left + previousRect.width) : nextRect.left - (currentRect.left + currentRect.width);
  }

  return nextRect ? nextRect.left - (currentRect.left + currentRect.width) : currentRect.left - (previousRect.left + previousRect.width);
}

const rectSortingStrategy = _ref => {
  let {
    rects,
    activeIndex,
    overIndex,
    index
  } = _ref;
  const newRects = arrayMove(rects, overIndex, activeIndex);
  const oldRect = rects[index];
  const newRect = newRects[index];

  if (!newRect || !oldRect) {
    return null;
  }

  return {
    x: newRect.left - oldRect.left,
    y: newRect.top - oldRect.top,
    scaleX: newRect.width / oldRect.width,
    scaleY: newRect.height / oldRect.height
  };
};

const rectSwappingStrategy = _ref => {
  let {
    activeIndex,
    index,
    rects,
    overIndex
  } = _ref;
  let oldRect;
  let newRect;

  if (index === activeIndex) {
    oldRect = rects[index];
    newRect = rects[overIndex];
  }

  if (index === overIndex) {
    oldRect = rects[index];
    newRect = rects[activeIndex];
  }

  if (!newRect || !oldRect) {
    return null;
  }

  return {
    x: newRect.left - oldRect.left,
    y: newRect.top - oldRect.top,
    scaleX: newRect.width / oldRect.width,
    scaleY: newRect.height / oldRect.height
  };
};

// To-do: We should be calculating scale transformation
const defaultScale$1 = {
  scaleX: 1,
  scaleY: 1
};
const verticalListSortingStrategy = _ref => {
  var _rects$activeIndex;

  let {
    activeIndex,
    activeNodeRect: fallbackActiveRect,
    index,
    rects,
    overIndex
  } = _ref;
  const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;

  if (!activeNodeRect) {
    return null;
  }

  if (index === activeIndex) {
    const overIndexRect = rects[overIndex];

    if (!overIndexRect) {
      return null;
    }

    return {
      x: 0,
      y: activeIndex < overIndex ? overIndexRect.top + overIndexRect.height - (activeNodeRect.top + activeNodeRect.height) : overIndexRect.top - activeNodeRect.top,
      ...defaultScale$1
    };
  }

  const itemGap = getItemGap$1(rects, index, activeIndex);

  if (index > activeIndex && index <= overIndex) {
    return {
      x: 0,
      y: -activeNodeRect.height - itemGap,
      ...defaultScale$1
    };
  }

  if (index < activeIndex && index >= overIndex) {
    return {
      x: 0,
      y: activeNodeRect.height + itemGap,
      ...defaultScale$1
    };
  }

  return {
    x: 0,
    y: 0,
    ...defaultScale$1
  };
};

function getItemGap$1(clientRects, index, activeIndex) {
  const currentRect = clientRects[index];
  const previousRect = clientRects[index - 1];
  const nextRect = clientRects[index + 1];

  if (!currentRect) {
    return 0;
  }

  if (activeIndex < index) {
    return previousRect ? currentRect.top - (previousRect.top + previousRect.height) : nextRect ? nextRect.top - (currentRect.top + currentRect.height) : 0;
  }

  return nextRect ? nextRect.top - (currentRect.top + currentRect.height) : previousRect ? currentRect.top - (previousRect.top + previousRect.height) : 0;
}

const ID_PREFIX = 'Sortable';
const Context = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createContext({
  activeIndex: -1,
  containerId: ID_PREFIX,
  disableTransforms: false,
  items: [],
  overIndex: -1,
  useDragOverlay: false,
  sortedRects: [],
  strategy: rectSortingStrategy,
  disabled: {
    draggable: false,
    droppable: false
  }
});
function SortableContext(_ref) {
  let {
    children,
    id,
    items: userDefinedItems,
    strategy = rectSortingStrategy,
    disabled: disabledProp = false
  } = _ref;
  const {
    active,
    dragOverlay,
    droppableRects,
    over,
    measureDroppableContainers
  } = (0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.useDndContext)();
  const containerId = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useUniqueId)(ID_PREFIX, id);
  const useDragOverlay = Boolean(dragOverlay.rect !== null);
  const items = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => userDefinedItems.map(item => typeof item === 'object' && 'id' in item ? item.id : item), [userDefinedItems]);
  const isDragging = active != null;
  const activeIndex = active ? items.indexOf(active.id) : -1;
  const overIndex = over ? items.indexOf(over.id) : -1;
  const previousItemsRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(items);
  const itemsHaveChanged = !itemsEqual(items, previousItemsRef.current);
  const disableTransforms = overIndex !== -1 && activeIndex === -1 || itemsHaveChanged;
  const disabled = normalizeDisabled(disabledProp);
  (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => {
    if (itemsHaveChanged && isDragging) {
      measureDroppableContainers(items);
    }
  }, [itemsHaveChanged, items, isDragging, measureDroppableContainers]);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    previousItemsRef.current = items;
  }, [items]);
  const contextValue = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({
    activeIndex,
    containerId,
    disabled,
    disableTransforms,
    items,
    overIndex,
    useDragOverlay,
    sortedRects: getSortedRects(items, droppableRects),
    strategy
  }), // eslint-disable-next-line react-hooks/exhaustive-deps
  [activeIndex, containerId, disabled.draggable, disabled.droppable, disableTransforms, items, overIndex, droppableRects, useDragOverlay, strategy]);
  return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Context.Provider, {
    value: contextValue
  }, children);
}

const defaultNewIndexGetter = _ref => {
  let {
    id,
    items,
    activeIndex,
    overIndex
  } = _ref;
  return arrayMove(items, activeIndex, overIndex).indexOf(id);
};
const defaultAnimateLayoutChanges = _ref2 => {
  let {
    containerId,
    isSorting,
    wasDragging,
    index,
    items,
    newIndex,
    previousItems,
    previousContainerId,
    transition
  } = _ref2;

  if (!transition || !wasDragging) {
    return false;
  }

  if (previousItems !== items && index === newIndex) {
    return false;
  }

  if (isSorting) {
    return true;
  }

  return newIndex !== index && containerId === previousContainerId;
};
const defaultTransition = {
  duration: 200,
  easing: 'ease'
};
const transitionProperty = 'transform';
const disabledTransition = /*#__PURE__*/_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.CSS.Transition.toString({
  property: transitionProperty,
  duration: 0,
  easing: 'linear'
});
const defaultAttributes = {
  roleDescription: 'sortable'
};

/*
 * When the index of an item changes while sorting,
 * we need to temporarily disable the transforms
 */

function useDerivedTransform(_ref) {
  let {
    disabled,
    index,
    node,
    rect
  } = _ref;
  const [derivedTransform, setDerivedtransform] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
  const previousIndex = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(index);
  (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => {
    if (!disabled && index !== previousIndex.current && node.current) {
      const initial = rect.current;

      if (initial) {
        const current = (0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.getClientRect)(node.current, {
          ignoreTransform: true
        });
        const delta = {
          x: initial.left - current.left,
          y: initial.top - current.top,
          scaleX: initial.width / current.width,
          scaleY: initial.height / current.height
        };

        if (delta.x || delta.y) {
          setDerivedtransform(delta);
        }
      }
    }

    if (index !== previousIndex.current) {
      previousIndex.current = index;
    }
  }, [disabled, index, node, rect]);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (derivedTransform) {
      setDerivedtransform(null);
    }
  }, [derivedTransform]);
  return derivedTransform;
}

function useSortable(_ref) {
  let {
    animateLayoutChanges = defaultAnimateLayoutChanges,
    attributes: userDefinedAttributes,
    disabled: localDisabled,
    data: customData,
    getNewIndex = defaultNewIndexGetter,
    id,
    strategy: localStrategy,
    resizeObserverConfig,
    transition = defaultTransition
  } = _ref;
  const {
    items,
    containerId,
    activeIndex,
    disabled: globalDisabled,
    disableTransforms,
    sortedRects,
    overIndex,
    useDragOverlay,
    strategy: globalStrategy
  } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(Context);
  const disabled = normalizeLocalDisabled(localDisabled, globalDisabled);
  const index = items.indexOf(id);
  const data = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({
    sortable: {
      containerId,
      index,
      items
    },
    ...customData
  }), [containerId, customData, index, items]);
  const itemsAfterCurrentSortable = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => items.slice(items.indexOf(id)), [items, id]);
  const {
    rect,
    node,
    isOver,
    setNodeRef: setDroppableNodeRef
  } = (0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.useDroppable)({
    id,
    data,
    disabled: disabled.droppable,
    resizeObserverConfig: {
      updateMeasurementsFor: itemsAfterCurrentSortable,
      ...resizeObserverConfig
    }
  });
  const {
    active,
    activatorEvent,
    activeNodeRect,
    attributes,
    setNodeRef: setDraggableNodeRef,
    listeners,
    isDragging,
    over,
    setActivatorNodeRef,
    transform
  } = (0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.useDraggable)({
    id,
    data,
    attributes: { ...defaultAttributes,
      ...userDefinedAttributes
    },
    disabled: disabled.draggable
  });
  const setNodeRef = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useCombinedRefs)(setDroppableNodeRef, setDraggableNodeRef);
  const isSorting = Boolean(active);
  const displaceItem = isSorting && !disableTransforms && isValidIndex(activeIndex) && isValidIndex(overIndex);
  const shouldDisplaceDragSource = !useDragOverlay && isDragging;
  const dragSourceDisplacement = shouldDisplaceDragSource && displaceItem ? transform : null;
  const strategy = localStrategy != null ? localStrategy : globalStrategy;
  const finalTransform = displaceItem ? dragSourceDisplacement != null ? dragSourceDisplacement : strategy({
    rects: sortedRects,
    activeNodeRect,
    activeIndex,
    overIndex,
    index
  }) : null;
  const newIndex = isValidIndex(activeIndex) && isValidIndex(overIndex) ? getNewIndex({
    id,
    items,
    activeIndex,
    overIndex
  }) : index;
  const activeId = active == null ? void 0 : active.id;
  const previous = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({
    activeId,
    items,
    newIndex,
    containerId
  });
  const itemsHaveChanged = items !== previous.current.items;
  const shouldAnimateLayoutChanges = animateLayoutChanges({
    active,
    containerId,
    isDragging,
    isSorting,
    id,
    index,
    items,
    newIndex: previous.current.newIndex,
    previousItems: previous.current.items,
    previousContainerId: previous.current.containerId,
    transition,
    wasDragging: previous.current.activeId != null
  });
  const derivedTransform = useDerivedTransform({
    disabled: !shouldAnimateLayoutChanges,
    index,
    node,
    rect
  });
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (isSorting && previous.current.newIndex !== newIndex) {
      previous.current.newIndex = newIndex;
    }

    if (containerId !== previous.current.containerId) {
      previous.current.containerId = containerId;
    }

    if (items !== previous.current.items) {
      previous.current.items = items;
    }
  }, [isSorting, newIndex, containerId, items]);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (activeId === previous.current.activeId) {
      return;
    }

    if (activeId != null && previous.current.activeId == null) {
      previous.current.activeId = activeId;
      return;
    }

    const timeoutId = setTimeout(() => {
      previous.current.activeId = activeId;
    }, 50);
    return () => clearTimeout(timeoutId);
  }, [activeId]);
  return {
    active,
    activeIndex,
    attributes,
    data,
    rect,
    index,
    newIndex,
    items,
    isOver,
    isSorting,
    isDragging,
    listeners,
    node,
    overIndex,
    over,
    setNodeRef,
    setActivatorNodeRef,
    setDroppableNodeRef,
    setDraggableNodeRef,
    transform: derivedTransform != null ? derivedTransform : finalTransform,
    transition: getTransition()
  };

  function getTransition() {
    if ( // Temporarily disable transitions for a single frame to set up derived transforms
    derivedTransform || // Or to prevent items jumping to back to their "new" position when items change
    itemsHaveChanged && previous.current.newIndex === index) {
      return disabledTransition;
    }

    if (shouldDisplaceDragSource && !(0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isKeyboardEvent)(activatorEvent) || !transition) {
      return undefined;
    }

    if (isSorting || shouldAnimateLayoutChanges) {
      return _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.CSS.Transition.toString({ ...transition,
        property: transitionProperty
      });
    }

    return undefined;
  }
}

function normalizeLocalDisabled(localDisabled, globalDisabled) {
  var _localDisabled$dragga, _localDisabled$droppa;

  if (typeof localDisabled === 'boolean') {
    return {
      draggable: localDisabled,
      // Backwards compatibility
      droppable: false
    };
  }

  return {
    draggable: (_localDisabled$dragga = localDisabled == null ? void 0 : localDisabled.draggable) != null ? _localDisabled$dragga : globalDisabled.draggable,
    droppable: (_localDisabled$droppa = localDisabled == null ? void 0 : localDisabled.droppable) != null ? _localDisabled$droppa : globalDisabled.droppable
  };
}

function hasSortableData(entry) {
  if (!entry) {
    return false;
  }

  const data = entry.data.current;

  if (data && 'sortable' in data && typeof data.sortable === 'object' && 'containerId' in data.sortable && 'items' in data.sortable && 'index' in data.sortable) {
    return true;
  }

  return false;
}

const directions = [_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.KeyboardCode.Down, _dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.KeyboardCode.Right, _dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.KeyboardCode.Up, _dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.KeyboardCode.Left];
const sortableKeyboardCoordinates = (event, _ref) => {
  let {
    context: {
      active,
      collisionRect,
      droppableRects,
      droppableContainers,
      over,
      scrollableAncestors
    }
  } = _ref;

  if (directions.includes(event.code)) {
    event.preventDefault();

    if (!active || !collisionRect) {
      return;
    }

    const filteredContainers = [];
    droppableContainers.getEnabled().forEach(entry => {
      if (!entry || entry != null && entry.disabled) {
        return;
      }

      const rect = droppableRects.get(entry.id);

      if (!rect) {
        return;
      }

      switch (event.code) {
        case _dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.KeyboardCode.Down:
          if (collisionRect.top < rect.top) {
            filteredContainers.push(entry);
          }

          break;

        case _dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.KeyboardCode.Up:
          if (collisionRect.top > rect.top) {
            filteredContainers.push(entry);
          }

          break;

        case _dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.KeyboardCode.Left:
          if (collisionRect.left > rect.left) {
            filteredContainers.push(entry);
          }

          break;

        case _dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.KeyboardCode.Right:
          if (collisionRect.left < rect.left) {
            filteredContainers.push(entry);
          }

          break;
      }
    });
    const collisions = (0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.closestCorners)({
      active,
      collisionRect: collisionRect,
      droppableRects,
      droppableContainers: filteredContainers,
      pointerCoordinates: null
    });
    let closestId = (0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.getFirstCollision)(collisions, 'id');

    if (closestId === (over == null ? void 0 : over.id) && collisions.length > 1) {
      closestId = collisions[1].id;
    }

    if (closestId != null) {
      const activeDroppable = droppableContainers.get(active.id);
      const newDroppable = droppableContainers.get(closestId);
      const newRect = newDroppable ? droppableRects.get(newDroppable.id) : null;
      const newNode = newDroppable == null ? void 0 : newDroppable.node.current;

      if (newNode && newRect && activeDroppable && newDroppable) {
        const newScrollAncestors = (0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.getScrollableAncestors)(newNode);
        const hasDifferentScrollAncestors = newScrollAncestors.some((element, index) => scrollableAncestors[index] !== element);
        const hasSameContainer = isSameContainer(activeDroppable, newDroppable);
        const isAfterActive = isAfter(activeDroppable, newDroppable);
        const offset = hasDifferentScrollAncestors || !hasSameContainer ? {
          x: 0,
          y: 0
        } : {
          x: isAfterActive ? collisionRect.width - newRect.width : 0,
          y: isAfterActive ? collisionRect.height - newRect.height : 0
        };
        const rectCoordinates = {
          x: newRect.left,
          y: newRect.top
        };
        const newCoordinates = offset.x && offset.y ? rectCoordinates : (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.subtract)(rectCoordinates, offset);
        return newCoordinates;
      }
    }
  }

  return undefined;
};

function isSameContainer(a, b) {
  if (!hasSortableData(a) || !hasSortableData(b)) {
    return false;
  }

  return a.data.current.sortable.containerId === b.data.current.sortable.containerId;
}

function isAfter(a, b) {
  if (!hasSortableData(a) || !hasSortableData(b)) {
    return false;
  }

  if (!isSameContainer(a, b)) {
    return false;
  }

  return a.data.current.sortable.index < b.data.current.sortable.index;
}


//# sourceMappingURL=sortable.esm.js.map


/***/ }),

/***/ "./node_modules/@dnd-kit/utilities/dist/utilities.esm.js":
/*!***************************************************************!*\
  !*** ./node_modules/@dnd-kit/utilities/dist/utilities.esm.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CSS: () => (/* binding */ CSS),
/* harmony export */   add: () => (/* binding */ add),
/* harmony export */   canUseDOM: () => (/* binding */ canUseDOM),
/* harmony export */   findFirstFocusableNode: () => (/* binding */ findFirstFocusableNode),
/* harmony export */   getEventCoordinates: () => (/* binding */ getEventCoordinates),
/* harmony export */   getOwnerDocument: () => (/* binding */ getOwnerDocument),
/* harmony export */   getWindow: () => (/* binding */ getWindow),
/* harmony export */   hasViewportRelativeCoordinates: () => (/* binding */ hasViewportRelativeCoordinates),
/* harmony export */   isDocument: () => (/* binding */ isDocument),
/* harmony export */   isHTMLElement: () => (/* binding */ isHTMLElement),
/* harmony export */   isKeyboardEvent: () => (/* binding */ isKeyboardEvent),
/* harmony export */   isNode: () => (/* binding */ isNode),
/* harmony export */   isSVGElement: () => (/* binding */ isSVGElement),
/* harmony export */   isTouchEvent: () => (/* binding */ isTouchEvent),
/* harmony export */   isWindow: () => (/* binding */ isWindow),
/* harmony export */   subtract: () => (/* binding */ subtract),
/* harmony export */   useCombinedRefs: () => (/* binding */ useCombinedRefs),
/* harmony export */   useEvent: () => (/* binding */ useEvent),
/* harmony export */   useInterval: () => (/* binding */ useInterval),
/* harmony export */   useIsomorphicLayoutEffect: () => (/* binding */ useIsomorphicLayoutEffect),
/* harmony export */   useLatestValue: () => (/* binding */ useLatestValue),
/* harmony export */   useLazyMemo: () => (/* binding */ useLazyMemo),
/* harmony export */   useNodeRef: () => (/* binding */ useNodeRef),
/* harmony export */   usePrevious: () => (/* binding */ usePrevious),
/* harmony export */   useUniqueId: () => (/* binding */ useUniqueId)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);


function useCombinedRefs() {
  for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
    refs[_key] = arguments[_key];
  }

  return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => node => {
    refs.forEach(ref => ref(node));
  }, // eslint-disable-next-line react-hooks/exhaustive-deps
  refs);
}

// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js
const canUseDOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';

function isWindow(element) {
  const elementString = Object.prototype.toString.call(element);
  return elementString === '[object Window]' || // In Electron context the Window object serializes to [object global]
  elementString === '[object global]';
}

function isNode(node) {
  return 'nodeType' in node;
}

function getWindow(target) {
  var _target$ownerDocument, _target$ownerDocument2;

  if (!target) {
    return window;
  }

  if (isWindow(target)) {
    return target;
  }

  if (!isNode(target)) {
    return window;
  }

  return (_target$ownerDocument = (_target$ownerDocument2 = target.ownerDocument) == null ? void 0 : _target$ownerDocument2.defaultView) != null ? _target$ownerDocument : window;
}

function isDocument(node) {
  const {
    Document
  } = getWindow(node);
  return node instanceof Document;
}

function isHTMLElement(node) {
  if (isWindow(node)) {
    return false;
  }

  return node instanceof getWindow(node).HTMLElement;
}

function isSVGElement(node) {
  return node instanceof getWindow(node).SVGElement;
}

function getOwnerDocument(target) {
  if (!target) {
    return document;
  }

  if (isWindow(target)) {
    return target.document;
  }

  if (!isNode(target)) {
    return document;
  }

  if (isDocument(target)) {
    return target;
  }

  if (isHTMLElement(target) || isSVGElement(target)) {
    return target.ownerDocument;
  }

  return document;
}

/**
 * A hook that resolves to useEffect on the server and useLayoutEffect on the client
 * @param callback {function} Callback function that is invoked when the dependencies of the hook change
 */

const useIsomorphicLayoutEffect = canUseDOM ? react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_0__.useEffect;

function useEvent(handler) {
  const handlerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(handler);
  useIsomorphicLayoutEffect(() => {
    handlerRef.current = handler;
  });
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    return handlerRef.current == null ? void 0 : handlerRef.current(...args);
  }, []);
}

function useInterval() {
  const intervalRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
  const set = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((listener, duration) => {
    intervalRef.current = setInterval(listener, duration);
  }, []);
  const clear = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    if (intervalRef.current !== null) {
      clearInterval(intervalRef.current);
      intervalRef.current = null;
    }
  }, []);
  return [set, clear];
}

function useLatestValue(value, dependencies) {
  if (dependencies === void 0) {
    dependencies = [value];
  }

  const valueRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(value);
  useIsomorphicLayoutEffect(() => {
    if (valueRef.current !== value) {
      valueRef.current = value;
    }
  }, dependencies);
  return valueRef;
}

function useLazyMemo(callback, dependencies) {
  const valueRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
    const newValue = callback(valueRef.current);
    valueRef.current = newValue;
    return newValue;
  }, // eslint-disable-next-line react-hooks/exhaustive-deps
  [...dependencies]);
}

function useNodeRef(onChange) {
  const onChangeHandler = useEvent(onChange);
  const node = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
  const setNodeRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(element => {
    if (element !== node.current) {
      onChangeHandler == null ? void 0 : onChangeHandler(element, node.current);
    }

    node.current = element;
  }, //eslint-disable-next-line
  []);
  return [node, setNodeRef];
}

function usePrevious(value) {
  const ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    ref.current = value;
  }, [value]);
  return ref.current;
}

let ids = {};
function useUniqueId(prefix, value) {
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
    if (value) {
      return value;
    }

    const id = ids[prefix] == null ? 0 : ids[prefix] + 1;
    ids[prefix] = id;
    return prefix + "-" + id;
  }, [prefix, value]);
}

function createAdjustmentFn(modifier) {
  return function (object) {
    for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      adjustments[_key - 1] = arguments[_key];
    }

    return adjustments.reduce((accumulator, adjustment) => {
      const entries = Object.entries(adjustment);

      for (const [key, valueAdjustment] of entries) {
        const value = accumulator[key];

        if (value != null) {
          accumulator[key] = value + modifier * valueAdjustment;
        }
      }

      return accumulator;
    }, { ...object
    });
  };
}

const add = /*#__PURE__*/createAdjustmentFn(1);
const subtract = /*#__PURE__*/createAdjustmentFn(-1);

function hasViewportRelativeCoordinates(event) {
  return 'clientX' in event && 'clientY' in event;
}

function isKeyboardEvent(event) {
  if (!event) {
    return false;
  }

  const {
    KeyboardEvent
  } = getWindow(event.target);
  return KeyboardEvent && event instanceof KeyboardEvent;
}

function isTouchEvent(event) {
  if (!event) {
    return false;
  }

  const {
    TouchEvent
  } = getWindow(event.target);
  return TouchEvent && event instanceof TouchEvent;
}

/**
 * Returns the normalized x and y coordinates for mouse and touch events.
 */

function getEventCoordinates(event) {
  if (isTouchEvent(event)) {
    if (event.touches && event.touches.length) {
      const {
        clientX: x,
        clientY: y
      } = event.touches[0];
      return {
        x,
        y
      };
    } else if (event.changedTouches && event.changedTouches.length) {
      const {
        clientX: x,
        clientY: y
      } = event.changedTouches[0];
      return {
        x,
        y
      };
    }
  }

  if (hasViewportRelativeCoordinates(event)) {
    return {
      x: event.clientX,
      y: event.clientY
    };
  }

  return null;
}

const CSS = /*#__PURE__*/Object.freeze({
  Translate: {
    toString(transform) {
      if (!transform) {
        return;
      }

      const {
        x,
        y
      } = transform;
      return "translate3d(" + (x ? Math.round(x) : 0) + "px, " + (y ? Math.round(y) : 0) + "px, 0)";
    }

  },
  Scale: {
    toString(transform) {
      if (!transform) {
        return;
      }

      const {
        scaleX,
        scaleY
      } = transform;
      return "scaleX(" + scaleX + ") scaleY(" + scaleY + ")";
    }

  },
  Transform: {
    toString(transform) {
      if (!transform) {
        return;
      }

      return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(' ');
    }

  },
  Transition: {
    toString(_ref) {
      let {
        property,
        duration,
        easing
      } = _ref;
      return property + " " + duration + "ms " + easing;
    }

  }
});

const SELECTOR = 'a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]';
function findFirstFocusableNode(element) {
  if (element.matches(SELECTOR)) {
    return element;
  }

  return element.querySelector(SELECTOR);
}


//# sourceMappingURL=utilities.esm.js.map


/***/ }),

/***/ "./node_modules/axios/lib/adapters/adapters.js":
/*!*****************************************************!*\
  !*** ./node_modules/axios/lib/adapters/adapters.js ***!
  \*****************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js");
/* harmony import */ var _http_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./http.js */ "./node_modules/axios/lib/helpers/null.js");
/* harmony import */ var _xhr_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./xhr.js */ "./node_modules/axios/lib/adapters/xhr.js");
/* harmony import */ var _fetch_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fetch.js */ "./node_modules/axios/lib/adapters/fetch.js");
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js");






const knownAdapters = {
  http: _http_js__WEBPACK_IMPORTED_MODULE_1__["default"],
  xhr: _xhr_js__WEBPACK_IMPORTED_MODULE_2__["default"],
  fetch: {
    get: _fetch_js__WEBPACK_IMPORTED_MODULE_3__.getFetch,
  }
}

_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(knownAdapters, (fn, value) => {
  if (fn) {
    try {
      Object.defineProperty(fn, 'name', {value});
    } catch (e) {
      // eslint-disable-next-line no-empty
    }
    Object.defineProperty(fn, 'adapterName', {value});
  }
});

const renderReason = (reason) => `- ${reason}`;

const isResolvedHandle = (adapter) => _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(adapter) || adapter === null || adapter === false;

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  getAdapter: (adapters, config) => {
    adapters = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(adapters) ? adapters : [adapters];

    const {length} = adapters;
    let nameOrAdapter;
    let adapter;

    const rejectedReasons = {};

    for (let i = 0; i < length; i++) {
      nameOrAdapter = adapters[i];
      let id;

      adapter = nameOrAdapter;

      if (!isResolvedHandle(nameOrAdapter)) {
        adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];

        if (adapter === undefined) {
          throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_4__["default"](`Unknown adapter '${id}'`);
        }
      }

      if (adapter && (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(adapter) || (adapter = adapter.get(config)))) {
        break;
      }

      rejectedReasons[id || '#' + i] = adapter;
    }

    if (!adapter) {

      const reasons = Object.entries(rejectedReasons)
        .map(([id, state]) => `adapter ${id} ` +
          (state === false ? 'is not supported by the environment' : 'is not available in the build')
        );

      let s = length ?
        (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
        'as no adapter specified';

      throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_4__["default"](
        `There is no suitable adapter to dispatch the request ` + s,
        'ERR_NOT_SUPPORT'
      );
    }

    return adapter;
  },
  adapters: knownAdapters
});


/***/ }),

/***/ "./node_modules/axios/lib/adapters/fetch.js":
/*!**************************************************!*\
  !*** ./node_modules/axios/lib/adapters/fetch.js ***!
  \**************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   getFetch: () => (/* binding */ getFetch)
/* harmony export */ });
/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js");
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js");
/* harmony import */ var _helpers_composeSignals_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/composeSignals.js */ "./node_modules/axios/lib/helpers/composeSignals.js");
/* harmony import */ var _helpers_trackStream_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/trackStream.js */ "./node_modules/axios/lib/helpers/trackStream.js");
/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js");
/* harmony import */ var _helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../helpers/progressEventReducer.js */ "./node_modules/axios/lib/helpers/progressEventReducer.js");
/* harmony import */ var _helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../helpers/resolveConfig.js */ "./node_modules/axios/lib/helpers/resolveConfig.js");
/* harmony import */ var _core_settle_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../core/settle.js */ "./node_modules/axios/lib/core/settle.js");










const DEFAULT_CHUNK_SIZE = 64 * 1024;

const {isFunction} = _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"];

const globalFetchAPI = (({Request, Response}) => ({
  Request, Response
}))(_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].global);

const {
  ReadableStream, TextEncoder
} = _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].global;


const test = (fn, ...args) => {
  try {
    return !!fn(...args);
  } catch (e) {
    return false
  }
}

const factory = (env) => {
  env = _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].merge.call({
    skipUndefined: true
  }, globalFetchAPI, env);

  const {fetch: envFetch, Request, Response} = env;
  const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
  const isRequestSupported = isFunction(Request);
  const isResponseSupported = isFunction(Response);

  if (!isFetchSupported) {
    return false;
  }

  const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);

  const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
      ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
      async (str) => new Uint8Array(await new Request(str).arrayBuffer())
  );

  const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
    let duplexAccessed = false;

    const hasContentType = new Request(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].origin, {
      body: new ReadableStream(),
      method: 'POST',
      get duplex() {
        duplexAccessed = true;
        return 'half';
      },
    }).headers.has('Content-Type');

    return duplexAccessed && !hasContentType;
  });

  const supportsResponseStream = isResponseSupported && isReadableStreamSupported &&
    test(() => _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isReadableStream(new Response('').body));

  const resolvers = {
    stream: supportsResponseStream && ((res) => res.body)
  };

  isFetchSupported && ((() => {
    ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
      !resolvers[type] && (resolvers[type] = (res, config) => {
        let method = res && res[type];

        if (method) {
          return method.call(res);
        }

        throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"](`Response type '${type}' is not supported`, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"].ERR_NOT_SUPPORT, config);
      })
    });
  })());

  const getBodyLength = async (body) => {
    if (body == null) {
      return 0;
    }

    if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isBlob(body)) {
      return body.size;
    }

    if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isSpecCompliantForm(body)) {
      const _request = new Request(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].origin, {
        method: 'POST',
        body,
      });
      return (await _request.arrayBuffer()).byteLength;
    }

    if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isArrayBufferView(body) || _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isArrayBuffer(body)) {
      return body.byteLength;
    }

    if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isURLSearchParams(body)) {
      body = body + '';
    }

    if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(body)) {
      return (await encodeText(body)).byteLength;
    }
  }

  const resolveBodyLength = async (headers, body) => {
    const length = _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].toFiniteNumber(headers.getContentLength());

    return length == null ? getBodyLength(body) : length;
  }

  return async (config) => {
    let {
      url,
      method,
      data,
      signal,
      cancelToken,
      timeout,
      onDownloadProgress,
      onUploadProgress,
      responseType,
      headers,
      withCredentials = 'same-origin',
      fetchOptions
    } = (0,_helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_7__["default"])(config);

    let _fetch = envFetch || fetch;

    responseType = responseType ? (responseType + '').toLowerCase() : 'text';

    let composedSignal = (0,_helpers_composeSignals_js__WEBPACK_IMPORTED_MODULE_3__["default"])([signal, cancelToken && cancelToken.toAbortSignal()], timeout);

    let request = null;

    const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
      composedSignal.unsubscribe();
    });

    let requestContentLength;

    try {
      if (
        onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
        (requestContentLength = await resolveBodyLength(headers, data)) !== 0
      ) {
        let _request = new Request(url, {
          method: 'POST',
          body: data,
          duplex: "half"
        });

        let contentTypeHeader;

        if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
          headers.setContentType(contentTypeHeader)
        }

        if (_request.body) {
          const [onProgress, flush] = (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_6__.progressEventDecorator)(
            requestContentLength,
            (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_6__.progressEventReducer)((0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_6__.asyncDecorator)(onUploadProgress))
          );

          data = (0,_helpers_trackStream_js__WEBPACK_IMPORTED_MODULE_4__.trackStream)(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
        }
      }

      if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(withCredentials)) {
        withCredentials = withCredentials ? 'include' : 'omit';
      }

      // Cloudflare Workers throws when credentials are defined
      // see https://github.com/cloudflare/workerd/issues/902
      const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;

      const resolvedOptions = {
        ...fetchOptions,
        signal: composedSignal,
        method: method.toUpperCase(),
        headers: headers.normalize().toJSON(),
        body: data,
        duplex: "half",
        credentials: isCredentialsSupported ? withCredentials : undefined
      };

      request = isRequestSupported && new Request(url, resolvedOptions);

      let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));

      const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');

      if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
        const options = {};

        ['status', 'statusText', 'headers'].forEach(prop => {
          options[prop] = response[prop];
        });

        const responseContentLength = _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].toFiniteNumber(response.headers.get('content-length'));

        const [onProgress, flush] = onDownloadProgress && (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_6__.progressEventDecorator)(
          responseContentLength,
          (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_6__.progressEventReducer)((0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_6__.asyncDecorator)(onDownloadProgress), true)
        ) || [];

        response = new Response(
          (0,_helpers_trackStream_js__WEBPACK_IMPORTED_MODULE_4__.trackStream)(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
            flush && flush();
            unsubscribe && unsubscribe();
          }),
          options
        );
      }

      responseType = responseType || 'text';

      let responseData = await resolvers[_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].findKey(resolvers, responseType) || 'text'](response, config);

      !isStreamResponse && unsubscribe && unsubscribe();

      return await new Promise((resolve, reject) => {
        (0,_core_settle_js__WEBPACK_IMPORTED_MODULE_8__["default"])(resolve, reject, {
          data: responseData,
          headers: _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_5__["default"].from(response.headers),
          status: response.status,
          statusText: response.statusText,
          config,
          request
        })
      })
    } catch (err) {
      unsubscribe && unsubscribe();

      if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
        throw Object.assign(
          new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"]('Network Error', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"].ERR_NETWORK, config, request),
          {
            cause: err.cause || err
          }
        )
      }

      throw _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"].from(err, err && err.code, config, request);
    }
  }
}

const seedCache = new Map();

const getFetch = (config) => {
  let env = config ? config.env : {};
  const {fetch, Request, Response} = env;
  const seeds = [
    Request, Response, fetch
  ];

  let len = seeds.length, i = len,
    seed, target, map = seedCache;

  while (i--) {
    seed = seeds[i];
    target = map.get(seed);

    target === undefined && map.set(seed, target = (i ? new Map() : factory(env)))

    map = target;
  }

  return target;
};

const adapter = getFetch();

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (adapter);


/***/ }),

/***/ "./node_modules/axios/lib/adapters/xhr.js":
/*!************************************************!*\
  !*** ./node_modules/axios/lib/adapters/xhr.js ***!
  \************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js");
/* harmony import */ var _core_settle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../core/settle.js */ "./node_modules/axios/lib/core/settle.js");
/* harmony import */ var _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../defaults/transitional.js */ "./node_modules/axios/lib/defaults/transitional.js");
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js");
/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js");
/* harmony import */ var _helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../helpers/parseProtocol.js */ "./node_modules/axios/lib/helpers/parseProtocol.js");
/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js");
/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js");
/* harmony import */ var _helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../helpers/progressEventReducer.js */ "./node_modules/axios/lib/helpers/progressEventReducer.js");
/* harmony import */ var _helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../helpers/resolveConfig.js */ "./node_modules/axios/lib/helpers/resolveConfig.js");











const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isXHRAdapterSupported && function (config) {
  return new Promise(function dispatchXhrRequest(resolve, reject) {
    const _config = (0,_helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_9__["default"])(config);
    let requestData = _config.data;
    const requestHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_7__["default"].from(_config.headers).normalize();
    let {responseType, onUploadProgress, onDownloadProgress} = _config;
    let onCanceled;
    let uploadThrottled, downloadThrottled;
    let flushUpload, flushDownload;

    function done() {
      flushUpload && flushUpload(); // flush events
      flushDownload && flushDownload(); // flush events

      _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);

      _config.signal && _config.signal.removeEventListener('abort', onCanceled);
    }

    let request = new XMLHttpRequest();

    request.open(_config.method.toUpperCase(), _config.url, true);

    // Set the request timeout in MS
    request.timeout = _config.timeout;

    function onloadend() {
      if (!request) {
        return;
      }
      // Prepare the response
      const responseHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_7__["default"].from(
        'getAllResponseHeaders' in request && request.getAllResponseHeaders()
      );
      const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
        request.responseText : request.response;
      const response = {
        data: responseData,
        status: request.status,
        statusText: request.statusText,
        headers: responseHeaders,
        config,
        request
      };

      (0,_core_settle_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function _resolve(value) {
        resolve(value);
        done();
      }, function _reject(err) {
        reject(err);
        done();
      }, response);

      // Clean up request
      request = null;
    }

    if ('onloadend' in request) {
      // Use onloadend if available
      request.onloadend = onloadend;
    } else {
      // Listen for ready state to emulate onloadend
      request.onreadystatechange = function handleLoad() {
        if (!request || request.readyState !== 4) {
          return;
        }

        // The request errored out and we didn't get a response, this will be
        // handled by onerror instead
        // With one exception: request that using file: protocol, most browsers
        // will return status as 0 even though it's a successful request
        if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
          return;
        }
        // readystate handler is calling before onerror or ontimeout handlers,
        // so we should call onloadend on the next 'tick'
        setTimeout(onloadend);
      };
    }

    // Handle browser request cancellation (as opposed to a manual cancellation)
    request.onabort = function handleAbort() {
      if (!request) {
        return;
      }

      reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"]('Request aborted', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"].ECONNABORTED, config, request));

      // Clean up request
      request = null;
    };

    // Handle low level network errors
  request.onerror = function handleError(event) {
       // Browsers deliver a ProgressEvent in XHR onerror
       // (message may be empty; when present, surface it)
       // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
       const msg = event && event.message ? event.message : 'Network Error';
       const err = new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"](msg, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"].ERR_NETWORK, config, request);
       // attach the underlying event for consumers who want details
       err.event = event || null;
       reject(err);
       request = null;
    };
    
    // Handle timeout
    request.ontimeout = function handleTimeout() {
      let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
      const transitional = _config.transitional || _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_2__["default"];
      if (_config.timeoutErrorMessage) {
        timeoutErrorMessage = _config.timeoutErrorMessage;
      }
      reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"](
        timeoutErrorMessage,
        transitional.clarifyTimeoutError ? _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"].ETIMEDOUT : _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"].ECONNABORTED,
        config,
        request));

      // Clean up request
      request = null;
    };

    // Remove Content-Type if data is undefined
    requestData === undefined && requestHeaders.setContentType(null);

    // Add headers to the request
    if ('setRequestHeader' in request) {
      _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
        request.setRequestHeader(key, val);
      });
    }

    // Add withCredentials to request if needed
    if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(_config.withCredentials)) {
      request.withCredentials = !!_config.withCredentials;
    }

    // Add responseType to request if needed
    if (responseType && responseType !== 'json') {
      request.responseType = _config.responseType;
    }

    // Handle progress if needed
    if (onDownloadProgress) {
      ([downloadThrottled, flushDownload] = (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_8__.progressEventReducer)(onDownloadProgress, true));
      request.addEventListener('progress', downloadThrottled);
    }

    // Not all browsers support upload events
    if (onUploadProgress && request.upload) {
      ([uploadThrottled, flushUpload] = (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_8__.progressEventReducer)(onUploadProgress));

      request.upload.addEventListener('progress', uploadThrottled);

      request.upload.addEventListener('loadend', flushUpload);
    }

    if (_config.cancelToken || _config.signal) {
      // Handle cancellation
      // eslint-disable-next-line func-names
      onCanceled = cancel => {
        if (!request) {
          return;
        }
        reject(!cancel || cancel.type ? new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_4__["default"](null, config, request) : cancel);
        request.abort();
        request = null;
      };

      _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
      if (_config.signal) {
        _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
      }
    }

    const protocol = (0,_helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_config.url);

    if (protocol && _platform_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].protocols.indexOf(protocol) === -1) {
      reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"]('Unsupported protocol ' + protocol + ':', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"].ERR_BAD_REQUEST, config));
      return;
    }


    // Send the request
    request.send(requestData || null);
  });
});


/***/ }),

/***/ "./node_modules/axios/lib/axios.js":
/*!*****************************************!*\
  !*** ./node_modules/axios/lib/axios.js ***!
  \*****************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ "./node_modules/axios/lib/utils.js");
/* harmony import */ var _helpers_bind_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers/bind.js */ "./node_modules/axios/lib/helpers/bind.js");
/* harmony import */ var _core_Axios_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./core/Axios.js */ "./node_modules/axios/lib/core/Axios.js");
/* harmony import */ var _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./core/mergeConfig.js */ "./node_modules/axios/lib/core/mergeConfig.js");
/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./defaults/index.js */ "./node_modules/axios/lib/defaults/index.js");
/* harmony import */ var _helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./helpers/formDataToJSON.js */ "./node_modules/axios/lib/helpers/formDataToJSON.js");
/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js");
/* harmony import */ var _cancel_CancelToken_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./cancel/CancelToken.js */ "./node_modules/axios/lib/cancel/CancelToken.js");
/* harmony import */ var _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./cancel/isCancel.js */ "./node_modules/axios/lib/cancel/isCancel.js");
/* harmony import */ var _env_data_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./env/data.js */ "./node_modules/axios/lib/env/data.js");
/* harmony import */ var _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./helpers/toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js");
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js");
/* harmony import */ var _helpers_spread_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./helpers/spread.js */ "./node_modules/axios/lib/helpers/spread.js");
/* harmony import */ var _helpers_isAxiosError_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./helpers/isAxiosError.js */ "./node_modules/axios/lib/helpers/isAxiosError.js");
/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js");
/* harmony import */ var _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./adapters/adapters.js */ "./node_modules/axios/lib/adapters/adapters.js");
/* harmony import */ var _helpers_HttpStatusCode_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./helpers/HttpStatusCode.js */ "./node_modules/axios/lib/helpers/HttpStatusCode.js");




















/**
 * Create an instance of Axios
 *
 * @param {Object} defaultConfig The default config for the instance
 *
 * @returns {Axios} A new instance of Axios
 */
function createInstance(defaultConfig) {
  const context = new _core_Axios_js__WEBPACK_IMPORTED_MODULE_2__["default"](defaultConfig);
  const instance = (0,_helpers_bind_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_core_Axios_js__WEBPACK_IMPORTED_MODULE_2__["default"].prototype.request, context);

  // Copy axios.prototype to instance
  _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].extend(instance, _core_Axios_js__WEBPACK_IMPORTED_MODULE_2__["default"].prototype, context, {allOwnKeys: true});

  // Copy context to instance
  _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].extend(instance, context, null, {allOwnKeys: true});

  // Factory for creating new instances
  instance.create = function create(instanceConfig) {
    return createInstance((0,_core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__["default"])(defaultConfig, instanceConfig));
  };

  return instance;
}

// Create the default instance to be exported
const axios = createInstance(_defaults_index_js__WEBPACK_IMPORTED_MODULE_4__["default"]);

// Expose Axios class to allow class inheritance
axios.Axios = _core_Axios_js__WEBPACK_IMPORTED_MODULE_2__["default"];

// Expose Cancel & CancelToken
axios.CanceledError = _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_6__["default"];
axios.CancelToken = _cancel_CancelToken_js__WEBPACK_IMPORTED_MODULE_7__["default"];
axios.isCancel = _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_8__["default"];
axios.VERSION = _env_data_js__WEBPACK_IMPORTED_MODULE_9__.VERSION;
axios.toFormData = _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_10__["default"];

// Expose AxiosError class
axios.AxiosError = _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_11__["default"];

// alias for CanceledError for backward compatibility
axios.Cancel = axios.CanceledError;

// Expose all/spread
axios.all = function all(promises) {
  return Promise.all(promises);
};

axios.spread = _helpers_spread_js__WEBPACK_IMPORTED_MODULE_12__["default"];

// Expose isAxiosError
axios.isAxiosError = _helpers_isAxiosError_js__WEBPACK_IMPORTED_MODULE_13__["default"];

// Expose mergeConfig
axios.mergeConfig = _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__["default"];

axios.AxiosHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_14__["default"];

axios.formToJSON = thing => (0,_helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isHTMLForm(thing) ? new FormData(thing) : thing);

axios.getAdapter = _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_15__["default"].getAdapter;

axios.HttpStatusCode = _helpers_HttpStatusCode_js__WEBPACK_IMPORTED_MODULE_16__["default"];

axios.default = axios;

// this module should only have a default export
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (axios);


/***/ }),

/***/ "./node_modules/axios/lib/cancel/CancelToken.js":
/*!******************************************************!*\
  !*** ./node_modules/axios/lib/cancel/CancelToken.js ***!
  \******************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js");




/**
 * A `CancelToken` is an object that can be used to request cancellation of an operation.
 *
 * @param {Function} executor The executor function.
 *
 * @returns {CancelToken}
 */
class CancelToken {
  constructor(executor) {
    if (typeof executor !== 'function') {
      throw new TypeError('executor must be a function.');
    }

    let resolvePromise;

    this.promise = new Promise(function promiseExecutor(resolve) {
      resolvePromise = resolve;
    });

    const token = this;

    // eslint-disable-next-line func-names
    this.promise.then(cancel => {
      if (!token._listeners) return;

      let i = token._listeners.length;

      while (i-- > 0) {
        token._listeners[i](cancel);
      }
      token._listeners = null;
    });

    // eslint-disable-next-line func-names
    this.promise.then = onfulfilled => {
      let _resolve;
      // eslint-disable-next-line func-names
      const promise = new Promise(resolve => {
        token.subscribe(resolve);
        _resolve = resolve;
      }).then(onfulfilled);

      promise.cancel = function reject() {
        token.unsubscribe(_resolve);
      };

      return promise;
    };

    executor(function cancel(message, config, request) {
      if (token.reason) {
        // Cancellation has already been requested
        return;
      }

      token.reason = new _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__["default"](message, config, request);
      resolvePromise(token.reason);
    });
  }

  /**
   * Throws a `CanceledError` if cancellation has been requested.
   */
  throwIfRequested() {
    if (this.reason) {
      throw this.reason;
    }
  }

  /**
   * Subscribe to the cancel signal
   */

  subscribe(listener) {
    if (this.reason) {
      listener(this.reason);
      return;
    }

    if (this._listeners) {
      this._listeners.push(listener);
    } else {
      this._listeners = [listener];
    }
  }

  /**
   * Unsubscribe from the cancel signal
   */

  unsubscribe(listener) {
    if (!this._listeners) {
      return;
    }
    const index = this._listeners.indexOf(listener);
    if (index !== -1) {
      this._listeners.splice(index, 1);
    }
  }

  toAbortSignal() {
    const controller = new AbortController();

    const abort = (err) => {
      controller.abort(err);
    };

    this.subscribe(abort);

    controller.signal.unsubscribe = () => this.unsubscribe(abort);

    return controller.signal;
  }

  /**
   * Returns an object that contains a new `CancelToken` and a function that, when called,
   * cancels the `CancelToken`.
   */
  static source() {
    let cancel;
    const token = new CancelToken(function executor(c) {
      cancel = c;
    });
    return {
      token,
      cancel
    };
  }
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CancelToken);


/***/ }),

/***/ "./node_modules/axios/lib/cancel/CanceledError.js":
/*!********************************************************!*\
  !*** ./node_modules/axios/lib/cancel/CanceledError.js ***!
  \********************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js");





/**
 * A `CanceledError` is an object that is thrown when an operation is canceled.
 *
 * @param {string=} message The message.
 * @param {Object=} config The config.
 * @param {Object=} request The request.
 *
 * @returns {CanceledError} The created error.
 */
function CanceledError(message, config, request) {
  // eslint-disable-next-line no-eq-null,eqeqeq
  _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].call(this, message == null ? 'canceled' : message, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_CANCELED, config, request);
  this.name = 'CanceledError';
}

_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].inherits(CanceledError, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"], {
  __CANCEL__: true
});

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CanceledError);


/***/ }),

/***/ "./node_modules/axios/lib/cancel/isCancel.js":
/*!***************************************************!*\
  !*** ./node_modules/axios/lib/cancel/isCancel.js ***!
  \***************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ isCancel)
/* harmony export */ });


function isCancel(value) {
  return !!(value && value.__CANCEL__);
}


/***/ }),

/***/ "./node_modules/axios/lib/core/Axios.js":
/*!**********************************************!*\
  !*** ./node_modules/axios/lib/core/Axios.js ***!
  \**********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js");
/* harmony import */ var _helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/buildURL.js */ "./node_modules/axios/lib/helpers/buildURL.js");
/* harmony import */ var _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./InterceptorManager.js */ "./node_modules/axios/lib/core/InterceptorManager.js");
/* harmony import */ var _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./dispatchRequest.js */ "./node_modules/axios/lib/core/dispatchRequest.js");
/* harmony import */ var _mergeConfig_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./mergeConfig.js */ "./node_modules/axios/lib/core/mergeConfig.js");
/* harmony import */ var _buildFullPath_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./buildFullPath.js */ "./node_modules/axios/lib/core/buildFullPath.js");
/* harmony import */ var _helpers_validator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../helpers/validator.js */ "./node_modules/axios/lib/helpers/validator.js");
/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js");











const validators = _helpers_validator_js__WEBPACK_IMPORTED_MODULE_6__["default"].validators;

/**
 * Create a new instance of Axios
 *
 * @param {Object} instanceConfig The default config for the instance
 *
 * @return {Axios} A new instance of Axios
 */
class Axios {
  constructor(instanceConfig) {
    this.defaults = instanceConfig || {};
    this.interceptors = {
      request: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_2__["default"](),
      response: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_2__["default"]()
    };
  }

  /**
   * Dispatch a request
   *
   * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
   * @param {?Object} config
   *
   * @returns {Promise} The Promise to be fulfilled
   */
  async request(configOrUrl, config) {
    try {
      return await this._request(configOrUrl, config);
    } catch (err) {
      if (err instanceof Error) {
        let dummy = {};

        Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());

        // slice off the Error: ... line
        const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
        try {
          if (!err.stack) {
            err.stack = stack;
            // match without the 2 top stack lines
          } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
            err.stack += '\n' + stack
          }
        } catch (e) {
          // ignore the case where "stack" is an un-writable property
        }
      }

      throw err;
    }
  }

  _request(configOrUrl, config) {
    /*eslint no-param-reassign:0*/
    // Allow for axios('example/url'[, config]) a la fetch API
    if (typeof configOrUrl === 'string') {
      config = config || {};
      config.url = configOrUrl;
    } else {
      config = configOrUrl || {};
    }

    config = (0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_4__["default"])(this.defaults, config);

    const {transitional, paramsSerializer, headers} = config;

    if (transitional !== undefined) {
      _helpers_validator_js__WEBPACK_IMPORTED_MODULE_6__["default"].assertOptions(transitional, {
        silentJSONParsing: validators.transitional(validators.boolean),
        forcedJSONParsing: validators.transitional(validators.boolean),
        clarifyTimeoutError: validators.transitional(validators.boolean)
      }, false);
    }

    if (paramsSerializer != null) {
      if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(paramsSerializer)) {
        config.paramsSerializer = {
          serialize: paramsSerializer
        }
      } else {
        _helpers_validator_js__WEBPACK_IMPORTED_MODULE_6__["default"].assertOptions(paramsSerializer, {
          encode: validators.function,
          serialize: validators.function
        }, true);
      }
    }

    // Set config.allowAbsoluteUrls
    if (config.allowAbsoluteUrls !== undefined) {
      // do nothing
    } else if (this.defaults.allowAbsoluteUrls !== undefined) {
      config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
    } else {
      config.allowAbsoluteUrls = true;
    }

    _helpers_validator_js__WEBPACK_IMPORTED_MODULE_6__["default"].assertOptions(config, {
      baseUrl: validators.spelling('baseURL'),
      withXsrfToken: validators.spelling('withXSRFToken')
    }, true);

    // Set config.method
    config.method = (config.method || this.defaults.method || 'get').toLowerCase();

    // Flatten headers
    let contextHeaders = headers && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].merge(
      headers.common,
      headers[config.method]
    );

    headers && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(
      ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
      (method) => {
        delete headers[method];
      }
    );

    config.headers = _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_7__["default"].concat(contextHeaders, headers);

    // filter out skipped interceptors
    const requestInterceptorChain = [];
    let synchronousRequestInterceptors = true;
    this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
      if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
        return;
      }

      synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;

      requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
    });

    const responseInterceptorChain = [];
    this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
      responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
    });

    let promise;
    let i = 0;
    let len;

    if (!synchronousRequestInterceptors) {
      const chain = [_dispatchRequest_js__WEBPACK_IMPORTED_MODULE_3__["default"].bind(this), undefined];
      chain.unshift(...requestInterceptorChain);
      chain.push(...responseInterceptorChain);
      len = chain.length;

      promise = Promise.resolve(config);

      while (i < len) {
        promise = promise.then(chain[i++], chain[i++]);
      }

      return promise;
    }

    len = requestInterceptorChain.length;

    let newConfig = config;

    while (i < len) {
      const onFulfilled = requestInterceptorChain[i++];
      const onRejected = requestInterceptorChain[i++];
      try {
        newConfig = onFulfilled(newConfig);
      } catch (error) {
        onRejected.call(this, error);
        break;
      }
    }

    try {
      promise = _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_3__["default"].call(this, newConfig);
    } catch (error) {
      return Promise.reject(error);
    }

    i = 0;
    len = responseInterceptorChain.length;

    while (i < len) {
      promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
    }

    return promise;
  }

  getUri(config) {
    config = (0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_4__["default"])(this.defaults, config);
    const fullPath = (0,_buildFullPath_js__WEBPACK_IMPORTED_MODULE_5__["default"])(config.baseURL, config.url, config.allowAbsoluteUrls);
    return (0,_helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_1__["default"])(fullPath, config.params, config.paramsSerializer);
  }
}

// Provide aliases for supported request methods
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
  /*eslint func-names:0*/
  Axios.prototype[method] = function(url, config) {
    return this.request((0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_4__["default"])(config || {}, {
      method,
      url,
      data: (config || {}).data
    }));
  };
});

_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  /*eslint func-names:0*/

  function generateHTTPMethod(isForm) {
    return function httpMethod(url, data, config) {
      return this.request((0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_4__["default"])(config || {}, {
        method,
        headers: isForm ? {
          'Content-Type': 'multipart/form-data'
        } : {},
        url,
        data
      }));
    };
  }

  Axios.prototype[method] = generateHTTPMethod();

  Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
});

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Axios);


/***/ }),

/***/ "./node_modules/axios/lib/core/AxiosError.js":
/*!***************************************************!*\
  !*** ./node_modules/axios/lib/core/AxiosError.js ***!
  \***************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js");




/**
 * Create an Error with the specified message, config, error code, request and response.
 *
 * @param {string} message The error message.
 * @param {string} [code] The error code (for example, 'ECONNABORTED').
 * @param {Object} [config] The config.
 * @param {Object} [request] The request.
 * @param {Object} [response] The response.
 *
 * @returns {Error} The created error.
 */
function AxiosError(message, code, config, request, response) {
  Error.call(this);

  if (Error.captureStackTrace) {
    Error.captureStackTrace(this, this.constructor);
  } else {
    this.stack = (new Error()).stack;
  }

  this.message = message;
  this.name = 'AxiosError';
  code && (this.code = code);
  config && (this.config = config);
  request && (this.request = request);
  if (response) {
    this.response = response;
    this.status = response.status ? response.status : null;
  }
}

_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].inherits(AxiosError, Error, {
  toJSON: function toJSON() {
    return {
      // Standard
      message: this.message,
      name: this.name,
      // Microsoft
      description: this.description,
      number: this.number,
      // Mozilla
      fileName: this.fileName,
      lineNumber: this.lineNumber,
      columnNumber: this.columnNumber,
      stack: this.stack,
      // Axios
      config: _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toJSONObject(this.config),
      code: this.code,
      status: this.status
    };
  }
});

const prototype = AxiosError.prototype;
const descriptors = {};

[
  'ERR_BAD_OPTION_VALUE',
  'ERR_BAD_OPTION',
  'ECONNABORTED',
  'ETIMEDOUT',
  'ERR_NETWORK',
  'ERR_FR_TOO_MANY_REDIRECTS',
  'ERR_DEPRECATED',
  'ERR_BAD_RESPONSE',
  'ERR_BAD_REQUEST',
  'ERR_CANCELED',
  'ERR_NOT_SUPPORT',
  'ERR_INVALID_URL'
// eslint-disable-next-line func-names
].forEach(code => {
  descriptors[code] = {value: code};
});

Object.defineProperties(AxiosError, descriptors);
Object.defineProperty(prototype, 'isAxiosError', {value: true});

// eslint-disable-next-line func-names
AxiosError.from = (error, code, config, request, response, customProps) => {
  const axiosError = Object.create(prototype);

  _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(error, axiosError, function filter(obj) {
    return obj !== Error.prototype;
  }, prop => {
    return prop !== 'isAxiosError';
  });

  const msg = error && error.message ? error.message : 'Error';

  // Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)
  const errCode = code == null && error ? error.code : code;
  AxiosError.call(axiosError, msg, errCode, config, request, response);

  // Chain the original error on the standard field; non-enumerable to avoid JSON noise
  if (error && axiosError.cause == null) {
    Object.defineProperty(axiosError, 'cause', { value: error, configurable: true });
  }

  axiosError.name = (error && error.name) || 'Error';

  customProps && Object.assign(axiosError, customProps);

  return axiosError;
};

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosError);


/***/ }),

/***/ "./node_modules/axios/lib/core/AxiosHeaders.js":
/*!*****************************************************!*\
  !*** ./node_modules/axios/lib/core/AxiosHeaders.js ***!
  \*****************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js");
/* harmony import */ var _helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/parseHeaders.js */ "./node_modules/axios/lib/helpers/parseHeaders.js");





const $internals = Symbol('internals');

function normalizeHeader(header) {
  return header && String(header).trim().toLowerCase();
}

function normalizeValue(value) {
  if (value === false || value == null) {
    return value;
  }

  return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) ? value.map(normalizeValue) : String(value);
}

function parseTokens(str) {
  const tokens = Object.create(null);
  const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
  let match;

  while ((match = tokensRE.exec(str))) {
    tokens[match[1]] = match[2];
  }

  return tokens;
}

const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());

function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
  if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(filter)) {
    return filter.call(this, value, header);
  }

  if (isHeaderNameFilter) {
    value = header;
  }

  if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(value)) return;

  if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(filter)) {
    return value.indexOf(filter) !== -1;
  }

  if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isRegExp(filter)) {
    return filter.test(value);
  }
}

function formatHeader(header) {
  return header.trim()
    .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
      return char.toUpperCase() + str;
    });
}

function buildAccessors(obj, header) {
  const accessorName = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toCamelCase(' ' + header);

  ['get', 'set', 'has'].forEach(methodName => {
    Object.defineProperty(obj, methodName + accessorName, {
      value: function(arg1, arg2, arg3) {
        return this[methodName].call(this, header, arg1, arg2, arg3);
      },
      configurable: true
    });
  });
}

class AxiosHeaders {
  constructor(headers) {
    headers && this.set(headers);
  }

  set(header, valueOrRewrite, rewrite) {
    const self = this;

    function setHeader(_value, _header, _rewrite) {
      const lHeader = normalizeHeader(_header);

      if (!lHeader) {
        throw new Error('header name must be a non-empty string');
      }

      const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(self, lHeader);

      if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
        self[key || _header] = normalizeValue(_value);
      }
    }

    const setHeaders = (headers, _rewrite) =>
      _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));

    if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(header) || header instanceof this.constructor) {
      setHeaders(header, valueOrRewrite)
    } else if(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
      setHeaders((0,_helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"])(header), valueOrRewrite);
    } else if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(header) && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isIterable(header)) {
      let obj = {}, dest, key;
      for (const entry of header) {
        if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(entry)) {
          throw TypeError('Object iterator must return a key-value pair');
        }

        obj[key = entry[0]] = (dest = obj[key]) ?
          (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
      }

      setHeaders(obj, valueOrRewrite)
    } else {
      header != null && setHeader(valueOrRewrite, header, rewrite);
    }

    return this;
  }

  get(header, parser) {
    header = normalizeHeader(header);

    if (header) {
      const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(this, header);

      if (key) {
        const value = this[key];

        if (!parser) {
          return value;
        }

        if (parser === true) {
          return parseTokens(value);
        }

        if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(parser)) {
          return parser.call(this, value, key);
        }

        if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isRegExp(parser)) {
          return parser.exec(value);
        }

        throw new TypeError('parser must be boolean|regexp|function');
      }
    }
  }

  has(header, matcher) {
    header = normalizeHeader(header);

    if (header) {
      const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(this, header);

      return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
    }

    return false;
  }

  delete(header, matcher) {
    const self = this;
    let deleted = false;

    function deleteHeader(_header) {
      _header = normalizeHeader(_header);

      if (_header) {
        const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(self, _header);

        if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
          delete self[key];

          deleted = true;
        }
      }
    }

    if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(header)) {
      header.forEach(deleteHeader);
    } else {
      deleteHeader(header);
    }

    return deleted;
  }

  clear(matcher) {
    const keys = Object.keys(this);
    let i = keys.length;
    let deleted = false;

    while (i--) {
      const key = keys[i];
      if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
        delete this[key];
        deleted = true;
      }
    }

    return deleted;
  }

  normalize(format) {
    const self = this;
    const headers = {};

    _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this, (value, header) => {
      const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(headers, header);

      if (key) {
        self[key] = normalizeValue(value);
        delete self[header];
        return;
      }

      const normalized = format ? formatHeader(header) : String(header).trim();

      if (normalized !== header) {
        delete self[header];
      }

      self[normalized] = normalizeValue(value);

      headers[normalized] = true;
    });

    return this;
  }

  concat(...targets) {
    return this.constructor.concat(this, ...targets);
  }

  toJSON(asStrings) {
    const obj = Object.create(null);

    _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this, (value, header) => {
      value != null && value !== false && (obj[header] = asStrings && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) ? value.join(', ') : value);
    });

    return obj;
  }

  [Symbol.iterator]() {
    return Object.entries(this.toJSON())[Symbol.iterator]();
  }

  toString() {
    return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
  }

  getSetCookie() {
    return this.get("set-cookie") || [];
  }

  get [Symbol.toStringTag]() {
    return 'AxiosHeaders';
  }

  static from(thing) {
    return thing instanceof this ? thing : new this(thing);
  }

  static concat(first, ...targets) {
    const computed = new this(first);

    targets.forEach((target) => computed.set(target));

    return computed;
  }

  static accessor(header) {
    const internals = this[$internals] = (this[$internals] = {
      accessors: {}
    });

    const accessors = internals.accessors;
    const prototype = this.prototype;

    function defineAccessor(_header) {
      const lHeader = normalizeHeader(_header);

      if (!accessors[lHeader]) {
        buildAccessors(prototype, _header);
        accessors[lHeader] = true;
      }
    }

    _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);

    return this;
  }
}

AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);

// reserved names hotfix
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
  let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
  return {
    get: () => value,
    set(headerValue) {
      this[mapped] = headerValue;
    }
  }
});

_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].freezeMethods(AxiosHeaders);

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosHeaders);


/***/ }),

/***/ "./node_modules/axios/lib/core/InterceptorManager.js":
/*!***********************************************************!*\
  !*** ./node_modules/axios/lib/core/InterceptorManager.js ***!
  \***********************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js");




class InterceptorManager {
  constructor() {
    this.handlers = [];
  }

  /**
   * Add a new interceptor to the stack
   *
   * @param {Function} fulfilled The function to handle `then` for a `Promise`
   * @param {Function} rejected The function to handle `reject` for a `Promise`
   *
   * @return {Number} An ID used to remove interceptor later
   */
  use(fulfilled, rejected, options) {
    this.handlers.push({
      fulfilled,
      rejected,
      synchronous: options ? options.synchronous : false,
      runWhen: options ? options.runWhen : null
    });
    return this.handlers.length - 1;
  }

  /**
   * Remove an interceptor from the stack
   *
   * @param {Number} id The ID that was returned by `use`
   *
   * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
   */
  eject(id) {
    if (this.handlers[id]) {
      this.handlers[id] = null;
    }
  }

  /**
   * Clear all interceptors from the stack
   *
   * @returns {void}
   */
  clear() {
    if (this.handlers) {
      this.handlers = [];
    }
  }

  /**
   * Iterate over all the registered interceptors
   *
   * This method is particularly useful for skipping over any
   * interceptors that may have become `null` calling `eject`.
   *
   * @param {Function} fn The function to call for each interceptor
   *
   * @returns {void}
   */
  forEach(fn) {
    _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this.handlers, function forEachHandler(h) {
      if (h !== null) {
        fn(h);
      }
    });
  }
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InterceptorManager);


/***/ }),

/***/ "./node_modules/axios/lib/core/buildFullPath.js":
/*!******************************************************!*\
  !*** ./node_modules/axios/lib/core/buildFullPath.js ***!
  \******************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ buildFullPath)
/* harmony export */ });
/* harmony import */ var _helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/isAbsoluteURL.js */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js");
/* harmony import */ var _helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/combineURLs.js */ "./node_modules/axios/lib/helpers/combineURLs.js");





/**
 * Creates a new URL by combining the baseURL with the requestedURL,
 * only when the requestedURL is not already an absolute URL.
 * If the requestURL is absolute, this function returns the requestedURL untouched.
 *
 * @param {string} baseURL The base URL
 * @param {string} requestedURL Absolute or relative URL to combine
 *
 * @returns {string} The combined full path
 */
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
  let isRelativeUrl = !(0,_helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__["default"])(requestedURL);
  if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
    return (0,_helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__["default"])(baseURL, requestedURL);
  }
  return requestedURL;
}


/***/ }),

/***/ "./node_modules/axios/lib/core/dispatchRequest.js":
/*!********************************************************!*\
  !*** ./node_modules/axios/lib/core/dispatchRequest.js ***!
  \********************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ dispatchRequest)
/* harmony export */ });
/* harmony import */ var _transformData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./transformData.js */ "./node_modules/axios/lib/core/transformData.js");
/* harmony import */ var _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../cancel/isCancel.js */ "./node_modules/axios/lib/cancel/isCancel.js");
/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../defaults/index.js */ "./node_modules/axios/lib/defaults/index.js");
/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js");
/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js");
/* harmony import */ var _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../adapters/adapters.js */ "./node_modules/axios/lib/adapters/adapters.js");









/**
 * Throws a `CanceledError` if cancellation has been requested.
 *
 * @param {Object} config The config that is to be used for the request
 *
 * @returns {void}
 */
function throwIfCancellationRequested(config) {
  if (config.cancelToken) {
    config.cancelToken.throwIfRequested();
  }

  if (config.signal && config.signal.aborted) {
    throw new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_3__["default"](null, config);
  }
}

/**
 * Dispatch a request to the server using the configured adapter.
 *
 * @param {object} config The config that is to be used for the request
 *
 * @returns {Promise} The Promise to be fulfilled
 */
function dispatchRequest(config) {
  throwIfCancellationRequested(config);

  config.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__["default"].from(config.headers);

  // Transform request data
  config.data = _transformData_js__WEBPACK_IMPORTED_MODULE_0__["default"].call(
    config,
    config.transformRequest
  );

  if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
    config.headers.setContentType('application/x-www-form-urlencoded', false);
  }

  const adapter = _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_5__["default"].getAdapter(config.adapter || _defaults_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].adapter, config);

  return adapter(config).then(function onAdapterResolution(response) {
    throwIfCancellationRequested(config);

    // Transform response data
    response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_0__["default"].call(
      config,
      config.transformResponse,
      response
    );

    response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__["default"].from(response.headers);

    return response;
  }, function onAdapterRejection(reason) {
    if (!(0,_cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_1__["default"])(reason)) {
      throwIfCancellationRequested(config);

      // Transform response data
      if (reason && reason.response) {
        reason.response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_0__["default"].call(
          config,
          config.transformResponse,
          reason.response
        );
        reason.response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__["default"].from(reason.response.headers);
      }
    }

    return Promise.reject(reason);
  });
}


/***/ }),

/***/ "./node_modules/axios/lib/core/mergeConfig.js":
/*!****************************************************!*\
  !*** ./node_modules/axios/lib/core/mergeConfig.js ***!
  \****************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ mergeConfig)
/* harmony export */ });
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js");
/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js");





const headersToObject = (thing) => thing instanceof _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"] ? { ...thing } : thing;

/**
 * Config-specific merge-function which creates a new config-object
 * by merging two configuration objects together.
 *
 * @param {Object} config1
 * @param {Object} config2
 *
 * @returns {Object} New object resulting from merging config2 to config1
 */
function mergeConfig(config1, config2) {
  // eslint-disable-next-line no-param-reassign
  config2 = config2 || {};
  const config = {};

  function getMergedValue(target, source, prop, caseless) {
    if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(target) && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(source)) {
      return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].merge.call({caseless}, target, source);
    } else if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(source)) {
      return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].merge({}, source);
    } else if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(source)) {
      return source.slice();
    }
    return source;
  }

  // eslint-disable-next-line consistent-return
  function mergeDeepProperties(a, b, prop , caseless) {
    if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(b)) {
      return getMergedValue(a, b, prop , caseless);
    } else if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(a)) {
      return getMergedValue(undefined, a, prop , caseless);
    }
  }

  // eslint-disable-next-line consistent-return
  function valueFromConfig2(a, b) {
    if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(b)) {
      return getMergedValue(undefined, b);
    }
  }

  // eslint-disable-next-line consistent-return
  function defaultToConfig2(a, b) {
    if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(b)) {
      return getMergedValue(undefined, b);
    } else if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(a)) {
      return getMergedValue(undefined, a);
    }
  }

  // eslint-disable-next-line consistent-return
  function mergeDirectKeys(a, b, prop) {
    if (prop in config2) {
      return getMergedValue(a, b);
    } else if (prop in config1) {
      return getMergedValue(undefined, a);
    }
  }

  const mergeMap = {
    url: valueFromConfig2,
    method: valueFromConfig2,
    data: valueFromConfig2,
    baseURL: defaultToConfig2,
    transformRequest: defaultToConfig2,
    transformResponse: defaultToConfig2,
    paramsSerializer: defaultToConfig2,
    timeout: defaultToConfig2,
    timeoutMessage: defaultToConfig2,
    withCredentials: defaultToConfig2,
    withXSRFToken: defaultToConfig2,
    adapter: defaultToConfig2,
    responseType: defaultToConfig2,
    xsrfCookieName: defaultToConfig2,
    xsrfHeaderName: defaultToConfig2,
    onUploadProgress: defaultToConfig2,
    onDownloadProgress: defaultToConfig2,
    decompress: defaultToConfig2,
    maxContentLength: defaultToConfig2,
    maxBodyLength: defaultToConfig2,
    beforeRedirect: defaultToConfig2,
    transport: defaultToConfig2,
    httpAgent: defaultToConfig2,
    httpsAgent: defaultToConfig2,
    cancelToken: defaultToConfig2,
    socketPath: defaultToConfig2,
    responseEncoding: defaultToConfig2,
    validateStatus: mergeDirectKeys,
    headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
  };

  _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
    const merge = mergeMap[prop] || mergeDeepProperties;
    const configValue = merge(config1[prop], config2[prop], prop);
    (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
  });

  return config;
}


/***/ }),

/***/ "./node_modules/axios/lib/core/settle.js":
/*!***********************************************!*\
  !*** ./node_modules/axios/lib/core/settle.js ***!
  \***********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ settle)
/* harmony export */ });
/* harmony import */ var _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js");




/**
 * Resolve or reject a Promise based on response status.
 *
 * @param {Function} resolve A function that resolves the promise.
 * @param {Function} reject A function that rejects the promise.
 * @param {object} response The response.
 *
 * @returns {object} The response.
 */
function settle(resolve, reject, response) {
  const validateStatus = response.config.validateStatus;
  if (!response.status || !validateStatus || validateStatus(response.status)) {
    resolve(response);
  } else {
    reject(new _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"](
      'Request failed with status code ' + response.status,
      [_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_REQUEST, _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
      response.config,
      response.request,
      response
    ));
  }
}


/***/ }),

/***/ "./node_modules/axios/lib/core/transformData.js":
/*!******************************************************!*\
  !*** ./node_modules/axios/lib/core/transformData.js ***!
  \******************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ transformData)
/* harmony export */ });
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js");
/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../defaults/index.js */ "./node_modules/axios/lib/defaults/index.js");
/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js");






/**
 * Transform the data for a request or a response
 *
 * @param {Array|Function} fns A single function or Array of functions
 * @param {?Object} response The response object
 *
 * @returns {*} The resulting transformed data
 */
function transformData(fns, response) {
  const config = this || _defaults_index_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  const context = response || config;
  const headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_2__["default"].from(context.headers);
  let data = context.data;

  _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(fns, function transform(fn) {
    data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
  });

  headers.normalize();

  return data;
}


/***/ }),

/***/ "./node_modules/axios/lib/defaults/index.js":
/*!**************************************************!*\
  !*** ./node_modules/axios/lib/defaults/index.js ***!
  \**************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js");
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js");
/* harmony import */ var _transitional_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transitional.js */ "./node_modules/axios/lib/defaults/transitional.js");
/* harmony import */ var _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js");
/* harmony import */ var _helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/toURLEncodedForm.js */ "./node_modules/axios/lib/helpers/toURLEncodedForm.js");
/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js");
/* harmony import */ var _helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../helpers/formDataToJSON.js */ "./node_modules/axios/lib/helpers/formDataToJSON.js");










/**
 * It takes a string, tries to parse it, and if it fails, it returns the stringified version
 * of the input
 *
 * @param {any} rawValue - The value to be stringified.
 * @param {Function} parser - A function that parses a string into a JavaScript object.
 * @param {Function} encoder - A function that takes a value and returns a string.
 *
 * @returns {string} A stringified version of the rawValue.
 */
function stringifySafely(rawValue, parser, encoder) {
  if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(rawValue)) {
    try {
      (parser || JSON.parse)(rawValue);
      return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].trim(rawValue);
    } catch (e) {
      if (e.name !== 'SyntaxError') {
        throw e;
      }
    }
  }

  return (encoder || JSON.stringify)(rawValue);
}

const defaults = {

  transitional: _transitional_js__WEBPACK_IMPORTED_MODULE_2__["default"],

  adapter: ['xhr', 'http', 'fetch'],

  transformRequest: [function transformRequest(data, headers) {
    const contentType = headers.getContentType() || '';
    const hasJSONContentType = contentType.indexOf('application/json') > -1;
    const isObjectPayload = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(data);

    if (isObjectPayload && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isHTMLForm(data)) {
      data = new FormData(data);
    }

    const isFormData = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFormData(data);

    if (isFormData) {
      return hasJSONContentType ? JSON.stringify((0,_helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_6__["default"])(data)) : data;
    }

    if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBuffer(data) ||
      _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBuffer(data) ||
      _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isStream(data) ||
      _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFile(data) ||
      _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBlob(data) ||
      _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isReadableStream(data)
    ) {
      return data;
    }
    if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBufferView(data)) {
      return data.buffer;
    }
    if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isURLSearchParams(data)) {
      headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
      return data.toString();
    }

    let isFileList;

    if (isObjectPayload) {
      if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
        return (0,_helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_4__["default"])(data, this.formSerializer).toString();
      }

      if ((isFileList = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
        const _FormData = this.env && this.env.FormData;

        return (0,_helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_3__["default"])(
          isFileList ? {'files[]': data} : data,
          _FormData && new _FormData(),
          this.formSerializer
        );
      }
    }

    if (isObjectPayload || hasJSONContentType ) {
      headers.setContentType('application/json', false);
      return stringifySafely(data);
    }

    return data;
  }],

  transformResponse: [function transformResponse(data) {
    const transitional = this.transitional || defaults.transitional;
    const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
    const JSONRequested = this.responseType === 'json';

    if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isResponse(data) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isReadableStream(data)) {
      return data;
    }

    if (data && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
      const silentJSONParsing = transitional && transitional.silentJSONParsing;
      const strictJSONParsing = !silentJSONParsing && JSONRequested;

      try {
        return JSON.parse(data, this.parseReviver);
      } catch (e) {
        if (strictJSONParsing) {
          if (e.name === 'SyntaxError') {
            throw _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(e, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_RESPONSE, this, null, this.response);
          }
          throw e;
        }
      }
    }

    return data;
  }],

  /**
   * A timeout in milliseconds to abort a request. If set to 0 (default) a
   * timeout is not created.
   */
  timeout: 0,

  xsrfCookieName: 'XSRF-TOKEN',
  xsrfHeaderName: 'X-XSRF-TOKEN',

  maxContentLength: -1,
  maxBodyLength: -1,

  env: {
    FormData: _platform_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].classes.FormData,
    Blob: _platform_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].classes.Blob
  },

  validateStatus: function validateStatus(status) {
    return status >= 200 && status < 300;
  },

  headers: {
    common: {
      'Accept': 'application/json, text/plain, */*',
      'Content-Type': undefined
    }
  }
};

_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
  defaults.headers[method] = {};
});

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (defaults);


/***/ }),

/***/ "./node_modules/axios/lib/defaults/transitional.js":
/*!*********************************************************!*\
  !*** ./node_modules/axios/lib/defaults/transitional.js ***!
  \*********************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  silentJSONParsing: true,
  forcedJSONParsing: true,
  clarifyTimeoutError: false
});


/***/ }),

/***/ "./node_modules/axios/lib/env/data.js":
/*!********************************************!*\
  !*** ./node_modules/axios/lib/env/data.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   VERSION: () => (/* binding */ VERSION)
/* harmony export */ });
const VERSION = "1.12.2";

/***/ }),

/***/ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js":
/*!****************************************************************!*\
  !*** ./node_modules/axios/lib/helpers/AxiosURLSearchParams.js ***!
  \****************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _toFormData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js");




/**
 * It encodes a string by replacing all characters that are not in the unreserved set with
 * their percent-encoded equivalents
 *
 * @param {string} str - The string to encode.
 *
 * @returns {string} The encoded string.
 */
function encode(str) {
  const charMap = {
    '!': '%21',
    "'": '%27',
    '(': '%28',
    ')': '%29',
    '~': '%7E',
    '%20': '+',
    '%00': '\x00'
  };
  return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
    return charMap[match];
  });
}

/**
 * It takes a params object and converts it to a FormData object
 *
 * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
 * @param {Object<string, any>} options - The options object passed to the Axios constructor.
 *
 * @returns {void}
 */
function AxiosURLSearchParams(params, options) {
  this._pairs = [];

  params && (0,_toFormData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(params, this, options);
}

const prototype = AxiosURLSearchParams.prototype;

prototype.append = function append(name, value) {
  this._pairs.push([name, value]);
};

prototype.toString = function toString(encoder) {
  const _encode = encoder ? function(value) {
    return encoder.call(this, value, encode);
  } : encode;

  return this._pairs.map(function each(pair) {
    return _encode(pair[0]) + '=' + _encode(pair[1]);
  }, '').join('&');
};

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosURLSearchParams);


/***/ }),

/***/ "./node_modules/axios/lib/helpers/HttpStatusCode.js":
/*!**********************************************************!*\
  !*** ./node_modules/axios/lib/helpers/HttpStatusCode.js ***!
  \**********************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
const HttpStatusCode = {
  Continue: 100,
  SwitchingProtocols: 101,
  Processing: 102,
  EarlyHints: 103,
  Ok: 200,
  Created: 201,
  Accepted: 202,
  NonAuthoritativeInformation: 203,
  NoContent: 204,
  ResetContent: 205,
  PartialContent: 206,
  MultiStatus: 207,
  AlreadyReported: 208,
  ImUsed: 226,
  MultipleChoices: 300,
  MovedPermanently: 301,
  Found: 302,
  SeeOther: 303,
  NotModified: 304,
  UseProxy: 305,
  Unused: 306,
  TemporaryRedirect: 307,
  PermanentRedirect: 308,
  BadRequest: 400,
  Unauthorized: 401,
  PaymentRequired: 402,
  Forbidden: 403,
  NotFound: 404,
  MethodNotAllowed: 405,
  NotAcceptable: 406,
  ProxyAuthenticationRequired: 407,
  RequestTimeout: 408,
  Conflict: 409,
  Gone: 410,
  LengthRequired: 411,
  PreconditionFailed: 412,
  PayloadTooLarge: 413,
  UriTooLong: 414,
  UnsupportedMediaType: 415,
  RangeNotSatisfiable: 416,
  ExpectationFailed: 417,
  ImATeapot: 418,
  MisdirectedRequest: 421,
  UnprocessableEntity: 422,
  Locked: 423,
  FailedDependency: 424,
  TooEarly: 425,
  UpgradeRequired: 426,
  PreconditionRequired: 428,
  TooManyRequests: 429,
  RequestHeaderFieldsTooLarge: 431,
  UnavailableForLegalReasons: 451,
  InternalServerError: 500,
  NotImplemented: 501,
  BadGateway: 502,
  ServiceUnavailable: 503,
  GatewayTimeout: 504,
  HttpVersionNotSupported: 505,
  VariantAlsoNegotiates: 506,
  InsufficientStorage: 507,
  LoopDetected: 508,
  NotExtended: 510,
  NetworkAuthenticationRequired: 511,
};

Object.entries(HttpStatusCode).forEach(([key, value]) => {
  HttpStatusCode[value] = key;
});

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (HttpStatusCode);


/***/ }),

/***/ "./node_modules/axios/lib/helpers/bind.js":
/*!************************************************!*\
  !*** ./node_modules/axios/lib/helpers/bind.js ***!
  \************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ bind)
/* harmony export */ });


function bind(fn, thisArg) {
  return function wrap() {
    return fn.apply(thisArg, arguments);
  };
}


/***/ }),

/***/ "./node_modules/axios/lib/helpers/buildURL.js":
/*!****************************************************!*\
  !*** ./node_modules/axios/lib/helpers/buildURL.js ***!
  \****************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ buildURL)
/* harmony export */ });
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js");
/* harmony import */ var _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/AxiosURLSearchParams.js */ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js");





/**
 * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
 * URI encoded counterparts
 *
 * @param {string} val The value to be encoded.
 *
 * @returns {string} The encoded value.
 */
function encode(val) {
  return encodeURIComponent(val).
    replace(/%3A/gi, ':').
    replace(/%24/g, '$').
    replace(/%2C/gi, ',').
    replace(/%20/g, '+');
}

/**
 * Build a URL by appending params to the end
 *
 * @param {string} url The base of the url (e.g., http://www.google.com)
 * @param {object} [params] The params to be appended
 * @param {?(object|Function)} options
 *
 * @returns {string} The formatted url
 */
function buildURL(url, params, options) {
  /*eslint no-param-reassign:0*/
  if (!params) {
    return url;
  }
  
  const _encode = options && options.encode || encode;

  if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(options)) {
    options = {
      serialize: options
    };
  } 

  const serializeFn = options && options.serialize;

  let serializedParams;

  if (serializeFn) {
    serializedParams = serializeFn(params, options);
  } else {
    serializedParams = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isURLSearchParams(params) ?
      params.toString() :
      new _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__["default"](params, options).toString(_encode);
  }

  if (serializedParams) {
    const hashmarkIndex = url.indexOf("#");

    if (hashmarkIndex !== -1) {
      url = url.slice(0, hashmarkIndex);
    }
    url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
  }

  return url;
}


/***/ }),

/***/ "./node_modules/axios/lib/helpers/combineURLs.js":
/*!*******************************************************!*\
  !*** ./node_modules/axios/lib/helpers/combineURLs.js ***!
  \*******************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ combineURLs)
/* harmony export */ });


/**
 * Creates a new URL by combining the specified URLs
 *
 * @param {string} baseURL The base URL
 * @param {string} relativeURL The relative URL
 *
 * @returns {string} The combined URL
 */
function combineURLs(baseURL, relativeURL) {
  return relativeURL
    ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
    : baseURL;
}


/***/ }),

/***/ "./node_modules/axios/lib/helpers/composeSignals.js":
/*!**********************************************************!*\
  !*** ./node_modules/axios/lib/helpers/composeSignals.js ***!
  \**********************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js");
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js");




const composeSignals = (signals, timeout) => {
  const {length} = (signals = signals ? signals.filter(Boolean) : []);

  if (timeout || length) {
    let controller = new AbortController();

    let aborted;

    const onabort = function (reason) {
      if (!aborted) {
        aborted = true;
        unsubscribe();
        const err = reason instanceof Error ? reason : this.reason;
        controller.abort(err instanceof _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"] ? err : new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__["default"](err instanceof Error ? err.message : err));
      }
    }

    let timer = timeout && setTimeout(() => {
      timer = null;
      onabort(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"](`timeout ${timeout} of ms exceeded`, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ETIMEDOUT))
    }, timeout)

    const unsubscribe = () => {
      if (signals) {
        timer && clearTimeout(timer);
        timer = null;
        signals.forEach(signal => {
          signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
        });
        signals = null;
      }
    }

    signals.forEach((signal) => signal.addEventListener('abort', onabort));

    const {signal} = controller;

    signal.unsubscribe = () => _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].asap(unsubscribe);

    return signal;
  }
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (composeSignals);


/***/ }),

/***/ "./node_modules/axios/lib/helpers/cookies.js":
/*!***************************************************!*\
  !*** ./node_modules/axios/lib/helpers/cookies.js ***!
  \***************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js");
/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js");



/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_platform_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].hasStandardBrowserEnv ?

  // Standard browser envs support document.cookie
  {
    write(name, value, expires, path, domain, secure) {
      const cookie = [name + '=' + encodeURIComponent(value)];

      _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());

      _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(path) && cookie.push('path=' + path);

      _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(domain) && cookie.push('domain=' + domain);

      secure === true && cookie.push('secure');

      document.cookie = cookie.join('; ');
    },

    read(name) {
      const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
      return (match ? decodeURIComponent(match[3]) : null);
    },

    remove(name) {
      this.write(name, '', Date.now() - 86400000);
    }
  }

  :

  // Non-standard browser env (web workers, react-native) lack needed support.
  {
    write() {},
    read() {
      return null;
    },
    remove() {}
  });



/***/ }),

/***/ "./node_modules/axios/lib/helpers/formDataToJSON.js":
/*!**********************************************************!*\
  !*** ./node_modules/axios/lib/helpers/formDataToJSON.js ***!
  \**********************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js");




/**
 * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
 *
 * @param {string} name - The name of the property to get.
 *
 * @returns An array of strings.
 */
function parsePropPath(name) {
  // foo[x][y][z]
  // foo.x.y.z
  // foo-x-y-z
  // foo x y z
  return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].matchAll(/\w+|\[(\w*)]/g, name).map(match => {
    return match[0] === '[]' ? '' : match[1] || match[0];
  });
}

/**
 * Convert an array to an object.
 *
 * @param {Array<any>} arr - The array to convert to an object.
 *
 * @returns An object with the same keys and values as the array.
 */
function arrayToObject(arr) {
  const obj = {};
  const keys = Object.keys(arr);
  let i;
  const len = keys.length;
  let key;
  for (i = 0; i < len; i++) {
    key = keys[i];
    obj[key] = arr[key];
  }
  return obj;
}

/**
 * It takes a FormData object and returns a JavaScript object
 *
 * @param {string} formData The FormData object to convert to JSON.
 *
 * @returns {Object<string, any> | null} The converted object.
 */
function formDataToJSON(formData) {
  function buildPath(path, value, target, index) {
    let name = path[index++];

    if (name === '__proto__') return true;

    const isNumericKey = Number.isFinite(+name);
    const isLast = index >= path.length;
    name = !name && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(target) ? target.length : name;

    if (isLast) {
      if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasOwnProp(target, name)) {
        target[name] = [target[name], value];
      } else {
        target[name] = value;
      }

      return !isNumericKey;
    }

    if (!target[name] || !_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(target[name])) {
      target[name] = [];
    }

    const result = buildPath(path, value, target[name], index);

    if (result && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(target[name])) {
      target[name] = arrayToObject(target[name]);
    }

    return !isNumericKey;
  }

  if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFormData(formData) && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(formData.entries)) {
    const obj = {};

    _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEachEntry(formData, (name, value) => {
      buildPath(parsePropPath(name), value, obj, 0);
    });

    return obj;
  }

  return null;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (formDataToJSON);


/***/ }),

/***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js":
/*!*********************************************************!*\
  !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***!
  \*********************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ isAbsoluteURL)
/* harmony export */ });


/**
 * Determines whether the specified URL is absolute
 *
 * @param {string} url The URL to test
 *
 * @returns {boolean} True if the specified URL is absolute, otherwise false
 */
function isAbsoluteURL(url) {
  // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
  // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
  // by any combination of letters, digits, plus, period, or hyphen.
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
}


/***/ }),

/***/ "./node_modules/axios/lib/helpers/isAxiosError.js":
/*!********************************************************!*\
  !*** ./node_modules/axios/lib/helpers/isAxiosError.js ***!
  \********************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ isAxiosError)
/* harmony export */ });
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js");




/**
 * Determines whether the payload is an error thrown by Axios
 *
 * @param {*} payload The value to test
 *
 * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
 */
function isAxiosError(payload) {
  return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(payload) && (payload.isAxiosError === true);
}


/***/ }),

/***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js":
/*!***********************************************************!*\
  !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***!
  \***********************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js");


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
  url = new URL(url, _platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].origin);

  return (
    origin.protocol === url.protocol &&
    origin.host === url.host &&
    (isMSIE || origin.port === url.port)
  );
})(
  new URL(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].origin),
  _platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].navigator && /(msie|trident)/i.test(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].navigator.userAgent)
) : () => true);


/***/ }),

/***/ "./node_modules/axios/lib/helpers/null.js":
/*!************************************************!*\
  !*** ./node_modules/axios/lib/helpers/null.js ***!
  \************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
// eslint-disable-next-line strict
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (null);


/***/ }),

/***/ "./node_modules/axios/lib/helpers/parseHeaders.js":
/*!********************************************************!*\
  !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***!
  \********************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js");




// RawAxiosHeaders whose duplicates are ignored by node
// c.f. https://nodejs.org/api/http.html#http_message_headers
const ignoreDuplicateOf = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toObjectSet([
  'age', 'authorization', 'content-length', 'content-type', 'etag',
  'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
  'last-modified', 'location', 'max-forwards', 'proxy-authorization',
  'referer', 'retry-after', 'user-agent'
]);

/**
 * Parse headers into an object
 *
 * ```
 * Date: Wed, 27 Aug 2014 08:58:49 GMT
 * Content-Type: application/json
 * Connection: keep-alive
 * Transfer-Encoding: chunked
 * ```
 *
 * @param {String} rawHeaders Headers needing to be parsed
 *
 * @returns {Object} Headers parsed into an object
 */
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (rawHeaders => {
  const parsed = {};
  let key;
  let val;
  let i;

  rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
    i = line.indexOf(':');
    key = line.substring(0, i).trim().toLowerCase();
    val = line.substring(i + 1).trim();

    if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
      return;
    }

    if (key === 'set-cookie') {
      if (parsed[key]) {
        parsed[key].push(val);
      } else {
        parsed[key] = [val];
      }
    } else {
      parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
    }
  });

  return parsed;
});


/***/ }),

/***/ "./node_modules/axios/lib/helpers/parseProtocol.js":
/*!*********************************************************!*\
  !*** ./node_modules/axios/lib/helpers/parseProtocol.js ***!
  \*********************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ parseProtocol)
/* harmony export */ });


function parseProtocol(url) {
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
  return match && match[1] || '';
}


/***/ }),

/***/ "./node_modules/axios/lib/helpers/progressEventReducer.js":
/*!****************************************************************!*\
  !*** ./node_modules/axios/lib/helpers/progressEventReducer.js ***!
  \****************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   asyncDecorator: () => (/* binding */ asyncDecorator),
/* harmony export */   progressEventDecorator: () => (/* binding */ progressEventDecorator),
/* harmony export */   progressEventReducer: () => (/* binding */ progressEventReducer)
/* harmony export */ });
/* harmony import */ var _speedometer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./speedometer.js */ "./node_modules/axios/lib/helpers/speedometer.js");
/* harmony import */ var _throttle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./throttle.js */ "./node_modules/axios/lib/helpers/throttle.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js");




const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
  let bytesNotified = 0;
  const _speedometer = (0,_speedometer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(50, 250);

  return (0,_throttle_js__WEBPACK_IMPORTED_MODULE_1__["default"])(e => {
    const loaded = e.loaded;
    const total = e.lengthComputable ? e.total : undefined;
    const progressBytes = loaded - bytesNotified;
    const rate = _speedometer(progressBytes);
    const inRange = loaded <= total;

    bytesNotified = loaded;

    const data = {
      loaded,
      total,
      progress: total ? (loaded / total) : undefined,
      bytes: progressBytes,
      rate: rate ? rate : undefined,
      estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
      event: e,
      lengthComputable: total != null,
      [isDownloadStream ? 'download' : 'upload']: true
    };

    listener(data);
  }, freq);
}

const progressEventDecorator = (total, throttled) => {
  const lengthComputable = total != null;

  return [(loaded) => throttled[0]({
    lengthComputable,
    total,
    loaded
  }), throttled[1]];
}

const asyncDecorator = (fn) => (...args) => _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].asap(() => fn(...args));


/***/ }),

/***/ "./node_modules/axios/lib/helpers/resolveConfig.js":
/*!*********************************************************!*\
  !*** ./node_modules/axios/lib/helpers/resolveConfig.js ***!
  \*********************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js");
/* harmony import */ var _isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isURLSameOrigin.js */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js");
/* harmony import */ var _cookies_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cookies.js */ "./node_modules/axios/lib/helpers/cookies.js");
/* harmony import */ var _core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/buildFullPath.js */ "./node_modules/axios/lib/core/buildFullPath.js");
/* harmony import */ var _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/mergeConfig.js */ "./node_modules/axios/lib/core/mergeConfig.js");
/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js");
/* harmony import */ var _buildURL_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./buildURL.js */ "./node_modules/axios/lib/helpers/buildURL.js");









/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((config) => {
  const newConfig = (0,_core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_5__["default"])({}, config);

  let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;

  newConfig.headers = headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_6__["default"].from(headers);

  newConfig.url = (0,_buildURL_js__WEBPACK_IMPORTED_MODULE_7__["default"])((0,_core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__["default"])(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);

  // HTTP basic authentication
  if (auth) {
    headers.set('Authorization', 'Basic ' +
      btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))
    );
  }

  if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isFormData(data)) {
    if (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasStandardBrowserEnv || _platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasStandardBrowserWebWorkerEnv) {
      headers.setContentType(undefined); // browser handles it
    } else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isFunction(data.getHeaders)) {
      // Node.js FormData (like form-data package)
      const formHeaders = data.getHeaders();
      // Only set safe headers to avoid overwriting security headers
      const allowedHeaders = ['content-type', 'content-length'];
      Object.entries(formHeaders).forEach(([key, val]) => {
        if (allowedHeaders.includes(key.toLowerCase())) {
          headers.set(key, val);
        }
      });
    }
  }  

  // Add xsrf header
  // This is only done if running in a standard browser environment.
  // Specifically not if we're in a web worker, or react-native.

  if (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasStandardBrowserEnv) {
    withXSRFToken && _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));

    if (withXSRFToken || (withXSRFToken !== false && (0,_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_2__["default"])(newConfig.url))) {
      // Add xsrf header
      const xsrfValue = xsrfHeaderName && xsrfCookieName && _cookies_js__WEBPACK_IMPORTED_MODULE_3__["default"].read(xsrfCookieName);

      if (xsrfValue) {
        headers.set(xsrfHeaderName, xsrfValue);
      }
    }
  }

  return newConfig;
});



/***/ }),

/***/ "./node_modules/axios/lib/helpers/speedometer.js":
/*!*******************************************************!*\
  !*** ./node_modules/axios/lib/helpers/speedometer.js ***!
  \*******************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });


/**
 * Calculate data maxRate
 * @param {Number} [samplesCount= 10]
 * @param {Number} [min= 1000]
 * @returns {Function}
 */
function speedometer(samplesCount, min) {
  samplesCount = samplesCount || 10;
  const bytes = new Array(samplesCount);
  const timestamps = new Array(samplesCount);
  let head = 0;
  let tail = 0;
  let firstSampleTS;

  min = min !== undefined ? min : 1000;

  return function push(chunkLength) {
    const now = Date.now();

    const startedAt = timestamps[tail];

    if (!firstSampleTS) {
      firstSampleTS = now;
    }

    bytes[head] = chunkLength;
    timestamps[head] = now;

    let i = tail;
    let bytesCount = 0;

    while (i !== head) {
      bytesCount += bytes[i++];
      i = i % samplesCount;
    }

    head = (head + 1) % samplesCount;

    if (head === tail) {
      tail = (tail + 1) % samplesCount;
    }

    if (now - firstSampleTS < min) {
      return;
    }

    const passed = startedAt && now - startedAt;

    return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
  };
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (speedometer);


/***/ }),

/***/ "./node_modules/axios/lib/helpers/spread.js":
/*!**************************************************!*\
  !*** ./node_modules/axios/lib/helpers/spread.js ***!
  \**************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ spread)
/* harmony export */ });


/**
 * Syntactic sugar for invoking a function and expanding an array for arguments.
 *
 * Common use case would be to use `Function.prototype.apply`.
 *
 *  ```js
 *  function f(x, y, z) {}
 *  var args = [1, 2, 3];
 *  f.apply(null, args);
 *  ```
 *
 * With `spread` this example can be re-written.
 *
 *  ```js
 *  spread(function(x, y, z) {})([1, 2, 3]);
 *  ```
 *
 * @param {Function} callback
 *
 * @returns {Function}
 */
function spread(callback) {
  return function wrap(arr) {
    return callback.apply(null, arr);
  };
}


/***/ }),

/***/ "./node_modules/axios/lib/helpers/throttle.js":
/*!****************************************************!*\
  !*** ./node_modules/axios/lib/helpers/throttle.js ***!
  \****************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Throttle decorator
 * @param {Function} fn
 * @param {Number} freq
 * @return {Function}
 */
function throttle(fn, freq) {
  let timestamp = 0;
  let threshold = 1000 / freq;
  let lastArgs;
  let timer;

  const invoke = (args, now = Date.now()) => {
    timestamp = now;
    lastArgs = null;
    if (timer) {
      clearTimeout(timer);
      timer = null;
    }
    fn(...args);
  }

  const throttled = (...args) => {
    const now = Date.now();
    const passed = now - timestamp;
    if ( passed >= threshold) {
      invoke(args, now);
    } else {
      lastArgs = args;
      if (!timer) {
        timer = setTimeout(() => {
          timer = null;
          invoke(lastArgs)
        }, threshold - passed);
      }
    }
  }

  const flush = () => lastArgs && invoke(lastArgs);

  return [throttled, flush];
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (throttle);


/***/ }),

/***/ "./node_modules/axios/lib/helpers/toFormData.js":
/*!******************************************************!*\
  !*** ./node_modules/axios/lib/helpers/toFormData.js ***!
  \******************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js");
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js");
/* harmony import */ var _platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../platform/node/classes/FormData.js */ "./node_modules/axios/lib/helpers/null.js");




// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored


/**
 * Determines if the given thing is a array or js object.
 *
 * @param {string} thing - The object or array to be visited.
 *
 * @returns {boolean}
 */
function isVisitable(thing) {
  return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(thing) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(thing);
}

/**
 * It removes the brackets from the end of a string
 *
 * @param {string} key - The key of the parameter.
 *
 * @returns {string} the key without the brackets.
 */
function removeBrackets(key) {
  return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '[]') ? key.slice(0, -2) : key;
}

/**
 * It takes a path, a key, and a boolean, and returns a string
 *
 * @param {string} path - The path to the current key.
 * @param {string} key - The key of the current object being iterated over.
 * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
 *
 * @returns {string} The path to the current key.
 */
function renderKey(path, key, dots) {
  if (!path) return key;
  return path.concat(key).map(function each(token, i) {
    // eslint-disable-next-line no-param-reassign
    token = removeBrackets(token);
    return !dots && i ? '[' + token + ']' : token;
  }).join(dots ? '.' : '');
}

/**
 * If the array is an array and none of its elements are visitable, then it's a flat array.
 *
 * @param {Array<any>} arr - The array to check
 *
 * @returns {boolean}
 */
function isFlatArray(arr) {
  return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(arr) && !arr.some(isVisitable);
}

const predicates = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"], {}, null, function filter(prop) {
  return /^is[A-Z]/.test(prop);
});

/**
 * Convert a data object to FormData
 *
 * @param {Object} obj
 * @param {?Object} [formData]
 * @param {?Object} [options]
 * @param {Function} [options.visitor]
 * @param {Boolean} [options.metaTokens = true]
 * @param {Boolean} [options.dots = false]
 * @param {?Boolean} [options.indexes = false]
 *
 * @returns {Object}
 **/

/**
 * It converts an object into a FormData object
 *
 * @param {Object<any, any>} obj - The object to convert to form data.
 * @param {string} formData - The FormData object to append to.
 * @param {Object<string, any>} options
 *
 * @returns
 */
function toFormData(obj, formData, options) {
  if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(obj)) {
    throw new TypeError('target must be an object');
  }

  // eslint-disable-next-line no-param-reassign
  formData = formData || new (_platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_2__["default"] || FormData)();

  // eslint-disable-next-line no-param-reassign
  options = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(options, {
    metaTokens: true,
    dots: false,
    indexes: false
  }, false, function defined(option, source) {
    // eslint-disable-next-line no-eq-null,eqeqeq
    return !_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(source[option]);
  });

  const metaTokens = options.metaTokens;
  // eslint-disable-next-line no-use-before-define
  const visitor = options.visitor || defaultVisitor;
  const dots = options.dots;
  const indexes = options.indexes;
  const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
  const useBlob = _Blob && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isSpecCompliantForm(formData);

  if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(visitor)) {
    throw new TypeError('visitor must be a function');
  }

  function convertValue(value) {
    if (value === null) return '';

    if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isDate(value)) {
      return value.toISOString();
    }

    if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBoolean(value)) {
      return value.toString();
    }

    if (!useBlob && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBlob(value)) {
      throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('Blob is not supported. Use a Buffer instead.');
    }

    if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBuffer(value) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isTypedArray(value)) {
      return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
    }

    return value;
  }

  /**
   * Default visitor.
   *
   * @param {*} value
   * @param {String|Number} key
   * @param {Array<String|Number>} path
   * @this {FormData}
   *
   * @returns {boolean} return true to visit the each prop of the value recursively
   */
  function defaultVisitor(value, key, path) {
    let arr = value;

    if (value && !path && typeof value === 'object') {
      if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '{}')) {
        // eslint-disable-next-line no-param-reassign
        key = metaTokens ? key : key.slice(0, -2);
        // eslint-disable-next-line no-param-reassign
        value = JSON.stringify(value);
      } else if (
        (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) && isFlatArray(value)) ||
        ((_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFileList(value) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '[]')) && (arr = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toArray(value))
        )) {
        // eslint-disable-next-line no-param-reassign
        key = removeBrackets(key);

        arr.forEach(function each(el, index) {
          !(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(el) || el === null) && formData.append(
            // eslint-disable-next-line no-nested-ternary
            indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
            convertValue(el)
          );
        });
        return false;
      }
    }

    if (isVisitable(value)) {
      return true;
    }

    formData.append(renderKey(path, key, dots), convertValue(value));

    return false;
  }

  const stack = [];

  const exposedHelpers = Object.assign(predicates, {
    defaultVisitor,
    convertValue,
    isVisitable
  });

  function build(value, path) {
    if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(value)) return;

    if (stack.indexOf(value) !== -1) {
      throw Error('Circular reference detected in ' + path.join('.'));
    }

    stack.push(value);

    _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(value, function each(el, key) {
      const result = !(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(el) || el === null) && visitor.call(
        formData, el, _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(key) ? key.trim() : key, path, exposedHelpers
      );

      if (result === true) {
        build(el, path ? path.concat(key) : [key]);
      }
    });

    stack.pop();
  }

  if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(obj)) {
    throw new TypeError('data must be an object');
  }

  build(obj);

  return formData;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (toFormData);


/***/ }),

/***/ "./node_modules/axios/lib/helpers/toURLEncodedForm.js":
/*!************************************************************!*\
  !*** ./node_modules/axios/lib/helpers/toURLEncodedForm.js ***!
  \************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ toURLEncodedForm)
/* harmony export */ });
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js");
/* harmony import */ var _toFormData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js");
/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js");






function toURLEncodedForm(data, options) {
  return (0,_toFormData_js__WEBPACK_IMPORTED_MODULE_1__["default"])(data, new _platform_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].classes.URLSearchParams(), {
    visitor: function(value, key, path, helpers) {
      if (_platform_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].isNode && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBuffer(value)) {
        this.append(key, value.toString('base64'));
        return false;
      }

      return helpers.defaultVisitor.apply(this, arguments);
    },
    ...options
  });
}


/***/ }),

/***/ "./node_modules/axios/lib/helpers/trackStream.js":
/*!*******************************************************!*\
  !*** ./node_modules/axios/lib/helpers/trackStream.js ***!
  \*******************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   readBytes: () => (/* binding */ readBytes),
/* harmony export */   streamChunk: () => (/* binding */ streamChunk),
/* harmony export */   trackStream: () => (/* binding */ trackStream)
/* harmony export */ });

const streamChunk = function* (chunk, chunkSize) {
  let len = chunk.byteLength;

  if (!chunkSize || len < chunkSize) {
    yield chunk;
    return;
  }

  let pos = 0;
  let end;

  while (pos < len) {
    end = pos + chunkSize;
    yield chunk.slice(pos, end);
    pos = end;
  }
}

const readBytes = async function* (iterable, chunkSize) {
  for await (const chunk of readStream(iterable)) {
    yield* streamChunk(chunk, chunkSize);
  }
}

const readStream = async function* (stream) {
  if (stream[Symbol.asyncIterator]) {
    yield* stream;
    return;
  }

  const reader = stream.getReader();
  try {
    for (;;) {
      const {done, value} = await reader.read();
      if (done) {
        break;
      }
      yield value;
    }
  } finally {
    await reader.cancel();
  }
}

const trackStream = (stream, chunkSize, onProgress, onFinish) => {
  const iterator = readBytes(stream, chunkSize);

  let bytes = 0;
  let done;
  let _onFinish = (e) => {
    if (!done) {
      done = true;
      onFinish && onFinish(e);
    }
  }

  return new ReadableStream({
    async pull(controller) {
      try {
        const {done, value} = await iterator.next();

        if (done) {
         _onFinish();
          controller.close();
          return;
        }

        let len = value.byteLength;
        if (onProgress) {
          let loadedBytes = bytes += len;
          onProgress(loadedBytes);
        }
        controller.enqueue(new Uint8Array(value));
      } catch (err) {
        _onFinish(err);
        throw err;
      }
    },
    cancel(reason) {
      _onFinish(reason);
      return iterator.return();
    }
  }, {
    highWaterMark: 2
  })
}


/***/ }),

/***/ "./node_modules/axios/lib/helpers/validator.js":
/*!*****************************************************!*\
  !*** ./node_modules/axios/lib/helpers/validator.js ***!
  \*****************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _env_data_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../env/data.js */ "./node_modules/axios/lib/env/data.js");
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js");





const validators = {};

// eslint-disable-next-line func-names
['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {
  validators[type] = function validator(thing) {
    return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
  };
});

const deprecatedWarnings = {};

/**
 * Transitional option validator
 *
 * @param {function|boolean?} validator - set to false if the transitional option has been removed
 * @param {string?} version - deprecated version / removed since version
 * @param {string?} message - some message with additional info
 *
 * @returns {function}
 */
validators.transitional = function transitional(validator, version, message) {
  function formatMessage(opt, desc) {
    return '[Axios v' + _env_data_js__WEBPACK_IMPORTED_MODULE_0__.VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
  }

  // eslint-disable-next-line func-names
  return (value, opt, opts) => {
    if (validator === false) {
      throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"](
        formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
        _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_DEPRECATED
      );
    }

    if (version && !deprecatedWarnings[opt]) {
      deprecatedWarnings[opt] = true;
      // eslint-disable-next-line no-console
      console.warn(
        formatMessage(
          opt,
          ' has been deprecated since v' + version + ' and will be removed in the near future'
        )
      );
    }

    return validator ? validator(value, opt, opts) : true;
  };
};

validators.spelling = function spelling(correctSpelling) {
  return (value, opt) => {
    // eslint-disable-next-line no-console
    console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
    return true;
  }
};

/**
 * Assert object's properties type
 *
 * @param {object} options
 * @param {object} schema
 * @param {boolean?} allowUnknown
 *
 * @returns {object}
 */

function assertOptions(options, schema, allowUnknown) {
  if (typeof options !== 'object') {
    throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('options must be an object', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION_VALUE);
  }
  const keys = Object.keys(options);
  let i = keys.length;
  while (i-- > 0) {
    const opt = keys[i];
    const validator = schema[opt];
    if (validator) {
      const value = options[opt];
      const result = value === undefined || validator(value, opt, options);
      if (result !== true) {
        throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('option ' + opt + ' must be ' + result, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION_VALUE);
      }
      continue;
    }
    if (allowUnknown !== true) {
      throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('Unknown option ' + opt, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION);
    }
  }
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  assertOptions,
  validators
});


/***/ }),

/***/ "./node_modules/axios/lib/platform/browser/classes/Blob.js":
/*!*****************************************************************!*\
  !*** ./node_modules/axios/lib/platform/browser/classes/Blob.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (typeof Blob !== 'undefined' ? Blob : null);


/***/ }),

/***/ "./node_modules/axios/lib/platform/browser/classes/FormData.js":
/*!*********************************************************************!*\
  !*** ./node_modules/axios/lib/platform/browser/classes/FormData.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (typeof FormData !== 'undefined' ? FormData : null);


/***/ }),

/***/ "./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js":
/*!****************************************************************************!*\
  !*** ./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js ***!
  \****************************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../helpers/AxiosURLSearchParams.js */ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js");



/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (typeof URLSearchParams !== 'undefined' ? URLSearchParams : _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__["default"]);


/***/ }),

/***/ "./node_modules/axios/lib/platform/browser/index.js":
/*!**********************************************************!*\
  !*** ./node_modules/axios/lib/platform/browser/index.js ***!
  \**********************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./classes/URLSearchParams.js */ "./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js");
/* harmony import */ var _classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./classes/FormData.js */ "./node_modules/axios/lib/platform/browser/classes/FormData.js");
/* harmony import */ var _classes_Blob_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./classes/Blob.js */ "./node_modules/axios/lib/platform/browser/classes/Blob.js");




/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  isBrowser: true,
  classes: {
    URLSearchParams: _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__["default"],
    FormData: _classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__["default"],
    Blob: _classes_Blob_js__WEBPACK_IMPORTED_MODULE_2__["default"]
  },
  protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
});


/***/ }),

/***/ "./node_modules/axios/lib/platform/common/utils.js":
/*!*********************************************************!*\
  !*** ./node_modules/axios/lib/platform/common/utils.js ***!
  \*********************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   hasBrowserEnv: () => (/* binding */ hasBrowserEnv),
/* harmony export */   hasStandardBrowserEnv: () => (/* binding */ hasStandardBrowserEnv),
/* harmony export */   hasStandardBrowserWebWorkerEnv: () => (/* binding */ hasStandardBrowserWebWorkerEnv),
/* harmony export */   navigator: () => (/* binding */ _navigator),
/* harmony export */   origin: () => (/* binding */ origin)
/* harmony export */ });
const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';

const _navigator = typeof navigator === 'object' && navigator || undefined;

/**
 * Determine if we're running in a standard browser environment
 *
 * This allows axios to run in a web worker, and react-native.
 * Both environments support XMLHttpRequest, but not fully standard globals.
 *
 * web workers:
 *  typeof window -> undefined
 *  typeof document -> undefined
 *
 * react-native:
 *  navigator.product -> 'ReactNative'
 * nativescript
 *  navigator.product -> 'NativeScript' or 'NS'
 *
 * @returns {boolean}
 */
const hasStandardBrowserEnv = hasBrowserEnv &&
  (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);

/**
 * Determine if we're running in a standard browser webWorker environment
 *
 * Although the `isStandardBrowserEnv` method indicates that
 * `allows axios to run in a web worker`, the WebWorker will still be
 * filtered out due to its judgment standard
 * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
 * This leads to a problem when axios post `FormData` in webWorker
 */
const hasStandardBrowserWebWorkerEnv = (() => {
  return (
    typeof WorkerGlobalScope !== 'undefined' &&
    // eslint-disable-next-line no-undef
    self instanceof WorkerGlobalScope &&
    typeof self.importScripts === 'function'
  );
})();

const origin = hasBrowserEnv && window.location.href || 'http://localhost';




/***/ }),

/***/ "./node_modules/axios/lib/platform/index.js":
/*!**************************************************!*\
  !*** ./node_modules/axios/lib/platform/index.js ***!
  \**************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node/index.js */ "./node_modules/axios/lib/platform/browser/index.js");
/* harmony import */ var _common_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common/utils.js */ "./node_modules/axios/lib/platform/common/utils.js");



/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  ..._common_utils_js__WEBPACK_IMPORTED_MODULE_1__,
  ..._node_index_js__WEBPACK_IMPORTED_MODULE_0__["default"]
});


/***/ }),

/***/ "./node_modules/axios/lib/utils.js":
/*!*****************************************!*\
  !*** ./node_modules/axios/lib/utils.js ***!
  \*****************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers/bind.js */ "./node_modules/axios/lib/helpers/bind.js");




// utils is a library of generic helper functions non-specific to axios

const {toString} = Object.prototype;
const {getPrototypeOf} = Object;
const {iterator, toStringTag} = Symbol;

const kindOf = (cache => thing => {
    const str = toString.call(thing);
    return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
})(Object.create(null));

const kindOfTest = (type) => {
  type = type.toLowerCase();
  return (thing) => kindOf(thing) === type
}

const typeOfTest = type => thing => typeof thing === type;

/**
 * Determine if a value is an Array
 *
 * @param {Object} val The value to test
 *
 * @returns {boolean} True if value is an Array, otherwise false
 */
const {isArray} = Array;

/**
 * Determine if a value is undefined
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if the value is undefined, otherwise false
 */
const isUndefined = typeOfTest('undefined');

/**
 * Determine if a value is a Buffer
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a Buffer, otherwise false
 */
function isBuffer(val) {
  return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
    && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
}

/**
 * Determine if a value is an ArrayBuffer
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is an ArrayBuffer, otherwise false
 */
const isArrayBuffer = kindOfTest('ArrayBuffer');


/**
 * Determine if a value is a view on an ArrayBuffer
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
 */
function isArrayBufferView(val) {
  let result;
  if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
    result = ArrayBuffer.isView(val);
  } else {
    result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
  }
  return result;
}

/**
 * Determine if a value is a String
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a String, otherwise false
 */
const isString = typeOfTest('string');

/**
 * Determine if a value is a Function
 *
 * @param {*} val The value to test
 * @returns {boolean} True if value is a Function, otherwise false
 */
const isFunction = typeOfTest('function');

/**
 * Determine if a value is a Number
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a Number, otherwise false
 */
const isNumber = typeOfTest('number');

/**
 * Determine if a value is an Object
 *
 * @param {*} thing The value to test
 *
 * @returns {boolean} True if value is an Object, otherwise false
 */
const isObject = (thing) => thing !== null && typeof thing === 'object';

/**
 * Determine if a value is a Boolean
 *
 * @param {*} thing The value to test
 * @returns {boolean} True if value is a Boolean, otherwise false
 */
const isBoolean = thing => thing === true || thing === false;

/**
 * Determine if a value is a plain Object
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a plain Object, otherwise false
 */
const isPlainObject = (val) => {
  if (kindOf(val) !== 'object') {
    return false;
  }

  const prototype = getPrototypeOf(val);
  return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
}

/**
 * Determine if a value is an empty object (safely handles Buffers)
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is an empty object, otherwise false
 */
const isEmptyObject = (val) => {
  // Early return for non-objects or Buffers to prevent RangeError
  if (!isObject(val) || isBuffer(val)) {
    return false;
  }

  try {
    return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
  } catch (e) {
    // Fallback for any other objects that might cause RangeError with Object.keys()
    return false;
  }
}

/**
 * Determine if a value is a Date
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a Date, otherwise false
 */
const isDate = kindOfTest('Date');

/**
 * Determine if a value is a File
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a File, otherwise false
 */
const isFile = kindOfTest('File');

/**
 * Determine if a value is a Blob
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a Blob, otherwise false
 */
const isBlob = kindOfTest('Blob');

/**
 * Determine if a value is a FileList
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a File, otherwise false
 */
const isFileList = kindOfTest('FileList');

/**
 * Determine if a value is a Stream
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a Stream, otherwise false
 */
const isStream = (val) => isObject(val) && isFunction(val.pipe);

/**
 * Determine if a value is a FormData
 *
 * @param {*} thing The value to test
 *
 * @returns {boolean} True if value is an FormData, otherwise false
 */
const isFormData = (thing) => {
  let kind;
  return thing && (
    (typeof FormData === 'function' && thing instanceof FormData) || (
      isFunction(thing.append) && (
        (kind = kindOf(thing)) === 'formdata' ||
        // detect form-data instance
        (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
      )
    )
  )
}

/**
 * Determine if a value is a URLSearchParams object
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a URLSearchParams object, otherwise false
 */
const isURLSearchParams = kindOfTest('URLSearchParams');

const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);

/**
 * Trim excess whitespace off the beginning and end of a string
 *
 * @param {String} str The String to trim
 *
 * @returns {String} The String freed of excess whitespace
 */
const trim = (str) => str.trim ?
  str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');

/**
 * Iterate over an Array or an Object invoking a function for each item.
 *
 * If `obj` is an Array callback will be called passing
 * the value, index, and complete array for each item.
 *
 * If 'obj' is an Object callback will be called passing
 * the value, key, and complete object for each property.
 *
 * @param {Object|Array} obj The object to iterate
 * @param {Function} fn The callback to invoke for each item
 *
 * @param {Boolean} [allOwnKeys = false]
 * @returns {any}
 */
function forEach(obj, fn, {allOwnKeys = false} = {}) {
  // Don't bother if no value provided
  if (obj === null || typeof obj === 'undefined') {
    return;
  }

  let i;
  let l;

  // Force an array if not already something iterable
  if (typeof obj !== 'object') {
    /*eslint no-param-reassign:0*/
    obj = [obj];
  }

  if (isArray(obj)) {
    // Iterate over array values
    for (i = 0, l = obj.length; i < l; i++) {
      fn.call(null, obj[i], i, obj);
    }
  } else {
    // Buffer check
    if (isBuffer(obj)) {
      return;
    }

    // Iterate over object keys
    const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
    const len = keys.length;
    let key;

    for (i = 0; i < len; i++) {
      key = keys[i];
      fn.call(null, obj[key], key, obj);
    }
  }
}

function findKey(obj, key) {
  if (isBuffer(obj)){
    return null;
  }

  key = key.toLowerCase();
  const keys = Object.keys(obj);
  let i = keys.length;
  let _key;
  while (i-- > 0) {
    _key = keys[i];
    if (key === _key.toLowerCase()) {
      return _key;
    }
  }
  return null;
}

const _global = (() => {
  /*eslint no-undef:0*/
  if (typeof globalThis !== "undefined") return globalThis;
  return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
})();

const isContextDefined = (context) => !isUndefined(context) && context !== _global;

/**
 * Accepts varargs expecting each argument to be an object, then
 * immutably merges the properties of each object and returns result.
 *
 * When multiple objects contain the same key the later object in
 * the arguments list will take precedence.
 *
 * Example:
 *
 * ```js
 * var result = merge({foo: 123}, {foo: 456});
 * console.log(result.foo); // outputs 456
 * ```
 *
 * @param {Object} obj1 Object to merge
 *
 * @returns {Object} Result of all merge properties
 */
function merge(/* obj1, obj2, obj3, ... */) {
  const {caseless, skipUndefined} = isContextDefined(this) && this || {};
  const result = {};
  const assignValue = (val, key) => {
    const targetKey = caseless && findKey(result, key) || key;
    if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
      result[targetKey] = merge(result[targetKey], val);
    } else if (isPlainObject(val)) {
      result[targetKey] = merge({}, val);
    } else if (isArray(val)) {
      result[targetKey] = val.slice();
    } else if (!skipUndefined || !isUndefined(val)) {
      result[targetKey] = val;
    }
  }

  for (let i = 0, l = arguments.length; i < l; i++) {
    arguments[i] && forEach(arguments[i], assignValue);
  }
  return result;
}

/**
 * Extends object a by mutably adding to it the properties of object b.
 *
 * @param {Object} a The object to be extended
 * @param {Object} b The object to copy properties from
 * @param {Object} thisArg The object to bind function to
 *
 * @param {Boolean} [allOwnKeys]
 * @returns {Object} The resulting value of object a
 */
const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
  forEach(b, (val, key) => {
    if (thisArg && isFunction(val)) {
      a[key] = (0,_helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__["default"])(val, thisArg);
    } else {
      a[key] = val;
    }
  }, {allOwnKeys});
  return a;
}

/**
 * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
 *
 * @param {string} content with BOM
 *
 * @returns {string} content value without BOM
 */
const stripBOM = (content) => {
  if (content.charCodeAt(0) === 0xFEFF) {
    content = content.slice(1);
  }
  return content;
}

/**
 * Inherit the prototype methods from one constructor into another
 * @param {function} constructor
 * @param {function} superConstructor
 * @param {object} [props]
 * @param {object} [descriptors]
 *
 * @returns {void}
 */
const inherits = (constructor, superConstructor, props, descriptors) => {
  constructor.prototype = Object.create(superConstructor.prototype, descriptors);
  constructor.prototype.constructor = constructor;
  Object.defineProperty(constructor, 'super', {
    value: superConstructor.prototype
  });
  props && Object.assign(constructor.prototype, props);
}

/**
 * Resolve object with deep prototype chain to a flat object
 * @param {Object} sourceObj source object
 * @param {Object} [destObj]
 * @param {Function|Boolean} [filter]
 * @param {Function} [propFilter]
 *
 * @returns {Object}
 */
const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
  let props;
  let i;
  let prop;
  const merged = {};

  destObj = destObj || {};
  // eslint-disable-next-line no-eq-null,eqeqeq
  if (sourceObj == null) return destObj;

  do {
    props = Object.getOwnPropertyNames(sourceObj);
    i = props.length;
    while (i-- > 0) {
      prop = props[i];
      if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
        destObj[prop] = sourceObj[prop];
        merged[prop] = true;
      }
    }
    sourceObj = filter !== false && getPrototypeOf(sourceObj);
  } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);

  return destObj;
}

/**
 * Determines whether a string ends with the characters of a specified string
 *
 * @param {String} str
 * @param {String} searchString
 * @param {Number} [position= 0]
 *
 * @returns {boolean}
 */
const endsWith = (str, searchString, position) => {
  str = String(str);
  if (position === undefined || position > str.length) {
    position = str.length;
  }
  position -= searchString.length;
  const lastIndex = str.indexOf(searchString, position);
  return lastIndex !== -1 && lastIndex === position;
}


/**
 * Returns new array from array like object or null if failed
 *
 * @param {*} [thing]
 *
 * @returns {?Array}
 */
const toArray = (thing) => {
  if (!thing) return null;
  if (isArray(thing)) return thing;
  let i = thing.length;
  if (!isNumber(i)) return null;
  const arr = new Array(i);
  while (i-- > 0) {
    arr[i] = thing[i];
  }
  return arr;
}

/**
 * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
 * thing passed in is an instance of Uint8Array
 *
 * @param {TypedArray}
 *
 * @returns {Array}
 */
// eslint-disable-next-line func-names
const isTypedArray = (TypedArray => {
  // eslint-disable-next-line func-names
  return thing => {
    return TypedArray && thing instanceof TypedArray;
  };
})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));

/**
 * For each entry in the object, call the function with the key and value.
 *
 * @param {Object<any, any>} obj - The object to iterate over.
 * @param {Function} fn - The function to call for each entry.
 *
 * @returns {void}
 */
const forEachEntry = (obj, fn) => {
  const generator = obj && obj[iterator];

  const _iterator = generator.call(obj);

  let result;

  while ((result = _iterator.next()) && !result.done) {
    const pair = result.value;
    fn.call(obj, pair[0], pair[1]);
  }
}

/**
 * It takes a regular expression and a string, and returns an array of all the matches
 *
 * @param {string} regExp - The regular expression to match against.
 * @param {string} str - The string to search.
 *
 * @returns {Array<boolean>}
 */
const matchAll = (regExp, str) => {
  let matches;
  const arr = [];

  while ((matches = regExp.exec(str)) !== null) {
    arr.push(matches);
  }

  return arr;
}

/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
const isHTMLForm = kindOfTest('HTMLFormElement');

const toCamelCase = str => {
  return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
    function replacer(m, p1, p2) {
      return p1.toUpperCase() + p2;
    }
  );
};

/* Creating a function that will check if an object has a property. */
const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);

/**
 * Determine if a value is a RegExp object
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a RegExp object, otherwise false
 */
const isRegExp = kindOfTest('RegExp');

const reduceDescriptors = (obj, reducer) => {
  const descriptors = Object.getOwnPropertyDescriptors(obj);
  const reducedDescriptors = {};

  forEach(descriptors, (descriptor, name) => {
    let ret;
    if ((ret = reducer(descriptor, name, obj)) !== false) {
      reducedDescriptors[name] = ret || descriptor;
    }
  });

  Object.defineProperties(obj, reducedDescriptors);
}

/**
 * Makes all methods read-only
 * @param {Object} obj
 */

const freezeMethods = (obj) => {
  reduceDescriptors(obj, (descriptor, name) => {
    // skip restricted props in strict mode
    if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
      return false;
    }

    const value = obj[name];

    if (!isFunction(value)) return;

    descriptor.enumerable = false;

    if ('writable' in descriptor) {
      descriptor.writable = false;
      return;
    }

    if (!descriptor.set) {
      descriptor.set = () => {
        throw Error('Can not rewrite read-only method \'' + name + '\'');
      };
    }
  });
}

const toObjectSet = (arrayOrString, delimiter) => {
  const obj = {};

  const define = (arr) => {
    arr.forEach(value => {
      obj[value] = true;
    });
  }

  isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));

  return obj;
}

const noop = () => {}

const toFiniteNumber = (value, defaultValue) => {
  return value != null && Number.isFinite(value = +value) ? value : defaultValue;
}



/**
 * If the thing is a FormData object, return true, otherwise return false.
 *
 * @param {unknown} thing - The thing to check.
 *
 * @returns {boolean}
 */
function isSpecCompliantForm(thing) {
  return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
}

const toJSONObject = (obj) => {
  const stack = new Array(10);

  const visit = (source, i) => {

    if (isObject(source)) {
      if (stack.indexOf(source) >= 0) {
        return;
      }

      //Buffer check
      if (isBuffer(source)) {
        return source;
      }

      if(!('toJSON' in source)) {
        stack[i] = source;
        const target = isArray(source) ? [] : {};

        forEach(source, (value, key) => {
          const reducedValue = visit(value, i + 1);
          !isUndefined(reducedValue) && (target[key] = reducedValue);
        });

        stack[i] = undefined;

        return target;
      }
    }

    return source;
  }

  return visit(obj, 0);
}

const isAsyncFn = kindOfTest('AsyncFunction');

const isThenable = (thing) =>
  thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);

// original code
// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34

const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
  if (setImmediateSupported) {
    return setImmediate;
  }

  return postMessageSupported ? ((token, callbacks) => {
    _global.addEventListener("message", ({source, data}) => {
      if (source === _global && data === token) {
        callbacks.length && callbacks.shift()();
      }
    }, false);

    return (cb) => {
      callbacks.push(cb);
      _global.postMessage(token, "*");
    }
  })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
})(
  typeof setImmediate === 'function',
  isFunction(_global.postMessage)
);

const asap = typeof queueMicrotask !== 'undefined' ?
  queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);

// *********************


const isIterable = (thing) => thing != null && isFunction(thing[iterator]);


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  isArray,
  isArrayBuffer,
  isBuffer,
  isFormData,
  isArrayBufferView,
  isString,
  isNumber,
  isBoolean,
  isObject,
  isPlainObject,
  isEmptyObject,
  isReadableStream,
  isRequest,
  isResponse,
  isHeaders,
  isUndefined,
  isDate,
  isFile,
  isBlob,
  isRegExp,
  isFunction,
  isStream,
  isURLSearchParams,
  isTypedArray,
  isFileList,
  forEach,
  merge,
  extend,
  trim,
  stripBOM,
  inherits,
  toFlatObject,
  kindOf,
  kindOfTest,
  endsWith,
  toArray,
  forEachEntry,
  matchAll,
  isHTMLForm,
  hasOwnProperty,
  hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection
  reduceDescriptors,
  freezeMethods,
  toObjectSet,
  toCamelCase,
  noop,
  toFiniteNumber,
  findKey,
  global: _global,
  isContextDefined,
  isSpecCompliantForm,
  toJSONObject,
  isAsyncFn,
  isThenable,
  setImmediate: _setImmediate,
  asap,
  isIterable
});


/***/ }),

/***/ "./node_modules/react-dom/client.js":
/*!******************************************!*\
  !*** ./node_modules/react-dom/client.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {



var m = __webpack_require__(/*! react-dom */ "react-dom");
if (false) // removed by dead control flow
{} else {
  var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
  exports.createRoot = function(c, o) {
    i.usingClientEntryPoint = true;
    try {
      return m.createRoot(c, o);
    } finally {
      i.usingClientEntryPoint = false;
    }
  };
  exports.hydrateRoot = function(c, h, o) {
    i.usingClientEntryPoint = true;
    try {
      return m.hydrateRoot(c, h, o);
    } finally {
      i.usingClientEntryPoint = false;
    }
  };
}


/***/ }),

/***/ "./node_modules/uuid/dist/esm-browser/regex.js":
/*!*****************************************************!*\
  !*** ./node_modules/uuid/dist/esm-browser/regex.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i);

/***/ }),

/***/ "./node_modules/uuid/dist/esm-browser/rng.js":
/*!***************************************************!*\
  !*** ./node_modules/uuid/dist/esm-browser/rng.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ rng)
/* harmony export */ });
// Unique ID creation requires a high quality random # generator. In the browser we therefore
// require the crypto API and do not support built-in fallback to lower quality random number
// generators (like Math.random()).
var getRandomValues;
var rnds8 = new Uint8Array(16);
function rng() {
  // lazy load so that environments that need to polyfill have a chance to do so
  if (!getRandomValues) {
    // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
    // find the complete implementation of crypto (msCrypto) on IE11.
    getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);

    if (!getRandomValues) {
      throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
    }
  }

  return getRandomValues(rnds8);
}

/***/ }),

/***/ "./node_modules/uuid/dist/esm-browser/stringify.js":
/*!*********************************************************!*\
  !*** ./node_modules/uuid/dist/esm-browser/stringify.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _validate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validate.js */ "./node_modules/uuid/dist/esm-browser/validate.js");

/**
 * Convert array of 16 byte values to UUID string format of the form:
 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
 */

var byteToHex = [];

for (var i = 0; i < 256; ++i) {
  byteToHex.push((i + 0x100).toString(16).substr(1));
}

function stringify(arr) {
  var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  // Note: Be careful editing this code!  It's been tuned for performance
  // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID.  If this throws, it's likely due to one
  // of the following:
  // - One or more input array values don't map to a hex octet (leading to
  // "undefined" in the uuid)
  // - Invalid input values for the RFC `version` or `variant` fields

  if (!(0,_validate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(uuid)) {
    throw TypeError('Stringified UUID is invalid');
  }

  return uuid;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stringify);

/***/ }),

/***/ "./node_modules/uuid/dist/esm-browser/v4.js":
/*!**************************************************!*\
  !*** ./node_modules/uuid/dist/esm-browser/v4.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _rng_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rng.js */ "./node_modules/uuid/dist/esm-browser/rng.js");
/* harmony import */ var _stringify_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stringify.js */ "./node_modules/uuid/dist/esm-browser/stringify.js");



function v4(options, buf, offset) {
  options = options || {};
  var rnds = options.random || (options.rng || _rng_js__WEBPACK_IMPORTED_MODULE_0__["default"])(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`

  rnds[6] = rnds[6] & 0x0f | 0x40;
  rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided

  if (buf) {
    offset = offset || 0;

    for (var i = 0; i < 16; ++i) {
      buf[offset + i] = rnds[i];
    }

    return buf;
  }

  return (0,_stringify_js__WEBPACK_IMPORTED_MODULE_1__["default"])(rnds);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (v4);

/***/ }),

/***/ "./node_modules/uuid/dist/esm-browser/validate.js":
/*!********************************************************!*\
  !*** ./node_modules/uuid/dist/esm-browser/validate.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _regex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./regex.js */ "./node_modules/uuid/dist/esm-browser/regex.js");


function validate(uuid) {
  return typeof uuid === 'string' && _regex_js__WEBPACK_IMPORTED_MODULE_0__["default"].test(uuid);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (validate);

/***/ }),

/***/ "./src/Alert/HvnlyNabAlert.css":
/*!*************************************!*\
  !*** ./src/Alert/HvnlyNabAlert.css ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ }),

/***/ "./src/Alert/HvnlyNabAlert.js":
/*!************************************!*\
  !*** ./src/Alert/HvnlyNabAlert.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _HvnlyNabAlert_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HvnlyNabAlert.css */ "./src/Alert/HvnlyNabAlert.css");




/**
 * HvnlyNabAlert - Professional Alert System for Havenlytics Nab Plugin
 * 
 * USAGE:
 * 1. Import and include this component in your main App/Layout
 * 2. Use the global window.HvnlyNabAlert methods anywhere in your plugin
 * 
 * EXAMPLE USAGE:
 * 
 * // Simple alerts
 * window.HvnlyNabAlert.success('Operation completed successfully!');
 * window.HvnlyNabAlert.error('Something went wrong!');
 * window.HvnlyNabAlert.warning('This action cannot be undone');
 * window.HvnlyNabAlert.info('New features available');
 * 
 * // Confirm dialog (returns promise)
 * window.HvnlyNabAlert.confirm('Are you sure?').then(result => {
 *   if (result === 'confirm') {
 *     // User confirmed
 *   }
 * });
 * 
 * // Prompt for input
 * window.HvnlyNabAlert.prompt('Enter your name:').then(result => {
 *   if (result !== 'cancel') {
 *     console.log('User entered:', result);
 *   }
 * });
 * 
 * // Custom alert with advanced options
 * window.HvnlyNabShowAlert({
 *   title: 'Custom Alert',
 *   message: 'This is a custom alert',
 *   icon: 'success',
 *   autoClose: 3000,
 *   buttons: [
 *     { text: 'Cancel', type: 'cancel', action: 'cancel' },
 *     { text: 'OK', type: 'success', action: 'ok' }
 *   ]
 * });
 */
/**
 * HvnlyNabAlert - Professional Alert System with Smooth Animations
 */

const HvnlyNabAlert = () => {
  const [isOpen, setIsOpen] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  const [alertConfig, setAlertConfig] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
  const [resolvePromise, setResolvePromise] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
  const [shouldShake, setShouldShake] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  const [isMounted, setIsMounted] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    setIsMounted(true);
    window.HvnlyNabShowAlert = config => {
      return new Promise(resolve => {
        setAlertConfig(config);
        setIsOpen(true);
        setResolvePromise(() => resolve);

        // Add shake effect for error alerts
        if (config.icon === 'error') {
          setTimeout(() => {
            setShouldShake(true);
            setTimeout(() => setShouldShake(false), 500);
          }, 600);
        }
      });
    };
    window.HvnlyNabAlert = {
      success: (message, title = 'Success!') => window.HvnlyNabShowAlert({
        title,
        message,
        icon: 'success',
        buttons: [{
          text: 'OK',
          type: 'success',
          action: 'ok'
        }]
      }),
      error: (message, title = 'Error!') => window.HvnlyNabShowAlert({
        title,
        message,
        icon: 'error',
        buttons: [{
          text: 'OK',
          type: 'error',
          action: 'ok'
        }]
      }),
      warning: (message, title = 'Warning!') => window.HvnlyNabShowAlert({
        title,
        message,
        icon: 'warning',
        buttons: [{
          text: 'OK',
          type: 'warning',
          action: 'ok'
        }]
      }),
      info: (message, title = 'Information') => window.HvnlyNabShowAlert({
        title,
        message,
        icon: 'info',
        buttons: [{
          text: 'OK',
          type: 'info',
          action: 'ok'
        }]
      }),
      confirm: (message, title = 'Confirm Action') => window.HvnlyNabShowAlert({
        title,
        message,
        icon: 'question',
        allowOutsideClick: false,
        buttons: [{
          text: 'Cancel',
          type: 'cancel',
          action: 'cancel'
        }, {
          text: 'Confirm',
          type: 'success',
          action: 'confirm'
        }]
      }),
      prompt: (message, defaultValue = '', title = 'Input Required') => window.HvnlyNabShowAlert({
        title,
        message,
        icon: 'info',
        allowOutsideClick: false,
        content: `
            <input type="text" 
                   class="HvnlyNab_alert_input" 
                   placeholder="${message}" 
                   value="${defaultValue}"
                   id="HvnlyNab_prompt_input"
                   autocomplete="off">
          `,
        buttons: [{
          text: 'Cancel',
          type: 'cancel',
          action: 'cancel'
        }, {
          text: 'Submit',
          type: 'success',
          action: 'submit'
        }]
      })
    };
    if (window.HvnlyNabOverrideNativeAlerts) {
      window.alert = message => window.HvnlyNabAlert.info(message);
      window.confirm = message => window.HvnlyNabAlert.confirm(message);
    }
    return () => {
      delete window.HvnlyNabShowAlert;
      delete window.HvnlyNabAlert;
    };
  }, []);
  const handleClose = action => {
    setIsOpen(false);
    setShouldShake(false);
    if (resolvePromise) {
      let result = action;
      if (action === 'submit' && alertConfig?.content?.includes('HvnlyNab_prompt_input')) {
        const input = document.getElementById('HvnlyNab_prompt_input');
        result = input ? input.value : '';
      }
      resolvePromise(result);
      setResolvePromise(null);
    }
    setTimeout(() => {
      setAlertConfig(null);
    }, 300);
  };
  const handleOverlayClick = e => {
    if (e.target === e.currentTarget && alertConfig?.allowOutsideClick !== false) {
      handleClose('overlay');
    }
  };
  if (!alertConfig || !isMounted) return null;
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: `HvnlyNab_alert_overlay ${isOpen ? 'HvnlyNab_alert_overlay--active' : ''}`,
    onClick: handleOverlayClick
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: `HvnlyNab_alert_container ${isOpen ? 'HvnlyNab_alert_container--active' : ''} ${shouldShake ? 'HvnlyNab_alert_shake' : ''}`
  }, alertConfig.autoClose && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "HvnlyNab_alert_progress",
    style: {
      animationDuration: `${alertConfig.autoClose}ms`
    }
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "HvnlyNab_alert_header"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: `HvnlyNab_alert_icon HvnlyNab_alert_icon--${alertConfig.icon}`
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: `fas ${getIconClass(alertConfig.icon)}`
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h2", {
    className: "HvnlyNab_alert_title"
  }, alertConfig.title), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
    className: "HvnlyNab_alert_message"
  }, alertConfig.message)), alertConfig.content && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "HvnlyNab_alert_content",
    dangerouslySetInnerHTML: {
      __html: alertConfig.content
    }
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "HvnlyNab_alert_footer"
  }, alertConfig.buttons?.map((button, index) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    key: index,
    className: `HvnlyNab_alert_btn HvnlyNab_alert_btn--${button.type}`,
    onClick: () => handleClose(button.action),
    autoFocus: index === alertConfig.buttons.length - 1
  }, button.text)))));
};
const getIconClass = iconType => {
  const icons = {
    success: 'fa-check-circle',
    error: 'fa-exclamation-circle',
    warning: 'fa-exclamation-triangle',
    info: 'fa-info-circle',
    question: 'fa-question-circle'
  };
  return icons[iconType] || icons.info;
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (HvnlyNabAlert);

/***/ }),

/***/ "./src/BuilderApp.css":
/*!****************************!*\
  !*** ./src/BuilderApp.css ***!
  \****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ }),

/***/ "./src/BuilderApp.jsx":
/*!****************************!*\
  !*** ./src/BuilderApp.jsx ***!
  \****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _Alert_HvnlyNabAlert__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Alert/HvnlyNabAlert */ "./src/Alert/HvnlyNabAlert.js");
/* harmony import */ var _builder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./builder */ "./src/builder/index.js");
/* harmony import */ var _BuilderApp_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./BuilderApp.css */ "./src/BuilderApp.css");
/* harmony import */ var _hooks_useBuilderPreloader__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./hooks/useBuilderPreloader */ "./src/hooks/useBuilderPreloader.js");
/* harmony import */ var _LoadingOverlay_LoadingOverlay__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./LoadingOverlay/LoadingOverlay */ "./src/LoadingOverlay/LoadingOverlay.js");
/* harmony import */ var _Toast_Toast__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Toast/Toast */ "./src/Toast/Toast.js");
/* harmony import */ var _utils_builderPreloader__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/builderPreloader */ "./src/utils/builderPreloader.js");










const BuilderApp = () => {
  const [toasts, setToasts] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
  const [isLoading, setIsLoading] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  const [isPropertyLoading, setIsPropertyLoading] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(true);
  const [loadingOverlayVisible, setLoadingOverlayVisible] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);

  // Toast position - can be changed dynamically
  const [toastPosition, setToastPosition] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)('top-center'); // Changed to top-center

  // Track toast IDs to prevent duplicates
  const lastToastRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)({
    id: null,
    time: 0
  });

  // Use your existing usePreloader hook
  const {
    preloaderVisible,
    isExiting,
    loadingProgress,
    loadingStage,
    setLoadingProgress,
    setLoadingStage
  } = (0,_hooks_useBuilderPreloader__WEBPACK_IMPORTED_MODULE_6__.usePreloader)(true);

  // Enhanced toast helpers with position support
  const showToast = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)((type, title, message, position = toastPosition // Use current position if not specified
  ) => {
    // Create a unique key for this toast
    const toastKey = `${type}-${title}-${message}-${position}`;
    const now = Date.now();

    // Prevent duplicate toasts within 2 seconds
    if (lastToastRef.current.id === toastKey && now - lastToastRef.current.time < 2000) {
      // console.log('🛑 Duplicate toast prevented:', toastKey);
      return;
    }

    // Update last toast reference
    lastToastRef.current = {
      id: toastKey,
      time: now
    };
    const id = Date.now() + Math.random();
    setToasts(prev => [...prev, {
      id,
      type,
      title,
      message,
      position
    }]);

    // Show loading overlay only for save operations
    if (type === 'success' && (title.includes('Saved') || title.includes('Updated') || title.includes('Sidebar'))) {
      setLoadingOverlayVisible(true);
      setTimeout(() => {
        setLoadingOverlayVisible(false);
      }, 2000);
    }
  }, [toastPosition]);

  // Function to change toast position dynamically
  const changeToastPosition = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(newPosition => {
    setToastPosition(newPosition);
    // Optional: Show a toast confirming position change
    showToast('info', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Position Updated', 'havenlytics'), `Toasts will now appear at ${newPosition}`, newPosition);
  }, [showToast]);
  const removeToast = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(id => {
    setToasts(prev => prev.filter(toast => toast.id !== id));
  }, []);

  // Handle property loading state changes
  const handlePropertyLoadingChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(loading => {
    //console.log('🔄 Property loading state changed:', loading);
    setIsPropertyLoading(loading);
    if (!loading) {
      setLoadingProgress(100);
    }
  }, [setLoadingProgress]);

  // Simulate initial loading stages
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (isPropertyLoading) {
      const stages = [{
        stage: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Initializing Property Builder...', 'havenlytics'),
        progress: 20
      }, {
        stage: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Loading form configuration...', 'havenlytics'),
        progress: 50
      }, {
        stage: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Setting up field types...', 'havenlytics'),
        progress: 80
      }, {
        stage: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Almost ready...', 'havenlytics'),
        progress: 95
      }];
      let currentStage = 0;
      const progressInterval = setInterval(() => {
        if (currentStage < stages.length) {
          setLoadingStage(stages[currentStage].stage);
          setLoadingProgress(stages[currentStage].progress);
          currentStage++;
        } else {
          clearInterval(progressInterval);
        }
      }, 500);
      return () => clearInterval(progressInterval);
    }
  }, [isPropertyLoading, setLoadingStage, setLoadingProgress]);

  // Get container styles based on position
  const getContainerStyles = () => {
    switch (toastPosition) {
      case 'top-right':
        return {
          top: '1.5rem',
          right: '1.5rem',
          left: 'auto',
          bottom: 'auto',
          transform: 'none',
          alignItems: 'flex-end'
        };
      case 'top-left':
        return {
          top: '1.5rem',
          left: '1.5rem',
          right: 'auto',
          bottom: 'auto',
          transform: 'none',
          alignItems: 'flex-start'
        };
      case 'top-center':
        return {
          top: '1.5rem',
          left: '50%',
          right: 'auto',
          bottom: 'auto',
          transform: 'translateX(-50%)',
          alignItems: 'center'
        };
      case 'bottom-right':
        return {
          bottom: '1.5rem',
          right: '1.5rem',
          top: 'auto',
          left: 'auto',
          transform: 'none',
          alignItems: 'flex-end'
        };
      case 'bottom-left':
        return {
          bottom: '1.5rem',
          left: '1.5rem',
          top: 'auto',
          right: 'auto',
          transform: 'none',
          alignItems: 'flex-start'
        };
      case 'bottom-center':
        return {
          bottom: '1.5rem',
          left: '50%',
          top: 'auto',
          right: 'auto',
          transform: 'translateX(-50%)',
          alignItems: 'center'
        };
      default:
        return {
          top: '1.5rem',
          right: '1.5rem',
          alignItems: 'flex-end'
        };
    }
  };
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--app"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_utils_builderPreloader__WEBPACK_IMPORTED_MODULE_9__["default"], {
    isLoading: preloaderVisible,
    isExiting: isExiting,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Property Builder", "havenlytics"),
    stage: loadingStage,
    progress: loadingProgress,
    tips: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("💡 Tip: Required tabs (Basic Info & Amenities Sidebar) cannot be moved or deleted", "havenlytics")
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Alert_HvnlyNabAlert__WEBPACK_IMPORTED_MODULE_3__["default"], null), !preloaderVisible && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api__container"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_builder__WEBPACK_IMPORTED_MODULE_4__["default"], {
    showToast: showToast,
    setIsLoading: setIsLoading,
    onPropertyLoadingChange: handlePropertyLoadingChange
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_LoadingOverlay_LoadingOverlay__WEBPACK_IMPORTED_MODULE_7__["default"], {
    isLoading: loadingOverlayVisible
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    id: "hvnlyToastContainer",
    className: "hvnly-toast-container",
    style: getContainerStyles(),
    "data-position": toastPosition
  }, toasts.map(toast => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Toast_Toast__WEBPACK_IMPORTED_MODULE_8__["default"], {
    key: toast.id,
    type: toast.type,
    title: toast.title,
    message: toast.message,
    onClose: () => removeToast(toast.id)
    // Note: position prop on individual Toast is just for data attribute, not styling
  })))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BuilderApp);

/***/ }),

/***/ "./src/LoadingOverlay/LoadingOverlay.js":
/*!**********************************************!*\
  !*** ./src/LoadingOverlay/LoadingOverlay.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _LoadingOverlay_module_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./LoadingOverlay.module.css */ "./src/LoadingOverlay/LoadingOverlay.module.css");

// import './LoadingOverlay.css';


const LoadingOverlay = ({
  isLoading
}) => {
  if (!isLoading) return null;
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: `${_LoadingOverlay_module_css__WEBPACK_IMPORTED_MODULE_2__["default"]['hvnly-settings-api__overlay']} ${_LoadingOverlay_module_css__WEBPACK_IMPORTED_MODULE_2__["default"]['active']}`
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: _LoadingOverlay_module_css__WEBPACK_IMPORTED_MODULE_2__["default"]['loader-container']
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: _LoadingOverlay_module_css__WEBPACK_IMPORTED_MODULE_2__["default"]['dot-pulse']
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: _LoadingOverlay_module_css__WEBPACK_IMPORTED_MODULE_2__["default"]['loader-text']
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Processing your request', 'havenlytics'))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LoadingOverlay);

/***/ }),

/***/ "./src/LoadingOverlay/LoadingOverlay.module.css":
/*!******************************************************!*\
  !*** ./src/LoadingOverlay/LoadingOverlay.module.css ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
// extracted by mini-css-extract-plugin
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({"hvnly-app":"kfcZqEO6ayVIX8ALioyO","dark-mode":"gokRmf_v8pSNtOMNLAwN","hvnly-settings-api__overlay":"oOhKHeqnfaejKD3nQH39","active":"M5lLaaQeEYHqtGdPlJiQ","hvnly-loader-container":"BRn2FuTWvr_wNLmsAOx3","dot-pulse":"nRoKDpLLkl_xQ8D699D5","dot-pulse-before":"wKQD9Iujbbvi3DeTfVIC","dot-pulse-after":"stYzaplnCrqKxkFwytkg","loader-text":"s03cHeE7iSmRXDDKMuBq"});

/***/ }),

/***/ "./src/Toast/Toast.css":
/*!*****************************!*\
  !*** ./src/Toast/Toast.css ***!
  \*****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ }),

/***/ "./src/Toast/Toast.js":
/*!****************************!*\
  !*** ./src/Toast/Toast.js ***!
  \****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _Toast_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Toast.css */ "./src/Toast/Toast.css");



const Toast = ({
  type,
  title,
  message,
  onClose,
  autoClose = true,
  autoCloseDuration = 2500,
  position = 'top-center' // Default position
}) => {
  const [isExiting, setIsExiting] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (!autoClose) return;
    const timer = setTimeout(() => {
      handleClose();
    }, autoCloseDuration);
    return () => {
      clearTimeout(timer);
    };
  }, [autoClose, autoCloseDuration]);
  const handleClose = () => {
    setIsExiting(true);
    setTimeout(() => {
      onClose();
    }, 200);
  };

  // Get icon based on type
  const getIconSvg = () => {
    if (type === 'success') {
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
        width: "20",
        height: "20",
        viewBox: "0 0 24 24",
        fill: "none",
        stroke: "currentColor",
        strokeWidth: "2.5"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("polyline", {
        points: "20 6 9 17 4 12"
      }));
    } else if (type === 'error') {
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
        width: "20",
        height: "20",
        viewBox: "0 0 24 24",
        fill: "none",
        stroke: "currentColor",
        strokeWidth: "2.5"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("line", {
        x1: "18",
        y1: "6",
        x2: "6",
        y2: "18"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("line", {
        x1: "6",
        y1: "6",
        x2: "18",
        y2: "18"
      }));
    } else if (type === 'warning') {
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
        width: "20",
        height: "20",
        viewBox: "0 0 24 24",
        fill: "none",
        stroke: "currentColor",
        strokeWidth: "2.5"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
        d: "M12 9v4M12 17h.01",
        strokeLinecap: "round"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
        d: "M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10z"
      }));
    } else {
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
        width: "20",
        height: "20",
        viewBox: "0 0 24 24",
        fill: "none",
        stroke: "currentColor",
        strokeWidth: "2.5"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("circle", {
        cx: "12",
        cy: "12",
        r: "10"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("line", {
        x1: "12",
        y1: "16",
        x2: "12",
        y2: "12"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("circle", {
        cx: "12",
        cy: "8",
        r: "1",
        fill: "currentColor"
      }));
    }
  };
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: `hvnly-toast ${type} ${isExiting ? 'hvnly-toast-exit' : ''}`,
    "data-position": position
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-toast-icon"
  }, getIconSvg()), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-toast-content"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-toast-title"
  }, title), message && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-toast-description"
  }, message)), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: "hvnly-toast-close",
    onClick: handleClose,
    "aria-label": "close"
  }, "\u2715"));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Toast);

/***/ }),

/***/ "./src/builder/PropertyBuilder.js":
/*!****************************************!*\
  !*** ./src/builder/PropertyBuilder.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _components_TabNavigation_TabNavigation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/TabNavigation/TabNavigation */ "./src/builder/components/TabNavigation/TabNavigation.js");


const PropertyBuilder = ({
  showToast,
  setIsLoading,
  onPropertyLoadingChange
}) => {
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_wrapper"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_components_TabNavigation_TabNavigation__WEBPACK_IMPORTED_MODULE_1__["default"], {
    showToast: showToast,
    setIsLoading: setIsLoading,
    onPropertyLoadingChange: onPropertyLoadingChange
  }));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PropertyBuilder);

/***/ }),

/***/ "./src/builder/components/TabContent/AddPropertyFormTab/AddPropertyFormTab.js":
/*!************************************************************************************!*\
  !*** ./src/builder/components/TabContent/AddPropertyFormTab/AddPropertyFormTab.js ***!
  \************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dnd-kit/core */ "./node_modules/@dnd-kit/core/dist/core.esm.js");
/* harmony import */ var _dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @dnd-kit/sortable */ "./node_modules/@dnd-kit/sortable/dist/sortable.esm.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _ComponentPanel_ComponentPanel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ComponentPanel/ComponentPanel */ "./src/builder/components/TabContent/AddPropertyFormTab/ComponentPanel/ComponentPanel.js");
/* harmony import */ var _hooks_useDragAndDrop__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./hooks/useDragAndDrop */ "./src/builder/components/TabContent/AddPropertyFormTab/hooks/useDragAndDrop.js");
/* harmony import */ var _hooks_usePropertyBuilder__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./hooks/usePropertyBuilder */ "./src/builder/components/TabContent/AddPropertyFormTab/hooks/usePropertyBuilder.js");
/* harmony import */ var _Modal_Modal__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Modal/Modal */ "./src/builder/components/TabContent/AddPropertyFormTab/Modal/Modal.js");
/* harmony import */ var _PlaceholderLoader_PlaceholderLoader__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./PlaceholderLoader/PlaceholderLoader */ "./src/builder/components/TabContent/AddPropertyFormTab/PlaceholderLoader/PlaceholderLoader.js");
/* harmony import */ var _Tab_Tab__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Tab/Tab */ "./src/builder/components/TabContent/AddPropertyFormTab/Tab/Tab.js");











const AddPropertyFormTab = ({
  showToast,
  onActionsReady,
  isSaving,
  isResetting
}) => {
  const {
    tabs,
    setTabs,
    activeTab,
    activeField,
    isTabModalOpen,
    setIsTabModalOpen,
    isFieldModalOpen,
    setIsFieldModalOpen,
    isLoading,
    groupCollapsedStates,
    openTabModal,
    openFieldModal,
    saveConfiguration,
    resetConfiguration,
    addTab,
    editTab,
    deleteTab,
    toggleTabCollapse,
    addField,
    editField,
    deleteField,
    toggleField,
    toggleFieldRequired,
    toggleFieldAdminOnly,
    moveFieldUp,
    moveFieldDown,
    moveGroupUp,
    moveGroupDown,
    toggleGroupCollapse,
    deleteGroup,
    toggleSidebar,
    isRequiredTab
  } = (0,_hooks_usePropertyBuilder__WEBPACK_IMPORTED_MODULE_7__.usePropertyBuilder)(showToast);
  const {
    sensors,
    dragOverTabId,
    dragDirection,
    handleDragStart,
    handleDragMove,
    handleDragOver,
    handleDragEnd
  } = (0,_hooks_useDragAndDrop__WEBPACK_IMPORTED_MODULE_6__.useDragAndDrop)({
    tabs,
    setTabs,
    showToast
  });
  const safeTabs = Array.isArray(tabs) ? tabs : Object.values(tabs || []);
  const hasSentActions = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(false);
  const hasShownLoadToast = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(false);
  const tabsRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(tabs);
  const saveConfigRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(saveConfiguration);
  const resetConfigRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(resetConfiguration);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
    tabsRef.current = tabs;
    saveConfigRef.current = saveConfiguration;
    resetConfigRef.current = resetConfiguration;
  }, [tabs, saveConfiguration, resetConfiguration]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
    if (!isLoading && !hasShownLoadToast.current && tabs.length > 0) {
      hasShownLoadToast.current = true;
      showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Configuration Loaded', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Form sections loaded successfully', 'havenlytics'));
    }
  }, [isLoading, tabs.length, showToast]);
  const stableSaveConfiguration = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(async () => {
    if (!tabsRef.current || tabsRef.current.length === 0) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Save Failed', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('No data to save. Please add some sections and fields first.', 'havenlytics'));
      return false;
    }
    const result = await saveConfigRef.current();
    return result;
  }, [showToast]);
  const stableResetConfiguration = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(async () => {
    const result = await resetConfigRef.current();
    return result;
  }, []);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
    if (onActionsReady && !hasSentActions.current) {
      hasSentActions.current = true;
      const actions = {
        saveConfiguration: stableSaveConfiguration,
        resetConfiguration: stableResetConfiguration,
        isLoading
      };
      onActionsReady(actions);
    }
  }, [onActionsReady, stableSaveConfiguration, stableResetConfiguration, isLoading]);
  const getExistingFields = () => {
    if (!activeTab) return [];
    const tab = tabs.find(t => t.id === activeTab);
    return tab ? tab.fields : [];
  };
  const getActiveTabObject = () => {
    if (!activeTab) return null;
    return tabs.find(t => t.id === activeTab);
  };

  // Function to replace a group instead of delete + add
  const replaceGroup = (tabId, oldGroupId, newFields, newGroupType) => {
    setTabs(prevTabs => {
      return prevTabs.map(tab => {
        if (tab.id === tabId) {
          // Filter out all fields from the old group
          const fieldsWithoutOldGroup = tab.fields.filter(field => field.group_id !== oldGroupId);

          // Find the position where the old group was (based on order of first field of old group)
          // We need to maintain the position - get the order of the first field of the old group
          // Since we filtered them out, we need to get the original position from the current fields
          let insertPosition = -1;

          // Find the position by looking at the original fields
          const originalFields = tab.fields;
          for (let i = 0; i < originalFields.length; i++) {
            if (originalFields[i].group_id === oldGroupId) {
              insertPosition = i;
              break;
            }
          }

          // If we found a position, insert new fields there
          let updatedFields = [...fieldsWithoutOldGroup];
          if (insertPosition >= 0 && insertPosition <= updatedFields.length) {
            // Insert new fields at the same position
            updatedFields.splice(insertPosition, 0, ...newFields);
          } else {
            // If position not found, add at the end
            updatedFields = [...updatedFields, ...newFields];
          }

          // Update order for all fields
          const reorderedFields = updatedFields.map((field, idx) => ({
            ...field,
            order: idx
          }));
          return {
            ...tab,
            fields: reorderedFields
          };
        }
        return tab;
      });
    });
    showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Group Replaced', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.sprintf)((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Group replaced with %s successfully', 'havenlytics'), newGroupType));
  };
  const handleSaveField = fieldData => {
    if (!activeTab) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Error', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('No active tab selected', 'havenlytics'));
      return;
    }

    // Check if this is a group replacement action
    if (fieldData && fieldData.type === 'REPLACE_GROUP') {
      // Replace the group directly without delete + add
      replaceGroup(activeTab, fieldData.oldGroupId, fieldData.newFields, fieldData.newGroupType);
      setIsFieldModalOpen(false);
      return;
    }
    if (Array.isArray(fieldData)) {
      let successCount = 0;
      fieldData.forEach((field, index) => {
        try {
          addField(activeTab, field);
          successCount++;
        } catch (error) {
          console.error('Error adding field:', error);
        }
      });
      if (successCount > 0) {
        if (fieldData.length > 1) {
          showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Fields Added', 'havenlytics'), `${successCount} of ${fieldData.length} ` + (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('fields added successfully', 'havenlytics'));
        } else {
          showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Field Added', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Field added successfully', 'havenlytics'));
        }
      } else {
        showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Add Failed', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Failed to add fields', 'havenlytics'));
      }
      setIsFieldModalOpen(false);
    } else {
      try {
        if (activeField) {
          editField(activeTab, activeField.id, fieldData);
          showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Field Updated', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Field updated successfully', 'havenlytics'));
        } else {
          addField(activeTab, fieldData);
          showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Field Added', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Field added successfully', 'havenlytics'));
        }
        setIsFieldModalOpen(false);
      } catch (error) {
        console.error('Error processing field:', error);
        showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Operation Failed', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Failed to process field', 'havenlytics'));
      }
    }
  };
  const checkRequiredTab = tab => {
    return isRequiredTab ? isRequiredTab(tab) : tab.required || tab.title === 'Basic Info';
  };
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__tab_content_panel"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_content"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_ComponentPanel_ComponentPanel__WEBPACK_IMPORTED_MODULE_5__["default"], null), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_area"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_section_header"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h3", {
    className: "hvnly--builder--int_api__property_builder_section_header_title"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Property Section & Fields', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_stats"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Total:', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "hvnly--builder--int_api__property_builder_stats_sections"
  }, safeTabs.length, " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('sections', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "hvnly--builder--int_api__property_builder_stats_fields"
  }, safeTabs.reduce((acc, tab) => acc + (tab.fields?.length || 0), 0), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('fields', 'havenlytics')))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.DndContext, {
    sensors: sensors,
    onDragStart: handleDragStart,
    onDragMove: handleDragMove,
    onDragOver: handleDragOver,
    onDragEnd: handleDragEnd
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_2__.SortableContext, {
    items: safeTabs.map(tab => tab.id),
    strategy: _dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_2__.verticalListSortingStrategy
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_tabs"
  }, isLoading ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_PlaceholderLoader_PlaceholderLoader__WEBPACK_IMPORTED_MODULE_9__["default"], {
    count: 2
  }) : safeTabs.length > 0 ? safeTabs.map((tab, index) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Tab_Tab__WEBPACK_IMPORTED_MODULE_10__["default"], {
    key: `${tab.id}-${tab.fields?.length || 0}-${index}`,
    id: tab.id,
    tab: {
      ...tab,
      fields: Array.isArray(tab.fields) ? tab.fields : []
    },
    isDragOver: dragOverTabId === tab.id,
    dragDirection: dragDirection,
    onEdit: () => openTabModal(tab),
    onDelete: () => deleteTab(tab.id),
    onToggleCollapse: () => toggleTabCollapse(tab.id),
    onAddField: () => openFieldModal(tab.id),
    onEditField: fieldId => {
      const field = (tab.fields || []).find(f => f.id === fieldId);
      openFieldModal(tab.id, field);
    },
    onDeleteField: fieldId => deleteField(tab.id, fieldId),
    onDeleteGroup: groupId => deleteGroup(groupId),
    onToggleField: fieldId => toggleField(tab.id, fieldId),
    onToggleFieldRequired: fieldId => toggleFieldRequired(tab.id, fieldId),
    onToggleFieldAdminOnly: fieldId => toggleFieldAdminOnly(tab.id, fieldId),
    onToggleGroupCollapse: groupId => toggleGroupCollapse(groupId),
    onToggleSidebar: toggleSidebar,
    onMoveFieldUp: fieldId => moveFieldUp(tab.id, fieldId),
    onMoveFieldDown: fieldId => moveFieldDown(tab.id, fieldId),
    onMoveGroupUp: (groupId, groupIndex) => moveGroupUp(groupId, groupIndex),
    onMoveGroupDown: (groupId, groupIndex) => moveGroupDown(groupId, groupIndex),
    showToast: showToast,
    isRequiredTab: checkRequiredTab,
    groupCollapsedStates: groupCollapsedStates
  })) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_empty_state"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-folder-open"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('No sections found. Add your first section to get started.', 'havenlytics'))))), !isLoading && safeTabs.length > 0 && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: "hvnly--builder--int_api__property_builder_empty_btn",
    onClick: () => openTabModal()
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-plus"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Add New Section', 'havenlytics'))))), isTabModalOpen && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Modal_Modal__WEBPACK_IMPORTED_MODULE_8__["default"], {
    key: `tab-${activeTab || 'new'}`,
    type: "tab",
    data: getActiveTabObject(),
    onSave: activeTab ? data => editTab(activeTab, data) : addTab,
    onClose: () => setIsTabModalOpen(false)
  }), isFieldModalOpen && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Modal_Modal__WEBPACK_IMPORTED_MODULE_8__["default"], {
    key: `field-${activeField?.id || 'new'}`,
    type: "field",
    data: activeField,
    existingFields: getExistingFields(),
    onSave: handleSaveField,
    onClose: () => {
      setIsFieldModalOpen(false);
    },
    allowMultiple: !activeField
  }), (isSaving || isResetting) && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__saving_indicator"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-spinner fa-spin"
  }), isSaving ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Saving changes...', 'havenlytics') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Resetting configuration...', 'havenlytics')));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AddPropertyFormTab);

/***/ }),

/***/ "./src/builder/components/TabContent/AddPropertyFormTab/ComponentPanel/ComponentPanel.css":
/*!************************************************************************************************!*\
  !*** ./src/builder/components/TabContent/AddPropertyFormTab/ComponentPanel/ComponentPanel.css ***!
  \************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ }),

/***/ "./src/builder/components/TabContent/AddPropertyFormTab/ComponentPanel/ComponentPanel.js":
/*!***********************************************************************************************!*\
  !*** ./src/builder/components/TabContent/AddPropertyFormTab/ComponentPanel/ComponentPanel.js ***!
  \***********************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _ComponentPanel_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ComponentPanel.css */ "./src/builder/components/TabContent/AddPropertyFormTab/ComponentPanel/ComponentPanel.css");
/* harmony import */ var _DraggableComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./DraggableComponent */ "./src/builder/components/TabContent/AddPropertyFormTab/ComponentPanel/DraggableComponent.js");




const ComponentPanel = () => {
  const components = [{
    id: 'text',
    type: 'text',
    icon: 'font',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Text Input', 'havenlytics')
  }, {
    id: 'textarea',
    type: 'textarea',
    icon: 'align-left',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Text Area', 'havenlytics')
  }, {
    id: 'number',
    type: 'number',
    icon: 'hashtag',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Number', 'havenlytics')
  }, {
    id: 'checkbox',
    type: 'checkbox',
    icon: 'check-square',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Checkbox', 'havenlytics')
  }, {
    id: 'image',
    type: 'image',
    icon: 'image',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Image Upload', 'havenlytics')
  }, {
    id: 'gallery',
    type: 'gallery',
    icon: 'images',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Gallery (2 Fields)', 'havenlytics')
  }, {
    id: 'video',
    type: 'video',
    icon: 'video',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Video (3 Fields)', 'havenlytics')
  }, {
    id: 'map',
    type: 'map',
    icon: 'map-marker-alt',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Map Location (4 Fields)', 'havenlytics')
  }, {
    id: 'property_docs',
    type: 'property_docs',
    icon: 'file-pdf',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Property Documents', 'havenlytics')
  }];
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_components"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h3", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Available Field Types', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
    className: "hvnly--builder--int_api__component_panel_subtitle"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Drag and drop to add fields', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__component_panel_section"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h4", {
    className: "hvnly--builder--int_api__component_panel_section_title"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-pencil-alt"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Basic Fields', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__component_panel_grid"
  }, components.slice(0, 5).map(component => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_DraggableComponent__WEBPACK_IMPORTED_MODULE_3__["default"], {
    key: component.id,
    id: component.id,
    type: component.type,
    icon: component.icon,
    label: component.label
  })))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__component_panel_section"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h4", {
    className: "hvnly--builder--int_api__component_panel_section_title"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-layer-group"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Group Fields', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__component_panel_grid"
  }, components.slice(5).map(component => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_DraggableComponent__WEBPACK_IMPORTED_MODULE_3__["default"], {
    key: component.id,
    id: component.id,
    type: component.type,
    icon: component.icon,
    label: component.label
  })))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__component_panel_footer"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-info-circle"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Group fields create multiple related fields at once', 'havenlytics'))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ComponentPanel);

/***/ }),

/***/ "./src/builder/components/TabContent/AddPropertyFormTab/ComponentPanel/DraggableComponent.js":
/*!***************************************************************************************************!*\
  !*** ./src/builder/components/TabContent/AddPropertyFormTab/ComponentPanel/DraggableComponent.js ***!
  \***************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dnd-kit/core */ "./node_modules/@dnd-kit/core/dist/core.esm.js");
/* harmony import */ var _ComponentPanel_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ComponentPanel.css */ "./src/builder/components/TabContent/AddPropertyFormTab/ComponentPanel/ComponentPanel.css");



const DraggableComponent = ({
  id,
  type,
  icon,
  label
}) => {
  const {
    attributes,
    listeners,
    setNodeRef,
    transform,
    isDragging
  } = (0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.useDraggable)({
    id: `${id}_${Date.now()}`,
    data: {
      type,
      fieldType: type,
      source: 'component-panel'
    }
  });
  const style = transform ? {
    transform: `translate3d(${transform.x}px, ${transform.y}px, 0)`
  } : undefined;
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    ref: setNodeRef,
    style: style,
    className: `hvnly--builder--int_api__property_builder_component_item ${isDragging ? 'hvnly--builder--int_api__dragging' : ''}`,
    ...listeners,
    ...attributes
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: `fas fa-${icon}`
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, label));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DraggableComponent);

/***/ }),

/***/ "./src/builder/components/TabContent/AddPropertyFormTab/Field/Field.css":
/*!******************************************************************************!*\
  !*** ./src/builder/components/TabContent/AddPropertyFormTab/Field/Field.css ***!
  \******************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ }),

/***/ "./src/builder/components/TabContent/AddPropertyFormTab/Field/Field.js":
/*!*****************************************************************************!*\
  !*** ./src/builder/components/TabContent/AddPropertyFormTab/Field/Field.js ***!
  \*****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dnd-kit/sortable */ "./node_modules/@dnd-kit/sortable/dist/sortable.esm.js");
/* harmony import */ var _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @dnd-kit/utilities */ "./node_modules/@dnd-kit/utilities/dist/utilities.esm.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _utils_fieldTypes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/fieldTypes */ "./src/builder/components/TabContent/AddPropertyFormTab/utils/fieldTypes.js");
/* harmony import */ var _utils_presetFields__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/presetFields */ "./src/builder/components/TabContent/AddPropertyFormTab/utils/presetFields.js");
/* harmony import */ var _Field_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Field.css */ "./src/builder/components/TabContent/AddPropertyFormTab/Field/Field.css");







const Field = ({
  id,
  field,
  index,
  fieldsLength,
  onEdit,
  onDelete,
  onToggle,
  onToggleRequired,
  onToggleAdminOnly,
  onMoveUp,
  onMoveDown,
  showToast,
  isFieldLocked,
  isGroupField = false,
  groupPosition,
  groupTotal
}) => {
  // Check if this field is part of a group - these should NOT be draggable individually
  const isPartOfGroup = isGroupField || !!field.group_id || (0,_utils_fieldTypes__WEBPACK_IMPORTED_MODULE_4__.getFieldGroupInfo)(field) !== null;
  const {
    attributes,
    listeners,
    setNodeRef,
    transform,
    transition,
    isDragging
  } = (0,_dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_1__.useSortable)({
    id: field.id,
    data: {
      type: 'field',
      fieldId: field.id,
      fieldType: field.type,
      isGroupField: isGroupField || !!field.group_id,
      groupId: field.group_id
    },
    disabled: isFieldLocked || isPartOfGroup // Disable dragging for group child fields AND locked fields
  });
  const style = {
    transform: _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.CSS.Transform.toString(transform),
    transition,
    opacity: isDragging ? 0.8 : 1,
    zIndex: isDragging ? 100 : 1,
    boxShadow: isDragging ? 'var(--hvnly-card-shadow)' : 'none'
  };
  const isPresetField = () => {
    return Object.values(_utils_presetFields__WEBPACK_IMPORTED_MODULE_5__.presetFields).some(category => category.fields.some(presetField => field.id && field.id.startsWith(presetField.id)));
  };
  const getPresetFieldInfo = () => {
    if (!isPresetField()) return null;
    for (const category of Object.values(_utils_presetFields__WEBPACK_IMPORTED_MODULE_5__.presetFields)) {
      for (const presetField of category.fields) {
        if (field.id && field.id.startsWith(presetField.id)) {
          return {
            category: category.name,
            icon: presetField.icon,
            originalLabel: presetField.defaultLabel
          };
        }
      }
    }
    return null;
  };
  const presetInfo = getPresetFieldInfo();
  const groupInfo = (0,_utils_fieldTypes__WEBPACK_IMPORTED_MODULE_4__.getFieldGroupInfo)(field);

  // Determine if this field is part of a group
  const isPartOfGroupFinal = isGroupField || !!field.group_id || groupInfo !== null;

  // Use provided groupPosition/groupTotal or get from field/groupInfo
  const currentGroupPosition = groupPosition !== undefined ? groupPosition : field.group_position !== undefined ? field.group_position : groupInfo?.position !== undefined ? groupInfo.position : 0;
  const currentGroupTotal = groupTotal !== undefined ? groupTotal : field.group_total !== undefined ? field.group_total : groupInfo?.total !== undefined ? groupInfo.total : 0;
  const currentIndex = field.order !== undefined ? field.order : index;
  const canMoveUp = !isFieldLocked && !isPartOfGroupFinal && currentIndex > 0;
  const canMoveDown = !isFieldLocked && !isPartOfGroupFinal && currentIndex < fieldsLength - 1;
  const handleDelete = e => {
    e.stopPropagation();
    if (isFieldLocked) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Cannot Delete', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('This field is required and cannot be deleted', 'havenlytics'));
      return;
    }
    if (isPartOfGroupFinal) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Cannot Delete', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Individual group fields cannot be deleted. Please delete the entire group.', 'havenlytics'));
      return;
    }
    onDelete();
  };
  const handleEdit = e => {
    e.stopPropagation();
    if (isFieldLocked) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Cannot Edit', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('This field is required and cannot be edited', 'havenlytics'));
      return;
    }
    if (isPartOfGroupFinal) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Cannot Edit', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Individual group fields cannot be edited. Please edit the entire group.', 'havenlytics'));
      return;
    }
    onEdit();
  };
  const handleToggle = e => {
    e.stopPropagation();
    if (isFieldLocked) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Cannot Modify', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('This field is required and cannot be modified', 'havenlytics'));
      return;
    }
    if (isPartOfGroupFinal) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Cannot Modify', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Individual group fields cannot be modified. Please modify the entire group.', 'havenlytics'));
      return;
    }
    onToggle();
  };
  const handleToggleRequired = e => {
    e.stopPropagation();
    if (isFieldLocked) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Cannot Modify', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('This field is required and cannot be modified', 'havenlytics'));
      return;
    }
    if (isPartOfGroupFinal) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Cannot Modify', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Individual group fields cannot be modified. Please modify the entire group.', 'havenlytics'));
      return;
    }
    onToggleRequired();
  };
  const handleToggleAdminOnly = e => {
    e.stopPropagation();
    if (isFieldLocked) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Cannot Modify', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('This field is required and cannot be modified', 'havenlytics'));
      return;
    }
    if (isPartOfGroupFinal) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Cannot Modify', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Individual group fields cannot be modified. Please modify the entire group.', 'havenlytics'));
      return;
    }
    onToggleAdminOnly();
  };
  const handleMoveUp = e => {
    e.stopPropagation();
    if (isFieldLocked) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Cannot Move', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('This field is required and cannot be moved', 'havenlytics'));
      return;
    }
    if (isPartOfGroupFinal) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Cannot Move', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Individual group fields cannot be moved. Please move the entire group.', 'havenlytics'));
      return;
    }
    onMoveUp();
  };
  const handleMoveDown = e => {
    e.stopPropagation();
    if (isFieldLocked) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Cannot Move', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('This field is required and cannot be moved', 'havenlytics'));
      return;
    }
    if (isPartOfGroupFinal) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Cannot Move', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Individual group fields cannot be moved. Please move the entire group.', 'havenlytics'));
      return;
    }
    onMoveDown();
  };
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    ref: setNodeRef,
    style: style,
    className: `hvnly--builder--int_api__property_builder_field 
        ${isFieldLocked ? 'hvnly--builder--int_api__locked_field' : ''} 
        ${isPresetField() ? 'hvnly--builder--int_api__preset_field' : ''} 
        ${isPartOfGroupFinal ? 'hvnly--builder--int_api__group_field' : ''} 
        ${isDragging ? 'dragging' : ''}`,
    "data-field-id": field.id,
    "data-field-order": currentIndex,
    "data-group-id": groupInfo?.id || field.group_id
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__drag_handle",
    ...attributes,
    ...listeners,
    style: {
      cursor: isFieldLocked || isPartOfGroupFinal ? 'not-allowed' : 'grab',
      opacity: isFieldLocked || isPartOfGroupFinal ? 0.5 : 1
    },
    title: isFieldLocked ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Required field cannot be moved', 'havenlytics') : isPartOfGroupFinal ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Group fields cannot be moved individually. Move the entire group.', 'havenlytics') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Drag to reorder', 'havenlytics')
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: `fas fa-${isFieldLocked || isPartOfGroupFinal ? 'lock' : 'grip-vertical'}`
  })), isPartOfGroupFinal && currentGroupTotal > 0 && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__group_position_indicator"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "hvnly--builder--int_api__group_position_number"
  }, currentGroupPosition + 1), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "hvnly--builder--int_api__group_position_total"
  }, "/", currentGroupTotal)), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_field_info"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: `fas fa-${presetInfo ? presetInfo.icon : (0,_utils_fieldTypes__WEBPACK_IMPORTED_MODULE_4__.getIconForType)(field.type)}`
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__field_details"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__field_label"
  }, field.label || field.name || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Untitled Field', 'havenlytics'), isFieldLocked && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "hvnly--builder--int_api__locked_badge"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-lock"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Required', 'havenlytics')), isPresetField() && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "hvnly--builder--int_api__preset_badge"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-star"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Preset', 'havenlytics')), isPartOfGroupFinal && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "hvnly--builder--int_api__group_badge"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: `fas fa-${groupInfo?.icon || 'folder'}`
  }), groupInfo?.name || field.group_name || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Group Field', 'havenlytics'))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__field_meta"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "hvnly--builder--int_api__field_type"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: `fas fa-${(0,_utils_fieldTypes__WEBPACK_IMPORTED_MODULE_4__.getIconForType)(field.type)}`
  }), field.type), field.placeholder && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "hvnly--builder--int_api__field_placeholder"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-text"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Placeholder:', 'havenlytics'), " ", field.placeholder), presetInfo && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "hvnly--builder--int_api__field_category"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-folder"
  }), " ", presetInfo.category), isPartOfGroupFinal && currentGroupTotal > 0 && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "hvnly--builder--int_api__group_position_text"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-hashtag"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Position', 'havenlytics'), " ", currentGroupPosition + 1, " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('of', 'havenlytics'), " ", currentGroupTotal), field.required && !isFieldLocked && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "hvnly--builder--int_api__field_required_badge"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-asterisk"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Required', 'havenlytics')), field.adminOnly && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "hvnly--builder--int_api__field_admin_badge"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-user-shield"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Admin Only', 'havenlytics')), !field.enabled && field.enabled !== undefined && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "hvnly--builder--int_api__field_disabled_badge"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-eye-slash"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Disabled', 'havenlytics'))))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_field_actions"
  }, !isFieldLocked && !isPartOfGroupFinal ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: `hvnly--builder--int_api__property_builder_field_action_btn toggle-btn ${!field.enabled ? 'hvnly--builder--int_api__property_builder_field_action_btn_active' : ''}`,
    onClick: handleToggle,
    title: field.enabled ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Disable Field', 'havenlytics') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Enable Field', 'havenlytics')
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: field.enabled ? 'fas fa-toggle-on' : 'fas fa-toggle-off'
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: `hvnly--builder--int_api__property_builder_field_action_btn required-btn ${field.required ? 'hvnly--builder--int_api__property_builder_field_action_btn_active' : ''}`,
    onClick: handleToggleRequired,
    title: field.required ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Make Optional', 'havenlytics') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Make Required', 'havenlytics')
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: `fas fa-${field.required ? 'check-circle' : 'circle'}`
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: `hvnly--builder--int_api__property_builder_field_action_btn admin-btn ${field.adminOnly ? 'hvnly--builder--int_api__property_builder_field_action_btn_active' : ''}`,
    onClick: handleToggleAdminOnly,
    title: field.adminOnly ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Make Public', 'havenlytics') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Make Admin Only', 'havenlytics')
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: `fas fa-${field.adminOnly ? 'user-shield' : 'user'}`
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: `hvnly--builder--int_api__property_builder_field_action_btn move-up-btn ${!canMoveUp ? 'hvnly--builder--int_api__disabled_action_btn' : ''}`,
    onClick: handleMoveUp,
    disabled: !canMoveUp,
    title: canMoveUp ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Move Field Up", "havenlytics") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Already at top", "havenlytics")
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-arrow-up"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: `hvnly--builder--int_api__property_builder_field_action_btn move-down-btn ${!canMoveDown ? 'hvnly--builder--int_api__disabled_action_btn' : ''}`,
    onClick: handleMoveDown,
    disabled: !canMoveDown,
    title: canMoveDown ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Move Field Down", "havenlytics") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Already at bottom", "havenlytics")
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-arrow-down"
  }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: "hvnly--builder--int_api__property_builder_field_action_btn edit-btn",
    onClick: handleEdit,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Edit Field", "havenlytics")
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-edit"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: "hvnly--builder--int_api__property_builder_field_action_btn delete-btn",
    onClick: handleDelete,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Delete Field", "havenlytics")
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-trash"
  }))) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: `hvnly--builder--int_api__property_builder_field_action_btn toggle-btn ${isPartOfGroupFinal ? 'hvnly--builder--int_api__disabled_action_btn' : 'hvnly--builder--int_api__locked_action_btn'}`,
    title: isPartOfGroupFinal ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Group fields cannot be disabled individually. Manage from group header.", "havenlytics") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Required Field - Cannot be disabled", "havenlytics"),
    disabled: true
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-toggle-on"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: `hvnly--builder--int_api__property_builder_field_action_btn required-btn ${isPartOfGroupFinal ? 'hvnly--builder--int_api__disabled_action_btn' : 'hvnly--builder--int_api__locked_action_btn'}`,
    title: isPartOfGroupFinal ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Group fields cannot be toggled individually. Manage from group header.", "havenlytics") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Required Field - Always required", "havenlytics"),
    disabled: true
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-check-circle"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: `hvnly--builder--int_api__property_builder_field_action_btn admin-btn ${isPartOfGroupFinal ? 'hvnly--builder--int_api__disabled_action_btn' : 'hvnly--builder--int_api__locked_action_btn'}`,
    title: isPartOfGroupFinal ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Group fields cannot be modified individually. Manage from group header.", "havenlytics") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Required Field - Admin only setting locked", "havenlytics"),
    disabled: true
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-user-shield"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: `hvnly--builder--int_api__property_builder_field_action_btn move-up-btn ${isPartOfGroupFinal ? 'hvnly--builder--int_api__disabled_action_btn' : 'hvnly--builder--int_api__locked_action_btn'}`,
    title: isPartOfGroupFinal ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Group fields cannot be moved individually. Move the entire group.", "havenlytics") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Required Field - Cannot be moved", "havenlytics"),
    disabled: true
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-arrow-up"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: `hvnly--builder--int_api__property_builder_field_action_btn move-down-btn ${isPartOfGroupFinal ? 'hvnly--builder--int_api__disabled_action_btn' : 'hvnly--builder--int_api__locked_action_btn'}`,
    title: isPartOfGroupFinal ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Group fields cannot be moved individually. Move the entire group.", "havenlytics") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Required Field - Cannot be moved", "havenlytics"),
    disabled: true
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-arrow-down"
  }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: `hvnly--builder--int_api__property_builder_field_action_btn edit-btn ${isPartOfGroupFinal ? 'hvnly--builder--int_api__disabled_action_btn' : 'hvnly--builder--int_api__locked_action_btn'}`,
    title: isPartOfGroupFinal ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Group fields cannot be edited individually. Edit the entire group.", "havenlytics") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Required Field - Cannot be edited", "havenlytics"),
    disabled: true
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-edit"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: `hvnly--builder--int_api__property_builder_field_action_btn delete-btn ${isPartOfGroupFinal ? 'hvnly--builder--int_api__disabled_action_btn' : 'hvnly--builder--int_api__locked_action_btn'}`,
    title: isPartOfGroupFinal ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Group fields cannot be deleted individually. Delete the entire group.", "havenlytics") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Required Field - Cannot be deleted", "havenlytics"),
    disabled: true
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-trash"
  })))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Field);

/***/ }),

/***/ "./src/builder/components/TabContent/AddPropertyFormTab/Group/Group.css":
/*!******************************************************************************!*\
  !*** ./src/builder/components/TabContent/AddPropertyFormTab/Group/Group.css ***!
  \******************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ }),

/***/ "./src/builder/components/TabContent/AddPropertyFormTab/Group/Group.js":
/*!*****************************************************************************!*\
  !*** ./src/builder/components/TabContent/AddPropertyFormTab/Group/Group.js ***!
  \*****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dnd-kit/sortable */ "./node_modules/@dnd-kit/sortable/dist/sortable.esm.js");
/* harmony import */ var _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @dnd-kit/utilities */ "./node_modules/@dnd-kit/utilities/dist/utilities.esm.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _Field_Field__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Field/Field */ "./src/builder/components/TabContent/AddPropertyFormTab/Field/Field.js");
/* harmony import */ var _Group_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Group.css */ "./src/builder/components/TabContent/AddPropertyFormTab/Group/Group.css");
/* harmony import */ var _GroupHelper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./GroupHelper */ "./src/builder/components/TabContent/AddPropertyFormTab/Group/GroupHelper.js");







const Group = ({
  group,
  onDelete,
  onToggleCollapse,
  onEditField,
  onDeleteField,
  onToggleField,
  onToggleFieldRequired,
  onToggleFieldAdminOnly,
  onMoveFieldUp,
  onMoveFieldDown,
  onMoveGroupUp,
  onMoveGroupDown,
  onToggleSidebar,
  showToast,
  canMoveUp,
  canMoveDown,
  groupCollapsedStates
}) => {
  const {
    attributes,
    listeners,
    setNodeRef,
    transform,
    transition,
    isDragging
  } = (0,_dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_1__.useSortable)({
    id: group.id,
    data: {
      type: 'group',
      groupId: group.id,
      groupType: group.group_type || group.type,
      fields: group.fields
    }
  });
  const style = {
    transform: _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.CSS.Transform.toString(transform),
    transition,
    opacity: isDragging ? 0.8 : 1,
    zIndex: isDragging ? 100 : 1,
    boxShadow: isDragging ? 'var(--hvnly-card-shadow)' : 'none'
  };
  const isCollapsed = group.collapsed || groupCollapsedStates?.[group.id] || false;

  // Get group type from multiple possible sources
  const groupType = group.group_type || group.type || '';

  // Sort fields by order/position
  const sortedFields = [...(group.fields || [])].sort((a, b) => (a.group_position !== undefined ? a.group_position : a.order || 0) - (b.group_position !== undefined ? b.group_position : b.order || 0));
  const handleDelete = e => {
    e.stopPropagation();
    onDelete();
  };
  const handleMoveUp = e => {
    e.stopPropagation();
    if (canMoveUp) {
      onMoveGroupUp();
    }
  };
  const handleMoveDown = e => {
    e.stopPropagation();
    if (canMoveDown) {
      onMoveGroupDown();
    }
  };
  const handleToggleSidebar = e => {
    e.stopPropagation();
    // Check for property_docs using both possible property names
    if (groupType === 'property_docs' && onToggleSidebar) {
      const currentStatus = group.show_in_sidebar !== false;
      onToggleSidebar(group.id, !currentStatus);
    }
  };
  const isPropertyDocs = groupType === 'property_docs';
  const isMapGroup = groupType === 'map';
  const isVideoGroup = groupType === 'video';
  const isGalleryGroup = groupType === 'gallery';

  // Get sidebar status from group or from first field
  const getSidebarStatus = () => {
    if (group.show_in_sidebar !== undefined) return group.show_in_sidebar;
    if (group.fields && group.fields.length > 0) {
      return group.fields[0]?.show_in_sidebar !== false;
    }
    return true;
  };
  const showInSidebar = getSidebarStatus();

  // Show helper for empty groups
  const showHelper = sortedFields.length === 0 && (isMapGroup || isVideoGroup || isGalleryGroup || isPropertyDocs);
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    ref: setNodeRef,
    style: style,
    className: `hvnly--builder--int_api__property_builder_group 
        ${isCollapsed ? 'collapsed' : ''} 
        ${isPropertyDocs ? 'hvnly--builder--int_api__property_docs_group' : ''}
        sidebar-${showInSidebar ? 'visible' : 'hidden'}`,
    "data-group-id": group.id,
    "data-group-type": groupType,
    "data-sidebar-status": showInSidebar ? 'visible' : 'hidden'
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_group_header"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__drag_handle",
    ...attributes,
    ...listeners,
    style: {
      cursor: 'grab'
    },
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Drag to reorder group", "havenlytics")
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-grip-vertical"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: "hvnly--builder--int_api__group_collapse_btn",
    onClick: e => {
      e.stopPropagation();
      onToggleCollapse();
    },
    title: isCollapsed ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Expand Group", "havenlytics") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Collapse Group", "havenlytics"),
    type: "button"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: `fas fa-chevron-${isCollapsed ? 'right' : 'down'}`
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h4", null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: `fas ${group.icon || (isPropertyDocs ? 'fa-file-pdf' : 'fa-layer-group')}`
  }), group.group_name || group.name || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Group', 'havenlytics'), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "hvnly--builder--int_api__group_badge"
  }, sortedFields.length, " ", sortedFields.length !== 1 ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('fields', 'havenlytics') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('field', 'havenlytics')), groupType && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "hvnly--builder--int_api__group_type_badge"
  }, groupType === 'property_docs' ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Documents', 'havenlytics') : groupType), isPropertyDocs && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: `hvnly--builder--int_api__sidebar_toggle_btn ${showInSidebar ? 'active' : ''}`,
    onClick: handleToggleSidebar,
    title: showInSidebar ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Hide from sidebar', 'havenlytics') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Show in sidebar', 'havenlytics'),
    type: "button"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: `fas fa-${showInSidebar ? 'eye' : 'eye-slash'}`
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "toggle-label"
  }, showInSidebar ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Sidebar', 'havenlytics') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Hidden', 'havenlytics')))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_group_actions"
  }, canMoveUp && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: "hvnly--builder--int_api__property_builder_group_action_btn move-up-btn",
    onClick: handleMoveUp,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Move Group Up", "havenlytics"),
    type: "button"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-arrow-up"
  })), canMoveDown && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: "hvnly--builder--int_api__property_builder_group_action_btn move-down-btn",
    onClick: handleMoveDown,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Move Group Down", "havenlytics"),
    type: "button"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-arrow-down"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: "hvnly--builder--int_api__property_builder_group_action_btn delete-btn",
    onClick: handleDelete,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Delete Group", "havenlytics"),
    type: "button"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-trash"
  })))), !isCollapsed ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, showHelper && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_GroupHelper__WEBPACK_IMPORTED_MODULE_6__["default"], {
    groupType: groupType
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_group_content"
  }, sortedFields.map((field, fieldIndex) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Field_Field__WEBPACK_IMPORTED_MODULE_4__["default"], {
    key: `${field.id}-${fieldIndex}`,
    id: field.id,
    field: field,
    index: fieldIndex,
    fieldsLength: sortedFields.length,
    onEdit: () => onEditField(field.id),
    onDelete: () => onDeleteField(field.id),
    onToggle: () => onToggleField(field.id),
    onToggleRequired: () => onToggleFieldRequired(field.id),
    onToggleAdminOnly: () => onToggleFieldAdminOnly(field.id),
    onMoveUp: () => onMoveFieldUp(field.id),
    onMoveDown: () => onMoveFieldDown(field.id),
    showToast: showToast,
    isFieldLocked: field.locked,
    isGroupField: true,
    groupPosition: field.group_position || fieldIndex,
    groupTotal: sortedFields.length
  })))) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_group_collapsed_summary"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, sortedFields.length, " ", sortedFields.length !== 1 ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('fields', 'havenlytics') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('field', 'havenlytics')), isPropertyDocs && showInSidebar && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "sidebar-status",
    "data-status": "visible"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-eye"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Visible in sidebar', 'havenlytics')), isPropertyDocs && !showInSidebar && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "sidebar-status",
    "data-status": "hidden"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-eye-slash"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Hidden from sidebar', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: "hvnly--builder--int_api__group_expand_btn",
    onClick: () => onToggleCollapse(),
    type: "button"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-chevron-right"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Expand', 'havenlytics'))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Group);

/***/ }),

/***/ "./src/builder/components/TabContent/AddPropertyFormTab/Group/GroupHelper.css":
/*!************************************************************************************!*\
  !*** ./src/builder/components/TabContent/AddPropertyFormTab/Group/GroupHelper.css ***!
  \************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ }),

/***/ "./src/builder/components/TabContent/AddPropertyFormTab/Group/GroupHelper.js":
/*!***********************************************************************************!*\
  !*** ./src/builder/components/TabContent/AddPropertyFormTab/Group/GroupHelper.js ***!
  \***********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _GroupHelper_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./GroupHelper.css */ "./src/builder/components/TabContent/AddPropertyFormTab/Group/GroupHelper.css");



const GroupHelper = ({
  groupType
}) => {
  const helpers = {
    map: {
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Map Location Group', 'havenlytics'),
      description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This group creates 4 fields for displaying a property on Google Maps:', 'havenlytics'),
      fields: [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('📍 Address - The property street address', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('📍 Latitude - Get coordinates from maps.ie', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('📍 Longitude - Get coordinates from maps.ie', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('📍 Map Preview - Shows the interactive map', 'havenlytics')],
      tip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('💡 Tip: Use maps.ie to find accurate latitude/longitude coordinates', 'havenlytics')
    },
    video: {
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Video Group', 'havenlytics'),
      description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This group creates 3 fields for video content:', 'havenlytics'),
      fields: [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('🎬 Video Title - Display name for the video', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('🎬 Video URL - YouTube/Vimeo or self-hosted URL', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('🎬 Thumbnail - Custom thumbnail image', 'havenlytics')],
      tip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('💡 Tip: YouTube videos work best with standard share URLs', 'havenlytics')
    },
    gallery: {
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Gallery Group', 'havenlytics'),
      description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This group creates 2 fields for image galleries:', 'havenlytics'),
      fields: [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('🖼️ Gallery Title - Name for the gallery', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('🖼️ Gallery Images - Upload multiple images', 'havenlytics')],
      tip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('💡 Tip: Drag and drop to reorder gallery images', 'havenlytics')
    },
    property_docs: {
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Property Documents Group', 'havenlytics'),
      description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This group creates document management fields:', 'havenlytics'),
      fields: [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('📄 Icon - FontAwesome icon name (e.g., file-pdf)', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('📄 Label - Display name for the document', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('📄 URL - Document file path or external link', 'havenlytics')],
      tip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('💡 Tip: Use the sidebar toggle to show/hide documents in the property sidebar', 'havenlytics')
    }
  };
  const helper = helpers[groupType];
  if (!helper) return null;
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-group-helper"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-group-helper-header"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-info-circle"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, helper.title)), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
    className: "hvnly-group-helper-desc"
  }, helper.description), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("ul", {
    className: "hvnly-group-helper-fields"
  }, helper.fields.map((field, idx) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("li", {
    key: idx
  }, field))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-group-helper-tip"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-lightbulb"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, helper.tip)));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (GroupHelper);

/***/ }),

/***/ "./src/builder/components/TabContent/AddPropertyFormTab/Modal/Modal.css":
/*!******************************************************************************!*\
  !*** ./src/builder/components/TabContent/AddPropertyFormTab/Modal/Modal.css ***!
  \******************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ }),

/***/ "./src/builder/components/TabContent/AddPropertyFormTab/Modal/Modal.js":
/*!*****************************************************************************!*\
  !*** ./src/builder/components/TabContent/AddPropertyFormTab/Modal/Modal.js ***!
  \*****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! uuid */ "./node_modules/uuid/dist/esm-browser/v4.js");
/* harmony import */ var _utils_fieldTypes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/fieldTypes */ "./src/builder/components/TabContent/AddPropertyFormTab/utils/fieldTypes.js");
/* harmony import */ var _utils_icons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/icons */ "./src/builder/components/TabContent/AddPropertyFormTab/utils/icons.js");
/* harmony import */ var _utils_presetFields__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/presetFields */ "./src/builder/components/TabContent/AddPropertyFormTab/utils/presetFields.js");
/* harmony import */ var _Modal_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Modal.css */ "./src/builder/components/TabContent/AddPropertyFormTab/Modal/Modal.css");








const Modal = ({
  type,
  data,
  onSave,
  onClose,
  existingFields = [],
  allowMultiple = false
}) => {
  const [formData, setFormData] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)({
    title: '',
    icon: 'home',
    type: 'text',
    label: '',
    placeholder: '',
    required: false,
    adminOnly: false,
    enabled: true
  });
  const [iconSearch, setIconSearch] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)('');
  const [showAllIcons, setShowAllIcons] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  const [fieldMode, setFieldMode] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)('custom');
  const [selectedPresetFields, setSelectedPresetFields] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
  const [presetSearch, setPresetSearch] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)('');
  const [activeCategory, setActiveCategory] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)('basic');

  // Check if we're editing an existing group field
  const [isEditingGroup, setIsEditingGroup] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  // Check if we're editing a single field (text, textarea, number, etc.)
  const [isEditingSingleField, setIsEditingSingleField] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  // Store the original group data for replacement
  const [originalGroupData, setOriginalGroupData] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(null);

  // Brand icons list that need 'fab' prefix instead of 'fas'
  const brandIcons = ['twitter', 'facebook', 'instagram', 'linkedin', 'youtube', 'pinterest', 'snapchat', 'skype', 'android', 'apple', 'windows', 'linux', 'chrome', 'firefox', 'safari', 'opera', 'edge', 'amazon', 'ebay', 'paypal', 'visa', 'mastercard', 'discover', 'amex', 'stripe', 'bitcoin', 'ethereum', 'github', 'gitlab', 'docker', 'wordpress', 'php', 'js', 'css3', 'html5', 'react', 'vuejs', 'angular', 'node', 'npm', 'python', 'java', 'microsoft', 'google', 'google-play', 'google-drive', 'google-plus', 'yahoo', 'bing', 'twitch', 'tiktok', 'whatsapp', 'telegram', 'signal', 'discord', 'slack', 'trello', 'asana', 'jira', 'confluence', 'bitbucket', 'git', 'git-alt', 'docker', 'kubernetes', 'aws', 'azure', 'cloudflare', 'digital-ocean'];

  // Function to get icon prefix
  const getIconPrefix = iconName => {
    return brandIcons.includes(iconName) ? 'fab' : 'fas';
  };

  // Initialize form data
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (data) {
      if (type === 'tab' || type === 'section' || type === 'tabsection') {
        setFormData({
          title: data.title || '',
          icon: data.icon || 'home'
        });
      } else {
        // Check if this is a group field being edited
        const isGroup = data.group_type || data.type && _utils_fieldTypes__WEBPACK_IMPORTED_MODULE_4__.fieldTypes.find(ft => ft.value === data.type)?.isGroup;
        setIsEditingGroup(isGroup);

        // Check if this is a single field being edited (not a group)
        const isSingle = !isGroup && data && data.id;
        setIsEditingSingleField(isSingle);

        // Store original group data for replacement
        if (isGroup && data.group_id) {
          setOriginalGroupData({
            group_id: data.group_id,
            group_type: data.group_type,
            group_base_id: data.group_base_id,
            fields: existingFields.filter(f => f.group_id === data.group_id)
          });
        }
        setFormData({
          type: data.type || 'text',
          label: data.label || '',
          placeholder: data.placeholder || '',
          required: data.required || false,
          adminOnly: data.adminOnly || false,
          enabled: data.enabled !== false
        });
        if (data.id) {
          const isPreset = Object.values(_utils_presetFields__WEBPACK_IMPORTED_MODULE_6__.presetFields).some(category => category.fields.some(field => data.id.startsWith(field.id)));
          if (isPreset) {
            setFieldMode('preset');
            Object.values(_utils_presetFields__WEBPACK_IMPORTED_MODULE_6__.presetFields).forEach(category => {
              category.fields.forEach(field => {
                if (data.id.startsWith(field.id)) {
                  setActiveCategory(Object.keys(_utils_presetFields__WEBPACK_IMPORTED_MODULE_6__.presetFields).find(key => _utils_presetFields__WEBPACK_IMPORTED_MODULE_6__.presetFields[key].name === category.name));
                  setSelectedPresetFields([field.id]);
                }
              });
            });
          }
        }
      }
    } else {
      setFormData({
        title: '',
        icon: 'home',
        type: 'text',
        label: '',
        placeholder: '',
        required: false,
        adminOnly: false,
        enabled: true
      });
      setFieldMode('custom');
      setSelectedPresetFields([]);
      setActiveCategory('basic');
      setIsEditingGroup(false);
      setIsEditingSingleField(false);
      setOriginalGroupData(null);
    }
  }, [data, type, existingFields]);
  const handleChange = e => {
    const {
      name,
      value,
      type: inputType,
      checked
    } = e.target;
    setFormData(prev => ({
      ...prev,
      [name]: inputType === 'checkbox' ? checked : value
    }));
  };
  const handleIconSelect = icon => {
    setFormData(prev => ({
      ...prev,
      icon
    }));
  };

  /**
   * Handle creating group fields with proper unique field names
   */
  const createGroupFields = (groupType, isReplacement = false, originalGroup = null) => {
    const groupDefinition = _utils_fieldTypes__WEBPACK_IMPORTED_MODULE_4__.groupDefinitions[groupType];
    if (!groupDefinition) return [];
    let groupId, groupBaseId, timestamp, uniqueSuffix;
    if (isReplacement && originalGroup) {
      groupId = originalGroup.group_id;
      groupBaseId = originalGroup.group_base_id;
      timestamp = Date.now();
      uniqueSuffix = originalGroup.group_unique_id || (0,uuid__WEBPACK_IMPORTED_MODULE_3__["default"])().substring(0, 8);
    } else {
      groupId = (0,_utils_fieldTypes__WEBPACK_IMPORTED_MODULE_4__.generateGroupId)(groupType);
      timestamp = Date.now();
      uniqueSuffix = (0,uuid__WEBPACK_IMPORTED_MODULE_3__["default"])().substring(0, 8);
      groupBaseId = `${groupType}_${timestamp}_${uniqueSuffix}`;
    }
    return groupDefinition.fields.map((fieldDef, index) => {
      const metaKey = fieldDef.metaKey || fieldDef.id;
      const fieldId = isReplacement && originalGroup ? `${originalGroup.group_base_id}_${metaKey}` : `${groupBaseId}_${metaKey}`;
      const fieldName = isReplacement && originalGroup ? `${originalGroup.group_base_id}_${metaKey}` : `${groupBaseId}_${metaKey}`;
      const legacyName = `_hvnly_${groupType}_${metaKey}`;
      const fieldData = {
        id: fieldId,
        name: fieldName,
        type: fieldDef.type,
        label: fieldDef.label,
        placeholder: fieldDef.placeholder || '',
        required: fieldDef.required || false,
        adminOnly: formData.adminOnly,
        enabled: formData.enabled !== false,
        locked: false,
        order: existingFields.length + index,
        group_id: groupId,
        group_type: groupType,
        group_name: groupDefinition.name,
        group_position: index,
        group_total: groupDefinition.fieldCount,
        group_collapsed: false,
        group_base_id: isReplacement && originalGroup ? originalGroup.group_base_id : groupBaseId,
        metaKey: metaKey,
        legacy_name: legacyName,
        description: fieldDef.description || '',
        group_timestamp: timestamp,
        group_unique_id: uniqueSuffix
      };
      if (groupType === 'property_docs') {
        fieldData.show_in_sidebar = true;
      }
      if (groupType === 'map') {
        const baseId = isReplacement && originalGroup ? originalGroup.group_base_id : groupBaseId;
        fieldData.address_field_name = `${baseId}_address`;
        fieldData.lat_field_name = `${baseId}_latitude`;
        fieldData.lng_field_name = `${baseId}_longitude`;
        fieldData.map_field_name = `${baseId}_preview`;
      }
      return fieldData;
    });
  };
  const handleSubmit = e => {
    e.preventDefault();
    if (type === 'field' && fieldMode === 'preset') {
      const fieldsToSave = selectedPresetFields.map(fieldId => {
        let presetField = null;
        Object.values(_utils_presetFields__WEBPACK_IMPORTED_MODULE_6__.presetFields).forEach(category => {
          const found = category.fields.find(field => field.id === fieldId);
          if (found) presetField = found;
        });
        if (!presetField) return null;
        return {
          ...presetField,
          id: presetField.id,
          label: presetField.defaultLabel,
          placeholder: presetField.defaultPlaceholder,
          required: presetField.defaultRequired,
          adminOnly: presetField.defaultAdminOnly,
          enabled: true,
          locked: false,
          options: presetField.options || {}
        };
      }).filter(field => field !== null);
      if (fieldsToSave.length > 0) {
        onSave(fieldsToSave);
      }
    } else {
      const selectedFieldType = formData.type;
      const fieldTypeDef = _utils_fieldTypes__WEBPACK_IMPORTED_MODULE_4__.fieldTypes.find(ft => ft.value === selectedFieldType);

      // If editing a single field, only allow non-group field types
      if (isEditingSingleField && fieldTypeDef?.isGroup) {
        // This should not happen because UI restricts it, but just in case
        console.warn('Cannot convert single field to group');
        return;
      }

      // Check if this is a group field type
      if (fieldTypeDef?.isGroup) {
        // Check if we're editing an existing group (replacement)
        if (isEditingGroup && originalGroupData) {
          const replacementGroupFields = createGroupFields(fieldTypeDef.groupType, true, originalGroupData);
          onSave({
            type: 'REPLACE_GROUP',
            oldGroupId: originalGroupData.group_id,
            newFields: replacementGroupFields,
            newGroupType: fieldTypeDef.groupType
          });
        } else {
          const groupFields = createGroupFields(fieldTypeDef.groupType, false, null);
          onSave(groupFields);
        }
      } else {
        // Handle normal field (non-group)
        onSave(formData);
      }
    }
  };
  const handlePresetFieldToggle = fieldId => {
    setSelectedPresetFields(prev => {
      if (data && !Array.isArray(data) || !allowMultiple) {
        return prev.includes(fieldId) ? [] : [fieldId];
      }
      if (prev.includes(fieldId)) {
        return prev.filter(id => id !== fieldId);
      } else {
        return [...prev, fieldId];
      }
    });
  };
  const isPresetFieldInUse = fieldId => {
    if (data && data.id && data.id.startsWith(fieldId)) {
      return false;
    }
    return existingFields.some(field => field.id && field.id.startsWith(fieldId));
  };
  const getFilteredPresetFields = () => {
    const category = _utils_presetFields__WEBPACK_IMPORTED_MODULE_6__.presetFields[activeCategory];
    if (!category) return [];
    if (!presetSearch.trim()) return category.fields;
    return category.fields.filter(field => field.defaultLabel.toLowerCase().includes(presetSearch.toLowerCase()) || field.defaultPlaceholder && field.defaultPlaceholder.toLowerCase().includes(presetSearch.toLowerCase()));
  };
  const getFilteredIcons = () => {
    let icons = showAllIcons ? _utils_icons__WEBPACK_IMPORTED_MODULE_5__.allIcons : _utils_icons__WEBPACK_IMPORTED_MODULE_5__.popularIcons;
    if (iconSearch.trim()) {
      icons = icons.filter(icon => icon.toLowerCase().includes(iconSearch.toLowerCase()));
    }
    return icons;
  };
  const displayedIcons = getFilteredIcons();
  const filteredPresetFields = getFilteredPresetFields();

  // Filter field types based on editing mode
  const getAvailableFieldTypes = () => {
    // If editing a single field (text, textarea, number, etc.), ONLY show non-group field types
    if (isEditingSingleField) {
      return _utils_fieldTypes__WEBPACK_IMPORTED_MODULE_4__.fieldTypes.filter(field => field.isGroup !== true);
    }

    // If editing a group field, ONLY show group field types
    if (isEditingGroup) {
      const groupTypes = _utils_fieldTypes__WEBPACK_IMPORTED_MODULE_4__.fieldTypes.filter(field => field.isGroup === true);
      if (data && data.group_type) {
        const hasCurrentType = groupTypes.some(ft => ft.groupType === data.group_type);
        if (!hasCurrentType && data.type) {
          const currentTypeDef = _utils_fieldTypes__WEBPACK_IMPORTED_MODULE_4__.fieldTypes.find(ft => ft.value === data.type);
          if (currentTypeDef && currentTypeDef.isGroup) {
            groupTypes.unshift(currentTypeDef);
          }
        }
      }
      return groupTypes;
    }

    // When adding new field, show all types including groups
    return _utils_fieldTypes__WEBPACK_IMPORTED_MODULE_4__.fieldTypes;
  };
  const availableFieldTypes = getAvailableFieldTypes();
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_modal_overlay"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_modal hvnly--builder--int_api__property_builder_wide_modal"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_modal_header"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h2", null, data ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Edit', 'havenlytics') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Add New', 'havenlytics'), type === 'tab' || type === 'section' || type === 'tabsection' ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)(' Section', 'havenlytics') : isEditingGroup ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)(' Group Field', 'havenlytics') : isEditingSingleField ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)(' Field', 'havenlytics') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)(' Field', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    onClick: onClose,
    className: "hvnly--builder--int_api__modal_close_btn"
  }, "\xD7")), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("form", {
    onSubmit: handleSubmit
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_modal_body"
  }, type === 'tab' || type === 'section' || type === 'tabsection' ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_modal_form_group"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("label", {
    className: "hvnly--builder--int_api__property_builder_modal_label"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Section Title', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("input", {
    type: "text",
    className: "hvnly--builder--int_api__property_builder_modal_input",
    name: "title",
    value: formData.title || '',
    onChange: handleChange,
    placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Enter section title', 'havenlytics'),
    required: true
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_modal_form_group"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("label", {
    className: "hvnly--builder--int_api__property_builder_modal_label"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Select Icon', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__icon_search"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("input", {
    type: "text",
    className: "hvnly--builder--int_api__property_builder_modal_input",
    placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Search icons...', 'havenlytics'),
    value: iconSearch,
    onChange: e => setIconSearch(e.target.value)
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    type: "button",
    className: "hvnly--builder--int_api__show_all_icons_btn",
    onClick: () => setShowAllIcons(!showAllIcons)
  }, showAllIcons ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Show Popular Only', 'havenlytics') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Show All Icons', 'havenlytics'))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_icon_picker"
  }, displayedIcons.map(icon => {
    const iconPrefix = getIconPrefix(icon);
    return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      key: icon,
      className: `hvnly--builder--int_api__property_builder_icon_option ${formData.icon === icon ? 'selected' : ''}`,
      onClick: () => handleIconSelect(icon),
      title: icon
    }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
      className: `${iconPrefix} fa-${icon}`
    }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      className: "icon-name"
    }, icon), formData.icon === icon && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      className: "icon-checkmark"
    }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
      className: "fas fa-check"
    })));
  })), displayedIcons.length === 0 && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
    className: "hvnly--builder--int_api__no_icons_found"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('No icons found matching', 'havenlytics'), " \"", iconSearch, "\""))) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, !isEditingGroup && !isEditingSingleField && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_modal_form_group"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__field_mode_toggle"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    type: "button",
    className: `hvnly--builder--int_api__field_mode_btn ${fieldMode === 'preset' ? 'active' : ''}`,
    onClick: () => setFieldMode('preset')
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-star"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Preset Fields', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    type: "button",
    className: `hvnly--builder--int_api__field_mode_btn ${fieldMode === 'custom' ? 'active' : ''}`,
    onClick: () => setFieldMode('custom')
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-edit"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Custom Field', 'havenlytics')))), isEditingGroup && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_modal_form_group"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__editing_group_notice"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-info-circle"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('You are editing a group field. You can only replace it with another group field type.', 'havenlytics')))), isEditingSingleField && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_modal_form_group"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__editing_group_notice",
    style: {
      borderLeftColor: '#00a32a',
      background: 'rgba(0, 163, 42, 0.05)'
    }
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-edit",
    style: {
      color: '#00a32a'
    }
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('You are editing a single field. You cannot convert it to a group field.', 'havenlytics')))), fieldMode === 'preset' && !isEditingGroup && !isEditingSingleField ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_modal_form_group hvnly--builder--int_api__preset_fields_container"
  }, allowMultiple && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__multiple_selection_info"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-info-circle"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('You can select multiple fields by clicking on them', 'havenlytics'))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__preset_categories"
  }, Object.entries(_utils_presetFields__WEBPACK_IMPORTED_MODULE_6__.presetFields).map(([key, category]) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    key: key,
    type: "button",
    className: `hvnly--builder--int_api__preset_category_tab ${activeCategory === key ? 'active' : ''}`,
    onClick: () => setActiveCategory(key)
  }, category.name))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__preset_fields_header"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__preset_search"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-search"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("input", {
    type: "text",
    placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Search preset fields...', 'havenlytics'),
    value: presetSearch,
    onChange: e => setPresetSearch(e.target.value)
  }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__preset_fields_list"
  }, filteredPresetFields.length > 0 ? filteredPresetFields.map(field => {
    const isInUse = isPresetFieldInUse(field.id);
    const isSelected = selectedPresetFields.includes(field.id);
    return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      key: field.id,
      className: `hvnly--builder--int_api__preset_field_item ${isInUse ? 'in-use' : ''} ${isSelected ? 'selected' : ''}`,
      onClick: () => !isInUse && handlePresetFieldToggle(field.id)
    }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      className: "hvnly--builder--int_api__preset_field_checkbox"
    }, isSelected && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
      className: "fas fa-check"
    })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      className: "hvnly--builder--int_api__preset_field_info"
    }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      className: "hvnly--builder--int_api__preset_field_label"
    }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
      className: `fas fa-${field.icon}`
    }), field.defaultLabel, field.defaultRequired && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
      className: "hvnly--builder--int_api__field_required_badge"
    }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Required', 'havenlytics'))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      className: "hvnly--builder--int_api__preset_field_description"
    }, field.defaultPlaceholder), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      className: "hvnly--builder--int_api__preset_field_type"
    }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Type:', 'havenlytics'), " ", _utils_fieldTypes__WEBPACK_IMPORTED_MODULE_4__.fieldTypes.find(ft => ft.value === field.type)?.label || field.type)), isInUse && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      className: "hvnly--builder--int_api__preset_field_status"
    }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
      className: "hvnly--builder--int_api__preset_field_in_use"
    }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Already in use', 'havenlytics'))));
  }) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__no_preset_fields_found"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-search"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('No preset fields found matching', 'havenlytics'), " \"", presetSearch, "\""))), selectedPresetFields.length > 0 && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__selected_preset_fields"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h4", null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-check-circle"
  }), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Selected Fields', 'havenlytics'), " (", selectedPresetFields.length, ")"), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__selected_preset_fields_list"
  }, selectedPresetFields.map(fieldId => {
    let presetField = null;
    Object.values(_utils_presetFields__WEBPACK_IMPORTED_MODULE_6__.presetFields).forEach(category => {
      const found = category.fields.find(field => field.id === fieldId);
      if (found) presetField = found;
    });
    return presetField ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      key: fieldId,
      className: "hvnly--builder--int_api__selected_preset_field_item"
    }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
      className: `fas fa-${presetField.icon}`
    }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, presetField.defaultLabel), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
      type: "button",
      className: "hvnly--builder--int_api__remove_preset_field_btn",
      onClick: () => handlePresetFieldToggle(fieldId)
    }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
      className: "fas fa-times"
    }))) : null;
  })))) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_modal_form_group"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("label", {
    className: "hvnly--builder--int_api__property_builder_modal_label"
  }, isEditingGroup ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Replace With Group Field Type', 'havenlytics') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Field Type', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("select", {
    className: "hvnly--builder--int_api__property_builder_modal_select",
    name: "type",
    value: formData.type,
    onChange: handleChange,
    required: true
  }, availableFieldTypes.map(field => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("option", {
    key: field.value,
    value: field.value
  }, field.label, field.isGroup ? ` (${_utils_fieldTypes__WEBPACK_IMPORTED_MODULE_4__.groupDefinitions[field.groupType]?.fieldCount || 0} fields)` : ''))), isEditingSingleField && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
    className: "hvnly--builder--int_api__field_type_warning",
    style: {
      marginTop: '8px',
      color: '#00a32a'
    }
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-info-circle"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Single fields can only be edited as single fields. Group fields are not available for editing single fields.', 'havenlytics'))), !_utils_fieldTypes__WEBPACK_IMPORTED_MODULE_4__.fieldTypes.find(ft => ft.value === formData.type)?.isGroup && !isEditingGroup && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_modal_form_group"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("label", {
    className: "hvnly--builder--int_api__property_builder_modal_label"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Field Label', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("input", {
    type: "text",
    className: "hvnly--builder--int_api__property_builder_modal_input",
    name: "label",
    value: formData.label || '',
    onChange: handleChange,
    placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Enter field label', 'havenlytics'),
    required: true
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_modal_form_group"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("label", {
    className: "hvnly--builder--int_api__property_builder_modal_label"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Placeholder Text', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("input", {
    type: "text",
    className: "hvnly--builder--int_api__property_builder_modal_input",
    name: "placeholder",
    value: formData.placeholder || '',
    onChange: handleChange,
    placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Enter placeholder text', 'havenlytics')
  }))), _utils_fieldTypes__WEBPACK_IMPORTED_MODULE_4__.fieldTypes.find(ft => ft.value === formData.type)?.isGroup && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_modal_form_group"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__group_info_banner"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-info-circle"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('This will create a group of', 'havenlytics'), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("strong", null, " ", _utils_fieldTypes__WEBPACK_IMPORTED_MODULE_4__.groupDefinitions[_utils_fieldTypes__WEBPACK_IMPORTED_MODULE_4__.fieldTypes.find(ft => ft.value === formData.type)?.groupType]?.fieldCount, " "), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('related fields that will be visually grouped together.', 'havenlytics'))), isEditingGroup && data?.group_type && data.group_type !== formData.type && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__group_replace_warning"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-exclamation-triangle"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("strong", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Warning:', 'havenlytics')), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Replacing this group will remove all existing fields in the current group and create a new group with different field structure.', 'havenlytics')))), (!_utils_fieldTypes__WEBPACK_IMPORTED_MODULE_4__.fieldTypes.find(ft => ft.value === formData.type)?.isGroup || !isEditingGroup) && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_modal_form_group hvnly--builder--int_api__modal_checkbox_group"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("label", {
    className: "hvnly--builder--int_api__property_builder_modal_checkbox"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("input", {
    type: "checkbox",
    name: "required",
    checked: formData.required,
    onChange: handleChange
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "hvnly--builder--int_api__checkbox_custom"
  }), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Required Field', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("label", {
    className: "hvnly--builder--int_api__property_builder_modal_checkbox"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("input", {
    type: "checkbox",
    name: "adminOnly",
    checked: formData.adminOnly,
    onChange: handleChange
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "hvnly--builder--int_api__checkbox_custom"
  }), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Administrative Only', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("label", {
    className: "hvnly--builder--int_api__property_builder_modal_checkbox"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("input", {
    type: "checkbox",
    name: "enabled",
    checked: formData.enabled,
    onChange: handleChange
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "hvnly--builder--int_api__checkbox_custom"
  }), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Field Enabled', 'havenlytics')))))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_modal_footer"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    type: "button",
    className: "hvnly--builder--int_api__property_builder_modal_btn hvnly--builder--int_api__property_builder_modal_btn_secondary",
    onClick: onClose
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Cancel', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    type: "submit",
    className: "hvnly--builder--int_api__property_builder_modal_btn hvnly--builder--int_api__property_builder_modal_btn_primary",
    disabled: type === 'field' && fieldMode === 'preset' && selectedPresetFields.length === 0 && !isEditingGroup && !isEditingSingleField || type !== 'field' && !formData.title.trim()
  }, type === 'field' && fieldMode === 'preset' && !isEditingGroup && !isEditingSingleField ? `${(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Add', 'havenlytics')} ${selectedPresetFields.length} ${selectedPresetFields.length !== 1 ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Fields', 'havenlytics') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Field', 'havenlytics')}` : (data ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Update', 'havenlytics') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Add', 'havenlytics')) + ' ' + (type === 'tab' || type === 'section' || type === 'tabsection' ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Section', 'havenlytics') : isEditingGroup ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Group', 'havenlytics') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Field', 'havenlytics')))))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Modal);

/***/ }),

/***/ "./src/builder/components/TabContent/AddPropertyFormTab/PlaceholderLoader/PlaceholderLoader.css":
/*!******************************************************************************************************!*\
  !*** ./src/builder/components/TabContent/AddPropertyFormTab/PlaceholderLoader/PlaceholderLoader.css ***!
  \******************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ }),

/***/ "./src/builder/components/TabContent/AddPropertyFormTab/PlaceholderLoader/PlaceholderLoader.js":
/*!*****************************************************************************************************!*\
  !*** ./src/builder/components/TabContent/AddPropertyFormTab/PlaceholderLoader/PlaceholderLoader.js ***!
  \*****************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _PlaceholderLoader_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PlaceholderLoader.css */ "./src/builder/components/TabContent/AddPropertyFormTab/PlaceholderLoader/PlaceholderLoader.css");

// src/components/PlaceholderLoader/PlaceholderLoader.js

const PlaceholderLoader = ({
  count = 2
}) => {
  const renderPlaceholderTabs = () => {
    const tabs = [];
    for (let i = 0; i < count; i++) {
      tabs.push((0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        key: i,
        className: "hvnly-placeholder-tab"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-tab-header"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-tab-icon"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-tab-title"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-tab-actions"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-action"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-action"
      }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-tab-content"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field-header"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field-label"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field-actions"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field-action"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field-action"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field-action"
      }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field-input"
      })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field-header"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field-label"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field-actions"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field-action"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field-action"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field-action"
      }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field-input medium"
      })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field-header"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field-label"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field-actions"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field-action"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field-action"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field-action"
      }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly-placeholder-field-input short"
      })))));
    }
    return tabs;
  };
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-loader"
  }, renderPlaceholderTabs());
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PlaceholderLoader);

/***/ }),

/***/ "./src/builder/components/TabContent/AddPropertyFormTab/Tab/Tab.css":
/*!**************************************************************************!*\
  !*** ./src/builder/components/TabContent/AddPropertyFormTab/Tab/Tab.css ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ }),

/***/ "./src/builder/components/TabContent/AddPropertyFormTab/Tab/Tab.js":
/*!*************************************************************************!*\
  !*** ./src/builder/components/TabContent/AddPropertyFormTab/Tab/Tab.js ***!
  \*************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dnd-kit/sortable */ "./node_modules/@dnd-kit/sortable/dist/sortable.esm.js");
/* harmony import */ var _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @dnd-kit/utilities */ "./node_modules/@dnd-kit/utilities/dist/utilities.esm.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _Field_Field__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Field/Field */ "./src/builder/components/TabContent/AddPropertyFormTab/Field/Field.js");
/* harmony import */ var _Group_Group__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Group/Group */ "./src/builder/components/TabContent/AddPropertyFormTab/Group/Group.js");
/* harmony import */ var _utils_fieldTypes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/fieldTypes */ "./src/builder/components/TabContent/AddPropertyFormTab/utils/fieldTypes.js");
/* harmony import */ var _Tab_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Tab.css */ "./src/builder/components/TabContent/AddPropertyFormTab/Tab/Tab.css");








const Tab = ({
  id,
  tab,
  isDragOver,
  dragDirection,
  onEdit,
  onDelete,
  onToggleCollapse,
  onAddField,
  onEditField,
  onDeleteField,
  onDeleteGroup,
  onToggleField,
  onToggleFieldRequired,
  onToggleFieldAdminOnly,
  onToggleGroupCollapse,
  onToggleSidebar,
  onMoveFieldUp,
  onMoveFieldDown,
  onMoveGroupUp,
  onMoveGroupDown,
  showToast,
  isRequiredTab,
  groupCollapsedStates
}) => {
  const {
    attributes,
    listeners,
    setNodeRef,
    transform,
    transition,
    isDragging
  } = (0,_dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_1__.useSortable)({
    id
  });
  const style = {
    transform: _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.CSS.Transform.toString(transform),
    transition,
    opacity: isDragging ? 0.8 : 1,
    zIndex: isDragging ? 100 : 1,
    boxShadow: isDragging ? 'var(--hvnly-card-shadow)' : 'none'
  };

  // Organize fields by group
  const organizedFields = (0,_utils_fieldTypes__WEBPACK_IMPORTED_MODULE_6__.organizeFieldsByGroup)(tab.fields || []);
  const {
    groups,
    standalone
  } = organizedFields;

  // Create sortable items array for DnD context - this allows mixing groups and fields
  const getSortableItems = () => {
    const items = [];

    // Add groups first with their group ID as the sortable ID
    Object.values(groups).forEach(group => {
      items.push({
        id: group.id,
        type: 'group',
        order: group.fields[0]?.order || 0
      });
    });

    // Add standalone fields
    standalone.forEach(field => {
      items.push({
        id: field.id,
        type: 'field',
        order: field.order || 0
      });
    });

    // Sort by order
    return items.sort((a, b) => (a.order || 0) - (b.order || 0));
  };
  const sortableItems = getSortableItems();
  const sortedItemIds = sortableItems.map(item => item.id);

  // Sort groups and standalone for display
  const allGroups = Object.values(groups);
  const sortedGroups = [...allGroups].sort((a, b) => {
    const aOrder = a.fields[0]?.order || 0;
    const bOrder = b.fields[0]?.order || 0;
    return aOrder - bOrder;
  });
  const sortedStandalone = [...standalone].sort((a, b) => (a.order || 0) - (b.order || 0));

  // Combine for display order - mixes groups and fields properly
  const displayItems = [];
  let groupIndex = 0;
  let fieldIndex = 0;
  sortableItems.forEach(item => {
    if (item.type === 'group') {
      displayItems.push({
        type: 'group',
        data: sortedGroups[groupIndex],
        displayIndex: groupIndex
      });
      groupIndex++;
    } else {
      displayItems.push({
        type: 'field',
        data: sortedStandalone[fieldIndex],
        displayIndex: fieldIndex
      });
      fieldIndex++;
    }
  });
  const handleDelete = e => {
    e.stopPropagation();
    if (isRequiredTab(tab)) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Cannot Delete', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('This tab is required and cannot be deleted', 'havenlytics'));
      return;
    }
    onDelete();
  };
  const handleEdit = e => {
    e.stopPropagation();
    if (isRequiredTab(tab)) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Cannot Edit', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('This tab is required and cannot be edited', 'havenlytics'));
      return;
    }
    onEdit();
  };
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    ref: setNodeRef,
    style: style,
    className: `hvnly--builder--int_api__property_builder_tab ${isDragOver ? 'hvnly--builder--int_api__drag_over_tab' : ''} ${isRequiredTab(tab) ? 'hvnly--builder--int_api__required_tab' : ''} ${isDragging ? 'dragging' : ''}`,
    "data-tab-id": tab.id
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_tab_header"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__drag_handle",
    ...attributes,
    ...listeners,
    style: {
      cursor: isRequiredTab(tab) ? 'not-allowed' : 'grab'
    },
    title: isRequiredTab(tab) ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Required tab cannot be moved', 'havenlytics') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Drag to reorder', 'havenlytics')
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: `fas fa-${isRequiredTab(tab) ? 'lock' : 'list'}`
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: "hvnly--builder--int_api__tab_collapse_btn",
    onClick: e => {
      e.stopPropagation();
      onToggleCollapse();
    },
    title: tab.collapsed ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Expand', 'havenlytics') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Collapse', 'havenlytics')
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: `fas fa-chevron-${tab.collapsed ? 'down' : 'up'}`
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h4", null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: `fas fa-${tab.icon}`
  }), tab.title, isRequiredTab(tab) && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "hvnly--builder--int_api__required_badge"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-lock"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Required', 'havenlytics'))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_tab_actions"
  }, !isRequiredTab(tab) ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: "hvnly--builder--int_api__property_builder_tab_action_btn",
    onClick: handleEdit,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Edit Tab", "havenlytics")
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-edit"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: "hvnly--builder--int_api__property_builder_tab_action_btn",
    onClick: handleDelete,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Delete Tab", "havenlytics")
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-trash"
  }))) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: "hvnly--builder--int_api__property_builder_tab_action_btn hvnly--builder--int_api__locked_action_btn",
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Required Tab - Cannot be modified", "havenlytics"),
    disabled: true
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-lock"
  })))), !tab.collapsed && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_tab_content"
  }, displayItems.length > 0 ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_1__.SortableContext, {
    items: sortedItemIds,
    strategy: _dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_1__.verticalListSortingStrategy
  }, displayItems.map((item, index) => {
    if (item.type === 'group') {
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Group_Group__WEBPACK_IMPORTED_MODULE_5__["default"], {
        key: item.data.id,
        group: {
          ...item.data,
          collapsed: groupCollapsedStates?.[item.data.id] || false
        },
        onDelete: () => onDeleteGroup(item.data.id),
        onToggleCollapse: () => onToggleGroupCollapse(item.data.id),
        onToggleSidebar: onToggleSidebar,
        onEditField: fieldId => {
          onEditField(fieldId);
        },
        onDeleteField: fieldId => onDeleteField(fieldId),
        onToggleField: fieldId => onToggleField(fieldId),
        onToggleFieldRequired: fieldId => onToggleFieldRequired(fieldId),
        onToggleFieldAdminOnly: fieldId => onToggleFieldAdminOnly(fieldId),
        onMoveFieldUp: fieldId => onMoveFieldUp(fieldId),
        onMoveFieldDown: fieldId => onMoveFieldDown(fieldId),
        onMoveGroupUp: () => onMoveGroupUp(item.data.id, index),
        onMoveGroupDown: () => onMoveGroupDown(item.data.id, index),
        showToast: showToast,
        canMoveUp: index > 0,
        canMoveDown: index < displayItems.length - 1,
        groupCollapsedStates: groupCollapsedStates
      });
    } else {
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Field_Field__WEBPACK_IMPORTED_MODULE_4__["default"], {
        key: `${item.data.id}-${item.data.order || index}`,
        id: item.data.id,
        field: item.data,
        index: item.data.order || index,
        fieldsLength: displayItems.length,
        onEdit: () => {
          onEditField(item.data.id);
        },
        onDelete: () => onDeleteField(item.data.id),
        onToggle: () => {
          onToggleField(item.data.id);
        },
        onToggleRequired: () => {
          onToggleFieldRequired(item.data.id);
        },
        onToggleAdminOnly: () => {
          onToggleFieldAdminOnly(item.data.id);
        },
        onMoveUp: () => {
          onMoveFieldUp(item.data.id);
        },
        onMoveDown: () => {
          onMoveFieldDown(item.data.id);
        },
        showToast: showToast,
        isFieldLocked: item.data.locked,
        isGroupField: false
      });
    }
  })) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__field_drop_placeholder"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-arrow-down"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Drop fields here', 'havenlytics'))), !isRequiredTab(tab) && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: "hvnly--builder--int_api__property_builder_empty_btn",
    onClick: e => {
      e.stopPropagation();
      onAddField();
    }
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-plus"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Add New Field', 'havenlytics'))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Tab);

/***/ }),

/***/ "./src/builder/components/TabContent/AddPropertyFormTab/hooks/useDragAndDrop.js":
/*!**************************************************************************************!*\
  !*** ./src/builder/components/TabContent/AddPropertyFormTab/hooks/useDragAndDrop.js ***!
  \**************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useDragAndDrop: () => (/* binding */ useDragAndDrop)
/* harmony export */ });
/* harmony import */ var _dnd_kit_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dnd-kit/core */ "./node_modules/@dnd-kit/core/dist/core.esm.js");
/* harmony import */ var _dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dnd-kit/sortable */ "./node_modules/@dnd-kit/sortable/dist/sortable.esm.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);




const useDragAndDrop = ({
  tabs,
  setTabs,
  showToast
}) => {
  const [activeDragId, setActiveDragId] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(null);
  const [dragOverTabId, setDragOverTabId] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(null);
  const [dragDirection, setDragDirection] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(null);
  const activeDragType = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
  const activeDragData = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
  const sensors = (0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_0__.useSensors)((0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_0__.useSensor)(_dnd_kit_core__WEBPACK_IMPORTED_MODULE_0__.PointerSensor, {
    activationConstraint: {
      distance: 5
    }
  }), (0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_0__.useSensor)(_dnd_kit_core__WEBPACK_IMPORTED_MODULE_0__.KeyboardSensor, {}));
  const findItem = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(id => {
    // Check if it's a tab
    const tab = tabs.find(t => t.id === id);
    if (tab) {
      return {
        type: 'tab',
        id: tab.id,
        data: tab
      };
    }

    // Check if it's a group
    for (const tab of tabs) {
      const group = Object.values(tab.fields?.reduce((acc, field) => {
        if (field.group_id && !acc[field.group_id]) {
          acc[field.group_id] = {
            id: field.group_id,
            type: 'group',
            group_type: field.group_type,
            group_name: field.group_name,
            fields: tab.fields.filter(f => f.group_id === field.group_id)
          };
        }
        return acc;
      }, {}) || []).find(g => g.id === id);
      if (group) {
        return {
          type: 'group',
          id: group.id,
          data: group,
          tabId: tab.id
        };
      }
    }

    // Check if it's a field
    for (const tab of tabs) {
      const field = tab.fields?.find(f => f.id === id);
      if (field) {
        return {
          type: 'field',
          id: field.id,
          data: field,
          tabId: tab.id,
          isGroupField: !!field.group_id
        };
      }
    }

    // Check if it's a component from panel
    if (activeDragData.current && activeDragData.current.source === 'component-panel') {
      return {
        type: 'component',
        id: id,
        componentType: activeDragData.current.type,
        componentLabel: activeDragData.current.label
      };
    }
    return null;
  }, [tabs]);
  const handleDragStart = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(event => {
    const {
      active
    } = event;
    const activeItem = findItem(active.id);
    if (activeItem) {
      setActiveDragId(active.id);
      activeDragType.current = activeItem.type;
      activeDragData.current = activeItem.data || activeItem;
    }
  }, [findItem]);
  const handleDragMove = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(event => {
    const {
      over
    } = event;
    if (over) {
      const overItem = findItem(over.id);
      if (overItem && overItem.type === 'tab') {
        setDragOverTabId(over.id);
      } else {
        setDragOverTabId(null);
      }
    } else {
      setDragOverTabId(null);
    }
  }, [findItem]);
  const handleDragOver = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(event => {
    const {
      over
    } = event;
    if (over) {
      const overItem = findItem(over.id);
      if (overItem && overItem.type === 'tab') {
        setDragOverTabId(over.id);
      }
    }
  }, [findItem]);
  const handleDragEnd = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(event => {
    const {
      active,
      over
    } = event;
    if (!over) {
      setActiveDragId(null);
      setDragOverTabId(null);
      setDragDirection(null);
      activeDragType.current = null;
      activeDragData.current = null;
      return;
    }
    const activeId = active.id;
    const overId = over.id;
    if (activeId === overId) {
      setActiveDragId(null);
      setDragOverTabId(null);
      setDragDirection(null);
      activeDragType.current = null;
      activeDragData.current = null;
      return;
    }
    const activeItem = findItem(activeId);
    const overItem = findItem(overId);
    if (!activeItem || !overItem) {
      setActiveDragId(null);
      setDragOverTabId(null);
      setDragDirection(null);
      activeDragType.current = null;
      activeDragData.current = null;
      return;
    }

    // Handle reordering tabs
    if (activeItem.type === 'tab' && overItem.type === 'tab') {
      const oldIndex = tabs.findIndex(tab => tab.id === activeId);
      const newIndex = tabs.findIndex(tab => tab.id === overId);
      if (oldIndex !== -1 && newIndex !== -1 && oldIndex !== newIndex) {
        const newTabs = (0,_dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_1__.arrayMove)(tabs, oldIndex, newIndex);
        setTabs(newTabs.map((tab, idx) => ({
          ...tab,
          order: idx
        })));
        showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Tab Moved', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Tab reordered successfully', 'havenlytics'));
      }
    }

    // Handle reordering groups within the same tab - FIXED for moving down
    else if (activeItem.type === 'group' && overItem.type === 'group' && activeItem.tabId === overItem.tabId) {
      const tab = tabs.find(t => t.id === activeItem.tabId);
      if (tab) {
        const fields = [...tab.fields];

        // Get all field IDs in display order (including group IDs at group positions)
        const getDisplayOrderIds = () => {
          const ids = [];
          let currentGroupId = null;
          for (const field of fields) {
            if (field.group_id) {
              if (field.group_id !== currentGroupId) {
                ids.push(field.group_id);
                currentGroupId = field.group_id;
              }
            } else {
              ids.push(field.id);
              currentGroupId = null;
            }
          }
          return ids;
        };
        const displayOrderIds = getDisplayOrderIds();
        const oldIndex = displayOrderIds.findIndex(id => id === activeId);
        const newIndex = displayOrderIds.findIndex(id => id === overId);
        if (oldIndex !== -1 && newIndex !== -1 && oldIndex !== newIndex) {
          // Get all fields for active group
          const activeGroupFields = fields.filter(f => f.group_id === activeId);

          // Remove active group fields from fields array
          const fieldsWithoutActive = fields.filter(f => f.group_id !== activeId);

          // Find where to insert by looking at the over group's position
          let insertIndex = 0;
          let foundOverGroup = false;
          for (let i = 0; i < fieldsWithoutActive.length; i++) {
            const field = fieldsWithoutActive[i];
            if (field.group_id === overId) {
              insertIndex = i;
              foundOverGroup = true;
              break;
            }
            // Also check if we passed the group by looking at original order
            if (!foundOverGroup && field.id === overId) {
              insertIndex = i;
              break;
            }
          }

          // Adjust insert index based on move direction
          let finalInsertIndex = insertIndex;
          if (oldIndex < newIndex) {
            // Moving down - insert after the over group's fields
            const overGroupFields = fields.filter(f => f.group_id === overId);
            finalInsertIndex = insertIndex + overGroupFields.length;
          }

          // Insert active group fields at new position
          const newFields = [...fieldsWithoutActive.slice(0, finalInsertIndex), ...activeGroupFields, ...fieldsWithoutActive.slice(finalInsertIndex)];

          // Update order for all fields
          const reorderedFields = newFields.map((field, idx) => ({
            ...field,
            order: idx
          }));
          setTabs(prevTabs => prevTabs.map(t => t.id === activeItem.tabId ? {
            ...t,
            fields: reorderedFields
          } : t));
          showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Group Moved', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Group reordered successfully', 'havenlytics'));
        }
      }
    }

    // Handle moving a single field (non-group)
    else if (activeItem.type === 'field' && !activeItem.isGroupField && overItem.type === 'field' && !overItem.isGroupField && activeItem.tabId === overItem.tabId) {
      const tab = tabs.find(t => t.id === activeItem.tabId);
      if (tab) {
        const fields = [...tab.fields];
        const oldIndex = fields.findIndex(f => f.id === activeId);
        const newIndex = fields.findIndex(f => f.id === overId);
        if (oldIndex !== -1 && newIndex !== -1 && oldIndex !== newIndex) {
          const newFields = (0,_dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_1__.arrayMove)(fields, oldIndex, newIndex);
          setTabs(prevTabs => prevTabs.map(t => t.id === activeItem.tabId ? {
            ...t,
            fields: newFields.map((f, idx) => ({
              ...f,
              order: idx
            }))
          } : t));
          showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Field Moved', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Field reordered successfully', 'havenlytics'));
        }
      }
    }

    // Handle dropping component from panel onto a tab or field
    else if (activeItem.type === 'component' && (overItem.type === 'field' || overItem.type === 'group' || overItem.type === 'tab')) {
      if (overItem.tabId) {
        const tab = tabs.find(t => t.id === overItem.tabId);
        if (tab) {
          const fields = [...tab.fields];
          let dropIndex = fields.length;
          if (overItem.type === 'field') {
            const fieldIndex = fields.findIndex(f => f.id === overId);
            if (fieldIndex !== -1) {
              dropIndex = fieldIndex + 1;
            }
          } else if (overItem.type === 'group') {
            const groupFields = fields.filter(f => f.group_id === overId);
            if (groupFields.length > 0) {
              const lastGroupFieldIndex = fields.findIndex(f => f.id === groupFields[groupFields.length - 1].id);
              dropIndex = lastGroupFieldIndex + 1;
            }
          }
          const newField = {
            id: `fld_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
            type: activeItem.componentType,
            label: activeItem.componentLabel || activeItem.componentType,
            placeholder: '',
            required: false,
            adminOnly: false,
            enabled: true,
            locked: false,
            order: dropIndex
          };
          const newFields = [...fields];
          newFields.splice(dropIndex, 0, newField);
          setTabs(prevTabs => prevTabs.map(t => t.id === overItem.tabId ? {
            ...t,
            fields: newFields.map((f, idx) => ({
              ...f,
              order: idx
            }))
          } : t));
          showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Field Added', 'havenlytics'), `${newField.label} added successfully`);
        }
      }
    }
    setActiveDragId(null);
    setDragOverTabId(null);
    setDragDirection(null);
    activeDragType.current = null;
    activeDragData.current = null;
  }, [tabs, setTabs, showToast, findItem]);
  return {
    sensors,
    activeDragId,
    dragOverTabId,
    dragDirection,
    handleDragStart,
    handleDragMove,
    handleDragOver,
    handleDragEnd
  };
};

/***/ }),

/***/ "./src/builder/components/TabContent/AddPropertyFormTab/hooks/useMetaCleanup.js":
/*!**************************************************************************************!*\
  !*** ./src/builder/components/TabContent/AddPropertyFormTab/hooks/useMetaCleanup.js ***!
  \**************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useMetaCleanup: () => (/* binding */ useMetaCleanup)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js");
/**
 * useMetaCleanup Hook - COMPLETE VERSION with all cleanup methods
 */




const useMetaCleanup = showToast => {
  const [isCleaning, setIsCleaning] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  const [orphanedCount, setOrphanedCount] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(0);
  const [cleanupStats, setCleanupStats] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
  const API_BASE = window.HavenlyticsData?.hvnlyNabApi?.url || null;
  const API_NONCE = window.HavenlyticsData?.hvnlyNabApi?.nonce || '';
  const AXIOS_CONFIG = {
    headers: {
      'X-WP-Nonce': API_NONCE,
      'Content-Type': 'application/json'
    }
  };

  /**
   * Reset and cleanup combined operation
   */
  const resetAndCleanup = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(async () => {
    // console.log('🧹 resetAndCleanup called');

    if (!API_BASE || !API_NONCE) {
      // console.error('Missing API configuration');
      return {
        success: false,
        error: 'Missing API configuration'
      };
    }
    setIsCleaning(true);
    try {
      const CLEANUP_ENDPOINT = `${API_BASE}/meta-cleanup/reset-and-cleanup`;
      // console.log('📡 Calling aggressive cleanup endpoint:', CLEANUP_ENDPOINT);

      const response = await axios__WEBPACK_IMPORTED_MODULE_2__["default"].post(CLEANUP_ENDPOINT, {}, AXIOS_CONFIG);

      // console.log('✅ API Response:', response.data);

      if (response.data && response.data.success) {
        // Only show toast if showToast is provided
        if (showToast) {
          showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Reset Complete', 'havenlytics'), response.data.deleted_count ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Configuration reset and %d orphaned entries cleaned up', 'havenlytics'), response.data.deleted_count) : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Configuration reset successfully', 'havenlytics'));
        }
        return response.data;
      }
    } catch (error) {
      // console.error('❌ Reset and cleanup failed:', error);

      if (error.response) {
        // console.error('Error response:', error.response.data);
        // console.error('Error status:', error.response.status);
      }

      // Only show toast if showToast is provided and it's not a 404
      if (showToast && error.response?.status !== 404) {
        showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Reset Failed', 'havenlytics'), error.response?.data?.message || error.message || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Failed to reset and cleanup', 'havenlytics'));
      } else if (error.response?.status === 404) {
        // console.log('ℹ️ Cleanup endpoint not available (404) - continuing with regular reset');
      }
      return {
        success: false,
        error: error.message
      };
    } finally {
      setIsCleaning(false);
    }
  }, [API_BASE, API_NONCE, showToast]);

  /**
   * Cleanup ALL orphaned meta across all properties
   */
  const cleanupAllOrphaned = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(async () => {
    // console.log('🧹 cleanupAllOrphaned called');

    if (!API_BASE || !API_NONCE) {
      // console.error('Missing API configuration');
      return {
        success: false,
        error: 'Missing API configuration'
      };
    }
    setIsCleaning(true);
    try {
      const CLEANUP_ENDPOINT = `${API_BASE}/meta-cleanup/cleanup-all`;
      const response = await axios__WEBPACK_IMPORTED_MODULE_2__["default"].post(CLEANUP_ENDPOINT, {}, AXIOS_CONFIG);
      if (response.data && response.data.success) {
        if (showToast) {
          showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Database Cleanup Complete', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Removed %d orphaned entries from %d properties', 'havenlytics'), response.data.deleted_count, response.data.properties_processed));
        }
        return response.data;
      }
    } catch (error) {
      // console.error('❌ Cleanup all failed:', error);
      if (showToast) {
        showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cleanup Failed', 'havenlytics'), error.response?.data?.message || error.message || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Failed to clean up database', 'havenlytics'));
      }
    } finally {
      setIsCleaning(false);
    }
  }, [API_BASE, API_NONCE, showToast]);

  /**
   * FINAL cleanup - removes old legacy data while keeping active fields
   */
  const finalCleanup = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(async () => {
    // console.log('🧹 finalCleanup called');

    if (!API_BASE || !API_NONCE) {
      // console.error('Missing API configuration');
      return {
        success: false,
        error: 'Missing API configuration'
      };
    }
    setIsCleaning(true);
    try {
      const CLEANUP_ENDPOINT = `${API_BASE}/meta-cleanup/final-cleanup`;
      const response = await axios__WEBPACK_IMPORTED_MODULE_2__["default"].post(CLEANUP_ENDPOINT, {}, AXIOS_CONFIG);
      if (response.data && response.data.success) {
        if (showToast) {
          showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Final Cleanup Complete', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Removed %d old entries, kept %d active keys', 'havenlytics'), response.data.deleted_count, response.data.kept_keys_count));
        }
        return response.data;
      }
    } catch (error) {
      // console.error('❌ Final cleanup failed:', error);
      if (showToast) {
        showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cleanup Failed', 'havenlytics'), error.response?.data?.message || error.message || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Failed to clean up database', 'havenlytics'));
      }
    } finally {
      setIsCleaning(false);
    }
  }, [API_BASE, API_NONCE, showToast]);

  /**
   * Get orphaned meta stats
   */
  const getOrphanedStats = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(async (propertyId = 0) => {
    try {
      const endpoint = propertyId ? `${API_BASE}/meta-cleanup/orphaned?property_id=${propertyId}` : `${API_BASE}/meta-cleanup/orphaned`;
      const response = await axios__WEBPACK_IMPORTED_MODULE_2__["default"].get(endpoint, AXIOS_CONFIG);
      if (response.data && response.data.success) {
        setOrphanedCount(response.data.total);
        return response.data.data;
      }
    } catch (error) {
      // console.error('Failed to get orphaned stats:', error);
    }
  }, [API_BASE, AXIOS_CONFIG]);

  /**
   * Get cleanup statistics
   */
  const getCleanupStats = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(async () => {
    try {
      const endpoint = `${API_BASE}/meta-cleanup/stats`;
      const response = await axios__WEBPACK_IMPORTED_MODULE_2__["default"].get(endpoint, AXIOS_CONFIG);
      if (response.data && response.data.success) {
        setCleanupStats(response.data.data);
        return response.data.data;
      }
    } catch (error) {
      // console.error('Failed to get cleanup stats:', error);
    }
  }, [API_BASE, AXIOS_CONFIG]);

  /**
   * Cleanup orphaned meta for specific fields
   */
  const cleanupOrphanedMeta = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(async (fields, propertyId = 0) => {
    if (!fields || fields.length === 0) {
      return {
        success: true,
        deleted_count: 0
      };
    }
    if (!API_BASE || !API_NONCE) {
      // console.error('Missing API configuration');
      return {
        success: false,
        error: 'Missing API configuration'
      };
    }
    setIsCleaning(true);
    try {
      const endpoint = `${API_BASE}/meta-cleanup/cleanup`;
      const response = await axios__WEBPACK_IMPORTED_MODULE_2__["default"].post(endpoint, {
        fields: fields,
        property_id: propertyId
      }, AXIOS_CONFIG);
      if (response.data && response.data.success) {
        if (showToast) {
          showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cleanup Complete', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Removed %d orphaned meta entries', 'havenlytics'), response.data.deleted_count));
        }

        // Refresh stats
        await getOrphanedStats(propertyId);
        return response.data;
      }
    } catch (error) {
      // console.error('Cleanup failed:', error);
      if (showToast) {
        showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cleanup Failed', 'havenlytics'), error.response?.data?.message || error.message || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Failed to clean up orphaned meta', 'havenlytics'));
      }
    } finally {
      setIsCleaning(false);
    }
  }, [API_BASE, AXIOS_CONFIG, showToast, getOrphanedStats]);

  /**
   * Extract field names from tabs
   */
  const extractFieldNames = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(tabs => {
    const fieldNames = [];
    tabs.forEach(tab => {
      if (tab.fields && Array.isArray(tab.fields)) {
        tab.fields.forEach(field => {
          if (field.name) fieldNames.push(field.name);else if (field.id) fieldNames.push(field.id);
          if (field.migrated_from) fieldNames.push(field.migrated_from);
        });
      }
    });
    return [...new Set(fieldNames)];
  }, []);
  return {
    isCleaning,
    orphanedCount,
    cleanupStats,
    extractFieldNames,
    getOrphanedStats,
    getCleanupStats,
    cleanupOrphanedMeta,
    resetAndCleanup,
    cleanupAllOrphaned,
    finalCleanup
  };
};

/***/ }),

/***/ "./src/builder/components/TabContent/AddPropertyFormTab/hooks/usePropertyBuilder.js":
/*!******************************************************************************************!*\
  !*** ./src/builder/components/TabContent/AddPropertyFormTab/hooks/usePropertyBuilder.js ***!
  \******************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   usePropertyBuilder: () => (/* binding */ usePropertyBuilder)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js");
/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! uuid */ "./node_modules/uuid/dist/esm-browser/v4.js");
/* harmony import */ var _utils_fieldTypes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/fieldTypes */ "./src/builder/components/TabContent/AddPropertyFormTab/utils/fieldTypes.js");
/* harmony import */ var _useMetaCleanup__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./useMetaCleanup */ "./src/builder/components/TabContent/AddPropertyFormTab/hooks/useMetaCleanup.js");






const usePropertyBuilder = showToast => {
  const [tabs, setTabs] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
  const [activeTab, setActiveTab] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
  const [activeField, setActiveField] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
  const [isTabModalOpen, setIsTabModalOpen] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  const [isFieldModalOpen, setIsFieldModalOpen] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  const [isSaving, setIsSaving] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  const [isLoading, setIsLoading] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(true);
  const [groupCollapsedStates, setGroupCollapsedStates] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)({});
  const [shouldReload, setShouldReload] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  const {
    isCleaning,
    cleanupOrphanedMeta,
    resetAndCleanup,
    getOrphanedStats
  } = (0,_useMetaCleanup__WEBPACK_IMPORTED_MODULE_5__.useMetaCleanup)(null);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (shouldReload) {
      setShouldReload(false);
      window.location.reload();
    }
  }, [shouldReload]);
  const API_BASE = window.HavenlyticsData?.hvnlyNabApi?.url || null;
  const API_NONCE = window.HavenlyticsData?.hvnlyNabApi?.nonce || '';
  const SECTIONS_ENDPOINT = `${API_BASE}/pb-dnd-sections`;
  const AXIOS_CONFIG = {
    headers: {
      'X-WP-Nonce': API_NONCE,
      'Content-Type': 'application/json'
    }
  };
  const tabsRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(tabs);
  const showToastRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(showToast);
  const groupCollapsedStatesRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(groupCollapsedStates);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    tabsRef.current = tabs;
    showToastRef.current = showToast;
    groupCollapsedStatesRef.current = groupCollapsedStates;
  }, [tabs, showToast, groupCollapsedStates]);
  const isRequiredTab = tab => {
    return tab?.required || tab?.title === 'Basic Info';
  };
  const toggleSidebar = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)((groupId, showInSidebar) => {
    setTabs(prevTabs => {
      return prevTabs.map(tab => {
        const hasGroup = tab.fields.some(field => field.group_id === groupId);
        if (hasGroup) {
          const updatedFields = tab.fields.map(field => {
            if (field.group_id === groupId) {
              return {
                ...field,
                show_in_sidebar: showInSidebar
              };
            }
            return field;
          });
          return {
            ...tab,
            fields: updatedFields
          };
        }
        return tab;
      });
    });
    showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Sidebar Updated', 'havenlytics'), showInSidebar ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Documents will show in sidebar widget', 'havenlytics') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Documents hidden from sidebar widget', 'havenlytics'));
  }, [showToast]);
  const moveGroupUp = (groupId, groupIndex) => {
    if (groupIndex <= 0) return;
    setTabs(prevTabs => {
      return prevTabs.map(tab => {
        const groupFields = tab.fields.filter(field => field.group_id === groupId);
        if (groupFields.length === 0) return tab;
        const allFields = [...tab.fields];
        const groupFieldIndices = groupFields.map(f => allFields.findIndex(field => field.id === f.id)).filter(idx => idx !== -1);
        if (groupFieldIndices.length === 0) return tab;
        const firstGroupIndex = Math.min(...groupFieldIndices);
        if (firstGroupIndex === 0) return tab;
        const fieldAbove = allFields[firstGroupIndex - 1];
        const isFieldAbovePartOfGroup = fieldAbove && fieldAbove.group_id;
        if (isFieldAbovePartOfGroup) {
          const aboveGroupId = fieldAbove.group_id;
          const aboveGroupFields = allFields.filter(f => f.group_id === aboveGroupId);
          const aboveGroupIndices = aboveGroupFields.map(f => allFields.findIndex(field => field.id === f.id)).filter(idx => idx !== -1);
          const firstAboveIndex = Math.min(...aboveGroupIndices);
          const lastAboveIndex = Math.max(...aboveGroupIndices);
          const lastGroupIndex = Math.max(...groupFieldIndices);
          const newFields = [...allFields.slice(0, firstAboveIndex), ...allFields.slice(firstGroupIndex, lastGroupIndex + 1), ...allFields.slice(firstAboveIndex, lastAboveIndex + 1), ...allFields.slice(lastGroupIndex + 1)];
          const updatedFields = newFields.map((field, index) => ({
            ...field,
            order: index
          }));
          return {
            ...tab,
            fields: updatedFields
          };
        } else {
          const newFields = [...allFields];
          [newFields[firstGroupIndex - 1], newFields[firstGroupIndex]] = [newFields[firstGroupIndex], newFields[firstGroupIndex - 1]];
          const updatedFields = newFields.map((field, index) => ({
            ...field,
            order: index
          }));
          return {
            ...tab,
            fields: updatedFields
          };
        }
      });
    });
    showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Group Moved', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Group moved up successfully', 'havenlytics'));
  };
  const moveGroupDown = (groupId, groupIndex) => {
    setTabs(prevTabs => {
      return prevTabs.map(tab => {
        const groupFields = tab.fields.filter(field => field.group_id === groupId);
        if (groupFields.length === 0) return tab;
        const allFields = [...tab.fields];
        const groupFieldIndices = groupFields.map(f => allFields.findIndex(field => field.id === f.id)).filter(idx => idx !== -1);
        if (groupFieldIndices.length === 0) return tab;
        const lastGroupIndex = Math.max(...groupFieldIndices);
        if (lastGroupIndex === allFields.length - 1) return tab;
        const fieldBelow = allFields[lastGroupIndex + 1];
        const isFieldBelowPartOfGroup = fieldBelow && fieldBelow.group_id;
        if (isFieldBelowPartOfGroup) {
          const belowGroupId = fieldBelow.group_id;
          const belowGroupFields = allFields.filter(f => f.group_id === belowGroupId);
          const belowGroupIndices = belowGroupFields.map(f => allFields.findIndex(field => field.id === f.id)).filter(idx => idx !== -1);
          const firstGroupIndex = Math.min(...groupFieldIndices);
          const firstBelowIndex = Math.min(...belowGroupIndices);
          const lastBelowIndex = Math.max(...belowGroupIndices);
          const newFields = [...allFields.slice(0, firstGroupIndex), ...allFields.slice(firstBelowIndex, lastBelowIndex + 1), ...allFields.slice(firstGroupIndex, lastGroupIndex + 1), ...allFields.slice(lastBelowIndex + 1)];
          const updatedFields = newFields.map((field, index) => ({
            ...field,
            order: index
          }));
          return {
            ...tab,
            fields: updatedFields
          };
        } else {
          const newFields = [...allFields];
          [newFields[lastGroupIndex], newFields[lastGroupIndex + 1]] = [newFields[lastGroupIndex + 1], newFields[lastGroupIndex]];
          const updatedFields = newFields.map((field, index) => ({
            ...field,
            order: index
          }));
          return {
            ...tab,
            fields: updatedFields
          };
        }
      });
    });
    showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Group Moved', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Group moved down successfully', 'havenlytics'));
  };
  const toggleGroupCollapse = groupId => {
    setGroupCollapsedStates(prev => {
      const newState = !prev[groupId];
      setTabs(currentTabs => {
        return currentTabs.map(tab => {
          const updatedFields = tab.fields.map(field => {
            if (field.group_id === groupId) {
              return {
                ...field,
                group_collapsed: newState
              };
            }
            return field;
          });
          return {
            ...tab,
            fields: updatedFields
          };
        });
      });
      return {
        ...prev,
        [groupId]: newState
      };
    });
  };
  const initializeGroupCollapsedStates = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(tabsData => {
    const newGroupStates = {};
    tabsData.forEach(tab => {
      const organized = (0,_utils_fieldTypes__WEBPACK_IMPORTED_MODULE_4__.organizeFieldsByGroup)(tab.fields || []);
      Object.keys(organized.groups).forEach(groupId => {
        const groupFields = organized.groups[groupId].fields;
        const hasCollapsedState = groupFields.some(f => f.group_collapsed !== undefined);
        if (hasCollapsedState) {
          newGroupStates[groupId] = groupFields[0].group_collapsed || false;
        } else {
          newGroupStates[groupId] = false;
        }
      });
    });
    setGroupCollapsedStates(newGroupStates);
  }, []);
  const createDefaultRequiredTabs = () => {
    return [{
      id: 'sec_basic_info',
      title: 'Basic Info',
      icon: 'fas fa-home',
      fields: [{
        id: '_hvnly_property_price',
        name: '_hvnly_property_price',
        type: 'price_label',
        label: 'Property Price',
        placeholder: 'Enter property price',
        required: true,
        locked: true,
        adminOnly: false,
        enabled: true,
        order: 0
      }, {
        id: '_hvnly_property_reception_rooms',
        name: '_hvnly_property_reception_rooms',
        type: 'number',
        label: 'Property Reception Rooms',
        placeholder: 'Enter reception rooms',
        required: true,
        locked: true,
        adminOnly: false,
        enabled: true,
        order: 1
      }, {
        id: '_hvnly_property_bedrooms',
        name: '_hvnly_property_bedrooms',
        type: 'number',
        label: 'Property Bedrooms',
        placeholder: 'Enter property bedrooms',
        required: true,
        locked: true,
        adminOnly: false,
        enabled: true,
        order: 2
      }, {
        id: '_hvnly_property_bathrooms',
        name: '_hvnly_property_bathrooms',
        type: 'number',
        label: 'Property Bathrooms',
        placeholder: 'Enter property bathrooms',
        required: true,
        locked: true,
        adminOnly: false,
        enabled: true,
        order: 3
      }, {
        id: '_hvnly_property_kitchens',
        name: '_hvnly_property_kitchens',
        type: 'number',
        label: 'Property Total Kitchens',
        placeholder: 'Enter property total kitchens',
        required: true,
        locked: true,
        adminOnly: false,
        enabled: true,
        order: 4
      }, {
        id: '_hvnly_property_total_rooms',
        name: '_hvnly_property_total_rooms',
        type: 'number',
        label: 'Property Total Rooms',
        placeholder: 'Enter property total rooms',
        required: true,
        locked: true,
        adminOnly: false,
        enabled: true,
        order: 5
      }, {
        id: '_hvnly_property_floors',
        name: '_hvnly_property_floors',
        type: 'number',
        label: 'Property Total Floors',
        placeholder: 'Enter property total floors',
        required: true,
        locked: true,
        adminOnly: false,
        enabled: true,
        order: 6
      }, {
        id: '_hvnly_property_year_built',
        name: '_hvnly_property_year_built',
        type: 'number',
        label: 'Property Year Built',
        placeholder: 'Enter property year built',
        required: true,
        locked: true,
        adminOnly: false,
        enabled: true,
        order: 7
      }, {
        id: '_hvnly_property_garage_sqft',
        name: '_hvnly_property_garage_sqft',
        type: 'number',
        label: 'Property Garage Square Footage',
        placeholder: 'Enter property garage square footage',
        required: true,
        locked: true,
        adminOnly: false,
        enabled: true,
        order: 8
      }],
      collapsed: false,
      order: 0,
      required: true
    }];
  };
  const filterOutAmenitiesSidebar = data => {
    if (!Array.isArray(data)) return data || [];
    return data.filter(item => {
      if (!item || typeof item !== 'object') return false;
      const title = item.title || item.hvnly__sectiontitle || '';
      return title !== 'Amenities Sidebar';
    });
  };
  const mergeWithDefaultStructure = apiData => {
    if (!Array.isArray(apiData)) return createDefaultRequiredTabs();
    const filteredApiData = filterOutAmenitiesSidebar(apiData);
    const defaultTabs = createDefaultRequiredTabs();
    const mergedTabs = [...defaultTabs];
    filteredApiData.forEach(apiTab => {
      const isRequired = isRequiredTab(apiTab);
      if (isRequired) {
        const defaultTabIndex = mergedTabs.findIndex(t => t.title === apiTab.title);
        if (defaultTabIndex !== -1) {
          const mergedTab = {
            ...mergedTabs[defaultTabIndex]
          };
          if (Array.isArray(apiTab.fields)) {
            mergedTab.fields = mergedTab.fields.map(defaultField => {
              const apiField = apiTab.fields.find(f => f.id === defaultField.id);
              if (apiField) {
                // CRITICAL FIX: Force price_label type for price field
                const isPriceField = defaultField.id === '_hvnly_property_price';
                const finalType = isPriceField ? 'price_label' : apiField.type || defaultField.type;
                return {
                  ...defaultField,
                  ...apiField,
                  type: finalType,
                  locked: defaultField.locked,
                  required: defaultField.required,
                  adminOnly: defaultField.adminOnly,
                  enabled: apiField.enabled !== false
                };
              }
              return defaultField;
            });
          }
          mergedTabs[defaultTabIndex] = mergedTab;
        }
      } else {
        mergedTabs.push(apiTab);
      }
    });
    return enforceRequiredTabPositions(mergedTabs);
  };
  const enforceRequiredTabPositions = tabsArray => {
    if (!Array.isArray(tabsArray)) return [];
    const basicInfoTab = tabsArray.find(tab => tab?.title === 'Basic Info');
    const otherTabs = tabsArray.filter(tab => tab?.title !== 'Basic Info');
    const orderedTabs = [];
    if (basicInfoTab) orderedTabs.push(basicInfoTab);
    orderedTabs.push(...otherTabs);
    return orderedTabs.map((tab, index) => ({
      ...tab,
      order: index
    }));
  };
  const ensureRequiredTabs = tabsArray => {
    if (!Array.isArray(tabsArray)) tabsArray = [];
    const hasBasicInfo = tabsArray.some(tab => tab?.title === 'Basic Info');
    let updatedTabs = [...tabsArray];
    if (!hasBasicInfo) {
      const defaultTabs = createDefaultRequiredTabs();
      const basicInfoTab = defaultTabs.find(tab => tab.title === 'Basic Info');
      if (basicInfoTab) updatedTabs.push(basicInfoTab);
    }
    return enforceRequiredTabPositions(updatedTabs);
  };
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (tabs.length > 0) {
      initializeGroupCollapsedStates(tabs);
    }
  }, [tabs, initializeGroupCollapsedStates]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (!SECTIONS_ENDPOINT || !API_NONCE) {
      const defaultTabs = createDefaultRequiredTabs();
      const enforcedTabs = enforceRequiredTabPositions(defaultTabs);
      setTabs(enforcedTabs);
      setIsLoading(false);
      return;
    }
    const fetchConfiguration = async () => {
      try {
        setIsLoading(true);
        const response = await axios__WEBPACK_IMPORTED_MODULE_2__["default"].get(SECTIONS_ENDPOINT, AXIOS_CONFIG);
        if (response.data && response.data.success) {
          let data = response.data.data || [];
          if (data.length === 0) {
            data = createDefaultRequiredTabs();
          } else {
            data = mergeWithDefaultStructure(data);
          }
          data = enforceRequiredTabPositions(data);
          setTabs(Array.isArray(data) ? data : []);
        } else {
          const defaultTabs = createDefaultRequiredTabs();
          const enforcedTabs = enforceRequiredTabPositions(defaultTabs);
          setTabs(enforcedTabs);
        }
      } catch (error) {
        const defaultTabs = createDefaultRequiredTabs();
        const enforcedTabs = enforceRequiredTabPositions(defaultTabs);
        setTabs(enforcedTabs);
        if (error.response) {
          if (error.response.status === 500) {
            showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Server Error', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Internal server error. Check PHP error logs.', 'havenlytics'));
          } else if (error.response.status === 403) {
            showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Permission Denied', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('You do not have permission to access this resource.', 'havenlytics'));
          } else {
            showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Load Failed', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Failed to load configuration:', 'havenlytics') + ` ${error.response.status}`);
          }
        } else if (error.request) {
          showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Network Error', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('No response received from server. Check your connection.', 'havenlytics'));
        } else {
          showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Error', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('An unexpected error occurred.', 'havenlytics'));
        }
      } finally {
        setIsLoading(false);
      }
    };
    fetchConfiguration();
  }, [SECTIONS_ENDPOINT, API_NONCE]);
  const saveConfiguration = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(async () => {
    if (!SECTIONS_ENDPOINT || !API_NONCE) {
      showToastRef.current('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Configuration Error', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Missing API configuration', 'havenlytics'));
      return false;
    }
    setIsSaving(true);
    if (!tabsRef.current || tabsRef.current.length === 0) {
      const defaultTabs = createDefaultRequiredTabs();
      const enforcedTabs = enforceRequiredTabPositions(defaultTabs);
      tabsRef.current = enforcedTabs;
      setTabs(enforcedTabs);
    }
    const tabsToSave = mergeWithDefaultStructure(tabsRef.current);
    try {
      const payload = {
        tabs: tabsToSave.map(tab => ({
          id: tab.id,
          title: tab.title,
          icon: tab.icon,
          fields: (tab.fields || []).map(field => {
            const fieldData = {
              id: field.id,
              name: field.name || field.id,
              type: field.type,
              label: field.label,
              placeholder: field.placeholder || '',
              required: Boolean(field.required),
              adminOnly: Boolean(field.adminOnly),
              enabled: field.enabled !== false,
              locked: Boolean(field.locked),
              order: field.order || 0,
              hidden: Boolean(field.hidden)
            };
            if (field.group_id) {
              fieldData.group_id = field.group_id;
              fieldData.group_type = field.group_type;
              fieldData.group_name = field.group_name;
              fieldData.group_position = field.group_position;
              fieldData.group_total = field.group_total;
              fieldData.group_base_id = field.group_base_id;
              fieldData.metaKey = field.metaKey;
              // FIX: Save group_collapsed state
              fieldData.group_collapsed = field.group_collapsed || false;
              if (field.group_type === 'property_docs') {
                fieldData.show_in_sidebar = field.show_in_sidebar !== undefined ? field.show_in_sidebar : true;
              }
            }
            if (field.address_field_name) {
              fieldData.address_field_name = field.address_field_name;
            }
            if (field.lat_field_name) {
              fieldData.lat_field_name = field.lat_field_name;
            }
            if (field.lng_field_name) {
              fieldData.lng_field_name = field.lng_field_name;
            }
            if (field.map_field_name) {
              fieldData.map_field_name = field.map_field_name;
            }
            return fieldData;
          }),
          collapsed: Boolean(tab.collapsed),
          order: tab.order || 0,
          required: Boolean(tab.required)
        }))
      };
      const response = await axios__WEBPACK_IMPORTED_MODULE_2__["default"].post(SECTIONS_ENDPOINT, payload, AXIOS_CONFIG);
      if (response.data && response.data.success) {
        let data = response.data.data || [];
        data = mergeWithDefaultStructure(data);
        data = enforceRequiredTabPositions(data);
        setTabs(Array.isArray(data) ? data : []);
        tabsRef.current = Array.isArray(data) ? data : [];
        showToastRef.current('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Configuration Saved', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Property builder configuration saved successfully!', 'havenlytics'));
        return true;
      } else {
        const errorMessage = response.data?.message || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Save failed - invalid response structure', 'havenlytics');
        throw new Error(errorMessage);
      }
    } catch (error) {
      if (error.response) {
        let errorMessage = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Failed to save configuration', 'havenlytics');
        if (error.response.data?.message) {
          errorMessage = error.response.data.message;
        } else if (error.response.status === 400) {
          errorMessage = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Bad request - check data structure', 'havenlytics');
        } else if (error.response.status === 403) {
          errorMessage = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Permission denied. Please check your user capabilities.', 'havenlytics');
        } else if (error.response.status === 500) {
          errorMessage = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Server error. Please check your PHP error logs.', 'havenlytics');
        }
        showToastRef.current('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Save Failed', 'havenlytics'), errorMessage);
      } else if (error.request) {
        showToastRef.current('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Network Error', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('No response received from server. Check your connection.', 'havenlytics'));
      } else {
        showToastRef.current('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Save Failed', 'havenlytics'), error.message);
      }
      return false;
    } finally {
      setIsSaving(false);
    }
  }, [SECTIONS_ENDPOINT, API_NONCE]);
  const resetConfiguration = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(async () => {
    if (!SECTIONS_ENDPOINT || !API_NONCE) {
      showToastRef.current('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Configuration Error', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Missing API configuration', 'havenlytics'));
      return false;
    }
    setIsLoading(true);
    try {
      const cleanupResponse = await resetAndCleanup();
      const response = await axios__WEBPACK_IMPORTED_MODULE_2__["default"].delete(SECTIONS_ENDPOINT, AXIOS_CONFIG);
      if (response.data && response.data.success) {
        const defaultTabs = createDefaultRequiredTabs();
        const enforcedTabs = enforceRequiredTabPositions(defaultTabs);
        const hasDocumentTab = enforcedTabs.some(tab => tab.title === 'Property Documents');
        if (!hasDocumentTab) {
          enforcedTabs.push({
            id: `sec_property_docs_${Date.now()}`,
            title: 'Property Documents',
            icon: 'fas fa-file-pdf',
            fields: [],
            collapsed: false,
            order: enforcedTabs.length,
            required: false
          });
        }
        setTabs(enforcedTabs);
        tabsRef.current = enforcedTabs;
        setGroupCollapsedStates({});
        if (cleanupResponse && cleanupResponse.success) {
          const message = cleanupResponse.deleted_count ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Configuration reset successfully. Cleaned up %d orphaned entries.', 'havenlytics'), cleanupResponse.deleted_count) : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Configuration reset successfully.', 'havenlytics');
          showToastRef.current('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Configuration Reset', 'havenlytics'), message);
        } else {
          showToastRef.current('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Configuration Reset', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Configuration reset successfully.', 'havenlytics'));
        }
        setShouldReload(true);
        return true;
      } else {
        const errorMsg = response.data?.message || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Reset failed', 'havenlytics');
        throw new Error(errorMsg);
      }
    } catch (error) {
      const defaultTabs = createDefaultRequiredTabs();
      const enforcedTabs = enforceRequiredTabPositions(defaultTabs);
      const hasDocumentTab = enforcedTabs.some(tab => tab.title === 'Property Documents');
      if (!hasDocumentTab) {
        enforcedTabs.push({
          id: `sec_property_docs_${Date.now()}`,
          title: 'Property Documents',
          icon: 'fas fa-file-pdf',
          fields: [],
          collapsed: false,
          order: enforcedTabs.length,
          required: false
        });
      }
      setTabs(enforcedTabs);
      tabsRef.current = enforcedTabs;
      setGroupCollapsedStates({});
      if (error.response?.status !== 404) {
        let errorMessage = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Failed to reset configuration, but required tabs have been restored.', 'havenlytics');
        showToastRef.current('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Reset Failed', 'havenlytics'), errorMessage);
      } else {
        showToastRef.current('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Configuration Reset', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Configuration reset successfully.', 'havenlytics'));
      }
      return false;
    } finally {
      setIsLoading(false);
    }
  }, [SECTIONS_ENDPOINT, API_NONCE, resetAndCleanup]);
  const deleteGroup = groupId => {
    const groupFields = [];
    tabs.forEach(tab => {
      tab.fields.forEach(field => {
        if (field.group_id === groupId) {
          groupFields.push(field);
        }
      });
    });
    const fieldNames = groupFields.map(f => f.name || f.id || '').filter(name => name);
    const groupExists = tabs.some(tab => tab.fields.some(field => field.group_id === groupId));
    if (!groupExists) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Error', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Group not found', 'havenlytics'));
      return;
    }
    window.HvnlyNabAlert.confirm((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Are you sure you want to delete this group and all its fields?', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Delete Group?', 'havenlytics')).then(async userConfirmed => {
      if (userConfirmed === 'confirm') {
        setTabs(prevTabs => {
          return prevTabs.map(tab => {
            const newTab = JSON.parse(JSON.stringify(tab));
            const hasGroup = newTab.fields.some(field => field.group_id === groupId);
            if (hasGroup) {
              const updatedFields = newTab.fields.filter(field => field.group_id !== groupId);
              const reorderedFields = updatedFields.map((field, index) => ({
                ...field,
                order: index
              }));
              newTab.fields = reorderedFields;
            }
            return newTab;
          });
        });
        if (fieldNames.length > 0) {
          await cleanupOrphanedMeta(fieldNames, 0);
        }
        setGroupCollapsedStates(prev => {
          const newStates = {
            ...prev
          };
          delete newStates[groupId];
          return newStates;
        });
        setTimeout(() => {
          setTabs(currentTabs => {
            return [...currentTabs];
          });
          showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Group Deleted', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Group and %d fields deleted', 'havenlytics'), fieldNames.length));
        }, 100);
      }
    });
  };
  const addTab = tabData => {
    const newTab = {
      id: `sec_${(0,uuid__WEBPACK_IMPORTED_MODULE_3__["default"])()}`,
      title: tabData.title || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('New Section', 'havenlytics'),
      icon: tabData.icon || 'fas fa-home',
      fields: [],
      collapsed: false,
      order: tabs.length,
      required: false
    };
    const newTabs = [...tabs, newTab];
    const enforcedTabs = ensureRequiredTabs(newTabs);
    setTabs(enforcedTabs);
    setIsTabModalOpen(false);
    showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Tab Added', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Tab added successfully', 'havenlytics'));
  };
  const editTab = (tabId, tabData) => {
    const tabToEdit = tabs.find(t => t.id === tabId);
    if (isRequiredTab(tabToEdit)) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cannot Edit', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This tab is required and cannot be edited', 'havenlytics'));
      return;
    }
    const updatedTabs = tabs.map(tab => tab.id === tabId ? {
      ...tab,
      title: tabData.title || tab.title,
      icon: tabData.icon || tab.icon
    } : tab);
    const enforcedTabs = ensureRequiredTabs(updatedTabs);
    setTabs(enforcedTabs);
    setIsTabModalOpen(false);
    showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Tab Updated', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Tab updated successfully', 'havenlytics'));
  };
  const deleteTab = tabId => {
    const tab = tabs.find(t => t.id === tabId);
    if (isRequiredTab(tab)) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cannot Delete', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This tab is required and cannot be deleted', 'havenlytics'));
      return;
    }
    window.HvnlyNabAlert.confirm((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Are you sure you want to delete the section', 'havenlytics') + ` "${tab?.title}"?`, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Delete Section?', 'havenlytics')).then(userConfirmed => {
      if (userConfirmed === 'confirm') {
        const newTabs = tabs.filter(tab => tab.id !== tabId);
        const enforcedTabs = ensureRequiredTabs(newTabs);
        setTabs(enforcedTabs);
        showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Tab Removed', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Section', 'havenlytics') + ` "${tab?.title}" ` + (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('removed successfully', 'havenlytics'));
      }
    });
  };
  const toggleTabCollapse = tabId => {
    setTabs(tabs.map(tab => tab.id === tabId ? {
      ...tab,
      collapsed: !tab.collapsed
    } : tab));
  };
  const addField = (tabId, fieldData) => {
    const tab = tabs.find(t => t.id === tabId);
    if (isRequiredTab(tab)) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cannot Add Field', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cannot add fields to required tabs', 'havenlytics'));
      return;
    }
    setTabs(prevTabs => {
      return prevTabs.map(tab => {
        if (tab.id === tabId) {
          const newField = {
            id: `fld_${(0,uuid__WEBPACK_IMPORTED_MODULE_3__["default"])()}`,
            ...fieldData,
            enabled: fieldData.enabled !== false,
            order: tab.fields?.length || 0,
            locked: false
          };
          return {
            ...tab,
            fields: [...(tab.fields || []), newField]
          };
        }
        return tab;
      });
    });
  };
  const editField = (tabId, fieldId, fieldData) => {
    const tab = tabs.find(t => t.id === tabId);
    const field = tab?.fields?.find(f => f.id === fieldId);
    if (field?.locked) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cannot Edit', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This field is required and cannot be edited', 'havenlytics'));
      return;
    }
    const newTabs = tabs.map(tab => {
      if (tab.id === tabId) {
        return {
          ...tab,
          fields: (tab.fields || []).map(f => f.id === fieldId ? {
            ...f,
            ...fieldData
          } : f)
        };
      }
      return tab;
    });
    setTabs(newTabs);
    setIsFieldModalOpen(false);
    setActiveField(null);
    showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Field Updated', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Field updated successfully', 'havenlytics'));
  };
  const deleteField = (tabId, fieldId) => {
    const tab = tabs.find(t => t.id === tabId);
    const field = tab?.fields?.find(f => f.id === fieldId);
    if (field?.locked) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cannot Delete', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This field is required and cannot be deleted', 'havenlytics'));
      return;
    }
    window.HvnlyNabAlert.confirm((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Are you sure you want to delete the field', 'havenlytics') + ` "${field?.label}"?`, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Delete Field?', 'havenlytics')).then(async userConfirmed => {
      if (userConfirmed === 'confirm') {
        const fieldName = field?.name || field?.id || '';
        setTabs(prevTabs => {
          return prevTabs.map(tab => tab.id === tabId ? {
            ...tab,
            fields: (tab.fields || []).filter(f => f.id !== fieldId)
          } : tab);
        });
        if (fieldName) {
          await cleanupOrphanedMeta([fieldName], 0);
        }
        showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Field Removed', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Field', 'havenlytics') + ` "${field?.label}" ` + (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('removed successfully', 'havenlytics'));
      }
    });
  };
  const toggleField = (tabId, fieldId) => {
    const tab = tabs.find(t => t.id === tabId);
    const field = tab?.fields?.find(f => f.id === fieldId);
    if (field?.locked) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cannot Modify', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This field is required and cannot be modified', 'havenlytics'));
      return;
    }
    setTabs(tabs.map(tab => {
      if (tab.id === tabId) {
        return {
          ...tab,
          fields: (tab.fields || []).map(f => f.id === fieldId ? {
            ...f,
            enabled: !f.enabled
          } : f)
        };
      }
      return tab;
    }));
  };
  const toggleFieldRequired = (tabId, fieldId) => {
    const tab = tabs.find(t => t.id === tabId);
    const field = tab?.fields?.find(f => f.id === fieldId);
    if (field?.locked) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cannot Modify', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This field is required and cannot be modified', 'havenlytics'));
      return;
    }
    setTabs(tabs.map(tab => {
      if (tab.id === tabId) {
        return {
          ...tab,
          fields: (tab.fields || []).map(f => f.id === fieldId ? {
            ...f,
            required: !f.required
          } : f)
        };
      }
      return tab;
    }));
  };
  const toggleFieldAdminOnly = (tabId, fieldId) => {
    const tab = tabs.find(t => t.id === tabId);
    const field = tab?.fields?.find(f => f.id === fieldId);
    if (field?.locked) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cannot Modify', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This field is required and cannot be modified', 'havenlytics'));
      return;
    }
    setTabs(tabs.map(tab => {
      if (tab.id === tabId) {
        return {
          ...tab,
          fields: (tab.fields || []).map(f => f.id === fieldId ? {
            ...f,
            adminOnly: !f.adminOnly
          } : f)
        };
      }
      return tab;
    }));
  };
  const moveFieldUp = (tabId, fieldId) => {
    const tab = tabs.find(t => t.id === tabId);
    const field = tab?.fields?.find(f => f.id === fieldId);
    if (field?.locked) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cannot Move', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This field is required and cannot be moved', 'havenlytics'));
      return;
    }
    if (field?.group_id) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cannot Move', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Individual group fields cannot be moved. Please move the entire group.', 'havenlytics'));
      return;
    }
    setTabs(prevTabs => {
      return prevTabs.map(tab => {
        if (tab.id === tabId) {
          const fields = [...(tab.fields || [])];
          const currentIndex = fields.findIndex(f => f.id === fieldId);
          if (currentIndex > 0) {
            if (fields[currentIndex - 1]?.group_id) {
              showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cannot Move', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cannot move field above a group. Move the group instead.', 'havenlytics'));
              return tab;
            }
            const newFields = [...fields.slice(0, currentIndex - 1), fields[currentIndex], fields[currentIndex - 1], ...fields.slice(currentIndex + 1)];
            const updatedFields = newFields.map((field, index) => ({
              ...field,
              order: index
            }));
            return {
              ...tab,
              fields: updatedFields
            };
          }
        }
        return tab;
      });
    });
  };
  const moveFieldDown = (tabId, fieldId) => {
    const tab = tabs.find(t => t.id === tabId);
    const field = tab?.fields?.find(f => f.id === fieldId);
    if (field?.locked) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cannot Move', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This field is required and cannot be moved', 'havenlytics'));
      return;
    }
    if (field?.group_id) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cannot Move', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Individual group fields cannot be moved. Please move the entire group.', 'havenlytics'));
      return;
    }
    setTabs(prevTabs => {
      return prevTabs.map(tab => {
        if (tab.id === tabId) {
          const fields = [...(tab.fields || [])];
          const currentIndex = fields.findIndex(f => f.id === fieldId);
          if (currentIndex < fields.length - 1) {
            if (fields[currentIndex + 1]?.group_id) {
              showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cannot Move', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cannot move field below a group. Move the group instead.', 'havenlytics'));
              return tab;
            }
            const newFields = [...fields.slice(0, currentIndex), fields[currentIndex + 1], fields[currentIndex], ...fields.slice(currentIndex + 2)];
            const updatedFields = newFields.map((field, index) => ({
              ...field,
              order: index
            }));
            return {
              ...tab,
              fields: updatedFields
            };
          }
        }
        return tab;
      });
    });
  };
  const openTabModal = (tab = null) => {
    setActiveTab(tab?.id || null);
    setActiveField(null);
    setIsTabModalOpen(true);
  };
  const openFieldModal = (tabId, field = null) => {
    setActiveTab(tabId);
    setActiveField(field);
    setIsFieldModalOpen(true);
  };
  return {
    tabs,
    setTabs,
    activeTab,
    activeField,
    isTabModalOpen,
    setIsTabModalOpen,
    isFieldModalOpen,
    setIsFieldModalOpen,
    isSaving,
    isLoading,
    isCleaning,
    groupCollapsedStates,
    openTabModal,
    openFieldModal,
    saveConfiguration,
    resetConfiguration,
    addTab,
    editTab,
    deleteTab,
    toggleTabCollapse,
    addField,
    editField,
    deleteField,
    toggleField,
    toggleFieldRequired,
    toggleFieldAdminOnly,
    moveFieldUp,
    moveFieldDown,
    moveGroupUp,
    moveGroupDown,
    toggleGroupCollapse,
    deleteGroup,
    toggleSidebar,
    isRequiredTab
  };
};

/***/ }),

/***/ "./src/builder/components/TabContent/AddPropertyFormTab/utils/fieldTypes.js":
/*!**********************************************************************************!*\
  !*** ./src/builder/components/TabContent/AddPropertyFormTab/utils/fieldTypes.js ***!
  \**********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fieldTypes: () => (/* binding */ fieldTypes),
/* harmony export */   generateFieldName: () => (/* binding */ generateFieldName),
/* harmony export */   generateGroupId: () => (/* binding */ generateGroupId),
/* harmony export */   getActiveItem: () => (/* binding */ getActiveItem),
/* harmony export */   getDefaultLabel: () => (/* binding */ getDefaultLabel),
/* harmony export */   getDefaultPlaceholder: () => (/* binding */ getDefaultPlaceholder),
/* harmony export */   getFieldGroupInfo: () => (/* binding */ getFieldGroupInfo),
/* harmony export */   getIconForType: () => (/* binding */ getIconForType),
/* harmony export */   groupDefinitions: () => (/* binding */ groupDefinitions),
/* harmony export */   isCompleteGroup: () => (/* binding */ isCompleteGroup),
/* harmony export */   isFieldInGroup: () => (/* binding */ isFieldInGroup),
/* harmony export */   organizeFieldsByGroup: () => (/* binding */ organizeFieldsByGroup)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);

const fieldTypes = [{
  value: 'text',
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Text Input', 'havenlytics'),
  icon: 'font',
  isGroup: false
}, {
  value: 'textarea',
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Text Area', 'havenlytics'),
  icon: 'align-left',
  isGroup: false
}, {
  value: 'number',
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Number', 'havenlytics'),
  icon: 'hashtag',
  isGroup: false
}, {
  value: 'checkbox',
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Checkbox List Feature', 'havenlytics'),
  icon: 'check-square',
  isGroup: false
}, {
  value: 'image',
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Image Upload', 'havenlytics'),
  icon: 'image',
  isGroup: false
}, {
  value: 'gallery',
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Gallery (2 Fields)', 'havenlytics'),
  icon: 'images',
  isGroup: true,
  groupType: 'gallery'
}, {
  value: 'video',
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Video (3 Fields)', 'havenlytics'),
  icon: 'video',
  isGroup: true,
  groupType: 'video'
}, {
  value: 'map',
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Map Location (4 Fields)', 'havenlytics'),
  icon: 'map-marker-alt',
  isGroup: true,
  groupType: 'map'
}, {
  value: 'property_docs',
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Property Documents', 'havenlytics'),
  icon: 'file-pdf',
  isGroup: true,
  groupType: 'property_docs'
}];

// Group field definitions
const groupDefinitions = {
  video: {
    name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Video Information', 'havenlytics'),
    icon: 'video',
    fieldCount: 3,
    fields: [{
      id: 'title',
      type: 'text',
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Video Title', 'havenlytics'),
      placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enter video title', 'havenlytics'),
      required: false,
      metaKey: 'title'
    }, {
      id: 'url',
      type: 'text',
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Video URL', 'havenlytics'),
      placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enter video URL', 'havenlytics'),
      required: false,
      metaKey: 'url'
    }, {
      id: 'thumbnail',
      type: 'image',
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Video Thumbnail', 'havenlytics'),
      placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Upload video thumbnail', 'havenlytics'),
      required: false,
      metaKey: 'thumbnail'
    }]
  },
  gallery: {
    name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Property Gallery', 'havenlytics'),
    icon: 'images',
    fieldCount: 2,
    fields: [{
      id: 'title',
      type: 'text',
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Gallery Title', 'havenlytics'),
      placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enter gallery title', 'havenlytics'),
      required: false,
      metaKey: 'title'
    }, {
      id: 'images',
      type: 'gallery',
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Gallery Images', 'havenlytics'),
      placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Upload gallery images', 'havenlytics'),
      required: false,
      metaKey: 'images'
    }]
  },
  map: {
    name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Map Location', 'havenlytics'),
    icon: 'map-marker-alt',
    fieldCount: 4,
    fields: [{
      id: 'address',
      type: 'text',
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Property Map Address', 'havenlytics'),
      placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enter property map address', 'havenlytics'),
      required: true,
      metaKey: 'address'
    }, {
      id: 'latitude',
      type: 'text',
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Property Latitude', 'havenlytics'),
      placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enter property latitude', 'havenlytics'),
      required: false,
      metaKey: 'latitude',
      description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Get the property latitude by clicking on Google Maps or visiting https://www.maps.ie/coordinates.html', 'havenlytics')
    }, {
      id: 'longitude',
      type: 'text',
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Property Longitude', 'havenlytics'),
      placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enter property longitude', 'havenlytics'),
      required: false,
      metaKey: 'longitude',
      description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Get the property longitude by clicking on Google Maps or visiting https://www.maps.ie/coordinates.html', 'havenlytics')
    }, {
      id: 'preview',
      type: 'map',
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Property Location Map', 'havenlytics'),
      placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Select location on map', 'havenlytics'),
      required: false,
      metaKey: 'preview'
    }]
  },
  property_docs: {
    name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Property Documents', 'havenlytics'),
    icon: 'file-pdf',
    fieldCount: 3,
    fields: [{
      id: 'icon',
      type: 'text',
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Document Icon', 'havenlytics'),
      placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('e.g., file-pdf, print, video', 'havenlytics'),
      required: false,
      metaKey: 'icon',
      description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enter FontAwesome icon name (without fa- prefix)', 'havenlytics')
    }, {
      id: 'label',
      type: 'text',
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Document Label', 'havenlytics'),
      placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('e.g., Floor Plan, Brochure, EPC', 'havenlytics'),
      required: true,
      metaKey: 'label'
    }, {
      id: 'url',
      type: 'text',
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Document URL', 'havenlytics'),
      placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enter document URL or file path', 'havenlytics'),
      required: true,
      metaKey: 'url'
    }]
  }
};

/**
 * Check if field belongs to a group
 */
const isFieldInGroup = field => {
  return field && field.group_id && field.group_type;
};

/**
 * Get group information for a field
 */
const getFieldGroupInfo = field => {
  if (!isFieldInGroup(field)) return null;
  return {
    id: field.group_id,
    type: field.group_type,
    name: field.group_name || groupDefinitions[field.group_type]?.name || field.group_type,
    position: field.group_position || 0,
    total: field.group_total || 0,
    icon: groupDefinitions[field.group_type]?.icon || 'folder'
  };
};

/**
 * Check if all fields in a group are present
 */
const isCompleteGroup = (fields, groupId) => {
  const groupFields = fields.filter(f => f.group_id === groupId);
  const groupType = groupFields[0]?.group_type;
  if (!groupType) return false;
  const expectedCount = groupDefinitions[groupType]?.fieldCount || 0;
  return groupFields.length === expectedCount;
};

/**
 * Organize fields by group
 */
const organizeFieldsByGroup = fields => {
  const organized = {
    groups: {},
    standalone: []
  };
  fields.forEach(field => {
    if (isFieldInGroup(field)) {
      const groupId = field.group_id;
      if (!organized.groups[groupId]) {
        organized.groups[groupId] = {
          id: groupId,
          type: field.group_type,
          name: field.group_name || groupDefinitions[field.group_type]?.name || field.group_type,
          icon: groupDefinitions[field.group_type]?.icon || 'folder',
          fields: [],
          collapsed: false,
          show_in_sidebar: field.show_in_sidebar !== undefined ? field.show_in_sidebar : true
        };
      }
      organized.groups[groupId].fields.push(field);

      // Sort fields by group position
      organized.groups[groupId].fields.sort((a, b) => {
        return (a.group_position || 0) - (b.group_position || 0);
      });
    } else {
      organized.standalone.push(field);
    }
  });
  return organized;
};

/**
 * Generate group ID
 */
const generateGroupId = groupType => {
  const timestamp = Date.now();
  const random = Math.random().toString(36).substring(2, 10);
  return `grp_${groupType}_${timestamp}_${random}`;
};

/**
 * Generate field name with prefix
 */
const generateFieldName = (prefix, fieldId) => {
  return `${prefix}${fieldId}`;
};
const getDefaultLabel = fieldType => {
  const labelMap = {
    text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Text Field', 'havenlytics'),
    textarea: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Text Area', 'havenlytics'),
    number: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Number', 'havenlytics'),
    checkbox: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Checkbox', 'havenlytics'),
    image: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Image Upload', 'havenlytics'),
    gallery: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Gallery', 'havenlytics'),
    video: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Video', 'havenlytics'),
    map: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Map Location', 'havenlytics'),
    property_docs: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Property Documents', 'havenlytics')
  };
  return labelMap[fieldType] || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('New Field', 'havenlytics');
};
const getDefaultPlaceholder = fieldType => {
  const placeholderMap = {
    text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enter text here', 'havenlytics'),
    textarea: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enter detailed information here', 'havenlytics'),
    number: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enter number here', 'havenlytics'),
    checkbox: '',
    image: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Upload image', 'havenlytics'),
    gallery: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Upload multiple images', 'havenlytics'),
    video: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Upload video', 'havenlytics'),
    map: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Select location on map', 'havenlytics'),
    property_docs: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add property documents', 'havenlytics')
  };
  return placeholderMap[fieldType] || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enter value here', 'havenlytics');
};
const getIconForType = type => {
  const iconMap = {
    text: 'font',
    textarea: 'align-left',
    number: 'hashtag',
    checkbox: 'check-square',
    image: 'image',
    gallery: 'images',
    video: 'video',
    map: 'map-marker-alt',
    property_docs: 'file-pdf'
  };
  return iconMap[type] || 'font';
};
const getActiveItem = (activeDragId, tabs) => {
  if (!activeDragId) return null;
  const activeTab = tabs.find(tab => tab.id === activeDragId);
  if (activeTab) {
    return {
      type: 'tab',
      data: activeTab
    };
  }
  for (const tab of tabs) {
    const activeField = tab.fields.find(field => field.id === activeDragId);
    if (activeField) {
      return {
        type: 'field',
        data: activeField
      };
    }
  }
  if (activeDragId.includes('text') || activeDragId.includes('textarea') || activeDragId.includes('number') || activeDragId.includes('checkbox') || activeDragId.includes('image') || activeDragId.includes('gallery') || activeDragId.includes('video') || activeDragId.includes('map') || activeDragId.includes('property_docs')) {
    const fieldType = activeDragId.split('_')[0];
    return {
      type: 'component',
      data: {
        type: fieldType,
        label: getDefaultLabel(fieldType)
      }
    };
  }
  return null;
};

/***/ }),

/***/ "./src/builder/components/TabContent/AddPropertyFormTab/utils/icons.js":
/*!*****************************************************************************!*\
  !*** ./src/builder/components/TabContent/AddPropertyFormTab/utils/icons.js ***!
  \*****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   allIcons: () => (/* binding */ allIcons),
/* harmony export */   getIconForType: () => (/* binding */ getIconForType),
/* harmony export */   popularIcons: () => (/* binding */ popularIcons)
/* harmony export */ });
// icons.js - FIXED: Remove duplicate icons

const getIconForType = type => {
  const iconMap = {
    text: 'font',
    textarea: 'align-left',
    number: 'hashtag',
    select: 'caret-square-down',
    checkbox: 'check-square',
    radio: 'dot-circle',
    image: 'image',
    gallery: 'images',
    video: 'video',
    map: 'map-marker-alt'
  };
  return iconMap[type] || 'font';
};
const popularIcons = ['home', 'info-circle', 'images', 'video', 'map-marker-alt', 'concierge-bell', 'star', 'bed', 'bath', 'building', 'couch', 'utensils', 'wifi', 'parking', 'swimming-pool', 'snowflake', 'sun', 'tree', 'umbrella-beach', 'dumbbell'];

// All icons with duplicates
const allIconsWithDuplicates = [
// Common icons
'home', 'cog', 'user', 'users', 'image', 'images', 'video', 'map-marker-alt', 'info-circle', 'question-circle', 'exclamation-circle', 'check-circle', 'times-circle', 'plus-circle', 'minus-circle', 'arrow-right', 'arrow-left', 'arrow-up', 'arrow-down', 'search', 'filter', 'sort', 'bars', 'th-large', 'th', 'th-list', 'star', 'heart', 'bookmark', 'flag', 'bell', 'envelope', 'paper-plane', 'inbox', 'trash', 'folder', 'folder-open', 'save', 'edit', 'key', 'lock', 'unlock', 'eye', 'eye-slash', 'camera', 'chart-bar', 'chart-line', 'chart-pie', 'calendar', 'clock', 'database', 'server', 'desktop', 'laptop', 'tablet', 'mobile', 'phone', 'globe', 'cloud', 'download', 'upload', 'sync', 'redo', 'undo', 'cog', 'wrench', 'tools', 'magic', 'tachometer-alt', 'rocket',
// Category icons
'shopping-cart', 'credit-card', 'money-bill', 'receipt', 'tag', 'tags', 'box', 'boxes', 'palette', 'brush', 'pencil-alt', 'font', 'bold', 'italic', 'heading', 'list', 'list-ol', 'list-ul', 'link', 'unlink', 'paperclip', 'file', 'file-alt', 'file-pdf', 'file-word', 'file-excel', 'file-powerpoint', 'file-image', 'file-video', 'file-audio', 'file-code', 'file-archive',
// Social icons
'thumbs-up', 'thumbs-down', 'comment', 'comments', 'share', 'retweet', 'like', 'dislike', 'smile', 'frown', 'meh', 'grin', 'grin-alt', 'grin-beam', 'grin-beam-sweat', 'grin-hearts', 'grin-squint', 'grin-squint-tears', 'grin-stars', 'grin-tears', 'grin-tongue', 'grin-tongue-squint', 'grin-tongue-wink', 'grin-wink', 'kiss', 'kiss-beam', 'kiss-wink-heart', 'laugh', 'laugh-beam', 'laugh-squint', 'laugh-wink',
// Brand icons
'twitter', 'facebook', 'instagram', 'linkedin', 'youtube', 'pinterest', 'snapchat', 'skype', 'android', 'apple', 'windows', 'linux', 'chrome', 'firefox', 'safari', 'opera', 'edge', 'amazon', 'ebay', 'paypal', 'visa', 'mastercard', 'discover', 'amex', 'stripe', 'bitcoin', 'ethereum', 'github', 'gitlab', 'docker', 'wordpress', 'php', 'js', 'css3', 'html5', 'react', 'vuejs', 'angular', 'node', 'npm', 'python', 'java',
// Special icons
'heartbeat', 'ambulance', 'first-aid', 'hospital', 'medkit', 'pills', 'syringe', 'thermometer', 'weight', 'dumbbell', 'bicycle', 'bus', 'car', 'motorcycle', 'plane', 'ship', 'train', 'truck', 'walking', 'wheelchair', 'utensils', 'glass-martini', 'wine-glass', 'beer', 'cocktail', 'coffee', 'teapot', 'birthday-cake', 'cookie', 'ice-cream', 'pizza-slice', 'hamburger',
// Additional useful icons
'address-book', 'address-card', 'archive', 'balance-scale', 'ban', 'barcode', 'bath', 'bed', 'bell-slash', 'bible', 'binoculars', 'birthday-cake', 'blender', 'blender-phone', 'blind', 'blog', 'bold', 'bolt', 'bomb', 'bone', 'bong', 'book', 'book-dead', 'book-medical', 'book-open', 'book-reader', 'bowling-ball', 'box-open', 'boxes', 'braille', 'briefcase', 'briefcase-medical', 'broadcast-tower', 'broom', 'brush', 'bug', 'building', 'bullhorn', 'bullseye', 'burn', 'business-time', 'calculator', 'calendar', 'calendar-alt', 'calendar-check', 'calendar-day', 'calendar-minus', 'calendar-plus', 'calendar-times', 'calendar-week', 'camera', 'camera-retro', 'campground', 'candy-cane', 'cannabis', 'capsules', 'car-alt', 'car-battery', 'car-crash', 'car-side', 'caret-down', 'caret-left', 'caret-right', 'caret-square-down', 'caret-square-left', 'caret-square-right', 'caret-square-up', 'caret-up', 'carrot', 'cart-arrow-down', 'cart-plus', 'cash-register', 'cat', 'certificate', 'chair', 'chalkboard', 'chalkboard-teacher', 'charging-station', 'chart-area', 'check', 'check-circle', 'check-double', 'check-square', 'cheese', 'chess', 'chess-bishop', 'chess-board', 'chess-king', 'chess-knight', 'chess-pawn', 'chess-queen', 'chess-rook', 'chevron-circle-down', 'chevron-circle-left', 'chevron-circle-right', 'chevron-circle-up', 'chevron-down', 'chevron-left', 'chevron-right', 'chevron-up', 'child', 'church', 'circle', 'circle-notch', 'city', 'clinic-medical', 'clipboard', 'clipboard-check', 'clipboard-list', 'clock', 'clone', 'closed-captioning', 'cloud-download-alt', 'cloud-meatball', 'cloud-moon', 'cloud-moon-rain', 'cloud-rain', 'cloud-showers-heavy', 'cloud-sun', 'cloud-sun-rain', 'cloud-upload-alt', 'cocktail', 'code', 'code-branch', 'coins', 'columns', 'comment-alt', 'comment-dollar', 'comment-dots', 'comment-medical', 'comment-slash', 'comments-dollar', 'compact-disc', 'compass', 'compress', 'compress-arrows-alt', 'concierge-bell', 'cookie-bite', 'copy', 'copyright', 'couch', 'crop', 'crop-alt', 'cross', 'crosshairs', 'crow', 'crown', 'crutch', 'cube', 'cubes', 'cut', 'deaf', 'democrat', 'dharmachakra', 'diagnoses', 'dice', 'dice-d20', 'dice-d6', 'dice-five', 'dice-four', 'dice-one', 'dice-six', 'dice-three', 'dice-two', 'digital-tachograph', 'directions', 'divide', 'dizzy', 'dna', 'dog', 'dollar-sign', 'dolly', 'dolly-flatbed', 'donate', 'door-closed', 'door-open', 'dot-circle', 'dove', 'download', 'drafting-compass', 'dragon', 'draw-polygon', 'drum', 'drum-steelpan', 'drumstick-bite', 'dumpster', 'dumpster-fire', 'dungeon', 'egg', 'eject', 'ellipsis-h', 'ellipsis-v', 'envelope-open', 'envelope-open-text', 'envelope-square', 'equals', 'eraser', 'ethernet', 'euro-sign', 'exchange-alt', 'exclamation', 'exclamation-circle', 'exclamation-triangle', 'expand', 'expand-arrows-alt', 'external-link-alt', 'external-link-square-alt', 'eye-dropper', 'fan', 'fast-backward', 'fast-forward', 'fax', 'feather', 'feather-alt', 'female', 'fighter-jet', 'file-archive', 'file-audio', 'file-code', 'file-contract', 'file-csv', 'file-download', 'file-excel', 'file-export', 'file-image', 'file-import', 'file-invoice', 'file-invoice-dollar', 'file-medical', 'file-medical-alt', 'file-pdf', 'file-powerpoint', 'file-prescription', 'file-signature', 'file-upload', 'file-video', 'file-word', 'fill', 'fill-drip', 'film', 'filter', 'fingerprint', 'fire', 'fire-alt', 'fire-extinguisher', 'first-aid', 'fish', 'fist-raised', 'flag-usa', 'flask', 'flushed', 'folder-minus', 'folder-open', 'folder-plus', 'font', 'football-ball', 'forward', 'frog', 'frown', 'frown-open', 'funnel-dollar', 'futbol', 'gamepad', 'gas-pump', 'gavel', 'gem', 'genderless', 'ghost', 'gift', 'gifts', 'glass-cheers', 'glass-martini', 'glass-martini-alt', 'glass-whiskey', 'glasses', 'globe-africa', 'globe-americas', 'globe-asia', 'globe-europe', 'golf-ball', 'gopuram', 'graduation-cap', 'greater-than', 'greater-than-equal', 'grimace', 'grip-horizontal', 'grip-lines', 'grip-lines-vertical', 'grip-vertical', 'guitar', 'h-square', 'hamburger', 'hammer', 'hamsa', 'hand-holding', 'hand-holding-heart', 'hand-holding-usd', 'hand-holding-water', 'hand-lizard', 'hand-middle-finger', 'hand-paper', 'hand-peace', 'hand-point-down', 'hand-point-left', 'hand-point-right', 'hand-point-up', 'hand-pointer', 'hand-rock', 'hand-scissors', 'hand-spock', 'hands', 'hands-helping', 'handshake', 'hanukiah', 'hard-hat', 'hashtag', 'hat-cowboy', 'hat-cowboy-side', 'hat-wizard', 'haykal', 'hdd', 'heading', 'headphones', 'headphones-alt', 'headset', 'heart-broken', 'heartbeat', 'helicopter', 'highlighter', 'hiking', 'hippo', 'history', 'hockey-puck', 'holly-berry', 'horse', 'horse-head', 'hospital-alt', 'hospital-symbol', 'hot-tub', 'hotdog', 'hotel', 'hourglass', 'hourglass-end', 'hourglass-half', 'hourglass-start', 'house-damage', 'hryvnia', 'i-cursor', 'ice-cream', 'icicles', 'icons', 'id-badge', 'id-card', 'id-card-alt', 'igloo', 'inbox', 'indent', 'industry', 'infinity', 'info', 'italic', 'jedi', 'joint', 'journal-whills', 'kaaba', 'keyboard', 'khanda', 'kiss-beam', 'kiss-wink-heart', 'kiwi-bird', 'landmark', 'language', 'laptop-code', 'laptop-medical', 'layer-group', 'leaf', 'lemon', 'less-than', 'less-than-equal', 'level-down-alt', 'level-up-alt', 'life-ring', 'lightbulb', 'link', 'lira-sign', 'list-alt', 'list-ol', 'list-ul', 'location-arrow', 'lock-open', 'long-arrow-alt-down', 'long-arrow-alt-left', 'long-arrow-alt-right', 'long-arrow-alt-up', 'low-vision', 'luggage-cart', 'magic', 'magnet', 'mail-bulk', 'male', 'map', 'map-marked', 'map-marked-alt', 'map-marker', 'map-pin', 'map-signs', 'marker', 'mars', 'mars-double', 'mars-stroke', 'mars-stroke-h', 'mars-stroke-v', 'mask', 'medal', 'medkit', 'meh-blank', 'meh-rolling-eyes', 'memory', 'menorah', 'mercury', 'meteor', 'microchip', 'microphone', 'microphone-alt', 'microphone-alt-slash', 'microphone-slash', 'microscope', 'minus', 'minus-circle', 'minus-square', 'mitten', 'mobile-alt', 'money-bill-alt', 'money-bill-wave', 'money-bill-wave-alt', 'money-check', 'money-check-alt', 'monument', 'moon', 'mortar-pestle', 'mosque', 'motorcycle', 'mountain', 'mouse-pointer', 'mug-hot', 'music', 'network-wired', 'neuter', 'newspaper', 'not-equal', 'notes-medical', 'object-group', 'object-ungroup', 'oil-can', 'om', 'otter', 'outdent', 'pager', 'paint-brush', 'paint-roller', 'palette', 'pallet', 'paper-plane', 'paperclip', 'parachute-box', 'paragraph', 'parking', 'passport', 'pastafarianism', 'paste', 'pause', 'pause-circle', 'paw', 'peace', 'pen', 'pen-alt', 'pen-fancy', 'pen-nib', 'pen-square', 'pencil-alt', 'pencil-ruler', 'people-carry', 'pepper-hot', 'percent', 'percentage', 'person-booth', 'phone-alt', 'phone-slash', 'phone-square', 'phone-square-alt', 'phone-volume', 'photo-video', 'piggy-bank', 'pills', 'pizza-slice', 'place-of-worship', 'plane-arrival', 'plane-departure', 'play', 'play-circle', 'plug', 'plus', 'plus-circle', 'plus-square', 'podcast', 'poll', 'poll-h', 'poo', 'poo-storm', 'poop', 'portrait', 'pound-sign', 'power-off', 'pray', 'praying-hands', 'prescription', 'prescription-bottle', 'prescription-bottle-alt', 'print', 'procedures', 'project-diagram', 'puzzle-piece', 'qrcode', 'question', 'question-circle', 'quidditch', 'quote-left', 'quote-right', 'quran', 'radiation', 'radiation-alt', 'rainbow', 'random', 'receipt', 'record-vinyl', 'recycle', 'redo-alt', 'registered', 'remove-format', 'reply', 'reply-all', 'republican', 'restroom', 'retweet', 'ribbon', 'ring', 'road', 'robot', 'rocket', 'route', 'rss', 'rss-square', 'ruble-sign', 'ruler', 'ruler-combined', 'ruler-horizontal', 'ruler-vertical', 'running', 'rupee-sign', 'sad-cry', 'sad-tear', 'satellite', 'satellite-dish', 'save', 'school', 'screwdriver', 'scroll', 'sd-card', 'search-dollar', 'search-location', 'search-minus', 'search-plus', 'seedling', 'server', 'shapes', 'share-alt', 'share-alt-square', 'share-square', 'shekel-sign', 'shield-alt', 'ship', 'shipping-fast', 'shoe-prints', 'shopping-bag', 'shopping-basket', 'shopping-cart', 'shower', 'shuttle-van', 'sign', 'sign-in-alt', 'sign-language', 'sign-out-alt', 'signature', 'sim-card', 'sitemap', 'skating', 'skiing', 'skiing-nordic', 'skull', 'skull-crossbones', 'slash', 'sleigh', 'sliders-h', 'smile-beam', 'smile-wink', 'smog', 'smoking', 'smoking-ban', 'sms', 'snowboarding', 'snowman', 'snowplow', 'socks', 'solar-panel', 'sort-alpha-down', 'sort-alpha-down-alt', 'sort-alpha-up', 'sort-alpha-up-alt', 'sort-amount-down', 'sort-amount-down-alt', 'sort-amount-up', 'sort-amount-up-alt', 'sort-down', 'sort-numeric-down', 'sort-numeric-down-alt', 'sort-numeric-up', 'sort-numeric-up-alt', 'sort-up', 'spa', 'space-shuttle', 'spell-check', 'spider', 'spinner', 'splotch', 'spray-can', 'square', 'square-full', 'square-root-alt', 'stamp', 'star-and-crescent', 'star-half', 'star-half-alt', 'star-of-david', 'star-of-life', 'step-backward', 'step-forward', 'stethoscope', 'sticky-note', 'stop', 'stop-circle', 'stopwatch', 'store', 'store-alt', 'stream', 'street-view', 'strikethrough', 'stroopwafel', 'subscript', 'subway', 'suitcase', 'suitcase-rolling', 'sun', 'superscript', 'surprise', 'swatchbook', 'swimmer', 'swimming-pool', 'synagogue', 'sync-alt', 'syringe', 'table', 'table-tennis', 'tablet-alt', 'tablets', 'tachometer-alt', 'tag', 'tags', 'tape', 'tasks', 'taxi', 'teeth', 'teeth-open', 'temperature-high', 'temperature-low', 'tenge', 'terminal', 'text-height', 'text-width', 'th', 'th-large', 'th-list', 'theater-masks', 'thermometer-empty', 'thermometer-full', 'thermometer-half', 'thermometer-quarter', 'thermometer-three-quarters', 'thumbtack', 'ticket-alt', 'times', 'times-circle', 'tint', 'tint-slash', 'tired', 'toggle-off', 'toggle-on', 'toilet', 'toilet-paper', 'toolbox', 'tools', 'tooth', 'torah', 'torii-gate', 'tractor', 'trademark', 'traffic-light', 'train', 'tram', 'transgender', 'transgender-alt', 'trash-alt', 'trash-restore', 'trash-restore-alt', 'tree', 'trophy', 'truck-loading', 'truck-monster', 'truck-moving', 'truck-pickup', 'tshirt', 'tty', 'tv', 'umbrella', 'umbrella-beach', 'underline', 'undo-alt', 'universal-access', 'university', 'unlink', 'unlock-alt', 'upload', 'user-alt', 'user-alt-slash', 'user-astronaut', 'user-check', 'user-circle', 'user-clock', 'user-cog', 'user-edit', 'user-friends', 'user-graduate', 'user-injured', 'user-lock', 'user-md', 'user-minus', 'user-ninja', 'user-nurse', 'user-plus', 'user-secret', 'user-shield', 'user-slash', 'user-tag', 'user-tie', 'user-times', 'users-cog', 'utensil-spoon', 'utensils', 'vector-square', 'venus', 'venus-double', 'venus-mars', 'vial', 'vials', 'video-slash', 'vihara', 'voicemail', 'volleyball-ball', 'volume-down', 'volume-mute', 'volume-off', 'volume-up', 'vote-yea', 'vr-cardboard', 'walking', 'wallet', 'warehouse', 'water', 'wave-square', 'weight-hanging', 'wheelchair', 'wifi', 'wind', 'window-close', 'window-maximize', 'window-minimize', 'window-restore', 'wine-bottle', 'wine-glass-alt', 'won-sign', 'wrench', 'x-ray', 'yen-sign', 'yin-yang'];

// Remove duplicates by converting to Set and back to array
const allIcons = [...new Set(allIconsWithDuplicates)];

/***/ }),

/***/ "./src/builder/components/TabContent/AddPropertyFormTab/utils/presetFields.js":
/*!************************************************************************************!*\
  !*** ./src/builder/components/TabContent/AddPropertyFormTab/utils/presetFields.js ***!
  \************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   presetFields: () => (/* binding */ presetFields)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
// utils/presetFields.js

const presetFields = {
  basic: {
    name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Basic Fields', 'havenlytics'),
    icon: 'user',
    fields: [{
      id: 'preset_hvnly_property_field_fullname',
      type: 'text',
      icon: 'user',
      defaultLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Full Name', 'havenlytics'),
      defaultPlaceholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enter your full name', 'havenlytics'),
      defaultRequired: true,
      defaultAdminOnly: false,
      category: 'basic'
    }, {
      id: 'preset_hvnly_property_field_email',
      type: 'text',
      icon: 'envelope',
      defaultLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Email Address', 'havenlytics'),
      defaultPlaceholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('your.email@example.com', 'havenlytics'),
      defaultRequired: true,
      defaultAdminOnly: false,
      category: 'basic'
    }, {
      id: 'preset_hvnly_property_field_phone',
      type: 'text',
      icon: 'phone',
      defaultLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Phone Number', 'havenlytics'),
      defaultPlaceholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('(123) 456-7890', 'havenlytics'),
      defaultRequired: false,
      defaultAdminOnly: false,
      category: 'basic'
    }, {
      id: 'preset_hvnly_property_field_company',
      type: 'text',
      icon: 'building',
      defaultLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Company Name', 'havenlytics'),
      defaultPlaceholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enter company name', 'havenlytics'),
      defaultRequired: false,
      defaultAdminOnly: false,
      category: 'basic'
    }, {
      id: 'preset_hvnly_property_field_website',
      type: 'text',
      icon: 'globe',
      defaultLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Website', 'havenlytics'),
      defaultPlaceholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enter website URL', 'havenlytics'),
      defaultRequired: false,
      defaultAdminOnly: false,
      category: 'basic'
    }]
  },
  property: {
    name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Property Details', 'havenlytics'),
    icon: 'home',
    fields: [{
      id: 'preset_hvnly_property_field_number_bedrooms',
      type: 'number',
      icon: 'bed',
      defaultLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Bedrooms', 'havenlytics'),
      defaultPlaceholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Number of bedrooms', 'havenlytics'),
      defaultRequired: true,
      defaultAdminOnly: false,
      category: 'property'
    }, {
      id: 'preset_hvnly_property_field_number_bathrooms',
      type: 'number',
      icon: 'bath',
      defaultLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Bathrooms', 'havenlytics'),
      defaultPlaceholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Number of bathrooms', 'havenlytics'),
      defaultRequired: true,
      defaultAdminOnly: false,
      category: 'property'
    }, {
      id: 'preset_hvnly_property_field_number_squarefeet',
      type: 'number',
      icon: 'ruler-combined',
      defaultLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Square Feet', 'havenlytics'),
      defaultPlaceholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Total square footage', 'havenlytics'),
      defaultRequired: false,
      defaultAdminOnly: false,
      category: 'property'
    }, {
      id: 'preset_hvnly_property_field_number_garage',
      type: 'number',
      icon: 'car',
      defaultLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Garage Spaces', 'havenlytics'),
      defaultPlaceholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Number of garage spaces', 'havenlytics'),
      defaultRequired: false,
      defaultAdminOnly: false,
      category: 'property'
    }]
  },
  location: {
    name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Location', 'havenlytics'),
    icon: 'map-marker-alt',
    fields: [
    // {
    //   id: 'preset_hvnly_property_field_text_address',
    //   type: 'text',
    //   icon: 'map-marker-alt',
    //   defaultLabel: __('Street Address', 'havenlytics'),
    //   defaultPlaceholder: __('123 Main Street', 'havenlytics'),
    //   defaultRequired: true,
    //   defaultAdminOnly: false,
    //   category: 'location'
    // },
    {
      id: 'preset_hvnly_property_field_text_city',
      type: 'text',
      icon: 'city',
      defaultLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('City', 'havenlytics'),
      defaultPlaceholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('City name', 'havenlytics'),
      defaultRequired: true,
      defaultAdminOnly: false,
      category: 'location'
    },
    // {
    //   id: 'preset_hvnly_property_field_select_state',
    //   type: 'select',
    //   icon: 'flag-usa',
    //   defaultLabel: __('State/Province', 'havenlytics'),
    //   defaultPlaceholder: __('Select state/province', 'havenlytics'),
    //   defaultRequired: true,
    //   defaultAdminOnly: false,
    //   category: 'location'
    // },
    {
      id: 'preset_hvnly_property_field_text_zipcode',
      type: 'text',
      icon: 'map-pin',
      defaultLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('ZIP/Postal Code', 'havenlytics'),
      defaultPlaceholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('12345', 'havenlytics'),
      defaultRequired: true,
      defaultAdminOnly: false,
      category: 'location'
    }]
  },
  amenities: {
    name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Amenities', 'havenlytics'),
    icon: 'star',
    fields: [{
      id: 'preset_hvnly_property_field_checkbox_pool',
      type: 'checkbox',
      icon: 'swimming-pool',
      defaultLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Swimming Pool', 'havenlytics'),
      defaultPlaceholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Has swimming pool', 'havenlytics'),
      defaultRequired: false,
      defaultAdminOnly: false,
      category: 'amenities'
    }, {
      id: 'preset_hvnly_property_field_checkbox_garden',
      type: 'checkbox',
      icon: 'tree',
      defaultLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Garden', 'havenlytics'),
      defaultPlaceholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Has garden', 'havenlytics'),
      defaultRequired: false,
      defaultAdminOnly: false,
      category: 'amenities'
    }, {
      id: 'preset_hvnly_property_field_checkbox_garage',
      type: 'checkbox',
      icon: 'warehouse',
      defaultLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Garage', 'havenlytics'),
      defaultPlaceholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Has garage', 'havenlytics'),
      defaultRequired: false,
      defaultAdminOnly: false,
      category: 'amenities'
    }]
  }
};

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/PlaceholderLoader/PlaceholderLoader.css":
/*!************************************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/PlaceholderLoader/PlaceholderLoader.css ***!
  \************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/PlaceholderLoader/PlaceholderLoader.js":
/*!***********************************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/PlaceholderLoader/PlaceholderLoader.js ***!
  \***********************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _PlaceholderLoader_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PlaceholderLoader.css */ "./src/builder/components/TabContent/PropertyCard/PlaceholderLoader/PlaceholderLoader.css");



const PlaceholderLoader = () => {
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder__main-container hvnly-placeholder-settings-api_property__builder__main-container"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder__left-panel"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h2", {
    className: "hvnly--builder---api_property__builder__section-title"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Property Card Builder', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder__card__container"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___preview_section"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-single-page-card"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-single-page-card-header"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-thumbnail-area"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-corner top-left"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-corner top-right"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-corner bottom-left"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-corner bottom-right"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-single-page-card-body"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-avatar-title-container"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-avatar-area"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-title-area"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-title-line"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-title-line short"
  }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-content-area"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-content-line"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-content-line"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-features-area"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-feature-line"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-excerpt-area"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-excerpt-line"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-excerpt-line short"
  }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-single-page-card-footer"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-footer-left"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-footer-item"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-footer-right"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-footer-item"
  }))))))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder__right-panel"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h2", {
    className: "hvnly--builder---api_property__builder__section-title"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Property Card Preview', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___enhanced_card_preview_container"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-enhanced-preview-card"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-enhanced-preview-card-image-section"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-enhanced-preview-card-image"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-image-bg"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-overlay-top"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-image-left"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-overlay-item"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-image-right"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-overlay-item"
  }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-overlay-bottom"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-image-left"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-overlay-item"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-image-right"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-overlay-item"
  }))))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-enhanced-preview-card-body"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-enhanced-preview-card-header"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-enhanced-preview-card-avatar"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-enhanced-preview-card-title-section"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-enhanced-preview-card-title"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-enhanced-preview-card-rating"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-enhanced-preview-card-location"
  }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-enhanced-preview-card-excerpt"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-excerpt-line"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-excerpt-line"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-excerpt-line short"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-enhanced-preview-card-features"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-feature-item"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-feature-item"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-feature-item"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-feature-item"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-enhanced-preview-card-content-area"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-detail-item"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-detail-item"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-detail-item"
  }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-enhanced-preview-card-footer"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-enhanced-preview-card-category"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-footer-button"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-enhanced-preview-card-actions"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-action-btn"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-action-btn"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-placeholder-views"
  })))))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PlaceholderLoader);

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/PropertyCardLayoutTab.css":
/*!**********************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/PropertyCardLayoutTab.css ***!
  \**********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/PropertyCardLayoutTab.js":
/*!*********************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/PropertyCardLayoutTab.js ***!
  \*********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _components_layout_CardEditor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/layout/CardEditor */ "./src/builder/components/TabContent/PropertyCard/components/layout/CardEditor.js");
/* harmony import */ var _components_layout_CardPreview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/layout/CardPreview */ "./src/builder/components/TabContent/PropertyCard/components/layout/CardPreview.js");
/* harmony import */ var _components_modals_FieldModal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/modals/FieldModal */ "./src/builder/components/TabContent/PropertyCard/components/modals/FieldModal.js");
/* harmony import */ var _constants_initialSections__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./constants/initialSections */ "./src/builder/components/TabContent/PropertyCard/constants/initialSections.js");
/* harmony import */ var _hooks_useCardSections__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./hooks/useCardSections */ "./src/builder/components/TabContent/PropertyCard/hooks/useCardSections.js");
/* harmony import */ var _hooks_useModal__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./hooks/useModal */ "./src/builder/components/TabContent/PropertyCard/hooks/useModal.js");
/* harmony import */ var _PlaceholderLoader_PlaceholderLoader__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./PlaceholderLoader/PlaceholderLoader */ "./src/builder/components/TabContent/PropertyCard/PlaceholderLoader/PlaceholderLoader.js");
/* harmony import */ var _PropertyCardLayoutTab_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./PropertyCardLayoutTab.css */ "./src/builder/components/TabContent/PropertyCard/PropertyCardLayoutTab.css");
/* harmony import */ var _constants_areaMappings__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./constants/areaMappings */ "./src/builder/components/TabContent/PropertyCard/constants/areaMappings.js");












const PropertyCardLayoutTab = ({
  onActionsReady,
  isSaving,
  isResetting,
  showToast,
  setIsLoading
}) => {
  const {
    sections,
    addField,
    updateField,
    deleteField,
    moveFieldUp,
    moveFieldDown,
    setSections
  } = (0,_hooks_useCardSections__WEBPACK_IMPORTED_MODULE_7__.useCardSections)(_constants_initialSections__WEBPACK_IMPORTED_MODULE_6__.INITIAL_CARD_SECTIONS);
  const {
    activeModal,
    editingField,
    openModal,
    closeModal
  } = (0,_hooks_useModal__WEBPACK_IMPORTED_MODULE_8__.useModal)();
  const [isLocalLoading, setIsLocalLoading] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(true);
  const [isInitialLoad, setIsInitialLoad] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(true);
  const lastToastRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)({
    id: null,
    time: 0
  });
  const getApiSettings = () => {
    const havenlyticsData = window.HavenlyticsData || {};
    return {
      nonce: havenlyticsData.hvnlyNabApi?.nonce || '',
      cardBuilderUrl: havenlyticsData.hvnlyNabApi?.url ? `${havenlyticsData.hvnlyNabApi.url}/pb-card-builder` : '/wp-json/hvnlynab/v1/pb-card-builder'
    };
  };
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (onActionsReady) {
      onActionsReady({
        saveConfiguration: handleSaveConfiguration,
        resetConfiguration: handleResetConfiguration
      });
    }
  }, [sections]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (isSaving) {
      handleSaveConfiguration();
    }
  }, [isSaving]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (isResetting) {
      handleResetConfiguration();
    }
  }, [isResetting]);
  const fetchSections = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async () => {
    try {
      setIsLocalLoading(true);
      if (setIsLoading) setIsLoading(true);
      const apiSettings = getApiSettings();
      const response = await fetch(apiSettings.cardBuilderUrl, {
        method: 'GET',
        headers: {
          'Content-Type': 'application/json',
          'X-WP-Nonce': apiSettings.nonce
        },
        credentials: 'same-origin'
      });
      if (!response.ok) {
        if (response.status === 403) {
          throw new Error((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Permission denied. Please check if you have administrator privileges.', 'havenlytics'));
        }
        throw new Error((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('HTTP error! status:', 'havenlytics') + ` ${response.status}`);
      }
      const data = await response.json();
      if (data.success && data.data && data.data.length > 0) {
        setSections(data.data);
      } else {
        setSections(_constants_initialSections__WEBPACK_IMPORTED_MODULE_6__.INITIAL_CARD_SECTIONS);
      }
    } catch (error) {
      setSections(_constants_initialSections__WEBPACK_IMPORTED_MODULE_6__.INITIAL_CARD_SECTIONS);
      if (showToast) {
        showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Load Failed', 'havenlytics'), error.message || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Failed to load card layout', 'havenlytics'));
      }
    } finally {
      setIsLocalLoading(false);
      if (setIsLoading) setIsLoading(false);
      setIsInitialLoad(false);
    }
  }, [setSections, setIsLoading, showToast]);
  const saveSections = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async sectionsToSave => {
    const saveKey = `save-${Date.now()}`;
    const now = Date.now();
    if (lastToastRef.current.id === saveKey && now - lastToastRef.current.time < 2000) {
      return false;
    }
    lastToastRef.current = {
      id: saveKey,
      time: now
    };
    try {
      if (setIsLoading) setIsLoading(true);
      const apiSettings = getApiSettings();
      const response = await fetch(apiSettings.cardBuilderUrl, {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          'X-WP-Nonce': apiSettings.nonce
        },
        credentials: 'same-origin',
        body: JSON.stringify({
          sections: sectionsToSave.map(section => ({
            id: section.id,
            title: section.title,
            icon: section.icon,
            mode: section.mode || 'both',
            fields: section.fields.map(field => ({
              id: field.id,
              type: field.type,
              label: field.label,
              mode: field.mode || 'both',
              value: field.value,
              order: field.order || 0
            })),
            order: section.order || 0
          }))
        })
      });
      if (!response.ok) {
        throw new Error((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('HTTP error! status:', 'havenlytics') + ` ${response.status}`);
      }
      const data = await response.json();
      if (data.success) {
        if (showToast) {
          showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Configuration Saved', 'havenlytics'), data.message || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Property card layout saved successfully!', 'havenlytics'));
        }
        return true;
      } else {
        throw new Error(data.message || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Failed to save sections', 'havenlytics'));
      }
    } catch (error) {
      if (showToast) {
        showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Save Failed', 'havenlytics'), error.message || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Failed to save property card layout', 'havenlytics'));
      }
      throw error;
    } finally {
      if (setIsLoading) setIsLoading(false);
    }
  }, [showToast, setIsLoading]);
  const deleteSections = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async () => {
    const resetKey = `reset-${Date.now()}`;
    const now = Date.now();
    if (lastToastRef.current.id === resetKey && now - lastToastRef.current.time < 2000) {
      return false;
    }
    lastToastRef.current = {
      id: resetKey,
      time: now
    };
    try {
      if (setIsLoading) setIsLoading(true);
      const apiSettings = getApiSettings();
      const response = await fetch(apiSettings.cardBuilderUrl, {
        method: 'DELETE',
        headers: {
          'Content-Type': 'application/json',
          'X-WP-Nonce': apiSettings.nonce
        },
        credentials: 'same-origin'
      });
      if (!response.ok) {
        throw new Error((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('HTTP error! status:', 'havenlytics') + ` ${response.status}`);
      }
      const data = await response.json();
      if (data.success) {
        if (showToast) {
          showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Configuration Reset', 'havenlytics'), data.message || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Property card layout reset successfully!', 'havenlytics'));
        }
        return true;
      } else {
        throw new Error(data.message || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Failed to delete sections', 'havenlytics'));
      }
    } catch (error) {
      if (showToast) {
        showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Reset Failed', 'havenlytics'), error.message || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Failed to reset property card layout', 'havenlytics'));
      }
      throw error;
    } finally {
      if (setIsLoading) setIsLoading(false);
    }
  }, [showToast, setIsLoading]);
  const handleSaveConfiguration = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async () => {
    try {
      const success = await saveSections(sections);
      return success;
    } catch (error) {
      return false;
    }
  }, [sections, saveSections]);
  const handleResetConfiguration = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async () => {
    try {
      const success = await deleteSections();
      if (success) {
        setSections(_constants_initialSections__WEBPACK_IMPORTED_MODULE_6__.INITIAL_CARD_SECTIONS);
      }
      return success;
    } catch (error) {
      return false;
    }
  }, [deleteSections, setSections]);
  const handleOpenModal = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)((area, event) => {
    openModal(area);
  }, [openModal]);
  const handleEditField = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)((field, event) => {
    event.stopPropagation();
    let area = null;
    for (const [areaKey, sectionId] of Object.entries(_constants_areaMappings__WEBPACK_IMPORTED_MODULE_11__.AREA_TO_SECTION_ID)) {
      if (sections.some(section => section.id === sectionId && section.fields.some(f => f.id === field.id))) {
        area = areaKey;
        break;
      }
    }
    if (area) {
      openModal(area, field);
    }
  }, [sections, openModal]);
  const handleDeleteField = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)((fieldId, event) => {
    event.stopPropagation();
    deleteField(fieldId);
    if (showToast) {
      showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Field Removed', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Field deleted successfully', 'havenlytics'));
    }
  }, [deleteField, showToast]);
  const handleMoveFieldUp = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)((fieldId, event) => {
    event.stopPropagation();
    moveFieldUp(fieldId);
  }, [moveFieldUp]);
  const handleMoveFieldDown = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)((fieldId, event) => {
    event.stopPropagation();
    moveFieldDown(fieldId);
  }, [moveFieldDown]);
  const handleFieldSelect = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(option => {
    if (editingField) {
      updateField(editingField.id, {
        type: option.id,
        label: option.title,
        value: option.defaultValue || {},
        mode: option.mode || 'both'
      });
      if (showToast) {
        showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Field Updated', 'havenlytics'), `${option.title} ${(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('added', 'havenlytics')}`);
      }
      closeModal();
    } else {
      addField(activeModal, option.id);
      if (showToast) {
        showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Field Added', 'havenlytics'), `${option.title} ${(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('added to', 'havenlytics')} ${activeModal}`);
      }
    }
  }, [activeModal, editingField, addField, updateField, closeModal, showToast]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    const handleResize = () => {
      if (activeModal) {
        closeModal();
      }
    };
    window.addEventListener('resize', handleResize);
    return () => {
      window.removeEventListener('resize', handleResize);
    };
  }, [activeModal, closeModal]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    fetchSections();
  }, [fetchSections]);
  if (isLocalLoading && isInitialLoad) {
    return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_PlaceholderLoader_PlaceholderLoader__WEBPACK_IMPORTED_MODULE_9__["default"], null);
  }
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__tab_content_panel"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder__main-container"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_components_layout_CardEditor__WEBPACK_IMPORTED_MODULE_3__["default"], {
    sections: sections,
    onOpenModal: handleOpenModal,
    onEditField: handleEditField,
    onDeleteField: handleDeleteField,
    onMoveFieldUp: handleMoveFieldUp,
    onMoveFieldDown: handleMoveFieldDown
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_components_layout_CardPreview__WEBPACK_IMPORTED_MODULE_4__["default"], {
    sections: sections,
    variant: "enhanced"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_components_modals_FieldModal__WEBPACK_IMPORTED_MODULE_5__["default"], {
    isOpen: !!activeModal,
    area: activeModal,
    editingField: editingField,
    onClose: closeModal,
    onFieldSelect: handleFieldSelect,
    cardSections: sections
  })));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PropertyCardLayoutTab);

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/components/areas/AddElementButton.js":
/*!*********************************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/components/areas/AddElementButton.js ***!
  \*********************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);

const AddElementButton = ({
  onClick
}) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder___add_element_btn",
  onClick: onClick
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
  className: "fas fa-plus"
}));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AddElementButton);

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/components/areas/AreaRenderer.js":
/*!*****************************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/components/areas/AreaRenderer.js ***!
  \*****************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _constants_areaMappings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/areaMappings */ "./src/builder/components/TabContent/PropertyCard/constants/areaMappings.js");
/* harmony import */ var _fields_FieldRenderer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../fields/FieldRenderer */ "./src/builder/components/TabContent/PropertyCard/components/fields/FieldRenderer.js");
/* harmony import */ var _AddElementButton__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AddElementButton */ "./src/builder/components/TabContent/PropertyCard/components/areas/AddElementButton.js");





const AreaRenderer = ({
  area,
  sections,
  onOpenModal,
  onEditField,
  onDeleteField,
  onMoveFieldUp,
  onMoveFieldDown,
  variant = 'default',
  mode = 'edit'
}) => {
  const sectionId = _constants_areaMappings__WEBPACK_IMPORTED_MODULE_2__.AREA_TO_SECTION_ID[area];
  const section = sections.find(s => s.id === sectionId);
  const label = _constants_areaMappings__WEBPACK_IMPORTED_MODULE_2__.AREA_LABELS[area];
  const [activeMoveId, setActiveMoveId] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(null);

  // Check if this area has any fields
  const hasFields = section?.fields && section.fields.length > 0;
  const getAreaStyles = () => {
    const baseStyles = {};
    if (area === 'thumbnail') {
      baseStyles.minHeight = '80px';
      baseStyles.minWidth = '65px';
    } else if (area === 'avatar') {
      baseStyles.minHeight = '70px';
    } else {
      baseStyles.minHeight = '30px';
    }
    return baseStyles;
  };

  // Handle move up with active state
  const handleMoveUp = (fieldId, event) => {
    setActiveMoveId(fieldId);
    onMoveFieldUp(fieldId, event);
    setTimeout(() => setActiveMoveId(null), 300);
  };

  // Handle move down with active state
  const handleMoveDown = (fieldId, event) => {
    setActiveMoveId(fieldId);
    onMoveFieldDown(fieldId, event);
    setTimeout(() => setActiveMoveId(null), 300);
  };

  // Render default avatar icon when no fields exist
  const renderDefaultAvatar = () => {
    if (area === 'avatar' && !hasFields && mode === 'edit') {
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___default_avatar_icon"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-user"
      }));
    }
    return null;
  };
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: `hvnly--builder---api_property__builder___editable_area ${variant} ${area}-area ${!hasFields ? 'empty' : ''}`,
    style: getAreaStyles()
  }, mode === 'edit' && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_AddElementButton__WEBPACK_IMPORTED_MODULE_4__["default"], {
    onClick: e => onOpenModal(area, e)
  }), renderDefaultAvatar(), section?.fields.map((field, index) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_fields_FieldRenderer__WEBPACK_IMPORTED_MODULE_3__["default"], {
    key: field.id,
    field: field,
    onEdit: onEditField,
    onDelete: onDeleteField,
    onMoveUp: handleMoveUp,
    onMoveDown: handleMoveDown,
    canMoveUp: index > 0,
    canMoveDown: index < section.fields.length - 1,
    isMoving: activeMoveId === field.id,
    mode: mode,
    area: area
  })));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AreaRenderer);

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/components/fields/FieldContent/EditFieldContent.js":
/*!***********************************************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/components/fields/FieldContent/EditFieldContent.js ***!
  \***********************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);


const EditFieldContent = ({
  field,
  onEdit,
  onDelete,
  onMoveUp,
  onMoveDown,
  canMoveUp,
  canMoveDown
}) => {
  const handleEdit = e => {
    e.stopPropagation();
    onEdit(field, e);
  };
  const handleDelete = e => {
    e.stopPropagation();
    onDelete(field.id, e);
  };
  const handleMoveUp = e => {
    e.stopPropagation();
    onMoveUp(field.id, e);
  };
  const handleMoveDown = e => {
    e.stopPropagation();
    onMoveDown(field.id, e);
  };
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___field_actions"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "hvnly--builder---api_property__builder___field_label"
  }, field.label), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___field_action_buttons"
  }, canMoveUp && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    type: "button",
    className: "hvnly--builder---api_property__builder___field_action_btn hvnly--builder---api_property__builder___field_move_up_btn",
    onClick: handleMoveUp,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Move Up", "havenlytics")
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-arrow-up"
  })), canMoveDown && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    type: "button",
    className: "hvnly--builder---api_property__builder___field_action_btn hvnly--builder---api_property__builder___field_move_down_btn",
    onClick: handleMoveDown,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Move Down", "havenlytics")
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-arrow-down"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    type: "button",
    className: "hvnly--builder---api_property__builder___field_action_btn hvnly--builder---api_property__builder___field_edit_btn",
    onClick: handleEdit,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Edit", "havenlytics")
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-edit"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    type: "button",
    className: "hvnly--builder---api_property__builder___field_action_btn hvnly--builder---api_property__builder___field_delete_btn",
    onClick: handleDelete,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Delete", "havenlytics")
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-trash"
  }))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditFieldContent);

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/components/fields/FieldContent/EnhancedPreviewFieldContent.js":
/*!**********************************************************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/components/fields/FieldContent/EnhancedPreviewFieldContent.js ***!
  \**********************************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);


const EnhancedPreviewFieldContent = ({
  field,
  area
}) => {
  // Special handling for footer-left area to match existing markup
  if (area === 'footer-left') {
    switch (field.type) {
      case 'view-btn':
        return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
          className: "hvnly--builder---api_property__builder___enhanced_preview_card_button hvnly--builder---api_property__builder___enhanced_preview_card_primary_btn"
        }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
          className: "fas fa-external-link-alt"
        }), " ", field.value?.text || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('View Property', 'havenlytics'));
      case 'schedule-tour-button':
        return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
          className: "hvnly--builder---api_property__builder___enhanced_preview_card_button hvnly--builder---api_property__builder___enhanced_preview_card_primary_btn"
        }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
          className: "fas fa-calendar-alt"
        }), " ", field.value?.text || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Schedule Tour', 'havenlytics'));
      case 'badge':
        return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
          className: "hvnly--builder---api_property__builder___enhanced_preview_card_tag"
        }, field.value?.text || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Featured', 'havenlytics'));
      case 'status':
        return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
          className: `hvnly--builder---api_property__builder___enhanced_preview_card_status hvnly-status-${field.value?.color || 'green'}`
        }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
          className: "fas fa-circle"
        }), " ", field.value?.text || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Active', 'havenlytics'));
      case 'time':
        return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
          className: "hvnly--builder---api_property__builder___enhanced_preview_card_time"
        }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
          className: "fas fa-clock"
        }), " ", field.value?.text || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('2 days ago', 'havenlytics'));
      default:
        return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.text || field.label);
    }
  }

  // Special handling for footer-right area to match existing markup
  if (area === 'footer-right') {
    switch (field.type) {
      case 'share':
        return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
          className: "hvnly--builder---api_property__builder___enhanced_preview_card_action_btn"
        }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
          className: "fas fa-share-alt"
        }));
      case 'favorite':
        return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
          className: "hvnly--builder---api_property__builder___enhanced_preview_card_action_btn"
        }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
          className: `fas fa-heart ${field.value?.isFavorite ? 'active' : ''}`
        }));
      case 'rating':
        return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
          className: "hvnly--builder---api_property__builder___enhanced_preview_card_rating"
        }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
          className: "hvnly--builder---api_property__builder___enhanced_preview_card_stars"
        }, [...Array(5)].map((_, i) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
          key: i,
          className: `fas fa-star ${i < Math.floor(field.value?.value || 0) ? 'filled' : ''}`
        }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
          className: "hvnly--builder---api_property__builder___enhanced_preview_card_rating_value"
        }, field.value?.value || 4.5), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
          className: "hvnly--builder---api_property__builder___enhanced_preview_card_rating_reviews"
        }, "(", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('120 reviews', 'havenlytics'), ")"));
      case 'views':
        return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
          className: "hvnly--builder---api_property__builder___enhanced_preview_card_views"
        }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
          className: "fas fa-eye"
        }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.count || 245, " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('views', 'havenlytics')));
      default:
        return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.text || field.label);
    }
  }

  // Handle all other areas with existing code
  switch (field.type) {
    case 'image':
      if (area === 'avatar') {
        return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
          className: "hvnly--builder---api_property__builder___enhanced_preview_card_avatar"
        }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
          className: "fas fa-user"
        }));
      }
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_image_bg"
      });
    case 'carousel':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_image_bg"
      });
    case 'badge':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_tag"
      }, field.value?.text);
    case 'favorite':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_favorite"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: `fas fa-heart ${field.value?.isFavorite ? 'active' : ''}`
      }));
    case 'share':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_share"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-share-alt"
      }));
    case 'title':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h3", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_title"
      }, field.value?.text);
    case 'rating':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_rating"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_stars"
      }, [...Array(5)].map((_, i) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        key: i,
        className: `fas fa-star ${i < Math.floor(field.value?.value || 0) ? 'filled' : ''}`
      }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_rating_value"
      }, field.value?.value), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_rating_reviews"
      }, "(", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('120 reviews', 'havenlytics'), ")"));
    case 'phone':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_detail_item"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_detail_icon"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-phone"
      })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.number));
    case 'email':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_detail_item"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_detail_icon"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-envelope"
      })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.address));
    case 'website':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_detail_item"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_detail_icon"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-globe"
      })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.url));
    case 'datetime':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_detail_item"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_detail_icon"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-clock"
      })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.text));
    case 'property_type':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_property_type"
      }, field.value?.text || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Property Type', 'havenlytics'));
    case 'views':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_views"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-eye"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.count || 0, " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('views', 'havenlytics')));
    case 'price':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_price"
      }, "$", field.value?.value || '0');
    case 'price-per-sqft':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, "$", field.value?.value || '0', "/sq ft");
    case 'beds':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_feature_item"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-bed"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.value || '0', " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Beds', 'havenlytics')));
    case 'baths':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_feature_item"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-bath"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.value || '0', " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Baths', 'havenlytics')));
    case 'receptions':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_feature_item"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-door-open"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.value || '0', " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Receptions', 'havenlytics')));
    case 'sqft':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_feature_item"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-ruler-combined"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.value || '0', " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('sq ft', 'havenlytics')));
    case 'view-btn':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_button hvnly--builder---api_property__builder___enhanced_preview_card_primary_btn"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-external-link-alt"
      }), " ", field.value?.text || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('View Property', 'havenlytics'));
    case 'schedule-tour-button':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_button hvnly--builder---api_property__builder___enhanced_preview_card_primary_btn"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-calendar-alt"
      }), " ", field.value?.text || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Schedule Tour', 'havenlytics'));
    case 'feature':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_feature_item"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: `fas fa-${field.value?.icon || 'star'}`
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.label || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Feature', 'havenlytics')));
    case 'excerpt':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_excerpt"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, field.value?.text || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Property excerpt', 'havenlytics')));
    case 'location':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_location"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-map-marker-alt"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.text || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Property location', 'havenlytics')));
    case 'kitchens':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_feature_item"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-utensils"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.value || '0', " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Kitchens', 'havenlytics')));
    case 'floor':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_feature_item"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-layer-group"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.value || '0', " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Floor', 'havenlytics')));
    case 'rooms':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_feature_item"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-door-closed"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.value || '0', " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Rooms', 'havenlytics')));
    case 'gsft':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_feature_item"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-warehouse"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.value || '0', " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Gsq ft', 'havenlytics')));
    case 'status':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
        className: `hvnly--builder---api_property__builder___enhanced_preview_card_status hvnly-status-${field.value?.color || 'green'}`
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-circle"
      }), " ", field.value?.text || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Status', 'havenlytics'));
    case 'time':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
        className: "hvnly--builder---api_property__builder___enhanced_preview_card_time"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-clock"
      }), " ", field.value?.text || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Time', 'havenlytics'));
    default:
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.text || field.label);
  }
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EnhancedPreviewFieldContent);

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/components/fields/FieldContent/PreviewFieldContent.js":
/*!**************************************************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/components/fields/FieldContent/PreviewFieldContent.js ***!
  \**************************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);


const PreviewFieldContent = ({
  field,
  area
}) => {
  switch (field.type) {
    case 'image':
      if (area === 'avatar') {
        return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
          className: "hvnly--builder---api_property__builder___single_page_card_avatar"
        }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
          className: "fas fa-user"
        }));
      }
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___preview_card_image_bg"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-image"
      }));
    case 'carousel':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___preview_card_image_bg"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-images"
      }));
    case 'badge':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
        className: "hvnly--builder---api_property__builder___preview_card_tag"
      }, field.value?.text);
    case 'favorite':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: `fas fa-heart ${field.value?.isFavorite ? 'active' : ''}`
      });
    case 'title':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h3", {
        className: "hvnly--builder---api_property__builder___preview_card_title"
      }, field.value?.text);
    case 'rating':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___preview_card_rating"
      }, [...Array(5)].map((_, i) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        key: i,
        className: `fas fa-star ${i < Math.floor(field.value?.value || 0) ? 'filled' : ''}`
      })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.value, " (", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('120 reviews', 'havenlytics'), ")"));
    case 'phone':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___single_page_card_detail_item"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-phone"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.number));
    case 'email':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___single_page_card_detail_item"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-envelope"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.address));
    case 'website':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___single_page_card_detail_item"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-globe"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.url));
    case 'datetime':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___single_page_card_detail_item"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-clock"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.text));
    case 'property_type':
      return field.value?.text || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Property Type', 'havenlytics');
    case 'views':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
        className: "hvnly--builder---api_property__builder___preview_card_views"
      }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: "fas fa-eye"
      }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.count || 0, " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('views', 'havenlytics')));
    case 'price':
      return `$${field.value?.value || '0'}`;
    case 'price-per-sqft':
      return `$${field.value?.value || '0'}/sq ft`;
    case 'beds':
      return `${field.value?.value || '0'} ${(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Beds', 'havenlytics')}`;
    case 'baths':
      return `${field.value?.value || '0'} ${(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Baths', 'havenlytics')}`;
    case 'receptions':
      return `${field.value?.value || '0'} ${(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Receptions', 'havenlytics')}`;
    case 'sqft':
      return `${field.value?.value || '0'} ${(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Sq ft', 'havenlytics')}`;
    case 'kitchens':
      return `${field.value?.value || '0'} ${(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Kitchens', 'havenlytics')}`;
    case 'floor':
      return `${field.value?.value || '0'} ${(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Floor', 'havenlytics')}`;
    case 'rooms':
      return `${field.value?.value || '0'} ${(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Rooms', 'havenlytics')}`;
    case 'gsft':
      return `${field.value?.value || '0'} ${(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Gsq ft', 'havenlytics')}`;
    case 'view-btn':
      if (area === 'footer-left') {
        return `${field.value?.text || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('View Property', 'havenlytics')}`;
      }
      return field.value?.text || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('View Property', 'havenlytics');
    case 'schedule-tour-button':
      if (area === 'footer-left') {
        return `${field.value?.text || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Schedule Tour', 'havenlytics')}`;
      }
      return field.value?.text || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Schedule Tour', 'havenlytics');
    case 'feature':
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
        className: `fas fa-${field.value?.icon || 'star'}`
      }), " ", field.value?.label || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Feature', 'havenlytics'));
    case 'excerpt':
      return field.value?.text || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Excerpt', 'havenlytics');
    case 'location':
      return field.value?.text || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Location', 'havenlytics');
    case 'status':
      return `${field.value?.text || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Status', 'havenlytics')}`;
    case 'time':
      return `${field.value?.text || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Time', 'havenlytics')}`;
    default:
      return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, field.value?.text || field.label);
  }
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PreviewFieldContent);

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/components/fields/FieldRenderer.js":
/*!*******************************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/components/fields/FieldRenderer.js ***!
  \*******************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _FieldContent_EditFieldContent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./FieldContent/EditFieldContent */ "./src/builder/components/TabContent/PropertyCard/components/fields/FieldContent/EditFieldContent.js");
/* harmony import */ var _FieldContent_EnhancedPreviewFieldContent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./FieldContent/EnhancedPreviewFieldContent */ "./src/builder/components/TabContent/PropertyCard/components/fields/FieldContent/EnhancedPreviewFieldContent.js");
/* harmony import */ var _FieldContent_PreviewFieldContent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./FieldContent/PreviewFieldContent */ "./src/builder/components/TabContent/PropertyCard/components/fields/FieldContent/PreviewFieldContent.js");




const FieldRenderer = ({
  field,
  onEdit,
  onDelete,
  onMoveUp,
  onMoveDown,
  canMoveUp,
  canMoveDown,
  isMoving,
  mode = 'edit',
  area
}) => {
  // Special handling for avatar area to show icon
  const renderAvatarContent = () => {
    if (area === 'avatar') {
      if (mode === 'edit') {
        return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
          className: "hvnly--builder---api_property__builder___avatar_with_icon"
        }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
          className: "hvnly--builder---api_property__builder___single_page_card_avatar"
        }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
          className: "fas fa-user"
        })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_FieldContent_EditFieldContent__WEBPACK_IMPORTED_MODULE_1__["default"], {
          field: field,
          onEdit: onEdit,
          onDelete: onDelete,
          onMoveUp: onMoveUp,
          onMoveDown: onMoveDown,
          canMoveUp: canMoveUp,
          canMoveDown: canMoveDown,
          isMoving: isMoving
        }));
      } else if (mode === 'enhanced-preview') {
        return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
          className: "hvnly--builder---api_property__builder___avatar_with_icon"
        }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
          className: "hvnly--builder---api_property__builder___enhanced_preview_card_avatar"
        }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
          className: "fas fa-user"
        })));
      }
    }

    // Default rendering for other areas
    const renderContent = () => {
      switch (mode) {
        case 'preview':
          return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_FieldContent_PreviewFieldContent__WEBPACK_IMPORTED_MODULE_3__["default"], {
            field: field,
            area: area
          });
        case 'enhanced-preview':
          return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_FieldContent_EnhancedPreviewFieldContent__WEBPACK_IMPORTED_MODULE_2__["default"], {
            field: field,
            area: area
          });
        default:
          return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_FieldContent_EditFieldContent__WEBPACK_IMPORTED_MODULE_1__["default"], {
            field: field,
            onEdit: onEdit,
            onDelete: onDelete,
            onMoveUp: onMoveUp,
            onMoveDown: onMoveDown,
            canMoveUp: canMoveUp,
            canMoveDown: canMoveDown,
            isMoving: isMoving
          });
      }
    };
    return renderContent();
  };
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "field-renderer"
  }, renderAvatarContent());
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FieldRenderer);

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/components/layout/CardEditor.css":
/*!*****************************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/components/layout/CardEditor.css ***!
  \*****************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/components/layout/CardEditor.js":
/*!****************************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/components/layout/CardEditor.js ***!
  \****************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../areas/AreaRenderer */ "./src/builder/components/TabContent/PropertyCard/components/areas/AreaRenderer.js");
/* harmony import */ var _CardEditor_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CardEditor.css */ "./src/builder/components/TabContent/PropertyCard/components/layout/CardEditor.css");




const CardEditor = ({
  sections,
  onOpenModal,
  onEditField,
  onDeleteField,
  onMoveFieldUp,
  onMoveFieldDown
}) => {
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder__left-panel"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h2", {
    className: "hvnly--builder---api_property__builder__section-title"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Property Card Builder', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder__card__container"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___preview_section"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___single_page_card"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___single_page_card_header"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
    area: "thumbnail",
    sections: sections,
    onOpenModal: onOpenModal,
    onEditField: onEditField,
    onDeleteField: onDeleteField,
    onMoveFieldUp: onMoveFieldUp,
    onMoveFieldDown: onMoveFieldDown
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___single_page_card_corner hvnly--builder---api_property__builder___single_page_card_top_left"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
    area: "top-left",
    sections: sections,
    onOpenModal: onOpenModal,
    onEditField: onEditField,
    onDeleteField: onDeleteField,
    onMoveFieldUp: onMoveFieldUp,
    onMoveFieldDown: onMoveFieldDown
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___single_page_card_corner hvnly--builder---api_property__builder___single_page_card_top_right"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
    area: "top-right",
    sections: sections,
    onOpenModal: onOpenModal,
    onEditField: onEditField,
    onDeleteField: onDeleteField,
    onMoveFieldUp: onMoveFieldUp,
    onMoveFieldDown: onMoveFieldDown
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___single_page_card_corner hvnly--builder---api_property__builder___single_page_card_bottom_left"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
    area: "bottom-left",
    sections: sections,
    onOpenModal: onOpenModal,
    onEditField: onEditField,
    onDeleteField: onDeleteField,
    onMoveFieldUp: onMoveFieldUp,
    onMoveFieldDown: onMoveFieldDown
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___single_page_card_corner hvnly--builder---api_property__builder___single_page_card_bottom_right"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
    area: "bottom-right",
    sections: sections,
    onOpenModal: onOpenModal,
    onEditField: onEditField,
    onDeleteField: onDeleteField,
    onMoveFieldUp: onMoveFieldUp,
    onMoveFieldDown: onMoveFieldDown
  }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___single_page_card_body"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___avatar_title_container"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
    area: "avatar",
    sections: sections,
    onOpenModal: onOpenModal,
    onEditField: onEditField,
    onDeleteField: onDeleteField,
    onMoveFieldUp: onMoveFieldUp,
    onMoveFieldDown: onMoveFieldDown
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
    area: "title",
    sections: sections,
    onOpenModal: onOpenModal,
    onEditField: onEditField,
    onDeleteField: onDeleteField,
    onMoveFieldUp: onMoveFieldUp,
    onMoveFieldDown: onMoveFieldDown
  })), ['excerpt', 'features', 'content'].map(area => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
    key: area,
    area: area,
    sections: sections,
    onOpenModal: onOpenModal,
    onEditField: onEditField,
    onDeleteField: onDeleteField,
    onMoveFieldUp: onMoveFieldUp,
    onMoveFieldDown: onMoveFieldDown
  }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___single_page_card_footer"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___single_page_card_footer_left"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
    area: "footer-left",
    sections: sections,
    onOpenModal: onOpenModal,
    onEditField: onEditField,
    onDeleteField: onDeleteField,
    onMoveFieldUp: onMoveFieldUp,
    onMoveFieldDown: onMoveFieldDown
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___single_page_card_footer_right"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
    area: "footer-right",
    sections: sections,
    onOpenModal: onOpenModal,
    onEditField: onEditField,
    onDeleteField: onDeleteField,
    onMoveFieldUp: onMoveFieldUp,
    onMoveFieldDown: onMoveFieldDown
  })))))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CardEditor);

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/components/layout/CardPreview.css":
/*!******************************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/components/layout/CardPreview.css ***!
  \******************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/components/layout/CardPreview.js":
/*!*****************************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/components/layout/CardPreview.js ***!
  \*****************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _preview_PreviewCard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../preview/PreviewCard */ "./src/builder/components/TabContent/PropertyCard/components/preview/PreviewCard.js");
/* harmony import */ var _CardPreview_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CardPreview.css */ "./src/builder/components/TabContent/PropertyCard/components/layout/CardPreview.css");




const CardPreview = ({
  sections,
  variant = 'enhanced'
}) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder__right-panel"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h2", {
  className: "hvnly--builder---api_property__builder__section-title"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Property Card Preview', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder___enhanced_card_preview_container"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder___enhanced_card_preview"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_preview_PreviewCard__WEBPACK_IMPORTED_MODULE_2__["default"], {
  sections: sections,
  variant: variant
}))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CardPreview);

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/components/modals/FieldModal.js":
/*!****************************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/components/modals/FieldModal.js ***!
  \****************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _constants_modalOptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/modalOptions */ "./src/builder/components/TabContent/PropertyCard/constants/modalOptions.js");
/* harmony import */ var _FieldOptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./FieldOptions */ "./src/builder/components/TabContent/PropertyCard/components/modals/FieldOptions.js");
/* harmony import */ var _ModalHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ModalHeader */ "./src/builder/components/TabContent/PropertyCard/components/modals/ModalHeader.js");
/* harmony import */ var _ModalOverlay__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ModalOverlay */ "./src/builder/components/TabContent/PropertyCard/components/modals/ModalOverlay.js");
/* harmony import */ var _constants_areaMappings__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../constants/areaMappings */ "./src/builder/components/TabContent/PropertyCard/constants/areaMappings.js");







// Import AREA_TO_SECTION_ID

const FieldModal = ({
  isOpen,
  area,
  editingField,
  onClose,
  onFieldSelect,
  cardSections
}) => {
  if (!isOpen) return null;

  // Get all modal options for this area
  const allModalOptions = area ? _constants_modalOptions__WEBPACK_IMPORTED_MODULE_2__.MODAL_OPTIONS[area] || [] : [];

  // Get used field types in the current area
  const getUsedFieldTypes = () => {
    if (!area || !cardSections) return [];

    // Find the section ID for this area
    const sectionId = Object.entries(_constants_areaMappings__WEBPACK_IMPORTED_MODULE_6__.AREA_TO_SECTION_ID).find(([areaKey, sectionId]) => areaKey === area)?.[1];
    if (!sectionId) return [];
    const section = cardSections.find(s => s.id === sectionId);
    if (!section) return [];
    return section.fields.map(field => field.type);
  };
  const usedFieldTypes = getUsedFieldTypes();

  // NEW: Updated logic for button restrictions
  const getAvailableModalOptions = () => {
    if (editingField) {
      // EDIT MODE: Show only unused fields (excluding the current field being edited)
      // Special handling for button types
      if (editingField.type === 'view-btn' || editingField.type === 'schedule-tour-button') {
        // When editing a button, show all options including the other button type
        return allModalOptions.filter(option => !usedFieldTypes.some(usedType => usedType === option.id && option.id !== editingField.type));
      } else {
        // Normal edit mode for non-button fields
        return allModalOptions.filter(option => !usedFieldTypes.some(usedType => usedType === option.id && option.id !== editingField.type));
      }
    } else {
      // ADD MODE: Normal logic with button restrictions
      // Check if a button already exists in footer areas
      const hasButton = usedFieldTypes.some(type => type === 'view-btn' || type === 'schedule-tour-button');

      // Apply button restriction only for footer areas
      if ((area === 'footer-left' || area === 'footer-right') && hasButton) {
        // If button exists in footer area, hide both button options
        return allModalOptions.filter(option => option.id !== 'view-btn' && option.id !== 'schedule-tour-button' && !usedFieldTypes.includes(option.id));
      }

      // For thumbnail area, check if image or carousel already exists
      if (area === 'thumbnail') {
        const hasImageType = usedFieldTypes.some(type => type === 'image' || type === 'carousel');
        if (hasImageType) {
          // If image type exists, hide both image and carousel options
          return allModalOptions.filter(option => option.id !== 'image' && option.id !== 'carousel' && !usedFieldTypes.includes(option.id));
        }
      }

      // No restrictions apply, show all available options
      return allModalOptions.filter(option => !usedFieldTypes.includes(option.id));
    }
  };
  const availableModalOptions = getAvailableModalOptions();

  // NEW: Check if thumbnail has image type for special message
  const hasThumbnailImageType = area === 'thumbnail' && usedFieldTypes.some(type => type === 'image' || type === 'carousel');

  // Check if footer area already has a button
  const hasFooterButton = (area === 'footer-left' || area === 'footer-right') && usedFieldTypes.some(type => type === 'view-btn' || type === 'schedule-tour-button');

  // Get modal title based on mode
  const getModalTitle = () => {
    if (editingField) {
      return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Replace Field:', 'havenlytics') + ` ${editingField.label}`;
    } else {
      return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Insert Element -', 'havenlytics') + ` ${area}`;
    }
  };
  const handleFieldSelect = option => {
    onFieldSelect(option);
    // Close modal after selection in edit mode
    if (editingField) {
      onClose();
    }
    // Don't close modal automatically after selection in add mode
  };
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_ModalOverlay__WEBPACK_IMPORTED_MODULE_5__["default"], {
    onClose: onClose
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___option_card"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_ModalHeader__WEBPACK_IMPORTED_MODULE_4__["default"], {
    title: getModalTitle(),
    onClose: onClose
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___option_card_body"
  }, editingField && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___edit_mode_info"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-exchange-alt"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Select a field type to replace', 'havenlytics'), " \"", editingField.label, "\"")), area === 'thumbnail' && hasThumbnailImageType && !editingField && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___thumbnail_restriction_message"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-info-circle"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Only one image type allowed. Remove current image to select a different type.', 'havenlytics'))), (area === 'footer-left' || area === 'footer-right') && hasFooterButton && !editingField && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___button_restriction_message"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-info-circle"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Only one button allowed in this area. Remove current button to select a different one.', 'havenlytics'))), availableModalOptions.length > 0 ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_FieldOptions__WEBPACK_IMPORTED_MODULE_3__["default"], {
    options: availableModalOptions,
    onSelect: handleFieldSelect
  }) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___no_options"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-check-circle"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, editingField ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("No available fields to replace with. All other field types are already used in this area.", "havenlytics") : area === 'thumbnail' && hasThumbnailImageType ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Image type already selected. Remove it to choose a different type.", "havenlytics") : (area === 'footer-left' || area === 'footer-right') && hasFooterButton ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Button already selected. Remove it to choose a different button type.", "havenlytics") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("All available fields have been added to this area", "havenlytics")), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("small", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Remove some fields to see more options", "havenlytics"))), editingField && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___field_editor_actions"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: "hvnly--builder---api_property__builder___field_editor_btn hvnly--builder---api_property__builder___field_editor_cancel_btn",
    onClick: onClose
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cancel', 'havenlytics'))))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FieldModal);

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/components/modals/FieldOption.js":
/*!*****************************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/components/modals/FieldOption.js ***!
  \*****************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);

const FieldOption = ({
  option,
  onSelect
}) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder___field_option",
  onClick: () => onSelect(option)
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder___field_icon"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
  className: `fas fa-${option.icon}`
})), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder___field_info"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h4", null, option.title), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, option.description)));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FieldOption);

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/components/modals/FieldOptions.js":
/*!******************************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/components/modals/FieldOptions.js ***!
  \******************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _FieldOption__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./FieldOption */ "./src/builder/components/TabContent/PropertyCard/components/modals/FieldOption.js");



const FieldOptions = ({
  options,
  onSelect
}) => {
  if (options.length === 0) {
    return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
      className: "hvnly--builder---api_property__builder___info_text"
    }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Nothing available', 'havenlytics'));
  }
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___field_options"
  }, options.map(option => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_FieldOption__WEBPACK_IMPORTED_MODULE_2__["default"], {
    key: option.id,
    option: option,
    onSelect: onSelect
  })));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FieldOptions);

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/components/modals/ModalHeader.js":
/*!*****************************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/components/modals/ModalHeader.js ***!
  \*****************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);

const ModalHeader = ({
  title,
  onClose
}) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder___option_card_header"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder___option_card_header_title_section"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h3", {
  className: "hvnly--builder---api_property__builder___option_card_header_title"
}, title), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder___header_action_area"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
  className: "hvnly--builder---api_property__builder___header_action_link hvnly--builder---api_property__builder___header_action_close",
  onClick: onClose
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
  className: "fas fa-times"
})))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ModalHeader);

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/components/modals/ModalOverlay.js":
/*!******************************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/components/modals/ModalOverlay.js ***!
  \******************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);


const ModalOverlay = ({
  children,
  onClose
}) => {
  const modalRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
  const [isDragging, setIsDragging] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  const [position, setPosition] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)({
    x: 0,
    y: 0
  });
  const dragStartRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)({
    x: 0,
    y: 0
  });
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    const handleEscapeKey = event => {
      if (event.key === 'Escape') {
        onClose();
      }
    };
    const handleMouseMove = event => {
      if (isDragging) {
        const deltaX = event.clientX - dragStartRef.current.x;
        const deltaY = event.clientY - dragStartRef.current.y;
        setPosition(prev => ({
          x: prev.x + deltaX,
          y: prev.y + deltaY
        }));
        dragStartRef.current = {
          x: event.clientX,
          y: event.clientY
        };
      }
    };
    const handleMouseUp = () => {
      setIsDragging(false);
    };

    // REMOVED: Click outside handler
    document.addEventListener('keydown', handleEscapeKey);
    document.addEventListener('mousemove', handleMouseMove);
    document.addEventListener('mouseup', handleMouseUp);
    document.body.style.overflow = 'hidden';
    return () => {
      document.removeEventListener('keydown', handleEscapeKey);
      document.removeEventListener('mousemove', handleMouseMove);
      document.removeEventListener('mouseup', handleMouseUp);
      document.body.style.overflow = 'unset';
    };
  }, [onClose, isDragging]);
  const handleHeaderMouseDown = event => {
    if (event.target.closest('.hvnly--builder---api_property__builder___header_action_link')) {
      return;
    }
    setIsDragging(true);
    dragStartRef.current = {
      x: event.clientX,
      y: event.clientY
    };
    event.preventDefault();
  };
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___widget_insert_modal_container active"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    ref: modalRef,
    className: "hvnly--builder---api_property__builder___option_card",
    style: {
      transform: `translate(calc(-50% + ${position.x}px), calc(-50% + ${position.y}px))`,
      cursor: isDragging ? 'grabbing' : 'default'
    }
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___option_card_header",
    onMouseDown: handleHeaderMouseDown,
    style: {
      cursor: 'move'
    }
  }, React.Children.toArray(children)[0]), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___option_card_body"
  }, React.Children.toArray(children)[1])));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ModalOverlay);

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/components/preview/BasicPreviewCard.js":
/*!***********************************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/components/preview/BasicPreviewCard.js ***!
  \***********************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../areas/AreaRenderer */ "./src/builder/components/TabContent/PropertyCard/components/areas/AreaRenderer.js");



const AREA_LABELS = {
  'price-details': (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Price Details', 'havenlytics'),
  'schedule-tour': (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Schedule Tour', 'havenlytics'),
  'features': (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Features', 'havenlytics'),
  'excerpt': (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Excerpt', 'havenlytics'),
  'location': (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Location', 'havenlytics')
};
const BasicPreviewCard = ({
  sections,
  onOpenModal,
  onEditField,
  onDeleteField
}) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder___single_page_card"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder___single_page_card_header"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
  area: "thumbnail",
  sections: sections,
  onOpenModal: onOpenModal,
  onEditField: onEditField,
  onDeleteField: onDeleteField,
  mode: "preview"
}), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder___single_page_card_corner hvnly--builder---api_property__builder___single_page_card_top_left"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
  area: "top-left",
  sections: sections,
  onOpenModal: onOpenModal,
  onEditField: onEditField,
  onDeleteField: onDeleteField,
  mode: "preview"
})), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder___single_page_card_corner hvnly--builder---api_property__builder___single_page_card_top_right"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
  area: "top-right",
  sections: sections,
  onOpenModal: onOpenModal,
  onEditField: onEditField,
  onDeleteField: onDeleteField,
  mode: "preview"
})), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder___single_page_card_corner hvnly--builder---api_property__builder___single_page_card_bottom_left"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
  area: "bottom-left",
  sections: sections,
  onOpenModal: onOpenModal,
  onEditField: onEditField,
  onDeleteField: onDeleteField,
  mode: "preview"
})), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder___single_page_card_corner hvnly--builder---api_property__builder___single_page_card_bottom_right"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
  area: "bottom-right",
  sections: sections,
  onOpenModal: onOpenModal,
  onEditField: onEditField,
  onDeleteField: onDeleteField,
  mode: "preview"
}))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder___single_page_card_body"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
  area: "avatar",
  sections: sections,
  onOpenModal: onOpenModal,
  onEditField: onEditField,
  onDeleteField: onDeleteField,
  mode: "preview"
}), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder___editable_area"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
  className: "hvnly--builder---api_property__builder___area_label"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Title Area', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder___single_page_card_title_area"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
  area: "title",
  sections: sections,
  mode: "preview"
}))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder___editable_area"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
  className: "hvnly--builder---api_property__builder___area_label"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Content Area', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder___single_page_card_content_area"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
  area: "content",
  sections: sections,
  mode: "preview"
}))), ['price-details', 'schedule-tour', 'features', 'excerpt', 'location'].map(area => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  key: area,
  className: "hvnly--builder---api_property__builder___editable_area"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
  className: "hvnly--builder---api_property__builder___area_label"
}, AREA_LABELS[area]), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: `hvnly--builder---api_property__builder___single_page_card_${area.replace('-', '_')}_area`
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
  area: area,
  sections: sections,
  mode: "preview"
}))))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder___single_page_card_footer"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder___single_page_card_footer_left"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
  area: "footer-left",
  sections: sections,
  mode: "preview"
})), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  className: "hvnly--builder---api_property__builder___single_page_card_footer_right"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
  area: "footer-right",
  sections: sections,
  mode: "preview"
}))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BasicPreviewCard);

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/components/preview/EnhancedPreviewCard.js":
/*!**************************************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/components/preview/EnhancedPreviewCard.js ***!
  \**************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../areas/AreaRenderer */ "./src/builder/components/TabContent/PropertyCard/components/areas/AreaRenderer.js");



const EnhancedPreviewCard = ({
  sections
}) => {
  const [isImageLoaded, setIsImageLoaded] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);

  // Simple image load detection
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    const image = new Image();
    image.src = 'https://images.unsplash.com/photo-1600585154340-be6161a56a0c?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1000&q=80';
    image.onload = () => {
      setIsImageLoaded(true);
    };
    image.onerror = () => {
      setIsImageLoaded(true);
    };

    // Fallback
    const fallbackTimer = setTimeout(() => {
      setIsImageLoaded(true);
    }, 3000);
    return () => {
      clearTimeout(fallbackTimer);
    };
  }, []);
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___enhanced_preview_card"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___enhanced_preview_card_image_section"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: `hvnly--builder---api_property__builder___enhanced_preview_card_image ${!isImageLoaded ? 'loading' : ''}`
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___enhanced_preview_card_image_bg"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
    area: "thumbnail",
    sections: sections,
    mode: "enhanced-preview"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___enhanced_preview_card_image_overlay_top"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___enhanced_preview_card_image_left"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
    area: "top-left",
    sections: sections,
    mode: "enhanced-preview"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___enhanced_preview_card_image_right"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
    area: "top-right",
    sections: sections,
    mode: "enhanced-preview"
  }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___enhanced_preview_card_image_overlay_bottom"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___enhanced_preview_card_image_left"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
    area: "bottom-left",
    sections: sections,
    mode: "enhanced-preview"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___enhanced_preview_card_image_right"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
    area: "bottom-right",
    sections: sections,
    mode: "enhanced-preview"
  }))))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___enhanced_preview_card_body"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___enhanced_preview_card_header"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
    area: "avatar",
    sections: sections,
    mode: "enhanced-preview"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___enhanced_preview_card_title_section"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
    area: "title",
    sections: sections,
    mode: "enhanced-preview"
  }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
    area: "excerpt",
    sections: sections,
    mode: "enhanced-preview"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___enhanced_preview_card_features"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
    area: "features",
    sections: sections,
    mode: "enhanced-preview"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___enhanced_preview_card_content_area"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
    area: "content",
    sections: sections,
    mode: "enhanced-preview"
  }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___enhanced_preview_card_footer"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___enhanced_preview_card_footer_left"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
    area: "footer-left",
    sections: sections,
    mode: "enhanced-preview"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder---api_property__builder___enhanced_preview_card_footer_right"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_areas_AreaRenderer__WEBPACK_IMPORTED_MODULE_2__["default"], {
    area: "footer-right",
    sections: sections,
    mode: "enhanced-preview"
  }))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EnhancedPreviewCard);

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/components/preview/PreviewCard.js":
/*!******************************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/components/preview/PreviewCard.js ***!
  \******************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _BasicPreviewCard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BasicPreviewCard */ "./src/builder/components/TabContent/PropertyCard/components/preview/BasicPreviewCard.js");
/* harmony import */ var _EnhancedPreviewCard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./EnhancedPreviewCard */ "./src/builder/components/TabContent/PropertyCard/components/preview/EnhancedPreviewCard.js");



const PreviewCard = ({
  sections,
  variant = 'default',
  onOpenModal,
  onEditField,
  onDeleteField
}) => {
  if (variant === 'enhanced') {
    return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_EnhancedPreviewCard__WEBPACK_IMPORTED_MODULE_2__["default"], {
      sections: sections
    });
  }
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_BasicPreviewCard__WEBPACK_IMPORTED_MODULE_1__["default"], {
    sections: sections,
    onOpenModal: onOpenModal,
    onEditField: onEditField,
    onDeleteField: onDeleteField
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PreviewCard);

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/constants/areaMappings.js":
/*!**********************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/constants/areaMappings.js ***!
  \**********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AREA_LABELS: () => (/* binding */ AREA_LABELS),
/* harmony export */   AREA_TO_SECTION_ID: () => (/* binding */ AREA_TO_SECTION_ID)
/* harmony export */ });
const AREA_TO_SECTION_ID = {
  'thumbnail': 'thumbnail',
  'top-left': 'image-overlay-top-left',
  'top-right': 'image-overlay-top-right',
  'bottom-left': 'image-overlay-bottom-left',
  'bottom-right': 'image-overlay-bottom-right',
  'avatar': 'avatar',
  'title': 'card-title',
  'content': 'card-content',
  'footer-left': 'card-footer-left',
  'footer-right': 'card-footer-right',
  // 'price-details': 'price-details',
  'schedule-tour': 'schedule-tour',
  'features': 'features',
  'excerpt': 'excerpt',
  'location': 'location'
};
const AREA_LABELS = {
  'thumbnail': 'Thumbnail',
  'top-left': 'Top Left',
  'top-right': 'Top Right',
  'bottom-left': 'Bottom Left',
  'bottom-right': 'Bottom Right',
  'avatar': 'Avatar',
  'title': 'Title Area',
  'content': 'Content Area',
  'footer-left': 'Footer Left',
  'footer-right': 'Footer Right',
  // 'price-details': 'Price Details',
  'schedule-tour': 'Schedule Tour',
  'features': 'Features',
  'excerpt': 'Excerpt',
  'location': 'Location'
};

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/constants/fieldTypes.js":
/*!********************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/constants/fieldTypes.js ***!
  \********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   FIELD_CONFIGS: () => (/* binding */ FIELD_CONFIGS),
/* harmony export */   FIELD_MODES: () => (/* binding */ FIELD_MODES),
/* harmony export */   FIELD_TYPES: () => (/* binding */ FIELD_TYPES)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);

const FIELD_TYPES = {
  IMAGE: 'image',
  CAROUSEL: 'carousel',
  BADGE: 'badge',
  STATUS: 'status',
  TIME: 'time',
  FAVORITE: 'favorite',
  SHARE: 'share',
  VIEWS: 'views',
  TITLE: 'title',
  RATING: 'rating',
  PHONE: 'phone',
  EMAIL: 'email',
  WEBSITE: 'website',
  ADDRESS: 'address',
  DATETIME: 'datetime',
  PRICE: 'price',
  PRICE_PER_SQFT: 'price-per-sqft',
  BEDS: 'beds',
  BATHS: 'baths',
  KITCHENS: 'kitchens',
  FLOOR: 'floor',
  ROOMS: 'rooms',
  RECEPTIONS: 'receptions',
  SQFT: 'sqft',
  GSFT: 'gsft',
  BUTTON: 'button',
  VIEW_BUTTON: 'view-btn',
  // NEW: Separate button type for View Property
  SCHEDULE_TOUR_BUTTON: 'schedule-tour-button',
  // NEW: Separate button type for Schedule Tour
  FEATURE: 'feature',
  EXCERPT: 'excerpt',
  LOCATION: 'location',
  SCHEDULE_TOUR: 'schedule-tour',
  PROPERTY_TYPE: 'property_type',
  AVATAR: 'avatar'
};

// Field modes for controlling display
const FIELD_MODES = {
  DEFAULT: 'default',
  PRESET: 'preset',
  BOTH: 'both'
};
const FIELD_CONFIGS = [{
  id: FIELD_TYPES.IMAGE,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Property Image', 'havenlytics'),
  icon: 'image',
  mode: FIELD_MODES.PRESET,
  defaultValue: {
    type: 'single',
    url: ''
  }
}, {
  id: FIELD_TYPES.CAROUSEL,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Image Carousel', 'havenlytics'),
  icon: 'images',
  mode: FIELD_MODES.PRESET,
  defaultValue: {
    type: 'carousel',
    images: []
  }
}, {
  id: FIELD_TYPES.BADGE,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Badge', 'havenlytics'),
  icon: 'tag',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Featured', 'havenlytics'),
    style: 'primary'
  } // Changed from "New Badge" to "Featured"
}, {
  id: FIELD_TYPES.SCHEDULE_TOUR,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Schedule Tour', 'havenlytics'),
  icon: 'calendar-alt',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Schedule Tour', 'havenlytics'),
    icon: 'calendar-alt'
  }
}, {
  id: FIELD_TYPES.STATUS,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Status', 'havenlytics'),
  icon: 'certificate',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Active', 'havenlytics'),
    color: 'green'
  }
}, {
  id: FIELD_TYPES.TIME,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Time', 'havenlytics'),
  icon: 'clock',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('2 days ago', 'havenlytics')
  }
}, {
  id: FIELD_TYPES.FAVORITE,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Favorite', 'havenlytics'),
  icon: 'heart',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    isFavorite: false
  }
}, {
  id: FIELD_TYPES.SHARE,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Share', 'havenlytics'),
  icon: 'share-alt',
  mode: FIELD_MODES.BOTH
}, {
  id: FIELD_TYPES.VIEWS,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Views', 'havenlytics'),
  icon: 'eye',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    count: 0
  }
}, {
  id: FIELD_TYPES.TITLE,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Title', 'havenlytics'),
  icon: 'heading',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Luxury Villa with Ocean View', 'havenlytics')
  }
}, {
  id: FIELD_TYPES.RATING,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Rating', 'havenlytics'),
  icon: 'star',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    value: 4.5,
    max: 5
  }
}, {
  id: FIELD_TYPES.PHONE,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Phone', 'havenlytics'),
  icon: 'phone',
  mode: FIELD_MODES.PRESET,
  defaultValue: {
    number: '+1 234 567 8900'
  }
}, {
  id: FIELD_TYPES.EMAIL,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Email', 'havenlytics'),
  icon: 'envelope',
  mode: FIELD_MODES.PRESET,
  defaultValue: {
    address: 'contact@example.com'
  }
}, {
  id: FIELD_TYPES.WEBSITE,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Website', 'havenlytics'),
  icon: 'globe',
  mode: FIELD_MODES.PRESET,
  defaultValue: {
    url: 'www.example.com'
  }
}, {
  id: FIELD_TYPES.ADDRESS,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Address', 'havenlytics'),
  icon: 'map-marker',
  mode: FIELD_MODES.PRESET,
  defaultValue: {
    text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('123 Main St, City', 'havenlytics')
  }
}, {
  id: FIELD_TYPES.DATETIME,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Date/Time', 'havenlytics'),
  icon: 'clock',
  mode: FIELD_MODES.PRESET,
  defaultValue: {
    text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Posted 2 days ago', 'havenlytics')
  }
}, {
  id: FIELD_TYPES.PRICE,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Price', 'havenlytics'),
  icon: 'dollar-sign',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    value: '1,250,000',
    currency: 'USD'
  }
}, {
  id: FIELD_TYPES.PRICE_PER_SQFT,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Price per Sq Ft', 'havenlytics'),
  icon: 'chart-line',
  mode: FIELD_MODES.PRESET,
  defaultValue: {
    value: '4,200',
    currency: 'USD'
  }
}, {
  id: FIELD_TYPES.BEDS,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Beds', 'havenlytics'),
  icon: 'bed',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    value: '3'
  }
}, {
  id: FIELD_TYPES.BATHS,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Baths', 'havenlytics'),
  icon: 'bath',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    value: '2'
  }
}, {
  id: FIELD_TYPES.RECEPTIONS,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Receptions', 'havenlytics'),
  icon: 'door-open',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    value: '2'
  }
}, {
  id: FIELD_TYPES.SQFT,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Square Feet', 'havenlytics'),
  icon: 'expand-arrows-alt',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    value: '2,980'
  }
},
// UPDATED: Changed from generic BUTTON to specific button types
{
  id: FIELD_TYPES.VIEW_BUTTON,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('View Property Button', 'havenlytics'),
  icon: 'external-link-alt',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('View Property', 'havenlytics'),
    style: 'primary',
    type: 'view-property'
  }
}, {
  id: FIELD_TYPES.SCHEDULE_TOUR_BUTTON,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Schedule Tour Button', 'havenlytics'),
  icon: 'calendar-alt',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Schedule Tour', 'havenlytics'),
    style: 'primary',
    type: 'schedule-tour'
  }
}, {
  id: FIELD_TYPES.FEATURE,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Feature', 'havenlytics'),
  icon: 'star',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    icon: 'swimming-pool',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Pool', 'havenlytics')
  }
}, {
  id: FIELD_TYPES.EXCERPT,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Excerpt', 'havenlytics'),
  icon: 'align-left',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Stunning oceanfront villa with panoramic views, modern amenities, and luxurious finishes. Features include infinity pool, home theater, and smart home technology.', 'havenlytics')
  }
}, {
  id: FIELD_TYPES.LOCATION,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Location', 'havenlytics'),
  icon: 'map-marker-alt',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('123 Ocean View Drive, Malibu, CA', 'havenlytics')
  }
}, {
  id: FIELD_TYPES.AVATAR,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Avatar', 'havenlytics'),
  icon: 'user-circle',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    type: 'avatar',
    url: ''
  }
}, {
  id: FIELD_TYPES.KITCHENS,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Kitchens', 'havenlytics'),
  icon: 'utensils',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    value: '1'
  }
}, {
  id: FIELD_TYPES.FLOOR,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Floor', 'havenlytics'),
  icon: 'layer-group',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    value: '1'
  }
}, {
  id: FIELD_TYPES.ROOMS,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Rooms', 'havenlytics'),
  icon: 'door-closed',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    value: '1'
  }
}, {
  id: FIELD_TYPES.PROPERTY_TYPE,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Property Type', 'havenlytics'),
  icon: 'home',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Villa', 'havenlytics'),
    style: 'secondary'
  }
}, {
  id: FIELD_TYPES.GSFT,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Gsq ft', 'havenlytics'),
  icon: 'warehouse',
  mode: FIELD_MODES.BOTH,
  defaultValue: {
    value: '50'
  }
}];

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/constants/initialSections.js":
/*!*************************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/constants/initialSections.js ***!
  \*************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   INITIAL_CARD_SECTIONS: () => (/* binding */ INITIAL_CARD_SECTIONS)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _fieldTypes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fieldTypes */ "./src/builder/components/TabContent/PropertyCard/constants/fieldTypes.js");


const INITIAL_CARD_SECTIONS = [{
  id: 'image-overlay-top-left',
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Image Overlay Left', 'havenlytics'),
  icon: 'tags',
  mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.PRESET,
  fields: [{
    id: 'tags-overlay',
    type: 'badge',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Badge', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.PRESET,
    value: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Featured', 'havenlytics'),
      style: 'primary'
    }
  }]
}, {
  id: 'image-overlay-top-right',
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Image Overlay Right', 'havenlytics'),
  icon: 'heart',
  mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.PRESET,
  fields: [{
    id: 'favorite-button',
    type: 'favorite',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Favorite Button', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.PRESET,
    value: {
      isFavorite: false
    }
  }]
}, {
  id: 'thumbnail',
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Thumbnail', 'havenlytics'),
  icon: 'image',
  mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.PRESET,
  fields: [{
    id: 'thumbnail-image',
    type: 'image',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Thumbnail Image', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.PRESET,
    value: {
      type: 'single',
      url: ''
    }
  }]
}, {
  id: 'image-overlay-bottom-left',
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Image Overlay Bottom Left', 'havenlytics'),
  icon: 'dollar-sign',
  mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.PRESET,
  fields: [{
    id: 'price-button',
    type: 'price',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Price', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.PRESET,
    value: {
      value: '1,250,000',
      currency: 'USD'
    }
  }]
}, {
  id: 'image-overlay-bottom-right',
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Image Overlay Bottom Right', 'havenlytics'),
  icon: 'share-alt',
  mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.PRESET,
  fields: [{
    id: 'share-button',
    type: 'share',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Share', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.PRESET,
    value: {}
  }]
}, {
  id: 'avatar',
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Avatar', 'havenlytics'),
  icon: 'user',
  mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
  fields: [{
    id: 'avatar-image',
    type: 'avatar',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Avatar', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
    value: {
      type: 'avatar',
      url: ''
    }
  }]
}, {
  id: 'card-title',
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Card Title', 'havenlytics'),
  icon: 'heading',
  mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
  fields: [{
    id: 'title-text',
    type: 'title',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Property Title', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
    value: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Luxury Villa with Ocean View', 'havenlytics')
    }
  }, {
    id: 'property-price',
    type: 'price',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Price', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
    value: {
      value: '1,250,000',
      currency: 'USD'
    }
  }, {
    id: 'rating-stars',
    type: 'rating',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Rating', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
    value: {
      value: 4.5,
      max: 5
    }
  }, {
    id: 'property-location',
    type: 'location',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Location', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
    value: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('123 Ocean View Drive, Malibu, CA', 'havenlytics')
    }
  }]
}, {
  id: 'card-content',
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Card Content', 'havenlytics'),
  icon: 'list',
  mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.PRESET,
  fields: [{
    id: 'phone-number',
    type: 'phone',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Phone', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.PRESET,
    value: {
      number: '+1 234 567 8900'
    }
  }, {
    id: 'email-address',
    type: 'email',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Email', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.PRESET,
    value: {
      address: 'contact@example.com'
    }
  }, {
    id: 'website-url',
    type: 'website',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Website', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.PRESET,
    value: {
      url: 'www.example.com'
    }
  }, {
    id: 'posted-time',
    type: 'datetime',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Date/Time', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.PRESET,
    value: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Posted 2 days ago', 'havenlytics')
    }
  }]
}, {
  id: 'schedule-tour',
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Schedule Tour', 'havenlytics'),
  icon: 'calendar-alt',
  mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
  fields: [{
    id: 'schedule-tour-button',
    type: 'button',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Button', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
    value: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Schedule Tour', 'havenlytics'),
      icon: 'calendar-alt'
    }
  }]
}, {
  id: 'features',
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Features', 'havenlytics'),
  icon: 'star',
  mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
  fields: [{
    id: 'feature-beds',
    type: 'beds',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Beds', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
    value: {
      value: '3'
    }
  }, {
    id: 'feature-baths',
    type: 'baths',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Baths', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
    value: {
      value: '2'
    }
  }, {
    id: 'feature-receptions',
    type: 'receptions',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Receptions', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
    value: {
      value: '2'
    }
  }, {
    id: 'feature-sqft',
    type: 'sqft',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Square Feet', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
    value: {
      value: '2,980'
    }
  }]
}, {
  id: 'excerpt',
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Excerpt', 'havenlytics'),
  icon: 'align-left',
  mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
  fields: [{
    id: 'property-excerpt',
    type: 'excerpt',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Excerpt', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
    value: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Stunning oceanfront villa with panoramic views, modern amenities, and luxurious finishes. Features include infinity pool, home theater, and smart home technology.', 'havenlytics')
    }
  }]
}, {
  id: 'location',
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Location', 'havenlytics'),
  icon: 'map-marker-alt',
  mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
  fields: [{
    id: 'property-location',
    type: 'location',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Location', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
    value: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('123 Ocean View Drive, Malibu, CA', 'havenlytics')
    }
  }]
}, {
  id: 'card-footer-left',
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Card Footer Left', 'havenlytics'),
  icon: 'folder',
  mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
  fields: [{
    id: 'view-property-button',
    type: 'view-btn',
    // Changed from 'button' to 'view-btn'
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('View Property Button', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
    value: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('View Property', 'havenlytics'),
      style: 'primary',
      type: 'view-property'
    }
  }, {
    id: 'property-badge',
    type: 'badge',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Badge', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
    value: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Featured', 'havenlytics'),
      style: 'secondary'
    } // Changed from "Villa" to "Featured"
  }, {
    id: 'property-status',
    type: 'status',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Status', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
    value: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Active', 'havenlytics'),
      color: 'green'
    }
  }, {
    id: 'posted-time',
    type: 'time',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Time', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
    value: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('2 days ago', 'havenlytics')
    }
  }]
}, {
  id: 'card-footer-right',
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Card Footer Right', 'havenlytics'),
  icon: 'eye',
  mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
  fields: [{
    id: 'share-button-footer',
    type: 'share',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Share', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
    value: {}
  }, {
    id: 'favorite-button-footer',
    type: 'favorite',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Favorite', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
    value: {
      isFavorite: false
    }
  }, {
    id: 'property-rating-footer',
    type: 'rating',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Rating', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
    value: {
      value: 4.5,
      max: 5
    }
  }, {
    id: 'view-count',
    type: 'views',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Views', 'havenlytics'),
    mode: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_MODES.BOTH,
    value: {
      count: 245
    }
  }]
}];

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/constants/modalOptions.js":
/*!**********************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/constants/modalOptions.js ***!
  \**********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   MODAL_OPTIONS: () => (/* binding */ MODAL_OPTIONS)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _fieldTypes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fieldTypes */ "./src/builder/components/TabContent/PropertyCard/constants/fieldTypes.js");


const MODAL_OPTIONS = {
  'thumbnail': [{
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.IMAGE,
    icon: 'image',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Single Image', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a single thumbnail image', 'havenlytics'),
    defaultValue: {
      type: 'single',
      url: ''
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.CAROUSEL,
    icon: 'images',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Image Carousel', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a carousel of images', 'havenlytics'),
    defaultValue: {
      type: 'carousel',
      images: []
    }
  }],
  'top-left': [{
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.BADGE,
    icon: 'tag',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Badge', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a badge element', 'havenlytics'),
    defaultValue: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Featured', 'havenlytics'),
      style: 'primary'
    }
  },
  // Changed to "Featured"
  {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.STATUS,
    icon: 'certificate',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Status', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a status indicator', 'havenlytics'),
    defaultValue: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Active', 'havenlytics'),
      color: 'green'
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.TIME,
    icon: 'clock',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Time', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a time element', 'havenlytics'),
    defaultValue: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('2 days ago', 'havenlytics')
    }
  }],
  'top-right': [{
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.FAVORITE,
    icon: 'heart',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Favorite', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a favorite button', 'havenlytics'),
    defaultValue: {
      isFavorite: false
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.SHARE,
    icon: 'share-alt',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Share', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a share button', 'havenlytics')
  }
  // { id: FIELD_TYPES.MENU, icon: 'ellipsis-v', title: __('Menu', 'havenlytics'), description: __('Add a options menu', 'havenlytics') }
  ],
  'bottom-left': [{
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.BADGE,
    icon: 'tag',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Badge', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a badge element', 'havenlytics'),
    defaultValue: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Featured', 'havenlytics'),
      style: 'primary'
    }
  },
  // Changed to "Featured"
  {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.STATUS,
    icon: 'certificate',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Status', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a status indicator', 'havenlytics'),
    defaultValue: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Active', 'havenlytics'),
      color: 'green'
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.PRICE,
    icon: 'dollar-sign',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Property Price', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a price element', 'havenlytics'),
    defaultValue: {
      value: '1,250,000',
      currency: 'USD'
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.RATING,
    icon: 'star',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Rating', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a rating element', 'havenlytics'),
    defaultValue: {
      value: 4.5,
      max: 5
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.SCHEDULE_TOUR,
    icon: 'calendar-alt',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Schedule Tour', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a schedule tour button', 'havenlytics'),
    defaultValue: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Schedule Tour', 'havenlytics'),
      icon: 'calendar-alt'
    }
  }],
  'bottom-right': [{
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.VIEWS,
    icon: 'eye',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Views', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a view counter', 'havenlytics'),
    defaultValue: {
      count: 0
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.SHARE,
    icon: 'share-alt',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Share', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a share button', 'havenlytics')
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.FAVORITE,
    icon: 'heart',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Favorite', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a favorite button', 'havenlytics'),
    defaultValue: {
      isFavorite: false
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.RATING,
    icon: 'star',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Rating', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a rating element', 'havenlytics'),
    defaultValue: {
      value: 4.5,
      max: 5
    }
  }],
  'avatar': [{
    id: 'avatar',
    icon: 'user-circle',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Avatar', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add an avatar image', 'havenlytics'),
    defaultValue: {
      type: 'avatar',
      url: ''
    }
  }],
  'title': [{
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.TITLE,
    icon: 'heading',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Property Title', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a title element', 'havenlytics'),
    defaultValue: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Luxury Villa with Ocean View', 'havenlytics')
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.PRICE,
    icon: 'dollar-sign',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Price', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add property price', 'havenlytics'),
    defaultValue: {
      value: '1,250,000',
      currency: 'USD'
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.RATING,
    icon: 'star',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Property Rating', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a rating element', 'havenlytics'),
    defaultValue: {
      value: 4.5,
      max: 5
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.LOCATION,
    icon: 'map-marker-alt',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Location', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add property location', 'havenlytics'),
    defaultValue: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('123 Ocean View Drive, Malibu, CA', 'havenlytics')
    }
  }],
  'location': [{
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.LOCATION,
    icon: 'map-marker-alt',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Location', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add property location', 'havenlytics'),
    defaultValue: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('123 Ocean View Drive, Malibu, CA', 'havenlytics')
    }
  }],
  'excerpt': [{
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.EXCERPT,
    icon: 'align-left',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Excerpt', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add property excerpt', 'havenlytics'),
    defaultValue: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Stunning oceanfront villa with panoramic views, modern amenities, and luxurious finishes. Features include infinity pool, home theater, and smart home technology.', 'havenlytics')
    }
  }],
  'features': [{
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.BEDS,
    icon: 'bed',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Beds', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add number of bedrooms', 'havenlytics'),
    defaultValue: {
      value: '3'
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.BATHS,
    icon: 'bath',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Baths', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add number of bathrooms', 'havenlytics'),
    defaultValue: {
      value: '2'
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.KITCHENS,
    icon: 'utensils',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Kitchens', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add number of kitchens', 'havenlytics'),
    defaultValue: {
      value: '1'
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.FLOOR,
    icon: 'layer-group',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Floor', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add floor number', 'havenlytics'),
    defaultValue: {
      value: '1'
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.ROOMS,
    icon: 'door-closed',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Rooms', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Total number of rooms', 'havenlytics'),
    defaultValue: {
      value: '1'
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.RECEPTIONS,
    icon: 'door-open',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Receptions', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add number of reception rooms', 'havenlytics'),
    defaultValue: {
      value: '2'
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.SQFT,
    icon: 'expand-arrows-alt',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Square Feet', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add property square footage', 'havenlytics'),
    defaultValue: {
      value: '2,980'
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.GSFT,
    icon: 'warehouse',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Gsq ft', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add property garage square footage', 'havenlytics'),
    defaultValue: {
      value: '50'
    }
  }],
  'content': [{
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.PHONE,
    icon: 'phone',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Phone', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a phone number', 'havenlytics'),
    defaultValue: {
      number: '+1 234 567 8900'
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.EMAIL,
    icon: 'envelope',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Email', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add an email address', 'havenlytics'),
    defaultValue: {
      address: 'contact@example.com'
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.WEBSITE,
    icon: 'globe',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Website', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a website link', 'havenlytics'),
    defaultValue: {
      url: 'www.example.com'
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.ADDRESS,
    icon: 'map-marker',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Address', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a location address', 'havenlytics'),
    defaultValue: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('123 Main St, City', 'havenlytics')
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.DATETIME,
    icon: 'clock',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Date/Time', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a date or time', 'havenlytics'),
    defaultValue: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Posted 2 days ago', 'havenlytics')
    }
  }],
  'footer-left': [{
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.VIEW_BUTTON,
    icon: 'external-link-alt',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('View Property Button', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a view property button', 'havenlytics'),
    defaultValue: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('View Property', 'havenlytics'),
      style: 'primary',
      type: 'view-property'
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.SCHEDULE_TOUR_BUTTON,
    icon: 'calendar-alt',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Schedule Tour Button', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a schedule tour button', 'havenlytics'),
    defaultValue: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Schedule Tour', 'havenlytics'),
      style: 'primary',
      type: 'schedule-tour'
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.BADGE,
    icon: 'tag',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Badge', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a badge element', 'havenlytics'),
    defaultValue: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Featured', 'havenlytics'),
      style: 'secondary'
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.STATUS,
    icon: 'certificate',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Status', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a status indicator', 'havenlytics'),
    defaultValue: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Active', 'havenlytics'),
      color: 'green'
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.TIME,
    icon: 'clock',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Time', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a time element', 'havenlytics'),
    defaultValue: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('2 days ago', 'havenlytics')
    }
  }],
  'footer-right': [{
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.SHARE,
    icon: 'share-alt',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Share', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a share button', 'havenlytics')
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.FAVORITE,
    icon: 'heart',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Favorite', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a favorite button', 'havenlytics'),
    defaultValue: {
      isFavorite: false
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.RATING,
    icon: 'star',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Rating', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a rating element', 'havenlytics'),
    defaultValue: {
      value: 4.5,
      max: 5
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.PROPERTY_TYPE,
    icon: 'home',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Property Type', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add property type badge', 'havenlytics'),
    defaultValue: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Villa', 'havenlytics'),
      style: 'secondary'
    }
  }, {
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.VIEWS,
    icon: 'eye',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Views', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a view counter', 'havenlytics'),
    defaultValue: {
      count: 0
    }
  }],
  'schedule-tour': [{
    id: _fieldTypes__WEBPACK_IMPORTED_MODULE_1__.FIELD_TYPES.SCHEDULE_TOUR,
    icon: 'mouse-pointer',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Schedule Tour', 'havenlytics'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add a schedule tour element', 'havenlytics'),
    defaultValue: {
      text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Schedule Tour', 'havenlytics'),
      icon: 'calendar-alt'
    }
  }]
};

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/hooks/useCardSections.js":
/*!*********************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/hooks/useCardSections.js ***!
  \*********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useCardSections: () => (/* binding */ useCardSections)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _constants_areaMappings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/areaMappings */ "./src/builder/components/TabContent/PropertyCard/constants/areaMappings.js");
/* harmony import */ var _constants_fieldTypes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants/fieldTypes */ "./src/builder/components/TabContent/PropertyCard/constants/fieldTypes.js");



const useCardSections = initialSections => {
  const [sections, setSections] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(initialSections);
  const addField = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)((area, fieldType) => {
    const sectionId = _constants_areaMappings__WEBPACK_IMPORTED_MODULE_1__.AREA_TO_SECTION_ID[area];
    const fieldConfig = _constants_fieldTypes__WEBPACK_IMPORTED_MODULE_2__.FIELD_CONFIGS.find(f => f.id === fieldType);
    if (!fieldConfig) return;

    // Validation for thumbnail area - only one image type allowed
    if (area === 'thumbnail') {
      const thumbnailSection = sections.find(s => s.id === sectionId);
      const hasImageType = thumbnailSection?.fields.some(field => field.type === 'image' || field.type === 'carousel');

      // Prevent adding image/carousel if one already exists
      if ((fieldType === 'image' || fieldType === 'carousel') && hasImageType) {
        //console.warn('Thumbnail area can only have one image type (Thumbnail OR Carousel)');
        return; // Prevent the addition
      }
    }
    const newField = {
      id: `${fieldType}-${Date.now()}`,
      type: fieldType,
      label: fieldConfig.title,
      mode: fieldConfig.mode || 'both',
      value: fieldConfig.defaultValue || {},
      order: sections.find(s => s.id === sectionId)?.fields.length || 0
    };
    setSections(prev => prev.map(section => section.id === sectionId ? {
      ...section,
      fields: [...section.fields, newField],
      order: section.order || 0
    } : section));
  }, [sections]);
  const updateField = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)((fieldId, updates) => {
    setSections(prev => prev.map(section => ({
      ...section,
      fields: section.fields.map(field => field.id === fieldId ? {
        ...field,
        ...updates,
        mode: updates.mode !== undefined ? updates.mode : field.mode
      } : field)
    })));
  }, []);
  const deleteField = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(fieldId => {
    setSections(prev => prev.map(section => ({
      ...section,
      fields: section.fields.filter(field => field.id !== fieldId)
    })));
  }, []);

  // Move field up in order
  const moveFieldUp = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(fieldId => {
    setSections(prev => prev.map(section => {
      const fieldIndex = section.fields.findIndex(field => field.id === fieldId);
      if (fieldIndex <= 0) return section; // Can't move first item up

      const newFields = [...section.fields];
      [newFields[fieldIndex - 1], newFields[fieldIndex]] = [newFields[fieldIndex], newFields[fieldIndex - 1]];

      // Update order for moved fields
      newFields.forEach((field, index) => {
        field.order = index;
      });
      return {
        ...section,
        fields: newFields
      };
    }));
  }, []);

  // Move field down in order
  const moveFieldDown = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(fieldId => {
    setSections(prev => prev.map(section => {
      const fieldIndex = section.fields.findIndex(field => field.id === fieldId);
      if (fieldIndex === -1 || fieldIndex >= section.fields.length - 1) return section; // Can't move last item down

      const newFields = [...section.fields];
      [newFields[fieldIndex], newFields[fieldIndex + 1]] = [newFields[fieldIndex + 1], newFields[fieldIndex]];

      // Update order for moved fields
      newFields.forEach((field, index) => {
        field.order = index;
      });
      return {
        ...section,
        fields: newFields
      };
    }));
  }, []);
  const getSectionByArea = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(area => {
    const sectionId = _constants_areaMappings__WEBPACK_IMPORTED_MODULE_1__.AREA_TO_SECTION_ID[area];
    return sections.find(section => section.id === sectionId);
  }, [sections]);

  // Set sections from external source (API)
  const setSectionsFromAPI = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(apiSections => {
    if (apiSections && Array.isArray(apiSections)) {
      // Ensure all sections have proper order and fields
      const processedSections = apiSections.map((section, index) => ({
        ...section,
        mode: section.mode || 'both',
        order: section.order || index,
        fields: section.fields?.map((field, fieldIndex) => ({
          ...field,
          mode: field.mode || 'both',
          order: field.order || fieldIndex
        })) || []
      }));
      setSections(processedSections);
    }
  }, []);
  return {
    sections,
    addField,
    updateField,
    deleteField,
    moveFieldUp,
    moveFieldDown,
    getSectionByArea,
    setSections: setSectionsFromAPI
  };
};

/***/ }),

/***/ "./src/builder/components/TabContent/PropertyCard/hooks/useModal.js":
/*!**************************************************************************!*\
  !*** ./src/builder/components/TabContent/PropertyCard/hooks/useModal.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useModal: () => (/* binding */ useModal)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);

const useModal = () => {
  const [activeModal, setActiveModal] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
  const [editingField, setEditingField] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
  const openModal = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)((area, field = null) => {
    setActiveModal(area);
    setEditingField(field);
  }, []);
  const closeModal = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    setActiveModal(null);
    setEditingField(null);
  }, []);
  return {
    activeModal,
    editingField,
    openModal,
    closeModal
  };
};

/***/ }),

/***/ "./src/builder/components/TabContent/index.js":
/*!****************************************************!*\
  !*** ./src/builder/components/TabContent/index.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AddPropertyFormTab: () => (/* reexport safe */ _AddPropertyFormTab_AddPropertyFormTab__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   PropertyCardLayoutTab: () => (/* reexport safe */ _PropertyCard_PropertyCardLayoutTab__WEBPACK_IMPORTED_MODULE_1__["default"])
/* harmony export */ });
/* harmony import */ var _AddPropertyFormTab_AddPropertyFormTab__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AddPropertyFormTab/AddPropertyFormTab */ "./src/builder/components/TabContent/AddPropertyFormTab/AddPropertyFormTab.js");
/* harmony import */ var _PropertyCard_PropertyCardLayoutTab__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PropertyCard/PropertyCardLayoutTab */ "./src/builder/components/TabContent/PropertyCard/PropertyCardLayoutTab.js");
// TabContent/index.js




/***/ }),

/***/ "./src/builder/components/TabNavigation/TabNavigation.css":
/*!****************************************************************!*\
  !*** ./src/builder/components/TabNavigation/TabNavigation.css ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ }),

/***/ "./src/builder/components/TabNavigation/TabNavigation.js":
/*!***************************************************************!*\
  !*** ./src/builder/components/TabNavigation/TabNavigation.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _hooks_useLocalStorage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../hooks/useLocalStorage */ "./src/builder/hooks/useLocalStorage.js");
/* harmony import */ var _TabContent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../TabContent */ "./src/builder/components/TabContent/index.js");
/* harmony import */ var _TabNavigation_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./TabNavigation.css */ "./src/builder/components/TabNavigation/TabNavigation.css");






const TabNavigation = ({
  showToast,
  setIsLoading,
  pageId = "builder"
}) => {
  // Navigation tabs configuration - Only two tabs
  const navigationTabs = [{
    id: "add-property-form",
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Add Property Form", "havenlytics"),
    icon: "plus-square"
  }, {
    id: "property-card-layout",
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Property Card Layout", "havenlytics"),
    icon: "th-large"
  }];
  const [activeTab, setActiveTab] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(navigationTabs[0].id);
  const [isSaving, setIsSaving] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  const [isResetting, setIsResetting] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  const [isSticky, setIsSticky] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);

  // State for hover animation
  const [hoverTab, setHoverTab] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(null);
  const tabsWrapperRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);

  // Track reset operations to prevent duplicate toasts
  const resetInProgressRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(false);

  // State for property card layout
  const [propertyCardLayoutData, setPropertyCardLayoutData] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)({
    layout: 'grid',
    columns: 3,
    style: 'modern',
    showPrice: true,
    showAddress: true
  });

  // Store the save/reset functions from each tab
  const [tabActions, setTabActions] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)({
    "add-property-form": {
      saveConfiguration: null,
      resetConfiguration: null
    },
    "property-card-layout": {
      saveConfiguration: null,
      resetConfiguration: null
    }
  });
  (0,_hooks_useLocalStorage__WEBPACK_IMPORTED_MODULE_3__["default"])(`hvnly--:${pageId}:active-tab`, activeTab, setActiveTab, navigationTabs[0].id);
  const handleTabClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(tabId => {
    setActiveTab(tabId);
    setHoverTab(null);
  }, []);

  // Sticky header effect
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    const handleScroll = () => {
      const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
      setIsSticky(scrollTop > 5);
    };
    window.addEventListener('scroll', handleScroll);
    return () => window.removeEventListener('scroll', handleScroll);
  }, []);

  // ========== SAVE HANDLER ==========
  const handleSave = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async () => {
    setIsSaving(true);
    setIsLoading(true);
    try {
      const currentActions = tabActions[activeTab];
      if (currentActions?.saveConfiguration) {
        const success = await currentActions.saveConfiguration();
        if (!success) {
          // Save failed - error toast already shown
        }
      } else {
        showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Configuration Saved', 'havenlytics'), `${getTabDisplayName(activeTab)} ` + (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('settings saved successfully!', 'havenlytics'));
      }
    } catch (error) {
      showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Save Failed', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Failed to save configuration:', 'havenlytics') + ` ${error.message}`);
    } finally {
      setIsSaving(false);
      setIsLoading(false);
    }
  }, [activeTab, tabActions, showToast, setIsLoading]);

  // ========== RESET HANDLER ==========
  const handleReset = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async () => {
    // Prevent multiple reset operations
    if (resetInProgressRef.current) {
      return;
    }
    const tabName = getTabDisplayName(activeTab);

    // Different confirmation messages for different tabs
    let confirmMessage, alertTitle;
    switch (activeTab) {
      case "add-property-form":
        confirmMessage = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Are you sure you want to reset all sections and fields? Required tabs (Basic Info) will be preserved.', 'havenlytics');
        alertTitle = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Reset All Sections?', 'havenlytics');
        break;
      case "property-card-layout":
        confirmMessage = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Are you sure you want to reset ONLY the', 'havenlytics') + ` ${tabName}? ` + (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('This will reset all property card layout settings to defaults.', 'havenlytics');
        alertTitle = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Reset', 'havenlytics') + ` ${tabName}?`;
        break;
      default:
        confirmMessage = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Are you sure you want to reset the', 'havenlytics') + ` ${tabName} ` + (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('settings?', 'havenlytics');
        alertTitle = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Reset', 'havenlytics') + ` ${tabName}?`;
    }

    // Use the beautiful HvnlyNabAlert instead of default window.confirm
    const userConfirmed = await window.HvnlyNabAlert.confirm(confirmMessage, alertTitle);
    if (userConfirmed === 'confirm') {
      // Set reset in progress flag
      resetInProgressRef.current = true;
      setIsResetting(true);
      setIsLoading(true);
      try {
        const currentActions = tabActions[activeTab];
        if (currentActions?.resetConfiguration) {
          const success = await currentActions.resetConfiguration();
          if (!success) {
            // Reset failed - error toast already shown
          }
        } else {
          // For tabs without API reset, reset local state
          if (activeTab === "property-card-layout") {
            setPropertyCardLayoutData({
              layout: 'grid',
              columns: 3,
              style: 'modern',
              showPrice: true,
              showAddress: true
            });
          }

          // Show success toast ONLY for tabs without API reset
          showToast('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Configuration Reset', 'havenlytics'), `${tabName} ` + (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('reset successfully!', 'havenlytics'));
        }
      } catch (error) {
        showToast('error', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Reset Failed', 'havenlytics'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Failed to reset configuration:', 'havenlytics') + ` ${error.message}`);
      } finally {
        setIsResetting(false);
        setIsLoading(false);
        // Clear reset in progress flag after a short delay
        setTimeout(() => {
          resetInProgressRef.current = false;
        }, 1000);
      }
    }
  }, [activeTab, tabActions, showToast, setIsLoading]);

  // Helper function to get display name for toast messages
  const getTabDisplayName = tabId => {
    const tab = navigationTabs.find(t => t.id === tabId);
    return tab ? tab.label : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Configuration', 'havenlytics');
  };

  // Callback to receive actions from tabs
  const handleTabActions = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)((tabId, actions) => {
    setTabActions(prev => ({
      ...prev,
      [tabId]: actions
    }));
  }, []);
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_tab_navigation"
  }, isSticky && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_header property-builder-sticky"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h1", null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-object-group"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Property Builder', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_header_actions"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: "hvnly--builder--int_api__property_builder_btn hvnly--builder--int_api__property_builder_btn_secondary",
    onClick: handleReset,
    disabled: isResetting || resetInProgressRef.current
  }, isResetting ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-spinner fa-spin"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Resetting...', 'havenlytics')) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-sync-alt"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Reset', 'havenlytics'))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: "hvnly--builder--int_api__property_builder_btn hvnly--builder--int_api__property_builder_btn_primary",
    onClick: handleSave,
    disabled: isSaving
  }, isSaving ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-spinner fa-spin"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Saving...', 'havenlytics')) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-save"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Save Configuration', 'havenlytics'))))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_header"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h1", null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-object-group"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Property Builder', 'havenlytics')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__property_builder_header_actions"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: "hvnly--builder--int_api__property_builder_btn hvnly--builder--int_api__property_builder_btn_secondary",
    onClick: handleReset,
    disabled: isResetting || resetInProgressRef.current
  }, isResetting ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-spinner fa-spin"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Resetting...', 'havenlytics')) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-sync-alt"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Reset', 'havenlytics'))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    className: "hvnly--builder--int_api__property_builder_btn hvnly--builder--int_api__property_builder_btn_primary",
    onClick: handleSave,
    disabled: isSaving
  }, isSaving ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-spinner fa-spin"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Saving...', 'havenlytics')) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: "fas fa-save"
  }), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Save Configuration', 'havenlytics'))))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__tab_nav_tabs_main"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__tab_nav_tabs_wrapper",
    ref: tabsWrapperRef
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__tab_nav_tabs"
  }, navigationTabs.map(tab => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
    key: tab.id,
    className: `hvnly--builder--int_api__tab_nav_item ${activeTab === tab.id ? "active" : ""}`,
    "data-tab": tab.id,
    onClick: () => handleTabClick(tab.id),
    onMouseEnter: () => setHoverTab(tab.id),
    onMouseLeave: () => setHoverTab(null)
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", {
    className: `fas fa-${tab.icon}`
  }), tab.label))))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly--builder--int_api__tab_nav_content"
  }, activeTab === "add-property-form" && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_TabContent__WEBPACK_IMPORTED_MODULE_4__.AddPropertyFormTab, {
    showToast: showToast,
    onActionsReady: actions => handleTabActions("add-property-form", actions),
    isSaving: isSaving,
    isResetting: isResetting
  }), activeTab === "property-card-layout" && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_TabContent__WEBPACK_IMPORTED_MODULE_4__.PropertyCardLayoutTab, {
    showToast: showToast,
    setIsLoading: setIsLoading,
    cardData: propertyCardLayoutData,
    onCardChange: setPropertyCardLayoutData,
    onActionsReady: actions => handleTabActions("property-card-layout", actions)
  })));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TabNavigation);

/***/ }),

/***/ "./src/builder/hooks/useLocalStorage.js":
/*!**********************************************!*\
  !*** ./src/builder/hooks/useLocalStorage.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   useLocalStorage: () => (/* binding */ useLocalStorage)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);

const useLocalStorage = (key, value, setValue, defaultValue) => {
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    try {
      const savedValue = localStorage.getItem(key);
      if (savedValue !== null) {
        // Try to parse JSON
        try {
          setValue(JSON.parse(savedValue));
        } catch (err) {
          // If not JSON, store raw string
          setValue(savedValue);
        }
      } else if (defaultValue !== undefined) {
        setValue(defaultValue);
      }
    } catch (err) {
      // console.error(`Error reading localStorage key “${key}”:`, err);
    }
  }, [key, setValue, defaultValue]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    try {
      if (typeof value === 'string') {
        localStorage.setItem(key, value);
      } else {
        localStorage.setItem(key, JSON.stringify(value));
      }
    } catch (err) {
      // console.error(`Error setting localStorage key “${key}”:`, err);
    }
  }, [key, value]);
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (useLocalStorage);

/***/ }),

/***/ "./src/builder/index.js":
/*!******************************!*\
  !*** ./src/builder/index.js ***!
  \******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _PropertyBuilder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PropertyBuilder */ "./src/builder/PropertyBuilder.js");

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_PropertyBuilder__WEBPACK_IMPORTED_MODULE_0__["default"]);

/***/ }),

/***/ "./src/hooks/useBuilderPreloader.js":
/*!******************************************!*\
  !*** ./src/hooks/useBuilderPreloader.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   usePreloader: () => (/* binding */ usePreloader)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);

const usePreloader = (initialLoading = true, minimumDisplayTime = 1000) => {
  const [preloaderVisible, setPreloaderVisible] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(initialLoading);
  const [isExiting, setIsExiting] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  const [loadingProgress, setLoadingProgress] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0);
  const [loadingStage, setLoadingStage] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)('Initializing');
  const [preloaderStartTime] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(Date.now());
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (!initialLoading) {
      // When loading is complete, start fade out
      const elapsed = Date.now() - preloaderStartTime;
      const remainingTime = Math.max(0, minimumDisplayTime - elapsed);
      const fadeTimer = setTimeout(() => {
        setIsExiting(true);
        // Remove preloader completely after fade out
        setTimeout(() => setPreloaderVisible(false), 300); // Match CSS transition time
      }, remainingTime);
      return () => clearTimeout(fadeTimer);
    }

    // Simulate loading stages and progress
    const stages = [{
      name: 'Initializing',
      duration: 300
    }, {
      name: 'Connecting to server',
      duration: 400
    }, {
      name: 'Fetching configuration',
      duration: 500
    }, {
      name: 'Processing data',
      duration: 300
    }, {
      name: 'Finalizing',
      duration: 200
    }];
    let currentStage = 0;
    let progress = 0;
    const stageTimer = setInterval(() => {
      if (currentStage < stages.length) {
        const currentStageData = stages[currentStage];
        setLoadingStage(currentStageData.name);
        const progressTimer = setInterval(() => {
          progress += 100 / (currentStageData.duration / 50);
          if (progress >= 100) {
            progress = 100;
            clearInterval(progressTimer);
          }
          setLoadingProgress(Math.min(progress, 100));
        }, 50);
        setTimeout(() => {
          clearInterval(progressTimer);
          currentStage++;
          progress = 0;
          if (currentStage >= stages.length) {
            clearInterval(stageTimer);
            // All stages complete, start exit
            const elapsed = Date.now() - preloaderStartTime;
            const remainingTime = Math.max(0, minimumDisplayTime - elapsed);
            setTimeout(() => {
              setIsExiting(true);
              // Remove preloader completely after fade out
              setTimeout(() => setPreloaderVisible(false), 300);
            }, remainingTime);
          }
        }, currentStageData.duration);
      }
    }, 0);
    return () => {
      clearInterval(stageTimer);
    };
  }, [initialLoading, minimumDisplayTime, preloaderStartTime]);
  return {
    preloaderVisible,
    isExiting,
    loadingProgress,
    loadingStage,
    setLoadingProgress,
    setLoadingStage
  };
};

/***/ }),

/***/ "./src/utils/builderPreloader.css":
/*!****************************************!*\
  !*** ./src/utils/builderPreloader.css ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ }),

/***/ "./src/utils/builderPreloader.js":
/*!***************************************!*\
  !*** ./src/utils/builderPreloader.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builderPreloader_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./builderPreloader.css */ "./src/utils/builderPreloader.css");


const Preloader = ({
  isLoading = true,
  isExiting = false,
  title = "Property Builder",
  stage = "Loading...",
  progress = 0,
  tips = "💡 Tip: You can drag and drop fields to reorder them"
}) => {
  if (!isLoading) return null;
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: `hvnly-preloader-container ${isExiting ? 'exiting' : ''}`
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-preloader-content"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-preloader-spinner"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-spinner-circle"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-preloader-info"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h2", {
    className: "hvnly-preloader-title"
  }, title), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
    className: "hvnly-preloader-stage"
  }, stage), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-progress-container"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-progress-track"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-progress-bar",
    style: {
      width: `${progress}%`
    }
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "hvnly-progress-text"
  }, Math.round(progress), "%"))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "hvnly-preloader-tips"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, tips))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Preloader);

/***/ }),

/***/ "@wordpress/element":
/*!*********************************!*\
  !*** external ["wp","element"] ***!
  \*********************************/
/***/ ((module) => {

module.exports = window["wp"]["element"];

/***/ }),

/***/ "@wordpress/i18n":
/*!******************************!*\
  !*** external ["wp","i18n"] ***!
  \******************************/
/***/ ((module) => {

module.exports = window["wp"]["i18n"];

/***/ }),

/***/ "react":
/*!************************!*\
  !*** external "React" ***!
  \************************/
/***/ ((module) => {

module.exports = window["React"];

/***/ }),

/***/ "react-dom":
/*!***************************!*\
  !*** external "ReactDOM" ***!
  \***************************/
/***/ ((module) => {

module.exports = window["ReactDOM"];

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	(() => {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = (module) => {
/******/ 			var getter = module && module.__esModule ?
/******/ 				() => (module['default']) :
/******/ 				() => (module);
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
(() => {
/*!********************************!*\
  !*** ./src/builder/builder.js ***!
  \********************************/
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_dom_client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom/client */ "./node_modules/react-dom/client.js");
/* harmony import */ var _BuilderApp_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../BuilderApp.jsx */ "./src/BuilderApp.jsx");



const initHavenlyticsAdminPropertyBuilder = () => {
  const container = document.getElementById('HvnlyNab_property_builder_render');
  if (!container) return;
  const root = (0,react_dom_client__WEBPACK_IMPORTED_MODULE_1__.createRoot)(container);
  root.render((0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_BuilderApp_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], null));
};
if (document.readyState === 'loading') {
  document.addEventListener('DOMContentLoaded', initHavenlyticsAdminPropertyBuilder);
} else {
  initHavenlyticsAdminPropertyBuilder();
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (initHavenlyticsAdminPropertyBuilder);
})();

/******/ })()
;
//# sourceMappingURL=builder.js.map