{"version":3,"mappings":";uhCAWA,MAAMA,EAAuC,2DAEvCC,EAAiB,CACrB,CACE,QAAU,0BACV,MAAUC,EAAK,EAAE,kDAAkD,EACnE,SAAU,SAEd,EAEMC,EAAO,IAAM,CAGjBC,EAAA,wBAAAC,CAAA,eACE,qBACF,OAAAC,KAAA,kBAAAD,EAAA,2QACC,KAAK,CAAC,CAAC,QAASA,KAAmB,CAC9BA,EAAc,WAAW,QAAU,GAGrBE,EAAA,QAChBP,EACA,GAAK,KAAO,EACZ,IAAM,CACIQ,EAAA,KAAKP,CAAc,EAC1B,KAAMQ,GAAoBA,EAAgB,OAAO,EAEtD,EACD,CACH,EAEMC,EAAS,IAAM,CAEfC,EAAiB,eAEhBC,EAAK,gBAEKC,EAAA,GAAG,uBAAwB,IAAM,CACzCV,EAAA,EACN,CACH,EAEeW,EAAA,CAAC,OAAAJ,CAAM","names":["COMPLETE_TUTORIAL_OVERLAY_COOKIE_KEY","INTRO_JS_STEPS","I18n","show","__vitePreload","ListingFilter","n","ActionWithTimeout","Introjs","intro_js_object","onLoad","BrowserDetection","Page","Filter_Manager","index"],"ignoreList":[],"sources":["../../../app/assets/javascripts/concepts/listings/searches/filter_bar/tutorial_save_search/index.ts"],"sourcesContent":["\nimport Introjs from \"plugins/introjs/index\"\nimport BrowserDetection from \"app/detection/browser\"\nimport {Page} from \"app/multi_device\"\nimport ActionWithTimeout from \"app/action_with_timeout\"\nimport Filter_Manager from \"app/search/filter/manager\"\n\n\nimport I18n from \"plugins/i18n-js\"\n\n\nconst COMPLETE_TUTORIAL_OVERLAY_COOKIE_KEY = \"window.App.Cells.ListingFilter.TutorialOverlay.Completed\"\n\nconst INTRO_JS_STEPS = [\n {\n element: \".btn-save-search-prompt\",\n intro: I18n.t(\"concepts.listings.searches.saved.button.tutorial\"),\n position: \"bottom\" as \"bottom\",\n },\n]\n\nconst show = () => {\n // # This tutorial is only shown when there are enough filter options changed\n // TODO: refactor\n import(\n \"concepts/listings/searches/filter_bar/index\"\n )\n .then(({Factory: ListingFilter}) => {\n if (ListingFilter.instance().count() < 2) return\n\n // # Only show at most once per 2 days\n ActionWithTimeout.execute(\n COMPLETE_TUTORIAL_OVERLAY_COOKIE_KEY,\n 24 * 3600 * 2,\n () => {\n Introjs.init(INTRO_JS_STEPS)\n .then((intro_js_object) => intro_js_object.start())\n }\n )\n })\n}\n\nconst onLoad = () => {\n // # The overlay won't work on old browsers\n if (BrowserDetection.isIE8OrLess()) return\n // # This tutorial only works for desktop (for now)\n if (!Page.isForDesktop()) return\n\n Filter_Manager.on(\"filter:update:action\", () => {\n show()\n })\n}\n\nexport default {onLoad}\n"],"file":"assets/index-DXOXyzyp.js"}