/*! For license information please see core.js.LICENSE.txt */ (()=>{"use strict";var e,t={6525:(e,t,n)=>{var i=n(5311),o=n.n(i),r=n(6599),a=n(7647),s=n.n(a),l=n(1302),c=n(3407),h=n(5697),d=n.n(h);d().shape({live:d().bool.isRequired,status:d().string.isRequired}).isRequired;var u=n(335),p=n.n(u);const f=({name:e,component:t,className:n,duration:i,children:o})=>s().createElement(p(),{component:t,transitionEnterTimeout:i,transitionLeaveTimeout:i,transitionName:`w-transition-${e}`,className:n},o);f.propTypes={name:d().oneOf(["push","pop"]).isRequired,component:d().string,className:d().string,duration:d().number,children:d().node},f.defaultProps={component:"div",children:null,className:null,duration:210};var g=n(434);class m extends r.Controller{static values={continue:{type:Boolean,default:!1},url:String};click(){this.element.click()}noop(){}post(e){e.preventDefault(),e.stopPropagation();const t=document.createElement("form");t.action=this.urlValue,t.method="POST";const n=document.createElement("input");if(n.type="hidden",n.name="csrfmiddlewaretoken",n.value=g.QF.CSRF_TOKEN,t.appendChild(n),!this.continueValue){const e=document.createElement("input");e.type="hidden",e.name="next",e.value=window.location.href,t.appendChild(e)}document.body.appendChild(t),t.submit()}redirect(e){const t=e?.params?.url??e?.detail?.url??this.element.value;t&&window.location.assign(t)}reset(e){const t=this.element,n=t.value,{value:i=""}={value:t instanceof HTMLInputElement?t.defaultValue:"",...e?.params,...e?.detail};n!==i&&(t.value=i,this.dispatch("change",{bubbles:!0,cancelable:!1,prefix:"",target:t}))}select(){const e=this.element;e&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&e.select()}}var v=new Map;function b(e){var t=v.get(e);t&&t.destroy()}function y(e){var t=v.get(e);t&&t.update()}var w=null;"undefined"==typeof window?((w=function(e){return e}).destroy=function(e){return e},w.update=function(e){return e}):((w=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return function(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!v.has(e)){var t,n=null,i=window.getComputedStyle(e),o=(t=e.value,function(){a({testForHeightReduction:""===t||!e.value.startsWith(t),restoreTextAlign:null}),t=e.value}),r=function(t){e.removeEventListener("autosize:destroy",r),e.removeEventListener("autosize:update",s),e.removeEventListener("input",o),window.removeEventListener("resize",s),Object.keys(t).forEach((function(n){return e.style[n]=t[n]})),v.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,textAlign:e.style.textAlign,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",r),e.addEventListener("autosize:update",s),e.addEventListener("input",o),window.addEventListener("resize",s),e.style.overflowX="hidden",e.style.wordWrap="break-word",v.set(e,{destroy:r,update:s}),s()}function a(t){var o,r,s=t.restoreTextAlign,l=void 0===s?null:s,c=t.testForHeightReduction,h=void 0===c||c,d=i.overflowY;if(0!==e.scrollHeight&&("vertical"===i.resize?e.style.resize="none":"both"===i.resize&&(e.style.resize="horizontal"),h&&(o=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push([e.parentNode,e.parentNode.scrollTop]),e=e.parentNode;return function(){return t.forEach((function(e){var t=e[0],n=e[1];t.style.scrollBehavior="auto",t.scrollTop=n,t.style.scrollBehavior=null}))}}(e),e.style.height=""),r="content-box"===i.boxSizing?e.scrollHeight-(parseFloat(i.paddingTop)+parseFloat(i.paddingBottom)):e.scrollHeight+parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth),"none"!==i.maxHeight&&r>parseFloat(i.maxHeight)?("hidden"===i.overflowY&&(e.style.overflow="scroll"),r=parseFloat(i.maxHeight)):"hidden"!==i.overflowY&&(e.style.overflow="hidden"),e.style.height=r+"px",l&&(e.style.textAlign=l),o&&o(),n!==r&&(e.dispatchEvent(new Event("autosize:resized",{bubbles:!0})),n=r),d!==i.overflow&&!l)){var u=i.textAlign;"hidden"===i.overflow&&(e.style.textAlign="start"===u?"end":"start"),a({restoreTextAlign:u,testForHeightReduction:!0})}}function s(){a({testForHeightReduction:!0,restoreTextAlign:null})}}(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],b),e},w.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],y),e});const E=w;var C=n(9437);class T extends r.Controller{resizeObserver;resize(){E.update(this.element)}initialize(){this.resize=(0,C.D)(this.resize.bind(this),50)}connect(){E(this.element),this.resizeObserver=new ResizeObserver(this.resize),this.resizeObserver.observe(this.element)}disconnect(){this.resizeObserver?.disconnect(),E.destroy(this.element)}}class S extends r.Controller{static classes=["actionInactive"];static targets=["action","all","item"];lastChanged;shiftActive;connect(){this.toggle(),this.handleShiftKey=this.handleShiftKey.bind(this),document.addEventListener("keydown",this.handleShiftKey),document.addEventListener("keyup",this.handleShiftKey)}getValidTargets(e=this.itemTargets){return e.filter((({disabled:e})=>!e))}handleShiftKey(e){if(!e)return;const{shiftKey:t,type:n}=e;"keydown"===n&&t&&(this.shiftActive=!0),"keyup"===n&&this.shiftActive&&(this.shiftActive=!1)}toggle(e){const t=this.getValidTargets(),n=this.lastChanged;if(this.shiftActive&&n instanceof HTMLElement){this.shiftActive=!1;const i=t.findIndex((e=>e===n)),o=t.findIndex((t=>t===e?.target)),[r,a]=[i,o].sort(((e,t)=>e-t));t.forEach(((e,n)=>{n>=r&&n<=a&&(e.checked=!!t[i].checked,this.dispatch("change",{target:e,bubbles:!0}))}))}this.lastChanged=t.find((t=>t.contains(e?.target)))??null;const i=t.filter((e=>e.checked)).length,o=i>0,r=i===t.length;this.getValidTargets(this.allTargets).forEach((e=>{e.checked=r}));const a=this.actionInactiveClasses;a.length&&this.actionTargets.forEach((e=>{a.forEach((t=>{e.classList.toggle(t,!o)}))}))}toggleAll(e){const{force:t=null}={...e.detail,...e.params};this.lastChanged=null;let n=!1;if("boolean"==typeof t)n=t;else if(e.target instanceof HTMLInputElement)n=e.target.checked;else{const e=this.allTargets[0];n=!e?.checked}this.getValidTargets().forEach((e=>{e.checked!==n&&(e.checked=n,e.dispatchEvent(new Event("change",{bubbles:!0})))})),this.toggle()}disconnect(){document?.removeEventListener("keydown",this.handleShiftKey),document?.removeEventListener("keyup",this.handleShiftKey)}}class A extends r.Controller{static targets=["value"];copy(e){const{value:t=(this.hasValueTarget?this.valueTarget.value:this.element.value||null)}={...e.detail,...e.params};t&&(this.dispatch("copy").defaultPrevented||new Promise(((e,n)=>{navigator.clipboard?navigator.clipboard.writeText(t).then(e,n):n()})).then((()=>this.dispatch("copied",{detail:{clear:!0,type:"success"}}))).catch((()=>this.dispatch("error",{detail:{clear:!0,type:"error"}}))))}}var D=n(4676);class V extends r.Controller{static classes=["added","hide","show"];static targets=["container","template"];static values={autoClear:{default:0,type:Number},clearDelay:{default:0,type:Number},showDelay:{default:0,type:Number}};isClearing;add(e){const{clear:t=!1,text:n="",type:i=null}={...e?.detail,...e?.params};this.element.classList.add(...this.addedClasses),t&&this.clear();const o=this.getTemplateContent(i);if(!o)return;const r=o.lastElementChild;r instanceof HTMLElement&&n&&(r.textContent=n),this.containerTarget.appendChild(o),(0,C.D)((()=>{this.element.classList.remove(...this.hideClasses),this.element.classList.add(...this.showClasses),this.dispatch("added")}),this.showDelayValue||null)().then((()=>{this.autoClearValue&&(0,C.D)((()=>{this.clear()}),this.autoClearValue)()}))}clear(e){if(this.isClearing=!1,!e)return void(this.containerTarget.innerHTML="");const t=this.clearDelayValue||null,n=this.element;this.isClearing=!0,n.classList.remove(...this.addedClasses),n.classList.remove(...this.showClasses),n.classList.add(...this.hideClasses),(0,C.D)(D.Z,t)().then((()=>{this?.isClearing&&(this.containerTarget.innerHTML="",this.dispatch("cleared"),this.isClearing=!1)}))}getTemplateContent(e){const t=e&&this.templateTargets.find((({dataset:t})=>t.type===e))||this.templateTarget,n=t.content.firstElementChild?.cloneNode(!0);return n instanceof HTMLElement?n:null}}var _=n(9408);class x extends r.Controller{static classes=["active"];static targets=["label","total"];static values={container:{default:"body",type:String},find:{default:".error-message,.help-critical",type:String},labels:{default:[],type:Array},min:{default:0,type:Number},total:{default:0,type:Number}};connect(){this.count()}count(){return this.totalValue=[...document.querySelectorAll(this.containerValue||"body")].map((e=>e.querySelectorAll(this.findValue).length)).reduce(((e,t)=>e+t),0),this.totalValue}getLabel(e){const t=(0,_.qP)("%(num)s error","%(num)s errors",e);if(this.labelsValue.length>1){const[t,n=this.labelsValue[1],i="__total__"]=this.labelsValue;return(0,_.qP)(t,n,e).replace(i,`${e}`)}return t.replace("%(num)s",`${e}`)}minValueChanged(){this.totalValueChanged(this.count())}totalValueChanged(e){const t=this.minValue;this.hasActiveClass&&this.element.classList.toggle(this.activeClass,e>t),this.hasLabelTarget&&(this.labelTarget.textContent=e>t?this.getLabel(e):""),this.hasTotalTarget&&(this.totalTarget.textContent=e>t?`${e}`:"")}}var L=n(859);class k extends r.Controller{static classes=["dismissed"];static values={dismissed:{default:!1,type:Boolean},id:{default:"",type:String}};toggle(){var e;this.idValue&&(this.element.classList.add(this.dismissedClass),this.dismissedValue=!0,e={[this.idValue]:!0},fetch(g.QF.ADMIN_URLS?.DISMISSIBLES,{method:"PATCH",headers:{[g.QF.CSRF_HEADER_NAME]:g.QF.CSRF_TOKEN,"Content-Type":"application/json"},body:JSON.stringify(e),mode:"same-origin"}))}}class O extends r.Controller{static targets=["count","menu","toggle"];static values={activeSubmenu:{default:"",type:String},countAttr:{default:"",type:String}};static outlets=["w-action","w-dropdown"];countTargetConnected(){this.updateCount()}connect(){this.open=this.open.bind(this)}wActionOutletConnected(e,t){t.addEventListener("click",this.open)}wActionOutletDisconnected(e,t){t.removeEventListener("click",this.open)}updateCount(){const e=document.querySelectorAll(`[${this.countAttrValue}]`).length;this.countTargets.forEach((t=>{const n=t.dataset.countName,i=n?document.querySelectorAll(`[${this.countAttrValue}=${n}]`).length:e;t.hidden=0===i,t.textContent=i.toString()}))}updateParams(e){const t=e;if("listing-results"===e.target?.id){const e=new URLSearchParams(t.detail?.requestUrl.split("?")[1]),n=new URLSearchParams;e.forEach(((e,t)=>{""===e.trim()||t.startsWith("_w_")||n.append(t,e)}));const i=`?${n.toString()}`;window.history.replaceState(null,"",i)}this.updateCount()}open(e){const t=e.target?.closest("button");this.activeSubmenuValue=t.getAttribute("aria-controls")||""}close(){this.activeSubmenuValue=""}delayedClose(){setTimeout((()=>this.close()),200)}activeSubmenuValueChanged(e,t){if(t){const e=document.querySelector(`[aria-controls="${t}"]`);this.toggle(!1,e)}if(e){const t=document.querySelector(`[aria-controls="${e}"]`);this.toggle(!0,t)}}preventOutletClickaway(e){const t=e.detail.target;if(!t)return;const n=this.toggleTargets.map((e=>e.getAttribute("aria-controls"))),i=t.closest("button")?.getAttribute("aria-controls")||"";n.includes(i)&&e.preventDefault()}toggle(e,t){this.hasWDropdownOutlet&&e&&this.wDropdownOutlet.show();const n=t.getAttribute("aria-controls"),i=this.element.querySelector(`#${n}`);i&&(t.setAttribute("aria-expanded",e.toString()),i.hidden=!e,this.menuTarget.hidden=e,e?i.focus():t.focus())}}var P=n(8689);const R=async()=>{"loading"===document.readyState&&await new Promise((e=>{document.addEventListener("DOMContentLoaded",(()=>e()),{once:!0,passive:!0})}))},N={name:"hideOnEsc",defaultValue:!0,fn({hide:e}){function t(t){"Escape"===t.key&&e()}return{onShow(){document.addEventListener("keydown",t)},onHide(){document.removeEventListener("keydown",t)}}}};class I extends r.Controller{static values={content:String,offset:Array,placement:{default:"bottom",type:String}};tippy;connect(){this.tippy=(0,P.ZP)(this.element,this.options)}contentValueChanged(e,t){t&&t!==e&&this.tippy?.setProps(this.options)}placementValueChanged(e,t){t&&t!==e&&this.tippy?.setProps(this.options)}hide(){this.tippy?.hide()}show(){this.tippy?.show()}get options(){return{content:this.contentValue,placement:this.placementValue,plugins:this.plugins,...this.hasOffsetValue&&{offset:this.offsetValue}}}get plugins(){return[N]}disconnect(){this.tippy?.destroy()}static afterLoad(){R().then((()=>{(0,P.ZP)("[data-tippy-content]",{plugins:[N]})}))}}const M={name:"hideTooltipOnBreadcrumbAndCollapse",fn({hide:e}){function t(){e()}return{onShow(){document.addEventListener("w-breadcrumbs:opened",t),document.addEventListener("w-breadcrumbs:closed",t)},onHide(){document.removeEventListener("w-breadcrumbs:closed",t),document.removeEventListener("w-breadcrumbs:opened",t)}}}},B={name:"hideTooltipOnClickInside",defaultValue:!0,fn(e){const t=()=>e.hide();return{onShow(){e.popper.addEventListener("click",t)},onHide(){e.popper.removeEventListener("click",t)}}}},F={name:"rotateToggleIcon",fn(e){const t=e.reference.querySelector(".icon-arrow-down, .icon-arrow-up");return t?{onShow:()=>t.classList.add("w-rotate-180"),onHide:()=>t.classList.remove("w-rotate-180")}:{}}};class H extends r.Controller{static targets=["toggle","content"];static values={hideOnClick:{default:!1,type:Boolean},keepMounted:{default:!1,type:Boolean},offset:Array,theme:{default:"dropdown",type:String}};tippy;connect(){this.tippy=(0,P.ZP)(this.toggleTarget,this.options)}hide(){this.tippy?.hide()}show(){this.tippy?.show()}get options(){const e=this.toggleTarget.getAttribute("aria-label");let t;return this.hasContentTarget&&(this.contentTarget.hidden=!1),e&&(t=(0,P.ZP)(this.toggleTarget,{content:e,placement:"bottom",plugins:[N]})),{...this.hasContentTarget?{content:this.contentTarget}:{},...this.themeOptions,trigger:"click",interactive:!0,...this.hasOffsetValue&&{offset:this.offsetValue},getReferenceClientRect:()=>this.reference.getBoundingClientRect(),theme:this.themeValue,onCreate:e=>{if(this.keepMountedValue){const{popper:t}=e;this.element.append(t),t.hidden=!0}},onShow:e=>{if(t&&t.disable(),this.keepMountedValue){const{popper:t}=e;t.hidden=!1}},onShown:()=>{this.dispatch("shown")},onHide:()=>{this.dispatch("hide"),t&&t.enable()},onHidden:e=>{if(this.keepMountedValue){const{popper:t}=e;this.element.append(t),t.hidden=!0}}}}get themeOptions(){return{dropdown:{arrow:!0,maxWidth:350,placement:"bottom",plugins:this.plugins},drilldown:{arrow:!1,maxWidth:"none",placement:"bottom-end",hideOnClick:!1,plugins:this.plugins.concat([this.hideTooltipOnClickAway])},"dropdown-button":{arrow:!1,maxWidth:"none",placement:"bottom-start",plugins:this.plugins}}[this.themeValue]}get hideTooltipOnClickAway(){return{name:"hideTooltipOnClickAway",fn:e=>{const t=t=>{this.dispatch("clickaway",{cancelable:!0,detail:{target:t.target}}).defaultPrevented||!e.state.isShown||this.reference.contains(t.target)&&!this.toggleTarget.contains(t.target)||e.hide()};return{onShow(){document.addEventListener("click",t)},onHide(){document.removeEventListener("click",t)}}}}}get plugins(){const e=[M,N,F];return this.hideOnClickValue&&e.push(B),e}get reference(){const e=this.toggleTarget.parentElement;return"dropdown-button"===this.themeValue?e.parentElement:e}}class z extends r.Controller{static classes=["ready","remove"];static values={delay:{default:-1,type:Number},event:{default:"",type:String}};connect(){this.ready()}ready(){const e=this.eventValue.split(" ").filter(Boolean),t=this.delayValue;(0,C.D)((()=>!0),t<0?null:t)().then((()=>{this.element.classList.add(...this.readyClasses),this.element.classList.remove(...this.removeClasses),this.dispatch("ready",{bubbles:!0,cancelable:!1}),e.forEach((e=>{this.dispatch(e,{bubbles:!0,cancelable:!1,prefix:""})})),this.remove()}))}remove(){const e=this.element,t=this.application.schema.controllerAttribute,n=(e.getAttribute(t)?.split(" ")??[]).filter((e=>e!==this.identifier)).join(" ");n?e.setAttribute(t,n):e.removeAttribute(t)}}class j extends r.Controller{static values={attrName:{default:"href",type:String},preserveKeys:{default:[],type:Array},reflectKeys:{default:["__all__"],type:Array}};get url(){return new URL(this.element.getAttribute(this.attrNameValue)||"",window.location.href)}connect(){this.setParamsFromLocation()}get reflectAll(){return this.reflectKeysValue.includes("__all__")}setParamsFromURL(e){const t=new URLSearchParams,n=this.reflectAll;e.searchParams.forEach(((e,i)=>{i.startsWith("_w_")||this.preserveKeysValue.includes(i)||!n&&!this.reflectKeysValue.includes(i)||t.append(i,e)}));const i=this.url;i.searchParams.forEach(((e,n)=>{this.preserveKeysValue.includes(n)&&t.append(n,e)})),i.search=t.toString(),this.element.setAttribute(this.attrNameValue,i.toString())}setParamsFromSwapRequest(e){e.detail?.requestUrl&&this.setParamsFromURL(new URL(e.detail.requestUrl,window.location.href))}setParamsFromLocation(){this.setParamsFromURL(new URL(window.location.href))}}function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Y(e){for(var t=1;t"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function re(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function ae(e,t,n,i){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&oe(e,t):oe(e,t))||i&&e===n)return e;if(e===n)break}while(e=re(e))}return null}var se,le=/\s+/g;function ce(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var i=(" "+e.className+" ").replace(le," ").replace(" "+t+" "," ");e.className=(i+(n?" "+t:"")).replace(le," ")}}function he(e,t,n){var i=e&&e.style;if(i){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];t in i||-1!==t.indexOf("webkit")||(t="-webkit-"+t),i[t]=n+("string"==typeof n?"":"px")}}function de(e,t){var n="";if("string"==typeof e)n=e;else do{var i=he(e,"transform");i&&"none"!==i&&(n=i+" "+n)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function ue(e,t,n){if(e){var i=e.getElementsByTagName(t),o=0,r=i.length;if(n)for(;o=r:o<=r))return i;if(i===pe())break;i=we(i,!1)}return!1}function me(e,t,n,i){for(var o=0,r=0,a=e.children;r2&&void 0!==arguments[2]?arguments[2]:{},i=n.evt,o=function(e,t){if(null==e)return{};var n,i,o=function(e,t){if(null==e)return{};var n,i,o={},r=Object.keys(e);for(i=0;i=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(n,xe);_e.pluginEvent.bind(Ct)(e,t,Y({dragEl:Oe,parentEl:Pe,ghostEl:Re,rootEl:Ne,nextEl:Ie,lastDownEl:Me,cloneEl:Be,cloneHidden:Fe,dragStarted:Qe,putSortable:qe,activeSortable:Ct.active,originalEvent:i,oldIndex:He,oldDraggableIndex:je,newIndex:ze,newDraggableIndex:Xe,hideGhostForTarget:bt,unhideGhostForTarget:yt,cloneNowHidden:function(){Fe=!0},cloneNowShown:function(){Fe=!1},dispatchSortableEvent:function(e){ke({sortable:t,name:e,originalEvent:i})}},o))};function ke(e){!function(e){var t=e.sortable,n=e.rootEl,i=e.name,o=e.targetEl,r=e.cloneEl,a=e.toEl,s=e.fromEl,l=e.oldIndex,c=e.newIndex,h=e.oldDraggableIndex,d=e.newDraggableIndex,u=e.originalEvent,p=e.putSortable,f=e.extraEventProperties;if(t=t||n&&n[Ae]){var g,m=t.options,v="on"+i.charAt(0).toUpperCase()+i.substr(1);!window.CustomEvent||K||Z?(g=document.createEvent("Event")).initEvent(i,!0,!0):g=new CustomEvent(i,{bubbles:!0,cancelable:!0}),g.to=a||n,g.from=s||n,g.item=o||n,g.clone=r,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=h,g.newDraggableIndex=d,g.originalEvent=u,g.pullMode=p?p.lastPutMode:void 0;var b=Y(Y({},f),_e.getEventProperties(i,t));for(var y in b)g[y]=b[y];n&&n.dispatchEvent(g),m[v]&&m[v].call(t,g)}}(Y({putSortable:qe,cloneEl:Be,targetEl:Oe,rootEl:Ne,oldIndex:He,oldDraggableIndex:je,newIndex:ze,newDraggableIndex:Xe},e))}var Oe,Pe,Re,Ne,Ie,Me,Be,Fe,He,ze,je,Xe,Ye,qe,$e,Ue,We,Ke,Ze,Ge,Qe,Je,et,tt,nt,it=!1,ot=!1,rt=[],at=!1,st=!1,lt=[],ct=!1,ht=[],dt="undefined"!=typeof document,ut=J,pt=Z||K?"cssFloat":"float",ft=dt&&!ee&&!J&&"draggable"in document.createElement("div"),gt=function(){if(dt){if(K)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),mt=function(e,t){var n=he(e),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=me(e,0,t),r=me(e,1,t),a=o&&he(o),s=r&&he(r),l=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+fe(o).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+fe(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&a.float&&"none"!==a.float){var h="left"===a.float?"left":"right";return!r||"both"!==s.clear&&s.clear!==h?"horizontal":"vertical"}return o&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||l>=i&&"none"===n[pt]||r&&"none"===n[pt]&&l+c>i)?"vertical":"horizontal"},vt=function(e){function t(e,n){return function(i,o,r,a){var s=i.options.group.name&&o.options.group.name&&i.options.group.name===o.options.group.name;if(null==e&&(n||s))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(i,o,r,a),n)(i,o,r,a);var l=(n?i:o).options.group.name;return!0===e||"string"==typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var n={},i=e.group;i&&"object"==q(i)||(i={name:i}),n.name=i.name,n.checkPull=t(i.pull,!0),n.checkPut=t(i.put),n.revertClone=i.revertClone,e.group=n},bt=function(){!gt&&Re&&he(Re,"display","none")},yt=function(){!gt&&Re&&he(Re,"display","")};dt&&!ee&&document.addEventListener("click",(function(e){if(ot)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),ot=!1,!1}),!0);var wt=function(e){if(Oe){e=e.touches?e.touches[0]:e;var t=(o=e.clientX,r=e.clientY,rt.some((function(e){var t=e[Ae].options.emptyInsertThreshold;if(t&&!ve(e)){var n=fe(e),i=o>=n.left-t&&o<=n.right+t,s=r>=n.top-t&&r<=n.bottom+t;return i&&s?a=e:void 0}})),a);if(t){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[i]=e[i]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[Ae]._onDragOver(n)}}var o,r,a},Et=function(e){Oe&&Oe.parentNode[Ae]._isOutsideThisEl(e.target)};function Ct(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=U({},t),e[Ae]=this;var n,i,o={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return mt(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Ct.supportPointer&&"PointerEvent"in window&&!Q,emptyInsertThreshold:5};for(var r in _e.initializePlugins(this,e,o),o)!(r in t)&&(t[r]=o[r]);for(var a in vt(t),this)"_"===a.charAt(0)&&"function"==typeof this[a]&&(this[a]=this[a].bind(this));this.nativeDraggable=!t.forceFallback&&ft,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?ne(e,"pointerdown",this._onTapStart):(ne(e,"mousedown",this._onTapStart),ne(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(ne(e,"dragover",this),ne(e,"dragenter",this)),rt.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),U(this,(i=[],{captureAnimationState:function(){i=[],this.options.animation&&[].slice.call(this.el.children).forEach((function(e){if("none"!==he(e,"display")&&e!==Ct.ghost){i.push({target:e,rect:fe(e)});var t=Y({},i[i.length-1].rect);if(e.thisAnimationDuration){var n=de(e,!0);n&&(t.top-=n.f,t.left-=n.e)}e.fromRect=t}}))},addAnimationState:function(e){i.push(e)},removeAnimationState:function(e){i.splice(function(e,t){for(var n in e)if(e.hasOwnProperty(n))for(var i in t)if(t.hasOwnProperty(i)&&t[i]===e[n][i])return Number(n);return-1}(i,{target:e}),1)},animateAll:function(e){var t=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof e&&e());var o=!1,r=0;i.forEach((function(e){var n=0,i=e.target,a=i.fromRect,s=fe(i),l=i.prevFromRect,c=i.prevToRect,h=e.rect,d=de(i,!0);d&&(s.top-=d.f,s.left-=d.e),i.toRect=s,i.thisAnimationDuration&&Ee(l,s)&&!Ee(a,s)&&(h.top-s.top)/(h.left-s.left)==(a.top-s.top)/(a.left-s.left)&&(n=function(e,t,n,i){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*i.animation}(h,l,c,t.options)),Ee(s,a)||(i.prevFromRect=a,i.prevToRect=s,n||(n=t.options.animation),t.animate(i,h,s,n)),n&&(o=!0,r=Math.max(r,n),clearTimeout(i.animationResetTimer),i.animationResetTimer=setTimeout((function(){i.animationTime=0,i.prevFromRect=null,i.fromRect=null,i.prevToRect=null,i.thisAnimationDuration=null}),n),i.thisAnimationDuration=n)})),clearTimeout(n),o?n=setTimeout((function(){"function"==typeof e&&e()}),r):"function"==typeof e&&e(),i=[]},animate:function(e,t,n,i){if(i){he(e,"transition",""),he(e,"transform","");var o=de(this.el),r=o&&o.a,a=o&&o.d,s=(t.left-n.left)/(r||1),l=(t.top-n.top)/(a||1);e.animatingX=!!s,e.animatingY=!!l,he(e,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),he(e,"transition","transform "+i+"ms"+(this.options.easing?" "+this.options.easing:"")),he(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout((function(){he(e,"transition",""),he(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1}),i)}}}))}function Tt(e,t,n,i,o,r,a,s){var l,c,h=e[Ae],d=h.options.onMove;return!window.CustomEvent||K||Z?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=t,l.from=e,l.dragged=n,l.draggedRect=i,l.related=o||t,l.relatedRect=r||fe(t),l.willInsertAfter=s,l.originalEvent=a,e.dispatchEvent(l),d&&(c=d.call(h,l,a)),c}function St(e){e.draggable=!1}function At(){ct=!1}function Dt(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,i=0;n--;)i+=t.charCodeAt(n);return i.toString(36)}function Vt(e){return setTimeout(e,0)}function _t(e){return clearTimeout(e)}Ct.prototype={constructor:Ct,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(Je=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,Oe):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,i=this.options,o=i.preventOnFilter,r=e.type,a=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,s=(a||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,c=i.filter;if(function(e){ht.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var i=t[n];i.checked&&ht.push(i)}}(n),!Oe&&!(/mousedown|pointerdown/.test(r)&&0!==e.button||i.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!Q||!s||"SELECT"!==s.tagName.toUpperCase())&&!((s=ae(s,i.draggable,n,!1))&&s.animated||Me===s)){if(He=be(s),je=be(s,i.draggable),"function"==typeof c){if(c.call(this,e,s,this))return ke({sortable:t,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),Le("filter",t,{evt:e}),void(o&&e.cancelable&&e.preventDefault())}else if(c&&(c=c.split(",").some((function(i){if(i=ae(l,i.trim(),n,!1))return ke({sortable:t,rootEl:i,name:"filter",targetEl:s,fromEl:n,toEl:n}),Le("filter",t,{evt:e}),!0}))))return void(o&&e.cancelable&&e.preventDefault());i.handle&&!ae(l,i.handle,n,!1)||this._prepareDragStart(e,a,s)}}},_prepareDragStart:function(e,t,n){var i,o=this,r=o.el,a=o.options,s=r.ownerDocument;if(n&&!Oe&&n.parentNode===r){var l=fe(n);if(Ne=r,Pe=(Oe=n).parentNode,Ie=Oe.nextSibling,Me=n,Ye=a.group,Ct.dragged=Oe,$e={target:Oe,clientX:(t||e).clientX,clientY:(t||e).clientY},Ze=$e.clientX-l.left,Ge=$e.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,Oe.style["will-change"]="all",i=function(){Le("delayEnded",o,{evt:e}),Ct.eventCanceled?o._onDrop():(o._disableDelayedDragEvents(),!G&&o.nativeDraggable&&(Oe.draggable=!0),o._triggerDragStart(e,t),ke({sortable:o,name:"choose",originalEvent:e}),ce(Oe,a.chosenClass,!0))},a.ignore.split(",").forEach((function(e){ue(Oe,e.trim(),St)})),ne(s,"dragover",wt),ne(s,"mousemove",wt),ne(s,"touchmove",wt),ne(s,"mouseup",o._onDrop),ne(s,"touchend",o._onDrop),ne(s,"touchcancel",o._onDrop),G&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Oe.draggable=!0),Le("delayStart",this,{evt:e}),!a.delay||a.delayOnTouchOnly&&!t||this.nativeDraggable&&(Z||K))i();else{if(Ct.eventCanceled)return void this._onDrop();ne(s,"mouseup",o._disableDelayedDrag),ne(s,"touchend",o._disableDelayedDrag),ne(s,"touchcancel",o._disableDelayedDrag),ne(s,"mousemove",o._delayedDragTouchMoveHandler),ne(s,"touchmove",o._delayedDragTouchMoveHandler),a.supportPointer&&ne(s,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(i,a.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Oe&&St(Oe),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;ie(e,"mouseup",this._disableDelayedDrag),ie(e,"touchend",this._disableDelayedDrag),ie(e,"touchcancel",this._disableDelayedDrag),ie(e,"mousemove",this._delayedDragTouchMoveHandler),ie(e,"touchmove",this._delayedDragTouchMoveHandler),ie(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?ne(document,"pointermove",this._onTouchMove):ne(document,t?"touchmove":"mousemove",this._onTouchMove):(ne(Oe,"dragend",this),ne(Ne,"dragstart",this._onDragStart));try{document.selection?Vt((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(it=!1,Ne&&Oe){Le("dragStarted",this,{evt:t}),this.nativeDraggable&&ne(document,"dragover",Et);var n=this.options;!e&&ce(Oe,n.dragClass,!1),ce(Oe,n.ghostClass,!0),Ct.active=this,e&&this._appendGhost(),ke({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(Ue){this._lastX=Ue.clientX,this._lastY=Ue.clientY,bt();for(var e=document.elementFromPoint(Ue.clientX,Ue.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Ue.clientX,Ue.clientY))!==t;)t=e;if(Oe.parentNode[Ae]._isOutsideThisEl(e),t)do{if(t[Ae]&&t[Ae]._onDragOver({clientX:Ue.clientX,clientY:Ue.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break;e=t}while(t=t.parentNode);yt()}},_onTouchMove:function(e){if($e){var t=this.options,n=t.fallbackTolerance,i=t.fallbackOffset,o=e.touches?e.touches[0]:e,r=Re&&de(Re,!0),a=Re&&r&&r.a,s=Re&&r&&r.d,l=ut&&nt&&ye(nt),c=(o.clientX-$e.clientX+i.x)/(a||1)+(l?l[0]-lt[0]:0)/(a||1),h=(o.clientY-$e.clientY+i.y)/(s||1)+(l?l[1]-lt[1]:0)/(s||1);if(!Ct.active&&!it){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))i.right+10||e.clientX<=i.right&&e.clientY>i.bottom&&e.clientX>=i.left:e.clientX>i.right&&e.clientY>i.top||e.clientX<=i.right&&e.clientY>i.bottom+10}(e,o,this)&&!g.animated){if(g===Oe)return k(!1);if(g&&r===e.target&&(a=g),a&&(n=fe(a)),!1!==Tt(Ne,r,Oe,t,a,n,e,!!a))return L(),g&&g.nextSibling?r.insertBefore(Oe,g.nextSibling):r.appendChild(Oe),Pe=r,O(),k(!0)}else if(g&&function(e,t,n){var i=fe(me(n.el,0,n.options,!0));return t?e.clientXh+c*r/2:ld-tt)return-et}else if(l>h+c*(1-o)/2&&ld-c*r/2)?l>h+c/2?1:-1:0}(e,a,n,o,E?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,st,Je===a),0!==v){var A=be(Oe);do{A-=v,y=Pe.children[A]}while(y&&("none"===he(y,"display")||y===Re))}if(0===v||y===a)return k(!1);Je=a,et=v;var D=a.nextElementSibling,V=!1,_=Tt(Ne,r,Oe,t,a,n,e,V=1===v);if(!1!==_)return 1!==_&&-1!==_||(V=1===_),ct=!0,setTimeout(At,30),L(),V&&!D?r.appendChild(Oe):a.parentNode.insertBefore(Oe,V?D:a),T&&Te(T,0,S-T.scrollTop),Pe=Oe.parentNode,void 0===b||st||(tt=Math.abs(b-fe(a)[C])),O(),k(!0)}if(r.contains(Oe))return k(!1)}return!1}function x(s,l){Le(s,p,Y({evt:e,isOwner:h,axis:o?"vertical":"horizontal",revert:i,dragRect:t,targetRect:n,canSort:d,fromSortable:u,target:a,completed:k,onMove:function(n,i){return Tt(Ne,r,Oe,t,n,fe(n),e,i)},changed:O},l))}function L(){x("dragOverAnimationCapture"),p.captureAnimationState(),p!==u&&u.captureAnimationState()}function k(t){return x("dragOverCompleted",{insertion:t}),t&&(h?c._hideClone():c._showClone(p),p!==u&&(ce(Oe,qe?qe.options.ghostClass:c.options.ghostClass,!1),ce(Oe,s.ghostClass,!0)),qe!==p&&p!==Ct.active?qe=p:p===Ct.active&&qe&&(qe=null),u===p&&(p._ignoreWhileAnimating=a),p.animateAll((function(){x("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==u&&(u.animateAll(),u._ignoreWhileAnimating=null)),(a===Oe&&!Oe.animated||a===r&&!a.animated)&&(Je=null),s.dragoverBubble||e.rootEl||a===document||(Oe.parentNode[Ae]._isOutsideThisEl(e.target),!t&&wt(e)),!s.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),f=!0}function O(){ze=be(Oe),Xe=be(Oe,s.draggable),ke({sortable:p,name:"change",toEl:r,newIndex:ze,newDraggableIndex:Xe,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){ie(document,"mousemove",this._onTouchMove),ie(document,"touchmove",this._onTouchMove),ie(document,"pointermove",this._onTouchMove),ie(document,"dragover",wt),ie(document,"mousemove",wt),ie(document,"touchmove",wt)},_offUpEvents:function(){var e=this.el.ownerDocument;ie(e,"mouseup",this._onDrop),ie(e,"touchend",this._onDrop),ie(e,"pointerup",this._onDrop),ie(e,"touchcancel",this._onDrop),ie(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;ze=be(Oe),Xe=be(Oe,n.draggable),Le("drop",this,{evt:e}),Pe=Oe&&Oe.parentNode,ze=be(Oe),Xe=be(Oe,n.draggable),Ct.eventCanceled||(it=!1,st=!1,at=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),_t(this.cloneId),_t(this._dragStartId),this.nativeDraggable&&(ie(document,"drop",this),ie(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Q&&he(document.body,"user-select",""),he(Oe,"transform",""),e&&(Qe&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),Re&&Re.parentNode&&Re.parentNode.removeChild(Re),(Ne===Pe||qe&&"clone"!==qe.lastPutMode)&&Be&&Be.parentNode&&Be.parentNode.removeChild(Be),Oe&&(this.nativeDraggable&&ie(Oe,"dragend",this),St(Oe),Oe.style["will-change"]="",Qe&&!it&&ce(Oe,qe?qe.options.ghostClass:this.options.ghostClass,!1),ce(Oe,this.options.chosenClass,!1),ke({sortable:this,name:"unchoose",toEl:Pe,newIndex:null,newDraggableIndex:null,originalEvent:e}),Ne!==Pe?(ze>=0&&(ke({rootEl:Pe,name:"add",toEl:Pe,fromEl:Ne,originalEvent:e}),ke({sortable:this,name:"remove",toEl:Pe,originalEvent:e}),ke({rootEl:Pe,name:"sort",toEl:Pe,fromEl:Ne,originalEvent:e}),ke({sortable:this,name:"sort",toEl:Pe,originalEvent:e})),qe&&qe.save()):ze!==He&&ze>=0&&(ke({sortable:this,name:"update",toEl:Pe,originalEvent:e}),ke({sortable:this,name:"sort",toEl:Pe,originalEvent:e})),Ct.active&&(null!=ze&&-1!==ze||(ze=He,Xe=je),ke({sortable:this,name:"end",toEl:Pe,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){Le("nulling",this),Ne=Oe=Pe=Re=Ie=Be=Me=Fe=$e=Ue=Qe=ze=Xe=He=je=Je=et=qe=Ye=Ct.dragged=Ct.ghost=Ct.clone=Ct.active=null,ht.forEach((function(e){e.checked=!0})),ht.length=We=Ke=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":Oe&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,i=0,o=n.length,r=this.options;i{this.element.classList.add(...this.activeClasses)},onEnd:({item:e,newIndex:t,oldIndex:n})=>{this.element.classList.remove(...this.activeClasses),n!==t&&(this.order=this.sortable.toArray(),this.submit({...this.getItemData(e),newIndex:t}))}}}getItemData(e){const t=this.identifier,n=e instanceof HTMLElement&&e.closest(`[data-${t}-target='item']`);return n?{id:n.getAttribute(`data-${t}-item-id`)||"",label:n.getAttribute(`data-${t}-item-label`)||""}:{id:"",label:""}}apply({currentTarget:e}){const{id:t,label:n}=this.getItemData(e),i=this.order.indexOf(t);this.submit({id:t,label:n,newIndex:i})}move({currentTarget:e},t){const n=this.identifier,i=e instanceof HTMLElement&&e.closest(`[data-${n}-target='item']`);if(!i)return;const o=i.getAttribute(`data-${n}-item-id`)||"",r=this.order.indexOf(o);this.order.splice(r,1),t===Yt.Down?this.order.splice(r+1,0,o):t===Yt.Up&&r>0?this.order.splice(r-1,0,o):this.order.splice(r,0,o),this.sortable.sort(this.order,!0)}up(e){this.move(e,Yt.Up),e.currentTarget?.focus()}down(e){this.move(e,Yt.Down),e.currentTarget?.focus()}submit({id:e,label:t,newIndex:n}){let i=this.urlValue.replace("999999",e);null!==n&&(i+="?position="+n);const o=(this.messageValue||"__LABEL__").replace("__LABEL__",t),r=this.element.closest("form"),a=r&&r.querySelector('input[name="csrfmiddlewaretoken"]');if(a instanceof HTMLInputElement){const e=a.value,t=new FormData;t.append("csrfmiddlewaretoken",e),fetch(i,{method:"POST",body:t}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`)})).then((()=>{this.dispatch("w-messages:add",{prefix:"",target:window.document,detail:{clear:!0,text:o,type:"success"},cancelable:!1})})).catch((e=>{throw e}))}}disconnect(){this.sortable&&this.sortable.destroy()}}class $t extends r.Controller{static classes=["active"];static targets=["label"];static values={active:{default:"",type:String},duration:{default:3e4,type:Number},label:{default:"",type:String},loading:{default:!1,type:Boolean}};timer;connect(){if(this.hasLabelTarget)return;const e=this.element.querySelector("em");e&&e.setAttribute(`data-${this.identifier}-target`,"label")}activate(){const e=this.element.closest("form");e&&e.checkValidity&&!e.noValidate&&!e.checkValidity()||window.setTimeout((()=>{this.loadingValue=!0,this.timer=window.setTimeout((()=>{this.loadingValue=!1}),this.durationValue)}))}loadingValueChanged(e){const t=this.hasActiveClass?this.activeClass:"button-longrunning-active";this.element.classList.toggle(t,e),this.labelValue||(this.labelValue=this.hasLabelTarget?this.labelTarget.textContent:this.element.textContent),e?(this.element.setAttribute("disabled",""),this.activeValue&&this.hasLabelTarget&&(this.labelTarget.textContent=this.activeValue)):(this.element.removeAttribute("disabled"),this.labelValue&&this.hasLabelTarget&&(this.labelTarget.textContent=this.labelValue))}disconnect(){this.timer&&clearTimeout(this.timer)}}class Ut extends r.Controller{static classes=["closed","closeIcon","opened","openedContent","openIcon"];static targets=["content","toggle"];static values={closed:{default:!1,type:Boolean},peeking:{default:!1,type:Boolean},peekTarget:{default:"",type:String}};cleanUpPeekListener;connect(){const e=!!this.peekTargetValue&&this.element.closest(this.peekTargetValue);if(e){const t=()=>{this.peekingValue&&this.close(),this.peekingValue=!1};e.addEventListener("mouseleave",t,{passive:!0}),this.cleanUpPeekListener=()=>{e.removeEventListener("mouseleave",t)}}new Promise((e=>{setTimeout(e)})).then((()=>{this.dispatch("ready",{cancelable:!1,detail:{closed:this.closedValue}})}))}closedValueChanged(e,t){if(t===e)return;const n=this.closedClasses,i=this.openedClasses,o=this.contentTargets,r=void 0===t,a=this.peekingValue,s=this.openedContentClasses,l=this.toggles;if(a||this.updateToggleIcon(e),e){if(this.dispatch("closing",{cancelable:!0}).defaultPrevented)return;l.forEach((e=>{e.setAttribute("aria-expanded","false")})),o.forEach((e=>{e.classList.remove(...s),e.hidden=!0})),this.element.classList.add(...n),this.element.classList.remove(...i),this.dispatch("closed",{cancelable:!1})}else{if(this.dispatch("opening",{cancelable:!0}).defaultPrevented)return;l.forEach((e=>{e.setAttribute("aria-expanded","true")})),o.forEach((e=>{e.classList.add(...s),e.hidden=!1})),this.element.classList.remove(...n),this.element.classList.add(...i),this.dispatch("opened",{cancelable:!1})}r||l.forEach((t=>{this.dispatch("toggled",{cancelable:!1,detail:{closed:e},target:t})}))}close(){this.closedValue=!0}open(){this.closedValue=!1}peek(){this.closedValue&&(this.peekingValue=!0,this.open())}toggle(){if(this.peekingValue)return this.peekingValue=!1,void this.updateToggleIcon(!1);this.closedValue=!this.closedValue}get toggles(){const e=this.contentTargets.map((e=>e.id)).flatMap((e=>Array.from(document.querySelectorAll(`[aria-controls~="${e}"]`)))).concat(...this.toggleTargets);return Array.from(new Set(e))}updateToggleIcon(e=!1){if(!this.hasCloseIconClass||!this.hasOpenIconClass)return;const t=this.closeIconClass,n=this.openIconClass;t!==n&&this.toggles.map((e=>{const t=e.querySelector(".icon"),n=t?.querySelector("use");return n&&t?[t,n]:[]})).filter((({length:e})=>e)).forEach((([i,o])=>{e?(i.classList.remove(t),i.classList.add(n),o.setAttribute("href",`#${n}`)):(i.classList.remove(n),i.classList.add(t),o.setAttribute("href",`#${t}`))}))}disconnect(){this.cleanUpPeekListener?.call(this)}}class Wt extends r.Controller{skipToTarget;connect(){this.skipToTarget=document.querySelector(this.element.getAttribute("href")||"main")}handleBlur(){this.skipToTarget&&(this.skipToTarget.removeAttribute("tabindex"),this.skipToTarget.removeEventListener("blur",this.handleBlur),this.skipToTarget.removeEventListener("focusout",this.handleBlur))}skip(){this.skipToTarget&&(this.skipToTarget.setAttribute("tabindex","-1"),this.skipToTarget.addEventListener("blur",this.handleBlur),this.skipToTarget.addEventListener("focusout",this.handleBlur),this.skipToTarget.focus())}}const Kt=(e,{unicodeSlugsEnabled:t=!1}={})=>t?e.replace(/\s+/g,"-").replace(/[&/\\#,+()$~%.'":`@^!*?<>{}]/g,"").toLowerCase():e.replace(/\s+/g,"-").replace(/[^A-Za-z0-9\-_]/g,"").toLowerCase();class Zt extends r.Controller{static values={allowUnicode:{default:!1,type:Boolean}};compare(e){if(!this.element.value)return!0;const t=this[e.detail?.compareAs||e.params?.compareAs||"slugify"]({detail:{value:e.detail?.value||""}},!0),n=this.element.value,i=t.trim()===n.trim();return i||e?.preventDefault(),i}slugify(e,t=!1){const n=this.allowUnicodeValue,{value:i=this.element.value}=e?.detail||{},o=Kt(i.trim(),{unicodeSlugsEnabled:n});return t||(this.element.value=o),o}urlify(e,t=!1){const n=this.allowUnicodeValue,{value:i=this.element.value}=e?.detail||{},o=((e,t={})=>window.URLify(e,255)||Kt(e,t))(i.trim(),{unicodeSlugsEnabled:n});return t||(this.element.value=o),o}}class Gt extends r.Controller{submit(){const e=this.element.form;if(!e)throw new Error(`${this.identifier} controlled element must be part of a
`);e.requestSubmit?e.requestSubmit():e.submit()}}class Qt extends r.Controller{static defaultClearParam="p";static targets=["input"];static values={icon:{default:"",type:String},loading:{default:!1,type:Boolean},src:{default:"",type:String},target:{default:"#listing-results",type:String},wait:{default:200,type:Number}};abortController;iconElement;replaceLazy;searchLazy;submitLazy;connect(){const e=this.hasInputTarget?this.inputTarget.form:this.element;this.srcValue=this.srcValue||e?.getAttribute("action")||"";const t=this.target;this.iconElement=null;const n=(this.hasInputTarget?this.inputTarget:this.element).parentElement;this.iconElement=n?.querySelector("use")||null,this.iconValue=this.iconElement?.getAttribute("href")||"",this.loadingValue=!1,this.replaceLazy=(0,C.D)(this.replace.bind(this),this.waitValue),this.searchLazy=(0,C.D)(this.search.bind(this),this.waitValue),this.submitLazy=(0,C.D)(this.submit.bind(this),this.waitValue),this.dispatch("ready",{cancelable:!1,target:t})}get target(){const e=this.targetValue,t=document.querySelector(e),n=t&&t instanceof HTMLElement,i=!!this.srcValue,o=[];if(n||o.push(`Cannot find valid target element at "${e}"`),i||o.push("Cannot find valid src URL value"),o.length)throw new Error(o.join(", "));return t}loadingValueChanged(e,t){const n=void 0===t?null:this.target;e?(n?.setAttribute("aria-busy","true"),this.iconElement?.setAttribute("href","#icon-spinner")):(n?.removeAttribute("aria-busy"),this.iconElement?.setAttribute("href",this.iconValue))}search(e){const t=(e?.detail?.clear||e?.params?.clear||this.constructor.defaultClearParam).split(" "),n=this.hasInputTarget?this.inputTarget:this.element,i=n.name,o=new URLSearchParams(window.location.search),r=o.get(i)||"",a=n.value||"";if(r.trim()===a.trim())return;a?o.set(i,a):o.delete(i),t.forEach((e=>{o.delete(e)}));const s="?"+o.toString(),l=this.srcValue;this.replace(l+s).then((()=>{window.history.replaceState(null,"",s)}))}submit(){const e=this.hasInputTarget?this.inputTarget.form:this.element,t="?"+new URLSearchParams(new FormData(e)).toString(),n=this.srcValue;this.replace(n+t)}async replace(e){const t=this.target,n=("string"==typeof e?e:e?.detail?.url||e?.params?.url||"")||this.srcValue;this.abortController&&this.abortController.abort(),this.abortController=new AbortController;const{signal:i}=this.abortController;return this.loadingValue=!0,this.dispatch("begin",{cancelable:!0,detail:{requestUrl:n},target:this.target}).defaultPrevented?Promise.resolve():fetch(n,{headers:{"x-requested-with":"XMLHttpRequest"},signal:i}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.text()})).then((e=>(t.innerHTML=e,this.dispatch("success",{cancelable:!1,detail:{requestUrl:n,results:e},target:t}),e))).catch((e=>{i.aborted||(this.dispatch("error",{cancelable:!1,detail:{error:e,requestUrl:n},target:t}),console.error(`Error fetching ${n}`,e))})).finally((()=>{i===this.abortController?.signal&&(this.loadingValue=!1)}))}disconnect(){this.loadingValue=!1,this.replaceLazy?.cancel(),this.searchLazy?.cancel(),this.submitLazy?.cancel()}}class Jt extends r.Controller{static values={debounce:{default:100,type:Number},delay:{default:0,type:Number},disabled:{default:!1,type:Boolean},quiet:{default:!1,type:Boolean},target:String};connect(){this.processTargetElements("start",!0),this.apply=(0,C.D)(this.apply.bind(this),this.debounceValue)}check(){this.processTargetElements("check",!0)}apply(e){const t=e?.params?.apply||this.element.value,n=e=>{e.value=t,this.quietValue||this.dispatch("change",{cancelable:!1,prefix:"",target:e})};this.processTargetElements("apply").forEach((e=>{this.delayValue?setTimeout((()=>{n(e)}),this.delayValue):n(e)}))}clear(){this.processTargetElements("clear").forEach((e=>{setTimeout((()=>{e.setAttribute("value",""),this.quietValue||this.dispatch("change",{cancelable:!1,prefix:"",target:e})}),this.delayValue)}))}ping(){this.processTargetElements("ping",!1,{bubbles:!0})}processTargetElements(e,t=!1,n={}){if(!t&&this.disabledValue)return[];const i=[...document.querySelectorAll(this.targetValue)],o=i.filter((t=>!this.dispatch(e,{bubbles:!1,cancelable:!0,...n,detail:{element:this.element,value:this.element.value},target:t}).defaultPrevented));return t&&(this.disabledValue=i.length>o.length),o}}class en extends r.Controller{static values={options:{default:{},type:Object},url:String};tagit;connect(){const e=this.cleanTag.bind(this);o()(this.element).tagit({autocomplete:{source:this.urlValue},preprocessTag:e,...this.optionsValue})}cleanTag(e){return e&&'"'!==e[0]&&e.indexOf(" ")>-1?`"${e}"`:e}clear(){o()(this.element).tagit("removeAll")}}var tn=n(9633);const nn={initial:1e4,long:3e3,notify:30,short:300};class on extends r.Controller{static values={confirmation:{default:"",type:String},durations:{default:nn,type:Object},force:{default:!1,type:Boolean},hasComments:{default:!1,type:Boolean},hasEdits:{default:!1,type:Boolean},watch:{default:"edits",type:String}};initialFormData;observer;runningCheck;initialize(){this.notify=(0,C.D)(this.notify.bind(this),this.durationsValue.notify)}connect(){this.clear();const e=this.durationsValue,t=this.watchValue;t.includes("comments")&&this.watchComments(e),t.includes("edits")&&this.watchEdits(e),this.dispatch("ready",{cancelable:!1})}get formData(){const e=["comment_","comments-","csrfmiddlewaretoken","next"],t=new FormData(this.element);return JSON.stringify([...t.entries()].filter((([t])=>!e.some((e=>t.startsWith(e))))),((e,t)=>t instanceof File?{name:t.name,size:t.size,type:t.type}:t))}check(){const{long:e,short:t}=this.durationsValue;return this.runningCheck&&this.runningCheck.cancel(),this.runningCheck=(0,C.D)((()=>{this.forceValue?this.hasEditsValue=!0:this.initialFormData?this.hasEditsValue=this.initialFormData!==this.formData:this.hasEditsValue=!1}),this.hasEditsValue?e:t),this.runningCheck()}clear(){this.hasCommentsValue=!1,this.hasEditsValue=!1}confirm(e){const t=this.confirmationValue;return t&&(this.forceValue||this.hasCommentsValue||this.hasEditsValue)?(e.returnValue=t,t):null}hasCommentsValueChanged(e,t){e!==t&&this.notify()}hasEditsValueChanged(e,t){e!==t&&this.notify()}notify(){const e=this.hasCommentsValue,t=this.hasEditsValue;if(!e&&!t)return void this.dispatch("clear",{cancelable:!1});const[n]=[t&&e&&"all",e&&"comments",t&&"edits"].filter(Boolean);this.dispatch("add",{cancelable:!1,detail:{type:n}})}submit(){this.confirmationValue=""}watchComments({long:e,short:t}){let n;const{commentApp:i}=window.comments,o=i.selectors.selectIsDirty(i.store.getState());this.dispatch("watch-edits",{cancelable:!1,detail:{initialComments:o}}),this.hasCommentsValue=o,i.store.subscribe((()=>{n&&n.cancel(),n=(0,C.D)((()=>{this.hasCommentsValue=i.selectors.selectIsDirty(i.store.getState())}),this.hasCommentsValue?e:t),n()}))}watchEdits({initial:e}){const t=this.element;(0,C.D)((()=>{const e=this.formData;this.initialFormData=e,this.dispatch("watch-edits",{cancelable:!1,detail:{initialFormData:e}});const n=e=>e.nodeType===e.ELEMENT_NODE&&["INPUT","TEXTAREA","SELECT"].includes(e.tagName),i=new MutationObserver((e=>{e.some((e=>Array.from(e.addedNodes).some(n)||Array.from(e.removedNodes).some(n)))&&this.check()}));i.observe(t,{attributes:!1,childList:!0,subtree:!0}),this.observer=i}),e)()}disconnect(){this.runningCheck&&this.runningCheck.cancel(),this.observer&&this.observer.disconnect()}static afterLoad(e){window.enableDirtyFormCheck=(t,{alwaysDirty:n=!1,confirmationMessage:i=""})=>{R().then((()=>{const o=document.querySelector(`${t}:not([data-controller~='${e}'])`);o instanceof HTMLFormElement&&([["data-w-unsaved-confirmation-value",i||" "],["data-w-unsaved-force-value",String(n||!1)],["data-w-unsaved-watch-value","edits comments"]].forEach((([e,t])=>{o.setAttribute(e,t)})),o.setAttribute("data-action",[o.getAttribute("data-action")||"","w-unsaved#submit","beforeunload@window->w-unsaved#confirm","change->w-unsaved#check","keyup->w-unsaved#check"].filter(Boolean).join(" ")),o.setAttribute("data-controller",[o.getAttribute("data-controller")||"",e].filter(Boolean).join(" ")))}))}}}class rn extends Error{constructor(e){super(e),this.message=`Version number '${e}' is not formatted correctly.`}}class an extends Error{constructor(){super(),this.message="Can only compare prerelease versions"}}class sn{static MAJOR=new sn("Major");static MINOR=new sn("Minor");static PATCH=new sn("Patch");static PRE_RELEASE_STEP=new sn("PreReleaseStep");static PRE_RELEASE_VERSION=new sn("PreReleaseVersion");constructor(e){this.name=e}}class ln{constructor(e){const t=e.match(/^(?\d+)\.{1}(?\d+)((\.{1}(?\d+))|(?a|b|rc|\.dev){1}(?\d+)){0,1}$/);if(null===t)throw new rn(e);const n=t.groups;this.major=parseInt(n.major,10),this.minor=parseInt(n.minor,10),this.patch=n.patch?parseInt(n.patch,10):0,this.preReleaseStep=n.preReleaseStep?n.preReleaseStep:null,this.preReleaseVersion=n.preReleaseVersion?parseInt(n.preReleaseVersion,10):null}isPreRelease(){return null!==this.preReleaseStep}isPreReleaseStepBehind(e){if(!this.isPreRelease()||!e.isPreRelease())throw new an;return"a"===this.preReleaseStep&&("b"===e.preReleaseStep||"rc"===e.preReleaseStep)||"b"===this.preReleaseStep&&"rc"===e.preReleaseStep}howMuchBehind(e){if(this.major{if(200!==t.status)throw Error(`Unexpected response from ${e}. Status: ${t.status}`);return t.json()})).then((e=>{let i=e;if(i&&i.lts&&n&&(i=i.lts),i&&i.version){const e=new ln(i.version),o=t.howMuchBehind(e);let r=null;if(!o)return;if(r=o===sn.MAJOR||o===sn.MINOR?i.minorUrl:i.url,this.latestVersionTarget instanceof HTMLElement){const e=[i.version,n?"(LTS)":""].join(" ").trim();this.latestVersionTarget.textContent=e}this.linkTarget instanceof HTMLElement&&this.linkTarget.setAttribute("href",r||""),this.element.classList.remove(this.hiddenClass)}})).catch((t=>{console.error(`Error fetching ${e}. Error: ${t}`)}))}}const hn=[{controllerConstructor:m,identifier:"w-action"},{controllerConstructor:T,identifier:"w-autosize"},{controllerConstructor:S,identifier:"w-bulk"},{controllerConstructor:A,identifier:"w-clipboard"},{controllerConstructor:V,identifier:"w-clone"},{controllerConstructor:V,identifier:"w-messages"},{controllerConstructor:x,identifier:"w-count"},{controllerConstructor:L.Y,identifier:"w-dialog"},{controllerConstructor:k,identifier:"w-dismissible"},{controllerConstructor:O,identifier:"w-drilldown"},{controllerConstructor:H,identifier:"w-dropdown"},{controllerConstructor:z,identifier:"w-init"},{controllerConstructor:j,identifier:"w-link"},{controllerConstructor:qt,identifier:"w-orderable"},{controllerConstructor:$t,identifier:"w-progress"},{controllerConstructor:Ut,identifier:"w-breadcrumbs"},{controllerConstructor:Ut,identifier:"w-reveal"},{controllerConstructor:Wt,identifier:"w-skip-link"},{controllerConstructor:Zt,identifier:"w-slug"},{controllerConstructor:Gt,identifier:"w-submit"},{controllerConstructor:Qt,identifier:"w-swap"},{controllerConstructor:Jt,identifier:"w-sync"},{controllerConstructor:en,identifier:"w-tag"},{controllerConstructor:tn.y,identifier:"w-teleport"},{controllerConstructor:I,identifier:"w-tooltip"},{controllerConstructor:on,identifier:"w-unsaved"},{controllerConstructor:cn,identifier:"w-upgrade"}];var dn=n(5447);window.StimulusModule=r;const un=window.wagtail||{};un.app=(({debug:e=!1,definitions:t=[],root:n=document.documentElement}={})=>{const i=r.Application.start(n);return i.debug=e,i.load(t),i})({definitions:hn}),un.components={Icon:l.Z,Portal:c.Z},window.wagtail=un,window.escapeHtml=dn.X,o()((()=>{o()(".drop-zone").on("dragover",(function(){o()(this).addClass("hovered")})).on("dragleave dragend drop",(function(){o()(this).removeClass("hovered")}))}))},5311:e=>{e.exports=jQuery}},n={};function i(e){var o=n[e];if(void 0!==o)return o.exports;var r=n[e]={id:e,loaded:!1,exports:{}};return t[e].call(r.exports,r,r.exports,i),r.loaded=!0,r.exports}i.m=t,e=[],i.O=(t,n,o,r)=>{if(!n){var a=1/0;for(h=0;h=r)&&Object.keys(i.O).every((e=>i.O[e](n[l])))?n.splice(l--,1):(s=!1,r0&&e[h-1][2]>r;h--)e[h]=e[h-1];e[h]=[n,o,r]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),i.j=321,(()=>{var e={321:0};i.O.j=t=>0===e[t];var t=(t,n)=>{var o,r,[a,s,l]=n,c=0;if(a.some((t=>0!==e[t]))){for(o in s)i.o(s,o)&&(i.m[o]=s[o]);if(l)var h=l(i)}for(t&&t(n);ci(6525)));o=i.O(o)})();