avo 3.17.8.tw4 → 3.17.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/README.md +0 -1
  4. data/app/assets/stylesheets/avo.base.css +101 -101
  5. data/app/assets/stylesheets/css/fields/progress.css +4 -4
  6. data/app/assets/stylesheets/css/fields/tiptap.css +4 -4
  7. data/app/assets/stylesheets/css/pagination.css +2 -2
  8. data/app/assets/stylesheets/css/search.css +4 -4
  9. data/app/assets/stylesheets/css/tailwindcss/base.css +1 -0
  10. data/app/assets/stylesheets/css/tailwindcss/components.css +1 -0
  11. data/app/assets/stylesheets/css/tailwindcss/utilities.css +1 -0
  12. data/app/assets/stylesheets/css/tooltips.css +1 -1
  13. data/app/components/avo/actions_component.html.erb +3 -3
  14. data/app/components/avo/alert_component.html.erb +2 -2
  15. data/app/components/avo/alert_component.rb +1 -1
  16. data/app/components/avo/backtrace_alert_component.html.erb +3 -3
  17. data/app/components/avo/button_component.rb +3 -3
  18. data/app/components/avo/divider_component.html.erb +2 -2
  19. data/app/components/avo/empty_state_component.html.erb +1 -1
  20. data/app/components/avo/field_wrapper_component.html.erb +1 -1
  21. data/app/components/avo/fields/belongs_to_field/edit_component.html.erb +1 -1
  22. data/app/components/avo/fields/boolean_field/edit_component.html.erb +1 -1
  23. data/app/components/avo/fields/boolean_group_field/edit_component.rb +1 -1
  24. data/app/components/avo/fields/common/files/view_type/list_item_component.html.erb +3 -3
  25. data/app/components/avo/fields/common/key_value_component.html.erb +3 -3
  26. data/app/components/avo/fields/common/progress_bar_component.html.erb +1 -1
  27. data/app/components/avo/fields/common/status_viewer_component.html.erb +7 -1
  28. data/app/components/avo/fields/date_field/edit_component.html.erb +1 -1
  29. data/app/components/avo/fields/date_time_field/edit_component.html.erb +1 -1
  30. data/app/components/avo/fields/tags_field/edit_component.html.erb +1 -1
  31. data/app/components/avo/fields/tags_field/tag_component.html.erb +1 -1
  32. data/app/components/avo/fields/tiptap_field/edit_component.html.erb +1 -1
  33. data/app/components/avo/fields/trix_field/edit_component.html.erb +1 -1
  34. data/app/components/avo/filters_component.html.erb +3 -3
  35. data/app/components/avo/index/grid_item_component.html.erb +2 -2
  36. data/app/components/avo/index/grid_item_component.rb +1 -1
  37. data/app/components/avo/index/resource_grid_component.html.erb +1 -1
  38. data/app/components/avo/index/resource_map_component.html.erb +1 -1
  39. data/app/components/avo/index/resource_table_component.html.erb +1 -1
  40. data/app/components/avo/index/table_row_component.html.erb +3 -3
  41. data/app/components/avo/items/panel_component.html.erb +1 -1
  42. data/app/components/avo/media_library/item_details_component.html.erb +1 -1
  43. data/app/components/avo/modal_component.html.erb +1 -1
  44. data/app/components/avo/paginator_component.html.erb +2 -1
  45. data/app/components/avo/panel_component.html.erb +2 -2
  46. data/app/components/avo/profile_item_component.rb +1 -1
  47. data/app/components/avo/resource_sidebar_component.html.erb +1 -1
  48. data/app/components/avo/row_selector_component.html.erb +1 -1
  49. data/app/components/avo/sidebar/link_component.rb +1 -1
  50. data/app/components/avo/sidebar_component.html.erb +3 -3
  51. data/app/components/avo/sidebar_profile_component.html.erb +4 -4
  52. data/app/components/avo/tab_group_component.html.erb +1 -1
  53. data/app/helpers/avo/application_helper.rb +4 -4
  54. data/app/javascript/js/controllers/fields/key_value_controller.js +1 -1
  55. data/app/javascript/js/controllers/fields/tags_field_helpers.js +1 -1
  56. data/app/javascript/js/controllers/search_controller.js +2 -2
  57. data/app/views/avo/base/preview.html.erb +1 -1
  58. data/app/views/avo/debug/report.html.erb +1 -1
  59. data/app/views/avo/debug/status.html.erb +14 -19
  60. data/app/views/avo/home/_actions.html.erb +1 -1
  61. data/app/views/avo/home/_dashboards.html.erb +1 -1
  62. data/app/views/avo/home/_filters.html.erb +1 -1
  63. data/app/views/avo/home/_resources.html.erb +2 -2
  64. data/app/views/avo/home/failed_to_load.html.erb +1 -1
  65. data/app/views/avo/partials/_confirm_dialog.html.erb +4 -4
  66. data/app/views/avo/partials/_custom_tools_alert.html.erb +6 -6
  67. data/app/views/avo/partials/_navbar.html.erb +3 -3
  68. data/app/views/avo/partials/_resource_search.html.erb +1 -1
  69. data/app/views/avo/partials/_table_header.html.erb +2 -2
  70. data/app/views/avo/sidebar/_license_warning.html.erb +1 -1
  71. data/lib/avo/concerns/row_controls_configuration.rb +15 -16
  72. data/lib/avo/resources/items/holder.rb +1 -1
  73. data/lib/avo/version.rb +1 -1
  74. data/lib/generators/avo/resource_tool_generator.rb +1 -1
  75. data/lib/generators/avo/templates/cards/partial_card_partial.tt +1 -1
  76. data/lib/generators/avo/tool_generator.rb +2 -2
  77. data/lib/tasks/avo_tasks.rake +1 -1
  78. data/public/avo-assets/avo.base.css +12272 -10320
  79. data/public/avo-assets/avo.base.js +3 -3
  80. data/public/avo-assets/avo.base.js.map +2 -2
  81. data/tailwind.preset.js +20 -0
  82. metadata +6 -3
@@ -683,7 +683,7 @@ uniform `+Ge+" "+Ke+" u_"+tt+`;
683
683
  ${this.inputField("key",t,r,e)}
684
684
  ${this.inputField("value",t,r,e)}
685
685
  `,this.options.editable&&(n+=this.dndIcon(t),n+=this.deleteButton(t)),n+="</div>",n}inputField(r="key",e,t,n){let i=r==="key"?t:n;return`<input
686
- class="${this.options.inputClasses} focus:bg-gray-100 !rounded-none border-gray-600 border-r border-l-0 border-b-0 border-t-0 focus:border-gray-300 w-1/2 focus:outline-hidden outline-hidden key-value-input-${r}"
686
+ class="${this.options.inputClasses} focus:bg-gray-100 !rounded-none border-gray-600 border-r border-l-0 border-b-0 border-t-0 focus:border-gray-300 w-1/2 focus:outline-none outline-none key-value-input-${r}"
687
687
  data-action="input->key-value#${r}FieldUpdated"
688
688
  placeholder="${this.options[`${r}_label`]}"
689
689
  data-index="${e}"
@@ -748,7 +748,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
748
748
  />
749
749
  </circle>`,n};var pG=function(e){var t=e.environment,n=t.document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("class","aa-SubmitIcon"),n.setAttribute("viewBox","0 0 24 24"),n.setAttribute("width","20"),n.setAttribute("height","20"),n.setAttribute("fill","currentColor");var i=t.document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d","M16.041 15.856c-0.034 0.026-0.067 0.055-0.099 0.087s-0.060 0.064-0.087 0.099c-1.258 1.213-2.969 1.958-4.855 1.958-1.933 0-3.682-0.782-4.95-2.050s-2.050-3.017-2.050-4.95 0.782-3.682 2.050-4.95 3.017-2.050 4.95-2.050 3.682 0.782 4.95 2.050 2.050 3.017 2.050 4.95c0 1.886-0.745 3.597-1.959 4.856zM21.707 20.293l-3.675-3.675c1.231-1.54 1.968-3.493 1.968-5.618 0-2.485-1.008-4.736-2.636-6.364s-3.879-2.636-6.364-2.636-4.736 1.008-6.364 2.636-2.636 3.879-2.636 6.364 1.008 4.736 2.636 6.364 3.879 2.636 6.364 2.636c2.125 0 4.078-0.737 5.618-1.968l3.675 3.675c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414z"),n.appendChild(i),n};function BD(r){"@babel/helpers - typeof";return BD=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},BD(r)}function ELe(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function w0(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ELe(Object(t),!0).forEach(function(n){pzt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ELe(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function pzt(r,e,t){return e=mzt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function mzt(r){var e=gzt(r,"string");return BD(e)==="symbol"?e:String(e)}function gzt(r,e){if(BD(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(BD(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function CLe(r){var e=r.autocomplete,t=r.autocompleteScopeApi,n=r.classNames,i=r.environment,o=r.isDetached,a=r.placeholder,s=a===void 0?"Search":a,c=r.propGetters,p=r.setIsModalOpen,g=r.state,w=r.translations,D=oq(i),M=c.getRootProps(w0({state:g,props:e.getRootProps({})},t)),F=D("div",w0({class:n.root},M)),q=D("div",{class:n.detachedContainer,onMouseDown:function(W){W.stopPropagation()}}),H=D("div",{class:n.detachedOverlay,children:[q],onMouseDown:function(){p(!1),e.setIsOpen(!1)}}),Y=c.getLabelProps(w0({state:g,props:e.getLabelProps({})},t)),X=D("button",{class:n.submitButton,type:"submit",title:w.submitButtonTitle,children:[pG({environment:i})]}),ce=D("label",w0({class:n.label,children:[X],ariaLabel:w.submitButtonTitle},Y)),k=D("button",{class:n.clearButton,type:"reset",title:w.clearButtonTitle,children:[hLe({environment:i})]}),he=D("div",{class:n.loadingIndicator,children:[TLe({environment:i})]}),le=kLe({class:n.input,environment:i,state:g,getInputProps:c.getInputProps,getInputPropsCore:e.getInputProps,autocompleteScopeApi:t,isDetached:o}),be=D("div",{class:n.inputWrapperPrefix,children:[ce,he]}),_e=D("div",{class:n.inputWrapperSuffix,children:[k]}),ge=D("div",{class:n.inputWrapper,children:[le]}),ve=c.getFormProps(w0({state:g,props:e.getFormProps({inputElement:le})},t)),Ne=D("form",w0({class:n.form,children:[be,ge,_e]},ve)),U=c.getPanelProps(w0({state:g,props:e.getPanelProps({})},t)),Q=D("div",w0({class:n.panel},U)),de=D("div",{class:n.detachedSearchButtonQuery,textContent:g.query}),De=D("div",{class:n.detachedSearchButtonPlaceholder,hidden:!!g.query,textContent:s});if(o){var ie=D("div",{class:n.detachedSearchButtonIcon,children:[pG({environment:i})]}),te=D("button",{type:"button",class:n.detachedSearchButton,title:w.detachedSearchButtonTitle,id:Y.id,onClick:function(){p(!0)},children:[ie,De,de]}),ae=D("button",{type:"button",class:n.detachedCancelButton,textContent:w.detachedCancelButtonText,onTouchStart:function(W){W.stopPropagation()},onClick:function(){e.setIsOpen(!1),p(!1)}}),Le=D("div",{class:n.detachedFormContainer,children:[Ne,ae]});q.appendChild(Le),F.appendChild(te)}else F.appendChild(Ne);return{detachedContainer:q,detachedOverlay:H,detachedSearchButtonQuery:de,detachedSearchButtonPlaceholder:De,inputWrapper:ge,input:le,root:F,form:Ne,label:ce,submitButton:X,clearButton:k,loadingIndicator:he,panel:Q}}function ALe(){var r=[],e=[];function t(n){r.push(n);var i=n();e.push(i)}return{runEffect:t,cleanupEffects:function(){var i=e;e=[],i.forEach(function(o){o()})},runEffects:function(){var i=r;r=[],i.forEach(function(o){t(o)})}}}function DLe(){var r=[];return{reactive:function(t){var n=t(),i={_fn:t,_ref:{current:n},get value(){return this._ref.current},set value(o){this._ref.current=o}};return r.push(i),i},runReactives:function(){r.forEach(function(t){t._ref.current=t._fn()})}}}var cq,bl,RLe,vzt,A_,OLe,FLe,mG,yzt,zD={},NLe=[],bzt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,vG=Array.isArray;function S0(r,e){for(var t in e)r[t]=e[t];return r}function qLe(r){var e=r.parentNode;e&&e.removeChild(r)}function yG(r,e,t){var n,i,o,a={};for(o in e)o=="key"?n=e[o]:o=="ref"?i=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?cq.call(arguments,2):t),typeof r=="function"&&r.defaultProps!=null)for(o in r.defaultProps)a[o]===void 0&&(a[o]=r.defaultProps[o]);return sq(r,a,n,i,null)}function sq(r,e,t,n,i){var o={type:r,props:e,key:t,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++RLe,__i:-1,__u:0};return i==null&&bl.vnode!=null&&bl.vnode(o),o}function Tk(r){return r.children}function lq(r,e){this.props=r,this.context=e}function kk(r,e){if(e==null)return r.__?kk(r.__,r.__i+1):null;for(var t;e<r.__k.length;e++)if((t=r.__k[e])!=null&&t.__e!=null)return t.__e;return typeof r.type=="function"?kk(r):null}function BLe(r){var e,t;if((r=r.__)!=null&&r.__c!=null){for(r.__e=r.__c.base=null,e=0;e<r.__k.length;e++)if((t=r.__k[e])!=null&&t.__e!=null){r.__e=r.__c.base=t.__e;break}return BLe(r)}}function ILe(r){(!r.__d&&(r.__d=!0)&&A_.push(r)&&!uq.__r++||OLe!==bl.debounceRendering)&&((OLe=bl.debounceRendering)||FLe)(uq)}function uq(){var r,e,t,n,i,o,a,s,c;for(A_.sort(mG);r=A_.shift();)r.__d&&(e=A_.length,n=void 0,o=(i=(t=r).__v).__e,s=[],c=[],(a=t.__P)&&((n=S0({},i)).__v=i.__v+1,bl.vnode&&bl.vnode(n),bG(a,n,i,t.__n,a.ownerSVGElement!==void 0,32&i.__u?[o]:null,s,o??kk(i),!!(32&i.__u),c),n.__.__k[n.__i]=n,jLe(s,n,c),n.__e!=o&&BLe(n)),A_.length>e&&A_.sort(mG));uq.__r=0}function zLe(r,e,t,n,i,o,a,s,c,p,g){var w,D,M,F,q,H=n&&n.__k||NLe,Y=e.length;for(t.__d=c,xzt(t,e,H),c=t.__d,w=0;w<Y;w++)(M=t.__k[w])!=null&&typeof M!="boolean"&&typeof M!="function"&&(D=M.__i===-1?zD:H[M.__i]||zD,M.__i=w,bG(r,M,D,i,o,a,s,c,p,g),F=M.__e,M.ref&&D.ref!=M.ref&&(D.ref&&xG(D.ref,null,M),g.push(M.ref,M.__c||F,M)),q==null&&F!=null&&(q=F),65536&M.__u||D.__k===M.__k?c=ULe(M,c,r):typeof M.type=="function"&&M.__d!==void 0?c=M.__d:F&&(c=F.nextSibling),M.__d=void 0,M.__u&=-196609);t.__d=c,t.__e=q}function xzt(r,e,t){var n,i,o,a,s,c=e.length,p=t.length,g=p,w=0;for(r.__k=[],n=0;n<c;n++)(i=r.__k[n]=(i=e[n])==null||typeof i=="boolean"||typeof i=="function"?null:typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?sq(null,i,null,null,i):vG(i)?sq(Tk,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?sq(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=r,i.__b=r.__b+1,s=_zt(i,t,a=n+w,g),i.__i=s,o=null,s!==-1&&(g--,(o=t[s])&&(o.__u|=131072)),o==null||o.__v===null?(s==-1&&w--,typeof i.type!="function"&&(i.__u|=65536)):s!==a&&(s===a+1?w++:s>a?g>c-a?w+=s-a:w--:w=s<a&&s==a-1?s-a:0,s!==n+w&&(i.__u|=65536))):(o=t[n])&&o.key==null&&o.__e&&(o.__e==r.__d&&(r.__d=kk(o)),gG(o,o,!1),t[n]=null,g--);if(g)for(n=0;n<p;n++)(o=t[n])!=null&&(131072&o.__u)==0&&(o.__e==r.__d&&(r.__d=kk(o)),gG(o,o))}function ULe(r,e,t){var n,i;if(typeof r.type=="function"){for(n=r.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=r,e=ULe(n[i],e,t));return e}return r.__e!=e&&(t.insertBefore(r.__e,e||null),e=r.__e),e&&e.nextSibling}function _zt(r,e,t,n){var i=r.key,o=r.type,a=t-1,s=t+1,c=e[t];if(c===null||c&&i==c.key&&o===c.type)return t;if(n>(c!=null&&(131072&c.__u)==0?1:0))for(;a>=0||s<e.length;){if(a>=0){if((c=e[a])&&(131072&c.__u)==0&&i==c.key&&o===c.type)return a;a--}if(s<e.length){if((c=e[s])&&(131072&c.__u)==0&&i==c.key&&o===c.type)return s;s++}}return-1}function MLe(r,e,t){e[0]==="-"?r.setProperty(e,t??""):r[e]=t==null?"":typeof t!="number"||bzt.test(e)?t:t+"px"}function aq(r,e,t,n,i){var o;e:if(e==="style")if(typeof t=="string")r.style.cssText=t;else{if(typeof n=="string"&&(r.style.cssText=n=""),n)for(e in n)t&&e in t||MLe(r.style,e,"");if(t)for(e in t)n&&t[e]===n[e]||MLe(r.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")o=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in r?e.toLowerCase().slice(2):e.slice(2),r.l||(r.l={}),r.l[e+o]=t,t?n?t.u=n.u:(t.u=Date.now(),r.addEventListener(e,o?PLe:LLe,o)):r.removeEventListener(e,o?PLe:LLe,o);else{if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e!=="role"&&e in r)try{r[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!=="-"?r.removeAttribute(e):r.setAttribute(e,t))}}function LLe(r){var e=this.l[r.type+!1];if(r.t){if(r.t<=e.u)return}else r.t=Date.now();return e(bl.event?bl.event(r):r)}function PLe(r){return this.l[r.type+!0](bl.event?bl.event(r):r)}function bG(r,e,t,n,i,o,a,s,c,p){var g,w,D,M,F,q,H,Y,X,ce,k,he,le,be,_e,ge=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(c=!!(32&t.__u),o=[s=e.__e=t.__e]),(g=bl.__b)&&g(e);e:if(typeof ge=="function")try{if(Y=e.props,X=(g=ge.contextType)&&n[g.__c],ce=g?X?X.props.value:g.__:n,t.__c?H=(w=e.__c=t.__c).__=w.__E:("prototype"in ge&&ge.prototype.render?e.__c=w=new ge(Y,ce):(e.__c=w=new lq(Y,ce),w.constructor=ge,w.render=Szt),X&&X.sub(w),w.props=Y,w.state||(w.state={}),w.context=ce,w.__n=n,D=w.__d=!0,w.__h=[],w._sb=[]),w.__s==null&&(w.__s=w.state),ge.getDerivedStateFromProps!=null&&(w.__s==w.state&&(w.__s=S0({},w.__s)),S0(w.__s,ge.getDerivedStateFromProps(Y,w.__s))),M=w.props,F=w.state,w.__v=e,D)ge.getDerivedStateFromProps==null&&w.componentWillMount!=null&&w.componentWillMount(),w.componentDidMount!=null&&w.__h.push(w.componentDidMount);else{if(ge.getDerivedStateFromProps==null&&Y!==M&&w.componentWillReceiveProps!=null&&w.componentWillReceiveProps(Y,ce),!w.__e&&(w.shouldComponentUpdate!=null&&w.shouldComponentUpdate(Y,w.__s,ce)===!1||e.__v===t.__v)){for(e.__v!==t.__v&&(w.props=Y,w.state=w.__s,w.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(ve){ve&&(ve.__=e)}),k=0;k<w._sb.length;k++)w.__h.push(w._sb[k]);w._sb=[],w.__h.length&&a.push(w);break e}w.componentWillUpdate!=null&&w.componentWillUpdate(Y,w.__s,ce),w.componentDidUpdate!=null&&w.__h.push(function(){w.componentDidUpdate(M,F,q)})}if(w.context=ce,w.props=Y,w.__P=r,w.__e=!1,he=bl.__r,le=0,"prototype"in ge&&ge.prototype.render){for(w.state=w.__s,w.__d=!1,he&&he(e),g=w.render(w.props,w.state,w.context),be=0;be<w._sb.length;be++)w.__h.push(w._sb[be]);w._sb=[]}else do w.__d=!1,he&&he(e),g=w.render(w.props,w.state,w.context),w.state=w.__s;while(w.__d&&++le<25);w.state=w.__s,w.getChildContext!=null&&(n=S0(S0({},n),w.getChildContext())),D||w.getSnapshotBeforeUpdate==null||(q=w.getSnapshotBeforeUpdate(M,F)),zLe(r,vG(_e=g!=null&&g.type===Tk&&g.key==null?g.props.children:g)?_e:[_e],e,t,n,i,o,a,s,c,p),w.base=e.__e,e.__u&=-161,w.__h.length&&a.push(w),H&&(w.__E=w.__=null)}catch(ve){e.__v=null,c||o!=null?(e.__e=s,e.__u|=c?160:32,o[o.indexOf(s)]=null):(e.__e=t.__e,e.__k=t.__k),bl.__e(ve,e,t)}else o==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=wzt(t.__e,e,t,n,i,o,a,c,p);(g=bl.diffed)&&g(e)}function jLe(r,e,t){e.__d=void 0;for(var n=0;n<t.length;n++)xG(t[n],t[++n],t[++n]);bl.__c&&bl.__c(e,r),r.some(function(i){try{r=i.__h,i.__h=[],r.some(function(o){o.call(i)})}catch(o){bl.__e(o,i.__v)}})}function wzt(r,e,t,n,i,o,a,s,c){var p,g,w,D,M,F,q,H=t.props,Y=e.props,X=e.type;if(X==="svg"&&(i=!0),o!=null){for(p=0;p<o.length;p++)if((M=o[p])&&"setAttribute"in M==!!X&&(X?M.localName===X:M.nodeType===3)){r=M,o[p]=null;break}}if(r==null){if(X===null)return document.createTextNode(Y);r=i?document.createElementNS("http://www.w3.org/2000/svg",X):document.createElement(X,Y.is&&Y),o=null,s=!1}if(X===null)H===Y||s&&r.data===Y||(r.data=Y);else{if(o=o&&cq.call(r.childNodes),H=t.props||zD,!s&&o!=null)for(H={},p=0;p<r.attributes.length;p++)H[(M=r.attributes[p]).name]=M.value;for(p in H)M=H[p],p=="children"||(p=="dangerouslySetInnerHTML"?w=M:p==="key"||p in Y||aq(r,p,null,M,i));for(p in Y)M=Y[p],p=="children"?D=M:p=="dangerouslySetInnerHTML"?g=M:p=="value"?F=M:p=="checked"?q=M:p==="key"||s&&typeof M!="function"||H[p]===M||aq(r,p,M,H[p],i);if(g)s||w&&(g.__html===w.__html||g.__html===r.innerHTML)||(r.innerHTML=g.__html),e.__k=[];else if(w&&(r.innerHTML=""),zLe(r,vG(D)?D:[D],e,t,n,i&&X!=="foreignObject",o,a,o?o[0]:t.__k&&kk(t,0),s,c),o!=null)for(p=o.length;p--;)o[p]!=null&&qLe(o[p]);s||(p="value",F!==void 0&&(F!==r[p]||X==="progress"&&!F||X==="option"&&F!==H[p])&&aq(r,p,F,H[p],!1),p="checked",q!==void 0&&q!==r[p]&&aq(r,p,q,H[p],!1))}return r}function xG(r,e,t){try{typeof r=="function"?r(e):r.current=e}catch(n){bl.__e(n,t)}}function gG(r,e,t){var n,i;if(bl.unmount&&bl.unmount(r),(n=r.ref)&&(n.current&&n.current!==r.__e||xG(n,null,e)),(n=r.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){bl.__e(o,e)}n.base=n.__P=null,r.__c=void 0}if(n=r.__k)for(i=0;i<n.length;i++)n[i]&&gG(n[i],e,t||typeof r.type!="function");t||r.__e==null||qLe(r.__e),r.__=r.__e=r.__d=void 0}function Szt(r,e,t){return this.constructor(r,t)}function HLe(r,e,t){var n,i,o,a;bl.__&&bl.__(r,e),i=(n=typeof t=="function")?null:t&&t.__k||e.__k,o=[],a=[],bG(e,r=(!n&&t||e).__k=yG(Tk,null,[r]),i||zD,zD,e.ownerSVGElement!==void 0,!n&&t?[t]:i?null:e.firstChild?cq.call(e.childNodes):null,o,!n&&t?t:i?i.__e:e.firstChild,n,a),jLe(o,r,a)}cq=NLe.slice,bl={__e:function(r,e,t,n){for(var i,o,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(r)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(r,n||{}),a=i.__d),a)return i.__E=i}catch(s){r=s}throw r}},RLe=0,vzt=function(r){return r!=null&&r.constructor==null},lq.prototype.setState=function(r,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=S0({},this.state),typeof r=="function"&&(r=r(S0({},t),this.props)),r&&S0(t,r),r!=null&&this.__v&&(e&&this._sb.push(e),ILe(this))},lq.prototype.forceUpdate=function(r){this.__v&&(this.__e=!0,r&&this.__h.push(r),ILe(this))},lq.prototype.render=Tk,A_=[],FLe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,mG=function(r,e){return r.__v.__b-e.__v.__b},uq.__r=0,yzt=0;var WLe="__aa-highlight__",VLe="__/aa-highlight__";function kzt(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=r;return{get:function(){return e},add:function(n){var i=e[e.length-1];i?.isHighlighted===n.isHighlighted?e[e.length-1]={value:i.value+n.value,isHighlighted:i.isHighlighted}:e.push(n)}}}function fq(r){var e=r.highlightedValue,t=e.split(WLe),n=t.shift(),i=kzt(n?[{value:n,isHighlighted:!1}]:[]);return t.forEach(function(o){var a=o.split(VLe);i.add({value:a[0],isHighlighted:!0}),a[1]!==""&&i.add({value:a[1],isHighlighted:!1})}),i.get()}function Tzt(r){return Dzt(r)||Azt(r)||Czt(r)||Ezt()}function Ezt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
750
750
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Czt(r,e){if(r){if(typeof r=="string")return _G(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _G(r,e)}}function Azt(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function Dzt(r){if(Array.isArray(r))return _G(r)}function _G(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function hq(r){var e=r.hit,t=r.attribute,n=Array.isArray(t)?t:[t],i=mk(e,["_highlightResult"].concat(Tzt(n),["value"]));return typeof i!="string"&&(i=mk(e,n)||""),fq({highlightedValue:i})}var Ozt={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Izt=new RegExp(/\w/i),$Le=/&(amp|quot|lt|gt|#39);/g,Mzt=RegExp($Le.source);function Lzt(r){return r&&Mzt.test(r)?r.replace($Le,function(e){return Ozt[e]}):r}function GLe(r,e){var t,n,i=r[e],o=((t=r[e+1])===null||t===void 0?void 0:t.isHighlighted)||!0,a=((n=r[e-1])===null||n===void 0?void 0:n.isHighlighted)||!0;return!Izt.test(Lzt(i.value))&&a===o?a:i.isHighlighted}function UD(r){"@babel/helpers - typeof";return UD=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},UD(r)}function KLe(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function dq(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?KLe(Object(t),!0).forEach(function(n){Pzt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):KLe(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Pzt(r,e,t){return e=Rzt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Rzt(r){var e=Fzt(r,"string");return UD(e)==="symbol"?e:String(e)}function Fzt(r,e){if(UD(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(UD(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function pq(r){return r.some(function(e){return e.isHighlighted})?r.map(function(e,t){return dq(dq({},e),{},{isHighlighted:!GLe(r,t)})}):r.map(function(e){return dq(dq({},e),{},{isHighlighted:!1})})}function YLe(r){return pq(hq(r))}function Nzt(r){return Uzt(r)||zzt(r)||Bzt(r)||qzt()}function qzt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
751
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bzt(r,e){if(r){if(typeof r=="string")return wG(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return wG(r,e)}}function zzt(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function Uzt(r){if(Array.isArray(r))return wG(r)}function wG(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function mq(r){var e=r.hit,t=r.attribute,n=Array.isArray(t)?t:[t],i=mk(e,["_snippetResult"].concat(Nzt(n),["value"]));return typeof i!="string"&&(i=mk(e,n)||""),fq({highlightedValue:i})}function ZLe(r){return pq(mq(r))}function XLe(r){var e=r.createElement,t=r.Fragment;function n(i){var o=i.hit,a=i.attribute,s=i.tagName,c=s===void 0?"mark":s;return e(t,{},hq({hit:o,attribute:a}).map(function(p,g){return p.isHighlighted?e(c,{key:g},p.value):p.value}))}return n.__autocomplete_componentName="Highlight",n}function JLe(r){var e=r.createElement,t=r.Fragment;function n(i){var o=i.hit,a=i.attribute,s=i.tagName,c=s===void 0?"mark":s;return e(t,{},YLe({hit:o,attribute:a}).map(function(p,g){return p.isHighlighted?e(c,{key:g},p.value):p.value}))}return n.__autocomplete_componentName="ReverseHighlight",n}function QLe(r){var e=r.createElement,t=r.Fragment;function n(i){var o=i.hit,a=i.attribute,s=i.tagName,c=s===void 0?"mark":s;return e(t,{},ZLe({hit:o,attribute:a}).map(function(p,g){return p.isHighlighted?e(c,{key:g},p.value):p.value}))}return n.__autocomplete_componentName="ReverseSnippet",n}function ePe(r){var e=r.createElement,t=r.Fragment;function n(i){var o=i.hit,a=i.attribute,s=i.tagName,c=s===void 0?"mark":s;return e(t,{},mq({hit:o,attribute:a}).map(function(p,g){return p.isHighlighted?e(c,{key:g},p.value):p.value}))}return n.__autocomplete_componentName="Snippet",n}function jD(r){"@babel/helpers - typeof";return jD=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jD(r)}var jzt=["classNames","container","getEnvironmentProps","getFormProps","getInputProps","getItemProps","getLabelProps","getListProps","getPanelProps","getRootProps","panelContainer","panelPlacement","render","renderNoResults","renderer","detachedMediaQuery","components","translations"];function tPe(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function k0(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?tPe(Object(t),!0).forEach(function(n){Hzt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):tPe(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Hzt(r,e,t){return e=Wzt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Wzt(r){var e=Vzt(r,"string");return jD(e)==="symbol"?e:String(e)}function Vzt(r,e){if(jD(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(jD(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function $zt(r,e){if(r==null)return{};var t=Gzt(r,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function Gzt(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}var Kzt={clearButton:"aa-ClearButton",detachedCancelButton:"aa-DetachedCancelButton",detachedContainer:"aa-DetachedContainer",detachedFormContainer:"aa-DetachedFormContainer",detachedOverlay:"aa-DetachedOverlay",detachedSearchButton:"aa-DetachedSearchButton",detachedSearchButtonIcon:"aa-DetachedSearchButtonIcon",detachedSearchButtonPlaceholder:"aa-DetachedSearchButtonPlaceholder",detachedSearchButtonQuery:"aa-DetachedSearchButtonQuery",form:"aa-Form",input:"aa-Input",inputWrapper:"aa-InputWrapper",inputWrapperPrefix:"aa-InputWrapperPrefix",inputWrapperSuffix:"aa-InputWrapperSuffix",item:"aa-Item",label:"aa-Label",list:"aa-List",loadingIndicator:"aa-LoadingIndicator",panel:"aa-Panel",panelLayout:"aa-PanelLayout aa-Panel--scrollable",root:"aa-Autocomplete",source:"aa-Source",sourceFooter:"aa-SourceFooter",sourceHeader:"aa-SourceHeader",sourceNoResults:"aa-SourceNoResults",submitButton:"aa-SubmitButton"},Yzt=function(e,t){var n=e.children,i=e.render;i(n,t)},Zzt={createElement:yG,Fragment:Tk,render:HLe};function rPe(r){var e,t=r.classNames,n=r.container,i=r.getEnvironmentProps,o=r.getFormProps,a=r.getInputProps,s=r.getItemProps,c=r.getLabelProps,p=r.getListProps,g=r.getPanelProps,w=r.getRootProps,D=r.panelContainer,M=r.panelPlacement,F=r.render,q=r.renderNoResults,H=r.renderer,Y=r.detachedMediaQuery,X=r.components,ce=r.translations,k=$zt(r,jzt),he=typeof window<"u"?window:{},le=sG(he,n);le.tagName;var be=k0(k0({},Zzt),H),_e={Highlight:XLe(be),ReverseHighlight:JLe(be),ReverseSnippet:QLe(be),Snippet:ePe(be)},ge={clearButtonTitle:"Clear",detachedCancelButtonText:"Cancel",detachedSearchButtonTitle:"Search",submitButtonTitle:"Submit"};return{renderer:{classNames:dLe(Kzt,t??{}),container:le,getEnvironmentProps:i??function(ve){var Ne=ve.props;return Ne},getFormProps:o??function(ve){var Ne=ve.props;return Ne},getInputProps:a??function(ve){var Ne=ve.props;return Ne},getItemProps:s??function(ve){var Ne=ve.props;return Ne},getLabelProps:c??function(ve){var Ne=ve.props;return Ne},getListProps:p??function(ve){var Ne=ve.props;return Ne},getPanelProps:g??function(ve){var Ne=ve.props;return Ne},getRootProps:w??function(ve){var Ne=ve.props;return Ne},panelContainer:D?sG(he,D):he.document.body,panelPlacement:M??"input-wrapper-width",render:F??Yzt,renderNoResults:q,renderer:be,detachedMediaQuery:Y??getComputedStyle(he.document.documentElement).getPropertyValue("--aa-detached-media-query"),components:k0(k0({},_e),X),translations:k0(k0({},ge),ce)},core:k0(k0({},k),{},{id:(e=k.id)!==null&&e!==void 0?e:XN(),environment:he})}}function nPe(r){var e=r.panelPlacement,t=r.container,n=r.form,i=r.environment,o=t.getBoundingClientRect(),a=i.pageYOffset||i.document.documentElement.scrollTop||i.document.body.scrollTop||0,s=a+o.top+o.height;switch(e){case"start":return{top:s,left:o.left};case"end":return{top:s,right:i.document.documentElement.clientWidth-(o.left+o.width)};case"full-width":return{top:s,left:0,right:0,width:"unset",maxWidth:"unset"};case"input-wrapper-width":{var c=n.getBoundingClientRect();return{top:s,left:c.left,right:i.document.documentElement.clientWidth-(c.left+c.width),width:"unset",maxWidth:"unset"}}default:throw new Error("[Autocomplete] The `panelPlacement` value ".concat(JSON.stringify(e)," is not valid."))}}function HD(r){"@babel/helpers - typeof";return HD=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},HD(r)}function gq(){return gq=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},gq.apply(this,arguments)}function iPe(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Ek(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?iPe(Object(t),!0).forEach(function(n){Xzt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):iPe(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Xzt(r,e,t){return e=Jzt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Jzt(r){var e=Qzt(r,"string");return HD(e)==="symbol"?e:String(e)}function Qzt(r,e){if(HD(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(HD(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function oPe(r){var e=r.autocomplete,t=r.autocompleteScopeApi,n=r.dom,i=r.propGetters,o=r.state;fG(n.root,i.getRootProps(Ek({state:o,props:e.getRootProps({})},t))),fG(n.input,i.getInputProps(Ek({state:o,props:e.getInputProps({inputElement:n.input}),inputElement:n.input},t))),Vd(n.label,{hidden:o.status==="stalled"}),Vd(n.loadingIndicator,{hidden:o.status!=="stalled"}),Vd(n.clearButton,{hidden:!o.query}),Vd(n.detachedSearchButtonQuery,{textContent:o.query}),Vd(n.detachedSearchButtonPlaceholder,{hidden:!!o.query})}function aPe(r,e){var t=e.autocomplete,n=e.autocompleteScopeApi,i=e.classNames,o=e.html,a=e.dom,s=e.panelContainer,c=e.propGetters,p=e.state,g=e.components,w=e.renderer;if(!p.isOpen){s.contains(a.panel)&&s.removeChild(a.panel);return}!s.contains(a.panel)&&p.status!=="loading"&&s.appendChild(a.panel),a.panel.classList.toggle("aa-Panel--stalled",p.status==="stalled");var D=p.collections.filter(function(q){var H=q.source,Y=q.items;return H.templates.noResults||Y.length>0}).map(function(q,H){var Y=q.source,X=q.items;return w.createElement("section",{key:H,className:i.source,"data-autocomplete-source-id":Y.sourceId},Y.templates.header&&w.createElement("div",{className:i.sourceHeader},Y.templates.header({components:g,createElement:w.createElement,Fragment:w.Fragment,items:X,source:Y,state:p,html:o})),Y.templates.noResults&&X.length===0?w.createElement("div",{className:i.sourceNoResults},Y.templates.noResults({components:g,createElement:w.createElement,Fragment:w.Fragment,source:Y,state:p,html:o})):w.createElement("ul",gq({className:i.list},c.getListProps(Ek({state:p,props:t.getListProps({source:Y})},n))),X.map(function(ce){var k=t.getItemProps({item:ce,source:Y});return w.createElement("li",gq({key:k.id,className:i.item},c.getItemProps(Ek({state:p,props:k},n))),Y.templates.item({components:g,createElement:w.createElement,Fragment:w.Fragment,item:ce,state:p,html:o}))})),Y.templates.footer&&w.createElement("div",{className:i.sourceFooter},Y.templates.footer({components:g,createElement:w.createElement,Fragment:w.Fragment,items:X,source:Y,state:p,html:o})))}),M=w.createElement(w.Fragment,null,w.createElement("div",{className:i.panelLayout},D),w.createElement("div",{className:"aa-GradientBottom"})),F=D.reduce(function(q,H){return q[H.props["data-autocomplete-source-id"]]=H,q},{});r(Ek(Ek({children:M,state:p,sections:D,elements:F},w),{},{components:g,html:o},n),a.panel)}var sPe=[{segment:"autocomplete-js",version:JN}];var e5t=["components"];function WD(r){"@babel/helpers - typeof";return WD=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},WD(r)}function t5t(r,e){if(r==null)return{};var t=r5t(r,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function r5t(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function lPe(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function D_(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lPe(Object(t),!0).forEach(function(n){cPe(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):lPe(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function cPe(r,e,t){return e=n5t(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function n5t(r){var e=i5t(r,"string");return WD(e)==="symbol"?e:String(e)}function i5t(r,e){if(WD(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(WD(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var uPe=0;function fPe(r){var e=ALe(),t=e.runEffect,n=e.cleanupEffects,i=e.runEffects,o=DLe(),a=o.reactive,s=o.runReactives,c=S_(!1),p=S_(r),g=S_(void 0),w=a(function(){return rPe(p.current)}),D=a(function(){return w.value.core.environment.matchMedia(w.value.renderer.detachedMediaQuery).matches}),M=a(function(){return lLe(D_(D_({},w.value.core),{},{onStateChange:function(ge){var ve,Ne,U;c.current=ge.state.collections.some(function(Q){return Q.source.templates.noResults}),(ve=g.current)===null||ve===void 0||ve.call(g,ge),(Ne=(U=w.value.core).onStateChange)===null||Ne===void 0||Ne.call(U,ge)},shouldPanelOpen:p.current.shouldPanelOpen||function(_e){var ge=_e.state;if(D.value)return!0;var ve=_0(ge)>0;if(!w.value.core.openOnFocus&&!ge.query)return ve;var Ne=!!(c.current||w.value.renderer.renderNoResults);return!ve&&Ne||ve},__autocomplete_metadata:{userAgents:sPe,options:r}}))}),F=S_(D_({collections:[],completion:null,context:{},isOpen:!1,query:"",activeItemId:null,status:"idle"},w.value.core.initialState)),q={getEnvironmentProps:w.value.renderer.getEnvironmentProps,getFormProps:w.value.renderer.getFormProps,getInputProps:w.value.renderer.getInputProps,getItemProps:w.value.renderer.getItemProps,getLabelProps:w.value.renderer.getLabelProps,getListProps:w.value.renderer.getListProps,getPanelProps:w.value.renderer.getPanelProps,getRootProps:w.value.renderer.getRootProps},H={setActiveItemId:M.value.setActiveItemId,setQuery:M.value.setQuery,setCollections:M.value.setCollections,setIsOpen:M.value.setIsOpen,setStatus:M.value.setStatus,setContext:M.value.setContext,refresh:M.value.refresh,navigator:M.value.navigator},Y=a(function(){return fLe.bind(w.value.renderer.renderer.createElement)}),X=a(function(){return CLe({autocomplete:M.value,autocompleteScopeApi:H,classNames:w.value.renderer.classNames,environment:w.value.core.environment,isDetached:D.value,placeholder:w.value.core.placeholder,propGetters:q,setIsModalOpen:be,state:F.current,translations:w.value.renderer.translations})});function ce(){Vd(X.value.panel,{style:D.value?{}:nPe({panelPlacement:w.value.renderer.panelPlacement,container:X.value.root,form:X.value.form,environment:w.value.core.environment})})}function k(_e){F.current=_e;var ge={autocomplete:M.value,autocompleteScopeApi:H,classNames:w.value.renderer.classNames,components:w.value.renderer.components,container:w.value.renderer.container,html:Y.value,dom:X.value,panelContainer:D.value?X.value.detachedContainer:w.value.renderer.panelContainer,propGetters:q,state:F.current,renderer:w.value.renderer.renderer},ve=!_0(_e)&&!c.current&&w.value.renderer.renderNoResults||w.value.renderer.render;oPe(ge),aPe(ve,ge)}t(function(){var _e=M.value.getEnvironmentProps({formElement:X.value.form,panelElement:X.value.panel,inputElement:X.value.input});return Vd(w.value.core.environment,_e),function(){Vd(w.value.core.environment,Object.keys(_e).reduce(function(ge,ve){return D_(D_({},ge),{},cPe({},ve,void 0))},{}))}}),t(function(){var _e=D.value?w.value.core.environment.document.body:w.value.renderer.panelContainer,ge=D.value?X.value.detachedOverlay:X.value.panel;return D.value&&F.current.isOpen&&be(!0),k(F.current),function(){_e.contains(ge)&&(_e.removeChild(ge),_e.classList.remove("aa-Detached"))}}),t(function(){var _e=w.value.renderer.container;return _e.appendChild(X.value.root),function(){_e.removeChild(X.value.root)}}),t(function(){var _e=dk(function(ge){var ve=ge.state;k(ve)},0);return g.current=function(ge){var ve=ge.state,Ne=ge.prevState;if(D.value&&Ne.isOpen!==ve.isOpen&&be(ve.isOpen),!D.value&&ve.isOpen&&!Ne.isOpen&&ce(),ve.query!==Ne.query){var U=w.value.core.environment.document.querySelectorAll(".aa-Panel--scrollable");U.forEach(function(Q){Q.scrollTop!==0&&(Q.scrollTop=0)})}_e({state:ve})},function(){g.current=void 0}}),t(function(){var _e=dk(function(){var ge=D.value;D.value=w.value.core.environment.matchMedia(w.value.renderer.detachedMediaQuery).matches,ge!==D.value?le({}):requestAnimationFrame(ce)},20);return w.value.core.environment.addEventListener("resize",_e),function(){w.value.core.environment.removeEventListener("resize",_e)}}),t(function(){if(!D.value)return function(){};function _e(U){X.value.detachedContainer.classList.toggle("aa-DetachedContainer--modal",U)}function ge(U){_e(U.matches)}var ve=w.value.core.environment.matchMedia(getComputedStyle(w.value.core.environment.document.documentElement).getPropertyValue("--aa-detached-modal-media-query"));_e(ve.matches);var Ne=!!ve.addEventListener;return Ne?ve.addEventListener("change",ge):ve.addListener(ge),function(){Ne?ve.removeEventListener("change",ge):ve.removeListener(ge)}}),t(function(){return requestAnimationFrame(ce),function(){}});function he(){uPe--,n()}function le(){var _e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n();var ge=w.value.renderer,ve=ge.components,Ne=t5t(ge,e5t);p.current=cG(Ne,w.value.core,{components:bLe(ve,function(U){var Q=U.value;return!Q.hasOwnProperty("__autocomplete_componentName")}),initialState:F.current},_e),s(),i(),M.value.refresh().then(function(){k(F.current)})}function be(_e){var ge=w.value.core.environment.document.body.contains(X.value.detachedOverlay);_e!==ge&&(_e?(w.value.core.environment.document.body.appendChild(X.value.detachedOverlay),w.value.core.environment.document.body.classList.add("aa-Detached"),X.value.input.focus()):(w.value.core.environment.document.body.removeChild(X.value.detachedOverlay),w.value.core.environment.document.body.classList.remove("aa-Detached")))}return uPe++,D_(D_({},H),{},{update:le,destroy:he})}var dPe=na(c_());var vq=(r,e)=>{let t;return(...n)=>(t&&clearTimeout(t),new Promise(i=>{t=setTimeout(()=>i(r(...n)),e)}))};var yq=class extends Or{static targets=["autocomplete","button","hiddenId","visibleLabel","clearValue","clearButton"];static values={extraParams:Object};debouncedFetch=vq(fetch,this.searchDebounce);destroyMethod;get dataset(){return this.autocompleteTarget.dataset}get searchDebounce(){return window.Avo.configuration.search_debounce}get translationKeys(){let r;try{r=JSON.parse(this.dataset.translationKeys)}catch{r={}}return r}get isBelongsToSearch(){return this.dataset.viaAssociation==="belongs_to"}get isHasManySearch(){return this.dataset.viaAssociation==="has_many"}get isGlobalSearch(){return this.dataset.searchResource==="global"}connect(){let r=this;this.buttonTarget.onclick=()=>this.showSearchPanel(),this.clearValueTargets.forEach(t=>{t.getAttribute("value")&&this.hasClearButtonTarget&&this.clearButtonTarget.classList.remove("hidden")}),this.isGlobalSearch&&hPe.bind(["command+k","ctrl+k"],()=>this.showSearchPanel()),this.autocompleteTarget.innerHTML="";let{destroy:e}=fPe({container:this.autocompleteTarget,placeholder:this.translationKeys.placeholder,translations:{detachedCancelButtonText:this.translationKeys.cancel_button},autoFocus:!0,openOnFocus:!0,detachedMediaQuery:"",onStateChange({prevState:t,state:n}){!n.isOpen&&t.isOpen&&(n.query="")},getSources:({query:t})=>{document.body.classList.add("search-loading");let n=r.searchUrl(t);return r.debouncedFetch(n).then(i=>(document.body.classList.remove("search-loading"),i.json())).then(i=>Object.keys(i).map(o=>r.addSource(o,i[o])))}});this.destroyMethod=e,this.buttonTarget.dataset.shouldBeDisabled!=="true"&&this.buttonTarget.removeAttribute("disabled")}disconnect(){this.destroyMethod&&(this.destroyMethod(),this.destroyMethod=null)}addSource(r,e){let t=this;return{sourceId:r,getItems:()=>e.results,onSelect:t.handleOnSelect.bind(t),templates:{header(){return`${e.header.toUpperCase()} ${e.help}`},item({item:n,createElement:i}){let o=[];if(n._avatar){let c;switch(n._avatar_type){default:case"circle":c="rounded-full";break;case"rounded":c="rounded-sm";break;case"square":c="rounded-none";break}o.push(i("img",{src:n._avatar,alt:n._label,class:`shrink-0 w-8 h-8 my-[2px] inline mr-2 ${c}`}))}let a=tk.sanitize(n._label),s=[i("div",{dangerouslySetInnerHTML:{__html:a}},a)];if(n._description){let c=tk.sanitize(n._description);s.push(i("div",{class:"aa-ItemDescription",dangerouslySetInnerHTML:{__html:c}},c))}return o.push(i("div",null,s)),i("div",{class:"flex"},o)},noResults(){return t.translationKeys.no_item_found.replace("%{item}",r)}}}}handleOnSelect({item:r}){this.isBelongsToSearch&&!r._error?(this.updateFieldAttribute(this.hiddenIdTarget,"value",r._id),this.updateFieldAttribute(this.buttonTarget,"value",this.removeHTMLTags(r._label)),this.hasClearButtonTarget&&this.clearButtonTarget.classList.remove("hidden")):pv.visit(r._url,{action:"advance"}),document.body.classList.remove("aa-Detached")}searchUrl(r){return(0,dPe.default)().segment([window.Avo.configuration.root_path,...this.searchSegments()]).search(this.searchParams(encodeURIComponent(r))).readable().toString()}searchSegments(){let r=["avo_api",this.dataset.searchResource,"search"];return this.isGlobalSearch&&(r=["avo_api","search"]),r}searchParams(r){let e={...Object.fromEntries(new URLSearchParams(window.location.search)),q:r,global:!1,...this.extraParamsValue};return this.isGlobalSearch&&(e.global=!0),(this.isBelongsToSearch||this.isHasManySearch)&&(e=this.addAssociationParams(e),e=this.addReflectionParams(e),this.isBelongsToSearch&&(e={...e,via_parent_resource_id:this.dataset.viaParentResourceId,via_parent_resource_class:this.dataset.viaParentResourceClass,via_relation:this.dataset.viaRelation})),e}addAssociationParams(r){return r={...r,via_association:this.dataset.viaAssociation,via_association_id:this.dataset.viaAssociationId},r}addReflectionParams(r){return r={...r,via_reflection_class:this.dataset.viaReflectionClass,via_reflection_id:this.dataset.viaReflectionId,via_reflection_view:this.dataset.viaReflectionView},r}showSearchPanel(){this.autocompleteTarget.querySelector("button").click()}clearValue(){this.clearValueTargets.map(r=>this.updateFieldAttribute(r,"value","")),this.clearButtonTarget.classList.add("hidden")}updateFieldAttribute(r,e,t){r.setAttribute(e,t),r.dispatchEvent(new Event("input"))}removeHTMLTags(r){return new DOMParser().parseFromString(r,"text/html").body.textContent||""}};var pPe=na(c_()),bq=class extends Or{static targets=["select"];get parentTurboFrame(){return this.context.scope.element.closest("turbo-frame")}onChange(r){if(!this.parentTurboFrame.src)return;let e=new pPe.default(this.parentTurboFrame.src);e.search({...e.query(!0),range:r.currentTarget.value}),this.parentTurboFrame.src=e.toString(),this.parentTurboFrame.reload()}};var xq=class extends Fd{static targets=["selector"];getFilterValue(){return this.selectorTarget.value===""?null:this.selectorTarget.value}getFilterClass(){let{filterClass:r}=this.selectorTarget.dataset;return r}};var _q=class extends Or{destroy(){this.context.element.remove()}};function wq(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)r[n]=t[n]}return r}var o5t={read:function(r){return r[0]==='"'&&(r=r.slice(1,-1)),r.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(r){return encodeURIComponent(r).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function SG(r,e){function t(i,o,a){if(!(typeof document>"u")){a=wq({},e,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var c in a)a[c]&&(s+="; "+c,a[c]!==!0&&(s+="="+a[c].split(";")[0]));return document.cookie=i+"="+r.write(o,i)+s}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},s=0;s<o.length;s++){var c=o[s].split("="),p=c.slice(1).join("=");try{var g=decodeURIComponent(c[0]);if(a[g]=r.read(p,g),i===g)break}catch{}}return i?a[i]:a}}return Object.create({set:t,get:n,remove:function(i,o){t(i,"",wq({},o,{expires:-1}))},withAttributes:function(i){return SG(this.converter,wq({},this.attributes,i))},withConverter:function(i){return SG(wq({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(r)}})}var VD=SG(o5t,{path:"/"});function a5t(r,e){let t=r.getBoundingClientRect(),n=document.documentElement,i=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(i.height||window.innerHeight||n.clientHeight)&&t.right<=(i.width||window.innerWidth||n.clientWidth)}function s5t(){let r=document.querySelector(".avo-sidebar .mac-styled-scrollbar a.active"),e=document.querySelector(".avo-sidebar .mac-styled-scrollbar");r&&!a5t(r,e)&&r.scrollIntoView({block:"end",inline:"nearest"})}var Sq=class extends Or{static targets=["sidebar","mobileSidebar","mainArea"];static values={open:Boolean};get cookieKey(){return`${window.Avo.configuration.cookies_key}.sidebar.open`}get sidebarOpen(){return VD.get(this.cookieKey)==="1"}get sidebarScrollPosition(){return window.Avo.localStorage.get("sidebar.sidebarScrollPosition")}set sidebarScrollPosition(r){window.Avo.localStorage.set("sidebar.sidebarScrollPosition",r)}set cookie(r){VD.set(this.cookieKey,r===!0?1:0)}connect(){this.attachScrollVisibilityAnchor(),this.sidebarScrollPosition&&window.Avo.configuration.preserve_sidebar_scroll&&document.querySelector(".avo-sidebar .mac-styled-scrollbar").scrollTo({top:this.sidebarScrollPosition,behavior:"instant"}),this.rememberScrollPosition()}rememberScrollPosition(){let r;document.addEventListener("turbo:visit",r=()=>{this.sidebarScrollPosition=document.querySelector(".avo-sidebar .mac-styled-scrollbar").scrollTop,document.removeEventListener("turbo:visit",r)})}attachScrollVisibilityAnchor(){window.Avo.configuration.focus_sidebar_menu_item&&s5t()}toggleSidebar(){this.sidebarTarget.classList.contains("hidden")&&this.sidebarTarget.classList.remove("hidden"),this.mainAreaTarget.classList.toggle("sidebar-open"),VD.set(this.cookieKey,this.newValue(VD.get(this.cookieKey)))}toggleSidebarOnMobile(){this.mobileSidebarTarget.classList.contains("hidden")&&(this.mainAreaTarget.classList.remove("sidebar-open"),this.mobileSidebarTarget.classList.remove("hidden"),this.mainAreaTarget.offsetHeight),this.mainAreaTarget.classList.toggle("sidebar-open")}newValue(r){return r===void 0||r==="1"?"0":"1"}};var kq=class extends Or{static targets=["element"];static values={confirm:String};handle(r){r.preventDefault(),window.confirm(this.confirmValue)&&(window.Turbo.cache.clear(),this.element.submit())}};var Tq=class extends Or{visitRecord(r){if(r.type!=="click")return;let e=r.shiftKey,t=r.target.closest(".item-selector-cell"),n=r.target.closest("a, button"),i=r.target.closest('input[type="checkbox"]');if(e||n||i||t)return;let o=r.target.closest("tr"),a=o.dataset.visitPath;!o||!a||(r.metaKey||r.ctrlKey?this.#t(a):this.#e(a))}#e(r){window.Turbo.visit(r)}#t(r){window.open(r,"_blank").focus()}};var Eq=class extends Or{static targets=["tabPanel"];static values={view:String,activeTab:String,groupId:String,resourceName:String};connect(){this.selectCurrentTab()}selectCurrentTab(){let r={};Array.from(new URL(window.location).searchParams.entries()).forEach(([i,o])=>{r[i]=o});let e=`resources.${this.resourceNameValue}.tabgroups.${this.groupIdValue}.selectedTab`,t=window.Avo.localStorage.get(e),n=null;r[this.groupParam(this.groupIdValue)]?n=r[this.groupParam(this.groupIdValue)]:t&&(n=t),this.getTabByName(n)&&(this.hideAllTabs(),this.revealTabByName(n))}getTabByName(r){return this.tabPanelTargets.find(e=>e.dataset.tabId===r)}groupParam(r){return encodeURIComponent(`tab-group_${r}`)}async changeTab(r){r.preventDefault();let{params:e}=r,{groupId:t,tabName:n,resourceName:i}=e,o=`resources.${i}.tabgroups.${t}.selectedTab`,a=new URL(window.location);a.searchParams.set(this.groupParam(t),encodeURIComponent(n)),window.Turbo.navigator.history.replace({href:a.pathname+a.search}),window.Avo.localStorage.set(o,n),this.hideAllTabs(),this.revealTabByName(n)}revealTabByName(r){this.getTabByName(r).classList.remove("hidden")}hideAllTabs(){this.tabPanelTargets.map(r=>r.classList.add("hidden"))}};var L_=na(O$());var mPe="&#8203;";function kG(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function gPe(r){return function(e){if(Array.isArray(e))return kG(e)}(r)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(r)||function(e,t){if(e){if(typeof e=="string")return kG(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kG(e,t)}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var E0={isEnabled:function(){var r;return(r=window.TAGIFY_DEBUG)===null||r===void 0||r},log:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var n;this.isEnabled()&&(n=console).log.apply(n,["[Tagify]:"].concat(gPe(e)))},warn:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var n;this.isEnabled()&&(n=console).warn.apply(n,["[Tagify]:"].concat(gPe(e)))}},GD=function(r,e,t,n){return r=""+r,e=""+e,n&&(r=r.trim(),e=e.trim()),t?r==e:r.toLowerCase()==e.toLowerCase()},vPe=function(r,e){return r&&Array.isArray(r)&&r.map(function(t){return IG(t,e)})};function IG(r,e){var t,n={};for(t in r)e.indexOf(t)<0&&(n[t]=r[t]);return n}function TG(r){return new DOMParser().parseFromString(r.trim(),"text/html").body.firstElementChild}function yPe(r,e){for(e=e||"previous";r=r[e+"Sibling"];)if(r.nodeType==3)return r}function I_(r){return typeof r=="string"?r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/`|'/g,"&#039;"):r}function Ig(r){var e=Object.prototype.toString.call(r).split(" ")[1].slice(0,-1);return r===Object(r)&&e!="Array"&&e!="Function"&&e!="RegExp"&&e!="HTMLUnknownElement"}function Tc(r,e,t){var n,i;function o(a,s){for(var c in s)if(s.hasOwnProperty(c)){if(Ig(s[c])){Ig(a[c])?o(a[c],s[c]):a[c]=Object.assign({},s[c]);continue}if(Array.isArray(s[c])){a[c]=Object.assign([],s[c]);continue}a[c]=s[c]}}return n=r,((i=Object)!=null&&typeof Symbol<"u"&&i[Symbol.hasInstance]?i[Symbol.hasInstance](n):n instanceof i)||(r={}),o(r,e),t&&o(r,t),r}function bPe(){var r=[],e={},t=!0,n=!1,i=void 0;try{for(var o,a=arguments[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){var s=o.value,c=!0,p=!1,g=void 0;try{for(var w,D=s[Symbol.iterator]();!(c=(w=D.next()).done);c=!0){var M=w.value;Ig(M)?e[M.value]||(r.push(M),e[M.value]=1):r.includes(M)||r.push(M)}}catch(F){p=!0,g=F}finally{try{c||D.return==null||D.return()}finally{if(p)throw g}}}}catch(F){n=!0,i=F}finally{try{t||a.return==null||a.return()}finally{if(n)throw i}}return r}function Cq(r){return String.prototype.normalize?typeof r=="string"?r.normalize("NFD").replace(/[\u0300-\u036f]/g,""):void 0:r}var xPe=function(){return/(?=.*chrome)(?=.*android)/i.test(navigator.userAgent)};function _Pe(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,function(r){return(r^crypto.getRandomValues(new Uint8Array(1))[0]&15>>r/4).toString(16)})}function M_(r){var e;return CPe.call(this,r)&&(r==null||(e=r.classList)===null||e===void 0?void 0:e.contains(this.settings.classNames.tag))}function wPe(r){return CPe.call(this,r)&&r?.closest(this.settings.classNames.tagSelector)}function CPe(r){var e;return(r==null||(e=r.closest)===null||e===void 0?void 0:e.call(r,this.settings.classNames.namespaceSelector))===this.DOM.scope}function APe(r,e){var t=window.getSelection();return e=e||t.getRangeAt(0),typeof r=="string"&&(r=document.createTextNode(r)),e&&(e.deleteContents(),e.insertNode(r)),r}function ol(r,e,t){return r?(e&&(r.__tagifyTagData=t?e:Tc({},r.__tagifyTagData||{},e)),r.__tagifyTagData):(E0.warn("tag element doesn't exist",{tagElm:r,data:e}),e)}function T0(r){if(r&&r.parentNode){var e=r,t=window.getSelection(),n=t.getRangeAt(0);t.rangeCount&&(n.setStartAfter(e),n.collapse(!0),t.removeAllRanges(),t.addRange(n))}}function DPe(r,e){r.forEach(function(t){if(ol(t.previousSibling)||!t.previousSibling){var n=document.createTextNode("\u200B");t.before(n),e&&T0(n)}})}var EG={delimiters:",",pattern:null,tagTextProp:"value",maxTags:1/0,callbacks:{},addTagOnBlur:!0,addTagOn:["blur","tab","enter"],onChangeAfterBlur:!0,duplicates:!1,whitelist:[],blacklist:[],enforceWhitelist:!1,userInput:!0,focusable:!0,keepInvalidTags:!1,createInvalidTags:!0,mixTagsAllowedAfter:/,|\.|\:|\s/,mixTagsInterpolator:["[[","]]"],backspace:!0,skipInvalid:!1,pasteAsTags:!0,editTags:{clicks:2,keepInvalid:!0},transformTag:function(){},trim:!0,a11y:{focusableTags:!1},mixMode:{insertAfterTag:"\xA0"},autoComplete:{enabled:!0,rightKey:!1,tabKey:!1},classNames:{namespace:"tagify",mixMode:"tagify--mix",selectMode:"tagify--select",input:"tagify__input",focus:"tagify--focus",tagNoAnimation:"tagify--noAnim",tagInvalid:"tagify--invalid",tagNotAllowed:"tagify--notAllowed",scopeLoading:"tagify--loading",hasMaxTags:"tagify--hasMaxTags",hasNoTags:"tagify--noTags",empty:"tagify--empty",inputInvalid:"tagify__input--invalid",dropdown:"tagify__dropdown",dropdownWrapper:"tagify__dropdown__wrapper",dropdownHeader:"tagify__dropdown__header",dropdownFooter:"tagify__dropdown__footer",dropdownItem:"tagify__dropdown__item",dropdownItemActive:"tagify__dropdown__item--active",dropdownItemHidden:"tagify__dropdown__item--hidden",dropdownItemSelected:"tagify__dropdown__item--selected",dropdownInital:"tagify__dropdown--initial",tag:"tagify__tag",tagText:"tagify__tag-text",tagX:"tagify__tag__removeBtn",tagLoading:"tagify__tag--loading",tagEditing:"tagify__tag--editable",tagFlash:"tagify__tag--flash",tagHide:"tagify__tag--hide"},dropdown:{classname:"",enabled:2,maxItems:10,searchKeys:["value","searchBy"],fuzzySearch:!0,caseSensitive:!1,accentedSearch:!0,includeSelectedTags:!1,escapeHTML:!0,highlightFirst:!0,closeOnSelect:!0,clearOnSelect:!0,position:"all",appendTarget:null},hooks:{beforeRemoveTag:function(){return Promise.resolve()},beforePaste:function(){return Promise.resolve()},suggestionClick:function(){return Promise.resolve()},beforeKeyDown:function(){return Promise.resolve()}}};function l5t(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function u5t(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){l5t(r,i,t[i])})}return r}function c5t(r,e){return e=e??{},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):function(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),i.push.apply(i,o)}return i}(Object(e)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}),r}function CG(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function f5t(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function h5t(r){return function(e){if(Array.isArray(e))return CG(e)}(r)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(r)||function(e,t){if(e){if(typeof e=="string")return CG(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return CG(e,t)}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d5t(){for(var r in this.dropdown={},this._dropdown)this.dropdown[r]=typeof this._dropdown[r]=="function"?this._dropdown[r].bind(this):this._dropdown[r];this.dropdown.refs(),this.DOM.dropdown.__tagify=this}var Aq,Ck,p5t=(Aq=function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){f5t(r,i,t[i])})}return r}({},{events:{binding:function(){var r=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],e=this.dropdown.events.callbacks,t=this.listeners.dropdown=this.listeners.dropdown||{position:this.dropdown.position.bind(this,null),onKeyDown:e.onKeyDown.bind(this),onMouseOver:e.onMouseOver.bind(this),onMouseLeave:e.onMouseLeave.bind(this),onClick:e.onClick.bind(this),onScroll:e.onScroll.bind(this)},n=r?"addEventListener":"removeEventListener";this.settings.dropdown.position!="manual"&&(document[n]("scroll",t.position,!0),window[n]("resize",t.position),window[n]("keydown",t.onKeyDown)),this.DOM.dropdown[n]("mouseover",t.onMouseOver),this.DOM.dropdown[n]("mouseleave",t.onMouseLeave),this.DOM.dropdown[n]("mousedown",t.onClick),this.DOM.dropdown.content[n]("scroll",t.onScroll)},callbacks:{onKeyDown:function(r){var e=this;if(this.state.hasFocus&&!this.state.composing){var t=this.settings,n=t.dropdown.includeSelectedTags,i=this.DOM.dropdown.querySelector(t.classNames.dropdownItemActiveSelector),o=this.dropdown.getSuggestionDataByNode(i),a=t.mode=="mix",s=t.mode=="select";t.hooks.beforeKeyDown(r,{tagify:this}).then(function(c){switch(r.key){case"ArrowDown":case"ArrowUp":case"Down":case"Up":r.preventDefault();var p=e.dropdown.getAllSuggestionsRefs(),g=r.key=="ArrowUp"||r.key=="Up";i&&(i=e.dropdown.getNextOrPrevOption(i,!g)),i&&i.matches(t.classNames.dropdownItemSelector)||(i=p[g?p.length-1:0]),e.dropdown.highlightOption(i,!0);break;case"PageUp":case"PageDown":var w;r.preventDefault();var D=e.dropdown.getAllSuggestionsRefs(),M=Math.floor(e.DOM.dropdown.content.clientHeight/((w=D[0])===null||w===void 0?void 0:w.offsetHeight))||1,F=r.key==="PageUp";if(i){var q=D.indexOf(i),H=F?Math.max(0,q-M):Math.min(D.length-1,q+M);i=D[H]}else i=D[0];e.dropdown.highlightOption(i,!0);break;case"Home":case"End":r.preventDefault();var Y=e.dropdown.getAllSuggestionsRefs();i=Y[r.key==="Home"?0:Y.length-1],e.dropdown.highlightOption(i,!0);break;case"Escape":case"Esc":e.dropdown.hide();break;case"ArrowRight":if(e.state.actions.ArrowLeft||t.autoComplete.rightKey)return;case"Tab":var X=!t.autoComplete.rightKey||!t.autoComplete.tabKey;if(!a&&!s&&i&&X&&!e.state.editing&&o){r.preventDefault();var ce=e.dropdown.getMappedValue(o);return e.state.autoCompleteData=o,e.input.autocomplete.set.call(e,ce),!1}return!0;case"Enter":r.preventDefault(),e.state.actions.selectOption=!0,setTimeout(function(){return e.state.actions.selectOption=!1},100),t.hooks.suggestionClick(r,{tagify:e,tagData:o,suggestionElm:i}).then(function(){if(i){var he=n?i:e.dropdown.getNextOrPrevOption(i,!g);e.dropdown.selectOption(i,r,function(){if(he){var le=he.getAttribute("value");he=e.dropdown.getSuggestionNodeByValue(le),e.dropdown.highlightOption(he)}})}else e.dropdown.hide(),a||e.addTags(e.state.inputText.trim(),!0)}).catch(function(he){return E0.warn(he)});break;case"Backspace":if(a||e.state.editing.scope)return;var k=e.input.raw.call(e);k!=""&&k.charCodeAt(0)!=8203||(t.backspace===!0?e.removeTags():t.backspace=="edit"&&setTimeout(e.editTag.bind(e),0))}})}},onMouseOver:function(r){var e=r.target.closest(this.settings.classNames.dropdownItemSelector);this.dropdown.highlightOption(e)},onMouseLeave:function(r){this.dropdown.highlightOption()},onClick:function(r){var e=this;if(r.button==0&&r.target!=this.DOM.dropdown&&r.target!=this.DOM.dropdown.content){var t=r.target.closest(this.settings.classNames.dropdownItemSelector),n=this.dropdown.getSuggestionDataByNode(t);this.state.actions.selectOption=!0,setTimeout(function(){return e.state.actions.selectOption=!1},100),this.settings.hooks.suggestionClick(r,{tagify:this,tagData:n,suggestionElm:t}).then(function(){t?e.dropdown.selectOption(t,r):e.dropdown.hide()}).catch(function(i){return E0.warn(i)})}},onScroll:function(r){var e=r.target,t=e.scrollTop/(e.scrollHeight-e.parentNode.clientHeight)*100;this.trigger("dropdown:scroll",{percentage:Math.round(t)})}}},refilter:function(r){r=r||this.state.dropdown.query||"",this.suggestedListItems=this.dropdown.filterListItems(r),this.dropdown.fill(),this.suggestedListItems.length||this.dropdown.hide(),this.trigger("dropdown:updated",this.DOM.dropdown)},getSuggestionDataByNode:function(r){for(var e,t=r&&r.getAttribute("value"),n=this.suggestedListItems.length;n--;){if(Ig(e=this.suggestedListItems[n])&&e.value==t)return e;if(e==t)return{value:e}}},getSuggestionNodeByValue:function(r){return this.dropdown.getAllSuggestionsRefs().find(function(e){return e.getAttribute("value")===r})},getNextOrPrevOption:function(r){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],t=this.dropdown.getAllSuggestionsRefs(),n=t.findIndex(function(i){return i===r});return e?t[n+1]:t[n-1]},highlightOption:function(r,e){var t,n=this.settings.classNames.dropdownItemActive;if(this.state.ddItemElm&&(this.state.ddItemElm.classList.remove(n),this.state.ddItemElm.removeAttribute("aria-selected")),!r)return this.state.ddItemData=null,this.state.ddItemElm=null,void this.input.autocomplete.suggest.call(this);t=this.dropdown.getSuggestionDataByNode(r),this.state.ddItemData=t,this.state.ddItemElm=r,r.classList.add(n),r.setAttribute("aria-selected",!0),e&&(r.parentNode.scrollTop=r.clientHeight+r.offsetTop-r.parentNode.clientHeight),this.settings.autoComplete&&(this.input.autocomplete.suggest.call(this,t),this.dropdown.position())},selectOption:function(r,e,t){var n=this,i=this.settings,o=i.dropdown.includeSelectedTags,a=i.dropdown,s=a.clearOnSelect,c=a.closeOnSelect;if(!r)return this.addTags(this.state.inputText,!0),void(c&&this.dropdown.hide());e=e||{};var p=r.getAttribute("value"),g=p=="noMatch",w=i.mode=="mix",D=this.suggestedListItems.find(function(F){var q;return((q=F.value)!==null&&q!==void 0?q:F)==p});if(this.trigger("dropdown:select",{data:D,elm:r,event:e}),D||g){if(this.state.editing){var M=this.normalizeTags([D])[0];D=i.transformTag.call(this,M)||M,this.onEditTagDone(null,Tc({__isValid:!0},D))}else this[w?"addMixTags":"addTags"]([D||this.input.raw.call(this)],s);(w||this.DOM.input.parentNode)&&(setTimeout(function(){n.DOM.input.focus(),n.toggleFocusClass(!0)}),c&&setTimeout(this.dropdown.hide.bind(this)),o?t&&t():(r.addEventListener("transitionend",function(){n.dropdown.fillHeaderFooter(),setTimeout(function(){r.remove(),n.dropdown.refilter(),t&&t()},100)},{once:!0}),r.classList.add(this.settings.classNames.dropdownItemHidden)))}else c&&setTimeout(this.dropdown.hide.bind(this))},selectAll:function(r){this.suggestedListItems.length=0,this.dropdown.hide(),this.dropdown.filterListItems("");var e=this.dropdown.filterListItems("");return r||(e=this.state.dropdown.suggestions),this.addTags(e,!0),this},filterListItems:function(r,e){var t,n,i,o,a,s,c=function(){var he,le,be=void 0,_e=void 0;he=F[ce],n=((le=Object)!=null&&typeof Symbol<"u"&&le[Symbol.hasInstance]?le[Symbol.hasInstance](he):he instanceof le)?F[ce]:{value:F[ce]};var ge,ve=Object.keys(n).some(function(Ne){return X.includes(Ne)})?X:["value"];w.fuzzySearch&&!e.exact?(o=ve.reduce(function(Ne,U){return Ne+" "+(n[U]||"")},"").toLowerCase().trim(),w.accentedSearch&&(o=Cq(o),s=Cq(s)),be=o.indexOf(s)==0,_e=o===s,ge=o,i=s.toLowerCase().split(" ").every(function(Ne){return ge.includes(Ne.toLowerCase())})):(be=!0,i=ve.some(function(Ne){var U=""+(n[Ne]||"");return w.accentedSearch&&(U=Cq(U),s=Cq(s)),w.caseSensitive||(U=U.toLowerCase()),_e=U===s,e.exact?U===s:U.indexOf(s)==0})),a=!w.includeSelectedTags&&t.isTagDuplicate(Ig(n)?n.value:n),i&&!a&&(_e&&be?M.push(n):w.sortby=="startsWith"&&be?D.unshift(n):D.push(n))},p=this,g=this.settings,w=g.dropdown,D=(e=e||{},[]),M=[],F=g.whitelist,q=w.maxItems>=0?w.maxItems:1/0,H=w.includeSelectedTags,Y=typeof w.sortby=="function",X=w.searchKeys,ce=0;if(!(r=g.mode=="select"&&this.value.length&&this.value[0][g.tagTextProp]==r?"":r)||!X.length){D=H?F:F.filter(function(he){return!p.isTagDuplicate(Ig(he)?he.value:he)});var k=Y?w.sortby(D,s):D.slice(0,q);return this.state.dropdown.suggestions=k,k}for(s=w.caseSensitive?""+r:(""+r).toLowerCase();ce<F.length;ce++)t=this,c();return this.state.dropdown.suggestions=M.concat(D),k=Y?w.sortby(M.concat(D),s):M.concat(D).slice(0,q),this.state.dropdown.suggestions=k,k},getMappedValue:function(r){var e=this.settings.dropdown.mapValueTo;return e?typeof e=="function"?e(r):r[e]||r.value:r.value},createListHTML:function(r){var e=this;return Tc([],r).map(function(t,n){typeof t!="string"&&typeof t!="number"||(t={value:t});var i=e.dropdown.getMappedValue(t);return i=typeof i=="string"&&e.settings.dropdown.escapeHTML?I_(i):i,e.settings.templates.dropdownItem.apply(e,[c5t(u5t({},t),{mappedValue:i}),e])}).join("")}}),Ck=(Ck={refs:function(){this.DOM.dropdown=this.parseTemplate("dropdown",[this.settings]),this.DOM.dropdown.content=this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-wrapper']")},getHeaderRef:function(){return this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-header']")},getFooterRef:function(){return this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-footer']")},getAllSuggestionsRefs:function(){return h5t(this.DOM.dropdown.content.querySelectorAll(this.settings.classNames.dropdownItemSelector))},show:function(r){var e,t,n,i=this,o=this.settings,a=o.mode=="mix"&&!o.enforceWhitelist,s=!o.whitelist||!o.whitelist.length,c=o.dropdown.position=="manual";if(r=r===void 0?this.state.inputText:r,!(s&&!a&&!o.templates.dropdownItemNoMatch||o.dropdown.enabled===!1||this.state.isLoading||this.settings.readonly)){if(clearTimeout(this.dropdownHide__bindEventsTimeout),this.suggestedListItems=this.dropdown.filterListItems(r),r&&!this.suggestedListItems.length&&(this.trigger("dropdown:noMatch",r),o.templates.dropdownItemNoMatch&&(n=o.templates.dropdownItemNoMatch.call(this,{value:r}))),!n){if(this.suggestedListItems.length)r&&a&&!this.state.editing.scope&&!GD(this.suggestedListItems[0].value,r)&&this.suggestedListItems.unshift({value:r});else{if(!r||!a||this.state.editing.scope)return this.input.autocomplete.suggest.call(this),void this.dropdown.hide();this.suggestedListItems=[{value:r}]}t=""+(Ig(e=this.suggestedListItems[0])?e.value:e),o.autoComplete&&t&&t.indexOf(r)==0&&this.input.autocomplete.suggest.call(this,e)}this.dropdown.fill(n),o.dropdown.highlightFirst&&this.dropdown.highlightOption(this.DOM.dropdown.content.querySelector(o.classNames.dropdownItemSelector)),this.state.dropdown.visible||setTimeout(this.dropdown.events.binding.bind(this)),this.state.dropdown.visible=r||!0,this.state.dropdown.query=r,this.setStateSelection(),c||setTimeout(function(){i.dropdown.position(),i.dropdown.render()}),setTimeout(function(){i.trigger("dropdown:show",i.DOM.dropdown)})}},hide:function(r){var e=this,t=this.DOM,n=t.scope,i=t.dropdown,o=this.settings.dropdown.position=="manual"&&!r;if(i&&document.body.contains(i)&&!o)return window.removeEventListener("resize",this.dropdown.position),this.dropdown.events.binding.call(this,!1),n.setAttribute("aria-expanded",!1),i.parentNode.removeChild(i),setTimeout(function(){e.state.dropdown.visible=!1},100),this.state.dropdown.query=this.state.ddItemData=this.state.ddItemElm=this.state.selection=null,this.state.tag&&this.state.tag.value.length&&(this.state.flaggedTags[this.state.tag.baseOffset]=this.state.tag),this.trigger("dropdown:hide",i),this},toggle:function(r){this.dropdown[this.state.dropdown.visible&&!r?"hide":"show"]()},getAppendTarget:function(){var r=this.settings.dropdown;return typeof r.appendTarget=="function"?r.appendTarget():r.appendTarget},render:function(){var r,e,t,n=this,i=(r=this.DOM.dropdown,(t=r.cloneNode(!0)).style.cssText="position:fixed; top:-9999px; opacity:0",document.body.appendChild(t),e=t.clientHeight,t.parentNode.removeChild(t),e),o=this.settings,a=this.dropdown.getAppendTarget();return o.dropdown.enabled===!1||(this.DOM.scope.setAttribute("aria-expanded",!0),document.body.contains(this.DOM.dropdown)||(this.DOM.dropdown.classList.add(o.classNames.dropdownInital),this.dropdown.position(i),a.appendChild(this.DOM.dropdown),setTimeout(function(){return n.DOM.dropdown.classList.remove(o.classNames.dropdownInital)}))),this},fill:function(r){r=typeof r=="string"?r:this.dropdown.createListHTML(r||this.suggestedListItems);var e,t=this.settings.templates.dropdownContent.call(this,r);this.DOM.dropdown.content.innerHTML=(e=t)?e.replace(/\>[\r\n ]+\</g,"><").split(/>\s+</).join("><").trim():""},fillHeaderFooter:function(){var r=this.dropdown.filterListItems(this.state.dropdown.query),e=this.parseTemplate("dropdownHeader",[r]),t=this.parseTemplate("dropdownFooter",[r]),n=this.dropdown.getHeaderRef(),i=this.dropdown.getFooterRef();e&&n?.parentNode.replaceChild(e,n),t&&i?.parentNode.replaceChild(t,i)},position:function(r){var e=this.settings.dropdown,t=this.dropdown.getAppendTarget();if(e.position!="manual"&&t){var n,i,o,a,s,c,p,g,w,D,M=this.DOM.dropdown,F=e.RTL,q=t===document.body,H=t===this.DOM.scope,Y=q?window.pageYOffset:t.scrollTop,X=document.fullscreenElement||document.webkitFullscreenElement||document.documentElement,ce=X.clientHeight,k=Math.max(X.clientWidth||0,window.innerWidth||0),he=k>480?e.position:"all",le=this.DOM[he=="input"?"input":"scope"];if(r=r||M.clientHeight,this.state.dropdown.visible){if(he=="text"?(o=(n=function(){var ge=document.getSelection();if(ge.rangeCount){var ve,Ne,U=ge.getRangeAt(0),Q=U.startContainer,de=U.startOffset;if(de>0)return(Ne=document.createRange()).setStart(Q,de-1),Ne.setEnd(Q,de),{left:(ve=Ne.getBoundingClientRect()).right,top:ve.top,bottom:ve.bottom};if(Q.getBoundingClientRect)return Q.getBoundingClientRect()}return{left:-9999,top:-9999}}()).bottom,i=n.top,a=n.left,s="auto"):(c=function(ge){var ve=0,Ne=0;for(ge=ge.parentNode;ge&&ge!=X;)ve+=ge.offsetTop||0,Ne+=ge.offsetLeft||0,ge=ge.parentNode;return{top:ve,left:Ne}}(t),n=le.getBoundingClientRect(),i=H?-1:n.top-c.top,o=(H?n.height:n.bottom-c.top)-1,a=H?-1:n.left-c.left,s=n.width+"px"),!q){var be=function(){for(var ge=0,ve=e.appendTarget.parentNode;ve;)ge+=ve.scrollTop||0,ve=ve.parentNode;return ge}();i+=be,o+=be}var _e;i=Math.floor(i),o=Math.ceil(o),g=k-a<120,w=((p=(_e=e.placeAbove)!==null&&_e!==void 0?_e:ce-n.bottom<r)?i:o)+Y,D=a+(F&&n.width||0)+window.pageXOffset,D=he=="text"&&g?"right: 0;":"left: ".concat(D,"px;"),M.style.cssText="".concat(D," top: ").concat(w,"px; min-width: ").concat(s,"; max-width: ").concat(s),M.setAttribute("placement",p?"top":"bottom"),M.setAttribute("position",he)}}}})!=null?Ck:{},Object.getOwnPropertyDescriptors?Object.defineProperties(Aq,Object.getOwnPropertyDescriptors(Ck)):function(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}(Object(Ck)).forEach(function(r){Object.defineProperty(Aq,r,Object.getOwnPropertyDescriptor(Ck,r))}),Aq),$D="@yaireo/tagify/",m5t={empty:"empty",exceed:"number of tags exceeded",pattern:"pattern mismatch",duplicate:"already exists",notAllowed:"not allowed"},g5t={wrapper:function(r,e){return'<tags class="'.concat(e.classNames.namespace," ").concat(e.mode?"".concat(e.classNames[e.mode+"Mode"]):""," ").concat(r.className,`"
751
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bzt(r,e){if(r){if(typeof r=="string")return wG(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return wG(r,e)}}function zzt(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function Uzt(r){if(Array.isArray(r))return wG(r)}function wG(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function mq(r){var e=r.hit,t=r.attribute,n=Array.isArray(t)?t:[t],i=mk(e,["_snippetResult"].concat(Nzt(n),["value"]));return typeof i!="string"&&(i=mk(e,n)||""),fq({highlightedValue:i})}function ZLe(r){return pq(mq(r))}function XLe(r){var e=r.createElement,t=r.Fragment;function n(i){var o=i.hit,a=i.attribute,s=i.tagName,c=s===void 0?"mark":s;return e(t,{},hq({hit:o,attribute:a}).map(function(p,g){return p.isHighlighted?e(c,{key:g},p.value):p.value}))}return n.__autocomplete_componentName="Highlight",n}function JLe(r){var e=r.createElement,t=r.Fragment;function n(i){var o=i.hit,a=i.attribute,s=i.tagName,c=s===void 0?"mark":s;return e(t,{},YLe({hit:o,attribute:a}).map(function(p,g){return p.isHighlighted?e(c,{key:g},p.value):p.value}))}return n.__autocomplete_componentName="ReverseHighlight",n}function QLe(r){var e=r.createElement,t=r.Fragment;function n(i){var o=i.hit,a=i.attribute,s=i.tagName,c=s===void 0?"mark":s;return e(t,{},ZLe({hit:o,attribute:a}).map(function(p,g){return p.isHighlighted?e(c,{key:g},p.value):p.value}))}return n.__autocomplete_componentName="ReverseSnippet",n}function ePe(r){var e=r.createElement,t=r.Fragment;function n(i){var o=i.hit,a=i.attribute,s=i.tagName,c=s===void 0?"mark":s;return e(t,{},mq({hit:o,attribute:a}).map(function(p,g){return p.isHighlighted?e(c,{key:g},p.value):p.value}))}return n.__autocomplete_componentName="Snippet",n}function jD(r){"@babel/helpers - typeof";return jD=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jD(r)}var jzt=["classNames","container","getEnvironmentProps","getFormProps","getInputProps","getItemProps","getLabelProps","getListProps","getPanelProps","getRootProps","panelContainer","panelPlacement","render","renderNoResults","renderer","detachedMediaQuery","components","translations"];function tPe(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function k0(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?tPe(Object(t),!0).forEach(function(n){Hzt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):tPe(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Hzt(r,e,t){return e=Wzt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Wzt(r){var e=Vzt(r,"string");return jD(e)==="symbol"?e:String(e)}function Vzt(r,e){if(jD(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(jD(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function $zt(r,e){if(r==null)return{};var t=Gzt(r,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function Gzt(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}var Kzt={clearButton:"aa-ClearButton",detachedCancelButton:"aa-DetachedCancelButton",detachedContainer:"aa-DetachedContainer",detachedFormContainer:"aa-DetachedFormContainer",detachedOverlay:"aa-DetachedOverlay",detachedSearchButton:"aa-DetachedSearchButton",detachedSearchButtonIcon:"aa-DetachedSearchButtonIcon",detachedSearchButtonPlaceholder:"aa-DetachedSearchButtonPlaceholder",detachedSearchButtonQuery:"aa-DetachedSearchButtonQuery",form:"aa-Form",input:"aa-Input",inputWrapper:"aa-InputWrapper",inputWrapperPrefix:"aa-InputWrapperPrefix",inputWrapperSuffix:"aa-InputWrapperSuffix",item:"aa-Item",label:"aa-Label",list:"aa-List",loadingIndicator:"aa-LoadingIndicator",panel:"aa-Panel",panelLayout:"aa-PanelLayout aa-Panel--scrollable",root:"aa-Autocomplete",source:"aa-Source",sourceFooter:"aa-SourceFooter",sourceHeader:"aa-SourceHeader",sourceNoResults:"aa-SourceNoResults",submitButton:"aa-SubmitButton"},Yzt=function(e,t){var n=e.children,i=e.render;i(n,t)},Zzt={createElement:yG,Fragment:Tk,render:HLe};function rPe(r){var e,t=r.classNames,n=r.container,i=r.getEnvironmentProps,o=r.getFormProps,a=r.getInputProps,s=r.getItemProps,c=r.getLabelProps,p=r.getListProps,g=r.getPanelProps,w=r.getRootProps,D=r.panelContainer,M=r.panelPlacement,F=r.render,q=r.renderNoResults,H=r.renderer,Y=r.detachedMediaQuery,X=r.components,ce=r.translations,k=$zt(r,jzt),he=typeof window<"u"?window:{},le=sG(he,n);le.tagName;var be=k0(k0({},Zzt),H),_e={Highlight:XLe(be),ReverseHighlight:JLe(be),ReverseSnippet:QLe(be),Snippet:ePe(be)},ge={clearButtonTitle:"Clear",detachedCancelButtonText:"Cancel",detachedSearchButtonTitle:"Search",submitButtonTitle:"Submit"};return{renderer:{classNames:dLe(Kzt,t??{}),container:le,getEnvironmentProps:i??function(ve){var Ne=ve.props;return Ne},getFormProps:o??function(ve){var Ne=ve.props;return Ne},getInputProps:a??function(ve){var Ne=ve.props;return Ne},getItemProps:s??function(ve){var Ne=ve.props;return Ne},getLabelProps:c??function(ve){var Ne=ve.props;return Ne},getListProps:p??function(ve){var Ne=ve.props;return Ne},getPanelProps:g??function(ve){var Ne=ve.props;return Ne},getRootProps:w??function(ve){var Ne=ve.props;return Ne},panelContainer:D?sG(he,D):he.document.body,panelPlacement:M??"input-wrapper-width",render:F??Yzt,renderNoResults:q,renderer:be,detachedMediaQuery:Y??getComputedStyle(he.document.documentElement).getPropertyValue("--aa-detached-media-query"),components:k0(k0({},_e),X),translations:k0(k0({},ge),ce)},core:k0(k0({},k),{},{id:(e=k.id)!==null&&e!==void 0?e:XN(),environment:he})}}function nPe(r){var e=r.panelPlacement,t=r.container,n=r.form,i=r.environment,o=t.getBoundingClientRect(),a=i.pageYOffset||i.document.documentElement.scrollTop||i.document.body.scrollTop||0,s=a+o.top+o.height;switch(e){case"start":return{top:s,left:o.left};case"end":return{top:s,right:i.document.documentElement.clientWidth-(o.left+o.width)};case"full-width":return{top:s,left:0,right:0,width:"unset",maxWidth:"unset"};case"input-wrapper-width":{var c=n.getBoundingClientRect();return{top:s,left:c.left,right:i.document.documentElement.clientWidth-(c.left+c.width),width:"unset",maxWidth:"unset"}}default:throw new Error("[Autocomplete] The `panelPlacement` value ".concat(JSON.stringify(e)," is not valid."))}}function HD(r){"@babel/helpers - typeof";return HD=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},HD(r)}function gq(){return gq=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},gq.apply(this,arguments)}function iPe(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Ek(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?iPe(Object(t),!0).forEach(function(n){Xzt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):iPe(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Xzt(r,e,t){return e=Jzt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Jzt(r){var e=Qzt(r,"string");return HD(e)==="symbol"?e:String(e)}function Qzt(r,e){if(HD(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(HD(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function oPe(r){var e=r.autocomplete,t=r.autocompleteScopeApi,n=r.dom,i=r.propGetters,o=r.state;fG(n.root,i.getRootProps(Ek({state:o,props:e.getRootProps({})},t))),fG(n.input,i.getInputProps(Ek({state:o,props:e.getInputProps({inputElement:n.input}),inputElement:n.input},t))),Vd(n.label,{hidden:o.status==="stalled"}),Vd(n.loadingIndicator,{hidden:o.status!=="stalled"}),Vd(n.clearButton,{hidden:!o.query}),Vd(n.detachedSearchButtonQuery,{textContent:o.query}),Vd(n.detachedSearchButtonPlaceholder,{hidden:!!o.query})}function aPe(r,e){var t=e.autocomplete,n=e.autocompleteScopeApi,i=e.classNames,o=e.html,a=e.dom,s=e.panelContainer,c=e.propGetters,p=e.state,g=e.components,w=e.renderer;if(!p.isOpen){s.contains(a.panel)&&s.removeChild(a.panel);return}!s.contains(a.panel)&&p.status!=="loading"&&s.appendChild(a.panel),a.panel.classList.toggle("aa-Panel--stalled",p.status==="stalled");var D=p.collections.filter(function(q){var H=q.source,Y=q.items;return H.templates.noResults||Y.length>0}).map(function(q,H){var Y=q.source,X=q.items;return w.createElement("section",{key:H,className:i.source,"data-autocomplete-source-id":Y.sourceId},Y.templates.header&&w.createElement("div",{className:i.sourceHeader},Y.templates.header({components:g,createElement:w.createElement,Fragment:w.Fragment,items:X,source:Y,state:p,html:o})),Y.templates.noResults&&X.length===0?w.createElement("div",{className:i.sourceNoResults},Y.templates.noResults({components:g,createElement:w.createElement,Fragment:w.Fragment,source:Y,state:p,html:o})):w.createElement("ul",gq({className:i.list},c.getListProps(Ek({state:p,props:t.getListProps({source:Y})},n))),X.map(function(ce){var k=t.getItemProps({item:ce,source:Y});return w.createElement("li",gq({key:k.id,className:i.item},c.getItemProps(Ek({state:p,props:k},n))),Y.templates.item({components:g,createElement:w.createElement,Fragment:w.Fragment,item:ce,state:p,html:o}))})),Y.templates.footer&&w.createElement("div",{className:i.sourceFooter},Y.templates.footer({components:g,createElement:w.createElement,Fragment:w.Fragment,items:X,source:Y,state:p,html:o})))}),M=w.createElement(w.Fragment,null,w.createElement("div",{className:i.panelLayout},D),w.createElement("div",{className:"aa-GradientBottom"})),F=D.reduce(function(q,H){return q[H.props["data-autocomplete-source-id"]]=H,q},{});r(Ek(Ek({children:M,state:p,sections:D,elements:F},w),{},{components:g,html:o},n),a.panel)}var sPe=[{segment:"autocomplete-js",version:JN}];var e5t=["components"];function WD(r){"@babel/helpers - typeof";return WD=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},WD(r)}function t5t(r,e){if(r==null)return{};var t=r5t(r,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function r5t(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function lPe(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function D_(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lPe(Object(t),!0).forEach(function(n){cPe(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):lPe(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function cPe(r,e,t){return e=n5t(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function n5t(r){var e=i5t(r,"string");return WD(e)==="symbol"?e:String(e)}function i5t(r,e){if(WD(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(WD(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var uPe=0;function fPe(r){var e=ALe(),t=e.runEffect,n=e.cleanupEffects,i=e.runEffects,o=DLe(),a=o.reactive,s=o.runReactives,c=S_(!1),p=S_(r),g=S_(void 0),w=a(function(){return rPe(p.current)}),D=a(function(){return w.value.core.environment.matchMedia(w.value.renderer.detachedMediaQuery).matches}),M=a(function(){return lLe(D_(D_({},w.value.core),{},{onStateChange:function(ge){var ve,Ne,U;c.current=ge.state.collections.some(function(Q){return Q.source.templates.noResults}),(ve=g.current)===null||ve===void 0||ve.call(g,ge),(Ne=(U=w.value.core).onStateChange)===null||Ne===void 0||Ne.call(U,ge)},shouldPanelOpen:p.current.shouldPanelOpen||function(_e){var ge=_e.state;if(D.value)return!0;var ve=_0(ge)>0;if(!w.value.core.openOnFocus&&!ge.query)return ve;var Ne=!!(c.current||w.value.renderer.renderNoResults);return!ve&&Ne||ve},__autocomplete_metadata:{userAgents:sPe,options:r}}))}),F=S_(D_({collections:[],completion:null,context:{},isOpen:!1,query:"",activeItemId:null,status:"idle"},w.value.core.initialState)),q={getEnvironmentProps:w.value.renderer.getEnvironmentProps,getFormProps:w.value.renderer.getFormProps,getInputProps:w.value.renderer.getInputProps,getItemProps:w.value.renderer.getItemProps,getLabelProps:w.value.renderer.getLabelProps,getListProps:w.value.renderer.getListProps,getPanelProps:w.value.renderer.getPanelProps,getRootProps:w.value.renderer.getRootProps},H={setActiveItemId:M.value.setActiveItemId,setQuery:M.value.setQuery,setCollections:M.value.setCollections,setIsOpen:M.value.setIsOpen,setStatus:M.value.setStatus,setContext:M.value.setContext,refresh:M.value.refresh,navigator:M.value.navigator},Y=a(function(){return fLe.bind(w.value.renderer.renderer.createElement)}),X=a(function(){return CLe({autocomplete:M.value,autocompleteScopeApi:H,classNames:w.value.renderer.classNames,environment:w.value.core.environment,isDetached:D.value,placeholder:w.value.core.placeholder,propGetters:q,setIsModalOpen:be,state:F.current,translations:w.value.renderer.translations})});function ce(){Vd(X.value.panel,{style:D.value?{}:nPe({panelPlacement:w.value.renderer.panelPlacement,container:X.value.root,form:X.value.form,environment:w.value.core.environment})})}function k(_e){F.current=_e;var ge={autocomplete:M.value,autocompleteScopeApi:H,classNames:w.value.renderer.classNames,components:w.value.renderer.components,container:w.value.renderer.container,html:Y.value,dom:X.value,panelContainer:D.value?X.value.detachedContainer:w.value.renderer.panelContainer,propGetters:q,state:F.current,renderer:w.value.renderer.renderer},ve=!_0(_e)&&!c.current&&w.value.renderer.renderNoResults||w.value.renderer.render;oPe(ge),aPe(ve,ge)}t(function(){var _e=M.value.getEnvironmentProps({formElement:X.value.form,panelElement:X.value.panel,inputElement:X.value.input});return Vd(w.value.core.environment,_e),function(){Vd(w.value.core.environment,Object.keys(_e).reduce(function(ge,ve){return D_(D_({},ge),{},cPe({},ve,void 0))},{}))}}),t(function(){var _e=D.value?w.value.core.environment.document.body:w.value.renderer.panelContainer,ge=D.value?X.value.detachedOverlay:X.value.panel;return D.value&&F.current.isOpen&&be(!0),k(F.current),function(){_e.contains(ge)&&(_e.removeChild(ge),_e.classList.remove("aa-Detached"))}}),t(function(){var _e=w.value.renderer.container;return _e.appendChild(X.value.root),function(){_e.removeChild(X.value.root)}}),t(function(){var _e=dk(function(ge){var ve=ge.state;k(ve)},0);return g.current=function(ge){var ve=ge.state,Ne=ge.prevState;if(D.value&&Ne.isOpen!==ve.isOpen&&be(ve.isOpen),!D.value&&ve.isOpen&&!Ne.isOpen&&ce(),ve.query!==Ne.query){var U=w.value.core.environment.document.querySelectorAll(".aa-Panel--scrollable");U.forEach(function(Q){Q.scrollTop!==0&&(Q.scrollTop=0)})}_e({state:ve})},function(){g.current=void 0}}),t(function(){var _e=dk(function(){var ge=D.value;D.value=w.value.core.environment.matchMedia(w.value.renderer.detachedMediaQuery).matches,ge!==D.value?le({}):requestAnimationFrame(ce)},20);return w.value.core.environment.addEventListener("resize",_e),function(){w.value.core.environment.removeEventListener("resize",_e)}}),t(function(){if(!D.value)return function(){};function _e(U){X.value.detachedContainer.classList.toggle("aa-DetachedContainer--modal",U)}function ge(U){_e(U.matches)}var ve=w.value.core.environment.matchMedia(getComputedStyle(w.value.core.environment.document.documentElement).getPropertyValue("--aa-detached-modal-media-query"));_e(ve.matches);var Ne=!!ve.addEventListener;return Ne?ve.addEventListener("change",ge):ve.addListener(ge),function(){Ne?ve.removeEventListener("change",ge):ve.removeListener(ge)}}),t(function(){return requestAnimationFrame(ce),function(){}});function he(){uPe--,n()}function le(){var _e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n();var ge=w.value.renderer,ve=ge.components,Ne=t5t(ge,e5t);p.current=cG(Ne,w.value.core,{components:bLe(ve,function(U){var Q=U.value;return!Q.hasOwnProperty("__autocomplete_componentName")}),initialState:F.current},_e),s(),i(),M.value.refresh().then(function(){k(F.current)})}function be(_e){var ge=w.value.core.environment.document.body.contains(X.value.detachedOverlay);_e!==ge&&(_e?(w.value.core.environment.document.body.appendChild(X.value.detachedOverlay),w.value.core.environment.document.body.classList.add("aa-Detached"),X.value.input.focus()):(w.value.core.environment.document.body.removeChild(X.value.detachedOverlay),w.value.core.environment.document.body.classList.remove("aa-Detached")))}return uPe++,D_(D_({},H),{},{update:le,destroy:he})}var dPe=na(c_());var vq=(r,e)=>{let t;return(...n)=>(t&&clearTimeout(t),new Promise(i=>{t=setTimeout(()=>i(r(...n)),e)}))};var yq=class extends Or{static targets=["autocomplete","button","hiddenId","visibleLabel","clearValue","clearButton"];static values={extraParams:Object};debouncedFetch=vq(fetch,this.searchDebounce);destroyMethod;get dataset(){return this.autocompleteTarget.dataset}get searchDebounce(){return window.Avo.configuration.search_debounce}get translationKeys(){let r;try{r=JSON.parse(this.dataset.translationKeys)}catch{r={}}return r}get isBelongsToSearch(){return this.dataset.viaAssociation==="belongs_to"}get isHasManySearch(){return this.dataset.viaAssociation==="has_many"}get isGlobalSearch(){return this.dataset.searchResource==="global"}connect(){let r=this;this.buttonTarget.onclick=()=>this.showSearchPanel(),this.clearValueTargets.forEach(t=>{t.getAttribute("value")&&this.hasClearButtonTarget&&this.clearButtonTarget.classList.remove("hidden")}),this.isGlobalSearch&&hPe.bind(["command+k","ctrl+k"],()=>this.showSearchPanel()),this.autocompleteTarget.innerHTML="";let{destroy:e}=fPe({container:this.autocompleteTarget,placeholder:this.translationKeys.placeholder,translations:{detachedCancelButtonText:this.translationKeys.cancel_button},autoFocus:!0,openOnFocus:!0,detachedMediaQuery:"",onStateChange({prevState:t,state:n}){!n.isOpen&&t.isOpen&&(n.query="")},getSources:({query:t})=>{document.body.classList.add("search-loading");let n=r.searchUrl(t);return r.debouncedFetch(n).then(i=>(document.body.classList.remove("search-loading"),i.json())).then(i=>Object.keys(i).map(o=>r.addSource(o,i[o])))}});this.destroyMethod=e,this.buttonTarget.dataset.shouldBeDisabled!=="true"&&this.buttonTarget.removeAttribute("disabled")}disconnect(){this.destroyMethod&&(this.destroyMethod(),this.destroyMethod=null)}addSource(r,e){let t=this;return{sourceId:r,getItems:()=>e.results,onSelect:t.handleOnSelect.bind(t),templates:{header(){return`${e.header.toUpperCase()} ${e.help}`},item({item:n,createElement:i}){let o=[];if(n._avatar){let c;switch(n._avatar_type){default:case"circle":c="rounded-full";break;case"rounded":c="rounded";break;case"square":c="rounded-none";break}o.push(i("img",{src:n._avatar,alt:n._label,class:`flex-shrink-0 w-8 h-8 my-[2px] inline mr-2 ${c}`}))}let a=tk.sanitize(n._label),s=[i("div",{dangerouslySetInnerHTML:{__html:a}},a)];if(n._description){let c=tk.sanitize(n._description);s.push(i("div",{class:"aa-ItemDescription",dangerouslySetInnerHTML:{__html:c}},c))}return o.push(i("div",null,s)),i("div",{class:"flex"},o)},noResults(){return t.translationKeys.no_item_found.replace("%{item}",r)}}}}handleOnSelect({item:r}){this.isBelongsToSearch&&!r._error?(this.updateFieldAttribute(this.hiddenIdTarget,"value",r._id),this.updateFieldAttribute(this.buttonTarget,"value",this.removeHTMLTags(r._label)),this.hasClearButtonTarget&&this.clearButtonTarget.classList.remove("hidden")):pv.visit(r._url,{action:"advance"}),document.body.classList.remove("aa-Detached")}searchUrl(r){return(0,dPe.default)().segment([window.Avo.configuration.root_path,...this.searchSegments()]).search(this.searchParams(encodeURIComponent(r))).readable().toString()}searchSegments(){let r=["avo_api",this.dataset.searchResource,"search"];return this.isGlobalSearch&&(r=["avo_api","search"]),r}searchParams(r){let e={...Object.fromEntries(new URLSearchParams(window.location.search)),q:r,global:!1,...this.extraParamsValue};return this.isGlobalSearch&&(e.global=!0),(this.isBelongsToSearch||this.isHasManySearch)&&(e=this.addAssociationParams(e),e=this.addReflectionParams(e),this.isBelongsToSearch&&(e={...e,via_parent_resource_id:this.dataset.viaParentResourceId,via_parent_resource_class:this.dataset.viaParentResourceClass,via_relation:this.dataset.viaRelation})),e}addAssociationParams(r){return r={...r,via_association:this.dataset.viaAssociation,via_association_id:this.dataset.viaAssociationId},r}addReflectionParams(r){return r={...r,via_reflection_class:this.dataset.viaReflectionClass,via_reflection_id:this.dataset.viaReflectionId,via_reflection_view:this.dataset.viaReflectionView},r}showSearchPanel(){this.autocompleteTarget.querySelector("button").click()}clearValue(){this.clearValueTargets.map(r=>this.updateFieldAttribute(r,"value","")),this.clearButtonTarget.classList.add("hidden")}updateFieldAttribute(r,e,t){r.setAttribute(e,t),r.dispatchEvent(new Event("input"))}removeHTMLTags(r){return new DOMParser().parseFromString(r,"text/html").body.textContent||""}};var pPe=na(c_()),bq=class extends Or{static targets=["select"];get parentTurboFrame(){return this.context.scope.element.closest("turbo-frame")}onChange(r){if(!this.parentTurboFrame.src)return;let e=new pPe.default(this.parentTurboFrame.src);e.search({...e.query(!0),range:r.currentTarget.value}),this.parentTurboFrame.src=e.toString(),this.parentTurboFrame.reload()}};var xq=class extends Fd{static targets=["selector"];getFilterValue(){return this.selectorTarget.value===""?null:this.selectorTarget.value}getFilterClass(){let{filterClass:r}=this.selectorTarget.dataset;return r}};var _q=class extends Or{destroy(){this.context.element.remove()}};function wq(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)r[n]=t[n]}return r}var o5t={read:function(r){return r[0]==='"'&&(r=r.slice(1,-1)),r.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(r){return encodeURIComponent(r).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function SG(r,e){function t(i,o,a){if(!(typeof document>"u")){a=wq({},e,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var c in a)a[c]&&(s+="; "+c,a[c]!==!0&&(s+="="+a[c].split(";")[0]));return document.cookie=i+"="+r.write(o,i)+s}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},s=0;s<o.length;s++){var c=o[s].split("="),p=c.slice(1).join("=");try{var g=decodeURIComponent(c[0]);if(a[g]=r.read(p,g),i===g)break}catch{}}return i?a[i]:a}}return Object.create({set:t,get:n,remove:function(i,o){t(i,"",wq({},o,{expires:-1}))},withAttributes:function(i){return SG(this.converter,wq({},this.attributes,i))},withConverter:function(i){return SG(wq({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(r)}})}var VD=SG(o5t,{path:"/"});function a5t(r,e){let t=r.getBoundingClientRect(),n=document.documentElement,i=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(i.height||window.innerHeight||n.clientHeight)&&t.right<=(i.width||window.innerWidth||n.clientWidth)}function s5t(){let r=document.querySelector(".avo-sidebar .mac-styled-scrollbar a.active"),e=document.querySelector(".avo-sidebar .mac-styled-scrollbar");r&&!a5t(r,e)&&r.scrollIntoView({block:"end",inline:"nearest"})}var Sq=class extends Or{static targets=["sidebar","mobileSidebar","mainArea"];static values={open:Boolean};get cookieKey(){return`${window.Avo.configuration.cookies_key}.sidebar.open`}get sidebarOpen(){return VD.get(this.cookieKey)==="1"}get sidebarScrollPosition(){return window.Avo.localStorage.get("sidebar.sidebarScrollPosition")}set sidebarScrollPosition(r){window.Avo.localStorage.set("sidebar.sidebarScrollPosition",r)}set cookie(r){VD.set(this.cookieKey,r===!0?1:0)}connect(){this.attachScrollVisibilityAnchor(),this.sidebarScrollPosition&&window.Avo.configuration.preserve_sidebar_scroll&&document.querySelector(".avo-sidebar .mac-styled-scrollbar").scrollTo({top:this.sidebarScrollPosition,behavior:"instant"}),this.rememberScrollPosition()}rememberScrollPosition(){let r;document.addEventListener("turbo:visit",r=()=>{this.sidebarScrollPosition=document.querySelector(".avo-sidebar .mac-styled-scrollbar").scrollTop,document.removeEventListener("turbo:visit",r)})}attachScrollVisibilityAnchor(){window.Avo.configuration.focus_sidebar_menu_item&&s5t()}toggleSidebar(){this.sidebarTarget.classList.contains("hidden")&&this.sidebarTarget.classList.remove("hidden"),this.mainAreaTarget.classList.toggle("sidebar-open"),VD.set(this.cookieKey,this.newValue(VD.get(this.cookieKey)))}toggleSidebarOnMobile(){this.mobileSidebarTarget.classList.contains("hidden")&&(this.mainAreaTarget.classList.remove("sidebar-open"),this.mobileSidebarTarget.classList.remove("hidden"),this.mainAreaTarget.offsetHeight),this.mainAreaTarget.classList.toggle("sidebar-open")}newValue(r){return r===void 0||r==="1"?"0":"1"}};var kq=class extends Or{static targets=["element"];static values={confirm:String};handle(r){r.preventDefault(),window.confirm(this.confirmValue)&&(window.Turbo.cache.clear(),this.element.submit())}};var Tq=class extends Or{visitRecord(r){if(r.type!=="click")return;let e=r.shiftKey,t=r.target.closest(".item-selector-cell"),n=r.target.closest("a, button"),i=r.target.closest('input[type="checkbox"]');if(e||n||i||t)return;let o=r.target.closest("tr"),a=o.dataset.visitPath;!o||!a||(r.metaKey||r.ctrlKey?this.#t(a):this.#e(a))}#e(r){window.Turbo.visit(r)}#t(r){window.open(r,"_blank").focus()}};var Eq=class extends Or{static targets=["tabPanel"];static values={view:String,activeTab:String,groupId:String,resourceName:String};connect(){this.selectCurrentTab()}selectCurrentTab(){let r={};Array.from(new URL(window.location).searchParams.entries()).forEach(([i,o])=>{r[i]=o});let e=`resources.${this.resourceNameValue}.tabgroups.${this.groupIdValue}.selectedTab`,t=window.Avo.localStorage.get(e),n=null;r[this.groupParam(this.groupIdValue)]?n=r[this.groupParam(this.groupIdValue)]:t&&(n=t),this.getTabByName(n)&&(this.hideAllTabs(),this.revealTabByName(n))}getTabByName(r){return this.tabPanelTargets.find(e=>e.dataset.tabId===r)}groupParam(r){return encodeURIComponent(`tab-group_${r}`)}async changeTab(r){r.preventDefault();let{params:e}=r,{groupId:t,tabName:n,resourceName:i}=e,o=`resources.${i}.tabgroups.${t}.selectedTab`,a=new URL(window.location);a.searchParams.set(this.groupParam(t),encodeURIComponent(n)),window.Turbo.navigator.history.replace({href:a.pathname+a.search}),window.Avo.localStorage.set(o,n),this.hideAllTabs(),this.revealTabByName(n)}revealTabByName(r){this.getTabByName(r).classList.remove("hidden")}hideAllTabs(){this.tabPanelTargets.map(r=>r.classList.add("hidden"))}};var L_=na(O$());var mPe="&#8203;";function kG(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function gPe(r){return function(e){if(Array.isArray(e))return kG(e)}(r)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(r)||function(e,t){if(e){if(typeof e=="string")return kG(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kG(e,t)}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var E0={isEnabled:function(){var r;return(r=window.TAGIFY_DEBUG)===null||r===void 0||r},log:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var n;this.isEnabled()&&(n=console).log.apply(n,["[Tagify]:"].concat(gPe(e)))},warn:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var n;this.isEnabled()&&(n=console).warn.apply(n,["[Tagify]:"].concat(gPe(e)))}},GD=function(r,e,t,n){return r=""+r,e=""+e,n&&(r=r.trim(),e=e.trim()),t?r==e:r.toLowerCase()==e.toLowerCase()},vPe=function(r,e){return r&&Array.isArray(r)&&r.map(function(t){return IG(t,e)})};function IG(r,e){var t,n={};for(t in r)e.indexOf(t)<0&&(n[t]=r[t]);return n}function TG(r){return new DOMParser().parseFromString(r.trim(),"text/html").body.firstElementChild}function yPe(r,e){for(e=e||"previous";r=r[e+"Sibling"];)if(r.nodeType==3)return r}function I_(r){return typeof r=="string"?r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/`|'/g,"&#039;"):r}function Ig(r){var e=Object.prototype.toString.call(r).split(" ")[1].slice(0,-1);return r===Object(r)&&e!="Array"&&e!="Function"&&e!="RegExp"&&e!="HTMLUnknownElement"}function Tc(r,e,t){var n,i;function o(a,s){for(var c in s)if(s.hasOwnProperty(c)){if(Ig(s[c])){Ig(a[c])?o(a[c],s[c]):a[c]=Object.assign({},s[c]);continue}if(Array.isArray(s[c])){a[c]=Object.assign([],s[c]);continue}a[c]=s[c]}}return n=r,((i=Object)!=null&&typeof Symbol<"u"&&i[Symbol.hasInstance]?i[Symbol.hasInstance](n):n instanceof i)||(r={}),o(r,e),t&&o(r,t),r}function bPe(){var r=[],e={},t=!0,n=!1,i=void 0;try{for(var o,a=arguments[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){var s=o.value,c=!0,p=!1,g=void 0;try{for(var w,D=s[Symbol.iterator]();!(c=(w=D.next()).done);c=!0){var M=w.value;Ig(M)?e[M.value]||(r.push(M),e[M.value]=1):r.includes(M)||r.push(M)}}catch(F){p=!0,g=F}finally{try{c||D.return==null||D.return()}finally{if(p)throw g}}}}catch(F){n=!0,i=F}finally{try{t||a.return==null||a.return()}finally{if(n)throw i}}return r}function Cq(r){return String.prototype.normalize?typeof r=="string"?r.normalize("NFD").replace(/[\u0300-\u036f]/g,""):void 0:r}var xPe=function(){return/(?=.*chrome)(?=.*android)/i.test(navigator.userAgent)};function _Pe(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,function(r){return(r^crypto.getRandomValues(new Uint8Array(1))[0]&15>>r/4).toString(16)})}function M_(r){var e;return CPe.call(this,r)&&(r==null||(e=r.classList)===null||e===void 0?void 0:e.contains(this.settings.classNames.tag))}function wPe(r){return CPe.call(this,r)&&r?.closest(this.settings.classNames.tagSelector)}function CPe(r){var e;return(r==null||(e=r.closest)===null||e===void 0?void 0:e.call(r,this.settings.classNames.namespaceSelector))===this.DOM.scope}function APe(r,e){var t=window.getSelection();return e=e||t.getRangeAt(0),typeof r=="string"&&(r=document.createTextNode(r)),e&&(e.deleteContents(),e.insertNode(r)),r}function ol(r,e,t){return r?(e&&(r.__tagifyTagData=t?e:Tc({},r.__tagifyTagData||{},e)),r.__tagifyTagData):(E0.warn("tag element doesn't exist",{tagElm:r,data:e}),e)}function T0(r){if(r&&r.parentNode){var e=r,t=window.getSelection(),n=t.getRangeAt(0);t.rangeCount&&(n.setStartAfter(e),n.collapse(!0),t.removeAllRanges(),t.addRange(n))}}function DPe(r,e){r.forEach(function(t){if(ol(t.previousSibling)||!t.previousSibling){var n=document.createTextNode("\u200B");t.before(n),e&&T0(n)}})}var EG={delimiters:",",pattern:null,tagTextProp:"value",maxTags:1/0,callbacks:{},addTagOnBlur:!0,addTagOn:["blur","tab","enter"],onChangeAfterBlur:!0,duplicates:!1,whitelist:[],blacklist:[],enforceWhitelist:!1,userInput:!0,focusable:!0,keepInvalidTags:!1,createInvalidTags:!0,mixTagsAllowedAfter:/,|\.|\:|\s/,mixTagsInterpolator:["[[","]]"],backspace:!0,skipInvalid:!1,pasteAsTags:!0,editTags:{clicks:2,keepInvalid:!0},transformTag:function(){},trim:!0,a11y:{focusableTags:!1},mixMode:{insertAfterTag:"\xA0"},autoComplete:{enabled:!0,rightKey:!1,tabKey:!1},classNames:{namespace:"tagify",mixMode:"tagify--mix",selectMode:"tagify--select",input:"tagify__input",focus:"tagify--focus",tagNoAnimation:"tagify--noAnim",tagInvalid:"tagify--invalid",tagNotAllowed:"tagify--notAllowed",scopeLoading:"tagify--loading",hasMaxTags:"tagify--hasMaxTags",hasNoTags:"tagify--noTags",empty:"tagify--empty",inputInvalid:"tagify__input--invalid",dropdown:"tagify__dropdown",dropdownWrapper:"tagify__dropdown__wrapper",dropdownHeader:"tagify__dropdown__header",dropdownFooter:"tagify__dropdown__footer",dropdownItem:"tagify__dropdown__item",dropdownItemActive:"tagify__dropdown__item--active",dropdownItemHidden:"tagify__dropdown__item--hidden",dropdownItemSelected:"tagify__dropdown__item--selected",dropdownInital:"tagify__dropdown--initial",tag:"tagify__tag",tagText:"tagify__tag-text",tagX:"tagify__tag__removeBtn",tagLoading:"tagify__tag--loading",tagEditing:"tagify__tag--editable",tagFlash:"tagify__tag--flash",tagHide:"tagify__tag--hide"},dropdown:{classname:"",enabled:2,maxItems:10,searchKeys:["value","searchBy"],fuzzySearch:!0,caseSensitive:!1,accentedSearch:!0,includeSelectedTags:!1,escapeHTML:!0,highlightFirst:!0,closeOnSelect:!0,clearOnSelect:!0,position:"all",appendTarget:null},hooks:{beforeRemoveTag:function(){return Promise.resolve()},beforePaste:function(){return Promise.resolve()},suggestionClick:function(){return Promise.resolve()},beforeKeyDown:function(){return Promise.resolve()}}};function l5t(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function u5t(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){l5t(r,i,t[i])})}return r}function c5t(r,e){return e=e??{},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):function(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),i.push.apply(i,o)}return i}(Object(e)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}),r}function CG(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function f5t(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function h5t(r){return function(e){if(Array.isArray(e))return CG(e)}(r)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(r)||function(e,t){if(e){if(typeof e=="string")return CG(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return CG(e,t)}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d5t(){for(var r in this.dropdown={},this._dropdown)this.dropdown[r]=typeof this._dropdown[r]=="function"?this._dropdown[r].bind(this):this._dropdown[r];this.dropdown.refs(),this.DOM.dropdown.__tagify=this}var Aq,Ck,p5t=(Aq=function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){f5t(r,i,t[i])})}return r}({},{events:{binding:function(){var r=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],e=this.dropdown.events.callbacks,t=this.listeners.dropdown=this.listeners.dropdown||{position:this.dropdown.position.bind(this,null),onKeyDown:e.onKeyDown.bind(this),onMouseOver:e.onMouseOver.bind(this),onMouseLeave:e.onMouseLeave.bind(this),onClick:e.onClick.bind(this),onScroll:e.onScroll.bind(this)},n=r?"addEventListener":"removeEventListener";this.settings.dropdown.position!="manual"&&(document[n]("scroll",t.position,!0),window[n]("resize",t.position),window[n]("keydown",t.onKeyDown)),this.DOM.dropdown[n]("mouseover",t.onMouseOver),this.DOM.dropdown[n]("mouseleave",t.onMouseLeave),this.DOM.dropdown[n]("mousedown",t.onClick),this.DOM.dropdown.content[n]("scroll",t.onScroll)},callbacks:{onKeyDown:function(r){var e=this;if(this.state.hasFocus&&!this.state.composing){var t=this.settings,n=t.dropdown.includeSelectedTags,i=this.DOM.dropdown.querySelector(t.classNames.dropdownItemActiveSelector),o=this.dropdown.getSuggestionDataByNode(i),a=t.mode=="mix",s=t.mode=="select";t.hooks.beforeKeyDown(r,{tagify:this}).then(function(c){switch(r.key){case"ArrowDown":case"ArrowUp":case"Down":case"Up":r.preventDefault();var p=e.dropdown.getAllSuggestionsRefs(),g=r.key=="ArrowUp"||r.key=="Up";i&&(i=e.dropdown.getNextOrPrevOption(i,!g)),i&&i.matches(t.classNames.dropdownItemSelector)||(i=p[g?p.length-1:0]),e.dropdown.highlightOption(i,!0);break;case"PageUp":case"PageDown":var w;r.preventDefault();var D=e.dropdown.getAllSuggestionsRefs(),M=Math.floor(e.DOM.dropdown.content.clientHeight/((w=D[0])===null||w===void 0?void 0:w.offsetHeight))||1,F=r.key==="PageUp";if(i){var q=D.indexOf(i),H=F?Math.max(0,q-M):Math.min(D.length-1,q+M);i=D[H]}else i=D[0];e.dropdown.highlightOption(i,!0);break;case"Home":case"End":r.preventDefault();var Y=e.dropdown.getAllSuggestionsRefs();i=Y[r.key==="Home"?0:Y.length-1],e.dropdown.highlightOption(i,!0);break;case"Escape":case"Esc":e.dropdown.hide();break;case"ArrowRight":if(e.state.actions.ArrowLeft||t.autoComplete.rightKey)return;case"Tab":var X=!t.autoComplete.rightKey||!t.autoComplete.tabKey;if(!a&&!s&&i&&X&&!e.state.editing&&o){r.preventDefault();var ce=e.dropdown.getMappedValue(o);return e.state.autoCompleteData=o,e.input.autocomplete.set.call(e,ce),!1}return!0;case"Enter":r.preventDefault(),e.state.actions.selectOption=!0,setTimeout(function(){return e.state.actions.selectOption=!1},100),t.hooks.suggestionClick(r,{tagify:e,tagData:o,suggestionElm:i}).then(function(){if(i){var he=n?i:e.dropdown.getNextOrPrevOption(i,!g);e.dropdown.selectOption(i,r,function(){if(he){var le=he.getAttribute("value");he=e.dropdown.getSuggestionNodeByValue(le),e.dropdown.highlightOption(he)}})}else e.dropdown.hide(),a||e.addTags(e.state.inputText.trim(),!0)}).catch(function(he){return E0.warn(he)});break;case"Backspace":if(a||e.state.editing.scope)return;var k=e.input.raw.call(e);k!=""&&k.charCodeAt(0)!=8203||(t.backspace===!0?e.removeTags():t.backspace=="edit"&&setTimeout(e.editTag.bind(e),0))}})}},onMouseOver:function(r){var e=r.target.closest(this.settings.classNames.dropdownItemSelector);this.dropdown.highlightOption(e)},onMouseLeave:function(r){this.dropdown.highlightOption()},onClick:function(r){var e=this;if(r.button==0&&r.target!=this.DOM.dropdown&&r.target!=this.DOM.dropdown.content){var t=r.target.closest(this.settings.classNames.dropdownItemSelector),n=this.dropdown.getSuggestionDataByNode(t);this.state.actions.selectOption=!0,setTimeout(function(){return e.state.actions.selectOption=!1},100),this.settings.hooks.suggestionClick(r,{tagify:this,tagData:n,suggestionElm:t}).then(function(){t?e.dropdown.selectOption(t,r):e.dropdown.hide()}).catch(function(i){return E0.warn(i)})}},onScroll:function(r){var e=r.target,t=e.scrollTop/(e.scrollHeight-e.parentNode.clientHeight)*100;this.trigger("dropdown:scroll",{percentage:Math.round(t)})}}},refilter:function(r){r=r||this.state.dropdown.query||"",this.suggestedListItems=this.dropdown.filterListItems(r),this.dropdown.fill(),this.suggestedListItems.length||this.dropdown.hide(),this.trigger("dropdown:updated",this.DOM.dropdown)},getSuggestionDataByNode:function(r){for(var e,t=r&&r.getAttribute("value"),n=this.suggestedListItems.length;n--;){if(Ig(e=this.suggestedListItems[n])&&e.value==t)return e;if(e==t)return{value:e}}},getSuggestionNodeByValue:function(r){return this.dropdown.getAllSuggestionsRefs().find(function(e){return e.getAttribute("value")===r})},getNextOrPrevOption:function(r){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],t=this.dropdown.getAllSuggestionsRefs(),n=t.findIndex(function(i){return i===r});return e?t[n+1]:t[n-1]},highlightOption:function(r,e){var t,n=this.settings.classNames.dropdownItemActive;if(this.state.ddItemElm&&(this.state.ddItemElm.classList.remove(n),this.state.ddItemElm.removeAttribute("aria-selected")),!r)return this.state.ddItemData=null,this.state.ddItemElm=null,void this.input.autocomplete.suggest.call(this);t=this.dropdown.getSuggestionDataByNode(r),this.state.ddItemData=t,this.state.ddItemElm=r,r.classList.add(n),r.setAttribute("aria-selected",!0),e&&(r.parentNode.scrollTop=r.clientHeight+r.offsetTop-r.parentNode.clientHeight),this.settings.autoComplete&&(this.input.autocomplete.suggest.call(this,t),this.dropdown.position())},selectOption:function(r,e,t){var n=this,i=this.settings,o=i.dropdown.includeSelectedTags,a=i.dropdown,s=a.clearOnSelect,c=a.closeOnSelect;if(!r)return this.addTags(this.state.inputText,!0),void(c&&this.dropdown.hide());e=e||{};var p=r.getAttribute("value"),g=p=="noMatch",w=i.mode=="mix",D=this.suggestedListItems.find(function(F){var q;return((q=F.value)!==null&&q!==void 0?q:F)==p});if(this.trigger("dropdown:select",{data:D,elm:r,event:e}),D||g){if(this.state.editing){var M=this.normalizeTags([D])[0];D=i.transformTag.call(this,M)||M,this.onEditTagDone(null,Tc({__isValid:!0},D))}else this[w?"addMixTags":"addTags"]([D||this.input.raw.call(this)],s);(w||this.DOM.input.parentNode)&&(setTimeout(function(){n.DOM.input.focus(),n.toggleFocusClass(!0)}),c&&setTimeout(this.dropdown.hide.bind(this)),o?t&&t():(r.addEventListener("transitionend",function(){n.dropdown.fillHeaderFooter(),setTimeout(function(){r.remove(),n.dropdown.refilter(),t&&t()},100)},{once:!0}),r.classList.add(this.settings.classNames.dropdownItemHidden)))}else c&&setTimeout(this.dropdown.hide.bind(this))},selectAll:function(r){this.suggestedListItems.length=0,this.dropdown.hide(),this.dropdown.filterListItems("");var e=this.dropdown.filterListItems("");return r||(e=this.state.dropdown.suggestions),this.addTags(e,!0),this},filterListItems:function(r,e){var t,n,i,o,a,s,c=function(){var he,le,be=void 0,_e=void 0;he=F[ce],n=((le=Object)!=null&&typeof Symbol<"u"&&le[Symbol.hasInstance]?le[Symbol.hasInstance](he):he instanceof le)?F[ce]:{value:F[ce]};var ge,ve=Object.keys(n).some(function(Ne){return X.includes(Ne)})?X:["value"];w.fuzzySearch&&!e.exact?(o=ve.reduce(function(Ne,U){return Ne+" "+(n[U]||"")},"").toLowerCase().trim(),w.accentedSearch&&(o=Cq(o),s=Cq(s)),be=o.indexOf(s)==0,_e=o===s,ge=o,i=s.toLowerCase().split(" ").every(function(Ne){return ge.includes(Ne.toLowerCase())})):(be=!0,i=ve.some(function(Ne){var U=""+(n[Ne]||"");return w.accentedSearch&&(U=Cq(U),s=Cq(s)),w.caseSensitive||(U=U.toLowerCase()),_e=U===s,e.exact?U===s:U.indexOf(s)==0})),a=!w.includeSelectedTags&&t.isTagDuplicate(Ig(n)?n.value:n),i&&!a&&(_e&&be?M.push(n):w.sortby=="startsWith"&&be?D.unshift(n):D.push(n))},p=this,g=this.settings,w=g.dropdown,D=(e=e||{},[]),M=[],F=g.whitelist,q=w.maxItems>=0?w.maxItems:1/0,H=w.includeSelectedTags,Y=typeof w.sortby=="function",X=w.searchKeys,ce=0;if(!(r=g.mode=="select"&&this.value.length&&this.value[0][g.tagTextProp]==r?"":r)||!X.length){D=H?F:F.filter(function(he){return!p.isTagDuplicate(Ig(he)?he.value:he)});var k=Y?w.sortby(D,s):D.slice(0,q);return this.state.dropdown.suggestions=k,k}for(s=w.caseSensitive?""+r:(""+r).toLowerCase();ce<F.length;ce++)t=this,c();return this.state.dropdown.suggestions=M.concat(D),k=Y?w.sortby(M.concat(D),s):M.concat(D).slice(0,q),this.state.dropdown.suggestions=k,k},getMappedValue:function(r){var e=this.settings.dropdown.mapValueTo;return e?typeof e=="function"?e(r):r[e]||r.value:r.value},createListHTML:function(r){var e=this;return Tc([],r).map(function(t,n){typeof t!="string"&&typeof t!="number"||(t={value:t});var i=e.dropdown.getMappedValue(t);return i=typeof i=="string"&&e.settings.dropdown.escapeHTML?I_(i):i,e.settings.templates.dropdownItem.apply(e,[c5t(u5t({},t),{mappedValue:i}),e])}).join("")}}),Ck=(Ck={refs:function(){this.DOM.dropdown=this.parseTemplate("dropdown",[this.settings]),this.DOM.dropdown.content=this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-wrapper']")},getHeaderRef:function(){return this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-header']")},getFooterRef:function(){return this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-footer']")},getAllSuggestionsRefs:function(){return h5t(this.DOM.dropdown.content.querySelectorAll(this.settings.classNames.dropdownItemSelector))},show:function(r){var e,t,n,i=this,o=this.settings,a=o.mode=="mix"&&!o.enforceWhitelist,s=!o.whitelist||!o.whitelist.length,c=o.dropdown.position=="manual";if(r=r===void 0?this.state.inputText:r,!(s&&!a&&!o.templates.dropdownItemNoMatch||o.dropdown.enabled===!1||this.state.isLoading||this.settings.readonly)){if(clearTimeout(this.dropdownHide__bindEventsTimeout),this.suggestedListItems=this.dropdown.filterListItems(r),r&&!this.suggestedListItems.length&&(this.trigger("dropdown:noMatch",r),o.templates.dropdownItemNoMatch&&(n=o.templates.dropdownItemNoMatch.call(this,{value:r}))),!n){if(this.suggestedListItems.length)r&&a&&!this.state.editing.scope&&!GD(this.suggestedListItems[0].value,r)&&this.suggestedListItems.unshift({value:r});else{if(!r||!a||this.state.editing.scope)return this.input.autocomplete.suggest.call(this),void this.dropdown.hide();this.suggestedListItems=[{value:r}]}t=""+(Ig(e=this.suggestedListItems[0])?e.value:e),o.autoComplete&&t&&t.indexOf(r)==0&&this.input.autocomplete.suggest.call(this,e)}this.dropdown.fill(n),o.dropdown.highlightFirst&&this.dropdown.highlightOption(this.DOM.dropdown.content.querySelector(o.classNames.dropdownItemSelector)),this.state.dropdown.visible||setTimeout(this.dropdown.events.binding.bind(this)),this.state.dropdown.visible=r||!0,this.state.dropdown.query=r,this.setStateSelection(),c||setTimeout(function(){i.dropdown.position(),i.dropdown.render()}),setTimeout(function(){i.trigger("dropdown:show",i.DOM.dropdown)})}},hide:function(r){var e=this,t=this.DOM,n=t.scope,i=t.dropdown,o=this.settings.dropdown.position=="manual"&&!r;if(i&&document.body.contains(i)&&!o)return window.removeEventListener("resize",this.dropdown.position),this.dropdown.events.binding.call(this,!1),n.setAttribute("aria-expanded",!1),i.parentNode.removeChild(i),setTimeout(function(){e.state.dropdown.visible=!1},100),this.state.dropdown.query=this.state.ddItemData=this.state.ddItemElm=this.state.selection=null,this.state.tag&&this.state.tag.value.length&&(this.state.flaggedTags[this.state.tag.baseOffset]=this.state.tag),this.trigger("dropdown:hide",i),this},toggle:function(r){this.dropdown[this.state.dropdown.visible&&!r?"hide":"show"]()},getAppendTarget:function(){var r=this.settings.dropdown;return typeof r.appendTarget=="function"?r.appendTarget():r.appendTarget},render:function(){var r,e,t,n=this,i=(r=this.DOM.dropdown,(t=r.cloneNode(!0)).style.cssText="position:fixed; top:-9999px; opacity:0",document.body.appendChild(t),e=t.clientHeight,t.parentNode.removeChild(t),e),o=this.settings,a=this.dropdown.getAppendTarget();return o.dropdown.enabled===!1||(this.DOM.scope.setAttribute("aria-expanded",!0),document.body.contains(this.DOM.dropdown)||(this.DOM.dropdown.classList.add(o.classNames.dropdownInital),this.dropdown.position(i),a.appendChild(this.DOM.dropdown),setTimeout(function(){return n.DOM.dropdown.classList.remove(o.classNames.dropdownInital)}))),this},fill:function(r){r=typeof r=="string"?r:this.dropdown.createListHTML(r||this.suggestedListItems);var e,t=this.settings.templates.dropdownContent.call(this,r);this.DOM.dropdown.content.innerHTML=(e=t)?e.replace(/\>[\r\n ]+\</g,"><").split(/>\s+</).join("><").trim():""},fillHeaderFooter:function(){var r=this.dropdown.filterListItems(this.state.dropdown.query),e=this.parseTemplate("dropdownHeader",[r]),t=this.parseTemplate("dropdownFooter",[r]),n=this.dropdown.getHeaderRef(),i=this.dropdown.getFooterRef();e&&n?.parentNode.replaceChild(e,n),t&&i?.parentNode.replaceChild(t,i)},position:function(r){var e=this.settings.dropdown,t=this.dropdown.getAppendTarget();if(e.position!="manual"&&t){var n,i,o,a,s,c,p,g,w,D,M=this.DOM.dropdown,F=e.RTL,q=t===document.body,H=t===this.DOM.scope,Y=q?window.pageYOffset:t.scrollTop,X=document.fullscreenElement||document.webkitFullscreenElement||document.documentElement,ce=X.clientHeight,k=Math.max(X.clientWidth||0,window.innerWidth||0),he=k>480?e.position:"all",le=this.DOM[he=="input"?"input":"scope"];if(r=r||M.clientHeight,this.state.dropdown.visible){if(he=="text"?(o=(n=function(){var ge=document.getSelection();if(ge.rangeCount){var ve,Ne,U=ge.getRangeAt(0),Q=U.startContainer,de=U.startOffset;if(de>0)return(Ne=document.createRange()).setStart(Q,de-1),Ne.setEnd(Q,de),{left:(ve=Ne.getBoundingClientRect()).right,top:ve.top,bottom:ve.bottom};if(Q.getBoundingClientRect)return Q.getBoundingClientRect()}return{left:-9999,top:-9999}}()).bottom,i=n.top,a=n.left,s="auto"):(c=function(ge){var ve=0,Ne=0;for(ge=ge.parentNode;ge&&ge!=X;)ve+=ge.offsetTop||0,Ne+=ge.offsetLeft||0,ge=ge.parentNode;return{top:ve,left:Ne}}(t),n=le.getBoundingClientRect(),i=H?-1:n.top-c.top,o=(H?n.height:n.bottom-c.top)-1,a=H?-1:n.left-c.left,s=n.width+"px"),!q){var be=function(){for(var ge=0,ve=e.appendTarget.parentNode;ve;)ge+=ve.scrollTop||0,ve=ve.parentNode;return ge}();i+=be,o+=be}var _e;i=Math.floor(i),o=Math.ceil(o),g=k-a<120,w=((p=(_e=e.placeAbove)!==null&&_e!==void 0?_e:ce-n.bottom<r)?i:o)+Y,D=a+(F&&n.width||0)+window.pageXOffset,D=he=="text"&&g?"right: 0;":"left: ".concat(D,"px;"),M.style.cssText="".concat(D," top: ").concat(w,"px; min-width: ").concat(s,"; max-width: ").concat(s),M.setAttribute("placement",p?"top":"bottom"),M.setAttribute("position",he)}}}})!=null?Ck:{},Object.getOwnPropertyDescriptors?Object.defineProperties(Aq,Object.getOwnPropertyDescriptors(Ck)):function(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}(Object(Ck)).forEach(function(r){Object.defineProperty(Aq,r,Object.getOwnPropertyDescriptor(Ck,r))}),Aq),$D="@yaireo/tagify/",m5t={empty:"empty",exceed:"number of tags exceeded",pattern:"pattern mismatch",duplicate:"already exists",notAllowed:"not allowed"},g5t={wrapper:function(r,e){return'<tags class="'.concat(e.classNames.namespace," ").concat(e.mode?"".concat(e.classNames[e.mode+"Mode"]):""," ").concat(r.className,`"
752
752
  `).concat(e.readonly?"readonly":"",`
753
753
  `).concat(e.disabled?"disabled":"",`
754
754
  `).concat(e.required?"required":"",`
@@ -806,7 +806,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
806
806
  tabindex="0"
807
807
  role="option">
808
808
  ${r.avatar?`
809
- <div class='rounded-sm w-8 h-8 block mr-2'>
809
+ <div class='rounded w-8 h-8 block mr-2'>
810
810
  <img onerror="this.style.visibility='hidden'" class="w-full" src="${r.avatar}">
811
811
  </div>`:""}
812
812
  <span>${r.label}</span>