avo 2.14.3.pre.7.polytranslations1 → 2.15.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of avo might be problematic. Click here for more details.

Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -3
  3. data/app/assets/stylesheets/avo.base.css +1 -34
  4. data/app/assets/stylesheets/css/fields/progress.css +3 -3
  5. data/app/assets/stylesheets/css/fields/trix.css +10 -0
  6. data/app/assets/stylesheets/css/pagination.css +0 -4
  7. data/app/assets/stylesheets/css/search.css +1 -1
  8. data/app/assets/stylesheets/css/sidebar.css +1 -1
  9. data/app/assets/stylesheets/css/tags.css +7 -0
  10. data/app/assets/svgs/failed_to_load.svg +4 -5
  11. data/app/assets/svgs/grid-empty-state.svg +10 -11
  12. data/app/assets/svgs/table-empty-state.svg +11 -12
  13. data/app/components/avo/actions_component.html.erb +2 -2
  14. data/app/components/avo/actions_component.rb +1 -1
  15. data/app/components/avo/button_component.rb +2 -2
  16. data/app/components/avo/fields/boolean_field/edit_component.html.erb +1 -1
  17. data/app/components/avo/fields/common/progress_bar_component.html.erb +1 -1
  18. data/app/components/avo/fields/common/progress_bar_component.rb +11 -1
  19. data/app/components/avo/fields/progress_bar_field/index_component.html.erb +1 -1
  20. data/app/components/avo/fields/progress_bar_field/show_component.html.erb +1 -1
  21. data/app/components/avo/fields/tags_field/edit_component.html.erb +1 -1
  22. data/app/components/avo/index/resource_grid_component.html.erb +2 -1
  23. data/app/components/avo/index/resource_table_component.html.erb +2 -1
  24. data/app/components/avo/profile_item_component.html.erb +1 -1
  25. data/app/components/avo/sidebar_component.html.erb +1 -1
  26. data/app/components/avo/sidebar_profile_component.html.erb +1 -1
  27. data/app/controllers/avo/base_controller.rb +2 -2
  28. data/app/helpers/avo/resources_helper.rb +20 -16
  29. data/app/javascript/avo.base.js +0 -1
  30. data/app/javascript/js/controllers/action_controller.js +6 -1
  31. data/app/javascript/js/controllers/fields/trix_field_controller.js +4 -3
  32. data/app/javascript/js/controllers/item_select_all_controller.js +16 -9
  33. data/app/javascript/js/controllers/item_selector_controller.js +1 -1
  34. data/app/views/avo/actions/show.html.erb +2 -2
  35. data/app/views/avo/associations/new.html.erb +2 -2
  36. data/app/views/avo/base/_multiple_select_filter.html.erb +1 -1
  37. data/app/views/avo/base/_text_filter.html.erb +1 -1
  38. data/app/views/avo/partials/_branding.html.erb +5 -0
  39. data/app/views/avo/partials/_header.html.erb +1 -1
  40. data/app/views/avo/partials/_logo.html.erb +2 -2
  41. data/app/views/avo/private/_links_and_buttons.html.erb +1 -1
  42. data/app/views/avo/private/design.html.erb +3 -3
  43. data/app/views/layouts/avo/application.html.erb +2 -0
  44. data/lib/avo/configuration/branding.rb +70 -0
  45. data/lib/avo/configuration.rb +5 -0
  46. data/lib/avo/dashboards/chartkick_card.rb +1 -1
  47. data/lib/avo/licensing/pro_license.rb +1 -0
  48. data/lib/avo/services/encryption_service.rb +1 -1
  49. data/lib/avo/version.rb +1 -1
  50. data/lib/generators/avo/templates/initializer/avo.tt +15 -0
  51. data/public/avo-assets/avo.base.css +310 -284
  52. data/public/avo-assets/avo.base.js +3 -3
  53. data/public/avo-assets/avo.base.js.map +2 -2
  54. metadata +6 -13
  55. data/app/components/avo/button_component.html.erb +0 -1
  56. data/app/helpers/avo/actions_helper.rb +0 -4
  57. data/app/helpers/avo/attachments_helper.rb +0 -4
  58. data/app/views/kaminari/_first_page.html.erb +0 -3
  59. data/app/views/kaminari/_last_page.html.erb +0 -3
  60. data/app/views/kaminari/_next_page.html.erb +0 -9
  61. data/app/views/kaminari/_page.html.erb +0 -12
  62. data/app/views/kaminari/_prev_page.html.erb +0 -9
  63. data/config/master.key +0 -1
@@ -39,7 +39,7 @@ chart.draw(data, `+JSON.stringify(Re)+");"),H.chart=new this.library.visualizati
39
39
 
40
40
  %o
41
41
 
42
- %o`,r,e,n),(i=window.onerror)===null||i===void 0||i.call(window,r,"",0,0,e)}logFormattedMessage(e,r,n={}){n=Object.assign({application:this},n),this.logger.groupCollapsed(`${e} #${r}`),this.logger.log("details:",Object.assign({},n)),this.logger.groupEnd()}};hGe={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},pGe={array(t){let e=JSON.parse(t);if(!Array.isArray(e))throw new TypeError("Expected array");return e},boolean(t){return!(t=="0"||t=="false")},number(t){return Number(t)},object(t){let e=JSON.parse(t);if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError("Expected object");return e},string(t){return t}},ere={default:gGe,array:tre,object:tre};Ct=class{constructor(e){this.context=e}static get shouldLoad(){return!0}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:r=this.element,detail:n={},prefix:i=this.identifier,bubbles:o=!0,cancelable:a=!0}={}){let s=i?`${i}:${e}`:e,u=new CustomEvent(s,{detail:n,bubbles:o,cancelable:a});return r.dispatchEvent(u),u}};Ct.blessings=[nGe,oGe,sGe];Ct.targets=[];Ct.values={}});var n0,Cre,w1,XR,Are,QR,_1,Tre,Dre,Ore=se(()=>{Pr();n0=class extends Ct{initialize(){this.hide()}connect(){setTimeout(()=>{this.show()},this.showAfter),this.hasDismissAfterValue&&setTimeout(()=>{this.close()},this.dismissAfterValue)}close(){this.hide(),setTimeout(()=>{this.element.remove()},this.removeAfter)}show(){this.element.classList.add(...this.showClasses),this.element.classList.remove(...this.hideClasses)}hide(){this.element.classList.add(...this.hideClasses),this.element.classList.remove(...this.showClasses)}get removeAfter(){return this.hasRemoveDelayValue?this.removeDelayValue:1100}get showAfter(){return this.hasShowDelayValue?this.showDelayValue:200}};n0.values={dismissAfter:Number,showDelay:Number,removeDelay:Number},n0.classes=["show","hide"];Cre=class extends Ct{connect(){this.timeout=null,this.duration=this.data.get("duration")||1e3}save(){clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.statusTarget.textContent="Saving...",Rails.fire(this.formTarget,"submit")},this.duration)}success(){this.setStatus("Saved!")}error(){this.setStatus("Unable to save!")}setStatus(e){this.statusTarget.textContent=e,this.timeout=setTimeout(()=>{this.statusTarget.textContent=""},2e3)}};Cre.targets=["form","status"];w1=class extends Ct{constructor(...e){super(...e),this._onMenuButtonKeydown=r=>{switch(r.keyCode){case 13:case 32:r.preventDefault(),this.toggle()}}}connect(){this.toggleClass=this.data.get("class")||"hidden",this.visibleClass=this.data.get("visibleClass")||null,this.invisibleClass=this.data.get("invisibleClass")||null,this.activeClass=this.data.get("activeClass")||null,this.enteringClass=this.data.get("enteringClass")||null,this.leavingClass=this.data.get("leavingClass")||null,this.hasButtonTarget&&this.buttonTarget.addEventListener("keydown",this._onMenuButtonKeydown),this.element.setAttribute("aria-haspopup","true")}disconnect(){this.hasButtonTarget&&this.buttonTarget.removeEventListener("keydown",this._onMenuButtonKeydown)}toggle(){this.openValue=!this.openValue}openValueChanged(){this.openValue?this._show():this._hide()}_show(e){setTimeout((()=>{this.menuTarget.classList.remove(this.toggleClass),this.element.setAttribute("aria-expanded","true"),this._enteringClassList[0].forEach((r=>{this.menuTarget.classList.add(r)}).bind(this)),this._activeClassList[0].forEach(r=>{this.activeTarget.classList.add(r)}),this._invisibleClassList[0].forEach(r=>this.menuTarget.classList.remove(r)),this._visibleClassList[0].forEach(r=>{this.menuTarget.classList.add(r)}),setTimeout((()=>{this._enteringClassList[0].forEach(r=>this.menuTarget.classList.remove(r))}).bind(this),this.enterTimeout[0]),typeof e=="function"&&e()}).bind(this))}_hide(e){setTimeout((()=>{this.element.setAttribute("aria-expanded","false"),this._invisibleClassList[0].forEach(r=>this.menuTarget.classList.add(r)),this._visibleClassList[0].forEach(r=>this.menuTarget.classList.remove(r)),this._activeClassList[0].forEach(r=>this.activeTarget.classList.remove(r)),this._leavingClassList[0].forEach(r=>this.menuTarget.classList.add(r)),setTimeout((()=>{this._leavingClassList[0].forEach(r=>this.menuTarget.classList.remove(r)),typeof e=="function"&&e(),this.menuTarget.classList.add(this.toggleClass)}).bind(this),this.leaveTimeout[0])}).bind(this))}show(){this.openValue=!0}hide(e){this.element.contains(e.target)===!1&&this.openValue&&(this.openValue=!1)}get activeTarget(){return this.data.has("activeTarget")?document.querySelector(this.data.get("activeTarget")):this.element}get _activeClassList(){return this.activeClass?this.activeClass.split(",").map(e=>e.split(" ")):[[],[]]}get _visibleClassList(){return this.visibleClass?this.visibleClass.split(",").map(e=>e.split(" ")):[[],[]]}get _invisibleClassList(){return this.invisibleClass?this.invisibleClass.split(",").map(e=>e.split(" ")):[[],[]]}get _enteringClassList(){return this.enteringClass?this.enteringClass.split(",").map(e=>e.split(" ")):[[],[]]}get _leavingClassList(){return this.leavingClass?this.leavingClass.split(",").map(e=>e.split(" ")):[[],[]]}get enterTimeout(){return(this.data.get("enterTimeout")||"0,0").split(",").map(e=>parseInt(e))}get leaveTimeout(){return(this.data.get("leaveTimeout")||"0,0").split(",").map(e=>parseInt(e))}};w1.targets=["menu","button"],w1.values={open:Boolean};XR=class extends Ct{connect(){this.toggleClass=this.data.get("class")||"hidden",this.backgroundId=this.data.get("backgroundId")||"modal-background",this.backgroundHtml=this.data.get("backgroundHtml")||this._backgroundHTML(),this.allowBackgroundClose=(this.data.get("allowBackgroundClose")||"true")==="true",this.preventDefaultActionOpening=(this.data.get("preventDefaultActionOpening")||"true")==="true",this.preventDefaultActionClosing=(this.data.get("preventDefaultActionClosing")||"true")==="true"}disconnect(){this.close()}open(e){this.preventDefaultActionOpening&&e.preventDefault(),e.target.blur&&e.target.blur(),this.lockScroll(),this.containerTarget.classList.remove(this.toggleClass),this.data.get("disable-backdrop")||(document.body.insertAdjacentHTML("beforeend",this.backgroundHtml),this.background=document.querySelector(`#${this.backgroundId}`))}close(e){e&&this.preventDefaultActionClosing&&e.preventDefault(),this.unlockScroll(),this.containerTarget.classList.add(this.toggleClass),this.background&&this.background.remove()}closeBackground(e){this.allowBackgroundClose&&e.target===this.containerTarget&&this.close(e)}closeWithKeyboard(e){e.keyCode!==27||this.containerTarget.classList.contains(this.toggleClass)||this.close(e)}_backgroundHTML(){return`<div id="${this.backgroundId}" class="fixed top-0 left-0 w-full h-full" style="background-color: ${this.backdropColorValue}; z-index: 9998;"></div>`}lockScroll(){let e=window.innerWidth-document.documentElement.clientWidth;document.body.style.paddingRight=`${e}px`,this.saveScrollPosition(),document.body.classList.add("fixed","inset-x-0","overflow-hidden"),document.body.style.top=`-${this.scrollPosition}px`}unlockScroll(){document.body.style.paddingRight=null,document.body.classList.remove("fixed","inset-x-0","overflow-hidden"),this.restoreScrollValue&&this.restoreScrollPosition(),document.body.style.top=null}saveScrollPosition(){this.scrollPosition=window.pageYOffset||document.body.scrollTop}restoreScrollPosition(){this.scrollPosition!==void 0&&(document.documentElement.scrollTop=this.scrollPosition)}};XR.targets=["container"],XR.values={backdropColor:{type:String,default:"rgba(0, 0, 0, 0.8)"},restoreScroll:{type:Boolean,default:!0}};Are=class extends Ct{connect(){this.activeTabClasses=(this.data.get("activeTab")||"active").split(" "),this.inactiveTabClasses=(this.data.get("inactiveTab")||"inactive").split(" "),this.anchor&&(this.index=this.tabTargets.findIndex(e=>e.id===this.anchor)),this.showTab()}change(e){e.preventDefault(),this.index=e.currentTarget.dataset.index?e.currentTarget.dataset.index:e.currentTarget.dataset.id?this.tabTargets.findIndex(r=>r.id==e.currentTarget.dataset.id):this.tabTargets.indexOf(e.currentTarget),window.dispatchEvent(new CustomEvent("tsc:tab-change"))}showTab(){this.tabTargets.forEach((e,r)=>{let n=this.panelTargets[r];r===this.index?(n.classList.remove("hidden"),e.classList.remove(...this.inactiveTabClasses),e.classList.add(...this.activeTabClasses),e.id&&(location.hash=e.id)):(n.classList.add("hidden"),e.classList.remove(...this.activeTabClasses),e.classList.add(...this.inactiveTabClasses))})}get index(){return parseInt(this.data.get("index")||0)}set index(e){this.data.set("index",e>=0?e:0),this.showTab()}get anchor(){return document.URL.split("#").length>1?document.URL.split("#")[1]:null}};Are.targets=["tab","panel"];QR=class extends Ct{connect(){this.toggleClass=this.data.get("class")||"hidden"}toggle(e){e.preventDefault(),this.openValue=!this.openValue}hide(e){e.preventDefault(),this.openValue=!1}show(e){e.preventDefault(),this.openValue=!0}openValueChanged(){this.toggleClass&&this.toggleableTargets.forEach(e=>{e.classList.toggle(this.toggleClass)})}};QR.targets=["toggleable"],QR.values={open:Boolean};_1=class extends Ct{initialize(){this.contentTarget.setAttribute("style",`transform:translate(${this.data.get("translateX")}, ${this.data.get("translateY")});`)}mouseOver(){this.contentTarget.classList.remove("hidden")}mouseOut(){this.contentTarget.classList.add("hidden")}};_1.targets=["content"];Tre=class extends w1{_show(){this.overlayTarget.classList.remove(this.toggleClass),super._show((()=>{this._activeClassList[1].forEach(e=>this.overlayTarget.classList.add(e)),this._invisibleClassList[1].forEach(e=>this.overlayTarget.classList.remove(e)),this._visibleClassList[1].forEach(e=>this.overlayTarget.classList.add(e)),setTimeout((()=>{this._enteringClassList[1].forEach(e=>this.overlayTarget.classList.remove(e))}).bind(this),this.enterTimeout[1])}).bind(this))}_hide(){this._leavingClassList[1].forEach(e=>this.overlayTarget.classList.add(e)),super._hide((()=>{setTimeout((()=>{this._visibleClassList[1].forEach(e=>this.overlayTarget.classList.remove(e)),this._invisibleClassList[1].forEach(e=>this.overlayTarget.classList.add(e)),this._activeClassList[1].forEach(e=>this.overlayTarget.classList.remove(e)),this._leavingClassList[1].forEach(e=>this.overlayTarget.classList.remove(e)),this.overlayTarget.classList.add(this.toggleClass)}).bind(this),this.leaveTimeout[1])}).bind(this))}};Tre.targets=["menu","overlay"];Dre=class extends Ct{connect(){this.styleProperty=this.data.get("style")||"backgroundColor"}update(){this.preview=this.color}set preview(e){this.previewTarget.style[this.styleProperty]=e;let r=this._getContrastYIQ(e);this.styleProperty==="color"?this.previewTarget.style.backgroundColor=r:this.previewTarget.style.color=r}get color(){return this.colorTarget.value}_getContrastYIQ(e){return e=e.replace("#",""),(299*parseInt(e.substr(0,2),16)+587*parseInt(e.substr(2,2),16)+114*parseInt(e.substr(4,2),16))/1e3>=128?"#000":"#fff"}};Dre.targets=["preview","color"]});var mr,Mre=se(()=>{Ore();Pr();mr=r0.start();mr.debug=window==null?void 0:window.localStorage.getItem("avo.debug");window.Stimulus=mr;mr.register("alert",n0);mr.register("popover",_1)});var Mo,Qg=se(()=>{Mo=t=>t=="true"});var S1,Ire=se(()=>{Pr();Qg();S1=class extends Ct{connect(){this.resourceIdsTarget.value=this.resourceIds,this.selectionOptions.itemSelectAllSelectedAllValue==="true"&&(this.selectedAllQueryTarget.value=this.selectionOptions.itemSelectAllSelectedAllQueryValue),this.noConfirmation?this.formTarget.submit():this.controllerDivTarget.classList.remove("hidden")}get noConfirmation(){return Mo(this.controllerDivTarget.dataset.noConfirmation)}get resourceName(){return this.controllerDivTarget.dataset.resourceName}get resourceIds(){try{return JSON.parse(this.selectionOptions.selectedResources)}catch(t){return[]}}get selectionOptions(){return document.querySelector(`[data-selected-resources-name="${this.resourceName}"]`).dataset}};vt(S1,"targets",["controllerDiv","resourceIds","form","selectedAllQuery"])});var Lre,ZR=se(()=>{Lre=function(){function t(e,r){var n=this;this.element=e,this.started=!1,this.delegate=r,this.elements=new Set,this.mutationObserver=new MutationObserver(function(i){return n.processMutations(i)})}return t.prototype.start=function(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,childList:!0,subtree:!0}),this.refresh())},t.prototype.stop=function(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)},t.prototype.refresh=function(){if(this.started){for(var e=new Set(this.matchElementsInTree()),r=0,n=Array.from(this.elements);r<n.length;r++){var i=n[r];e.has(i)||this.removeElement(i)}for(var o=0,a=Array.from(e);o<a.length;o++){var i=a[o];this.addElement(i)}}},t.prototype.processMutations=function(e){if(this.started)for(var r=0,n=e;r<n.length;r++){var i=n[r];this.processMutation(i)}},t.prototype.processMutation=function(e){e.type=="attributes"?this.processAttributeChange(e.target,e.attributeName):e.type=="childList"&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))},t.prototype.processAttributeChange=function(e,r){var n=e;this.elements.has(n)?this.delegate.elementAttributeChanged&&this.matchElement(n)?this.delegate.elementAttributeChanged(n,r):this.removeElement(n):this.matchElement(n)&&this.addElement(n)},t.prototype.processRemovedNodes=function(e){for(var r=0,n=Array.from(e);r<n.length;r++){var i=n[r],o=this.elementFromNode(i);o&&this.processTree(o,this.removeElement)}},t.prototype.processAddedNodes=function(e){for(var r=0,n=Array.from(e);r<n.length;r++){var i=n[r],o=this.elementFromNode(i);o&&this.elementIsActive(o)&&this.processTree(o,this.addElement)}},t.prototype.matchElement=function(e){return this.delegate.matchElement(e)},t.prototype.matchElementsInTree=function(e){return e===void 0&&(e=this.element),this.delegate.matchElementsInTree(e)},t.prototype.processTree=function(e,r){for(var n=0,i=this.matchElementsInTree(e);n<i.length;n++){var o=i[n];r.call(this,o)}},t.prototype.elementFromNode=function(e){if(e.nodeType==Node.ELEMENT_NODE)return e},t.prototype.elementIsActive=function(e){return e.isConnected!=this.element.isConnected?!1:this.element.contains(e)},t.prototype.addElement=function(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))},t.prototype.removeElement=function(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))},t}()});var Zg,JR=se(()=>{ZR();Zg=function(){function t(e,r,n){this.attributeName=r,this.delegate=n,this.elementObserver=new Lre(e,this)}return Object.defineProperty(t.prototype,"element",{get:function(){return this.elementObserver.element},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selector",{get:function(){return"["+this.attributeName+"]"},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.elementObserver.start()},t.prototype.stop=function(){this.elementObserver.stop()},t.prototype.refresh=function(){this.elementObserver.refresh()},Object.defineProperty(t.prototype,"started",{get:function(){return this.elementObserver.started},enumerable:!1,configurable:!0}),t.prototype.matchElement=function(e){return e.hasAttribute(this.attributeName)},t.prototype.matchElementsInTree=function(e){var r=this.matchElement(e)?[e]:[],n=Array.from(e.querySelectorAll(this.selector));return r.concat(n)},t.prototype.elementMatched=function(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)},t.prototype.elementUnmatched=function(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)},t.prototype.elementAttributeChanged=function(e,r){this.delegate.elementAttributeValueChanged&&this.attributeName==r&&this.delegate.elementAttributeValueChanged(e,r)},t}()});var S1t,Pre=se(()=>{S1t=function(){function t(e,r){var n=this;this.element=e,this.delegate=r,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(function(i){return n.processMutations(i)})}return t.prototype.start=function(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0}),this.refresh())},t.prototype.stop=function(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)},t.prototype.refresh=function(){if(this.started)for(var e=0,r=this.knownAttributeNames;e<r.length;e++){var n=r[e];this.refreshAttribute(n)}},t.prototype.processMutations=function(e){if(this.started)for(var r=0,n=e;r<n.length;r++){var i=n[r];this.processMutation(i)}},t.prototype.processMutation=function(e){var r=e.attributeName;r&&this.refreshAttribute(r)},t.prototype.refreshAttribute=function(e){var r=this.delegate.getStringMapKeyForAttribute(e);if(r!=null){this.stringMap.has(e)||this.stringMapKeyAdded(r,e);var n=this.element.getAttribute(e);this.stringMap.get(e)!=n&&this.stringMapValueChanged(n,r),n==null?(this.stringMap.delete(e),this.stringMapKeyRemoved(r,e)):this.stringMap.set(e,n)}},t.prototype.stringMapKeyAdded=function(e,r){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,r)},t.prototype.stringMapValueChanged=function(e,r){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,r)},t.prototype.stringMapKeyRemoved=function(e,r){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,r)},Object.defineProperty(t.prototype,"knownAttributeNames",{get:function(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentAttributeNames",{get:function(){return Array.from(this.element.attributes).map(function(e){return e.name})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"recordedAttributeNames",{get:function(){return Array.from(this.stringMap.keys())},enumerable:!1,configurable:!0}),t}()});function k1(t,e,r){Rre(t,e).add(r)}function E1(t,e,r){Rre(t,e).delete(r),mGe(t,e)}function Rre(t,e){var r=t.get(e);return r||(r=new Set,t.set(e,r)),r}function mGe(t,e){var r=t.get(e);r!=null&&r.size==0&&t.delete(e)}var C1=se(()=>{});var A1,eq=se(()=>{C1();A1=function(){function t(){this.valuesByKey=new Map}return Object.defineProperty(t.prototype,"values",{get:function(){var e=Array.from(this.valuesByKey.values());return e.reduce(function(r,n){return r.concat(Array.from(n))},[])},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var e=Array.from(this.valuesByKey.values());return e.reduce(function(r,n){return r+n.size},0)},enumerable:!1,configurable:!0}),t.prototype.add=function(e,r){k1(this.valuesByKey,e,r)},t.prototype.delete=function(e,r){E1(this.valuesByKey,e,r)},t.prototype.has=function(e,r){var n=this.valuesByKey.get(e);return n!=null&&n.has(r)},t.prototype.hasKey=function(e){return this.valuesByKey.has(e)},t.prototype.hasValue=function(e){var r=Array.from(this.valuesByKey.values());return r.some(function(n){return n.has(e)})},t.prototype.getValuesForKey=function(e){var r=this.valuesByKey.get(e);return r?Array.from(r):[]},t.prototype.getKeysForValue=function(e){return Array.from(this.valuesByKey).filter(function(r){var n=r[0],i=r[1];return i.has(e)}).map(function(r){var n=r[0],i=r[1];return n})},t}()});var vGe,O1t,qre=se(()=>{eq();C1();vGe=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),O1t=function(t){vGe(e,t);function e(){var r=t.call(this)||this;return r.keysByValue=new Map,r}return Object.defineProperty(e.prototype,"values",{get:function(){return Array.from(this.keysByValue.keys())},enumerable:!1,configurable:!0}),e.prototype.add=function(r,n){t.prototype.add.call(this,r,n),k1(this.keysByValue,n,r)},e.prototype.delete=function(r,n){t.prototype.delete.call(this,r,n),E1(this.keysByValue,n,r)},e.prototype.hasValue=function(r){return this.keysByValue.has(r)},e.prototype.getKeysForValue=function(r){var n=this.keysByValue.get(r);return n?Array.from(n):[]},e}(A1)});var Fre=se(()=>{qre();eq();C1()});function yGe(t,e,r){return t.trim().split(/\s+/).filter(function(n){return n.length}).map(function(n,i){return{element:e,attributeName:r,content:n,index:i}})}function bGe(t,e){var r=Math.max(t.length,e.length);return Array.from({length:r},function(n,i){return[t[i],e[i]]})}function xGe(t,e){return t&&e&&t.index==e.index&&t.content==e.content}var Nre,tq=se(()=>{JR();Fre();Nre=function(){function t(e,r,n){this.attributeObserver=new Zg(e,r,this),this.delegate=n,this.tokensByElement=new A1}return Object.defineProperty(t.prototype,"started",{get:function(){return this.attributeObserver.started},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.attributeObserver.start()},t.prototype.stop=function(){this.attributeObserver.stop()},t.prototype.refresh=function(){this.attributeObserver.refresh()},Object.defineProperty(t.prototype,"element",{get:function(){return this.attributeObserver.element},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributeName",{get:function(){return this.attributeObserver.attributeName},enumerable:!1,configurable:!0}),t.prototype.elementMatchedAttribute=function(e){this.tokensMatched(this.readTokensForElement(e))},t.prototype.elementAttributeValueChanged=function(e){var r=this.refreshTokensForElement(e),n=r[0],i=r[1];this.tokensUnmatched(n),this.tokensMatched(i)},t.prototype.elementUnmatchedAttribute=function(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))},t.prototype.tokensMatched=function(e){var r=this;e.forEach(function(n){return r.tokenMatched(n)})},t.prototype.tokensUnmatched=function(e){var r=this;e.forEach(function(n){return r.tokenUnmatched(n)})},t.prototype.tokenMatched=function(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)},t.prototype.tokenUnmatched=function(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)},t.prototype.refreshTokensForElement=function(e){var r=this.tokensByElement.getValuesForKey(e),n=this.readTokensForElement(e),i=bGe(r,n).findIndex(function(o){var a=o[0],s=o[1];return!xGe(a,s)});return i==-1?[[],[]]:[r.slice(i),n.slice(i)]},t.prototype.readTokensForElement=function(e){var r=this.attributeName,n=e.getAttribute(r)||"";return yGe(n,e,r)},t}()});var j1t,Bre=se(()=>{tq();j1t=function(){function t(e,r,n){this.tokenListObserver=new Nre(e,r,this),this.delegate=n,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}return Object.defineProperty(t.prototype,"started",{get:function(){return this.tokenListObserver.started},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.tokenListObserver.start()},t.prototype.stop=function(){this.tokenListObserver.stop()},t.prototype.refresh=function(){this.tokenListObserver.refresh()},Object.defineProperty(t.prototype,"element",{get:function(){return this.tokenListObserver.element},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributeName",{get:function(){return this.tokenListObserver.attributeName},enumerable:!1,configurable:!0}),t.prototype.tokenMatched=function(e){var r=e.element,n=this.fetchParseResultForToken(e).value;n&&(this.fetchValuesByTokenForElement(r).set(e,n),this.delegate.elementMatchedValue(r,n))},t.prototype.tokenUnmatched=function(e){var r=e.element,n=this.fetchParseResultForToken(e).value;n&&(this.fetchValuesByTokenForElement(r).delete(e),this.delegate.elementUnmatchedValue(r,n))},t.prototype.fetchParseResultForToken=function(e){var r=this.parseResultsByToken.get(e);return r||(r=this.parseToken(e),this.parseResultsByToken.set(e,r)),r},t.prototype.fetchValuesByTokenForElement=function(e){var r=this.valuesByTokenByElement.get(e);return r||(r=new Map,this.valuesByTokenByElement.set(e,r)),r},t.prototype.parseToken=function(e){try{var r=this.delegate.parseValueForToken(e);return{value:r}}catch(n){return{error:n}}},t}()});var rq=se(()=>{JR();ZR();Pre();tq();Bre()});var i0,jre=se(()=>{rq();Pr();i0=class extends Ct{constructor(){super(...arguments);vt(this,"target",{})}get targetIsDisabled(){return this.target.dataset.disabled==="true"}enableTarget(){this.targetIsDisabled&&(this.target.classList.remove(...this.disabledClasses),this.target.classList.add(...this.enabledClasses),this.target.dataset.disabled=!1)}disableTarget(){this.target.classList.remove(...this.enabledClasses),this.target.classList.add(...this.disabledClasses),this.target.dataset.disabled=!0}visitAction(t){if(this.target=t.target,this.targetIsDisabled){t.preventDefault();return}this.disableTarget();let e=new Zg(document.querySelector("turbo-frame#actions_show"),"busy",{elementUnmatchedAttribute:()=>{this.enableTarget(this.target),e&&e.stop()}});e.start()}};vt(i0,"targets",["resourceAction","standaloneAction"]),vt(i0,"classes",["enabled","disabled"])});var T1,zre=se(()=>{Pr();T1=class extends Ct{connect(){this.formTarget.submit()}};vt(T1,"targets",["form"])});var D1,Hre=se(()=>{Pr();D1=class extends Ct{constructor(){super(...arguments);vt(this,"defaults",{})}get selectedType(){return this.selectTarget.value}get isSearchable(){return this.context.scope.element.dataset.searchable==="true"}get association(){return this.context.scope.element.dataset.association}get associationClass(){return this.context.scope.element.dataset.associationClass}connect(){this.copyValidNames(),this.changeType()}changeType(){this.hideAllTypes(),this.showType(this.selectTarget.value)}hideAllTypes(){this.typeTargets.forEach(t=>{t.classList.add("hidden"),this.invalidateTarget(t)})}copyValidNames(){this.typeTargets.forEach(t=>{let{type:e}=t.dataset;if(this.isSearchable){let r=t.querySelector('input[type="text"]');r&&this.nameToValidName(r);let n=t.querySelector('input[type="hidden"]');n&&this.nameToValidName(n)}else{let r=t.querySelector("select");r&&this.nameToValidName(r);let n=t.querySelector('input[type="hidden"]');n&&this.nameToValidName(n),this.selectedType!==e&&(r.selectedIndex=0)}})}showType(t){let e=this.typeTargets.find(r=>r.dataset.type===t);e&&(e.classList.remove("hidden"),this.validateTarget(e))}validateTarget(t){if(this.isSearchable){let e=t.querySelector('input[type="text"]'),r=t.querySelector('input[type="hidden"]');this.validNameToName(e),this.validNameToName(r)}else{let e=t.querySelector("select"),r=t.querySelector('input[type="hidden"]');this.validNameToName(e),r&&this.validNameToName(r)}}invalidateTarget(t){if(this.isSearchable)try{t.querySelector('input[type="text"]').setAttribute("name",""),t.querySelector('input[type="hidden"]').setAttribute("name","")}catch(e){}else if(t)try{t.querySelector("select").setAttribute("name",""),t.querySelector('input[type="hidden"]').setAttribute("name","")}catch(e){}}validNameToName(t){t.setAttribute("name",t.getAttribute("valid-name"))}nameToValidName(t){t.setAttribute("valid-name",t.getAttribute("name"))}};vt(D1,"targets",["select","type","loadAssociationLink"])});var Wre=Z((Jg,em)=>{(function(t){var e=typeof Jg=="object"&&Jg&&!Jg.nodeType&&Jg,r=typeof em=="object"&&em&&!em.nodeType&&em,n=typeof global=="object"&&global;(n.global===n||n.window===n||n.self===n)&&(t=n);var i,o=2147483647,a=36,s=1,u=26,c=38,f=700,p=72,g=128,m="-",x=/^xn--/,w=/[^\x20-\x7E]/,T=/[\x2E\u3002\uFF0E\uFF61]/g,k={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=a-s,D=Math.floor,M=String.fromCharCode,P;function _(X){throw new RangeError(k[X])}function C(X,oe){for(var G=X.length,K=[];G--;)K[G]=oe(X[G]);return K}function O(X,oe){var G=X.split("@"),K="";G.length>1&&(K=G[0]+"@",X=G[1]),X=X.replace(T,".");var ve=X.split("."),Se=C(ve,oe).join(".");return K+Se}function F(X){for(var oe=[],G=0,K=X.length,ve,Se;G<K;)ve=X.charCodeAt(G++),ve>=55296&&ve<=56319&&G<K?(Se=X.charCodeAt(G++),(Se&64512)==56320?oe.push(((ve&1023)<<10)+(Se&1023)+65536):(oe.push(ve),G--)):oe.push(ve);return oe}function B(X){return C(X,function(oe){var G="";return oe>65535&&(oe-=65536,G+=M(oe>>>10&1023|55296),oe=56320|oe&1023),G+=M(oe),G}).join("")}function V(X){return X-48<10?X-22:X-65<26?X-65:X-97<26?X-97:a}function S(X,oe){return X+22+75*(X<26)-((oe!=0)<<5)}function R(X,oe,G){var K=0;for(X=G?D(X/f):X>>1,X+=D(X/oe);X>A*u>>1;K+=a)X=D(X/A);return D(K+(A+1)*X/(X+c))}function q(X){var oe=[],G=X.length,K,ve=0,Se=g,_e=p,Ne,Le,it,ze,tt,wt,At,Ve,Oe;for(Ne=X.lastIndexOf(m),Ne<0&&(Ne=0),Le=0;Le<Ne;++Le)X.charCodeAt(Le)>=128&&_("not-basic"),oe.push(X.charCodeAt(Le));for(it=Ne>0?Ne+1:0;it<G;){for(ze=ve,tt=1,wt=a;it>=G&&_("invalid-input"),At=V(X.charCodeAt(it++)),(At>=a||At>D((o-ve)/tt))&&_("overflow"),ve+=At*tt,Ve=wt<=_e?s:wt>=_e+u?u:wt-_e,!(At<Ve);wt+=a)Oe=a-Ve,tt>D(o/Oe)&&_("overflow"),tt*=Oe;K=oe.length+1,_e=R(ve-ze,K,ze==0),D(ve/K)>o-Se&&_("overflow"),Se+=D(ve/K),ve%=K,oe.splice(ve++,0,Se)}return B(oe)}function W(X){var oe,G,K,ve,Se,_e,Ne,Le,it,ze,tt,wt=[],At,Ve,Oe,Me;for(X=F(X),At=X.length,oe=g,G=0,Se=p,_e=0;_e<At;++_e)tt=X[_e],tt<128&&wt.push(M(tt));for(K=ve=wt.length,ve&&wt.push(m);K<At;){for(Ne=o,_e=0;_e<At;++_e)tt=X[_e],tt>=oe&&tt<Ne&&(Ne=tt);for(Ve=K+1,Ne-oe>D((o-G)/Ve)&&_("overflow"),G+=(Ne-oe)*Ve,oe=Ne,_e=0;_e<At;++_e)if(tt=X[_e],tt<oe&&++G>o&&_("overflow"),tt==oe){for(Le=G,it=a;ze=it<=Se?s:it>=Se+u?u:it-Se,!(Le<ze);it+=a)Me=Le-ze,Oe=a-ze,wt.push(M(S(ze+Me%Oe,0))),Le=D(Me/Oe);wt.push(M(S(Le,0))),Se=R(G,Ve,K==ve),G=0,++K}++G,++oe}return wt.join("")}function N(X){return O(X,function(oe){return x.test(oe)?q(oe.slice(4).toLowerCase()):oe})}function z(X){return O(X,function(oe){return w.test(oe)?"xn--"+W(oe):oe})}if(i={version:"1.3.2",ucs2:{decode:F,encode:B},decode:q,encode:W,toASCII:z,toUnicode:N},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return i});else if(e&&r)if(em.exports==e)r.exports=i;else for(P in i)i.hasOwnProperty(P)&&(e[P]=i[P]);else t.punycode=i})(Jg)});var Vre=Z((Ure,O1)=>{(function(t,e){"use strict";typeof O1=="object"&&O1.exports?O1.exports=e():typeof define=="function"&&define.amd?define(e):t.IPv6=e(t)})(Ure,function(t){"use strict";var e=t&&t.IPv6;function r(i){var o=i.toLowerCase(),a=o.split(":"),s=a.length,u=8;a[0]===""&&a[1]===""&&a[2]===""?(a.shift(),a.shift()):a[0]===""&&a[1]===""?a.shift():a[s-1]===""&&a[s-2]===""&&a.pop(),s=a.length,a[s-1].indexOf(".")!==-1&&(u=7);var c;for(c=0;c<s&&a[c]!=="";c++);if(c<u)for(a.splice(c,1,"0000");a.length<u;)a.splice(c,0,"0000");for(var f,p=0;p<u;p++){f=a[p].split("");for(var g=0;g<3&&(f[0]==="0"&&f.length>1);g++)f.splice(0,1);a[p]=f.join("")}var m=-1,x=0,w=0,T=-1,k=!1;for(p=0;p<u;p++)k?a[p]==="0"?w+=1:(k=!1,w>x&&(m=T,x=w)):a[p]==="0"&&(k=!0,T=p,w=1);w>x&&(m=T,x=w),x>1&&a.splice(m,x,""),s=a.length;var A="";for(a[0]===""&&(A=":"),p=0;p<s&&(A+=a[p],p!==s-1);p++)A+=":";return a[s-1]===""&&(A+=":"),A}function n(){return t.IPv6===this&&(t.IPv6=e),this}return{best:r,noConflict:n}})});var Yre=Z(($re,M1)=>{(function(t,e){"use strict";typeof M1=="object"&&M1.exports?M1.exports=e():typeof define=="function"&&define.amd?define(e):t.SecondLevelDomains=e(t)})($re,function(t){"use strict";var e=t&&t.SecondLevelDomains,r={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(n){var i=n.lastIndexOf(".");if(i<=0||i>=n.length-1)return!1;var o=n.lastIndexOf(".",i-1);if(o<=0||o>=i-1)return!1;var a=r.list[n.slice(i+1)];return a?a.indexOf(" "+n.slice(o+1,i)+" ")>=0:!1},is:function(n){var i=n.lastIndexOf(".");if(i<=0||i>=n.length-1)return!1;var o=n.lastIndexOf(".",i-1);if(o>=0)return!1;var a=r.list[n.slice(i+1)];return a?a.indexOf(" "+n.slice(0,i)+" ")>=0:!1},get:function(n){var i=n.lastIndexOf(".");if(i<=0||i>=n.length-1)return null;var o=n.lastIndexOf(".",i-1);if(o<=0||o>=i-1)return null;var a=r.list[n.slice(i+1)];return!a||a.indexOf(" "+n.slice(o+1,i)+" ")<0?null:n.slice(o+1)},noConflict:function(){return t.SecondLevelDomains===this&&(t.SecondLevelDomains=e),this}};return r})});var L1=Z((Kre,I1)=>{(function(t,e){"use strict";typeof I1=="object"&&I1.exports?I1.exports=e(Wre(),Vre(),Yre()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],e):t.URI=e(t.punycode,t.IPv6,t.SecondLevelDomains,t)})(Kre,function(t,e,r,n){"use strict";var i=n&&n.URI;function o(S,R){var q=arguments.length>=1,W=arguments.length>=2;if(!(this instanceof o))return q?W?new o(S,R):new o(S):new o;if(S===void 0){if(q)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?S=location.href+"":S=""}if(S===null&&q)throw new TypeError("null is not a valid argument for URI");return this.href(S),R!==void 0?this.absoluteTo(R):this}function a(S){return/^[0-9]+$/.test(S)}o.version="1.19.11";var s=o.prototype,u=Object.prototype.hasOwnProperty;function c(S){return S.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(S){return S===void 0?"Undefined":String(Object.prototype.toString.call(S)).slice(8,-1)}function p(S){return f(S)==="Array"}function g(S,R){var q={},W,N;if(f(R)==="RegExp")q=null;else if(p(R))for(W=0,N=R.length;W<N;W++)q[R[W]]=!0;else q[R]=!0;for(W=0,N=S.length;W<N;W++){var z=q&&q[S[W]]!==void 0||!q&&R.test(S[W]);z&&(S.splice(W,1),N--,W--)}return S}function m(S,R){var q,W;if(p(R)){for(q=0,W=R.length;q<W;q++)if(!m(S,R[q]))return!1;return!0}var N=f(R);for(q=0,W=S.length;q<W;q++)if(N==="RegExp"){if(typeof S[q]=="string"&&S[q].match(R))return!0}else if(S[q]===R)return!0;return!1}function x(S,R){if(!p(S)||!p(R)||S.length!==R.length)return!1;S.sort(),R.sort();for(var q=0,W=S.length;q<W;q++)if(S[q]!==R[q])return!1;return!0}function w(S){var R=/^\/+|\/+$/g;return S.replace(R,"")}o._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:o.preventInvalidHostname,duplicateQueryParameters:o.duplicateQueryParameters,escapeQuerySpace:o.escapeQuerySpace}},o.preventInvalidHostname=!1,o.duplicateQueryParameters=!1,o.escapeQuerySpace=!0,o.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,o.idn_expression=/[^a-z0-9\._-]/i,o.punycode_expression=/(xn--)/i,o.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,o.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,o.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,o.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},o.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,o.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},o.hostProtocols=["http","https"],o.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,o.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},o.getDomAttribute=function(S){if(!(!S||!S.nodeName)){var R=S.nodeName.toLowerCase();if(!(R==="input"&&S.type!=="image"))return o.domAttributes[R]}};function T(S){return escape(S)}function k(S){return encodeURIComponent(S).replace(/[!'()*]/g,T).replace(/\*/g,"%2A")}o.encode=k,o.decode=decodeURIComponent,o.iso8859=function(){o.encode=escape,o.decode=unescape},o.unicode=function(){o.encode=k,o.decode=decodeURIComponent},o.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},o.encodeQuery=function(S,R){var q=o.encode(S+"");return R===void 0&&(R=o.escapeQuerySpace),R?q.replace(/%20/g,"+"):q},o.decodeQuery=function(S,R){S+="",R===void 0&&(R=o.escapeQuerySpace);try{return o.decode(R?S.replace(/\+/g,"%20"):S)}catch{return S}};var A={encode:"encode",decode:"decode"},D,M=function(S,R){return function(q){try{return o[R](q+"").replace(o.characters[S][R].expression,function(W){return o.characters[S][R].map[W]})}catch{return q}}};for(D in A)o[D+"PathSegment"]=M("pathname",A[D]),o[D+"UrnPathSegment"]=M("urnpath",A[D]);var P=function(S,R,q){return function(W){var N;q?N=function(G){return o[R](o[q](G))}:N=o[R];for(var z=(W+"").split(S),X=0,oe=z.length;X<oe;X++)z[X]=N(z[X]);return z.join(S)}};o.decodePath=P("/","decodePathSegment"),o.decodeUrnPath=P(":","decodeUrnPathSegment"),o.recodePath=P("/","encodePathSegment","decode"),o.recodeUrnPath=P(":","encodeUrnPathSegment","decode"),o.encodeReserved=M("reserved","encode"),o.parse=function(S,R){var q;return R||(R={preventInvalidHostname:o.preventInvalidHostname}),S=S.replace(o.leading_whitespace_expression,""),S=S.replace(o.ascii_tab_whitespace,""),q=S.indexOf("#"),q>-1&&(R.fragment=S.substring(q+1)||null,S=S.substring(0,q)),q=S.indexOf("?"),q>-1&&(R.query=S.substring(q+1)||null,S=S.substring(0,q)),S=S.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),S=S.replace(/^[/\\]{2,}/i,"//"),S.substring(0,2)==="//"?(R.protocol=null,S=S.substring(2),S=o.parseAuthority(S,R)):(q=S.indexOf(":"),q>-1&&(R.protocol=S.substring(0,q)||null,R.protocol&&!R.protocol.match(o.protocol_expression)?R.protocol=void 0:S.substring(q+1,q+3).replace(/\\/g,"/")==="//"?(S=S.substring(q+3),S=o.parseAuthority(S,R)):(S=S.substring(q+1),R.urn=!0))),R.path=S,R},o.parseHost=function(S,R){S||(S=""),S=S.replace(/\\/g,"/");var q=S.indexOf("/"),W,N;if(q===-1&&(q=S.length),S.charAt(0)==="[")W=S.indexOf("]"),R.hostname=S.substring(1,W)||null,R.port=S.substring(W+2,q)||null,R.port==="/"&&(R.port=null);else{var z=S.indexOf(":"),X=S.indexOf("/"),oe=S.indexOf(":",z+1);oe!==-1&&(X===-1||oe<X)?(R.hostname=S.substring(0,q)||null,R.port=null):(N=S.substring(0,q).split(":"),R.hostname=N[0]||null,R.port=N[1]||null)}return R.hostname&&S.substring(q).charAt(0)!=="/"&&(q++,S="/"+S),R.preventInvalidHostname&&o.ensureValidHostname(R.hostname,R.protocol),R.port&&o.ensureValidPort(R.port),S.substring(q)||"/"},o.parseAuthority=function(S,R){return S=o.parseUserinfo(S,R),o.parseHost(S,R)},o.parseUserinfo=function(S,R){var q=S,W=S.indexOf("\\");W!==-1&&(S=S.replace(/\\/g,"/"));var N=S.indexOf("/"),z=S.lastIndexOf("@",N>-1?N:S.length-1),X;return z>-1&&(N===-1||z<N)?(X=S.substring(0,z).split(":"),R.username=X[0]?o.decode(X[0]):null,X.shift(),R.password=X[0]?o.decode(X.join(":")):null,S=q.substring(z+1)):(R.username=null,R.password=null),S},o.parseQuery=function(S,R){if(!S)return{};if(S=S.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!S)return{};for(var q={},W=S.split("&"),N=W.length,z,X,oe,G=0;G<N;G++)z=W[G].split("="),X=o.decodeQuery(z.shift(),R),oe=z.length?o.decodeQuery(z.join("="),R):null,X!=="__proto__"&&(u.call(q,X)?((typeof q[X]=="string"||q[X]===null)&&(q[X]=[q[X]]),q[X].push(oe)):q[X]=oe);return q},o.build=function(S){var R="",q=!1;return S.protocol&&(R+=S.protocol+":"),!S.urn&&(R||S.hostname)&&(R+="//",q=!0),R+=o.buildAuthority(S)||"",typeof S.path=="string"&&(S.path.charAt(0)!=="/"&&q&&(R+="/"),R+=S.path),typeof S.query=="string"&&S.query&&(R+="?"+S.query),typeof S.fragment=="string"&&S.fragment&&(R+="#"+S.fragment),R},o.buildHost=function(S){var R="";if(S.hostname)o.ip6_expression.test(S.hostname)?R+="["+S.hostname+"]":R+=S.hostname;else return"";return S.port&&(R+=":"+S.port),R},o.buildAuthority=function(S){return o.buildUserinfo(S)+o.buildHost(S)},o.buildUserinfo=function(S){var R="";return S.username&&(R+=o.encode(S.username)),S.password&&(R+=":"+o.encode(S.password)),R&&(R+="@"),R},o.buildQuery=function(S,R,q){var W="",N,z,X,oe;for(z in S)if(z!=="__proto__"&&u.call(S,z))if(p(S[z]))for(N={},X=0,oe=S[z].length;X<oe;X++)S[z][X]!==void 0&&N[S[z][X]+""]===void 0&&(W+="&"+o.buildQueryParameter(z,S[z][X],q),R!==!0&&(N[S[z][X]+""]=!0));else S[z]!==void 0&&(W+="&"+o.buildQueryParameter(z,S[z],q));return W.substring(1)},o.buildQueryParameter=function(S,R,q){return o.encodeQuery(S,q)+(R!==null?"="+o.encodeQuery(R,q):"")},o.addQuery=function(S,R,q){if(typeof R=="object")for(var W in R)u.call(R,W)&&o.addQuery(S,W,R[W]);else if(typeof R=="string"){if(S[R]===void 0){S[R]=q;return}else typeof S[R]=="string"&&(S[R]=[S[R]]);p(q)||(q=[q]),S[R]=(S[R]||[]).concat(q)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},o.setQuery=function(S,R,q){if(typeof R=="object")for(var W in R)u.call(R,W)&&o.setQuery(S,W,R[W]);else if(typeof R=="string")S[R]=q===void 0?null:q;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},o.removeQuery=function(S,R,q){var W,N,z;if(p(R))for(W=0,N=R.length;W<N;W++)S[R[W]]=void 0;else if(f(R)==="RegExp")for(z in S)R.test(z)&&(S[z]=void 0);else if(typeof R=="object")for(z in R)u.call(R,z)&&o.removeQuery(S,z,R[z]);else if(typeof R=="string")q!==void 0?f(q)==="RegExp"?!p(S[R])&&q.test(S[R])?S[R]=void 0:S[R]=g(S[R],q):S[R]===String(q)&&(!p(q)||q.length===1)?S[R]=void 0:p(S[R])&&(S[R]=g(S[R],q)):S[R]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},o.hasQuery=function(S,R,q,W){switch(f(R)){case"String":break;case"RegExp":for(var N in S)if(u.call(S,N)&&R.test(N)&&(q===void 0||o.hasQuery(S,N,q)))return!0;return!1;case"Object":for(var z in R)if(u.call(R,z)&&!o.hasQuery(S,z,R[z]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(q)){case"Undefined":return R in S;case"Boolean":var X=Boolean(p(S[R])?S[R].length:S[R]);return q===X;case"Function":return!!q(S[R],R,S);case"Array":if(!p(S[R]))return!1;var oe=W?m:x;return oe(S[R],q);case"RegExp":return p(S[R])?W?m(S[R],q):!1:Boolean(S[R]&&S[R].match(q));case"Number":q=String(q);case"String":return p(S[R])?W?m(S[R],q):!1:S[R]===q;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},o.joinPaths=function(){for(var S=[],R=[],q=0,W=0;W<arguments.length;W++){var N=new o(arguments[W]);S.push(N);for(var z=N.segment(),X=0;X<z.length;X++)typeof z[X]=="string"&&R.push(z[X]),z[X]&&q++}if(!R.length||!q)return new o("");var oe=new o("").segment(R);return(S[0].path()===""||S[0].path().slice(0,1)==="/")&&oe.path("/"+oe.path()),oe.normalize()},o.commonPath=function(S,R){var q=Math.min(S.length,R.length),W;for(W=0;W<q;W++)if(S.charAt(W)!==R.charAt(W)){W--;break}return W<1?S.charAt(0)===R.charAt(0)&&S.charAt(0)==="/"?"/":"":((S.charAt(W)!=="/"||R.charAt(W)!=="/")&&(W=S.substring(0,W).lastIndexOf("/")),S.substring(0,W+1))},o.withinString=function(S,R,q){q||(q={});var W=q.start||o.findUri.start,N=q.end||o.findUri.end,z=q.trim||o.findUri.trim,X=q.parens||o.findUri.parens,oe=/[a-z0-9-]=["']?$/i;for(W.lastIndex=0;;){var G=W.exec(S);if(!G)break;var K=G.index;if(q.ignoreHtml){var ve=S.slice(Math.max(K-3,0),K);if(ve&&oe.test(ve))continue}for(var Se=K+S.slice(K).search(N),_e=S.slice(K,Se),Ne=-1;;){var Le=X.exec(_e);if(!Le)break;var it=Le.index+Le[0].length;Ne=Math.max(Ne,it)}if(Ne>-1?_e=_e.slice(0,Ne)+_e.slice(Ne).replace(z,""):_e=_e.replace(z,""),!(_e.length<=G[0].length)&&!(q.ignore&&q.ignore.test(_e))){Se=K+_e.length;var ze=R(_e,K,Se,S);if(ze===void 0){W.lastIndex=Se;continue}ze=String(ze),S=S.slice(0,K)+ze+S.slice(Se),W.lastIndex=K+ze.length}}return W.lastIndex=0,S},o.ensureValidHostname=function(S,R){var q=!!S,W=!!R,N=!1;if(W&&(N=m(o.hostProtocols,R)),N&&!q)throw new TypeError("Hostname cannot be empty, if protocol is "+R);if(S&&S.match(o.invalid_hostname_characters)){if(!t)throw new TypeError('Hostname "'+S+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(t.toASCII(S).match(o.invalid_hostname_characters))throw new TypeError('Hostname "'+S+'" contains characters other than [A-Z0-9.-:_]')}},o.ensureValidPort=function(S){if(!!S){var R=Number(S);if(!(a(R)&&R>0&&R<65536))throw new TypeError('Port "'+S+'" is not a valid port')}},o.noConflict=function(S){if(S){var R={URI:this.noConflict()};return n.URITemplate&&typeof n.URITemplate.noConflict=="function"&&(R.URITemplate=n.URITemplate.noConflict()),n.IPv6&&typeof n.IPv6.noConflict=="function"&&(R.IPv6=n.IPv6.noConflict()),n.SecondLevelDomains&&typeof n.SecondLevelDomains.noConflict=="function"&&(R.SecondLevelDomains=n.SecondLevelDomains.noConflict()),R}else n.URI===this&&(n.URI=i);return this},s.build=function(S){return S===!0?this._deferred_build=!0:(S===void 0||this._deferred_build)&&(this._string=o.build(this._parts),this._deferred_build=!1),this},s.clone=function(){return new o(this)},s.valueOf=s.toString=function(){return this.build(!1)._string};function _(S){return function(R,q){return R===void 0?this._parts[S]||"":(this._parts[S]=R||null,this.build(!q),this)}}function C(S,R){return function(q,W){return q===void 0?this._parts[S]||"":(q!==null&&(q=q+"",q.charAt(0)===R&&(q=q.substring(1))),this._parts[S]=q,this.build(!W),this)}}s.protocol=_("protocol"),s.username=_("username"),s.password=_("password"),s.hostname=_("hostname"),s.port=_("port"),s.query=C("query","?"),s.fragment=C("fragment","#"),s.search=function(S,R){var q=this.query(S,R);return typeof q=="string"&&q.length?"?"+q:q},s.hash=function(S,R){var q=this.fragment(S,R);return typeof q=="string"&&q.length?"#"+q:q},s.pathname=function(S,R){if(S===void 0||S===!0){var q=this._parts.path||(this._parts.hostname?"/":"");return S?(this._parts.urn?o.decodeUrnPath:o.decodePath)(q):q}else return this._parts.urn?this._parts.path=S?o.recodeUrnPath(S):"":this._parts.path=S?o.recodePath(S):"/",this.build(!R),this},s.path=s.pathname,s.href=function(S,R){var q;if(S===void 0)return this.toString();this._string="",this._parts=o._parts();var W=S instanceof o,N=typeof S=="object"&&(S.hostname||S.path||S.pathname);if(S.nodeName){var z=o.getDomAttribute(S);S=S[z]||"",N=!1}if(!W&&N&&S.pathname!==void 0&&(S=S.toString()),typeof S=="string"||S instanceof String)this._parts=o.parse(String(S),this._parts);else if(W||N){var X=W?S._parts:S;for(q in X)q!=="query"&&u.call(this._parts,q)&&(this._parts[q]=X[q]);X.query&&this.query(X.query,!1)}else throw new TypeError("invalid input");return this.build(!R),this},s.is=function(S){var R=!1,q=!1,W=!1,N=!1,z=!1,X=!1,oe=!1,G=!this._parts.urn;switch(this._parts.hostname&&(G=!1,q=o.ip4_expression.test(this._parts.hostname),W=o.ip6_expression.test(this._parts.hostname),R=q||W,N=!R,z=N&&r&&r.has(this._parts.hostname),X=N&&o.idn_expression.test(this._parts.hostname),oe=N&&o.punycode_expression.test(this._parts.hostname)),S.toLowerCase()){case"relative":return G;case"absolute":return!G;case"domain":case"name":return N;case"sld":return z;case"ip":return R;case"ip4":case"ipv4":case"inet4":return q;case"ip6":case"ipv6":case"inet6":return W;case"idn":return X;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return oe}return null};var O=s.protocol,F=s.port,B=s.hostname;s.protocol=function(S,R){if(S&&(S=S.replace(/:(\/\/)?$/,""),!S.match(o.protocol_expression)))throw new TypeError('Protocol "'+S+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return O.call(this,S,R)},s.scheme=s.protocol,s.port=function(S,R){return this._parts.urn?S===void 0?"":this:(S!==void 0&&(S===0&&(S=null),S&&(S+="",S.charAt(0)===":"&&(S=S.substring(1)),o.ensureValidPort(S))),F.call(this,S,R))},s.hostname=function(S,R){if(this._parts.urn)return S===void 0?"":this;if(S!==void 0){var q={preventInvalidHostname:this._parts.preventInvalidHostname},W=o.parseHost(S,q);if(W!=="/")throw new TypeError('Hostname "'+S+'" contains characters other than [A-Z0-9.-]');S=q.hostname,this._parts.preventInvalidHostname&&o.ensureValidHostname(S,this._parts.protocol)}return B.call(this,S,R)},s.origin=function(S,R){if(this._parts.urn)return S===void 0?"":this;if(S===void 0){var q=this.protocol(),W=this.authority();return W?(q?q+"://":"")+this.authority():""}else{var N=o(S);return this.protocol(N.protocol()).authority(N.authority()).build(!R),this}},s.host=function(S,R){if(this._parts.urn)return S===void 0?"":this;if(S===void 0)return this._parts.hostname?o.buildHost(this._parts):"";var q=o.parseHost(S,this._parts);if(q!=="/")throw new TypeError('Hostname "'+S+'" contains characters other than [A-Z0-9.-]');return this.build(!R),this},s.authority=function(S,R){if(this._parts.urn)return S===void 0?"":this;if(S===void 0)return this._parts.hostname?o.buildAuthority(this._parts):"";var q=o.parseAuthority(S,this._parts);if(q!=="/")throw new TypeError('Hostname "'+S+'" contains characters other than [A-Z0-9.-]');return this.build(!R),this},s.userinfo=function(S,R){if(this._parts.urn)return S===void 0?"":this;if(S===void 0){var q=o.buildUserinfo(this._parts);return q&&q.substring(0,q.length-1)}else return S[S.length-1]!=="@"&&(S+="@"),o.parseUserinfo(S,this._parts),this.build(!R),this},s.resource=function(S,R){var q;return S===void 0?this.path()+this.search()+this.hash():(q=o.parse(S),this._parts.path=q.path,this._parts.query=q.query,this._parts.fragment=q.fragment,this.build(!R),this)},s.subdomain=function(S,R){if(this._parts.urn)return S===void 0?"":this;if(S===void 0){if(!this._parts.hostname||this.is("IP"))return"";var q=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,q)||""}else{var W=this._parts.hostname.length-this.domain().length,N=this._parts.hostname.substring(0,W),z=new RegExp("^"+c(N));if(S&&S.charAt(S.length-1)!=="."&&(S+="."),S.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return S&&o.ensureValidHostname(S,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(z,S),this.build(!R),this}},s.domain=function(S,R){if(this._parts.urn)return S===void 0?"":this;if(typeof S=="boolean"&&(R=S,S=void 0),S===void 0){if(!this._parts.hostname||this.is("IP"))return"";var q=this._parts.hostname.match(/\./g);if(q&&q.length<2)return this._parts.hostname;var W=this._parts.hostname.length-this.tld(R).length-1;return W=this._parts.hostname.lastIndexOf(".",W-1)+1,this._parts.hostname.substring(W)||""}else{if(!S)throw new TypeError("cannot set domain empty");if(S.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(o.ensureValidHostname(S,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=S;else{var N=new RegExp(c(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(N,S)}return this.build(!R),this}},s.tld=function(S,R){if(this._parts.urn)return S===void 0?"":this;if(typeof S=="boolean"&&(R=S,S=void 0),S===void 0){if(!this._parts.hostname||this.is("IP"))return"";var q=this._parts.hostname.lastIndexOf("."),W=this._parts.hostname.substring(q+1);return R!==!0&&r&&r.list[W.toLowerCase()]&&r.get(this._parts.hostname)||W}else{var N;if(S)if(S.match(/[^a-zA-Z0-9-]/))if(r&&r.is(S))N=new RegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(N,S);else throw new TypeError('TLD "'+S+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");N=new RegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(N,S)}else throw new TypeError("cannot set TLD empty");return this.build(!R),this}},s.directory=function(S,R){if(this._parts.urn)return S===void 0?"":this;if(S===void 0||S===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var q=this._parts.path.length-this.filename().length-1,W=this._parts.path.substring(0,q)||(this._parts.hostname?"/":"");return S?o.decodePath(W):W}else{var N=this._parts.path.length-this.filename().length,z=this._parts.path.substring(0,N),X=new RegExp("^"+c(z));return this.is("relative")||(S||(S="/"),S.charAt(0)!=="/"&&(S="/"+S)),S&&S.charAt(S.length-1)!=="/"&&(S+="/"),S=o.recodePath(S),this._parts.path=this._parts.path.replace(X,S),this.build(!R),this}},s.filename=function(S,R){if(this._parts.urn)return S===void 0?"":this;if(typeof S!="string"){if(!this._parts.path||this._parts.path==="/")return"";var q=this._parts.path.lastIndexOf("/"),W=this._parts.path.substring(q+1);return S?o.decodePathSegment(W):W}else{var N=!1;S.charAt(0)==="/"&&(S=S.substring(1)),S.match(/\.?\//)&&(N=!0);var z=new RegExp(c(this.filename())+"$");return S=o.recodePath(S),this._parts.path=this._parts.path.replace(z,S),N?this.normalizePath(R):this.build(!R),this}},s.suffix=function(S,R){if(this._parts.urn)return S===void 0?"":this;if(S===void 0||S===!0){if(!this._parts.path||this._parts.path==="/")return"";var q=this.filename(),W=q.lastIndexOf("."),N,z;return W===-1?"":(N=q.substring(W+1),z=/^[a-z0-9%]+$/i.test(N)?N:"",S?o.decodePathSegment(z):z)}else{S.charAt(0)==="."&&(S=S.substring(1));var X=this.suffix(),oe;if(X)S?oe=new RegExp(c(X)+"$"):oe=new RegExp(c("."+X)+"$");else{if(!S)return this;this._parts.path+="."+o.recodePath(S)}return oe&&(S=o.recodePath(S),this._parts.path=this._parts.path.replace(oe,S)),this.build(!R),this}},s.segment=function(S,R,q){var W=this._parts.urn?":":"/",N=this.path(),z=N.substring(0,1)==="/",X=N.split(W);if(S!==void 0&&typeof S!="number"&&(q=R,R=S,S=void 0),S!==void 0&&typeof S!="number")throw new Error('Bad segment "'+S+'", must be 0-based integer');if(z&&X.shift(),S<0&&(S=Math.max(X.length+S,0)),R===void 0)return S===void 0?X:X[S];if(S===null||X[S]===void 0)if(p(R)){X=[];for(var oe=0,G=R.length;oe<G;oe++)!R[oe].length&&(!X.length||!X[X.length-1].length)||(X.length&&!X[X.length-1].length&&X.pop(),X.push(w(R[oe])))}else(R||typeof R=="string")&&(R=w(R),X[X.length-1]===""?X[X.length-1]=R:X.push(R));else R?X[S]=w(R):X.splice(S,1);return z&&X.unshift(""),this.path(X.join(W),q)},s.segmentCoded=function(S,R,q){var W,N,z;if(typeof S!="number"&&(q=R,R=S,S=void 0),R===void 0){if(W=this.segment(S,R,q),!p(W))W=W!==void 0?o.decode(W):void 0;else for(N=0,z=W.length;N<z;N++)W[N]=o.decode(W[N]);return W}if(!p(R))R=typeof R=="string"||R instanceof String?o.encode(R):R;else for(N=0,z=R.length;N<z;N++)R[N]=o.encode(R[N]);return this.segment(S,R,q)};var V=s.query;return s.query=function(S,R){if(S===!0)return o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof S=="function"){var q=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace),W=S.call(this,q);return this._parts.query=o.buildQuery(W||q,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!R),this}else return S!==void 0&&typeof S!="string"?(this._parts.query=o.buildQuery(S,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!R),this):V.call(this,S,R)},s.setQuery=function(S,R,q){var W=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof S=="string"||S instanceof String)W[S]=R!==void 0?R:null;else if(typeof S=="object")for(var N in S)u.call(S,N)&&(W[N]=S[N]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=o.buildQuery(W,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof S!="string"&&(q=R),this.build(!q),this},s.addQuery=function(S,R,q){var W=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.addQuery(W,S,R===void 0?null:R),this._parts.query=o.buildQuery(W,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof S!="string"&&(q=R),this.build(!q),this},s.removeQuery=function(S,R,q){var W=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.removeQuery(W,S,R),this._parts.query=o.buildQuery(W,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof S!="string"&&(q=R),this.build(!q),this},s.hasQuery=function(S,R,q){var W=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.hasQuery(W,S,R,q)},s.setSearch=s.setQuery,s.addSearch=s.addQuery,s.removeSearch=s.removeQuery,s.hasSearch=s.hasQuery,s.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},s.normalizeProtocol=function(S){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!S)),this},s.normalizeHostname=function(S){return this._parts.hostname&&(this.is("IDN")&&t?this._parts.hostname=t.toASCII(this._parts.hostname):this.is("IPv6")&&e&&(this._parts.hostname=e.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!S)),this},s.normalizePort=function(S){return typeof this._parts.protocol=="string"&&this._parts.port===o.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!S)),this},s.normalizePath=function(S){var R=this._parts.path;if(!R)return this;if(this._parts.urn)return this._parts.path=o.recodeUrnPath(this._parts.path),this.build(!S),this;if(this._parts.path==="/")return this;R=o.recodePath(R);var q,W="",N,z;for(R.charAt(0)!=="/"&&(q=!0,R="/"+R),(R.slice(-3)==="/.."||R.slice(-2)==="/.")&&(R+="/"),R=R.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),q&&(W=R.substring(1).match(/^(\.\.\/)+/)||"",W&&(W=W[0]));N=R.search(/\/\.\.(\/|$)/),N!==-1;){if(N===0){R=R.substring(3);continue}z=R.substring(0,N).lastIndexOf("/"),z===-1&&(z=N),R=R.substring(0,z)+R.substring(N+3)}return q&&this.is("relative")&&(R=W+R.substring(1)),this._parts.path=R,this.build(!S),this},s.normalizePathname=s.normalizePath,s.normalizeQuery=function(S){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(o.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!S)),this},s.normalizeFragment=function(S){return this._parts.fragment||(this._parts.fragment=null,this.build(!S)),this},s.normalizeSearch=s.normalizeQuery,s.normalizeHash=s.normalizeFragment,s.iso8859=function(){var S=o.encode,R=o.decode;o.encode=escape,o.decode=decodeURIComponent;try{this.normalize()}finally{o.encode=S,o.decode=R}return this},s.unicode=function(){var S=o.encode,R=o.decode;o.encode=k,o.decode=unescape;try{this.normalize()}finally{o.encode=S,o.decode=R}return this},s.readable=function(){var S=this.clone();S.username("").password("").normalize();var R="";if(S._parts.protocol&&(R+=S._parts.protocol+"://"),S._parts.hostname&&(S.is("punycode")&&t?(R+=t.toUnicode(S._parts.hostname),S._parts.port&&(R+=":"+S._parts.port)):R+=S.host()),S._parts.hostname&&S._parts.path&&S._parts.path.charAt(0)!=="/"&&(R+="/"),R+=S.path(!0),S._parts.query){for(var q="",W=0,N=S._parts.query.split("&"),z=N.length;W<z;W++){var X=(N[W]||"").split("=");q+="&"+o.decodeQuery(X[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),X[1]!==void 0&&(q+="="+o.decodeQuery(X[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}R+="?"+q.substring(1)}return R+=o.decodeQuery(S.hash(),!0),R},s.absoluteTo=function(S){var R=this.clone(),q=["protocol","username","password","hostname","port"],W,N,z;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(S instanceof o||(S=new o(S)),R._parts.protocol||(R._parts.protocol=S._parts.protocol,this._parts.hostname))return R;for(N=0;z=q[N];N++)R._parts[z]=S._parts[z];return R._parts.path?(R._parts.path.substring(-2)===".."&&(R._parts.path+="/"),R.path().charAt(0)!=="/"&&(W=S.directory(),W=W||(S.path().indexOf("/")===0?"/":""),R._parts.path=(W?W+"/":"")+R._parts.path,R.normalizePath())):(R._parts.path=S._parts.path,R._parts.query||(R._parts.query=S._parts.query)),R.build(),R},s.relativeTo=function(S){var R=this.clone().normalize(),q,W,N,z,X;if(R._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(S=new o(S).normalize(),q=R._parts,W=S._parts,z=R.path(),X=S.path(),z.charAt(0)!=="/")throw new Error("URI is already relative");if(X.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(q.protocol===W.protocol&&(q.protocol=null),q.username!==W.username||q.password!==W.password||q.protocol!==null||q.username!==null||q.password!==null)return R.build();if(q.hostname===W.hostname&&q.port===W.port)q.hostname=null,q.port=null;else return R.build();if(z===X)return q.path="",R.build();if(N=o.commonPath(z,X),!N)return R.build();var oe=W.path.substring(N.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return q.path=oe+q.path.substring(N.length)||"./",R.build()},s.equals=function(S){var R=this.clone(),q=new o(S),W={},N={},z={},X,oe,G;if(R.normalize(),q.normalize(),R.toString()===q.toString())return!0;if(X=R.query(),oe=q.query(),R.query(""),q.query(""),R.toString()!==q.toString()||X.length!==oe.length)return!1;W=o.parseQuery(X,this._parts.escapeQuerySpace),N=o.parseQuery(oe,this._parts.escapeQuerySpace);for(G in W)if(u.call(W,G)){if(p(W[G])){if(!x(W[G],N[G]))return!1}else if(W[G]!==N[G])return!1;z[G]=!0}for(G in N)if(u.call(N,G)&&!z[G])return!1;return!0},s.preventInvalidHostname=function(S){return this._parts.preventInvalidHostname=!!S,this},s.duplicateQueryParameters=function(S){return this._parts.duplicateQueryParameters=!!S,this},s.escapeQuerySpace=function(S){return this._parts.escapeQuerySpace=!!S,this},o})});var nq,Ca,tm=se(()=>{Pr();nq=Vr(L1()),Ca=class extends Ct{uriParams(){return(0,nq.default)(window.location.toString()).query(!0)}viaResourceName(){return this.uriParams().via_resource_name}uriParam(t){return this.viaResourceName()?`${this.viaResourceName}_${t}`:t}b64EncodeUnicode(t){return btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,r)=>String.fromCharCode(`0x${r}`)))}b64DecodeUnicode(t){return decodeURIComponent(atob(t).split("").map(e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""))}changeFilter(){let t=this.getFilterValue(),e=this.getFilterClass(),r=this.uriParams()[this.uriParam("filters")];r?r=JSON.parse(this.b64DecodeUnicode(r)):r={},r[e]=t;let n=Object.keys(r).filter(o=>r[o]!==null).reduce((o,a)=>(o[a]=r[a],o),{}),i;n&&Object.keys(n).length>0&&(i=this.b64EncodeUnicode(JSON.stringify(n))),this.navigateToURLWithFilters(i)}navigateToURLWithFilters(t){let e=new nq.default(this.urlRedirectTarget.href),r=bl({},e.query(!0));this.keepFiltersPanelOpenValue&&(r.keep_filters_panel_open=this.keepFiltersPanelOpenValue?1:null),r.page=1,t?r.filters=t:delete r.filters,e.query(r),this.urlRedirectTarget.href=e,this.urlRedirectTarget.click()}};vt(Ca,"targets",["urlRedirect"]),vt(Ca,"values",{keepFiltersPanelOpen:Boolean})});var P1,Gre=se(()=>{tm();P1=class extends Ca{getFilterValue(){let t={};return this.optionTargets.forEach(e=>{t[e.value]=e.checked}),t}getFilterClass(){let{filterClass:t}=this.optionTarget.dataset;return t}};vt(P1,"targets",["option"])});var Br=Z((iq,oq)=>{(function(t,e){typeof iq=="object"&&typeof oq<"u"?oq.exports=e():typeof define=="function"&&define.amd?define(e):(t=t||self,t.CodeMirror=e())})(iq,function(){"use strict";var t=navigator.userAgent,e=navigator.platform,r=/gecko\/\d/i.test(t),n=/MSIE \d/.test(t),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),o=/Edge\/(\d+)/.exec(t),a=n||i||o,s=a&&(n?document.documentMode||6:+(o||i)[1]),u=!o&&/WebKit\//.test(t),c=u&&/Qt\/\d+\.\d+/.test(t),f=!o&&/Chrome\//.test(t),p=/Opera\//.test(t),g=/Apple Computer/.test(navigator.vendor),m=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),x=/PhantomJS/.test(t),w=g&&(/Mobile\/\w+/.test(t)||navigator.maxTouchPoints>2),T=/Android/.test(t),k=w||T||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),A=w||/Mac/.test(e),D=/\bCrOS\b/.test(t),M=/win/i.test(e),P=p&&t.match(/Version\/(\d*\.\d*)/);P&&(P=Number(P[1])),P&&P>=15&&(p=!1,u=!0);var _=A&&(c||p&&(P==null||P<12.11)),C=r||a&&s>=9;function O(l){return new RegExp("(^|\\s)"+l+"(?:$|\\s)\\s*")}var F=function(l,d){var y=l.className,v=O(d).exec(y);if(v){var E=y.slice(v.index+v[0].length);l.className=y.slice(0,v.index)+(E?v[1]+E:"")}};function B(l){for(var d=l.childNodes.length;d>0;--d)l.removeChild(l.firstChild);return l}function V(l,d){return B(l).appendChild(d)}function S(l,d,y,v){var E=document.createElement(l);if(y&&(E.className=y),v&&(E.style.cssText=v),typeof d=="string")E.appendChild(document.createTextNode(d));else if(d)for(var L=0;L<d.length;++L)E.appendChild(d[L]);return E}function R(l,d,y,v){var E=S(l,d,y,v);return E.setAttribute("role","presentation"),E}var q;document.createRange?q=function(l,d,y,v){var E=document.createRange();return E.setEnd(v||l,y),E.setStart(l,d),E}:q=function(l,d,y){var v=document.body.createTextRange();try{v.moveToElementText(l.parentNode)}catch{return v}return v.collapse(!0),v.moveEnd("character",y),v.moveStart("character",d),v};function W(l,d){if(d.nodeType==3&&(d=d.parentNode),l.contains)return l.contains(d);do if(d.nodeType==11&&(d=d.host),d==l)return!0;while(d=d.parentNode)}function N(){var l;try{l=document.activeElement}catch{l=document.body||null}for(;l&&l.shadowRoot&&l.shadowRoot.activeElement;)l=l.shadowRoot.activeElement;return l}function z(l,d){var y=l.className;O(d).test(y)||(l.className+=(y?" ":"")+d)}function X(l,d){for(var y=l.split(" "),v=0;v<y.length;v++)y[v]&&!O(y[v]).test(d)&&(d+=" "+y[v]);return d}var oe=function(l){l.select()};w?oe=function(l){l.selectionStart=0,l.selectionEnd=l.value.length}:a&&(oe=function(l){try{l.select()}catch{}});function G(l){var d=Array.prototype.slice.call(arguments,1);return function(){return l.apply(null,d)}}function K(l,d,y){d||(d={});for(var v in l)l.hasOwnProperty(v)&&(y!==!1||!d.hasOwnProperty(v))&&(d[v]=l[v]);return d}function ve(l,d,y,v,E){d==null&&(d=l.search(/[^\s\u00a0]/),d==-1&&(d=l.length));for(var L=v||0,j=E||0;;){var Y=l.indexOf(" ",L);if(Y<0||Y>=d)return j+(d-L);j+=Y-L,j+=y-j%y,L=Y+1}}var Se=function(){this.id=null,this.f=null,this.time=0,this.handler=G(this.onTimeout,this)};Se.prototype.onTimeout=function(l){l.id=0,l.time<=+new Date?l.f():setTimeout(l.handler,l.time-+new Date)},Se.prototype.set=function(l,d){this.f=d;var y=+new Date+l;(!this.id||y<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,l),this.time=y)};function _e(l,d){for(var y=0;y<l.length;++y)if(l[y]==d)return y;return-1}var Ne=50,Le={toString:function(){return"CodeMirror.Pass"}},it={scroll:!1},ze={origin:"*mouse"},tt={origin:"+move"};function wt(l,d,y){for(var v=0,E=0;;){var L=l.indexOf(" ",v);L==-1&&(L=l.length);var j=L-v;if(L==l.length||E+j>=d)return v+Math.min(j,d-E);if(E+=L-v,E+=y-E%y,v=L+1,E>=d)return v}}var At=[""];function Ve(l){for(;At.length<=l;)At.push(Oe(At)+" ");return At[l]}function Oe(l){return l[l.length-1]}function Me(l,d){for(var y=[],v=0;v<l.length;v++)y[v]=d(l[v],v);return y}function he(l,d,y){for(var v=0,E=y(d);v<l.length&&y(l[v])<=E;)v++;l.splice(v,0,d)}function J(){}function re(l,d){var y;return Object.create?y=Object.create(l):(J.prototype=l,y=new J),d&&K(d,y),y}var fe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ht(l){return/\w/.test(l)||l>"\x80"&&(l.toUpperCase()!=l.toLowerCase()||fe.test(l))}function ke(l,d){return d?d.source.indexOf("\\w")>-1&&ht(l)?!0:d.test(l):ht(l)}function $e(l){for(var d in l)if(l.hasOwnProperty(d)&&l[d])return!1;return!0}var Fe=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function It(l){return l.charCodeAt(0)>=768&&Fe.test(l)}function ut(l,d,y){for(;(y<0?d>0:d<l.length)&&It(l.charAt(d));)d+=y;return d}function pt(l,d,y){for(var v=d>y?-1:1;;){if(d==y)return d;var E=(d+y)/2,L=v<0?Math.ceil(E):Math.floor(E);if(L==d)return l(L)?d:y;l(L)?y=L:d=L+v}}function st(l,d,y,v){if(!l)return v(d,y,"ltr",0);for(var E=!1,L=0;L<l.length;++L){var j=l[L];(j.from<y&&j.to>d||d==y&&j.to==d)&&(v(Math.max(j.from,d),Math.min(j.to,y),j.level==1?"rtl":"ltr",L),E=!0)}E||v(d,y,"ltr")}var ye=null;function xe(l,d,y){var v;ye=null;for(var E=0;E<l.length;++E){var L=l[E];if(L.from<d&&L.to>d)return E;L.to==d&&(L.from!=L.to&&y=="before"?v=E:ye=E),L.from==d&&(L.from!=L.to&&y!="before"?v=E:ye=E)}return v??ye}var We=function(){var l="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",d="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function y(ee){return ee<=247?l.charAt(ee):1424<=ee&&ee<=1524?"R":1536<=ee&&ee<=1785?d.charAt(ee-1536):1774<=ee&&ee<=2220?"r":8192<=ee&&ee<=8203?"w":ee==8204?"b":"L"}var v=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,E=/[stwN]/,L=/[LRr]/,j=/[Lb1n]/,Y=/[1n]/;function Q(ee,ce,pe){this.level=ee,this.from=ce,this.to=pe}return function(ee,ce){var pe=ce=="ltr"?"L":"R";if(ee.length==0||ce=="ltr"&&!v.test(ee))return!1;for(var Te=ee.length,Ce=[],je=0;je<Te;++je)Ce.push(y(ee.charCodeAt(je)));for(var Ke=0,ot=pe;Ke<Te;++Ke){var ct=Ce[Ke];ct=="m"?Ce[Ke]=ot:ot=ct}for(var xt=0,ft=pe;xt<Te;++xt){var St=Ce[xt];St=="1"&&ft=="r"?Ce[xt]="n":L.test(St)&&(ft=St,St=="r"&&(Ce[xt]="R"))}for(var Pt=1,Lt=Ce[0];Pt<Te-1;++Pt){var ir=Ce[Pt];ir=="+"&&Lt=="1"&&Ce[Pt+1]=="1"?Ce[Pt]="1":ir==","&&Lt==Ce[Pt+1]&&(Lt=="1"||Lt=="n")&&(Ce[Pt]=Lt),Lt=ir}for(var Rr=0;Rr<Te;++Rr){var qn=Ce[Rr];if(qn==",")Ce[Rr]="N";else if(qn=="%"){var Zr=void 0;for(Zr=Rr+1;Zr<Te&&Ce[Zr]=="%";++Zr);for(var Oi=Rr&&Ce[Rr-1]=="!"||Zr<Te&&Ce[Zr]=="1"?"1":"N",Mi=Rr;Mi<Zr;++Mi)Ce[Mi]=Oi;Rr=Zr-1}}for(var Sn=0,ni=pe;Sn<Te;++Sn){var Un=Ce[Sn];ni=="L"&&Un=="1"?Ce[Sn]="L":L.test(Un)&&(ni=Un)}for(var Ur=0;Ur<Te;++Ur)if(E.test(Ce[Ur])){var rn=void 0;for(rn=Ur+1;rn<Te&&E.test(Ce[rn]);++rn);for(var yn=(Ur?Ce[Ur-1]:pe)=="L",Ii=(rn<Te?Ce[rn]:pe)=="L",Fc=yn==Ii?yn?"L":"R":pe,yl=Ur;yl<rn;++yl)Ce[yl]=Fc;Ur=rn-1}for(var vi=[],Na,Vn=0;Vn<Te;)if(j.test(Ce[Vn])){var pv=Vn;for(++Vn;Vn<Te&&j.test(Ce[Vn]);++Vn);vi.push(new Q(0,pv,Vn))}else{var ys=Vn,yu=vi.length,bu=ce=="rtl"?1:0;for(++Vn;Vn<Te&&Ce[Vn]!="L";++Vn);for(var Li=ys;Li<Vn;)if(Y.test(Ce[Li])){ys<Li&&(vi.splice(yu,0,new Q(1,ys,Li)),yu+=bu);var Nc=Li;for(++Li;Li<Vn&&Y.test(Ce[Li]);++Li);vi.splice(yu,0,new Q(2,Nc,Li)),yu+=bu,ys=Li}else++Li;ys<Vn&&vi.splice(yu,0,new Q(1,ys,Vn))}return ce=="ltr"&&(vi[0].level==1&&(Na=ee.match(/^\s+/))&&(vi[0].from=Na[0].length,vi.unshift(new Q(0,0,Na[0].length))),Oe(vi).level==1&&(Na=ee.match(/\s+$/))&&(Oe(vi).to-=Na[0].length,vi.push(new Q(0,Te-Na[0].length,Te)))),ce=="rtl"?vi.reverse():vi}}();function bt(l,d){var y=l.order;return y==null&&(y=l.order=We(l.text,d)),y}var Gr=[],mt=function(l,d,y){if(l.addEventListener)l.addEventListener(d,y,!1);else if(l.attachEvent)l.attachEvent("on"+d,y);else{var v=l._handlers||(l._handlers={});v[d]=(v[d]||Gr).concat(y)}};function er(l,d){return l._handlers&&l._handlers[d]||Gr}function Ie(l,d,y){if(l.removeEventListener)l.removeEventListener(d,y,!1);else if(l.detachEvent)l.detachEvent("on"+d,y);else{var v=l._handlers,E=v&&v[d];if(E){var L=_e(E,y);L>-1&&(v[d]=E.slice(0,L).concat(E.slice(L+1)))}}}function Ze(l,d){var y=er(l,d);if(!!y.length)for(var v=Array.prototype.slice.call(arguments,2),E=0;E<y.length;++E)y[E].apply(null,v)}function dt(l,d,y){return typeof d=="string"&&(d={type:d,preventDefault:function(){this.defaultPrevented=!0}}),Ze(l,y||d.type,l,d),le(d)||d.codemirrorIgnore}function Zt(l){var d=l._handlers&&l._handlers.cursorActivity;if(!!d)for(var y=l.curOp.cursorActivityHandlers||(l.curOp.cursorActivityHandlers=[]),v=0;v<d.length;++v)_e(y,d[v])==-1&&y.push(d[v])}function jt(l,d){return er(l,d).length>0}function tr(l){l.prototype.on=function(d,y){mt(this,d,y)},l.prototype.off=function(d,y){Ie(this,d,y)}}function sr(l){l.preventDefault?l.preventDefault():l.returnValue=!1}function zn(l){l.stopPropagation?l.stopPropagation():l.cancelBubble=!0}function le(l){return l.defaultPrevented!=null?l.defaultPrevented:l.returnValue==!1}function de(l){sr(l),zn(l)}function Ae(l){return l.target||l.srcElement}function He(l){var d=l.which;return d==null&&(l.button&1?d=1:l.button&2?d=3:l.button&4&&(d=2)),A&&l.ctrlKey&&d==1&&(d=3),d}var lt=function(){if(a&&s<9)return!1;var l=S("div");return"draggable"in l||"dragDrop"in l}(),Qe;function Dt(l){if(Qe==null){var d=S("span","\u200B");V(l,S("span",[d,document.createTextNode("x")])),l.firstChild.offsetHeight!=0&&(Qe=d.offsetWidth<=1&&d.offsetHeight>2&&!(a&&s<8))}var y=Qe?S("span","\u200B"):S("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return y.setAttribute("cm-text",""),y}var _t;function Xt(l){if(_t!=null)return _t;var d=V(l,document.createTextNode("A\u062EA")),y=q(d,0,1).getBoundingClientRect(),v=q(d,1,2).getBoundingClientRect();return B(l),!y||y.left==y.right?!1:_t=v.right-y.right<3}var Yt=`
42
+ %o`,r,e,n),(i=window.onerror)===null||i===void 0||i.call(window,r,"",0,0,e)}logFormattedMessage(e,r,n={}){n=Object.assign({application:this},n),this.logger.groupCollapsed(`${e} #${r}`),this.logger.log("details:",Object.assign({},n)),this.logger.groupEnd()}};hGe={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},pGe={array(t){let e=JSON.parse(t);if(!Array.isArray(e))throw new TypeError("Expected array");return e},boolean(t){return!(t=="0"||t=="false")},number(t){return Number(t)},object(t){let e=JSON.parse(t);if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError("Expected object");return e},string(t){return t}},ere={default:gGe,array:tre,object:tre};Ct=class{constructor(e){this.context=e}static get shouldLoad(){return!0}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:r=this.element,detail:n={},prefix:i=this.identifier,bubbles:o=!0,cancelable:a=!0}={}){let s=i?`${i}:${e}`:e,u=new CustomEvent(s,{detail:n,bubbles:o,cancelable:a});return r.dispatchEvent(u),u}};Ct.blessings=[nGe,oGe,sGe];Ct.targets=[];Ct.values={}});var n0,Cre,w1,XR,Are,QR,_1,Tre,Dre,Ore=se(()=>{Pr();n0=class extends Ct{initialize(){this.hide()}connect(){setTimeout(()=>{this.show()},this.showAfter),this.hasDismissAfterValue&&setTimeout(()=>{this.close()},this.dismissAfterValue)}close(){this.hide(),setTimeout(()=>{this.element.remove()},this.removeAfter)}show(){this.element.classList.add(...this.showClasses),this.element.classList.remove(...this.hideClasses)}hide(){this.element.classList.add(...this.hideClasses),this.element.classList.remove(...this.showClasses)}get removeAfter(){return this.hasRemoveDelayValue?this.removeDelayValue:1100}get showAfter(){return this.hasShowDelayValue?this.showDelayValue:200}};n0.values={dismissAfter:Number,showDelay:Number,removeDelay:Number},n0.classes=["show","hide"];Cre=class extends Ct{connect(){this.timeout=null,this.duration=this.data.get("duration")||1e3}save(){clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.statusTarget.textContent="Saving...",Rails.fire(this.formTarget,"submit")},this.duration)}success(){this.setStatus("Saved!")}error(){this.setStatus("Unable to save!")}setStatus(e){this.statusTarget.textContent=e,this.timeout=setTimeout(()=>{this.statusTarget.textContent=""},2e3)}};Cre.targets=["form","status"];w1=class extends Ct{constructor(...e){super(...e),this._onMenuButtonKeydown=r=>{switch(r.keyCode){case 13:case 32:r.preventDefault(),this.toggle()}}}connect(){this.toggleClass=this.data.get("class")||"hidden",this.visibleClass=this.data.get("visibleClass")||null,this.invisibleClass=this.data.get("invisibleClass")||null,this.activeClass=this.data.get("activeClass")||null,this.enteringClass=this.data.get("enteringClass")||null,this.leavingClass=this.data.get("leavingClass")||null,this.hasButtonTarget&&this.buttonTarget.addEventListener("keydown",this._onMenuButtonKeydown),this.element.setAttribute("aria-haspopup","true")}disconnect(){this.hasButtonTarget&&this.buttonTarget.removeEventListener("keydown",this._onMenuButtonKeydown)}toggle(){this.openValue=!this.openValue}openValueChanged(){this.openValue?this._show():this._hide()}_show(e){setTimeout((()=>{this.menuTarget.classList.remove(this.toggleClass),this.element.setAttribute("aria-expanded","true"),this._enteringClassList[0].forEach((r=>{this.menuTarget.classList.add(r)}).bind(this)),this._activeClassList[0].forEach(r=>{this.activeTarget.classList.add(r)}),this._invisibleClassList[0].forEach(r=>this.menuTarget.classList.remove(r)),this._visibleClassList[0].forEach(r=>{this.menuTarget.classList.add(r)}),setTimeout((()=>{this._enteringClassList[0].forEach(r=>this.menuTarget.classList.remove(r))}).bind(this),this.enterTimeout[0]),typeof e=="function"&&e()}).bind(this))}_hide(e){setTimeout((()=>{this.element.setAttribute("aria-expanded","false"),this._invisibleClassList[0].forEach(r=>this.menuTarget.classList.add(r)),this._visibleClassList[0].forEach(r=>this.menuTarget.classList.remove(r)),this._activeClassList[0].forEach(r=>this.activeTarget.classList.remove(r)),this._leavingClassList[0].forEach(r=>this.menuTarget.classList.add(r)),setTimeout((()=>{this._leavingClassList[0].forEach(r=>this.menuTarget.classList.remove(r)),typeof e=="function"&&e(),this.menuTarget.classList.add(this.toggleClass)}).bind(this),this.leaveTimeout[0])}).bind(this))}show(){this.openValue=!0}hide(e){this.element.contains(e.target)===!1&&this.openValue&&(this.openValue=!1)}get activeTarget(){return this.data.has("activeTarget")?document.querySelector(this.data.get("activeTarget")):this.element}get _activeClassList(){return this.activeClass?this.activeClass.split(",").map(e=>e.split(" ")):[[],[]]}get _visibleClassList(){return this.visibleClass?this.visibleClass.split(",").map(e=>e.split(" ")):[[],[]]}get _invisibleClassList(){return this.invisibleClass?this.invisibleClass.split(",").map(e=>e.split(" ")):[[],[]]}get _enteringClassList(){return this.enteringClass?this.enteringClass.split(",").map(e=>e.split(" ")):[[],[]]}get _leavingClassList(){return this.leavingClass?this.leavingClass.split(",").map(e=>e.split(" ")):[[],[]]}get enterTimeout(){return(this.data.get("enterTimeout")||"0,0").split(",").map(e=>parseInt(e))}get leaveTimeout(){return(this.data.get("leaveTimeout")||"0,0").split(",").map(e=>parseInt(e))}};w1.targets=["menu","button"],w1.values={open:Boolean};XR=class extends Ct{connect(){this.toggleClass=this.data.get("class")||"hidden",this.backgroundId=this.data.get("backgroundId")||"modal-background",this.backgroundHtml=this.data.get("backgroundHtml")||this._backgroundHTML(),this.allowBackgroundClose=(this.data.get("allowBackgroundClose")||"true")==="true",this.preventDefaultActionOpening=(this.data.get("preventDefaultActionOpening")||"true")==="true",this.preventDefaultActionClosing=(this.data.get("preventDefaultActionClosing")||"true")==="true"}disconnect(){this.close()}open(e){this.preventDefaultActionOpening&&e.preventDefault(),e.target.blur&&e.target.blur(),this.lockScroll(),this.containerTarget.classList.remove(this.toggleClass),this.data.get("disable-backdrop")||(document.body.insertAdjacentHTML("beforeend",this.backgroundHtml),this.background=document.querySelector(`#${this.backgroundId}`))}close(e){e&&this.preventDefaultActionClosing&&e.preventDefault(),this.unlockScroll(),this.containerTarget.classList.add(this.toggleClass),this.background&&this.background.remove()}closeBackground(e){this.allowBackgroundClose&&e.target===this.containerTarget&&this.close(e)}closeWithKeyboard(e){e.keyCode!==27||this.containerTarget.classList.contains(this.toggleClass)||this.close(e)}_backgroundHTML(){return`<div id="${this.backgroundId}" class="fixed top-0 left-0 w-full h-full" style="background-color: ${this.backdropColorValue}; z-index: 9998;"></div>`}lockScroll(){let e=window.innerWidth-document.documentElement.clientWidth;document.body.style.paddingRight=`${e}px`,this.saveScrollPosition(),document.body.classList.add("fixed","inset-x-0","overflow-hidden"),document.body.style.top=`-${this.scrollPosition}px`}unlockScroll(){document.body.style.paddingRight=null,document.body.classList.remove("fixed","inset-x-0","overflow-hidden"),this.restoreScrollValue&&this.restoreScrollPosition(),document.body.style.top=null}saveScrollPosition(){this.scrollPosition=window.pageYOffset||document.body.scrollTop}restoreScrollPosition(){this.scrollPosition!==void 0&&(document.documentElement.scrollTop=this.scrollPosition)}};XR.targets=["container"],XR.values={backdropColor:{type:String,default:"rgba(0, 0, 0, 0.8)"},restoreScroll:{type:Boolean,default:!0}};Are=class extends Ct{connect(){this.activeTabClasses=(this.data.get("activeTab")||"active").split(" "),this.inactiveTabClasses=(this.data.get("inactiveTab")||"inactive").split(" "),this.anchor&&(this.index=this.tabTargets.findIndex(e=>e.id===this.anchor)),this.showTab()}change(e){e.preventDefault(),this.index=e.currentTarget.dataset.index?e.currentTarget.dataset.index:e.currentTarget.dataset.id?this.tabTargets.findIndex(r=>r.id==e.currentTarget.dataset.id):this.tabTargets.indexOf(e.currentTarget),window.dispatchEvent(new CustomEvent("tsc:tab-change"))}showTab(){this.tabTargets.forEach((e,r)=>{let n=this.panelTargets[r];r===this.index?(n.classList.remove("hidden"),e.classList.remove(...this.inactiveTabClasses),e.classList.add(...this.activeTabClasses),e.id&&(location.hash=e.id)):(n.classList.add("hidden"),e.classList.remove(...this.activeTabClasses),e.classList.add(...this.inactiveTabClasses))})}get index(){return parseInt(this.data.get("index")||0)}set index(e){this.data.set("index",e>=0?e:0),this.showTab()}get anchor(){return document.URL.split("#").length>1?document.URL.split("#")[1]:null}};Are.targets=["tab","panel"];QR=class extends Ct{connect(){this.toggleClass=this.data.get("class")||"hidden"}toggle(e){e.preventDefault(),this.openValue=!this.openValue}hide(e){e.preventDefault(),this.openValue=!1}show(e){e.preventDefault(),this.openValue=!0}openValueChanged(){this.toggleClass&&this.toggleableTargets.forEach(e=>{e.classList.toggle(this.toggleClass)})}};QR.targets=["toggleable"],QR.values={open:Boolean};_1=class extends Ct{initialize(){this.contentTarget.setAttribute("style",`transform:translate(${this.data.get("translateX")}, ${this.data.get("translateY")});`)}mouseOver(){this.contentTarget.classList.remove("hidden")}mouseOut(){this.contentTarget.classList.add("hidden")}};_1.targets=["content"];Tre=class extends w1{_show(){this.overlayTarget.classList.remove(this.toggleClass),super._show((()=>{this._activeClassList[1].forEach(e=>this.overlayTarget.classList.add(e)),this._invisibleClassList[1].forEach(e=>this.overlayTarget.classList.remove(e)),this._visibleClassList[1].forEach(e=>this.overlayTarget.classList.add(e)),setTimeout((()=>{this._enteringClassList[1].forEach(e=>this.overlayTarget.classList.remove(e))}).bind(this),this.enterTimeout[1])}).bind(this))}_hide(){this._leavingClassList[1].forEach(e=>this.overlayTarget.classList.add(e)),super._hide((()=>{setTimeout((()=>{this._visibleClassList[1].forEach(e=>this.overlayTarget.classList.remove(e)),this._invisibleClassList[1].forEach(e=>this.overlayTarget.classList.add(e)),this._activeClassList[1].forEach(e=>this.overlayTarget.classList.remove(e)),this._leavingClassList[1].forEach(e=>this.overlayTarget.classList.remove(e)),this.overlayTarget.classList.add(this.toggleClass)}).bind(this),this.leaveTimeout[1])}).bind(this))}};Tre.targets=["menu","overlay"];Dre=class extends Ct{connect(){this.styleProperty=this.data.get("style")||"backgroundColor"}update(){this.preview=this.color}set preview(e){this.previewTarget.style[this.styleProperty]=e;let r=this._getContrastYIQ(e);this.styleProperty==="color"?this.previewTarget.style.backgroundColor=r:this.previewTarget.style.color=r}get color(){return this.colorTarget.value}_getContrastYIQ(e){return e=e.replace("#",""),(299*parseInt(e.substr(0,2),16)+587*parseInt(e.substr(2,2),16)+114*parseInt(e.substr(4,2),16))/1e3>=128?"#000":"#fff"}};Dre.targets=["preview","color"]});var mr,Mre=se(()=>{Ore();Pr();mr=r0.start();mr.debug=window==null?void 0:window.localStorage.getItem("avo.debug");window.Stimulus=mr;mr.register("alert",n0);mr.register("popover",_1)});var Mo,Qg=se(()=>{Mo=t=>t=="true"});var S1,Ire=se(()=>{Pr();Qg();S1=class extends Ct{connect(){this.resourceIdsTarget.value=this.resourceIds,this.selectionOptions.itemSelectAllSelectedAllValue==="true"&&(this.selectedAllQueryTarget.value=this.selectionOptions.itemSelectAllSelectedAllQueryValue),this.noConfirmation?this.formTarget.submit():this.controllerDivTarget.classList.remove("hidden")}get noConfirmation(){return Mo(this.controllerDivTarget.dataset.noConfirmation)}get resourceName(){return this.controllerDivTarget.dataset.resourceName}get resourceIds(){try{return JSON.parse(this.selectionOptions.selectedResources)}catch(t){return[]}}get selectionOptions(){try{return document.querySelector(`[data-selected-resources-name="${this.resourceName}"]`).dataset}catch(t){return[]}}};vt(S1,"targets",["controllerDiv","resourceIds","form","selectedAllQuery"])});var Lre,ZR=se(()=>{Lre=function(){function t(e,r){var n=this;this.element=e,this.started=!1,this.delegate=r,this.elements=new Set,this.mutationObserver=new MutationObserver(function(i){return n.processMutations(i)})}return t.prototype.start=function(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,childList:!0,subtree:!0}),this.refresh())},t.prototype.stop=function(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)},t.prototype.refresh=function(){if(this.started){for(var e=new Set(this.matchElementsInTree()),r=0,n=Array.from(this.elements);r<n.length;r++){var i=n[r];e.has(i)||this.removeElement(i)}for(var o=0,a=Array.from(e);o<a.length;o++){var i=a[o];this.addElement(i)}}},t.prototype.processMutations=function(e){if(this.started)for(var r=0,n=e;r<n.length;r++){var i=n[r];this.processMutation(i)}},t.prototype.processMutation=function(e){e.type=="attributes"?this.processAttributeChange(e.target,e.attributeName):e.type=="childList"&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))},t.prototype.processAttributeChange=function(e,r){var n=e;this.elements.has(n)?this.delegate.elementAttributeChanged&&this.matchElement(n)?this.delegate.elementAttributeChanged(n,r):this.removeElement(n):this.matchElement(n)&&this.addElement(n)},t.prototype.processRemovedNodes=function(e){for(var r=0,n=Array.from(e);r<n.length;r++){var i=n[r],o=this.elementFromNode(i);o&&this.processTree(o,this.removeElement)}},t.prototype.processAddedNodes=function(e){for(var r=0,n=Array.from(e);r<n.length;r++){var i=n[r],o=this.elementFromNode(i);o&&this.elementIsActive(o)&&this.processTree(o,this.addElement)}},t.prototype.matchElement=function(e){return this.delegate.matchElement(e)},t.prototype.matchElementsInTree=function(e){return e===void 0&&(e=this.element),this.delegate.matchElementsInTree(e)},t.prototype.processTree=function(e,r){for(var n=0,i=this.matchElementsInTree(e);n<i.length;n++){var o=i[n];r.call(this,o)}},t.prototype.elementFromNode=function(e){if(e.nodeType==Node.ELEMENT_NODE)return e},t.prototype.elementIsActive=function(e){return e.isConnected!=this.element.isConnected?!1:this.element.contains(e)},t.prototype.addElement=function(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))},t.prototype.removeElement=function(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))},t}()});var Zg,JR=se(()=>{ZR();Zg=function(){function t(e,r,n){this.attributeName=r,this.delegate=n,this.elementObserver=new Lre(e,this)}return Object.defineProperty(t.prototype,"element",{get:function(){return this.elementObserver.element},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selector",{get:function(){return"["+this.attributeName+"]"},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.elementObserver.start()},t.prototype.stop=function(){this.elementObserver.stop()},t.prototype.refresh=function(){this.elementObserver.refresh()},Object.defineProperty(t.prototype,"started",{get:function(){return this.elementObserver.started},enumerable:!1,configurable:!0}),t.prototype.matchElement=function(e){return e.hasAttribute(this.attributeName)},t.prototype.matchElementsInTree=function(e){var r=this.matchElement(e)?[e]:[],n=Array.from(e.querySelectorAll(this.selector));return r.concat(n)},t.prototype.elementMatched=function(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)},t.prototype.elementUnmatched=function(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)},t.prototype.elementAttributeChanged=function(e,r){this.delegate.elementAttributeValueChanged&&this.attributeName==r&&this.delegate.elementAttributeValueChanged(e,r)},t}()});var S1t,Pre=se(()=>{S1t=function(){function t(e,r){var n=this;this.element=e,this.delegate=r,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(function(i){return n.processMutations(i)})}return t.prototype.start=function(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0}),this.refresh())},t.prototype.stop=function(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)},t.prototype.refresh=function(){if(this.started)for(var e=0,r=this.knownAttributeNames;e<r.length;e++){var n=r[e];this.refreshAttribute(n)}},t.prototype.processMutations=function(e){if(this.started)for(var r=0,n=e;r<n.length;r++){var i=n[r];this.processMutation(i)}},t.prototype.processMutation=function(e){var r=e.attributeName;r&&this.refreshAttribute(r)},t.prototype.refreshAttribute=function(e){var r=this.delegate.getStringMapKeyForAttribute(e);if(r!=null){this.stringMap.has(e)||this.stringMapKeyAdded(r,e);var n=this.element.getAttribute(e);this.stringMap.get(e)!=n&&this.stringMapValueChanged(n,r),n==null?(this.stringMap.delete(e),this.stringMapKeyRemoved(r,e)):this.stringMap.set(e,n)}},t.prototype.stringMapKeyAdded=function(e,r){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,r)},t.prototype.stringMapValueChanged=function(e,r){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,r)},t.prototype.stringMapKeyRemoved=function(e,r){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,r)},Object.defineProperty(t.prototype,"knownAttributeNames",{get:function(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentAttributeNames",{get:function(){return Array.from(this.element.attributes).map(function(e){return e.name})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"recordedAttributeNames",{get:function(){return Array.from(this.stringMap.keys())},enumerable:!1,configurable:!0}),t}()});function k1(t,e,r){Rre(t,e).add(r)}function E1(t,e,r){Rre(t,e).delete(r),mGe(t,e)}function Rre(t,e){var r=t.get(e);return r||(r=new Set,t.set(e,r)),r}function mGe(t,e){var r=t.get(e);r!=null&&r.size==0&&t.delete(e)}var C1=se(()=>{});var A1,eq=se(()=>{C1();A1=function(){function t(){this.valuesByKey=new Map}return Object.defineProperty(t.prototype,"values",{get:function(){var e=Array.from(this.valuesByKey.values());return e.reduce(function(r,n){return r.concat(Array.from(n))},[])},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var e=Array.from(this.valuesByKey.values());return e.reduce(function(r,n){return r+n.size},0)},enumerable:!1,configurable:!0}),t.prototype.add=function(e,r){k1(this.valuesByKey,e,r)},t.prototype.delete=function(e,r){E1(this.valuesByKey,e,r)},t.prototype.has=function(e,r){var n=this.valuesByKey.get(e);return n!=null&&n.has(r)},t.prototype.hasKey=function(e){return this.valuesByKey.has(e)},t.prototype.hasValue=function(e){var r=Array.from(this.valuesByKey.values());return r.some(function(n){return n.has(e)})},t.prototype.getValuesForKey=function(e){var r=this.valuesByKey.get(e);return r?Array.from(r):[]},t.prototype.getKeysForValue=function(e){return Array.from(this.valuesByKey).filter(function(r){var n=r[0],i=r[1];return i.has(e)}).map(function(r){var n=r[0],i=r[1];return n})},t}()});var vGe,O1t,qre=se(()=>{eq();C1();vGe=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),O1t=function(t){vGe(e,t);function e(){var r=t.call(this)||this;return r.keysByValue=new Map,r}return Object.defineProperty(e.prototype,"values",{get:function(){return Array.from(this.keysByValue.keys())},enumerable:!1,configurable:!0}),e.prototype.add=function(r,n){t.prototype.add.call(this,r,n),k1(this.keysByValue,n,r)},e.prototype.delete=function(r,n){t.prototype.delete.call(this,r,n),E1(this.keysByValue,n,r)},e.prototype.hasValue=function(r){return this.keysByValue.has(r)},e.prototype.getKeysForValue=function(r){var n=this.keysByValue.get(r);return n?Array.from(n):[]},e}(A1)});var Fre=se(()=>{qre();eq();C1()});function yGe(t,e,r){return t.trim().split(/\s+/).filter(function(n){return n.length}).map(function(n,i){return{element:e,attributeName:r,content:n,index:i}})}function bGe(t,e){var r=Math.max(t.length,e.length);return Array.from({length:r},function(n,i){return[t[i],e[i]]})}function xGe(t,e){return t&&e&&t.index==e.index&&t.content==e.content}var Nre,tq=se(()=>{JR();Fre();Nre=function(){function t(e,r,n){this.attributeObserver=new Zg(e,r,this),this.delegate=n,this.tokensByElement=new A1}return Object.defineProperty(t.prototype,"started",{get:function(){return this.attributeObserver.started},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.attributeObserver.start()},t.prototype.stop=function(){this.attributeObserver.stop()},t.prototype.refresh=function(){this.attributeObserver.refresh()},Object.defineProperty(t.prototype,"element",{get:function(){return this.attributeObserver.element},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributeName",{get:function(){return this.attributeObserver.attributeName},enumerable:!1,configurable:!0}),t.prototype.elementMatchedAttribute=function(e){this.tokensMatched(this.readTokensForElement(e))},t.prototype.elementAttributeValueChanged=function(e){var r=this.refreshTokensForElement(e),n=r[0],i=r[1];this.tokensUnmatched(n),this.tokensMatched(i)},t.prototype.elementUnmatchedAttribute=function(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))},t.prototype.tokensMatched=function(e){var r=this;e.forEach(function(n){return r.tokenMatched(n)})},t.prototype.tokensUnmatched=function(e){var r=this;e.forEach(function(n){return r.tokenUnmatched(n)})},t.prototype.tokenMatched=function(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)},t.prototype.tokenUnmatched=function(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)},t.prototype.refreshTokensForElement=function(e){var r=this.tokensByElement.getValuesForKey(e),n=this.readTokensForElement(e),i=bGe(r,n).findIndex(function(o){var a=o[0],s=o[1];return!xGe(a,s)});return i==-1?[[],[]]:[r.slice(i),n.slice(i)]},t.prototype.readTokensForElement=function(e){var r=this.attributeName,n=e.getAttribute(r)||"";return yGe(n,e,r)},t}()});var j1t,Bre=se(()=>{tq();j1t=function(){function t(e,r,n){this.tokenListObserver=new Nre(e,r,this),this.delegate=n,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}return Object.defineProperty(t.prototype,"started",{get:function(){return this.tokenListObserver.started},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.tokenListObserver.start()},t.prototype.stop=function(){this.tokenListObserver.stop()},t.prototype.refresh=function(){this.tokenListObserver.refresh()},Object.defineProperty(t.prototype,"element",{get:function(){return this.tokenListObserver.element},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributeName",{get:function(){return this.tokenListObserver.attributeName},enumerable:!1,configurable:!0}),t.prototype.tokenMatched=function(e){var r=e.element,n=this.fetchParseResultForToken(e).value;n&&(this.fetchValuesByTokenForElement(r).set(e,n),this.delegate.elementMatchedValue(r,n))},t.prototype.tokenUnmatched=function(e){var r=e.element,n=this.fetchParseResultForToken(e).value;n&&(this.fetchValuesByTokenForElement(r).delete(e),this.delegate.elementUnmatchedValue(r,n))},t.prototype.fetchParseResultForToken=function(e){var r=this.parseResultsByToken.get(e);return r||(r=this.parseToken(e),this.parseResultsByToken.set(e,r)),r},t.prototype.fetchValuesByTokenForElement=function(e){var r=this.valuesByTokenByElement.get(e);return r||(r=new Map,this.valuesByTokenByElement.set(e,r)),r},t.prototype.parseToken=function(e){try{var r=this.delegate.parseValueForToken(e);return{value:r}}catch(n){return{error:n}}},t}()});var rq=se(()=>{JR();ZR();Pre();tq();Bre()});var i0,jre=se(()=>{rq();Pr();i0=class extends Ct{constructor(){super(...arguments);vt(this,"target",{})}get targetIsDisabled(){return this.target.dataset.disabled==="true"}enableTarget(){this.targetIsDisabled&&(this.target.classList.remove(...this.disabledClasses),this.target.classList.add(...this.enabledClasses),this.target.dataset.disabled=!1)}disableTarget(){this.target.classList.remove(...this.enabledClasses),this.target.classList.add(...this.disabledClasses),this.target.dataset.disabled=!0}visitAction(t){if(this.target=t.target,this.targetIsDisabled){t.preventDefault();return}this.disableTarget();let e=new Zg(document.querySelector("turbo-frame#actions_show"),"busy",{elementUnmatchedAttribute:()=>{this.enableTarget(this.target),e&&e.stop()}});e.start()}};vt(i0,"targets",["resourceAction","standaloneAction"]),vt(i0,"classes",["enabled","disabled"])});var T1,zre=se(()=>{Pr();T1=class extends Ct{connect(){this.formTarget.submit()}};vt(T1,"targets",["form"])});var D1,Hre=se(()=>{Pr();D1=class extends Ct{constructor(){super(...arguments);vt(this,"defaults",{})}get selectedType(){return this.selectTarget.value}get isSearchable(){return this.context.scope.element.dataset.searchable==="true"}get association(){return this.context.scope.element.dataset.association}get associationClass(){return this.context.scope.element.dataset.associationClass}connect(){this.copyValidNames(),this.changeType()}changeType(){this.hideAllTypes(),this.showType(this.selectTarget.value)}hideAllTypes(){this.typeTargets.forEach(t=>{t.classList.add("hidden"),this.invalidateTarget(t)})}copyValidNames(){this.typeTargets.forEach(t=>{let{type:e}=t.dataset;if(this.isSearchable){let r=t.querySelector('input[type="text"]');r&&this.nameToValidName(r);let n=t.querySelector('input[type="hidden"]');n&&this.nameToValidName(n)}else{let r=t.querySelector("select");r&&this.nameToValidName(r);let n=t.querySelector('input[type="hidden"]');n&&this.nameToValidName(n),this.selectedType!==e&&(r.selectedIndex=0)}})}showType(t){let e=this.typeTargets.find(r=>r.dataset.type===t);e&&(e.classList.remove("hidden"),this.validateTarget(e))}validateTarget(t){if(this.isSearchable){let e=t.querySelector('input[type="text"]'),r=t.querySelector('input[type="hidden"]');this.validNameToName(e),this.validNameToName(r)}else{let e=t.querySelector("select"),r=t.querySelector('input[type="hidden"]');this.validNameToName(e),r&&this.validNameToName(r)}}invalidateTarget(t){if(this.isSearchable)try{t.querySelector('input[type="text"]').setAttribute("name",""),t.querySelector('input[type="hidden"]').setAttribute("name","")}catch(e){}else if(t)try{t.querySelector("select").setAttribute("name",""),t.querySelector('input[type="hidden"]').setAttribute("name","")}catch(e){}}validNameToName(t){t.setAttribute("name",t.getAttribute("valid-name"))}nameToValidName(t){t.setAttribute("valid-name",t.getAttribute("name"))}};vt(D1,"targets",["select","type","loadAssociationLink"])});var Wre=Z((Jg,em)=>{(function(t){var e=typeof Jg=="object"&&Jg&&!Jg.nodeType&&Jg,r=typeof em=="object"&&em&&!em.nodeType&&em,n=typeof global=="object"&&global;(n.global===n||n.window===n||n.self===n)&&(t=n);var i,o=2147483647,a=36,s=1,u=26,c=38,f=700,p=72,g=128,m="-",x=/^xn--/,w=/[^\x20-\x7E]/,T=/[\x2E\u3002\uFF0E\uFF61]/g,k={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=a-s,D=Math.floor,M=String.fromCharCode,P;function _(X){throw new RangeError(k[X])}function C(X,oe){for(var G=X.length,K=[];G--;)K[G]=oe(X[G]);return K}function O(X,oe){var G=X.split("@"),K="";G.length>1&&(K=G[0]+"@",X=G[1]),X=X.replace(T,".");var ve=X.split("."),Se=C(ve,oe).join(".");return K+Se}function F(X){for(var oe=[],G=0,K=X.length,ve,Se;G<K;)ve=X.charCodeAt(G++),ve>=55296&&ve<=56319&&G<K?(Se=X.charCodeAt(G++),(Se&64512)==56320?oe.push(((ve&1023)<<10)+(Se&1023)+65536):(oe.push(ve),G--)):oe.push(ve);return oe}function B(X){return C(X,function(oe){var G="";return oe>65535&&(oe-=65536,G+=M(oe>>>10&1023|55296),oe=56320|oe&1023),G+=M(oe),G}).join("")}function V(X){return X-48<10?X-22:X-65<26?X-65:X-97<26?X-97:a}function S(X,oe){return X+22+75*(X<26)-((oe!=0)<<5)}function R(X,oe,G){var K=0;for(X=G?D(X/f):X>>1,X+=D(X/oe);X>A*u>>1;K+=a)X=D(X/A);return D(K+(A+1)*X/(X+c))}function q(X){var oe=[],G=X.length,K,ve=0,Se=g,_e=p,Ne,Le,it,ze,tt,wt,At,Ve,Oe;for(Ne=X.lastIndexOf(m),Ne<0&&(Ne=0),Le=0;Le<Ne;++Le)X.charCodeAt(Le)>=128&&_("not-basic"),oe.push(X.charCodeAt(Le));for(it=Ne>0?Ne+1:0;it<G;){for(ze=ve,tt=1,wt=a;it>=G&&_("invalid-input"),At=V(X.charCodeAt(it++)),(At>=a||At>D((o-ve)/tt))&&_("overflow"),ve+=At*tt,Ve=wt<=_e?s:wt>=_e+u?u:wt-_e,!(At<Ve);wt+=a)Oe=a-Ve,tt>D(o/Oe)&&_("overflow"),tt*=Oe;K=oe.length+1,_e=R(ve-ze,K,ze==0),D(ve/K)>o-Se&&_("overflow"),Se+=D(ve/K),ve%=K,oe.splice(ve++,0,Se)}return B(oe)}function W(X){var oe,G,K,ve,Se,_e,Ne,Le,it,ze,tt,wt=[],At,Ve,Oe,Me;for(X=F(X),At=X.length,oe=g,G=0,Se=p,_e=0;_e<At;++_e)tt=X[_e],tt<128&&wt.push(M(tt));for(K=ve=wt.length,ve&&wt.push(m);K<At;){for(Ne=o,_e=0;_e<At;++_e)tt=X[_e],tt>=oe&&tt<Ne&&(Ne=tt);for(Ve=K+1,Ne-oe>D((o-G)/Ve)&&_("overflow"),G+=(Ne-oe)*Ve,oe=Ne,_e=0;_e<At;++_e)if(tt=X[_e],tt<oe&&++G>o&&_("overflow"),tt==oe){for(Le=G,it=a;ze=it<=Se?s:it>=Se+u?u:it-Se,!(Le<ze);it+=a)Me=Le-ze,Oe=a-ze,wt.push(M(S(ze+Me%Oe,0))),Le=D(Me/Oe);wt.push(M(S(Le,0))),Se=R(G,Ve,K==ve),G=0,++K}++G,++oe}return wt.join("")}function N(X){return O(X,function(oe){return x.test(oe)?q(oe.slice(4).toLowerCase()):oe})}function z(X){return O(X,function(oe){return w.test(oe)?"xn--"+W(oe):oe})}if(i={version:"1.3.2",ucs2:{decode:F,encode:B},decode:q,encode:W,toASCII:z,toUnicode:N},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return i});else if(e&&r)if(em.exports==e)r.exports=i;else for(P in i)i.hasOwnProperty(P)&&(e[P]=i[P]);else t.punycode=i})(Jg)});var Vre=Z((Ure,O1)=>{(function(t,e){"use strict";typeof O1=="object"&&O1.exports?O1.exports=e():typeof define=="function"&&define.amd?define(e):t.IPv6=e(t)})(Ure,function(t){"use strict";var e=t&&t.IPv6;function r(i){var o=i.toLowerCase(),a=o.split(":"),s=a.length,u=8;a[0]===""&&a[1]===""&&a[2]===""?(a.shift(),a.shift()):a[0]===""&&a[1]===""?a.shift():a[s-1]===""&&a[s-2]===""&&a.pop(),s=a.length,a[s-1].indexOf(".")!==-1&&(u=7);var c;for(c=0;c<s&&a[c]!=="";c++);if(c<u)for(a.splice(c,1,"0000");a.length<u;)a.splice(c,0,"0000");for(var f,p=0;p<u;p++){f=a[p].split("");for(var g=0;g<3&&(f[0]==="0"&&f.length>1);g++)f.splice(0,1);a[p]=f.join("")}var m=-1,x=0,w=0,T=-1,k=!1;for(p=0;p<u;p++)k?a[p]==="0"?w+=1:(k=!1,w>x&&(m=T,x=w)):a[p]==="0"&&(k=!0,T=p,w=1);w>x&&(m=T,x=w),x>1&&a.splice(m,x,""),s=a.length;var A="";for(a[0]===""&&(A=":"),p=0;p<s&&(A+=a[p],p!==s-1);p++)A+=":";return a[s-1]===""&&(A+=":"),A}function n(){return t.IPv6===this&&(t.IPv6=e),this}return{best:r,noConflict:n}})});var Yre=Z(($re,M1)=>{(function(t,e){"use strict";typeof M1=="object"&&M1.exports?M1.exports=e():typeof define=="function"&&define.amd?define(e):t.SecondLevelDomains=e(t)})($re,function(t){"use strict";var e=t&&t.SecondLevelDomains,r={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(n){var i=n.lastIndexOf(".");if(i<=0||i>=n.length-1)return!1;var o=n.lastIndexOf(".",i-1);if(o<=0||o>=i-1)return!1;var a=r.list[n.slice(i+1)];return a?a.indexOf(" "+n.slice(o+1,i)+" ")>=0:!1},is:function(n){var i=n.lastIndexOf(".");if(i<=0||i>=n.length-1)return!1;var o=n.lastIndexOf(".",i-1);if(o>=0)return!1;var a=r.list[n.slice(i+1)];return a?a.indexOf(" "+n.slice(0,i)+" ")>=0:!1},get:function(n){var i=n.lastIndexOf(".");if(i<=0||i>=n.length-1)return null;var o=n.lastIndexOf(".",i-1);if(o<=0||o>=i-1)return null;var a=r.list[n.slice(i+1)];return!a||a.indexOf(" "+n.slice(o+1,i)+" ")<0?null:n.slice(o+1)},noConflict:function(){return t.SecondLevelDomains===this&&(t.SecondLevelDomains=e),this}};return r})});var L1=Z((Kre,I1)=>{(function(t,e){"use strict";typeof I1=="object"&&I1.exports?I1.exports=e(Wre(),Vre(),Yre()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],e):t.URI=e(t.punycode,t.IPv6,t.SecondLevelDomains,t)})(Kre,function(t,e,r,n){"use strict";var i=n&&n.URI;function o(S,R){var q=arguments.length>=1,W=arguments.length>=2;if(!(this instanceof o))return q?W?new o(S,R):new o(S):new o;if(S===void 0){if(q)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?S=location.href+"":S=""}if(S===null&&q)throw new TypeError("null is not a valid argument for URI");return this.href(S),R!==void 0?this.absoluteTo(R):this}function a(S){return/^[0-9]+$/.test(S)}o.version="1.19.11";var s=o.prototype,u=Object.prototype.hasOwnProperty;function c(S){return S.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(S){return S===void 0?"Undefined":String(Object.prototype.toString.call(S)).slice(8,-1)}function p(S){return f(S)==="Array"}function g(S,R){var q={},W,N;if(f(R)==="RegExp")q=null;else if(p(R))for(W=0,N=R.length;W<N;W++)q[R[W]]=!0;else q[R]=!0;for(W=0,N=S.length;W<N;W++){var z=q&&q[S[W]]!==void 0||!q&&R.test(S[W]);z&&(S.splice(W,1),N--,W--)}return S}function m(S,R){var q,W;if(p(R)){for(q=0,W=R.length;q<W;q++)if(!m(S,R[q]))return!1;return!0}var N=f(R);for(q=0,W=S.length;q<W;q++)if(N==="RegExp"){if(typeof S[q]=="string"&&S[q].match(R))return!0}else if(S[q]===R)return!0;return!1}function x(S,R){if(!p(S)||!p(R)||S.length!==R.length)return!1;S.sort(),R.sort();for(var q=0,W=S.length;q<W;q++)if(S[q]!==R[q])return!1;return!0}function w(S){var R=/^\/+|\/+$/g;return S.replace(R,"")}o._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:o.preventInvalidHostname,duplicateQueryParameters:o.duplicateQueryParameters,escapeQuerySpace:o.escapeQuerySpace}},o.preventInvalidHostname=!1,o.duplicateQueryParameters=!1,o.escapeQuerySpace=!0,o.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,o.idn_expression=/[^a-z0-9\._-]/i,o.punycode_expression=/(xn--)/i,o.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,o.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,o.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,o.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},o.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,o.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},o.hostProtocols=["http","https"],o.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,o.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},o.getDomAttribute=function(S){if(!(!S||!S.nodeName)){var R=S.nodeName.toLowerCase();if(!(R==="input"&&S.type!=="image"))return o.domAttributes[R]}};function T(S){return escape(S)}function k(S){return encodeURIComponent(S).replace(/[!'()*]/g,T).replace(/\*/g,"%2A")}o.encode=k,o.decode=decodeURIComponent,o.iso8859=function(){o.encode=escape,o.decode=unescape},o.unicode=function(){o.encode=k,o.decode=decodeURIComponent},o.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},o.encodeQuery=function(S,R){var q=o.encode(S+"");return R===void 0&&(R=o.escapeQuerySpace),R?q.replace(/%20/g,"+"):q},o.decodeQuery=function(S,R){S+="",R===void 0&&(R=o.escapeQuerySpace);try{return o.decode(R?S.replace(/\+/g,"%20"):S)}catch{return S}};var A={encode:"encode",decode:"decode"},D,M=function(S,R){return function(q){try{return o[R](q+"").replace(o.characters[S][R].expression,function(W){return o.characters[S][R].map[W]})}catch{return q}}};for(D in A)o[D+"PathSegment"]=M("pathname",A[D]),o[D+"UrnPathSegment"]=M("urnpath",A[D]);var P=function(S,R,q){return function(W){var N;q?N=function(G){return o[R](o[q](G))}:N=o[R];for(var z=(W+"").split(S),X=0,oe=z.length;X<oe;X++)z[X]=N(z[X]);return z.join(S)}};o.decodePath=P("/","decodePathSegment"),o.decodeUrnPath=P(":","decodeUrnPathSegment"),o.recodePath=P("/","encodePathSegment","decode"),o.recodeUrnPath=P(":","encodeUrnPathSegment","decode"),o.encodeReserved=M("reserved","encode"),o.parse=function(S,R){var q;return R||(R={preventInvalidHostname:o.preventInvalidHostname}),S=S.replace(o.leading_whitespace_expression,""),S=S.replace(o.ascii_tab_whitespace,""),q=S.indexOf("#"),q>-1&&(R.fragment=S.substring(q+1)||null,S=S.substring(0,q)),q=S.indexOf("?"),q>-1&&(R.query=S.substring(q+1)||null,S=S.substring(0,q)),S=S.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),S=S.replace(/^[/\\]{2,}/i,"//"),S.substring(0,2)==="//"?(R.protocol=null,S=S.substring(2),S=o.parseAuthority(S,R)):(q=S.indexOf(":"),q>-1&&(R.protocol=S.substring(0,q)||null,R.protocol&&!R.protocol.match(o.protocol_expression)?R.protocol=void 0:S.substring(q+1,q+3).replace(/\\/g,"/")==="//"?(S=S.substring(q+3),S=o.parseAuthority(S,R)):(S=S.substring(q+1),R.urn=!0))),R.path=S,R},o.parseHost=function(S,R){S||(S=""),S=S.replace(/\\/g,"/");var q=S.indexOf("/"),W,N;if(q===-1&&(q=S.length),S.charAt(0)==="[")W=S.indexOf("]"),R.hostname=S.substring(1,W)||null,R.port=S.substring(W+2,q)||null,R.port==="/"&&(R.port=null);else{var z=S.indexOf(":"),X=S.indexOf("/"),oe=S.indexOf(":",z+1);oe!==-1&&(X===-1||oe<X)?(R.hostname=S.substring(0,q)||null,R.port=null):(N=S.substring(0,q).split(":"),R.hostname=N[0]||null,R.port=N[1]||null)}return R.hostname&&S.substring(q).charAt(0)!=="/"&&(q++,S="/"+S),R.preventInvalidHostname&&o.ensureValidHostname(R.hostname,R.protocol),R.port&&o.ensureValidPort(R.port),S.substring(q)||"/"},o.parseAuthority=function(S,R){return S=o.parseUserinfo(S,R),o.parseHost(S,R)},o.parseUserinfo=function(S,R){var q=S,W=S.indexOf("\\");W!==-1&&(S=S.replace(/\\/g,"/"));var N=S.indexOf("/"),z=S.lastIndexOf("@",N>-1?N:S.length-1),X;return z>-1&&(N===-1||z<N)?(X=S.substring(0,z).split(":"),R.username=X[0]?o.decode(X[0]):null,X.shift(),R.password=X[0]?o.decode(X.join(":")):null,S=q.substring(z+1)):(R.username=null,R.password=null),S},o.parseQuery=function(S,R){if(!S)return{};if(S=S.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!S)return{};for(var q={},W=S.split("&"),N=W.length,z,X,oe,G=0;G<N;G++)z=W[G].split("="),X=o.decodeQuery(z.shift(),R),oe=z.length?o.decodeQuery(z.join("="),R):null,X!=="__proto__"&&(u.call(q,X)?((typeof q[X]=="string"||q[X]===null)&&(q[X]=[q[X]]),q[X].push(oe)):q[X]=oe);return q},o.build=function(S){var R="",q=!1;return S.protocol&&(R+=S.protocol+":"),!S.urn&&(R||S.hostname)&&(R+="//",q=!0),R+=o.buildAuthority(S)||"",typeof S.path=="string"&&(S.path.charAt(0)!=="/"&&q&&(R+="/"),R+=S.path),typeof S.query=="string"&&S.query&&(R+="?"+S.query),typeof S.fragment=="string"&&S.fragment&&(R+="#"+S.fragment),R},o.buildHost=function(S){var R="";if(S.hostname)o.ip6_expression.test(S.hostname)?R+="["+S.hostname+"]":R+=S.hostname;else return"";return S.port&&(R+=":"+S.port),R},o.buildAuthority=function(S){return o.buildUserinfo(S)+o.buildHost(S)},o.buildUserinfo=function(S){var R="";return S.username&&(R+=o.encode(S.username)),S.password&&(R+=":"+o.encode(S.password)),R&&(R+="@"),R},o.buildQuery=function(S,R,q){var W="",N,z,X,oe;for(z in S)if(z!=="__proto__"&&u.call(S,z))if(p(S[z]))for(N={},X=0,oe=S[z].length;X<oe;X++)S[z][X]!==void 0&&N[S[z][X]+""]===void 0&&(W+="&"+o.buildQueryParameter(z,S[z][X],q),R!==!0&&(N[S[z][X]+""]=!0));else S[z]!==void 0&&(W+="&"+o.buildQueryParameter(z,S[z],q));return W.substring(1)},o.buildQueryParameter=function(S,R,q){return o.encodeQuery(S,q)+(R!==null?"="+o.encodeQuery(R,q):"")},o.addQuery=function(S,R,q){if(typeof R=="object")for(var W in R)u.call(R,W)&&o.addQuery(S,W,R[W]);else if(typeof R=="string"){if(S[R]===void 0){S[R]=q;return}else typeof S[R]=="string"&&(S[R]=[S[R]]);p(q)||(q=[q]),S[R]=(S[R]||[]).concat(q)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},o.setQuery=function(S,R,q){if(typeof R=="object")for(var W in R)u.call(R,W)&&o.setQuery(S,W,R[W]);else if(typeof R=="string")S[R]=q===void 0?null:q;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},o.removeQuery=function(S,R,q){var W,N,z;if(p(R))for(W=0,N=R.length;W<N;W++)S[R[W]]=void 0;else if(f(R)==="RegExp")for(z in S)R.test(z)&&(S[z]=void 0);else if(typeof R=="object")for(z in R)u.call(R,z)&&o.removeQuery(S,z,R[z]);else if(typeof R=="string")q!==void 0?f(q)==="RegExp"?!p(S[R])&&q.test(S[R])?S[R]=void 0:S[R]=g(S[R],q):S[R]===String(q)&&(!p(q)||q.length===1)?S[R]=void 0:p(S[R])&&(S[R]=g(S[R],q)):S[R]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},o.hasQuery=function(S,R,q,W){switch(f(R)){case"String":break;case"RegExp":for(var N in S)if(u.call(S,N)&&R.test(N)&&(q===void 0||o.hasQuery(S,N,q)))return!0;return!1;case"Object":for(var z in R)if(u.call(R,z)&&!o.hasQuery(S,z,R[z]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(q)){case"Undefined":return R in S;case"Boolean":var X=Boolean(p(S[R])?S[R].length:S[R]);return q===X;case"Function":return!!q(S[R],R,S);case"Array":if(!p(S[R]))return!1;var oe=W?m:x;return oe(S[R],q);case"RegExp":return p(S[R])?W?m(S[R],q):!1:Boolean(S[R]&&S[R].match(q));case"Number":q=String(q);case"String":return p(S[R])?W?m(S[R],q):!1:S[R]===q;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},o.joinPaths=function(){for(var S=[],R=[],q=0,W=0;W<arguments.length;W++){var N=new o(arguments[W]);S.push(N);for(var z=N.segment(),X=0;X<z.length;X++)typeof z[X]=="string"&&R.push(z[X]),z[X]&&q++}if(!R.length||!q)return new o("");var oe=new o("").segment(R);return(S[0].path()===""||S[0].path().slice(0,1)==="/")&&oe.path("/"+oe.path()),oe.normalize()},o.commonPath=function(S,R){var q=Math.min(S.length,R.length),W;for(W=0;W<q;W++)if(S.charAt(W)!==R.charAt(W)){W--;break}return W<1?S.charAt(0)===R.charAt(0)&&S.charAt(0)==="/"?"/":"":((S.charAt(W)!=="/"||R.charAt(W)!=="/")&&(W=S.substring(0,W).lastIndexOf("/")),S.substring(0,W+1))},o.withinString=function(S,R,q){q||(q={});var W=q.start||o.findUri.start,N=q.end||o.findUri.end,z=q.trim||o.findUri.trim,X=q.parens||o.findUri.parens,oe=/[a-z0-9-]=["']?$/i;for(W.lastIndex=0;;){var G=W.exec(S);if(!G)break;var K=G.index;if(q.ignoreHtml){var ve=S.slice(Math.max(K-3,0),K);if(ve&&oe.test(ve))continue}for(var Se=K+S.slice(K).search(N),_e=S.slice(K,Se),Ne=-1;;){var Le=X.exec(_e);if(!Le)break;var it=Le.index+Le[0].length;Ne=Math.max(Ne,it)}if(Ne>-1?_e=_e.slice(0,Ne)+_e.slice(Ne).replace(z,""):_e=_e.replace(z,""),!(_e.length<=G[0].length)&&!(q.ignore&&q.ignore.test(_e))){Se=K+_e.length;var ze=R(_e,K,Se,S);if(ze===void 0){W.lastIndex=Se;continue}ze=String(ze),S=S.slice(0,K)+ze+S.slice(Se),W.lastIndex=K+ze.length}}return W.lastIndex=0,S},o.ensureValidHostname=function(S,R){var q=!!S,W=!!R,N=!1;if(W&&(N=m(o.hostProtocols,R)),N&&!q)throw new TypeError("Hostname cannot be empty, if protocol is "+R);if(S&&S.match(o.invalid_hostname_characters)){if(!t)throw new TypeError('Hostname "'+S+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(t.toASCII(S).match(o.invalid_hostname_characters))throw new TypeError('Hostname "'+S+'" contains characters other than [A-Z0-9.-:_]')}},o.ensureValidPort=function(S){if(!!S){var R=Number(S);if(!(a(R)&&R>0&&R<65536))throw new TypeError('Port "'+S+'" is not a valid port')}},o.noConflict=function(S){if(S){var R={URI:this.noConflict()};return n.URITemplate&&typeof n.URITemplate.noConflict=="function"&&(R.URITemplate=n.URITemplate.noConflict()),n.IPv6&&typeof n.IPv6.noConflict=="function"&&(R.IPv6=n.IPv6.noConflict()),n.SecondLevelDomains&&typeof n.SecondLevelDomains.noConflict=="function"&&(R.SecondLevelDomains=n.SecondLevelDomains.noConflict()),R}else n.URI===this&&(n.URI=i);return this},s.build=function(S){return S===!0?this._deferred_build=!0:(S===void 0||this._deferred_build)&&(this._string=o.build(this._parts),this._deferred_build=!1),this},s.clone=function(){return new o(this)},s.valueOf=s.toString=function(){return this.build(!1)._string};function _(S){return function(R,q){return R===void 0?this._parts[S]||"":(this._parts[S]=R||null,this.build(!q),this)}}function C(S,R){return function(q,W){return q===void 0?this._parts[S]||"":(q!==null&&(q=q+"",q.charAt(0)===R&&(q=q.substring(1))),this._parts[S]=q,this.build(!W),this)}}s.protocol=_("protocol"),s.username=_("username"),s.password=_("password"),s.hostname=_("hostname"),s.port=_("port"),s.query=C("query","?"),s.fragment=C("fragment","#"),s.search=function(S,R){var q=this.query(S,R);return typeof q=="string"&&q.length?"?"+q:q},s.hash=function(S,R){var q=this.fragment(S,R);return typeof q=="string"&&q.length?"#"+q:q},s.pathname=function(S,R){if(S===void 0||S===!0){var q=this._parts.path||(this._parts.hostname?"/":"");return S?(this._parts.urn?o.decodeUrnPath:o.decodePath)(q):q}else return this._parts.urn?this._parts.path=S?o.recodeUrnPath(S):"":this._parts.path=S?o.recodePath(S):"/",this.build(!R),this},s.path=s.pathname,s.href=function(S,R){var q;if(S===void 0)return this.toString();this._string="",this._parts=o._parts();var W=S instanceof o,N=typeof S=="object"&&(S.hostname||S.path||S.pathname);if(S.nodeName){var z=o.getDomAttribute(S);S=S[z]||"",N=!1}if(!W&&N&&S.pathname!==void 0&&(S=S.toString()),typeof S=="string"||S instanceof String)this._parts=o.parse(String(S),this._parts);else if(W||N){var X=W?S._parts:S;for(q in X)q!=="query"&&u.call(this._parts,q)&&(this._parts[q]=X[q]);X.query&&this.query(X.query,!1)}else throw new TypeError("invalid input");return this.build(!R),this},s.is=function(S){var R=!1,q=!1,W=!1,N=!1,z=!1,X=!1,oe=!1,G=!this._parts.urn;switch(this._parts.hostname&&(G=!1,q=o.ip4_expression.test(this._parts.hostname),W=o.ip6_expression.test(this._parts.hostname),R=q||W,N=!R,z=N&&r&&r.has(this._parts.hostname),X=N&&o.idn_expression.test(this._parts.hostname),oe=N&&o.punycode_expression.test(this._parts.hostname)),S.toLowerCase()){case"relative":return G;case"absolute":return!G;case"domain":case"name":return N;case"sld":return z;case"ip":return R;case"ip4":case"ipv4":case"inet4":return q;case"ip6":case"ipv6":case"inet6":return W;case"idn":return X;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return oe}return null};var O=s.protocol,F=s.port,B=s.hostname;s.protocol=function(S,R){if(S&&(S=S.replace(/:(\/\/)?$/,""),!S.match(o.protocol_expression)))throw new TypeError('Protocol "'+S+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return O.call(this,S,R)},s.scheme=s.protocol,s.port=function(S,R){return this._parts.urn?S===void 0?"":this:(S!==void 0&&(S===0&&(S=null),S&&(S+="",S.charAt(0)===":"&&(S=S.substring(1)),o.ensureValidPort(S))),F.call(this,S,R))},s.hostname=function(S,R){if(this._parts.urn)return S===void 0?"":this;if(S!==void 0){var q={preventInvalidHostname:this._parts.preventInvalidHostname},W=o.parseHost(S,q);if(W!=="/")throw new TypeError('Hostname "'+S+'" contains characters other than [A-Z0-9.-]');S=q.hostname,this._parts.preventInvalidHostname&&o.ensureValidHostname(S,this._parts.protocol)}return B.call(this,S,R)},s.origin=function(S,R){if(this._parts.urn)return S===void 0?"":this;if(S===void 0){var q=this.protocol(),W=this.authority();return W?(q?q+"://":"")+this.authority():""}else{var N=o(S);return this.protocol(N.protocol()).authority(N.authority()).build(!R),this}},s.host=function(S,R){if(this._parts.urn)return S===void 0?"":this;if(S===void 0)return this._parts.hostname?o.buildHost(this._parts):"";var q=o.parseHost(S,this._parts);if(q!=="/")throw new TypeError('Hostname "'+S+'" contains characters other than [A-Z0-9.-]');return this.build(!R),this},s.authority=function(S,R){if(this._parts.urn)return S===void 0?"":this;if(S===void 0)return this._parts.hostname?o.buildAuthority(this._parts):"";var q=o.parseAuthority(S,this._parts);if(q!=="/")throw new TypeError('Hostname "'+S+'" contains characters other than [A-Z0-9.-]');return this.build(!R),this},s.userinfo=function(S,R){if(this._parts.urn)return S===void 0?"":this;if(S===void 0){var q=o.buildUserinfo(this._parts);return q&&q.substring(0,q.length-1)}else return S[S.length-1]!=="@"&&(S+="@"),o.parseUserinfo(S,this._parts),this.build(!R),this},s.resource=function(S,R){var q;return S===void 0?this.path()+this.search()+this.hash():(q=o.parse(S),this._parts.path=q.path,this._parts.query=q.query,this._parts.fragment=q.fragment,this.build(!R),this)},s.subdomain=function(S,R){if(this._parts.urn)return S===void 0?"":this;if(S===void 0){if(!this._parts.hostname||this.is("IP"))return"";var q=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,q)||""}else{var W=this._parts.hostname.length-this.domain().length,N=this._parts.hostname.substring(0,W),z=new RegExp("^"+c(N));if(S&&S.charAt(S.length-1)!=="."&&(S+="."),S.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return S&&o.ensureValidHostname(S,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(z,S),this.build(!R),this}},s.domain=function(S,R){if(this._parts.urn)return S===void 0?"":this;if(typeof S=="boolean"&&(R=S,S=void 0),S===void 0){if(!this._parts.hostname||this.is("IP"))return"";var q=this._parts.hostname.match(/\./g);if(q&&q.length<2)return this._parts.hostname;var W=this._parts.hostname.length-this.tld(R).length-1;return W=this._parts.hostname.lastIndexOf(".",W-1)+1,this._parts.hostname.substring(W)||""}else{if(!S)throw new TypeError("cannot set domain empty");if(S.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(o.ensureValidHostname(S,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=S;else{var N=new RegExp(c(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(N,S)}return this.build(!R),this}},s.tld=function(S,R){if(this._parts.urn)return S===void 0?"":this;if(typeof S=="boolean"&&(R=S,S=void 0),S===void 0){if(!this._parts.hostname||this.is("IP"))return"";var q=this._parts.hostname.lastIndexOf("."),W=this._parts.hostname.substring(q+1);return R!==!0&&r&&r.list[W.toLowerCase()]&&r.get(this._parts.hostname)||W}else{var N;if(S)if(S.match(/[^a-zA-Z0-9-]/))if(r&&r.is(S))N=new RegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(N,S);else throw new TypeError('TLD "'+S+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");N=new RegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(N,S)}else throw new TypeError("cannot set TLD empty");return this.build(!R),this}},s.directory=function(S,R){if(this._parts.urn)return S===void 0?"":this;if(S===void 0||S===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var q=this._parts.path.length-this.filename().length-1,W=this._parts.path.substring(0,q)||(this._parts.hostname?"/":"");return S?o.decodePath(W):W}else{var N=this._parts.path.length-this.filename().length,z=this._parts.path.substring(0,N),X=new RegExp("^"+c(z));return this.is("relative")||(S||(S="/"),S.charAt(0)!=="/"&&(S="/"+S)),S&&S.charAt(S.length-1)!=="/"&&(S+="/"),S=o.recodePath(S),this._parts.path=this._parts.path.replace(X,S),this.build(!R),this}},s.filename=function(S,R){if(this._parts.urn)return S===void 0?"":this;if(typeof S!="string"){if(!this._parts.path||this._parts.path==="/")return"";var q=this._parts.path.lastIndexOf("/"),W=this._parts.path.substring(q+1);return S?o.decodePathSegment(W):W}else{var N=!1;S.charAt(0)==="/"&&(S=S.substring(1)),S.match(/\.?\//)&&(N=!0);var z=new RegExp(c(this.filename())+"$");return S=o.recodePath(S),this._parts.path=this._parts.path.replace(z,S),N?this.normalizePath(R):this.build(!R),this}},s.suffix=function(S,R){if(this._parts.urn)return S===void 0?"":this;if(S===void 0||S===!0){if(!this._parts.path||this._parts.path==="/")return"";var q=this.filename(),W=q.lastIndexOf("."),N,z;return W===-1?"":(N=q.substring(W+1),z=/^[a-z0-9%]+$/i.test(N)?N:"",S?o.decodePathSegment(z):z)}else{S.charAt(0)==="."&&(S=S.substring(1));var X=this.suffix(),oe;if(X)S?oe=new RegExp(c(X)+"$"):oe=new RegExp(c("."+X)+"$");else{if(!S)return this;this._parts.path+="."+o.recodePath(S)}return oe&&(S=o.recodePath(S),this._parts.path=this._parts.path.replace(oe,S)),this.build(!R),this}},s.segment=function(S,R,q){var W=this._parts.urn?":":"/",N=this.path(),z=N.substring(0,1)==="/",X=N.split(W);if(S!==void 0&&typeof S!="number"&&(q=R,R=S,S=void 0),S!==void 0&&typeof S!="number")throw new Error('Bad segment "'+S+'", must be 0-based integer');if(z&&X.shift(),S<0&&(S=Math.max(X.length+S,0)),R===void 0)return S===void 0?X:X[S];if(S===null||X[S]===void 0)if(p(R)){X=[];for(var oe=0,G=R.length;oe<G;oe++)!R[oe].length&&(!X.length||!X[X.length-1].length)||(X.length&&!X[X.length-1].length&&X.pop(),X.push(w(R[oe])))}else(R||typeof R=="string")&&(R=w(R),X[X.length-1]===""?X[X.length-1]=R:X.push(R));else R?X[S]=w(R):X.splice(S,1);return z&&X.unshift(""),this.path(X.join(W),q)},s.segmentCoded=function(S,R,q){var W,N,z;if(typeof S!="number"&&(q=R,R=S,S=void 0),R===void 0){if(W=this.segment(S,R,q),!p(W))W=W!==void 0?o.decode(W):void 0;else for(N=0,z=W.length;N<z;N++)W[N]=o.decode(W[N]);return W}if(!p(R))R=typeof R=="string"||R instanceof String?o.encode(R):R;else for(N=0,z=R.length;N<z;N++)R[N]=o.encode(R[N]);return this.segment(S,R,q)};var V=s.query;return s.query=function(S,R){if(S===!0)return o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof S=="function"){var q=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace),W=S.call(this,q);return this._parts.query=o.buildQuery(W||q,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!R),this}else return S!==void 0&&typeof S!="string"?(this._parts.query=o.buildQuery(S,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!R),this):V.call(this,S,R)},s.setQuery=function(S,R,q){var W=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof S=="string"||S instanceof String)W[S]=R!==void 0?R:null;else if(typeof S=="object")for(var N in S)u.call(S,N)&&(W[N]=S[N]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=o.buildQuery(W,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof S!="string"&&(q=R),this.build(!q),this},s.addQuery=function(S,R,q){var W=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.addQuery(W,S,R===void 0?null:R),this._parts.query=o.buildQuery(W,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof S!="string"&&(q=R),this.build(!q),this},s.removeQuery=function(S,R,q){var W=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.removeQuery(W,S,R),this._parts.query=o.buildQuery(W,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof S!="string"&&(q=R),this.build(!q),this},s.hasQuery=function(S,R,q){var W=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.hasQuery(W,S,R,q)},s.setSearch=s.setQuery,s.addSearch=s.addQuery,s.removeSearch=s.removeQuery,s.hasSearch=s.hasQuery,s.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},s.normalizeProtocol=function(S){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!S)),this},s.normalizeHostname=function(S){return this._parts.hostname&&(this.is("IDN")&&t?this._parts.hostname=t.toASCII(this._parts.hostname):this.is("IPv6")&&e&&(this._parts.hostname=e.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!S)),this},s.normalizePort=function(S){return typeof this._parts.protocol=="string"&&this._parts.port===o.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!S)),this},s.normalizePath=function(S){var R=this._parts.path;if(!R)return this;if(this._parts.urn)return this._parts.path=o.recodeUrnPath(this._parts.path),this.build(!S),this;if(this._parts.path==="/")return this;R=o.recodePath(R);var q,W="",N,z;for(R.charAt(0)!=="/"&&(q=!0,R="/"+R),(R.slice(-3)==="/.."||R.slice(-2)==="/.")&&(R+="/"),R=R.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),q&&(W=R.substring(1).match(/^(\.\.\/)+/)||"",W&&(W=W[0]));N=R.search(/\/\.\.(\/|$)/),N!==-1;){if(N===0){R=R.substring(3);continue}z=R.substring(0,N).lastIndexOf("/"),z===-1&&(z=N),R=R.substring(0,z)+R.substring(N+3)}return q&&this.is("relative")&&(R=W+R.substring(1)),this._parts.path=R,this.build(!S),this},s.normalizePathname=s.normalizePath,s.normalizeQuery=function(S){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(o.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!S)),this},s.normalizeFragment=function(S){return this._parts.fragment||(this._parts.fragment=null,this.build(!S)),this},s.normalizeSearch=s.normalizeQuery,s.normalizeHash=s.normalizeFragment,s.iso8859=function(){var S=o.encode,R=o.decode;o.encode=escape,o.decode=decodeURIComponent;try{this.normalize()}finally{o.encode=S,o.decode=R}return this},s.unicode=function(){var S=o.encode,R=o.decode;o.encode=k,o.decode=unescape;try{this.normalize()}finally{o.encode=S,o.decode=R}return this},s.readable=function(){var S=this.clone();S.username("").password("").normalize();var R="";if(S._parts.protocol&&(R+=S._parts.protocol+"://"),S._parts.hostname&&(S.is("punycode")&&t?(R+=t.toUnicode(S._parts.hostname),S._parts.port&&(R+=":"+S._parts.port)):R+=S.host()),S._parts.hostname&&S._parts.path&&S._parts.path.charAt(0)!=="/"&&(R+="/"),R+=S.path(!0),S._parts.query){for(var q="",W=0,N=S._parts.query.split("&"),z=N.length;W<z;W++){var X=(N[W]||"").split("=");q+="&"+o.decodeQuery(X[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),X[1]!==void 0&&(q+="="+o.decodeQuery(X[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}R+="?"+q.substring(1)}return R+=o.decodeQuery(S.hash(),!0),R},s.absoluteTo=function(S){var R=this.clone(),q=["protocol","username","password","hostname","port"],W,N,z;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(S instanceof o||(S=new o(S)),R._parts.protocol||(R._parts.protocol=S._parts.protocol,this._parts.hostname))return R;for(N=0;z=q[N];N++)R._parts[z]=S._parts[z];return R._parts.path?(R._parts.path.substring(-2)===".."&&(R._parts.path+="/"),R.path().charAt(0)!=="/"&&(W=S.directory(),W=W||(S.path().indexOf("/")===0?"/":""),R._parts.path=(W?W+"/":"")+R._parts.path,R.normalizePath())):(R._parts.path=S._parts.path,R._parts.query||(R._parts.query=S._parts.query)),R.build(),R},s.relativeTo=function(S){var R=this.clone().normalize(),q,W,N,z,X;if(R._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(S=new o(S).normalize(),q=R._parts,W=S._parts,z=R.path(),X=S.path(),z.charAt(0)!=="/")throw new Error("URI is already relative");if(X.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(q.protocol===W.protocol&&(q.protocol=null),q.username!==W.username||q.password!==W.password||q.protocol!==null||q.username!==null||q.password!==null)return R.build();if(q.hostname===W.hostname&&q.port===W.port)q.hostname=null,q.port=null;else return R.build();if(z===X)return q.path="",R.build();if(N=o.commonPath(z,X),!N)return R.build();var oe=W.path.substring(N.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return q.path=oe+q.path.substring(N.length)||"./",R.build()},s.equals=function(S){var R=this.clone(),q=new o(S),W={},N={},z={},X,oe,G;if(R.normalize(),q.normalize(),R.toString()===q.toString())return!0;if(X=R.query(),oe=q.query(),R.query(""),q.query(""),R.toString()!==q.toString()||X.length!==oe.length)return!1;W=o.parseQuery(X,this._parts.escapeQuerySpace),N=o.parseQuery(oe,this._parts.escapeQuerySpace);for(G in W)if(u.call(W,G)){if(p(W[G])){if(!x(W[G],N[G]))return!1}else if(W[G]!==N[G])return!1;z[G]=!0}for(G in N)if(u.call(N,G)&&!z[G])return!1;return!0},s.preventInvalidHostname=function(S){return this._parts.preventInvalidHostname=!!S,this},s.duplicateQueryParameters=function(S){return this._parts.duplicateQueryParameters=!!S,this},s.escapeQuerySpace=function(S){return this._parts.escapeQuerySpace=!!S,this},o})});var nq,Ca,tm=se(()=>{Pr();nq=Vr(L1()),Ca=class extends Ct{uriParams(){return(0,nq.default)(window.location.toString()).query(!0)}viaResourceName(){return this.uriParams().via_resource_name}uriParam(t){return this.viaResourceName()?`${this.viaResourceName}_${t}`:t}b64EncodeUnicode(t){return btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,r)=>String.fromCharCode(`0x${r}`)))}b64DecodeUnicode(t){return decodeURIComponent(atob(t).split("").map(e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""))}changeFilter(){let t=this.getFilterValue(),e=this.getFilterClass(),r=this.uriParams()[this.uriParam("filters")];r?r=JSON.parse(this.b64DecodeUnicode(r)):r={},r[e]=t;let n=Object.keys(r).filter(o=>r[o]!==null).reduce((o,a)=>(o[a]=r[a],o),{}),i;n&&Object.keys(n).length>0&&(i=this.b64EncodeUnicode(JSON.stringify(n))),this.navigateToURLWithFilters(i)}navigateToURLWithFilters(t){let e=new nq.default(this.urlRedirectTarget.href),r=bl({},e.query(!0));this.keepFiltersPanelOpenValue&&(r.keep_filters_panel_open=this.keepFiltersPanelOpenValue?1:null),r.page=1,t?r.filters=t:delete r.filters,e.query(r),this.urlRedirectTarget.href=e,this.urlRedirectTarget.click()}};vt(Ca,"targets",["urlRedirect"]),vt(Ca,"values",{keepFiltersPanelOpen:Boolean})});var P1,Gre=se(()=>{tm();P1=class extends Ca{getFilterValue(){let t={};return this.optionTargets.forEach(e=>{t[e.value]=e.checked}),t}getFilterClass(){let{filterClass:t}=this.optionTarget.dataset;return t}};vt(P1,"targets",["option"])});var Br=Z((iq,oq)=>{(function(t,e){typeof iq=="object"&&typeof oq<"u"?oq.exports=e():typeof define=="function"&&define.amd?define(e):(t=t||self,t.CodeMirror=e())})(iq,function(){"use strict";var t=navigator.userAgent,e=navigator.platform,r=/gecko\/\d/i.test(t),n=/MSIE \d/.test(t),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),o=/Edge\/(\d+)/.exec(t),a=n||i||o,s=a&&(n?document.documentMode||6:+(o||i)[1]),u=!o&&/WebKit\//.test(t),c=u&&/Qt\/\d+\.\d+/.test(t),f=!o&&/Chrome\//.test(t),p=/Opera\//.test(t),g=/Apple Computer/.test(navigator.vendor),m=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),x=/PhantomJS/.test(t),w=g&&(/Mobile\/\w+/.test(t)||navigator.maxTouchPoints>2),T=/Android/.test(t),k=w||T||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),A=w||/Mac/.test(e),D=/\bCrOS\b/.test(t),M=/win/i.test(e),P=p&&t.match(/Version\/(\d*\.\d*)/);P&&(P=Number(P[1])),P&&P>=15&&(p=!1,u=!0);var _=A&&(c||p&&(P==null||P<12.11)),C=r||a&&s>=9;function O(l){return new RegExp("(^|\\s)"+l+"(?:$|\\s)\\s*")}var F=function(l,d){var y=l.className,v=O(d).exec(y);if(v){var E=y.slice(v.index+v[0].length);l.className=y.slice(0,v.index)+(E?v[1]+E:"")}};function B(l){for(var d=l.childNodes.length;d>0;--d)l.removeChild(l.firstChild);return l}function V(l,d){return B(l).appendChild(d)}function S(l,d,y,v){var E=document.createElement(l);if(y&&(E.className=y),v&&(E.style.cssText=v),typeof d=="string")E.appendChild(document.createTextNode(d));else if(d)for(var L=0;L<d.length;++L)E.appendChild(d[L]);return E}function R(l,d,y,v){var E=S(l,d,y,v);return E.setAttribute("role","presentation"),E}var q;document.createRange?q=function(l,d,y,v){var E=document.createRange();return E.setEnd(v||l,y),E.setStart(l,d),E}:q=function(l,d,y){var v=document.body.createTextRange();try{v.moveToElementText(l.parentNode)}catch{return v}return v.collapse(!0),v.moveEnd("character",y),v.moveStart("character",d),v};function W(l,d){if(d.nodeType==3&&(d=d.parentNode),l.contains)return l.contains(d);do if(d.nodeType==11&&(d=d.host),d==l)return!0;while(d=d.parentNode)}function N(){var l;try{l=document.activeElement}catch{l=document.body||null}for(;l&&l.shadowRoot&&l.shadowRoot.activeElement;)l=l.shadowRoot.activeElement;return l}function z(l,d){var y=l.className;O(d).test(y)||(l.className+=(y?" ":"")+d)}function X(l,d){for(var y=l.split(" "),v=0;v<y.length;v++)y[v]&&!O(y[v]).test(d)&&(d+=" "+y[v]);return d}var oe=function(l){l.select()};w?oe=function(l){l.selectionStart=0,l.selectionEnd=l.value.length}:a&&(oe=function(l){try{l.select()}catch{}});function G(l){var d=Array.prototype.slice.call(arguments,1);return function(){return l.apply(null,d)}}function K(l,d,y){d||(d={});for(var v in l)l.hasOwnProperty(v)&&(y!==!1||!d.hasOwnProperty(v))&&(d[v]=l[v]);return d}function ve(l,d,y,v,E){d==null&&(d=l.search(/[^\s\u00a0]/),d==-1&&(d=l.length));for(var L=v||0,j=E||0;;){var Y=l.indexOf(" ",L);if(Y<0||Y>=d)return j+(d-L);j+=Y-L,j+=y-j%y,L=Y+1}}var Se=function(){this.id=null,this.f=null,this.time=0,this.handler=G(this.onTimeout,this)};Se.prototype.onTimeout=function(l){l.id=0,l.time<=+new Date?l.f():setTimeout(l.handler,l.time-+new Date)},Se.prototype.set=function(l,d){this.f=d;var y=+new Date+l;(!this.id||y<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,l),this.time=y)};function _e(l,d){for(var y=0;y<l.length;++y)if(l[y]==d)return y;return-1}var Ne=50,Le={toString:function(){return"CodeMirror.Pass"}},it={scroll:!1},ze={origin:"*mouse"},tt={origin:"+move"};function wt(l,d,y){for(var v=0,E=0;;){var L=l.indexOf(" ",v);L==-1&&(L=l.length);var j=L-v;if(L==l.length||E+j>=d)return v+Math.min(j,d-E);if(E+=L-v,E+=y-E%y,v=L+1,E>=d)return v}}var At=[""];function Ve(l){for(;At.length<=l;)At.push(Oe(At)+" ");return At[l]}function Oe(l){return l[l.length-1]}function Me(l,d){for(var y=[],v=0;v<l.length;v++)y[v]=d(l[v],v);return y}function he(l,d,y){for(var v=0,E=y(d);v<l.length&&y(l[v])<=E;)v++;l.splice(v,0,d)}function J(){}function re(l,d){var y;return Object.create?y=Object.create(l):(J.prototype=l,y=new J),d&&K(d,y),y}var fe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ht(l){return/\w/.test(l)||l>"\x80"&&(l.toUpperCase()!=l.toLowerCase()||fe.test(l))}function ke(l,d){return d?d.source.indexOf("\\w")>-1&&ht(l)?!0:d.test(l):ht(l)}function $e(l){for(var d in l)if(l.hasOwnProperty(d)&&l[d])return!1;return!0}var Fe=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function It(l){return l.charCodeAt(0)>=768&&Fe.test(l)}function ut(l,d,y){for(;(y<0?d>0:d<l.length)&&It(l.charAt(d));)d+=y;return d}function pt(l,d,y){for(var v=d>y?-1:1;;){if(d==y)return d;var E=(d+y)/2,L=v<0?Math.ceil(E):Math.floor(E);if(L==d)return l(L)?d:y;l(L)?y=L:d=L+v}}function st(l,d,y,v){if(!l)return v(d,y,"ltr",0);for(var E=!1,L=0;L<l.length;++L){var j=l[L];(j.from<y&&j.to>d||d==y&&j.to==d)&&(v(Math.max(j.from,d),Math.min(j.to,y),j.level==1?"rtl":"ltr",L),E=!0)}E||v(d,y,"ltr")}var ye=null;function xe(l,d,y){var v;ye=null;for(var E=0;E<l.length;++E){var L=l[E];if(L.from<d&&L.to>d)return E;L.to==d&&(L.from!=L.to&&y=="before"?v=E:ye=E),L.from==d&&(L.from!=L.to&&y!="before"?v=E:ye=E)}return v??ye}var We=function(){var l="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",d="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function y(ee){return ee<=247?l.charAt(ee):1424<=ee&&ee<=1524?"R":1536<=ee&&ee<=1785?d.charAt(ee-1536):1774<=ee&&ee<=2220?"r":8192<=ee&&ee<=8203?"w":ee==8204?"b":"L"}var v=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,E=/[stwN]/,L=/[LRr]/,j=/[Lb1n]/,Y=/[1n]/;function Q(ee,ce,pe){this.level=ee,this.from=ce,this.to=pe}return function(ee,ce){var pe=ce=="ltr"?"L":"R";if(ee.length==0||ce=="ltr"&&!v.test(ee))return!1;for(var Te=ee.length,Ce=[],je=0;je<Te;++je)Ce.push(y(ee.charCodeAt(je)));for(var Ke=0,ot=pe;Ke<Te;++Ke){var ct=Ce[Ke];ct=="m"?Ce[Ke]=ot:ot=ct}for(var xt=0,ft=pe;xt<Te;++xt){var St=Ce[xt];St=="1"&&ft=="r"?Ce[xt]="n":L.test(St)&&(ft=St,St=="r"&&(Ce[xt]="R"))}for(var Pt=1,Lt=Ce[0];Pt<Te-1;++Pt){var ir=Ce[Pt];ir=="+"&&Lt=="1"&&Ce[Pt+1]=="1"?Ce[Pt]="1":ir==","&&Lt==Ce[Pt+1]&&(Lt=="1"||Lt=="n")&&(Ce[Pt]=Lt),Lt=ir}for(var Rr=0;Rr<Te;++Rr){var qn=Ce[Rr];if(qn==",")Ce[Rr]="N";else if(qn=="%"){var Zr=void 0;for(Zr=Rr+1;Zr<Te&&Ce[Zr]=="%";++Zr);for(var Oi=Rr&&Ce[Rr-1]=="!"||Zr<Te&&Ce[Zr]=="1"?"1":"N",Mi=Rr;Mi<Zr;++Mi)Ce[Mi]=Oi;Rr=Zr-1}}for(var Sn=0,ni=pe;Sn<Te;++Sn){var Un=Ce[Sn];ni=="L"&&Un=="1"?Ce[Sn]="L":L.test(Un)&&(ni=Un)}for(var Ur=0;Ur<Te;++Ur)if(E.test(Ce[Ur])){var rn=void 0;for(rn=Ur+1;rn<Te&&E.test(Ce[rn]);++rn);for(var yn=(Ur?Ce[Ur-1]:pe)=="L",Ii=(rn<Te?Ce[rn]:pe)=="L",Fc=yn==Ii?yn?"L":"R":pe,yl=Ur;yl<rn;++yl)Ce[yl]=Fc;Ur=rn-1}for(var vi=[],Na,Vn=0;Vn<Te;)if(j.test(Ce[Vn])){var pv=Vn;for(++Vn;Vn<Te&&j.test(Ce[Vn]);++Vn);vi.push(new Q(0,pv,Vn))}else{var ys=Vn,yu=vi.length,bu=ce=="rtl"?1:0;for(++Vn;Vn<Te&&Ce[Vn]!="L";++Vn);for(var Li=ys;Li<Vn;)if(Y.test(Ce[Li])){ys<Li&&(vi.splice(yu,0,new Q(1,ys,Li)),yu+=bu);var Nc=Li;for(++Li;Li<Vn&&Y.test(Ce[Li]);++Li);vi.splice(yu,0,new Q(2,Nc,Li)),yu+=bu,ys=Li}else++Li;ys<Vn&&vi.splice(yu,0,new Q(1,ys,Vn))}return ce=="ltr"&&(vi[0].level==1&&(Na=ee.match(/^\s+/))&&(vi[0].from=Na[0].length,vi.unshift(new Q(0,0,Na[0].length))),Oe(vi).level==1&&(Na=ee.match(/\s+$/))&&(Oe(vi).to-=Na[0].length,vi.push(new Q(0,Te-Na[0].length,Te)))),ce=="rtl"?vi.reverse():vi}}();function bt(l,d){var y=l.order;return y==null&&(y=l.order=We(l.text,d)),y}var Gr=[],mt=function(l,d,y){if(l.addEventListener)l.addEventListener(d,y,!1);else if(l.attachEvent)l.attachEvent("on"+d,y);else{var v=l._handlers||(l._handlers={});v[d]=(v[d]||Gr).concat(y)}};function er(l,d){return l._handlers&&l._handlers[d]||Gr}function Ie(l,d,y){if(l.removeEventListener)l.removeEventListener(d,y,!1);else if(l.detachEvent)l.detachEvent("on"+d,y);else{var v=l._handlers,E=v&&v[d];if(E){var L=_e(E,y);L>-1&&(v[d]=E.slice(0,L).concat(E.slice(L+1)))}}}function Ze(l,d){var y=er(l,d);if(!!y.length)for(var v=Array.prototype.slice.call(arguments,2),E=0;E<y.length;++E)y[E].apply(null,v)}function dt(l,d,y){return typeof d=="string"&&(d={type:d,preventDefault:function(){this.defaultPrevented=!0}}),Ze(l,y||d.type,l,d),le(d)||d.codemirrorIgnore}function Zt(l){var d=l._handlers&&l._handlers.cursorActivity;if(!!d)for(var y=l.curOp.cursorActivityHandlers||(l.curOp.cursorActivityHandlers=[]),v=0;v<d.length;++v)_e(y,d[v])==-1&&y.push(d[v])}function jt(l,d){return er(l,d).length>0}function tr(l){l.prototype.on=function(d,y){mt(this,d,y)},l.prototype.off=function(d,y){Ie(this,d,y)}}function sr(l){l.preventDefault?l.preventDefault():l.returnValue=!1}function zn(l){l.stopPropagation?l.stopPropagation():l.cancelBubble=!0}function le(l){return l.defaultPrevented!=null?l.defaultPrevented:l.returnValue==!1}function de(l){sr(l),zn(l)}function Ae(l){return l.target||l.srcElement}function He(l){var d=l.which;return d==null&&(l.button&1?d=1:l.button&2?d=3:l.button&4&&(d=2)),A&&l.ctrlKey&&d==1&&(d=3),d}var lt=function(){if(a&&s<9)return!1;var l=S("div");return"draggable"in l||"dragDrop"in l}(),Qe;function Dt(l){if(Qe==null){var d=S("span","\u200B");V(l,S("span",[d,document.createTextNode("x")])),l.firstChild.offsetHeight!=0&&(Qe=d.offsetWidth<=1&&d.offsetHeight>2&&!(a&&s<8))}var y=Qe?S("span","\u200B"):S("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return y.setAttribute("cm-text",""),y}var _t;function Xt(l){if(_t!=null)return _t;var d=V(l,document.createTextNode("A\u062EA")),y=q(d,0,1).getBoundingClientRect(),v=q(d,1,2).getBoundingClientRect();return B(l),!y||y.left==y.right?!1:_t=v.right-y.right<3}var Yt=`
43
43
 
44
44
  b`.split(/\n/).length!=3?function(l){for(var d=0,y=[],v=l.length;d<=v;){var E=l.indexOf(`
45
45
  `,d);E==-1&&(E=l.length);var L=l.slice(d,l.charAt(E-1)=="\r"?E-1:E),j=L.indexOf("\r");j!=-1?(y.push(L.slice(0,j)),d+=j+1):(y.push(L),d=E+1)}return y}:function(l){return l.split(/\r\n?|\n/)},dr=window.getSelection?function(l){try{return l.selectionStart!=l.selectionEnd}catch{return!1}}:function(l){var d;try{d=l.ownerDocument.selection.createRange()}catch{}return!d||d.parentElement()!=l?!1:d.compareEndPoints("StartToEnd",d)!=0},sn=function(){var l=S("div");return"oncopy"in l?!0:(l.setAttribute("oncopy","return;"),typeof l.oncopy=="function")}(),zr=null;function go(l){if(zr!=null)return zr;var d=V(l,S("span","x")),y=d.getBoundingClientRect(),v=q(d,0,1).getBoundingClientRect();return zr=Math.abs(y.left-v.left)>1}var Hr={},Zn={};function Wi(l,d){arguments.length>2&&(d.dependencies=Array.prototype.slice.call(arguments,2)),Hr[l]=d}function ki(l,d){Zn[l]=d}function ln(l){if(typeof l=="string"&&Zn.hasOwnProperty(l))l=Zn[l];else if(l&&typeof l.name=="string"&&Zn.hasOwnProperty(l.name)){var d=Zn[l.name];typeof d=="string"&&(d={name:d}),l=re(d,l),l.name=d.name}else{if(typeof l=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(l))return ln("application/xml");if(typeof l=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(l))return ln("application/json")}return typeof l=="string"?{name:l}:l||{name:"null"}}function Po(l,d){d=ln(d);var y=Hr[d.name];if(!y)return Po(l,"text/plain");var v=y(l,d);if(Ei.hasOwnProperty(d.name)){var E=Ei[d.name];for(var L in E)!E.hasOwnProperty(L)||(v.hasOwnProperty(L)&&(v["_"+L]=v[L]),v[L]=E[L])}if(v.name=d.name,d.helperType&&(v.helperType=d.helperType),d.modeProps)for(var j in d.modeProps)v[j]=d.modeProps[j];return v}var Ei={};function Ws(l,d){var y=Ei.hasOwnProperty(l)?Ei[l]:Ei[l]={};K(d,y)}function mo(l,d){if(d===!0)return d;if(l.copyState)return l.copyState(d);var y={};for(var v in d){var E=d[v];E instanceof Array&&(E=E.concat([])),y[v]=E}return y}function Ro(l,d){for(var y;l.innerMode&&(y=l.innerMode(d),!(!y||y.mode==l));)d=y.state,l=y.mode;return y||{mode:l,state:d}}function Ar(l,d,y){return l.startState?l.startState(d,y):!0}var Xr=function(l,d,y){this.pos=this.start=0,this.string=l,this.tabSize=d||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=y};Xr.prototype.eol=function(){return this.pos>=this.string.length},Xr.prototype.sol=function(){return this.pos==this.lineStart},Xr.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Xr.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Xr.prototype.eat=function(l){var d=this.string.charAt(this.pos),y;if(typeof l=="string"?y=d==l:y=d&&(l.test?l.test(d):l(d)),y)return++this.pos,d},Xr.prototype.eatWhile=function(l){for(var d=this.pos;this.eat(l););return this.pos>d},Xr.prototype.eatSpace=function(){for(var l=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>l},Xr.prototype.skipToEnd=function(){this.pos=this.string.length},Xr.prototype.skipTo=function(l){var d=this.string.indexOf(l,this.pos);if(d>-1)return this.pos=d,!0},Xr.prototype.backUp=function(l){this.pos-=l},Xr.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=ve(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?ve(this.string,this.lineStart,this.tabSize):0)},Xr.prototype.indentation=function(){return ve(this.string,null,this.tabSize)-(this.lineStart?ve(this.string,this.lineStart,this.tabSize):0)},Xr.prototype.match=function(l,d,y){if(typeof l=="string"){var v=function(j){return y?j.toLowerCase():j},E=this.string.substr(this.pos,l.length);if(v(E)==v(l))return d!==!1&&(this.pos+=l.length),!0}else{var L=this.string.slice(this.pos).match(l);return L&&L.index>0?null:(L&&d!==!1&&(this.pos+=L[0].length),L)}},Xr.prototype.current=function(){return this.string.slice(this.start,this.pos)},Xr.prototype.hideFirstChars=function(l,d){this.lineStart+=l;try{return d()}finally{this.lineStart-=l}},Xr.prototype.lookAhead=function(l){var d=this.lineOracle;return d&&d.lookAhead(l)},Xr.prototype.baseToken=function(){var l=this.lineOracle;return l&&l.baseToken(this.pos)};function Ot(l,d){if(d-=l.first,d<0||d>=l.size)throw new Error("There is no line "+(d+l.first)+" in the document.");for(var y=l;!y.lines;)for(var v=0;;++v){var E=y.children[v],L=E.chunkSize();if(d<L){y=E;break}d-=L}return y.lines[d]}function to(l,d,y){var v=[],E=d.line;return l.iter(d.line,y.line+1,function(L){var j=L.text;E==y.line&&(j=j.slice(0,y.ch)),E==d.line&&(j=j.slice(d.ch)),v.push(j),++E}),v}function Us(l,d,y){var v=[];return l.iter(d,y,function(E){v.push(E.text)}),v}function ro(l,d){var y=d-l.height;if(y)for(var v=l;v;v=v.parent)v.height+=y}function wr(l){if(l.parent==null)return null;for(var d=l.parent,y=_e(d.lines,l),v=d.parent;v;d=v,v=v.parent)for(var E=0;v.children[E]!=d;++E)y+=v.children[E].chunkSize();return y+d.first}function vo(l,d){var y=l.first;e:do{for(var v=0;v<l.children.length;++v){var E=l.children[v],L=E.height;if(d<L){l=E;continue e}d-=L,y+=E.chunkSize()}return y}while(!l.lines);for(var j=0;j<l.lines.length;++j){var Y=l.lines[j],Q=Y.height;if(d<Q)break;d-=Q}return y+j}function ne(l,d){return d>=l.first&&d<l.first+l.size}function me(l,d){return String(l.lineNumberFormatter(d+l.firstLineNumber))}function be(l,d,y){if(y===void 0&&(y=null),!(this instanceof be))return new be(l,d,y);this.line=l,this.ch=d,this.sticky=y}function $(l,d){return l.line-d.line||l.ch-d.ch}function H(l,d){return l.sticky==d.sticky&&$(l,d)==0}function ae(l){return be(l.line,l.ch)}function ge(l,d){return $(l,d)<0?d:l}function Re(l,d){return $(l,d)<0?l:d}function Ue(l,d){return Math.max(l.first,Math.min(d,l.first+l.size-1))}function Xe(l,d){if(d.line<l.first)return be(l.first,0);var y=l.first+l.size-1;return d.line>y?be(y,Ot(l,y).text.length):zt(d,Ot(l,d.line).text.length)}function zt(l,d){var y=l.ch;return y==null||y>d?be(l.line,d):y<0?be(l.line,0):l}function Ht(l,d){for(var y=[],v=0;v<d.length;v++)y[v]=Xe(l,d[v]);return y}var Wt=function(l,d){this.state=l,this.lookAhead=d},$t=function(l,d,y,v){this.state=d,this.doc=l,this.line=y,this.maxLookAhead=v||0,this.baseTokens=null,this.baseTokenPos=1};$t.prototype.lookAhead=function(l){var d=this.doc.getLine(this.line+l);return d!=null&&l>this.maxLookAhead&&(this.maxLookAhead=l),d},$t.prototype.baseToken=function(l){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=l;)this.baseTokenPos+=2;var d=this.baseTokens[this.baseTokenPos+1];return{type:d&&d.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-l}},$t.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},$t.fromSaved=function(l,d,y){return d instanceof Wt?new $t(l,mo(l.mode,d.state),y,d.lookAhead):new $t(l,mo(l.mode,d),y)},$t.prototype.save=function(l){var d=l!==!1?mo(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Wt(d,this.maxLookAhead):d};function gn(l,d,y,v){var E=[l.state.modeGen],L={};ci(l,d.text,l.doc.mode,y,function(ee,ce){return E.push(ee,ce)},L,v);for(var j=y.state,Y=function(ee){y.baseTokens=E;var ce=l.state.overlays[ee],pe=1,Te=0;y.state=!0,ci(l,d.text,ce.mode,y,function(Ce,je){for(var Ke=pe;Te<Ce;){var ot=E[pe];ot>Ce&&E.splice(pe,1,Ce,E[pe+1],ot),pe+=2,Te=Math.min(Ce,ot)}if(!!je)if(ce.opaque)E.splice(Ke,pe-Ke,Ce,"overlay "+je),pe=Ke+2;else for(;Ke<pe;Ke+=2){var ct=E[Ke+1];E[Ke+1]=(ct?ct+" ":"")+"overlay "+je}},L),y.state=j,y.baseTokens=null,y.baseTokenPos=1},Q=0;Q<l.state.overlays.length;++Q)Y(Q);return{styles:E,classes:L.bgClass||L.textClass?L:null}}function Ut(l,d,y){if(!d.styles||d.styles[0]!=l.state.modeGen){var v=nr(l,wr(d)),E=d.text.length>l.options.maxHighlightLength&&mo(l.doc.mode,v.state),L=gn(l,d,v);E&&(v.state=E),d.stateAfter=v.save(!E),d.styles=L.styles,L.classes?d.styleClasses=L.classes:d.styleClasses&&(d.styleClasses=null),y===l.doc.highlightFrontier&&(l.doc.modeFrontier=Math.max(l.doc.modeFrontier,++l.doc.highlightFrontier))}return d.styles}function nr(l,d,y){var v=l.doc,E=l.display;if(!v.mode.startState)return new $t(v,!0,d);var L=Jl(l,d,y),j=L>v.first&&Ot(v,L-1).stateAfter,Y=j?$t.fromSaved(v,j,L):new $t(v,Ar(v.mode),L);return v.iter(L,d,function(Q){Ci(l,Q.text,Y);var ee=Y.line;Q.stateAfter=ee==d-1||ee%5==0||ee>=E.viewFrom&&ee<E.viewTo?Y.save():null,Y.nextLine()}),y&&(v.modeFrontier=Y.line),Y}function Ci(l,d,y,v){var E=l.doc.mode,L=new Xr(d,l.options.tabSize,y);for(L.start=L.pos=v||0,d==""&&ac(E,y.state);!L.eol();)Vs(E,L,y.state),L.start=L.pos}function ac(l,d){if(l.blankLine)return l.blankLine(d);if(!!l.innerMode){var y=Ro(l,d);if(y.mode.blankLine)return y.mode.blankLine(y.state)}}function Vs(l,d,y,v){for(var E=0;E<10;E++){v&&(v[0]=Ro(l,y).mode);var L=l.token(d,y);if(d.pos>d.start)return L}throw new Error("Mode "+l.name+" failed to advance stream.")}var os=function(l,d,y){this.start=l.start,this.end=l.pos,this.string=l.current(),this.type=d||null,this.state=y};function un(l,d,y,v){var E=l.doc,L=E.mode,j;d=Xe(E,d);var Y=Ot(E,d.line),Q=nr(l,d.line,y),ee=new Xr(Y.text,l.options.tabSize,Q),ce;for(v&&(ce=[]);(v||ee.pos<d.ch)&&!ee.eol();)ee.start=ee.pos,j=Vs(L,ee,Q.state),v&&ce.push(new os(ee,j,mo(E.mode,Q.state)));return v?ce:new os(ee,j,Q.state)}function Cn(l,d){if(l)for(;;){var y=l.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!y)break;l=l.slice(0,y.index)+l.slice(y.index+y[0].length);var v=y[1]?"bgClass":"textClass";d[v]==null?d[v]=y[2]:new RegExp("(?:^|\\s)"+y[2]+"(?:$|\\s)").test(d[v])||(d[v]+=" "+y[2])}return l}function ci(l,d,y,v,E,L,j){var Y=y.flattenSpans;Y==null&&(Y=l.options.flattenSpans);var Q=0,ee=null,ce=new Xr(d,l.options.tabSize,v),pe,Te=l.options.addModeClass&&[null];for(d==""&&Cn(ac(y,v.state),L);!ce.eol();){if(ce.pos>l.options.maxHighlightLength?(Y=!1,j&&Ci(l,d,v,ce.pos),ce.pos=d.length,pe=null):pe=Cn(Vs(y,ce,v.state,Te),L),Te){var Ce=Te[0].name;Ce&&(pe="m-"+(pe?Ce+" "+pe:Ce))}if(!Y||ee!=pe){for(;Q<ce.start;)Q=Math.min(ce.start,Q+5e3),E(Q,ee);ee=pe}ce.start=ce.pos}for(;Q<ce.pos;){var je=Math.min(ce.pos,Q+5e3);E(je,ee),Q=je}}function Jl(l,d,y){for(var v,E,L=l.doc,j=y?-1:d-(l.doc.mode.innerMode?1e3:100),Y=d;Y>j;--Y){if(Y<=L.first)return L.first;var Q=Ot(L,Y-1),ee=Q.stateAfter;if(ee&&(!y||Y+(ee instanceof Wt?ee.lookAhead:0)<=L.modeFrontier))return Y;var ce=ve(Q.text,null,l.options.tabSize);(E==null||v>ce)&&(E=Y-1,v=ce)}return E}function $s(l,d){if(l.modeFrontier=Math.min(l.modeFrontier,d),!(l.highlightFrontier<d-10)){for(var y=l.first,v=d-1;v>y;v--){var E=Ot(l,v).stateAfter;if(E&&(!(E instanceof Wt)||v+E.lookAhead<d)){y=v+1;break}}l.highlightFrontier=Math.min(l.highlightFrontier,y)}}var as=!1,Ui=!1;function Ys(){as=!0}function yo(){Ui=!0}function ss(l,d,y){this.marker=l,this.from=d,this.to=y}function ls(l,d){if(l)for(var y=0;y<l.length;++y){var v=l[y];if(v.marker==d)return v}}function eu(l,d){for(var y,v=0;v<l.length;++v)l[v]!=d&&(y||(y=[])).push(l[v]);return y}function Ff(l,d){l.markedSpans=l.markedSpans?l.markedSpans.concat([d]):[d],d.marker.attachLine(l)}function Ks(l,d,y){var v;if(l)for(var E=0;E<l.length;++E){var L=l[E],j=L.marker,Y=L.from==null||(j.inclusiveLeft?L.from<=d:L.from<d);if(Y||L.from==d&&j.type=="bookmark"&&(!y||!L.marker.insertLeft)){var Q=L.to==null||(j.inclusiveRight?L.to>=d:L.to>d);(v||(v=[])).push(new ss(j,L.from,Q?null:L.to))}}return v}function Nf(l,d,y){var v;if(l)for(var E=0;E<l.length;++E){var L=l[E],j=L.marker,Y=L.to==null||(j.inclusiveRight?L.to>=d:L.to>d);if(Y||L.from==d&&j.type=="bookmark"&&(!y||L.marker.insertLeft)){var Q=L.from==null||(j.inclusiveLeft?L.from<=d:L.from<d);(v||(v=[])).push(new ss(j,Q?null:L.from-d,L.to==null?null:L.to-d))}}return v}function qo(l,d){if(d.full)return null;var y=ne(l,d.from.line)&&Ot(l,d.from.line).markedSpans,v=ne(l,d.to.line)&&Ot(l,d.to.line).markedSpans;if(!y&&!v)return null;var E=d.from.ch,L=d.to.ch,j=$(d.from,d.to)==0,Y=Ks(y,E,j),Q=Nf(v,L,j),ee=d.text.length==1,ce=Oe(d.text).length+(ee?E:0);if(Y)for(var pe=0;pe<Y.length;++pe){var Te=Y[pe];if(Te.to==null){var Ce=ls(Q,Te.marker);Ce?ee&&(Te.to=Ce.to==null?null:Ce.to+ce):Te.to=E}}if(Q)for(var je=0;je<Q.length;++je){var Ke=Q[je];if(Ke.to!=null&&(Ke.to+=ce),Ke.from==null){var ot=ls(Y,Ke.marker);ot||(Ke.from=ce,ee&&(Y||(Y=[])).push(Ke))}else Ke.from+=ce,ee&&(Y||(Y=[])).push(Ke)}Y&&(Y=us(Y)),Q&&Q!=Y&&(Q=us(Q));var ct=[Y];if(!ee){var xt=d.text.length-2,ft;if(xt>0&&Y)for(var St=0;St<Y.length;++St)Y[St].to==null&&(ft||(ft=[])).push(new ss(Y[St].marker,null,null));for(var Pt=0;Pt<xt;++Pt)ct.push(ft);ct.push(Q)}return ct}function us(l){for(var d=0;d<l.length;++d){var y=l[d];y.from!=null&&y.from==y.to&&y.marker.clearWhenEmpty!==!1&&l.splice(d--,1)}return l.length?l:null}function Gs(l,d,y){var v=null;if(l.iter(d.line,y.line+1,function(Ce){if(Ce.markedSpans)for(var je=0;je<Ce.markedSpans.length;++je){var Ke=Ce.markedSpans[je].marker;Ke.readOnly&&(!v||_e(v,Ke)==-1)&&(v||(v=[])).push(Ke)}}),!v)return null;for(var E=[{from:d,to:y}],L=0;L<v.length;++L)for(var j=v[L],Y=j.find(0),Q=0;Q<E.length;++Q){var ee=E[Q];if(!($(ee.to,Y.from)<0||$(ee.from,Y.to)>0)){var ce=[Q,1],pe=$(ee.from,Y.from),Te=$(ee.to,Y.to);(pe<0||!j.inclusiveLeft&&!pe)&&ce.push({from:ee.from,to:Y.from}),(Te>0||!j.inclusiveRight&&!Te)&&ce.push({from:Y.to,to:ee.to}),E.splice.apply(E,ce),Q+=ce.length-3}}return E}function An(l){var d=l.markedSpans;if(!!d){for(var y=0;y<d.length;++y)d[y].marker.detachLine(l);l.markedSpans=null}}function Bf(l,d){if(!!d){for(var y=0;y<d.length;++y)d[y].marker.attachLine(l);l.markedSpans=d}}function sc(l){return l.inclusiveLeft?-1:0}function lc(l){return l.inclusiveRight?1:0}function Fo(l,d){var y=l.lines.length-d.lines.length;if(y!=0)return y;var v=l.find(),E=d.find(),L=$(v.from,E.from)||sc(l)-sc(d);if(L)return-L;var j=$(v.to,E.to)||lc(l)-lc(d);return j||d.id-l.id}function yr(l,d){var y=Ui&&l.markedSpans,v;if(y)for(var E=void 0,L=0;L<y.length;++L)E=y[L],E.marker.collapsed&&(d?E.from:E.to)==null&&(!v||Fo(v,E.marker)<0)&&(v=E.marker);return v}function Mr(l){return yr(l,!0)}function Xs(l){return yr(l,!1)}function uc(l,d){var y=Ui&&l.markedSpans,v;if(y)for(var E=0;E<y.length;++E){var L=y[E];L.marker.collapsed&&(L.from==null||L.from<d)&&(L.to==null||L.to>d)&&(!v||Fo(v,L.marker)<0)&&(v=L.marker)}return v}function cs(l,d,y,v,E){var L=Ot(l,d),j=Ui&&L.markedSpans;if(j)for(var Y=0;Y<j.length;++Y){var Q=j[Y];if(!!Q.marker.collapsed){var ee=Q.marker.find(0),ce=$(ee.from,y)||sc(Q.marker)-sc(E),pe=$(ee.to,v)||lc(Q.marker)-lc(E);if(!(ce>=0&&pe<=0||ce<=0&&pe>=0)&&(ce<=0&&(Q.marker.inclusiveRight&&E.inclusiveLeft?$(ee.to,y)>=0:$(ee.to,y)>0)||ce>=0&&(Q.marker.inclusiveRight&&E.inclusiveLeft?$(ee.from,v)<=0:$(ee.from,v)<0)))return!0}}}function Hn(l){for(var d;d=Mr(l);)l=d.find(-1,!0).line;return l}function Th(l){for(var d;d=Xs(l);)l=d.find(1,!0).line;return l}function jf(l){for(var d,y;d=Xs(l);)l=d.find(1,!0).line,(y||(y=[])).push(l);return y}function cc(l,d){var y=Ot(l,d),v=Hn(y);return y==v?d:wr(v)}function H0(l,d){if(d>l.lastLine())return d;var y=Ot(l,d),v;if(!cn(l,y))return d;for(;v=Xs(y);)y=v.find(1,!0).line;return wr(y)+1}function cn(l,d){var y=Ui&&d.markedSpans;if(y){for(var v=void 0,E=0;E<y.length;++E)if(v=y[E],!!v.marker.collapsed){if(v.from==null)return!0;if(!v.marker.widgetNode&&v.from==0&&v.marker.inclusiveLeft&&zf(l,d,v))return!0}}}function zf(l,d,y){if(y.to==null){var v=y.marker.find(1,!0);return zf(l,v.line,ls(v.line.markedSpans,y.marker))}if(y.marker.inclusiveRight&&y.to==d.text.length)return!0;for(var E=void 0,L=0;L<d.markedSpans.length;++L)if(E=d.markedSpans[L],E.marker.collapsed&&!E.marker.widgetNode&&E.from==y.to&&(E.to==null||E.to!=y.from)&&(E.marker.inclusiveLeft||y.marker.inclusiveRight)&&zf(l,d,E))return!0}function Vi(l){l=Hn(l);for(var d=0,y=l.parent,v=0;v<y.lines.length;++v){var E=y.lines[v];if(E==l)break;d+=E.height}for(var L=y.parent;L;y=L,L=y.parent)for(var j=0;j<L.children.length;++j){var Y=L.children[j];if(Y==y)break;d+=Y.height}return d}function Hf(l){if(l.height==0)return 0;for(var d=l.text.length,y,v=l;y=Mr(v);){var E=y.find(0,!0);v=E.from.line,d+=E.from.ch-E.to.ch}for(v=l;y=Xs(v);){var L=y.find(0,!0);d-=v.text.length-L.from.ch,v=L.to.line,d+=v.text.length-L.to.ch}return d}function Wf(l){var d=l.display,y=l.doc;d.maxLine=Ot(y,y.first),d.maxLineLength=Hf(d.maxLine),d.maxLineChanged=!0,y.iter(function(v){var E=Hf(v);E>d.maxLineLength&&(d.maxLineLength=E,d.maxLine=v)})}var fi=function(l,d,y){this.text=l,Bf(this,d),this.height=y?y(this):1};fi.prototype.lineNo=function(){return wr(this)},tr(fi);function W0(l,d,y,v){l.text=d,l.stateAfter&&(l.stateAfter=null),l.styles&&(l.styles=null),l.order!=null&&(l.order=null),An(l),Bf(l,y);var E=v?v(l):1;E!=l.height&&ro(l,E)}function U0(l){l.parent=null,An(l)}var V0={},$0={};function Am(l,d){if(!l||/^\s*$/.test(l))return null;var y=d.addModeClass?$0:V0;return y[l]||(y[l]=l.replace(/\S+/g,"cm-$&"))}function Tm(l,d){var y=R("span",null,null,u?"padding-right: .1px":null),v={pre:R("pre",[y],"CodeMirror-line"),content:y,col:0,pos:0,cm:l,trailingSpace:!1,splitSpaces:l.getOption("lineWrapping")};d.measure={};for(var E=0;E<=(d.rest?d.rest.length:0);E++){var L=E?d.rest[E-1]:d.line,j=void 0;v.pos=0,v.addToken=EC,Xt(l.display.measure)&&(j=bt(L,l.doc.direction))&&(v.addToken=CC(v.addToken,j)),v.map=[];var Y=d!=l.display.externalMeasured&&wr(L);Qs(L,v,Ut(l,L,Y)),L.styleClasses&&(L.styleClasses.bgClass&&(v.bgClass=X(L.styleClasses.bgClass,v.bgClass||"")),L.styleClasses.textClass&&(v.textClass=X(L.styleClasses.textClass,v.textClass||""))),v.map.length==0&&v.map.push(0,0,v.content.appendChild(Dt(l.display.measure))),E==0?(d.measure.map=v.map,d.measure.cache={}):((d.measure.maps||(d.measure.maps=[])).push(v.map),(d.measure.caches||(d.measure.caches=[])).push({}))}if(u){var Q=v.content.lastChild;(/\bcm-tab\b/.test(Q.className)||Q.querySelector&&Q.querySelector(".cm-tab"))&&(v.content.className="cm-tab-wrap-hack")}return Ze(l,"renderLine",l,d.line,v.pre),v.pre.className&&(v.textClass=X(v.pre.className,v.textClass||"")),v}function bo(l){var d=S("span","\u2022","cm-invalidchar");return d.title="\\u"+l.charCodeAt(0).toString(16),d.setAttribute("aria-label",d.title),d}function EC(l,d,y,v,E,L,j){if(!!d){var Y=l.splitSpaces?No(d,l.trailingSpace):d,Q=l.cm.state.specialChars,ee=!1,ce;if(!Q.test(d))l.col+=d.length,ce=document.createTextNode(Y),l.map.push(l.pos,l.pos+d.length,ce),a&&s<9&&(ee=!0),l.pos+=d.length;else{ce=document.createDocumentFragment();for(var pe=0;;){Q.lastIndex=pe;var Te=Q.exec(d),Ce=Te?Te.index-pe:d.length-pe;if(Ce){var je=document.createTextNode(Y.slice(pe,pe+Ce));a&&s<9?ce.appendChild(S("span",[je])):ce.appendChild(je),l.map.push(l.pos,l.pos+Ce,je),l.col+=Ce,l.pos+=Ce}if(!Te)break;pe+=Ce+1;var Ke=void 0;if(Te[0]==" "){var ot=l.cm.options.tabSize,ct=ot-l.col%ot;Ke=ce.appendChild(S("span",Ve(ct),"cm-tab")),Ke.setAttribute("role","presentation"),Ke.setAttribute("cm-text"," "),l.col+=ct}else Te[0]=="\r"||Te[0]==`
@@ -69,7 +69,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
69
69
  <span class='flatpickr-weekday'>
70
70
  ${de.join("</span><span class='flatpickr-weekday'>")}
71
71
  </span>
72
- `}function oe(){r.calendarContainer.classList.add("hasWeeks");let le=jr("div","flatpickr-weekwrapper");le.appendChild(jr("span","flatpickr-weekday",r.l10n.weekAbbreviation));let de=jr("div","flatpickr-weeks");return le.appendChild(de),{weekWrapper:le,weekNumbers:de}}function G(le,de=!0){let Ae=de?le:le-r.currentMonth;Ae<0&&r._hidePrevMonthArrow===!0||Ae>0&&r._hideNextMonthArrow===!0||(r.currentMonth+=Ae,(r.currentMonth<0||r.currentMonth>11)&&(r.currentYear+=r.currentMonth>11?1:-1,r.currentMonth=(r.currentMonth+12)%12,er("onYearChange"),S()),V(),er("onMonthChange"),Zt())}function K(le=!0,de=!0){if(r.input.value="",r.altInput!==void 0&&(r.altInput.value=""),r.mobileInput!==void 0&&(r.mobileInput.value=""),r.selectedDates=[],r.latestSelectedDateObj=void 0,de===!0&&(r.currentYear=r._initialDate.getFullYear(),r.currentMonth=r._initialDate.getMonth()),r.config.enableTime===!0){let{hours:Ae,minutes:He,seconds:lt}=aE(r.config);g(Ae,He,lt)}r.redraw(),le&&er("onChange")}function ve(){r.isOpen=!1,r.isMobile||(r.calendarContainer!==void 0&&r.calendarContainer.classList.remove("open"),r._input!==void 0&&r._input.classList.remove("active")),er("onClose")}function Se(){r.config!==void 0&&er("onDestroy");for(let le=r._handlers.length;le--;)r._handlers[le].remove();if(r._handlers=[],r.mobileInput)r.mobileInput.parentNode&&r.mobileInput.parentNode.removeChild(r.mobileInput),r.mobileInput=void 0;else if(r.calendarContainer&&r.calendarContainer.parentNode)if(r.config.static&&r.calendarContainer.parentNode){let le=r.calendarContainer.parentNode;if(le.lastChild&&le.removeChild(le.lastChild),le.parentNode){for(;le.firstChild;)le.parentNode.insertBefore(le.firstChild,le);le.parentNode.removeChild(le)}}else r.calendarContainer.parentNode.removeChild(r.calendarContainer);r.altInput&&(r.input.type="text",r.altInput.parentNode&&r.altInput.parentNode.removeChild(r.altInput),delete r.altInput),r.input&&(r.input.type=r.input._type,r.input.classList.remove("flatpickr-input"),r.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(le=>{try{delete r[le]}catch{}})}function _e(le){return r.config.appendTo&&r.config.appendTo.contains(le)?!0:r.calendarContainer.contains(le)}function Ne(le){if(r.isOpen&&!r.config.inline){let de=sa(le),Ae=_e(de),He=de===r.input||de===r.altInput||r.element.contains(de)||le.path&&le.path.indexOf&&(~le.path.indexOf(r.input)||~le.path.indexOf(r.altInput)),lt=le.type==="blur"?He&&le.relatedTarget&&!_e(le.relatedTarget):!He&&!Ae&&!_e(le.relatedTarget),Qe=!r.config.ignoredFocusElements.some(Dt=>Dt.contains(de));lt&&Qe&&(r.timeContainer!==void 0&&r.minuteElement!==void 0&&r.hourElement!==void 0&&r.input.value!==""&&r.input.value!==void 0&&s(),r.close(),r.config&&r.config.mode==="range"&&r.selectedDates.length===1&&(r.clear(!1),r.redraw()))}}function Le(le){if(!le||r.config.minDate&&le<r.config.minDate.getFullYear()||r.config.maxDate&&le>r.config.maxDate.getFullYear())return;let de=le,Ae=r.currentYear!==de;r.currentYear=de||r.currentYear,r.config.maxDate&&r.currentYear===r.config.maxDate.getFullYear()?r.currentMonth=Math.min(r.config.maxDate.getMonth(),r.currentMonth):r.config.minDate&&r.currentYear===r.config.minDate.getFullYear()&&(r.currentMonth=Math.max(r.config.minDate.getMonth(),r.currentMonth)),Ae&&(r.redraw(),er("onYearChange"),S())}function it(le,de=!0){var Ae;let He=r.parseDate(le,void 0,de);if(r.config.minDate&&He&&la(He,r.config.minDate,de!==void 0?de:!r.minDateHasTime)<0||r.config.maxDate&&He&&la(He,r.config.maxDate,de!==void 0?de:!r.maxDateHasTime)>0)return!1;if(!r.config.enable&&r.config.disable.length===0)return!0;if(He===void 0)return!1;let lt=!!r.config.enable,Qe=(Ae=r.config.enable)!==null&&Ae!==void 0?Ae:r.config.disable;for(let Dt=0,_t;Dt<Qe.length;Dt++){if(_t=Qe[Dt],typeof _t=="function"&&_t(He))return lt;if(_t instanceof Date&&He!==void 0&&_t.getTime()===He.getTime())return lt;if(typeof _t=="string"){let Xt=r.parseDate(_t,void 0,!0);return Xt&&Xt.getTime()===He.getTime()?lt:!lt}else if(typeof _t=="object"&&He!==void 0&&_t.from&&_t.to&&He.getTime()>=_t.from.getTime()&&He.getTime()<=_t.to.getTime())return lt}return!lt}function ze(le){return r.daysContainer!==void 0?le.className.indexOf("hidden")===-1&&le.className.indexOf("flatpickr-disabled")===-1&&r.daysContainer.contains(le):!1}function tt(le){le.target===r._input&&(r.selectedDates.length>0||r._input.value.length>0)&&!(le.relatedTarget&&_e(le.relatedTarget))&&r.setDate(r._input.value,!0,le.target===r.altInput?r.config.altFormat:r.config.dateFormat)}function wt(le){let de=sa(le),Ae=r.config.wrap?t.contains(de):de===r._input,He=r.config.allowInput,lt=r.isOpen&&(!He||!Ae),Qe=r.config.inline&&Ae&&!He;if(le.keyCode===13&&Ae){if(He)return r.setDate(r._input.value,!0,de===r.altInput?r.config.altFormat:r.config.dateFormat),de.blur();r.open()}else if(_e(de)||lt||Qe){let Dt=!!r.timeContainer&&r.timeContainer.contains(de);switch(le.keyCode){case 13:Dt?(le.preventDefault(),s(),Fe()):It(le);break;case 27:le.preventDefault(),Fe();break;case 8:case 46:Ae&&!r.config.allowInput&&(le.preventDefault(),r.clear());break;case 37:case 39:if(!Dt&&!Ae){if(le.preventDefault(),r.daysContainer!==void 0&&(He===!1||document.activeElement&&ze(document.activeElement))){let Xt=le.keyCode===39?1:-1;le.ctrlKey?(le.stopPropagation(),G(Xt),F(C(1),0)):F(void 0,Xt)}}else r.hourElement&&r.hourElement.focus();break;case 38:case 40:le.preventDefault();let _t=le.keyCode===40?1:-1;r.daysContainer&&de.$i!==void 0||de===r.input||de===r.altInput?le.ctrlKey?(le.stopPropagation(),Le(r.currentYear-_t),F(C(1),0)):Dt||F(void 0,_t*7):de===r.currentYearElement?Le(r.currentYear-_t):r.config.enableTime&&(!Dt&&r.hourElement&&r.hourElement.focus(),s(le),r._debouncedChange());break;case 9:if(Dt){let Xt=[r.hourElement,r.minuteElement,r.secondElement,r.amPM].concat(r.pluginElements).filter(dr=>dr),Yt=Xt.indexOf(de);if(Yt!==-1){let dr=Xt[Yt+(le.shiftKey?-1:1)];le.preventDefault(),(dr||r._input).focus()}}else!r.config.noCalendar&&r.daysContainer&&r.daysContainer.contains(de)&&le.shiftKey&&(le.preventDefault(),r._input.focus());break;default:break}}if(r.amPM!==void 0&&de===r.amPM)switch(le.key){case r.l10n.amPM[0].charAt(0):case r.l10n.amPM[0].charAt(0).toLowerCase():r.amPM.textContent=r.l10n.amPM[0],f(),tr();break;case r.l10n.amPM[1].charAt(0):case r.l10n.amPM[1].charAt(0).toLowerCase():r.amPM.textContent=r.l10n.amPM[1],f(),tr();break}(Ae||_e(de))&&er("onKeyDown",le)}function At(le){if(r.selectedDates.length!==1||le&&(!le.classList.contains("flatpickr-day")||le.classList.contains("flatpickr-disabled")))return;let de=le?le.dateObj.getTime():r.days.firstElementChild.dateObj.getTime(),Ae=r.parseDate(r.selectedDates[0],void 0,!0).getTime(),He=Math.min(de,r.selectedDates[0].getTime()),lt=Math.max(de,r.selectedDates[0].getTime()),Qe=!1,Dt=0,_t=0;for(let Xt=He;Xt<lt;Xt+=yoe.DAY)it(new Date(Xt),!0)||(Qe=Qe||Xt>He&&Xt<lt,Xt<Ae&&(!Dt||Xt>Dt)?Dt=Xt:Xt>Ae&&(!_t||Xt<_t)&&(_t=Xt));for(let Xt=0;Xt<r.config.showMonths;Xt++){let Yt=r.daysContainer.children[Xt];for(let dr=0,sn=Yt.children.length;dr<sn;dr++){let zr=Yt.children[dr],Hr=zr.dateObj.getTime(),Zn=Dt>0&&Hr<Dt||_t>0&&Hr>_t;if(Zn){zr.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(Wi=>{zr.classList.remove(Wi)});continue}else if(Qe&&!Zn)continue;["startRange","inRange","endRange","notAllowed"].forEach(Wi=>{zr.classList.remove(Wi)}),le!==void 0&&(le.classList.add(de<=r.selectedDates[0].getTime()?"startRange":"endRange"),Ae<de&&Hr===Ae?zr.classList.add("startRange"):Ae>de&&Hr===Ae&&zr.classList.add("endRange"),Hr>=Dt&&(_t===0||Hr<=_t)&&voe(Hr,Ae,de)&&zr.classList.add("inRange"))}}}function Ve(){r.isOpen&&!r.config.static&&!r.config.inline&&fe()}function Oe(le,de=r._positionElement){if(r.isMobile===!0){if(le){le.preventDefault();let He=sa(le);He&&He.blur()}r.mobileInput!==void 0&&(r.mobileInput.focus(),r.mobileInput.click()),er("onOpen");return}else if(r._input.disabled||r.config.inline)return;let Ae=r.isOpen;r.isOpen=!0,Ae||(r.calendarContainer.classList.add("open"),r._input.classList.add("active"),er("onOpen"),fe(de)),r.config.enableTime===!0&&r.config.noCalendar===!0&&r.config.allowInput===!1&&(le===void 0||!r.timeContainer.contains(le.relatedTarget))&&setTimeout(()=>r.hourElement.select(),50)}function Me(le){return de=>{let Ae=r.config[`_${le}Date`]=r.parseDate(de,r.config.dateFormat),He=r.config[`_${le==="min"?"max":"min"}Date`];Ae!==void 0&&(r[le==="min"?"minDateHasTime":"maxDateHasTime"]=Ae.getHours()>0||Ae.getMinutes()>0||Ae.getSeconds()>0),r.selectedDates&&(r.selectedDates=r.selectedDates.filter(lt=>it(lt)),!r.selectedDates.length&&le==="min"&&p(Ae),tr()),r.daysContainer&&($e(),Ae!==void 0?r.currentYearElement[le]=Ae.getFullYear().toString():r.currentYearElement.removeAttribute(le),r.currentYearElement.disabled=!!He&&Ae!==void 0&&He.getFullYear()===Ae.getFullYear())}}function he(){let le=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],de=Object.assign(Object.assign({},JSON.parse(JSON.stringify(t.dataset||{}))),e),Ae={};r.config.parseDate=de.parseDate,r.config.formatDate=de.formatDate,Object.defineProperty(r.config,"enable",{get:()=>r.config._enable,set:Qe=>{r.config._enable=xe(Qe)}}),Object.defineProperty(r.config,"disable",{get:()=>r.config._disable,set:Qe=>{r.config._disable=xe(Qe)}});let He=de.mode==="time";if(!de.dateFormat&&(de.enableTime||He)){let Qe=li.defaultConfig.dateFormat||Of.dateFormat;Ae.dateFormat=de.noCalendar||He?"H:i"+(de.enableSeconds?":S":""):Qe+" H:i"+(de.enableSeconds?":S":"")}if(de.altInput&&(de.enableTime||He)&&!de.altFormat){let Qe=li.defaultConfig.altFormat||Of.altFormat;Ae.altFormat=de.noCalendar||He?"h:i"+(de.enableSeconds?":S K":" K"):Qe+` h:i${de.enableSeconds?":S":""} K`}Object.defineProperty(r.config,"minDate",{get:()=>r.config._minDate,set:Me("min")}),Object.defineProperty(r.config,"maxDate",{get:()=>r.config._maxDate,set:Me("max")});let lt=Qe=>Dt=>{r.config[Qe==="min"?"_minTime":"_maxTime"]=r.parseDate(Dt,"H:i:S")};Object.defineProperty(r.config,"minTime",{get:()=>r.config._minTime,set:lt("min")}),Object.defineProperty(r.config,"maxTime",{get:()=>r.config._maxTime,set:lt("max")}),de.mode==="time"&&(r.config.noCalendar=!0,r.config.enableTime=!0),Object.assign(r.config,Ae,de);for(let Qe=0;Qe<le.length;Qe++)r.config[le[Qe]]=r.config[le[Qe]]===!0||r.config[le[Qe]]==="true";tE.filter(Qe=>r.config[Qe]!==void 0).forEach(Qe=>{r.config[Qe]=iE(r.config[Qe]||[]).map(o)}),r.isMobile=!r.config.disableMobile&&!r.config.inline&&r.config.mode==="single"&&!r.config.disable.length&&!r.config.enable&&!r.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(let Qe=0;Qe<r.config.plugins.length;Qe++){let Dt=r.config.plugins[Qe](r)||{};for(let _t in Dt)tE.indexOf(_t)>-1?r.config[_t]=iE(Dt[_t]).map(o).concat(r.config[_t]):typeof de[_t]>"u"&&(r.config[_t]=Dt[_t])}de.altInputClass||(r.config.altInputClass=J().className+" "+r.config.altInputClass),er("onParseConfig")}function J(){return r.config.wrap?t.querySelector("[data-input]"):t}function re(){typeof r.config.locale!="object"&&typeof li.l10ns[r.config.locale]>"u"&&r.config.errorHandler(new Error(`flatpickr: invalid locale ${r.config.locale}`)),r.l10n=Object.assign(Object.assign({},li.l10ns.default),typeof r.config.locale=="object"?r.config.locale:r.config.locale!=="default"?li.l10ns[r.config.locale]:void 0),b0.K=`(${r.l10n.amPM[0]}|${r.l10n.amPM[1]}|${r.l10n.amPM[0].toLowerCase()}|${r.l10n.amPM[1].toLowerCase()})`,Object.assign(Object.assign({},e),JSON.parse(JSON.stringify(t.dataset||{}))).time_24hr===void 0&&li.defaultConfig.time_24hr===void 0&&(r.config.time_24hr=r.l10n.time_24hr),r.formatDate=oF(r),r.parseDate=oE({config:r.config,l10n:r.l10n})}function fe(le){if(typeof r.config.position=="function")return void r.config.position(r,le);if(r.calendarContainer===void 0)return;er("onPreCalendarPosition");let de=le||r._positionElement,Ae=Array.prototype.reduce.call(r.calendarContainer.children,(ki,ln)=>ki+ln.offsetHeight,0),He=r.calendarContainer.offsetWidth,lt=r.config.position.split(" "),Qe=lt[0],Dt=lt.length>1?lt[1]:null,_t=de.getBoundingClientRect(),Xt=window.innerHeight-_t.bottom,Yt=Qe==="above"||Qe!=="below"&&Xt<Ae&&_t.top>Ae,dr=window.pageYOffset+_t.top+(Yt?-Ae-2:de.offsetHeight+2);if(ho(r.calendarContainer,"arrowTop",!Yt),ho(r.calendarContainer,"arrowBottom",Yt),r.config.inline)return;let sn=window.pageXOffset+_t.left,zr=!1,go=!1;Dt==="center"?(sn-=(He-_t.width)/2,zr=!0):Dt==="right"&&(sn-=He-_t.width,go=!0),ho(r.calendarContainer,"arrowLeft",!zr&&!go),ho(r.calendarContainer,"arrowCenter",zr),ho(r.calendarContainer,"arrowRight",go);let Hr=window.document.body.offsetWidth-(window.pageXOffset+_t.right),Zn=sn+He>window.document.body.offsetWidth,Wi=Hr+He>window.document.body.offsetWidth;if(ho(r.calendarContainer,"rightMost",Zn),!r.config.static)if(r.calendarContainer.style.top=`${dr}px`,!Zn)r.calendarContainer.style.left=`${sn}px`,r.calendarContainer.style.right="auto";else if(!Wi)r.calendarContainer.style.left="auto",r.calendarContainer.style.right=`${Hr}px`;else{let ki=ht();if(ki===void 0)return;let ln=window.document.body.offsetWidth,Po=Math.max(0,ln/2-He/2),Ei=".flatpickr-calendar.centerMost:before",Ws=".flatpickr-calendar.centerMost:after",mo=ki.cssRules.length,Ro=`{left:${_t.left}px;right:auto;}`;ho(r.calendarContainer,"rightMost",!1),ho(r.calendarContainer,"centerMost",!0),ki.insertRule(`${Ei},${Ws}${Ro}`,mo),r.calendarContainer.style.left=`${Po}px`,r.calendarContainer.style.right="auto"}}function ht(){let le=null;for(let de=0;de<document.styleSheets.length;de++){let Ae=document.styleSheets[de];try{Ae.cssRules}catch{continue}le=Ae;break}return le??ke()}function ke(){let le=document.createElement("style");return document.head.appendChild(le),le.sheet}function $e(){r.config.noCalendar||r.isMobile||(S(),Zt(),V())}function Fe(){r._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(r.close,0):r.close()}function It(le){le.preventDefault(),le.stopPropagation();let de=Dt=>Dt.classList&&Dt.classList.contains("flatpickr-day")&&!Dt.classList.contains("flatpickr-disabled")&&!Dt.classList.contains("notAllowed"),Ae=rF(sa(le),de);if(Ae===void 0)return;let He=Ae,lt=r.latestSelectedDateObj=new Date(He.dateObj.getTime()),Qe=(lt.getMonth()<r.currentMonth||lt.getMonth()>r.currentMonth+r.config.showMonths-1)&&r.config.mode!=="range";if(r.selectedDateElem=He,r.config.mode==="single")r.selectedDates=[lt];else if(r.config.mode==="multiple"){let Dt=Ze(lt);Dt?r.selectedDates.splice(parseInt(Dt),1):r.selectedDates.push(lt)}else r.config.mode==="range"&&(r.selectedDates.length===2&&r.clear(!1,!1),r.latestSelectedDateObj=lt,r.selectedDates.push(lt),la(lt,r.selectedDates[0],!0)!==0&&r.selectedDates.sort((Dt,_t)=>Dt.getTime()-_t.getTime()));if(f(),Qe){let Dt=r.currentYear!==lt.getFullYear();r.currentYear=lt.getFullYear(),r.currentMonth=lt.getMonth(),Dt&&(er("onYearChange"),S()),er("onMonthChange")}if(Zt(),V(),tr(),!Qe&&r.config.mode!=="range"&&r.config.showMonths===1?_(He):r.selectedDateElem!==void 0&&r.hourElement===void 0&&r.selectedDateElem&&r.selectedDateElem.focus(),r.hourElement!==void 0&&r.hourElement!==void 0&&r.hourElement.focus(),r.config.closeOnSelect){let Dt=r.config.mode==="single"&&!r.config.enableTime,_t=r.config.mode==="range"&&r.selectedDates.length===2&&!r.config.enableTime;(Dt||_t)&&Fe()}w()}let ut={locale:[re,X],showMonths:[q,a,z],minDate:[k],maxDate:[k],clickOpens:[()=>{r.config.clickOpens===!0?(x(r._input,"focus",r.open),x(r._input,"click",r.open)):(r._input.removeEventListener("focus",r.open),r._input.removeEventListener("click",r.open))}]};function pt(le,de){if(le!==null&&typeof le=="object"){Object.assign(r.config,le);for(let Ae in le)ut[Ae]!==void 0&&ut[Ae].forEach(He=>He())}else r.config[le]=de,ut[le]!==void 0?ut[le].forEach(Ae=>Ae()):tE.indexOf(le)>-1&&(r.config[le]=iE(de));r.redraw(),tr(!0)}function st(le,de){let Ae=[];if(le instanceof Array)Ae=le.map(He=>r.parseDate(He,de));else if(le instanceof Date||typeof le=="number")Ae=[r.parseDate(le,de)];else if(typeof le=="string")switch(r.config.mode){case"single":case"time":Ae=[r.parseDate(le,de)];break;case"multiple":Ae=le.split(r.config.conjunction).map(He=>r.parseDate(He,de));break;case"range":Ae=le.split(r.l10n.rangeSeparator).map(He=>r.parseDate(He,de));break;default:break}else r.config.errorHandler(new Error(`Invalid date supplied: ${JSON.stringify(le)}`));r.selectedDates=r.config.allowInvalidPreload?Ae:Ae.filter(He=>He instanceof Date&&it(He,!1)),r.config.mode==="range"&&r.selectedDates.sort((He,lt)=>He.getTime()-lt.getTime())}function ye(le,de=!1,Ae=r.config.dateFormat){if(le!==0&&!le||le instanceof Array&&le.length===0)return r.clear(de);st(le,Ae),r.latestSelectedDateObj=r.selectedDates[r.selectedDates.length-1],r.redraw(),k(void 0,de),p(),r.selectedDates.length===0&&r.clear(!1),tr(de),de&&er("onChange")}function xe(le){return le.slice().map(de=>typeof de=="string"||typeof de=="number"||de instanceof Date?r.parseDate(de,void 0,!0):de&&typeof de=="object"&&de.from&&de.to?{from:r.parseDate(de.from,void 0),to:r.parseDate(de.to,void 0)}:de).filter(de=>de)}function We(){r.selectedDates=[],r.now=r.parseDate(r.config.now)||new Date;let le=r.config.defaultDate||((r.input.nodeName==="INPUT"||r.input.nodeName==="TEXTAREA")&&r.input.placeholder&&r.input.value===r.input.placeholder?null:r.input.value);le&&st(le,r.config.dateFormat),r._initialDate=r.selectedDates.length>0?r.selectedDates[0]:r.config.minDate&&r.config.minDate.getTime()>r.now.getTime()?r.config.minDate:r.config.maxDate&&r.config.maxDate.getTime()<r.now.getTime()?r.config.maxDate:r.now,r.currentYear=r._initialDate.getFullYear(),r.currentMonth=r._initialDate.getMonth(),r.selectedDates.length>0&&(r.latestSelectedDateObj=r.selectedDates[0]),r.config.minTime!==void 0&&(r.config.minTime=r.parseDate(r.config.minTime,"H:i")),r.config.maxTime!==void 0&&(r.config.maxTime=r.parseDate(r.config.maxTime,"H:i")),r.minDateHasTime=!!r.config.minDate&&(r.config.minDate.getHours()>0||r.config.minDate.getMinutes()>0||r.config.minDate.getSeconds()>0),r.maxDateHasTime=!!r.config.maxDate&&(r.config.maxDate.getHours()>0||r.config.maxDate.getMinutes()>0||r.config.maxDate.getSeconds()>0)}function bt(){if(r.input=J(),!r.input){r.config.errorHandler(new Error("Invalid input element specified"));return}r.input._type=r.input.type,r.input.type="text",r.input.classList.add("flatpickr-input"),r._input=r.input,r.config.altInput&&(r.altInput=jr(r.input.nodeName,r.config.altInputClass),r._input=r.altInput,r.altInput.placeholder=r.input.placeholder,r.altInput.disabled=r.input.disabled,r.altInput.required=r.input.required,r.altInput.tabIndex=r.input.tabIndex,r.altInput.type="text",r.input.setAttribute("type","hidden"),!r.config.static&&r.input.parentNode&&r.input.parentNode.insertBefore(r.altInput,r.input.nextSibling)),r.config.allowInput||r._input.setAttribute("readonly","readonly"),r._positionElement=r.config.positionElement||r._input}function Gr(){let le=r.config.enableTime?r.config.noCalendar?"time":"datetime-local":"date";r.mobileInput=jr("input",r.input.className+" flatpickr-mobile"),r.mobileInput.tabIndex=1,r.mobileInput.type=le,r.mobileInput.disabled=r.input.disabled,r.mobileInput.required=r.input.required,r.mobileInput.placeholder=r.input.placeholder,r.mobileFormatStr=le==="datetime-local"?"Y-m-d\\TH:i:S":le==="date"?"Y-m-d":"H:i:S",r.selectedDates.length>0&&(r.mobileInput.defaultValue=r.mobileInput.value=r.formatDate(r.selectedDates[0],r.mobileFormatStr)),r.config.minDate&&(r.mobileInput.min=r.formatDate(r.config.minDate,"Y-m-d")),r.config.maxDate&&(r.mobileInput.max=r.formatDate(r.config.maxDate,"Y-m-d")),r.input.getAttribute("step")&&(r.mobileInput.step=String(r.input.getAttribute("step"))),r.input.type="hidden",r.altInput!==void 0&&(r.altInput.type="hidden");try{r.input.parentNode&&r.input.parentNode.insertBefore(r.mobileInput,r.input.nextSibling)}catch{}x(r.mobileInput,"change",de=>{r.setDate(sa(de).value,!1,r.mobileFormatStr),er("onChange"),er("onClose")})}function mt(le){if(r.isOpen===!0)return r.close();r.open(le)}function er(le,de){if(r.config===void 0)return;let Ae=r.config[le];if(Ae!==void 0&&Ae.length>0)for(let He=0;Ae[He]&&He<Ae.length;He++)Ae[He](r.selectedDates,r.input.value,r,de);le==="onChange"&&(r.input.dispatchEvent(Ie("change")),r.input.dispatchEvent(Ie("input")))}function Ie(le){let de=document.createEvent("Event");return de.initEvent(le,!0,!0),de}function Ze(le){for(let de=0;de<r.selectedDates.length;de++)if(la(r.selectedDates[de],le)===0)return""+de;return!1}function dt(le){return r.config.mode!=="range"||r.selectedDates.length<2?!1:la(le,r.selectedDates[0])>=0&&la(le,r.selectedDates[1])<=0}function Zt(){r.config.noCalendar||r.isMobile||!r.monthNav||(r.yearElements.forEach((le,de)=>{let Ae=new Date(r.currentYear,r.currentMonth,1);Ae.setMonth(r.currentMonth+de),r.config.showMonths>1||r.config.monthSelectorType==="static"?r.monthElements[de].textContent=y0(Ae.getMonth(),r.config.shorthandCurrentMonth,r.l10n)+" ":r.monthsDropdownContainer.value=Ae.getMonth().toString(),le.value=Ae.getFullYear().toString()}),r._hidePrevMonthArrow=r.config.minDate!==void 0&&(r.currentYear===r.config.minDate.getFullYear()?r.currentMonth<=r.config.minDate.getMonth():r.currentYear<r.config.minDate.getFullYear()),r._hideNextMonthArrow=r.config.maxDate!==void 0&&(r.currentYear===r.config.maxDate.getFullYear()?r.currentMonth+1>r.config.maxDate.getMonth():r.currentYear>r.config.maxDate.getFullYear()))}function jt(le){return r.selectedDates.map(de=>r.formatDate(de,le)).filter((de,Ae,He)=>r.config.mode!=="range"||r.config.enableTime||He.indexOf(de)===Ae).join(r.config.mode!=="range"?r.config.conjunction:r.l10n.rangeSeparator)}function tr(le=!0){r.mobileInput!==void 0&&r.mobileFormatStr&&(r.mobileInput.value=r.latestSelectedDateObj!==void 0?r.formatDate(r.latestSelectedDateObj,r.mobileFormatStr):""),r.input.value=jt(r.config.dateFormat),r.altInput!==void 0&&(r.altInput.value=jt(r.config.altFormat)),le!==!1&&er("onValueUpdate")}function sr(le){let de=sa(le),Ae=r.prevMonthNav.contains(de),He=r.nextMonthNav.contains(de);Ae||He?G(Ae?-1:1):r.yearElements.indexOf(de)>=0?de.select():de.classList.contains("arrowUp")?r.changeYear(r.currentYear+1):de.classList.contains("arrowDown")&&r.changeYear(r.currentYear-1)}function zn(le){le.preventDefault();let de=le.type==="keydown",Ae=sa(le),He=Ae;r.amPM!==void 0&&Ae===r.amPM&&(r.amPM.textContent=r.l10n.amPM[aa(r.amPM.textContent===r.l10n.amPM[0])]);let lt=parseFloat(He.getAttribute("min")),Qe=parseFloat(He.getAttribute("max")),Dt=parseFloat(He.getAttribute("step")),_t=parseInt(He.value,10),Xt=le.delta||(de?le.which===38?1:-1:0),Yt=_t+Dt*Xt;if(typeof He.value<"u"&&He.value.length===2){let dr=He===r.hourElement,sn=He===r.minuteElement;Yt<lt?(Yt=Qe+Yt+aa(!dr)+(aa(dr)&&aa(!r.amPM)),sn&&D(void 0,-1,r.hourElement)):Yt>Qe&&(Yt=He===r.hourElement?Yt-Qe-aa(!r.amPM):lt,sn&&D(void 0,1,r.hourElement)),r.amPM&&dr&&(Dt===1?Yt+_t===23:Math.abs(Yt-_t)>Dt)&&(r.amPM.textContent=r.l10n.amPM[aa(r.amPM.textContent===r.l10n.amPM[0])]),He.value=fo(Yt)}}return i(),r}function pm(t,e){let r=Array.prototype.slice.call(t).filter(i=>i instanceof HTMLElement),n=[];for(let i=0;i<r.length;i++){let o=r[i];try{if(o.getAttribute("data-fp-omit")!==null)continue;o._flatpickr!==void 0&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=SQe(o,e||{}),n.push(o._flatpickr)}catch(a){console.error(a)}}return n.length===1?n[0]:n}var _Qe,li,woe,_oe=se(()=>{Zq();Jq();tF();goe();boe();iF();xoe();_Qe=300;typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(t){return pm(this,t)},HTMLElement.prototype.flatpickr=function(t){return pm([this],t)});li=function(t,e){return typeof t=="string"?pm(window.document.querySelectorAll(t),e):t instanceof Node?pm([t],e):pm(t,e)};li.defaultConfig={};li.l10ns={en:Object.assign({},nE),default:Object.assign({},nE)};li.localize=t=>{li.l10ns.default=Object.assign(Object.assign({},li.l10ns.default),t)};li.setDefaults=t=>{li.defaultConfig=Object.assign(Object.assign({},li.defaultConfig),t)};li.parseDate=oE({});li.formatDate=oF({});li.compareDates=la;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(t){return pm(this,t)});Date.prototype.fp_incr=function(t){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof t=="string"?parseInt(t,10):t))};typeof window<"u"&&(window.flatpickr=li);woe=li});function Soe(t){return new Date(new Date(t).getTime()+new Date(t).getTimezoneOffset()*60*1e3)}var x0,w0,koe=se(()=>{Pr();x0=Vr(poe());_oe();w0=class extends Ct{get browserZone(){return x0.DateTime.local().zoneName}get initialValue(){return this.isOnShow||this.isOnIndex?this.context.element.innerText:this.isOnEdit?this.inputTarget.value:null}get isOnIndex(){return this.viewValue==="index"}get isOnEdit(){return this.viewValue==="edit"}get isOnShow(){return this.viewValue==="show"}get parsedValue(){return x0.DateTime.fromISO(this.initialValue,{zone:"UTC"})}get displayTimezone(){return this.timezoneValue||this.browserZone}connect(){this.isOnShow||this.isOnIndex?this.initShow():this.isOnEdit&&this.initEdit()}initShow(){let t=this.parsedValue;this.enableTimeValue&&(t=t.setZone(this.displayTimezone)),this.context.element.innerText=t.toFormat(this.formatValue)}initEdit(){let t={enableTime:!1,enableSeconds:!1,time_24hr:this.time24HrValue,locale:{firstDayOfWeek:0},altInput:!0,onChange:this.onChange.bind(this)};t.altFormat=this.pickerFormatValue,t.disableMobile=this.disableMobileValue,t.locale.firstDayOfWeek=this.firstDayOfWeekValue,t.enableTime=this.enableTimeValue,t.enableSeconds=this.enableTimeValue,this.enableTimeValue?(t.defaultDate=this.parsedValue.setZone(this.displayTimezone).toISO(),t.dateFormat="Y-m-d H:i:S"):t.defaultDate=Soe(this.initialValue),woe(this.fakeInputTarget,t),this.enableTimeValue?this.updateRealInput(this.parsedValue.setZone(this.displayTimezone).toISO()):this.updateRealInput(Soe(this.initialValue))}onChange(t){if(t.length===0){this.updateRealInput("");return}let e,r={};this.timezoneValue?r={keepLocalTime:!0}:r={keepLocalTime:!1},this.enableTimeValue?e=x0.DateTime.fromISO(t[0].toISOString()).setZone("UTC",r):e=x0.DateTime.fromISO(t[0].toISOString()).setZone("UTC",{keepLocalTime:!0}),this.updateRealInput(e)}updateRealInput(t){this.inputTarget.value=t}};vt(w0,"targets",["input","fakeInput"]),vt(w0,"values",{view:String,timezone:String,format:String,enableTime:Boolean,pickerFormat:String,firstDayOfWeek:Number,time24Hr:Boolean,disableMobile:Boolean})});var sE,Eoe=se(()=>{Pr();sE=class extends Ct{showContent(t){this.contentTarget.classList.toggle("hidden"),t.target.classList.add("hidden")}};vt(sE,"targets",["content"])});var _0,Coe=se(()=>{Pr();_0=class extends Ct{connect(){this.resourceName=this.element.dataset.resourceName}toggle(t){let e=!!t.target.checked;document.querySelectorAll(`[data-controller="item-selector"][data-resource-name="${this.resourceName}"] input[type=checkbox]`).forEach(r=>r.checked!==e&&r.click()),this.selectAllOverlay(e),e||this.resetUnselected()}selectRow(){let t=!0;this.itemCheckboxTargets.forEach(e=>t=t&&e.checked),this.checkboxTarget.checked=t,this.selectAllOverlay(t),this.resetUnselected()}selectAll(t){t.preventDefault(),this.selectedAllValue=!this.selectedAllValue,this.unselectedMessageTarget.classList.toggle("hidden"),this.selectedMessageTarget.classList.toggle("hidden")}resetUnselected(){this.selectedAllValue=!1,this.unselectedMessageTarget.classList.remove("hidden"),this.selectedMessageTarget.classList.add("hidden")}selectAllOverlay(t){t?this.selectAllOvelayTarget.classList.remove("hidden"):this.selectAllOvelayTarget.classList.add("hidden")}};vt(_0,"targets",["itemCheckbox","checkbox","selectAllOvelay","unselectedMessage","selectedMessage"]),vt(_0,"values",{selectedAll:Boolean,selectedAllQuery:String})});var lE,Aoe=se(()=>{Pr();lE=class extends Ct{constructor(){super(...arguments);vt(this,"checkbox",{});vt(this,"enabledClasses",["text-black","hover:bg-blue-500","hover:text-white"]);vt(this,"disabledClasses",["text-gray-500"])}get actionsPanelPresent(){return this.actionsButtonElement!==null}get currentIds(){try{return JSON.parse(this.stateHolderElement.dataset.selectedResources)}catch(t){return[]}}get actionLinks(){return document.querySelectorAll('.js-actions-dropdown a[data-actions-picker-target="resourceAction"]')}set currentIds(t){this.stateHolderElement.dataset.selectedResources=JSON.stringify(t),this.actionsPanelPresent&&(t.length>0?this.enableResourceActions():this.disableResourceActions())}connect(){this.resourceName=this.element.dataset.resourceName,this.resourceId=this.element.dataset.resourceId,this.actionsButtonElement=document.querySelector(`[data-actions-dropdown-button="${this.resourceName}"]`),this.stateHolderElement=document.querySelector(`[data-selected-resources-name="${this.resourceName}"]`)}addToSelected(){let t=this.currentIds;t.push(this.resourceId),this.currentIds=t}removeFromSelected(){this.currentIds=this.currentIds.filter(t=>t.toString()!==this.resourceId)}toggle(t){this.checkbox=t.target,this.checkbox.checked?this.addToSelected():this.removeFromSelected()}enableResourceActions(){this.actionLinks.forEach(t=>{t.classList.add(...this.enabledClasses),t.classList.remove(...this.disabledClasses),t.setAttribute("data-href",t.getAttribute("href")),t.dataset.disabled=!1})}disableResourceActions(){this.actionLinks.forEach(t=>{t.classList.remove(...this.enabledClasses),t.classList.add(...this.disabledClasses),t.setAttribute("href",t.getAttribute("data-href")),t.dataset.disabled=!0})}};vt(lE,"targets",["panel"])});var uE,Toe=se(()=>{Pr();Qg();uE=class extends Ct{constructor(){super(...arguments);vt(this,"fieldValue",[]);vt(this,"options",{})}get keyInputDisabled(){return!this.options.editable||this.options.disable_editing_keys}get valueInputDisabled(){return!this.options.editable}connect(){this.setOptions();try{let t=JSON.parse(this.inputTarget.value);Object.keys(t).forEach(e=>this.fieldValue.push([e,t[e]]))}catch(t){this.fieldValue=[]}this.updateKeyValueComponent()}addRow(){this.options.disable_adding_rows||!this.options.editable||(this.fieldValue.push(["",""]),this.updateKeyValueComponent(),this.focusLastRow())}deleteRow(t){if(this.options.disable_deleting_rows||!this.options.editable)return;let{index:e}=t.params;this.fieldValue.splice(e,1),this.updateTextareaInput(),this.updateKeyValueComponent()}focusLastRow(){return this.rowsTarget.querySelector(".flex.key-value-row:last-child .key-value-input-key").focus()}valueFieldUpdated(t){let{value:e}=t.target,{index:r}=t.target.dataset;this.fieldValue[r][1]=e,this.updateTextareaInput()}keyFieldUpdated(t){let{value:e}=t.target,{index:r}=t.target.dataset;this.fieldValue[r][0]=e,this.updateTextareaInput()}updateTextareaInput(){if(!this.hasInputTarget)return;let t={};this.fieldValue&&this.fieldValue.length>0&&(t=Object.assign(...this.fieldValue.map(([e,r])=>({[e]:r})))),this.inputTarget.innerText=JSON.stringify(t),this.inputTarget.dispatchEvent(new Event("input"))}updateKeyValueComponent(){let t="",e=0;this.fieldValue.forEach(r=>{let[n,i]=r;t+=this.interpolatedRow(n,i,e),e++}),this.rowsTarget.innerHTML=t,window.initTippy()}interpolatedRow(t,e,r){let n=`<div class="flex key-value-row">
72
+ `}function oe(){r.calendarContainer.classList.add("hasWeeks");let le=jr("div","flatpickr-weekwrapper");le.appendChild(jr("span","flatpickr-weekday",r.l10n.weekAbbreviation));let de=jr("div","flatpickr-weeks");return le.appendChild(de),{weekWrapper:le,weekNumbers:de}}function G(le,de=!0){let Ae=de?le:le-r.currentMonth;Ae<0&&r._hidePrevMonthArrow===!0||Ae>0&&r._hideNextMonthArrow===!0||(r.currentMonth+=Ae,(r.currentMonth<0||r.currentMonth>11)&&(r.currentYear+=r.currentMonth>11?1:-1,r.currentMonth=(r.currentMonth+12)%12,er("onYearChange"),S()),V(),er("onMonthChange"),Zt())}function K(le=!0,de=!0){if(r.input.value="",r.altInput!==void 0&&(r.altInput.value=""),r.mobileInput!==void 0&&(r.mobileInput.value=""),r.selectedDates=[],r.latestSelectedDateObj=void 0,de===!0&&(r.currentYear=r._initialDate.getFullYear(),r.currentMonth=r._initialDate.getMonth()),r.config.enableTime===!0){let{hours:Ae,minutes:He,seconds:lt}=aE(r.config);g(Ae,He,lt)}r.redraw(),le&&er("onChange")}function ve(){r.isOpen=!1,r.isMobile||(r.calendarContainer!==void 0&&r.calendarContainer.classList.remove("open"),r._input!==void 0&&r._input.classList.remove("active")),er("onClose")}function Se(){r.config!==void 0&&er("onDestroy");for(let le=r._handlers.length;le--;)r._handlers[le].remove();if(r._handlers=[],r.mobileInput)r.mobileInput.parentNode&&r.mobileInput.parentNode.removeChild(r.mobileInput),r.mobileInput=void 0;else if(r.calendarContainer&&r.calendarContainer.parentNode)if(r.config.static&&r.calendarContainer.parentNode){let le=r.calendarContainer.parentNode;if(le.lastChild&&le.removeChild(le.lastChild),le.parentNode){for(;le.firstChild;)le.parentNode.insertBefore(le.firstChild,le);le.parentNode.removeChild(le)}}else r.calendarContainer.parentNode.removeChild(r.calendarContainer);r.altInput&&(r.input.type="text",r.altInput.parentNode&&r.altInput.parentNode.removeChild(r.altInput),delete r.altInput),r.input&&(r.input.type=r.input._type,r.input.classList.remove("flatpickr-input"),r.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(le=>{try{delete r[le]}catch{}})}function _e(le){return r.config.appendTo&&r.config.appendTo.contains(le)?!0:r.calendarContainer.contains(le)}function Ne(le){if(r.isOpen&&!r.config.inline){let de=sa(le),Ae=_e(de),He=de===r.input||de===r.altInput||r.element.contains(de)||le.path&&le.path.indexOf&&(~le.path.indexOf(r.input)||~le.path.indexOf(r.altInput)),lt=le.type==="blur"?He&&le.relatedTarget&&!_e(le.relatedTarget):!He&&!Ae&&!_e(le.relatedTarget),Qe=!r.config.ignoredFocusElements.some(Dt=>Dt.contains(de));lt&&Qe&&(r.timeContainer!==void 0&&r.minuteElement!==void 0&&r.hourElement!==void 0&&r.input.value!==""&&r.input.value!==void 0&&s(),r.close(),r.config&&r.config.mode==="range"&&r.selectedDates.length===1&&(r.clear(!1),r.redraw()))}}function Le(le){if(!le||r.config.minDate&&le<r.config.minDate.getFullYear()||r.config.maxDate&&le>r.config.maxDate.getFullYear())return;let de=le,Ae=r.currentYear!==de;r.currentYear=de||r.currentYear,r.config.maxDate&&r.currentYear===r.config.maxDate.getFullYear()?r.currentMonth=Math.min(r.config.maxDate.getMonth(),r.currentMonth):r.config.minDate&&r.currentYear===r.config.minDate.getFullYear()&&(r.currentMonth=Math.max(r.config.minDate.getMonth(),r.currentMonth)),Ae&&(r.redraw(),er("onYearChange"),S())}function it(le,de=!0){var Ae;let He=r.parseDate(le,void 0,de);if(r.config.minDate&&He&&la(He,r.config.minDate,de!==void 0?de:!r.minDateHasTime)<0||r.config.maxDate&&He&&la(He,r.config.maxDate,de!==void 0?de:!r.maxDateHasTime)>0)return!1;if(!r.config.enable&&r.config.disable.length===0)return!0;if(He===void 0)return!1;let lt=!!r.config.enable,Qe=(Ae=r.config.enable)!==null&&Ae!==void 0?Ae:r.config.disable;for(let Dt=0,_t;Dt<Qe.length;Dt++){if(_t=Qe[Dt],typeof _t=="function"&&_t(He))return lt;if(_t instanceof Date&&He!==void 0&&_t.getTime()===He.getTime())return lt;if(typeof _t=="string"){let Xt=r.parseDate(_t,void 0,!0);return Xt&&Xt.getTime()===He.getTime()?lt:!lt}else if(typeof _t=="object"&&He!==void 0&&_t.from&&_t.to&&He.getTime()>=_t.from.getTime()&&He.getTime()<=_t.to.getTime())return lt}return!lt}function ze(le){return r.daysContainer!==void 0?le.className.indexOf("hidden")===-1&&le.className.indexOf("flatpickr-disabled")===-1&&r.daysContainer.contains(le):!1}function tt(le){le.target===r._input&&(r.selectedDates.length>0||r._input.value.length>0)&&!(le.relatedTarget&&_e(le.relatedTarget))&&r.setDate(r._input.value,!0,le.target===r.altInput?r.config.altFormat:r.config.dateFormat)}function wt(le){let de=sa(le),Ae=r.config.wrap?t.contains(de):de===r._input,He=r.config.allowInput,lt=r.isOpen&&(!He||!Ae),Qe=r.config.inline&&Ae&&!He;if(le.keyCode===13&&Ae){if(He)return r.setDate(r._input.value,!0,de===r.altInput?r.config.altFormat:r.config.dateFormat),de.blur();r.open()}else if(_e(de)||lt||Qe){let Dt=!!r.timeContainer&&r.timeContainer.contains(de);switch(le.keyCode){case 13:Dt?(le.preventDefault(),s(),Fe()):It(le);break;case 27:le.preventDefault(),Fe();break;case 8:case 46:Ae&&!r.config.allowInput&&(le.preventDefault(),r.clear());break;case 37:case 39:if(!Dt&&!Ae){if(le.preventDefault(),r.daysContainer!==void 0&&(He===!1||document.activeElement&&ze(document.activeElement))){let Xt=le.keyCode===39?1:-1;le.ctrlKey?(le.stopPropagation(),G(Xt),F(C(1),0)):F(void 0,Xt)}}else r.hourElement&&r.hourElement.focus();break;case 38:case 40:le.preventDefault();let _t=le.keyCode===40?1:-1;r.daysContainer&&de.$i!==void 0||de===r.input||de===r.altInput?le.ctrlKey?(le.stopPropagation(),Le(r.currentYear-_t),F(C(1),0)):Dt||F(void 0,_t*7):de===r.currentYearElement?Le(r.currentYear-_t):r.config.enableTime&&(!Dt&&r.hourElement&&r.hourElement.focus(),s(le),r._debouncedChange());break;case 9:if(Dt){let Xt=[r.hourElement,r.minuteElement,r.secondElement,r.amPM].concat(r.pluginElements).filter(dr=>dr),Yt=Xt.indexOf(de);if(Yt!==-1){let dr=Xt[Yt+(le.shiftKey?-1:1)];le.preventDefault(),(dr||r._input).focus()}}else!r.config.noCalendar&&r.daysContainer&&r.daysContainer.contains(de)&&le.shiftKey&&(le.preventDefault(),r._input.focus());break;default:break}}if(r.amPM!==void 0&&de===r.amPM)switch(le.key){case r.l10n.amPM[0].charAt(0):case r.l10n.amPM[0].charAt(0).toLowerCase():r.amPM.textContent=r.l10n.amPM[0],f(),tr();break;case r.l10n.amPM[1].charAt(0):case r.l10n.amPM[1].charAt(0).toLowerCase():r.amPM.textContent=r.l10n.amPM[1],f(),tr();break}(Ae||_e(de))&&er("onKeyDown",le)}function At(le){if(r.selectedDates.length!==1||le&&(!le.classList.contains("flatpickr-day")||le.classList.contains("flatpickr-disabled")))return;let de=le?le.dateObj.getTime():r.days.firstElementChild.dateObj.getTime(),Ae=r.parseDate(r.selectedDates[0],void 0,!0).getTime(),He=Math.min(de,r.selectedDates[0].getTime()),lt=Math.max(de,r.selectedDates[0].getTime()),Qe=!1,Dt=0,_t=0;for(let Xt=He;Xt<lt;Xt+=yoe.DAY)it(new Date(Xt),!0)||(Qe=Qe||Xt>He&&Xt<lt,Xt<Ae&&(!Dt||Xt>Dt)?Dt=Xt:Xt>Ae&&(!_t||Xt<_t)&&(_t=Xt));for(let Xt=0;Xt<r.config.showMonths;Xt++){let Yt=r.daysContainer.children[Xt];for(let dr=0,sn=Yt.children.length;dr<sn;dr++){let zr=Yt.children[dr],Hr=zr.dateObj.getTime(),Zn=Dt>0&&Hr<Dt||_t>0&&Hr>_t;if(Zn){zr.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(Wi=>{zr.classList.remove(Wi)});continue}else if(Qe&&!Zn)continue;["startRange","inRange","endRange","notAllowed"].forEach(Wi=>{zr.classList.remove(Wi)}),le!==void 0&&(le.classList.add(de<=r.selectedDates[0].getTime()?"startRange":"endRange"),Ae<de&&Hr===Ae?zr.classList.add("startRange"):Ae>de&&Hr===Ae&&zr.classList.add("endRange"),Hr>=Dt&&(_t===0||Hr<=_t)&&voe(Hr,Ae,de)&&zr.classList.add("inRange"))}}}function Ve(){r.isOpen&&!r.config.static&&!r.config.inline&&fe()}function Oe(le,de=r._positionElement){if(r.isMobile===!0){if(le){le.preventDefault();let He=sa(le);He&&He.blur()}r.mobileInput!==void 0&&(r.mobileInput.focus(),r.mobileInput.click()),er("onOpen");return}else if(r._input.disabled||r.config.inline)return;let Ae=r.isOpen;r.isOpen=!0,Ae||(r.calendarContainer.classList.add("open"),r._input.classList.add("active"),er("onOpen"),fe(de)),r.config.enableTime===!0&&r.config.noCalendar===!0&&r.config.allowInput===!1&&(le===void 0||!r.timeContainer.contains(le.relatedTarget))&&setTimeout(()=>r.hourElement.select(),50)}function Me(le){return de=>{let Ae=r.config[`_${le}Date`]=r.parseDate(de,r.config.dateFormat),He=r.config[`_${le==="min"?"max":"min"}Date`];Ae!==void 0&&(r[le==="min"?"minDateHasTime":"maxDateHasTime"]=Ae.getHours()>0||Ae.getMinutes()>0||Ae.getSeconds()>0),r.selectedDates&&(r.selectedDates=r.selectedDates.filter(lt=>it(lt)),!r.selectedDates.length&&le==="min"&&p(Ae),tr()),r.daysContainer&&($e(),Ae!==void 0?r.currentYearElement[le]=Ae.getFullYear().toString():r.currentYearElement.removeAttribute(le),r.currentYearElement.disabled=!!He&&Ae!==void 0&&He.getFullYear()===Ae.getFullYear())}}function he(){let le=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],de=Object.assign(Object.assign({},JSON.parse(JSON.stringify(t.dataset||{}))),e),Ae={};r.config.parseDate=de.parseDate,r.config.formatDate=de.formatDate,Object.defineProperty(r.config,"enable",{get:()=>r.config._enable,set:Qe=>{r.config._enable=xe(Qe)}}),Object.defineProperty(r.config,"disable",{get:()=>r.config._disable,set:Qe=>{r.config._disable=xe(Qe)}});let He=de.mode==="time";if(!de.dateFormat&&(de.enableTime||He)){let Qe=li.defaultConfig.dateFormat||Of.dateFormat;Ae.dateFormat=de.noCalendar||He?"H:i"+(de.enableSeconds?":S":""):Qe+" H:i"+(de.enableSeconds?":S":"")}if(de.altInput&&(de.enableTime||He)&&!de.altFormat){let Qe=li.defaultConfig.altFormat||Of.altFormat;Ae.altFormat=de.noCalendar||He?"h:i"+(de.enableSeconds?":S K":" K"):Qe+` h:i${de.enableSeconds?":S":""} K`}Object.defineProperty(r.config,"minDate",{get:()=>r.config._minDate,set:Me("min")}),Object.defineProperty(r.config,"maxDate",{get:()=>r.config._maxDate,set:Me("max")});let lt=Qe=>Dt=>{r.config[Qe==="min"?"_minTime":"_maxTime"]=r.parseDate(Dt,"H:i:S")};Object.defineProperty(r.config,"minTime",{get:()=>r.config._minTime,set:lt("min")}),Object.defineProperty(r.config,"maxTime",{get:()=>r.config._maxTime,set:lt("max")}),de.mode==="time"&&(r.config.noCalendar=!0,r.config.enableTime=!0),Object.assign(r.config,Ae,de);for(let Qe=0;Qe<le.length;Qe++)r.config[le[Qe]]=r.config[le[Qe]]===!0||r.config[le[Qe]]==="true";tE.filter(Qe=>r.config[Qe]!==void 0).forEach(Qe=>{r.config[Qe]=iE(r.config[Qe]||[]).map(o)}),r.isMobile=!r.config.disableMobile&&!r.config.inline&&r.config.mode==="single"&&!r.config.disable.length&&!r.config.enable&&!r.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(let Qe=0;Qe<r.config.plugins.length;Qe++){let Dt=r.config.plugins[Qe](r)||{};for(let _t in Dt)tE.indexOf(_t)>-1?r.config[_t]=iE(Dt[_t]).map(o).concat(r.config[_t]):typeof de[_t]>"u"&&(r.config[_t]=Dt[_t])}de.altInputClass||(r.config.altInputClass=J().className+" "+r.config.altInputClass),er("onParseConfig")}function J(){return r.config.wrap?t.querySelector("[data-input]"):t}function re(){typeof r.config.locale!="object"&&typeof li.l10ns[r.config.locale]>"u"&&r.config.errorHandler(new Error(`flatpickr: invalid locale ${r.config.locale}`)),r.l10n=Object.assign(Object.assign({},li.l10ns.default),typeof r.config.locale=="object"?r.config.locale:r.config.locale!=="default"?li.l10ns[r.config.locale]:void 0),b0.K=`(${r.l10n.amPM[0]}|${r.l10n.amPM[1]}|${r.l10n.amPM[0].toLowerCase()}|${r.l10n.amPM[1].toLowerCase()})`,Object.assign(Object.assign({},e),JSON.parse(JSON.stringify(t.dataset||{}))).time_24hr===void 0&&li.defaultConfig.time_24hr===void 0&&(r.config.time_24hr=r.l10n.time_24hr),r.formatDate=oF(r),r.parseDate=oE({config:r.config,l10n:r.l10n})}function fe(le){if(typeof r.config.position=="function")return void r.config.position(r,le);if(r.calendarContainer===void 0)return;er("onPreCalendarPosition");let de=le||r._positionElement,Ae=Array.prototype.reduce.call(r.calendarContainer.children,(ki,ln)=>ki+ln.offsetHeight,0),He=r.calendarContainer.offsetWidth,lt=r.config.position.split(" "),Qe=lt[0],Dt=lt.length>1?lt[1]:null,_t=de.getBoundingClientRect(),Xt=window.innerHeight-_t.bottom,Yt=Qe==="above"||Qe!=="below"&&Xt<Ae&&_t.top>Ae,dr=window.pageYOffset+_t.top+(Yt?-Ae-2:de.offsetHeight+2);if(ho(r.calendarContainer,"arrowTop",!Yt),ho(r.calendarContainer,"arrowBottom",Yt),r.config.inline)return;let sn=window.pageXOffset+_t.left,zr=!1,go=!1;Dt==="center"?(sn-=(He-_t.width)/2,zr=!0):Dt==="right"&&(sn-=He-_t.width,go=!0),ho(r.calendarContainer,"arrowLeft",!zr&&!go),ho(r.calendarContainer,"arrowCenter",zr),ho(r.calendarContainer,"arrowRight",go);let Hr=window.document.body.offsetWidth-(window.pageXOffset+_t.right),Zn=sn+He>window.document.body.offsetWidth,Wi=Hr+He>window.document.body.offsetWidth;if(ho(r.calendarContainer,"rightMost",Zn),!r.config.static)if(r.calendarContainer.style.top=`${dr}px`,!Zn)r.calendarContainer.style.left=`${sn}px`,r.calendarContainer.style.right="auto";else if(!Wi)r.calendarContainer.style.left="auto",r.calendarContainer.style.right=`${Hr}px`;else{let ki=ht();if(ki===void 0)return;let ln=window.document.body.offsetWidth,Po=Math.max(0,ln/2-He/2),Ei=".flatpickr-calendar.centerMost:before",Ws=".flatpickr-calendar.centerMost:after",mo=ki.cssRules.length,Ro=`{left:${_t.left}px;right:auto;}`;ho(r.calendarContainer,"rightMost",!1),ho(r.calendarContainer,"centerMost",!0),ki.insertRule(`${Ei},${Ws}${Ro}`,mo),r.calendarContainer.style.left=`${Po}px`,r.calendarContainer.style.right="auto"}}function ht(){let le=null;for(let de=0;de<document.styleSheets.length;de++){let Ae=document.styleSheets[de];try{Ae.cssRules}catch{continue}le=Ae;break}return le??ke()}function ke(){let le=document.createElement("style");return document.head.appendChild(le),le.sheet}function $e(){r.config.noCalendar||r.isMobile||(S(),Zt(),V())}function Fe(){r._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(r.close,0):r.close()}function It(le){le.preventDefault(),le.stopPropagation();let de=Dt=>Dt.classList&&Dt.classList.contains("flatpickr-day")&&!Dt.classList.contains("flatpickr-disabled")&&!Dt.classList.contains("notAllowed"),Ae=rF(sa(le),de);if(Ae===void 0)return;let He=Ae,lt=r.latestSelectedDateObj=new Date(He.dateObj.getTime()),Qe=(lt.getMonth()<r.currentMonth||lt.getMonth()>r.currentMonth+r.config.showMonths-1)&&r.config.mode!=="range";if(r.selectedDateElem=He,r.config.mode==="single")r.selectedDates=[lt];else if(r.config.mode==="multiple"){let Dt=Ze(lt);Dt?r.selectedDates.splice(parseInt(Dt),1):r.selectedDates.push(lt)}else r.config.mode==="range"&&(r.selectedDates.length===2&&r.clear(!1,!1),r.latestSelectedDateObj=lt,r.selectedDates.push(lt),la(lt,r.selectedDates[0],!0)!==0&&r.selectedDates.sort((Dt,_t)=>Dt.getTime()-_t.getTime()));if(f(),Qe){let Dt=r.currentYear!==lt.getFullYear();r.currentYear=lt.getFullYear(),r.currentMonth=lt.getMonth(),Dt&&(er("onYearChange"),S()),er("onMonthChange")}if(Zt(),V(),tr(),!Qe&&r.config.mode!=="range"&&r.config.showMonths===1?_(He):r.selectedDateElem!==void 0&&r.hourElement===void 0&&r.selectedDateElem&&r.selectedDateElem.focus(),r.hourElement!==void 0&&r.hourElement!==void 0&&r.hourElement.focus(),r.config.closeOnSelect){let Dt=r.config.mode==="single"&&!r.config.enableTime,_t=r.config.mode==="range"&&r.selectedDates.length===2&&!r.config.enableTime;(Dt||_t)&&Fe()}w()}let ut={locale:[re,X],showMonths:[q,a,z],minDate:[k],maxDate:[k],clickOpens:[()=>{r.config.clickOpens===!0?(x(r._input,"focus",r.open),x(r._input,"click",r.open)):(r._input.removeEventListener("focus",r.open),r._input.removeEventListener("click",r.open))}]};function pt(le,de){if(le!==null&&typeof le=="object"){Object.assign(r.config,le);for(let Ae in le)ut[Ae]!==void 0&&ut[Ae].forEach(He=>He())}else r.config[le]=de,ut[le]!==void 0?ut[le].forEach(Ae=>Ae()):tE.indexOf(le)>-1&&(r.config[le]=iE(de));r.redraw(),tr(!0)}function st(le,de){let Ae=[];if(le instanceof Array)Ae=le.map(He=>r.parseDate(He,de));else if(le instanceof Date||typeof le=="number")Ae=[r.parseDate(le,de)];else if(typeof le=="string")switch(r.config.mode){case"single":case"time":Ae=[r.parseDate(le,de)];break;case"multiple":Ae=le.split(r.config.conjunction).map(He=>r.parseDate(He,de));break;case"range":Ae=le.split(r.l10n.rangeSeparator).map(He=>r.parseDate(He,de));break;default:break}else r.config.errorHandler(new Error(`Invalid date supplied: ${JSON.stringify(le)}`));r.selectedDates=r.config.allowInvalidPreload?Ae:Ae.filter(He=>He instanceof Date&&it(He,!1)),r.config.mode==="range"&&r.selectedDates.sort((He,lt)=>He.getTime()-lt.getTime())}function ye(le,de=!1,Ae=r.config.dateFormat){if(le!==0&&!le||le instanceof Array&&le.length===0)return r.clear(de);st(le,Ae),r.latestSelectedDateObj=r.selectedDates[r.selectedDates.length-1],r.redraw(),k(void 0,de),p(),r.selectedDates.length===0&&r.clear(!1),tr(de),de&&er("onChange")}function xe(le){return le.slice().map(de=>typeof de=="string"||typeof de=="number"||de instanceof Date?r.parseDate(de,void 0,!0):de&&typeof de=="object"&&de.from&&de.to?{from:r.parseDate(de.from,void 0),to:r.parseDate(de.to,void 0)}:de).filter(de=>de)}function We(){r.selectedDates=[],r.now=r.parseDate(r.config.now)||new Date;let le=r.config.defaultDate||((r.input.nodeName==="INPUT"||r.input.nodeName==="TEXTAREA")&&r.input.placeholder&&r.input.value===r.input.placeholder?null:r.input.value);le&&st(le,r.config.dateFormat),r._initialDate=r.selectedDates.length>0?r.selectedDates[0]:r.config.minDate&&r.config.minDate.getTime()>r.now.getTime()?r.config.minDate:r.config.maxDate&&r.config.maxDate.getTime()<r.now.getTime()?r.config.maxDate:r.now,r.currentYear=r._initialDate.getFullYear(),r.currentMonth=r._initialDate.getMonth(),r.selectedDates.length>0&&(r.latestSelectedDateObj=r.selectedDates[0]),r.config.minTime!==void 0&&(r.config.minTime=r.parseDate(r.config.minTime,"H:i")),r.config.maxTime!==void 0&&(r.config.maxTime=r.parseDate(r.config.maxTime,"H:i")),r.minDateHasTime=!!r.config.minDate&&(r.config.minDate.getHours()>0||r.config.minDate.getMinutes()>0||r.config.minDate.getSeconds()>0),r.maxDateHasTime=!!r.config.maxDate&&(r.config.maxDate.getHours()>0||r.config.maxDate.getMinutes()>0||r.config.maxDate.getSeconds()>0)}function bt(){if(r.input=J(),!r.input){r.config.errorHandler(new Error("Invalid input element specified"));return}r.input._type=r.input.type,r.input.type="text",r.input.classList.add("flatpickr-input"),r._input=r.input,r.config.altInput&&(r.altInput=jr(r.input.nodeName,r.config.altInputClass),r._input=r.altInput,r.altInput.placeholder=r.input.placeholder,r.altInput.disabled=r.input.disabled,r.altInput.required=r.input.required,r.altInput.tabIndex=r.input.tabIndex,r.altInput.type="text",r.input.setAttribute("type","hidden"),!r.config.static&&r.input.parentNode&&r.input.parentNode.insertBefore(r.altInput,r.input.nextSibling)),r.config.allowInput||r._input.setAttribute("readonly","readonly"),r._positionElement=r.config.positionElement||r._input}function Gr(){let le=r.config.enableTime?r.config.noCalendar?"time":"datetime-local":"date";r.mobileInput=jr("input",r.input.className+" flatpickr-mobile"),r.mobileInput.tabIndex=1,r.mobileInput.type=le,r.mobileInput.disabled=r.input.disabled,r.mobileInput.required=r.input.required,r.mobileInput.placeholder=r.input.placeholder,r.mobileFormatStr=le==="datetime-local"?"Y-m-d\\TH:i:S":le==="date"?"Y-m-d":"H:i:S",r.selectedDates.length>0&&(r.mobileInput.defaultValue=r.mobileInput.value=r.formatDate(r.selectedDates[0],r.mobileFormatStr)),r.config.minDate&&(r.mobileInput.min=r.formatDate(r.config.minDate,"Y-m-d")),r.config.maxDate&&(r.mobileInput.max=r.formatDate(r.config.maxDate,"Y-m-d")),r.input.getAttribute("step")&&(r.mobileInput.step=String(r.input.getAttribute("step"))),r.input.type="hidden",r.altInput!==void 0&&(r.altInput.type="hidden");try{r.input.parentNode&&r.input.parentNode.insertBefore(r.mobileInput,r.input.nextSibling)}catch{}x(r.mobileInput,"change",de=>{r.setDate(sa(de).value,!1,r.mobileFormatStr),er("onChange"),er("onClose")})}function mt(le){if(r.isOpen===!0)return r.close();r.open(le)}function er(le,de){if(r.config===void 0)return;let Ae=r.config[le];if(Ae!==void 0&&Ae.length>0)for(let He=0;Ae[He]&&He<Ae.length;He++)Ae[He](r.selectedDates,r.input.value,r,de);le==="onChange"&&(r.input.dispatchEvent(Ie("change")),r.input.dispatchEvent(Ie("input")))}function Ie(le){let de=document.createEvent("Event");return de.initEvent(le,!0,!0),de}function Ze(le){for(let de=0;de<r.selectedDates.length;de++)if(la(r.selectedDates[de],le)===0)return""+de;return!1}function dt(le){return r.config.mode!=="range"||r.selectedDates.length<2?!1:la(le,r.selectedDates[0])>=0&&la(le,r.selectedDates[1])<=0}function Zt(){r.config.noCalendar||r.isMobile||!r.monthNav||(r.yearElements.forEach((le,de)=>{let Ae=new Date(r.currentYear,r.currentMonth,1);Ae.setMonth(r.currentMonth+de),r.config.showMonths>1||r.config.monthSelectorType==="static"?r.monthElements[de].textContent=y0(Ae.getMonth(),r.config.shorthandCurrentMonth,r.l10n)+" ":r.monthsDropdownContainer.value=Ae.getMonth().toString(),le.value=Ae.getFullYear().toString()}),r._hidePrevMonthArrow=r.config.minDate!==void 0&&(r.currentYear===r.config.minDate.getFullYear()?r.currentMonth<=r.config.minDate.getMonth():r.currentYear<r.config.minDate.getFullYear()),r._hideNextMonthArrow=r.config.maxDate!==void 0&&(r.currentYear===r.config.maxDate.getFullYear()?r.currentMonth+1>r.config.maxDate.getMonth():r.currentYear>r.config.maxDate.getFullYear()))}function jt(le){return r.selectedDates.map(de=>r.formatDate(de,le)).filter((de,Ae,He)=>r.config.mode!=="range"||r.config.enableTime||He.indexOf(de)===Ae).join(r.config.mode!=="range"?r.config.conjunction:r.l10n.rangeSeparator)}function tr(le=!0){r.mobileInput!==void 0&&r.mobileFormatStr&&(r.mobileInput.value=r.latestSelectedDateObj!==void 0?r.formatDate(r.latestSelectedDateObj,r.mobileFormatStr):""),r.input.value=jt(r.config.dateFormat),r.altInput!==void 0&&(r.altInput.value=jt(r.config.altFormat)),le!==!1&&er("onValueUpdate")}function sr(le){let de=sa(le),Ae=r.prevMonthNav.contains(de),He=r.nextMonthNav.contains(de);Ae||He?G(Ae?-1:1):r.yearElements.indexOf(de)>=0?de.select():de.classList.contains("arrowUp")?r.changeYear(r.currentYear+1):de.classList.contains("arrowDown")&&r.changeYear(r.currentYear-1)}function zn(le){le.preventDefault();let de=le.type==="keydown",Ae=sa(le),He=Ae;r.amPM!==void 0&&Ae===r.amPM&&(r.amPM.textContent=r.l10n.amPM[aa(r.amPM.textContent===r.l10n.amPM[0])]);let lt=parseFloat(He.getAttribute("min")),Qe=parseFloat(He.getAttribute("max")),Dt=parseFloat(He.getAttribute("step")),_t=parseInt(He.value,10),Xt=le.delta||(de?le.which===38?1:-1:0),Yt=_t+Dt*Xt;if(typeof He.value<"u"&&He.value.length===2){let dr=He===r.hourElement,sn=He===r.minuteElement;Yt<lt?(Yt=Qe+Yt+aa(!dr)+(aa(dr)&&aa(!r.amPM)),sn&&D(void 0,-1,r.hourElement)):Yt>Qe&&(Yt=He===r.hourElement?Yt-Qe-aa(!r.amPM):lt,sn&&D(void 0,1,r.hourElement)),r.amPM&&dr&&(Dt===1?Yt+_t===23:Math.abs(Yt-_t)>Dt)&&(r.amPM.textContent=r.l10n.amPM[aa(r.amPM.textContent===r.l10n.amPM[0])]),He.value=fo(Yt)}}return i(),r}function pm(t,e){let r=Array.prototype.slice.call(t).filter(i=>i instanceof HTMLElement),n=[];for(let i=0;i<r.length;i++){let o=r[i];try{if(o.getAttribute("data-fp-omit")!==null)continue;o._flatpickr!==void 0&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=SQe(o,e||{}),n.push(o._flatpickr)}catch(a){console.error(a)}}return n.length===1?n[0]:n}var _Qe,li,woe,_oe=se(()=>{Zq();Jq();tF();goe();boe();iF();xoe();_Qe=300;typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(t){return pm(this,t)},HTMLElement.prototype.flatpickr=function(t){return pm([this],t)});li=function(t,e){return typeof t=="string"?pm(window.document.querySelectorAll(t),e):t instanceof Node?pm([t],e):pm(t,e)};li.defaultConfig={};li.l10ns={en:Object.assign({},nE),default:Object.assign({},nE)};li.localize=t=>{li.l10ns.default=Object.assign(Object.assign({},li.l10ns.default),t)};li.setDefaults=t=>{li.defaultConfig=Object.assign(Object.assign({},li.defaultConfig),t)};li.parseDate=oE({});li.formatDate=oF({});li.compareDates=la;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(t){return pm(this,t)});Date.prototype.fp_incr=function(t){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof t=="string"?parseInt(t,10):t))};typeof window<"u"&&(window.flatpickr=li);woe=li});function Soe(t){return new Date(new Date(t).getTime()+new Date(t).getTimezoneOffset()*60*1e3)}var x0,w0,koe=se(()=>{Pr();x0=Vr(poe());_oe();w0=class extends Ct{get browserZone(){return x0.DateTime.local().zoneName}get initialValue(){return this.isOnShow||this.isOnIndex?this.context.element.innerText:this.isOnEdit?this.inputTarget.value:null}get isOnIndex(){return this.viewValue==="index"}get isOnEdit(){return this.viewValue==="edit"}get isOnShow(){return this.viewValue==="show"}get parsedValue(){return x0.DateTime.fromISO(this.initialValue,{zone:"UTC"})}get displayTimezone(){return this.timezoneValue||this.browserZone}connect(){this.isOnShow||this.isOnIndex?this.initShow():this.isOnEdit&&this.initEdit()}initShow(){let t=this.parsedValue;this.enableTimeValue&&(t=t.setZone(this.displayTimezone)),this.context.element.innerText=t.toFormat(this.formatValue)}initEdit(){let t={enableTime:!1,enableSeconds:!1,time_24hr:this.time24HrValue,locale:{firstDayOfWeek:0},altInput:!0,onChange:this.onChange.bind(this)};t.altFormat=this.pickerFormatValue,t.disableMobile=this.disableMobileValue,t.locale.firstDayOfWeek=this.firstDayOfWeekValue,t.enableTime=this.enableTimeValue,t.enableSeconds=this.enableTimeValue,this.enableTimeValue?(t.defaultDate=this.parsedValue.setZone(this.displayTimezone).toISO(),t.dateFormat="Y-m-d H:i:S"):t.defaultDate=Soe(this.initialValue),woe(this.fakeInputTarget,t),this.enableTimeValue?this.updateRealInput(this.parsedValue.setZone(this.displayTimezone).toISO()):this.updateRealInput(Soe(this.initialValue))}onChange(t){if(t.length===0){this.updateRealInput("");return}let e,r={};this.timezoneValue?r={keepLocalTime:!0}:r={keepLocalTime:!1},this.enableTimeValue?e=x0.DateTime.fromISO(t[0].toISOString()).setZone("UTC",r):e=x0.DateTime.fromISO(t[0].toISOString()).setZone("UTC",{keepLocalTime:!0}),this.updateRealInput(e)}updateRealInput(t){this.inputTarget.value=t}};vt(w0,"targets",["input","fakeInput"]),vt(w0,"values",{view:String,timezone:String,format:String,enableTime:Boolean,pickerFormat:String,firstDayOfWeek:Number,time24Hr:Boolean,disableMobile:Boolean})});var sE,Eoe=se(()=>{Pr();sE=class extends Ct{showContent(t){this.contentTarget.classList.toggle("hidden"),t.target.classList.add("hidden")}};vt(sE,"targets",["content"])});var _0,Coe=se(()=>{Pr();_0=class extends Ct{connect(){this.resourceName=this.element.dataset.resourceName}toggle(t){let e=!!t.target.checked;document.querySelectorAll(`[data-controller="item-selector"][data-resource-name="${this.resourceName}"] input[type=checkbox]`).forEach(r=>r.checked!==e&&r.click()),this.pageCountValue>1&&(this.selectAllOverlay(e),e||this.resetUnselected())}selectRow(){let t=!0;this.itemCheckboxTargets.forEach(e=>t=t&&e.checked),this.checkboxTarget.checked=t,this.pageCountValue>1&&(this.selectAllOverlay(t),this.resetUnselected())}selectAll(t){t.preventDefault(),this.selectedAllValue=!this.selectedAllValue,this.unselectedMessageTarget.classList.toggle("hidden"),this.selectedMessageTarget.classList.toggle("hidden")}resetUnselected(){this.selectedAllValue=!1,this.unselectedMessageTarget.classList.remove("hidden"),this.selectedMessageTarget.classList.add("hidden")}selectAllOverlay(t){t?this.selectAllOverlayTarget.classList.remove("hidden"):this.selectAllOverlayTarget.classList.add("hidden")}};vt(_0,"targets",["itemCheckbox","checkbox","selectAllOverlay","unselectedMessage","selectedMessage"]),vt(_0,"values",{pageCount:Number,selectedAll:Boolean,selectedAllQuery:String})});var lE,Aoe=se(()=>{Pr();lE=class extends Ct{constructor(){super(...arguments);vt(this,"checkbox",{});vt(this,"enabledClasses",["text-black"]);vt(this,"disabledClasses",["text-gray-500"])}get actionsPanelPresent(){return this.actionsButtonElement!==null}get currentIds(){try{return JSON.parse(this.stateHolderElement.dataset.selectedResources)}catch(t){return[]}}get actionLinks(){return document.querySelectorAll('.js-actions-dropdown a[data-actions-picker-target="resourceAction"]')}set currentIds(t){this.stateHolderElement.dataset.selectedResources=JSON.stringify(t),this.actionsPanelPresent&&(t.length>0?this.enableResourceActions():this.disableResourceActions())}connect(){this.resourceName=this.element.dataset.resourceName,this.resourceId=this.element.dataset.resourceId,this.actionsButtonElement=document.querySelector(`[data-actions-dropdown-button="${this.resourceName}"]`),this.stateHolderElement=document.querySelector(`[data-selected-resources-name="${this.resourceName}"]`)}addToSelected(){let t=this.currentIds;t.push(this.resourceId),this.currentIds=t}removeFromSelected(){this.currentIds=this.currentIds.filter(t=>t.toString()!==this.resourceId)}toggle(t){this.checkbox=t.target,this.checkbox.checked?this.addToSelected():this.removeFromSelected()}enableResourceActions(){this.actionLinks.forEach(t=>{t.classList.add(...this.enabledClasses),t.classList.remove(...this.disabledClasses),t.setAttribute("data-href",t.getAttribute("href")),t.dataset.disabled=!1})}disableResourceActions(){this.actionLinks.forEach(t=>{t.classList.remove(...this.enabledClasses),t.classList.add(...this.disabledClasses),t.setAttribute("href",t.getAttribute("data-href")),t.dataset.disabled=!0})}};vt(lE,"targets",["panel"])});var uE,Toe=se(()=>{Pr();Qg();uE=class extends Ct{constructor(){super(...arguments);vt(this,"fieldValue",[]);vt(this,"options",{})}get keyInputDisabled(){return!this.options.editable||this.options.disable_editing_keys}get valueInputDisabled(){return!this.options.editable}connect(){this.setOptions();try{let t=JSON.parse(this.inputTarget.value);Object.keys(t).forEach(e=>this.fieldValue.push([e,t[e]]))}catch(t){this.fieldValue=[]}this.updateKeyValueComponent()}addRow(){this.options.disable_adding_rows||!this.options.editable||(this.fieldValue.push(["",""]),this.updateKeyValueComponent(),this.focusLastRow())}deleteRow(t){if(this.options.disable_deleting_rows||!this.options.editable)return;let{index:e}=t.params;this.fieldValue.splice(e,1),this.updateTextareaInput(),this.updateKeyValueComponent()}focusLastRow(){return this.rowsTarget.querySelector(".flex.key-value-row:last-child .key-value-input-key").focus()}valueFieldUpdated(t){let{value:e}=t.target,{index:r}=t.target.dataset;this.fieldValue[r][1]=e,this.updateTextareaInput()}keyFieldUpdated(t){let{value:e}=t.target,{index:r}=t.target.dataset;this.fieldValue[r][0]=e,this.updateTextareaInput()}updateTextareaInput(){if(!this.hasInputTarget)return;let t={};this.fieldValue&&this.fieldValue.length>0&&(t=Object.assign(...this.fieldValue.map(([e,r])=>({[e]:r})))),this.inputTarget.innerText=JSON.stringify(t),this.inputTarget.dispatchEvent(new Event("input"))}updateKeyValueComponent(){let t="",e=0;this.fieldValue.forEach(r=>{let[n,i]=r;t+=this.interpolatedRow(n,i,e),e++}),this.rowsTarget.innerHTML=t,window.initTippy()}interpolatedRow(t,e,r){let n=`<div class="flex key-value-row">
73
73
  ${this.inputField("key",r,t,e)}
74
74
  ${this.inputField("value",r,t,e)}`;return this.options.editable&&(n+=`<a
75
75
  href="javascript:void(0);"
@@ -413,7 +413,7 @@ function print() { __p += __j.call(arguments, '') }
413
413
  %t [data-trix-cursor-target=right] {
414
414
  vertical-align: bottom !important;
415
415
  margin-right: -1px !important;
416
- }`,trixId:{get:function(){return this.hasAttribute("trix-id")?this.getAttribute("trix-id"):(this.setAttribute("trix-id",++T),this.trixId)}},labels:{get:function(){var D,M,P;return M=[],this.id&&this.ownerDocument&&M.push.apply(M,this.ownerDocument.querySelectorAll("label[for='"+this.id+"']")),(D=i(this,{matchingSelector:"label"}))&&((P=D.control)===this||P===null)&&M.push(D),M}},toolbarElement:{get:function(){var D,M,P;return this.hasAttribute("toolbar")?(M=this.ownerDocument)!=null?M.getElementById(this.getAttribute("toolbar")):void 0:this.parentNode?(P="trix-toolbar-"+this.trixId,this.setAttribute("toolbar",P),D=s("trix-toolbar",{id:P}),this.parentNode.insertBefore(D,this),D):void 0}},inputElement:{get:function(){var D,M,P;return this.hasAttribute("input")?(P=this.ownerDocument)!=null?P.getElementById(this.getAttribute("input")):void 0:this.parentNode?(M="trix-input-"+this.trixId,this.setAttribute("input",M),D=s("input",{type:"hidden",id:M}),this.parentNode.insertBefore(D,this.nextElementSibling),D):void 0}},editor:{get:function(){var D;return(D=this.editorController)!=null?D.editor:void 0}},name:{get:function(){var D;return(D=this.inputElement)!=null?D.name:void 0}},value:{get:function(){var D;return(D=this.inputElement)!=null?D.value:void 0},set:function(D){var M;return this.defaultValue=D,(M=this.editor)!=null?M.loadHTML(this.defaultValue):void 0}},notify:function(D,M){return this.editorController?u("trix-"+D,{onElement:this,attributes:M}):void 0},setInputElementValue:function(D){var M;return(M=this.inputElement)!=null?M.value=D:void 0},initialize:function(){return this.hasAttribute("data-trix-internal")?void 0:(k(this),f(this),w(this))},connect:function(){return this.hasAttribute("data-trix-internal")?void 0:(this.editorController||(u("trix-before-initialize",{onElement:this}),this.editorController=new e.EditorController({editorElement:this,html:this.defaultValue=this.value}),requestAnimationFrame(function(D){return function(){return u("trix-initialize",{onElement:D})}}(this))),this.editorController.registerSelectionManager(),this.registerResetListener(),this.registerClickListener(),p(this))},disconnect:function(){var D;return(D=this.editorController)!=null&&D.unregisterSelectionManager(),this.unregisterResetListener(),this.unregisterClickListener()},registerResetListener:function(){return this.resetListener=this.resetBubbled.bind(this),window.addEventListener("reset",this.resetListener,!1)},unregisterResetListener:function(){return window.removeEventListener("reset",this.resetListener,!1)},registerClickListener:function(){return this.clickListener=this.clickBubbled.bind(this),window.addEventListener("click",this.clickListener,!1)},unregisterClickListener:function(){return window.removeEventListener("click",this.clickListener,!1)},resetBubbled:function(D){var M;if(!D.defaultPrevented&&D.target===((M=this.inputElement)!=null?M.form:void 0))return this.reset()},clickBubbled:function(D){var M;if(!(D.defaultPrevented||this.contains(D.target)||!(M=i(D.target,{matchingSelector:"label"}))||c.call(this.labels,M)<0))return this.focus()},reset:function(){return this.value=this.defaultValue}}}())}.call(this),function(){}.call(this)}).call(this),typeof Ah=="object"&&Ah.exports?Ah.exports=e:typeof define=="function"&&define.amd&&define(e)}.call(Ch)});var kIt,SC,ade=se(()=>{kIt=Vr(ode());Pr();Qg();SC=class extends Ct{get resourceId(){return this.controllerTarget.dataset.resourceId}get resourceName(){return this.controllerTarget.dataset.resourceName}get attachmentKey(){return this.controllerTarget.dataset.attachmentKey}get attachmentsDisabled(){return Mo(this.controllerTarget.dataset.attachmentsDisabled)}get hideAttachmentFilename(){return Mo(this.controllerTarget.dataset.hideAttachmentFilename)}get hideAttachmentFilesize(){return Mo(this.controllerTarget.dataset.hideAttachmentFilesize)}get hideAttachmentUrl(){return Mo(this.controllerTarget.dataset.hideAttachmentUrl)}get uploadUrl(){return`${window.location.origin}${window.Avo.configuration.root_path}/avo_api/resources/${this.resourceName}/${this.resourceId}/attachments`}connect(){this.attachmentsDisabled&&this.controllerTarget.querySelector(".trix-button-group--file-tools").remove(),window.addEventListener("trix-file-accept",t=>{if(t.target===this.editorTarget){if(this.attachmentsDisabled){t.preventDefault(),window.toastr.warning("This field has attachments disabled.");return}if(this.resourceId===""){t.preventDefault(),window.toastr.warning("You can't upload files into the Trix editor until you save the resource.");return}this.attachmentKey===""&&(t.preventDefault(),window.toastr.warning("You haven't set an <a href='https://google.com' class='!text-blue-700 underline'>attachment_key</a> to this Trix field."))}}),window.addEventListener("trix-attachment-add",t=>{t.target===this.editorTarget&&t.attachment.file&&this.uploadFileAttachment(t.attachment)})}uploadFileAttachment(t){this.uploadFile(t.file,e=>t.setUploadProgress(e),e=>t.setAttributes(e))}uploadFile(t,e,r){let n=this.createFormData(t),i=new XMLHttpRequest;i.open("POST",this.uploadUrl,!0),i.setRequestHeader("X-CSRF-Token",document.querySelector('meta[name="csrf-token"]').content),i.upload.addEventListener("progress",o=>{let a=o.loaded/o.total*100;e(a)}),i.addEventListener("load",()=>{if(i.status===200){let o;try{o=JSON.parse(i.response)}catch(s){o={}}let a={url:o.url,href:o.href};this.hideAttachmentFilename&&(a.filename=null),this.hideAttachmentFilesize&&(a.filesize=null),this.hideAttachmentUrl&&(a.href=null),r(a)}}),i.send(n)}createFormData(t){let e=new FormData;return e.append("Content-Type",t.type),e.append("file",t),e.append("filename",t.name),e.append("attachment_key",this.attachmentKey),e}};vt(SC,"targets",["editor","controller"])});var sde=se(()=>{Mre();Ire();jre();zre();Hre();Gre();iie();oie();aie();koe();tm();Eoe();Coe();Aoe();Toe();Doe();Ooe();Moe();Ioe();Loe();mse();vse();yse();Lce();Rce();qce();zce();Mfe();Ife();jfe();zfe();Hfe();ide();ade();mr.register("action",S1);mr.register("actions-picker",i0);mr.register("attachments",T1);mr.register("boolean-filter",P1);mr.register("copy-to-clipboard",lq);mr.register("dashboard-card",B1);mr.register("filter",Ca);mr.register("hidden-input",sE);mr.register("item-select-all",_0);mr.register("item-selector",lE);mr.register("loading-button",cE);mr.register("menu",fE);mr.register("modal",dE);mr.register("multiple-select-filter",hE);mr.register("per-page",pE);mr.register("resource-edit",E0);mr.register("resource-index",cF);mr.register("resource-show",fF);mr.register("search",jE);mr.register("select",zE);mr.register("select-filter",HE);mr.register("sidebar",L0);mr.register("tabs",N0);mr.register("tags-field",vC);mr.register("text-filter",yC);mr.register("tippy",bC);mr.register("toggle-panel",_C);mr.register("belongs-to-field",D1);mr.register("code-field",N1);mr.register("date-field",w0);mr.register("key-value",uE);mr.register("simple-mde",mC);mr.register("trix-field",SC)});var Vrt=Z(fde=>{var uLt=Vr(uX()),cLt=Vr(cX()),lde=Vr(dX()),ude=Vr(fL());ML();var cde=Vr(uQ());lP();Qte();Zte();sde();cde.default.start();window.Turbolinks=$d;var kC=null;ude.bind("r r r",()=>{kC=document.scrollingElement.scrollTop,$d.visit(window.location.href,{action:"replace"})});function Urt(){window.navigator.userAgent.indexOf("Mac OS X")>=0?(document.body.classList.add("os-mac"),document.body.classList.remove("os-pc")):(document.body.classList.add("os-pc"),document.body.classList.remove("os-mac"))}function dN(){JS('[data-tippy="tooltip"]',{theme:"light",content(t){let e=t.getAttribute("title");return t.removeAttribute("title"),t.removeAttribute("data-tippy"),e}})}window.initTippy=dN;lde.start();document.addEventListener("turbo:load",()=>{document.body.classList.remove("turbo-loading"),dN(),Urt(),kC&&setTimeout(()=>{document.scrollingElement.scrollTo(0,kC),kC=0},50)});document.addEventListener("turbo:frame-load",()=>{dN()});document.addEventListener("turbo:before-fetch-response",t=>XN(fde,null,function*(){var e,r,n;if(t.detail.fetchResponse.response.status===500){let{id:i,src:o}=t.target;(n=(r=(e=t.detail.fetchResponse)==null?void 0:e.response)==null?void 0:r.url)!=null&&n.includes("/failed_to_load")||(t.target.src=`${window.Avo.configuration.root_path}/failed_to_load?turbo_frame=${i}&src=${o}`)}}));document.addEventListener("turbo:visit",()=>document.body.classList.add("turbo-loading"));document.addEventListener("turbo:submit-start",()=>document.body.classList.add("turbo-loading"));document.addEventListener("turbo:submit-end",()=>document.body.classList.remove("turbo-loading"));document.addEventListener("turbo:before-cache",()=>{document.querySelectorAll("[data-turbo-remove-before-cache]").forEach(t=>t.remove())});window.Avo=window.Avo||{configuration:{}};window.Avo.menus={resetCollapsedState(){Array.from(document.querySelectorAll("[data-menu-key-param]")).map(t=>t.getAttribute("data-menu-key-param")).filter(Boolean).forEach(t=>{window.localStorage.removeItem(t)})}}});Vrt();})();
416
+ }`,trixId:{get:function(){return this.hasAttribute("trix-id")?this.getAttribute("trix-id"):(this.setAttribute("trix-id",++T),this.trixId)}},labels:{get:function(){var D,M,P;return M=[],this.id&&this.ownerDocument&&M.push.apply(M,this.ownerDocument.querySelectorAll("label[for='"+this.id+"']")),(D=i(this,{matchingSelector:"label"}))&&((P=D.control)===this||P===null)&&M.push(D),M}},toolbarElement:{get:function(){var D,M,P;return this.hasAttribute("toolbar")?(M=this.ownerDocument)!=null?M.getElementById(this.getAttribute("toolbar")):void 0:this.parentNode?(P="trix-toolbar-"+this.trixId,this.setAttribute("toolbar",P),D=s("trix-toolbar",{id:P}),this.parentNode.insertBefore(D,this),D):void 0}},inputElement:{get:function(){var D,M,P;return this.hasAttribute("input")?(P=this.ownerDocument)!=null?P.getElementById(this.getAttribute("input")):void 0:this.parentNode?(M="trix-input-"+this.trixId,this.setAttribute("input",M),D=s("input",{type:"hidden",id:M}),this.parentNode.insertBefore(D,this.nextElementSibling),D):void 0}},editor:{get:function(){var D;return(D=this.editorController)!=null?D.editor:void 0}},name:{get:function(){var D;return(D=this.inputElement)!=null?D.name:void 0}},value:{get:function(){var D;return(D=this.inputElement)!=null?D.value:void 0},set:function(D){var M;return this.defaultValue=D,(M=this.editor)!=null?M.loadHTML(this.defaultValue):void 0}},notify:function(D,M){return this.editorController?u("trix-"+D,{onElement:this,attributes:M}):void 0},setInputElementValue:function(D){var M;return(M=this.inputElement)!=null?M.value=D:void 0},initialize:function(){return this.hasAttribute("data-trix-internal")?void 0:(k(this),f(this),w(this))},connect:function(){return this.hasAttribute("data-trix-internal")?void 0:(this.editorController||(u("trix-before-initialize",{onElement:this}),this.editorController=new e.EditorController({editorElement:this,html:this.defaultValue=this.value}),requestAnimationFrame(function(D){return function(){return u("trix-initialize",{onElement:D})}}(this))),this.editorController.registerSelectionManager(),this.registerResetListener(),this.registerClickListener(),p(this))},disconnect:function(){var D;return(D=this.editorController)!=null&&D.unregisterSelectionManager(),this.unregisterResetListener(),this.unregisterClickListener()},registerResetListener:function(){return this.resetListener=this.resetBubbled.bind(this),window.addEventListener("reset",this.resetListener,!1)},unregisterResetListener:function(){return window.removeEventListener("reset",this.resetListener,!1)},registerClickListener:function(){return this.clickListener=this.clickBubbled.bind(this),window.addEventListener("click",this.clickListener,!1)},unregisterClickListener:function(){return window.removeEventListener("click",this.clickListener,!1)},resetBubbled:function(D){var M;if(!D.defaultPrevented&&D.target===((M=this.inputElement)!=null?M.form:void 0))return this.reset()},clickBubbled:function(D){var M;if(!(D.defaultPrevented||this.contains(D.target)||!(M=i(D.target,{matchingSelector:"label"}))||c.call(this.labels,M)<0))return this.focus()},reset:function(){return this.value=this.defaultValue}}}())}.call(this),function(){}.call(this)}).call(this),typeof Ah=="object"&&Ah.exports?Ah.exports=e:typeof define=="function"&&define.amd&&define(e)}.call(Ch)});var kIt,SC,ade=se(()=>{kIt=Vr(ode());Pr();Qg();SC=class extends Ct{get resourceId(){return this.controllerTarget.dataset.resourceId}get resourceName(){return this.controllerTarget.dataset.resourceName}get attachmentKey(){return this.controllerTarget.dataset.attachmentKey}get attachmentsDisabled(){return Mo(this.controllerTarget.dataset.attachmentsDisabled)}get hideAttachmentFilename(){return Mo(this.controllerTarget.dataset.hideAttachmentFilename)}get hideAttachmentFilesize(){return Mo(this.controllerTarget.dataset.hideAttachmentFilesize)}get hideAttachmentUrl(){return Mo(this.controllerTarget.dataset.hideAttachmentUrl)}get uploadUrl(){return`${window.location.origin}${window.Avo.configuration.root_path}/avo_api/resources/${this.resourceName}/${this.resourceId}/attachments`}connect(){this.attachmentsDisabled&&this.controllerTarget.querySelector(".trix-button-group--file-tools").remove(),window.addEventListener("trix-file-accept",t=>{if(t.target===this.editorTarget){if(this.attachmentsDisabled){t.preventDefault(),alert("This field has attachments disabled.");return}if(this.resourceId===""){t.preventDefault(),alert("You can't upload files into the Trix editor until you save the resource.");return}this.attachmentKey===""&&(t.preventDefault(),alert("You haven't set an `attachment_key` to this Trix field."))}}),window.addEventListener("trix-attachment-add",t=>{t.target===this.editorTarget&&t.attachment.file&&this.uploadFileAttachment(t.attachment)})}uploadFileAttachment(t){this.uploadFile(t.file,e=>t.setUploadProgress(e),e=>t.setAttributes(e))}uploadFile(t,e,r){let n=this.createFormData(t),i=new XMLHttpRequest;i.open("POST",this.uploadUrl,!0),i.setRequestHeader("X-CSRF-Token",document.querySelector('meta[name="csrf-token"]').content),i.upload.addEventListener("progress",o=>{let a=o.loaded/o.total*100;e(a)}),i.addEventListener("load",()=>{if(i.status===200){let o;try{o=JSON.parse(i.response)}catch(s){o={}}let a={url:o.url,href:o.href};this.hideAttachmentFilename&&(a.filename=null),this.hideAttachmentFilesize&&(a.filesize=null),this.hideAttachmentUrl&&(a.href=null),r(a)}}),i.send(n)}createFormData(t){let e=new FormData;return e.append("Content-Type",t.type),e.append("file",t),e.append("filename",t.name),e.append("attachment_key",this.attachmentKey),e}};vt(SC,"targets",["editor","controller"])});var sde=se(()=>{Mre();Ire();jre();zre();Hre();Gre();iie();oie();aie();koe();tm();Eoe();Coe();Aoe();Toe();Doe();Ooe();Moe();Ioe();Loe();mse();vse();yse();Lce();Rce();qce();zce();Mfe();Ife();jfe();zfe();Hfe();ide();ade();mr.register("action",S1);mr.register("actions-picker",i0);mr.register("attachments",T1);mr.register("boolean-filter",P1);mr.register("copy-to-clipboard",lq);mr.register("dashboard-card",B1);mr.register("filter",Ca);mr.register("hidden-input",sE);mr.register("item-select-all",_0);mr.register("item-selector",lE);mr.register("loading-button",cE);mr.register("menu",fE);mr.register("modal",dE);mr.register("multiple-select-filter",hE);mr.register("per-page",pE);mr.register("resource-edit",E0);mr.register("resource-index",cF);mr.register("resource-show",fF);mr.register("search",jE);mr.register("select",zE);mr.register("select-filter",HE);mr.register("sidebar",L0);mr.register("tabs",N0);mr.register("tags-field",vC);mr.register("text-filter",yC);mr.register("tippy",bC);mr.register("toggle-panel",_C);mr.register("belongs-to-field",D1);mr.register("code-field",N1);mr.register("date-field",w0);mr.register("key-value",uE);mr.register("simple-mde",mC);mr.register("trix-field",SC)});var Vrt=Z(fde=>{var uLt=Vr(uX()),cLt=Vr(cX()),lde=Vr(dX()),ude=Vr(fL());ML();var cde=Vr(uQ());lP();Qte();Zte();sde();cde.default.start();window.Turbolinks=$d;var kC=null;ude.bind("r r r",()=>{kC=document.scrollingElement.scrollTop,$d.visit(window.location.href,{action:"replace"})});function Urt(){window.navigator.userAgent.indexOf("Mac OS X")>=0?(document.body.classList.add("os-mac"),document.body.classList.remove("os-pc")):(document.body.classList.add("os-pc"),document.body.classList.remove("os-mac"))}function dN(){JS('[data-tippy="tooltip"]',{theme:"light",content(t){let e=t.getAttribute("title");return t.removeAttribute("title"),t.removeAttribute("data-tippy"),e}})}window.initTippy=dN;lde.start();document.addEventListener("turbo:load",()=>{document.body.classList.remove("turbo-loading"),dN(),Urt(),kC&&setTimeout(()=>{document.scrollingElement.scrollTo(0,kC),kC=0},50)});document.addEventListener("turbo:frame-load",()=>{dN()});document.addEventListener("turbo:before-fetch-response",t=>XN(fde,null,function*(){var e,r,n;if(t.detail.fetchResponse.response.status===500){let{id:i,src:o}=t.target;(n=(r=(e=t.detail.fetchResponse)==null?void 0:e.response)==null?void 0:r.url)!=null&&n.includes("/failed_to_load")||(t.target.src=`${window.Avo.configuration.root_path}/failed_to_load?turbo_frame=${i}&src=${o}`)}}));document.addEventListener("turbo:visit",()=>document.body.classList.add("turbo-loading"));document.addEventListener("turbo:submit-start",()=>document.body.classList.add("turbo-loading"));document.addEventListener("turbo:submit-end",()=>document.body.classList.remove("turbo-loading"));document.addEventListener("turbo:before-cache",()=>{document.querySelectorAll("[data-turbo-remove-before-cache]").forEach(t=>t.remove())});window.Avo=window.Avo||{configuration:{}};window.Avo.menus={resetCollapsedState(){Array.from(document.querySelectorAll("[data-menu-key-param]")).map(t=>t.getAttribute("data-menu-key-param")).filter(Boolean).forEach(t=>{window.localStorage.removeItem(t)})}}});Vrt();})();
417
417
  /*!
418
418
  * @kurkle/color v0.1.9
419
419
  * https://github.com/kurkle/color#readme