(function(w){
    // Config objs
    var config = {
        endpoint: 'https://a11ystatusfb.usablenet.com/lv/aaas/csaa/6d5e363f18b41614a9ba9328a94f46b5c8d3ab586e2/feedback',
        tokenURI: 'https://a11ystatusfb.usablenet.com/lv/aaas/csaa/6d5e363f18b41614a9ba9328a94f46b5c8d3ab586e2/token',
        panelHTML: '<button id="un-s-open" aria-haspopup="dialog" lang="en">About Accessibility Status</button><div id="un-s" role="dialog" aria-hidden="true" aria-modal="true"></div><div id="un-s-overlay"></div>',
        panelContentHTML: ' <div id="un-s-header" class="un-s-component"> <button id="un-s-close" class="un-s-bold" title="Closes the Accessibility Status panel">Close</button> </div> <div id="un-s-wrapper" class="un-s-component"> <h1 id="un-s-title">Accessibility Status</h1> <div id="un-s-badge"> <svg version="1.1" id="Livello_1" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 141.3 135.4" style="enable-background:new 0 0 141.3 135.4;" xml:space="preserve"><style type="text/css">.st0{fill:#03446D;}.st1{fill:#FFFFFF;}</style><path class="st0" d="M136.2,55.2c-1.7-2.6-3.2-5-4-7.5c-0.9-2.6-1-5.7-1.2-8.7c-0.3-4.6-0.5-9.3-3.1-12.8c-2.6-3.6-7-5.3-11.3-7c-2.8-1.1-5.7-2.2-7.9-3.8c-2.2-1.6-4-3.8-6-6.2c-2.9-3.6-5.9-7.3-10.2-8.7c-4.1-1.3-8.6-0.1-13,1c-3,0.8-6,1.6-8.9,1.6c-2.8,0-5.9-0.8-8.9-1.6c-4.4-1.1-8.9-2.3-13-1c-4.3,1.4-7.3,5.1-10.2,8.7c-1.9,2.4-3.8,4.7-6,6.2c-2.2,1.6-5.1,2.7-7.9,3.8c-4.3,1.7-8.7,3.4-11.3,7c-2.6,3.5-2.9,8.3-3.1,12.8c-0.2,3-0.4,6.1-1.2,8.7c-0.8,2.5-2.4,4.9-4,7.5C2.6,59.1,0,63.1,0,67.7c0,4.6,2.6,8.6,5.1,12.5c1.7,2.6,3.2,5,4,7.5c0.9,2.6,1,5.7,1.2,8.7c0.3,4.6,0.5,9.3,3.1,12.8c2.6,3.6,7,5.3,11.3,7c2.8,1.1,5.7,2.2,7.9,3.8c2.2,1.6,4,3.8,6,6.2c2.9,3.6,5.9,7.3,10.2,8.7c1.3,0.4,2.6,0.6,4,0.6c3,0,6-0.8,9-1.6c3-0.8,6-1.6,8.9-1.6s5.9,0.8,8.9,1.6c4.4,1.1,8.9,2.3,13,1c4.3-1.4,7.3-5.1,10.2-8.7c1.9-2.4,3.8-4.7,6-6.2c2.2-1.6,5.1-2.7,7.9-3.8c4.3-1.7,8.7-3.4,11.3-7c2.6-3.5,2.9-8.3,3.1-12.8c0.2-3,0.4-6.1,1.2-8.7c0.8-2.5,2.4-4.9,4-7.5c2.5-3.9,5.1-7.9,5.1-12.5C141.3,63.1,138.7,59.1,136.2,55.2z"/><path class="st1" d="M28.4,48c-0.4,0.9-1.5,1.3-2.4,0.8c-0.9-0.4-1.3-1.5-0.8-2.4c0.4-0.9,1.5-1.3,2.3-0.8C28.4,46.1,28.8,47.1,28.4,48C28.4,48,28.4,48,28.4,48z"/><path class="st1" d="M37.9,32.7c1.9,1.8,1.9,3.7,0.4,5.4s-3.5,1.9-5.4,0.2l-3.7-3.4l1-1.1l3.7,3.4c1.2,1.1,2.4,1.1,3.3,0s0.9-2.2-0.3-3.3l-3.7-3.4l1-1.1L37.9,32.7z"/><path class="st1" d="M42.8,27.3c1.8-0.7,2.9-0.7,3.8,0.5c1,1.4,0.5,2.9-1,4c-1.1,0.8-2.5,1.1-3.8,1l0.1-1.4c1,0.2,2.1-0.1,2.9-0.7c0.8-0.6,1-1.3,0.6-1.8c-0.4-0.5-0.9-0.6-2.4,0c-1.8,0.7-3,0.9-3.9-0.5c-0.9-1.2-0.5-2.8,1-3.8c0.9-0.7,2.1-1,3.2-0.9V25c-0.9-0.1-1.7,0.2-2.5,0.6c-0.7,0.5-0.9,1.2-0.6,1.7C40.7,27.9,41.2,27.9,42.8,27.3z"/><path class="st1" d="M57.8,25.3l-1.5,0.6l-1.7-1.6L50.8,26v2.3l-1.5,0.6l0.1-9.7l1.3-0.6L57.8,25.3z M50.8,20.7v3.8l2.8-1.2L50.8,20.7z"/><path class="st1" d="M65.6,17.2c0.2,0.8-0.2,1.7-0.9,2.2c1,0,1.9,0.8,2.1,1.8c0.3,1.6-0.9,2.6-2.8,2.9l-4,0.7l-1.5-8.7l3.9-0.7C64.1,15.2,65.4,15.8,65.6,17.2z M64.1,17.7c-0.1-0.7-0.7-1-1.7-0.8l-2.2,0.4l0.4,2.3l2.1-0.4C63.7,19,64.3,18.5,64.1,17.7L64.1,17.7z M65.2,21.3c-0.1-0.7-0.8-1.1-2-0.9l-2.4,0.4l0.4,2.4l2.5-0.4C64.8,22.6,65.4,22.1,65.2,21.3L65.2,21.3z"/><path class="st1" d="M70,14.7l1.5,0.1l-0.3,7.4l4.6,0.2l-0.1,1.4l-6.2-0.2L70,14.7z"/><path class="st1" d="M86.3,18.4l-4.8-1.2L81,19.5l4.3,1l-0.3,1.3l-4.3-1l-0.6,2.3l4.9,1.2l-0.3,1.3l-6.4-1.5l2.1-8.5l6.3,1.5L86.3,18.4z"/><path class="st1" d="M96.5,21.4l1.4,0.7l-3.9,7.9l-1.2-0.6l-1.6-7.7l-2.8,5.6l-1.4-0.7l3.9-7.9l1.3,0.6l1.5,7.5L96.5,21.4z"/><path class="st1" d="M106.2,30l-3.8-3.1l-1.4,1.8l3.4,2.8l-0.9,1.1l-3.4-2.8l-1.5,1.8l3.9,3.2l-0.9,1.1l-5.1-4.2l5.6-6.8l5,4.1L106.2,30z"/><path class="st1" d="M105.7,40.5l-1-1.2l5.7-4.6l-1.8-2.2l1.1-0.9l4.5,5.5l-1.1,0.9l-1.8-2.2L105.7,40.5z"/><path class="st1" d="M114.1,49.8c-0.4-0.9,0.1-1.9,1-2.3c0.9-0.4,1.9,0.1,2.3,1c0.4,0.9-0.1,1.9-1,2.3C115.5,51.2,114.5,50.8,114.1,49.8z"/><path class="st1" d="M23.9,61.3c-0.7,1.8-1.5,2.6-3,2.4c-1.6-0.2-2.4-1.7-2.1-3.5c0.2-1.3,0.9-2.6,1.9-3.4l1,1.1c-0.8,0.6-1.4,1.6-1.5,2.6c-0.1,0.9,0.2,1.6,0.9,1.7c0.6,0.1,1-0.2,1.6-1.8c0.7-1.8,1.4-2.7,3-2.5c1.5,0.2,2.3,1.6,2.1,3.3c-0.2,1.2-0.7,2.2-1.6,3l-1-1c0.6-0.6,1.1-1.4,1.2-2.2c0.1-0.9-0.2-1.5-0.8-1.6C24.9,59.3,24.5,59.7,23.9,61.3z"/><path class="st1" d="M26,73.5l-0.3-5l-2.3,0.1l0.2,4.4l-1.4,0.1L22,68.8l-2.4,0.1l0.3,5L18.6,74l-0.3-6.6L27,67l0.3,6.5L26,73.5z"/><path class="st1" d="M21.6,86.5l-0.4-1.6l1.8-1.4l-1.1-4l-2.3-0.3l-0.4-1.5l9.6,1.3l0.4,1.4L21.6,86.5z M27,80.1l-3.8-0.5l0.8,2.9L27,80.1z"/><path class="st1" d="M31,86l0.7,1.4l-6.5,3.5l2.2,4.1l-1.2,0.7l-2.9-5.4L31,86z"/><path class="st1" d="M34.1,105.5c-1.8-1.7-1.9-4.5-0.3-6.3c0,0,0.1-0.1,0.1-0.1c1.7-1.8,4.6-1.9,6.5-0.2c1.8,1.7,1.9,4.6,0.2,6.5C38.9,107.2,36,107.3,34.1,105.5C34.1,105.5,34.1,105.5,34.1,105.5z M39.4,100c-1.2-1.1-3.1-1.1-4.2,0.1c0,0-0.1,0.1-0.1,0.1c-1.2,1.1-1.3,3.1-0.1,4.3c0,0,0,0,0.1,0.1c1.2,1.1,3.1,1.1,4.2-0.1c0,0,0.1-0.1,0.1-0.1C40.6,103.2,40.7,101.3,39.4,100C39.5,100,39.5,100,39.4,100L39.4,100z"/><path class="st1" d="M50.7,108.3l-4.3-2.6l-1.2,2.1l3.8,2.3l-0.7,1.2l-3.8-2.3l-1.8,3.1l-1.3-0.8l4.5-7.5l5.6,3.4L50.7,108.3z"/><path class="st1" d="M58.7,119c-2.4-0.6-3.9-3.1-3.2-5.5c0.6-2.4,3.1-3.9,5.5-3.3c1.3,0.3,2.4,1,3,2.1l-1.2,0.9c-0.5-0.8-1.2-1.4-2.1-1.6c-1.7-0.3-3.3,0.9-3.6,2.6c-0.3,1.5,0.6,3,2.1,3.5c0.9,0.2,1.9,0,2.7-0.5l0.7,1.2C61.4,119.1,60,119.4,58.7,119z"/><path class="st1" d="M70.4,120.4c-2.5-0.1-4.5-2.1-4.4-4.6c0.1-2.5,2.1-4.5,4.6-4.4c2.5,0.1,4.5,2.1,4.4,4.6c0,2.5-2,4.5-4.5,4.5C70.5,120.4,70.4,120.4,70.4,120.4z M70.4,112.8c-1.6,0-3,1.3-3,2.9c0,0,0,0.1,0,0.1c-0.1,1.7,1.2,3.1,2.9,3.2c0,0,0.1,0,0.1,0c1.6,0,3-1.3,3-3c0,0,0-0.1,0-0.1C73.5,114.3,72.2,112.8,70.4,112.8C70.5,112.8,70.5,112.8,70.4,112.8L70.4,112.8z"/><path class="st1" d="M83.7,116.5L83.7,116.5l-3.8-3.3l1.6,6.1l-1.5,0.4l-2.2-8.5l1.6-0.4l3.6,3.3l1.5-4.7l1.6-0.4l2.2,8.5l-1.5,0.4l-1.6-6.1L83.7,116.5z"/><path class="st1" d="M94.6,111.4l-1.5,0.8l1.3,2.5l-1.4,0.7l-4.1-7.7l3-1.6c1.8-1,3.5-0.6,4.3,1C97.2,108.9,96.3,110.5,94.6,111.4z M92.5,107.4l-1.6,0.9l1.5,2.8l1.6-0.8c0.9-0.3,1.3-1.2,1-2.1c0-0.1,0-0.1-0.1-0.2C94.4,107,93.5,106.9,92.5,107.4L92.5,107.4z"/><path class="st1" d="M96.5,103.3l1.2-1l4.7,5.7l3.6-2.9l0.9,1.1l-4.8,3.9L96.5,103.3z"/><path class="st1" d="M103.6,96.8l6.5,6l-1,1.1l-6.5-6L103.6,96.8z"/><path class="st1" d="M117.3,92.7l-0.9,1.4l-2.3-0.4l-2.3,3.5l1.3,1.9l-0.9,1.3l-5.3-8.1l0.8-1.2L117.3,92.7z M109,92.7l2.1,3.2l1.7-2.5L109,92.7z"/><path class="st1" d="M112.9,80l0.5-1.4l8.3,2.9l-0.4,1.2l-7.5,2.5l5.9,2.1l-0.5,1.4l-8.3-2.9l0.5-1.4l7.3-2.4L112.9,80z"/><path class="st1" d="M123.4,72.6c-0.3,2.5-2.5,4.3-5,4c-2.5-0.3-4.3-2.5-4-5l0,0c0.1-1.3,0.7-2.5,1.7-3.3l1,1.1c-0.7,0.6-1.2,1.4-1.3,2.3c-0.1,1.7,1.3,3.2,3,3.2c1.6,0,2.9-1,3.2-2.6c0.1-1-0.2-1.9-0.9-2.6l1.1-0.9C123.1,69.9,123.6,71.2,123.4,72.6z"/><path class="st1" d="M115.4,59.3l0.5,4.9l2.3-0.3l-0.5-4.4l1.4-0.2l0.5,4.4l2.3-0.3l-0.6-5l1.4-0.2l0.7,6.5l-8.7,1l-0.7-6.5L115.4,59.3z"/><g><path class="st1" d="M52.8,83.3l0.4-0.4c-5.1-4.5-8.3-11.1-8.3-18.5c0-13.7,11.1-24.8,24.8-24.8s24.8,11.1,24.8,24.8c0,1-0.1,1.9-0.2,2.9l0.6-0.6C95,66,95,65.2,95,64.4c0-14-11.4-25.3-25.3-25.3c-14,0-25.3,11.4-25.3,25.3C44.4,71.9,47.6,78.6,52.8,83.3z"/></g><polygon class="st1" points="70.7,103.6 52.4,85.4 57.9,79.9 70.7,92.7 101.7,61.7 107.1,67.1 "/><path class="st1" d="M77.3,81.6c0.2,0,0.4,0,0.5-0.2l0,0c0.7-0.3,1-1,0.7-1.7L74.3,66v-8c0-0.4,0.4-1,0.8-1c2.6,0,5.2-0.2,7.8-0.6c0.8,0,1.1-0.8,1.1-1.5c0-0.8-0.8-1.1-1.5-1.1c-7.9,0.8-15.8,0.8-23.7,0c-0.7-0.1-1.4,0.4-1.5,1.1c-0.1,0.7,0.4,1.4,1.1,1.5c1.7,0.3,3.4,0.3,5.1,0.4c0.9,0,1.8,0.1,2.6,0.2c0.5,0.1,0.9,0.5,0.8,1l0,8l-4.3,13.8c-0.2,0.6-0.1,1.5,0.7,1.7c0,0,0,0,0,0c0.1,0,0.2,0.1,0.3,0.1c0.1,0,0.2,0.1,0.3,0.1c0.5,0,0.9-0.3,1.1-0.7L69.8,70c0.2-0.4,0.6-0.7,1-0.6c0.3,0,0.6,0.3,0.7,0.6l4.7,10.9C76.3,81.3,76.8,81.6,77.3,81.6C77.3,81.6,77.3,81.6,77.3,81.6z"/><path class="st1" d="M70.7,46.6c-1.9,0-3.4,1.5-3.4,3.4s1.5,3.4,3.4,3.4h0c0.9,0,1.8-0.4,2.4-1s1-1.5,1-2.4C74.1,48.1,72.6,46.6,70.7,46.6z"/></svg> <hr aria-hidden="true"/> </div> <p> To make sure everyone can use this website without barriers we have engaged the accessibility services of UsableNet Inc. </p> <p> This screen provides information about this website’s ongoing efforts to keep the site accessible and usable by people with disabilities. </p> <p> In addition, as part of our commitment to accessibility, you can find <span style="display:none">a contact us form for accessibility support at the end of this panel and</span> an accessibility statement in the footer of every page of this website. </p> <h2>Status of verification services:</h2> <ul id="un-s-status"> <li class="un-s-bold"> Site key task verified by blind users with screen readers.<br/> <span class="ok-status">Active and ongoing</span> </li> <li class="un-s-bold"> Monitoring of pages against WCAG.<br/> <span class="ok-status">Active and ongoing</span> </li> <li class="un-s-bold"> Annual Audit and User Testing.<br/> <span class="ok-status">Active and ongoing</span> </li> <li class="un-s-bold"> Accessibility Statement with access to support on every page.<br/> <span class="ok-status">Active and in place</span> </li> </ul> <p> This website qualifies to display the UsableNet Accessible Certification Seal, as it has achieved a high level of accessibility along with documented ongoing efforts to support the disability community. This includes consistent testing with assistive technologies and code assessments. </p> <div style="display:none"> <h2>Contact for Accessibility Support</h2> <form onSubmit="return false;" id="un-s-feedback" name="un-s-feedback"> <fieldset id="un-s-srq" class="un-s-input-row"> <legend class="un-s-input-label un-s-bold"> <sup>*</sup>Do you use assistive technology such as a screen reader? </legend> <div id="un-s-radio-row"> <div class="un-s-radio-wrapper"> <input type="radio" id="un-s-btn-yes" name="at" aria-required="true"/> <label for="un-s-btn-yes" class="un-s-bold">Yes</label> </div> <div class="un-s-radio-wrapper"> <input type="radio" id="un-s-btn-no" name="at" aria-required="true" /> <label for="un-s-btn-no" class="un-s-bold">No</label> </div> </div> <div class="un-s-error-txt"> Please select an answer. </div> </fieldset> <div class="un-s-input-row"> <label class="un-s-input-label un-s-bold" for="un-s-i-msg"> <sup>*</sup>How can we help? </label> <textarea class="un-s-input" id="un-s-i-msg" name="content" rows="4" aria-required="true"></textarea> <div class="un-s-error-txt"> This field is required. </div> </div> <div class="un-s-input-row"> <label class="un-s-input-label un-s-bold" for="un-s-i-name"> <sup>*</sup>Name </label> <input type="text" class="un-s-input" name="name" id="un-s-i-name" autocomplete="name" aria-required="true"> <div class="un-s-error-txt"> This field is required. </div> </div> <div class="un-s-input-row"> <label class="un-s-input-label un-s-bold" for="un-s-i-email"> <sup>*</sup>Email </label> <input type="email" class="un-s-input" name="email" id="un-s-i-email" autocomplete="email" aria-required="true"> <div class="un-s-error-txt"> This field is required. </div> </div> <div class="un-s-input-row"> <button id="un-s-submit" class="un-s-bold">Submit feedback</button> </div> <input type="hidden" name="token" id="un-s-token" value=""/> </form> </div> <div id="un-s-confirmation" tabindex="-1"> <p class="un-s-d un-s-bold">Thank you for submitting.</p> <p class="un-s-l un-s-bold">Your message has been forwarded and you should expect a response shortly.</p> <p class="un-s-d un-s-bold"> UsableNet Team </p> </div> </div>',
        buttonCSS: '#un-s-open{line-height: 50px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; padding: 0 30px; background: #fff; color: #333; font-weight:bold; font-size: 14px; border-radius: 3px; border: none; box-shadow: 0px 0px 12px #00000080; letter-spacing: 0.02px; text-decoration: none; white-space:nowrap;}#un-s-open.un-s-dark{color:#FFF; background:#111111;}#un-s-open:focus, #un-s-open[aria-expanded=true]{outline: 4px solid rgba(0,125,250,0.6); outline-offset: 4px;}',
        defaultCSS: ' .un-s-sr-only{overflow: hidden !important; width: 0px !important; height: 0px !important;} .un-s-hide{display: none;} #un-s-open{position: fixed; top: -100px; left: 18px; opacity: 0; z-index: 999999; transition: opacity .5s;}#un-s-open:focus, #un-s-open[aria-expanded=true]{top: 18px; opacity: 1;}#un-s-open.un-s-out{transition: opacity .5s, top 1s;}#un-s-open.un-s-center{left: 50%; transform: translate(-50%, 0);}#un-s-open.un-s-right{left: auto; right: 18px;}#un-s{position: fixed; left: 50%; transform: translate(-50%, 0); background: #fff; z-index: 99999999; overflow: hidden; opacity: 0; top: 10px; transition: opacity .5s; width: 0; height: 0; background: #FAFAFA; overflow: hidden; box-shadow: 0px 6px 12px #00000029;}#un-s.un-s-open{opacity: 1; height: calc(100vh - 20px); width: 80vw; max-width: 650px;}#un-s .un-s-component{display: none;}#un-s.un-s-open .un-s-component{display: block;}#un-s *{font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: 0.02px;}#un-s a, #un-s a:visited{color:#0066CC !important;}#un-s button:focus, #un-s input:focus, #un-s textarea:focus{border: 1px solid #0070C9; -webkit-box-shadow: 0 0 0 4px rgba(0,125,250,0.6); box-shadow: 0 0 0 4px rgba(0,125,250,0.6); outline: none;}#un-s sup{vertical-align: top; margin-right: 3px;}#un-s a:focus{outline: 4px solid rgba(0,125,250,0.6);}#un-s p{font-size: 16px; line-height: 24px; color: #666; margin: 30px 0;}#un-s-overlay{display: none; position: fixed; top: 0; left: 0; width: 0; height: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .5s; z-index: 9999999;}#un-s.un-s-open + #un-s-overlay{display: block; opacity: .55; width: 100vw; height: 100vh;}#un-s-header{padding: 30px; text-align: right;}#un-s-close{font-size: 14px; height: 44px; border-radius: 4px; border: 1px solid #989494; background: #FFF; padding: 0 16px 0 30px; background-image: url(\'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMi4xMjEiIGhlaWdodD0iMTIuMTIxIiB2aWV3Qm94PSIwIDAgMTIuMTIxIDEyLjEyMSI+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTk4Ny44NTEgLTEyMi44NTEpIj48bGluZSB5MT0iMTAiIHgyPSIxMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoOTg4LjkxMiAxMjMuOTEyKSIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjNjY2IiBzdHJva2Utd2lkdGg9IjMiLz48bGluZSB4Mj0iMTAiIHkyPSIxMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoOTg4LjkxMiAxMjMuOTEyKSIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjNjY2IiBzdHJva2Utd2lkdGg9IjMiLz48L2c+PC9zdmc+\'); background-position: 16px center; background-repeat: no-repeat; background-size: 11px; color: #666;}#un-s-close:hover{color: #333 !important; background-image: url(\'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMi4xMjEiIGhlaWdodD0iMTIuMTIxIiB2aWV3Qm94PSIwIDAgMTIuMTIxIDEyLjEyMSI+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTk4Ny44NTEgLTEyMi44NTEpIj48bGluZSB5MT0iMTAiIHgyPSIxMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoOTg4LjkxMiAxMjMuOTEyKSIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMzMzIiBzdHJva2Utd2lkdGg9IjMiLz48bGluZSB4Mj0iMTAiIHkyPSIxMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoOTg4LjkxMiAxMjMuOTEyKSIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMzMzIiBzdHJva2Utd2lkdGg9IjMiLz48L2c+PC9zdmc+\');}#un-s-wrapper{padding: 0px 50px 50px 50px; position: relative; overflow-x: hidden; overflow-y: scroll; height: calc(100vh - 180px); box-sizing: border-box;}#un-s h1{margin: 20px 0; font-size: 20px; line-height: 25px; color: #333;}#un-s h2{color: #333; font-size: 20px;}#un-s h1#un-s-title{text-align: center; font-size: 24px; line-height: 40px; margin: 0 0 30px 0;}#un-s-badge{text-align: center;}#un-s-badge svg{width: 124px;}#un-s-badge hr{width: 50px; margin: 30px auto; border: 1px solid #989494;}ul#un-s-status, #un-s-a11y-errors ul{list-style: none; margin: 0; padding: 0}ul#un-s-status > li{padding-bottom: 12px; border: 1px solid #ddd; padding: 15px 60px; margin-bottom: 10px; background: #FFF; border-radius: 6px; font-size: 16px; color:#666; line-height: 20px; background-image: url(\'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyOCIgaGVpZ2h0PSIyOCIgdmlld0JveD0iMCAwIDI4IDI4Ij48ZGVmcz48c3R5bGU+LmF7ZmlsbDojZGRlY2RjO30uYntmaWxsOiMxMThhMGY7fTwvc3R5bGU+PC9kZWZzPjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKC00OTYgLTgxMikiPjxwYXRoIGNsYXNzPSJhIiBkPSJNMTQsMEExNCwxNCwwLDEsMSwwLDE0LDE0LDE0LDAsMCwxLDE0LDBaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg0OTYgODEyKSIvPjxwYXRoIGNsYXNzPSJiIiBkPSJNNjk2Ljg5MSwyMTEuNjI1bC0xMC42NjcsMTAuNjY2LTUuMzMzLTUuMzMzLDEuNi0xLjYsMy43MzMsMy43MzMsOS4wNjYtOS4wNjdaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTc4Ljg5MSA2MDkuOTc1KSIvPjwvZz48L3N2Zz4=\'); background-position: 15px center; background-repeat: no-repeat; background-size: 30px;}#un-s .ok-status{color: green}.un-s-input-row{margin: 0 0 20px 0;}.un-s-input-label{display:block; padding: 0 0 .5rem 0; font-size: 14px; color: #333;}fieldset#un-s-srq{padding: 0; display: block; border: none;}fieldset#un-s-srq legend{float: left; width: 100%;}#un-s-radio-row{clear: both;}.un-s-radio-wrapper{position: relative; width: 70px; height: 44px; display: inline-block;}.un-s-radio-wrapper input[type="radio"]{-webkit-appearance: none; position: absolute; width: 100%; height: 100%; border: 1px solid #989494; border-radius: 4px; margin: 0; padding: 0; background-color: #fff;}.un-s-radio-wrapper + .un-s-radio-wrapper{margin-left: 10px;}.un-s-radio-wrapper input[type="radio"]:checked{border-width: 3px; border-color: #0070C9;}.un-s-radio-wrapper label{width: 100%; height: 100%; position: absolute; pointer-events: none; text-align: center; line-height: 44px; font-size: 14px; color: #333;}.un-s-input{width: 70%; border: 1px solid #989494; padding: 0 10px; font-size: 14px; height: 44px; line-height: 44px; border-radius: 4px; color: #666; box-sizing: border-box;}.un-s-i-error .un-s-input-label, .un-s-error-txt{color: #E30000 !important;}.un-s-i-error .un-s-input{border: 1px solid #E30000; background: #FFF2F4;}.un-s-error-txt{font-size: 12px; line-height: 20px; margin-top: 5px; display: none;}.un-s-i-error .un-s-error-txt{display: block;}textarea.un-s-input{resize: none; height: auto; line-height: 18px; padding: 5px 10px;}button#un-s-submit{background:#0066CC; border: none; font-size: 14px; color: #FFF; line-height: 44px; border-radius: 4px; padding: 0 15px; margin-top: 20px; box-sizing: border-box;}button#un-s-submit:hover{background:#0052A3 !important;}#un-s-confirmation{background: #FFF; padding: 20px 40px; display: none;}.un-s-success #un-s-confirmation{display: block;}.un-s-success #un-s-feedback{display: none;}#un-s-confirmation p{font-size: 18px; line-height: 26px; margin: 0;}.un-s-bold{font-weight: bold;}.un-s-d{color: #03446D !important;}.un-s-l{color: #497896 !important; margin-bottom: 30px !important;}@media all and (-ms-high-contrast: none), (-ms-high-contrast: active){ul#un-s-status > li{list-style-image: url(data:0);}.un-s-radio-wrapper input[type="radio"]{position: relative; width: 20px; height: 20px; border: 1px solid #989494;}.un-s-radio-wrapper label{width: auto; height: 20px; display: inline-block; position: relative; line-height: 20px; font-size: 14px; vertical-align: top;}}@media only screen and (max-width:485px){#un-s.un-s-open{position: fixed; left: 0; top: 0; transform: none; width: 100vw; height: 100vh; overflow: scroll}#un-s-header, #un-s-wrapper{padding-left: 15px; padding-right: 15px;}.un-s-input{width: 100%; font-size: 16px;}button#un-s-submit{width: 100%;}}@media only screen and (min-width:813px){#un-s-wrapper{padding-left: 80px; padding-right: 80px;}}#un-s-open.un-relative:focus{position:static;display:block;margin: 0 auto;text-align:center;}#un-s-open.un-relative{transition:none!important;}',
    };

    var errors = {"noInput": "The %label% field is empty; it is a required field and must be filled in.", "noAnswer": "No answer to: do you use assistive technology such as a screen reader?", "nErrors": "There are %n% errors in this form"};

    var buttonLabels = {"newtab": "(will open on a new tab)"};

    var unStatusUrl = 'https://a11ystatus.usablenet.com/lv/aaas/csaa/6d5e363f18b41614a9ba9328a94f46b5c8d3ab586e2/standalonehtml?domain=' + window.location.host;

    var panelInit = false;

    // Get the token
    var token = false;

    // Read style setup
    var thisScript = document.getElementById('UsableNetSeal');
    var color = thisScript ? thisScript.getAttribute('color') || thisScript.dataset.color : '';
    var position = thisScript ? thisScript.getAttribute('position') || thisScript.dataset.position : '';
    var additionalStyle = thisScript ? thisScript.getAttribute('css-style') || thisScript.dataset['css-style'] : '';
    var isRelative = thisScript ? thisScript.dataset['relative'] : '';

    if (thisScript) {
        thisScript.removeAttribute('css-style');
        thisScript.removeAttribute('data-css-style');
    }

    // Pointers
    var panel = document.createElement('div');
    var fform = null, toggle = null, panelEl, opener, firstEl, lastEl, lastElConf;

    // Detect mobile
    function detectMobile() {
        var isMobile = {
            Android: function() {
                return navigator.userAgent.match(/Android/i);
            },
            BlackBerry: function() {
                return navigator.userAgent.match(/BlackBerry/i);
            },
            iOS: function() {
                return navigator.userAgent.match(/iPhone|iPad|iPod/i);
            },
            Opera: function() {
                return navigator.userAgent.match(/Opera Mini/i);
            },
            Windows: function() {
                return navigator.userAgent.match(/IEMobile/i) || navigator.userAgent.match(/WPDesktop/i);
            },
            any: function() {
                return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
            }
        };
        var check = isMobile.any();
        return (check instanceof Array && isMobile.any().length > 0) || ((window.innerWidth <= 800) && (window.innerHeight <= 600)) || (window.orientation !== undefined);
    }

    function openWindow() {
        return window.open(unStatusUrl);
    }

    function newTabMsg() {
        var el = document.createElement('span');
        el.innerText = buttonLabels.newtab;
        el.setAttribute('style', 'display:inline-block;height:0!important;width:0!important;overflow:hidden!important;')
        return el;
    }

    // Tab trap functions
    function enableTabTrap(){
        firstEl.addEventListener('keydown', trapFirstElement, false);
        lastEl.addEventListener('keydown', trapLastElement, false);
    }

    function disableTabTrap(){
        firstEl.removeEventListener('keydown', trapFirstElement);
        lastEl.removeEventListener('keydown', trapLastElement);
    }

    function trapFirstElement(e) {
        if(e.shiftKey && e.keyCode == 9) {
            e.preventDefault();
            lastEl.focus();
        }
    }

    function trapLastElement(e) {
        if(!e.shiftKey && e.keyCode == 9) {
            e.preventDefault();
            firstEl.focus();
        }
    }

    function lastElTrap(e){
        e.preventDefault();
        if (panelEl.getAttribute('role') === 'dialog') {
            firstEl.focus();
        } else {
            toggle.focus();
            closeStatementDialog();
        }
    }
    // End tab trap functions

    // Escape key
    function handleEscape(e) {
        var key = e.which || e.keyCode;

        if (key === 27) {
            closeStatementDialog();
        }
    }

    function removeError(e) {
        var input = e.target;
        if (input.getAttribute('name') === 'at') {
            fform.querySelector('#un-s-srq').classList.remove('un-s-i-error');
            fform.querySelectorAll('#un-s-srq input[type="radio"]').forEach(function(input){
                input.removeAttribute("aria-describedby");
                input.removeAttribute("aria-invalid");
            })
        } else {
            input.parentNode.classList.remove('un-s-i-error');
            input.removeAttribute("aria-describedby");
            input.removeAttribute("aria-invalid");
        }
    }

    // Retrieve the token to submit form
    function getToken() {
        try {
            var xhr = new XMLHttpRequest();
            xhr.withCredentials = true;
            xhr.open("GET", config.tokenURI, true);
            xhr.onreadystatechange = function () {
                if(xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) {
                    // Add token
                    var tokenValue = JSON.parse(xhr.responseText).token;
                    panel.querySelector('#un-s-token').setAttribute('value', tokenValue);
                }
            };
            xhr.send(null);
            return true;
        } catch (e) {
            return false;
        }
    }

    // Serialize form data
    function urlencodeFormData(fd){
        var s = '';
        function encode(s){ return encodeURIComponent(s).replace(/%20/g,'+'); }
        var keys = Object.keys(fd);
        for(var i = 0; i < keys.length; i += 1){
            s += (s?'&':'') + encode(keys[i])+'='+encode(fd[keys[i]]);
        }
        s += '&domain=' + window.location.host;
        return s;
    }

    function validateForm() {
        var inputs = ['#un-s-i-msg', '#un-s-i-name', '#un-s-i-email', '#un-s-token'];
        var radios = fform.querySelectorAll('input[name="at"]');
        var radioValue = null;
        var isValid = true;
        var data = {};
        var a11yErrors = [];
        var errorIndex = 0;

        for (var i = 0, length = radios.length; i < length; i++) {
            if (radios[i].checked) {
                radioValue = radios[i].value;
                break;
            }
        }

        if (!radioValue) {
            fform.querySelector('#un-s-srq').classList.add('un-s-i-error');
            isValid = false;
            a11yErrors.push(errors.noAnswer);
            fform.querySelectorAll('#un-s-srq input[type="radio"]').forEach(function(input){
                input.setAttribute("aria-describedby", "error-"+errorIndex);
                input.setAttribute("aria-invalid", "true");
            })
            errorIndex += 1;
        } else {
            fform.querySelector('#un-s-srq').classList.remove('un-s-i-error');
        }

        data.at = radioValue;

        for (var i = 0; i < inputs.length; i += 1) {
            var current = inputs[i];
            var input = fform.querySelector(current);
            var name = input.getAttribute('name');
            var id = input.getAttribute('id');
            var value = input.value;

            data[input.getAttribute('name')] = value;

            if (name === 'token') continue;

            // ..do other validations here
            if (value.trim() === '') {
                input.parentNode.classList.add('un-s-i-error')
                isValid = false;

                var inputLabel = fform.querySelector('label[for="' + id + '"]').innerText;
                a11yErrors.push(errors.noInput.replace('%label%', inputLabel.replace("*", "")));
                input.setAttribute("aria-describedby", "error-"+errorIndex++);
                input.setAttribute("aria-invalid", "true");
            }
        }

        return { isValid: isValid, data: data, a11yErrors: a11yErrors, };
    }

    function buildA11yErrors(errorsList) {
        var container = panel.querySelector('#un-s-a11y-errors');

        if (container) {
            container.parentNode.removeChild(container);
        }

        container = document.createElement('div');
        container.setAttribute('id', 'un-s-a11y-errors');
        container.setAttribute('role', 'alert');
        container.setAttribute('tabindex', '-1');
        container.classList.add('un-s-sr-only');

        var title = document.createElement('h3');
        title.innerText = errors.nErrors.replace('%n%', errorsList.length);

        container.appendChild(title);

        var listContainer = document.createElement('ul');
        for (var i = 0; i < errorsList.length; i += 1) {
            var errorEl = document.createElement('li');
            errorEl.innerText = errorsList[i];
            errorEl.setAttribute("id", "error-"+i);
            listContainer.appendChild(errorEl);
        }

        container.appendChild(listContainer);

        if (fform) {
            fform.insertBefore(container, fform.childNodes[0]);
            container.focus();
        }
    }

    function submitForm(e) {
        if (e.isTrusted || e.isTrusted === undefined) {
            var formData = validateForm();
            if (formData.isValid) {
                var xhr = new XMLHttpRequest();
                xhr.withCredentials = true;
                xhr.open('POST', config.endpoint, true);
                xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');

                xhr.onreadystatechange = function () {
                    if(xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) {
                        var response = JSON.parse(xhr.responseText);
                        if (response.status === 'sent') {
                            panel.classList.add('un-s-success');

                            var confirmation = panel.querySelector('#un-s-confirmation');
                            confirmation.setAttribute('role', 'alert');
                            confirmation.focus();
                            fform.parentNode.removeChild(fform);
                        }
                    }
                };
                try {
                    xhr.send(urlencodeFormData(formData.data));
                }catch(e) {}
            } else {
                buildA11yErrors(formData.a11yErrors);
            }
        }
    }

    function prepend(node){
        if (document.body.childNodes.length) {
            document.body.insertBefore(node, document.body.childNodes[0]);
        } else {
            document.body.appendChild(node);
        }
    }

    // Init panel and bind listeners
    function initPanelContent(){
        panelInit = true;
        panelEl.innerHTML = config.panelContentHTML;
        panel.querySelector('#un-s-close').addEventListener('click', closeStatementDialog, false);
        panel.querySelector('#un-s-submit').addEventListener('click', submitForm, false);

        firstEl = panel.querySelector('#un-s-close');
        lastEl = panel.querySelector('#un-s-submit');

        // Form pointer
        fform = panel.querySelector('#un-s-feedback');
        var inputs = fform.querySelectorAll('.un-s-input, input[type="radio"]');
        for (var i = 0; i < inputs.length; i += 1) {
            inputs[i].addEventListener('change', removeError);
        }
    }

    // Run callback when elements are available
    function observe(_sel, _callback){
        var els = document.querySelectorAll(_sel);
        if(els.length) return _callback(els);
        var mo = (w.MutationObserver || w.WebKitMutationObserver);
        var observer = new mo(function(){
            if((els = document.querySelectorAll(_sel)).length){
                observer.disconnect();
                connected = false;
                _callback(els);
            }
        });
        observer.observe(document, { childList: true, subtree: true });
        var connected = true;
        // Disconnect observer after a while
        setTimeout(function(){
            if (connected) {
                observer.disconnect();
                connected = false;
            }
        }, 5000);
    }

    // Open/Close functions
    w.closeStatementDialog = function(e) {
        if (e) {
            e.preventDefault();
            e.stopPropagation();
        }

        setTimeout(function(){
            if (opener) {
                opener.focus();
            }
        }, 600);


        // Disable trap anyway
        disableTabTrap();

        // Unbind escape key
        panel.removeEventListener('keyup', handleEscape);
        document.removeEventListener('keyup', handleEscape);

        // Enable the accordion trigger
        toggle.classList.remove('un-s-hide');

        // Hide the panel
        if (panelEl) {
            panelEl.setAttribute('aria-hidden', 'true');
            panelEl.removeAttribute('role');
            panelEl.removeAttribute('aria-modal');
            panelEl.classList.remove('un-s-open');
        }

        return false;
    }

    w.openUNAccessibilityStatusPanel = function(e) {
        if (e) {
            e.preventDefault();
            e.stopPropagation();
        }

        if (detectMobile()) {
            return openWindow();
        }

        if(!panelInit){
            initPanelContent();
        }

        // Store opener to focus back on it at close
        opener = e.target;

        // Bind tab trap
        enableTabTrap();

        if (!token) {
            token = getToken();
        }

        // Bind the esc key
        panel.addEventListener('keyup', handleEscape, true);
        document.addEventListener('keyup', handleEscape, true);

        // Setup dialog attributes
        panelEl.removeAttribute('aria-hidden');
        panelEl.setAttribute('role', 'dialog');
        panelEl.setAttribute('aria-modal', 'true');
        panelEl.classList.add('un-s-open');

        // Disable the accordion trigger
        toggle.classList.add('un-s-hide');

        // Move focus inside the panel
        setTimeout(function(){
            firstEl.focus();
        }, 600);

        return false;
    }
    // End Open/Close functions

    // Enable A40 from panel
    w.sealEnableUsableNetAssistive = function(e) {
        if (typeof window.enableUsableNetAssistive === 'function') {
            return enableUsableNetAssistive();
        }
    }

    // Create button + panel container
    panel = document.createElement('div');
    panel.setAttribute('id', 'un-s-cont');

    // Inject HTML
    panel.innerHTML = config.panelHTML;

    // Panel element pointer
    panelEl = panel.querySelector('#un-s');

    // Append the style
    var style = document.createElement('style');
    style.setAttribute('type', 'text/css');
    style.innerHTML = config.defaultCSS + config.buttonCSS + additionalStyle;

    // Toggle pointer
    toggle = panel.querySelector('#un-s-open');

    if (detectMobile()) {
        var toggleLink = document.createElement('a');
        toggleLink.setAttribute('id', 'un-s-open');
        toggleLink.setAttribute('href', '#');
        toggleLink.setAttribute('target', '_blank');
        toggleLink.innerText = toggle.innerText;
        if(isRelative){
            toggleLink.classList.add('un-relative')
        }
        toggleLink.appendChild(newTabMsg());
        toggle.parentNode.replaceChild(toggleLink, toggle);
        toggle = toggleLink;

        observe('.UNAccessibilityStatus', function (els) {
            for (var i = 0; i < els.length; i += 1) {
                var el = els[i];
                el.removeAttribute('aria-haspopup');
                el.removeAttribute('role');
                el.setAttribute('href', '#');
                el.setAttribute('target', '_blank');
                el.appendChild(newTabMsg());
            }
        });
    }
    toggle.addEventListener('click', openUNAccessibilityStatusPanel, false);
    toggle.addEventListener('focusin', function(e){ toggle.classList.remove('un-s-out'); });
    toggle.addEventListener('focusout', function(e){ toggle.classList.add('un-s-out'); });

    // Setup color and position
    if (position === 'right') {
        toggle.classList.add('un-s-right')
    } else if (position === 'center') {
        toggle.classList.add('un-s-center')
    }

    if (color === 'dark') {
        toggle.classList.add('un-s-dark');
    }

    observe('body', function () {
        // Create the root element
        var shadowElement = document.createElement('div');
        shadowElement.setAttribute('id', 'un-seal');

        panelEl.removeAttribute('aria-modal');
        panelEl.removeAttribute('role');
        panelEl.setAttribute('aria-label', toggle.innerText);

        lastElConf = panel.querySelector('#un-s-overlay');
        lastElConf.setAttribute('tabindex', '0');
        lastElConf.addEventListener('focus', lastElTrap, false);

        // Add the shadow root
        if (shadowElement.attachShadow) {
            var shadow = shadowElement.attachShadow({mode: 'open'});
            shadow.appendChild(style);
            shadow.appendChild(panel);
            prepend(shadowElement);
        }
        // Fallback for IE, append as regular child
        else {
            document.getElementsByTagName('head')[0].appendChild(style);
            shadowElement.appendChild(panel);
            prepend(shadowElement);
        }
    });

})(window);