import { UserState as p } from "./shop-minis-platform/src/types/user.js";
import { MinisContentStatus as l } from "./shop-minis-platform/src/types/content.js";
const e = (t, o, a = "99.99", d) => ({
  id: t,
  title: o,
  price: { amount: a, currencyCode: "USD" },
  ...d && {
    compareAtPrice: { amount: d, currencyCode: "USD" }
  },
  reviewAnalytics: { averageRating: 4.5, reviewCount: 10 },
  shop: i("shop1", "Mock Shop"),
  defaultVariantId: `variant-${t}`,
  isFavorited: !1,
  featuredImage: {
    url: "https://cdn.shopify.com/static/sample-images/teapot.jpg",
    altText: o
  }
}), i = (t, o, a) => {
  const c = Array.from({ length: 3 }, (v, n) => ({
    url: `https://picsum.photos/400/400?random=${t}-${n}`,
    sensitive: !1,
    altText: `${o} featured image ${n + 1}`
  }));
  return {
    id: t,
    name: o,
    primaryDomain: {
      url: `https://${o.toLowerCase().replace(/\s+/g, "-")}.com`
    },
    reviewAnalytics: { averageRating: 4.3, reviewCount: 50 },
    visualTheme: {
      id: `visual-theme-${t}`,
      featuredImages: c,
      logoImage: {
        url: `https://picsum.photos/100/100?random=${t}`,
        sensitive: !1
      },
      brandSettings: void 0
    }
  };
}, r = (t = !1) => ({
  hasNextPage: t,
  endCursor: t ? "cursor123" : null
}), s = (t, o, a = []) => ({
  id: t,
  publicId: `public-${t}`,
  name: o,
  products: a
});
function u(t, o) {
  return (a) => (console.log(`[Mock Action] ${String(t)}`, a), Promise.resolve({ ok: !0, data: o }));
}
function m() {
  const t = {
    translateContentUp: void 0,
    translateContentDown: void 0,
    followShop: !0,
    unfollowShop: !1,
    favorite: void 0,
    unfavorite: void 0,
    getShopAppInformation: {
      appVersion: "1.0.0",
      buildNumber: "12345",
      buildId: "dev-build-123"
    },
    productRecommendationImpression: void 0,
    productRecommendationClick: void 0,
    hideEntryPoint: void 0,
    closeMini: void 0,
    getAccountInformation: {
      status: "available",
      value: "user@example.com"
    },
    getCurrentUser: {
      data: {
        displayName: "John Doe",
        avatarImage: { url: "https://example.com/avatar.jpg" }
      }
    },
    createOrderAttribution: void 0,
    addToCart: void 0,
    buyProduct: void 0,
    buyProducts: void 0,
    showErrorScreen: void 0,
    showErrorToast: void 0,
    getDeeplinkPaths: {
      matchers: ["/products", "/collections", "/cart"]
    },
    navigateToDeeplink: void 0,
    navigateToShop: void 0,
    navigateToProduct: void 0,
    navigateToOrder: void 0,
    navigateToCheckout: void 0,
    createImageUploadLink: {
      targets: [
        {
          url: "https://example.com/upload",
          resourceUrl: "https://example.com/resource",
          parameters: [{ name: "key", value: "upload-123" }]
        }
      ]
    },
    completeImageUpload: {
      files: [
        {
          id: "file-123",
          fileStatus: "READY",
          image: { url: "https://example.com/image.jpg" }
        }
      ]
    },
    getPersistedItem: null,
    setPersistedItem: void 0,
    removePersistedItem: void 0,
    getAllPersistedKeys: ["key1", "key2", "key3"],
    clearPersistedItems: void 0,
    getInternalPersistedItem: null,
    setInternalPersistedItem: void 0,
    removeInternalPersistedItem: void 0,
    getAllInternalPersistedKeys: ["internal-key1", "internal-key2"],
    clearInternalPersistedItems: void 0,
    getSecret: "secret-value",
    setSecret: void 0,
    removeSecret: void 0,
    reportInteraction: void 0,
    reportImpression: void 0,
    reportContentImpression: void 0,
    getProductLists: {
      data: [
        s("list-1", "Wishlist"),
        s("list-2", "Favorites")
      ],
      pageInfo: r()
    },
    getProductList: {
      data: s("list-1", "Wishlist", [
        e("prod-1", "Sample Product")
      ]),
      pageInfo: r()
    },
    addProductList: s("list-3", "New List"),
    removeProductList: void 0,
    renameProductList: s("list-1", "Updated Wishlist"),
    addProductListItem: void 0,
    removeProductListItem: void 0,
    getRecommendedProducts: {
      data: [
        e("rec-1", "Recommended Product 1", "79.99"),
        e("rec-2", "Recommended Product 2", "129.99"),
        e("rec-3", "Recommended Product 3", "129.99"),
        e("rec-4", "Recommended Product 4", "29.99"),
        e("rec-5", "Recommended Product 5", "39.99"),
        e("rec-6", "Recommended Product 6", "49.99"),
        e("rec-7", "Recommended Product 7", "59.99"),
        e("rec-8", "Recommended Product 8", "69.99"),
        e("rec-9", "Recommended Product 9", "129.99")
      ],
      pageInfo: r()
    },
    getRecommendedShops: {
      data: [
        i("shop-1", "Amazing Store"),
        i("shop-2", "Best Deals Shop")
      ],
      pageInfo: r()
    },
    searchProductsByShop: {
      data: [
        e("search-1", "Search Result 1", "59.99"),
        e("search-2", "Search Result 2", "89.99")
      ],
      pageInfo: r()
    },
    getOrders: {
      data: [
        {
          id: "order-1",
          name: "#1001",
          lineItems: [
            {
              productTitle: "Sample Product",
              variantTitle: "Medium",
              quantity: 2,
              product: null
            }
          ],
          shop: i("shop-1", "Sample Shop")
        }
      ],
      pageInfo: r()
    },
    getBuyerAttributes: {
      data: {
        genderAffinity: "NEUTRAL",
        categoryAffinities: [
          { id: "cat1", name: "Electronics" },
          { id: "cat2", name: "Clothing" }
        ]
      }
    },
    showFeedbackSheet: void 0,
    getPopularProducts: {
      data: [
        e("pop-1", "The Hero Snowboard", "702.95"),
        e("pop-2", "Snow Jacket", "605.95", "702.00"),
        e("pop-3", "Winter Gloves", "89.95"),
        e("pop-4", "Summer Gloves", "89.95"),
        e("pop-5", "Spring Gloves", "89.95"),
        e("pop-6", "Playstation 5", "499.95"),
        e("pop-7", "Xbox Series X", "499.95"),
        e("pop-8", "Nintendo Switch", "299.95"),
        e("pop-9", "Playstation 4", "299.95"),
        e("pop-10", "Nintendo 3DS", "89.95")
      ],
      pageInfo: r()
    },
    share: {
      message: "Shared!",
      success: !0
    },
    shareSingle: {
      message: "Shared!",
      success: !0
    },
    getCuratedProducts: {
      data: [
        e("cur-1", "Curated Product 1", "79.99"),
        e("cur-2", "Curated Product 2", "129.99")
      ],
      pageInfo: r()
    },
    getSavedProducts: {
      data: [e("saved-1", "Saved Product 1", "49.99")],
      pageInfo: r()
    },
    getRecentProducts: {
      data: [e("recent-1", "Recent Product 1", "59.99")],
      pageInfo: r()
    },
    getProductSearch: {
      data: [e("search-3", "Search Product 3", "39.99")],
      pageInfo: r()
    },
    getProducts: { data: [e("prod-2", "Product 2", "19.99")] },
    getProduct: { data: e("prod-1", "Sample Product") },
    getProductVariants: {
      data: [
        {
          id: "variant-1",
          title: "Variant 1",
          isFavorited: !1,
          image: { url: "https://example.com/variant-1.jpg" },
          price: { amount: "19.99", currencyCode: "USD" },
          compareAtPrice: { amount: "29.99", currencyCode: "USD" }
        }
      ],
      pageInfo: r()
    },
    getProductMedia: {
      data: [
        {
          id: "media-1",
          image: { url: "https://example.com/media-1.jpg" },
          mediaContentType: "IMAGE",
          alt: "Sample product image"
        }
      ],
      pageInfo: r()
    },
    getShop: { data: i("shop-1", "Sample Shop") },
    getRecentShops: {
      data: [i("recent-shop-1", "Recent Shop 1")],
      pageInfo: r()
    },
    getFollowedShops: {
      data: [i("followed-shop-1", "Followed Shop 1")],
      pageInfo: r()
    },
    previewProductInAr: void 0,
    createContent: {
      data: {
        publicId: "content-123",
        externalId: null,
        image: {
          id: "img-123",
          url: "https://cdn.shopify.com/s/files/1/0633/6574/2742/files/Namnlosdesign-47.png?v=1740438079",
          width: 800,
          height: 600
        },
        title: "Mock Content",
        description: "This is a mock content item",
        visibility: ["DISCOVERABLE"],
        shareableUrl: "https://example.com/content/123",
        products: null
      }
    },
    getContent: {
      data: [
        {
          publicId: "content-123",
          image: {
            id: "img-123",
            url: "https://cdn.shopify.com/s/files/1/0633/6574/2742/files/Namnlosdesign-47.png?v=1740438079",
            width: 800,
            height: 600
          },
          title: "Mock Content",
          visibility: ["DISCOVERABLE"],
          status: l.READY
        }
      ]
    },
    generateUserToken: {
      data: {
        token: "user-token-123",
        expiresAt: "2025-01-01",
        userState: p.VERIFIED
      }
    },
    navigateToCart: void 0,
    requestPermission: {
      granted: !0
    },
    reportError: void 0
  }, o = {};
  for (const a in t)
    Object.prototype.hasOwnProperty.call(t, a) && (o[a] = u(
      a,
      t[a]
    ));
  return o;
}
const g = () => {
  const t = navigator.userAgent.toLowerCase(), o = /iphone|ipad|ipod/.test(t), a = /android/.test(t);
  return o || a;
}, S = ({ force: t } = {}) => {
  g() && !t || window.minisSDK || (window.minisSDK = m(), window.minisParams = {
    handle: "mock-handle",
    initialUrl: "/mock-initial-url",
    platform: "web"
  });
};
export {
  e as createProduct,
  i as createShop,
  S as injectMocks,
  m as makeMockActions
};
//# sourceMappingURL=mocks.js.map
