vendor: 4,832 bytes, lines 1-5
1/*! 2* tabbable 6.4.0 3* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE 4*/ 5!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):(t="undefined"!=typeof globalThis?globalThis:t||self,function(){var n=t.tabbable,o=t.tabbable={};e(o),o.noConflict=function(){return t.tabbable=n,o}}())}(this,function(t){"use strict";var e=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],n=e.join(","),o="undefined"==typeof Element,i=o?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,a=!o&&Element.prototype.getRootNode?function(t){var e;return null==t||null===(e=t.getRootNode)||void 0===e?void 0:e.call(t)}:function(t){return null==t?void 0:t.ownerDocument},r=function(t,e){var n;void 0===e&&(e=!0);var o=null==t||null===(n=t.getAttribute)||void 0===n?void 0:n.call(t,"inert");return""===o||"true"===o||e&&t&&("function"==typeof t.closest?t.closest("[inert]"):r(t.parentNode))},s=function(t,e,o){if(r(t))return[];var a=Array.prototype.slice.apply(t.querySelectorAll(n));return e&&i.call(t,n)&&a.unshift(t),a=a.filter(o)},l=function(t,e,o){for(var a=[],s=Array.from(t);s.length;){var c=s.shift();if(!r(c,!1))if("SLOT"===c.tagName){var u=c.assignedElements(),d=u.length?u:c.children,h=l(d,!0,o);o.flatten?a.push.apply(a,h):a.push({scopeParent:c,candidates:h})}else{i.call(c,n)&&o.filter(c)&&(e||!t.includes(c))&&a.push(c);var f=c.shadowRoot||"function"==typeof o.getShadowRoot&&o.getShadowRoot(c),p=!r(f,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(c));if(f&&p){var b=l(!0===f?c.children:f.children,!0,o);o.flatten?a.push.apply(a,b):a.push({scopeParent:c,candidates:b})}else s.unshift.apply(s,c.children)}}return a},c=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},u=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||function(t){var e,n=null==t||null===(e=t.getAttribute)||void 0===e?void 0:e.call(t,"contenteditable");return""===n||"true"===n}(t))&&!c(t)?0:t.tabIndex},d=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},h=function(t){return"INPUT"===t.tagName},f=function(t){return function(t){return h(t)&&"radio"===t.type}(t)&&!function(t){if(!t.name)return!0;var e,n=t.form||a(t),o=function(t){return n.querySelectorAll('input[type="radio"][name="'+t+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)e=o(window.CSS.escape(t.name));else try{e=o(t.name)}catch(t){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",t.message),!1}var i=function(t,e){for(var n=0;n<t.length;n++)if(t[n].checked&&t[n].form===e)return t[n]}(e,t.form);return!i||i===t}(t)},p=function(t){var e=t.getBoundingClientRect(),n=e.width,o=e.height;return 0===n&&0===o},b=function(t,e){var n=e.displayCheck,o=e.getShadowRoot;if("full-native"===n&&"checkVisibility"in t)return!t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if("hidden"===getComputedStyle(t).visibility)return!0;var r=i.call(t,"details>summary:first-of-type")?t.parentElement:t;if(i.call(r,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return p(t)}else{if("function"==typeof o){for(var s=t;t;){var l=t.parentElement,c=a(t);if(l&&!l.shadowRoot&&!0===o(l))return p(t);t=t.assignedSlot?t.assignedSlot:l||c===t.ownerDocument?l:c.host}t=s}if(function(t){var e,n,o,i,r=t&&a(t),s=null===(e=r)||void 0===e?void 0:e.host,l=!1;if(r&&r!==t)for(l=!!(null!==(n=s)&&void 0!==n&&null!==(o=n.ownerDocument)&&void 0!==o&&o.contains(s)||null!=t&&null!==(i=t.ownerDocument)&&void 0!==i&&i.contains(t));!l&&s;){var c,u,d;l=!(null===(u=s=null===(c=r=a(s))||void 0===c?void 0:c.host)||void 0===u||null===(d=u.ownerDocument)||void 0===d||!d.contains(s))}return l}(t))return!t.getClientRects().length;if("legacy-full"!==n)return!0}return!1},v=function(t,e){return!(e.disabled||function(t){return h(t)&&"hidden"===t.type}(e)||b(e,t)||function(t){return"DETAILS"===t.tagName&&Array.prototype.slice.apply(t.children).some(function(t){return"SUMMARY"===t.tagName})}
vendor: 6,591 bytes, lines 5-10
5(e)||function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var e=t.parentElement;e;){if("FIELDSET"===e.tagName&&e.disabled){for(var n=0;n<e.children.length;n++){var o=e.children.item(n);if("LEGEND"===o.tagName)return!!i.call(e,"fieldset[disabled] *")||!o.contains(t)}return!0}e=e.parentElement}return!1}(e))},g=function(t,e){return!(f(e)||u(e)<0||!v(t,e))},m=function(t){var e=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(e)||e>=0)},y=function(t){var e=[],n=[];return t.forEach(function(t,o){var i=!!t.scopeParent,a=i?t.scopeParent:t,r=function(t,e){var n=u(t);return n<0&&e&&!c(t)?0:n}(a,i),s=i?y(t.candidates):a;0===r?i?e.push.apply(e,s):e.push(a):n.push({documentOrder:o,tabIndex:r,item:t,isScope:i,content:s})}),n.sort(d).reduce(function(t,e){return e.isScope?t.push.apply(t,e.content):t.push(e.content),t},[]).concat(e)},w=e.concat("iframe:not([inert]):not([inert] *)").join(",");t.focusable=function(t,e){return(e=e||{}).getShadowRoot?l([t],e.includeContainer,{filter:v.bind(null,e),flatten:!0,getShadowRoot:e.getShadowRoot}):s(t,e.includeContainer,v.bind(null,e))},t.getTabIndex=u,t.isFocusable=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return!1!==i.call(t,w)&&v(e,t)},t.isTabbable=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return!1!==i.call(t,n)&&g(e,t)},t.tabbable=function(t,e){var n;return n=(e=e||{}).getShadowRoot?l([t],e.includeContainer,{filter:g.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:m}):s(t,e.includeContainer,g.bind(null,e)),y(n)}}), 6/*! 7* focus-trap 7.8.0 8* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE 9*/ 10function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("tabbable")):"function"==typeof define&&define.amd?define(["exports","tabbable"],e):(t="undefined"!=typeof globalThis?globalThis:t||self,function(){var n=t.focusTrap,o=t.focusTrap={};e(o,t.tabbable),o.noConflict=function(){return t.focusTrap=n,o}}())}(this,function(t,e){"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function o(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=l(t))||e){n&&(t=n);var o=0,i=function(){};return{s:i,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,r=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return r=t.done,t},e:function(t){s=!0,a=t},f:function(){try{r||null==n.return||n.return()}finally{if(s)throw a}}}}function i(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function r(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach(function(e){i(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function s(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||l(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){if(t){if("string"==typeof t)return n(t,e);var o={}.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?n(t,e):void 0}}var c={getActiveTrap:function(t){return(null==t?void 0:t.length)>0?t[t.length-1]:null},activateTrap:function(t,e){e!==c.getActiveTrap(t)&&c.pauseTrap(t);var n=t.indexOf(e);-1===n||t.splice(n,1),t.push(e)},deactivateTrap:function(t,e){var n=t.indexOf(e);-1!==n&&t.splice(n,1),c.unpauseTrap(t)},pauseTrap:function(t){var e=c.getActiveTrap(t);null==e||e._setPausedState(!0)},unpauseTrap:function(t){var e=c.getActiveTrap(t);e&&!e._isManuallyPaused()&&e._setPausedState(!1)}},u=function(t){return"Tab"===(null==t?void 0:t.key)||9===(null==t?void 0:t.keyCode)},d=function(t){return u(t)&&!t.shiftKey},h=function(t){return u(t)&&t.shiftKey},f=function(t){return setTimeout(t,0)},p=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];return"function"==typeof t?t.apply(void 0,n):t},b=function(t){return t.target.shadowRoot&&"function"==typeof t.composedPath?t.composedPath()[0]:t.target},v=[];t.createFocusTrap=function(t,n){var i,a=(null==n?void 0:n.document)||document,l=(null==n?void 0:n.trapStack)||v,g=r({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isolateSubtrees:!1,isKeyForward:d,isKeyBackward:h},n),m={containers:[],containerGroups:[],tabbableGroups:[],adjacentElements:new Set,alreadySilent:new Set,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},y=function(t,e,n){return t&&void 0!==t[e]?t[e]:g[n||e]},w=function(t,e){var n="function"==typeof(null==e?void 0:e.composedPath)?e.composedPath():void 0;return m.containerGroups.findIndex(function(e){var o=e.container,i=e.tabbableNodes;return o.contains(t)||(null==n?void 0:n.includes(o))||i.find(function(e){return e===t})})},D=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.hasFallback,o=void 0!==n&&n,i=e.params,r=void 0===i?[]:i,l=g[t];if("function"==typeof l&&(l=l.apply(void 0,s(r))),!0===l&&(l=void 0),!l){if(void 0===l||!1===l)return l;throw new Error("`".concat(t,"` was specified but was not a node, or did not return a node"))}var c=l;if("string"==typeof l){try{c=a.querySelector(l)}catch(e){throw new Error("`".concat(t,'` appears to be an invali
10d selector; error="').concat(e.message,'"'))}if(!c&&!o)throw new Error("`".concat(t,"` as selector refers to no known node"))}return c},k=function(){var t=D("initialFocus",{hasFallback:!0});if(!1===t)return!1;if(void 0===t||t&&!e.isFocusable(t,g.tabbableOptions))if(w(a.activeElement)>=0)t=a.activeElement;else{var n=m.tabbableGroups[0];t=n&&n.firstTabbableNode||D("fallbackFocus")}else null===t&&(t=D("fallbackFocus"));if(!t)throw new Error("Your focus-trap needs to have at least one focusable element");return t},_=function(){if(m.containerGroups=m.containers.map(function(t){var n=e.tabbable(t,g.tabbableOptions),o=e.focusable(t,g.tabbableOptions),i=n.length>0?n[0]:void 0,a=n.length>0?n[n.length-1]:void 0,r=o.find(function(t){return e.isTabbable(t)}),s=o.slice().reverse().find(function(t){return e.isTabbable(t)}),l=!!n.find(function(t){return e.getTabIndex(t)>0});return{container:t,tabbableNodes:n,focusableNodes:o,posTabIndexesFound:l,firstTabbableNode:i,lastTabbableNode:a,firstDomTabbableNode:r,lastDomTabbableNode:s,nextTabbableNode:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=n.indexOf(t);return a<0?i?o.slice(o.indexOf(t)+1).find(function(t){return e.isTabbable(t)}):o.slice(0,o.indexOf(t)).reverse().find(function(t){return e.isTabbable(t)}):n[a+(i?1:-1)]}}}),m.tabbableGroups=m.containerGroups.filter(function(t){return t.tabbableNodes.length>0}),m.tabbableGroups.length<=0&&!D("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(m.containerGroups.find(function(t){return t.posTabIndexesFound})&&m.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},x=function(t){var e=t.activeElement;if(e)return e.shadowRoot&&null!==e.shadowRoot.activeElement?x(e.shadowRoot):e},S=function(t){!1!==t&&t!==x(document)&&(t&&t.focus?(t.focus({preventScroll:!!g.preventScroll}),m.mostRecentlyFocusedNode=t,function(t){return t.tagName&&"input"===t.tagName.toLowerCase()&&"function"==typeof t.select}(t)&&t.select()):S(k()))},T=function(t){var e=D("setReturnFocus",{params:[t]});return e||!1!==e&&t},E=function(t){var n=t.target,o=t.event,i=t.isBackward,a=void 0!==i&&i;n=n||b(o),_();var r=null;if(m.tabbableGroups.length>0){var s=w(n,o),l=s>=0?m.containerGroups[s]:void 0;if(s<0)r=a?m.tabbableGroups[m.tabbableGroups.length-1].lastTabbableNode:m.tabbableGroups[0].firstTabbableNode;else if(a){var c=m.tabbableGroups.findIndex(function(t){var e=t.firstTabbableNode;return n===e});if(c<0&&(l.container===n||e.isFocusable(n,g.tabbableOptions)&&!e.isTabbable(n,g.tabbableOptions)&&!l.nextTabbableNode(n,!1))&&(c=s),c>=0){var d=0===c?m.tabbableGroups.length-1:c-1,h=m.tabbableGroups[d];r=e.getTabIndex(n)>=0?h.lastTabbableNode:h.lastDomTabbableNode}else u(o)||(r=l.nextTabbableNode(n,!1))}else{var f=m.tabbableGroups.findIndex(function(t){var e=t.lastTabbableNode;return n===e});if(f<0&&(l.container===n||e.isFocusable(n,g.tabbableOptions)&&!e.isTabbable(n,g.tabbableOptions)&&!l.nextTabbableNode(n))&&(f=s),f>=0){var p=f===m.tabbableGroups.length-1?0:f+1,v=m.tabbableGroups[p];r=e.getTabIndex(n)>=0?v.firstTabbableNode:v.firstDomTabbableNode}else u(o)||(r=l.nextTabbableNode(n))}}else r=D("fallbackFocus");return r},A=function(t){var e=b(t);w(e,t)>=0||(p(g.clickOutsideDeactivates,t)?i.deactivate({returnFocus:g.returnFocusOnDeactivate}):p(g.allowOutsideClick,t)||t.preventDefault())},N=function(t){var n=b(t),o=w(n,t)>=0;if(o||n instanceof Document)o&&(m.mostRecentlyFocusedNode=n);else{var i;t.stopImmediatePropagation();var a=!0;if(m.mostRecentlyFocusedNode)if(e.getTabIndex(m.mostRecentlyFocusedNode)>0){var r=w(m.mostRecentlyFocusedNode),s=m.containerGroups[r].tabbableNodes;if(s.length>0){var l=s.findIndex(function(t){return t===m.mostRecentlyFocusedNode});l>=0&&(g.isKeyForward(m.recentNavEvent)?l+1<s.length&&(i=s[l+1],a=!1):l-1>=0&&(i=s[l-1],a=!1))}}else m.containerGroups.some(function(t){return t.tabbableNodes.some(function(t){return e.getTabIndex(t)>0})})||(a=!1);else a=!1;a&&(i=E({target:m.mostRecentlyFocusedNode,isBackward:g.isKeyBackward(m.recentNavEvent)})),S(i||(m.mostRecentlyFocusedNode||k()))}m.recentNavEvent=void 0},C=function(t){(g.isKeyForward(t)||g.isKeyBackward(t))&&function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];m.recentNavEvent=t;var n=E({event:t,isBackward:e});n&&(u(t)&&t.preventDefault(),S(n))}(t,g.isKeyBackward(t))},L=function(t){var e;"Escape"!==(null==(e=t)?void 0:e.key)&&"Esc"!==(null==e?void 0:e.key)&&27!==(null==e?void 0:e.keyCode)||!1===p(g.escapeDeactivates,t)||(t.preventDefault(),i.deactivate())},P=function(t){var e=b(t);w(e,t)>=0||p(g.clickOutsideDeactivates,t)||p(g.allowOutsideClick,t)||(t.preventDefault(),t.stopImmediatePropagation())},I=function(){if(m.active)return c.activateTrap(l,i),m.delayInitialFocusTimer=g.delayInitialFocus?f(function(){S(k())}):S(k()),a.addEventListener("focusin",N,!0),a.addEventListener("mousedown",A,{capture:!0,passive:!1}),a.addEventListener("touchstart",A,{capture:!0,passive:!1}),a.addEventListener("click",P,{capture:!0,passive:!1}),a.addEventListener("keydown",C,{capture:!0,passive:!1}),a.addEventListener("keydown",L),i},F=function(){if(m.active)return a.removeEventListener("focusin",N,!0),a.removeEventListener("mousedown",A,!0),a.removeEventListener("touchstart",A,!0),a.removeEventListener("click",P,!0),a.removeEventListener("keydown",C,!0),a.removeEventListener("keydown",L),i},$="undefined"!=typeof window&&"MutationObserver"in window?new MutationObserver(function(t){t.some(function(t){return Array.from(t.removedNodes
10).some(function(t){return t===m.mostRecentlyFocusedNode})})&&S(k())}):void 0,M=function(){$&&($.disconnect(),m.active&&!m.paused&&m.containers.map(function(t){$.observe(t,{subtree:!0,childList:!0})}))};return i={get active(){return m.active},get paused(){return m.paused},activate:function(t){if(m.active)return this;var e,n=y(t,"onActivate"),o=y(t,"onPostActivate"),r=y(t,"checkCanFocusTrap"),s=c.getActiveTrap(l),u=!1;s&&!s.paused&&(null===(e=s._setSubtreeIsolation)||void 0===e||e.call(s,!1),u=!0);try{r||_(),m.active=!0,m.paused=!1,m.nodeFocusedBeforeActivation=x(a),null==n||n();var d=function(){r&&_(),I(),M(),g.isolateSubtrees&&i._setSubtreeIsolation(!0),null==o||o()};if(r)return r(m.containers.concat()).then(d,d),this;d()}catch(t){var h;if(s===c.getActiveTrap(l)&&u)null===(h=s._setSubtreeIsolation)||void 0===h||h.call(s,!0);throw t}return this},deactivate:function(t){if(!m.active)return this;var e=r({onDeactivate:g.onDeactivate,onPostDeactivate:g.onPostDeactivate,checkCanReturnFocus:g.checkCanReturnFocus},t);clearTimeout(m.delayInitialFocusTimer),m.delayInitialFocusTimer=void 0,m.paused||i._setSubtreeIsolation(!1),m.alreadySilent.clear(),F(),m.active=!1,m.paused=!1,M(),c.deactivateTrap(l,i);var n=y(e,"onDeactivate"),o=y(e,"onPostDeactivate"),a=y(e,"checkCanReturnFocus"),s=y(e,"returnFocus","returnFocusOnDeactivate");null==n||n();var u=function(){f(function(){s&&S(T(m.nodeFocusedBeforeActivation)),null==o||o()})};return s&&a?(a(T(m.nodeFocusedBeforeActivation)).then(u,u),this):(u(),this)},pause:function(t){return m.active?(m.manuallyPaused=!0,this._setPausedState(!0,t)):this},unpause:function(t){return m.active?(m.manuallyPaused=!1,l[l.length-1]!==this?this:this._setPausedState(!1,t)):this},updateContainerElements:function(t){var e=[].concat(t).filter(Boolean);return m.containers=e.map(function(t){return"string"==typeof t?a.querySelector(t):t}),g.isolateSubtrees&&function(t){m.active&&!m.paused&&i._setSubtreeIsolation(!1),m.adjacentElements.clear(),m.alreadySilent.clear();var e,n=new Set,a=new Set,r=o(t);try{for(r.s();!(e=r.n()).done;){var s=e.value;n.add(s);for(var l="undefined"!=typeof ShadowRoot&&s.getRootNode()instanceof ShadowRoot,c=s;c;){n.add(c);var u=c.parentElement,d=[];u?d=u.children:!u&&l&&(d=c.getRootNode().children,u=c.getRootNode().host,l="undefined"!=typeof ShadowRoot&&u.getRootNode()instanceof ShadowRoot);var h,f=o(d);try{for(f.s();!(h=f.n()).done;){var p=h.value;a.add(p)}}catch(t){f.e(t)}finally{f.f()}c=u}}}catch(t){r.e(t)}finally{r.f()}n.forEach(function(t){a.delete(t)}),m.adjacentElements=a}(m.containers),m.active&&(_(),g.isolateSubtrees&&!m.paused&&i._setSubtreeIsolation(!0)),M(),this}},Object.defineProperties(i,{_isManuallyPaused:{value:function(){return m.manuallyPaused}},_setPausedState:{value:function(t,e){if(m.paused===t)return this;if(m.paused=t,t){var n=y(e,"onPause"),o=y(e,"onPostPause");null==n||n(),F(),M(),i._setSubtreeIsolation(!1),null==o||o()}else{var a=y(e,"onUnpause"),r=y(e,"onPostUnpause");null==a||a(),i._setSubtreeIsolation(!0),_(),I(),M(),null==r||r()}return this}},_setSubtreeIsolation:{value:function(t){g.isolateSubtrees&&m.adjacentElements.forEach(function(e){var n;if(t)if("aria-hidden"===g.isolateSubtrees)"true"!==e.ariaHidden&&"true"!==(null===(n=e.getAttribute("aria-hidden"))||void 0===n?void 0:n.toLowerCase())||m.alreadySilent.add(e),e.setAttribute("aria-hidden","true");else(e.inert||e.hasAttribute("inert"))&&m.alreadySilent.add(e),e.setAttribute("inert",!0);else if(m.alreadySilent.has(e));else if("aria-hidden"===g.isolateSubtrees)e.removeAttribute("aria-hidden");else e.removeAttribute("inert")})}}}),i.updateContainerElements(t),i}});class AccessibleDatePicker{static VERSION="1.0";static DATEPICKERS=[];#t=[];#e={};static buildFrom(t){if(!t)throw new Error("AccessibleDatePicker requer um objeto de configuração com a propriedade alvo.");t.targets.forEach(e=>{let n=t.options||{};"string"==typeof e?e=document.querySelector(e):"object"==typeof e&&(e instanceof HTMLElement||(e.options&&(n=e.options),e=document.querySelector(e.target)));try{this.DATEPICKERS.push(new AccessibleDatePicker({target:e,options:n,id:e?.id||e}))}catch(t){}})}static buildGlobal(){document.querySelectorAll(".accessible-date-picker").forEach(t=>{"true"!==t.getAttribute("data-skip-callendar-init")&&this.DATEPICKERS.push(new AccessibleDatePicker({target:t,id:t.
10id||t}))})}static getDatePickerById(t){return this.DATEPICKERS.find(e=>e.id===t)}constructor(t){let e=t.target,n=t.options||{};this.id=t.id,this.#t=n.availableDates||[],this.buttonLabelChoose=n.buttonLabelChoose||"Escolher Data",this.buttonLabelChange=n.buttonLabelChange||"Alterar Data",this.buttonLabelCancel=n.buttonLabelCancel||"Cancelar",this.captionLabel=n.captionLabel||"Calendário de seleção de data",this.previousYearLabel=n.previousYearLabel||"Ano Anterior",this.nextYearLabel=n.nextYearLabel||"Próximo Ano",this.previousMonthLabel=n.previousMonthLabel||"Mês Anterior",this.nextMonthLabel=n.nextMonthLabel||"Próximo Mês",this.dayLabels=n.dayLabels||["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],this.monthLabels=n.monthLabels||["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],this.locales=n.locales||{available:"DisponÃvel",unavailable:"IndisponÃvel",ariaLabelText:"{{weekday}}, {{day}} de {{month}} de {{year}}"},this.messageCursorKeys=n.messageCursorKeys||"As setinhas são usadas para navegar",this.lastMessage="",this.textboxNode=e.querySelector('input[type="text"'),this.appendDatepicker.call(this,this.id,this.textboxNode.id),this.textboxNode.addEventListener("keydown",function(t){[8,9,13,27,46,37,38,39,40].includes(t.keyCode)||(t.ctrlKey||t.metaKey)&&["a","c","v","x"].includes(t.key.toLowerCase())||/[0-9\/]/.test(t.key)||t.preventDefault()}),this.buttonNode=e.querySelector(".group button"),this.dialogNode=e.querySelector('[role="dialog"]'),this.messageNode=this.dialogNode.querySelector(".dialog-message"),this.monthYearNode=this.dialogNode.querySelector(".month-year"),this.prevYearNode=this.dialogNode.querySelector(".prev-year"),this.prevMonthNode=this.dialogNode.querySelector(".prev-month"),this.nextMonthNode=this.dialogNode.querySelector(".next-month"),this.nextYearNode=this.dialogNode.querySelector(".next-year"),this.okButtonNode=this.dialogNode.querySelector('button[value="ok"]'),this.cancelButtonNode=this.dialogNode.querySelector('button[value="cancel"]'),this.tbodyNode=this.dialogNode.querySelector("table.dates tbody"),this.lastRowNode=null,this.days=[],this.focusDay=new Date,this.selectedDay=new Date(0,0,1),this.lastDate=-1,this.isMouseDownOnBackground=!1,this.textboxNode.addEventListener("blur",this.setDateForButtonLabel.bind(this)),this.buttonNode.addEventListener("keydown",this.handleButtonKeydown.bind(this)),this.buttonNode.addEventListener("click",this.handleButtonClick.bind(this)),this.okButtonNode.addEventListener("click",this.handleOkButton.bind(this)),this.okButtonNode.addEventListener("keydown",this.handleOkButton.bind(this)),this.cancelButtonNode.addEventListener("click",this.handleCancelButton.bind(this)),this.cancelButtonNode.addEventListener("keydown",this.handleCancelButton.bind(this)),this.prevMonthNode.addEventListener("click",this.handlePreviousMonthButton.bind(this)),this.nextMonthNode.addEventListener("click",this.handleNextMonthButton.bind(this)),this.prevYearNode.addEventListener("click",this.handlePreviousYearButton.bind(this)),this.nextYearNode.addEventListener("click",this.handleNextYearButton.bind(this)),this.prevMonthNode.addEventListener("keydown",this.handlePreviousMonthButton.bind(this)),this.nextMonthNode.addEventListener("keydown",this.handleNextMonthButton.bind(this)),this.prevYearNode.addEventListener("keydown",this.handlePreviousYearButton.bind(this)),this.nextYearNode.addEventListener("keydown",this.handleNextYearButton.bind(this)),document.body.addEventListener("pointerup",this.handleBackgroundMouseUp.bind(this),!0),this.tbodyNode.innerHTML="";for(let t=0;t<6;t++){const e=this.tbodyNode.insertRow(t);this.lastRowNode=e;for(let t=0;t<7;t++){const t=document.createElement("td");t.tabIndex=-1,t.addEventListener("click",this.handleDayClick.bind(this)),t.addEventListener("keydown",this.handleDayKeyDown.bind(this)),t.addEventListener("focus",this.handleDayFocus.bind(this)),t.textContent="-1",t.role="gridcell",e.appendChild(t),this.days.push(t)}}this.updateGrid(),this.close(!1),this.setDateForButtonLabel(),"function"==typeof n.onSelect&&this.addEventListener("select",n.onSelect),this.textboxNode.value.length>0&&this.triggerEvent("select")}appendDatepicker(t,e=null){const n=document.getElementById(t);if(!n)return void console.error(`Element with id "${t}" not found.`);const o=`\n <div id="id-datepicker-${e||t}" class="datepicker-dialog" role="dialog" aria-modal="true" aria-label="${this.captionLabel}">\n <div class="header">\n <button type="button" class="prev-year" aria-label="${this.previousYearLabel}">
10\n <span class="fa-solid fa-angles-left"></span>\n </button>\n <button type="button" class="prev-month" aria-label="${this.previousMonthLabel}">\n <span class="fa-solid fa-angle-left"></span>\n </button>\n <h2 id="id-grid-label" class="month-year" aria-live="polite">February 2020</h2>\n <button type="button" class="next-month" aria-label="${this.nextMonthLabel}">\n <span class="fa-solid fa-angle-right"></span>\n </button>\n <button type="button" class="next-year" aria-label="${this.nextYearLabel}">\n <span class="fa-solid fa-angles-right"></span>\n </button>\n </div>\n\n <div class="dialog-message" aria-live="polite"></div>\n\n <div class="table-wrap">\n <table class="dates calendar" role="grid" aria-labelledby="id-grid-label">\n <thead>\n <tr>\n <th scope="col" abbr="Domingo">D</th>\n <th scope="col" abbr="Segunda">S</th>\n <th scope="col" abbr="Terça">T</th>\n <th scope="col" abbr="Quarta">Q</th>\n <th scope="col" abbr="Quinta">Q</th>\n <th scope="col" abbr="Sexta">S</th>\n <th scope="col" abbr="Sábado">Sa</th>\n </tr>\n </thead>\n <tbody>\n \x3c!-- table rows here --\x3e\n </tbody>\n <caption class="sr-only">\n ${this.captionLabel}\n </caption>\n </table>\n </div>\n\n <div class="dialog-ok-cancel-group">\n <button class="dialog-button" value="cancel">${this.buttonLabelCancel}</button>\n <button class="dialog-button" value="ok">${this.buttonLabelChoose}</button>\n </div>\n </div>\n `;n.insertAdjacentHTML("beforeend",o)}triggerEvent(t){let e=this;(this.#e[t]||[]).forEach(t=>{t(e)})}addEventListener(t,e){this.#e[t]||(this.#e[t]=[]),this.#e[t].push(e)}isSameDay(t,e){return t.getFullYear()==e.getFullYear()&&t.getMonth()==e.getMonth()&&t.getDate()==e.getDate()}isNotSameMonth(t,e){return t.getFullYear()!=e.getFullYear()||t.getMonth()!=e.getMonth()}setAvailableDates(t){this.#t=t,this.updateGrid()}updateGrid(){const t=this.focusDay;this.monthYearNode.textContent=this.monthLabels[t.getMonth()]+" "+t.getFullYear();let e=new Date(t.getFullYear(),t.getMonth(),1),n=e.getDay();e.setDate(e.getDate()-n);const o=new Date(e);for(let e=0;e<this.days.length;e++){const n=o.getMonth()!=t.getMonth();this.updateDate(this.days[e],n,o,this.isSameDay(o,this.selectedDay)),o.setDate(o.getDate()+1),35===e&&(this.lastRowNode.style.display=n?"none":"table-row")}}updateDate(t,e,n,o){let i=n.getDate().toString();n.getDate()<=9&&(i="0"+i);let a=n.getMonth()+1;n.getMonth()<9&&(a="0"+a),t.tabIndex=-1,t.removeAttribute("aria-selected"),t.setAttribute("data-date",n.getFullYear()+"-"+a+"-"+i);let r=this.locales.ariaLabelText;r=r.replace("{{weekday}}",this.dayLabels[n.getDay()]),r=r.replace("{{day}}",n.getDate()),r=r.replace("{{month}}",this.monthLabels[n.getMonth()]),r=r.replace("{{year}}",n.getFullYear()),this.#t&&this.#t.includes(t.getAttribute("data-date"))&&(r+=`, ${this.locales.available}`),t.setAttribute("aria-label",r),e?(t.classList.add("disabled"),t.textContent="",t.removeAttribute("aria-disabled")):(this.#t.length>0?this.#t.includes(t.getAttribute("data-date"))?(t.classList.remove("disabled"),t.removeAttribute("aria-disabled")):(t.classList.add("disabled"),t.setAttribute("aria-disabled","true")):(t.classList.remove("disabled"),t.removeAttribute("aria-disabled")),t.textContent=n.getDate(),this.isSameDay(n,new Date)&&t.setAttribute("aria-current","date"),o&&(t.setAttribute("aria-selected","true"),t.tabIndex=0))}moveFocusToDay(t){const e=this.focusDay;this.focusDay=t,e.getMonth()==this.focusDay.getMonth()&&e.getFullYear()==this.focusDay.getFullYear()||this.updateGrid(),this.setFocusDay()}setFocusDay(t){"boolean"!=typeof t&&(t=!0);for(let e=0;e<this.days.length;e++){const n=this.days[e],o=this.getDayFromDataDateAttribute(n);n.tabIndex=-1,this.isSameDay(o,this.focusDay)&&(n.tabIndex=0,t&&n.focus())}}open(){this.dialogNode.style.display="block",this.dialogNode.style.zIndex=2,this.getDateFromTextbox(),this.updateGrid(),this.lastDate=this.focusDay.getDate()}isOpen(){return"none"!==window.getComputedStyle(this.dialogNode).display}close(t){"boolean"!=typeof t&&(t=!0),this.setMessage(""),this.dialogNode.style.display="none",t&&this.buttonNode.focus()}changeMonth(t,e){const n=e<0,o=Math.trunc(Math.abs(e)/12);e=Math.abs(e)%12;const i=n?t.getFullYear()-o:t.getFullYear()+o,a=n?t.getMonth()-e:t.getMonth()+e,r=new Date(i,a,1),s=(l=r.getFullYear(),c=r.getMonth()+1,new Date(l,c,0).getDate());var l,c;return this.lastDate=this.lastDate?this.lastDate:t.getDate(),this.lastDate>s?r.setDate(s):r.setDate(this.lastDate),r}moveToNextYear(){this.focusDay=this.changeMonth(this.focusDay,12),this.updateGrid()}moveToPreviousYear(){this.focusDay=this.changeMonth(this.focusDay,-12),this.updateGrid()}moveToNextMonth(){this.focusDay=this.changeMonth(this.focusDay,1),this.updateGrid()}moveToPreviousMonth(){this.focusDay=this.changeMonth(this.focusDay,-1),this.updateGrid()}moveFocusToNextDay(){const t=new Date(this.focusDay);t.setDate(t.getDate()+1),this.lastDate=t.getDate(),this.moveFocusToDay(t)}moveFocusToNextWeek(){const t=new Date(this.focusDay);t.setDate(t.getDate()+7),this.lastDate=t.getDate(),this.moveFocusToDay(t)}moveFocusToPreviousDay(){const t=new Date(this.focusDay);t.setDate(t.getDate()-1),this.lastDate=t.getDate(),this.moveFocusToDay(t)}moveFocusToPreviousWeek(){const t=new Date(this.focusDay);t.setDate(t.getDate()-7),this.lastDate=t.getDate(),this.moveFocusToDay(t)}moveFocusToFirstDayOfWeek(){const t=new Date(this.focusDay);t.setDate(t.getDate()-t.getDay()),this.lastDate=t.getDate(),this.moveFocusToDay(t)}moveFocusToLastDayOfWeek(){const t=new Date(this.focusDay);t.setDate(t.getDate()+(6-t.getDay())),this.lastDate=t.getDate(),this.moveFocusToDay(t)}isDayDisabled(t){return t.classList.contains("disabled")}getDayFromDataDateAttribute(t){const e=t.getAttribute("data-date").split("-");return new Date(e[0],parseInt(e[1])-1,e[2])}setTextboxDate(t){let e=this.focusDay;this.#t.length>0&&t&&this.isDayDisabled(t)||(t&&(e=this.getDayFromDataDateAttribute(t),this.days.forEach(e
10=>e===t?e.setAttribute("aria-selected","true"):e.removeAttribute("aria-selected"))),this.textboxNode.value=(e.getDate()<10?"0":"")+e.getDate()+"/"+(e.getMonth()+1<10?"0":"")+(e.getMonth()+1)+"/"+e.getFullYear(),this.setDateForButtonLabel(),this.triggerEvent("select"))}getDateFromTextbox(){const t=this.textboxNode.value.split("/"),e=parseInt(t[0]),n=parseInt(t[1]);let o=parseInt(t[2]);3===t.length&&Number.isInteger(n)&&Number.isInteger(e)&&Number.isInteger(o)?(o<100&&(o=2e3+o),this.focusDay=new Date(o,n-1,e),this.selectedDay=new Date(this.focusDay)):(this.focusDay=new Date,this.selectedDay=new Date(0,0,1))}setDateForButtonLabel(){const t=this.textboxNode.value.split("/");if(3===t.length&&Number.isInteger(parseInt(t[0]))&&Number.isInteger(parseInt(t[1]))&&Number.isInteger(parseInt(t[2]))){new Date(parseInt(t[2]),parseInt(t[0])-1,parseInt(t[1]));let e=this.buttonLabelChange;this.buttonNode.setAttribute("aria-label",e)}else this.buttonNode.setAttribute("aria-label",this.buttonLabelChoose)}setMessage(t){t!==this.lastMessage&&(setTimeout(function(){this.messageNode.textContent=t}.bind(this),200),this.lastMessage=t)}handleOkButton(t){let e=!1;switch(t.type){case"keydown":switch(t.key){case"Tab":t.shiftKey||(this.prevYearNode.focus(),e=!0);break;case"Esc":case"Escape":this.close(),e=!0}break;case"click":this.setTextboxDate(),this.close(),e=!0}e&&(t.stopPropagation(),t.preventDefault())}handleCancelButton(t){let e=!1;switch(t.type){case"keydown":switch(t.key){case"Esc":case"Escape":this.close(),e=!0}break;case"click":this.close(),e=!0}e&&(t.stopPropagation(),t.preventDefault())}handleNextYearButton(t){let e=!1;switch(t.type){case"keydown":switch(t.key){case"Esc":case"Escape":this.close(),e=!0;break;case"Enter":this.moveToNextYear(),this.setFocusDay(!1),e=!0}break;case"click":this.moveToNextYear(),this.setFocusDay(!1)}e&&(t.stopPropagation(),t.preventDefault())}handlePreviousYearButton(t){let e=!1;switch(t.type){case"keydown":switch(t.key){case"Enter":this.moveToPreviousYear(),this.setFocusDay(!1),e=!0;break;case"Tab":t.shiftKey&&(this.okButtonNode.focus(),e=!0);break;case"Esc":case"Escape":this.close(),e=!0}break;case"click":this.moveToPreviousYear(),this.setFocusDay(!1)}e&&(t.stopPropagation(),t.preventDefault())}handleNextMonthButton(t){let e=!1;switch(t.type){case"keydown":switch(t.key){case"Esc":case"Escape":this.close(),e=!0;break;case"Enter":this.moveToNextMonth(),this.setFocusDay(!1),e=!0}break;case"click":this.moveToNextMonth(),this.setFocusDay(!1)}e&&(t.stopPropagation(),t.preventDefault())}handlePreviousMonthButton(t){let e=!1;switch(t.type){case"keydown":switch(t.key){case"Esc":case"Escape":this.close(),e=!0;break;case"Enter":this.moveToPreviousMonth(),this.setFocusDay(!1),e=!0}break;case"click":this.moveToPreviousMonth(),this.setFocusDay(!1),e=!0}e&&(t.stopPropagation(),t.preventDefault())}handleDayKeyDown(t){let e=!1;switch(t.key){case"Esc":case"Escape":this.close();break;case" ":this.setTextboxDate(t.currentTarget),e=!0;break;case"Enter":this.setTextboxDate(t.currentTarget),this.close(),e=!0;break;case"Tab":this.cancelButtonNode.focus(),t.shiftKey&&this.nextYearNode.focus(),this.setMessage(""),e=!0;break;case"Right":case"ArrowRight":this.moveFocusToNextDay(),e=!0;break;case"Left":case"ArrowLeft":this.moveFocusToPreviousDay(),e=!0;break;case"Down":case"ArrowDown":this.moveFocusToNextWeek(),e=!0;break;case"Up":case"ArrowUp":this.moveFocusToPreviousWeek(),e=!0;break;case"PageUp":t.shiftKey?this.moveToPreviousYear():this.moveToPreviousMonth(),this.setFocusDay(),e=!0;break;case"PageDown":t.shiftKey?this.moveToNextYear():this.moveToNextMonth(),this.setFocusDay(),e=!0;break;case"Home":this.moveFocusToFirstDayOfWeek(),e=!0;break;case"End":this.moveFocusToLastDayOfWeek(),e=!0}e&&(t.stopPropagation(),t.preventDefault())}handleDayClick(t){this.isDayDisabled(t.currentTarget)||3===t.which||(this.setTextboxDate(t.currentTarget),this.close()),t.stopPropagation(),t.preventDefault()}handleDayFocus(){this.setMessage(this.messageCursorKeys)}handleButtonKeydown(t){"Enter"!==t.key&&" "!==t.key||(this.open(),this.setFocusDay(),t.stopPropagation(),t.preventDefault())}handleButtonClick(t){this.isOpen()?this.close():(this.open(),this.setFocusDay()),t.stopPropagation(),t.preventDefault()}
10handleBackgroundMouseUp(t){this.buttonNode.contains(t.target)||this.dialogNode.contains(t.target)||this.isOpen()&&(this.close(!1),t.stopPropagation(),t.preventDefault())}}$(function(){AccessibleDatePicker.buildGlobal()}),$(function(){setTimeout(()=>{var t=$(".auto-focus:visible, .FormAlert")[0];t&&t.focus()},500);var t="undefined"!=typeof Storage;$(".google_search_button").length>0&&$(".google_search_button").click(function(t){t.stopPropagation(),t.preventDefault();var e=$(this),n=e.data("url")+"?search="+e.prev().val();e.data("search_domain")+""!=""&&(n+="&search_domain="+e.data("search_domain")),window.location=n}),$(".slideshow").length>0&&$(".slideshow").css("display","block").cycle({fx:"fade",random:0,speed:3500}),"undefined"!=typeof Galleria&&(Galleria.loadTheme("/assets/wm-smile/javascripts/frontoffice/galleria/themes/azur/galleria.azur.min.js"),Galleria.run(".galleria",{autoplay:5e3,thumbCrop:!1,imageCrop:!1,maxScaleRatio:1,fullscreenCrop:!1,extend:function(t){this.bind("image",function(t){$(t.imageTarget).click(this.proxy(function(){}))})}}),Galleria.ready(function(){1==this.getDataLength()&&(this.$("image-nav").hide(),this.$("thumbnails-container").hide()),this.bind("image",function(t){t.scope._data.forEach(function(){t.imageTarget.alt=t.galleriaData.original.alt})}),this.bind("thumbnail",function(t){t.scope._data.forEach(function(){t.thumbTarget.alt=t.galleriaData.original.alt})})}));var e=$(".light-gallery");e.length>0&&e.each(function(t,e){$gallery=$(e),$gallery.data("thumbs")?$gallery.lightGallery({thumbnails:!0}):$gallery.lightGallery()});var n=$(".video-light-gallery");if(n.length>0){try{for(const t of n){if("true"===t.getAttribute("skip-gallery"))continue;t.setAttribute("aria-hidden","true");const e=document.createElement("ul");e.setAttribute("class","sr-only");for(const[n,o]of t.querySelectorAll("a").entries().toArray()){o.setAttribute("aria-hidden","true"),o.setAttribute("tabindex","-1");const t=document.createElement("li"),i=document.createElement("a");i.setAttribute("href",o.href.replace("youtube-nocookie","youtube")),i.setAttribute("target","_blank"),i.innerText=`Abrir vÃdeo ${n+1} com titulo ${o.querySelector(".title").innerText} num novo separador`,t.append(i),e.append(t)}t.after(e)}}catch(t){console.error(t)}n.filter(function(){return"true"!==$(this).attr("skip-gallery")}).lightGallery({loadYoutubeThumbnail:!0,youtubeThumbSize:"default",loadVimeoThumbnail:!0,vimeoThumbSize:"thumbnail_medium"})}var o=$(".subscribe-me");if(o.length>0){var i=function(t){return t.subscribeBetter({trigger:t.data("trigger")||"onload",animation:t.data("animation")||"fade",delay:t.data("delay")?parseInt(t.data("delay")):0,showOnce:"true"==t.data("showOnce"),autoClose:"true"==t.data("autoClose"),scrollableModal:"true"==t.data("scrollableModal")})};
10o.each(function(){var e=$(this),n=e.attr("id"),o=e.hasClass("keep-closed");if(!t||!o)return i(e);null===sessionStorage.getItem(n)?(i(e),sessionStorage.setItem(n,!0)):e.hide()})}if($.piroBox_ext&&$(".video_preview, .image_preview").length>0&&($.piroBox_ext({piro_speed:700,bg_alpha:.5,piro_scroll:!0,piro_drag:!1,piro_nav_pos:"bottom"}),$(".video_preview").each(function(){if($(this).closest("ul:not([data-acessible=true])").length>0)try{const t=$(this).closest("ul:not([data-acessible=true])")[0];t.setAttribute("data-acessible","true"),t.setAttribute("aria-hidden","true");const e=document.createElement("ul");e.setAttribute("class","sr-only");for(const[n,o]of t.querySelectorAll("a").entries().toArray()){o.setAttribute("aria-hidden","true"),o.setAttribute("tabindex","-1");const t=document.createElement("li"),i=document.createElement("a");i.setAttribute("href",o.href.replace("youtube-nocookie","youtube")),i.setAttribute("target","_blank"),i.innerText=`Abrir vÃdeo ${n+1} com titulo ${o.querySelector(".title").innerText} num novo separador`,t.append(i),e.append(t)}t.after(e)}catch(t){console.error(t)}})),$(".widget_form").length>0&&(process_form_buttons(),process_error_focus_links()),$(".showcase-holder").length>0&&$(".showcase-holder").each(function(){process_showcase_holder($(this))}),$("div").flexslider&&$(".flexslider").length>0&&($(".flexslider[data-type=fader]").each(function(){var t=$(this),e={prevText:"Anterior",nextText:"Próximo"};"yes"===t.data("has-thumbs")&&(e.controlNav="thumbnails"),t.flexslider(e)}),$(".flexslider[data-type=slider]").each(function(){var t=$(this),e={prevText:"Anterior",nextText:"Próximo",animation:"slide"};"yes"===t.data("has-thumbs")&&(e.controlNav="thumbnails"),t.flexslider(e)}),$(".flexslider[data-type=carousel]").each(function(){var t=$(this),e={prevText:"Anterior",nextText:"Próximo",animation:"slide",animationLoop:!1,itemWidth:t.data("item-with"),itemMargin:t.data("item-margin")};"yes"===t.data("has-thumbs")&&(e.controlNav="thumbnails"),t.flexslider(e)})),jQuery.gritter&&$(".gritter-message").length>0&&$(".gritter-message").each(function(){var t=$(this);jQuery.gritter.add({title:$(".title",t).html(),text:$(".text",t).html()})}),$('form[action="/email_form"]').length>0&&testIfLocalStorageIsAvailable()){var a=$('form[action="/email_form"]');if(a.on("submit",function(t){var e=a.find("*[type='submit']");if(0!==e.length){if(!0===e.data("is-submitted"))return t.preventDefault();e.unbind("click"),e.addClass("disabled"),e.data("is-submitted",!0)}}),a.submit(function(){localStorage.setItem("formContents",JSON.stringify(a.serializeArray()))}),window.has_form_error)for(var r=JSON.parse(localStorage.getItem("formContents")),s=0;s<r.length;s++){if(r[s].name.indexOf("g-recaptcha-response")>-1){if(""==r[s].value){var l=a.find("input[name='captcha_error']"),c="Por favor preencha o captcha";l.length>0&&(c=l.val()),a.prepend("<div class='widget_warning'>"+c+"</div>")}}else $("input[name='"+r[s].name+"'],textarea[name='"+r[s].name+"']").val(r[s].value)}else localStorage.removeItem("formContents")}});var testIfLocalStorageIsAvailable=function(){var t="test";try{return localStorage.setItem(t,t),localStorage.removeItem(t),!0}catch(t){return!1}},get_default_showcase_options=function(){return{fit_to_parent:!0,auto:!0,interval:1e4,continuous:!0,loading:!0,tooltip_width:200,tooltip_icon_width:32,tooltip_icon_height:32,tooltip_offsetx:18,tooltip_offsety:0,arrows:!1,buttons:!0,btn_numbers:!0,keybord_keys:!0,mousetrace:!1,pauseonover:!0,stoponclick:!0,transition:"fade",transition_delay:300,transition_speed:500,show_caption:"show",thumbnails:!1,thumbnails_position:"outside-last",thumbnails_direction:"horizontal",thumbnails_slidex:0,dynamic_height:!1,speed_change:!0,viewline:!1}},get_options_for_fader=function(){return get_default_showcase_options()},get_options_for_mosaic_fader=function(){var t=get_default_showcase_options();return t.fit_to_parent=!1,t.buttons=!1,t.btn_numbers=!1,t.pauseonover=!0,t.thumbnails=!0,t.thumbnails_position="inside-last",t},get_options_for_slider=function(){var t=get_default_showcase_options();return t.transition="hslide",t},get_options_for_innerslider=function(){var t=get_default_showcase_options();return t.fit_to_parent=!1,t.buttons=!1,t.btn_numbers=!1,t.transition="hslide",t.thumbnails=!0,t},get_options_for_highlights_slider=function(){var t=get_default_showcase_options();return t.arrows=!0,t.fit_to_parent=!1,t.buttons=!1,t.btn_numbers=!1,t.transition="hslide",t.thumbnails=!1,t},option_functions={fader:get_options_for_fader,mosaic_fader:get_options_for_mosaic_fader,slider:get_options_for_slider,innerslider:get_options_for_innerslider,highlights_slider:get_options_for_highlights_slider},process_showcase_holder=function(t){if(!(t.find(".showcase-content-container").length>0))try{var e=t.data("showcase-type"),n=option_functions[e]();
10n.content_width=t.data("max_image_width"),n.content_height=t.data("max_image_height"),t.awShowcase(n),setTimeout(function(){$.piroBox_ext&&$.piroBox_ext()},50)}catch(t){}},process_form_buttons=function(){$(document).on("keypress","input[type=text]",function(t){if(13!==t.keyCode)return!0;t.preventDefault(),do_form_submit($(this))}),$(".submit_button_link").click(function(t){t.preventDefault(),debounce?do_form_submit_debounce($(this)):do_form_submit($(this))}),$("form").on("submit",function(t){if($form=$(this),$form.find(".submit_button_link.submit-with-partial-form").length>0){$button=$form.find(".submit_button_link.submit-with-partial-form");let e=()=>{debounce?do_form_submit_debounce($button):do_form_submit($button)};if($button.attr("disabled"))return t.preventDefault(),t.stopPropagation(),!1;if("true"==$button.data("validated"))return!0;let n=$("input[name='partial_form_id']");if(0==n.length||"0"==n.val()||!n.closest(".widget_extra_fields").is(":visible"))return e(),!0;t.preventDefault(),t.stopPropagation();let o=+$button.parents("div.widget").data("id"),i=t=>{0==Object.keys(t).length?($button.data("validated","true"),e($button)):$button.data("validated","false")};document.dispatchEvent(new CustomEvent("React.CheckIfPartialFormIsValid",{bubbles:!0,detail:{widgetId:o,callback:i}}))}})},process_error_focus_links=function(){$("[data-focus]").on("click",function(t){t.preventDefault();let e=$(this).attr("data-focus"),n=$('.RenderFormElem[data-focus-on-error="'+e+'"]');if(n.length){$("html, body").animate({scrollTop:n.offset().top},600);let t=n.find("input:not([type=hidden])");if(!t.length&&n.find("select").length&&(console.log("Focando select",n.find("select")),t=n.find("select")),!t.length&&n.find("textarea").length&&(console.log("Focando textarea",n.find("textarea")),t=n.find("textarea")),!t.length)return;t.focus()}})},do_form_submit=function(t){var e=t.closest("form").find(".FormViewer-StatusLive");e.length>0&&e.data("submitting-text")&&e.text(e.data("submitting-text"));var n=t.prev("input[type=submit]");if(0==n.length&&(n=t.parent().find("input[type=submit],input.search_button")),0==n.length&&(n=t.closest(".widget").find("input[type=submit],input.search_button")),$(t).closest(".ajax-submit-form").length>0)$(t).closest(".ajax-submit-form").find(".input-ajax-submit-form").keyup();else if(n.length>0)n.click();else{var o=t.closest("form");o.length>0&&o.submit()}},do_form_submit_debounce=debounce?debounce(do_form_submit,500):void 0;function pickAjaxTargetWidget(t,e){if(!e||!e.length)return null;var n=t?e.filter(function(e){return t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING}):[],o=n.length?n:e;return o.filter(function(t){return t.querySelector("form")})[0]||o[0]||null}"undefined"!=typeof module&&(module.exports=pickAjaxTargetWidget),$(function(){function t(t){t.preventDefault();var e=window.location.href.indexOf("admin/editor")>-1;if(!this.dataset.ignore&&!e){var o=$(this),i=o.closest("form"),a=o.closest(".widget"),r=parseInt($("#is-same-page",a).val()),s=$("#secondary-widget",a).val(),l=$("#secondary-widget-selectors",a).val(),c="",u=null,d=null;if(r&&s&&!l){var h=$(".widget[data-content_type='"+s+"']").toArray();d=$(pickAjaxTargetWidget(a[0],h)),0===(u=$("form",d)).length&&(u=i),c=u.attr("action")}else r&&s&&l?(d=$(l).filter(".widget[data-content_type='"+s+"']"),0===(u=$("form",d)).length&&(u=i),c=u.attr("action")):(d=o.closest(".widget"),u=o.closest("form"),c=u.attr("action"));d.each(function(t){url_anchor="",c.indexOf("#")>=0&&(url_anchor=c.split("#")[1],c=c.split("#")[0]),c.indexOf("?")<0?c+="?":c+="&",c+="widget_id="+d.data("id"),c+="&widget_type="+d.data("content_type"),url_anchor&&(c+="#"+url_anchor),c+="&"+$("input[name!=widget_id][name!=widget_type][name!=widget_action][name!=return_to],select",i).serialize();var e=null,n=i.attr("aria-controls");n&&(e=$("#"+n)).length>0&&e.attr("aria-busy","true"),$.getScript(c).done(function(){e&&e.length>0&&e.removeAttr("aria-busy")}).fail(function(){e&&e.length>0&&e.removeAttr("aria-busy")})}),setTimeout(n,550)}}var e=!1;function n(){$galleries=$(".light-gallery"),$galleries.length>0&&$galleries.lightGallery(),"function"==typeof setup_swiper_widgets&&setup_swiper_widgets()}$(document).on("keyup dp.change",".input-ajax-submit-form:not([data-skip-real-time])",debounce(t,550)),$(document).on("submit","form.generic_search",function(e){var n=$(".input-ajax-submit-form",this);n.length?t.call(n[0],e):e.preventDefault()}),$(document).on("change",".select-ajax-submit-form",debounce(t,550)),$(document).ready(function(){$(document).on("click",".wm-ajax-links a:not(.widget_field a)",function(t){var e=window.location.href.indexOf("admin/editor")>-1;if(!this.dataset.ignore&&!e){t.preventDefault();var o=$(this);url=o.prop("href"),url_anchor="",url.indexOf("#")>=0&&(url_anchor=url.split("#")[1],url=url.split("#")[0]),url.indexOf("?")<0?url+="?":url+="&";var i=o.closest(".widget");
10url+="widget_id="+i.data("id"),url+="&widget_type="+i.data("content_type"),url_anchor&&(url+="#"+url_anchor),$.getScript(url),setTimeout(n,550),history.pushState({},"",o.attr("href"))}})}),$(document).on("click",".pagination a",function(t){t.stopPropagation();var e=$(this),o=$("form.generic_search",e.closest(".widget"));0!=o.length&&(t.preventDefault(),$.post(e.prop("href"),o.serialize()),setTimeout(()=>history.pushState({},"",e.attr("href")),0),setTimeout(n,550))}),document.addEventListener("usedforajaxwidgetsScriptLoaded",function(t){n()}),document.addEventListener("usedforajaxwidgetsUrlChanged",function(t){e&&(e=!1)}),document.addEventListener("usedforajaxwidgetsUrlWillChange",function(t){e||(e=!0)}),window.addEventListener("popstate",function(t){if(!e){var n=document.createEvent("HTMLEvents");n.initEvent("usedforajaxwidgetsUrlWillChange",!1,!0),document.dispatchEvent(n),e=!0,window.location.replace(window.location.href),(n=document.createEvent("HTMLEvents")).initEvent("usedforajaxwidgetsUrlChanged",!1,!0),document.dispatchEvent(n)}})}),function(t,e){var n="_wm_cookiebar_status",o="cookie_prefs",i="_wm_cookie_cfg",a="accepted",r="declined",s="custom";function l(t,n,o){var i="";if(o){var a=new Date;a.setTime(a.getTime()+24*o*60*60*1e3),i="; expires="+a.toUTCString()}e.cookie=encodeURIComponent(t)+"="+encodeURIComponent(n)+i+"; path=/"}function c(t){for(var n=encodeURIComponent(t)+"=",o=e.cookie.split(";"),i=0;i<o.length;i++){for(var a=o[i];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(n))return decodeURIComponent(a.substring(n.length,a.length))}return null}function u(t){if(!0===t||!1===t)return t;if("string"==typeof t){var e=t.trim().toLowerCase();if("1"===e||"true"===e)return!0;if("0"===e||"false"===e)return!1}return!1}function d(t){return(t||"").toString().trim()}function h(t){return(t||"").toString().trim()}function f(){try{var t=e.querySelector(".cookie-bar[data-config-digest]");if(t){var n=t.getAttribute("data-config-digest");if(n)return n.toString()}}catch(t){}return null}function p(t){var e={categories:{},cookies:{}};return t&&"object"==typeof t?(t.categories&&"object"==typeof t.categories&&Object.keys(t.categories).forEach(function(n){var o=d(n);o&&(e.categories[o]=u(t.categories[n]))}),t.cookies&&"object"==typeof t.cookies&&Object.keys(t.cookies).forEach(function(n){var o=h(n);o&&(e.cookies[o]=u(t.cookies[n]))}),e):e}function b(){if(!m())return p();var t=c(o);if(!t)return p();try{return p(JSON.parse(t))}catch(t){return p()}}function v(t){return"essential"===d(t).toLowerCase()}function g(t){var e=m();if(!e)return v(t);if(e===a)return!0;if(e===r)return v(t);var n=b(),o=d(t);return!!o&&(!!v(o)||!!Object.prototype.hasOwnProperty.call(n.categories,o)&&!!n.categories[o])}function m(){return function(){var t=f();if(!t)return!1;var e=c(i);return!e||e!==t}()?(l(n,"",-1),l(o,"",-1),l(i,"",-1),null):function(t){if(!t)return null;var e=t.toString().toLowerCase();return e===a||e===r||e===s?e:null}(c(n))}function y(t){var e;l(n,t,365),(e=f())&&l(i,e,365)}function w(){for(var t=e.querySelectorAll(".cookie-bar"),n=0;n<t.length;n++)t[n].setAttribute("aria-hidden","true"),t[n].style.display="none"}function D(n){try{t.dispatchEvent(new CustomEvent(n))}catch(i){var o=e.createEvent("Event");o.initEvent(n,!0,!0),t.dispatchEvent(o)}}function k(t){t===a?D("wm:cookie:accepted"):t===r?D("wm:cookie:declined"):t===s&&D("wm:cookie:custom"),D("wm:cookie:updated")}function _(e,n){var o=n||{};y(e),w(),k(e),!0===o.reload&&setTimeout(function(){t.location.reload()},30)}function x(t){var e=t.getAttribute("data-cookie-reload"),n=null===e||"true"===e,o=m();o!==a&&o!==r&&o!==s?(!function(t){t.removeAttribute("aria-hidden"),t.style.display=""}(t),t.addEventListener("click",function(e){var o=function(t,e){for(var n=t.target;n&&n!==e;){if(n.getAttribute&&n.getAttribute("data-cookie-choice"))return n;n=n.parentNode}return null}(e,t);if(o){var i=o.getAttribute("data-cookie-choice");i===a?_(a,{reload:n}):i===r&&_(r,{reload:n})}})):w()}e.addEventListener("DOMContentLoaded",function(){for(var t=e.querySelectorAll(".cookie-bar"),n=0;n<t.length;n++)x(t[n]);var o=m();o&&k(o);let i=e.querySelectorAll(".cookie-bar button");i&&i.length>0&&i[0].focus()}),t.WMCookieConsent={status:m,hasConsent:function(){return m()===a},getPreferences:b,isCategoryAllowed:g,isCookieAllowed:function(t,e){var n=m();if(!n)return v(e);
10if(n===a)return!0;if(n===r)return v(e);var o=b(),i=h(t);return i&&Object.prototype.hasOwnProperty.call(o.cookies,i)?!!o.cookies[i]:g(e)},acceptAll:function(t){_(a,t)},declineAll:function(t){_(r,t)}}}(window,document),document.addEventListener("DOMContentLoaded",function(){var t=document.querySelector("[data-cookie-manager]");if(t){var e=t.querySelector(".cookie-manager__form");e&&(e.addEventListener("change",function(t){var e=t.target;e.matches("[data-cookie-toggle]")&&i(e)}),e.querySelectorAll("[data-cookie-action]").forEach(function(t){t.addEventListener("click",function(e){o(e);var s=t.getAttribute("data-cookie-action");return"accept"===s?(a("accept_all"),void r(t)):"reject"===s?(a("reject_all"),void r(t)):void("defaults"===s&&n().forEach(function(t){if(!t.disabled){var e="true"===t.dataset.defaultEnabled;t.checked=e,i(t)}}))})}),e.querySelectorAll(".submit_button_link").forEach(function(t){t.hasAttribute("data-cookie-action")||t.addEventListener("click",function(e){e.defaultPrevented||(o(e),a("update"),r(t))})}
10),n().forEach(function(t){i(t)}))}function n(){return Array.prototype.slice.call(e.querySelectorAll("[data-cookie-toggle]"))}function o(t){t.preventDefault(),t.stopPropagation(),"function"==typeof t.stopImmediatePropagation&&t.stopImmediatePropagation()}function i(t){var e=t.closest("[data-cookie-row]")||t.closest(".cookie-card"),n=e&&e.querySelector("[data-cookie-toggle-label]");if(n){var o=t.dataset.labelOn||n.textContent,i=t.dataset.labelOff||n.textContent;n.textContent=t.checked?o:i}}function a(t){var n=e.querySelector('input[name="widget_action"]');n&&(n.value=t)}function r(t){var n=t&&t.previousElementSibling;if(n&&"INPUT"===n.tagName&&"submit"===n.type)n.click();else{var o=e.querySelector('input[type="submit"]');o?o.click():"function"==typeof e.requestSubmit?e.requestSubmit():e.submit()}}}),function(t){"use strict";t.ajaxPrefilter(function(t,e,n){if(t.iframe)return"iframe"}),t.ajaxTransport("iframe",function(e,n,o){var i,a=null,r=null,s="iframe-"+t.now(),l=t(e.files).filter(":file:enabled"),c=null;function u(){c.each(function(e){t(this).replaceWith(l[e]),c.splice(e,1)}),a.remove(),r.bind("load",function(){r.remove()}),r.attr("src","about:blank")}if(e.dataTypes.shift(),l.length)return a=t("<form enctype='multipart/form-data' method='post'></form>").hide().attr({action:e.url,target:s}),"string"==typeof e.data&&e.data.length>0&&t.error("data must not be serialized"),t.each(e.data||{}
10,function(e,n){t.isPlainObject(n)&&(e=n.name,n=n.value),t("<input type='hidden' />").attr({name:e,value:n}).appendTo(a)}),t("<input type='hidden' value='IFrame' name='X-Requested-With' />").appendTo(a),i=e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+("*"!==e.dataTypes[0]?", */*; q=0.01":""):e.accepts["*"],t("<input type='hidden' name='X-Http-Accept'>").attr("value",i).appendTo(a),c=l.after(function(e){return t(this).clone().prop("disabled",!0)}).next(),l.appendTo(a),{send:function(e,n){(r=t("<iframe src='about:blank' name='"+s+"' id='"+s+"' style='display:none'></iframe>")).bind("load",function(){r.unbind("load").bind("load",function(){var t=this.contentWindow?this.contentWindow.document:this.contentDocument?this.contentDocument:this.document,e=t.documentElement?t.documentElement:t.body,i=e.getElementsByTagName("textarea")[0],a=i&&i.getAttribute("data-type")||null,r=i&&i.getAttribute("data-status")||200,s=i&&i.getAttribute("data-statusText")||"OK",l={html:e.innerHTML,text:a?i.value:e?e.textContent||e.innerText:null};u(),o.responseText||(o.responseText=l.text),n(r,s,l,a?"Content-Type: "+a:null)}),a[0].submit()}),t("body").append(a,r)},abort:function(){null!==r&&(r.unbind("load").attr("src","javascript:false;"),u())}}})}(jQuery),function(t){var e;t.remotipart=e={setup:function(n){var o=n.data("ujs:submit-button"),i=t('meta[name="csrf-param"]').attr("content"),a=t('meta[name="csrf-token"]').attr("content"),r=n.find('input[name="'+i+'"]').length;n.one("ajax:beforeSend.remotipart",function(s,l,c){return delete c.beforeSend,c.iframe=!0,c.files=t(t.rails.fileInputSelector,n),c.data=n.serializeArray(),o&&c.data.push(o),c.files.each(function(t,e){for(var n=c.data.length-1;n>=0;n--)c.data[n].name==e.name&&c.data.splice(n,1)}),c.processData=!1,void 0===c.dataType&&(c.dataType="script *"),c.data.push({name:"remotipart_submitted",value:!0}),a&&i&&!r&&c.data.push({name:i,value:a}),t.rails.fire(n,"ajax:remotipartSubmit",[l,c])&&(t.rails.ajax(c).always(function(e){t.rails.fire(n,"ajax:remotipartComplete",[e])}),setTimeout(function(){t.rails.disableFormElements(n)},20)),e.teardown(n),!1}).data("remotipartSubmitted",!0)},teardown:function(t){t.unbind("ajax:beforeSend.remotipart").removeData("remotipartSubmitted")}},t(document).on("ajax:aborted:file","form",function(){var n=t(this);return e.setup(n),t.rails.handleRemote(n),!1})}(jQuery),function(){(function(){(function(){var e=[].slice;this.ActionCable={INTERNAL:{message_types:{welcome:"welcome",ping:"ping",confirmation:"confirm_subscription",rejection:"reject_subscription"},default_mount_path:"/cable",protocols:["actioncable-v1-json","actioncable-unsupported"]},WebSocket:window.WebSocket,logger:window.console,createConsumer:function(e){var n;return null==e&&(e=null!=(n=this.getConfig("url"))?n:this.INTERNAL.default_mount_path),new t.Consumer(this.createWebSocketURL(e))},getConfig:function(t){var e;return null!=(e=document.head.querySelector("meta[name='action-cable-"+t+"']"))?e.getAttribute("content"):void 0},createWebSocketURL:function(t){var e;return t&&!/^wss?:/i.test(t)?((e=document.createElement("a")).href=t,e.href=e.href,e.protocol=e.protocol.replace("http","ws"),e.href):t},startDebugging:function(){return this.debugging=!0},stopDebugging:function(){return this.debugging=null},log:function(){var t,n;if(t=1<=arguments.length?e.call(arguments,0):[],this.debugging)return t.push(Date.now()),(n=this.logger).log.apply(n,["[ActionCable]"].concat(e.call(t)))}}}).call(this)}).call(this);var t=this.ActionCable;(function(){(function(){t.ConnectionMonitor=function(){var e,n,o;function i(t){var e,n;this.connection=t,this.visibilityDidChange=(e=this.visibilityDidChange,n=this,function(){return e.apply(n,arguments)}),this.reconnectAttempts=0}return i.pollInterval={min:3,max:30},i.staleThreshold=6,i.prototype.start=function(){if(!this.isRunning())return this.startedAt=n(),delete this.stoppedAt,this.startPolling(),document.addEventListener("visibilitychange",this.visibilityDidChange),t.log("ConnectionMonitor started. pollInterval = "+this.getPollInterval()+" ms")},i.prototype.stop=function(){if(this.isRunning())return this.stoppedAt=n(),this.stopPolling(),document.removeEventListener("visibilitychange",this.visibilityDidChange),t.log("ConnectionMonitor stopped")},i.prototype.isRunning=function(){return null!=this.startedAt&&null==this.stoppedAt},i.prototype.recordPing=function(){return this.pingedAt=n()},i.prototype.recordConnect=function(){return this.reconnectAttempts=0,this.recordPing(),delete this.disconnectedAt,t.log("ConnectionMonitor recorded connect")},i.prototype.recordDisconnect=function(){return this.disconnectedAt=n(),t.log("ConnectionMonitor recorded disconnect")},i.prototype.startPolling=function(){return this.stopPolling(),this.poll()},i.prototype.stopPolling=function(){return clearTimeout(this.pollTimeout)},i.prototype.poll=function(){return this.pollTimeout=setTimeout((t=this,function(){return t.reconnectIfStale(),t.poll()}),this.getPollInterval());var t},i.prototype.getPollInterval=function(){var t,n,o,i;return o=(i=this.constructor.pollInterval).min,n=i.max,t=5*Math.log(this.reconnectAttempts+1),Math.round(1e3*e(t,o,n))},i.prototype.reconnectIfStale=function(){if(this.connectionIsStale())return t.log("ConnectionMonitor detected stale c
10onnection. reconnectAttempts = "+this.reconnectAttempts+", pollInterval = "+this.getPollInterval()+" ms, time disconnected = "+o(this.disconnectedAt)+" s, stale threshold = "+this.constructor.staleThreshold+" s"),this.reconnectAttempts++,this.disconnectedRecently()?t.log("ConnectionMonitor skipping reopening recent disconnect"):(t.log("ConnectionMonitor reopening"),this.connection.reopen())},i.prototype.connectionIsStale=function(){var t;return o(null!=(t=this.pingedAt)?t:this.startedAt)>this.constructor.staleThreshold},i.prototype.disconnectedRecently=function(){return this.disconnectedAt&&o(this.disconnectedAt)<this.constructor.staleThreshold},i.prototype.visibilityDidChange=function(){if("visible"===document.visibilityState)return setTimeout((e=this,function(){if(e.connectionIsStale()||!e.connection.isOpen())return t.log("ConnectionMonitor reopening stale connection on visibilitychange. visbilityState = "+document.visibilityState),e.connection.reopen()}),200);var e},n=function(){return(new Date).getTime()},o=function(t){return(n()-t)/1e3},e=function(t,e,n){return Math.max(e,Math.min(n,t))},i}()}).call(this),function(){var e,n,o,i,a,r=[].slice,s=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1};i=t.INTERNAL,n=i.message_types,o=i.protocols,a=2<=o.length?r.call(o,0,e=o.length-1):(e=0,[]),o[e++],t.Connection=function(){function e(e){var n,o;this.consumer=e,this.open=(n=this.open,o=this,function(){return n.apply(o,arguments)}),this.subscriptions=this.consumer.subscriptions,this.monitor=new t.ConnectionMonitor(this),this.disconnected=!0}return e.reopenDelay=500,e.prototype.send=function(t){return!!this.isOpen()&&(this.webSocket.send(JSON.stringify(t)),!0)},e.prototype.open=function(){return this.isActive()?(t.log("Attempted to open WebSocket, but existing socket is "+this.getState()),!1):(t.log("Opening WebSocket, current state is "+this.getState()+", subprotocols: "+o),null!=this.webSocket&&this.uninstallEventHandlers(),this.webSocket=new t.WebSocket(this.consumer.url,o),this.installEventHandlers(),this.monitor.start(),!0)},e.prototype.close=function(t){var e;if((null!=t?t:{allowReconnect:!0}).allowReconnect||this.monitor.stop(),this.isActive())return null!=(e=this.webSocket)?e.close():void 0},e.prototype.reopen=function(){var e;if(t.log("Reopening WebSocket, current state is "+this.getState()),!this.isActive())return this.open();try{return this.close()}catch(n){return e=n,t.log("Failed to reopen WebSocket",e)}finally{t.log("Reopening WebSocket in "+this.constructor.reopenDelay+"ms"),setTimeout(this.open,this.constructor.reopenDelay)}},e.prototype.getProtocol=function(){var t;return null!=(t=this.webSocket)?t.protocol:void 0},e.prototype.isOpen=function(){return this.isState("open")},e.prototype.isActive=function(){return this.isState("open","connecting")},e.prototype.isProtocolSupported=function(){var t;return t=this.getProtocol(),s.call(a,t)>=0},e.prototype.isState=function(){var t,e;return e=1<=arguments.length?r.call(arguments,0):[],t=this.getState(),s.call(e,t)>=0},e.prototype.getState=function(){var t,e;for(e in WebSocket)if(WebSocket[e]===(null!=(t=this.webSocket)?t.readyState:void 0))return e.toLowerCase();return null},e.prototype.installEventHandlers=function(){var t,e;for(t in this.events)e=this.events[t].bind(this),this.webSocket["on"+t]=e},e.prototype.uninstallEventHandlers=function(){var t;for(t in this.events)this.webSocket["on"+t]=function(){}},e.prototype.events={message:function(t){var e,o,i;if(this.isProtocolSupported())switch(e=(i=JSON.parse(t.data)).identifier,o=i.message,i.type){case n.welcome:return this.monitor.recordConnect(),this.subscriptions.reload();case n.ping:return this.monitor.recordPing();case n.confirmation:return this.subscriptions.notify(e,"connected");case n.rejection:return this.subscriptions.reject(e);default:return this.subscriptions.notify(e,"received",o)}},open:function(){if(t.log("WebSocket onopen event, using '"+this.getProtocol()+"' subprotocol"),this.disconnected=!1,!this.isProtocolSupported())return t.log("Protocol is unsupported. Stopping monitor and disconnecting."),this.close({allowReconnect:!1})},close:function(e){if(t.log("WebSocket onclose event"),!this.disconnected)return this.disconnected=!0,this.monitor.recordDisconnect(),this.subscriptions.notifyAll("disconnected",{willAttemptReconnect:this.monitor.isRunning()})},error:function(){return t.log("WebSocket onerror event")}},e}()}.call(this),function(){var e=[].slice;t.Subscriptions=function(){function n(t){this.consumer=t,this.subscriptions=[]}return n.prototype.create=function(e,n){var o,i,a;return i="object"==typeof(o=e)?o:{channel:o},a=new t.Subscription(this.consumer,i,n),this.add(a)},n.prototype.add=function(t){return this.subscriptions.push(t),this.consumer.ensureActiveConnection(),this.notify(t,"initialized"),this.sendCommand(t,"subscribe"),t},n.prototype.remove=function(t){return this.forget(t),this.findAll(t.identifier).length||this.sendCommand(t,"unsubscribe"),t},n.prototype.reject=function(t){var e,n,o,i,a;for(i=[],e=0,n=(o=this.findAll(t)).length;e<n;e++)a=o[e],this.forget(a),this.notify(a,"rejected"),i.push(a);return i},n.prototype.forget=function(t){var e;return this.subscriptions=function(){var n,o,i,a;for(a=[],n=0,o=(i=this.subscriptions).length;n<o;n++)(e=i[n])!==t&&a.push(e);return a}.call(this),t},n.prototype.findAll=function(t){var e,n,o,i,a;for(i=[],e=0,n=(o=this.subscriptions).length;e<n;e++)(a=o[e]).identifier===t&&i.push(a);return i},n.prototype.reload=function(){var t,e,n,o,i;for(o=[],t=0,e=(n=this.subscriptions).length;t<e;t++)i=n[t],o.push(this.sendCommand(i,"subscribe"));return o},n.prototype.notifyAll=function(){var t,n,o,i,a,r,s;
10for(n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],r=[],o=0,i=(a=this.subscriptions).length;o<i;o++)s=a[o],r.push(this.notify.apply(this,[s,n].concat(e.call(t))));return r},n.prototype.notify=function(){var t,n,o,i,a,r,s;for(r=arguments[0],n=arguments[1],t=3<=arguments.length?e.call(arguments,2):[],a=[],o=0,i=(s="string"==typeof r?this.findAll(r):[r]).length;o<i;o++)r=s[o],a.push("function"==typeof r[n]?r[n].apply(r,t):void 0);return a},n.prototype.sendCommand=function(t,e){var n;return n=t.identifier,this.consumer.send({command:e,identifier:n})},n}()}.call(this),function(){t.Subscription=function(){var t;function e(e,n,o){this.consumer=e,null==n&&(n={}),this.identifier=JSON.stringify(n),t(this,o)}return e.prototype.perform=function(t,e){return null==e&&(e={}),e.action=t,this.send(e)},e.prototype.send=function(t){return this.consumer.send({command:"message",identifier:this.identifier,data:JSON.stringify(t)})},e.prototype.unsubscribe=function(){return this.consumer.subscriptions.remove(this)},t=function(t,e){var n,o;if(null!=e)for(n in e)o=e[n],t[n]=o;return t},e}()}.call(this),function(){t.Consumer=function(){function e(e){this.url=e,this.subscriptions=new t.Subscriptions(this),this.connection=new t.Connection(this)}return e.prototype.send=function(t){return this.connection.send(t)},e.prototype.connect=function(){return this.connection.open()},e.prototype.disconnect=function(){return this.connection.close({allowReconnect:!1})},e.prototype.ensureActiveConnection=function(){if(!this.connection.isActive())return this.connection.open()},e}()}.call(this)}).call(this),"object"==typeof module&&module.exports?module.exports=t:"function"==typeof define&&define.amd&&define(t)}.call(this);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.