app/assets/javascripts/refine-stimulus.modern.js.map in refine-rails-2.11.12 vs app/assets/javascripts/refine-stimulus.modern.js.map in refine-rails-2.12.0

- old
+ new

@@ -1 +1 @@ -{"version":3,"file":"refine-stimulus.modern.js","sources":["../../../node_modules/@hotwired/stimulus-webpack-helpers/dist/stimulus-webpack-helpers.js","../../javascript/controllers/refine/server-refresh-controller.js","../../javascript/controllers/refine/add-controller.js","../../javascript/controllers/refine/criterion-form-controller.js","../../javascript/controllers/refine/defaults-controller.js","../../javascript/controllers/refine/delete-controller.js","../../javascript/controllers/refine/filter-pills-controller.js","../../javascript/controllers/refine/popup-controller.js","../../javascript/controllers/refine/modal-controller.js","../../javascript/controllers/refine/search-filter-controller.js","../../javascript/refine/helpers/index.js","../../javascript/controllers/refine/state-controller.js","../../javascript/controllers/refine/stored-filter-controller.js","../../javascript/controllers/refine/submit-form-controller.js","../../javascript/controllers/refine/toggle-controller.js","../../javascript/controllers/refine/turbo-stream-form-controller.js","../../javascript/controllers/refine/turbo-stream-link-controller.js","../../javascript/controllers/refine/typeahead-list-controller.js","../../javascript/controllers/refine/update-controller.js","../../javascript/controllers/refine/date-controller.js","../../javascript/controllers/refine/inline-advanced-modal-controller.js","../../javascript/controllers/fields/shoelace/tab-group-controller.js","../../javascript/controllers/index.js"],"sourcesContent":["/*\nStimulus Webpack Helpers 1.0.0\nCopyright © 2021 Basecamp, LLC\n */\nfunction definitionsFromContext(context) {\n return context.keys()\n .map((key) => definitionForModuleWithContextAndKey(context, key))\n .filter((value) => value);\n}\nfunction definitionForModuleWithContextAndKey(context, key) {\n const identifier = identifierForContextKey(key);\n if (identifier) {\n return definitionForModuleAndIdentifier(context(key), identifier);\n }\n}\nfunction definitionForModuleAndIdentifier(module, identifier) {\n const controllerConstructor = module.default;\n if (typeof controllerConstructor == \"function\") {\n return { identifier, controllerConstructor };\n }\n}\nfunction identifierForContextKey(key) {\n const logicalName = (key.match(/^(?:\\.\\/)?(.+)(?:[_-]controller\\..+?)$/) || [])[1];\n if (logicalName) {\n return logicalName.replace(/_/g, \"-\").replace(/\\//g, \"--\");\n }\n}\n\nexport { definitionForModuleAndIdentifier, definitionForModuleWithContextAndKey, definitionsFromContext, identifierForContextKey };\n","import { Controller } from \"@hotwired/stimulus\"\nimport { FetchRequest } from '@rails/request.js'\n\n\n// Base class for controllers that reload form content from the server\nexport default class extends Controller {\n connect() {\n this.state.finishUpdate()\n }\n\n get state() {\n let currentElement = this.element\n\n while(currentElement !== document.body) {\n if (currentElement.matches('[data-controller~=\"refine--state\"]'))\n return this.application.getControllerForElementAndIdentifier(currentElement, 'refine--state')\n else {\n currentElement = currentElement.parentNode\n }\n }\n\n return null\n }\n\n async refreshFromServer(options = {}) {\n const { includeErrors } = options\n this.state.startUpdate()\n const request = new FetchRequest(\n \"GET\",\n this.state.refreshUrlValue,\n {\n responseKind: \"turbo-stream\",\n query: {\n \"refine_filters_builder[filter_class]\": this.state.filterName,\n \"refine_filters_builder[blueprint_json]\": JSON.stringify(this.state.blueprint),\n \"refine_filters_builder[client_id]\": this.state.clientIdValue,\n include_errors: !!includeErrors\n }\n }\n )\n await request.perform()\n }\n}\n","import ServerRefreshController from './server-refresh-controller'\nimport { FetchRequest } from '@rails/request.js'\n\nexport default class extends ServerRefreshController {\n static values = {\n previousCriterionId: Number,\n }\n\n async criterion() {\n const isValid = await this.validateBlueprint()\n if (isValid) {\n this.state.addCriterion(this.previousCriterionIdValue)\n }\n this.refreshFromServer({includeErrors: !isValid})\n }\n\n async group() {\n const isValid = await this.validateBlueprint()\n if (isValid) {\n this.state.addGroup()\n }\n this.refreshFromServer({includeErrors: !isValid})\n }\n\n async validateBlueprint(blueprint) {\n const { state } = this\n\n const request = new FetchRequest(\n \"GET\",\n this.state.validateBlueprintUrlValue,\n {\n query: {\n \"refine_filters_builder[filter_class]\": this.state.filterName,\n \"refine_filters_builder[blueprint_json]\": JSON.stringify(this.state.blueprint),\n \"refine_filters_builder[client_id]\": this.state.clientIdValue\n }\n }\n )\n const response = await request.perform()\n return response.ok\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\nimport { FetchRequest } from '@rails/request.js'\n\n/*\n This controller handles criteria forms\n (refine/inline/criteria/new|edit)\n*/\nexport default class extends Controller {\n static values = {\n url: String,\n formId: String\n }\n\n async refresh(_event) {\n // update the url with params from the form\n const formElement = document.getElementById(this.formIdValue)\n const formData = new FormData(formElement)\n\n const request = new FetchRequest(\n \"GET\",\n this.urlValue,\n {\n query: formData,\n responseKind: \"turbo-stream\"\n }\n )\n const response = await request.perform()\n }\n\n\n\n}\n","import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n static values = {\n criterionId: Number,\n input: Object,\n };\n\n connect() {\n this.state = this.getStateController()\n\n this.state.updateInput(\n this.criterionIdValue,\n this.inputValue,\n );\n }\n\n getStateController() {\n let currentElement = this.element\n\n while(currentElement !== document.body) {\n const controller = this.application.getControllerForElementAndIdentifier(currentElement, 'refine--state')\n if (controller) {\n return controller\n } else {\n currentElement = currentElement.parentNode\n }\n }\n\n return null\n }\n}\n","import ServerRefreshController from './server-refresh-controller';\n\nexport default class extends ServerRefreshController {\n static values = {\n criterionId: Number,\n }\n\n criterion() {\n const { state, criterionIdValue } = this;\n state.deleteCriterion(criterionIdValue);\n this.refreshFromServer()\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\nimport { FetchRequest } from '@rails/request.js'\n\nexport default class extends Controller {\n static values = {\n submitUrl: String\n }\n\n connect() {\n const urlParams = new URLSearchParams(window.location.search)\n this.existingParams = urlParams\n this.existingParams.delete('stable_id')\n }\n\n delete(event) {\n const { criterionId } = event.currentTarget.dataset\n var index = parseInt(criterionId)\n this.stateController.deleteCriterion(index)\n this.reloadPage()\n }\n\n async reloadPage() {\n const {blueprint} = this.stateController\n const request = new FetchRequest(\n \"POST\",\n this.submitUrlValue,\n {\n responseKind: \"turbo-stream\",\n body: JSON.stringify({\n refine_filters_builder: {\n filter_class: this.stateController.filterName,\n blueprint_json: JSON.stringify(blueprint),\n client_id: this.stateController.clientIdValue\n }\n })\n }\n )\n await request.perform()\n }\n\n redirectToStableId(stableId) {\n const params = new URLSearchParams()\n if (stableId) {\n params.append('stable_id', stableId)\n }\n const allParams = new URLSearchParams({\n ...Object.fromEntries(this.existingParams),\n ...Object.fromEntries(params),\n }).toString()\n const url = `${window.location.pathname}?${allParams}`\n\n history.pushState({}, document.title, url)\n window.location.reload()\n }\n\n get stateController() {\n return this.element.refineStateController\n }\n\n get stabilizeFilterController() {\n return this.element.stabilizeFilterController\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\nimport { useClickOutside } from 'stimulus-use'\n\n// simple controller to hide/show the filter modal\nexport default class extends Controller {\n static targets = [\"frame\"]\n\n static values = {\n src: String,\n isOpen: {type: Boolean, default: false}\n }\n\n connect() {\n useClickOutside(this)\n this.boundHandleKeyUp = this.handleKeyUp.bind(this)\n document.addEventListener(\"keyup\", this.boundHandleKeyUp)\n }\n\n disconnect() {\n document.removeEventListener(\"keyup\", this.boundHandleKeyUp)\n }\n\n show(event) {\n event.preventDefault()\n this.frameTarget.src = this.srcValue;\n this.isOpenValue = true\n }\n\n hide(event) {\n if (this.isOpenValue) {\n event?.preventDefault()\n event?.stopPropagation()\n this.frameTarget.innerHTML = \"\";\n this.isOpenValue = false\n }\n }\n\n clickOutside(event) {\n this.hide(event)\n }\n\n handleKeyUp(event) {\n if (event.key === \"Escape\" || event.key === \"Esc\") {\n this.hide(event)\n }\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\nimport { useClickOutside } from 'stimulus-use'\n\n// simple controller to hide/show the filter modal\nexport default class extends Controller {\n static targets = [\"frame\"]\n\n static values = {\n src: String,\n isOpen: {type: Boolean, default: false}\n }\n\n connect() {\n useClickOutside(this)\n }\n\n disconnect() {\n }\n\n open(event) {\n event.preventDefault()\n this.frameTarget.src = this.srcValue;\n this.isOpenValue = true\n }\n\n close(event) {\n if (this.isOpenValue) {\n event?.preventDefault()\n this.frameTarget.innerHTML = \"\";\n this.isOpenValue = false\n }\n }\n\n clickOutside(event) {\n this.close(event)\n }\n\n\n}\n","import { Controller } from \"@hotwired/stimulus\"\nimport { FetchRequest } from '@rails/request.js'\n\nexport default class extends Controller {\n static values = {\n submitUrl: String\n }\n\n\n search(event) {\n event.preventDefault()\n this.submitFilter()\n document.activeElement.blur()\n }\n\n async submitFilter() {\n const {blueprint} = this.stateController\n const request = new FetchRequest(\n \"POST\",\n this.submitUrlValue,\n {\n responseKind: \"turbo-stream\",\n body: JSON.stringify({\n refine_filters_builder: {\n filter_class: this.stateController.filterName,\n blueprint_json: JSON.stringify(blueprint),\n client_id: this.stateController.clientIdValue\n }\n })\n }\n )\n await request.perform()\n }\n\n get stateController() {\n return this\n .element\n .querySelector('[data-controller~=\"refine--state\"]')\n .refineStateController\n }\n\n loadResults({detail: {url}}) {\n console.log(\"filter submit success\")\n if (window.Turbo) {\n window.Turbo.visit(url)\n } else {\n window.location.href = url\n }\n }\n}\n","// Polyfill for custom events in IE9-11\n// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#polyfill\n;(function () {\n if (typeof window.CustomEvent === 'function') return false\n\n function CustomEvent(event, params) {\n params = params || { bubbles: false, cancelable: false, detail: undefined }\n var evt = document.createEvent('CustomEvent')\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail)\n return evt\n }\n\n CustomEvent.prototype = window.Event.prototype\n\n window.CustomEvent = CustomEvent\n\n // eslint expects a return here\n return true\n})()\n\nexport const filterStabilizedEvent = (element, stableId, filterName) => {\n const event = new CustomEvent('filter-stabilized', {\n bubbles: true,\n cancelable: true,\n detail: {\n stableId,\n filterName,\n },\n })\n element.dispatchEvent(event)\n}\n\nexport const filterUnstableEvent = (blueprint) => {\n const event = new CustomEvent('filter-unstable', {\n bubbles: true,\n cancelable: true,\n detail: {\n blueprint,\n },\n })\n window.dispatchEvent(event)\n}\n\nexport const filterInvalidEvent = ({blueprint, errors}) => {\n const event = new CustomEvent('filter-invalid', {\n bubbles: true,\n cancelable: true,\n detail: {\n blueprint,\n errors,\n },\n })\n window.dispatchEvent(event)\n}\n\nexport const filterStoredEvent = (storedFilterId) => {\n const event = new CustomEvent('filter-stored', {\n bubbles: true,\n cancelable: true,\n detail: {\n storedFilterId,\n },\n })\n window.dispatchEvent(event)\n}\n\nexport const blueprintUpdatedEvent = (element, {blueprint, formId}) => {\n const event = new CustomEvent('blueprint-updated', {\n bubbles: true,\n cancelable: true,\n detail: {\n blueprint,\n formId\n },\n })\n element.dispatchEvent(event)\n}\n","import { Controller } from \"@hotwired/stimulus\"\nimport { delegate, abnegate } from 'jquery-events-to-dom-events'\nimport { blueprintUpdatedEvent } from '../../refine/helpers'\nimport { isEqual } from 'lodash'\n\nconst criterion = (id, depth, condition) => {\n const component = condition?.component\n const meta = condition?.meta || { clauses: [], options: {}}\n const refinements = condition?.refinements || []\n const { clauses, options } = meta\n let selected\n if (component === 'option-condition') {\n selected = options[0] ? [options[0].id] : []\n } else {\n selected = undefined\n }\n // Set newInput based on component\n\n let newInput = {\n clause: clauses[0]?.id,\n selected: selected,\n }\n\n // If refinements are present, add to input array\n refinements.forEach((refinement) => {\n const { meta, component } = refinement\n const { clauses, options } = meta\n let selected\n if (component === 'option-condition') {\n selected = options[0] ? [options[0].id] : []\n } else {\n selected = undefined\n }\n newInput[refinement.id] = {\n clause: clauses[0].id,\n selected: selected,\n }\n })\n\n return {\n depth,\n type: 'criterion',\n condition_id: id,\n input: newInput,\n }\n}\n\nconst or = function (depth) {\n depth = depth === undefined ? 0 : depth\n return {\n depth,\n type: 'conjunction',\n word: 'or',\n }\n}\n\nconst and = function (depth) {\n depth = depth === undefined ? 1 : depth\n return {\n depth,\n type: 'conjunction',\n word: 'and',\n }\n}\nexport default class extends Controller {\n static values = {\n blueprint: Array,\n conditions: Array,\n className: String,\n refreshUrl: String,\n clientId: String,\n validateBlueprintUrl: String,\n defaultConditionId: String\n }\n static targets = ['loading']\n\n\n connect() {\n // for select2 jquery events and datepicker\n this.element.refineStateController = this\n this.changeDelegate = delegate('change', ['event', 'picker'])\n this.blueprint = this.blueprintValue\n this.conditions = this.conditionsValue\n this.filterName = this.classNameValue\n this.conditionsLookup = this.conditions.reduce((lookup, condition) => {\n lookup[condition.id] = condition\n return lookup\n }, {})\n this.loadingTimeout = null\n blueprintUpdatedEvent(this.element, {blueprint: this.blueprint, formId: this.formIdValue})\n }\n\n disconnect() {\n abnegate('change', this.changeDelegate)\n }\n\n startUpdate() {\n if (this.loadingTimeout) {\n window.clearTimeout(this.loadingTimeout)\n }\n // only show the loading overlay if it's taking a long time\n // to render the updates\n this.loadingTimeout = window.setTimeout(() => {\n this.loadingTarget.classList.remove('hidden')\n }, 1000)\n }\n\n finishUpdate() {\n if (this.loadingTimeout) {\n window.clearTimeout(this.loadingTimeout)\n }\n this.loadingTarget.classList.add('hidden')\n }\n\n conditionConfigFor(conditionId) {\n return this.conditionsLookup[conditionId]\n }\n\n addGroup() {\n const { blueprint, conditions } = this\n const condition = ( conditions.find(c => c.id == this.defaultConditionIdValue) || conditions[0] )\n const { meta } = condition\n\n if (this.blueprint.length > 0) {\n this.blueprint.push(or())\n }\n this.blueprint.push(criterion(condition.id, 1, condition))\n blueprintUpdatedEvent(this.element, {blueprint: this.blueprint, formId: this.formIdValue})\n }\n\n addCriterion(previousCriterionId) {\n const { blueprint, conditions } = this\n const condition = ( conditions.find(c => c.id == this.defaultConditionIdValue) || conditions[0] )\n const { meta } = condition\n blueprint.splice(previousCriterionId + 1, 0, and(), criterion(condition.id, 1, condition))\n blueprintUpdatedEvent(this.element, {blueprint: this.blueprint, formId: this.formIdValue})\n }\n\n deleteCriterion(criterionId) {\n /**\n To support 'groups' there is some complicated logic for deleting criterion.\n\n Imagine this simplified blueprint: [eq, and, sw, or, eq]\n\n User clicks to delete the last eq. We also have to delete the preceding or\n otherwise we're left with a hanging empty group\n\n What if the user deletes the sw? We have to clean up the preceding and.\n\n Imagine another scenario: [eq or sw and ew]\n Now we delete the first eq but this time we need to clean up the or.\n\n These conditionals cover these cases.\n **/\n const { blueprint } = this\n const previous = blueprint[criterionId - 1]\n const next = blueprint[criterionId + 1]\n\n const nextIsOr = next && next.word === 'or'\n const previousIsOr = previous && previous.word === 'or'\n\n const nextIsRightParen = nextIsOr || !next\n const previousIsLeftParen = previousIsOr || !previous\n\n const isFirstInGroup = previousIsLeftParen && !nextIsRightParen\n const isLastInGroup = previousIsLeftParen && nextIsRightParen\n const isLastCriterion = !previous && !next\n\n if (isLastCriterion) {\n this.blueprint = []\n } else if (isLastInGroup && previousIsOr) {\n blueprint.splice(criterionId - 1, 2)\n } else if (isLastInGroup && !previous) {\n blueprint.splice(criterionId, 2)\n } else if (isFirstInGroup) {\n blueprint.splice(criterionId, 2)\n } else {\n blueprint.splice(criterionId - 1, 2)\n }\n\n blueprintUpdatedEvent(this.element, {blueprint: this.blueprint, formId: this.formIdValue})\n }\n\n /*\n Updates a criterion in the blueprint\n Returns true if an update was actually performed, or false if no-op\n */\n replaceCriterion(criterionId, conditionId, condition) {\n const criterionRow = this.blueprint[criterionId]\n if (criterionRow.type !== 'criterion') {\n throw new Error(\n `You can't call updateConditionId on a non-criterion type. Trying to update ${JSON.stringify(criterion)}`\n )\n }\n const existingCriterion = this.blueprint[criterionId]\n const newCriterion = criterion(conditionId, criterionRow.depth, condition)\n if (isEqual(existingCriterion, newCriterion)) {\n return false\n } else {\n this.blueprint[criterionId] = newCriterion\n blueprintUpdatedEvent(this.element, {blueprint: this.blueprint, formId: this.formIdValue})\n return true\n }\n }\n\n updateInput(criterionId, input, inputId) {\n // Input id is an array of hash keys that define the path for this input such as [\"input\", \"date_refinement\"]\n const { blueprint } = this\n const criterion = blueprint[criterionId]\n inputId = inputId || 'input'\n const blueprintPath = inputId.split(', ')\n // If the inputId contains more than one element, add input at appropriate depth\n if (blueprintPath.length > 1) {\n criterion[blueprintPath[0]][blueprintPath[1]] = { ...criterion[blueprintPath[0]][blueprintPath[1]], ...input }\n } else {\n criterion[inputId] = { ...criterion[inputId], ...input }\n }\n blueprintUpdatedEvent(this.element, {blueprint: this.blueprint, formId: this.formIdValue})\n }\n\n}\n","import { Controller } from \"@hotwired/stimulus\"\nimport { filterStoredEvent } from '../../refine/helpers'\n\nexport default class extends Controller {\n static targets = ['blueprintField']\n static values = { formId: String, stateDomId: String }\n\n connect() {\n const stateController = document\n .getElementById(this.stateDomIdValue)\n .refineStateController\n this.blueprintFieldTarget.value = JSON.stringify(stateController.blueprint)\n console.log(\"connect\", this.blueprintFieldTarget.value)\n }\n\n updateBlueprintField(event) {\n if (event.detail.formId != this.formIdValue) { return null }\n const { detail } = event\n const { blueprint } = detail\n this.blueprintFieldTarget.value = JSON.stringify(blueprint)\n console.log(\"update blueprint\", this.blueprintFieldTarget.value)\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n submit(event) {\n event.preventDefault()\n this.element.requestSubmit()\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\n\n// simple controller to hide/show the filter modal\nexport default class extends Controller {\n static targets = [\"content\"]\n\n toggle(_event) {\n this.contentTargets.forEach(node => {\n node.toggleAttribute(\"hidden\")\n })\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\nimport { FetchRequest } from '@rails/request.js'\n\n/*\n attach to a form element to have it submit to a turbo-stream endpoint\n\n <form action=\"/contacts\" data-controller=\"refine--turbo-stream-form\" data-action=\"submit->refine--turbo-stream-form#submit\">\n\n Turbo is supposed to handle this natively but we're seeing issues when the form is inside an iframe\n*/\nexport default class extends Controller {\n async submit(event) {\n event.preventDefault()\n const request = new FetchRequest(\n (this.element.method || \"POST\"),\n this.element.action,\n {\n responseKind: \"turbo-stream\",\n body: new FormData(this.element)\n }\n )\n await request.perform()\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\nimport { FetchRequest } from '@rails/request.js'\n\n/*\n attach to a link element to have it request turbo stream responses\n\n <a href=\"/contacts\" data-controller=\"refine--turbo-stream-link\" data-action=\"refine--turbo-stream-link#get\">Click me</a>\n\n Turbo is supposed to handle this natively with data-turbo-stream but we're\n seeing issues using that attribute inside iframes\n*/\nexport default class extends Controller {\n async visit(event) {\n event.preventDefault()\n const request = new FetchRequest(\n (this.element.dataset.turboMethod || \"GET\"),\n this.element.href,\n {\n responseKind: \"turbo-stream\",\n }\n )\n await request.perform()\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n\n static targets = ['listItem', 'category', 'recommended']\n\n filter(event) {\n const query = event.currentTarget.value.toLowerCase()\n const visibleCategories = new Set()\n\n // hide / show listItem links that match the query and note which\n // categories should be visible\n this.listItemTargets.forEach(listItemNode => {\n const listItemName = listItemNode.dataset.listItemValue.toLowerCase()\n if (listItemName.includes(query)) {\n listItemNode.hidden = false\n visibleCategories.add(listItemNode.dataset.category)\n } else {\n listItemNode.hidden = true\n }\n })\n\n this.recommendedTargets.forEach(recommendedNode => {\n (query !== '' && visibleCategories.size === 0) ? recommendedNode.hidden = true : recommendedNode.hidden = false\n })\n\n // hide / show category headers that have visible listItems\n this.categoryTargets.forEach(categoryNode => {\n const categoryName = categoryNode.innerHTML\n if (visibleCategories.has(categoryName)) {\n categoryNode.hidden = false\n } else {\n categoryNode.hidden = true\n }\n })\n }\n}\n","import ServerRefreshController from './server-refresh-controller'\nimport { debounce } from 'lodash'\n\nexport default class extends ServerRefreshController {\n static values = {\n criterionId: Number,\n }\n\n initialize() {\n this.updateBlueprint = debounce((event, value, inputKey) => {\n this.value(event, value, inputKey)\n }, 500)\n }\n\n refinedFilter(event) {\n const { criterionIdValue, state } = this\n const dataset = event.target.dataset\n const inputId = dataset.inputId\n\n state.updateInput(\n criterionIdValue,\n {\n id: event.target.value,\n },\n inputId\n )\n this.refreshFromServer()\n }\n\n clause(event) {\n const { criterionIdValue, state } = this\n const dataset = event.target.dataset\n const inputId = dataset.inputId\n state.updateInput(\n criterionIdValue,\n {\n clause: event.target.value,\n },\n inputId\n )\n this.refreshFromServer()\n }\n\n selected(event) {\n const { target: select } = event\n const options = Array.prototype.slice.call(select.options)\n const selectedOptions = options.filter((option) => option.selected)\n const selected = selectedOptions.map((option) => option.value)\n this.value(event, selected, 'selected')\n }\n\n value(event, value, inputKey) {\n const { criterionIdValue, state } = this\n const dataset = event.target.dataset\n const inputId = dataset.inputId\n inputKey = inputKey || dataset.inputKey || 'value'\n value = value || event.target.value\n value = value.trim()\n state.updateInput(\n criterionIdValue,\n {\n [inputKey]: value,\n },\n inputId\n )\n }\n\n condition(event) {\n const { criterionIdValue, state } = this\n const element = event.target\n let newConditionId = element.value\n if (!newConditionId) newConditionId = element.querySelector('select').value \n const config = this.state.conditionConfigFor(newConditionId)\n const updatePerformed = state.replaceCriterion(criterionIdValue, newConditionId, config)\n if (updatePerformed) {\n this.refreshFromServer()\n }\n }\n\n // Prevent form submission when hitting enter in a text box\n cancelEnter(event) {\n if (event.code === \"Enter\") {\n event.preventDefault()\n event.stopPropagation()\n }\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\nimport moment from 'moment'\nrequire('daterangepicker/daterangepicker.css')\n\n// requires jQuery, moment, might want to consider a vanilla JS alternative\nimport $ from 'jquery' // ensure jquery is loaded before daterangepicker\nimport 'daterangepicker'\n\nexport default class extends Controller {\n static targets = [\n 'field',\n 'hiddenField',\n 'clearButton',\n ]\n\n static values = {\n includeTime: Boolean,\n futureOnly: Boolean,\n drops: String,\n inline: Boolean,\n dateFormat: String,\n timeFormat: String,\n isAmPm: Boolean,\n locale: { type: String, default: 'en' },\n datetimeFormat: { type: String, default: 'MM/DD/YYYY h:mm A' },\n pickerLocale: { type: Object, default: {} },\n }\n\n connect() {\n this.initPluginInstance()\n }\n\n disconnect() {\n this.teardownPluginInstance()\n }\n\n clearDate(event) {\n // don't submit the form, unless it originated from the cancel/clear button\n event.preventDefault()\n\n window.$(this.fieldTarget).val('')\n\n this.dispatch('value-cleared')\n }\n\n applyDateToField(event, picker) {\n const format = this.includeTimeValue ? this.timeFormatValue : this.dateFormatValue\n\n const momentVal = picker\n ? moment(picker.startDate.toISOString())\n : moment(this.fieldTarget.value, 'YYYY-MM-DDTHH:mm').format('YYYY-MM-DDTHH:mm')\n const displayVal = momentVal.format(format)\n const dataVal = this.includeTimeValue ? momentVal.toISOString(true) : momentVal.format('YYYY-MM-DD')\n\n this.fieldTarget.value = displayVal\n this.hiddenFieldTarget.value = dataVal\n // bubble up a change event when the input is updated for other listeners\n window.$(this.fieldTarget).trigger('change', picker)\n\n // emit native change event\n this.hiddenFieldTarget.dispatchEvent(new Event('change', { detail: picker, bubbles: true }))\n }\n\n initPluginInstance() {\n const localeValues = this.pickerLocaleValue\n const isAmPm = this.isAmPmValue\n localeValues['format'] = this.includeTimeValue ? this.timeFormatValue : this.dateFormatValue\n\n window.$(this.fieldTarget).daterangepicker({\n singleDatePicker: true,\n timePicker: this.includeTimeValue,\n timePickerIncrement: 5,\n autoUpdateInput: false,\n autoApply: true,\n minDate: this.futureOnlyValue ? new Date() : false,\n locale: localeValues,\n parentEl: $(this.element),\n drops: this.dropsValue ? this.dropsValue : 'down',\n timePicker24Hour: !isAmPm,\n })\n\n window.$(this.fieldTarget).on('apply.daterangepicker', this.applyDateToField.bind(this))\n window.$(this.fieldTarget).on('cancel.daterangepicker', this.clearDate.bind(this))\n window.$(this.fieldTarget).on('showCalendar.daterangepicker', this.showCalendar.bind(this))\n\n this.pluginMainEl = this.fieldTarget\n this.plugin = $(this.pluginMainEl).data('daterangepicker') // weird\n\n if (this.inlineValue) {\n this.element.classList.add('date-input--inline')\n }\n\n }\n \n teardownPluginInstance() {\n if (this.plugin === undefined) {\n return\n }\n\n $(this.pluginMainEl).off('apply.daterangepicker')\n $(this.pluginMainEl).off('cancel.daterangepicker')\n $(this.pluginMainEl).off('showCalendar.daterangepicker')\n\n // revert to original markup, remove any event listeners\n this.plugin.remove()\n\n }\n\n showCalendar() {\n this.dispatch('show-calendar')\n }\n\n}\n","import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n\n static targets = ['searchBarInput']\n\n showSearchBar(event) {\n this.searchBarInputTarget.hidden = false\n }\n\n hideSearchBar(event) {\n this.searchBarInputTarget.hidden = true\n }\n \n}\n","// to be used with sl-tab-group\nimport { Controller } from \"@hotwired/stimulus\"\n\n// This controller is used to handle the tab group component\n// @see https://shoelace.style/components/tab-group\n// @param keepScrollPosition [Boolean] - If true, the scroll position will be kept when changing tabs\n// @usage <div data-controller=\"shoelace--tab-group\" data-shoelace--tab-group-keep-scroll-position-value=\"true\">\n\nexport default class extends Controller {\n static values = {\n keepScrollPosition: { type: Boolean, default: false },\n }\n\n connect() {\n this.currentScrollYPosition = 0\n this.navigateToTab = this.navigateToTab.bind(this)\n this.handleTabShow = this.handleTabShow.bind(this)\n\n this.navigateToTab()\n\n document.addEventListener('turbo:load', this.navigateToTab)\n this.element.addEventListener('sl-tab-show', this.handleTabShow)\n }\n\n disconnect() {\n document.removeEventListener('turbo:load', this.navigateToTab)\n this.element.removeEventListener('sl-tab-show', this.handleTabShow)\n }\n\n handleTabShow(event) {\n this.setLocationHash(event)\n\n if (this.keepScrollPositionValue) {\n this.handleTabChange()\n }\n }\n\n setLocationHash(event) {\n window.location.hash = event.detail.name\n }\n\n navigateToTab() {\n let hash = window.location.hash.toString()\n if (hash) {\n this.element.show(hash.slice(1))\n } else {\n /*\n * Turbo doesn't currently support hashes on redirects (see https://github.com/hotwired/turbo/issues/825)\n * so we've created a workaround. Pass `redirect_anchor` as a query param, and the component will convert\n * it to a hash and delete the query param. e.g. `some_url?redirect_anchor=store_upsells`\n */\n const params = new URLSearchParams(window.location.search)\n const redirectedHashParam = params.get('redirect_anchor')\n if (redirectedHashParam) {\n params.delete('redirect_anchor')\n let newParams = params.toString()\n window.history.replaceState(\n null,\n '',\n [window.location.pathname, newParams ? `?${newParams}` : '', '#', redirectedHashParam].join('')\n )\n }\n }\n }\n\n handleTabChange() {\n this.currentScrollYPosition = window.scrollY\n }\n\n /**\n * Programmatically reveal a sl-tab-panel via action params.\n * @see Shoelace sl-tab-group show() method\n * @see https://shoelace.style/components/tab-group?id=methods\n *\n * @param {Event} event\n * @param {string} event.params.showPanel - the name attribute of the sl-tab-panel to show\n * @example <button type='button' data-action=\"click->shoelace--tab-group#show\"\n * data-shoelace--tab-group-show-panel-param=\"mypanelname\">\n * @returns {void}\n */\n show(event) {\n const { showPanel } = event.params\n this.element.show(showPanel)\n }\n}\n","import { identifierForContextKey } from \"@hotwired/stimulus-webpack-helpers\"\n\nimport AddController from './refine/add-controller'\nimport CriterionFormController from './refine/criterion-form-controller'\nimport DefaultsController from './refine/defaults-controller'\nimport DeleteController from './refine/delete-controller'\nimport FilterPillsController from './refine/filter-pills-controller'\nimport PopupController from './refine/popup-controller'\nimport ModalController from './refine/modal-controller'\nimport SearchFilterController from './refine/search-filter-controller'\nimport ServerRefreshController from './refine/server-refresh-controller'\nimport StateController from './refine/state-controller'\nimport StoredFilterController from './refine/stored-filter-controller'\nimport SubmitForm from './refine/submit-form-controller'\nimport ToggleController from './refine/toggle-controller'\nimport TurboStreamFormController from './refine/turbo-stream-form-controller'\nimport TurboStreamLinkController from './refine/turbo-stream-link-controller'\nimport TypeaheadListController from './refine/typeahead-list-controller'\nimport UpdateController from './refine/update-controller'\nimport DateController from './refine/date-controller'\nimport InlineAdvancedModalController from \"./refine/inline-advanced-modal-controller\"\nimport TabGroupController from \"./fields/shoelace/tab-group-controller\"\n\nexport const controllerDefinitions = [\n [AddController, 'refine/add-controller.js'],\n [CriterionFormController, 'refine/criterion-form-controller.js'],\n [DefaultsController, 'refine/defaults-controller.js'],\n [DeleteController, 'refine/delete-controller.js'],\n [FilterPillsController, 'refine/filter-pills-controller.js'],\n [PopupController, 'refine/popup-controller.js'],\n [ModalController, 'refine/modal-controller.js'],\n [SearchFilterController, 'refine/search-filter-controller.js'],\n [ServerRefreshController, 'refine/server-refresh-controller.js'],\n [StateController, 'refine/state-controller.js'],\n [StoredFilterController, 'refine/stored-filter-controller.js'],\n [SubmitForm, 'refine/submit-form-controller.js'],\n [ToggleController, 'refine/toggle-controller.js'],\n [TurboStreamFormController, 'refine/turbo-stream-form-controller.js'],\n [TurboStreamLinkController, 'refine/turbo-stream-link-controller.js'],\n [TypeaheadListController, './refine/typeahead-list-controller.js'],\n [UpdateController, 'refine/update-controller.js'],\n [DateController, 'refine/date-controller.js'],\n [InlineAdvancedModalController, 'refine/inline-advanced-modal-controller.js'],\n [TabGroupController, 'fields/shoelace/tab-group-controller.js']\n].map(function(d) {\n const key = d[1]\n const controller = d[0]\n return {\n identifier: identifierForContextKey(key),\n controllerConstructor: controller\n }\n})\n\nexport {\n AddController,\n CriterionFormController,\n DefaultsController,\n DeleteController,\n FilterPillsController,\n PopupController,\n ModalController,\n SearchFilterController,\n ServerRefreshController,\n StateController,\n StoredFilterController,\n SubmitForm,\n ToggleController,\n TurboStreamFormController,\n TurboStreamLinkController,\n TypeaheadListController,\n UpdateController,\n DateController,\n InlineAdvancedModalController,\n TabGroupController\n}\n"],"names":["identifierForContextKey","key","logicalName","match","replace","Controller","connect","this","state","finishUpdate","currentElement","element","document","body","matches","application","getControllerForElementAndIdentifier","parentNode","async","options","includeErrors","startUpdate","request","FetchRequest","refreshUrlValue","responseKind","query","filterName","JSON","stringify","blueprint","clientIdValue","include_errors","perform","ServerRefreshController","isValid","validateBlueprint","addCriterion","previousCriterionIdValue","refreshFromServer","addGroup","validateBlueprintUrlValue","ok","values","previousCriterionId","Number","_event","formElement","getElementById","formIdValue","formData","FormData","urlValue","url","String","formId","getStateController","updateInput","criterionIdValue","inputValue","controller","criterionId","input","Object","criterion","deleteCriterion","urlParams","URLSearchParams","window","location","search","existingParams","delete","event","currentTarget","dataset","index","parseInt","stateController","reloadPage","submitUrlValue","refine_filters_builder","filter_class","blueprint_json","client_id","redirectToStableId","stableId","params","append","allParams","fromEntries","toString","pathname","history","pushState","title","reload","refineStateController","stabilizeFilterController","submitUrl","_class","useClickOutside","boundHandleKeyUp","handleKeyUp","bind","addEventListener","disconnect","removeEventListener","show","preventDefault","frameTarget","src","srcValue","isOpenValue","hide","stopPropagation","innerHTML","clickOutside","targets","isOpen","type","Boolean","default","open","close","submitFilter","activeElement","blur","querySelector","loadResults","detail","console","log","Turbo","visit","href","CustomEvent","bubbles","cancelable","undefined","evt","createEvent","initCustomEvent","prototype","Event","blueprintUpdatedEvent","dispatchEvent","id","depth","condition","_clauses$","component","meta","clauses","refinements","selected","newInput","clause","forEach","refinement","condition_id","changeDelegate","delegate","blueprintValue","conditions","conditionsValue","classNameValue","conditionsLookup","reduce","lookup","loadingTimeout","abnegate","clearTimeout","setTimeout","loadingTarget","classList","remove","add","conditionConfigFor","conditionId","find","c","defaultConditionIdValue","length","push","word","splice","previous","next","previousIsOr","nextIsRightParen","previousIsLeftParen","isLastInGroup","replaceCriterion","criterionRow","Error","existingCriterion","newCriterion","isEqual","inputId","blueprintPath","split","Array","className","refreshUrl","clientId","validateBlueprintUrl","defaultConditionId","stateDomIdValue","blueprintFieldTarget","value","updateBlueprintField","stateDomId","submit","requestSubmit","toggle","contentTargets","node","toggleAttribute","TurboStreamFormController","method","action","turboMethod","filter","toLowerCase","visibleCategories","Set","listItemTargets","listItemNode","listItemValue","includes","hidden","category","recommendedTargets","recommendedNode","size","categoryTargets","categoryNode","has","initialize","updateBlueprint","debounce","inputKey","refinedFilter","target","select","slice","call","option","map","trim","newConditionId","config","cancelEnter","code","require","initPluginInstance","teardownPluginInstance","clearDate","$","fieldTarget","val","dispatch","applyDateToField","picker","format","includeTimeValue","timeFormatValue","dateFormatValue","momentVal","moment","startDate","toISOString","displayVal","dataVal","hiddenFieldTarget","trigger","localeValues","pickerLocaleValue","isAmPm","isAmPmValue","daterangepicker","singleDatePicker","timePicker","timePickerIncrement","autoUpdateInput","autoApply","minDate","futureOnlyValue","Date","locale","parentEl","drops","dropsValue","timePicker24Hour","on","showCalendar","pluginMainEl","plugin","data","inlineValue","off","includeTime","futureOnly","inline","dateFormat","timeFormat","datetimeFormat","pickerLocale","showSearchBar","searchBarInputTarget","hideSearchBar","currentScrollYPosition","navigateToTab","handleTabShow","setLocationHash","keepScrollPositionValue","handleTabChange","hash","name","redirectedHashParam","get","newParams","replaceState","join","scrollY","showPanel","keepScrollPosition","controllerDefinitions","AddController","CriterionFormController","DefaultsController","DeleteController","FilterPillsController","PopupController","ModalController","SearchFilterController","StateController","StoredFilterController","SubmitForm","ToggleController","TurboStreamLinkController","TypeaheadListController","UpdateController","DateController","InlineAdvancedModalController","TabGroupController","d","identifier","controllerConstructor"],"mappings":"wUAqBA,SAASA,EAAwBC,GAC7B,MAAMC,GAAeD,EAAIE,MAAM,2CAA6C,IAAI,GAChF,GAAID,EACA,OAAOA,EAAYE,QAAQ,KAAM,KAAKA,QAAQ,MAAO,MCnBhCC,MAAAA,UAAAA,EAC3BC,UACEC,KAAKC,MAAMC,eAGTD,YACF,IAAIE,EAAiBH,KAAKI,QAE1B,KAAMD,IAAmBE,SAASC,MAAM,CACtC,GAAIH,EAAeI,QAAQ,sCACzB,OAAYC,KAAAA,YAAYC,qCAAqCN,EAAgB,iBAE7EA,EAAiBA,EAAeO,WAIpC,OACD,KAEsBC,wBAACC,EAAU,IAChC,MAAMC,cAAEA,GAAkBD,EAC1BZ,KAAKC,MAAMa,cACX,MAAMC,EAAU,IAAIC,EAClB,MACAhB,KAAKC,MAAMgB,gBACX,CACEC,aAAc,eACdC,MAAO,CACL,uCAAwCnB,KAAKC,MAAMmB,WACnD,yCAA0CC,KAAKC,UAAUtB,KAAKC,MAAMsB,WACpE,oCAAqCvB,KAAKC,MAAMuB,cAChDC,iBAAkBZ,WAIlBE,EAAQW,WCrCWC,MAAAA,UAAAA,EAKZhB,kBACb,MAAMiB,QAAqBC,KAAAA,oBACvBD,GACF5B,KAAKC,MAAM6B,aAAa9B,KAAK+B,0BAE/B/B,KAAKgC,kBAAkB,CAACnB,eAAgBe,IAG/BjB,cACT,MAAMiB,QAAqBC,KAAAA,oBACvBD,GACF5B,KAAKC,MAAMgC,WAEbjC,KAAKgC,kBAAkB,CAACnB,eAAgBe,IAGnBjB,wBA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K,EAAO1P,OAAOC,SAASyP,KAAKnO,WAChC,GAAImO,EACFvT,KAAKI,QAAQiG,KAAKkN,EAAKxE,MAAM,QACxB,CAML,MAAM/J,EAAS,IAAIpB,gBAAgBC,OAAOC,SAASC,QAC7C0P,EAAsBzO,EAAO0O,IAAI,mBACvC,GAAID,EAAqB,CACvBzO,EAAOf,OAAO,mBACd,IAAI0P,EAAY3O,EAAOI,WACvBvB,OAAOyB,QAAQsO,aACb,KACA,GACA,CAAC/P,OAAOC,SAASuB,SAAUsO,EAAa,IAAGA,IAAc,GAAI,IAAKF,GAAqBI,KAAK,OAMpGP,kBACEtT,KAAKiT,uBAAyBpP,OAAOiQ,QAcvCzN,KAAKnC,GACH,MAAM6P,UAAEA,GAAc7P,EAAMc,OAC5BhF,KAAKI,QAAQiG,KAAK0N,MAzEb3R,OAAS,CACd4R,mBAAoB,CAAE/M,KAAMC,QAASC,SAAS,ICarC8M,MAAAA,EAAwB,CACnC,CAACC,EAAe,4BAChB,CAACC,EAAyB,uCAC1B,CAACC,EAAoB,iCACrB,CAACC,EAAkB,+BACnB,CAACC,EAAuB,qCACxB,CAACC,EAAiB,8BAClB,CAACC,EAAiB,8BAClB,CAACC,EAAwB,sCACzB,CAAC9S,EAAyB,uCAC1B,CAAC+S,EAAiB,8BAClB,CAACC,EAAwB,sCACzB,CAACC,EAAY,oCACb,CAACC,EAAkB,+BACnB,CAACzH,EAA2B,0CAC5B,CAAC0H,EAA2B,0CAC5B,CAACC,EAAyB,yCAC1B,CAACC,EAAkB,+BACnB,CAACC,EAAgB,6BACjB,CAACC,EAA+B,8CAChC,CAACC,EAAoB,4CACrBjG,IAAI,SAASkG,GACb,MACM/R,EAAa+R,EAAE,GACrB,MAAO,CACLC,WAAY5V,EAHF2V,EAAE,IAIZE,sBAAuBjS"} +{"version":3,"file":"refine-stimulus.modern.js","sources":["../../../node_modules/@hotwired/stimulus-webpack-helpers/dist/stimulus-webpack-helpers.js","../../javascript/controllers/refine/server-refresh-controller.js","../../javascript/controllers/refine/add-controller.js","../../javascript/controllers/refine/criterion-form-controller.js","../../javascript/controllers/refine/defaults-controller.js","../../javascript/controllers/refine/delete-controller.js","../../javascript/controllers/refine/filter-pills-controller.js","../../javascript/controllers/refine/popup-controller.js","../../javascript/controllers/refine/modal-controller.js","../../javascript/controllers/refine/search-filter-controller.js","../../javascript/refine/helpers/index.js","../../javascript/controllers/refine/state-controller.js","../../javascript/controllers/refine/stored-filter-controller.js","../../javascript/controllers/refine/submit-form-controller.js","../../javascript/controllers/refine/toggle-controller.js","../../javascript/controllers/refine/turbo-stream-form-controller.js","../../javascript/controllers/refine/turbo-stream-link-controller.js","../../javascript/controllers/refine/typeahead-list-controller.js","../../javascript/controllers/refine/update-controller.js","../../javascript/controllers/refine/date-controller.js","../../javascript/controllers/refine/inline-advanced-modal-controller.js","../../javascript/controllers/fields/shoelace/tab-group-controller.js","../../javascript/controllers/index.js"],"sourcesContent":["/*\nStimulus Webpack Helpers 1.0.0\nCopyright © 2021 Basecamp, LLC\n */\nfunction definitionsFromContext(context) {\n return context.keys()\n .map((key) => definitionForModuleWithContextAndKey(context, key))\n .filter((value) => value);\n}\nfunction definitionForModuleWithContextAndKey(context, key) {\n const identifier = identifierForContextKey(key);\n if (identifier) {\n return definitionForModuleAndIdentifier(context(key), identifier);\n }\n}\nfunction definitionForModuleAndIdentifier(module, identifier) {\n const controllerConstructor = module.default;\n if (typeof controllerConstructor == \"function\") {\n return { identifier, controllerConstructor };\n }\n}\nfunction identifierForContextKey(key) {\n const logicalName = (key.match(/^(?:\\.\\/)?(.+)(?:[_-]controller\\..+?)$/) || [])[1];\n if (logicalName) {\n return logicalName.replace(/_/g, \"-\").replace(/\\//g, \"--\");\n }\n}\n\nexport { definitionForModuleAndIdentifier, definitionForModuleWithContextAndKey, definitionsFromContext, identifierForContextKey };\n","import { Controller } from \"@hotwired/stimulus\"\nimport { FetchRequest } from '@rails/request.js'\n\n\n// Base class for controllers that reload form content from the server\nexport default class extends Controller {\n connect() {\n this.state.finishUpdate()\n }\n\n get state() {\n let currentElement = this.element\n\n while(currentElement !== document.body) {\n if (currentElement.matches('[data-controller~=\"refine--state\"]'))\n return this.application.getControllerForElementAndIdentifier(currentElement, 'refine--state')\n else {\n currentElement = currentElement.parentNode\n }\n }\n\n return null\n }\n\n async refreshFromServer(options = {}) {\n const { includeErrors } = options\n this.state.startUpdate()\n const request = new FetchRequest(\n \"GET\",\n this.state.refreshUrlValue,\n {\n responseKind: \"turbo-stream\",\n query: {\n \"refine_filters_builder[filter_class]\": this.state.filterName,\n \"refine_filters_builder[blueprint_json]\": JSON.stringify(this.state.blueprint),\n \"refine_filters_builder[client_id]\": this.state.clientIdValue,\n include_errors: !!includeErrors\n }\n }\n )\n await request.perform()\n }\n}\n","import ServerRefreshController from './server-refresh-controller'\nimport { FetchRequest } from '@rails/request.js'\n\nexport default class extends ServerRefreshController {\n static values = {\n previousCriterionId: Number,\n }\n\n async criterion() {\n const isValid = await this.validateBlueprint()\n if (isValid) {\n this.state.addCriterion(this.previousCriterionIdValue)\n }\n this.refreshFromServer({includeErrors: !isValid})\n }\n\n async group() {\n const isValid = await this.validateBlueprint()\n if (isValid) {\n this.state.addGroup()\n }\n this.refreshFromServer({includeErrors: !isValid})\n }\n\n async validateBlueprint(blueprint) {\n const { state } = this\n\n const request = new FetchRequest(\n \"GET\",\n this.state.validateBlueprintUrlValue,\n {\n query: {\n \"refine_filters_builder[filter_class]\": this.state.filterName,\n \"refine_filters_builder[blueprint_json]\": JSON.stringify(this.state.blueprint),\n \"refine_filters_builder[client_id]\": this.state.clientIdValue\n }\n }\n )\n const response = await request.perform()\n return response.ok\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\nimport { FetchRequest } from '@rails/request.js'\n\n/*\n This controller handles criteria forms\n (refine/inline/criteria/new|edit)\n*/\nexport default class extends Controller {\n static values = {\n url: String,\n formId: String\n }\n\n async refresh(_event) {\n // update the url with params from the form\n const formElement = document.getElementById(this.formIdValue)\n const formData = new FormData(formElement)\n\n const request = new FetchRequest(\n \"GET\",\n this.urlValue,\n {\n query: formData,\n responseKind: \"turbo-stream\"\n }\n )\n const response = await request.perform()\n }\n\n\n\n}\n","import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n static values = {\n criterionId: Number,\n input: Object,\n };\n\n connect() {\n this.state = this.getStateController()\n\n this.state.updateInput(\n this.criterionIdValue,\n this.inputValue,\n );\n }\n\n getStateController() {\n let currentElement = this.element\n\n while(currentElement !== document.body) {\n const controller = this.application.getControllerForElementAndIdentifier(currentElement, 'refine--state')\n if (controller) {\n return controller\n } else {\n currentElement = currentElement.parentNode\n }\n }\n\n return null\n }\n}\n","import ServerRefreshController from './server-refresh-controller';\n\nexport default class extends ServerRefreshController {\n static values = {\n criterionId: Number,\n }\n\n criterion() {\n const { state, criterionIdValue } = this;\n state.deleteCriterion(criterionIdValue);\n this.refreshFromServer()\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\nimport { FetchRequest } from '@rails/request.js'\n\nexport default class extends Controller {\n static values = {\n submitUrl: String\n }\n\n connect() {\n const urlParams = new URLSearchParams(window.location.search)\n this.existingParams = urlParams\n this.existingParams.delete('stable_id')\n }\n\n delete(event) {\n const { criterionId } = event.currentTarget.dataset\n var index = parseInt(criterionId)\n this.stateController.deleteCriterion(index)\n this.reloadPage()\n }\n\n async reloadPage() {\n const {blueprint} = this.stateController\n const request = new FetchRequest(\n \"POST\",\n this.submitUrlValue,\n {\n responseKind: \"turbo-stream\",\n body: JSON.stringify({\n refine_filters_builder: {\n filter_class: this.stateController.filterName,\n blueprint_json: JSON.stringify(blueprint),\n client_id: this.stateController.clientIdValue\n }\n })\n }\n )\n await request.perform()\n }\n\n redirectToStableId(stableId) {\n const params = new URLSearchParams()\n if (stableId) {\n params.append('stable_id', stableId)\n }\n const allParams = new URLSearchParams({\n ...Object.fromEntries(this.existingParams),\n ...Object.fromEntries(params),\n }).toString()\n const url = `${window.location.pathname}?${allParams}`\n\n history.pushState({}, document.title, url)\n window.location.reload()\n }\n\n get stateController() {\n return this.element.refineStateController\n }\n\n get stabilizeFilterController() {\n return this.element.stabilizeFilterController\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\nimport { useClickOutside } from 'stimulus-use'\n\n// simple controller to hide/show the filter modal\nexport default class extends Controller {\n static targets = [\"frame\"]\n\n static values = {\n src: String,\n isOpen: {type: Boolean, default: false}\n }\n\n connect() {\n useClickOutside(this)\n this.boundHandleKeyUp = this.handleKeyUp.bind(this)\n document.addEventListener(\"keyup\", this.boundHandleKeyUp)\n }\n\n disconnect() {\n document.removeEventListener(\"keyup\", this.boundHandleKeyUp)\n }\n\n show(event) {\n event.preventDefault()\n this.frameTarget.src = this.srcValue;\n this.isOpenValue = true\n }\n\n hide(event) {\n if (this.isOpenValue) {\n event?.preventDefault()\n event?.stopPropagation()\n this.frameTarget.innerHTML = \"\";\n this.isOpenValue = false\n }\n }\n\n clickOutside(event) {\n this.hide(event)\n }\n\n handleKeyUp(event) {\n if (event.key === \"Escape\" || event.key === \"Esc\") {\n this.hide(event)\n }\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\nimport { useClickOutside } from 'stimulus-use'\n\n// simple controller to hide/show the filter modal\nexport default class extends Controller {\n static targets = [\"frame\"]\n\n static values = {\n src: String,\n isOpen: {type: Boolean, default: false}\n }\n\n connect() {\n useClickOutside(this)\n }\n\n disconnect() {\n }\n\n open(event) {\n event.preventDefault()\n this.frameTarget.src = this.srcValue;\n this.isOpenValue = true\n }\n\n close(event) {\n if (this.isOpenValue) {\n event?.preventDefault()\n this.frameTarget.innerHTML = \"\";\n this.isOpenValue = false\n }\n }\n\n clickOutside(event) {\n this.close(event)\n }\n\n\n}\n","import { Controller } from \"@hotwired/stimulus\"\nimport { FetchRequest } from '@rails/request.js'\n\nexport default class extends Controller {\n static values = {\n submitUrl: String\n }\n\n\n search(event) {\n event.preventDefault()\n this.submitFilter()\n document.activeElement.blur()\n }\n\n async submitFilter() {\n const {blueprint} = this.stateController\n const request = new FetchRequest(\n \"POST\",\n this.submitUrlValue,\n {\n responseKind: \"turbo-stream\",\n body: JSON.stringify({\n refine_filters_builder: {\n filter_class: this.stateController.filterName,\n blueprint_json: JSON.stringify(blueprint),\n client_id: this.stateController.clientIdValue\n }\n })\n }\n )\n await request.perform()\n }\n\n get stateController() {\n return this\n .element\n .querySelector('[data-controller~=\"refine--state\"]')\n .refineStateController\n }\n\n loadResults({detail: {url}}) {\n console.log(\"filter submit success\")\n if (window.Turbo) {\n window.Turbo.visit(url)\n } else {\n window.location.href = url\n }\n }\n}\n","// Polyfill for custom events in IE9-11\n// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#polyfill\n;(function () {\n if (typeof window.CustomEvent === 'function') return false\n\n function CustomEvent(event, params) {\n params = params || { bubbles: false, cancelable: false, detail: undefined }\n var evt = document.createEvent('CustomEvent')\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail)\n return evt\n }\n\n CustomEvent.prototype = window.Event.prototype\n\n window.CustomEvent = CustomEvent\n\n // eslint expects a return here\n return true\n})()\n\nexport const filterStabilizedEvent = (element, stableId, filterName) => {\n const event = new CustomEvent('filter-stabilized', {\n bubbles: true,\n cancelable: true,\n detail: {\n stableId,\n filterName,\n },\n })\n element.dispatchEvent(event)\n}\n\nexport const filterUnstableEvent = (blueprint) => {\n const event = new CustomEvent('filter-unstable', {\n bubbles: true,\n cancelable: true,\n detail: {\n blueprint,\n },\n })\n window.dispatchEvent(event)\n}\n\nexport const filterInvalidEvent = ({blueprint, errors}) => {\n const event = new CustomEvent('filter-invalid', {\n bubbles: true,\n cancelable: true,\n detail: {\n blueprint,\n errors,\n },\n })\n window.dispatchEvent(event)\n}\n\nexport const filterStoredEvent = (storedFilterId) => {\n const event = new CustomEvent('filter-stored', {\n bubbles: true,\n cancelable: true,\n detail: {\n storedFilterId,\n },\n })\n window.dispatchEvent(event)\n}\n\nexport const blueprintUpdatedEvent = (element, {blueprint, formId}) => {\n const event = new CustomEvent('blueprint-updated', {\n bubbles: true,\n cancelable: true,\n detail: {\n blueprint,\n formId\n },\n })\n element.dispatchEvent(event)\n}\n","import { Controller } from \"@hotwired/stimulus\"\nimport { delegate, abnegate } from 'jquery-events-to-dom-events'\nimport { blueprintUpdatedEvent } from '../../refine/helpers'\nimport { isEqual } from 'lodash'\n\nconst criterion = (id, depth, condition) => {\n const component = condition?.component\n const meta = condition?.meta || { clauses: [], options: {}}\n const refinements = condition?.refinements || []\n const { clauses, options } = meta\n let selected\n if (component === 'option-condition') {\n selected = options[0] ? [options[0].id] : []\n } else {\n selected = undefined\n }\n // Set newInput based on component\n\n let newInput = {\n clause: clauses[0]?.id,\n selected: selected,\n }\n\n // If refinements are present, add to input array\n refinements.forEach((refinement) => {\n const { meta, component } = refinement\n const { clauses, options } = meta\n let selected\n if (component === 'option-condition') {\n selected = options[0] ? [options[0].id] : []\n } else {\n selected = undefined\n }\n newInput[refinement.id] = {\n clause: clauses[0].id,\n selected: selected,\n }\n })\n\n return {\n depth,\n type: 'criterion',\n condition_id: id,\n input: newInput,\n }\n}\n\nconst or = function (depth) {\n depth = depth === undefined ? 0 : depth\n return {\n depth,\n type: 'conjunction',\n word: 'or',\n }\n}\n\nconst and = function (depth) {\n depth = depth === undefined ? 1 : depth\n return {\n depth,\n type: 'conjunction',\n word: 'and',\n }\n}\nexport default class extends Controller {\n static values = {\n blueprint: Array,\n conditions: Array,\n className: String,\n refreshUrl: String,\n clientId: String,\n validateBlueprintUrl: String,\n defaultConditionId: String\n }\n static targets = ['loading']\n\n\n connect() {\n // for select2 jquery events and datepicker\n this.element.refineStateController = this\n this.changeDelegate = delegate('change', ['event', 'picker'])\n this.blueprint = this.blueprintValue\n this.conditions = this.conditionsValue\n this.filterName = this.classNameValue\n this.conditionsLookup = this.conditions.reduce((lookup, condition) => {\n lookup[condition.id] = condition\n return lookup\n }, {})\n this.loadingTimeout = null\n blueprintUpdatedEvent(this.element, {blueprint: this.blueprint, formId: this.formIdValue})\n }\n\n disconnect() {\n abnegate('change', this.changeDelegate)\n }\n\n startUpdate() {\n if (this.loadingTimeout) {\n window.clearTimeout(this.loadingTimeout)\n }\n // only show the loading overlay if it's taking a long time\n // to render the updates\n this.loadingTimeout = window.setTimeout(() => {\n this.loadingTarget.classList.remove('hidden')\n }, 1000)\n }\n\n finishUpdate() {\n if (this.loadingTimeout) {\n window.clearTimeout(this.loadingTimeout)\n }\n this.loadingTarget.classList.add('hidden')\n }\n\n conditionConfigFor(conditionId) {\n return this.conditionsLookup[conditionId]\n }\n\n addGroup() {\n const { blueprint, conditions } = this\n const condition = ( conditions.find(c => c.id == this.defaultConditionIdValue) || conditions[0] )\n const { meta } = condition\n\n if (this.blueprint.length > 0) {\n this.blueprint.push(or())\n }\n this.blueprint.push(criterion(condition.id, 1, condition))\n blueprintUpdatedEvent(this.element, {blueprint: this.blueprint, formId: this.formIdValue})\n }\n\n addCriterion(previousCriterionId) {\n const { blueprint, conditions } = this\n const condition = ( conditions.find(c => c.id == this.defaultConditionIdValue) || conditions[0] )\n const { meta } = condition\n blueprint.splice(previousCriterionId + 1, 0, and(), criterion(condition.id, 1, condition))\n blueprintUpdatedEvent(this.element, {blueprint: this.blueprint, formId: this.formIdValue})\n }\n\n deleteCriterion(criterionId) {\n /**\n To support 'groups' there is some complicated logic for deleting criterion.\n\n Imagine this simplified blueprint: [eq, and, sw, or, eq]\n\n User clicks to delete the last eq. We also have to delete the preceding or\n otherwise we're left with a hanging empty group\n\n What if the user deletes the sw? We have to clean up the preceding and.\n\n Imagine another scenario: [eq or sw and ew]\n Now we delete the first eq but this time we need to clean up the or.\n\n These conditionals cover these cases.\n **/\n const { blueprint } = this\n const previous = blueprint[criterionId - 1]\n const next = blueprint[criterionId + 1]\n\n const nextIsOr = next && next.word === 'or'\n const previousIsOr = previous && previous.word === 'or'\n\n const nextIsRightParen = nextIsOr || !next\n const previousIsLeftParen = previousIsOr || !previous\n\n const isFirstInGroup = previousIsLeftParen && !nextIsRightParen\n const isLastInGroup = previousIsLeftParen && nextIsRightParen\n const isLastCriterion = !previous && !next\n\n if (isLastCriterion) {\n this.blueprint = []\n } else if (isLastInGroup && previousIsOr) {\n blueprint.splice(criterionId - 1, 2)\n } else if (isLastInGroup && !previous) {\n blueprint.splice(criterionId, 2)\n } else if (isFirstInGroup) {\n blueprint.splice(criterionId, 2)\n } else {\n blueprint.splice(criterionId - 1, 2)\n }\n\n blueprintUpdatedEvent(this.element, {blueprint: this.blueprint, formId: this.formIdValue})\n }\n\n /*\n Updates a criterion in the blueprint\n Returns true if an update was actually performed, or false if no-op\n */\n replaceCriterion(criterionId, conditionId, condition) {\n const criterionRow = this.blueprint[criterionId]\n if (criterionRow.type !== 'criterion') {\n throw new Error(\n `You can't call updateConditionId on a non-criterion type. Trying to update ${JSON.stringify(criterion)}`\n )\n }\n const existingCriterion = this.blueprint[criterionId]\n const newCriterion = criterion(conditionId, criterionRow.depth, condition)\n if (isEqual(existingCriterion, newCriterion)) {\n return false\n } else {\n this.blueprint[criterionId] = newCriterion\n blueprintUpdatedEvent(this.element, {blueprint: this.blueprint, formId: this.formIdValue})\n return true\n }\n }\n\n updateInput(criterionId, input, inputId) {\n // Input id is an array of hash keys that define the path for this input such as [\"input\", \"date_refinement\"]\n const { blueprint } = this\n const criterion = blueprint[criterionId]\n inputId = inputId || 'input'\n const blueprintPath = inputId.split(', ')\n // If the inputId contains more than one element, add input at appropriate depth\n if (blueprintPath.length > 1) {\n criterion[blueprintPath[0]][blueprintPath[1]] = { ...criterion[blueprintPath[0]][blueprintPath[1]], ...input }\n } else {\n criterion[inputId] = { ...criterion[inputId], ...input }\n }\n blueprintUpdatedEvent(this.element, {blueprint: this.blueprint, formId: this.formIdValue})\n }\n\n}\n","import { Controller } from \"@hotwired/stimulus\"\nimport { filterStoredEvent } from '../../refine/helpers'\n\nexport default class extends Controller {\n static targets = ['blueprintField']\n static values = { formId: String, stateDomId: String }\n\n connect() {\n const stateController = document\n .getElementById(this.stateDomIdValue)\n .refineStateController\n this.blueprintFieldTarget.value = JSON.stringify(stateController.blueprint)\n console.log(\"connect\", this.blueprintFieldTarget.value)\n }\n\n updateBlueprintField(event) {\n if (event.detail.formId != this.formIdValue) { return null }\n const { detail } = event\n const { blueprint } = detail\n this.blueprintFieldTarget.value = JSON.stringify(blueprint)\n console.log(\"update blueprint\", this.blueprintFieldTarget.value)\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n submit(event) {\n event.preventDefault()\n this.element.requestSubmit()\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\n\n// simple controller to hide/show the filter modal\nexport default class extends Controller {\n static targets = [\"content\"]\n\n toggle(_event) {\n this.contentTargets.forEach(node => {\n node.toggleAttribute(\"hidden\")\n })\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\nimport { FetchRequest } from '@rails/request.js'\n\n/*\n attach to a form element to have it submit to a turbo-stream endpoint\n\n <form action=\"/contacts\" data-controller=\"refine--turbo-stream-form\" data-action=\"submit->refine--turbo-stream-form#submit\">\n\n Turbo is supposed to handle this natively but we're seeing issues when the form is inside an iframe\n*/\nexport default class extends Controller {\n async submit(event) {\n event.preventDefault()\n const request = new FetchRequest(\n (this.element.method || \"POST\"),\n this.element.action,\n {\n responseKind: \"turbo-stream\",\n body: new FormData(this.element)\n }\n )\n await request.perform()\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\nimport { FetchRequest } from '@rails/request.js'\n\n/*\n attach to a link element to have it request turbo stream responses\n\n <a href=\"/contacts\" data-controller=\"refine--turbo-stream-link\" data-action=\"refine--turbo-stream-link#get\">Click me</a>\n\n Turbo is supposed to handle this natively with data-turbo-stream but we're\n seeing issues using that attribute inside iframes\n*/\nexport default class extends Controller {\n async visit(event) {\n event.preventDefault()\n const request = new FetchRequest(\n (this.element.dataset.turboMethod || \"GET\"),\n this.element.href,\n {\n responseKind: \"turbo-stream\",\n }\n )\n await request.perform()\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n\n static targets = ['listItem', 'category', 'recommended']\n\n filter(event) {\n const query = event.currentTarget.value.toLowerCase()\n const visibleCategories = new Set()\n\n // hide / show listItem links that match the query and note which\n // categories should be visible\n this.listItemTargets.forEach(listItemNode => {\n const listItemName = listItemNode.dataset.listItemValue.toLowerCase()\n if (listItemName.includes(query)) {\n listItemNode.hidden = false\n visibleCategories.add(listItemNode.dataset.category)\n } else {\n listItemNode.hidden = true\n }\n })\n\n this.recommendedTargets.forEach(recommendedNode => {\n (query !== '' && visibleCategories.size === 0) ? recommendedNode.hidden = true : recommendedNode.hidden = false\n })\n\n // hide / show category headers that have visible listItems\n this.categoryTargets.forEach(categoryNode => {\n const categoryName = categoryNode.innerHTML\n if (visibleCategories.has(categoryName)) {\n categoryNode.hidden = false\n } else {\n categoryNode.hidden = true\n }\n })\n }\n}\n","import ServerRefreshController from './server-refresh-controller'\nimport { debounce } from 'lodash'\n\nexport default class extends ServerRefreshController {\n static values = {\n criterionId: Number,\n }\n\n initialize() {\n this.updateBlueprint = debounce((event, value, inputKey) => {\n this.value(event, value, inputKey)\n }, 500)\n }\n\n refinedFilter(event) {\n const { criterionIdValue, state } = this\n const dataset = event.target.dataset\n const inputId = dataset.inputId\n\n state.updateInput(\n criterionIdValue,\n {\n id: event.target.value,\n },\n inputId\n )\n this.refreshFromServer()\n }\n\n clause(event) {\n const { criterionIdValue, state } = this\n const dataset = event.target.dataset\n const inputId = dataset.inputId\n state.updateInput(\n criterionIdValue,\n {\n clause: event.target.value,\n },\n inputId\n )\n this.refreshFromServer()\n }\n\n selected(event) {\n const { target: select } = event\n const options = Array.prototype.slice.call(select.options)\n const selectedOptions = options.filter((option) => option.selected)\n const selected = selectedOptions.map((option) => option.value)\n this.value(event, selected, 'selected')\n }\n\n value(event, value, inputKey) {\n const { criterionIdValue, state } = this\n const dataset = event.target.dataset\n const inputId = dataset.inputId\n inputKey = inputKey || dataset.inputKey || 'value'\n value = value || event.target.value\n if(typeof value === 'string')\n value = value.trim()\n state.updateInput(\n criterionIdValue,\n {\n [inputKey]: value,\n },\n inputId\n )\n }\n\n condition(event) {\n const { criterionIdValue, state } = this\n const element = event.target\n let newConditionId = element.value\n if (!newConditionId) newConditionId = element.querySelector('select').value \n const config = this.state.conditionConfigFor(newConditionId)\n const updatePerformed = state.replaceCriterion(criterionIdValue, newConditionId, config)\n if (updatePerformed) {\n this.refreshFromServer()\n }\n }\n\n // Prevent form submission when hitting enter in a text box\n cancelEnter(event) {\n if (event.code === \"Enter\") {\n event.preventDefault()\n event.stopPropagation()\n }\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\nimport moment from 'moment'\nrequire('daterangepicker/daterangepicker.css')\n\n// requires jQuery, moment, might want to consider a vanilla JS alternative\nimport $ from 'jquery' // ensure jquery is loaded before daterangepicker\nimport 'daterangepicker'\n\nexport default class extends Controller {\n static targets = [\n 'field',\n 'hiddenField',\n 'clearButton',\n ]\n\n static values = {\n includeTime: Boolean,\n futureOnly: Boolean,\n drops: String,\n inline: Boolean,\n dateFormat: String,\n timeFormat: String,\n isAmPm: Boolean,\n locale: { type: String, default: 'en' },\n datetimeFormat: { type: String, default: 'MM/DD/YYYY h:mm A' },\n pickerLocale: { type: Object, default: {} },\n }\n\n connect() {\n this.initPluginInstance()\n }\n\n disconnect() {\n this.teardownPluginInstance()\n }\n\n clearDate(event) {\n // don't submit the form, unless it originated from the cancel/clear button\n event.preventDefault()\n\n window.$(this.fieldTarget).val('')\n\n this.dispatch('value-cleared')\n }\n\n applyDateToField(event, picker) {\n const format = this.includeTimeValue ? this.timeFormatValue : this.dateFormatValue\n\n const momentVal = picker\n ? moment(picker.startDate.toISOString())\n : moment(this.fieldTarget.value, 'YYYY-MM-DDTHH:mm').format('YYYY-MM-DDTHH:mm')\n const displayVal = momentVal.format(format)\n const dataVal = this.includeTimeValue ? momentVal.toISOString(true) : momentVal.format('YYYY-MM-DD')\n\n this.fieldTarget.value = displayVal\n this.hiddenFieldTarget.value = dataVal\n // bubble up a change event when the input is updated for other listeners\n window.$(this.fieldTarget).trigger('change', picker)\n\n // emit native change event\n this.hiddenFieldTarget.dispatchEvent(new Event('change', { detail: picker, bubbles: true }))\n }\n\n initPluginInstance() {\n const localeValues = this.pickerLocaleValue\n const isAmPm = this.isAmPmValue\n localeValues['format'] = this.includeTimeValue ? this.timeFormatValue : this.dateFormatValue\n\n window.$(this.fieldTarget).daterangepicker({\n singleDatePicker: true,\n timePicker: this.includeTimeValue,\n timePickerIncrement: 5,\n autoUpdateInput: false,\n autoApply: true,\n minDate: this.futureOnlyValue ? new Date() : false,\n locale: localeValues,\n parentEl: $(this.element),\n drops: this.dropsValue ? this.dropsValue : 'down',\n timePicker24Hour: !isAmPm,\n })\n\n window.$(this.fieldTarget).on('apply.daterangepicker', this.applyDateToField.bind(this))\n window.$(this.fieldTarget).on('cancel.daterangepicker', this.clearDate.bind(this))\n window.$(this.fieldTarget).on('showCalendar.daterangepicker', this.showCalendar.bind(this))\n\n this.pluginMainEl = this.fieldTarget\n this.plugin = $(this.pluginMainEl).data('daterangepicker') // weird\n\n if (this.inlineValue) {\n this.element.classList.add('date-input--inline')\n }\n\n }\n \n teardownPluginInstance() {\n if (this.plugin === undefined) {\n return\n }\n\n $(this.pluginMainEl).off('apply.daterangepicker')\n $(this.pluginMainEl).off('cancel.daterangepicker')\n $(this.pluginMainEl).off('showCalendar.daterangepicker')\n\n // revert to original markup, remove any event listeners\n this.plugin.remove()\n\n }\n\n showCalendar() {\n this.dispatch('show-calendar')\n }\n\n}\n","import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n\n static targets = ['searchBarInput', 'categoryListItem', 'categoryBlockItem', 'categoryShortcutItem']\n\n connect() {\n this.observer = new IntersectionObserver(\n this.handleIntersection.bind(this), {\n threshold: 1\n }\n )\n\n this.categoryBlockItemTargets.forEach(item => this.observer.observe(item))\n }\n\n disconnect() {\n this.observer.disconnect()\n }\n\n handleIntersection(entries) {\n entries.forEach(entry => {\n if(entry.isIntersecting) {\n this.highlightCategory(entry.target.dataset.categoryListBlockValue)\n }\n })\n }\n\n highlightCategory(categoryName) {\n this.categoryShortcutItemTargets.forEach(item => {\n if(item.dataset.inlineAdvancedModalValue === categoryName) {\n item.classList.add('active')\n } else {\n item.classList.remove('active')\n }\n })\n }\n\n showSearchBar() {\n this.searchBarInputTarget.hidden = false\n }\n\n hideSearchBar() {\n this.searchBarInputTarget.hidden = true\n }\n\n findCategoryElementByName(categoryName) {\n // Use the find method to locate the target with the specified attribute value\n return this.categoryListItemTargets.find(item => item.dataset.categoryListItemValue === categoryName)\n }\n\n scrollToCategory(event) {\n const categoryName = event.target.dataset.inlineAdvancedModalValue\n const categoryElement = this.findCategoryElementByName(categoryName)\n if(categoryElement) {\n categoryElement.scrollIntoView({\n behavior: \"smooth\",\n block: \"start\",\n inline: \"nearest\"\n })\n }\n }\n \n}\n","// to be used with sl-tab-group\nimport { Controller } from \"@hotwired/stimulus\"\n\n// This controller is used to handle the tab group component\n// @see https://shoelace.style/components/tab-group\n// @param keepScrollPosition [Boolean] - If true, the scroll position will be kept when changing tabs\n// @usage <div data-controller=\"shoelace--tab-group\" data-shoelace--tab-group-keep-scroll-position-value=\"true\">\n\nexport default class extends Controller {\n static values = {\n keepScrollPosition: { type: Boolean, default: false },\n }\n\n connect() {\n this.currentScrollYPosition = 0\n this.navigateToTab = this.navigateToTab.bind(this)\n this.handleTabShow = this.handleTabShow.bind(this)\n\n this.navigateToTab()\n\n document.addEventListener('turbo:load', this.navigateToTab)\n this.element.addEventListener('sl-tab-show', this.handleTabShow)\n }\n\n disconnect() {\n document.removeEventListener('turbo:load', this.navigateToTab)\n this.element.removeEventListener('sl-tab-show', this.handleTabShow)\n }\n\n handleTabShow(event) {\n this.setLocationHash(event)\n\n if (this.keepScrollPositionValue) {\n this.handleTabChange()\n }\n }\n\n setLocationHash(event) {\n window.location.hash = event.detail.name\n }\n\n navigateToTab() {\n let hash = window.location.hash.toString()\n if (hash) {\n this.element.show(hash.slice(1))\n } else {\n /*\n * Turbo doesn't currently support hashes on redirects (see https://github.com/hotwired/turbo/issues/825)\n * so we've created a workaround. Pass `redirect_anchor` as a query param, and the component will convert\n * it to a hash and delete the query param. e.g. `some_url?redirect_anchor=store_upsells`\n */\n const params = new URLSearchParams(window.location.search)\n const redirectedHashParam = params.get('redirect_anchor')\n if (redirectedHashParam) {\n params.delete('redirect_anchor')\n let newParams = params.toString()\n window.history.replaceState(\n null,\n '',\n [window.location.pathname, newParams ? `?${newParams}` : '', '#', redirectedHashParam].join('')\n )\n }\n }\n }\n\n handleTabChange() {\n this.currentScrollYPosition = window.scrollY\n }\n\n /**\n * Programmatically reveal a sl-tab-panel via action params.\n * @see Shoelace sl-tab-group show() method\n * @see https://shoelace.style/components/tab-group?id=methods\n *\n * @param {Event} event\n * @param {string} event.params.showPanel - the name attribute of the sl-tab-panel to show\n * @example <button type='button' data-action=\"click->shoelace--tab-group#show\"\n * data-shoelace--tab-group-show-panel-param=\"mypanelname\">\n * @returns {void}\n */\n show(event) {\n const { showPanel } = event.params\n this.element.show(showPanel)\n }\n}\n","import { identifierForContextKey } from \"@hotwired/stimulus-webpack-helpers\"\n\nimport AddController from './refine/add-controller'\nimport CriterionFormController from './refine/criterion-form-controller'\nimport DefaultsController from './refine/defaults-controller'\nimport DeleteController from './refine/delete-controller'\nimport FilterPillsController from './refine/filter-pills-controller'\nimport PopupController from './refine/popup-controller'\nimport ModalController from './refine/modal-controller'\nimport SearchFilterController from './refine/search-filter-controller'\nimport ServerRefreshController from './refine/server-refresh-controller'\nimport StateController from './refine/state-controller'\nimport StoredFilterController from './refine/stored-filter-controller'\nimport SubmitForm from './refine/submit-form-controller'\nimport ToggleController from './refine/toggle-controller'\nimport TurboStreamFormController from './refine/turbo-stream-form-controller'\nimport TurboStreamLinkController from './refine/turbo-stream-link-controller'\nimport TypeaheadListController from './refine/typeahead-list-controller'\nimport UpdateController from './refine/update-controller'\nimport DateController from './refine/date-controller'\nimport InlineAdvancedModalController from \"./refine/inline-advanced-modal-controller\"\nimport TabGroupController from \"./fields/shoelace/tab-group-controller\"\n\nexport const controllerDefinitions = [\n [AddController, 'refine/add-controller.js'],\n [CriterionFormController, 'refine/criterion-form-controller.js'],\n [DefaultsController, 'refine/defaults-controller.js'],\n [DeleteController, 'refine/delete-controller.js'],\n [FilterPillsController, 'refine/filter-pills-controller.js'],\n [PopupController, 'refine/popup-controller.js'],\n [ModalController, 'refine/modal-controller.js'],\n [SearchFilterController, 'refine/search-filter-controller.js'],\n [ServerRefreshController, 'refine/server-refresh-controller.js'],\n [StateController, 'refine/state-controller.js'],\n [StoredFilterController, 'refine/stored-filter-controller.js'],\n [SubmitForm, 'refine/submit-form-controller.js'],\n [ToggleController, 'refine/toggle-controller.js'],\n [TurboStreamFormController, 'refine/turbo-stream-form-controller.js'],\n [TurboStreamLinkController, 'refine/turbo-stream-link-controller.js'],\n [TypeaheadListController, './refine/typeahead-list-controller.js'],\n [UpdateController, 'refine/update-controller.js'],\n [DateController, 'refine/date-controller.js'],\n [InlineAdvancedModalController, 'refine/inline-advanced-modal-controller.js'],\n [TabGroupController, 'fields/shoelace/tab-group-controller.js']\n].map(function(d) {\n const key = d[1]\n const controller = d[0]\n return {\n identifier: identifierForContextKey(key),\n controllerConstructor: controller\n }\n})\n\nexport {\n AddController,\n CriterionFormController,\n DefaultsController,\n DeleteController,\n FilterPillsController,\n PopupController,\n ModalController,\n SearchFilterController,\n ServerRefreshController,\n StateController,\n StoredFilterController,\n SubmitForm,\n ToggleController,\n TurboStreamFormController,\n TurboStreamLinkController,\n TypeaheadListController,\n UpdateController,\n DateController,\n InlineAdvancedModalController,\n TabGroupController\n}\n"],"names":["identifierForContextKey","key","logicalName","match","replace","Controller","connect","this","state","finishUpdate","currentElement","element","document","body","matches","application","getControllerForElementAndIdentifier","parentNode","async","options","includeErrors","startUpdate","request","FetchRequest","refreshUrlValue","responseKind","query","filterName","JSON","stringify","blueprint","clientIdValue","include_errors","perform","ServerRefreshController","isValid","validateBlueprint","addCriterion","previousCriterionIdValue","refreshFromServer","addGroup","validateBlueprintUrlValue","ok","values","previousCriterionId","Number","_event","formElement","getElementById","formIdValue","formData","FormData","urlValue","url","String","formId","getStateController","updateInput","criterionIdValue","inputValue","controller","criterionId","input","Object","criterion","deleteCriterion","urlParams","URLSearchParams","window","location","search","existingParams","delete","event","currentTarget","dataset","index","parseInt","stateController","reloadPage","submitUrlValue","refine_filters_builder","filter_class","blueprint_json","client_id","redirectToStableId","stableId","params","append","allParams","fromEntries","toString","pathname","history","pushState","title","reload","refineStateController","stabilizeFilterController","submitUrl","_class","useClickOutside","boundHandleKeyUp","handleKeyUp","bind","addEventListener","disconnect","removeEventListener","show","preventDefault","frameTarget","src","srcValue","isOpenValue","hide","stopPropagation","innerHTML","clickOutside","targets","isOpen","type","Boolean","default","open","close","submitFilter","activeElement","blur","querySelector","loadResults","detail","console","log","Turbo","visit","href","CustomEvent","bubbles","cancelable","undefined","evt","createEvent","initCustomEvent","prototype","Event","blueprintUpdatedEvent","dispatchEvent","id","depth","condition","_clauses$","component","meta","clauses","refinements","selected","newInput","clause","forEach","refinement","condition_id","changeDelegate","delegate","blueprintValue","conditions","conditionsValue","classNameValue","conditionsLookup","reduce","lookup","loadingTimeout","abnegate","clearTimeout","setTimeout","loadingTarget","classList","remove","add","conditionConfigFor","conditionId","find","c","defaultConditionIdValue","length","push","word","splice","previous","next","previousIsOr","nextIsRightParen","previousIsLeftParen","isLastInGroup","replaceCriterion","criterionRow","Error","existingCriterion","newCriterion","isEqual","inputId","blueprintPath","split","Array","className","refreshUrl","clientId","validateBlueprintUrl","defaultConditionId","stateDomIdValue","blueprintFieldTarget","value","updateBlueprintField","stateDomId","submit","requestSubmit","toggle","contentTargets","node","toggleAttribute","TurboStreamFormController","method","action","turboMethod","filter","toLowerCase","visibleCategories","Set","listItemTargets","listItemNode","listItemValue","includes","hidden","category","recommendedTargets","recommendedNode","size","categoryTargets","categoryNode","has","initialize","updateBlueprint","debounce","inputKey","refinedFilter","target","select","slice","call","option","map","trim","newConditionId","config","cancelEnter","code","require","initPluginInstance","teardownPluginInstance","clearDate","$","fieldTarget","val","dispatch","applyDateToField","picker","format","includeTimeValue","timeFormatValue","dateFormatValue","momentVal","moment","startDate","toISOString","displayVal","dataVal","hiddenFieldTarget","trigger","localeValues","pickerLocaleValue","isAmPm","isAmPmValue","daterangepicker","singleDatePicker","timePicker","timePickerIncrement","autoUpdateInput","autoApply","minDate","futureOnlyValue","Date","locale","parentEl","drops","dropsValue","timePicker24Hour","on","showCalendar","pluginMainEl","plugin","data","inlineValue","off","includeTime","futureOnly","inline","dateFormat","timeFormat","datetimeFormat","pickerLocale","observer","IntersectionObserver","handleIntersection","threshold","categoryBlockItemTargets","item","observe","entries","entry","isIntersecting","highlightCategory","categoryListBlockValue","categoryName","categoryShortcutItemTargets","inlineAdvancedModalValue","showSearchBar","searchBarInputTarget","hideSearchBar","findCategoryElementByName","categoryListItemTargets","categoryListItemValue","scrollToCategory","categoryElement","scrollIntoView","behavior","block","currentScrollYPosition","navigateToTab","handleTabShow","setLocationHash","keepScrollPositionValue","handleTabChange","hash","name","redirectedHashParam","get","newParams","replaceState","join","scrollY","showPanel","keepScrollPosition","controllerDefinitions","AddController","CriterionFormController","DefaultsController","DeleteController","FilterPillsController","PopupController","ModalController","SearchFilterController","StateController","StoredFilterController","SubmitForm","ToggleController","TurboStreamLinkController","TypeaheadListController","UpdateController","DateController","InlineAdvancedModalController","TabGroupController","d","identifier","controllerConstructor"],"mappings":"wUAqBA,SAASA,EAAwBC,GAC7B,MAAMC,GAAeD,EAAIE,MAAM,2CAA6C,IAAI,GAChF,GAAID,EACA,OAAOA,EAAYE,QAAQ,KAAM,KAAKA,QAAQ,MAAO,MCnBhCC,MAAAA,UAAAA,EAC3BC,UACEC,KAAKC,MAAMC,eAGTD,YACF,IAAIE,EAAiBH,KAAKI,QAE1B,KAAMD,IAAmBE,SAASC,MAAM,CACtC,GAAIH,EAAeI,QAAQ,sCACzB,OAAYC,KA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