| 26 | `},Ia={...Et.DefaultType,content:"(string|element|function)"},Ra={HIDE:`hide${tt}`,HIDDEN:`hidden${tt}`,SHOW:`show${tt}`,SHOWN:`shown${tt}`,INSERTED:`inserted${tt}`,CLICK:`click${tt}`,FOCUSIN:`focusin${tt}`,FOCUSOUT:`focusout${tt}`,MOUSEENTER:`mouseenter${tt}`,MOUSELEAVE:`mouseleave${tt}`},ka="[data-twe-popover-header-ref]",xa="[data-twe-popover-body-ref]";class ge extends Et{static get Default(){return $a}static get NAME(){return Sa}static get Event(){return Ra}static get DefaultType(){return Ia}isWithContent(){return this.getTitle()||this._getContent()}setContent(t){this._sanitizeAndSetContent(t,this.getTitle(),ka),this._sanitizeAndSetContent(t,this._getContent(),xa)}_getContent(){return this._resolvePossibleFunction(this._config.content)}_getBasicClassPrefix(){return La}static jQueryInterface(t){return this.each(function(){const e=ge.getOrCreateInstance(this,t);if(typeof t=="string"){if(typeof e[t]>"u")throw new TypeError(`No method named "${t}"`);e[t]()}})}}const mi="scrollspy",Ei=".twe.scrollspy",nn={offset:10,method:"auto",target:""},Pa={offset:"number",method:"string",target:"(string|element)"},Ma={active:"!text-primary font-semibold border-s-[0.125rem] border-solid border-primary"},Ha={active:"string"},vi=`activate${Ei}`,Va=`scroll${Ei}`,Zt="data-twe-nav-link-active",rn="data-twe-collapsible-scrollspy-ref",on="[data-twe-dropdown-item-ref]",Wa="[data-twe-nav-list-ref]",bi="[data-twe-nav-link-ref]",Ba="[data-twe-nav-item-ref]",an="[data-twe-list-group-item-ref]",wi=`${bi}, ${an}, ${on}`,ja="[data-twe-dropdown-ref]",Ua="[data-twe-dropdown-toggle-ref]",ln=`[${rn}]`,Ya=`[${Zt}]`,Ti="ul",Ka="maxOffset",cn="position";class me extends et{constructor(t,e,s){super(t),this._scrollElement=this._element.tagName==="BODY"?window:this._element,this._config=this._getConfig(e),this._classes=this._getClasses(s),this._offsets=[],this._targets=[],this._collapsibles=[],this._activeTarget=null,this._scrollHeight=0,d.on(this._scrollElement,Va,()=>this._process()),this.refresh(),this._process(),this._bindActivateEvent(),this._getCollapsibles(),this._collapsibles.length!==0&&(this._showSubsection(),this._hideSubsection())}static get Default(){return nn}static get NAME(){return mi}refresh(){const t=this._scrollElement===this._scrollElement.window?Ka:cn,e=this._config.method==="auto"?t:this._config.method,s=e===cn?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),h.find(wi,this._config.target).map(r=>{const o=Re(r),a=o?h.findOne(o):null;if(a){const l=a.getBoundingClientRect();if(l.width||l.height)return[E[e](a).top+s,o]}return null}).filter(r=>r).sort((r,o)=>r[0]-o[0]).forEach(r=>{this._offsets.push(r[0]),this._targets.push(r[1])})}dispose(){d.off(this._scrollElement,Ei),d.off(this._scrollElement,vi),super.dispose()}_getConfig(t){return t={...nn,...E.getDataAttributes(this._element),...typeof t=="object"&&t?t:{}},t.target=nt(t.target)||document.documentElement,x(mi,t,Pa),t}_getClasses(t){const e=E.getDataClassAttributes(this._element);return t={...Ma,...e,...t},x(mi,t,Ha),t}_getScrollTop(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop}_getScrollHeight(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}_getOffsetHeight(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height}_process(){const t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),s=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=s){const n=this._targets[this._targets.length-1];this._activeTarget!==n&&this._activate(n);return}if(this._activeTarget&&t<this._offsets[0]&&this._offsets[0]>0){this._activeTarget=null,this._clear();return}for(let n=this._offsets.length;n--;)this._activeTarget!==this._targets[n]&&t>=this._offsets[n]&&(typeof this._offsets[n+1]>"u"||t<this._offsets[n+1])&&this._activate(this._targets[n])}_activate(t){this._activeTarget=t,this._clear();const e=wi.split(",").map(n=>`${n}[data-twe-target="${t}"],${n}[href="${t}"]`),s=h.findOne(e.join(","),this._config.target);s.classList.add(...this._classes.active.split(" ")),s.setAttribute(Zt,""),s.getAttribute(on)?h.findOne(Ua,s.closest(ja)).classList.add(...this._classes.active.split(" ")):h.parents(s,Wa).forEach(n=>{h.prev(n,`${bi}, ${an}`).forEach(r=>{r.classList.add(...this._classes.active.split(" ")),r.setAttribute(Zt,"")}),h.prev(n,Ba).forEach(r=>{h.children(r,bi).forEach(o=>o.classList.add(...this._classes.active.split(" ")))})}),d.trigger(this._scrollElement,vi,{relatedTarget:t})}_clear(){h.find(wi,this._config.target).filter(t=>t.classList.contains(...this._classes.active.split(" "))).forEach(t=>{t.classList.remove(...this._classes.active.split(" ")),t.removeAttribute(Zt)})}_hide(t){const e=h.findOne(Ti,t.parentNode);e.style.overflow="hidden",e.style.height="0px"}_show(t,e){t.style.height=e}_getCollapsibles(){const t=h.find(ln);t&&t.forEach(e=>{const s=e.parentNode,n=h.findOne(Ti,s),r=n.offsetHeight||n.scrollHeight;this._collapsibles.push({element:n,relatedTarget:e.getAttribute("href"),height:`${r}px`})})}_showSubsection(){h.find(Ya).filter(s=>s.hasAttribute(rn)).forEach(s=>{const n=h.findOne(Ti,s.parentNode),r=this._collapsibles.find(o=>o.relatedTarget=s.getAttribute("href")).height;this._show(n,r)})}_hideSubsection(){h.find(ln).filter(e=>e.hasAttribute(Zt)===!1).forEach(e=>{this._hide(e)})}_bindActivateEvent(){d.on(this._element,vi,()=>{this._showSubsection(),this._hideSubsection()})}static jQueryInterface(t){return this.each(function(){const e=me.getOrCreateInstance(this,t);if(typeof t=="string"){if(typeof e[t]>"u")throw new TypeError(`No method named "${t}"`);e[t]()}})}}const dn="tab",Ee=".twe.tab",Fa=`hide${Ee}`,za=`hidden${Ee}`,qa=`show${Ee}`,Xa=`shown${Ee}`,Ga="data-twe-dropdown-menu-ref",Ht="data-twe-tab-active",ve="data-twe-nav-active",Qa="[data-twe-dropdown-ref]",Za="[data-twe-nav-ref]",un=`[${Ht}]`,Ja=`[${ve}]`,hn=":scope > li > .active",tl="[data-twe-dropdown-toggle-ref]",el=":scope > [data-twe-dropdown-menu-ref] [data-twe-dropdown-show]",il={show:"opacity-100",hide:"opacity-0"},sl={show:"string",hide:"string"};class be extends et{constructor(t,e){super(t),this._classes=this._getClasses(e)}static get NAME(){return dn}show(){if(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&this._element.getAttribute(ve)==="")return;let t;const e=st(this._element),s=this._element.closest(Za),n=h.findOne(Ja,s);if(s){const l=s.nodeName==="UL"||s.nodeName==="OL"?hn:un;t=h.find(l,s),t=t[t.length-1]}const r=t?d.trigger(t,Fa,{relatedTarget:this._element}):null;if(d.trigger(this._element,qa,{relatedTarget:t}).defaultPrevented||r!==null&&r.defaultPrevented)return;this._activate(this._element,s,null,n,this._element);const a=()=>{d.trigger(t,za,{relatedTarget:this._element}),d.trigger(this._element,Xa,{relatedTarget:t})};e?this._activate(e,e.parentNode,a,n,this._element):a()}_getClasses(t){const e=E.getDataClassAttributes(this._element);return t={...il,...e,...t},x(dn,t,sl),t}_activate(t,e,s,n,r){const a=(e&&(e.nodeName==="UL"||e.nodeName==="OL")?h.find(hn,e):h.children(e,un))[0],l=s&&a&&a.hasAttribute(Ht),u=()=>this._transitionComplete(t,a,s,n,r);a&&l?(E.removeClass(a,this._classes.show),E.addClass(a,this._classes.hide),this._queueCallback(u,t,!0)):u()}_transitionComplete(t,e,s,n,r){if(e&&n){e.removeAttribute(Ht),n.removeAttribute(ve);const a=h.findOne(el,e.parentNode);a&&a.removeAttribute(Ht),e.getAttribute("role")==="tab"&&e.setAttribute("aria-selected",!1)}t.setAttribute(Ht,""),r.setAttribute(ve,""),t.getAttribute("role")==="tab"&&t.setAttribute("aria-selected",!0),Ut(t),t.classList.contains(this._classes.hide)&&(E.removeClass(t,this._classes.hide),E.addClass(t,this._classes.show));let o=t.parentNode;if(o&&o.nodeName==="LI"&&(o=o.parentNode),o&&o.hasAttribute(Ga)){const a=t.closest(Qa);a&&h.find(tl,a).forEach(l=>l.setAttribute(Ht,"")),t.setAttribute("aria-expanded",!0)}s&&s()}static jQueryInterface(t){return this.each(function(){const e=be.getOrCreateInstance(this);if(typeof t=="string"){if(typeof e[t]>"u")throw new TypeError(`No method named "${t}"`);e[t]()}})}}(()=>{var i={454:(s,n,r)=>{r.d(n,{Z:()=>l});var o=r(645),a=r.n(o)()(function(u){return u[1]});a.push([s.id,"INPUT:-webkit-autofill,SELECT:-webkit-autofill,TEXTAREA:-webkit-autofill{animation-name:onautofillstart}INPUT:not(:-webkit-autofill),SELECT:not(:-webkit-autofill),TEXTAREA:not(:-webkit-autofill){animation-name:onautofillcancel}@keyframes onautofillstart{}@keyframes onautofillcancel{}",""]);const l=a},645:s=>{s.exports=function(n){var r=[];return r.toString=function(){return this.map(function(o){var a=n(o);return o[2]?"@media ".concat(o[2]," {").concat(a,"}"):a}).join("")},r.i=function(o,a,l){typeof o=="string"&&(o=[[null,o,""]]);var u={};if(l)for(var c=0;c<this.length;c++){var f=this[c][0];f!=null&&(u[f]=!0)}for(var v=0;v<o.length;v++){var g=[].concat(o[v]);l&&u[g[0]]||(a&&(g[2]?g[2]="".concat(a," and ").concat(g[2]):g[2]=a),r.push(g))}},r}},810:()=>{(function(){if(typeof window<"u")try{var s=new window.CustomEvent("test",{cancelable:!0});if(s.preventDefault(),s.defaultPrevented!==!0)throw new Error("Could not prevent default")}catch{var n=function(o,a){var l,u;return(a=a||{}).bubbles=!!a.bubbles,a.cancelable=!!a.cancelable,(l=document.createEvent("CustomEvent")).initCustomEvent(o,a.bubbles,a.cancelable,a.detail),u=l.preventDefault,l.preventDefault=function(){u.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch{this.defaultPrevented=!0}},l};n.prototype=window.Event.prototype,window.CustomEvent=n}})()},379:(s,n,r)=>{var o,a=function(){var m={};return function(p){if(m[p]===void 0){var _=document.querySelector(p);if(window.HTMLIFrameElement&&_ instanceof window.HTMLIFrameElement)try{_=_.contentDocument.head}catch{_=null}m[p]=_}return m[p]}}(),l=[];function u(m){for(var p=-1,_=0;_<l.length;_++)if(l[_].identifier===m){p=_;break}return p}function c(m,p){for(var _={},b=[],w=0;w<m.length;w++){var C=m[w],A=p.base?C[0]+p.base:C[0],N=_[A]||0,$="".concat(A," ").concat(N);_[A]=N+1;var V=u($),k={css:C[1],media:C[2],sourceMap:C[3]};V!==-1?(l[V].references++,l[V].updater(k)):l.push({identifier:$,updater:I(k,p),references:1}),b.push($)}return b}function f(m){var p=document.createElement("style"),_=m.attributes||{};if(_.nonce===void 0){var b=r.nc;b&&(_.nonce=b)}if(Object.keys(_).forEach(function(C){p.setAttribute(C,_[C])}),typeof m.insert=="function")m.insert(p);else{var w=a(m.insert||"head");if(!w)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");w.appendChild(p)}return p}var v,g=(v=[],function(m,p){return v[m]=p,v.filter(Boolean).join(` |
| 28 | /*# sourceMappingURL=data:application/json;base64,`.concat(btoa(unescape(encodeURIComponent(JSON.stringify(C))))," */")),m.styleSheet)m.styleSheet.cssText=b;else{for(;m.firstChild;)m.removeChild(m.firstChild);m.appendChild(document.createTextNode(b))}}var y=null,D=0;function I(m,p){var _,b,w;if(p.singleton){var C=D++;_=y||(y=f(p)),b=O.bind(null,_,C,!1),w=O.bind(null,_,C,!0)}else _=f(p),b=T.bind(null,_,p),w=function(){(function(A){if(A.parentNode===null)return!1;A.parentNode.removeChild(A)})(_)};return b(m),function(A){if(A){if(A.css===m.css&&A.media===m.media&&A.sourceMap===m.sourceMap)return;b(m=A)}else w()}}s.exports=function(m,p){(p=p||{}).singleton||typeof p.singleton=="boolean"||(p.singleton=(o===void 0&&(o=!!(window&&document&&document.all&&!window.atob)),o));var _=c(m=m||[],p);return function(b){if(b=b||[],Object.prototype.toString.call(b)==="[object Array]"){for(var w=0;w<_.length;w++){var C=u(_[w]);l[C].references--}for(var A=c(b,p),N=0;N<_.length;N++){var $=u(_[N]);l[$].references===0&&(l[$].updater(),l.splice($,1))}_=A}}}}},t={};function e(s){var n=t[s];if(n!==void 0)return n.exports;var r=t[s]={id:s,exports:{}};return i[s](r,r.exports,e),r.exports}e.n=s=>{var n=s&&s.__esModule?()=>s.default:()=>s;return e.d(n,{a:n}),n},e.d=(s,n)=>{for(var r in n)e.o(n,r)&&!e.o(s,r)&&Object.defineProperty(s,r,{enumerable:!0,get:n[r]})},e.o=(s,n)=>Object.prototype.hasOwnProperty.call(s,n),(()=>{var s=e(379),n=e.n(s),r=e(454);function o(l){if(!l.hasAttribute("autocompleted")){l.setAttribute("autocompleted","");var u=new window.CustomEvent("onautocomplete",{bubbles:!0,cancelable:!0,detail:null});l.dispatchEvent(u)||(l.value="")}}function a(l){l.hasAttribute("autocompleted")&&(l.removeAttribute("autocompleted"),l.dispatchEvent(new window.CustomEvent("onautocomplete",{bubbles:!0,cancelable:!1,detail:null})))}n()(r.Z,{insert:"head",singleton:!1}),r.Z.locals,e(810),document.addEventListener("animationstart",function(l){l.animationName==="onautofillstart"?o(l.target):a(l.target)},!0),document.addEventListener("input",function(l){l.inputType!=="insertReplacementText"&&"data"in l?a(l.target):o(l.target)},!0)})()})();const Ai="input",we="twe.input",fn="data-twe-input-wrapper-init",pn="data-twe-input-notch-ref",_n="data-twe-input-notch-leading-ref",gn="data-twe-input-notch-middle-ref",nl="data-twe-input-notch-trailing-ref",rl="data-twe-input-helper-ref",ol="data-twe-input-placeholder-active",at="data-twe-input-state-active",mn="data-twe-input-focused",En="data-twe-input-form-counter",Te=`[${fn}] input`,Ae=`[${fn}] textarea`,Vt=`[${pn}]`,vn=`[${_n}]`,bn=`[${gn}]`,al=`[${rl}]`,ll={inputFormWhite:!1},cl={inputFormWhite:"(boolean)"},dl={notch:"group flex absolute left-0 top-0 w-full max-w-full h-full text-left pointer-events-none",notchLeading:"pointer-events-none border border-solid box-border bg-transparent transition-all duration-200 ease-linear motion-reduce:transition-none left-0 top-0 h-full w-2 border-e-0 rounded-s-[0.25rem] group-data-[twe-input-focused]:border-e-0 group-data-[twe-input-state-active]:border-e-0",notchLeadingNormal:"border-secondary-500 dark:border-neutral-400 group-data-[twe-input-focused]:shadow-notch-1 group-data-[twe-input-focused]:border-primary",notchLeadingWhite:"border-neutral-200 group-data-[twe-input-focused]:shadow-notch-1 group-data-[twe-input-focused]:shadow-white group-data-[twe-input-focused]:border-white",notchMiddle:"pointer-events-none border border-solid box-border bg-transparent transition-all duration-200 ease-linear motion-reduce:transition-none grow-0 shrink-0 basis-auto w-auto max-w-[calc(100%-1rem)] h-full border-e-0 border-s-0 group-data-[twe-input-focused]:border-x-0 group-data-[twe-input-state-active]:border-x-0 group-data-[twe-input-focused]:border-t group-data-[twe-input-state-active]:border-t group-data-[twe-input-focused]:border-solid group-data-[twe-input-state-active]:border-solid group-data-[twe-input-focused]:border-t-transparent group-data-[twe-input-state-active]:border-t-transparent",notchMiddleNormal:"border-secondary-500 dark:border-neutral-400 group-data-[twe-input-focused]:shadow-notch-2 group-data-[twe-input-focused]:border-primary",notchMiddleWhite:"border-neutral-200 group-data-[twe-input-focused]:shadow-notch-2 group-data-[twe-input-focused]:shadow-white group-data-[twe-input-focused]:border-white",notchTrailing:"pointer-events-none border border-solid box-border bg-transparent transition-all duration-200 ease-linear motion-reduce:transition-none grow h-full border-s-0 rounded-e-[0.25rem] group-data-[twe-input-focused]:border-s-0 group-data-[twe-input-state-active]:border-s-0",notchTrailingNormal:"border-secondary-500 dark:border-neutral-400 group-data-[twe-input-focused]:shadow-notch-3 group-data-[twe-input-focused]:border-primary",notchTrailingWhite:"border-neutral-200 group-data-[twe-input-focused]:shadow-notch-3 group-data-[twe-input-focused]:shadow-white group-data-[twe-input-focused]:border-white",counter:"text-right leading-[1.6]"},ul={notch:"string",notchLeading:"string",notchLeadingNormal:"string",notchLeadingWhite:"string",notchMiddle:"string",notchMiddleNormal:"string",notchMiddleWhite:"string",notchTrailing:"string",notchTrailingNormal:"string",notchTrailingWhite:"string",counter:"string"};class S{constructor(t,e,s){this._config=this._getConfig(e,t),this._element=t,this._classes=this._getClasses(s),this._label=null,this._labelWidth=0,this._labelMarginLeft=0,this._notchLeading=null,this._notchMiddle=null,this._notchTrailing=null,this._initiated=!1,this._helper=null,this._counter=!1,this._counterElement=null,this._maxLength=0,this._leadingIcon=null,this._element&&(R.setData(t,we,this),this.init())}static get NAME(){return Ai}get input(){return h.findOne("input",this._element)||h.findOne("textarea",this._element)}init(){this._initiated||(this._getLabelData(),this._applyDivs(),this._applyNotch(),this._activate(),this._getHelper(),this._getCounter(),this._getEvents(),this._initiated=!0)}update(){this._getLabelData(),this._getNotchData(),this._applyNotch(),this._activate(),this._getHelper(),this._getCounter()}forceActive(){this.input.setAttribute(at,""),h.findOne(Vt,this.input.parentNode).setAttribute(at,"")}forceInactive(){this.input.removeAttribute(at),h.findOne(Vt,this.input.parentNode).removeAttribute(at)}dispose(){this._removeBorder(),R.removeData(this._element,we),this._element=null}_getConfig(t,e){return t={...ll,...E.getDataAttributes(e),...typeof t=="object"?t:{}},x(Ai,t,cl),t}_getClasses(t){const e=E.getDataClassAttributes(this._element);return t={...dl,...e,...t},x(Ai,t,ul),t}_getLabelData(){this._label=h.findOne("label",this._element),this._label===null?this._showPlaceholder():(this._getLabelWidth(),this._getLabelPositionInInputGroup(),this._toggleDefaultDatePlaceholder())}_getHelper(){this._helper=h.findOne(al,this._element)}_getCounter(){this._counter=E.getDataAttribute(this.input,"inputShowcounter"),this._counter&&(this._maxLength=this.input.maxLength,this._showCounter())}_getEvents(){d.on(this._element,"focus","input",S.activate(new S)),d.on(this._element,"input","input",S.activate(new S)),d.on(this._element,"blur","input",S.deactivate(new S)),d.on(this._element,"focus","textarea",S.activate(new S)),d.on(this._element,"input","textarea",S.activate(new S)),d.on(this._element,"blur","textarea",S.deactivate(new S)),d.on(window,"shown.twe.modal",t=>{h.find(Te,t.target).forEach(e=>{const s=S.getInstance(e.parentNode);s&&s.update()}),h.find(Ae,t.target).forEach(e=>{const s=S.getInstance(e.parentNode);s&&s.update()})}),d.on(window,"shown.twe.dropdown",t=>{const e=t.target.parentNode.querySelector("[data-twe-dropdown-menu-ref]");e&&(h.find(Te,e).forEach(s=>{const n=S.getInstance(s.parentNode);n&&n.update()}),h.find(Ae,e).forEach(s=>{const n=S.getInstance(s.parentNode);n&&n.update()}))}),d.on(window,"shown.twe.tab",t=>{let e;t.target.href?e=t.target.href.split("#")[1]:e=E.getDataAttribute(t.target,"target").split("#")[1];const s=h.findOne(`#${e}`);h.find(Te,s).forEach(n=>{const r=S.getInstance(n.parentNode);r&&r.update()}),h.find(Ae,s).forEach(n=>{const r=S.getInstance(n.parentNode);r&&r.update()})}),d.on(window,"reset",t=>{h.find(Te,t.target).forEach(e=>{const s=S.getInstance(e.parentNode);s&&s.forceInactive()}),h.find(Ae,t.target).forEach(e=>{const s=S.getInstance(e.parentNode);s&&s.forceInactive()})}),d.on(window,"onautocomplete",t=>{const e=S.getInstance(t.target.parentNode);!e||!t.cancelable||e.forceActive()})}_showCounter(){if(h.find(`[${En}]`,this._element).length>0)return;this._counterElement=document.createElement("div"),E.addClass(this._counterElement,this._classes.counter),this._counterElement.setAttribute(En,"");const e=this.input.value.length;this._counterElement.innerHTML=`${e} / ${this._maxLength}`,this._helper.appendChild(this._counterElement),this._bindCounter()}_bindCounter(){d.on(this.input,"input",()=>{const t=this.input.value.length;this._counterElement.innerHTML=`${t} / ${this._maxLength}`})}_toggleDefaultDatePlaceholder(t=this.input){if(!(t.getAttribute("type")==="date"))return;!(document.activeElement===t)&&!t.value?t.style.opacity=0:t.style.opacity=1}_showPlaceholder(){this.input.setAttribute(ol,"")}_getNotchData(){this._notchMiddle=h.findOne(bn,this._element),this._notchLeading=h.findOne(vn,this._element)}_getLabelWidth(){this._labelWidth=this._label.clientWidth*.8+8}_getLabelPositionInInputGroup(){if(this._labelMarginLeft=0,!this._element.hasAttribute("data-twe-input-group-ref"))return;const t=this.input,e=h.prev(t,"[data-twe-input-group-text-ref]")[0];e===void 0?this._labelMarginLeft=0:this._labelMarginLeft=e.offsetWidth-1}_applyDivs(){const t=this._config.inputFormWhite?this._classes.notchLeadingWhite:this._classes.notchLeadingNormal,e=this._config.inputFormWhite?this._classes.notchMiddleWhite:this._classes.notchMiddleNormal,s=this._config.inputFormWhite?this._classes.notchTrailingWhite:this._classes.notchTrailingNormal,n=h.find(Vt,this._element),r=Yt("div");E.addClass(r,this._classes.notch),r.setAttribute(pn,""),this._notchLeading=Yt("div"),E.addClass(this._notchLeading,`${this._classes.notchLeading} ${t}`),this._notchLeading.setAttribute(_n,""),this._notchMiddle=Yt("div"),E.addClass(this._notchMiddle,`${this._classes.notchMiddle} ${e}`),this._notchMiddle.setAttribute(gn,""),this._notchTrailing=Yt("div"),E.addClass(this._notchTrailing,`${this._classes.notchTrailing} ${s}`),this._notchTrailing.setAttribute(nl,""),!(n.length>=1)&&(r.append(this._notchLeading),r.append(this._notchMiddle),r.append(this._notchTrailing),this._element.append(r),r.dir="ltr")}_applyNotch(){this._notchMiddle.style.width=`${this._labelWidth}px`,this._notchLeading.style.width=`${this._labelMarginLeft+9}px`,this._label!==null&&(this._label.style.marginLeft=`${this._labelMarginLeft}px`)}_removeBorder(){const t=h.findOne(Vt,this._element);t&&t.remove()}_activate(t){Pi(()=>{this._getElements(t);const e=t?t.target:this.input,s=h.findOne(Vt,this._element);t&&t.type==="focus"&&s&&s.setAttribute(mn,""),e.value!==""&&(e.setAttribute(at,""),s&&s.setAttribute(at,"")),this._toggleDefaultDatePlaceholder(e)})}_getElements(t){if(t&&(this._element=t.target.parentNode,this._label=h.findOne("label",this._element)),t&&this._label){const e=this._labelWidth;this._getLabelData(),e!==this._labelWidth&&(this._notchMiddle=h.findOne(bn,t.target.parentNode),this._notchLeading=h.findOne(vn,t.target.parentNode),this._applyNotch())}}_deactivate(t){const e=t?t.target:this.input;if(e.getAttribute("aria-expanded")==="true")return;const s=h.findOne(Vt,e.parentNode);s.removeAttribute(mn),e.value===""&&(e.removeAttribute(at),s.removeAttribute(at)),this._toggleDefaultDatePlaceholder(e)}static activate(t){return function(e){t._activate(e)}}static deactivate(t){return function(e){t._deactivate(e)}}static jQueryInterface(t,e){return this.each(function(){let s=R.getData(this,we);const n=typeof t=="object"&&t;if(!(!s&&/dispose/.test(t))&&(s||(s=new S(this,n)),typeof t=="string")){if(typeof s[t]>"u")throw new TypeError(`No method named "${t}"`);s[t](e)}})}static getInstance(t){return R.getData(t,we)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,typeof e=="object"?e:null)}}const hl={property:"color",defaultValue:null,inherit:!0},Wt=(i,t)=>{const{property:e,defaultValue:s,inherit:n}={...hl,...t},r=document.createElement("div");r.classList.add(i),document.body.appendChild(r);const a=window.getComputedStyle(r)[e]||s,u=window.getComputedStyle(r.parentElement)[e];return document.body.removeChild(r),!n&&u&&a===u?s:a||s},yi="ripple",ye="twe.ripple",fl="rgba({{color}}, 0.2) 0, rgba({{color}}, 0.3) 40%, rgba({{color}}, 0.4) 50%, rgba({{color}}, 0.5) 60%, rgba({{color}}, 0) 70%",pl=["[data-twe-ripple-init]"],Ce=[0,0,0],_l=[{name:"primary",gradientColor:Wt("text-primary",{defaultValue:"#3B71CA",inherit:!1})},{name:"secondary",gradientColor:Wt("text-primary-100",{defaultValue:"#9FA6B2",inherit:!1})},{name:"success",gradientColor:Wt("text-success",{defaultValue:"#14A44D",inherit:!1})},{name:"danger",gradientColor:Wt("text-danger",{defaultValue:"#DC4C64",inherit:!1})},{name:"warning",gradientColor:Wt("text-warning",{defaultValue:"#E4A11B",inherit:!1})},{name:"info",gradientColor:Wt("text-info",{defaultValue:"#54B4D3",inherit:!1})},{name:"light",gradientColor:"#fbfbfb"},{name:"dark",gradientColor:"#262626"}],wn=.5,gl={rippleCentered:!1,rippleColor:"",rippleColorDark:"",rippleDuration:"500ms",rippleRadius:0,rippleUnbound:!1},ml={rippleCentered:"boolean",rippleColor:"string",rippleColorDark:"string",rippleDuration:"string",rippleRadius:"number",rippleUnbound:"boolean"},El={ripple:"relative overflow-hidden inline-block align-bottom",rippleWave:"rounded-[50%] opacity-50 pointer-events-none absolute touch-none scale-0 transition-[transform,_opacity] ease-[cubic-bezier(0,0,0.15,1),_cubic-bezier(0,0,0.15,1)] z-[999]",unbound:"overflow-visible"},vl={ripple:"string",rippleWave:"string",unbound:"string"};class Oe{constructor(t,e,s){this._element=t,this._options=this._getConfig(e),this._classes=this._getClasses(s),this._currentColor=this._options.rippleColor,this._element&&(R.setData(t,ye,this),E.addClass(this._element,this._classes.ripple)),this._clickHandler=this._createRipple.bind(this),this._rippleTimer=null,this._isMinWidthSet=!1,this._initialClasses=null,this.init()}static get NAME(){return yi}init(){this._addClickEvent(this._element)}dispose(){R.removeData(this._element,ye),d.off(this._element,"mousedown",this._clickHandler),this._element=null,this._options=null}_autoInit(t){pl.forEach(e=>{h.closest(t.target,e)&&(this._element=h.closest(t.target,e))}),this._element.style.minWidth||(E.style(this._element,{"min-width":getComputedStyle(this._element).width}),this._isMinWidthSet=!0),this._options=this._getConfig(),this._classes=this._getClasses(),this._initialClasses=[...this._element.classList],E.addClass(this._element,this._classes.ripple),this._createRipple(t)}_addClickEvent(t){d.on(t,"mousedown",this._clickHandler)}_createRipple(t){this._element.className.indexOf(this._classes.ripple)<0&&E.addClass(this._element,this._classes.ripple);const{layerX:e,layerY:s}=t,n=t.offsetX||e,r=t.offsetY||s,o=this._element.offsetHeight,a=this._element.offsetWidth,l=this._durationToMsNumber(this._options.rippleDuration),u={offsetX:this._options.rippleCentered?o/2:n,offsetY:this._options.rippleCentered?a/2:r,height:o,width:a},c=this._getDiameter(u),f=this._options.rippleRadius||c/2,v={delay:l*wn,duration:l-l*wn},g={left:this._options.rippleCentered?`${a/2-f}px`:`${n-f}px`,top:this._options.rippleCentered?`${o/2-f}px`:`${r-f}px`,height:`${this._options.rippleRadius*2||c}px`,width:`${this._options.rippleRadius*2||c}px`,transitionDelay:`0s, ${v.delay}ms`,transitionDuration:`${l}ms, ${v.duration}ms`},O=Yt("div");this._createHTMLRipple({wrapper:this._element,ripple:O,styles:g}),this._removeHTMLRipple({ripple:O,duration:l})}_createHTMLRipple({wrapper:t,ripple:e,styles:s}){Object.keys(s).forEach(n=>e.style[n]=s[n]),E.addClass(e,this._classes.rippleWave),e.setAttribute("data-twe-ripple-ref",""),this._addColor(e,t),this._toggleUnbound(t),this._appendRipple(e,t)}_removeHTMLRipple({ripple:t,duration:e}){this._rippleTimer&&(clearTimeout(this._rippleTimer),this._rippleTimer=null),t&&setTimeout(()=>{t.classList.add("!opacity-0")},10),this._rippleTimer=setTimeout(()=>{if(t&&(t.remove(),this._element)){h.find("[data-twe-ripple-ref]",this._element).forEach(n=>{n.remove()}),this._isMinWidthSet&&(E.style(this._element,{"min-width":""}),this._isMinWidthSet=!1);const s=this._initialClasses?this._addedNewRippleClasses(this._classes.ripple,this._initialClasses):this._classes.ripple.split(" ");E.removeClass(this._element,s)}},e)}_addedNewRippleClasses(t,e){return t.split(" ").filter(s=>e.findIndex(n=>s===n)===-1)}_durationToMsNumber(t){return Number(t.replace("ms","").replace("s","000"))}_getConfig(t={}){const e=E.getDataAttributes(this._element);return t={...gl,...e,...t},x(yi,t,ml),t}_getClasses(t={}){const e=E.getDataClassAttributes(this._element);return t={...El,...e,...t},x(yi,t,vl),t}_getDiameter({offsetX:t,offsetY:e,height:s,width:n}){const r=e<=s/2,o=t<=n/2,a=(v,g)=>Math.sqrt(v**2+g**2),l=e===s/2&&t===n/2,u={first:r===!0&&o===!1,second:r===!0&&o===!0,third:r===!1&&o===!0,fourth:r===!1&&o===!1},c={topLeft:a(t,e),topRight:a(n-t,e),bottomLeft:a(t,s-e),bottomRight:a(n-t,s-e)};let f=0;return l||u.fourth?f=c.topLeft:u.third?f=c.topRight:u.second?f=c.bottomRight:u.first&&(f=c.bottomLeft),f*2}_appendRipple(t,e){e.appendChild(t),setTimeout(()=>{E.addClass(t,"opacity-0 scale-100")},50)}_toggleUnbound(t){this._options.rippleUnbound===!0?E.addClass(t,this._classes.unbound):E.removeClass(t,this._classes.unbound)}_addColor(t){let e=this._options.rippleColor||"rgb(0,0,0)";(localStorage.theme==="dark"||!("theme"in localStorage)&&window.matchMedia("(prefers-color-scheme: dark)").matches)&&(e=this._options.rippleColorDark||this._options.rippleColor);const s=_l.find(o=>o.name===e.toLowerCase()),n=s?this._colorToRGB(s.gradientColor).join(","):this._colorToRGB(e).join(","),r=fl.split("{{color}}").join(`${n}`);t.style.backgroundImage=`radial-gradient(circle, ${r})`}_colorToRGB(t){function e(r){return r.length<7&&(r=`#${r[1]}${r[1]}${r[2]}${r[2]}${r[3]}${r[3]}`),[parseInt(r.substr(1,2),16),parseInt(r.substr(3,2),16),parseInt(r.substr(5,2),16)]}function s(r){const o=document.body.appendChild(document.createElement("fictum")),a="rgb(1, 2, 3)";return o.style.color=a,o.style.color!==a||(o.style.color=r,o.style.color===a||o.style.color==="")?Ce:(r=getComputedStyle(o).color,document.body.removeChild(o),r)}function n(r){return r=r.match(/[.\d]+/g).map(o=>+Number(o)),r.length=3,r}return t.toLowerCase()==="transparent"?Ce:t[0]==="#"?e(t):(t.indexOf("rgb")===-1&&(t=s(t)),t.indexOf("rgb")===0?n(t):Ce)}static autoInitial(t){return function(e){t._autoInit(e)}}static jQueryInterface(t){return this.each(function(){return R.getData(this,ye)?null:new Oe(this,t)})}static getInstance(t){return R.getData(t,ye)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,typeof e=="object"?e:null)}}const Ci="modal",X=".twe.modal",Tn="Escape",An={backdrop:!0,keyboard:!0,focus:!0},yn={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean"},bl={show:"transform-none",static:"scale-[1.02]",staticProperties:"transition-scale duration-300 ease-in-out",backdrop:"opacity-50 transition-all duration-300 ease-in-out fixed top-0 left-0 z-[1040] bg-black w-screen h-screen"},wl={show:"string",static:"string",staticProperties:"string",backdrop:"string"},Tl=`hide${X}`,Al=`hidePrevented${X}`,yl=`hidden${X}`,Cl=`show${X}`,Ol=`shown${X}`,Cn=`resize${X}`,On=`click.dismiss${X}`,Dn=`keydown.dismiss${X}`,Dl=`mouseup.dismiss${X}`,Nn=`mousedown.dismiss${X}`,Sn="data-twe-modal-open",Ln="data-twe-open",Jt="[data-twe-modal-dialog-ref]",Nl="[data-twe-modal-body-ref]";class te extends et{constructor(t,e,s){super(t),this._config=this._getConfig(e),this._classes=this._getClasses(s),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._scrollBar=new ci,this._dialog=h.findOne(Jt,this._element),this._isShown=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._didInit=!1,this._init()}static get NAME(){return Ci}static get Default(){return An}static get getDefaultType(){return yn}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||this._isTransitioning||d.trigger(this._element,Cl,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isAnimated()&&(this._isTransitioning=!0),this._scrollBar.hide(),document.body.setAttribute(Sn,"true"),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),d.on(this._dialog,Nn,()=>{d.one(this._element,Dl,s=>{s.target===this._element&&(this._ignoreBackdropClick=!0)})}),this._showElement(t),this._showBackdrop())}hide(){if(!this._isShown||this._isTransitioning||d.trigger(this._element,Tl).defaultPrevented)return;this._isShown=!1;const e=this._isAnimated();e&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),this._focustrap.disable(),h.findOne(Jt,this._element).classList.remove(this._classes.show),d.off(this._element,On),d.off(this._dialog,Nn),this._queueCallback(()=>this._hideModal(),this._element,e),this._element.removeAttribute(Ln)}dispose(){[window,document,this._dialog].forEach(t=>d.off(t,X)),this._backdrop.dispose(),this._focustrap.disable(),super.dispose()}handleUpdate(){this._adjustDialog()}_init(){this._didInit||(js(te),this._didInit=!0)}_initializeBackDrop(){return new Vs({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated(),backdropClasses:this._classes.backdrop})}_initializeFocusTrap(){return new Ws(this._element,{event:"keydown",condition:t=>t.key==="Tab"})}_showElement(t){const e=this._isAnimated(),s=h.findOne(Nl,this._dialog);(!this._element.parentNode||this._element.parentNode.nodeType!==Node.ELEMENT_NODE)&&document.body.append(this._element),this._element.style.display="block",this._element.classList.remove("hidden"),this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.setAttribute(`${Ln}`,"true"),this._element.scrollTop=0;const n=h.findOne(Jt,this._element);n.classList.add(this._classes.show),n.classList.remove("opacity-0"),n.classList.add("opacity-100"),s&&(s.scrollTop=0),e&&Ut(this._element);const r=()=>{this._config.focus&&this._focustrap.trap(),this._isTransitioning=!1,d.trigger(this._element,Ol,{relatedTarget:t})};this._queueCallback(r,this._dialog,e)}_setEscapeEvent(){this._isShown?d.on(document,Dn,t=>{this._config.keyboard&&t.key===Tn?(t.preventDefault(),this.hide()):!this._config.keyboard&&t.key===Tn&&this._triggerBackdropTransition()}):d.off(this._element,Dn)}_setResizeEvent(){this._isShown?d.on(window,Cn,()=>this._adjustDialog()):d.off(window,Cn)}_hideModal(){const t=h.findOne(Jt,this._element);t.classList.remove(this._classes.show),t.classList.remove("opacity-100"),t.classList.add("opacity-0");const e=ke(t);setTimeout(()=>{this._element.style.display="none"},e),this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.removeAttribute(Sn),this._resetAdjustments(),this._scrollBar.reset(),d.trigger(this._element,yl)})}_showBackdrop(t){d.on(this._element,On,e=>{if(this._ignoreBackdropClick){this._ignoreBackdropClick=!1;return}e.target===e.currentTarget&&(this._config.backdrop===!0?this.hide():this._config.backdrop==="static"&&this._triggerBackdropTransition())}),this._backdrop.show(t)}_isAnimated(){return!!h.findOne(Jt,this._element)}_triggerBackdropTransition(){if(d.trigger(this._element,Al).defaultPrevented)return;const{classList:e,scrollHeight:s,style:n}=this._element,r=s>document.documentElement.clientHeight;if(!r&&n.overflowY==="hidden"||e.contains(this._classes.static))return;r||(n.overflowY="hidden"),e.add(...this._classes.static.split(" ")),e.add(...this._classes.staticProperties.split(" "));const o=ke(this._element);this._queueCallback(()=>{e.remove(this._classes.static),setTimeout(()=>{e.remove(...this._classes.staticProperties.split(" "))},o),r||this._queueCallback(()=>{n.overflowY=""},this._dialog)},this._dialog),this._element.focus()}_getConfig(t){return t={...An,...E.getDataAttributes(this._element),...typeof t=="object"?t:{}},x(Ci,t,yn),t}_getClasses(t){const e=E.getDataClassAttributes(this._element);return t={...bl,...e,...t},x(Ci,t,wl),t}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._scrollBar.getWidth(),s=e>0;(!s&&t&&!W()||s&&!t&&W())&&(this._element.style.paddingLeft=`${e}px`),(s&&!t&&!W()||!s&&t&&W())&&(this._element.style.paddingRight=`${e}px`)}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,e){return this.each(function(){const s=te.getOrCreateInstance(this,t);if(typeof t=="string"){if(typeof s[t]>"u")throw new TypeError(`No method named "${t}"`);s[t](e)}})}}const Sl={carousel:{name:"Carousel",selector:"[data-twe-carousel-init]",isToggler:!1},input:{name:"Input",selector:"[data-twe-input-wrapper-init]",isToggler:!1},scrollspy:{name:"ScrollSpy",selector:"[data-twe-spy='scroll']",isToggler:!1},button:{name:"Button",selector:"[data-twe-toggle='button']",isToggler:!0,callback:(i,t)=>{d.on(document,`click.twe.${i.NAME}`,t,e=>{e.preventDefault();const s=e.target.closest(t);i.getOrCreateInstance(s).toggle()})}},collapse:{name:"Collapse",selector:"[data-twe-collapse-init]",isToggler:!0,callback:(i,t)=>{d.on(document,`click.twe.${i.NAME}.data-api`,t,function(e){(e.target.tagName==="A"||e.delegateTarget&&e.delegateTarget.tagName==="A")&&e.preventDefault();const s=Re(this);h.find(s).forEach(r=>{i.getOrCreateInstance(r,{toggle:!1}).toggle()})})}},dropdown:{name:"Dropdown",selector:"[data-twe-dropdown-toggle-ref]",isToggler:!0,callback:(i,t)=>{d.on(document,`click.twe.${i.NAME}`,t,function(e){e.preventDefault(),i.getOrCreateInstance(this).toggle()})}},ripple:{name:"Ripple",selector:"[data-twe-ripple-init]",isToggler:!0,callback:(i,t)=>{d.one(document,"mousedown",t,i.autoInitial(new i))}},offcanvas:{name:"Offcanvas",selector:"[data-twe-offcanvas-toggle]",isToggler:!0,callback:(i,t)=>{d.on(document,`click.twe.${i.NAME}.data-api`,t,function(e){const s=st(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),ct(this))return;d.one(s,i.EVENT_HIDDEN,()=>{Ct(this)&&this.focus()});const n=h.findOne(i.OPEN_SELECTOR);n&&n!==s&&i.getInstance(n).hide(),i.getOrCreateInstance(s).toggle(this)})}},tab:{name:"Tab",selector:"[data-twe-toggle='tab'], [data-twe-toggle='pill'], [data-twe-toggle='list']",isToggler:!0,callback:(i,t)=>{d.on(document,`click.twe.${i.NAME}.data-api`,t,function(e){if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),ct(this))return;i.getOrCreateInstance(this).show()})}},tooltip:{name:"Tooltip",selector:"[data-twe-toggle='tooltip']",isToggler:!1,callback:(i,t)=>{[].slice.call(document.querySelectorAll(t)).map(function(s){return new i(s)})}},popover:{name:"Popover",selector:"[data-twe-toggle='popover']",isToggler:!0,callback:(i,t)=>{[].slice.call(document.querySelectorAll(t)).map(function(s){return new i(s)})}},modal:{name:"Modal",selector:"[data-twe-toggle='modal']",isToggler:!0,callback:(i,t)=>{d.on(document,`click.twe.${i.NAME}`,t,function(e){const s=st(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),d.one(s,i.EVENT_SHOW,o=>{o.defaultPrevented||d.one(s,i.EVENT_HIDDEN,()=>{Ct(this)&&this.focus()})});const n=h.findOne(`[${i.OPEN_SELECTOR}="true"]`);n&&i.getInstance(n).hide(),i.getOrCreateInstance(s).toggle(this)})}}},Ll=i=>{Pi(()=>{const t=xi();if(t){const e=i.NAME,s=t.fn[e];t.fn[e]=i.jQueryInterface,t.fn[e].Constructor=i,t.fn[e].noConflict=()=>(t.fn[e]=s,i.jQueryInterface)}})};class $l{constructor(){this.inits=[]}get initialized(){return this.inits}isInited(t){return this.inits.includes(t)}add(t){this.isInited(t)||this.inits.push(t)}}const Oi=new $l;let Bt;const Il=i=>Bt[i.NAME]||null,Rl=(i,t)=>{if(!i||!t.allowReinits&&Oi.isInited(i.NAME))return;Oi.add(i.NAME);const e=Il(i),s=(e==null?void 0:e.isToggler)||!1;if(Ll(i),e!=null&&e.advanced){e==null||e.advanced(i,e==null?void 0:e.selector);return}if(s){e==null||e.callback(i,e==null?void 0:e.selector);return}h.find(e==null?void 0:e.selector).forEach(n=>{let r=i.getInstance(n);r||(r=new i(n),e!=null&&e.onInit&&r[e.onInit]())})},kl={allowReinits:!1,checkOtherImports:!1};class xl{constructor(t){$i(this,"init",(t,e)=>{t.forEach(s=>Rl(s,e))});$i(this,"initTWE",(t,e)=>{const s={...kl,...e},n=Object.keys(Bt).map(r=>{if(!!document.querySelector(Bt[r].selector)){const a=t[Bt[r].name];return!a&&!Oi.isInited(r)&&s.checkOtherImports&&console.warn(`Please import ${Bt[r].name} from "tw-elements" package and add it to a object parameter inside "initTWE" function`),a}});this.init(n,s)});Bt=t}}const $n=new xl(Sl).initTWE;$n({Button:ne,Dropdown:z,Collapse:kt,Offcanvas:Pt,Carousel:q,Popover:ge,ScrollSpy:me,Tab:be,Tooltip:Et,Input:S,Ripple:Oe,Modal:te}),L.Button=ne,L.Carousel=q,L.Collapse=kt,L.Dropdown=z,L.Input=S,L.Modal=te,L.Offcanvas=Pt,L.Popover=ge,L.Ripple=Oe,L.ScrollSpy=me,L.Tab=be,L.Tooltip=Et,L.initTWE=$n,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})}); |