{
  "version": 3,
  "sources": ["../src/catalog-nav.js"],
  "sourcesContent": ["/**\n * Catalog Navigation - Alpine.js component for mobile catalog navigation\n * Used in: templates/includes/search_modal.html\n *\n * Features:\n * - Navigation by category groups and categories\n * - Quick access to subservices\n * - Smooth transitions between views\n * - No keyboard input - touch-friendly navigation\n */\n\n// SVG \u0438\u043A\u043E\u043D\u043A\u0438 \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u0439 (\u0431\u0435\u0437 width/height \u0434\u043B\u044F \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0447\u0435\u0440\u0435\u0437 CSS)\nconst CATEGORY_ICONS = {\n  'massage-masters': '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M11 14h2a2 2 0 0 0 0-4h-3c-.6 0-1.1.2-1.4.6L3 16\" /><path d=\"m14.45 13.39 5.05-4.694C20.196 8 21 6.85 21 5.75a2.75 2.75 0 0 0-4.797-1.837.276.276 0 0 1-.406 0A2.75 2.75 0 0 0 11 5.75c0 1.2.802 2.248 1.5 2.946L16 11.95\" /><path d=\"m2 15 6 6\" /><path d=\"m7 20 1.6-1.4c.3-.4.8-.6 1.4-.6h4c1.1 0 2.1-.4 2.8-1.2l4.6-4.4a1 1 0 0 0-2.75-2.91\" /></svg>',\n  'massage-salons': '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5\" /><path d=\"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244\" /><path d=\"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05\" /></svg>',\n  'beauty-masters': '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z\" /><path d=\"M20 2v4\" /><path d=\"M22 4h-4\" /><circle cx=\"4\" cy=\"20\" r=\"2\" /></svg>',\n  'beauty-salons': '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"6\" cy=\"6\" r=\"3\" /><path d=\"M8.12 8.12 12 12\" /><path d=\"M20 4 8.12 15.88\" /><circle cx=\"6\" cy=\"18\" r=\"3\" /><path d=\"M14.8 14.8 20 20\" /></svg>',\n  'fitness-trainers': '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m6.5 6.5 11 11\" /><path d=\"m21 21-1-1\" /><path d=\"m3 3 1 1\" /><path d=\"m18 22 4-4\" /><path d=\"m2 6 4-4\" /><path d=\"m3 10 7-7\" /><path d=\"m14 21 7-7\" /></svg>',\n  'fitness-clubs': '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m6.5 6.5 11 11\" /><path d=\"m21 21-1-1\" /><path d=\"m3 3 1 1\" /><path d=\"m18 22 4-4\" /><path d=\"m2 6 4-4\" /><path d=\"m3 10 7-7\" /><path d=\"m14 21 7-7\" /></svg>',\n  'spa': '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z\" /><path d=\"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97\" /></svg>',\n  'bani': '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4\" /></svg>',\n  'massage-courses': '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z\" /><path d=\"M22 10v6\" /><path d=\"M6 12.5V16a6 3 0 0 0 12 0v-3.5\" /></svg>',\n  'beauty-courses': '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z\" /><path d=\"M22 10v6\" /><path d=\"M6 12.5V16a6 3 0 0 0 12 0v-3.5\" /></svg>',\n};\n\n// \u0414\u0435\u0444\u043E\u043B\u0442\u043D\u0430\u044F \u0438\u043A\u043E\u043D\u043A\u0430\nconst DEFAULT_ICON = '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z\" /><path d=\"M20 2v4\" /><path d=\"M22 4h-4\" /><circle cx=\"4\" cy=\"20\" r=\"2\" /></svg>';\n\n/**\n * Alpine.js component for catalog navigation modal\n */\nfunction catalogNav() {\n  return {\n    // View state: 'categories' (default) or 'subservices'\n    view: 'categories',\n\n    // Selected category for subservices view\n    selectedCategory: null,\n\n    // All grouped categories (loaded from config)\n    groupedCategories: [],\n\n    /**\n     * Initialize component\n     */\n    init() {\n      const config = window.CATALOG_NAV_CONFIG || {};\n      this.groupedCategories = config.groupedCategories || [];\n      this.currentCitySlug = config.currentCitySlug || '';\n      this.currentCityName = config.currentCityName || '';\n      this.cityId = config.cityId || null;\n\n      // Listen for modal open to reset state\n      const modal = document.getElementById('hs-search-modal');\n      if (modal) {\n        modal.addEventListener('open.hs.overlay', () => {\n          this.resetState();\n        });\n      }\n    },\n\n    /**\n     * Reset to initial state\n     */\n    resetState() {\n      this.view = 'categories';\n      this.selectedCategory = null;\n    },\n\n    /**\n     * Select a category and show its subservices\n     */\n    selectCategory(category) {\n      this.selectedCategory = category;\n      this.view = 'subservices';\n    },\n\n    /**\n     * Go back to categories view\n     */\n    goBack() {\n      this.view = 'categories';\n      this.selectedCategory = null;\n    },\n\n    /**\n     * Get SVG icon for category by slug\n     */\n    getCategoryIcon(slug) {\n      return CATEGORY_ICONS[slug] || DEFAULT_ICON;\n    },\n\n    /**\n     * Get URL for category page\n     */\n    getCategoryUrl(category) {\n      if (!category) return '#';\n      if (this.currentCitySlug) {\n        return `/${this.currentCitySlug}/${category.slug}/`;\n      }\n      return `/${category.slug}/`;\n    },\n\n    /**\n     * Get URL for subservice (category + subservice slug in path)\n     */\n    getSubserviceUrl(subservice) {\n      if (!this.selectedCategory) return '#';\n\n      const baseUrl = this.getCategoryUrl(this.selectedCategory);\n      // URL \u0444\u043E\u0440\u043C\u0430\u0442: /city/category/subservice/\n      return `${baseUrl}${subservice.slug}/`;\n    },\n\n    /**\n     * Check if category has subservice groups\n     */\n    hasSubserviceGroups() {\n      return this.selectedCategory?.subserviceGroups?.length > 0;\n    },\n\n    /**\n     * Get subservices for a specific group\n     */\n    getSubservicesForGroup(groupId) {\n      if (!this.selectedCategory?.subservices) return [];\n      return this.selectedCategory.subservices.filter(s => s.group_id === groupId);\n    },\n\n    /**\n     * Get ungrouped subservices (without a group)\n     */\n    getUngroupedSubservices() {\n      if (!this.selectedCategory?.subservices) return [];\n      return this.selectedCategory.subservices.filter(s => !s.group_id);\n    },\n\n    /**\n     * Get section title for subservices\n     */\n    getSubserviceSectionTitle() {\n      return this.selectedCategory?.subserviceSectionTitle || '\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u0438\u043F \u0443\u0441\u043B\u0443\u0433\u0438';\n    },\n\n    /**\n     * Close modal programmatically\n     */\n    closeModal() {\n      const modal = document.getElementById('hs-search-modal');\n      if (modal && typeof HSOverlay !== 'undefined') {\n        HSOverlay.close(modal);\n      }\n    },\n\n    /**\n     * Open city selection modal\n     */\n    openCityModal() {\n      // First close the search modal\n      this.closeModal();\n      // Then open city modal\n      setTimeout(() => {\n        const cityModal = document.getElementById('hs-city-select-modal');\n        if (cityModal && typeof HSOverlay !== 'undefined') {\n          HSOverlay.open(cityModal);\n        }\n      }, 100);\n    }\n  };\n}\n\n// Register Alpine component globally\nwindow.catalogNav = catalogNav;\n"],
  "mappings": "MAYA,IAAMA,EAAiB,CACrB,kBAAmB,kgBACnB,iBAAkB,yhBAClB,iBAAkB,kgBAClB,gBAAiB,2TACjB,mBAAoB,uUACpB,gBAAiB,uUACjB,IAAO,yaACP,KAAQ,8QACR,kBAAmB,0WACnB,iBAAkB,yWACpB,EAGMC,EAAe,kgBAKrB,SAASC,GAAa,CACpB,MAAO,CAEL,KAAM,aAGN,iBAAkB,KAGlB,kBAAmB,CAAC,EAKpB,MAAO,CACL,IAAMC,EAAS,OAAO,oBAAsB,CAAC,EAC7C,KAAK,kBAAoBA,EAAO,mBAAqB,CAAC,EACtD,KAAK,gBAAkBA,EAAO,iBAAmB,GACjD,KAAK,gBAAkBA,EAAO,iBAAmB,GACjD,KAAK,OAASA,EAAO,QAAU,KAG/B,IAAMC,EAAQ,SAAS,eAAe,iBAAiB,EACnDA,GACFA,EAAM,iBAAiB,kBAAmB,IAAM,CAC9C,KAAK,WAAW,CAClB,CAAC,CAEL,EAKA,YAAa,CACX,KAAK,KAAO,aACZ,KAAK,iBAAmB,IAC1B,EAKA,eAAeC,EAAU,CACvB,KAAK,iBAAmBA,EACxB,KAAK,KAAO,aACd,EAKA,QAAS,CACP,KAAK,KAAO,aACZ,KAAK,iBAAmB,IAC1B,EAKA,gBAAg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