From 592e867a03786aeed541c71860806118ea709e5d Mon Sep 17 00:00:00 2001 From: YamiOdymel Date: Fri, 3 Mar 2023 08:16:29 +0800 Subject: [PATCH] Tocas 4.2.0 --- dist/tocas.js | 2 +- dist/tocas.min.js | 2 +- docs/zh-tw/assets/tocas/src/scripts/tocas.js | 2 +- docs/zh-tw/assets/tocas/tocas.js | 2 +- docs/zh-tw/assets/tocas/tocas.min.js | 2 +- package.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/tocas.js b/dist/tocas.js index 696671ae..254e6804 100644 --- a/dist/tocas.js +++ b/dist/tocas.js @@ -225,7 +225,7 @@ window.tocas = { // 如果這個規則開頭有個 @ 符號,就尋找最近的 Container 容器來作為寬度判斷, // 但如果沒有,就以視窗的 innerWidth 為主。 // @breakpoint - var width = rule.startsWith("@") ? element.closest(`[class~="${tocas.config.scopes.container}"]`).getBoundingClientRect().width : window.innerWidth; + var width = rule.startsWith("@") ? Math.round(element.closest(`[class~="${tocas.config.scopes.container}"]`).getBoundingClientRect().width) : Math.round(window.innerWidth); return { min, diff --git a/dist/tocas.min.js b/dist/tocas.min.js index 64162691..cf126850 100644 --- a/dist/tocas.min.js +++ b/dist/tocas.min.js @@ -1 +1 @@ -window.tocas={config:{strict_responsive:!1,attributes:{tab:"data-tab",tab_name:"data-name",toggle:"data-toggle",toggle_name:"data-name",dropdown:"data-dropdown",dropdown_name:"data-name",dropdown_position:"data-position",tooltip:"data-tooltip",tooltip_position:"data-position",tooltip_delay:"data-delay"},scopes:{tab:"@scope",toggle:"@scope",tab:"@scope",dropdown:"@scope",container:"@container"},classes:{hidden:"u-hidden",tab_active:"is-active",tooltip_visible:"is-visible",tab:"ts-tab"}}},function(){var t,e;t=this,e=function(t){"use strict";function e(t){return t.split("-")[1]}function n(t){return"y"===t?"height":"width"}function o(t){return t.split("-")[0]}function i(t){return["top","bottom"].includes(o(t))?"x":"y"}function s(t,s,r){let{reference:a,floating:c}=t;const l=a.x+a.width/2-c.width/2,f=a.y+a.height/2-c.height/2,d=i(s),u=n(d),p=a[u]/2-c[u]/2,g="x"===d;let m;switch(o(s)){case"top":m={x:l,y:a.y-c.height};break;case"bottom":m={x:l,y:a.y+a.height};break;case"right":m={x:a.x+a.width,y:f};break;case"left":m={x:a.x-c.width,y:f};break;default:m={x:a.x,y:a.y}}switch(e(s)){case"start":m[d]-=p*(r&&g?-1:1);break;case"end":m[d]+=p*(r&&g?-1:1)}return m}function r(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function a(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function c(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:s,rects:c,elements:l,strategy:f}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:g=!1,padding:m=0}=e,h=r(m),b=l[g?"floating"===p?"reference":"floating":p],v=a(await s.getClippingRect({element:null==(n=await(null==s.isElement?void 0:s.isElement(b)))||n?b:b.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:f})),w="floating"===p?{...c.floating,x:o,y:i}:c.reference,y=await(null==s.getOffsetParent?void 0:s.getOffsetParent(l.floating)),x=await(null==s.isElement?void 0:s.isElement(y))&&await(null==s.getScale?void 0:s.getScale(y))||{x:1,y:1},E=a(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:y,strategy:f}):w);return{top:(v.top-E.top+h.top)/x.y,bottom:(E.bottom-v.bottom+h.bottom)/x.y,left:(v.left-E.left+h.left)/x.x,right:(E.right-v.right+h.right)/x.x}}const l=Math.min,f=Math.max;function d(t,e,n){return f(t,l(e,n))}const u=["top","right","bottom","left"],p=u.reduce(((t,e)=>t.concat(e,e+"-start",e+"-end")),[]),g={left:"right",right:"left",bottom:"top",top:"bottom"};function m(t){return t.replace(/left|right|bottom|top/g,(t=>g[t]))}function h(t,o,s){void 0===s&&(s=!1);const r=e(t),a=i(t),c=n(a);let l="x"===a?r===(s?"end":"start")?"right":"left":"start"===r?"bottom":"top";return o.reference[c]>o.floating[c]&&(l=m(l)),{main:l,cross:m(l)}}const b={start:"end",end:"start"};function v(t){return t.replace(/start|end/g,(t=>b[t]))}function w(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function y(t){return u.some((e=>t[e]>=0))}function x(t){return"x"===t?"y":"x"}t.arrow=t=>({name:"arrow",options:t,async fn(o){const{element:s,padding:a=0}=t||{},{x:c,y:l,placement:f,rects:u,platform:p,elements:g}=o;if(null==s)return{};const m=r(a),h={x:c,y:l},b=i(f),v=n(b),w=await p.getDimensions(s),y="y"===b,x=y?"top":"left",E=y?"bottom":"right",L=y?"clientHeight":"clientWidth",T=u.reference[v]+u.reference[b]-h[b]-u.floating[v],A=h[b]-u.reference[b],_=await(null==p.getOffsetParent?void 0:p.getOffsetParent(s));let R=_?_[L]:0;R&&await(null==p.isElement?void 0:p.isElement(_))||(R=g.floating[L]||u.floating[v]);const P=T/2-A/2,O=m[x],D=R-w[v]-m[E],M=R/2-w[v]/2+P,k=d(O,M,D),C=null!=e(f)&&M!=k&&u.reference[v]/2-(Me(n)===t)),...i.filter((n=>e(n)!==t))]:i.filter((t=>o(t)===t))).filter((o=>!t||e(o)===t||!!n&&v(o)!==o))}(m||null,w,b):b,E=await c(n,y),L=(null==(i=l.autoPlacement)?void 0:i.index)||0,T=x[L];if(null==T)return{};const{main:A,cross:_}=h(T,a,await(null==d.isRTL?void 0:d.isRTL(u.floating)));if(f!==T)return{reset:{placement:x[0]}};const R=[E[o(T)],E[A],E[_]],P=[...(null==(s=l.autoPlacement)?void 0:s.overflows)||[],{placement:T,overflows:R}],O=x[L+1];if(O)return{data:{index:L+1,overflows:P},reset:{placement:O}};const D=P.map((t=>{const n=e(t.placement);return[t.placement,n&&g?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1])),M=(null==(r=D.filter((t=>t[2].slice(0,e(t[0])?2:3).every((t=>t<=0))))[0])?void 0:r[0])||D[0][0];return M!==f?{data:{index:L+1,overflows:P},reset:{placement:M}}:{}}}},t.computePosition=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:a}=n,c=r.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(e));let f=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:u}=s(f,o,l),p=o,g={},m=0;for(let n=0;nt+"-"+r)),n&&(a=a.concat(a.map(v)))),a}(l,y,w,T));const _=[l,...A],R=await c(n,x),P=[];let O=(null==(i=r.flip)?void 0:i.overflows)||[];if(u&&P.push(R[E]),p){const{main:t,cross:e}=h(s,a,T);P.push(R[t],R[e])}if(O=[...O,{placement:s,overflows:P}],!P.every((t=>t<=0))){var D,M;const t=((null==(D=r.flip)?void 0:D.index)||0)+1,e=_[t];if(e)return{data:{index:t,overflows:O},reset:{placement:e}};let n=null==(M=O.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:M.placement;if(!n)switch(b){case"bestFit":{var k;const t=null==(k=O.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:k[0];t&&(n=t);break}case"initialPlacement":n=l}if(s!==n)return{reset:{placement:n}}}return{}}}},t.hide=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{strategy:n="referenceHidden",...o}=t,{rects:i}=e;switch(n){case"referenceHidden":{const t=w(await c(e,{...o,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:y(t)}}}case"escaped":{const t=w(await c(e,{...o,altBoundary:!0}),i.floating);return{data:{escapedOffsets:t,escaped:y(t)}}}default:return{}}}}},t.inline=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:s,rects:c,platform:d,strategy:u}=e,{padding:p=2,x:g,y:m}=t,h=a(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({rect:c.reference,offsetParent:await(null==d.getOffsetParent?void 0:d.getOffsetParent(s.floating)),strategy:u}):c.reference),b=await(null==d.getClientRects?void 0:d.getClientRects(s.reference))||[],v=r(p),w=await d.getElementRects({reference:{getBoundingClientRect:function(){if(2===b.length&&b[0].left>b[1].right&&null!=g&&null!=m)return b.find((t=>g>t.left-v.left&&gt.top-v.top&&m=2){if("x"===i(n)){const t=b[0],e=b[b.length-1],i="top"===o(n),s=t.top,r=e.bottom,a=i?t.left:e.left,c=i?t.right:e.right;return{top:s,bottom:r,left:a,right:c,width:c-a,height:r-s,x:a,y:s}}const t="left"===o(n),e=f(...b.map((t=>t.right))),s=l(...b.map((t=>t.left))),r=b.filter((n=>t?n.left===s:n.right===e)),a=r[0].top,c=r[r.length-1].bottom;return{top:a,bottom:c,left:s,right:e,width:e-s,height:c-a,x:s,y:a}}return h}},floating:s.floating,strategy:u});return c.reference.x!==w.reference.x||c.reference.y!==w.reference.y||c.reference.width!==w.reference.width||c.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}},t.limitShift=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:s,placement:r,rects:a,middlewareData:c}=e,{offset:l=0,mainAxis:f=!0,crossAxis:d=!0}=t,u={x:n,y:s},p=i(r),g=x(p);let m=u[p],h=u[g];const b="function"==typeof l?l(e):l,v="number"==typeof b?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(f){const t="y"===p?"height":"width",e=a.reference[p]-a.floating[t]+v.mainAxis,n=a.reference[p]+a.reference[t]-v.mainAxis;mn&&(m=n)}if(d){var w,y;const t="y"===p?"width":"height",e=["top","left"].includes(o(r)),n=a.reference[g]-a.floating[t]+(e&&(null==(w=c.offset)?void 0:w[g])||0)+(e?0:v.crossAxis),i=a.reference[g]+a.reference[t]+(e?0:(null==(y=c.offset)?void 0:y[g])||0)-(e?v.crossAxis:0);hi&&(h=i)}return{[p]:m,[g]:h}}}},t.offset=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(n){const{x:s,y:r}=n,a=await async function(t,n){const{placement:s,platform:r,elements:a}=t,c=await(null==r.isRTL?void 0:r.isRTL(a.floating)),l=o(s),f=e(s),d="x"===i(s),u=["left","top"].includes(l)?-1:1,p=c&&d?-1:1,g="function"==typeof n?n(t):n;let{mainAxis:m,crossAxis:h,alignmentAxis:b}="number"==typeof g?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...g};return f&&"number"==typeof b&&(h="end"===f?-1*b:b),d?{x:h*p,y:m*u}:{x:m*u,y:h*p}}(n,t);return{x:s+a.x,y:r+a.y,data:a}}}},t.rectToClientRect=a,t.shift=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:s,placement:r}=e,{mainAxis:a=!0,crossAxis:l=!1,limiter:f={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...u}=t,p={x:n,y:s},g=await c(e,u),m=i(o(r)),h=x(m);let b=p[m],v=p[h];if(a){const t="y"===m?"bottom":"right";b=d(b+g["y"===m?"top":"left"],b,b-g[t])}if(l){const t="y"===h?"bottom":"right";v=d(v+g["y"===h?"top":"left"],v,v-g[t])}const w=f.fn({...e,[m]:b,[h]:v});return{...w,data:{x:w.x-n,y:w.y-s}}}}},t.size=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(n){const{placement:s,rects:r,platform:a,elements:d}=n,{apply:u=(()=>{}),...p}=t,g=await c(n,p),m=o(s),h=e(s),b="x"===i(s),{width:v,height:w}=r.floating;let y,x;"top"===m||"bottom"===m?(y=m,x=h===(await(null==a.isRTL?void 0:a.isRTL(d.floating))?"start":"end")?"left":"right"):(x=m,y="end"===h?"top":"bottom");const E=w-g[y],L=v-g[x];let T=E,A=L;if(b?A=l(v-g.right-g.left,L):T=l(w-g.bottom-g.top,E),!n.middlewareData.shift&&!h){const t=f(g.left,0),e=f(g.right,0),n=f(g.top,0),o=f(g.bottom,0);b?A=v-2*(0!==t||0!==e?t+e:f(g.left,g.right)):T=w-2*(0!==n||0!==o?n+o:f(g.top,g.bottom))}await u({...n,availableWidth:A,availableHeight:T});const _=await a.getDimensions(d.floating);return v!==_.width||w!==_.height?{reset:{rects:!0}}:{}}}},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).TocasFloatingUICore={}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@floating-ui/core")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).TocasFloatingUIDOM={},t.TocasFloatingUICore)}(this,(function(t,e){"use strict";function n(t){var e;return(null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function o(t){return n(t).getComputedStyle(t)}const i=Math.min,s=Math.max,r=Math.round;function a(t){const e=o(t);let n=parseFloat(e.width),i=parseFloat(e.height);const s=t.offsetWidth,a=t.offsetHeight,c=r(n)!==s||r(i)!==a;return c&&(n=s,i=a),{width:n,height:i,fallback:c}}function c(t){return p(t)?(t.nodeName||"").toLowerCase():""}let l;function f(){if(l)return l;const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?(l=t.brands.map((t=>t.brand+"/"+t.version)).join(" "),l):navigator.userAgent}function d(t){return t instanceof n(t).HTMLElement}function u(t){return t instanceof n(t).Element}function p(t){return t instanceof n(t).Node}function g(t){return"undefined"!=typeof ShadowRoot&&(t instanceof n(t).ShadowRoot||t instanceof ShadowRoot)}function m(t){const{overflow:e,overflowX:n,overflowY:i,display:s}=o(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(s)}function h(t){return["table","td","th"].includes(c(t))}function b(t){const e=/firefox/i.test(f()),n=o(t),i=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!i&&"none"!==i||e&&"filter"===n.willChange||e&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((t=>n.willChange.includes(t)))||["paint","layout","strict","content"].some((t=>{const e=n.contain;return null!=e&&e.includes(t)}))}function v(){return/^((?!chrome|android).)*safari/i.test(f())}function w(t){return["html","body","#document"].includes(c(t))}function y(t){return u(t)?t:t.contextElement}const x={x:1,y:1};function E(t){const e=y(t);if(!d(e))return x;const n=e.getBoundingClientRect(),{width:o,height:i,fallback:s}=a(e);let c=(s?r(n.width):n.width)/o,l=(s?r(n.height):n.height)/i;return c&&Number.isFinite(c)||(c=1),l&&Number.isFinite(l)||(l=1),{x:c,y:l}}function L(t,o,i,s){var r,a;void 0===o&&(o=!1),void 0===i&&(i=!1);const c=t.getBoundingClientRect(),l=y(t);let f=x;o&&(s?u(s)&&(f=E(s)):f=E(t));const d=l?n(l):window,p=v()&&i;let g=(c.left+(p&&(null==(r=d.visualViewport)?void 0:r.offsetLeft)||0))/f.x,m=(c.top+(p&&(null==(a=d.visualViewport)?void 0:a.offsetTop)||0))/f.y,h=c.width/f.x,b=c.height/f.y;if(l){const t=n(l),e=s&&u(s)?n(s):s;let o=t.frameElement;for(;o&&s&&e!==t;){const t=E(o),e=o.getBoundingClientRect(),i=getComputedStyle(o);e.x+=(o.clientLeft+parseFloat(i.paddingLeft))*t.x,e.y+=(o.clientTop+parseFloat(i.paddingTop))*t.y,g*=t.x,m*=t.y,h*=t.x,b*=t.y,g+=e.x,m+=e.y,o=n(o).frameElement}}return e.rectToClientRect({width:h,height:b,x:g,y:m})}function T(t){return((p(t)?t.ownerDocument:t.document)||window.document).documentElement}function A(t){return u(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function _(t){return L(T(t)).left+A(t).scrollLeft}function R(t){if("html"===c(t))return t;const e=t.assignedSlot||t.parentNode||g(t)&&t.host||T(t);return g(e)?e.host:e}function P(t){const e=R(t);return w(e)?e.ownerDocument.body:d(e)&&m(e)?e:P(e)}function O(t,e){var o;void 0===e&&(e=[]);const i=P(t),s=i===(null==(o=t.ownerDocument)?void 0:o.body),r=n(i);return s?e.concat(r,r.visualViewport||[],m(i)?i:[]):e.concat(i,O(i))}function D(t,i,r){let a;if("viewport"===i)a=function(t,e){const o=n(t),i=T(t),s=o.visualViewport;let r=i.clientWidth,a=i.clientHeight,c=0,l=0;if(s){r=s.width,a=s.height;const t=v();(!t||t&&"fixed"===e)&&(c=s.offsetLeft,l=s.offsetTop)}return{width:r,height:a,x:c,y:l}}(t,r);else if("document"===i)a=function(t){const e=T(t),n=A(t),i=t.ownerDocument.body,r=s(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),a=s(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let c=-n.scrollLeft+_(t);const l=-n.scrollTop;return"rtl"===o(i).direction&&(c+=s(e.clientWidth,i.clientWidth)-r),{width:r,height:a,x:c,y:l}}(T(t));else if(u(i))a=function(t,e){const n=L(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=d(t)?E(t):{x:1,y:1};return{width:t.clientWidth*s.x,height:t.clientHeight*s.y,x:i*s.x,y:o*s.y}}(i,r);else{const e={...i};if(v()){var c,l;const o=n(t);e.x-=(null==(c=o.visualViewport)?void 0:c.offsetLeft)||0,e.y-=(null==(l=o.visualViewport)?void 0:l.offsetTop)||0}a=e}return e.rectToClientRect(a)}function M(t,e){return d(t)&&"fixed"!==o(t).position?e?e(t):t.offsetParent:null}function k(t,e){const i=n(t);let s=M(t,e);for(;s&&h(s)&&"static"===o(s).position;)s=M(s,e);return s&&("html"===c(s)||"body"===c(s)&&"static"===o(s).position&&!b(s))?i:s||function(t){let e=R(t);for(;d(e)&&!w(e);){if(b(e))return e;e=R(e)}return null}(t)||i}function C(t,e,n){const o=d(e),i=T(e),s=L(t,!0,"fixed"===n,e);let r={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(o||!o&&"fixed"!==n)if(("body"!==c(e)||m(i))&&(r=A(e)),d(e)){const t=L(e,!0);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&(a.x=_(i));return{x:s.left+r.scrollLeft-a.x,y:s.top+r.scrollTop-a.y,width:s.width,height:s.height}}const $={getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:r,strategy:a}=t;const l="clippingAncestors"===n?function(t,e){const n=e.get(t);if(n)return n;let i=O(t).filter((t=>u(t)&&"body"!==c(t))),s=null;const r="fixed"===o(t).position;let a=r?R(t):t;for(;u(a)&&!w(a);){const t=o(a),e=b(a);"fixed"===t.position?s=null:(r?e||s:e||"static"!==t.position||!s||!["absolute","fixed"].includes(s.position))?s=t:i=i.filter((t=>t!==a)),a=R(a)}return e.set(t,i),i}(e,this._c):[].concat(n),f=[...l,r],d=f[0],p=f.reduce(((t,n)=>{const o=D(e,n,a);return t.top=s(o.top,t.top),t.right=i(o.right,t.right),t.bottom=i(o.bottom,t.bottom),t.left=s(o.left,t.left),t}),D(e,d,a));return{width:p.right-p.left,height:p.bottom-p.top,x:p.left,y:p.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=d(n),s=T(n);if(n===s)return e;let r={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((i||!i&&"fixed"!==o)&&(("body"!==c(n)||m(s))&&(r=A(n)),d(n))){const t=L(n);a=E(n),l.x=t.x+n.clientLeft,l.y=t.y+n.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-r.scrollLeft*a.x+l.x,y:e.y*a.y-r.scrollTop*a.y+l.y}},isElement:u,getDimensions:function(t){return d(t)?a(t):t.getBoundingClientRect()},getOffsetParent:k,getDocumentElement:T,getScale:E,async getElementRects(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||k,s=this.getDimensions;return{reference:C(e,await i(n),o),floating:{x:0,y:0,...await s(n)}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>"rtl"===o(t).direction};Object.defineProperty(t,"arrow",{enumerable:!0,get:function(){return e.arrow}}),Object.defineProperty(t,"autoPlacement",{enumerable:!0,get:function(){return e.autoPlacement}}),Object.defineProperty(t,"detectOverflow",{enumerable:!0,get:function(){return e.detectOverflow}}),Object.defineProperty(t,"flip",{enumerable:!0,get:function(){return e.flip}}),Object.defineProperty(t,"hide",{enumerable:!0,get:function(){return e.hide}}),Object.defineProperty(t,"inline",{enumerable:!0,get:function(){return e.inline}}),Object.defineProperty(t,"limitShift",{enumerable:!0,get:function(){return e.limitShift}}),Object.defineProperty(t,"offset",{enumerable:!0,get:function(){return e.offset}}),Object.defineProperty(t,"shift",{enumerable:!0,get:function(){return e.shift}}),Object.defineProperty(t,"size",{enumerable:!0,get:function(){return e.size}}),t.autoUpdate=function(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=!0,animationFrame:a=!1}=o,c=i&&!a,l=c||s?[...u(t)?O(t):t.contextElement?O(t.contextElement):[],...O(e)]:[];l.forEach((t=>{c&&t.addEventListener("scroll",n,{passive:!0}),s&&t.addEventListener("resize",n)}));let f,d=null;if(r){let o=!0;d=new ResizeObserver((()=>{o||n(),o=!1})),u(t)&&!a&&d.observe(t),u(t)||!t.contextElement||a||d.observe(t.contextElement),d.observe(e)}let p=a?L(t):null;return a&&function e(){const o=L(t);!p||o.x===p.x&&o.y===p.y&&o.width===p.width&&o.height===p.height||n(),p=o,f=requestAnimationFrame(e)}(),n(),()=>{var t;l.forEach((t=>{c&&t.removeEventListener("scroll",n),s&&t.removeEventListener("resize",n)})),null==(t=d)||t.disconnect(),d=null,a&&cancelAnimationFrame(f)}},t.computePosition=(t,n,o)=>{const i=new Map,s={platform:$,...o},r={...s.platform,_c:i};return e.computePosition(t,n,{...s,platform:r})},t.getOverflowAncestors=O,t.platform=$,Object.defineProperty(t,"__esModule",{value:!0})}));function n(t,e,n,o){var i=t.closest(`[class*="${n}"]`)||document,s=Array.from(i.querySelectorAll(`[${o}="${e}"]`)).filter((t=>t.closest(`[class*="${n}"]`)||document===i));return s.length>0?s:i===document?[]:this.searchScopeTargets(i.parentNode,e,n,o)}var o=new class{constructor(){this.resize_observer=new ResizeObserver((t=>{t.forEach((t=>{this.getAllContaineredElements(t.target).forEach((t=>{this.check(t)}))}))}))}attributeMutation(t){this.isContainer(t.target)?this.resize_observer.observe(t.target):this.resize_observer.unobserve(t.target)}addedNodeMutation(t){this.isResponsiveElement(t)&&this.check(t),this.isContainer(t)&&this.resize_observer.observe(t)}getAllContaineredElements(t){return t.querySelectorAll(tocas.config.strict_responsive?'[class^="@"]:is([class*=":is-"],[class*=":u-"])':'[class^="@"][class*=":"]')}getAllResponsiveElements(t){return t.querySelectorAll(tocas.config.strict_responsive?'[class*=":is-"],[class*=":u-"]':'[class*=":"]')}isContainer(t){return t.matches(`[class~="${tocas.config.scopes.container}"]`)}isResponsiveElement(t){return t.matches(tocas.config.strict_responsive?'[class*=":is-"],[class*=":u-"]':'[class*=":"]')}hasResponsiveClass(t){return tocas.config.strict_responsive?t.includes(":is-")||t.includes(":u-"):t.includes(":")}windowResize(){this.getAllResponsiveElements(document).forEach((t=>{this.check(t)}))}unit(t){return parseInt(t,10)||0}breakpointSize(t,e){var n=window.getComputedStyle(e);return{min:this.unit(n.getPropertyValue(`--ts-breakpoint-${t}-min`)),max:this.unit(n.getPropertyValue(`--ts-breakpoint-${t}-max`))}}rule(t,e){var n=t.startsWith("@"),o=t.endsWith("+"),i=t.endsWith("-"),s=t.includes("[");n&&(t=t.substring(1)),(o||i)&&(t=t.substring(0,t.length-1)),s&&(t=t.substring(1).substring(0,t.length-1));var[r,a]=t.split("-");if(s)return o?[this.unit(r),99999]:i?[0,this.unit(r)]:[this.unit(r),this.unit(a)];var c=this.breakpointSize(r,e);return void 0!==a?[c.min,this.breakpointSize(a,e).max]:o?[c.min,99999]:i?[0,c.max]:[c.min,c.max]}compile(t){return Array.from(t.classList).filter((t=>this.hasResponsiveClass(t))).map((e=>{var[n,o]=e.split(":"),[i,s]=this.rule(n,t);return{min:i,max:s,width:n.startsWith("@")?t.closest(`[class~="${tocas.config.scopes.container}"]`).getBoundingClientRect().width:window.innerWidth,target_class:o}}))}check(t){var e=[],n=this.compile(t);n.forEach((({width:n,min:o,max:i,target_class:s})=>{n>=o&&n<=i&&(t.classList.add(s),e=[...e,s])})),n.forEach((({width:n,min:o,max:i,target_class:s})=>{(ni)&&!e.includes(s)&&t.classList.remove(s)}))}},i=new class{constructor(){}attributeMutation(t){}addedNodeMutation(t){this.isTab(t)&&(this.bindEventListener(t),this.initialTab(t))}isTab(t){return t.matches(`[${tocas.config.attributes.tab}]`)}isActiveTab(t){return t.classList.contains(tocas.config.classes.tab_active)}initialTab(t){this.isActiveTab(t)||n(t,t.getAttribute(tocas.config.attributes.tab),tocas.config.scopes.tab,tocas.config.attributes.tab_name).forEach((t=>{t.classList.add(tocas.config.classes.hidden)}))}toggle(t){var e=t.target.closest(`[${tocas.config.attributes.tab}]`),n=e.getAttribute(tocas.config.attributes.tab),o=e.closest(`[class*="${tocas.config.scopes.tab}"]`)||document,i=e.closest(".ts-tab"),s=[];i.querySelectorAll(`[${tocas.config.attributes.tab}]`).forEach((t=>{t.getAttribute(tocas.config.attributes.tab)===n?t.classList.add(tocas.config.classes.tab_active):(s=[...s,t.getAttribute(tocas.config.attributes.tab)],t.classList.remove(tocas.config.classes.tab_active))})),o.querySelectorAll(`[${tocas.config.attributes.tab_name}]`).forEach((t=>{var e=t.closest(`[class*="${tocas.config.scopes.tab}"]`)||document;o===e&&(t.getAttribute(tocas.config.attributes.tab_name)===n?t.classList.remove(tocas.config.classes.hidden):s.includes(t.getAttribute(tocas.config.attributes.tab_name))&&t.classList.add(tocas.config.classes.hidden))}))}bindEventListener(t){t.removeEventListener("click",this.toggle),t.addEventListener("click",this.toggle)}},s=new class{attributeMutation(t){}addedNodeMutation(t){this.isToggle(t)&&this.bindEventListener(t)}isToggle(t){return t.matches(`[${tocas.config.attributes.toggle}]`)}toggle(t){var e=t.target.closest(`[${tocas.config.attributes.toggle}]`),[o,i]=e.getAttribute(tocas.config.attributes.toggle).split(":");n(e,o,tocas.config.scopes.toggle,tocas.config.attributes.toggle_name).forEach((t=>{t.classList.toggle(i)}))}bindEventListener(t){t.removeEventListener("click",this.toggle.bind(this)),t.addEventListener("click",this.toggle.bind(this))}},r=new class{attributeMutation(t){}addedNodeMutation(t){this.isDropdownTrigger(t)&&this.bindEventListener(t),this.isDropdown(t)&&this.bindItemEventListener(t)}isDropdownTrigger(t){return t.matches(`[${tocas.config.attributes.dropdown}]`)}isDropdown(t){return t.matches(`.ts-dropdown[${tocas.config.attributes.dropdown_name}]`)}position(t){return t.getAttribute(tocas.config.attributes.dropdown_position)||"bottom"}windowClick(t){var e=t.target.closest(`[${tocas.config.attributes.dropdown}]`),o=t.target.closest(`[${tocas.config.attributes.dropdown_name}]`);if(null===e&&null===o&&document.querySelectorAll(`.ts-dropdown[${tocas.config.attributes.dropdown_name}]`).forEach((t=>{this.closeDropdown(t)})),null!==e){var i=e.getAttribute(tocas.config.attributes.dropdown),s=n(e,i,tocas.config.scopes.dropdown,tocas.config.attributes.dropdown_name)[0];this.closeDropdownsExcept(s)}null!==o&&this.closeDropdownsExcept(o)}closeDropdownsExcept(t){document.querySelectorAll(`.ts-dropdown[${tocas.config.attributes.dropdown_name}]`).forEach((e=>{e!==t&&this.closeDropdown(e)}))}bindEventListener(t){t.removeEventListener("click",this.clickEventListener.bind(this)),t.addEventListener("click",this.clickEventListener.bind(this))}bindItemEventListener(t){t.removeEventListener("click",this.itemClickEventListener.bind(this)),t.addEventListener("click",this.itemClickEventListener.bind(this))}closeDropdown(t){(t.classList.contains(".ts-dropdown")||t.classList.contains("is-visible"))&&(t.classList.remove("is-visible"),void 0!==t.tocas_dropdown&&(t.tocas_dropdown(),t.tocas_dropdown=void 0,t.style.removeProperty("--ts-dropdown-min-width"),t.style.removeProperty("--ts-dropdown-position")))}itemClickEventListener(t){var e=t.target.closest(`.ts-dropdown[${tocas.config.attributes.dropdown_name}]`);null!==t.target.closest(".item")&&this.closeDropdown(e)}clickEventListener(t){var e=t.target.closest(`[${tocas.config.attributes.dropdown}]`),o=e.getAttribute(tocas.config.attributes.dropdown),i=n(e,o,tocas.config.scopes.dropdown,tocas.config.attributes.dropdown_name)[0],s=this.position(i);void 0!==i.tocas_dropdown&&(i.tocas_dropdown(),i.tocas_dropdown=void 0,i.style.removeProperty("--ts-dropdown-min-width"),i.style.removeProperty("--ts-dropdown-position")),i.classList.toggle("is-visible"),i.classList.contains("is-visible")&&(i.style.setProperty("--ts-dropdown-min-width",`${e.getBoundingClientRect().width}px`),i.style.setProperty("--ts-dropdown-position","fixed"),i.tocas_dropdown=TocasFloatingUIDOM.autoUpdate(e,i,(()=>{TocasFloatingUIDOM.computePosition(e,i,{strategy:"fixed",placement:s,middleware:[TocasFloatingUIDOM.flip({crossAxis:!1}),TocasFloatingUIDOM.offset(8),TocasFloatingUIDOM.shift()]}).then((({x:t,y:e})=>{Object.assign(i.style,{left:`${t}px`,top:`${e}px`})}))})))}},a=new class{attributeMutation(t){this.isTooltip(t.target)&&this.bindEventListener(t.target)}addedNodeMutation(t){this.isTooltip(t)&&this.bindEventListener(t)}isTooltip(t){return t.matches(`[${tocas.config.attributes.tooltip}]`)}bindEventListener(t){t.tocas_tooltip_timer=null,this.enterEventListener(t),this.leaveEventListener(t)}delay(t){var e=t.getAttribute(tocas.config.attributes.tooltip_delay);return"0"===e?0:parseInt(e,10)||200}position(t){return t.getAttribute(tocas.config.attributes.tooltip_position)||"bottom"}enterEventListener(t){t.addEventListener("mouseover",(e=>{window.matchMedia("(pointer: coarse)").matches||null===t.tocas_tooltip_timer&&void 0===t.tocas_tooltip&&(t.tocas_tooltip_timer=setTimeout((()=>{this.showTooltip(t)}),this.delay(t)+1))}))}leaveEventListener(t){t.addEventListener("mouseleave",(e=>{e.target===t&&(void 0!==t.tocas_tooltip&&(t.tocas_tooltip(),t.tocas_tooltip=void 0),null!==t.tocas_tooltip_timer&&(clearTimeout(t.tocas_tooltip_timer),t.tocas_tooltip_timer=null),document.querySelectorAll(".ts-tooltip").forEach((t=>{t.remove()})))}))}createTooltip(t,e){var n=document.createElement("div");return n.innerText=t.getAttribute(tocas.config.attributes.tooltip),n.classList.add("ts-tooltip",tocas.config.classes.tooltip_visible),n.appendChild(e),n}createArrow(){var t=document.createElement("div");return t.classList.add("arrow"),t}showTooltip(t){var e=this.position(t),n=this.createArrow(),o=this.createTooltip(t,n);document.body.appendChild(o),t.tocas_tooltip=TocasFloatingUIDOM.autoUpdate(t,o,(()=>{TocasFloatingUIDOM.computePosition(t,o,{strategy:"fixed",placement:e,middleware:[TocasFloatingUIDOM.flip({crossAxis:!1}),TocasFloatingUIDOM.offset({crossAxis:-15,mainAxis:10}),TocasFloatingUIDOM.shift(),TocasFloatingUIDOM.arrow({element:n})]}).then((({middlewareData:t,x:e,y:i,placement:s})=>{if(Object.assign(o.style,{left:`${e}px`,top:`${i}px`}),t.arrow){const{x:e}=t.arrow;n.style.setProperty("--ts-tooltip-x",null!=e?`${e}px`:"0")}s&&(o.classList.remove("is-top","is-top-start","is-top-end","is-bottom","is-bottom-start","is-bottom-end"),o.classList.add(`is-${s}`))}))}))}};new MutationObserver((function(t){t.forEach((function(t){"attributes"===t.type?(o.attributeMutation(t),i.attributeMutation(t),s.attributeMutation(t),r.attributeMutation(t),a.attributeMutation(t)):t.addedNodes&&t.addedNodes.length&&t.addedNodes.forEach((function(t){t.nodeType===Node.ELEMENT_NODE&&(o.addedNodeMutation(t),i.addedNodeMutation(t),s.addedNodeMutation(t),r.addedNodeMutation(t),a.addedNodeMutation(t))}))}))})).observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),window.addEventListener("resize",(t=>{o.windowResize(t)})),window.addEventListener("click",(t=>{r.windowClick(t)}))}(); +window.tocas={config:{strict_responsive:!1,attributes:{tab:"data-tab",tab_name:"data-name",toggle:"data-toggle",toggle_name:"data-name",dropdown:"data-dropdown",dropdown_name:"data-name",dropdown_position:"data-position",tooltip:"data-tooltip",tooltip_position:"data-position",tooltip_delay:"data-delay"},scopes:{tab:"@scope",toggle:"@scope",tab:"@scope",dropdown:"@scope",container:"@container"},classes:{hidden:"u-hidden",tab_active:"is-active",tooltip_visible:"is-visible",tab:"ts-tab"}}},function(){var t,e;t=this,e=function(t){"use strict";function e(t){return t.split("-")[1]}function n(t){return"y"===t?"height":"width"}function o(t){return t.split("-")[0]}function i(t){return["top","bottom"].includes(o(t))?"x":"y"}function s(t,s,r){let{reference:a,floating:c}=t;const l=a.x+a.width/2-c.width/2,d=a.y+a.height/2-c.height/2,f=i(s),u=n(f),p=a[u]/2-c[u]/2,g="x"===f;let m;switch(o(s)){case"top":m={x:l,y:a.y-c.height};break;case"bottom":m={x:l,y:a.y+a.height};break;case"right":m={x:a.x+a.width,y:d};break;case"left":m={x:a.x-c.width,y:d};break;default:m={x:a.x,y:a.y}}switch(e(s)){case"start":m[f]-=p*(r&&g?-1:1);break;case"end":m[f]+=p*(r&&g?-1:1)}return m}function r(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function a(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function c(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:s,rects:c,elements:l,strategy:d}=t,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:g=!1,padding:m=0}=e,h=r(m),b=l[g?"floating"===p?"reference":"floating":p],v=a(await s.getClippingRect({element:null==(n=await(null==s.isElement?void 0:s.isElement(b)))||n?b:b.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(l.floating)),boundary:f,rootBoundary:u,strategy:d})),w="floating"===p?{...c.floating,x:o,y:i}:c.reference,y=await(null==s.getOffsetParent?void 0:s.getOffsetParent(l.floating)),x=await(null==s.isElement?void 0:s.isElement(y))&&await(null==s.getScale?void 0:s.getScale(y))||{x:1,y:1},E=a(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:y,strategy:d}):w);return{top:(v.top-E.top+h.top)/x.y,bottom:(E.bottom-v.bottom+h.bottom)/x.y,left:(v.left-E.left+h.left)/x.x,right:(E.right-v.right+h.right)/x.x}}const l=Math.min,d=Math.max;function f(t,e,n){return d(t,l(e,n))}const u=["top","right","bottom","left"],p=u.reduce(((t,e)=>t.concat(e,e+"-start",e+"-end")),[]),g={left:"right",right:"left",bottom:"top",top:"bottom"};function m(t){return t.replace(/left|right|bottom|top/g,(t=>g[t]))}function h(t,o,s){void 0===s&&(s=!1);const r=e(t),a=i(t),c=n(a);let l="x"===a?r===(s?"end":"start")?"right":"left":"start"===r?"bottom":"top";return o.reference[c]>o.floating[c]&&(l=m(l)),{main:l,cross:m(l)}}const b={start:"end",end:"start"};function v(t){return t.replace(/start|end/g,(t=>b[t]))}function w(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function y(t){return u.some((e=>t[e]>=0))}function x(t){return"x"===t?"y":"x"}t.arrow=t=>({name:"arrow",options:t,async fn(o){const{element:s,padding:a=0}=t||{},{x:c,y:l,placement:d,rects:u,platform:p,elements:g}=o;if(null==s)return{};const m=r(a),h={x:c,y:l},b=i(d),v=n(b),w=await p.getDimensions(s),y="y"===b,x=y?"top":"left",E=y?"bottom":"right",L=y?"clientHeight":"clientWidth",T=u.reference[v]+u.reference[b]-h[b]-u.floating[v],A=h[b]-u.reference[b],_=await(null==p.getOffsetParent?void 0:p.getOffsetParent(s));let R=_?_[L]:0;R&&await(null==p.isElement?void 0:p.isElement(_))||(R=g.floating[L]||u.floating[v]);const P=T/2-A/2,O=m[x],M=R-w[v]-m[E],D=R/2-w[v]/2+P,k=f(O,D,M),C=null!=e(d)&&D!=k&&u.reference[v]/2-(De(n)===t)),...i.filter((n=>e(n)!==t))]:i.filter((t=>o(t)===t))).filter((o=>!t||e(o)===t||!!n&&v(o)!==o))}(m||null,w,b):b,E=await c(n,y),L=(null==(i=l.autoPlacement)?void 0:i.index)||0,T=x[L];if(null==T)return{};const{main:A,cross:_}=h(T,a,await(null==f.isRTL?void 0:f.isRTL(u.floating)));if(d!==T)return{reset:{placement:x[0]}};const R=[E[o(T)],E[A],E[_]],P=[...(null==(s=l.autoPlacement)?void 0:s.overflows)||[],{placement:T,overflows:R}],O=x[L+1];if(O)return{data:{index:L+1,overflows:P},reset:{placement:O}};const M=P.map((t=>{const n=e(t.placement);return[t.placement,n&&g?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1])),D=(null==(r=M.filter((t=>t[2].slice(0,e(t[0])?2:3).every((t=>t<=0))))[0])?void 0:r[0])||M[0][0];return D!==d?{data:{index:L+1,overflows:P},reset:{placement:D}}:{}}}},t.computePosition=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:a}=n,c=r.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(e));let d=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=s(d,o,l),p=o,g={},m=0;for(let n=0;nt+"-"+r)),n&&(a=a.concat(a.map(v)))),a}(l,y,w,T));const _=[l,...A],R=await c(n,x),P=[];let O=(null==(i=r.flip)?void 0:i.overflows)||[];if(u&&P.push(R[E]),p){const{main:t,cross:e}=h(s,a,T);P.push(R[t],R[e])}if(O=[...O,{placement:s,overflows:P}],!P.every((t=>t<=0))){var M,D;const t=((null==(M=r.flip)?void 0:M.index)||0)+1,e=_[t];if(e)return{data:{index:t,overflows:O},reset:{placement:e}};let n=null==(D=O.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:D.placement;if(!n)switch(b){case"bestFit":{var k;const t=null==(k=O.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:k[0];t&&(n=t);break}case"initialPlacement":n=l}if(s!==n)return{reset:{placement:n}}}return{}}}},t.hide=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{strategy:n="referenceHidden",...o}=t,{rects:i}=e;switch(n){case"referenceHidden":{const t=w(await c(e,{...o,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:y(t)}}}case"escaped":{const t=w(await c(e,{...o,altBoundary:!0}),i.floating);return{data:{escapedOffsets:t,escaped:y(t)}}}default:return{}}}}},t.inline=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:s,rects:c,platform:f,strategy:u}=e,{padding:p=2,x:g,y:m}=t,h=a(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({rect:c.reference,offsetParent:await(null==f.getOffsetParent?void 0:f.getOffsetParent(s.floating)),strategy:u}):c.reference),b=await(null==f.getClientRects?void 0:f.getClientRects(s.reference))||[],v=r(p),w=await f.getElementRects({reference:{getBoundingClientRect:function(){if(2===b.length&&b[0].left>b[1].right&&null!=g&&null!=m)return b.find((t=>g>t.left-v.left&&gt.top-v.top&&m=2){if("x"===i(n)){const t=b[0],e=b[b.length-1],i="top"===o(n),s=t.top,r=e.bottom,a=i?t.left:e.left,c=i?t.right:e.right;return{top:s,bottom:r,left:a,right:c,width:c-a,height:r-s,x:a,y:s}}const t="left"===o(n),e=d(...b.map((t=>t.right))),s=l(...b.map((t=>t.left))),r=b.filter((n=>t?n.left===s:n.right===e)),a=r[0].top,c=r[r.length-1].bottom;return{top:a,bottom:c,left:s,right:e,width:e-s,height:c-a,x:s,y:a}}return h}},floating:s.floating,strategy:u});return c.reference.x!==w.reference.x||c.reference.y!==w.reference.y||c.reference.width!==w.reference.width||c.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}},t.limitShift=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:s,placement:r,rects:a,middlewareData:c}=e,{offset:l=0,mainAxis:d=!0,crossAxis:f=!0}=t,u={x:n,y:s},p=i(r),g=x(p);let m=u[p],h=u[g];const b="function"==typeof l?l(e):l,v="number"==typeof b?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(d){const t="y"===p?"height":"width",e=a.reference[p]-a.floating[t]+v.mainAxis,n=a.reference[p]+a.reference[t]-v.mainAxis;mn&&(m=n)}if(f){var w,y;const t="y"===p?"width":"height",e=["top","left"].includes(o(r)),n=a.reference[g]-a.floating[t]+(e&&(null==(w=c.offset)?void 0:w[g])||0)+(e?0:v.crossAxis),i=a.reference[g]+a.reference[t]+(e?0:(null==(y=c.offset)?void 0:y[g])||0)-(e?v.crossAxis:0);hi&&(h=i)}return{[p]:m,[g]:h}}}},t.offset=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(n){const{x:s,y:r}=n,a=await async function(t,n){const{placement:s,platform:r,elements:a}=t,c=await(null==r.isRTL?void 0:r.isRTL(a.floating)),l=o(s),d=e(s),f="x"===i(s),u=["left","top"].includes(l)?-1:1,p=c&&f?-1:1,g="function"==typeof n?n(t):n;let{mainAxis:m,crossAxis:h,alignmentAxis:b}="number"==typeof g?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...g};return d&&"number"==typeof b&&(h="end"===d?-1*b:b),f?{x:h*p,y:m*u}:{x:m*u,y:h*p}}(n,t);return{x:s+a.x,y:r+a.y,data:a}}}},t.rectToClientRect=a,t.shift=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:s,placement:r}=e,{mainAxis:a=!0,crossAxis:l=!1,limiter:d={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...u}=t,p={x:n,y:s},g=await c(e,u),m=i(o(r)),h=x(m);let b=p[m],v=p[h];if(a){const t="y"===m?"bottom":"right";b=f(b+g["y"===m?"top":"left"],b,b-g[t])}if(l){const t="y"===h?"bottom":"right";v=f(v+g["y"===h?"top":"left"],v,v-g[t])}const w=d.fn({...e,[m]:b,[h]:v});return{...w,data:{x:w.x-n,y:w.y-s}}}}},t.size=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(n){const{placement:s,rects:r,platform:a,elements:f}=n,{apply:u=(()=>{}),...p}=t,g=await c(n,p),m=o(s),h=e(s),b="x"===i(s),{width:v,height:w}=r.floating;let y,x;"top"===m||"bottom"===m?(y=m,x=h===(await(null==a.isRTL?void 0:a.isRTL(f.floating))?"start":"end")?"left":"right"):(x=m,y="end"===h?"top":"bottom");const E=w-g[y],L=v-g[x];let T=E,A=L;if(b?A=l(v-g.right-g.left,L):T=l(w-g.bottom-g.top,E),!n.middlewareData.shift&&!h){const t=d(g.left,0),e=d(g.right,0),n=d(g.top,0),o=d(g.bottom,0);b?A=v-2*(0!==t||0!==e?t+e:d(g.left,g.right)):T=w-2*(0!==n||0!==o?n+o:d(g.top,g.bottom))}await u({...n,availableWidth:A,availableHeight:T});const _=await a.getDimensions(f.floating);return v!==_.width||w!==_.height?{reset:{rects:!0}}:{}}}},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).TocasFloatingUICore={}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@floating-ui/core")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).TocasFloatingUIDOM={},t.TocasFloatingUICore)}(this,(function(t,e){"use strict";function n(t){var e;return(null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function o(t){return n(t).getComputedStyle(t)}const i=Math.min,s=Math.max,r=Math.round;function a(t){const e=o(t);let n=parseFloat(e.width),i=parseFloat(e.height);const s=t.offsetWidth,a=t.offsetHeight,c=r(n)!==s||r(i)!==a;return c&&(n=s,i=a),{width:n,height:i,fallback:c}}function c(t){return p(t)?(t.nodeName||"").toLowerCase():""}let l;function d(){if(l)return l;const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?(l=t.brands.map((t=>t.brand+"/"+t.version)).join(" "),l):navigator.userAgent}function f(t){return t instanceof n(t).HTMLElement}function u(t){return t instanceof n(t).Element}function p(t){return t instanceof n(t).Node}function g(t){return"undefined"!=typeof ShadowRoot&&(t instanceof n(t).ShadowRoot||t instanceof ShadowRoot)}function m(t){const{overflow:e,overflowX:n,overflowY:i,display:s}=o(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(s)}function h(t){return["table","td","th"].includes(c(t))}function b(t){const e=/firefox/i.test(d()),n=o(t),i=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!i&&"none"!==i||e&&"filter"===n.willChange||e&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((t=>n.willChange.includes(t)))||["paint","layout","strict","content"].some((t=>{const e=n.contain;return null!=e&&e.includes(t)}))}function v(){return/^((?!chrome|android).)*safari/i.test(d())}function w(t){return["html","body","#document"].includes(c(t))}function y(t){return u(t)?t:t.contextElement}const x={x:1,y:1};function E(t){const e=y(t);if(!f(e))return x;const n=e.getBoundingClientRect(),{width:o,height:i,fallback:s}=a(e);let c=(s?r(n.width):n.width)/o,l=(s?r(n.height):n.height)/i;return c&&Number.isFinite(c)||(c=1),l&&Number.isFinite(l)||(l=1),{x:c,y:l}}function L(t,o,i,s){var r,a;void 0===o&&(o=!1),void 0===i&&(i=!1);const c=t.getBoundingClientRect(),l=y(t);let d=x;o&&(s?u(s)&&(d=E(s)):d=E(t));const f=l?n(l):window,p=v()&&i;let g=(c.left+(p&&(null==(r=f.visualViewport)?void 0:r.offsetLeft)||0))/d.x,m=(c.top+(p&&(null==(a=f.visualViewport)?void 0:a.offsetTop)||0))/d.y,h=c.width/d.x,b=c.height/d.y;if(l){const t=n(l),e=s&&u(s)?n(s):s;let o=t.frameElement;for(;o&&s&&e!==t;){const t=E(o),e=o.getBoundingClientRect(),i=getComputedStyle(o);e.x+=(o.clientLeft+parseFloat(i.paddingLeft))*t.x,e.y+=(o.clientTop+parseFloat(i.paddingTop))*t.y,g*=t.x,m*=t.y,h*=t.x,b*=t.y,g+=e.x,m+=e.y,o=n(o).frameElement}}return e.rectToClientRect({width:h,height:b,x:g,y:m})}function T(t){return((p(t)?t.ownerDocument:t.document)||window.document).documentElement}function A(t){return u(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function _(t){return L(T(t)).left+A(t).scrollLeft}function R(t){if("html"===c(t))return t;const e=t.assignedSlot||t.parentNode||g(t)&&t.host||T(t);return g(e)?e.host:e}function P(t){const e=R(t);return w(e)?e.ownerDocument.body:f(e)&&m(e)?e:P(e)}function O(t,e){var o;void 0===e&&(e=[]);const i=P(t),s=i===(null==(o=t.ownerDocument)?void 0:o.body),r=n(i);return s?e.concat(r,r.visualViewport||[],m(i)?i:[]):e.concat(i,O(i))}function M(t,i,r){let a;if("viewport"===i)a=function(t,e){const o=n(t),i=T(t),s=o.visualViewport;let r=i.clientWidth,a=i.clientHeight,c=0,l=0;if(s){r=s.width,a=s.height;const t=v();(!t||t&&"fixed"===e)&&(c=s.offsetLeft,l=s.offsetTop)}return{width:r,height:a,x:c,y:l}}(t,r);else if("document"===i)a=function(t){const e=T(t),n=A(t),i=t.ownerDocument.body,r=s(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),a=s(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let c=-n.scrollLeft+_(t);const l=-n.scrollTop;return"rtl"===o(i).direction&&(c+=s(e.clientWidth,i.clientWidth)-r),{width:r,height:a,x:c,y:l}}(T(t));else if(u(i))a=function(t,e){const n=L(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=f(t)?E(t):{x:1,y:1};return{width:t.clientWidth*s.x,height:t.clientHeight*s.y,x:i*s.x,y:o*s.y}}(i,r);else{const e={...i};if(v()){var c,l;const o=n(t);e.x-=(null==(c=o.visualViewport)?void 0:c.offsetLeft)||0,e.y-=(null==(l=o.visualViewport)?void 0:l.offsetTop)||0}a=e}return e.rectToClientRect(a)}function D(t,e){return f(t)&&"fixed"!==o(t).position?e?e(t):t.offsetParent:null}function k(t,e){const i=n(t);let s=D(t,e);for(;s&&h(s)&&"static"===o(s).position;)s=D(s,e);return s&&("html"===c(s)||"body"===c(s)&&"static"===o(s).position&&!b(s))?i:s||function(t){let e=R(t);for(;f(e)&&!w(e);){if(b(e))return e;e=R(e)}return null}(t)||i}function C(t,e,n){const o=f(e),i=T(e),s=L(t,!0,"fixed"===n,e);let r={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(o||!o&&"fixed"!==n)if(("body"!==c(e)||m(i))&&(r=A(e)),f(e)){const t=L(e,!0);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&(a.x=_(i));return{x:s.left+r.scrollLeft-a.x,y:s.top+r.scrollTop-a.y,width:s.width,height:s.height}}const $={getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:r,strategy:a}=t;const l="clippingAncestors"===n?function(t,e){const n=e.get(t);if(n)return n;let i=O(t).filter((t=>u(t)&&"body"!==c(t))),s=null;const r="fixed"===o(t).position;let a=r?R(t):t;for(;u(a)&&!w(a);){const t=o(a),e=b(a);"fixed"===t.position?s=null:(r?e||s:e||"static"!==t.position||!s||!["absolute","fixed"].includes(s.position))?s=t:i=i.filter((t=>t!==a)),a=R(a)}return e.set(t,i),i}(e,this._c):[].concat(n),d=[...l,r],f=d[0],p=d.reduce(((t,n)=>{const o=M(e,n,a);return t.top=s(o.top,t.top),t.right=i(o.right,t.right),t.bottom=i(o.bottom,t.bottom),t.left=s(o.left,t.left),t}),M(e,f,a));return{width:p.right-p.left,height:p.bottom-p.top,x:p.left,y:p.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=f(n),s=T(n);if(n===s)return e;let r={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((i||!i&&"fixed"!==o)&&(("body"!==c(n)||m(s))&&(r=A(n)),f(n))){const t=L(n);a=E(n),l.x=t.x+n.clientLeft,l.y=t.y+n.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-r.scrollLeft*a.x+l.x,y:e.y*a.y-r.scrollTop*a.y+l.y}},isElement:u,getDimensions:function(t){return f(t)?a(t):t.getBoundingClientRect()},getOffsetParent:k,getDocumentElement:T,getScale:E,async getElementRects(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||k,s=this.getDimensions;return{reference:C(e,await i(n),o),floating:{x:0,y:0,...await s(n)}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>"rtl"===o(t).direction};Object.defineProperty(t,"arrow",{enumerable:!0,get:function(){return e.arrow}}),Object.defineProperty(t,"autoPlacement",{enumerable:!0,get:function(){return e.autoPlacement}}),Object.defineProperty(t,"detectOverflow",{enumerable:!0,get:function(){return e.detectOverflow}}),Object.defineProperty(t,"flip",{enumerable:!0,get:function(){return e.flip}}),Object.defineProperty(t,"hide",{enumerable:!0,get:function(){return e.hide}}),Object.defineProperty(t,"inline",{enumerable:!0,get:function(){return e.inline}}),Object.defineProperty(t,"limitShift",{enumerable:!0,get:function(){return e.limitShift}}),Object.defineProperty(t,"offset",{enumerable:!0,get:function(){return e.offset}}),Object.defineProperty(t,"shift",{enumerable:!0,get:function(){return e.shift}}),Object.defineProperty(t,"size",{enumerable:!0,get:function(){return e.size}}),t.autoUpdate=function(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=!0,animationFrame:a=!1}=o,c=i&&!a,l=c||s?[...u(t)?O(t):t.contextElement?O(t.contextElement):[],...O(e)]:[];l.forEach((t=>{c&&t.addEventListener("scroll",n,{passive:!0}),s&&t.addEventListener("resize",n)}));let d,f=null;if(r){let o=!0;f=new ResizeObserver((()=>{o||n(),o=!1})),u(t)&&!a&&f.observe(t),u(t)||!t.contextElement||a||f.observe(t.contextElement),f.observe(e)}let p=a?L(t):null;return a&&function e(){const o=L(t);!p||o.x===p.x&&o.y===p.y&&o.width===p.width&&o.height===p.height||n(),p=o,d=requestAnimationFrame(e)}(),n(),()=>{var t;l.forEach((t=>{c&&t.removeEventListener("scroll",n),s&&t.removeEventListener("resize",n)})),null==(t=f)||t.disconnect(),f=null,a&&cancelAnimationFrame(d)}},t.computePosition=(t,n,o)=>{const i=new Map,s={platform:$,...o},r={...s.platform,_c:i};return e.computePosition(t,n,{...s,platform:r})},t.getOverflowAncestors=O,t.platform=$,Object.defineProperty(t,"__esModule",{value:!0})}));function n(t,e,n,o){var i=t.closest(`[class*="${n}"]`)||document,s=Array.from(i.querySelectorAll(`[${o}="${e}"]`)).filter((t=>t.closest(`[class*="${n}"]`)||document===i));return s.length>0?s:i===document?[]:this.searchScopeTargets(i.parentNode,e,n,o)}var o=new class{constructor(){this.resize_observer=new ResizeObserver((t=>{t.forEach((t=>{this.getAllContaineredElements(t.target).forEach((t=>{this.check(t)}))}))}))}attributeMutation(t){this.isContainer(t.target)?this.resize_observer.observe(t.target):this.resize_observer.unobserve(t.target)}addedNodeMutation(t){this.isResponsiveElement(t)&&this.check(t),this.isContainer(t)&&this.resize_observer.observe(t)}getAllContaineredElements(t){return t.querySelectorAll(tocas.config.strict_responsive?'[class^="@"]:is([class*=":is-"],[class*=":u-"])':'[class^="@"][class*=":"]')}getAllResponsiveElements(t){return t.querySelectorAll(tocas.config.strict_responsive?'[class*=":is-"],[class*=":u-"]':'[class*=":"]')}isContainer(t){return t.matches(`[class~="${tocas.config.scopes.container}"]`)}isResponsiveElement(t){return t.matches(tocas.config.strict_responsive?'[class*=":is-"],[class*=":u-"]':'[class*=":"]')}hasResponsiveClass(t){return tocas.config.strict_responsive?t.includes(":is-")||t.includes(":u-"):t.includes(":")}windowResize(){this.getAllResponsiveElements(document).forEach((t=>{this.check(t)}))}unit(t){return parseInt(t,10)||0}breakpointSize(t,e){var n=window.getComputedStyle(e);return{min:this.unit(n.getPropertyValue(`--ts-breakpoint-${t}-min`)),max:this.unit(n.getPropertyValue(`--ts-breakpoint-${t}-max`))}}rule(t,e){var n=t.startsWith("@"),o=t.endsWith("+"),i=t.endsWith("-"),s=t.includes("[");n&&(t=t.substring(1)),(o||i)&&(t=t.substring(0,t.length-1)),s&&(t=t.substring(1).substring(0,t.length-1));var[r,a]=t.split("-");if(s)return o?[this.unit(r),99999]:i?[0,this.unit(r)]:[this.unit(r),this.unit(a)];var c=this.breakpointSize(r,e);return void 0!==a?[c.min,this.breakpointSize(a,e).max]:o?[c.min,99999]:i?[0,c.max]:[c.min,c.max]}compile(t){return Array.from(t.classList).filter((t=>this.hasResponsiveClass(t))).map((e=>{var[n,o]=e.split(":"),[i,s]=this.rule(n,t);return{min:i,max:s,width:n.startsWith("@")?Math.round(t.closest(`[class~="${tocas.config.scopes.container}"]`).getBoundingClientRect().width):Math.round(window.innerWidth),target_class:o}}))}check(t){var e=[],n=this.compile(t);n.forEach((({width:n,min:o,max:i,target_class:s})=>{n>=o&&n<=i&&(t.classList.add(s),e=[...e,s])})),n.forEach((({width:n,min:o,max:i,target_class:s})=>{(ni)&&!e.includes(s)&&t.classList.remove(s)}))}},i=new class{constructor(){}attributeMutation(t){}addedNodeMutation(t){this.isTab(t)&&(this.bindEventListener(t),this.initialTab(t))}isTab(t){return t.matches(`[${tocas.config.attributes.tab}]`)}isActiveTab(t){return t.classList.contains(tocas.config.classes.tab_active)}initialTab(t){this.isActiveTab(t)||n(t,t.getAttribute(tocas.config.attributes.tab),tocas.config.scopes.tab,tocas.config.attributes.tab_name).forEach((t=>{t.classList.add(tocas.config.classes.hidden)}))}toggle(t){var e=t.target.closest(`[${tocas.config.attributes.tab}]`),n=e.getAttribute(tocas.config.attributes.tab),o=e.closest(`[class*="${tocas.config.scopes.tab}"]`)||document,i=e.closest(".ts-tab"),s=[];i.querySelectorAll(`[${tocas.config.attributes.tab}]`).forEach((t=>{t.getAttribute(tocas.config.attributes.tab)===n?t.classList.add(tocas.config.classes.tab_active):(s=[...s,t.getAttribute(tocas.config.attributes.tab)],t.classList.remove(tocas.config.classes.tab_active))})),o.querySelectorAll(`[${tocas.config.attributes.tab_name}]`).forEach((t=>{var e=t.closest(`[class*="${tocas.config.scopes.tab}"]`)||document;o===e&&(t.getAttribute(tocas.config.attributes.tab_name)===n?t.classList.remove(tocas.config.classes.hidden):s.includes(t.getAttribute(tocas.config.attributes.tab_name))&&t.classList.add(tocas.config.classes.hidden))}))}bindEventListener(t){t.removeEventListener("click",this.toggle),t.addEventListener("click",this.toggle)}},s=new class{attributeMutation(t){}addedNodeMutation(t){this.isToggle(t)&&this.bindEventListener(t)}isToggle(t){return t.matches(`[${tocas.config.attributes.toggle}]`)}toggle(t){var e=t.target.closest(`[${tocas.config.attributes.toggle}]`),[o,i]=e.getAttribute(tocas.config.attributes.toggle).split(":");n(e,o,tocas.config.scopes.toggle,tocas.config.attributes.toggle_name).forEach((t=>{t.classList.toggle(i)}))}bindEventListener(t){t.removeEventListener("click",this.toggle.bind(this)),t.addEventListener("click",this.toggle.bind(this))}},r=new class{attributeMutation(t){}addedNodeMutation(t){this.isDropdownTrigger(t)&&this.bindEventListener(t),this.isDropdown(t)&&this.bindItemEventListener(t)}isDropdownTrigger(t){return t.matches(`[${tocas.config.attributes.dropdown}]`)}isDropdown(t){return t.matches(`.ts-dropdown[${tocas.config.attributes.dropdown_name}]`)}position(t){return t.getAttribute(tocas.config.attributes.dropdown_position)||"bottom"}windowClick(t){var e=t.target.closest(`[${tocas.config.attributes.dropdown}]`),o=t.target.closest(`[${tocas.config.attributes.dropdown_name}]`);if(null===e&&null===o&&document.querySelectorAll(`.ts-dropdown[${tocas.config.attributes.dropdown_name}]`).forEach((t=>{this.closeDropdown(t)})),null!==e){var i=e.getAttribute(tocas.config.attributes.dropdown),s=n(e,i,tocas.config.scopes.dropdown,tocas.config.attributes.dropdown_name)[0];this.closeDropdownsExcept(s)}null!==o&&this.closeDropdownsExcept(o)}closeDropdownsExcept(t){document.querySelectorAll(`.ts-dropdown[${tocas.config.attributes.dropdown_name}]`).forEach((e=>{e!==t&&this.closeDropdown(e)}))}bindEventListener(t){t.removeEventListener("click",this.clickEventListener.bind(this)),t.addEventListener("click",this.clickEventListener.bind(this))}bindItemEventListener(t){t.removeEventListener("click",this.itemClickEventListener.bind(this)),t.addEventListener("click",this.itemClickEventListener.bind(this))}closeDropdown(t){(t.classList.contains(".ts-dropdown")||t.classList.contains("is-visible"))&&(t.classList.remove("is-visible"),void 0!==t.tocas_dropdown&&(t.tocas_dropdown(),t.tocas_dropdown=void 0,t.style.removeProperty("--ts-dropdown-min-width"),t.style.removeProperty("--ts-dropdown-position")))}itemClickEventListener(t){var e=t.target.closest(`.ts-dropdown[${tocas.config.attributes.dropdown_name}]`);null!==t.target.closest(".item")&&this.closeDropdown(e)}clickEventListener(t){var e=t.target.closest(`[${tocas.config.attributes.dropdown}]`),o=e.getAttribute(tocas.config.attributes.dropdown),i=n(e,o,tocas.config.scopes.dropdown,tocas.config.attributes.dropdown_name)[0],s=this.position(i);void 0!==i.tocas_dropdown&&(i.tocas_dropdown(),i.tocas_dropdown=void 0,i.style.removeProperty("--ts-dropdown-min-width"),i.style.removeProperty("--ts-dropdown-position")),i.classList.toggle("is-visible"),i.classList.contains("is-visible")&&(i.style.setProperty("--ts-dropdown-min-width",`${e.getBoundingClientRect().width}px`),i.style.setProperty("--ts-dropdown-position","fixed"),i.tocas_dropdown=TocasFloatingUIDOM.autoUpdate(e,i,(()=>{TocasFloatingUIDOM.computePosition(e,i,{strategy:"fixed",placement:s,middleware:[TocasFloatingUIDOM.flip({crossAxis:!1}),TocasFloatingUIDOM.offset(8),TocasFloatingUIDOM.shift()]}).then((({x:t,y:e})=>{Object.assign(i.style,{left:`${t}px`,top:`${e}px`})}))})))}},a=new class{attributeMutation(t){this.isTooltip(t.target)&&this.bindEventListener(t.target)}addedNodeMutation(t){this.isTooltip(t)&&this.bindEventListener(t)}isTooltip(t){return t.matches(`[${tocas.config.attributes.tooltip}]`)}bindEventListener(t){t.tocas_tooltip_timer=null,this.enterEventListener(t),this.leaveEventListener(t)}delay(t){var e=t.getAttribute(tocas.config.attributes.tooltip_delay);return"0"===e?0:parseInt(e,10)||200}position(t){return t.getAttribute(tocas.config.attributes.tooltip_position)||"bottom"}enterEventListener(t){t.addEventListener("mouseover",(e=>{window.matchMedia("(pointer: coarse)").matches||null===t.tocas_tooltip_timer&&void 0===t.tocas_tooltip&&(t.tocas_tooltip_timer=setTimeout((()=>{this.showTooltip(t)}),this.delay(t)+1))}))}leaveEventListener(t){t.addEventListener("mouseleave",(e=>{e.target===t&&(void 0!==t.tocas_tooltip&&(t.tocas_tooltip(),t.tocas_tooltip=void 0),null!==t.tocas_tooltip_timer&&(clearTimeout(t.tocas_tooltip_timer),t.tocas_tooltip_timer=null),document.querySelectorAll(".ts-tooltip").forEach((t=>{t.remove()})))}))}createTooltip(t,e){var n=document.createElement("div");return n.innerText=t.getAttribute(tocas.config.attributes.tooltip),n.classList.add("ts-tooltip",tocas.config.classes.tooltip_visible),n.appendChild(e),n}createArrow(){var t=document.createElement("div");return t.classList.add("arrow"),t}showTooltip(t){var e=this.position(t),n=this.createArrow(),o=this.createTooltip(t,n);document.body.appendChild(o),t.tocas_tooltip=TocasFloatingUIDOM.autoUpdate(t,o,(()=>{TocasFloatingUIDOM.computePosition(t,o,{strategy:"fixed",placement:e,middleware:[TocasFloatingUIDOM.flip({crossAxis:!1}),TocasFloatingUIDOM.offset({crossAxis:-15,mainAxis:10}),TocasFloatingUIDOM.shift(),TocasFloatingUIDOM.arrow({element:n})]}).then((({middlewareData:t,x:e,y:i,placement:s})=>{if(Object.assign(o.style,{left:`${e}px`,top:`${i}px`}),t.arrow){const{x:e}=t.arrow;n.style.setProperty("--ts-tooltip-x",null!=e?`${e}px`:"0")}s&&(o.classList.remove("is-top","is-top-start","is-top-end","is-bottom","is-bottom-start","is-bottom-end"),o.classList.add(`is-${s}`))}))}))}};new MutationObserver((function(t){t.forEach((function(t){"attributes"===t.type?(o.attributeMutation(t),i.attributeMutation(t),s.attributeMutation(t),r.attributeMutation(t),a.attributeMutation(t)):t.addedNodes&&t.addedNodes.length&&t.addedNodes.forEach((function(t){t.nodeType===Node.ELEMENT_NODE&&(o.addedNodeMutation(t),i.addedNodeMutation(t),s.addedNodeMutation(t),r.addedNodeMutation(t),a.addedNodeMutation(t))}))}))})).observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),window.addEventListener("resize",(t=>{o.windowResize(t)})),window.addEventListener("click",(t=>{r.windowClick(t)}))}(); diff --git a/docs/zh-tw/assets/tocas/src/scripts/tocas.js b/docs/zh-tw/assets/tocas/src/scripts/tocas.js index a9e12063..ede7a36f 100644 --- a/docs/zh-tw/assets/tocas/src/scripts/tocas.js +++ b/docs/zh-tw/assets/tocas/src/scripts/tocas.js @@ -220,7 +220,7 @@ window.tocas = { // 如果這個規則開頭有個 @ 符號,就尋找最近的 Container 容器來作為寬度判斷, // 但如果沒有,就以視窗的 innerWidth 為主。 // @breakpoint - var width = rule.startsWith("@") ? element.closest(`[class~="${tocas.config.scopes.container}"]`).getBoundingClientRect().width : window.innerWidth; + var width = rule.startsWith("@") ? Math.round(element.closest(`[class~="${tocas.config.scopes.container}"]`).getBoundingClientRect().width) : Math.round(window.innerWidth); return { min, diff --git a/docs/zh-tw/assets/tocas/tocas.js b/docs/zh-tw/assets/tocas/tocas.js index 696671ae..254e6804 100644 --- a/docs/zh-tw/assets/tocas/tocas.js +++ b/docs/zh-tw/assets/tocas/tocas.js @@ -225,7 +225,7 @@ window.tocas = { // 如果這個規則開頭有個 @ 符號,就尋找最近的 Container 容器來作為寬度判斷, // 但如果沒有,就以視窗的 innerWidth 為主。 // @breakpoint - var width = rule.startsWith("@") ? element.closest(`[class~="${tocas.config.scopes.container}"]`).getBoundingClientRect().width : window.innerWidth; + var width = rule.startsWith("@") ? Math.round(element.closest(`[class~="${tocas.config.scopes.container}"]`).getBoundingClientRect().width) : Math.round(window.innerWidth); return { min, diff --git a/docs/zh-tw/assets/tocas/tocas.min.js b/docs/zh-tw/assets/tocas/tocas.min.js index 64162691..cf126850 100644 --- a/docs/zh-tw/assets/tocas/tocas.min.js +++ b/docs/zh-tw/assets/tocas/tocas.min.js @@ -1 +1 @@ -window.tocas={config:{strict_responsive:!1,attributes:{tab:"data-tab",tab_name:"data-name",toggle:"data-toggle",toggle_name:"data-name",dropdown:"data-dropdown",dropdown_name:"data-name",dropdown_position:"data-position",tooltip:"data-tooltip",tooltip_position:"data-position",tooltip_delay:"data-delay"},scopes:{tab:"@scope",toggle:"@scope",tab:"@scope",dropdown:"@scope",container:"@container"},classes:{hidden:"u-hidden",tab_active:"is-active",tooltip_visible:"is-visible",tab:"ts-tab"}}},function(){var t,e;t=this,e=function(t){"use strict";function e(t){return t.split("-")[1]}function n(t){return"y"===t?"height":"width"}function o(t){return t.split("-")[0]}function i(t){return["top","bottom"].includes(o(t))?"x":"y"}function s(t,s,r){let{reference:a,floating:c}=t;const l=a.x+a.width/2-c.width/2,f=a.y+a.height/2-c.height/2,d=i(s),u=n(d),p=a[u]/2-c[u]/2,g="x"===d;let m;switch(o(s)){case"top":m={x:l,y:a.y-c.height};break;case"bottom":m={x:l,y:a.y+a.height};break;case"right":m={x:a.x+a.width,y:f};break;case"left":m={x:a.x-c.width,y:f};break;default:m={x:a.x,y:a.y}}switch(e(s)){case"start":m[d]-=p*(r&&g?-1:1);break;case"end":m[d]+=p*(r&&g?-1:1)}return m}function r(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function a(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function c(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:s,rects:c,elements:l,strategy:f}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:g=!1,padding:m=0}=e,h=r(m),b=l[g?"floating"===p?"reference":"floating":p],v=a(await s.getClippingRect({element:null==(n=await(null==s.isElement?void 0:s.isElement(b)))||n?b:b.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:f})),w="floating"===p?{...c.floating,x:o,y:i}:c.reference,y=await(null==s.getOffsetParent?void 0:s.getOffsetParent(l.floating)),x=await(null==s.isElement?void 0:s.isElement(y))&&await(null==s.getScale?void 0:s.getScale(y))||{x:1,y:1},E=a(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:y,strategy:f}):w);return{top:(v.top-E.top+h.top)/x.y,bottom:(E.bottom-v.bottom+h.bottom)/x.y,left:(v.left-E.left+h.left)/x.x,right:(E.right-v.right+h.right)/x.x}}const l=Math.min,f=Math.max;function d(t,e,n){return f(t,l(e,n))}const u=["top","right","bottom","left"],p=u.reduce(((t,e)=>t.concat(e,e+"-start",e+"-end")),[]),g={left:"right",right:"left",bottom:"top",top:"bottom"};function m(t){return t.replace(/left|right|bottom|top/g,(t=>g[t]))}function h(t,o,s){void 0===s&&(s=!1);const r=e(t),a=i(t),c=n(a);let l="x"===a?r===(s?"end":"start")?"right":"left":"start"===r?"bottom":"top";return o.reference[c]>o.floating[c]&&(l=m(l)),{main:l,cross:m(l)}}const b={start:"end",end:"start"};function v(t){return t.replace(/start|end/g,(t=>b[t]))}function w(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function y(t){return u.some((e=>t[e]>=0))}function x(t){return"x"===t?"y":"x"}t.arrow=t=>({name:"arrow",options:t,async fn(o){const{element:s,padding:a=0}=t||{},{x:c,y:l,placement:f,rects:u,platform:p,elements:g}=o;if(null==s)return{};const m=r(a),h={x:c,y:l},b=i(f),v=n(b),w=await p.getDimensions(s),y="y"===b,x=y?"top":"left",E=y?"bottom":"right",L=y?"clientHeight":"clientWidth",T=u.reference[v]+u.reference[b]-h[b]-u.floating[v],A=h[b]-u.reference[b],_=await(null==p.getOffsetParent?void 0:p.getOffsetParent(s));let R=_?_[L]:0;R&&await(null==p.isElement?void 0:p.isElement(_))||(R=g.floating[L]||u.floating[v]);const P=T/2-A/2,O=m[x],D=R-w[v]-m[E],M=R/2-w[v]/2+P,k=d(O,M,D),C=null!=e(f)&&M!=k&&u.reference[v]/2-(Me(n)===t)),...i.filter((n=>e(n)!==t))]:i.filter((t=>o(t)===t))).filter((o=>!t||e(o)===t||!!n&&v(o)!==o))}(m||null,w,b):b,E=await c(n,y),L=(null==(i=l.autoPlacement)?void 0:i.index)||0,T=x[L];if(null==T)return{};const{main:A,cross:_}=h(T,a,await(null==d.isRTL?void 0:d.isRTL(u.floating)));if(f!==T)return{reset:{placement:x[0]}};const R=[E[o(T)],E[A],E[_]],P=[...(null==(s=l.autoPlacement)?void 0:s.overflows)||[],{placement:T,overflows:R}],O=x[L+1];if(O)return{data:{index:L+1,overflows:P},reset:{placement:O}};const D=P.map((t=>{const n=e(t.placement);return[t.placement,n&&g?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1])),M=(null==(r=D.filter((t=>t[2].slice(0,e(t[0])?2:3).every((t=>t<=0))))[0])?void 0:r[0])||D[0][0];return M!==f?{data:{index:L+1,overflows:P},reset:{placement:M}}:{}}}},t.computePosition=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:a}=n,c=r.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(e));let f=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:u}=s(f,o,l),p=o,g={},m=0;for(let n=0;nt+"-"+r)),n&&(a=a.concat(a.map(v)))),a}(l,y,w,T));const _=[l,...A],R=await c(n,x),P=[];let O=(null==(i=r.flip)?void 0:i.overflows)||[];if(u&&P.push(R[E]),p){const{main:t,cross:e}=h(s,a,T);P.push(R[t],R[e])}if(O=[...O,{placement:s,overflows:P}],!P.every((t=>t<=0))){var D,M;const t=((null==(D=r.flip)?void 0:D.index)||0)+1,e=_[t];if(e)return{data:{index:t,overflows:O},reset:{placement:e}};let n=null==(M=O.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:M.placement;if(!n)switch(b){case"bestFit":{var k;const t=null==(k=O.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:k[0];t&&(n=t);break}case"initialPlacement":n=l}if(s!==n)return{reset:{placement:n}}}return{}}}},t.hide=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{strategy:n="referenceHidden",...o}=t,{rects:i}=e;switch(n){case"referenceHidden":{const t=w(await c(e,{...o,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:y(t)}}}case"escaped":{const t=w(await c(e,{...o,altBoundary:!0}),i.floating);return{data:{escapedOffsets:t,escaped:y(t)}}}default:return{}}}}},t.inline=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:s,rects:c,platform:d,strategy:u}=e,{padding:p=2,x:g,y:m}=t,h=a(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({rect:c.reference,offsetParent:await(null==d.getOffsetParent?void 0:d.getOffsetParent(s.floating)),strategy:u}):c.reference),b=await(null==d.getClientRects?void 0:d.getClientRects(s.reference))||[],v=r(p),w=await d.getElementRects({reference:{getBoundingClientRect:function(){if(2===b.length&&b[0].left>b[1].right&&null!=g&&null!=m)return b.find((t=>g>t.left-v.left&&gt.top-v.top&&m=2){if("x"===i(n)){const t=b[0],e=b[b.length-1],i="top"===o(n),s=t.top,r=e.bottom,a=i?t.left:e.left,c=i?t.right:e.right;return{top:s,bottom:r,left:a,right:c,width:c-a,height:r-s,x:a,y:s}}const t="left"===o(n),e=f(...b.map((t=>t.right))),s=l(...b.map((t=>t.left))),r=b.filter((n=>t?n.left===s:n.right===e)),a=r[0].top,c=r[r.length-1].bottom;return{top:a,bottom:c,left:s,right:e,width:e-s,height:c-a,x:s,y:a}}return h}},floating:s.floating,strategy:u});return c.reference.x!==w.reference.x||c.reference.y!==w.reference.y||c.reference.width!==w.reference.width||c.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}},t.limitShift=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:s,placement:r,rects:a,middlewareData:c}=e,{offset:l=0,mainAxis:f=!0,crossAxis:d=!0}=t,u={x:n,y:s},p=i(r),g=x(p);let m=u[p],h=u[g];const b="function"==typeof l?l(e):l,v="number"==typeof b?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(f){const t="y"===p?"height":"width",e=a.reference[p]-a.floating[t]+v.mainAxis,n=a.reference[p]+a.reference[t]-v.mainAxis;mn&&(m=n)}if(d){var w,y;const t="y"===p?"width":"height",e=["top","left"].includes(o(r)),n=a.reference[g]-a.floating[t]+(e&&(null==(w=c.offset)?void 0:w[g])||0)+(e?0:v.crossAxis),i=a.reference[g]+a.reference[t]+(e?0:(null==(y=c.offset)?void 0:y[g])||0)-(e?v.crossAxis:0);hi&&(h=i)}return{[p]:m,[g]:h}}}},t.offset=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(n){const{x:s,y:r}=n,a=await async function(t,n){const{placement:s,platform:r,elements:a}=t,c=await(null==r.isRTL?void 0:r.isRTL(a.floating)),l=o(s),f=e(s),d="x"===i(s),u=["left","top"].includes(l)?-1:1,p=c&&d?-1:1,g="function"==typeof n?n(t):n;let{mainAxis:m,crossAxis:h,alignmentAxis:b}="number"==typeof g?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...g};return f&&"number"==typeof b&&(h="end"===f?-1*b:b),d?{x:h*p,y:m*u}:{x:m*u,y:h*p}}(n,t);return{x:s+a.x,y:r+a.y,data:a}}}},t.rectToClientRect=a,t.shift=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:s,placement:r}=e,{mainAxis:a=!0,crossAxis:l=!1,limiter:f={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...u}=t,p={x:n,y:s},g=await c(e,u),m=i(o(r)),h=x(m);let b=p[m],v=p[h];if(a){const t="y"===m?"bottom":"right";b=d(b+g["y"===m?"top":"left"],b,b-g[t])}if(l){const t="y"===h?"bottom":"right";v=d(v+g["y"===h?"top":"left"],v,v-g[t])}const w=f.fn({...e,[m]:b,[h]:v});return{...w,data:{x:w.x-n,y:w.y-s}}}}},t.size=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(n){const{placement:s,rects:r,platform:a,elements:d}=n,{apply:u=(()=>{}),...p}=t,g=await c(n,p),m=o(s),h=e(s),b="x"===i(s),{width:v,height:w}=r.floating;let y,x;"top"===m||"bottom"===m?(y=m,x=h===(await(null==a.isRTL?void 0:a.isRTL(d.floating))?"start":"end")?"left":"right"):(x=m,y="end"===h?"top":"bottom");const E=w-g[y],L=v-g[x];let T=E,A=L;if(b?A=l(v-g.right-g.left,L):T=l(w-g.bottom-g.top,E),!n.middlewareData.shift&&!h){const t=f(g.left,0),e=f(g.right,0),n=f(g.top,0),o=f(g.bottom,0);b?A=v-2*(0!==t||0!==e?t+e:f(g.left,g.right)):T=w-2*(0!==n||0!==o?n+o:f(g.top,g.bottom))}await u({...n,availableWidth:A,availableHeight:T});const _=await a.getDimensions(d.floating);return v!==_.width||w!==_.height?{reset:{rects:!0}}:{}}}},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).TocasFloatingUICore={}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@floating-ui/core")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).TocasFloatingUIDOM={},t.TocasFloatingUICore)}(this,(function(t,e){"use strict";function n(t){var e;return(null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function o(t){return n(t).getComputedStyle(t)}const i=Math.min,s=Math.max,r=Math.round;function a(t){const e=o(t);let n=parseFloat(e.width),i=parseFloat(e.height);const s=t.offsetWidth,a=t.offsetHeight,c=r(n)!==s||r(i)!==a;return c&&(n=s,i=a),{width:n,height:i,fallback:c}}function c(t){return p(t)?(t.nodeName||"").toLowerCase():""}let l;function f(){if(l)return l;const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?(l=t.brands.map((t=>t.brand+"/"+t.version)).join(" "),l):navigator.userAgent}function d(t){return t instanceof n(t).HTMLElement}function u(t){return t instanceof n(t).Element}function p(t){return t instanceof n(t).Node}function g(t){return"undefined"!=typeof ShadowRoot&&(t instanceof n(t).ShadowRoot||t instanceof ShadowRoot)}function m(t){const{overflow:e,overflowX:n,overflowY:i,display:s}=o(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(s)}function h(t){return["table","td","th"].includes(c(t))}function b(t){const e=/firefox/i.test(f()),n=o(t),i=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!i&&"none"!==i||e&&"filter"===n.willChange||e&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((t=>n.willChange.includes(t)))||["paint","layout","strict","content"].some((t=>{const e=n.contain;return null!=e&&e.includes(t)}))}function v(){return/^((?!chrome|android).)*safari/i.test(f())}function w(t){return["html","body","#document"].includes(c(t))}function y(t){return u(t)?t:t.contextElement}const x={x:1,y:1};function E(t){const e=y(t);if(!d(e))return x;const n=e.getBoundingClientRect(),{width:o,height:i,fallback:s}=a(e);let c=(s?r(n.width):n.width)/o,l=(s?r(n.height):n.height)/i;return c&&Number.isFinite(c)||(c=1),l&&Number.isFinite(l)||(l=1),{x:c,y:l}}function L(t,o,i,s){var r,a;void 0===o&&(o=!1),void 0===i&&(i=!1);const c=t.getBoundingClientRect(),l=y(t);let f=x;o&&(s?u(s)&&(f=E(s)):f=E(t));const d=l?n(l):window,p=v()&&i;let g=(c.left+(p&&(null==(r=d.visualViewport)?void 0:r.offsetLeft)||0))/f.x,m=(c.top+(p&&(null==(a=d.visualViewport)?void 0:a.offsetTop)||0))/f.y,h=c.width/f.x,b=c.height/f.y;if(l){const t=n(l),e=s&&u(s)?n(s):s;let o=t.frameElement;for(;o&&s&&e!==t;){const t=E(o),e=o.getBoundingClientRect(),i=getComputedStyle(o);e.x+=(o.clientLeft+parseFloat(i.paddingLeft))*t.x,e.y+=(o.clientTop+parseFloat(i.paddingTop))*t.y,g*=t.x,m*=t.y,h*=t.x,b*=t.y,g+=e.x,m+=e.y,o=n(o).frameElement}}return e.rectToClientRect({width:h,height:b,x:g,y:m})}function T(t){return((p(t)?t.ownerDocument:t.document)||window.document).documentElement}function A(t){return u(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function _(t){return L(T(t)).left+A(t).scrollLeft}function R(t){if("html"===c(t))return t;const e=t.assignedSlot||t.parentNode||g(t)&&t.host||T(t);return g(e)?e.host:e}function P(t){const e=R(t);return w(e)?e.ownerDocument.body:d(e)&&m(e)?e:P(e)}function O(t,e){var o;void 0===e&&(e=[]);const i=P(t),s=i===(null==(o=t.ownerDocument)?void 0:o.body),r=n(i);return s?e.concat(r,r.visualViewport||[],m(i)?i:[]):e.concat(i,O(i))}function D(t,i,r){let a;if("viewport"===i)a=function(t,e){const o=n(t),i=T(t),s=o.visualViewport;let r=i.clientWidth,a=i.clientHeight,c=0,l=0;if(s){r=s.width,a=s.height;const t=v();(!t||t&&"fixed"===e)&&(c=s.offsetLeft,l=s.offsetTop)}return{width:r,height:a,x:c,y:l}}(t,r);else if("document"===i)a=function(t){const e=T(t),n=A(t),i=t.ownerDocument.body,r=s(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),a=s(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let c=-n.scrollLeft+_(t);const l=-n.scrollTop;return"rtl"===o(i).direction&&(c+=s(e.clientWidth,i.clientWidth)-r),{width:r,height:a,x:c,y:l}}(T(t));else if(u(i))a=function(t,e){const n=L(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=d(t)?E(t):{x:1,y:1};return{width:t.clientWidth*s.x,height:t.clientHeight*s.y,x:i*s.x,y:o*s.y}}(i,r);else{const e={...i};if(v()){var c,l;const o=n(t);e.x-=(null==(c=o.visualViewport)?void 0:c.offsetLeft)||0,e.y-=(null==(l=o.visualViewport)?void 0:l.offsetTop)||0}a=e}return e.rectToClientRect(a)}function M(t,e){return d(t)&&"fixed"!==o(t).position?e?e(t):t.offsetParent:null}function k(t,e){const i=n(t);let s=M(t,e);for(;s&&h(s)&&"static"===o(s).position;)s=M(s,e);return s&&("html"===c(s)||"body"===c(s)&&"static"===o(s).position&&!b(s))?i:s||function(t){let e=R(t);for(;d(e)&&!w(e);){if(b(e))return e;e=R(e)}return null}(t)||i}function C(t,e,n){const o=d(e),i=T(e),s=L(t,!0,"fixed"===n,e);let r={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(o||!o&&"fixed"!==n)if(("body"!==c(e)||m(i))&&(r=A(e)),d(e)){const t=L(e,!0);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&(a.x=_(i));return{x:s.left+r.scrollLeft-a.x,y:s.top+r.scrollTop-a.y,width:s.width,height:s.height}}const $={getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:r,strategy:a}=t;const l="clippingAncestors"===n?function(t,e){const n=e.get(t);if(n)return n;let i=O(t).filter((t=>u(t)&&"body"!==c(t))),s=null;const r="fixed"===o(t).position;let a=r?R(t):t;for(;u(a)&&!w(a);){const t=o(a),e=b(a);"fixed"===t.position?s=null:(r?e||s:e||"static"!==t.position||!s||!["absolute","fixed"].includes(s.position))?s=t:i=i.filter((t=>t!==a)),a=R(a)}return e.set(t,i),i}(e,this._c):[].concat(n),f=[...l,r],d=f[0],p=f.reduce(((t,n)=>{const o=D(e,n,a);return t.top=s(o.top,t.top),t.right=i(o.right,t.right),t.bottom=i(o.bottom,t.bottom),t.left=s(o.left,t.left),t}),D(e,d,a));return{width:p.right-p.left,height:p.bottom-p.top,x:p.left,y:p.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=d(n),s=T(n);if(n===s)return e;let r={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((i||!i&&"fixed"!==o)&&(("body"!==c(n)||m(s))&&(r=A(n)),d(n))){const t=L(n);a=E(n),l.x=t.x+n.clientLeft,l.y=t.y+n.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-r.scrollLeft*a.x+l.x,y:e.y*a.y-r.scrollTop*a.y+l.y}},isElement:u,getDimensions:function(t){return d(t)?a(t):t.getBoundingClientRect()},getOffsetParent:k,getDocumentElement:T,getScale:E,async getElementRects(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||k,s=this.getDimensions;return{reference:C(e,await i(n),o),floating:{x:0,y:0,...await s(n)}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>"rtl"===o(t).direction};Object.defineProperty(t,"arrow",{enumerable:!0,get:function(){return e.arrow}}),Object.defineProperty(t,"autoPlacement",{enumerable:!0,get:function(){return e.autoPlacement}}),Object.defineProperty(t,"detectOverflow",{enumerable:!0,get:function(){return e.detectOverflow}}),Object.defineProperty(t,"flip",{enumerable:!0,get:function(){return e.flip}}),Object.defineProperty(t,"hide",{enumerable:!0,get:function(){return e.hide}}),Object.defineProperty(t,"inline",{enumerable:!0,get:function(){return e.inline}}),Object.defineProperty(t,"limitShift",{enumerable:!0,get:function(){return e.limitShift}}),Object.defineProperty(t,"offset",{enumerable:!0,get:function(){return e.offset}}),Object.defineProperty(t,"shift",{enumerable:!0,get:function(){return e.shift}}),Object.defineProperty(t,"size",{enumerable:!0,get:function(){return e.size}}),t.autoUpdate=function(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=!0,animationFrame:a=!1}=o,c=i&&!a,l=c||s?[...u(t)?O(t):t.contextElement?O(t.contextElement):[],...O(e)]:[];l.forEach((t=>{c&&t.addEventListener("scroll",n,{passive:!0}),s&&t.addEventListener("resize",n)}));let f,d=null;if(r){let o=!0;d=new ResizeObserver((()=>{o||n(),o=!1})),u(t)&&!a&&d.observe(t),u(t)||!t.contextElement||a||d.observe(t.contextElement),d.observe(e)}let p=a?L(t):null;return a&&function e(){const o=L(t);!p||o.x===p.x&&o.y===p.y&&o.width===p.width&&o.height===p.height||n(),p=o,f=requestAnimationFrame(e)}(),n(),()=>{var t;l.forEach((t=>{c&&t.removeEventListener("scroll",n),s&&t.removeEventListener("resize",n)})),null==(t=d)||t.disconnect(),d=null,a&&cancelAnimationFrame(f)}},t.computePosition=(t,n,o)=>{const i=new Map,s={platform:$,...o},r={...s.platform,_c:i};return e.computePosition(t,n,{...s,platform:r})},t.getOverflowAncestors=O,t.platform=$,Object.defineProperty(t,"__esModule",{value:!0})}));function n(t,e,n,o){var i=t.closest(`[class*="${n}"]`)||document,s=Array.from(i.querySelectorAll(`[${o}="${e}"]`)).filter((t=>t.closest(`[class*="${n}"]`)||document===i));return s.length>0?s:i===document?[]:this.searchScopeTargets(i.parentNode,e,n,o)}var o=new class{constructor(){this.resize_observer=new ResizeObserver((t=>{t.forEach((t=>{this.getAllContaineredElements(t.target).forEach((t=>{this.check(t)}))}))}))}attributeMutation(t){this.isContainer(t.target)?this.resize_observer.observe(t.target):this.resize_observer.unobserve(t.target)}addedNodeMutation(t){this.isResponsiveElement(t)&&this.check(t),this.isContainer(t)&&this.resize_observer.observe(t)}getAllContaineredElements(t){return t.querySelectorAll(tocas.config.strict_responsive?'[class^="@"]:is([class*=":is-"],[class*=":u-"])':'[class^="@"][class*=":"]')}getAllResponsiveElements(t){return t.querySelectorAll(tocas.config.strict_responsive?'[class*=":is-"],[class*=":u-"]':'[class*=":"]')}isContainer(t){return t.matches(`[class~="${tocas.config.scopes.container}"]`)}isResponsiveElement(t){return t.matches(tocas.config.strict_responsive?'[class*=":is-"],[class*=":u-"]':'[class*=":"]')}hasResponsiveClass(t){return tocas.config.strict_responsive?t.includes(":is-")||t.includes(":u-"):t.includes(":")}windowResize(){this.getAllResponsiveElements(document).forEach((t=>{this.check(t)}))}unit(t){return parseInt(t,10)||0}breakpointSize(t,e){var n=window.getComputedStyle(e);return{min:this.unit(n.getPropertyValue(`--ts-breakpoint-${t}-min`)),max:this.unit(n.getPropertyValue(`--ts-breakpoint-${t}-max`))}}rule(t,e){var n=t.startsWith("@"),o=t.endsWith("+"),i=t.endsWith("-"),s=t.includes("[");n&&(t=t.substring(1)),(o||i)&&(t=t.substring(0,t.length-1)),s&&(t=t.substring(1).substring(0,t.length-1));var[r,a]=t.split("-");if(s)return o?[this.unit(r),99999]:i?[0,this.unit(r)]:[this.unit(r),this.unit(a)];var c=this.breakpointSize(r,e);return void 0!==a?[c.min,this.breakpointSize(a,e).max]:o?[c.min,99999]:i?[0,c.max]:[c.min,c.max]}compile(t){return Array.from(t.classList).filter((t=>this.hasResponsiveClass(t))).map((e=>{var[n,o]=e.split(":"),[i,s]=this.rule(n,t);return{min:i,max:s,width:n.startsWith("@")?t.closest(`[class~="${tocas.config.scopes.container}"]`).getBoundingClientRect().width:window.innerWidth,target_class:o}}))}check(t){var e=[],n=this.compile(t);n.forEach((({width:n,min:o,max:i,target_class:s})=>{n>=o&&n<=i&&(t.classList.add(s),e=[...e,s])})),n.forEach((({width:n,min:o,max:i,target_class:s})=>{(ni)&&!e.includes(s)&&t.classList.remove(s)}))}},i=new class{constructor(){}attributeMutation(t){}addedNodeMutation(t){this.isTab(t)&&(this.bindEventListener(t),this.initialTab(t))}isTab(t){return t.matches(`[${tocas.config.attributes.tab}]`)}isActiveTab(t){return t.classList.contains(tocas.config.classes.tab_active)}initialTab(t){this.isActiveTab(t)||n(t,t.getAttribute(tocas.config.attributes.tab),tocas.config.scopes.tab,tocas.config.attributes.tab_name).forEach((t=>{t.classList.add(tocas.config.classes.hidden)}))}toggle(t){var e=t.target.closest(`[${tocas.config.attributes.tab}]`),n=e.getAttribute(tocas.config.attributes.tab),o=e.closest(`[class*="${tocas.config.scopes.tab}"]`)||document,i=e.closest(".ts-tab"),s=[];i.querySelectorAll(`[${tocas.config.attributes.tab}]`).forEach((t=>{t.getAttribute(tocas.config.attributes.tab)===n?t.classList.add(tocas.config.classes.tab_active):(s=[...s,t.getAttribute(tocas.config.attributes.tab)],t.classList.remove(tocas.config.classes.tab_active))})),o.querySelectorAll(`[${tocas.config.attributes.tab_name}]`).forEach((t=>{var e=t.closest(`[class*="${tocas.config.scopes.tab}"]`)||document;o===e&&(t.getAttribute(tocas.config.attributes.tab_name)===n?t.classList.remove(tocas.config.classes.hidden):s.includes(t.getAttribute(tocas.config.attributes.tab_name))&&t.classList.add(tocas.config.classes.hidden))}))}bindEventListener(t){t.removeEventListener("click",this.toggle),t.addEventListener("click",this.toggle)}},s=new class{attributeMutation(t){}addedNodeMutation(t){this.isToggle(t)&&this.bindEventListener(t)}isToggle(t){return t.matches(`[${tocas.config.attributes.toggle}]`)}toggle(t){var e=t.target.closest(`[${tocas.config.attributes.toggle}]`),[o,i]=e.getAttribute(tocas.config.attributes.toggle).split(":");n(e,o,tocas.config.scopes.toggle,tocas.config.attributes.toggle_name).forEach((t=>{t.classList.toggle(i)}))}bindEventListener(t){t.removeEventListener("click",this.toggle.bind(this)),t.addEventListener("click",this.toggle.bind(this))}},r=new class{attributeMutation(t){}addedNodeMutation(t){this.isDropdownTrigger(t)&&this.bindEventListener(t),this.isDropdown(t)&&this.bindItemEventListener(t)}isDropdownTrigger(t){return t.matches(`[${tocas.config.attributes.dropdown}]`)}isDropdown(t){return t.matches(`.ts-dropdown[${tocas.config.attributes.dropdown_name}]`)}position(t){return t.getAttribute(tocas.config.attributes.dropdown_position)||"bottom"}windowClick(t){var e=t.target.closest(`[${tocas.config.attributes.dropdown}]`),o=t.target.closest(`[${tocas.config.attributes.dropdown_name}]`);if(null===e&&null===o&&document.querySelectorAll(`.ts-dropdown[${tocas.config.attributes.dropdown_name}]`).forEach((t=>{this.closeDropdown(t)})),null!==e){var i=e.getAttribute(tocas.config.attributes.dropdown),s=n(e,i,tocas.config.scopes.dropdown,tocas.config.attributes.dropdown_name)[0];this.closeDropdownsExcept(s)}null!==o&&this.closeDropdownsExcept(o)}closeDropdownsExcept(t){document.querySelectorAll(`.ts-dropdown[${tocas.config.attributes.dropdown_name}]`).forEach((e=>{e!==t&&this.closeDropdown(e)}))}bindEventListener(t){t.removeEventListener("click",this.clickEventListener.bind(this)),t.addEventListener("click",this.clickEventListener.bind(this))}bindItemEventListener(t){t.removeEventListener("click",this.itemClickEventListener.bind(this)),t.addEventListener("click",this.itemClickEventListener.bind(this))}closeDropdown(t){(t.classList.contains(".ts-dropdown")||t.classList.contains("is-visible"))&&(t.classList.remove("is-visible"),void 0!==t.tocas_dropdown&&(t.tocas_dropdown(),t.tocas_dropdown=void 0,t.style.removeProperty("--ts-dropdown-min-width"),t.style.removeProperty("--ts-dropdown-position")))}itemClickEventListener(t){var e=t.target.closest(`.ts-dropdown[${tocas.config.attributes.dropdown_name}]`);null!==t.target.closest(".item")&&this.closeDropdown(e)}clickEventListener(t){var e=t.target.closest(`[${tocas.config.attributes.dropdown}]`),o=e.getAttribute(tocas.config.attributes.dropdown),i=n(e,o,tocas.config.scopes.dropdown,tocas.config.attributes.dropdown_name)[0],s=this.position(i);void 0!==i.tocas_dropdown&&(i.tocas_dropdown(),i.tocas_dropdown=void 0,i.style.removeProperty("--ts-dropdown-min-width"),i.style.removeProperty("--ts-dropdown-position")),i.classList.toggle("is-visible"),i.classList.contains("is-visible")&&(i.style.setProperty("--ts-dropdown-min-width",`${e.getBoundingClientRect().width}px`),i.style.setProperty("--ts-dropdown-position","fixed"),i.tocas_dropdown=TocasFloatingUIDOM.autoUpdate(e,i,(()=>{TocasFloatingUIDOM.computePosition(e,i,{strategy:"fixed",placement:s,middleware:[TocasFloatingUIDOM.flip({crossAxis:!1}),TocasFloatingUIDOM.offset(8),TocasFloatingUIDOM.shift()]}).then((({x:t,y:e})=>{Object.assign(i.style,{left:`${t}px`,top:`${e}px`})}))})))}},a=new class{attributeMutation(t){this.isTooltip(t.target)&&this.bindEventListener(t.target)}addedNodeMutation(t){this.isTooltip(t)&&this.bindEventListener(t)}isTooltip(t){return t.matches(`[${tocas.config.attributes.tooltip}]`)}bindEventListener(t){t.tocas_tooltip_timer=null,this.enterEventListener(t),this.leaveEventListener(t)}delay(t){var e=t.getAttribute(tocas.config.attributes.tooltip_delay);return"0"===e?0:parseInt(e,10)||200}position(t){return t.getAttribute(tocas.config.attributes.tooltip_position)||"bottom"}enterEventListener(t){t.addEventListener("mouseover",(e=>{window.matchMedia("(pointer: coarse)").matches||null===t.tocas_tooltip_timer&&void 0===t.tocas_tooltip&&(t.tocas_tooltip_timer=setTimeout((()=>{this.showTooltip(t)}),this.delay(t)+1))}))}leaveEventListener(t){t.addEventListener("mouseleave",(e=>{e.target===t&&(void 0!==t.tocas_tooltip&&(t.tocas_tooltip(),t.tocas_tooltip=void 0),null!==t.tocas_tooltip_timer&&(clearTimeout(t.tocas_tooltip_timer),t.tocas_tooltip_timer=null),document.querySelectorAll(".ts-tooltip").forEach((t=>{t.remove()})))}))}createTooltip(t,e){var n=document.createElement("div");return n.innerText=t.getAttribute(tocas.config.attributes.tooltip),n.classList.add("ts-tooltip",tocas.config.classes.tooltip_visible),n.appendChild(e),n}createArrow(){var t=document.createElement("div");return t.classList.add("arrow"),t}showTooltip(t){var e=this.position(t),n=this.createArrow(),o=this.createTooltip(t,n);document.body.appendChild(o),t.tocas_tooltip=TocasFloatingUIDOM.autoUpdate(t,o,(()=>{TocasFloatingUIDOM.computePosition(t,o,{strategy:"fixed",placement:e,middleware:[TocasFloatingUIDOM.flip({crossAxis:!1}),TocasFloatingUIDOM.offset({crossAxis:-15,mainAxis:10}),TocasFloatingUIDOM.shift(),TocasFloatingUIDOM.arrow({element:n})]}).then((({middlewareData:t,x:e,y:i,placement:s})=>{if(Object.assign(o.style,{left:`${e}px`,top:`${i}px`}),t.arrow){const{x:e}=t.arrow;n.style.setProperty("--ts-tooltip-x",null!=e?`${e}px`:"0")}s&&(o.classList.remove("is-top","is-top-start","is-top-end","is-bottom","is-bottom-start","is-bottom-end"),o.classList.add(`is-${s}`))}))}))}};new MutationObserver((function(t){t.forEach((function(t){"attributes"===t.type?(o.attributeMutation(t),i.attributeMutation(t),s.attributeMutation(t),r.attributeMutation(t),a.attributeMutation(t)):t.addedNodes&&t.addedNodes.length&&t.addedNodes.forEach((function(t){t.nodeType===Node.ELEMENT_NODE&&(o.addedNodeMutation(t),i.addedNodeMutation(t),s.addedNodeMutation(t),r.addedNodeMutation(t),a.addedNodeMutation(t))}))}))})).observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),window.addEventListener("resize",(t=>{o.windowResize(t)})),window.addEventListener("click",(t=>{r.windowClick(t)}))}(); +window.tocas={config:{strict_responsive:!1,attributes:{tab:"data-tab",tab_name:"data-name",toggle:"data-toggle",toggle_name:"data-name",dropdown:"data-dropdown",dropdown_name:"data-name",dropdown_position:"data-position",tooltip:"data-tooltip",tooltip_position:"data-position",tooltip_delay:"data-delay"},scopes:{tab:"@scope",toggle:"@scope",tab:"@scope",dropdown:"@scope",container:"@container"},classes:{hidden:"u-hidden",tab_active:"is-active",tooltip_visible:"is-visible",tab:"ts-tab"}}},function(){var t,e;t=this,e=function(t){"use strict";function e(t){return t.split("-")[1]}function n(t){return"y"===t?"height":"width"}function o(t){return t.split("-")[0]}function i(t){return["top","bottom"].includes(o(t))?"x":"y"}function s(t,s,r){let{reference:a,floating:c}=t;const l=a.x+a.width/2-c.width/2,d=a.y+a.height/2-c.height/2,f=i(s),u=n(f),p=a[u]/2-c[u]/2,g="x"===f;let m;switch(o(s)){case"top":m={x:l,y:a.y-c.height};break;case"bottom":m={x:l,y:a.y+a.height};break;case"right":m={x:a.x+a.width,y:d};break;case"left":m={x:a.x-c.width,y:d};break;default:m={x:a.x,y:a.y}}switch(e(s)){case"start":m[f]-=p*(r&&g?-1:1);break;case"end":m[f]+=p*(r&&g?-1:1)}return m}function r(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function a(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function c(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:s,rects:c,elements:l,strategy:d}=t,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:g=!1,padding:m=0}=e,h=r(m),b=l[g?"floating"===p?"reference":"floating":p],v=a(await s.getClippingRect({element:null==(n=await(null==s.isElement?void 0:s.isElement(b)))||n?b:b.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(l.floating)),boundary:f,rootBoundary:u,strategy:d})),w="floating"===p?{...c.floating,x:o,y:i}:c.reference,y=await(null==s.getOffsetParent?void 0:s.getOffsetParent(l.floating)),x=await(null==s.isElement?void 0:s.isElement(y))&&await(null==s.getScale?void 0:s.getScale(y))||{x:1,y:1},E=a(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:y,strategy:d}):w);return{top:(v.top-E.top+h.top)/x.y,bottom:(E.bottom-v.bottom+h.bottom)/x.y,left:(v.left-E.left+h.left)/x.x,right:(E.right-v.right+h.right)/x.x}}const l=Math.min,d=Math.max;function f(t,e,n){return d(t,l(e,n))}const u=["top","right","bottom","left"],p=u.reduce(((t,e)=>t.concat(e,e+"-start",e+"-end")),[]),g={left:"right",right:"left",bottom:"top",top:"bottom"};function m(t){return t.replace(/left|right|bottom|top/g,(t=>g[t]))}function h(t,o,s){void 0===s&&(s=!1);const r=e(t),a=i(t),c=n(a);let l="x"===a?r===(s?"end":"start")?"right":"left":"start"===r?"bottom":"top";return o.reference[c]>o.floating[c]&&(l=m(l)),{main:l,cross:m(l)}}const b={start:"end",end:"start"};function v(t){return t.replace(/start|end/g,(t=>b[t]))}function w(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function y(t){return u.some((e=>t[e]>=0))}function x(t){return"x"===t?"y":"x"}t.arrow=t=>({name:"arrow",options:t,async fn(o){const{element:s,padding:a=0}=t||{},{x:c,y:l,placement:d,rects:u,platform:p,elements:g}=o;if(null==s)return{};const m=r(a),h={x:c,y:l},b=i(d),v=n(b),w=await p.getDimensions(s),y="y"===b,x=y?"top":"left",E=y?"bottom":"right",L=y?"clientHeight":"clientWidth",T=u.reference[v]+u.reference[b]-h[b]-u.floating[v],A=h[b]-u.reference[b],_=await(null==p.getOffsetParent?void 0:p.getOffsetParent(s));let R=_?_[L]:0;R&&await(null==p.isElement?void 0:p.isElement(_))||(R=g.floating[L]||u.floating[v]);const P=T/2-A/2,O=m[x],M=R-w[v]-m[E],D=R/2-w[v]/2+P,k=f(O,D,M),C=null!=e(d)&&D!=k&&u.reference[v]/2-(De(n)===t)),...i.filter((n=>e(n)!==t))]:i.filter((t=>o(t)===t))).filter((o=>!t||e(o)===t||!!n&&v(o)!==o))}(m||null,w,b):b,E=await c(n,y),L=(null==(i=l.autoPlacement)?void 0:i.index)||0,T=x[L];if(null==T)return{};const{main:A,cross:_}=h(T,a,await(null==f.isRTL?void 0:f.isRTL(u.floating)));if(d!==T)return{reset:{placement:x[0]}};const R=[E[o(T)],E[A],E[_]],P=[...(null==(s=l.autoPlacement)?void 0:s.overflows)||[],{placement:T,overflows:R}],O=x[L+1];if(O)return{data:{index:L+1,overflows:P},reset:{placement:O}};const M=P.map((t=>{const n=e(t.placement);return[t.placement,n&&g?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1])),D=(null==(r=M.filter((t=>t[2].slice(0,e(t[0])?2:3).every((t=>t<=0))))[0])?void 0:r[0])||M[0][0];return D!==d?{data:{index:L+1,overflows:P},reset:{placement:D}}:{}}}},t.computePosition=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:a}=n,c=r.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(e));let d=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=s(d,o,l),p=o,g={},m=0;for(let n=0;nt+"-"+r)),n&&(a=a.concat(a.map(v)))),a}(l,y,w,T));const _=[l,...A],R=await c(n,x),P=[];let O=(null==(i=r.flip)?void 0:i.overflows)||[];if(u&&P.push(R[E]),p){const{main:t,cross:e}=h(s,a,T);P.push(R[t],R[e])}if(O=[...O,{placement:s,overflows:P}],!P.every((t=>t<=0))){var M,D;const t=((null==(M=r.flip)?void 0:M.index)||0)+1,e=_[t];if(e)return{data:{index:t,overflows:O},reset:{placement:e}};let n=null==(D=O.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:D.placement;if(!n)switch(b){case"bestFit":{var k;const t=null==(k=O.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:k[0];t&&(n=t);break}case"initialPlacement":n=l}if(s!==n)return{reset:{placement:n}}}return{}}}},t.hide=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{strategy:n="referenceHidden",...o}=t,{rects:i}=e;switch(n){case"referenceHidden":{const t=w(await c(e,{...o,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:y(t)}}}case"escaped":{const t=w(await c(e,{...o,altBoundary:!0}),i.floating);return{data:{escapedOffsets:t,escaped:y(t)}}}default:return{}}}}},t.inline=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:s,rects:c,platform:f,strategy:u}=e,{padding:p=2,x:g,y:m}=t,h=a(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({rect:c.reference,offsetParent:await(null==f.getOffsetParent?void 0:f.getOffsetParent(s.floating)),strategy:u}):c.reference),b=await(null==f.getClientRects?void 0:f.getClientRects(s.reference))||[],v=r(p),w=await f.getElementRects({reference:{getBoundingClientRect:function(){if(2===b.length&&b[0].left>b[1].right&&null!=g&&null!=m)return b.find((t=>g>t.left-v.left&&gt.top-v.top&&m=2){if("x"===i(n)){const t=b[0],e=b[b.length-1],i="top"===o(n),s=t.top,r=e.bottom,a=i?t.left:e.left,c=i?t.right:e.right;return{top:s,bottom:r,left:a,right:c,width:c-a,height:r-s,x:a,y:s}}const t="left"===o(n),e=d(...b.map((t=>t.right))),s=l(...b.map((t=>t.left))),r=b.filter((n=>t?n.left===s:n.right===e)),a=r[0].top,c=r[r.length-1].bottom;return{top:a,bottom:c,left:s,right:e,width:e-s,height:c-a,x:s,y:a}}return h}},floating:s.floating,strategy:u});return c.reference.x!==w.reference.x||c.reference.y!==w.reference.y||c.reference.width!==w.reference.width||c.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}},t.limitShift=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:s,placement:r,rects:a,middlewareData:c}=e,{offset:l=0,mainAxis:d=!0,crossAxis:f=!0}=t,u={x:n,y:s},p=i(r),g=x(p);let m=u[p],h=u[g];const b="function"==typeof l?l(e):l,v="number"==typeof b?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(d){const t="y"===p?"height":"width",e=a.reference[p]-a.floating[t]+v.mainAxis,n=a.reference[p]+a.reference[t]-v.mainAxis;mn&&(m=n)}if(f){var w,y;const t="y"===p?"width":"height",e=["top","left"].includes(o(r)),n=a.reference[g]-a.floating[t]+(e&&(null==(w=c.offset)?void 0:w[g])||0)+(e?0:v.crossAxis),i=a.reference[g]+a.reference[t]+(e?0:(null==(y=c.offset)?void 0:y[g])||0)-(e?v.crossAxis:0);hi&&(h=i)}return{[p]:m,[g]:h}}}},t.offset=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(n){const{x:s,y:r}=n,a=await async function(t,n){const{placement:s,platform:r,elements:a}=t,c=await(null==r.isRTL?void 0:r.isRTL(a.floating)),l=o(s),d=e(s),f="x"===i(s),u=["left","top"].includes(l)?-1:1,p=c&&f?-1:1,g="function"==typeof n?n(t):n;let{mainAxis:m,crossAxis:h,alignmentAxis:b}="number"==typeof g?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...g};return d&&"number"==typeof b&&(h="end"===d?-1*b:b),f?{x:h*p,y:m*u}:{x:m*u,y:h*p}}(n,t);return{x:s+a.x,y:r+a.y,data:a}}}},t.rectToClientRect=a,t.shift=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:s,placement:r}=e,{mainAxis:a=!0,crossAxis:l=!1,limiter:d={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...u}=t,p={x:n,y:s},g=await c(e,u),m=i(o(r)),h=x(m);let b=p[m],v=p[h];if(a){const t="y"===m?"bottom":"right";b=f(b+g["y"===m?"top":"left"],b,b-g[t])}if(l){const t="y"===h?"bottom":"right";v=f(v+g["y"===h?"top":"left"],v,v-g[t])}const w=d.fn({...e,[m]:b,[h]:v});return{...w,data:{x:w.x-n,y:w.y-s}}}}},t.size=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(n){const{placement:s,rects:r,platform:a,elements:f}=n,{apply:u=(()=>{}),...p}=t,g=await c(n,p),m=o(s),h=e(s),b="x"===i(s),{width:v,height:w}=r.floating;let y,x;"top"===m||"bottom"===m?(y=m,x=h===(await(null==a.isRTL?void 0:a.isRTL(f.floating))?"start":"end")?"left":"right"):(x=m,y="end"===h?"top":"bottom");const E=w-g[y],L=v-g[x];let T=E,A=L;if(b?A=l(v-g.right-g.left,L):T=l(w-g.bottom-g.top,E),!n.middlewareData.shift&&!h){const t=d(g.left,0),e=d(g.right,0),n=d(g.top,0),o=d(g.bottom,0);b?A=v-2*(0!==t||0!==e?t+e:d(g.left,g.right)):T=w-2*(0!==n||0!==o?n+o:d(g.top,g.bottom))}await u({...n,availableWidth:A,availableHeight:T});const _=await a.getDimensions(f.floating);return v!==_.width||w!==_.height?{reset:{rects:!0}}:{}}}},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).TocasFloatingUICore={}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@floating-ui/core")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).TocasFloatingUIDOM={},t.TocasFloatingUICore)}(this,(function(t,e){"use strict";function n(t){var e;return(null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function o(t){return n(t).getComputedStyle(t)}const i=Math.min,s=Math.max,r=Math.round;function a(t){const e=o(t);let n=parseFloat(e.width),i=parseFloat(e.height);const s=t.offsetWidth,a=t.offsetHeight,c=r(n)!==s||r(i)!==a;return c&&(n=s,i=a),{width:n,height:i,fallback:c}}function c(t){return p(t)?(t.nodeName||"").toLowerCase():""}let l;function d(){if(l)return l;const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?(l=t.brands.map((t=>t.brand+"/"+t.version)).join(" "),l):navigator.userAgent}function f(t){return t instanceof n(t).HTMLElement}function u(t){return t instanceof n(t).Element}function p(t){return t instanceof n(t).Node}function g(t){return"undefined"!=typeof ShadowRoot&&(t instanceof n(t).ShadowRoot||t instanceof ShadowRoot)}function m(t){const{overflow:e,overflowX:n,overflowY:i,display:s}=o(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(s)}function h(t){return["table","td","th"].includes(c(t))}function b(t){const e=/firefox/i.test(d()),n=o(t),i=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!i&&"none"!==i||e&&"filter"===n.willChange||e&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((t=>n.willChange.includes(t)))||["paint","layout","strict","content"].some((t=>{const e=n.contain;return null!=e&&e.includes(t)}))}function v(){return/^((?!chrome|android).)*safari/i.test(d())}function w(t){return["html","body","#document"].includes(c(t))}function y(t){return u(t)?t:t.contextElement}const x={x:1,y:1};function E(t){const e=y(t);if(!f(e))return x;const n=e.getBoundingClientRect(),{width:o,height:i,fallback:s}=a(e);let c=(s?r(n.width):n.width)/o,l=(s?r(n.height):n.height)/i;return c&&Number.isFinite(c)||(c=1),l&&Number.isFinite(l)||(l=1),{x:c,y:l}}function L(t,o,i,s){var r,a;void 0===o&&(o=!1),void 0===i&&(i=!1);const c=t.getBoundingClientRect(),l=y(t);let d=x;o&&(s?u(s)&&(d=E(s)):d=E(t));const f=l?n(l):window,p=v()&&i;let g=(c.left+(p&&(null==(r=f.visualViewport)?void 0:r.offsetLeft)||0))/d.x,m=(c.top+(p&&(null==(a=f.visualViewport)?void 0:a.offsetTop)||0))/d.y,h=c.width/d.x,b=c.height/d.y;if(l){const t=n(l),e=s&&u(s)?n(s):s;let o=t.frameElement;for(;o&&s&&e!==t;){const t=E(o),e=o.getBoundingClientRect(),i=getComputedStyle(o);e.x+=(o.clientLeft+parseFloat(i.paddingLeft))*t.x,e.y+=(o.clientTop+parseFloat(i.paddingTop))*t.y,g*=t.x,m*=t.y,h*=t.x,b*=t.y,g+=e.x,m+=e.y,o=n(o).frameElement}}return e.rectToClientRect({width:h,height:b,x:g,y:m})}function T(t){return((p(t)?t.ownerDocument:t.document)||window.document).documentElement}function A(t){return u(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function _(t){return L(T(t)).left+A(t).scrollLeft}function R(t){if("html"===c(t))return t;const e=t.assignedSlot||t.parentNode||g(t)&&t.host||T(t);return g(e)?e.host:e}function P(t){const e=R(t);return w(e)?e.ownerDocument.body:f(e)&&m(e)?e:P(e)}function O(t,e){var o;void 0===e&&(e=[]);const i=P(t),s=i===(null==(o=t.ownerDocument)?void 0:o.body),r=n(i);return s?e.concat(r,r.visualViewport||[],m(i)?i:[]):e.concat(i,O(i))}function M(t,i,r){let a;if("viewport"===i)a=function(t,e){const o=n(t),i=T(t),s=o.visualViewport;let r=i.clientWidth,a=i.clientHeight,c=0,l=0;if(s){r=s.width,a=s.height;const t=v();(!t||t&&"fixed"===e)&&(c=s.offsetLeft,l=s.offsetTop)}return{width:r,height:a,x:c,y:l}}(t,r);else if("document"===i)a=function(t){const e=T(t),n=A(t),i=t.ownerDocument.body,r=s(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),a=s(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let c=-n.scrollLeft+_(t);const l=-n.scrollTop;return"rtl"===o(i).direction&&(c+=s(e.clientWidth,i.clientWidth)-r),{width:r,height:a,x:c,y:l}}(T(t));else if(u(i))a=function(t,e){const n=L(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=f(t)?E(t):{x:1,y:1};return{width:t.clientWidth*s.x,height:t.clientHeight*s.y,x:i*s.x,y:o*s.y}}(i,r);else{const e={...i};if(v()){var c,l;const o=n(t);e.x-=(null==(c=o.visualViewport)?void 0:c.offsetLeft)||0,e.y-=(null==(l=o.visualViewport)?void 0:l.offsetTop)||0}a=e}return e.rectToClientRect(a)}function D(t,e){return f(t)&&"fixed"!==o(t).position?e?e(t):t.offsetParent:null}function k(t,e){const i=n(t);let s=D(t,e);for(;s&&h(s)&&"static"===o(s).position;)s=D(s,e);return s&&("html"===c(s)||"body"===c(s)&&"static"===o(s).position&&!b(s))?i:s||function(t){let e=R(t);for(;f(e)&&!w(e);){if(b(e))return e;e=R(e)}return null}(t)||i}function C(t,e,n){const o=f(e),i=T(e),s=L(t,!0,"fixed"===n,e);let r={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(o||!o&&"fixed"!==n)if(("body"!==c(e)||m(i))&&(r=A(e)),f(e)){const t=L(e,!0);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&(a.x=_(i));return{x:s.left+r.scrollLeft-a.x,y:s.top+r.scrollTop-a.y,width:s.width,height:s.height}}const $={getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:r,strategy:a}=t;const l="clippingAncestors"===n?function(t,e){const n=e.get(t);if(n)return n;let i=O(t).filter((t=>u(t)&&"body"!==c(t))),s=null;const r="fixed"===o(t).position;let a=r?R(t):t;for(;u(a)&&!w(a);){const t=o(a),e=b(a);"fixed"===t.position?s=null:(r?e||s:e||"static"!==t.position||!s||!["absolute","fixed"].includes(s.position))?s=t:i=i.filter((t=>t!==a)),a=R(a)}return e.set(t,i),i}(e,this._c):[].concat(n),d=[...l,r],f=d[0],p=d.reduce(((t,n)=>{const o=M(e,n,a);return t.top=s(o.top,t.top),t.right=i(o.right,t.right),t.bottom=i(o.bottom,t.bottom),t.left=s(o.left,t.left),t}),M(e,f,a));return{width:p.right-p.left,height:p.bottom-p.top,x:p.left,y:p.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=f(n),s=T(n);if(n===s)return e;let r={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((i||!i&&"fixed"!==o)&&(("body"!==c(n)||m(s))&&(r=A(n)),f(n))){const t=L(n);a=E(n),l.x=t.x+n.clientLeft,l.y=t.y+n.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-r.scrollLeft*a.x+l.x,y:e.y*a.y-r.scrollTop*a.y+l.y}},isElement:u,getDimensions:function(t){return f(t)?a(t):t.getBoundingClientRect()},getOffsetParent:k,getDocumentElement:T,getScale:E,async getElementRects(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||k,s=this.getDimensions;return{reference:C(e,await i(n),o),floating:{x:0,y:0,...await s(n)}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>"rtl"===o(t).direction};Object.defineProperty(t,"arrow",{enumerable:!0,get:function(){return e.arrow}}),Object.defineProperty(t,"autoPlacement",{enumerable:!0,get:function(){return e.autoPlacement}}),Object.defineProperty(t,"detectOverflow",{enumerable:!0,get:function(){return e.detectOverflow}}),Object.defineProperty(t,"flip",{enumerable:!0,get:function(){return e.flip}}),Object.defineProperty(t,"hide",{enumerable:!0,get:function(){return e.hide}}),Object.defineProperty(t,"inline",{enumerable:!0,get:function(){return e.inline}}),Object.defineProperty(t,"limitShift",{enumerable:!0,get:function(){return e.limitShift}}),Object.defineProperty(t,"offset",{enumerable:!0,get:function(){return e.offset}}),Object.defineProperty(t,"shift",{enumerable:!0,get:function(){return e.shift}}),Object.defineProperty(t,"size",{enumerable:!0,get:function(){return e.size}}),t.autoUpdate=function(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=!0,animationFrame:a=!1}=o,c=i&&!a,l=c||s?[...u(t)?O(t):t.contextElement?O(t.contextElement):[],...O(e)]:[];l.forEach((t=>{c&&t.addEventListener("scroll",n,{passive:!0}),s&&t.addEventListener("resize",n)}));let d,f=null;if(r){let o=!0;f=new ResizeObserver((()=>{o||n(),o=!1})),u(t)&&!a&&f.observe(t),u(t)||!t.contextElement||a||f.observe(t.contextElement),f.observe(e)}let p=a?L(t):null;return a&&function e(){const o=L(t);!p||o.x===p.x&&o.y===p.y&&o.width===p.width&&o.height===p.height||n(),p=o,d=requestAnimationFrame(e)}(),n(),()=>{var t;l.forEach((t=>{c&&t.removeEventListener("scroll",n),s&&t.removeEventListener("resize",n)})),null==(t=f)||t.disconnect(),f=null,a&&cancelAnimationFrame(d)}},t.computePosition=(t,n,o)=>{const i=new Map,s={platform:$,...o},r={...s.platform,_c:i};return e.computePosition(t,n,{...s,platform:r})},t.getOverflowAncestors=O,t.platform=$,Object.defineProperty(t,"__esModule",{value:!0})}));function n(t,e,n,o){var i=t.closest(`[class*="${n}"]`)||document,s=Array.from(i.querySelectorAll(`[${o}="${e}"]`)).filter((t=>t.closest(`[class*="${n}"]`)||document===i));return s.length>0?s:i===document?[]:this.searchScopeTargets(i.parentNode,e,n,o)}var o=new class{constructor(){this.resize_observer=new ResizeObserver((t=>{t.forEach((t=>{this.getAllContaineredElements(t.target).forEach((t=>{this.check(t)}))}))}))}attributeMutation(t){this.isContainer(t.target)?this.resize_observer.observe(t.target):this.resize_observer.unobserve(t.target)}addedNodeMutation(t){this.isResponsiveElement(t)&&this.check(t),this.isContainer(t)&&this.resize_observer.observe(t)}getAllContaineredElements(t){return t.querySelectorAll(tocas.config.strict_responsive?'[class^="@"]:is([class*=":is-"],[class*=":u-"])':'[class^="@"][class*=":"]')}getAllResponsiveElements(t){return t.querySelectorAll(tocas.config.strict_responsive?'[class*=":is-"],[class*=":u-"]':'[class*=":"]')}isContainer(t){return t.matches(`[class~="${tocas.config.scopes.container}"]`)}isResponsiveElement(t){return t.matches(tocas.config.strict_responsive?'[class*=":is-"],[class*=":u-"]':'[class*=":"]')}hasResponsiveClass(t){return tocas.config.strict_responsive?t.includes(":is-")||t.includes(":u-"):t.includes(":")}windowResize(){this.getAllResponsiveElements(document).forEach((t=>{this.check(t)}))}unit(t){return parseInt(t,10)||0}breakpointSize(t,e){var n=window.getComputedStyle(e);return{min:this.unit(n.getPropertyValue(`--ts-breakpoint-${t}-min`)),max:this.unit(n.getPropertyValue(`--ts-breakpoint-${t}-max`))}}rule(t,e){var n=t.startsWith("@"),o=t.endsWith("+"),i=t.endsWith("-"),s=t.includes("[");n&&(t=t.substring(1)),(o||i)&&(t=t.substring(0,t.length-1)),s&&(t=t.substring(1).substring(0,t.length-1));var[r,a]=t.split("-");if(s)return o?[this.unit(r),99999]:i?[0,this.unit(r)]:[this.unit(r),this.unit(a)];var c=this.breakpointSize(r,e);return void 0!==a?[c.min,this.breakpointSize(a,e).max]:o?[c.min,99999]:i?[0,c.max]:[c.min,c.max]}compile(t){return Array.from(t.classList).filter((t=>this.hasResponsiveClass(t))).map((e=>{var[n,o]=e.split(":"),[i,s]=this.rule(n,t);return{min:i,max:s,width:n.startsWith("@")?Math.round(t.closest(`[class~="${tocas.config.scopes.container}"]`).getBoundingClientRect().width):Math.round(window.innerWidth),target_class:o}}))}check(t){var e=[],n=this.compile(t);n.forEach((({width:n,min:o,max:i,target_class:s})=>{n>=o&&n<=i&&(t.classList.add(s),e=[...e,s])})),n.forEach((({width:n,min:o,max:i,target_class:s})=>{(ni)&&!e.includes(s)&&t.classList.remove(s)}))}},i=new class{constructor(){}attributeMutation(t){}addedNodeMutation(t){this.isTab(t)&&(this.bindEventListener(t),this.initialTab(t))}isTab(t){return t.matches(`[${tocas.config.attributes.tab}]`)}isActiveTab(t){return t.classList.contains(tocas.config.classes.tab_active)}initialTab(t){this.isActiveTab(t)||n(t,t.getAttribute(tocas.config.attributes.tab),tocas.config.scopes.tab,tocas.config.attributes.tab_name).forEach((t=>{t.classList.add(tocas.config.classes.hidden)}))}toggle(t){var e=t.target.closest(`[${tocas.config.attributes.tab}]`),n=e.getAttribute(tocas.config.attributes.tab),o=e.closest(`[class*="${tocas.config.scopes.tab}"]`)||document,i=e.closest(".ts-tab"),s=[];i.querySelectorAll(`[${tocas.config.attributes.tab}]`).forEach((t=>{t.getAttribute(tocas.config.attributes.tab)===n?t.classList.add(tocas.config.classes.tab_active):(s=[...s,t.getAttribute(tocas.config.attributes.tab)],t.classList.remove(tocas.config.classes.tab_active))})),o.querySelectorAll(`[${tocas.config.attributes.tab_name}]`).forEach((t=>{var e=t.closest(`[class*="${tocas.config.scopes.tab}"]`)||document;o===e&&(t.getAttribute(tocas.config.attributes.tab_name)===n?t.classList.remove(tocas.config.classes.hidden):s.includes(t.getAttribute(tocas.config.attributes.tab_name))&&t.classList.add(tocas.config.classes.hidden))}))}bindEventListener(t){t.removeEventListener("click",this.toggle),t.addEventListener("click",this.toggle)}},s=new class{attributeMutation(t){}addedNodeMutation(t){this.isToggle(t)&&this.bindEventListener(t)}isToggle(t){return t.matches(`[${tocas.config.attributes.toggle}]`)}toggle(t){var e=t.target.closest(`[${tocas.config.attributes.toggle}]`),[o,i]=e.getAttribute(tocas.config.attributes.toggle).split(":");n(e,o,tocas.config.scopes.toggle,tocas.config.attributes.toggle_name).forEach((t=>{t.classList.toggle(i)}))}bindEventListener(t){t.removeEventListener("click",this.toggle.bind(this)),t.addEventListener("click",this.toggle.bind(this))}},r=new class{attributeMutation(t){}addedNodeMutation(t){this.isDropdownTrigger(t)&&this.bindEventListener(t),this.isDropdown(t)&&this.bindItemEventListener(t)}isDropdownTrigger(t){return t.matches(`[${tocas.config.attributes.dropdown}]`)}isDropdown(t){return t.matches(`.ts-dropdown[${tocas.config.attributes.dropdown_name}]`)}position(t){return t.getAttribute(tocas.config.attributes.dropdown_position)||"bottom"}windowClick(t){var e=t.target.closest(`[${tocas.config.attributes.dropdown}]`),o=t.target.closest(`[${tocas.config.attributes.dropdown_name}]`);if(null===e&&null===o&&document.querySelectorAll(`.ts-dropdown[${tocas.config.attributes.dropdown_name}]`).forEach((t=>{this.closeDropdown(t)})),null!==e){var i=e.getAttribute(tocas.config.attributes.dropdown),s=n(e,i,tocas.config.scopes.dropdown,tocas.config.attributes.dropdown_name)[0];this.closeDropdownsExcept(s)}null!==o&&this.closeDropdownsExcept(o)}closeDropdownsExcept(t){document.querySelectorAll(`.ts-dropdown[${tocas.config.attributes.dropdown_name}]`).forEach((e=>{e!==t&&this.closeDropdown(e)}))}bindEventListener(t){t.removeEventListener("click",this.clickEventListener.bind(this)),t.addEventListener("click",this.clickEventListener.bind(this))}bindItemEventListener(t){t.removeEventListener("click",this.itemClickEventListener.bind(this)),t.addEventListener("click",this.itemClickEventListener.bind(this))}closeDropdown(t){(t.classList.contains(".ts-dropdown")||t.classList.contains("is-visible"))&&(t.classList.remove("is-visible"),void 0!==t.tocas_dropdown&&(t.tocas_dropdown(),t.tocas_dropdown=void 0,t.style.removeProperty("--ts-dropdown-min-width"),t.style.removeProperty("--ts-dropdown-position")))}itemClickEventListener(t){var e=t.target.closest(`.ts-dropdown[${tocas.config.attributes.dropdown_name}]`);null!==t.target.closest(".item")&&this.closeDropdown(e)}clickEventListener(t){var e=t.target.closest(`[${tocas.config.attributes.dropdown}]`),o=e.getAttribute(tocas.config.attributes.dropdown),i=n(e,o,tocas.config.scopes.dropdown,tocas.config.attributes.dropdown_name)[0],s=this.position(i);void 0!==i.tocas_dropdown&&(i.tocas_dropdown(),i.tocas_dropdown=void 0,i.style.removeProperty("--ts-dropdown-min-width"),i.style.removeProperty("--ts-dropdown-position")),i.classList.toggle("is-visible"),i.classList.contains("is-visible")&&(i.style.setProperty("--ts-dropdown-min-width",`${e.getBoundingClientRect().width}px`),i.style.setProperty("--ts-dropdown-position","fixed"),i.tocas_dropdown=TocasFloatingUIDOM.autoUpdate(e,i,(()=>{TocasFloatingUIDOM.computePosition(e,i,{strategy:"fixed",placement:s,middleware:[TocasFloatingUIDOM.flip({crossAxis:!1}),TocasFloatingUIDOM.offset(8),TocasFloatingUIDOM.shift()]}).then((({x:t,y:e})=>{Object.assign(i.style,{left:`${t}px`,top:`${e}px`})}))})))}},a=new class{attributeMutation(t){this.isTooltip(t.target)&&this.bindEventListener(t.target)}addedNodeMutation(t){this.isTooltip(t)&&this.bindEventListener(t)}isTooltip(t){return t.matches(`[${tocas.config.attributes.tooltip}]`)}bindEventListener(t){t.tocas_tooltip_timer=null,this.enterEventListener(t),this.leaveEventListener(t)}delay(t){var e=t.getAttribute(tocas.config.attributes.tooltip_delay);return"0"===e?0:parseInt(e,10)||200}position(t){return t.getAttribute(tocas.config.attributes.tooltip_position)||"bottom"}enterEventListener(t){t.addEventListener("mouseover",(e=>{window.matchMedia("(pointer: coarse)").matches||null===t.tocas_tooltip_timer&&void 0===t.tocas_tooltip&&(t.tocas_tooltip_timer=setTimeout((()=>{this.showTooltip(t)}),this.delay(t)+1))}))}leaveEventListener(t){t.addEventListener("mouseleave",(e=>{e.target===t&&(void 0!==t.tocas_tooltip&&(t.tocas_tooltip(),t.tocas_tooltip=void 0),null!==t.tocas_tooltip_timer&&(clearTimeout(t.tocas_tooltip_timer),t.tocas_tooltip_timer=null),document.querySelectorAll(".ts-tooltip").forEach((t=>{t.remove()})))}))}createTooltip(t,e){var n=document.createElement("div");return n.innerText=t.getAttribute(tocas.config.attributes.tooltip),n.classList.add("ts-tooltip",tocas.config.classes.tooltip_visible),n.appendChild(e),n}createArrow(){var t=document.createElement("div");return t.classList.add("arrow"),t}showTooltip(t){var e=this.position(t),n=this.createArrow(),o=this.createTooltip(t,n);document.body.appendChild(o),t.tocas_tooltip=TocasFloatingUIDOM.autoUpdate(t,o,(()=>{TocasFloatingUIDOM.computePosition(t,o,{strategy:"fixed",placement:e,middleware:[TocasFloatingUIDOM.flip({crossAxis:!1}),TocasFloatingUIDOM.offset({crossAxis:-15,mainAxis:10}),TocasFloatingUIDOM.shift(),TocasFloatingUIDOM.arrow({element:n})]}).then((({middlewareData:t,x:e,y:i,placement:s})=>{if(Object.assign(o.style,{left:`${e}px`,top:`${i}px`}),t.arrow){const{x:e}=t.arrow;n.style.setProperty("--ts-tooltip-x",null!=e?`${e}px`:"0")}s&&(o.classList.remove("is-top","is-top-start","is-top-end","is-bottom","is-bottom-start","is-bottom-end"),o.classList.add(`is-${s}`))}))}))}};new MutationObserver((function(t){t.forEach((function(t){"attributes"===t.type?(o.attributeMutation(t),i.attributeMutation(t),s.attributeMutation(t),r.attributeMutation(t),a.attributeMutation(t)):t.addedNodes&&t.addedNodes.length&&t.addedNodes.forEach((function(t){t.nodeType===Node.ELEMENT_NODE&&(o.addedNodeMutation(t),i.addedNodeMutation(t),s.addedNodeMutation(t),r.addedNodeMutation(t),a.addedNodeMutation(t))}))}))})).observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),window.addEventListener("resize",(t=>{o.windowResize(t)})),window.addEventListener("click",(t=>{r.windowClick(t)}))}(); diff --git a/package.json b/package.json index 66f137ac..62ae5ced 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tocas", - "version": "4.1.0", + "version": "4.2.0", "description": "The fastest and most intuitive way to build diverse websites and progressive web application interfaces.", "directories": { "doc": "docs",