ws4kp/dist/resources/ws.min.js

36 lines
258 KiB
JavaScript
Raw Normal View History

/*!
* jQuery JavaScript Library v3.5.1
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2020-05-04T22:49Z
*/
2020-10-16 20:52:56 +00:00
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,(function(e,t){"use strict";var n=[],r=Object.getPrototypeOf,i=n.slice,a=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},o=n.push,s=n.indexOf,u={},l=u.toString,c=u.hasOwnProperty,d=c.toString,h=d.call(Object),f={},A=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},p=function(e){return null!=e&&e===e.window},m=e.document,g={type:!0,src:!0,nonce:!0,noModule:!0};function v(e,t,n){var r,i,a=(n=n||m).createElement("script");if(a.text=e,t)for(r in g)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&a.setAttribute(r,i);n.head.appendChild(a).parentNode.removeChild(a)}function y(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?u[l.call(e)]||"object":typeof e}var w="3.5.1",x=function(e,t){return new x.fn.init(e,t)};function b(e){var t=!!e&&"length"in e&&e.length,n=y(e);return!A(e)&&!p(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}x.fn=x.prototype={jquery:w,constructor:x,length:0,toArray:function(){return i.call(this)},get:function(e){return null==e?i.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return x.each(this,e)},map:function(e){return this.pushStack(x.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(i.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(x.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(x.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:o,sort:n.sort,splice:n.splice},x.extend=x.fn.extend=function(){var e,t,n,r,i,a,o=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof o&&(l=o,o=arguments[s]||{},s++),"object"==typeof o||A(o)||(o={}),s===u&&(o=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&o!==r&&(l&&r&&(x.isPlainObject(r)||(i=Array.isArray(r)))?(n=o[t],a=i&&!Array.isArray(n)?[]:i||x.isPlainObject(n)?n:{},i=!1,o[t]=x.extend(l,a,r)):void 0!==r&&(o[t]=r));return o},x.extend({expando:"jQuery"+(w+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==l.call(e))&&(!(t=r(e))||"function"==typeof(n=c.call(t,"constructor")&&t.constructor)&&d.call(n)===h)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){v(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(b(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(b(Object(e))?x.merge(n,"string"==typeof e?[e]:e):o.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:s.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,a=e.length,o=!n;i<a;i++)!t(e[i],i)!==o&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,s=[];if(b(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&s.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&s.push(i);return a(s)},guid:1,support:f}),"function"==typeof Symbol&&(x.fn[Symbol.iterator]=n[Symbol.iterator]),x.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){u["[object "+t+"]"]=t.toLowerCase()}));var S=
/*!
* Sizzle CSS Selector Engine v2.3.5
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://js.foundation/
*
* Date: 2020-03-14
*/
2020-10-16 20:52:56 +00:00
function(e){var t,n,r,i,a,o,s,u,l,c,d,h,f,A,p,m,g,v,y,w="sizzle"+1*new Date,x=e.document,b=0,S=0,C=ue(),T=ue(),F=ue(),k=ue(),I=function(e,t){return e===t&&(d=!0),0},E={}.hasOwnProperty,D=[],N=D.pop,L=D.push,M=D.push,B=D.slice,O=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},j="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",H="[\\x20\\t\\r\\n\\f]",_="(?:\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",P="\\[[\\x20\\t\\r\\n\\f]*("+_+")(?:"+H+"*([*^$|!~]?=)"+H+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+_+"))|)"+H+"*\\]",R=":("+_+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",W=new RegExp(H+"+","g"),Q=new RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g"),V=new RegExp("^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*"),U=new RegExp("^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),G=new RegExp(H+"|>"),q=new RegExp(R),z=new RegExp("^"+_+"$"),Z={ID:new RegExp("^#("+_+")"),CLASS:new RegExp("^\\.("+_+")"),TAG:new RegExp("^("+_+"|[*])"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+R),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:"+j+")$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,$=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,K=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"<22>":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ae=function(){h()},oe=we((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{M.apply(D=B.call(x.childNodes),x.childNodes),D[x.childNodes.length].nodeType}catch(e){M={apply:D.length?function(e,t){L.apply(e,B.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function se(e,t,r,i){var a,s,l,c,d,A,g,v=t&&t.ownerDocument,x=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==x&&9!==x&&11!==x)return r;if(!i&&(h(t),t=t||f,p)){if(11!==x&&(d=K.exec(e)))if(a=d[1]){if(9===x){if(!(l=t.getElementById(a)))return r;if(l.id===a)return r.push(l),r}else if(v&&(l=v.getElementById(a))&&y(t,l)&&l.id===a)return r.push(l),r}else{if(d[2])return M.apply(r,t.getElementsByTagName(e)),r;if((a=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return M.apply(r,t.getElementsByClassName(a)),r}if(n.qsa&&!k[e+" "]&&(!m||!m.test(e))&&(1!==x||"object"!==t.nodeName.toLowerCase())){if(g=e,v=t,1===x&&(G.test(e)||U.test(e))){for((v=ee.test(e)&&ge(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(re,ie):t.setAttribute("id",c=w)),s=(A=o(e)).length;s--;)A[s]=(c?"#"+c:":scope")+" "+ye(A[s]);g=A.join(",")}try{return M.apply(r,v.querySelectorAll(g)),r}catch(t){k(e,!0)}finally{c===w&&t.removeAttribute("id")}}}return u(e.replace(Q,"$1"),t,r,i)}function ue(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function le(e){return e[w]=!0,e}function ce(e){var t=f.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function he(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"inp
/*! NoSleep.js v0.11.0 - git.io/vfn01 - Rich Tibbett - MIT license */
2020-10-16 20:52:56 +00:00
function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.NoSleep=t():e.NoSleep=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=n(1),a=i.webm,o=i.mp4,s="undefined"!=typeof navigator&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,u="wakeLock"in navigator,l=function(){function e(){var t=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),u){this._wakeLock=null;var n=function(){null!==t._wakeLock&&"visible"===document.visibilityState&&t.enable()};document.addEventListener("visibilitychange",n),document.addEventListener("fullscreenchange",n)}else s?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",a),this._addSourceToVideo(this.noSleepVideo,"mp4",o),this.noSleepVideo.addEventListener("loadedmetadata",(function(){t.noSleepVideo.duration<=1?t.noSleepVideo.setAttribute("loop",""):t.noSleepVideo.addEventListener("timeupdate",(function(){t.noSleepVideo.currentTime>.5&&(t.noSleepVideo.currentTime=Math.random())}))})))}return r(e,[{key:"_addSourceToVideo",value:function(e,t,n){var r=document.createElement("source");r.src=n,r.type="video/"+t,e.appendChild(r)}},{key:"enable",value:function(){var e=this;u?navigator.wakeLock.request("screen").then((function(t){e._wakeLock=t,console.log("Wake Lock active."),e._wakeLock.addEventListener("release",(function(){console.log("Wake Lock released.")}))})).catch((function(e){console.error(e.name+", "+e.message)})):s?(this.disable(),console.warn("\n NoSleep enabled for older iOS devices. This can interrupt\n active or long-running network requests from completing successfully.\n See https://github.com/richtr/NoSleep.js/issues/15 for more details.\n "),this.noSleepTimer=window.setInterval((function(){document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))}),15e3)):this.noSleepVideo.play()}},{key:"disable",value:function(){u?(this._wakeLock.release(),this._wakeLock=null):s?this.noSleepTimer&&(console.warn("\n NoSleep now disabled for older iOS devices.\n "),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause()}}]),e}();e.exports=l},function(e,t,n){"use strict";e.exports={webm:"data:video/webm;base64,GkXfo0AgQoaBAUL3gQFC8oEEQvOBCEKCQAR3ZWJtQoeBAkKFgQIYU4BnQI0VSalmQCgq17FAAw9CQE2AQAZ3aGFtbXlXQUAGd2hhbW15RIlACECPQAAAAAAAFlSua0AxrkAu14EBY8WBAZyBACK1nEADdW5khkAFVl9WUDglhohAA1ZQOIOBAeBABrCBCLqBCB9DtnVAIueBAKNAHIEAAIAwAQCdASoIA
/*!
* swiped-events.js - v@version@
* Pure JavaScript swipe events
* https://github.com/john-doherty/swiped-events
* @inspiration https://stackoverflow.com/questions/16348031/disable-scrolling-when-touch-moving-certain-element
* @author John Doherty <www.johndoherty.info>
* @license MIT
*/
function(e,t){"use strict";"function"!=typeof e.CustomEvent&&(e.CustomEvent=function(e,n){n=n||{bubbles:!1,cancelable:!1,detail:void 0};var r=t.createEvent("CustomEvent");return r.initCustomEvent(e,n.bubbles,n.cancelable,n.detail),r},e.CustomEvent.prototype=e.Event.prototype),t.addEventListener("touchstart",(function(e){if("true"===e.target.getAttribute("data-swipe-ignore"))return;s=e.target,o=Date.now(),n=e.touches[0].clientX,r=e.touches[0].clientY,i=0,a=0}),!1),t.addEventListener("touchmove",(function(e){if(!n||!r)return;var t=e.touches[0].clientX,o=e.touches[0].clientY;i=n-t,a=r-o}),!1),t.addEventListener("touchend",(function(e){if(s!==e.target)return;var t=parseInt(u(s,"data-swipe-threshold","20"),10),l=parseInt(u(s,"data-swipe-timeout","500"),10),c=Date.now()-o,d="",h=e.changedTouches||e.touches||[];Math.abs(i)>Math.abs(a)?Math.abs(i)>t&&c<l&&(d=i>0?"swiped-left":"swiped-right"):Math.abs(a)>t&&c<l&&(d=a>0?"swiped-up":"swiped-down");if(""!==d){var f={dir:d.replace(/swiped-/,""),xStart:parseInt(n,10),xEnd:parseInt((h[0]||{}).clientX||-1,10),yStart:parseInt(r,10),yEnd:parseInt((h[0]||{}).clientY||-1,10)};s.dispatchEvent(new CustomEvent("swiped",{bubbles:!0,cancelable:!0,detail:f})),s.dispatchEvent(new CustomEvent(d,{bubbles:!0,cancelable:!0,detail:f}))}n=null,r=null,o=null}),!1);var n=null,r=null,i=null,a=null,o=null,s=null;function u(e,n,r){for(;e&&e!==t.documentElement;){var i=e.getAttribute(n);if(i)return i;e=e.parentNode}return r}}(window,document),document.addEventListener("DOMContentLoaded",()=>{index.init()});const index=(()=>{const e={},t=6e5,n=new NoSleep;let r=!1,i=null,a=null,o=0,s=!1;const u=["Land Features","Bay","Channel","Cove","Dam","Delta","Gulf","Lagoon","Lake","Ocean","Reef","Reservoir","Sea","Sound","Strait","Waterfall","Wharf","Amusement Park","Historical Monument","Landmark","Tourist Attraction","Zoo","College","Beach","Campground","Golf Course","Harbor","Nature Reserve","Other Parks and Outdoors","Park","Racetrack","Scenic Overlook","Ski Resort","Sports Center","Sports Field","Wildlife Reserve","Airport","Ferry","Marina","Pier","Port","Resort","Postal","Populated Place"].join(","),l=e=>{const t=e.target.value;localStorage.setItem("TwcUnits",t),v(),F("units",t)},c=async t=>{if(this.previousSuggestionValue!==t.value)if(e[t.value])d(e[t.value]);else{const e=(await utils.fetch.json("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find",{data:{text:t.value,magicKey:t.data,f:"json"}})).locations[0];e?d(e.feature.geometry):alert("An unexpected error occurred. Please try a different search string.")}},d=e=>{const t={lat:Math.round2(e.y,4),lon:Math.round2(e.x,4)};m(t),localStorage.setItem("TwcQuery",document.getElementById("txtAddress").value)},h=()=>(document.fullscreenElement?A():f(),navigation.isPlaying()?L():M(),S(),!1),f=()=>{const e=document.getElementById("divTwc"),t=e.requestFullScreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullscreen;t?t.call(e,{navigationUI:"hide"}):(window.scrollTo(0,0),s=!0),S()},A=()=>{s&&(s=!1),document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()},p=()=>(F("navButton","menu"),S(),!1),m=e=>{e&&(m.latLon=e);const t=m.latLon;t&&(document.getElementById("txtAddress").blur(),I(),i=null,v(),F("latLon",t))},g=e=>{switch(e){case"left":w();break;case"right":default:x()}},v=()=>{let e="(None)";if(i)switch(navigation.units()){case UNITS.english:e=i.toLocaleString("en-US",{weekday:"short",month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"});break;default:e=i.toLocaleString("en-GB",{weekday:"short",month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"})}document.getElementById("spanLastRefresh").innerHTML=e,i&&document.getElementById("chkAutoRefresh").checked&&k()},y=()=>(m(),S(),!1),w=()=>(F("navButton","next"),S(),!1),x=()=>(F("navButton","previous"),S