From c3e002f7cc0a5dcee78a1900635c3d1d611429d9 Mon Sep 17 00:00:00 2001 From: Sam Pohlenz Date: Sat, 11 May 2024 15:07:18 +0930 Subject: [PATCH] Fire native change event in select controller --- app/assets/bundle/trestle/bundle.js | 2 +- frontend/js/controllers/select_controller.js | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/assets/bundle/trestle/bundle.js b/app/assets/bundle/trestle/bundle.js index 85f9f25d..20de8cba 100644 --- a/app/assets/bundle/trestle/bundle.js +++ b/app/assets/bundle/trestle/bundle.js @@ -26,7 +26,7 @@ Copyright © 2024 37signals LLC —— Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s - `,e.outerHTML);e=e.parentElement}})(),window.Turbo={...nn,StreamActions:cn},Ut(),e.FetchEnctype=se,e.FetchMethod=ie,e.FetchRequest=ae,e.FetchResponse=_,e.FrameElement=o,e.FrameLoadingStyle=i,e.FrameRenderer=qe,e.PageRenderer=Lt,e.PageSnapshot=et,e.StreamActions=cn,e.StreamElement=ln,e.StreamSourceElement=un,e.cache=Vt,e.clearCache=Jt,e.connectStreamSource=Gt,e.disconnectStreamSource=Xt,e.fetch=ne,e.fetchEnctypeFromString=oe,e.fetchMethodFromString=re,e.isSafe=ce,e.navigator=zt,e.registerAdapter=Yt,e.renderStreamMessage=Qt,e.session=Wt,e.setConfirmMethod=en,e.setFormMode=tn,e.setProgressBarDelay=Zt,e.start=Ut,e.visit=Kt,Object.defineProperty(e,"__esModule",{value:!0})}(t)},352:function(e,t){"use strict";function n(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function r(e){return e instanceof n(e).Element||e instanceof Element}function i(e){return e instanceof n(e).HTMLElement||e instanceof HTMLElement}function o(e){return"undefined"!=typeof ShadowRoot&&(e instanceof n(e).ShadowRoot||e instanceof ShadowRoot)}Object.defineProperty(t,"__esModule",{value:!0});var s=Math.max,a=Math.min,c=Math.round;function l(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function u(){return!/^((?!chrome|android).)*safari/i.test(l())}function d(e,t,o){void 0===t&&(t=!1),void 0===o&&(o=!1);var s=e.getBoundingClientRect(),a=1,l=1;t&&i(e)&&(a=e.offsetWidth>0&&c(s.width)/e.offsetWidth||1,l=e.offsetHeight>0&&c(s.height)/e.offsetHeight||1);var d=(r(e)?n(e):window).visualViewport,h=!u()&&o,f=(s.left+(h&&d?d.offsetLeft:0))/a,p=(s.top+(h&&d?d.offsetTop:0))/l,m=s.width/a,g=s.height/l;return{width:m,height:g,top:p,right:f+m,bottom:p+g,left:f,x:f,y:p}}function h(e){var t=n(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function f(e){return e?(e.nodeName||"").toLowerCase():null}function p(e){return((r(e)?e.ownerDocument:e.document)||window.document).documentElement}function m(e){return d(p(e)).left+h(e).scrollLeft}function g(e){return n(e).getComputedStyle(e)}function v(e){var t=g(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function y(e,t,r){void 0===r&&(r=!1);var o,s,a=i(t),l=i(t)&&function(e){var t=e.getBoundingClientRect(),n=c(t.width)/e.offsetWidth||1,r=c(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),u=p(t),g=d(e,l,r),y={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(a||!a&&!r)&&(("body"!==f(t)||v(u))&&(y=(o=t)!==n(o)&&i(o)?{scrollLeft:(s=o).scrollLeft,scrollTop:s.scrollTop}:h(o)),i(t)?((b=d(t,!0)).x+=t.clientLeft,b.y+=t.clientTop):u&&(b.x=m(u))),{x:g.left+y.scrollLeft-b.x,y:g.top+y.scrollTop-b.y,width:g.width,height:g.height}}function b(e){var t=d(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function w(e){return"html"===f(e)?e:e.assignedSlot||e.parentNode||(o(e)?e.host:null)||p(e)}function _(e){return["html","body","#document"].indexOf(f(e))>=0?e.ownerDocument.body:i(e)&&v(e)?e:_(w(e))}function E(e,t){var r;void 0===t&&(t=[]);var i=_(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),s=n(i),a=o?[s].concat(s.visualViewport||[],v(i)?i:[]):i,c=t.concat(a);return o?c:c.concat(E(w(a)))}function S(e){return["table","td","th"].indexOf(f(e))>=0}function O(e){return i(e)&&"fixed"!==g(e).position?e.offsetParent:null}function C(e){for(var t=n(e),r=O(e);r&&S(r)&&"static"===g(r).position;)r=O(r);return r&&("html"===f(r)||"body"===f(r)&&"static"===g(r).position)?t:r||function(e){var t=/firefox/i.test(l());if(/Trident/i.test(l())&&i(e)&&"fixed"===g(e).position)return null;var n=w(e);for(o(n)&&(n=n.host);i(n)&&["html","body"].indexOf(f(n))<0;){var r=g(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var T="top",x="bottom",A="right",k="left",P="auto",j=[T,x,A,k],D="start",M="end",L="clippingParents",I="viewport",R="popper",N="reference",F=j.reduce((function(e,t){return e.concat([t+"-"+D,t+"-"+M])}),[]),$=[].concat(j,[P]).reduce((function(e,t){return e.concat([t,t+"-"+D,t+"-"+M])}),[]),B=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function H(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}function q(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function W(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function V(e,t,i){return t===I?W(function(e,t){var r=n(e),i=p(e),o=r.visualViewport,s=i.clientWidth,a=i.clientHeight,c=0,l=0;if(o){s=o.width,a=o.height;var d=u();(d||!d&&"fixed"===t)&&(c=o.offsetLeft,l=o.offsetTop)}return{width:s,height:a,x:c+m(e),y:l}}(e,i)):r(t)?function(e,t){var n=d(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,i):W(function(e){var t,n=p(e),r=h(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=s(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=s(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),c=-r.scrollLeft+m(e),l=-r.scrollTop;return"rtl"===g(i||n).direction&&(c+=s(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:c,y:l}}(p(e)))}function z(e,t,n,o){var c="clippingParents"===t?function(e){var t=E(w(e)),n=["absolute","fixed"].indexOf(g(e).position)>=0&&i(e)?C(e):e;return r(n)?t.filter((function(e){return r(e)&&q(e,n)&&"body"!==f(e)})):[]}(e):[].concat(t),l=[].concat(c,[n]),u=l[0],d=l.reduce((function(t,n){var r=V(e,n,o);return t.top=s(r.top,t.top),t.right=a(r.right,t.right),t.bottom=a(r.bottom,t.bottom),t.left=s(r.left,t.left),t}),V(e,u,o));return d.width=d.right-d.left,d.height=d.bottom-d.top,d.x=d.left,d.y=d.top,d}function U(e){return e.split("-")[0]}function Y(e){return e.split("-")[1]}function K(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function G(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?U(i):null,s=i?Y(i):null,a=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(o){case T:t={x:a,y:n.y-r.height};break;case x:t={x:a,y:n.y+n.height};break;case A:t={x:n.x+n.width,y:c};break;case k:t={x:n.x-r.width,y:c};break;default:t={x:n.x,y:n.y}}var l=o?K(o):null;if(null!=l){var u="y"===l?"height":"width";switch(s){case D:t[l]=t[l]-(n[u]/2-r[u]/2);break;case M:t[l]=t[l]+(n[u]/2-r[u]/2)}}return t}function X(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Q(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function J(e,t){void 0===t&&(t={});var n=t,i=n.placement,o=void 0===i?e.placement:i,s=n.strategy,a=void 0===s?e.strategy:s,c=n.boundary,l=void 0===c?L:c,u=n.rootBoundary,h=void 0===u?I:u,f=n.elementContext,m=void 0===f?R:f,g=n.altBoundary,v=void 0!==g&&g,y=n.padding,b=void 0===y?0:y,w=X("number"!=typeof b?b:Q(b,j)),_=m===R?N:R,E=e.rects.popper,S=e.elements[v?_:m],O=z(r(S)?S:S.contextElement||p(e.elements.popper),l,h,a),C=d(e.elements.reference),k=G({reference:C,element:E,strategy:"absolute",placement:o}),P=W(Object.assign({},E,k)),D=m===R?P:C,M={top:O.top-D.top+w.top,bottom:D.bottom-O.bottom+w.bottom,left:O.left-D.left+w.left,right:D.right-O.right+w.right},F=e.modifiersData.offset;if(m===R&&F){var $=F[o];Object.keys(M).forEach((function(e){var t=[A,x].indexOf(e)>=0?1:-1,n=[T,x].indexOf(e)>=0?"y":"x";M[e]+=$[n]*t}))}return M}var Z={placement:"bottom",modifiers:[],strategy:"absolute"};function ee(){for(var e=arguments.length,t=new Array(e),n=0;n=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[k,A].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,t.rects,o),e}),{}),a=s[t.placement],c=a.x,l=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=s}},ue={left:"right",right:"left",bottom:"top",top:"bottom"};function de(e){return e.replace(/left|right|bottom|top/g,(function(e){return ue[e]}))}var he={start:"end",end:"start"};function fe(e){return e.replace(/start|end/g,(function(e){return he[e]}))}function pe(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,c=n.allowedAutoPlacements,l=void 0===c?$:c,u=Y(r),d=u?a?F:F.filter((function(e){return Y(e)===u})):j,h=d.filter((function(e){return l.indexOf(e)>=0}));0===h.length&&(h=d);var f=h.reduce((function(t,n){return t[n]=J(e,{placement:n,boundary:i,rootBoundary:o,padding:s})[U(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}var me={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0===s||s,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,p=void 0===f||f,m=n.allowedAutoPlacements,g=t.options.placement,v=U(g),y=c||(v===g||!p?[de(g)]:function(e){if(U(e)===P)return[];var t=de(e);return[fe(e),t,fe(t)]}(g)),b=[g].concat(y).reduce((function(e,n){return e.concat(U(n)===P?pe(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:p,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,_=t.rects.popper,E=new Map,S=!0,O=b[0],C=0;C=0,R=I?"width":"height",N=J(t,{placement:j,boundary:u,rootBoundary:d,altBoundary:h,padding:l}),F=I?L?A:k:L?x:T;w[R]>_[R]&&(F=de(F));var $=de(F),B=[];if(o&&B.push(N[M]<=0),a&&B.push(N[F]<=0,N[$]<=0),B.every((function(e){return e}))){O=j,S=!1;break}E.set(j,B)}if(S)for(var H=function(e){var t=b.find((function(t){var n=E.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return O=t,"break"},q=p?3:1;q>0;q--){if("break"===H(q))break}t.placement!==O&&(t.modifiersData[r]._skip=!0,t.placement=O,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ge(e,t,n){return s(e,a(t,n))}var ve={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,c=n.altAxis,l=void 0!==c&&c,u=n.boundary,d=n.rootBoundary,h=n.altBoundary,f=n.padding,p=n.tether,m=void 0===p||p,g=n.tetherOffset,v=void 0===g?0:g,y=J(t,{boundary:u,rootBoundary:d,padding:f,altBoundary:h}),w=U(t.placement),_=Y(t.placement),E=!_,S=K(w),O="x"===S?"y":"x",P=t.modifiersData.popperOffsets,j=t.rects.reference,M=t.rects.popper,L="function"==typeof v?v(Object.assign({},t.rects,{placement:t.placement})):v,I="number"==typeof L?{mainAxis:L,altAxis:L}:Object.assign({mainAxis:0,altAxis:0},L),R=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,N={x:0,y:0};if(P){if(o){var F,$="y"===S?T:k,B="y"===S?x:A,H="y"===S?"height":"width",q=P[S],W=q+y[$],V=q-y[B],z=m?-M[H]/2:0,G=_===D?j[H]:M[H],X=_===D?-M[H]:-j[H],Q=t.elements.arrow,Z=m&&Q?b(Q):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[$],ne=ee[B],re=ge(0,j[H],Z[H]),ie=E?j[H]/2-z-re-te-I.mainAxis:G-re-te-I.mainAxis,oe=E?-j[H]/2+z+re+ne+I.mainAxis:X+re+ne+I.mainAxis,se=t.elements.arrow&&C(t.elements.arrow),ae=se?"y"===S?se.clientTop||0:se.clientLeft||0:0,ce=null!=(F=null==R?void 0:R[S])?F:0,le=q+oe-ce,ue=ge(m?a(W,q+ie-ce-ae):W,q,m?s(V,le):V);P[S]=ue,N[S]=ue-q}if(l){var de,he="x"===S?T:k,fe="x"===S?x:A,pe=P[O],me="y"===O?"height":"width",ve=pe+y[he],ye=pe-y[fe],be=-1!==[T,k].indexOf(w),we=null!=(de=null==R?void 0:R[O])?de:0,_e=be?ve:pe-j[me]-M[me]-we+I.altAxis,Ee=be?pe+j[me]+M[me]-we-I.altAxis:ye,Se=m&&be?function(e,t,n){var r=ge(e,t,n);return r>n?n:r}(_e,pe,Ee):ge(m?_e:ve,pe,m?Ee:ye);P[O]=Se,N[O]=Se-pe}t.modifiersData[r]=N}},requiresIfExists:["offset"]};var ye={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=U(n.placement),c=K(a),l=[k,A].indexOf(a)>=0?"height":"width";if(o&&s){var u=function(e,t){return X("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Q(e,j))}(i.padding,n),d=b(o),h="y"===c?T:k,f="y"===c?x:A,p=n.rects.reference[l]+n.rects.reference[c]-s[c]-n.rects.popper[l],m=s[c]-n.rects.reference[c],g=C(o),v=g?"y"===c?g.clientHeight||0:g.clientWidth||0:0,y=p/2-m/2,w=u[h],_=v-d[l]-u[f],E=v/2-d[l]/2+y,S=ge(w,E,_),O=c;n.modifiersData[r]=((t={})[O]=S,t.centerOffset=S-E,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&q(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function be(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function we(e){return[T,A,x,k].some((function(t){return e[t]>=0}))}var _e={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=J(t,{elementContext:"reference"}),a=J(t,{altBoundary:!0}),c=be(s,r),l=be(a,i,o),u=we(c),d=we(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}},Ee=te({defaultModifiers:[re,ie,ae,ce]}),Se=[re,ie,ae,ce,le,me,ve,ye,_e],Oe=te({defaultModifiers:Se});t.applyStyles=ce,t.arrow=ye,t.computeStyles=ae,t.createPopper=Oe,t.createPopperLite=Ee,t.defaultModifiers=Se,t.detectOverflow=J,t.eventListeners=re,t.flip=me,t.hide=_e,t.offset=le,t.popperGenerator=te,t.popperOffsets=ie,t.preventOverflow=ve},6579:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return h}});var r=n(9428),i=n(7176);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return(0,i.y)(e,t)}},{key:"fetchTurboStream",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,i.m)(e,t)}},{key:"csrfToken",get:function(){return document.querySelector("[name='csrf-token']").content}}],r&&s(n.prototype,r),o&&s(n,o),Object.defineProperty(n,"prototype",{writable:!1}),t}(r.Controller)},3696:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){for(var n=0;n=500){e.preventDefault();var n="".concat(t.status," (").concat(t.statusText,")");t.text().then((function(e){return i.c.show({title:n,content:e})}))}}}])&&s(n.prototype,r),o&&s(n,o),Object.defineProperty(n,"prototype",{writable:!1}),t}(r.default)},5493:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return h}});var r=n(6579);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n\n
\n
\n\n',title:function(){return e.labelText}})}},{key:"disconnect",value:function(){this.tooltip.dispose()}},{key:"labelText",get:function(){return this.labelTarget.innerText}}])&&s(n.prototype,r),o&&s(n,o),Object.defineProperty(n,"prototype",{writable:!1}),t}(r.default);h=m,p=["label"],(f=d(f="targets"))in h?Object.defineProperty(h,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):h[f]=p},5980:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return f}});var r=n(6579),i=n(9652);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n=1200?(e.add("sidebar-collapsed"),i.cp.set("trestle:sidebar","collapsed")):document.body.clientWidth>=768&&(e.add("sidebar-expanded"),i.cp.set("trestle:sidebar","expanded"))}},{key:"scrollToActive",value:function(){var e=this.element.getElementsByClassName("active")[0];e&&this.hasInnerTarget&&(this.innerTarget.scrollTop=e.offsetTop-100)}}])&&s(n.prototype,r),o&&s(n,o),Object.defineProperty(n,"prototype",{writable:!1}),t}(r.default);h=m,p=["inner"],(f=d(f="targets"))in h?Object.defineProperty(h,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):h[f]=p},3596:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return m}});var r=n(6579),i=n(9652);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n0){var n=this._createErrorBadge(t);e.appendChild(n)}}},{key:"focusFirstTabWithErrors",value:function(){this.element.querySelectorAll(".nav-link").forEach((function(e){e.querySelector(".badge-danger")&&i.Tab.getOrCreateInstance(e).show()}))}},{key:"_createErrorBadge",value:function(e){var t=document.createElement("span");return t.classList.add("badge","badge-danger","badge-pill"),t.textContent=e,t}}])&&s(n.prototype,r),o&&s(n,o),Object.defineProperty(n,"prototype",{writable:!1}),t}(r.default);h=m,f="values",p={errorSelector:{type:String,default:'.is-invalid:not([type="hidden"])'}},(f=d(f))in h?Object.defineProperty(h,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):h[f]=p},9752:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return f}});var r=n(6579),i=n(564),o=n(9652);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n=0;n--)if(!t[n].indexOf(e)){var r=t[n].replace(e,"");return decodeURIComponent(r)}return""},set:function(e,t){document.cookie="".concat(e,"=").concat(encodeURIComponent(t),"; path=/")},delete:function(e){document.cookie="".concat(e,"=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT")}}},4464:function(e,t,n){"use strict";n.d(t,{c:function(){return c}});var r=n(1028);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){for(var n=0;n\n \n \n\n"),c=function(){function e(t){var n=t.title,r=t.content;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.title=n,this.content=r}var t,n,r;return t=e,r=[{key:"show",value:function(t){new e({title:t.title,content:t.content}).show()}}],(n=[{key:"show",value:function(){this._append(this._buildModal())}},{key:"_buildModal",value:function(){var e=this._buildWrapper();e.querySelector(".modal-title").textContent=this.title;var t=this._buildIframe(this.content);return e.querySelector(".modal-body").append(t),e}},{key:"_buildWrapper",value:function(){return(new DOMParser).parseFromString(a,"text/html").body.childNodes[0]}},{key:"_buildIframe",value:function(){var e=document.createElement("iframe");return e.className="error-iframe",e.srcdoc=this.content,e}},{key:"_append",value:function(e){document.getElementById("modal").append(e)}}])&&o(t.prototype,n),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7176:function(e,t,n){"use strict";n.d(t,{m:function(){return u},y:function(){return l}});var r=n(564),i=n(4464);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{}).then((function(e){if(!e.ok)throw e;return e})).catch((function(e){var t="".concat(e.status," (").concat(e.statusText,")");e.text().then((function(e){return i.c.show({title:t,content:e})}))}))}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(e,t=a(a({},t),{},{headers:a({Accept:"text/vnd.turbo-stream.html"},t.headers)})).then((function(e){return e.text()})).then((function(e){return(0,r.renderStreamMessage)(e)}))}},1028:function(e,t,n){"use strict";n.d(t,{_:function(){return o},u:function(){return a}});var r=n(3363),i=n.n(r),o={},s={ca:"cat",el:"gr",nb:"no",vi:"vn"};function a(){for(var e=0;e2&&void 0!==arguments[2])||arguments[2]){var n=function(e){if(!e)return 0;var t=window.getComputedStyle(e),n=t.transitionDuration,r=t.transitionDelay,i=Number.parseFloat(n),o=Number.parseFloat(r);return i||o?(n=n.split(",")[0],r=r.split(",")[0],1e3*(Number.parseFloat(n)+Number.parseFloat(r))):0}(t)+5,r=!1;t.addEventListener(i,(function n(s){s.target===t&&(r=!0,t.removeEventListener(i,n),o(e))})),setTimeout((function(){r||t.dispatchEvent(new Event(i))}),n)}else o(e)};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function c(e,t){for(var n=0;n0&&c(s.width)/e.offsetWidth||1,l=e.offsetHeight>0&&c(s.height)/e.offsetHeight||1);var d=(r(e)?n(e):window).visualViewport,h=!u()&&o,f=(s.left+(h&&d?d.offsetLeft:0))/a,p=(s.top+(h&&d?d.offsetTop:0))/l,m=s.width/a,g=s.height/l;return{width:m,height:g,top:p,right:f+m,bottom:p+g,left:f,x:f,y:p}}function h(e){var t=n(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function f(e){return e?(e.nodeName||"").toLowerCase():null}function p(e){return((r(e)?e.ownerDocument:e.document)||window.document).documentElement}function m(e){return d(p(e)).left+h(e).scrollLeft}function g(e){return n(e).getComputedStyle(e)}function v(e){var t=g(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function y(e,t,r){void 0===r&&(r=!1);var o,s,a=i(t),l=i(t)&&function(e){var t=e.getBoundingClientRect(),n=c(t.width)/e.offsetWidth||1,r=c(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),u=p(t),g=d(e,l,r),y={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(a||!a&&!r)&&(("body"!==f(t)||v(u))&&(y=(o=t)!==n(o)&&i(o)?{scrollLeft:(s=o).scrollLeft,scrollTop:s.scrollTop}:h(o)),i(t)?((b=d(t,!0)).x+=t.clientLeft,b.y+=t.clientTop):u&&(b.x=m(u))),{x:g.left+y.scrollLeft-b.x,y:g.top+y.scrollTop-b.y,width:g.width,height:g.height}}function b(e){var t=d(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function w(e){return"html"===f(e)?e:e.assignedSlot||e.parentNode||(o(e)?e.host:null)||p(e)}function _(e){return["html","body","#document"].indexOf(f(e))>=0?e.ownerDocument.body:i(e)&&v(e)?e:_(w(e))}function E(e,t){var r;void 0===t&&(t=[]);var i=_(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),s=n(i),a=o?[s].concat(s.visualViewport||[],v(i)?i:[]):i,c=t.concat(a);return o?c:c.concat(E(w(a)))}function S(e){return["table","td","th"].indexOf(f(e))>=0}function O(e){return i(e)&&"fixed"!==g(e).position?e.offsetParent:null}function C(e){for(var t=n(e),r=O(e);r&&S(r)&&"static"===g(r).position;)r=O(r);return r&&("html"===f(r)||"body"===f(r)&&"static"===g(r).position)?t:r||function(e){var t=/firefox/i.test(l());if(/Trident/i.test(l())&&i(e)&&"fixed"===g(e).position)return null;var n=w(e);for(o(n)&&(n=n.host);i(n)&&["html","body"].indexOf(f(n))<0;){var r=g(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var T="top",x="bottom",A="right",k="left",P="auto",j=[T,x,A,k],D="start",M="end",L="clippingParents",I="viewport",R="popper",N="reference",F=j.reduce((function(e,t){return e.concat([t+"-"+D,t+"-"+M])}),[]),$=[].concat(j,[P]).reduce((function(e,t){return e.concat([t,t+"-"+D,t+"-"+M])}),[]),B=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function H(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}function q(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function W(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function V(e,t,i){return t===I?W(function(e,t){var r=n(e),i=p(e),o=r.visualViewport,s=i.clientWidth,a=i.clientHeight,c=0,l=0;if(o){s=o.width,a=o.height;var d=u();(d||!d&&"fixed"===t)&&(c=o.offsetLeft,l=o.offsetTop)}return{width:s,height:a,x:c+m(e),y:l}}(e,i)):r(t)?function(e,t){var n=d(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,i):W(function(e){var t,n=p(e),r=h(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=s(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=s(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),c=-r.scrollLeft+m(e),l=-r.scrollTop;return"rtl"===g(i||n).direction&&(c+=s(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:c,y:l}}(p(e)))}function z(e,t,n,o){var c="clippingParents"===t?function(e){var t=E(w(e)),n=["absolute","fixed"].indexOf(g(e).position)>=0&&i(e)?C(e):e;return r(n)?t.filter((function(e){return r(e)&&q(e,n)&&"body"!==f(e)})):[]}(e):[].concat(t),l=[].concat(c,[n]),u=l[0],d=l.reduce((function(t,n){var r=V(e,n,o);return t.top=s(r.top,t.top),t.right=a(r.right,t.right),t.bottom=a(r.bottom,t.bottom),t.left=s(r.left,t.left),t}),V(e,u,o));return d.width=d.right-d.left,d.height=d.bottom-d.top,d.x=d.left,d.y=d.top,d}function U(e){return e.split("-")[0]}function Y(e){return e.split("-")[1]}function K(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function G(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?U(i):null,s=i?Y(i):null,a=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(o){case T:t={x:a,y:n.y-r.height};break;case x:t={x:a,y:n.y+n.height};break;case A:t={x:n.x+n.width,y:c};break;case k:t={x:n.x-r.width,y:c};break;default:t={x:n.x,y:n.y}}var l=o?K(o):null;if(null!=l){var u="y"===l?"height":"width";switch(s){case D:t[l]=t[l]-(n[u]/2-r[u]/2);break;case M:t[l]=t[l]+(n[u]/2-r[u]/2)}}return t}function X(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Q(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function J(e,t){void 0===t&&(t={});var n=t,i=n.placement,o=void 0===i?e.placement:i,s=n.strategy,a=void 0===s?e.strategy:s,c=n.boundary,l=void 0===c?L:c,u=n.rootBoundary,h=void 0===u?I:u,f=n.elementContext,m=void 0===f?R:f,g=n.altBoundary,v=void 0!==g&&g,y=n.padding,b=void 0===y?0:y,w=X("number"!=typeof b?b:Q(b,j)),_=m===R?N:R,E=e.rects.popper,S=e.elements[v?_:m],O=z(r(S)?S:S.contextElement||p(e.elements.popper),l,h,a),C=d(e.elements.reference),k=G({reference:C,element:E,strategy:"absolute",placement:o}),P=W(Object.assign({},E,k)),D=m===R?P:C,M={top:O.top-D.top+w.top,bottom:D.bottom-O.bottom+w.bottom,left:O.left-D.left+w.left,right:D.right-O.right+w.right},F=e.modifiersData.offset;if(m===R&&F){var $=F[o];Object.keys(M).forEach((function(e){var t=[A,x].indexOf(e)>=0?1:-1,n=[T,x].indexOf(e)>=0?"y":"x";M[e]+=$[n]*t}))}return M}var Z={placement:"bottom",modifiers:[],strategy:"absolute"};function ee(){for(var e=arguments.length,t=new Array(e),n=0;n=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[k,A].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,t.rects,o),e}),{}),a=s[t.placement],c=a.x,l=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=s}},ue={left:"right",right:"left",bottom:"top",top:"bottom"};function de(e){return e.replace(/left|right|bottom|top/g,(function(e){return ue[e]}))}var he={start:"end",end:"start"};function fe(e){return e.replace(/start|end/g,(function(e){return he[e]}))}function pe(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,c=n.allowedAutoPlacements,l=void 0===c?$:c,u=Y(r),d=u?a?F:F.filter((function(e){return Y(e)===u})):j,h=d.filter((function(e){return l.indexOf(e)>=0}));0===h.length&&(h=d);var f=h.reduce((function(t,n){return t[n]=J(e,{placement:n,boundary:i,rootBoundary:o,padding:s})[U(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}var me={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0===s||s,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,p=void 0===f||f,m=n.allowedAutoPlacements,g=t.options.placement,v=U(g),y=c||(v===g||!p?[de(g)]:function(e){if(U(e)===P)return[];var t=de(e);return[fe(e),t,fe(t)]}(g)),b=[g].concat(y).reduce((function(e,n){return e.concat(U(n)===P?pe(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:p,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,_=t.rects.popper,E=new Map,S=!0,O=b[0],C=0;C=0,R=I?"width":"height",N=J(t,{placement:j,boundary:u,rootBoundary:d,altBoundary:h,padding:l}),F=I?L?A:k:L?x:T;w[R]>_[R]&&(F=de(F));var $=de(F),B=[];if(o&&B.push(N[M]<=0),a&&B.push(N[F]<=0,N[$]<=0),B.every((function(e){return e}))){O=j,S=!1;break}E.set(j,B)}if(S)for(var H=function(e){var t=b.find((function(t){var n=E.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return O=t,"break"},q=p?3:1;q>0;q--){if("break"===H(q))break}t.placement!==O&&(t.modifiersData[r]._skip=!0,t.placement=O,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ge(e,t,n){return s(e,a(t,n))}var ve={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,c=n.altAxis,l=void 0!==c&&c,u=n.boundary,d=n.rootBoundary,h=n.altBoundary,f=n.padding,p=n.tether,m=void 0===p||p,g=n.tetherOffset,v=void 0===g?0:g,y=J(t,{boundary:u,rootBoundary:d,padding:f,altBoundary:h}),w=U(t.placement),_=Y(t.placement),E=!_,S=K(w),O="x"===S?"y":"x",P=t.modifiersData.popperOffsets,j=t.rects.reference,M=t.rects.popper,L="function"==typeof v?v(Object.assign({},t.rects,{placement:t.placement})):v,I="number"==typeof L?{mainAxis:L,altAxis:L}:Object.assign({mainAxis:0,altAxis:0},L),R=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,N={x:0,y:0};if(P){if(o){var F,$="y"===S?T:k,B="y"===S?x:A,H="y"===S?"height":"width",q=P[S],W=q+y[$],V=q-y[B],z=m?-M[H]/2:0,G=_===D?j[H]:M[H],X=_===D?-M[H]:-j[H],Q=t.elements.arrow,Z=m&&Q?b(Q):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[$],ne=ee[B],re=ge(0,j[H],Z[H]),ie=E?j[H]/2-z-re-te-I.mainAxis:G-re-te-I.mainAxis,oe=E?-j[H]/2+z+re+ne+I.mainAxis:X+re+ne+I.mainAxis,se=t.elements.arrow&&C(t.elements.arrow),ae=se?"y"===S?se.clientTop||0:se.clientLeft||0:0,ce=null!=(F=null==R?void 0:R[S])?F:0,le=q+oe-ce,ue=ge(m?a(W,q+ie-ce-ae):W,q,m?s(V,le):V);P[S]=ue,N[S]=ue-q}if(l){var de,he="x"===S?T:k,fe="x"===S?x:A,pe=P[O],me="y"===O?"height":"width",ve=pe+y[he],ye=pe-y[fe],be=-1!==[T,k].indexOf(w),we=null!=(de=null==R?void 0:R[O])?de:0,_e=be?ve:pe-j[me]-M[me]-we+I.altAxis,Ee=be?pe+j[me]+M[me]-we-I.altAxis:ye,Se=m&&be?function(e,t,n){var r=ge(e,t,n);return r>n?n:r}(_e,pe,Ee):ge(m?_e:ve,pe,m?Ee:ye);P[O]=Se,N[O]=Se-pe}t.modifiersData[r]=N}},requiresIfExists:["offset"]};var ye={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=U(n.placement),c=K(a),l=[k,A].indexOf(a)>=0?"height":"width";if(o&&s){var u=function(e,t){return X("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Q(e,j))}(i.padding,n),d=b(o),h="y"===c?T:k,f="y"===c?x:A,p=n.rects.reference[l]+n.rects.reference[c]-s[c]-n.rects.popper[l],m=s[c]-n.rects.reference[c],g=C(o),v=g?"y"===c?g.clientHeight||0:g.clientWidth||0:0,y=p/2-m/2,w=u[h],_=v-d[l]-u[f],E=v/2-d[l]/2+y,S=ge(w,E,_),O=c;n.modifiersData[r]=((t={})[O]=S,t.centerOffset=S-E,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&q(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function be(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function we(e){return[T,A,x,k].some((function(t){return e[t]>=0}))}var _e={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=J(t,{elementContext:"reference"}),a=J(t,{altBoundary:!0}),c=be(s,r),l=be(a,i,o),u=we(c),d=we(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}},Ee=te({defaultModifiers:[re,ie,ae,ce]}),Se=[re,ie,ae,ce,le,me,ve,ye,_e],Oe=te({defaultModifiers:Se});t.applyStyles=ce,t.arrow=ye,t.computeStyles=ae,t.createPopper=Oe,t.createPopperLite=Ee,t.defaultModifiers=Se,t.detectOverflow=J,t.eventListeners=re,t.flip=me,t.hide=_e,t.offset=le,t.popperGenerator=te,t.popperOffsets=ie,t.preventOverflow=ve},6579:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return h}});var r=n(9428),i=n(7176);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return(0,i.y)(e,t)}},{key:"fetchTurboStream",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,i.m)(e,t)}},{key:"csrfToken",get:function(){return document.querySelector("[name='csrf-token']").content}}],r&&s(n.prototype,r),o&&s(n,o),Object.defineProperty(n,"prototype",{writable:!1}),t}(r.Controller)},3696:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){for(var n=0;n=500){e.preventDefault();var n="".concat(t.status," (").concat(t.statusText,")");t.text().then((function(e){return i.c.show({title:n,content:e})}))}}}])&&s(n.prototype,r),o&&s(n,o),Object.defineProperty(n,"prototype",{writable:!1}),t}(r.default)},5493:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return h}});var r=n(6579);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n\n
\n
\n\n',title:function(){return e.labelText}})}},{key:"disconnect",value:function(){this.tooltip.dispose()}},{key:"labelText",get:function(){return this.labelTarget.innerText}}])&&s(n.prototype,r),o&&s(n,o),Object.defineProperty(n,"prototype",{writable:!1}),t}(r.default);h=m,p=["label"],(f=d(f="targets"))in h?Object.defineProperty(h,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):h[f]=p},5980:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return f}});var r=n(6579),i=n(9652);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n=1200?(e.add("sidebar-collapsed"),i.cp.set("trestle:sidebar","collapsed")):document.body.clientWidth>=768&&(e.add("sidebar-expanded"),i.cp.set("trestle:sidebar","expanded"))}},{key:"scrollToActive",value:function(){var e=this.element.getElementsByClassName("active")[0];e&&this.hasInnerTarget&&(this.innerTarget.scrollTop=e.offsetTop-100)}}])&&s(n.prototype,r),o&&s(n,o),Object.defineProperty(n,"prototype",{writable:!1}),t}(r.default);h=m,p=["inner"],(f=d(f="targets"))in h?Object.defineProperty(h,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):h[f]=p},3596:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return m}});var r=n(6579),i=n(9652);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n0){var n=this._createErrorBadge(t);e.appendChild(n)}}},{key:"focusFirstTabWithErrors",value:function(){this.element.querySelectorAll(".nav-link").forEach((function(e){e.querySelector(".badge-danger")&&i.Tab.getOrCreateInstance(e).show()}))}},{key:"_createErrorBadge",value:function(e){var t=document.createElement("span");return t.classList.add("badge","badge-danger","badge-pill"),t.textContent=e,t}}])&&s(n.prototype,r),o&&s(n,o),Object.defineProperty(n,"prototype",{writable:!1}),t}(r.default);h=m,f="values",p={errorSelector:{type:String,default:'.is-invalid:not([type="hidden"])'}},(f=d(f))in h?Object.defineProperty(h,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):h[f]=p},9752:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return f}});var r=n(6579),i=n(564),o=n(9652);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n=0;n--)if(!t[n].indexOf(e)){var r=t[n].replace(e,"");return decodeURIComponent(r)}return""},set:function(e,t){document.cookie="".concat(e,"=").concat(encodeURIComponent(t),"; path=/")},delete:function(e){document.cookie="".concat(e,"=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT")}}},4464:function(e,t,n){"use strict";n.d(t,{c:function(){return c}});var r=n(1028);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){for(var n=0;n\n \n \n\n"),c=function(){function e(t){var n=t.title,r=t.content;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.title=n,this.content=r}var t,n,r;return t=e,r=[{key:"show",value:function(t){new e({title:t.title,content:t.content}).show()}}],(n=[{key:"show",value:function(){this._append(this._buildModal())}},{key:"_buildModal",value:function(){var e=this._buildWrapper();e.querySelector(".modal-title").textContent=this.title;var t=this._buildIframe(this.content);return e.querySelector(".modal-body").append(t),e}},{key:"_buildWrapper",value:function(){return(new DOMParser).parseFromString(a,"text/html").body.childNodes[0]}},{key:"_buildIframe",value:function(){var e=document.createElement("iframe");return e.className="error-iframe",e.srcdoc=this.content,e}},{key:"_append",value:function(e){document.getElementById("modal").append(e)}}])&&o(t.prototype,n),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7176:function(e,t,n){"use strict";n.d(t,{m:function(){return u},y:function(){return l}});var r=n(564),i=n(4464);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{}).then((function(e){if(!e.ok)throw e;return e})).catch((function(e){var t="".concat(e.status," (").concat(e.statusText,")");e.text().then((function(e){return i.c.show({title:t,content:e})}))}))}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(e,t=a(a({},t),{},{headers:a({Accept:"text/vnd.turbo-stream.html"},t.headers)})).then((function(e){return e.text()})).then((function(e){return(0,r.renderStreamMessage)(e)}))}},1028:function(e,t,n){"use strict";n.d(t,{_:function(){return o},u:function(){return a}});var r=n(3363),i=n.n(r),o={},s={ca:"cat",el:"gr",nb:"no",vi:"vn"};function a(){for(var e=0;e2&&void 0!==arguments[2])||arguments[2]){var n=function(e){if(!e)return 0;var t=window.getComputedStyle(e),n=t.transitionDuration,r=t.transitionDelay,i=Number.parseFloat(n),o=Number.parseFloat(r);return i||o?(n=n.split(",")[0],r=r.split(",")[0],1e3*(Number.parseFloat(n)+Number.parseFloat(r))):0}(t)+5,r=!1;t.addEventListener(i,(function n(s){s.target===t&&(r=!0,t.removeEventListener(i,n),o(e))})),setTimeout((function(){r||t.dispatchEvent(new Event(i))}),n)}else o(e)};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function c(e,t){for(var n=0;n { + if (!e.originalEvent) { + e.preventDefault() + + const nativeEvent = new CustomEvent('change', { + bubbles: true, + cancelable: true + }) + + e.target.dispatchEvent(nativeEvent) + } + }) } disconnect () { $(this.element).select2('destroy') + $(this.element).off('change.select2') } get options () {