-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprototype-builder.min.js
More file actions
3 lines (3 loc) · 263 KB
/
prototype-builder.min.js
File metadata and controls
3 lines (3 loc) · 263 KB
1
2
3
/*! For license information please see prototype-builder.min.js.LICENSE.txt */
var builder;(()=>{var t={462:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=new(i(385).PrototypeBuilder);t.exports=n},642:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.filter=e.pvsFilter=e.modelFilter=e.imageFilter=e.isPimFile=e.isEmuchartsFile=e.isPvsFile=e.isModelFile=e.isImageFile=e.checkExt=e.isSupportedFile=e.isHiddenFile=e.desc2fname=e.getContextFolder=e.getFileExtension=e.getFileName=void 0;const i=[".jpg",".jpeg",".png"],n=[".pvs",".muz",".tex",".i",".emdl",".vdmsl",".aadl",".adb",".ads",".c",".h",".smv",".als"],r=n.concat(i).concat([".txt"]);function s(t){let e=t||"";return e=e.includes("/")?e.substr(e.lastIndexOf("/")+1):e,e=e.includes(".")?e.substr(0,e.lastIndexOf(".")):e,e.trim()}function o(t,e){let i=t||"";return i=i.includes("/")?i.substr(i.lastIndexOf("/")+1):i,i=i.includes(".")?i.substr(i.lastIndexOf(".")):"",(null==e?void 0:e.toLowerCase)?i.toLocaleLowerCase().trim():i.trim()}function a(t){return!!t&&0===s(t).indexOf(".")}function l(t,e){if(t&&"string"==typeof t){const i=o(t,{toLowerCase:!0});return!!(i&&i.length>0)&&e.indexOf("."+i[0].toLowerCase())>-1}return!1}function c(t){return l(t,i)}function d(t){return l(t,n)}function u(t){return l(t,[".pvs"])}e.getFileName=s,e.getFileExtension=o,e.getContextFolder=function(t){let e=t||"";return e=e.includes("/")?e.substr(0,e.lastIndexOf("/")+1):e,e.trim()},e.desc2fname=function(t){return t?`${t.contextFolder}/${t.fileName}${t.fileExtension}`:null},e.isHiddenFile=a,e.isSupportedFile=function(t){const e=t?o(t):null;return e&&r.includes(e)},e.checkExt=l,e.isImageFile=c,e.isModelFile=d,e.isPvsFile=u,e.isEmuchartsFile=function(t){return l(t,[".emdl"])},e.isPimFile=function(t){return l(t,[".muz"])},e.imageFilter=function(t){return!1===a(t.path)&&(t.isDirectory||c(t.path))},e.modelFilter=function(t){return!1===a(t.path)&&(t.isDirectory||d(t.path))},e.pvsFilter=function(t){return!1===a(t.path)&&(t.isDirectory||u(t.path))},e.filter=function(t){return function(e){return!1===a(e.path)&&(e.isDirectory||l(e.path,t))}}},634:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.evaluate=e.resolveAttribute=e.simpleExpressionParser=void 0,e.simpleExpressionParser=function(t){const e={res:null,err:null};return"string"==typeof t?t.indexOf("!=")>=0?(e.res=t.split("!="),e.res={type:"boolexpr",binop:"!=",attr:e.res[0].trim(),constant:e.res[1].trim()}):t.indexOf("=")>=0?(e.res=t.split("="),e.res={type:"boolexpr",binop:"=",attr:e.res[0].trim(),constant:e.res[1].trim()}):"true"===t.toLowerCase()?e.res={type:"constexpr",constant:"true"}:"false"===t.toLowerCase()&&(e.res={type:"constexpr",constant:"false"}):e.res={type:"constexpr",constant:`${t}`},e},e.resolveAttribute=function(t,e){const i=e.split(".");let n=t,r="";for(let t=0;t<i.length&&n;t++)r=i[t],n=n[r];return n?"string"==typeof n?n:JSON.stringify(n):""},e.evaluate=function(t){if(null!=t){if("string"==typeof t){const e=(t=t.trim()).split("/");return 2!==e.length||isNaN(+e[0])||isNaN(+e[1])?t:(+e[0]/+e[1]).toString()}return t.toString().trim()}return""}},569:function(t,e){"use strict";var i=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};function n(t){if(t){const i=Handlebars.compile(e.dialogTemplate,{noEscape:!0})(Object.assign({dialogId:"pvsioweb-modal"},t));$("body").find("#pvsioweb-modal").remove(),$("body").append(i)}return $("body").find("#pvsioweb-modal").css({position:"absolute",overflow:"auto"})}function r(){if("none"!==$(document).find(".toolkit-navbar").css("display")){const t=$(document).find(".toolkit-navbar").css("height"),e=parseFloat(t);return isNaN(e)?0:e}return 0}Object.defineProperty(e,"__esModule",{value:!0}),e.colors=e.fontOutlineStyle=e.dimColor=e.rgb2hex=e.colorNameToHex=e.cssCursorClasses=e.animateCssClasses=e.cssColors=e.keyCodes=e.mouseButtons=e.inlineMenuTemplate=e.dropdownMenuTemplate=e.removeSpaceDash=e.transparentGif=e.requiredBrowserWarning=e.requiredBrowser=e.getVersion=e.isBrowserSupported=e.getBrowserVersion=e.enableResizeLeft=e.createStickyPanel=e.getToolkitNavbarHeight=e.deleteContextMenu=e.closeContextMenu=e.openContextMenu=e.createMenu=e.dialogTemplate=e.DBLCLICK_TIMEOUT=e.showYesCancelDialog=e.setDialogTitle=e.revealDialog=e.createDialog=void 0,e.createDialog=n,e.revealDialog=function(){return $("body").find("#pvsioweb-modal").css("display","block")},e.setDialogTitle=function(t){return $("body").find("#pvsioweb-modal-title").html(t)},e.showYesCancelDialog=function(t){return i(this,void 0,void 0,(function*(){const e=n({content:t});return new Promise(((t,i)=>{e.find(".ok-btn").on("click",(i=>{e.remove(),t("yes")})),e.find(".cancel-btn").on("click",(i=>{e.remove(),t("cancel")}))}))}))},e.DBLCLICK_TIMEOUT=300,e.dialogTemplate='\n<div class="modal fade show" id="{{dialogId}}" tabindex="-1" role="dialog" aria-labelledby="{{dialogId}}-title" aria-hidden="true" style="display:{{#if hidden}}none{{else}}block{{/if}};">\n <div class="modal-dialog-shadow" style="width:100%; height:100%; position:fixed; background: black; opacity: 0.8;"></div>\n <div class="modal-dialog modal-dialog-centered{{#if largeModal}} modal-lg{{/if}}" role="document">\n <div class="modal-content" style="transform:scale(0.8); transform-origin:top;">\n <div class="modal-header py-0">\n <h6 class="modal-title tile" style="display:none;" id="{{dialogId}}-title">{{title}}</h6>\n <button type="button" class="close" data-dismiss="modal" aria-label="Close">\n <span aria-hidden="true" class="cancel-btn">×</span>\n </button>\n </div>\n <div class="modal-body">\n {{content}}\n </div>\n <div class="modal-footer py-1">\n {{#if buttons}}\n {{buttons}}\n {{else}}\n <button type="button" class="cancel-btn btn btn-secondary" data-dismiss="modal">Cancel</button>\n <button type="button" class="ok-btn btn btn-primary">Ok</button>\n {{/if}}\n </div>\n </div>\n </div>\n</div>',e.createMenu=function(t){if(t){const e=parseFloat(`${t.top}`),i=parseFloat(`${t.left}`),n=Handlebars.compile('\n<div id="{{menuId}}" class="fade show" style="position:absolute;width:0px;height:0px;top:{{top}}px;left:{{left}}px;">\n <div class="dropdown-menu show">\n {{#each items}}\n {{#if name}}<a class="dropdown-item{{#if disabled}} disabled{{/if}}" href="#" action="{{name}}">{{icon}}{{name}}</a>{{else}}<div class="dropdown-divider"></div>{{/if}}\n {{/each}}\n </div>\n</div>\n',{noEscape:!0})({menuId:"pvsioweb-menu",top:e,left:i,items:t.items.map((t=>"string"==typeof t?t:t.disabled?{name:t.name,icon:t.icon,disabled:!0}:{name:t.name,icon:t.icon}))});$("body").find("#pvsioweb-menu").remove(),$("body").append(n)}return $("body").find("#pvsioweb-menu")},e.openContextMenu=function(){return $("body").find("#pvsioweb-menu").css("display","block")},e.closeContextMenu=function(){return $("body").find("#pvsioweb-menu").css("display","none")},e.deleteContextMenu=function(){return $("body").find("#pvsioweb-menu").remove()},e.getToolkitNavbarHeight=r,e.createStickyPanel=function(t,e){const i=(e=e||{}).parent||"body",n=t.getId()||"",s=t.getName()||"",o=e.width||"100%",a=e.top||r()||0;console.log(`[pvsioweb-utils] Creating panel, parent is ${i}`);const l=Handlebars.compile('\n<style>\n.pvsioweb-sticky-panel {\n display: block;\n position: sticky;\n top: {{top}}px;\n}\n.pvsioweb-sticky-panel span {\n font-size: small;\n}\n.pvsioweb-sticky-panel-content {\n top: {{top}}px;\n margin-top: {{margin-top}}px;\n}\n.navbar .btn {\n font-size: small;\n}\n.navbar .btn-group {\n border: 1px solid white;\n border-radius: 4px;\n}\n</style>\n<div id="{{id}}-panel" class="navbar navbar-dark fixed-top bg-dark flex-md-nowrap py-0 px-1 shadow pvsioweb-sticky-panel">\n <span class="navbar navbar-brand container-fluid px-1">\n <div class="btn-group" role="group">\n {{navbarLeft}}\n </div>\n <div class="btn-group" role="group">\n {{navbarCentral}}\n </div>\n {{#if navbarRight}}\n <div class="btn-group" role="group">\n {{navbarRight}}\n </div>\n {{else}}\n <div></div>\n {{/if}}\n </span>\n</div>\n<div id="{{id}}-content" class="content collapsible-panel pvsioweb-sticky-panel-content {{#if showContent}}show{{/if}}"></div>\n',{noEscape:!0})(Object.assign(Object.assign({},e),{width:o,top:a,"margin-top":a,id:n,name:s}));$(i).append(l);const c=$(`#${n}-panel`),d=$(`#${n}-content`),u=c.find(".navbar");return c.on("mouseover",(t=>{c.attr("active-panel",n)})),{$div:c,$content:d,$navbar:u}},e.enableResizeLeft=function(t,e){if(e=e||{},t){const i=10,n=t.$div.width(),r=2*parseFloat(t.$resizeBar.css("width"));let s=e.initialWidth||n/3;const o=e=>{(e=e||{}).leftWidth=e.leftWidth||t.$left.width();const n=$(window).width(),o=t.$div.width(),a=o<n?o:n,l=a-s-2*r;s=e.leftWidth<i?i:e.leftWidth>a?a:e.leftWidth,t.$left.css("width",s),t.$central.css({width:l})};t.$left.css("width",s),t.$resizeBar.on("mousedown",(e=>{e.preventDefault(),$("html").css({cursor:"col-resize"});const i=e=>{e.preventDefault(),o({leftWidth:e.pageX}),(null==t?void 0:t.onResize)&&t.onResize({width:t.$central.css("width"),height:t.$central.css("height")})},n=t=>{t.preventDefault(),$(window).off("mousemove",i),$(window).off("mouseup",n),$("html").css({cursor:"default"}),o({leftWidth:t.pageX})};$(window).on("mousemove",i),$(window).on("mouseup",n),$(window).on("keydown",(t=>{"Escape"===t.key&&n(t)}))})),t.$resizeBar.on("mouseover",(e=>{t.disableResize||(e.preventDefault(),t.$resizeBar.css({cursor:"col-resize"}))})),$(window).on("resize",(e=>{t.disableResize||o({leftWidth:s})})),o({leftWidth:s})}return t};const s=/Chrome\//.test(navigator.userAgent),o=/Firefox\//.test(navigator.userAgent);function a(t){const e=navigator.userAgent.split(" ").filter((e=>e.indexOf(t)>=0)).toString().split("/");return e&&2===e.length?parseFloat(e[1]):-1}function l(){return s||o?navigator.userAgent.split(" ").filter((t=>t.indexOf("Chrome")>=0||t.indexOf("Firefox")>=0)).toString().split("/").join(" "):navigator.userAgent}function c(t){const i=t.toLowerCase();return e.cssColors[i]?e.cssColors[i]:t}function d(t){const e=t.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);return e&&4===e.length?"#"+("0"+parseInt(e[1],10).toString(16)).slice(-2)+("0"+parseInt(e[2],10).toString(16)).slice(-2)+("0"+parseInt(e[3],10).toString(16)).slice(-2):t}var u;e.getBrowserVersion=a,e.isBrowserSupported=function(){return s&&a("Chrome")>=42||o&&a("Firefox")>=37},e.getVersion=l,e.requiredBrowser=function(){return"PVSio-web requires Chome 42 or greater, or Firefox 37 or greater"},e.requiredBrowserWarning=function(){return"Warning: PVSio-web requires Chome 42 or greater, or Firefox 37 or greater (your browser is "+l()+")"},e.transparentGif="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",e.removeSpaceDash=function(t){return t?t.replace(/[\s|-]/g,""):t},e.dropdownMenuTemplate='\n<div class="dropdown mr-1 panel-menu">\n <button type="button" class="btn btn-sm btn-dark dropdown-toggle" id="{{id}}" data-toggle="dropdown">{{name}}</button>\n {{#if style}}<style>{{style}}</style>{{/if}}\n <div class="dropdown-menu {{id}}" aria-labelledby="{{id}}">\n {{content}}\n </div>\n</div>\n',e.inlineMenuTemplate='\n<div class="mr-2 panel-menu dropdown">\n {{#if style}}<style>{{style}}</style>{{/if}}\n {{#each buttons}}\n {{this}}\n {{/each}}\n</div>\n',e.mouseButtons={left:0,middle:1,right:2},(u=e.keyCodes||(e.keyCodes={})).Backspace="Backspace",u.Tab="Tab",u.Enter="Enter",u.ShiftLeft="ShiftLeft",u.ShiftRight="ShiftRight",u.ControlLeft="ControlLeft",u.ControlRight="ControlRight",u.AltLeft="AltLeft",u.AltRight="AltRight",u.MetaLeft="MetaLeft",u.MetaRight="MetaRight",u.CapsLock="CapsLock",u.Escape="Escape",u.SPACE="Space",u.ArrowLeft="ArrowLeft",u.ArrowUp="ArrowUp",u.ArrowRight="ArrowRight",u.ArrowDown="ArrowDown",u.Semicolon="Semicolon",u.Equal="Equal",u.Comma="Comma",u.Minus="Minus",u.Period="Period",u.Slash="Slash",u.Backslash="Backslash",e.cssColors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",transparent:"#00000000",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},e.animateCssClasses=["animated flash","animated pulse","animated fadeIn","animated flip","animated zoomIn"],e.cssCursorClasses=["default","alias","all-scroll","auto","cell","context-menu","col-resize","copy","crosshair","e-resize","ew-resize","grab","grabbing","help","move","n-resize","ne-resize","nesw-resize","ns-resize","nw-resize","nwse-resize","no-drop","none","not-allowed","pointer","progress","row-resize","s-resize","se-resize","sw-resize","text","url","w-resize","wait","zoom-in","zoom-out"],e.colorNameToHex=c,e.rgb2hex=d,e.dimColor=function(t,e){e=e||48,t=d(c(t)).slice(1)||"0";const i=parseInt(t,16);let n=(i>>16)-e;n=n>255?255:n<0?0:n;let r=(i>>8&255)-e;r=r>255?255:r<0?0:r;let s=(255&i)-e;return s=s>255?255:s<0?0:s,"#"+(s|r<<8|n<<16).toString(16)},e.fontOutlineStyle=function(t){return`\n -webkit-text-fill-color: transparent; -webkit-text-stroke: 1px ${t=t||"black"};`},e.colors={blue:"#007bff"}},490:(t,e)=>{"use strict";function i(t){let e=(new Date).getTime();return(t=t||"xxxxxxxx_xxxx_4xxx_yxxx_xxxxxxxxxxxx").replace(/[xy]/g,(t=>{const i=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?i:7&i|8).toString(16)}))}Object.defineProperty(e,"__esModule",{value:!0}),e.uuid=e.widgetUUID=void 0,e.widgetUUID=function(){return"wdg"+i("Wxxxx")},e.uuid=i},30:function(t,e,i){"use strict";var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.WebSocketConnection=e.LoopbackConnection=e.BackboneConnection=e.ConnectionEvents=void 0;const r=i(845);e.ConnectionEvents={DidOpenConnection:"DidOpenConnection",DidCloseConnection:"DidCloseConnection",ConnectionTimedOut:"ConnectionTimedOut",UserAuthenticated:"UserAuthenticated",NoConnection:"NoConnection",DidSendRequest:"DidSendRequest",SendResponse:"SendResponse"};class s extends r.Model{constructor(){super(),this.serverUrl="wss://localhost",this.serverPort=8082,this.connected=!1,this.callbackRegistry={},this.serverPort=this.getServerPort(),this.serverUrl=this.getServerUrl(),this.on(e.ConnectionEvents.SendResponse,(t=>{t&&t.type?this.callbackRegistry&&"function"==typeof this.callbackRegistry[t.type]?this.callbackRegistry[t.type](t.err,t.res):console.warn(`[connection] Warning: unable to trigger callback (callback registry for ${t.type} is null)`):console.warn("[connection] Warning: unable to trigger callback (OnRequest descriptor is null)")}))}isOnCloud(){return window.location.href.includes(".herokuapp.com")||window.location.href.includes("pvsioweb.org")}getServerPort(){return this.isOnCloud()?0:8082}getServerUrl(){const t=this.isOnCloud()?"wss":"ws";return 0===window.location.href.indexOf("file")?`${t}://localhost`:`${t}://${window.location.hostname}`}getServerAddress(){return this.serverPort?this.serverUrl+":"+this.serverPort:this.serverUrl}getUrl(){return this.getServerAddress().startsWith("ws")?this.getServerAddress().replace("ws","http"):this.getServerAddress()}activate(){return n(this,void 0,void 0,(function*(){return this.connected||(this.connected=!0,this.trigger(e.ConnectionEvents.DidOpenConnection)),!0}))}onRequest(t,e){t&&"function"==typeof e&&(this.callbackRegistry[t]=e)}sendRequest(t,i){return n(this,void 0,void 0,(function*(){if(yield this.activate(),t){const n={type:t,req:i};this.trigger(e.ConnectionEvents.DidSendRequest,n)}return!0}))}close(){this.connected&&(this.connected=!1,this.trigger(e.ConnectionEvents.DidCloseConnection))}}e.BackboneConnection=s,e.LoopbackConnection=class extends s{sendRequest(t,i){const r=Object.create(null,{sendRequest:{get:()=>super.sendRequest}});return n(this,void 0,void 0,(function*(){return r.sendRequest.call(this,t,i),t&&setTimeout((()=>{this.trigger(e.ConnectionEvents.SendResponse,{type:t,res:i})}),50),!0}))}},e.WebSocketConnection=class extends s{constructor(t){super(),this.keepAlive=!1,this.keepAliveInterval=6e3,t=t||{},this.keepAlive=t.keepAlive,this.keepAliveInterval=t.keepAliveInterval||6e3}activate(){const t=Object.create(null,{activate:{get:()=>super.activate}});return n(this,void 0,void 0,(function*(){return new Promise(((e,i)=>{this.ws?e(!0):(this.ws=new WebSocket(this.getServerAddress()),this.ws.onopen=i=>{this.connected=!0,this.keepAlive&&setInterval((()=>{this.sendRequest("keepAlive")}),this.keepAliveInterval),t.activate.call(this),e(!0)},this.ws.onerror=t=>{this.connected=!1,console.error("[websocket-connection] Connection closed unexpectedly :/",t),e(!1)},this.ws.onclose=t=>{this.connected=!1,this.ws=null,console.error("[websocket-connection] Connection closed",t),e(!1)},this.ws.onmessage=t=>{let e=JSON.parse(t.data);e&&(e.err&&(console.warn("[websocket-connection] Warning: server replied with error state",e.err),"EPIPE"!==e.err.code&&console.warn(JSON.stringify(e))),e.type&&this.callbackRegistry[e.type]&&"function"==typeof this.callbackRegistry[e.type]&&this.callbackRegistry[e.type](e.err,e))})}))}))}sendRequest(t,e){return n(this,void 0,void 0,(function*(){return yield this.activate(),this.ws?(()=>{var i;return null===(i=this.ws)||void 0===i||i.send(JSON.stringify(Object.assign({type:t},e))),!0})():(console.error("[websocket-connection] Cannot send: WebSocket is closed :/"),!1)}))}close(){this.ws&&(this.ws.close(),this.ws=null,super.close())}}},845:(t,e,i)=>{var n,r,s;s="object"==typeof self&&self.self===self&&self||"object"==typeof i.g&&i.g.global===i.g&&i.g,n=[i(590),i(530),e],void 0===(r=function(t,e,i){s.Backbone=function(t,e,i,n){var r=t.Backbone,s=Array.prototype.slice;e.VERSION="1.4.0",e.$=n,e.noConflict=function(){return t.Backbone=r,this},e.emulateHTTP=!1,e.emulateJSON=!1;var o,a=e.Events={},l=/\s+/,c=function(t,e,n,r,s){var o,a=0;if(n&&"object"==typeof n){void 0!==r&&"context"in s&&void 0===s.context&&(s.context=r);for(o=i.keys(n);a<o.length;a++)e=c(t,e,o[a],n[o[a]],s)}else if(n&&l.test(n))for(o=n.split(l);a<o.length;a++)e=t(e,o[a],r,s);else e=t(e,n,r,s);return e};a.on=function(t,e,i){return this._events=c(d,this._events||{},t,e,{context:i,ctx:this,listening:o}),o&&((this._listeners||(this._listeners={}))[o.id]=o,o.interop=!1),this},a.listenTo=function(t,e,n){if(!t)return this;var r=t._listenId||(t._listenId=i.uniqueId("l")),s=this._listeningTo||(this._listeningTo={}),a=o=s[r];a||(this._listenId||(this._listenId=i.uniqueId("l")),a=o=s[r]=new v(this,t));var l=u(t,e,n,this);if(o=void 0,l)throw l;return a.interop&&a.on(e,n),this};var d=function(t,e,i,n){if(i){var r=t[e]||(t[e]=[]),s=n.context,o=n.ctx,a=n.listening;a&&a.count++,r.push({callback:i,context:s,ctx:s||o,listening:a})}return t},u=function(t,e,i,n){try{t.on(e,i,n)}catch(t){return t}};a.off=function(t,e,i){return this._events?(this._events=c(h,this._events,t,e,{context:i,listeners:this._listeners}),this):this},a.stopListening=function(t,e,n){var r=this._listeningTo;if(!r)return this;for(var s=t?[t._listenId]:i.keys(r),o=0;o<s.length;o++){var a=r[s[o]];if(!a)break;a.obj.off(e,n,this),a.interop&&a.off(e,n)}return i.isEmpty(r)&&(this._listeningTo=void 0),this};var h=function(t,e,n,r){if(t){var s,o=r.context,a=r.listeners,l=0;if(e||o||n){for(s=e?[e]:i.keys(t);l<s.length;l++){var c=t[e=s[l]];if(!c)break;for(var d=[],u=0;u<c.length;u++){var h=c[u];if(n&&n!==h.callback&&n!==h.callback._callback||o&&o!==h.context)d.push(h);else{var p=h.listening;p&&p.off(e,n)}}d.length?t[e]=d:delete t[e]}return t}for(s=i.keys(a);l<s.length;l++)a[s[l]].cleanup()}};a.once=function(t,e,i){var n=c(p,{},t,e,this.off.bind(this));return"string"==typeof t&&null==i&&(e=void 0),this.on(n,e,i)},a.listenToOnce=function(t,e,i){var n=c(p,{},e,i,this.stopListening.bind(this,t));return this.listenTo(t,n)};var p=function(t,e,n,r){if(n){var s=t[e]=i.once((function(){r(e,s),n.apply(this,arguments)}));s._callback=n}return t};a.trigger=function(t){if(!this._events)return this;for(var e=Math.max(0,arguments.length-1),i=Array(e),n=0;n<e;n++)i[n]=arguments[n+1];return c(f,this._events,t,void 0,i),this};var f=function(t,e,i,n){if(t){var r=t[e],s=t.all;r&&s&&(s=s.slice()),r&&g(r,n),s&&g(s,[e].concat(n))}return t},g=function(t,e){var i,n=-1,r=t.length,s=e[0],o=e[1],a=e[2];switch(e.length){case 0:for(;++n<r;)(i=t[n]).callback.call(i.ctx);return;case 1:for(;++n<r;)(i=t[n]).callback.call(i.ctx,s);return;case 2:for(;++n<r;)(i=t[n]).callback.call(i.ctx,s,o);return;case 3:for(;++n<r;)(i=t[n]).callback.call(i.ctx,s,o,a);return;default:for(;++n<r;)(i=t[n]).callback.apply(i.ctx,e);return}},v=function(t,e){this.id=t._listenId,this.listener=t,this.obj=e,this.interop=!0,this.count=0,this._events=void 0};v.prototype.on=a.on,v.prototype.off=function(t,e){var i;this.interop?(this._events=c(h,this._events,t,e,{context:void 0,listeners:void 0}),i=!this._events):(this.count--,i=0===this.count),i&&this.cleanup()},v.prototype.cleanup=function(){delete this.listener._listeningTo[this.obj._listenId],this.interop||delete this.obj._listeners[this.id]},a.bind=a.on,a.unbind=a.off,i.extend(e,a);var m=e.Model=function(t,e){var n=t||{};e||(e={}),this.preinitialize.apply(this,arguments),this.cid=i.uniqueId(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(n=this.parse(n,e)||{});var r=i.result(this,"defaults");n=i.defaults(i.extend({},r,n),r),this.set(n,e),this.changed={},this.initialize.apply(this,arguments)};i.extend(m.prototype,a,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",preinitialize:function(){},initialize:function(){},toJSON:function(t){return i.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return i.escape(this.get(t))},has:function(t){return null!=this.get(t)},matches:function(t){return!!i.iteratee(t,this)(this.attributes)},set:function(t,e,n){if(null==t)return this;var r;if("object"==typeof t?(r=t,n=e):(r={})[t]=e,n||(n={}),!this._validate(r,n))return!1;var s=n.unset,o=n.silent,a=[],l=this._changing;this._changing=!0,l||(this._previousAttributes=i.clone(this.attributes),this.changed={});var c=this.attributes,d=this.changed,u=this._previousAttributes;for(var h in r)e=r[h],i.isEqual(c[h],e)||a.push(h),i.isEqual(u[h],e)?delete d[h]:d[h]=e,s?delete c[h]:c[h]=e;if(this.idAttribute in r&&(this.id=this.get(this.idAttribute)),!o){a.length&&(this._pending=n);for(var p=0;p<a.length;p++)this.trigger("change:"+a[p],this,c[a[p]],n)}if(l)return this;if(!o)for(;this._pending;)n=this._pending,this._pending=!1,this.trigger("change",this,n);return this._pending=!1,this._changing=!1,this},unset:function(t,e){return this.set(t,void 0,i.extend({},e,{unset:!0}))},clear:function(t){var e={};for(var n in this.attributes)e[n]=void 0;return this.set(e,i.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!i.isEmpty(this.changed):i.has(this.changed,t)},changedAttributes:function(t){if(!t)return!!this.hasChanged()&&i.clone(this.changed);var e,n=this._changing?this._previousAttributes:this.attributes,r={};for(var s in t){var o=t[s];i.isEqual(n[s],o)||(r[s]=o,e=!0)}return!!e&&r},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return i.clone(this._previousAttributes)},fetch:function(t){t=i.extend({parse:!0},t);var e=this,n=t.success;return t.success=function(i){var r=t.parse?e.parse(i,t):i;if(!e.set(r,t))return!1;n&&n.call(t.context,e,i,t),e.trigger("sync",e,i,t)},L(this,t),this.sync("read",this,t)},save:function(t,e,n){var r;null==t||"object"==typeof t?(r=t,n=e):(r={})[t]=e;var s=(n=i.extend({validate:!0,parse:!0},n)).wait;if(r&&!s){if(!this.set(r,n))return!1}else if(!this._validate(r,n))return!1;var o=this,a=n.success,l=this.attributes;n.success=function(t){o.attributes=l;var e=n.parse?o.parse(t,n):t;if(s&&(e=i.extend({},r,e)),e&&!o.set(e,n))return!1;a&&a.call(n.context,o,t,n),o.trigger("sync",o,t,n)},L(this,n),r&&s&&(this.attributes=i.extend({},l,r));var c=this.isNew()?"create":n.patch?"patch":"update";"patch"!==c||n.attrs||(n.attrs=r);var d=this.sync(c,this,n);return this.attributes=l,d},destroy:function(t){t=t?i.clone(t):{};var e=this,n=t.success,r=t.wait,s=function(){e.stopListening(),e.trigger("destroy",e,e.collection,t)};t.success=function(i){r&&s(),n&&n.call(t.context,e,i,t),e.isNew()||e.trigger("sync",e,i,t)};var o=!1;return this.isNew()?i.defer(t.success):(L(this,t),o=this.sync("delete",this,t)),r||s(),o},url:function(){var t=i.result(this,"urlRoot")||i.result(this.collection,"url")||B();if(this.isNew())return t;var e=this.get(this.idAttribute);return t.replace(/[^\/]$/,"$&/")+encodeURIComponent(e)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},i.extend({},t,{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=i.extend({},this.attributes,t);var n=this.validationError=this.validate(t,e)||null;return!n||(this.trigger("invalid",this,n,i.extend(e,{validationError:n})),!1)}});var b=e.Collection=function(t,e){e||(e={}),this.preinitialize.apply(this,arguments),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,i.extend({silent:!0},e))},y={add:!0,remove:!0,merge:!0},w={add:!0,remove:!1},x=function(t,e,i){i=Math.min(Math.max(i,0),t.length);var n,r=Array(t.length-i),s=e.length;for(n=0;n<r.length;n++)r[n]=t[n+i];for(n=0;n<s;n++)t[n+i]=e[n];for(n=0;n<r.length;n++)t[n+s+i]=r[n]};i.extend(b.prototype,a,{model:m,preinitialize:function(){},initialize:function(){},toJSON:function(t){return this.map((function(e){return e.toJSON(t)}))},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,i.extend({merge:!1},e,w))},remove:function(t,e){e=i.extend({},e);var n=!i.isArray(t);t=n?[t]:t.slice();var r=this._removeModels(t,e);return!e.silent&&r.length&&(e.changes={added:[],merged:[],removed:r},this.trigger("update",this,e)),n?r[0]:r},set:function(t,e){if(null!=t){(e=i.extend({},y,e)).parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);var n=!i.isArray(t);t=n?[t]:t.slice();var r=e.at;null!=r&&(r=+r),r>this.length&&(r=this.length),r<0&&(r+=this.length+1);var s,o,a=[],l=[],c=[],d=[],u={},h=e.add,p=e.merge,f=e.remove,g=!1,v=this.comparator&&null==r&&!1!==e.sort,m=i.isString(this.comparator)?this.comparator:null;for(o=0;o<t.length;o++){s=t[o];var b=this.get(s);if(b){if(p&&s!==b){var w=this._isModel(s)?s.attributes:s;e.parse&&(w=b.parse(w,e)),b.set(w,e),c.push(b),v&&!g&&(g=b.hasChanged(m))}u[b.cid]||(u[b.cid]=!0,a.push(b)),t[o]=b}else h&&(s=t[o]=this._prepareModel(s,e))&&(l.push(s),this._addReference(s,e),u[s.cid]=!0,a.push(s))}if(f){for(o=0;o<this.length;o++)u[(s=this.models[o]).cid]||d.push(s);d.length&&this._removeModels(d,e)}var C=!1,k=!v&&h&&f;if(a.length&&k?(C=this.length!==a.length||i.some(this.models,(function(t,e){return t!==a[e]})),this.models.length=0,x(this.models,a,0),this.length=this.models.length):l.length&&(v&&(g=!0),x(this.models,l,null==r?this.length:r),this.length=this.models.length),g&&this.sort({silent:!0}),!e.silent){for(o=0;o<l.length;o++)null!=r&&(e.index=r+o),(s=l[o]).trigger("add",s,this,e);(g||C)&&this.trigger("sort",this,e),(l.length||d.length||c.length)&&(e.changes={added:l,removed:d,merged:c},this.trigger("update",this,e))}return n?t[0]:t}},reset:function(t,e){e=e?i.clone(e):{};for(var n=0;n<this.models.length;n++)this._removeReference(this.models[n],e);return e.previousModels=this.models,this._reset(),t=this.add(t,i.extend({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,i.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t)},unshift:function(t,e){return this.add(t,i.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t)},slice:function(){return s.apply(this.models,arguments)},get:function(t){if(null!=t)return this._byId[t]||this._byId[this.modelId(this._isModel(t)?t.attributes:t)]||t.cid&&this._byId[t.cid]},has:function(t){return null!=this.get(t)},at:function(t){return t<0&&(t+=this.length),this.models[t]},where:function(t,e){return this[e?"find":"filter"](t)},findWhere:function(t){return this.where(t,!0)},sort:function(t){var e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t||(t={});var n=e.length;return i.isFunction(e)&&(e=e.bind(this)),1===n||i.isString(e)?this.models=this.sortBy(e):this.models.sort(e),t.silent||this.trigger("sort",this,t),this},pluck:function(t){return this.map(t+"")},fetch:function(t){var e=(t=i.extend({parse:!0},t)).success,n=this;return t.success=function(i){var r=t.reset?"reset":"set";n[r](i,t),e&&e.call(t.context,n,i,t),n.trigger("sync",n,i,t)},L(this,t),this.sync("read",this,t)},create:function(t,e){var n=(e=e?i.clone(e):{}).wait;if(!(t=this._prepareModel(t,e)))return!1;n||this.add(t,e);var r=this,s=e.success;return e.success=function(t,e,i){n&&r.add(t,i),s&&s.call(i.context,t,e,i)},t.save(null,e),t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t){return t[this.model.prototype.idAttribute||"id"]},values:function(){return new k(this,S)},keys:function(){return new k(this,$)},entries:function(){return new k(this,E)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){if(this._isModel(t))return t.collection||(t.collection=this),t;(e=e?i.clone(e):{}).collection=this;var n=new this.model(t,e);return n.validationError?(this.trigger("invalid",this,n.validationError,e),!1):n},_removeModels:function(t,e){for(var i=[],n=0;n<t.length;n++){var r=this.get(t[n]);if(r){var s=this.indexOf(r);this.models.splice(s,1),this.length--,delete this._byId[r.cid];var o=this.modelId(r.attributes);null!=o&&delete this._byId[o],e.silent||(e.index=s,r.trigger("remove",r,this,e)),i.push(r),this._removeReference(r,e)}}return i},_isModel:function(t){return t instanceof m},_addReference:function(t,e){this._byId[t.cid]=t;var i=this.modelId(t.attributes);null!=i&&(this._byId[i]=t),t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){delete this._byId[t.cid];var i=this.modelId(t.attributes);null!=i&&delete this._byId[i],this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,n){if(e){if(("add"===t||"remove"===t)&&i!==this)return;if("destroy"===t&&this.remove(e,n),"change"===t){var r=this.modelId(e.previousAttributes()),s=this.modelId(e.attributes);r!==s&&(null!=r&&delete this._byId[r],null!=s&&(this._byId[s]=e))}}this.trigger.apply(this,arguments)}});var C="function"==typeof Symbol&&Symbol.iterator;C&&(b.prototype[C]=b.prototype.values);var k=function(t,e){this._collection=t,this._kind=e,this._index=0},S=1,$=2,E=3;C&&(k.prototype[C]=function(){return this}),k.prototype.next=function(){if(this._collection){if(this._index<this._collection.length){var t,e=this._collection.at(this._index);if(this._index++,this._kind===S)t=e;else{var i=this._collection.modelId(e.attributes);t=this._kind===$?i:[i,e]}return{value:t,done:!1}}this._collection=void 0}return{value:void 0,done:!0}};var D=e.View=function(t){this.cid=i.uniqueId("view"),this.preinitialize.apply(this,arguments),i.extend(this,i.pick(t,M)),this._ensureElement(),this.initialize.apply(this,arguments)},T=/^(\S+)\s*(.*)$/,M=["model","collection","el","id","attributes","className","tagName","events"];i.extend(D.prototype,a,{tagName:"div",$:function(t){return this.$el.find(t)},preinitialize:function(){},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(t){return this.undelegateEvents(),this._setElement(t),this.delegateEvents(),this},_setElement:function(t){this.$el=t instanceof e.$?t:e.$(t),this.el=this.$el[0]},delegateEvents:function(t){if(t||(t=i.result(this,"events")),!t)return this;for(var e in this.undelegateEvents(),t){var n=t[e];if(i.isFunction(n)||(n=this[n]),n){var r=e.match(T);this.delegate(r[1],r[2],n.bind(this))}}return this},delegate:function(t,e,i){return this.$el.on(t+".delegateEvents"+this.cid,e,i),this},undelegateEvents:function(){return this.$el&&this.$el.off(".delegateEvents"+this.cid),this},undelegate:function(t,e,i){return this.$el.off(t+".delegateEvents"+this.cid,e,i),this},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){if(this.el)this.setElement(i.result(this,"el"));else{var t=i.extend({},i.result(this,"attributes"));this.id&&(t.id=i.result(this,"id")),this.className&&(t.class=i.result(this,"className")),this.setElement(this._createElement(i.result(this,"tagName"))),this._setAttributes(t)}},_setAttributes:function(t){this.$el.attr(t)}});var N=function(t,e,n,r){i.each(n,(function(i,n){e[n]&&(t.prototype[n]=function(t,e,i,n){switch(e){case 1:return function(){return t[i](this[n])};case 2:return function(e){return t[i](this[n],e)};case 3:return function(e,r){return t[i](this[n],A(e,this),r)};case 4:return function(e,r,s){return t[i](this[n],A(e,this),r,s)};default:return function(){var e=s.call(arguments);return e.unshift(this[n]),t[i].apply(t,e)}}}(e,i,n,r))}))},A=function(t,e){return i.isFunction(t)?t:i.isObject(t)&&!e._isModel(t)?_(t):i.isString(t)?function(e){return e.get(t)}:t},_=function(t){var e=i.matches(t);return function(t){return e(t.attributes)}};i.each([[b,{forEach:3,each:3,map:3,collect:3,reduce:0,foldl:0,inject:0,reduceRight:0,foldr:0,find:3,detect:3,filter:3,select:3,reject:3,every:3,all:3,some:3,any:3,include:3,includes:3,contains:3,invoke:0,max:3,min:3,toArray:1,size:1,first:3,head:3,take:3,initial:3,rest:3,tail:3,drop:3,last:3,without:0,difference:0,indexOf:3,shuffle:1,lastIndexOf:3,isEmpty:1,chain:1,sample:3,partition:3,groupBy:3,countBy:3,sortBy:3,indexBy:3,findIndex:3,findLastIndex:3},"models"],[m,{keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1},"attributes"]],(function(t){var e=t[0],n=t[1],r=t[2];e.mixin=function(t){var n=i.reduce(i.functions(t),(function(t,e){return t[e]=0,t}),{});N(e,t,n,r)},N(e,i,n,r)})),e.sync=function(t,n,r){var s=F[t];i.defaults(r||(r={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var o={type:s,dataType:"json"};if(r.url||(o.url=i.result(n,"url")||B()),null!=r.data||!n||"create"!==t&&"update"!==t&&"patch"!==t||(o.contentType="application/json",o.data=JSON.stringify(r.attrs||n.toJSON(r))),r.emulateJSON&&(o.contentType="application/x-www-form-urlencoded",o.data=o.data?{model:o.data}:{}),r.emulateHTTP&&("PUT"===s||"DELETE"===s||"PATCH"===s)){o.type="POST",r.emulateJSON&&(o.data._method=s);var a=r.beforeSend;r.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",s),a)return a.apply(this,arguments)}}"GET"===o.type||r.emulateJSON||(o.processData=!1);var l=r.error;r.error=function(t,e,i){r.textStatus=e,r.errorThrown=i,l&&l.call(r.context,t,e,i)};var c=r.xhr=e.ajax(i.extend(o,r));return n.trigger("request",n,c,r),c};var F={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var H=e.Router=function(t){t||(t={}),this.preinitialize.apply(this,arguments),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},P=/\((.*?)\)/g,O=/(\(\?)?:\w+/g,j=/\*\w+/g,I=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend(H.prototype,a,{preinitialize:function(){},initialize:function(){},route:function(t,n,r){i.isRegExp(t)||(t=this._routeToRegExp(t)),i.isFunction(n)&&(r=n,n=""),r||(r=this[n]);var s=this;return e.history.route(t,(function(i){var o=s._extractParameters(t,i);!1!==s.execute(r,o,n)&&(s.trigger.apply(s,["route:"+n].concat(o)),s.trigger("route",n,o),e.history.trigger("route",s,n,o))})),this},execute:function(t,e,i){t&&t.apply(this,e)},navigate:function(t,i){return e.history.navigate(t,i),this},_bindRoutes:function(){if(this.routes){this.routes=i.result(this,"routes");for(var t,e=i.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(I,"\\$&").replace(P,"(?:$1)?").replace(O,(function(t,e){return e?t:"([^/?]+)"})).replace(j,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var n=t.exec(e).slice(1);return i.map(n,(function(t,e){return e===n.length-1?t||null:t?decodeURIComponent(t):null}))}});var W=e.History=function(){this.handlers=[],this.checkUrl=this.checkUrl.bind(this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},z=/^[#\/]|\s+$/g,V=/^\/+|\/+$/g,R=/#.*$/;W.started=!1,i.extend(W.prototype,a,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+"/"===this.root},decodeFragment:function(t){return decodeURI(t.replace(/%25/g,"%2525"))},getSearch:function(){var t=this.location.href.replace(/#.*/,"").match(/\?.+/);return t?t[0]:""},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getPath:function(){var t=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return"/"===t.charAt(0)?t.slice(1):t},getFragment:function(t){return null==t&&(t=this._usePushState||!this._wantsHashChange?this.getPath():this.getHash()),t.replace(z,"")},start:function(t){if(W.started)throw new Error("Backbone.history has already been started");if(W.started=!0,this.options=i.extend({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._hasHashChange="onhashchange"in window&&(void 0===document.documentMode||document.documentMode>7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(V,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";return this.location.replace(e+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var n=document.body,r=n.insertBefore(this.iframe,n.firstChild).contentWindow;r.document.open(),r.document.close(),r.location.hash="#"+this.fragment}var s=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};if(this._usePushState?s("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?s("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&t("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),W.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e===this.fragment)return!1;this.iframe&&this.navigate(e),this.loadUrl()},loadUrl:function(t){return!!this.matchRoot()&&(t=this.fragment=this.getFragment(t),i.some(this.handlers,(function(e){if(e.route.test(t))return e.callback(t),!0})))},navigate:function(t,e){if(!W.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||"");var i=this.root;""!==t&&"?"!==t.charAt(0)||(i=i.slice(0,-1)||"/");var n=i+t;t=t.replace(R,"");var r=this.decodeFragment(t);if(this.fragment!==r){if(this.fragment=r,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,n);else{if(!this._wantsHashChange)return this.location.assign(n);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var s=this.iframe.contentWindow;e.replace||(s.document.open(),s.document.close()),this._updateHash(s.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,i){if(i){var n=t.href.replace(/(javascript:|#).*$/,"");t.replace(n+"#"+e)}else t.hash="#"+e}}),e.history=new W;m.extend=b.extend=H.extend=D.extend=W.extend=function(t,e){var n,r=this;return n=t&&i.has(t,"constructor")?t.constructor:function(){return r.apply(this,arguments)},i.extend(n,r,e),n.prototype=i.create(r.prototype,t),n.prototype.constructor=n,n.__super__=r.prototype,n};var B=function(){throw new Error('A "url" property or function must be specified')},L=function(t,e){var i=e.error;e.error=function(n){i&&i.call(e.context,t,n,e),t.trigger("error",t,n,e)}};return e}(s,i,t,e)}.apply(e,n))||(t.exports=r)},530:function(t,e){var i;!function(e,i){"use strict";"object"==typeof t.exports?t.exports=e.document?i(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return i(t)}:i(e)}("undefined"!=typeof window?window:this,(function(n,r){"use strict";var s=[],o=Object.getPrototypeOf,a=s.slice,l=s.flat?function(t){return s.flat.call(t)}:function(t){return s.concat.apply([],t)},c=s.push,d=s.indexOf,u={},h=u.toString,p=u.hasOwnProperty,f=p.toString,g=f.call(Object),v={},m=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},b=function(t){return null!=t&&t===t.window},y=n.document,w={type:!0,src:!0,nonce:!0,noModule:!0};function x(t,e,i){var n,r,s=(i=i||y).createElement("script");if(s.text=t,e)for(n in w)(r=e[n]||e.getAttribute&&e.getAttribute(n))&&s.setAttribute(n,r);i.head.appendChild(s).parentNode.removeChild(s)}function C(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?u[h.call(t)]||"object":typeof t}var k="3.6.0",S=function(t,e){return new S.fn.init(t,e)};function $(t){var e=!!t&&"length"in t&&t.length,i=C(t);return!m(t)&&!b(t)&&("array"===i||0===e||"number"==typeof e&&e>0&&e-1 in t)}S.fn=S.prototype={jquery:k,constructor:S,length:0,toArray:function(){return a.call(this)},get:function(t){return null==t?a.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=S.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return S.each(this,t)},map:function(t){return this.pushStack(S.map(this,(function(e,i){return t.call(e,i,e)})))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(S.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,i=+t+(t<0?e:0);return this.pushStack(i>=0&&i<e?[this[i]]:[])},end:function(){return this.prevObject||this.constructor()},push:c,sort:s.sort,splice:s.splice},S.extend=S.fn.extend=function(){var t,e,i,n,r,s,o=arguments[0]||{},a=1,l=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[a]||{},a++),"object"==typeof o||m(o)||(o={}),a===l&&(o=this,a--);a<l;a++)if(null!=(t=arguments[a]))for(e in t)n=t[e],"__proto__"!==e&&o!==n&&(c&&n&&(S.isPlainObject(n)||(r=Array.isArray(n)))?(i=o[e],s=r&&!Array.isArray(i)?[]:r||S.isPlainObject(i)?i:{},r=!1,o[e]=S.extend(c,s,n)):void 0!==n&&(o[e]=n));return o},S.extend({expando:"jQuery"+(k+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,i;return!(!t||"[object Object]"!==h.call(t)||(e=o(t))&&("function"!=typeof(i=p.call(e,"constructor")&&e.constructor)||f.call(i)!==g))},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,i){x(t,{nonce:e&&e.nonce},i)},each:function(t,e){var i,n=0;if($(t))for(i=t.length;n<i&&!1!==e.call(t[n],n,t[n]);n++);else for(n in t)if(!1===e.call(t[n],n,t[n]))break;return t},makeArray:function(t,e){var i=e||[];return null!=t&&($(Object(t))?S.merge(i,"string"==typeof t?[t]:t):c.call(i,t)),i},inArray:function(t,e,i){return null==e?-1:d.call(e,t,i)},merge:function(t,e){for(var i=+e.length,n=0,r=t.length;n<i;n++)t[r++]=e[n];return t.length=r,t},grep:function(t,e,i){for(var n=[],r=0,s=t.length,o=!i;r<s;r++)!e(t[r],r)!==o&&n.push(t[r]);return n},map:function(t,e,i){var n,r,s=0,o=[];if($(t))for(n=t.length;s<n;s++)null!=(r=e(t[s],s,i))&&o.push(r);else for(s in t)null!=(r=e(t[s],s,i))&&o.push(r);return l(o)},guid:1,support:v}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=s[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(t,e){u["[object "+e+"]"]=e.toLowerCase()}));var E=function(t){var e,i,n,r,s,o,a,l,c,d,u,h,p,f,g,v,m,b,y,w="sizzle"+1*new Date,x=t.document,C=0,k=0,S=lt(),$=lt(),E=lt(),D=lt(),T=function(t,e){return t===e&&(u=!0),0},M={}.hasOwnProperty,N=[],A=N.pop,_=N.push,F=N.push,H=N.slice,P=function(t,e){for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1},O="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",j="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\[[\\x20\\t\\r\\n\\f]*("+I+")(?:"+j+"*([*^$|!~]?=)"+j+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+j+"*\\]",z=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",V=new RegExp(j+"+","g"),R=new RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g"),B=new RegExp("^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*"),L=new RegExp("^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),q=new RegExp(j+"|>"),U=new RegExp(z),X=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+z),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("^(?:"+O+")$","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")},J=/HTML$/i,Y=/^(?:input|select|textarea|button)$/i,K=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\([^\\r\\n\\f])","g"),it=function(t,e){var i="0x"+t.slice(1)-65536;return e||(i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320))},nt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,rt=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},st=function(){h()},ot=wt((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{F.apply(N=H.call(x.childNodes),x.childNodes),N[x.childNodes.length].nodeType}catch(t){F={apply:N.length?function(t,e){_.apply(t,H.call(e))}:function(t,e){for(var i=t.length,n=0;t[i++]=e[n++];);t.length=i-1}}}function at(t,e,n,r){var s,a,c,d,u,f,m,b=e&&e.ownerDocument,x=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==x&&9!==x&&11!==x)return n;if(!r&&(h(e),e=e||p,g)){if(11!==x&&(u=Z.exec(t)))if(s=u[1]){if(9===x){if(!(c=e.getElementById(s)))return n;if(c.id===s)return n.push(c),n}else if(b&&(c=b.getElementById(s))&&y(e,c)&&c.id===s)return n.push(c),n}else{if(u[2])return F.apply(n,e.getElementsByTagName(t)),n;if((s=u[3])&&i.getElementsByClassName&&e.getElementsByClassName)return F.apply(n,e.getElementsByClassName(s)),n}if(i.qsa&&!D[t+" "]&&(!v||!v.test(t))&&(1!==x||"object"!==e.nodeName.toLowerCase())){if(m=t,b=e,1===x&&(q.test(t)||L.test(t))){for((b=tt.test(t)&&mt(e.parentNode)||e)===e&&i.scope||((d=e.getAttribute("id"))?d=d.replace(nt,rt):e.setAttribute("id",d=w)),a=(f=o(t)).length;a--;)f[a]=(d?"#"+d:":scope")+" "+yt(f[a]);m=f.join(",")}try{return F.apply(n,b.querySelectorAll(m)),n}catch(e){D(t,!0)}finally{d===w&&e.removeAttribute("id")}}}return l(t.replace(R,"$1"),e,n,r)}function lt(){var t=[];return function e(i,r){return t.push(i+" ")>n.cacheLength&&delete e[t.shift()],e[i+" "]=r}}function ct(t){return t[w]=!0,t}function dt(t){var e=p.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ut(t,e){for(var i=t.split("|"),r=i.length;r--;)n.attrHandle[i[r]]=e}function ht(t,e){var i=e&&t,n=i&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(n)return n;if(i)for(;i=i.nextSibling;)if(i===e)return-1;return t?1:-1}function pt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function ft(t){return function(e){var i=e.nodeName.toLowerCase();return("input"===i||"button"===i)&&e.type===t}}function gt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ot(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function vt(t){return ct((function(e){return e=+e,ct((function(i,n){for(var r,s=t([],i.length,e),o=s.length;o--;)i[r=s[o]]&&(i[r]=!(n[r]=i[r]))}))}))}function mt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in i=at.support={},s=at.isXML=function(t){var e=t&&t.namespaceURI,i=t&&(t.ownerDocument||t).documentElement;return!J.test(e||i&&i.nodeName||"HTML")},h=at.setDocument=function(t){var e,r,o=t?t.ownerDocument||t:x;return o!=p&&9===o.nodeType&&o.documentElement?(f=(p=o).documentElement,g=!s(p),x!=p&&(r=p.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",st,!1):r.attachEvent&&r.attachEvent("onunload",st)),i.scope=dt((function(t){return f.appendChild(t).appendChild(p.createElement("div")),void 0!==t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length})),i.attributes=dt((function(t){return t.className="i",!t.getAttribute("className")})),i.getElementsByTagName=dt((function(t){return t.appendChild(p.createComment("")),!t.getElementsByTagName("*").length})),i.getElementsByClassName=Q.test(p.getElementsByClassName),i.getById=dt((function(t){return f.appendChild(t).id=w,!p.getElementsByName||!p.getElementsByName(w).length})),i.getById?(n.filter.ID=function(t){var e=t.replace(et,it);return function(t){return t.getAttribute("id")===e}},n.find.ID=function(t,e){if(void 0!==e.getElementById&&g){var i=e.getElementById(t);return i?[i]:[]}}):(n.filter.ID=function(t){var e=t.replace(et,it);return function(t){var i=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return i&&i.value===e}},n.find.ID=function(t,e){if(void 0!==e.getElementById&&g){var i,n,r,s=e.getElementById(t);if(s){if((i=s.getAttributeNode("id"))&&i.value===t)return[s];for(r=e.getElementsByName(t),n=0;s=r[n++];)if((i=s.getAttributeNode("id"))&&i.value===t)return[s]}return[]}}),n.find.TAG=i.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):i.qsa?e.querySelectorAll(t):void 0}:function(t,e){var i,n=[],r=0,s=e.getElementsByTagName(t);if("*"===t){for(;i=s[r++];)1===i.nodeType&&n.push(i);return n}return s},n.find.CLASS=i.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&g)return e.getElementsByClassName(t)},m=[],v=[],(i.qsa=Q.test(p.querySelectorAll))&&(dt((function(t){var e;f.appendChild(t).innerHTML="<a id='"+w+"'></a><select id='"+w+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),t.querySelectorAll("[selected]").length||v.push("\\[[\\x20\\t\\r\\n\\f]*(?:value|"+O+")"),t.querySelectorAll("[id~="+w+"-]").length||v.push("~="),(e=p.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||v.push("\\[[\\x20\\t\\r\\n\\f]*name[\\x20\\t\\r\\n\\f]*=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),t.querySelectorAll(":checked").length||v.push(":checked"),t.querySelectorAll("a#"+w+"+*").length||v.push(".#.+[+~]"),t.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")})),dt((function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=p.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&v.push("name[\\x20\\t\\r\\n\\f]*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),f.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),v.push(",.*:")}))),(i.matchesSelector=Q.test(b=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&dt((function(t){i.disconnectedMatch=b.call(t,"*"),b.call(t,"[s!='']:x"),m.push("!=",z)})),v=v.length&&new RegExp(v.join("|")),m=m.length&&new RegExp(m.join("|")),e=Q.test(f.compareDocumentPosition),y=e||Q.test(f.contains)?function(t,e){var i=9===t.nodeType?t.documentElement:t,n=e&&e.parentNode;return t===n||!(!n||1!==n.nodeType||!(i.contains?i.contains(n):t.compareDocumentPosition&&16&t.compareDocumentPosition(n)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},T=e?function(t,e){if(t===e)return u=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n||(1&(n=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!i.sortDetached&&e.compareDocumentPosition(t)===n?t==p||t.ownerDocument==x&&y(x,t)?-1:e==p||e.ownerDocument==x&&y(x,e)?1:d?P(d,t)-P(d,e):0:4&n?-1:1)}:function(t,e){if(t===e)return u=!0,0;var i,n=0,r=t.parentNode,s=e.parentNode,o=[t],a=[e];if(!r||!s)return t==p?-1:e==p?1:r?-1:s?1:d?P(d,t)-P(d,e):0;if(r===s)return ht(t,e);for(i=t;i=i.parentNode;)o.unshift(i);for(i=e;i=i.parentNode;)a.unshift(i);for(;o[n]===a[n];)n++;return n?ht(o[n],a[n]):o[n]==x?-1:a[n]==x?1:0},p):p},at.matches=function(t,e){return at(t,null,null,e)},at.matchesSelector=function(t,e){if(h(t),i.matchesSelector&&g&&!D[e+" "]&&(!m||!m.test(e))&&(!v||!v.test(e)))try{var n=b.call(t,e);if(n||i.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){D(e,!0)}return at(e,p,null,[t]).length>0},at.contains=function(t,e){return(t.ownerDocument||t)!=p&&h(t),y(t,e)},at.attr=function(t,e){(t.ownerDocument||t)!=p&&h(t);var r=n.attrHandle[e.toLowerCase()],s=r&&M.call(n.attrHandle,e.toLowerCase())?r(t,e,!g):void 0;return void 0!==s?s:i.attributes||!g?t.getAttribute(e):(s=t.getAttributeNode(e))&&s.specified?s.value:null},at.escape=function(t){return(t+"").replace(nt,rt)},at.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},at.uniqueSort=function(t){var e,n=[],r=0,s=0;if(u=!i.detectDuplicates,d=!i.sortStable&&t.slice(0),t.sort(T),u){for(;e=t[s++];)e===t[s]&&(r=n.push(s));for(;r--;)t.splice(n[r],1)}return d=null,t},r=at.getText=function(t){var e,i="",n=0,s=t.nodeType;if(s){if(1===s||9===s||11===s){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)i+=r(t)}else if(3===s||4===s)return t.nodeValue}else for(;e=t[n++];)i+=r(e);return i},(n=at.selectors={cacheLength:50,createPseudo:ct,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,it),t[3]=(t[3]||t[4]||t[5]||"").replace(et,it),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||at.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&at.error(t[0]),t},PSEUDO:function(t){var e,i=!t[6]&&t[2];return G.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":i&&U.test(i)&&(e=o(i,!0))&&(e=i.indexOf(")",i.length-e)-i.length)&&(t[0]=t[0].slice(0,e),t[2]=i.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,it).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=S[t+" "];return e||(e=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+t+"("+j+"|$)"))&&S(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,i){return function(n){var r=at.attr(n,t);return null==r?"!="===e:!e||(r+="","="===e?r===i:"!="===e?r!==i:"^="===e?i&&0===r.indexOf(i):"*="===e?i&&r.indexOf(i)>-1:"$="===e?i&&r.slice(-i.length)===i:"~="===e?(" "+r.replace(V," ")+" ").indexOf(i)>-1:"|="===e&&(r===i||r.slice(0,i.length+1)===i+"-"))}},CHILD:function(t,e,i,n,r){var s="nth"!==t.slice(0,3),o="last"!==t.slice(-4),a="of-type"===e;return 1===n&&0===r?function(t){return!!t.parentNode}:function(e,i,l){var c,d,u,h,p,f,g=s!==o?"nextSibling":"previousSibling",v=e.parentNode,m=a&&e.nodeName.toLowerCase(),b=!l&&!a,y=!1;if(v){if(s){for(;g;){for(h=e;h=h[g];)if(a?h.nodeName.toLowerCase()===m:1===h.nodeType)return!1;f=g="only"===t&&!f&&"nextSibling"}return!0}if(f=[o?v.firstChild:v.lastChild],o&&b){for(y=(p=(c=(d=(u=(h=v)[w]||(h[w]={}))[h.uniqueID]||(u[h.uniqueID]={}))[t]||[])[0]===C&&c[1])&&c[2],h=p&&v.childNodes[p];h=++p&&h&&h[g]||(y=p=0)||f.pop();)if(1===h.nodeType&&++y&&h===e){d[t]=[C,p,y];break}}else if(b&&(y=p=(c=(d=(u=(h=e)[w]||(h[w]={}))[h.uniqueID]||(u[h.uniqueID]={}))[t]||[])[0]===C&&c[1]),!1===y)for(;(h=++p&&h&&h[g]||(y=p=0)||f.pop())&&((a?h.nodeName.toLowerCase()!==m:1!==h.nodeType)||!++y||(b&&((d=(u=h[w]||(h[w]={}))[h.uniqueID]||(u[h.uniqueID]={}))[t]=[C,y]),h!==e)););return(y-=r)===n||y%n==0&&y/n>=0}}},PSEUDO:function(t,e){var i,r=n.pseudos[t]||n.setFilters[t.toLowerCase()]||at.error("unsupported pseudo: "+t);return r[w]?r(e):r.length>1?(i=[t,t,"",e],n.setFilters.hasOwnProperty(t.toLowerCase())?ct((function(t,i){for(var n,s=r(t,e),o=s.length;o--;)t[n=P(t,s[o])]=!(i[n]=s[o])})):function(t){return r(t,0,i)}):r}},pseudos:{not:ct((function(t){var e=[],i=[],n=a(t.replace(R,"$1"));return n[w]?ct((function(t,e,i,r){for(var s,o=n(t,null,r,[]),a=t.length;a--;)(s=o[a])&&(t[a]=!(e[a]=s))})):function(t,r,s){return e[0]=t,n(e,null,s,i),e[0]=null,!i.pop()}})),has:ct((function(t){return function(e){return at(t,e).length>0}})),contains:ct((function(t){return t=t.replace(et,it),function(e){return(e.textContent||r(e)).indexOf(t)>-1}})),lang:ct((function(t){return X.test(t||"")||at.error("unsupported lang: "+t),t=t.replace(et,it).toLowerCase(),function(e){var i;do{if(i=g?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(i=i.toLowerCase())===t||0===i.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var i=t.location&&t.location.hash;return i&&i.slice(1)===e.id},root:function(t){return t===f},focus:function(t){return t===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:gt(!1),disabled:gt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!n.pseudos.empty(t)},header:function(t){return K.test(t.nodeName)},input:function(t){return Y.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:vt((function(){return[0]})),last:vt((function(t,e){return[e-1]})),eq:vt((function(t,e,i){return[i<0?i+e:i]})),even:vt((function(t,e){for(var i=0;i<e;i+=2)t.push(i);return t})),odd:vt((function(t,e){for(var i=1;i<e;i+=2)t.push(i);return t})),lt:vt((function(t,e,i){for(var n=i<0?i+e:i>e?e:i;--n>=0;)t.push(n);return t})),gt:vt((function(t,e,i){for(var n=i<0?i+e:i;++n<e;)t.push(n);return t}))}}).pseudos.nth=n.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})n.pseudos[e]=pt(e);for(e in{submit:!0,reset:!0})n.pseudos[e]=ft(e);function bt(){}function yt(t){for(var e=0,i=t.length,n="";e<i;e++)n+=t[e].value;return n}function wt(t,e,i){var n=e.dir,r=e.next,s=r||n,o=i&&"parentNode"===s,a=k++;return e.first?function(e,i,r){for(;e=e[n];)if(1===e.nodeType||o)return t(e,i,r);return!1}:function(e,i,l){var c,d,u,h=[C,a];if(l){for(;e=e[n];)if((1===e.nodeType||o)&&t(e,i,l))return!0}else for(;e=e[n];)if(1===e.nodeType||o)if(d=(u=e[w]||(e[w]={}))[e.uniqueID]||(u[e.uniqueID]={}),r&&r===e.nodeName.toLowerCase())e=e[n]||e;else{if((c=d[s])&&c[0]===C&&c[1]===a)return h[2]=c[2];if(d[s]=h,h[2]=t(e,i,l))return!0}return!1}}function xt(t){return t.length>1?function(e,i,n){for(var r=t.length;r--;)if(!t[r](e,i,n))return!1;return!0}:t[0]}function Ct(t,e,i,n,r){for(var s,o=[],a=0,l=t.length,c=null!=e;a<l;a++)(s=t[a])&&(i&&!i(s,n,r)||(o.push(s),c&&e.push(a)));return o}function kt(t,e,i,n,r,s){return n&&!n[w]&&(n=kt(n)),r&&!r[w]&&(r=kt(r,s)),ct((function(s,o,a,l){var c,d,u,h=[],p=[],f=o.length,g=s||function(t,e,i){for(var n=0,r=e.length;n<r;n++)at(t,e[n],i);return i}(e||"*",a.nodeType?[a]:a,[]),v=!t||!s&&e?g:Ct(g,h,t,a,l),m=i?r||(s?t:f||n)?[]:o:v;if(i&&i(v,m,a,l),n)for(c=Ct(m,p),n(c,[],a,l),d=c.length;d--;)(u=c[d])&&(m[p[d]]=!(v[p[d]]=u));if(s){if(r||t){if(r){for(c=[],d=m.length;d--;)(u=m[d])&&c.push(v[d]=u);r(null,m=[],c,l)}for(d=m.length;d--;)(u=m[d])&&(c=r?P(s,u):h[d])>-1&&(s[c]=!(o[c]=u))}}else m=Ct(m===o?m.splice(f,m.length):m),r?r(null,o,m,l):F.apply(o,m)}))}function St(t){for(var e,i,r,s=t.length,o=n.relative[t[0].type],a=o||n.relative[" "],l=o?1:0,d=wt((function(t){return t===e}),a,!0),u=wt((function(t){return P(e,t)>-1}),a,!0),h=[function(t,i,n){var r=!o&&(n||i!==c)||((e=i).nodeType?d(t,i,n):u(t,i,n));return e=null,r}];l<s;l++)if(i=n.relative[t[l].type])h=[wt(xt(h),i)];else{if((i=n.filter[t[l].type].apply(null,t[l].matches))[w]){for(r=++l;r<s&&!n.relative[t[r].type];r++);return kt(l>1&&xt(h),l>1&&yt(t.slice(0,l-1).concat({value:" "===t[l-2].type?"*":""})).replace(R,"$1"),i,l<r&&St(t.slice(l,r)),r<s&&St(t=t.slice(r)),r<s&&yt(t))}h.push(i)}return xt(h)}return bt.prototype=n.filters=n.pseudos,n.setFilters=new bt,o=at.tokenize=function(t,e){var i,r,s,o,a,l,c,d=$[t+" "];if(d)return e?0:d.slice(0);for(a=t,l=[],c=n.preFilter;a;){for(o in i&&!(r=B.exec(a))||(r&&(a=a.slice(r[0].length)||a),l.push(s=[])),i=!1,(r=L.exec(a))&&(i=r.shift(),s.push({value:i,type:r[0].replace(R," ")}),a=a.slice(i.length)),n.filter)!(r=G[o].exec(a))||c[o]&&!(r=c[o](r))||(i=r.shift(),s.push({value:i,type:o,matches:r}),a=a.slice(i.length));if(!i)break}return e?a.length:a?at.error(t):$(t,l).slice(0)},a=at.compile=function(t,e){var i,r=[],s=[],a=E[t+" "];if(!a){for(e||(e=o(t)),i=e.length;i--;)(a=St(e[i]))[w]?r.push(a):s.push(a);(a=E(t,function(t,e){var i=e.length>0,r=t.length>0,s=function(s,o,a,l,d){var u,f,v,m=0,b="0",y=s&&[],w=[],x=c,k=s||r&&n.find.TAG("*",d),S=C+=null==x?1:Math.random()||.1,$=k.length;for(d&&(c=o==p||o||d);b!==$&&null!=(u=k[b]);b++){if(r&&u){for(f=0,o||u.ownerDocument==p||(h(u),a=!g);v=t[f++];)if(v(u,o||p,a)){l.push(u);break}d&&(C=S)}i&&((u=!v&&u)&&m--,s&&y.push(u))}if(m+=b,i&&b!==m){for(f=0;v=e[f++];)v(y,w,o,a);if(s){if(m>0)for(;b--;)y[b]||w[b]||(w[b]=A.call(l));w=Ct(w)}F.apply(l,w),d&&!s&&w.length>0&&m+e.length>1&&at.uniqueSort(l)}return d&&(C=S,c=x),y};return i?ct(s):s}(s,r))).selector=t}return a},l=at.select=function(t,e,i,r){var s,l,c,d,u,h="function"==typeof t&&t,p=!r&&o(t=h.selector||t);if(i=i||[],1===p.length){if((l=p[0]=p[0].slice(0)).length>2&&"ID"===(c=l[0]).type&&9===e.nodeType&&g&&n.relative[l[1].type]){if(!(e=(n.find.ID(c.matches[0].replace(et,it),e)||[])[0]))return i;h&&(e=e.parentNode),t=t.slice(l.shift().value.length)}for(s=G.needsContext.test(t)?0:l.length;s--&&(c=l[s],!n.relative[d=c.type]);)if((u=n.find[d])&&(r=u(c.matches[0].replace(et,it),tt.test(l[0].type)&&mt(e.parentNode)||e))){if(l.splice(s,1),!(t=r.length&&yt(l)))return F.apply(i,r),i;break}}return(h||a(t,p))(r,e,!g,i,!e||tt.test(t)&&mt(e.parentNode)||e),i},i.sortStable=w.split("").sort(T).join("")===w,i.detectDuplicates=!!u,h(),i.sortDetached=dt((function(t){return 1&t.compareDocumentPosition(p.createElement("fieldset"))})),dt((function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")}))||ut("type|href|height|width",(function(t,e,i){if(!i)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),i.attributes&&dt((function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||ut("value",(function(t,e,i){if(!i&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),dt((function(t){return null==t.getAttribute("disabled")}))||ut(O,(function(t,e,i){var n;if(!i)return!0===t[e]?e.toLowerCase():(n=t.getAttributeNode(e))&&n.specified?n.value:null})),at}(n);S.find=E,S.expr=E.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=E.uniqueSort,S.text=E.getText,S.isXMLDoc=E.isXML,S.contains=E.contains,S.escapeSelector=E.escape;var D=function(t,e,i){for(var n=[],r=void 0!==i;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&&S(t).is(i))break;n.push(t)}return n},T=function(t,e){for(var i=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&i.push(t);return i},M=S.expr.match.needsContext;function N(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var A=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function _(t,e,i){return m(e)?S.grep(t,(function(t,n){return!!e.call(t,n,t)!==i})):e.nodeType?S.grep(t,(function(t){return t===e!==i})):"string"!=typeof e?S.grep(t,(function(t){return d.call(e,t)>-1!==i})):S.filter(e,t,i)}S.filter=function(t,e,i){var n=e[0];return i&&(t=":not("+t+")"),1===e.length&&1===n.nodeType?S.find.matchesSelector(n,t)?[n]:[]:S.find.matches(t,S.grep(e,(function(t){return 1===t.nodeType})))},S.fn.extend({find:function(t){var e,i,n=this.length,r=this;if("string"!=typeof t)return this.pushStack(S(t).filter((function(){for(e=0;e<n;e++)if(S.contains(r[e],this))return!0})));for(i=this.pushStack([]),e=0;e<n;e++)S.find(t,r[e],i);return n>1?S.uniqueSort(i):i},filter:function(t){return this.pushStack(_(this,t||[],!1))},not:function(t){return this.pushStack(_(this,t||[],!0))},is:function(t){return!!_(this,"string"==typeof t&&M.test(t)?S(t):t||[],!1).length}});var F,H=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(t,e,i){var n,r;if(!t)return this;if(i=i||F,"string"==typeof t){if(!(n="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:H.exec(t))||!n[1]&&e)return!e||e.jquery?(e||i).find(t):this.constructor(e).find(t);if(n[1]){if(e=e instanceof S?e[0]:e,S.merge(this,S.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:y,!0)),A.test(n[1])&&S.isPlainObject(e))for(n in e)m(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}return(r=y.getElementById(n[2]))&&(this[0]=r,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):m(t)?void 0!==i.ready?i.ready(t):t(S):S.makeArray(t,this)}).prototype=S.fn,F=S(y);var P=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function j(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}S.fn.extend({has:function(t){var e=S(t,this),i=e.length;return this.filter((function(){for(var t=0;t<i;t++)if(S.contains(this,e[t]))return!0}))},closest:function(t,e){var i,n=0,r=this.length,s=[],o="string"!=typeof t&&S(t);if(!M.test(t))for(;n<r;n++)for(i=this[n];i&&i!==e;i=i.parentNode)if(i.nodeType<11&&(o?o.index(i)>-1:1===i.nodeType&&S.find.matchesSelector(i,t))){s.push(i);break}return this.pushStack(s.length>1?S.uniqueSort(s):s)},index:function(t){return t?"string"==typeof t?d.call(S(t),this[0]):d.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),S.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return D(t,"parentNode")},parentsUntil:function(t,e,i){return D(t,"parentNode",i)},next:function(t){return j(t,"nextSibling")},prev:function(t){return j(t,"previousSibling")},nextAll:function(t){return D(t,"nextSibling")},prevAll:function(t){return D(t,"previousSibling")},nextUntil:function(t,e,i){return D(t,"nextSibling",i)},prevUntil:function(t,e,i){return D(t,"previousSibling",i)},siblings:function(t){return T((t.parentNode||{}).firstChild,t)},children:function(t){return T(t.firstChild)},contents:function(t){return null!=t.contentDocument&&o(t.contentDocument)?t.contentDocument:(N(t,"template")&&(t=t.content||t),S.merge([],t.childNodes))}},(function(t,e){S.fn[t]=function(i,n){var r=S.map(this,e,i);return"Until"!==t.slice(-5)&&(n=i),n&&"string"==typeof n&&(r=S.filter(n,r)),this.length>1&&(O[t]||S.uniqueSort(r),P.test(t)&&r.reverse()),this.pushStack(r)}}));var I=/[^\x20\t\r\n\f]+/g;function W(t){return t}function z(t){throw t}function V(t,e,i,n){var r;try{t&&m(r=t.promise)?r.call(t).done(e).fail(i):t&&m(r=t.then)?r.call(t,e,i):e.apply(void 0,[t].slice(n))}catch(t){i.apply(void 0,[t])}}S.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return S.each(t.match(I)||[],(function(t,i){e[i]=!0})),e}(t):S.extend({},t);var e,i,n,r,s=[],o=[],a=-1,l=function(){for(r=r||t.once,n=e=!0;o.length;a=-1)for(i=o.shift();++a<s.length;)!1===s[a].apply(i[0],i[1])&&t.stopOnFalse&&(a=s.length,i=!1);t.memory||(i=!1),e=!1,r&&(s=i?[]:"")},c={add:function(){return s&&(i&&!e&&(a=s.length-1,o.push(i)),function e(i){S.each(i,(function(i,n){m(n)?t.unique&&c.has(n)||s.push(n):n&&n.length&&"string"!==C(n)&&e(n)}))}(arguments),i&&!e&&l()),this},remove:function(){return S.each(arguments,(function(t,e){for(var i;(i=S.inArray(e,s,i))>-1;)s.splice(i,1),i<=a&&a--})),this},has:function(t){return t?S.inArray(t,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return r=o=[],s=i="",this},disabled:function(){return!s},lock:function(){return r=o=[],i||e||(s=i=""),this},locked:function(){return!!r},fireWith:function(t,i){return r||(i=[t,(i=i||[]).slice?i.slice():i],o.push(i),e||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!n}};return c},S.extend({Deferred:function(t){var e=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pending",r={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},catch:function(t){return r.then(null,t)},pipe:function(){var t=arguments;return S.Deferred((function(i){S.each(e,(function(e,n){var r=m(t[n[4]])&&t[n[4]];s[n[1]]((function(){var t=r&&r.apply(this,arguments);t&&m(t.promise)?t.promise().progress(i.notify).done(i.resolve).fail(i.reject):i[n[0]+"With"](this,r?[t]:arguments)}))})),t=null})).promise()},then:function(t,i,r){var s=0;function o(t,e,i,r){return function(){var a=this,l=arguments,c=function(){var n,c;if(!(t<s)){if((n=i.apply(a,l))===e.promise())throw new TypeError("Thenable self-resolution");c=n&&("object"==typeof n||"function"==typeof n)&&n.then,m(c)?r?c.call(n,o(s,e,W,r),o(s,e,z,r)):(s++,c.call(n,o(s,e,W,r),o(s,e,z,r),o(s,e,W,e.notifyWith))):(i!==W&&(a=void 0,l=[n]),(r||e.resolveWith)(a,l))}},d=r?c:function(){try{c()}catch(n){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(n,d.stackTrace),t+1>=s&&(i!==z&&(a=void 0,l=[n]),e.rejectWith(a,l))}};t?d():(S.Deferred.getStackHook&&(d.stackTrace=S.Deferred.getStackHook()),n.setTimeout(d))}}return S.Deferred((function(n){e[0][3].add(o(0,n,m(r)?r:W,n.notifyWith)),e[1][3].add(o(0,n,m(t)?t:W)),e[2][3].add(o(0,n,m(i)?i:z))})).promise()},promise:function(t){return null!=t?S.extend(t,r):r}},s={};return S.each(e,(function(t,n){var o=n[2],a=n[5];r[n[1]]=o.add,a&&o.add((function(){i=a}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),o.add(n[3].fire),s[n[0]]=function(){return s[n[0]+"With"](this===s?void 0:this,arguments),this},s[n[0]+"With"]=o.fireWith})),r.promise(s),t&&t.call(s,s),s},when:function(t){var e=arguments.length,i=e,n=Array(i),r=a.call(arguments),s=S.Deferred(),o=function(t){return function(i){n[t]=this,r[t]=arguments.length>1?a.call(arguments):i,--e||s.resolveWith(n,r)}};if(e<=1&&(V(t,s.done(o(i)).resolve,s.reject,!e),"pending"===s.state()||m(r[i]&&r[i].then)))return s.then();for(;i--;)V(r[i],o(i),s.reject);return s.promise()}});var R=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&R.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},S.readyException=function(t){n.setTimeout((function(){throw t}))};var B=S.Deferred();function L(){y.removeEventListener("DOMContentLoaded",L),n.removeEventListener("load",L),S.ready()}S.fn.ready=function(t){return B.then(t).catch((function(t){S.readyException(t)})),this},S.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==t&&--S.readyWait>0||B.resolveWith(y,[S]))}}),S.ready.then=B.then,"complete"===y.readyState||"loading"!==y.readyState&&!y.documentElement.doScroll?n.setTimeout(S.ready):(y.addEventListener("DOMContentLoaded",L),n.addEventListener("load",L));var q=function(t,e,i,n,r,s,o){var a=0,l=t.length,c=null==i;if("object"===C(i))for(a in r=!0,i)q(t,e,a,i[a],!0,s,o);else if(void 0!==n&&(r=!0,m(n)||(o=!0),c&&(o?(e.call(t,n),e=null):(c=e,e=function(t,e,i){return c.call(S(t),i)})),e))for(;a<l;a++)e(t[a],i,o?n:n.call(t[a],a,e(t[a],i)));return r?t:c?e.call(t):l?e(t[0],i):s},U=/^-ms-/,X=/-([a-z])/g;function G(t,e){return e.toUpperCase()}function J(t){return t.replace(U,"ms-").replace(X,G)}var Y=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function K(){this.expando=S.expando+K.uid++}K.uid=1,K.prototype={cache:function(t){var e=t[this.expando];return e||(e={},Y(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,i){var n,r=this.cache(t);if("string"==typeof e)r[J(e)]=i;else for(n in e)r[J(n)]=e[n];return r},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][J(e)]},access:function(t,e,i){return void 0===e||e&&"string"==typeof e&&void 0===i?this.get(t,e):(this.set(t,e,i),void 0!==i?i:e)},remove:function(t,e){var i,n=t[this.expando];if(void 0!==n){if(void 0!==e){i=(e=Array.isArray(e)?e.map(J):(e=J(e))in n?[e]:e.match(I)||[]).length;for(;i--;)delete n[e[i]]}(void 0===e||S.isEmptyObject(n))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!S.isEmptyObject(e)}};var Q=new K,Z=new K,tt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,et=/[A-Z]/g;function it(t,e,i){var n;if(void 0===i&&1===t.nodeType)if(n="data-"+e.replace(et,"-$&").toLowerCase(),"string"==typeof(i=t.getAttribute(n))){try{i=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:tt.test(t)?JSON.parse(t):t)}(i)}catch(t){}Z.set(t,e,i)}else i=void 0;return i}S.extend({hasData:function(t){return Z.hasData(t)||Q.hasData(t)},data:function(t,e,i){return Z.access(t,e,i)},removeData:function(t,e){Z.remove(t,e)},_data:function(t,e,i){return Q.access(t,e,i)},_removeData:function(t,e){Q.remove(t,e)}}),S.fn.extend({data:function(t,e){var i,n,r,s=this[0],o=s&&s.attributes;if(void 0===t){if(this.length&&(r=Z.get(s),1===s.nodeType&&!Q.get(s,"hasDataAttrs"))){for(i=o.length;i--;)o[i]&&0===(n=o[i].name).indexOf("data-")&&(n=J(n.slice(5)),it(s,n,r[n]));Q.set(s,"hasDataAttrs",!0)}return r}return"object"==typeof t?this.each((function(){Z.set(this,t)})):q(this,(function(e){var i;if(s&&void 0===e)return void 0!==(i=Z.get(s,t))||void 0!==(i=it(s,t))?i:void 0;this.each((function(){Z.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){Z.remove(this,t)}))}}),S.extend({queue:function(t,e,i){var n;if(t)return e=(e||"fx")+"queue",n=Q.get(t,e),i&&(!n||Array.isArray(i)?n=Q.access(t,e,S.makeArray(i)):n.push(i)),n||[]},dequeue:function(t,e){e=e||"fx";var i=S.queue(t,e),n=i.length,r=i.shift(),s=S._queueHooks(t,e);"inprogress"===r&&(r=i.shift(),n--),r&&("fx"===e&&i.unshift("inprogress"),delete s.stop,r.call(t,(function(){S.dequeue(t,e)}),s)),!n&&s&&s.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return Q.get(t,i)||Q.access(t,i,{empty:S.Callbacks("once memory").add((function(){Q.remove(t,[e+"queue",i])}))})}}),S.fn.extend({queue:function(t,e){var i=2;return"string"!=typeof t&&(e=t,t="fx",i--),arguments.length<i?S.queue(this[0],t):void 0===e?this:this.each((function(){var i=S.queue(this,t,e);S._queueHooks(this,t),"fx"===t&&"inprogress"!==i[0]&&S.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){S.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var i,n=1,r=S.Deferred(),s=this,o=this.length,a=function(){--n||r.resolveWith(s,[s])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";o--;)(i=Q.get(s[o],t+"queueHooks"))&&i.empty&&(n++,i.empty.add(a));return a(),r.promise(e)}});var nt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,rt=new RegExp("^(?:([+-])=|)("+nt+")([a-z%]*)$","i"),st=["Top","Right","Bottom","Left"],ot=y.documentElement,at=function(t){return S.contains(t.ownerDocument,t)},lt={composed:!0};ot.getRootNode&&(at=function(t){return S.contains(t.ownerDocument,t)||t.getRootNode(lt)===t.ownerDocument});var ct=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&at(t)&&"none"===S.css(t,"display")};function dt(t,e,i,n){var r,s,o=20,a=n?function(){return n.cur()}:function(){return S.css(t,e,"")},l=a(),c=i&&i[3]||(S.cssNumber[e]?"":"px"),d=t.nodeType&&(S.cssNumber[e]||"px"!==c&&+l)&&rt.exec(S.css(t,e));if(d&&d[3]!==c){for(l/=2,c=c||d[3],d=+l||1;o--;)S.style(t,e,d+c),(1-s)*(1-(s=a()/l||.5))<=0&&(o=0),d/=s;d*=2,S.style(t,e,d+c),i=i||[]}return i&&(d=+d||+l||0,r=i[1]?d+(i[1]+1)*i[2]:+i[2],n&&(n.unit=c,n.start=d,n.end=r)),r}var ut={};function ht(t){var e,i=t.ownerDocument,n=t.nodeName,r=ut[n];return r||(e=i.body.appendChild(i.createElement(n)),r=S.css(e,"display"),e.parentNode.removeChild(e),"none"===r&&(r="block"),ut[n]=r,r)}function pt(t,e){for(var i,n,r=[],s=0,o=t.length;s<o;s++)(n=t[s]).style&&(i=n.style.display,e?("none"===i&&(r[s]=Q.get(n,"display")||null,r[s]||(n.style.display="")),""===n.style.display&&ct(n)&&(r[s]=ht(n))):"none"!==i&&(r[s]="none",Q.set(n,"display",i)));for(s=0;s<o;s++)null!=r[s]&&(t[s].style.display=r[s]);return t}S.fn.extend({show:function(){return pt(this,!0)},hide:function(){return pt(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each((function(){ct(this)?S(this).show():S(this).hide()}))}});var ft,gt,vt=/^(?:checkbox|radio)$/i,mt=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,bt=/^$|^module$|\/(?:java|ecma)script/i;ft=y.createDocumentFragment().appendChild(y.createElement("div")),(gt=y.createElement("input")).setAttribute("type","radio"),gt.setAttribute("checked","checked"),gt.setAttribute("name","t"),ft.appendChild(gt),v.checkClone=ft.cloneNode(!0).cloneNode(!0).lastChild.checked,ft.innerHTML="<textarea>x</textarea>",v.noCloneChecked=!!ft.cloneNode(!0).lastChild.defaultValue,ft.innerHTML="<option></option>",v.option=!!ft.lastChild;var yt={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function wt(t,e){var i;return i=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&N(t,e)?S.merge([t],i):i}function xt(t,e){for(var i=0,n=t.length;i<n;i++)Q.set(t[i],"globalEval",!e||Q.get(e[i],"globalEval"))}yt.tbody=yt.tfoot=yt.colgroup=yt.caption=yt.thead,yt.th=yt.td,v.option||(yt.optgroup=yt.option=[1,"<select multiple='multiple'>","</select>"]);var Ct=/<|&#?\w+;/;function kt(t,e,i,n,r){for(var s,o,a,l,c,d,u=e.createDocumentFragment(),h=[],p=0,f=t.length;p<f;p++)if((s=t[p])||0===s)if("object"===C(s))S.merge(h,s.nodeType?[s]:s);else if(Ct.test(s)){for(o=o||u.appendChild(e.createElement("div")),a=(mt.exec(s)||["",""])[1].toLowerCase(),l=yt[a]||yt._default,o.innerHTML=l[1]+S.htmlPrefilter(s)+l[2],d=l[0];d--;)o=o.lastChild;S.merge(h,o.childNodes),(o=u.firstChild).textContent=""}else h.push(e.createTextNode(s));for(u.textContent="",p=0;s=h[p++];)if(n&&S.inArray(s,n)>-1)r&&r.push(s);else if(c=at(s),o=wt(u.appendChild(s),"script"),c&&xt(o),i)for(d=0;s=o[d++];)bt.test(s.type||"")&&i.push(s);return u}var St=/^([^.]*)(?:\.(.+)|)/;function $t(){return!0}function Et(){return!1}function Dt(t,e){return t===function(){try{return y.activeElement}catch(t){}}()==("focus"===e)}function Tt(t,e,i,n,r,s){var o,a;if("object"==typeof e){for(a in"string"!=typeof i&&(n=n||i,i=void 0),e)Tt(t,a,i,n,e[a],s);return t}if(null==n&&null==r?(r=i,n=i=void 0):null==r&&("string"==typeof i?(r=n,n=void 0):(r=n,n=i,i=void 0)),!1===r)r=Et;else if(!r)return t;return 1===s&&(o=r,(r=function(t){return S().off(t),o.apply(this,arguments)}).guid=o.guid||(o.guid=S.guid++)),t.each((function(){S.event.add(this,e,r,n,i)}))}function Mt(t,e,i){i?(Q.set(t,e,!1),S.event.add(t,e,{namespace:!1,handler:function(t){var n,r,s=Q.get(this,e);if(1&t.isTrigger&&this[e]){if(s.length)(S.event.special[e]||{}).delegateType&&t.stopPropagation();else if(s=a.call(arguments),Q.set(this,e,s),n=i(this,e),this[e](),s!==(r=Q.get(this,e))||n?Q.set(this,e,!1):r={},s!==r)return t.stopImmediatePropagation(),t.preventDefault(),r&&r.value}else s.length&&(Q.set(this,e,{value:S.event.trigger(S.extend(s[0],S.Event.prototype),s.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===Q.get(t,e)&&S.event.add(t,e,$t)}S.event={global:{},add:function(t,e,i,n,r){var s,o,a,l,c,d,u,h,p,f,g,v=Q.get(t);if(Y(t))for(i.handler&&(i=(s=i).handler,r=s.selector),r&&S.find.matchesSelector(ot,r),i.guid||(i.guid=S.guid++),(l=v.events)||(l=v.events=Object.create(null)),(o=v.handle)||(o=v.handle=function(e){return void 0!==S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(I)||[""]).length;c--;)p=g=(a=St.exec(e[c])||[])[1],f=(a[2]||"").split(".").sort(),p&&(u=S.event.special[p]||{},p=(r?u.delegateType:u.bindType)||p,u=S.event.special[p]||{},d=S.extend({type:p,origType:g,data:n,handler:i,guid:i.guid,selector:r,needsContext:r&&S.expr.match.needsContext.test(r),namespace:f.join(".")},s),(h=l[p])||((h=l[p]=[]).delegateCount=0,u.setup&&!1!==u.setup.call(t,n,f,o)||t.addEventListener&&t.addEventListener(p,o)),u.add&&(u.add.call(t,d),d.handler.guid||(d.handler.guid=i.guid)),r?h.splice(h.delegateCount++,0,d):h.push(d),S.event.global[p]=!0)},remove:function(t,e,i,n,r){var s,o,a,l,c,d,u,h,p,f,g,v=Q.hasData(t)&&Q.get(t);if(v&&(l=v.events)){for(c=(e=(e||"").match(I)||[""]).length;c--;)if(p=g=(a=St.exec(e[c])||[])[1],f=(a[2]||"").split(".").sort(),p){for(u=S.event.special[p]||{},h=l[p=(n?u.delegateType:u.bindType)||p]||[],a=a[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=s=h.length;s--;)d=h[s],!r&&g!==d.origType||i&&i.guid!==d.guid||a&&!a.test(d.namespace)||n&&n!==d.selector&&("**"!==n||!d.selector)||(h.splice(s,1),d.selector&&h.delegateCount--,u.remove&&u.remove.call(t,d));o&&!h.length&&(u.teardown&&!1!==u.teardown.call(t,f,v.handle)||S.removeEvent(t,p,v.handle),delete l[p])}else for(p in l)S.event.remove(t,p+e[c],i,n,!0);S.isEmptyObject(l)&&Q.remove(t,"handle events")}},dispatch:function(t){var e,i,n,r,s,o,a=new Array(arguments.length),l=S.event.fix(t),c=(Q.get(this,"events")||Object.create(null))[l.type]||[],d=S.event.special[l.type]||{};for(a[0]=l,e=1;e<arguments.length;e++)a[e]=arguments[e];if(l.delegateTarget=this,!d.preDispatch||!1!==d.preDispatch.call(this,l)){for(o=S.event.handlers.call(this,l,c),e=0;(r=o[e++])&&!l.isPropagationStopped();)for(l.currentTarget=r.elem,i=0;(s=r.handlers[i++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==s.namespace&&!l.rnamespace.test(s.namespace)||(l.handleObj=s,l.data=s.data,void 0!==(n=((S.event.special[s.origType]||{}).handle||s.handler).apply(r.elem,a))&&!1===(l.result=n)&&(l.preventDefault(),l.stopPropagation()));return d.postDispatch&&d.postDispatch.call(this,l),l.result}},handlers:function(t,e){var i,n,r,s,o,a=[],l=e.delegateCount,c=t.target;if(l&&c.nodeType&&!("click"===t.type&&t.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(s=[],o={},i=0;i<l;i++)void 0===o[r=(n=e[i]).selector+" "]&&(o[r]=n.needsContext?S(r,this).index(c)>-1:S.find(r,this,null,[c]).length),o[r]&&s.push(n);s.length&&a.push({elem:c,handlers:s})}return c=this,l<e.length&&a.push({elem:c,handlers:e.slice(l)}),a},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[S.expando]?t:new S.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return vt.test(e.type)&&e.click&&N(e,"input")&&Mt(e,"click",$t),!1},trigger:function(t){var e=this||t;return vt.test(e.type)&&e.click&&N(e,"input")&&Mt(e,"click"),!0},_default:function(t){var e=t.target;return vt.test(e.type)&&e.click&&N(e,"input")&&Q.get(e,"click")||N(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},S.removeEvent=function(t,e,i){t.removeEventListener&&t.removeEventListener(e,i)},S.Event=function(t,e){if(!(this instanceof S.Event))return new S.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?$t:Et,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&S.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Et,isPropagationStopped:Et,isImmediatePropagationStopped:Et,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=$t,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=$t,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=$t,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},(function(t,e){S.event.special[t]={setup:function(){return Mt(this,t,Dt),!1},trigger:function(){return Mt(this,t),!0},_default:function(){return!0},delegateType:e}})),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){S.event.special[t]={delegateType:e,bindType:e,handle:function(t){var i,n=this,r=t.relatedTarget,s=t.handleObj;return r&&(r===n||S.contains(n,r))||(t.type=s.origType,i=s.handler.apply(this,arguments),t.type=e),i}}})),S.fn.extend({on:function(t,e,i,n){return Tt(this,t,e,i,n)},one:function(t,e,i,n){return Tt(this,t,e,i,n,1)},off:function(t,e,i){var n,r;if(t&&t.preventDefault&&t.handleObj)return n=t.handleObj,S(t.delegateTarget).off(n.namespace?n.origType+"."+n.namespace:n.origType,n.selector,n.handler),this;if("object"==typeof t){for(r in t)this.off(r,e,t[r]);return this}return!1!==e&&"function"!=typeof e||(i=e,e=void 0),!1===i&&(i=Et),this.each((function(){S.event.remove(this,t,i,e)}))}});var Nt=/<script|<style|<link/i,At=/checked\s*(?:[^=]|=\s*.checked.)/i,_t=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Ft(t,e){return N(t,"table")&&N(11!==e.nodeType?e:e.firstChild,"tr")&&S(t).children("tbody")[0]||t}function Ht(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Pt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Ot(t,e){var i,n,r,s,o,a;if(1===e.nodeType){if(Q.hasData(t)&&(a=Q.get(t).events))for(r in Q.remove(e,"handle events"),a)for(i=0,n=a[r].length;i<n;i++)S.event.add(e,r,a[r][i]);Z.hasData(t)&&(s=Z.access(t),o=S.extend({},s),Z.set(e,o))}}function jt(t,e){var i=e.nodeName.toLowerCase();"input"===i&&vt.test(t.type)?e.checked=t.checked:"input"!==i&&"textarea"!==i||(e.defaultValue=t.defaultValue)}function It(t,e,i,n){e=l(e);var r,s,o,a,c,d,u=0,h=t.length,p=h-1,f=e[0],g=m(f);if(g||h>1&&"string"==typeof f&&!v.checkClone&&At.test(f))return t.each((function(r){var s=t.eq(r);g&&(e[0]=f.call(this,r,s.html())),It(s,e,i,n)}));if(h&&(s=(r=kt(e,t[0].ownerDocument,!1,t,n)).firstChild,1===r.childNodes.length&&(r=s),s||n)){for(a=(o=S.map(wt(r,"script"),Ht)).length;u<h;u++)c=r,u!==p&&(c=S.clone(c,!0,!0),a&&S.merge(o,wt(c,"script"))),i.call(t[u],c,u);if(a)for(d=o[o.length-1].ownerDocument,S.map(o,Pt),u=0;u<a;u++)c=o[u],bt.test(c.type||"")&&!Q.access(c,"globalEval")&&S.contains(d,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?S._evalUrl&&!c.noModule&&S._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},d):x(c.textContent.replace(_t,""),c,d))}return t}function Wt(t,e,i){for(var n,r=e?S.filter(e,t):t,s=0;null!=(n=r[s]);s++)i||1!==n.nodeType||S.cleanData(wt(n)),n.parentNode&&(i&&at(n)&&xt(wt(n,"script")),n.parentNode.removeChild(n));return t}S.extend({htmlPrefilter:function(t){return t},clone:function(t,e,i){var n,r,s,o,a=t.cloneNode(!0),l=at(t);if(!(v.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||S.isXMLDoc(t)))for(o=wt(a),n=0,r=(s=wt(t)).length;n<r;n++)jt(s[n],o[n]);if(e)if(i)for(s=s||wt(t),o=o||wt(a),n=0,r=s.length;n<r;n++)Ot(s[n],o[n]);else Ot(t,a);return(o=wt(a,"script")).length>0&&xt(o,!l&&wt(t,"script")),a},cleanData:function(t){for(var e,i,n,r=S.event.special,s=0;void 0!==(i=t[s]);s++)if(Y(i)){if(e=i[Q.expando]){if(e.events)for(n in e.events)r[n]?S.event.remove(i,n):S.removeEvent(i,n,e.handle);i[Q.expando]=void 0}i[Z.expando]&&(i[Z.expando]=void 0)}}}),S.fn.extend({detach:function(t){return Wt(this,t,!0)},remove:function(t){return Wt(this,t)},text:function(t){return q(this,(function(t){return void 0===t?S.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return It(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ft(this,t).appendChild(t)}))},prepend:function(){return It(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Ft(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return It(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return It(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(S.cleanData(wt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return S.clone(this,t,e)}))},html:function(t){return q(this,(function(t){var e=this[0]||{},i=0,n=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Nt.test(t)&&!yt[(mt.exec(t)||["",""])[1].toLowerCase()]){t=S.htmlPrefilter(t);try{for(;i<n;i++)1===(e=this[i]||{}).nodeType&&(S.cleanData(wt(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(){var t=[];return It(this,arguments,(function(e){var i=this.parentNode;S.inArray(this,t)<0&&(S.cleanData(wt(this)),i&&i.replaceChild(e,this))}),t)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){S.fn[t]=function(t){for(var i,n=[],r=S(t),s=r.length-1,o=0;o<=s;o++)i=o===s?this:this.clone(!0),S(r[o])[e](i),c.apply(n,i.get());return this.pushStack(n)}}));var zt=new RegExp("^("+nt+")(?!px)[a-z%]+$","i"),Vt=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=n),e.getComputedStyle(t)},Rt=function(t,e,i){var n,r,s={};for(r in e)s[r]=t.style[r],t.style[r]=e[r];for(r in n=i.call(t),e)t.style[r]=s[r];return n},Bt=new RegExp(st.join("|"),"i");function Lt(t,e,i){var n,r,s,o,a=t.style;return(i=i||Vt(t))&&(""!==(o=i.getPropertyValue(e)||i[e])||at(t)||(o=S.style(t,e)),!v.pixelBoxStyles()&&zt.test(o)&&Bt.test(e)&&(n=a.width,r=a.minWidth,s=a.maxWidth,a.minWidth=a.maxWidth=a.width=o,o=i.width,a.width=n,a.minWidth=r,a.maxWidth=s)),void 0!==o?o+"":o}function qt(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function t(){if(d){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",d.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ot.appendChild(c).appendChild(d);var t=n.getComputedStyle(d);i="1%"!==t.top,l=12===e(t.marginLeft),d.style.right="60%",o=36===e(t.right),r=36===e(t.width),d.style.position="absolute",s=12===e(d.offsetWidth/3),ot.removeChild(c),d=null}}function e(t){return Math.round(parseFloat(t))}var i,r,s,o,a,l,c=y.createElement("div"),d=y.createElement("div");d.style&&(d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",v.clearCloneStyle="content-box"===d.style.backgroundClip,S.extend(v,{boxSizingReliable:function(){return t(),r},pixelBoxStyles:function(){return t(),o},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),s},reliableTrDimensions:function(){var t,e,i,r;return null==a&&(t=y.createElement("table"),e=y.createElement("tr"),i=y.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",e.style.cssText="border:1px solid",e.style.height="1px",i.style.height="9px",i.style.display="block",ot.appendChild(t).appendChild(e).appendChild(i),r=n.getComputedStyle(e),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===e.offsetHeight,ot.removeChild(t)),a}}))}();var Ut=["Webkit","Moz","ms"],Xt=y.createElement("div").style,Gt={};function Jt(t){return S.cssProps[t]||Gt[t]||(t in Xt?t:Gt[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),i=Ut.length;i--;)if((t=Ut[i]+e)in Xt)return t}(t)||t)}var Yt=/^(none|table(?!-c[ea]).+)/,Kt=/^--/,Qt={position:"absolute",visibility:"hidden",display:"block"},Zt={letterSpacing:"0",fontWeight:"400"};function te(t,e,i){var n=rt.exec(e);return n?Math.max(0,n[2]-(i||0))+(n[3]||"px"):e}function ee(t,e,i,n,r,s){var o="width"===e?1:0,a=0,l=0;if(i===(n?"border":"content"))return 0;for(;o<4;o+=2)"margin"===i&&(l+=S.css(t,i+st[o],!0,r)),n?("content"===i&&(l-=S.css(t,"padding"+st[o],!0,r)),"margin"!==i&&(l-=S.css(t,"border"+st[o]+"Width",!0,r))):(l+=S.css(t,"padding"+st[o],!0,r),"padding"!==i?l+=S.css(t,"border"+st[o]+"Width",!0,r):a+=S.css(t,"border"+st[o]+"Width",!0,r));return!n&&s>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-s-l-a-.5))||0),l}function ie(t,e,i){var n=Vt(t),r=(!v.boxSizingReliable()||i)&&"border-box"===S.css(t,"boxSizing",!1,n),s=r,o=Lt(t,e,n),a="offset"+e[0].toUpperCase()+e.slice(1);if(zt.test(o)){if(!i)return o;o="auto"}return(!v.boxSizingReliable()&&r||!v.reliableTrDimensions()&&N(t,"tr")||"auto"===o||!parseFloat(o)&&"inline"===S.css(t,"display",!1,n))&&t.getClientRects().length&&(r="border-box"===S.css(t,"boxSizing",!1,n),(s=a in t)&&(o=t[a])),(o=parseFloat(o)||0)+ee(t,e,i||(r?"border":"content"),s,n,o)+"px"}function ne(t,e,i,n,r){return new ne.prototype.init(t,e,i,n,r)}S.extend({cssHooks:{opacity:{get:function(t,e){if(e){var i=Lt(t,"opacity");return""===i?"1":i}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,i,n){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,s,o,a=J(e),l=Kt.test(e),c=t.style;if(l||(e=Jt(a)),o=S.cssHooks[e]||S.cssHooks[a],void 0===i)return o&&"get"in o&&void 0!==(r=o.get(t,!1,n))?r:c[e];"string"==(s=typeof i)&&(r=rt.exec(i))&&r[1]&&(i=dt(t,e,r),s="number"),null!=i&&i==i&&("number"!==s||l||(i+=r&&r[3]||(S.cssNumber[a]?"":"px")),v.clearCloneStyle||""!==i||0!==e.indexOf("background")||(c[e]="inherit"),o&&"set"in o&&void 0===(i=o.set(t,i,n))||(l?c.setProperty(e,i):c[e]=i))}},css:function(t,e,i,n){var r,s,o,a=J(e);return Kt.test(e)||(e=Jt(a)),(o=S.cssHooks[e]||S.cssHooks[a])&&"get"in o&&(r=o.get(t,!0,i)),void 0===r&&(r=Lt(t,e,n)),"normal"===r&&e in Zt&&(r=Zt[e]),""===i||i?(s=parseFloat(r),!0===i||isFinite(s)?s||0:r):r}}),S.each(["height","width"],(function(t,e){S.cssHooks[e]={get:function(t,i,n){if(i)return!Yt.test(S.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?ie(t,e,n):Rt(t,Qt,(function(){return ie(t,e,n)}))},set:function(t,i,n){var r,s=Vt(t),o=!v.scrollboxSize()&&"absolute"===s.position,a=(o||n)&&"border-box"===S.css(t,"boxSizing",!1,s),l=n?ee(t,e,n,a,s):0;return a&&o&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(s[e])-ee(t,e,"border",!1,s)-.5)),l&&(r=rt.exec(i))&&"px"!==(r[3]||"px")&&(t.style[e]=i,i=S.css(t,e)),te(0,i,l)}}})),S.cssHooks.marginLeft=qt(v.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Lt(t,"marginLeft"))||t.getBoundingClientRect().left-Rt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),S.each({margin:"",padding:"",border:"Width"},(function(t,e){S.cssHooks[t+e]={expand:function(i){for(var n=0,r={},s="string"==typeof i?i.split(" "):[i];n<4;n++)r[t+st[n]+e]=s[n]||s[n-2]||s[0];return r}},"margin"!==t&&(S.cssHooks[t+e].set=te)})),S.fn.extend({css:function(t,e){return q(this,(function(t,e,i){var n,r,s={},o=0;if(Array.isArray(e)){for(n=Vt(t),r=e.length;o<r;o++)s[e[o]]=S.css(t,e[o],!1,n);return s}return void 0!==i?S.style(t,e,i):S.css(t,e)}),t,e,arguments.length>1)}}),S.Tween=ne,ne.prototype={constructor:ne,init:function(t,e,i,n,r,s){this.elem=t,this.prop=i,this.easing=r||S.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=n,this.unit=s||(S.cssNumber[i]?"":"px")},cur:function(){var t=ne.propHooks[this.prop];return t&&t.get?t.get(this):ne.propHooks._default.get(this)},run:function(t){var e,i=ne.propHooks[this.prop];return this.options.duration?this.pos=e=S.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):ne.propHooks._default.set(this),this}},ne.prototype.init.prototype=ne.prototype,ne.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=S.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){S.fx.step[t.prop]?S.fx.step[t.prop](t):1!==t.elem.nodeType||!S.cssHooks[t.prop]&&null==t.elem.style[Jt(t.prop)]?t.elem[t.prop]=t.now:S.style(t.elem,t.prop,t.now+t.unit)}}},ne.propHooks.scrollTop=ne.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},S.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},S.fx=ne.prototype.init,S.fx.step={};var re,se,oe=/^(?:toggle|show|hide)$/,ae=/queueHooks$/;function le(){se&&(!1===y.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(le):n.setTimeout(le,S.fx.interval),S.fx.tick())}function ce(){return n.setTimeout((function(){re=void 0})),re=Date.now()}function de(t,e){var i,n=0,r={height:t};for(e=e?1:0;n<4;n+=2-e)r["margin"+(i=st[n])]=r["padding"+i]=t;return e&&(r.opacity=r.width=t),r}function ue(t,e,i){for(var n,r=(he.tweeners[e]||[]).concat(he.tweeners["*"]),s=0,o=r.length;s<o;s++)if(n=r[s].call(i,e,t))return n}function he(t,e,i){var n,r,s=0,o=he.prefilters.length,a=S.Deferred().always((function(){delete l.elem})),l=function(){if(r)return!1;for(var e=re||ce(),i=Math.max(0,c.startTime+c.duration-e),n=1-(i/c.duration||0),s=0,o=c.tweens.length;s<o;s++)c.tweens[s].run(n);return a.notifyWith(t,[c,n,i]),n<1&&o?i:(o||a.notifyWith(t,[c,1,0]),a.resolveWith(t,[c]),!1)},c=a.promise({elem:t,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},i),originalProperties:e,originalOptions:i,startTime:re||ce(),duration:i.duration,tweens:[],createTween:function(e,i){var n=S.Tween(t,c.opts,e,i,c.opts.specialEasing[e]||c.opts.easing);return c.tweens.push(n),n},stop:function(e){var i=0,n=e?c.tweens.length:0;if(r)return this;for(r=!0;i<n;i++)c.tweens[i].run(1);return e?(a.notifyWith(t,[c,1,0]),a.resolveWith(t,[c,e])):a.rejectWith(t,[c,e]),this}}),d=c.props;for(function(t,e){var i,n,r,s,o;for(i in t)if(r=e[n=J(i)],s=t[i],Array.isArray(s)&&(r=s[1],s=t[i]=s[0]),i!==n&&(t[n]=s,delete t[i]),(o=S.cssHooks[n])&&"expand"in o)for(i in s=o.expand(s),delete t[n],s)i in t||(t[i]=s[i],e[i]=r);else e[n]=r}(d,c.opts.specialEasing);s<o;s++)if(n=he.prefilters[s].call(c,t,d,c.opts))return m(n.stop)&&(S._queueHooks(c.elem,c.opts.queue).stop=n.stop.bind(n)),n;return S.map(d,ue,c),m(c.opts.start)&&c.opts.start.call(t,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),S.fx.timer(S.extend(l,{elem:t,anim:c,queue:c.opts.queue})),c}S.Animation=S.extend(he,{tweeners:{"*":[function(t,e){var i=this.createTween(t,e);return dt(i.elem,t,rt.exec(e),i),i}]},tweener:function(t,e){m(t)?(e=t,t=["*"]):t=t.match(I);for(var i,n=0,r=t.length;n<r;n++)i=t[n],he.tweeners[i]=he.tweeners[i]||[],he.tweeners[i].unshift(e)},prefilters:[function(t,e,i){var n,r,s,o,a,l,c,d,u="width"in e||"height"in e,h=this,p={},f=t.style,g=t.nodeType&&ct(t),v=Q.get(t,"fxshow");for(n in i.queue||(null==(o=S._queueHooks(t,"fx")).unqueued&&(o.unqueued=0,a=o.empty.fire,o.empty.fire=function(){o.unqueued||a()}),o.unqueued++,h.always((function(){h.always((function(){o.unqueued--,S.queue(t,"fx").length||o.empty.fire()}))}))),e)if(r=e[n],oe.test(r)){if(delete e[n],s=s||"toggle"===r,r===(g?"hide":"show")){if("show"!==r||!v||void 0===v[n])continue;g=!0}p[n]=v&&v[n]||S.style(t,n)}if((l=!S.isEmptyObject(e))||!S.isEmptyObject(p))for(n in u&&1===t.nodeType&&(i.overflow=[f.overflow,f.overflowX,f.overflowY],null==(c=v&&v.display)&&(c=Q.get(t,"display")),"none"===(d=S.css(t,"display"))&&(c?d=c:(pt([t],!0),c=t.style.display||c,d=S.css(t,"display"),pt([t]))),("inline"===d||"inline-block"===d&&null!=c)&&"none"===S.css(t,"float")&&(l||(h.done((function(){f.display=c})),null==c&&(d=f.display,c="none"===d?"":d)),f.display="inline-block")),i.overflow&&(f.overflow="hidden",h.always((function(){f.overflow=i.overflow[0],f.overflowX=i.overflow[1],f.overflowY=i.overflow[2]}))),l=!1,p)l||(v?"hidden"in v&&(g=v.hidden):v=Q.access(t,"fxshow",{display:c}),s&&(v.hidden=!g),g&&pt([t],!0),h.done((function(){for(n in g||pt([t]),Q.remove(t,"fxshow"),p)S.style(t,n,p[n])}))),l=ue(g?v[n]:0,n,h),n in v||(v[n]=l.start,g&&(l.end=l.start,l.start=0))}],prefilter:function(t,e){e?he.prefilters.unshift(t):he.prefilters.push(t)}}),S.speed=function(t,e,i){var n=t&&"object"==typeof t?S.extend({},t):{complete:i||!i&&e||m(t)&&t,duration:t,easing:i&&e||e&&!m(e)&&e};return S.fx.off?n.duration=0:"number"!=typeof n.duration&&(n.duration in S.fx.speeds?n.duration=S.fx.speeds[n.duration]:n.duration=S.fx.speeds._default),null!=n.queue&&!0!==n.queue||(n.queue="fx"),n.old=n.complete,n.complete=function(){m(n.old)&&n.old.call(this),n.queue&&S.dequeue(this,n.queue)},n},S.fn.extend({fadeTo:function(t,e,i,n){return this.filter(ct).css("opacity",0).show().end().animate({opacity:e},t,i,n)},animate:function(t,e,i,n){var r=S.isEmptyObject(t),s=S.speed(e,i,n),o=function(){var e=he(this,S.extend({},t),s);(r||Q.get(this,"finish"))&&e.stop(!0)};return o.finish=o,r||!1===s.queue?this.each(o):this.queue(s.queue,o)},stop:function(t,e,i){var n=function(t){var e=t.stop;delete t.stop,e(i)};return"string"!=typeof t&&(i=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each((function(){var e=!0,r=null!=t&&t+"queueHooks",s=S.timers,o=Q.get(this);if(r)o[r]&&o[r].stop&&n(o[r]);else for(r in o)o[r]&&o[r].stop&&ae.test(r)&&n(o[r]);for(r=s.length;r--;)s[r].elem!==this||null!=t&&s[r].queue!==t||(s[r].anim.stop(i),e=!1,s.splice(r,1));!e&&i||S.dequeue(this,t)}))},finish:function(t){return!1!==t&&(t=t||"fx"),this.each((function(){var e,i=Q.get(this),n=i[t+"queue"],r=i[t+"queueHooks"],s=S.timers,o=n?n.length:0;for(i.finish=!0,S.queue(this,t,[]),r&&r.stop&&r.stop.call(this,!0),e=s.length;e--;)s[e].elem===this&&s[e].queue===t&&(s[e].anim.stop(!0),s.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete i.finish}))}}),S.each(["toggle","show","hide"],(function(t,e){var i=S.fn[e];S.fn[e]=function(t,n,r){return null==t||"boolean"==typeof t?i.apply(this,arguments):this.animate(de(e,!0),t,n,r)}})),S.each({slideDown:de("show"),slideUp:de("hide"),slideToggle:de("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){S.fn[t]=function(t,i,n){return this.animate(e,t,i,n)}})),S.timers=[],S.fx.tick=function(){var t,e=0,i=S.timers;for(re=Date.now();e<i.length;e++)(t=i[e])()||i[e]!==t||i.splice(e--,1);i.length||S.fx.stop(),re=void 0},S.fx.timer=function(t){S.timers.push(t),S.fx.start()},S.fx.interval=13,S.fx.start=function(){se||(se=!0,le())},S.fx.stop=function(){se=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(t,e){return t=S.fx&&S.fx.speeds[t]||t,e=e||"fx",this.queue(e,(function(e,i){var r=n.setTimeout(e,t);i.stop=function(){n.clearTimeout(r)}}))},function(){var t=y.createElement("input"),e=y.createElement("select").appendChild(y.createElement("option"));t.type="checkbox",v.checkOn=""!==t.value,v.optSelected=e.selected,(t=y.createElement("input")).value="t",t.type="radio",v.radioValue="t"===t.value}();var pe,fe=S.expr.attrHandle;S.fn.extend({attr:function(t,e){return q(this,S.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){S.removeAttr(this,t)}))}}),S.extend({attr:function(t,e,i){var n,r,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return void 0===t.getAttribute?S.prop(t,e,i):(1===s&&S.isXMLDoc(t)||(r=S.attrHooks[e.toLowerCase()]||(S.expr.match.bool.test(e)?pe:void 0)),void 0!==i?null===i?void S.removeAttr(t,e):r&&"set"in r&&void 0!==(n=r.set(t,i,e))?n:(t.setAttribute(e,i+""),i):r&&"get"in r&&null!==(n=r.get(t,e))?n:null==(n=S.find.attr(t,e))?void 0:n)},attrHooks:{type:{set:function(t,e){if(!v.radioValue&&"radio"===e&&N(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}}},removeAttr:function(t,e){var i,n=0,r=e&&e.match(I);if(r&&1===t.nodeType)for(;i=r[n++];)t.removeAttribute(i)}}),pe={set:function(t,e,i){return!1===e?S.removeAttr(t,i):t.setAttribute(i,i),i}},S.each(S.expr.match.bool.source.match(/\w+/g),(function(t,e){var i=fe[e]||S.find.attr;fe[e]=function(t,e,n){var r,s,o=e.toLowerCase();return n||(s=fe[o],fe[o]=r,r=null!=i(t,e,n)?o:null,fe[o]=s),r}}));var ge=/^(?:input|select|textarea|button)$/i,ve=/^(?:a|area)$/i;function me(t){return(t.match(I)||[]).join(" ")}function be(t){return t.getAttribute&&t.getAttribute("class")||""}function ye(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(I)||[]}S.fn.extend({prop:function(t,e){return q(this,S.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[S.propFix[t]||t]}))}}),S.extend({prop:function(t,e,i){var n,r,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&S.isXMLDoc(t)||(e=S.propFix[e]||e,r=S.propHooks[e]),void 0!==i?r&&"set"in r&&void 0!==(n=r.set(t,i,e))?n:t[e]=i:r&&"get"in r&&null!==(n=r.get(t,e))?n:t[e]},propHooks:{tabIndex:{get:function(t){var e=S.find.attr(t,"tabindex");return e?parseInt(e,10):ge.test(t.nodeName)||ve.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),v.optSelected||(S.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){S.propFix[this.toLowerCase()]=this})),S.fn.extend({addClass:function(t){var e,i,n,r,s,o,a,l=0;if(m(t))return this.each((function(e){S(this).addClass(t.call(this,e,be(this)))}));if((e=ye(t)).length)for(;i=this[l++];)if(r=be(i),n=1===i.nodeType&&" "+me(r)+" "){for(o=0;s=e[o++];)n.indexOf(" "+s+" ")<0&&(n+=s+" ");r!==(a=me(n))&&i.setAttribute("class",a)}return this},removeClass:function(t){var e,i,n,r,s,o,a,l=0;if(m(t))return this.each((function(e){S(this).removeClass(t.call(this,e,be(this)))}));if(!arguments.length)return this.attr("class","");if((e=ye(t)).length)for(;i=this[l++];)if(r=be(i),n=1===i.nodeType&&" "+me(r)+" "){for(o=0;s=e[o++];)for(;n.indexOf(" "+s+" ")>-1;)n=n.replace(" "+s+" "," ");r!==(a=me(n))&&i.setAttribute("class",a)}return this},toggleClass:function(t,e){var i=typeof t,n="string"===i||Array.isArray(t);return"boolean"==typeof e&&n?e?this.addClass(t):this.removeClass(t):m(t)?this.each((function(i){S(this).toggleClass(t.call(this,i,be(this),e),e)})):this.each((function(){var e,r,s,o;if(n)for(r=0,s=S(this),o=ye(t);e=o[r++];)s.hasClass(e)?s.removeClass(e):s.addClass(e);else void 0!==t&&"boolean"!==i||((e=be(this))&&Q.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":Q.get(this,"__className__")||""))}))},hasClass:function(t){var e,i,n=0;for(e=" "+t+" ";i=this[n++];)if(1===i.nodeType&&(" "+me(be(i))+" ").indexOf(e)>-1)return!0;return!1}});var we=/\r/g;S.fn.extend({val:function(t){var e,i,n,r=this[0];return arguments.length?(n=m(t),this.each((function(i){var r;1===this.nodeType&&(null==(r=n?t.call(this,i,S(this).val()):t)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=S.map(r,(function(t){return null==t?"":t+""}))),(e=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))}))):r?(e=S.valHooks[r.type]||S.valHooks[r.nodeName.toLowerCase()])&&"get"in e&&void 0!==(i=e.get(r,"value"))?i:"string"==typeof(i=r.value)?i.replace(we,""):null==i?"":i:void 0}}),S.extend({valHooks:{option:{get:function(t){var e=S.find.attr(t,"value");return null!=e?e:me(S.text(t))}},select:{get:function(t){var e,i,n,r=t.options,s=t.selectedIndex,o="select-one"===t.type,a=o?null:[],l=o?s+1:r.length;for(n=s<0?l:o?s:0;n<l;n++)if(((i=r[n]).selected||n===s)&&!i.disabled&&(!i.parentNode.disabled||!N(i.parentNode,"optgroup"))){if(e=S(i).val(),o)return e;a.push(e)}return a},set:function(t,e){for(var i,n,r=t.options,s=S.makeArray(e),o=r.length;o--;)((n=r[o]).selected=S.inArray(S.valHooks.option.get(n),s)>-1)&&(i=!0);return i||(t.selectedIndex=-1),s}}}}),S.each(["radio","checkbox"],(function(){S.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=S.inArray(S(t).val(),e)>-1}},v.checkOn||(S.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),v.focusin="onfocusin"in n;var xe=/^(?:focusinfocus|focusoutblur)$/,Ce=function(t){t.stopPropagation()};S.extend(S.event,{trigger:function(t,e,i,r){var s,o,a,l,c,d,u,h,f=[i||y],g=p.call(t,"type")?t.type:t,v=p.call(t,"namespace")?t.namespace.split("."):[];if(o=h=a=i=i||y,3!==i.nodeType&&8!==i.nodeType&&!xe.test(g+S.event.triggered)&&(g.indexOf(".")>-1&&(v=g.split("."),g=v.shift(),v.sort()),c=g.indexOf(":")<0&&"on"+g,(t=t[S.expando]?t:new S.Event(g,"object"==typeof t&&t)).isTrigger=r?2:3,t.namespace=v.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),e=null==e?[t]:S.makeArray(e,[t]),u=S.event.special[g]||{},r||!u.trigger||!1!==u.trigger.apply(i,e))){if(!r&&!u.noBubble&&!b(i)){for(l=u.delegateType||g,xe.test(l+g)||(o=o.parentNode);o;o=o.parentNode)f.push(o),a=o;a===(i.ownerDocument||y)&&f.push(a.defaultView||a.parentWindow||n)}for(s=0;(o=f[s++])&&!t.isPropagationStopped();)h=o,t.type=s>1?l:u.bindType||g,(d=(Q.get(o,"events")||Object.create(null))[t.type]&&Q.get(o,"handle"))&&d.apply(o,e),(d=c&&o[c])&&d.apply&&Y(o)&&(t.result=d.apply(o,e),!1===t.result&&t.preventDefault());return t.type=g,r||t.isDefaultPrevented()||u._default&&!1!==u._default.apply(f.pop(),e)||!Y(i)||c&&m(i[g])&&!b(i)&&((a=i[c])&&(i[c]=null),S.event.triggered=g,t.isPropagationStopped()&&h.addEventListener(g,Ce),i[g](),t.isPropagationStopped()&&h.removeEventListener(g,Ce),S.event.triggered=void 0,a&&(i[c]=a)),t.result}},simulate:function(t,e,i){var n=S.extend(new S.Event,i,{type:t,isSimulated:!0});S.event.trigger(n,null,e)}}),S.fn.extend({trigger:function(t,e){return this.each((function(){S.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var i=this[0];if(i)return S.event.trigger(t,e,i,!0)}}),v.focusin||S.each({focus:"focusin",blur:"focusout"},(function(t,e){var i=function(t){S.event.simulate(e,t.target,S.event.fix(t))};S.event.special[e]={setup:function(){var n=this.ownerDocument||this.document||this,r=Q.access(n,e);r||n.addEventListener(t,i,!0),Q.access(n,e,(r||0)+1)},teardown:function(){var n=this.ownerDocument||this.document||this,r=Q.access(n,e)-1;r?Q.access(n,e,r):(n.removeEventListener(t,i,!0),Q.remove(n,e))}}}));var ke=n.location,Se={guid:Date.now()},$e=/\?/;S.parseXML=function(t){var e,i;if(!t||"string"!=typeof t)return null;try{e=(new n.DOMParser).parseFromString(t,"text/xml")}catch(t){}return i=e&&e.getElementsByTagName("parsererror")[0],e&&!i||S.error("Invalid XML: "+(i?S.map(i.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var Ee=/\[\]$/,De=/\r?\n/g,Te=/^(?:submit|button|image|reset|file)$/i,Me=/^(?:input|select|textarea|keygen)/i;function Ne(t,e,i,n){var r;if(Array.isArray(e))S.each(e,(function(e,r){i||Ee.test(t)?n(t,r):Ne(t+"["+("object"==typeof r&&null!=r?e:"")+"]",r,i,n)}));else if(i||"object"!==C(e))n(t,e);else for(r in e)Ne(t+"["+r+"]",e[r],i,n)}S.param=function(t,e){var i,n=[],r=function(t,e){var i=m(e)?e():e;n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==i?"":i)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!S.isPlainObject(t))S.each(t,(function(){r(this.name,this.value)}));else for(i in t)Ne(i,t[i],e,r);return n.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=S.prop(this,"elements");return t?S.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!S(this).is(":disabled")&&Me.test(this.nodeName)&&!Te.test(t)&&(this.checked||!vt.test(t))})).map((function(t,e){var i=S(this).val();return null==i?null:Array.isArray(i)?S.map(i,(function(t){return{name:e.name,value:t.replace(De,"\r\n")}})):{name:e.name,value:i.replace(De,"\r\n")}})).get()}});var Ae=/%20/g,_e=/#.*$/,Fe=/([?&])_=[^&]*/,He=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pe=/^(?:GET|HEAD)$/,Oe=/^\/\//,je={},Ie={},We="*/".concat("*"),ze=y.createElement("a");function Ve(t){return function(e,i){"string"!=typeof e&&(i=e,e="*");var n,r=0,s=e.toLowerCase().match(I)||[];if(m(i))for(;n=s[r++];)"+"===n[0]?(n=n.slice(1)||"*",(t[n]=t[n]||[]).unshift(i)):(t[n]=t[n]||[]).push(i)}}function Re(t,e,i,n){var r={},s=t===Ie;function o(a){var l;return r[a]=!0,S.each(t[a]||[],(function(t,a){var c=a(e,i,n);return"string"!=typeof c||s||r[c]?s?!(l=c):void 0:(e.dataTypes.unshift(c),o(c),!1)})),l}return o(e.dataTypes[0])||!r["*"]&&o("*")}function Be(t,e){var i,n,r=S.ajaxSettings.flatOptions||{};for(i in e)void 0!==e[i]&&((r[i]?t:n||(n={}))[i]=e[i]);return n&&S.extend(!0,t,n),t}ze.href=ke.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ke.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ke.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":We,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Be(Be(t,S.ajaxSettings),e):Be(S.ajaxSettings,t)},ajaxPrefilter:Ve(je),ajaxTransport:Ve(Ie),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var i,r,s,o,a,l,c,d,u,h,p=S.ajaxSetup({},e),f=p.context||p,g=p.context&&(f.nodeType||f.jquery)?S(f):S.event,v=S.Deferred(),m=S.Callbacks("once memory"),b=p.statusCode||{},w={},x={},C="canceled",k={readyState:0,getResponseHeader:function(t){var e;if(c){if(!o)for(o={};e=He.exec(s);)o[e[1].toLowerCase()+" "]=(o[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=o[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?s:null},setRequestHeader:function(t,e){return null==c&&(t=x[t.toLowerCase()]=x[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==c&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)k.always(t[k.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||C;return i&&i.abort(e),$(0,e),this}};if(v.promise(k),p.url=((t||p.url||ke.href)+"").replace(Oe,ke.protocol+"//"),p.type=e.method||e.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(I)||[""],null==p.crossDomain){l=y.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=ze.protocol+"//"+ze.host!=l.protocol+"//"+l.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=S.param(p.data,p.traditional)),Re(je,p,e,k),c)return k;for(u in(d=S.event&&p.global)&&0==S.active++&&S.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Pe.test(p.type),r=p.url.replace(_e,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Ae,"+")):(h=p.url.slice(r.length),p.data&&(p.processData||"string"==typeof p.data)&&(r+=($e.test(r)?"&":"?")+p.data,delete p.data),!1===p.cache&&(r=r.replace(Fe,"$1"),h=($e.test(r)?"&":"?")+"_="+Se.guid+++h),p.url=r+h),p.ifModified&&(S.lastModified[r]&&k.setRequestHeader("If-Modified-Since",S.lastModified[r]),S.etag[r]&&k.setRequestHeader("If-None-Match",S.etag[r])),(p.data&&p.hasContent&&!1!==p.contentType||e.contentType)&&k.setRequestHeader("Content-Type",p.contentType),k.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+We+"; q=0.01":""):p.accepts["*"]),p.headers)k.setRequestHeader(u,p.headers[u]);if(p.beforeSend&&(!1===p.beforeSend.call(f,k,p)||c))return k.abort();if(C="abort",m.add(p.complete),k.done(p.success),k.fail(p.error),i=Re(Ie,p,e,k)){if(k.readyState=1,d&&g.trigger("ajaxSend",[k,p]),c)return k;p.async&&p.timeout>0&&(a=n.setTimeout((function(){k.abort("timeout")}),p.timeout));try{c=!1,i.send(w,$)}catch(t){if(c)throw t;$(-1,t)}}else $(-1,"No Transport");function $(t,e,o,l){var u,h,y,w,x,C=e;c||(c=!0,a&&n.clearTimeout(a),i=void 0,s=l||"",k.readyState=t>0?4:0,u=t>=200&&t<300||304===t,o&&(w=function(t,e,i){for(var n,r,s,o,a=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=t.mimeType||e.getResponseHeader("Content-Type"));if(n)for(r in a)if(a[r]&&a[r].test(n)){l.unshift(r);break}if(l[0]in i)s=l[0];else{for(r in i){if(!l[0]||t.converters[r+" "+l[0]]){s=r;break}o||(o=r)}s=s||o}if(s)return s!==l[0]&&l.unshift(s),i[s]}(p,k,o)),!u&&S.inArray("script",p.dataTypes)>-1&&S.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),w=function(t,e,i,n){var r,s,o,a,l,c={},d=t.dataTypes.slice();if(d[1])for(o in t.converters)c[o.toLowerCase()]=t.converters[o];for(s=d.shift();s;)if(t.responseFields[s]&&(i[t.responseFields[s]]=e),!l&&n&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=s,s=d.shift())if("*"===s)s=l;else if("*"!==l&&l!==s){if(!(o=c[l+" "+s]||c["* "+s]))for(r in c)if((a=r.split(" "))[1]===s&&(o=c[l+" "+a[0]]||c["* "+a[0]])){!0===o?o=c[r]:!0!==c[r]&&(s=a[0],d.unshift(a[1]));break}if(!0!==o)if(o&&t.throws)e=o(e);else try{e=o(e)}catch(t){return{state:"parsererror",error:o?t:"No conversion from "+l+" to "+s}}}return{state:"success",data:e}}(p,w,k,u),u?(p.ifModified&&((x=k.getResponseHeader("Last-Modified"))&&(S.lastModified[r]=x),(x=k.getResponseHeader("etag"))&&(S.etag[r]=x)),204===t||"HEAD"===p.type?C="nocontent":304===t?C="notmodified":(C=w.state,h=w.data,u=!(y=w.error))):(y=C,!t&&C||(C="error",t<0&&(t=0))),k.status=t,k.statusText=(e||C)+"",u?v.resolveWith(f,[h,C,k]):v.rejectWith(f,[k,C,y]),k.statusCode(b),b=void 0,d&&g.trigger(u?"ajaxSuccess":"ajaxError",[k,p,u?h:y]),m.fireWith(f,[k,C]),d&&(g.trigger("ajaxComplete",[k,p]),--S.active||S.event.trigger("ajaxStop")))}return k},getJSON:function(t,e,i){return S.get(t,e,i,"json")},getScript:function(t,e){return S.get(t,void 0,e,"script")}}),S.each(["get","post"],(function(t,e){S[e]=function(t,i,n,r){return m(i)&&(r=r||n,n=i,i=void 0),S.ajax(S.extend({url:t,type:e,dataType:r,data:i,success:n},S.isPlainObject(t)&&t))}})),S.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),S._evalUrl=function(t,e,i){return S.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){S.globalEval(t,e,i)}})},S.fn.extend({wrapAll:function(t){var e;return this[0]&&(m(t)&&(t=t.call(this[0])),e=S(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return m(t)?this.each((function(e){S(this).wrapInner(t.call(this,e))})):this.each((function(){var e=S(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)}))},wrap:function(t){var e=m(t);return this.each((function(i){S(this).wrapAll(e?t.call(this,i):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){S(this).replaceWith(this.childNodes)})),this}}),S.expr.pseudos.hidden=function(t){return!S.expr.pseudos.visible(t)},S.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var Le={0:200,1223:204},qe=S.ajaxSettings.xhr();v.cors=!!qe&&"withCredentials"in qe,v.ajax=qe=!!qe,S.ajaxTransport((function(t){var e,i;if(v.cors||qe&&!t.crossDomain)return{send:function(r,s){var o,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)a[o]=t.xhrFields[o];for(o in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)a.setRequestHeader(o,r[o]);e=function(t){return function(){e&&(e=i=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?s(0,"error"):s(a.status,a.statusText):s(Le[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=e(),i=a.onerror=a.ontimeout=e("error"),void 0!==a.onabort?a.onabort=i:a.onreadystatechange=function(){4===a.readyState&&n.setTimeout((function(){e&&i()}))},e=e("abort");try{a.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),S.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return S.globalEval(t),t}}}),S.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),S.ajaxTransport("script",(function(t){var e,i;if(t.crossDomain||t.scriptAttrs)return{send:function(n,r){e=S("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",i=function(t){e.remove(),i=null,t&&r("error"===t.type?404:200,t.type)}),y.head.appendChild(e[0])},abort:function(){i&&i()}}}));var Ue,Xe=[],Ge=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Xe.pop()||S.expando+"_"+Se.guid++;return this[t]=!0,t}}),S.ajaxPrefilter("json jsonp",(function(t,e,i){var r,s,o,a=!1!==t.jsonp&&(Ge.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ge.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return r=t.jsonpCallback=m(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(Ge,"$1"+r):!1!==t.jsonp&&(t.url+=($e.test(t.url)?"&":"?")+t.jsonp+"="+r),t.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},t.dataTypes[0]="json",s=n[r],n[r]=function(){o=arguments},i.always((function(){void 0===s?S(n).removeProp(r):n[r]=s,t[r]&&(t.jsonpCallback=e.jsonpCallback,Xe.push(r)),o&&m(s)&&s(o[0]),o=s=void 0})),"script"})),v.createHTMLDocument=((Ue=y.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ue.childNodes.length),S.parseHTML=function(t,e,i){return"string"!=typeof t?[]:("boolean"==typeof e&&(i=e,e=!1),e||(v.createHTMLDocument?((n=(e=y.implementation.createHTMLDocument("")).createElement("base")).href=y.location.href,e.head.appendChild(n)):e=y),s=!i&&[],(r=A.exec(t))?[e.createElement(r[1])]:(r=kt([t],e,s),s&&s.length&&S(s).remove(),S.merge([],r.childNodes)));var n,r,s},S.fn.load=function(t,e,i){var n,r,s,o=this,a=t.indexOf(" ");return a>-1&&(n=me(t.slice(a)),t=t.slice(0,a)),m(e)?(i=e,e=void 0):e&&"object"==typeof e&&(r="POST"),o.length>0&&S.ajax({url:t,type:r||"GET",dataType:"html",data:e}).done((function(t){s=arguments,o.html(n?S("<div>").append(S.parseHTML(t)).find(n):t)})).always(i&&function(t,e){o.each((function(){i.apply(this,s||[t.responseText,e,t])}))}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,(function(e){return t===e.elem})).length},S.offset={setOffset:function(t,e,i){var n,r,s,o,a,l,c=S.css(t,"position"),d=S(t),u={};"static"===c&&(t.style.position="relative"),a=d.offset(),s=S.css(t,"top"),l=S.css(t,"left"),("absolute"===c||"fixed"===c)&&(s+l).indexOf("auto")>-1?(o=(n=d.position()).top,r=n.left):(o=parseFloat(s)||0,r=parseFloat(l)||0),m(e)&&(e=e.call(t,i,S.extend({},a))),null!=e.top&&(u.top=e.top-a.top+o),null!=e.left&&(u.left=e.left-a.left+r),"using"in e?e.using.call(t,u):d.css(u)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){S.offset.setOffset(this,t,e)}));var e,i,n=this[0];return n?n.getClientRects().length?(e=n.getBoundingClientRect(),i=n.ownerDocument.defaultView,{top:e.top+i.pageYOffset,left:e.left+i.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,i,n=this[0],r={top:0,left:0};if("fixed"===S.css(n,"position"))e=n.getBoundingClientRect();else{for(e=this.offset(),i=n.ownerDocument,t=n.offsetParent||i.documentElement;t&&(t===i.body||t===i.documentElement)&&"static"===S.css(t,"position");)t=t.parentNode;t&&t!==n&&1===t.nodeType&&((r=S(t).offset()).top+=S.css(t,"borderTopWidth",!0),r.left+=S.css(t,"borderLeftWidth",!0))}return{top:e.top-r.top-S.css(n,"marginTop",!0),left:e.left-r.left-S.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent;t&&"static"===S.css(t,"position");)t=t.offsetParent;return t||ot}))}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var i="pageYOffset"===e;S.fn[t]=function(n){return q(this,(function(t,n,r){var s;if(b(t)?s=t:9===t.nodeType&&(s=t.defaultView),void 0===r)return s?s[e]:t[n];s?s.scrollTo(i?s.pageXOffset:r,i?r:s.pageYOffset):t[n]=r}),t,n,arguments.length)}})),S.each(["top","left"],(function(t,e){S.cssHooks[e]=qt(v.pixelPosition,(function(t,i){if(i)return i=Lt(t,e),zt.test(i)?S(t).position()[e]+"px":i}))})),S.each({Height:"height",Width:"width"},(function(t,e){S.each({padding:"inner"+t,content:e,"":"outer"+t},(function(i,n){S.fn[n]=function(r,s){var o=arguments.length&&(i||"boolean"!=typeof r),a=i||(!0===r||!0===s?"margin":"border");return q(this,(function(e,i,r){var s;return b(e)?0===n.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(s=e.documentElement,Math.max(e.body["scroll"+t],s["scroll"+t],e.body["offset"+t],s["offset"+t],s["client"+t])):void 0===r?S.css(e,i,a):S.style(e,i,r,a)}),e,o?r:void 0,o)}}))})),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){S.fn[e]=function(t){return this.on(e,t)}})),S.fn.extend({bind:function(t,e,i){return this.on(t,null,e,i)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,i,n){return this.on(e,t,i,n)},undelegate:function(t,e,i){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",i)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(t,e){S.fn[e]=function(t,i){return arguments.length>0?this.on(e,null,t,i):this.trigger(e)}}));var Je=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(t,e){var i,n,r;if("string"==typeof e&&(i=t[e],e=t,t=i),m(t))return n=a.call(arguments,2),(r=function(){return t.apply(e||this,n.concat(a.call(arguments)))}).guid=t.guid=t.guid||S.guid++,r},S.holdReady=function(t){t?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=N,S.isFunction=m,S.isWindow=b,S.camelCase=J,S.type=C,S.now=Date.now,S.isNumeric=function(t){var e=S.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},S.trim=function(t){return null==t?"":(t+"").replace(Je,"")},void 0===(i=function(){return S}.apply(e,[]))||(t.exports=i);var Ye=n.jQuery,Ke=n.$;return S.noConflict=function(t){return n.$===S&&(n.$=Ke),t&&n.jQuery===S&&(n.jQuery=Ye),S},void 0===r&&(n.jQuery=n.$=S),S}))},590:function(t,e,i){t.exports=function(){var t="1.13.1",e="object"==typeof self&&self.self===self&&self||"object"==typeof i.g&&i.g.global===i.g&&i.g||Function("return this")()||{},n=Array.prototype,r=Object.prototype,s="undefined"!=typeof Symbol?Symbol.prototype:null,o=n.push,a=n.slice,l=r.toString,c=r.hasOwnProperty,d="undefined"!=typeof ArrayBuffer,u="undefined"!=typeof DataView,h=Array.isArray,p=Object.keys,f=Object.create,g=d&&ArrayBuffer.isView,v=isNaN,m=isFinite,b=!{toString:null}.propertyIsEnumerable("toString"),y=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],w=Math.pow(2,53)-1;function x(t,e){return e=null==e?t.length-1:+e,function(){for(var i=Math.max(arguments.length-e,0),n=Array(i),r=0;r<i;r++)n[r]=arguments[r+e];switch(e){case 0:return t.call(this,n);case 1:return t.call(this,arguments[0],n);case 2:return t.call(this,arguments[0],arguments[1],n)}var s=Array(e+1);for(r=0;r<e;r++)s[r]=arguments[r];return s[e]=n,t.apply(this,s)}}function C(t){var e=typeof t;return"function"===e||"object"===e&&!!t}function k(t){return void 0===t}function S(t){return!0===t||!1===t||"[object Boolean]"===l.call(t)}function $(t){var e="[object "+t+"]";return function(t){return l.call(t)===e}}var E=$("String"),D=$("Number"),T=$("Date"),M=$("RegExp"),N=$("Error"),A=$("Symbol"),_=$("ArrayBuffer"),F=$("Function"),H=e.document&&e.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof H&&(F=function(t){return"function"==typeof t||!1});var P=F,O=$("Object"),j=u&&O(new DataView(new ArrayBuffer(8))),I="undefined"!=typeof Map&&O(new Map),W=$("DataView"),z=j?function(t){return null!=t&&P(t.getInt8)&&_(t.buffer)}:W,V=h||$("Array");function R(t,e){return null!=t&&c.call(t,e)}var B=$("Arguments");!function(){B(arguments)||(B=function(t){return R(t,"callee")})}();var L=B;function q(t){return D(t)&&v(t)}function U(t){return function(){return t}}function X(t){return function(e){var i=t(e);return"number"==typeof i&&i>=0&&i<=w}}function G(t){return function(e){return null==e?void 0:e[t]}}var J=G("byteLength"),Y=X(J),K=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/,Q=d?function(t){return g?g(t)&&!z(t):Y(t)&&K.test(l.call(t))}:U(!1),Z=G("length");function tt(t,e){e=function(t){for(var e={},i=t.length,n=0;n<i;++n)e[t[n]]=!0;return{contains:function(t){return e[t]},push:function(i){return e[i]=!0,t.push(i)}}}(e);var i=y.length,n=t.constructor,s=P(n)&&n.prototype||r,o="constructor";for(R(t,o)&&!e.contains(o)&&e.push(o);i--;)(o=y[i])in t&&t[o]!==s[o]&&!e.contains(o)&&e.push(o)}function et(t){if(!C(t))return[];if(p)return p(t);var e=[];for(var i in t)R(t,i)&&e.push(i);return b&&tt(t,e),e}function it(t,e){var i=et(e),n=i.length;if(null==t)return!n;for(var r=Object(t),s=0;s<n;s++){var o=i[s];if(e[o]!==r[o]||!(o in r))return!1}return!0}function nt(t){return t instanceof nt?t:this instanceof nt?void(this._wrapped=t):new nt(t)}function rt(t){return new Uint8Array(t.buffer||t,t.byteOffset||0,J(t))}nt.VERSION=t,nt.prototype.value=function(){return this._wrapped},nt.prototype.valueOf=nt.prototype.toJSON=nt.prototype.value,nt.prototype.toString=function(){return String(this._wrapped)};var st="[object DataView]";function ot(t,e,i,n){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var r=typeof t;return("function"===r||"object"===r||"object"==typeof e)&&function t(e,i,n,r){e instanceof nt&&(e=e._wrapped),i instanceof nt&&(i=i._wrapped);var o=l.call(e);if(o!==l.call(i))return!1;if(j&&"[object Object]"==o&&z(e)){if(!z(i))return!1;o=st}switch(o){case"[object RegExp]":case"[object String]":return""+e==""+i;case"[object Number]":return+e!=+e?+i!=+i:0==+e?1/+e==1/i:+e==+i;case"[object Date]":case"[object Boolean]":return+e==+i;case"[object Symbol]":return s.valueOf.call(e)===s.valueOf.call(i);case"[object ArrayBuffer]":case st:return t(rt(e),rt(i),n,r)}var a="[object Array]"===o;if(!a&&Q(e)){if(J(e)!==J(i))return!1;if(e.buffer===i.buffer&&e.byteOffset===i.byteOffset)return!0;a=!0}if(!a){if("object"!=typeof e||"object"!=typeof i)return!1;var c=e.constructor,d=i.constructor;if(c!==d&&!(P(c)&&c instanceof c&&P(d)&&d instanceof d)&&"constructor"in e&&"constructor"in i)return!1}r=r||[];for(var u=(n=n||[]).length;u--;)if(n[u]===e)return r[u]===i;if(n.push(e),r.push(i),a){if((u=e.length)!==i.length)return!1;for(;u--;)if(!ot(e[u],i[u],n,r))return!1}else{var h,p=et(e);if(u=p.length,et(i).length!==u)return!1;for(;u--;)if(!R(i,h=p[u])||!ot(e[h],i[h],n,r))return!1}return n.pop(),r.pop(),!0}(t,e,i,n)}function at(t){if(!C(t))return[];var e=[];for(var i in t)e.push(i);return b&&tt(t,e),e}function lt(t){var e=Z(t);return function(i){if(null==i)return!1;var n=at(i);if(Z(n))return!1;for(var r=0;r<e;r++)if(!P(i[t[r]]))return!1;return t!==pt||!P(i[ct])}}var ct="forEach",dt=["clear","delete"],ut=["get","has","set"],ht=dt.concat(ct,ut),pt=dt.concat(ut),ft=["add"].concat(dt,ct,"has"),gt=I?lt(ht):$("Map"),vt=I?lt(pt):$("WeakMap"),mt=I?lt(ft):$("Set"),bt=$("WeakSet");function yt(t){for(var e=et(t),i=e.length,n=Array(i),r=0;r<i;r++)n[r]=t[e[r]];return n}function wt(t){for(var e={},i=et(t),n=0,r=i.length;n<r;n++)e[t[i[n]]]=i[n];return e}function xt(t){var e=[];for(var i in t)P(t[i])&&e.push(i);return e.sort()}function Ct(t,e){return function(i){var n=arguments.length;if(e&&(i=Object(i)),n<2||null==i)return i;for(var r=1;r<n;r++)for(var s=arguments[r],o=t(s),a=o.length,l=0;l<a;l++){var c=o[l];e&&void 0!==i[c]||(i[c]=s[c])}return i}}var kt=Ct(at),St=Ct(et),$t=Ct(at,!0);function Et(t){if(!C(t))return{};if(f)return f(t);var e=function(){};e.prototype=t;var i=new e;return e.prototype=null,i}function Dt(t){return C(t)?V(t)?t.slice():kt({},t):t}function Tt(t){return V(t)?t:[t]}function Mt(t){return nt.toPath(t)}function Nt(t,e){for(var i=e.length,n=0;n<i;n++){if(null==t)return;t=t[e[n]]}return i?t:void 0}function At(t,e,i){var n=Nt(t,Mt(e));return k(n)?i:n}function _t(t){return t}function Ft(t){return t=St({},t),function(e){return it(e,t)}}function Ht(t){return t=Mt(t),function(e){return Nt(e,t)}}function Pt(t,e,i){if(void 0===e)return t;switch(null==i?3:i){case 1:return function(i){return t.call(e,i)};case 3:return function(i,n,r){return t.call(e,i,n,r)};case 4:return function(i,n,r,s){return t.call(e,i,n,r,s)}}return function(){return t.apply(e,arguments)}}function Ot(t,e,i){return null==t?_t:P(t)?Pt(t,e,i):C(t)&&!V(t)?Ft(t):Ht(t)}function jt(t,e){return Ot(t,e,1/0)}function It(t,e,i){return nt.iteratee!==jt?nt.iteratee(t,e):Ot(t,e,i)}function Wt(){}function zt(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))}nt.toPath=Tt,nt.iteratee=jt;var Vt=Date.now||function(){return(new Date).getTime()};function Rt(t){var e=function(e){return t[e]},i="(?:"+et(t).join("|")+")",n=RegExp(i),r=RegExp(i,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(r,e):t}}var Bt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Lt=Rt(Bt),qt=Rt(wt(Bt)),Ut=nt.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Xt=/(.)^/,Gt={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Jt=/\\|'|\r|\n|\u2028|\u2029/g;function Yt(t){return"\\"+Gt[t]}var Kt=/^\s*(\w|\$)+\s*$/,Qt=0;function Zt(t,e,i,n,r){if(!(n instanceof e))return t.apply(i,r);var s=Et(t.prototype),o=t.apply(s,r);return C(o)?o:s}var te=x((function(t,e){var i=te.placeholder,n=function(){for(var r=0,s=e.length,o=Array(s),a=0;a<s;a++)o[a]=e[a]===i?arguments[r++]:e[a];for(;r<arguments.length;)o.push(arguments[r++]);return Zt(t,n,this,this,o)};return n}));te.placeholder=nt;var ee=x((function(t,e,i){if(!P(t))throw new TypeError("Bind must be called on a function");var n=x((function(r){return Zt(t,n,e,this,i.concat(r))}));return n})),ie=X(Z);function ne(t,e,i,n){if(n=n||[],e||0===e){if(e<=0)return n.concat(t)}else e=1/0;for(var r=n.length,s=0,o=Z(t);s<o;s++){var a=t[s];if(ie(a)&&(V(a)||L(a)))if(e>1)ne(a,e-1,i,n),r=n.length;else for(var l=0,c=a.length;l<c;)n[r++]=a[l++];else i||(n[r++]=a)}return n}var re=x((function(t,e){var i=(e=ne(e,!1,!1)).length;if(i<1)throw new Error("bindAll must be passed function names");for(;i--;){var n=e[i];t[n]=ee(t[n],t)}return t})),se=x((function(t,e,i){return setTimeout((function(){return t.apply(null,i)}),e)})),oe=te(se,nt,1);function ae(t){return function(){return!t.apply(this,arguments)}}function le(t,e){var i;return function(){return--t>0&&(i=e.apply(this,arguments)),t<=1&&(e=null),i}}var ce=te(le,2);function de(t,e,i){e=It(e,i);for(var n,r=et(t),s=0,o=r.length;s<o;s++)if(e(t[n=r[s]],n,t))return n}function ue(t){return function(e,i,n){i=It(i,n);for(var r=Z(e),s=t>0?0:r-1;s>=0&&s<r;s+=t)if(i(e[s],s,e))return s;return-1}}var he=ue(1),pe=ue(-1);function fe(t,e,i,n){for(var r=(i=It(i,n,1))(e),s=0,o=Z(t);s<o;){var a=Math.floor((s+o)/2);i(t[a])<r?s=a+1:o=a}return s}function ge(t,e,i){return function(n,r,s){var o=0,l=Z(n);if("number"==typeof s)t>0?o=s>=0?s:Math.max(s+l,o):l=s>=0?Math.min(s+1,l):s+l+1;else if(i&&s&&l)return n[s=i(n,r)]===r?s:-1;if(r!=r)return(s=e(a.call(n,o,l),q))>=0?s+o:-1;for(s=t>0?o:l-1;s>=0&&s<l;s+=t)if(n[s]===r)return s;return-1}}var ve=ge(1,he,fe),me=ge(-1,pe);function be(t,e,i){var n=(ie(t)?he:de)(t,e,i);if(void 0!==n&&-1!==n)return t[n]}function ye(t,e,i){var n,r;if(e=Pt(e,i),ie(t))for(n=0,r=t.length;n<r;n++)e(t[n],n,t);else{var s=et(t);for(n=0,r=s.length;n<r;n++)e(t[s[n]],s[n],t)}return t}function we(t,e,i){e=It(e,i);for(var n=!ie(t)&&et(t),r=(n||t).length,s=Array(r),o=0;o<r;o++){var a=n?n[o]:o;s[o]=e(t[a],a,t)}return s}function xe(t){var e=function(e,i,n,r){var s=!ie(e)&&et(e),o=(s||e).length,a=t>0?0:o-1;for(r||(n=e[s?s[a]:a],a+=t);a>=0&&a<o;a+=t){var l=s?s[a]:a;n=i(n,e[l],l,e)}return n};return function(t,i,n,r){var s=arguments.length>=3;return e(t,Pt(i,r,4),n,s)}}var Ce=xe(1),ke=xe(-1);function Se(t,e,i){var n=[];return e=It(e,i),ye(t,(function(t,i,r){e(t,i,r)&&n.push(t)})),n}function $e(t,e,i){e=It(e,i);for(var n=!ie(t)&&et(t),r=(n||t).length,s=0;s<r;s++){var o=n?n[s]:s;if(!e(t[o],o,t))return!1}return!0}function Ee(t,e,i){e=It(e,i);for(var n=!ie(t)&&et(t),r=(n||t).length,s=0;s<r;s++){var o=n?n[s]:s;if(e(t[o],o,t))return!0}return!1}function De(t,e,i,n){return ie(t)||(t=yt(t)),("number"!=typeof i||n)&&(i=0),ve(t,e,i)>=0}var Te=x((function(t,e,i){var n,r;return P(e)?r=e:(e=Mt(e),n=e.slice(0,-1),e=e[e.length-1]),we(t,(function(t){var s=r;if(!s){if(n&&n.length&&(t=Nt(t,n)),null==t)return;s=t[e]}return null==s?s:s.apply(t,i)}))}));function Me(t,e){return we(t,Ht(e))}function Ne(t,e,i){var n,r,s=-1/0,o=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,l=(t=ie(t)?t:yt(t)).length;a<l;a++)null!=(n=t[a])&&n>s&&(s=n);else e=It(e,i),ye(t,(function(t,i,n){((r=e(t,i,n))>o||r===-1/0&&s===-1/0)&&(s=t,o=r)}));return s}function Ae(t,e,i){if(null==e||i)return ie(t)||(t=yt(t)),t[zt(t.length-1)];var n=ie(t)?Dt(t):yt(t),r=Z(n);e=Math.max(Math.min(e,r),0);for(var s=r-1,o=0;o<e;o++){var a=zt(o,s),l=n[o];n[o]=n[a],n[a]=l}return n.slice(0,e)}function _e(t,e){return function(i,n,r){var s=e?[[],[]]:{};return n=It(n,r),ye(i,(function(e,r){var o=n(e,r,i);t(s,e,o)})),s}}var Fe=_e((function(t,e,i){R(t,i)?t[i].push(e):t[i]=[e]})),He=_e((function(t,e,i){t[i]=e})),Pe=_e((function(t,e,i){R(t,i)?t[i]++:t[i]=1})),Oe=_e((function(t,e,i){t[i?0:1].push(e)}),!0),je=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function Ie(t,e,i){return e in i}var We=x((function(t,e){var i={},n=e[0];if(null==t)return i;P(n)?(e.length>1&&(n=Pt(n,e[1])),e=at(t)):(n=Ie,e=ne(e,!1,!1),t=Object(t));for(var r=0,s=e.length;r<s;r++){var o=e[r],a=t[o];n(a,o,t)&&(i[o]=a)}return i})),ze=x((function(t,e){var i,n=e[0];return P(n)?(n=ae(n),e.length>1&&(i=e[1])):(e=we(ne(e,!1,!1),String),n=function(t,i){return!De(e,i)}),We(t,n,i)}));function Ve(t,e,i){return a.call(t,0,Math.max(0,t.length-(null==e||i?1:e)))}function Re(t,e,i){return null==t||t.length<1?null==e||i?void 0:[]:null==e||i?t[0]:Ve(t,t.length-e)}function Be(t,e,i){return a.call(t,null==e||i?1:e)}var Le=x((function(t,e){return e=ne(e,!0,!0),Se(t,(function(t){return!De(e,t)}))})),qe=x((function(t,e){return Le(t,e)}));function Ue(t,e,i,n){S(e)||(n=i,i=e,e=!1),null!=i&&(i=It(i,n));for(var r=[],s=[],o=0,a=Z(t);o<a;o++){var l=t[o],c=i?i(l,o,t):l;e&&!i?(o&&s===c||r.push(l),s=c):i?De(s,c)||(s.push(c),r.push(l)):De(r,l)||r.push(l)}return r}var Xe=x((function(t){return Ue(ne(t,!0,!0))}));function Ge(t){for(var e=t&&Ne(t,Z).length||0,i=Array(e),n=0;n<e;n++)i[n]=Me(t,n);return i}var Je=x(Ge);function Ye(t,e){return t._chain?nt(e).chain():e}function Ke(t){return ye(xt(t),(function(e){var i=nt[e]=t[e];nt.prototype[e]=function(){var t=[this._wrapped];return o.apply(t,arguments),Ye(this,i.apply(nt,t))}})),nt}ye(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=n[t];nt.prototype[t]=function(){var i=this._wrapped;return null!=i&&(e.apply(i,arguments),"shift"!==t&&"splice"!==t||0!==i.length||delete i[0]),Ye(this,i)}})),ye(["concat","join","slice"],(function(t){var e=n[t];nt.prototype[t]=function(){var t=this._wrapped;return null!=t&&(t=e.apply(t,arguments)),Ye(this,t)}}));var Qe=Ke({__proto__:null,VERSION:t,restArguments:x,isObject:C,isNull:function(t){return null===t},isUndefined:k,isBoolean:S,isElement:function(t){return!(!t||1!==t.nodeType)},isString:E,isNumber:D,isDate:T,isRegExp:M,isError:N,isSymbol:A,isArrayBuffer:_,isDataView:z,isArray:V,isFunction:P,isArguments:L,isFinite:function(t){return!A(t)&&m(t)&&!isNaN(parseFloat(t))},isNaN:q,isTypedArray:Q,isEmpty:function(t){if(null==t)return!0;var e=Z(t);return"number"==typeof e&&(V(t)||E(t)||L(t))?0===e:0===Z(et(t))},isMatch:it,isEqual:function(t,e){return ot(t,e)},isMap:gt,isWeakMap:vt,isSet:mt,isWeakSet:bt,keys:et,allKeys:at,values:yt,pairs:function(t){for(var e=et(t),i=e.length,n=Array(i),r=0;r<i;r++)n[r]=[e[r],t[e[r]]];return n},invert:wt,functions:xt,methods:xt,extend:kt,extendOwn:St,assign:St,defaults:$t,create:function(t,e){var i=Et(t);return e&&St(i,e),i},clone:Dt,tap:function(t,e){return e(t),t},get:At,has:function(t,e){for(var i=(e=Mt(e)).length,n=0;n<i;n++){var r=e[n];if(!R(t,r))return!1;t=t[r]}return!!i},mapObject:function(t,e,i){e=It(e,i);for(var n=et(t),r=n.length,s={},o=0;o<r;o++){var a=n[o];s[a]=e(t[a],a,t)}return s},identity:_t,constant:U,noop:Wt,toPath:Tt,property:Ht,propertyOf:function(t){return null==t?Wt:function(e){return At(t,e)}},matcher:Ft,matches:Ft,times:function(t,e,i){var n=Array(Math.max(0,t));e=Pt(e,i,1);for(var r=0;r<t;r++)n[r]=e(r);return n},random:zt,now:Vt,escape:Lt,unescape:qt,templateSettings:Ut,template:function(t,e,i){!e&&i&&(e=i),e=$t({},e,nt.templateSettings);var n=RegExp([(e.escape||Xt).source,(e.interpolate||Xt).source,(e.evaluate||Xt).source].join("|")+"|$","g"),r=0,s="__p+='";t.replace(n,(function(e,i,n,o,a){return s+=t.slice(r,a).replace(Jt,Yt),r=a+e.length,i?s+="'+\n((__t=("+i+"))==null?'':_.escape(__t))+\n'":n?s+="'+\n((__t=("+n+"))==null?'':__t)+\n'":o&&(s+="';\n"+o+"\n__p+='"),e})),s+="';\n";var o,a=e.variable;if(a){if(!Kt.test(a))throw new Error("variable is not a bare identifier: "+a)}else s="with(obj||{}){\n"+s+"}\n",a="obj";s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{o=new Function(a,"_",s)}catch(t){throw t.source=s,t}var l=function(t){return o.call(this,t,nt)};return l.source="function("+a+"){\n"+s+"}",l},result:function(t,e,i){var n=(e=Mt(e)).length;if(!n)return P(i)?i.call(t):i;for(var r=0;r<n;r++){var s=null==t?void 0:t[e[r]];void 0===s&&(s=i,r=n),t=P(s)?s.call(t):s}return t},uniqueId:function(t){var e=++Qt+"";return t?t+e:e},chain:function(t){var e=nt(t);return e._chain=!0,e},iteratee:jt,partial:te,bind:ee,bindAll:re,memoize:function(t,e){var i=function(n){var r=i.cache,s=""+(e?e.apply(this,arguments):n);return R(r,s)||(r[s]=t.apply(this,arguments)),r[s]};return i.cache={},i},delay:se,defer:oe,throttle:function(t,e,i){var n,r,s,o,a=0;i||(i={});var l=function(){a=!1===i.leading?0:Vt(),n=null,o=t.apply(r,s),n||(r=s=null)},c=function(){var c=Vt();a||!1!==i.leading||(a=c);var d=e-(c-a);return r=this,s=arguments,d<=0||d>e?(n&&(clearTimeout(n),n=null),a=c,o=t.apply(r,s),n||(r=s=null)):n||!1===i.trailing||(n=setTimeout(l,d)),o};return c.cancel=function(){clearTimeout(n),a=0,n=r=s=null},c},debounce:function(t,e,i){var n,r,s,o,a,l=function(){var c=Vt()-r;e>c?n=setTimeout(l,e-c):(n=null,i||(o=t.apply(a,s)),n||(s=a=null))},c=x((function(c){return a=this,s=c,r=Vt(),n||(n=setTimeout(l,e),i&&(o=t.apply(a,s))),o}));return c.cancel=function(){clearTimeout(n),n=s=a=null},c},wrap:function(t,e){return te(e,t)},negate:ae,compose:function(){var t=arguments,e=t.length-1;return function(){for(var i=e,n=t[e].apply(this,arguments);i--;)n=t[i].call(this,n);return n}},after:function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},before:le,once:ce,findKey:de,findIndex:he,findLastIndex:pe,sortedIndex:fe,indexOf:ve,lastIndexOf:me,find:be,detect:be,findWhere:function(t,e){return be(t,Ft(e))},each:ye,forEach:ye,map:we,collect:we,reduce:Ce,foldl:Ce,inject:Ce,reduceRight:ke,foldr:ke,filter:Se,select:Se,reject:function(t,e,i){return Se(t,ae(It(e)),i)},every:$e,all:$e,some:Ee,any:Ee,contains:De,includes:De,include:De,invoke:Te,pluck:Me,where:function(t,e){return Se(t,Ft(e))},max:Ne,min:function(t,e,i){var n,r,s=1/0,o=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,l=(t=ie(t)?t:yt(t)).length;a<l;a++)null!=(n=t[a])&&n<s&&(s=n);else e=It(e,i),ye(t,(function(t,i,n){((r=e(t,i,n))<o||r===1/0&&s===1/0)&&(s=t,o=r)}));return s},shuffle:function(t){return Ae(t,1/0)},sample:Ae,sortBy:function(t,e,i){var n=0;return e=It(e,i),Me(we(t,(function(t,i,r){return{value:t,index:n++,criteria:e(t,i,r)}})).sort((function(t,e){var i=t.criteria,n=e.criteria;if(i!==n){if(i>n||void 0===i)return 1;if(i<n||void 0===n)return-1}return t.index-e.index})),"value")},groupBy:Fe,indexBy:He,countBy:Pe,partition:Oe,toArray:function(t){return t?V(t)?a.call(t):E(t)?t.match(je):ie(t)?we(t,_t):yt(t):[]},size:function(t){return null==t?0:ie(t)?t.length:et(t).length},pick:We,omit:ze,first:Re,head:Re,take:Re,initial:Ve,last:function(t,e,i){return null==t||t.length<1?null==e||i?void 0:[]:null==e||i?t[t.length-1]:Be(t,Math.max(0,t.length-e))},rest:Be,tail:Be,drop:Be,compact:function(t){return Se(t,Boolean)},flatten:function(t,e){return ne(t,e,!1)},without:qe,uniq:Ue,unique:Ue,union:Xe,intersection:function(t){for(var e=[],i=arguments.length,n=0,r=Z(t);n<r;n++){var s=t[n];if(!De(e,s)){var o;for(o=1;o<i&&De(arguments[o],s);o++);o===i&&e.push(s)}}return e},difference:Le,unzip:Ge,transpose:Ge,zip:Je,object:function(t,e){for(var i={},n=0,r=Z(t);n<r;n++)e?i[t[n]]=e[n]:i[t[n][0]]=t[n][1];return i},range:function(t,e,i){null==e&&(e=t||0,t=0),i||(i=e<t?-1:1);for(var n=Math.max(Math.ceil((e-t)/i),0),r=Array(n),s=0;s<n;s++,t+=i)r[s]=t;return r},chunk:function(t,e){if(null==e||e<1)return[];for(var i=[],n=0,r=t.length;n<r;)i.push(a.call(t,n,n+=e));return i},mixin:Ke,default:nt});return Qe._=Qe,Qe}()},587:(t,e)=>{"use strict";var i,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),e.defaultWebSettings=e.defaultIoSettings=e.DEFAULT_PICTURE_SIZE=e.MIN_HEIGHT=e.MIN_WIDTH=e.whiteboardFile=e.getFrequency=e.PrototypeBuilderEvents=e.getWebFile=e.getIoFile=e.DataAttribute=e.WebFileAttribute=e.IoFileAttribute=void 0,function(t){t.description="description",t.mainFile="mainFile",t.mainModule="mainModule",t.initialState="initialState",t.tickFunction="tickFunction",t.tickInterval="tickInterval",t.toStringFunction="toStringFunction"}(i=e.IoFileAttribute||(e.IoFileAttribute={})),function(t){t.pictureFile="pictureFile",t.pictureWidth="pictureWidth",t.pictureHeight="pictureHeight",t.widgets="widgets"}(n=e.WebFileAttribute||(e.WebFileAttribute={})),(s=e.DataAttribute||(e.DataAttribute={})).contextFolder="contextFolder",s.pictureData="pictureData",e.getIoFile=function(t){if(t){const e={};for(let n in i)e[n]=t[n];return e}return null},e.getWebFile=function(t){if(t){const e={};for(let i in n)e[i]=t[i];return e}return null},(r=e.PrototypeBuilderEvents||(e.PrototypeBuilderEvents={})).DidActivatePlugin="DidActivatePlugin",r.DidLoadPrototypeData="DidLoadPrototypeData",r.NewPrototype="NewPrototype",r.SavePrototype="SavePrototype",r.SaveAs="SaveAs",r.OpenPrototype="OpenPrototype",r.PauseSimulation="PauseSimulation",r.RebootSimulation="RebootSimulation",r.DidSwitchToSimulatorView="DidSwitchToSimulatorView",r.DidSwitchToBuilderView="DidSwitchToBuilderView",r.DidSwitchToSettingsView="DidSwitchToSettingsView",r.DidSwitchToSplashScreenView="DidSwitchToSplashScreenView",r.DidChangePicture="DidChangePicture",r.DidUpdateWidgets="DidUpdateWidgets",r.DidUpdateSettings="DidUpdateSettings",r.DidRemovePicture="DidRemovePicture",e.getFrequency=function(t){return t?"string"==typeof t?t.endsWith("ms")?parseFloat(t):t.endsWith("s")?1e3*parseFloat(t):+t:t:0},e.whiteboardFile="whiteboard.gif",e.MIN_WIDTH=800,e.MIN_HEIGHT=600,e.DEFAULT_PICTURE_SIZE={width:e.MIN_WIDTH,height:e.MIN_HEIGHT},e.defaultIoSettings={description:{label:"Description",value:""},mainModule:{label:"Theory Name",value:""},mainFile:{label:"Main File",value:""},initialState:{label:"Initial State",value:"init"},tickFunction:{label:"Tick Function (optional)",value:""},tickInterval:{label:"Tick Interval (optional)",value:""},toStringFunction:{label:"toString Function (optional)",value:""}},e.defaultWebSettings={pictureFile:"",pictureWidth:e.DEFAULT_PICTURE_SIZE.width,pictureHeight:e.DEFAULT_PICTURE_SIZE.height}},385:function(t,e,i){"use strict";var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.PrototypeBuilder=e.runMenu=e.pictureMenu=e.dropDownMenuTemplate=e.compactDropdownButtonTemplate=e.removePictureTemplate=e.changePictureTemplate=void 0;const r=i(845),s=i(569),o=i(642),a=i(403),l=i(100),c=i(676),d=i(93),u=i(347),h=i(31),p=i(587),f=i(420),g=i(30);e.changePictureTemplate='\n<form class="load-picture-form">\n <div class="custom-file">\n <input class="change-picture custom-file-input" type="file" accept="image"">\n <label class="custom-file-label">Change Picture</label>\n </div>\n</form>',e.removePictureTemplate='\n<div class="btn btn-sm btn-outline-danger remove-picture">Remove Picture</div>',e.compactDropdownButtonTemplate='\n<button class="btn btn-sm btn-dark builder-navbar dropdown-toggle" data-toggle="dropdown"></button>',e.dropDownMenuTemplate='\n<div class="dropdown-menu px-2">\n {{#each items}}\n {{#if divider}}<div class="dropdown-divider"></div>\n {{else}}<div class="dropdown-item input-group p-0">{{this}}</div>\n {{/if}}\n {{/each}}\n</div>',e.pictureMenu=Handlebars.compile(e.dropDownMenuTemplate,{noEscape:!0})({items:[e.changePictureTemplate,{divider:!0},e.removePictureTemplate]}),e.runMenu=Handlebars.compile(e.dropDownMenuTemplate,{noEscape:!0})({items:['<div class="reboot-simulator btn btn-sm btn-outline-danger">Reboot Simulation</div>']});const v=`\n<style>\n.custom-file {\n min-width:220px;\n}\n.dropdown-item {\n font-size: small;\n cursor:default;\n}\n</style>\n<div class="dropdown">\n <button class="btn btn-sm btn-dark builder-navbar dropdown-toggle" data-toggle="dropdown">Picture</button>\n ${e.pictureMenu}\n</div>\n<div class=""dropdown">\n <button class="btn btn-sm btn-dark builder-navbar dropdown-toggle" data-toggle="dropdown">Run</button>\n ${e.runMenu}\n</div>\n`;class m extends r.Model{constructor(){super(...arguments),this.name="Prototype Builder",this.id=s.removeSpaceDash(this.name),this.mode="splash",this.activeFlag=!1,this.parent="body",this.widgetClassManager=new h.WidgetClassManager,this.width="0px",this.sidePanelIsCollapsed=!1,this.sidePanelIsHidden=!1}activate(t){var e,i,r,o,d,h,m,b,y,w;return n(this,void 0,void 0,(function*(){t=t||{},this.parent=t.parent||this.parent,this.connection=t.connection||new g.BackboneConnection,console.log(`Browser version: ${s.getVersion()}`),console.log("Bootstrap version",null===(r=null===(i=null===(e=null===$||void 0===$?void 0:$.fn)||void 0===e?void 0:e.tooltip)||void 0===i?void 0:i.Constructor)||void 0===r?void 0:r.VERSION),this.panel=s.createStickyPanel(this,{parent:this.parent,navbarCentral:'\n<button class="btn btn-sm btn-dark builder-navbar simulator">Simulator</button>\n<button class="btn btn-sm btn-dark builder-navbar builder">Builder</button>\n<button class="btn btn-sm btn-dark builder-navbar settings">Settings</button>',navbarLeft:v}),this.body=this.createPanelBody({parent:this.panel.$content});const n=this.panel.$content.find(".central-panel-inner")[0];return this.sideViews={Builder:new l.WidgetsListView({el:this.panel.$content.find(".widget-list")[0]})},this.centralViews={Settings:new c.SettingsView({label:"Settings",viewId:"settings-view",panelId:"settings-view",el:n,parentDiv:this.body.$central[0],settings:{io:(null===(o=t.settings)||void 0===o?void 0:o.io)||p.defaultIoSettings,web:(null===(d=t.settings)||void 0===d?void 0:d.web)||p.defaultWebSettings,contextFolder:(null===(h=t.settings)||void 0===h?void 0:h.contextFolder)||""}},this.connection),Builder:new a.BuilderView({label:"Builder",viewId:"builder-view",panelId:"builder-view",el:n,parentDiv:this.body.$central[0],widgetClassMap:(null===(m=this.widgetClassManager)||void 0===m?void 0:m.getWidgetClassMap())||{}},this.connection),Simulator:new u.SimulatorView({label:"Simulator",viewId:"simulator-view",panelId:"builder-view",el:n,parentDiv:this.body.$central[0]},this.connection),Splash:new f.SplashScreenView({label:"",viewId:"splash-screeen-view",panelId:"splash-screen-view",active:!0,el:n,parentDiv:this.body.$central[0]},this.connection)},yield this.renderViews(),null===(y=null===(b=this.centralViews)||void 0===b?void 0:b.Builder)||void 0===y||y.createWhiteboard(),this.$menu=null===(w=this.panel)||void 0===w?void 0:w.$navbar,this.installHandlers(),this.onResizeCentralView(),console.log("[prototype-builder] DidActivatePlugin"),this.trigger(p.PrototypeBuilderEvents.DidActivatePlugin),this.switchToSplashScreenView(),this.activeFlag=!0,this.activeFlag}))}deactivate(){return this.centralViews.Builder.clearDelayedTriggers(),this.centralViews.Settings.clearDelayedTriggers(),this.getPrototypeData()}importWidgetLibrary(t){if(this.widgetClassManager&&(console.log("[pvsio-web] Importing widget library",t),t)){const e=Object.keys(t);for(let i=0;i<e.length;i++){const n=e[i];console.log(`[pvsio-web] Importing ${n}`,t[n]);try{this.widgetClassManager.importWidgetClassMap(t[n]),console.log(`[pvsio-web] Library ${n} imported successfully!`)}catch(e){console.warn("[pvsio-web] Warning: unable to load widget library",t)}}}}getView(t){return this.centralViews[t]}isActive(){return this.activeFlag}hideBuilderMenu(){var t;null===(t=this.$menu)||void 0===t||t.find(".builder-menu").css("display","none")}revealBuilderMenu(){var t;null===(t=this.$menu)||void 0===t||t.find(".builder-menu").css("display","inline-block")}hideSimulatorMenu(){var t;null===(t=this.$menu)||void 0===t||t.find(".simulator-menu").css("display","none")}revealSimulatorMenu(){var t;null===(t=this.$menu)||void 0===t||t.find(".simulator-menu").css("display","inline-block")}removePicture(){return n(this,void 0,void 0,(function*(){if(!this.isWhiteboard()){const t=this.centralViews.Builder.getCurrentPicture();yield this.centralViews.Builder.createWhiteboard();const e=this.getPrototypeData(),i=Object.assign({old:t},e);console.log("[prototype-builder] DidRemovePicture",i),this.trigger(p.PrototypeBuilderEvents.DidRemovePicture,{pictureFile:i})}}))}renderState(t,e){var i,r;return n(this,void 0,void 0,(function*(){return console.log("[pvsio-web] Render state",t,e),yield null===(r=null===(i=this.centralViews)||void 0===i?void 0:i.Simulator)||void 0===r?void 0:r.renderState(t,e)}))}createPanelBody(t){const e=`${this.id}-panel`,i=Handlebars.compile('\n<style>\n.builder-sidebar-heading {\n color: white;\n display: block;\n background-color: #4c4c4c;\n border-bottom:1px solid;\n}\n.left-panel {\n overflow-x:hidden;\n width:30%; \n min-width:10px; \n position:relative;\n border: 1px solid lightgray;\n background:whitesmoke;\n}\n.resize-bar {\n width:6px;\n background-color:#4c4c4c;\n}\n.central-panel {\n position:relative;\n width:66%;\n height:100%;\n background:whitesmoke;\n}\n.central-panel-inner {\n width:100% !important;\n min-height:600px;\n}\n.card-header-dropdown-menu {\n position:absolute;\n top:10px;\n border: 0px;\n z-index:0;\n}\n.r-10 {\n right:10px !important;\n margin-top:-3px !important; \n}\n.builder-content {\n height:100%;\n margin-left:0;\n}\n.builder-coords {\n color: white;\n font-size: small;\n font-family: monospace;\n position:absolute;\n}\n.dropdown-menu .dropdown-item {\n padding-top:4px !important;\n}\n.dropdown-item .btn {\n width:100%;\n}\n.btn-sm {\n white-space:nowrap;\n}\n</style>\n<div id="{{id}}" class="builder-content row d-flex p-0">\n <div id="{{id}}-left" class="left-panel container-fluid no-gutters p-0">\n <div class="builder-sidebar-heading p-2">\n </div>\n <div id="{{id}}-widget-list" class="widget-list list-group"></div>\n <div id="{{id}}-timers-list" class="list-group"></div>\n </div>\n <div id="{{id}}-resize-bar" class="resize-bar"></div>\n <div id="{{id}}-central" class="flex-grow-1 no-gutters p-0 central-panel">\n <div class="card-header central-panel-header" style="display:none;"></div>\n <div class="card-body central-panel-inner tab-content p-1 m-0"></div>\n </div>\n \x3c!-- the coordinates div need to be placed outside the panel, otherwise the panel flickers because the scroll bars sometimes may appear when the coordinates are updates --\x3e\n <div class="builder-coords px-2">(top:0, left:0)</div>\n</div>',{noEscape:!0})({id:e});t.parent.append(i);const n=$(`#${e}`),r=$(`#${e}-left`),o=$(`#${e}-central`),a=$(`#${e}-resize-bar`);return s.enableResizeLeft({$div:n,$left:r,$central:o,$resizeBar:a,onResize:this.onResizeCentralView})}onResizeCentralView(t){var e;for(let e in this.centralViews)this.centralViews[e].resizeView(t);this.width=null===(e=this.body)||void 0===e?void 0:e.$left.css("width")}isWhiteboard(){const t=this.centralViews.Builder.getCurrentPicture();return!((null==t?void 0:t.fileName)&&(null==t?void 0:t.fileExtension)&&`${t.fileName}${t.fileExtension}`!==p.whiteboardFile)}highlightBuilderButton(){this.deselectNavbarButtons(),this.panel.$navbar.find(".builder-navbar.builder").removeClass("btn-dark").addClass("btn-primary")}highlightSimulatorButton(){this.deselectNavbarButtons(),this.panel.$navbar.find(".builder-navbar.simulator").removeClass("btn-dark").addClass("btn-primary")}highlightSettingsButton(){this.deselectNavbarButtons(),this.panel.$navbar.find(".builder-navbar.settings").removeClass("btn-dark").addClass("btn-primary")}deselectNavbarButtons(){this.panel.$navbar.find(".builder-navbar").removeClass("btn-primary").addClass("btn-dark")}installHandlers(){this.centralViews.Simulator.on(d.CentralViewEvents.DidShowView,(()=>{this.switchToSimulatorView()})),this.centralViews.Builder.on(d.CentralViewEvents.DidShowView,(()=>{this.switchToBuilderView()})),this.centralViews.Settings.on(d.CentralViewEvents.DidShowView,(()=>{this.switchToSettingsView()})),this.centralViews.Builder.on(d.CentralViewEvents.DidChangePictureSize,(t=>{this.centralViews.Settings.updatePictureSize(t)})),this.centralViews.Builder.on(a.BuilderEvents.DidLoadPicture,(t=>{this.centralViews.Settings.updateSettings({web:t})})),this.centralViews.Builder.on(a.BuilderEvents.DidChangePicture,(t=>{const e=this.getPrototypeData();this.centralViews.Settings.updateSettings({web:p.getWebFile(e)});const i=Object.assign(Object.assign({},e),t);console.log("[prototype-builder] DidChangePicture",i),this.trigger(p.PrototypeBuilderEvents.DidChangePicture,i)})),this.centralViews.Settings.on(d.CentralViewEvents.DidChangePictureSize,(t=>{this.centralViews.Builder.resizePicture(t)})),this.centralViews.Settings.on(c.SettingsEvents.DidUpdateSettings,(()=>{const t=this.getPrototypeData();console.log("[prototype-builder] DidUpdateSettings",t),this.trigger(p.PrototypeBuilderEvents.DidUpdateSettings,t)})),this.panel.$navbar.find(".new-prototype").on("click",(t=>{const e=this.getPrototypeData();console.log("[prototype-builder] NewPrototype",e),this.trigger(p.PrototypeBuilderEvents.NewPrototype,e)})),this.panel.$navbar.find(".open").on("click",(t=>{const e=this.getPrototypeData();console.log("[prototype-builder] OpenPrototype",e),this.trigger(p.PrototypeBuilderEvents.OpenPrototype,e)})),this.panel.$navbar.find(".save").on("click",(t=>{const e=this.getPrototypeData();console.log("[prototype-builder] SavePrototype",e),this.trigger(p.PrototypeBuilderEvents.SavePrototype,e)})),this.panel.$navbar.find(".save-as").on("click",(t=>{const e=this.getPrototypeData();console.log("[prototype-builder] SaveAs",e),this.trigger(p.PrototypeBuilderEvents.SaveAs,e)})),$(document).find(".remove-picture").on("click",(t=>n(this,void 0,void 0,(function*(){this.isWhiteboard()||"yes"===(yield s.showYesCancelDialog("Remove prototype picture?"))&&(yield this.removePicture()),"splash"===this.mode&&this.switchToBuilderView()})))),$(document).find(".change-picture").on("input",(t=>n(this,void 0,void 0,(function*(){yield this.centralViews.Builder.onDidChangePicture(t),"splash"===this.mode&&this.switchToBuilderView()})))),$(document).find(".pause-simulation").on("click",(t=>n(this,void 0,void 0,(function*(){this.pauseSimulation()})))),$(document).find(".reboot-simulator").on("click",(t=>n(this,void 0,void 0,(function*(){yield this.rebootSimulation()})))),this.panel.$navbar.find(".settings").on("click",(t=>{this.switchToSettingsView(),this.panel.$navbar.find(".builder-navbar").removeClass("btn-primary").addClass("btn-dark"),$(t.target).removeClass("btn-dark").addClass("btn-primary")})),this.panel.$navbar.find(".builder").on("click",(t=>{this.switchToBuilderView(),this.panel.$navbar.find(".builder-navbar").removeClass("btn-primary").addClass("btn-dark"),$(t.target).removeClass("btn-dark").addClass("btn-primary")})),this.panel.$navbar.find(".simulator").on("click",(t=>{this.switchToSimulatorView(),this.panel.$navbar.find(".builder-navbar").removeClass("btn-primary").addClass("btn-dark"),$(t.target).removeClass("btn-dark").addClass("btn-primary")}))}renderViews(){var t,e,i;return n(this,void 0,void 0,(function*(){for(let n in this.centralViews)yield this.centralViews[n].renderView(),this.centralViews[n].on(d.CentralViewEvents.DidShowView,(t=>{var e,i;for(let t in this.sideViews)null===(e=this.sideViews[t])||void 0===e||e.hide();null===(i=this.sideViews[n])||void 0===i||i.reveal()})),this.centralViews[n].on(a.BuilderEvents.DidUpdateWidgets,(t=>{const e=this.getPrototypeData();console.log("[prototype-builder] DidUpdateWidgets",e),this.trigger(p.PrototypeBuilderEvents.DidUpdateWidgets,e)})),this.centralViews[n].on(a.BuilderEvents.DidCreateWidget,(t=>{var e,i;null===(e=this.sideViews[n])||void 0===e||e.refresh(null==t?void 0:t.widgets),null===(i=this.sideViews[n])||void 0===i||i.selectWidget({id:null==t?void 0:t.id})})),this.centralViews[n].on(a.BuilderEvents.DidDeleteWidget,(t=>{var e;null===(e=this.sideViews[n])||void 0===e||e.refresh(null==t?void 0:t.widgets)})),this.centralViews[n].on(a.BuilderEvents.DidCutWidget,(t=>{var e;null===(e=this.sideViews[n])||void 0===e||e.refresh(null==t?void 0:t.widgets)})),this.centralViews[n].on(a.BuilderEvents.DidSelectWidget,(t=>{var e;null===(e=this.sideViews[n])||void 0===e||e.selectWidget({id:null==t?void 0:t.id})})),null===(t=this.sideViews[n])||void 0===t||t.on(a.BuilderEvents.DidSelectWidget,(t=>{this.centralViews[n].selectWidget({id:null==t?void 0:t.id})})),null===(e=this.sideViews[n])||void 0===e||e.on(a.BuilderEvents.DidDeselectWidget,(t=>{this.centralViews[n].deselectWidget({id:null==t?void 0:t.id})})),null===(i=this.sideViews[n])||void 0===i||i.on(a.BuilderEvents.WillEditWidget,(t=>{this.centralViews[n].editWidget({id:null==t?void 0:t.id})}))}))}getName(){return this.name}getId(){return this.id}getDependencies(){return[]}switchToBuilderView(){var t,e;this.$menu,null===(e=null===(t=this.centralViews)||void 0===t?void 0:t.Builder)||void 0===e||e.builderView(),this.highlightBuilderButton(),this.sidePanelIsHidden&&this.revealSidePanel(),this.sidePanelIsCollapsed&&this.expandSidePanel(),this.revealBuilderMenu(),this.hideSimulatorMenu(),this.mode="builder";const i=this.getPrototypeData();this.trigger(p.PrototypeBuilderEvents.DidSwitchToBuilderView,i),console.log("[prototype-builder] DidSwitchToBuilderView",i)}switchToSimulatorView(){var t,e,i,n,r,s;null===(e=null===(t=this.centralViews)||void 0===t?void 0:t.Builder)||void 0===e||e.simulatorView(),this.highlightSimulatorButton(),this.sidePanelIsHidden||this.collapseSidePanel(),this.revealSimulatorMenu(),this.hideBuilderMenu();const o=null===(n=null===(i=this.centralViews)||void 0===i?void 0:i.Builder)||void 0===n?void 0:n.getWidgets();null===(s=null===(r=this.centralViews)||void 0===r?void 0:r.Simulator)||void 0===s||s.importWidgets(o),this.mode="simulator";const a=this.getPrototypeData();this.trigger(p.PrototypeBuilderEvents.DidSwitchToSimulatorView,a),console.log("[prototype-builder] DidSwitchToSimulatorView",a)}switchToSettingsView(){var t,e;null===(e=null===(t=this.centralViews)||void 0===t?void 0:t.Settings)||void 0===e||e.revealView(),this.highlightSettingsButton(),this.hideSidePanel(),this.hideBuilderMenu(),this.hideSimulatorMenu(),this.mode="settings";const i=this.getPrototypeData();this.trigger(p.PrototypeBuilderEvents.DidSwitchToSettingsView,i),console.log("[prototype-builder] DidSwitchToSettingsView",i)}switchToSplashScreenView(){var t,e;null===(e=null===(t=this.centralViews)||void 0===t?void 0:t.Splash)||void 0===e||e.revealView(),this.deselectNavbarButtons(),this.hideSidePanel(),this.mode="splash";const i=this.getPrototypeData();this.trigger(p.PrototypeBuilderEvents.DidSwitchToSplashScreenView,i),console.log("[prototype-builder] DidSwitchToSplashScreenView",i)}pauseSimulation(){var t,e;const i=null===(e=null===(t=this.centralViews)||void 0===t?void 0:t.Settings)||void 0===e?void 0:e.getCurrentIoSettings();this.trigger(p.PrototypeBuilderEvents.PauseSimulation,i),console.log("[prototype-builder] PauseSimulation",i)}rebootSimulation(){var t,e;return n(this,void 0,void 0,(function*(){if("yes"===(yield s.showYesCancelDialog("Reboot Simulation?"))){const i=null===(e=null===(t=this.centralViews)||void 0===t?void 0:t.Settings)||void 0===e?void 0:e.getCurrentIoSettings();this.trigger(p.PrototypeBuilderEvents.RebootSimulation,i),console.log("[prototype-builder] RebootSimulation",i)}}))}collapseSidePanel(){var t,e,i;this.saveSidePanelWidth(),null===(t=this.body.$left)||void 0===t||t.css({display:"block"}),null===(e=this.body.$left)||void 0===e||e.animate({"min-width":0,width:0},500),null===(i=this.body.$resizeBar)||void 0===i||i.css({display:"none"}),this.sidePanelIsCollapsed=!0}expandSidePanel(){var t,e,i;this.body.disableResize=!1,null===(t=this.body.$left)||void 0===t||t.css({display:"block"}),null===(e=this.body.$left)||void 0===e||e.animate({"min-width":"10px",width:this.width},500),null===(i=this.body.$resizeBar)||void 0===i||i.css({display:"block"}),this.sidePanelIsCollapsed=!1,this.sidePanelIsHidden=!1}hideSidePanel(){var t,e;null===(t=this.body.$left)||void 0===t||t.css({display:"none"}),null===(e=this.body.$resizeBar)||void 0===e||e.css({display:"none"}),this.sidePanelIsHidden=!0}revealSidePanel(){var t,e;null===(t=this.body.$left)||void 0===t||t.css({display:"block"}),null===(e=this.body.$resizeBar)||void 0===e||e.css({display:"block"}),this.sidePanelIsHidden=!1}saveSidePanelWidth(){this.body.disableResize=!0;const t=this.body.$left.css("width");parseFloat(t)>20&&(this.width=t)}loadPrototypeData(t){var e,i,r,s,a,l,c,d;return n(this,void 0,void 0,(function*(){if(console.log("[pvsio-web] loading prototype data",t),t){let n=!1;if(t.pictureFile&&t.pictureData){console.log("[pvsio-web] loading picture",t.pictureFile);const r=t.pictureFile,s={fileName:o.getFileName(r),fileExtension:o.getFileExtension(r),fileContent:t.pictureData};yield null===(i=null===(e=this.centralViews)||void 0===e?void 0:e.Builder)||void 0===i?void 0:i.loadPicture(s),n=!0}if(t.widgets){console.log("[pvsio-web] loading widgets",t.widgets);for(let e=0;e<t.widgets.length;e++){const i=t.widgets[e];yield null===(s=null===(r=this.centralViews)||void 0===r?void 0:r.Builder)||void 0===s?void 0:s.loadWidget(i),null===(l=null===(a=this.centralViews)||void 0===a?void 0:a.Builder)||void 0===l||l.createHotspot(i)}n=t.widgets.length>0}const u={io:p.getIoFile(t),web:p.getWebFile(t),contextFolder:t.contextFolder};return console.log("[pvsio-web] loading settings",u),null===(d=null===(c=this.centralViews)||void 0===c?void 0:c.Settings)||void 0===d||d.updateSettings(u),n&&this.switchToBuilderView(),this.getPrototypeData()}return console.warn("[pvsio-web] Warning: prototype data is null"),null}))}getPrototypeData(){var t,e,i,n,r,s,o;if(this.centralViews){const a=null===(t=this.centralViews.Settings)||void 0===t?void 0:t.getValue(p.DataAttribute.contextFolder),l=null===(e=this.centralViews.Settings)||void 0===e?void 0:e.getCurrentIoSettings(),c=Object.assign({version:m.version,contextFolder:a},l);return c.pictureFile=null===(i=this.centralViews)||void 0===i?void 0:i.Builder.getCurrentPictureFileName(),c.pictureWidth=null===(n=this.centralViews)||void 0===n?void 0:n.Builder.getCurrentPictureWidth(),c.pictureHeight=null===(r=this.centralViews)||void 0===r?void 0:r.Builder.getCurrentPictureHeight(),c.pictureData=null===(s=this.centralViews)||void 0===s?void 0:s.Builder.getCurrentPictureData(),c.widgets=null===(o=this.centralViews)||void 0===o?void 0:o.Builder.getCurrentWidgetsData(),c}return null}}e.PrototypeBuilder=m,m.constructorName="PrototypeBuilder",m.version="3.0"},31:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WidgetClassManager=void 0;const n=i(83);e.WidgetClassManager=class{constructor(){this.widgetClassMap=n.coreWidgetClassMap}getWidgetClassMap(){return this.widgetClassMap||{}}importWidgetClassMap(t){if(t){console.log("[pvsio-web] Importing widget class map",t);for(let e in t){const i=t[e];for(let t=0;t<i.length;t++){this.widgetClassMap[e]=this.widgetClassMap[e]||[];const n=i[t];this.widgetClassMap[e]=this.widgetClassMap[e].filter((t=>t.id!==n.id)),this.widgetClassMap[e].push(n),console.log("[pvsio-web] New widget added",n)}}}return this.widgetClassMap}}},403:function(t,e,i){"use strict";var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.BuilderView=e.BuilderEvents=void 0;const r=i(998),s=i(93),o=i(946),a=i(569),l=i(642),c=i(490),d=i(587);var u;!function(t){t.DidCreateWidget="DidCreateWidget",t.DidCutWidget="DidCutWidget",t.DidDeleteWidget="DidDeleteWidget",t.DidSelectWidget="DidSelectWidget",t.DidDeselectWidget="DidDeselectWidget",t.WillEditWidget="WillEditWidget",t.DidChangePicture="DidChangePicture",t.DidUpdateSettings="DidUpdateSettings",t.DidUpdateWidgets="DidUpdateWidgets",t.DidLoadPicture="DidLoadPicture"}(u=e.BuilderEvents||(e.BuilderEvents={}));class h extends s.CentralView{constructor(t,e){super(t,e),this.defaultPanelSize=d.DEFAULT_PICTURE_SIZE,this.widgetsMap={},this.timer=null,this.widgetClassMap=null==t?void 0:t.widgetClassMap}setWidgetClassMap(t){this.widgetClassMap=t}getWidgetClassMap(){return this.widgetClassMap}getWidgets(){return this.widgetsMap}getHotspots(){return this.hotspotEditor.getHotspots()}renderView(){const t=Object.create(null,{renderView:{get:()=>super.renderView}});return n(this,void 0,void 0,(function*(){const e=Handlebars.compile('\n<style>\n.view-div {\n position:absolute;\n padding-left:0;\n}\n.builder-toolbar {\n position:absolute; \n transform:scale(0.8);\n transform-origin:left;\n}\n.builder-toolbar .btn {\n height:2.5em;\n}\n.prototype-image-frame {\n position: absolute;\n cursor: crosshair;\n}\n.prototype-image-overlay {\n position: absolute;\n cursor: crosshair;\n}\n.prototype {\n transform-origin: top left;\n}\n</style>\n<div class="prototype row">\n <div class="prototype-image view-div container-fluid p-0"></div>\n <div class="prototype-image-frame view-div container-fluid p-0"></div>\n <div class="prototype-image-overlay container-fluid p-0"></div>\n</div>',{noEscape:!0})({});return yield t.renderView.call(this,Object.assign(Object.assign({},this.viewOptions),{content:e})),this.$imageDiv=this.$el.find(".prototype-image"),this.$imageFrame=this.$el.find(".prototype-image-frame"),this.$imageOverlay=this.$el.find(".prototype-image-overlay"),this.$coords=$(document).find(".builder-coords"),this.$toolbar=this.$el.find(".builder-toolbar"),yield this.createWhiteboard(),yield this.createImageFrameLayer(),this.installHandlers(),this.resizeView(),this.createHotspotEditor(),this}))}resizePicture(t,e){t&&(t.width&&this.$imageDiv.find("img").attr("width",t.width).attr("min-width",t.width),t.height&&this.$imageDiv.find("img").attr("height",t.height).attr("min-height",t.height)),(t=t||this.getCurrentPictureSize())&&(this.$imageDiv.css({width:`${t.width}px`,height:`${t.height}px`,"min-width":`${t.width}px`,"min-height":`${t.height}px`}),this.$imageFrame.find("img").attr("width",t.width).attr("height",t.height),this.$imageFrame.css({width:`${t.width}px`,height:`${t.height}px`,"min-width":`${t.width}px`,"min-height":`${t.height}px`}),this.$el.css({"min-height":`${t.height+36}px`}),(null==e?void 0:e.quiet)||this.trigger(s.CentralViewEvents.DidChangePictureSize,t))}resizeView(t){super.resizeView({width:parseFloat(this.$imageDiv.css("width")),height:parseFloat(this.$imageDiv.css("height"))+36})}delayedTrigger(t){clearTimeout(this.timer),this.timer=setTimeout((()=>{const t=this.getCurrentWidgetsData();this.trigger(u.DidUpdateWidgets,t)}),s.DELAYED_TRIGGER_TIMEOUT)}clearDelayedTriggers(){clearTimeout(this.timer)}createHotspotEditor(){this.hotspotEditor=new r.HotspotEditor({el:this.$imageFrame.find("img")[0],overlay:this.$imageOverlay[0],builderCoords:this.$coords[0]}),this.hotspotEditor.renderView(),this.hotspotEditor.on(r.HotspotEditorEvents.DidCreateHotspot,(t=>n(this,void 0,void 0,(function*(){(yield this.editWidget(t))||this.hotspotEditor.deleteHotspot(t)})))),this.hotspotEditor.on(r.HotspotEditorEvents.DidSelectHotspot,(t=>{this.trigger(u.DidSelectWidget,t)})),this.hotspotEditor.on(r.HotspotEditorEvents.DidMoveHotspot,(t=>{var e;null===(e=this.widgetsMap[t.id])||void 0===e||e.move(t.coords),this.delayedTrigger(u.DidUpdateWidgets)})),this.hotspotEditor.on(r.HotspotEditorEvents.DidResizeHotspot,(t=>{var e;null===(e=this.widgetsMap[t.id])||void 0===e||e.resize(t.coords),this.delayedTrigger(u.DidUpdateWidgets)})),this.hotspotEditor.on(r.HotspotEditorEvents.WillEditHotspot,(t=>n(this,void 0,void 0,(function*(){yield this.editWidget(t)})))),this.hotspotEditor.on(r.HotspotEditorEvents.DidCopyHotspot,(t=>n(this,void 0,void 0,(function*(){this.clipboard=this.widgetsMap[t.id]})))),this.hotspotEditor.on(r.HotspotEditorEvents.DidDeleteHotspot,(t=>n(this,void 0,void 0,(function*(){this.deleteWidget(t),this.trigger(u.DidDeleteWidget,Object.assign(Object.assign({},t),{widgets:this.getWidgets(),hotspots:this.getHotspots()})),this.delayedTrigger(u.DidUpdateWidgets)})))),this.hotspotEditor.on(r.HotspotEditorEvents.DidCutHotspot,(t=>n(this,void 0,void 0,(function*(){this.clipboard=this.widgetsMap[t.id],this.clipboard&&(this.clipboard.hide(),delete this.widgetsMap[t.id],this.trigger(u.DidCutWidget,Object.assign(Object.assign({},t),{widgets:this.getWidgets(),hotspots:this.getHotspots()})),this.delayedTrigger(u.DidUpdateWidgets))})))),this.hotspotEditor.on(r.HotspotEditorEvents.DidPasteHotspot,(t=>n(this,void 0,void 0,(function*(){if(t){const e=t.origin.id,i=this.widgetsMap[e]||this.clipboard;if(i){const e=Object.assign(Object.assign({},t.clone),{name:i.getName(),kind:i.getKind(),opt:i.getOptions(),cons:i.getConstructorName()});this.createWidget(e)}this.delayedTrigger(u.DidUpdateWidgets)}}))))}selectWidget(t){this.hotspotEditor.selectHotspot(t)}deselectWidget(t){this.hotspotEditor.deselectHotspot(t)}hideCoords(){var t;null===(t=this.$coords)||void 0===t||t.css("display","none")}revealCoords(){var t;null===(t=this.$coords)||void 0===t||t.css("display","block")}hideToolbar(){var t;null===(t=this.$toolbar)||void 0===t||t.css("display","none")}revealToolbar(){var t;null===(t=this.$toolbar)||void 0===t||t.css("display","block")}hideHotspots(){var t,e;null===(t=this.$imageOverlay)||void 0===t||t.css("display","none"),null===(e=this.$imageFrame)||void 0===e||e.css("cursor","default")}revealHotspots(){var t,e;null===(t=this.$imageOverlay)||void 0===t||t.css("display","block"),null===(e=this.$imageFrame)||void 0===e||e.css("cursor","crosshair")}builderView(){this.revealView(),this.revealHotspots(),this.revealCoords(),this.revealToolbar()}simulatorView(){this.revealView(),this.hideHotspots(),this.hideCoords(),this.hideToolbar()}getCurrentPicture(){const t=this.getCurrentPictureData(),e=this.getCurrentPictureFileName();return{fileContent:t,fileName:l.getFileName(e),fileExtension:l.getFileExtension(e)}}getCurrentPictureFileName(){var t;return null===(t=this.$imageDiv)||void 0===t?void 0:t.attr(d.WebFileAttribute.pictureFile)}getCurrentPictureData(){var t;return null===(t=this.$imageDiv)||void 0===t?void 0:t.find("img").attr("src")}getCurrentPictureSize(){return{width:this.getCurrentPictureWidth(),height:this.getCurrentPictureHeight()}}getCurrentPictureWidth(){var t;return(null===(t=this.$imageFrame)||void 0===t?void 0:t.find("img")[0]).width||0}getCurrentPictureHeight(){var t;return(null===(t=this.$imageFrame)||void 0===t?void 0:t.find("img")[0]).height||0}getCurrentWidgetsData(){if(this.widgetsMap){const t=Object.keys(this.widgetsMap),e=[];for(let i=0;i<t.length;i++){const n=this.widgetsMap[t[i]].toJSON();e.push(n)}return e}return[]}createWidget(t){if(console.log("[builder] Creating widget"),t&&t.cons&&t.kind){const e=this.widgetClassMap[t.kind].find((e=>e.cons.constructorName===t.cons));if(e){this.widgetsMap[t.id]&&this.widgetsMap[t.id].remove();const i=Object.assign(Object.assign({parent:this.$imageFrame,type:t.cons},null==t?void 0:t.opt),{connection:this.connection});console.log("[builder] Loading widget constructor");const n=new e.cons(t.id,t.coords,i);n.render(),this.widgetsMap[t.id]=n;const r={id:t.id,name:t.name,widgets:this.getWidgets(),hotspots:this.getHotspots()};return console.log("[builder] Widget created",n),this.trigger(u.DidCreateWidget,r),n}}return null}deleteWidget(t){var e;null===(e=this.widgetsMap[t.id])||void 0===e||e.remove(),delete this.widgetsMap[t.id]}editWidget(t){return n(this,void 0,void 0,(function*(){if(null==t?void 0:t.id){const e=t.id,i=(null==t?void 0:t.coords)||this.hotspotEditor.getCoords(e);return new Promise(((t,n)=>{var r,s,a,l;if(e&&i){const n={id:e,coords:i,name:(null===(r=this.widgetsMap[e])||void 0===r?void 0:r.getName())||c.widgetUUID(),kind:null===(s=this.widgetsMap[e])||void 0===s?void 0:s.getKind(),opt:null===(a=this.widgetsMap[e])||void 0===a?void 0:a.getOptions(),cons:null===(l=this.widgetsMap[e])||void 0===l?void 0:l.getConstructorName()};console.log("[builder] Creating widget editor dialog");const d=new o.WidgetEditor({widgetData:n,widgetClassMap:this.widgetClassMap});d.renderView(),d.on(o.WidgetEditorEvents.ok,(e=>{const i=this.createWidget(e);this.trigger(u.DidUpdateWidgets),t(i)})),d.on(o.WidgetEditorEvents.cancel,(e=>{t(null)}))}else t(null)}))}}))}loadWidget(t){return n(this,void 0,void 0,(function*(){return console.log("[builder] Loading widget",t),(null==t?void 0:t.id)&&t.coords?this.createWidget(t):(console.warn("[builder] Warning: unable to load widget",t),null)}))}createHotspot(t){return this.hotspotEditor.createHotspot(t)}createWhiteboard(){return n(this,void 0,void 0,(function*(){const t=this.defaultPanelSize;return yield this.loadPicture({fileName:l.getFileName(d.whiteboardFile),fileExtension:l.getFileExtension(d.whiteboardFile),fileContent:a.transparentGif},Object.assign(Object.assign({},t),{border:"1px solid black",background:"white"}))}))}createImageFrameLayer(){return n(this,void 0,void 0,(function*(){const t=this.getActivePanelSize();yield this.loadPicture({fileName:"image-frame",fileExtension:".gif",fileContent:a.transparentGif},Object.assign(Object.assign({},t),{border:"1px solid black",$el:this.$imageFrame}))}))}getActivePictureSize(){const t=parseFloat($(".prototype-screens .tab-pane.active .prototype-image").css("width"))||window.innerWidth,e=parseFloat($(".prototype-screens .tab-pane.active .prototype-image").css("height"))||window.innerHeight-36;return{width:Math.min(t,d.MIN_WIDTH),height:Math.min(e,d.MIN_HEIGHT)}}getActivePanelSize(){return{width:parseFloat($(".prototype-screens").css("width"))||window.innerWidth||d.MIN_WIDTH,height:(parseFloat($(".prototype-screens .tab-pane.active").css("height"))||window.innerHeight||d.MIN_HEIGHT)-54}}loadPicture(t,e){return n(this,void 0,void 0,(function*(){if(t&&t.fileContent){const i=(e=e||{}).$el||this.$imageDiv,n=this.$imageFrame;if(t.fileContent.startsWith("data:image/")){const r=new Image;return e.width&&(r.width=e.width),e.height&&(r.height=e.height),e.border&&n.css({border:"1px solid lightgray","border-radius":"4px","box-shadow":"10px 10px 10px"}),e.background&&$(r).css({background:e.background}),r.src=t.fileContent,new Promise(((e,n)=>{r.onload=n=>{var o,a,l;const c=null===(o=null==n?void 0:n.target)||void 0===o?void 0:o.width,u=null===(a=null==n?void 0:n.target)||void 0===a?void 0:a.height,h=null===(l=null==n?void 0:n.target)||void 0===l?void 0:l.src;i.html(r);const p=t.fileName&&t.fileExtension?`${t.fileName}${t.fileExtension}`:"";i.attr(d.WebFileAttribute.pictureFile,p),this.resizePicture({width:c,height:u},{quiet:!0}),this.resizeView();const f={fileName:t.fileName,fileExtension:t.fileExtension,fileContent:h,height:u,width:c};e(f);const g={pictureFile:p,pictureWidth:c,pictureHeight:u};this.trigger(s.CentralViewEvents.DidLoadPicture,g)},r.onerror=i=>{console.warn("Failed to load picture ",t,i),e(null)}}))}}return null}))}onDidChangePicture(t){return n(this,void 0,void 0,(function*(){if(t)return $(".dropdown-menu").removeClass("show"),new Promise(((e,i)=>{var r;const s=null===(r=null==t?void 0:t.currentTarget)||void 0===r?void 0:r.files[0];if(s){const t=new FileReader;t.addEventListener("loadend",(t=>n(this,void 0,void 0,(function*(){var i;const n=null===(i=t.target.result)||void 0===i?void 0:i.toString();if($(".load-picture-form").trigger("reset"),n){const t=this.getCurrentPicture(),i={fileName:l.getFileName(s.name),fileExtension:l.getFileExtension(s.name),fileContent:n},r=yield this.loadPicture(i),o={old:t,new:i};this.trigger(u.DidChangePicture,o),e(r)}else e(null)})))),t.readAsDataURL(s)}else e(null)}))}))}installHandlers(){}}e.BuilderView=h},93:function(t,e,i){"use strict";var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.CentralView=e.DELAYED_TRIGGER_TIMEOUT=e.CentralViewEvents=void 0;const r=i(845),s=i(490);var o;(o=e.CentralViewEvents||(e.CentralViewEvents={})).DidShowView="DidShowView",o.DidHideView="DidHideView",o.DidChangePictureSize="DidChangePictureSize",o.DidLoadPicture="DidLoadPicture",e.DELAYED_TRIGGER_TIMEOUT=4e3;class a extends r.View{constructor(t,e){var i,n;super(t),this.viewOptions=t,this.connection=e,this.viewId=(null===(i=t.viewId)||void 0===i?void 0:i.replace(/[\s\.]/g,"-"))||`view-${s.uuid()}`,this.panelId=(null===(n=null==t?void 0:t.panelId)||void 0===n?void 0:n.replace(/[\s\.]/g,"-"))||"",this.$parentDiv=$(null==t?void 0:t.parentDiv)}resizeView(t){if(t){const e=t.width?parseFloat(`${t.width}`):0;e&&this.$el.css({width:e});const i=t.height?parseFloat(`${t.height}`):0;i&&this.$el.css({height:i})}}renderView(t){return n(this,void 0,void 0,(function*(){const e=Handlebars.compile('\n<div id="{{panelId}}" class="container-fluid tab-pane show no-gutters fade">\n {{content}}\n</div>',{noEscape:!0})({controlledBy:`${this.viewId}-tab`,panelId:this.panelId,content:null==t?void 0:t.content,active:null==t?void 0:t.active});return this.$el.append(e),this}))}revealView(){this.$el.find(".tab-pane").removeClass("active"),this.$el.find(`#${this.panelId}`).addClass("active")}}e.CentralView=a},676:function(t,e,i){"use strict";var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.SettingsView=e.SettingsEvents=e.PVSIOWEB_FILE_VERSION=void 0;const r=i(587),s=i(93),o=i(385);var a;e.PVSIOWEB_FILE_VERSION="3.0",function(t){t.DidUpdateSettings="DidUpdateSettings"}(a=e.SettingsEvents||(e.SettingsEvents={}));class l extends s.CentralView{constructor(t,e){super(t,e),this.ioSettings={},this.webSettings={},this.timer=null,this.updateSettings(null==t?void 0:t.settings)}updateSettings(t){if(t){if(t.io){this.ioSettings={};for(let i in r.IoFileAttribute)this.ioSettings[i]="version"!==i?t.io[i]||{id:i,value:""}:t.io[i]||e.PVSIOWEB_FILE_VERSION}if(t.web){this.webSettings={};for(let e in r.WebFileAttribute)this.webSettings[e]=t.web[e]||""}t.contextFolder&&(this.contextFolder=t.contextFolder||""),this.refreshView()}}updatePictureSize(t){t&&(t.width&&(this.webSettings.pictureWidth=t.width),t.height&&(this.webSettings.pictureHeight=t.height),this.refreshView())}refreshView(){var t;for(let e in r.IoFileAttribute){const i=(null===(t=this.ioSettings[e])||void 0===t?void 0:t.value)||"";this.$el.find(`#${e}-input`).val(i)}for(let t in r.WebFileAttribute){let e=this.webSettings[t]||"";if(t===r.WebFileAttribute.pictureHeight||t===r.WebFileAttribute.pictureWidth){const i=parseFloat(e);isNaN(i)||(e=`${parseFloat(e)}px`,this.$el.find(`#${t}-input`).val(e))}else this.$el.find(`#${t}-input`).val(e)}this.$el.find(`#${r.DataAttribute.contextFolder}-input`).val(this.contextFolder||"")}renderView(){const t=Object.create(null,{renderView:{get:()=>super.renderView}});return n(this,void 0,void 0,(function*(){const e={};e[r.DataAttribute.contextFolder]={value:this.contextFolder,label:"Context Folder",readonly:!0};for(let t in r.IoFileAttribute)e[t]=this.ioSettings[t];for(let t in r.WebFileAttribute)switch(t){case r.WebFileAttribute.pictureFile:{const i=o.compactDropdownButtonTemplate+o.pictureMenu;e[t]={value:this.webSettings[t],label:"Picture",readonly:!0,browse:i};break}case r.WebFileAttribute.pictureWidth:e[t]={value:`${this.webSettings[t]}px`,label:"Picture Width"};break;case r.WebFileAttribute.pictureHeight:e[t]={value:`${this.webSettings[t]}px`,label:"Picture Height"}}const i=Handlebars.compile('\n<style>\n.input-group-text {\n font-size: small;\n}\n</style>\n<div class="settings-view container-fluid p-0">\n <div class="card">\n \x3c!--\n <div class="card-header d-flex justify-content-between">\n <button class="btn btn-sm btn-outline-primary save">Save</button>\n </div>\n --\x3e\n <div class="card-body">\n \n{{#each settings}}\n<div id="{{@key}}" class="input-group input-group-sm mb-3 settings">\n <div class="input-group-prepend">\n <span class="input-group-text" id="{{@key}}-label" style="min-width:10em;">{{#if label}}{{label}}{{else}}{{id}}{{/if}}</span>\n </div>\n <input {{#if readonly}}disabled{{/if}} id="{{@key}}-input" key="{{@key}}" type="text" value="{{value}}" class="form-control" placeholder="{{placeholder}}" aria-label="{{#if label}}{{label}}{{else}}{{id}}{{/if}}" aria-describedby="{{@key}}-label">\n {{browse}}\n</div>\n{{/each}}\n\n </div>\n </div>\n</div>',{noEscape:!0})({settings:e});return yield t.renderView.call(this,Object.assign(Object.assign({},this.viewOptions),{content:i,label:'<i class="fa fa-cogs"></i>'})),this.$settings=this.$el.find(".settings-view"),this.installHandlers(),this}))}installHandlers(){this.$settings.find(`#${r.WebFileAttribute.pictureHeight}`).on("input",(t=>{var e;const i=parseFloat(null===(e=null==t?void 0:t.target)||void 0===e?void 0:e.value);i&&!isNaN(i)&&this.trigger(s.CentralViewEvents.DidChangePictureSize,{height:i})})),this.$settings.find(`#${r.WebFileAttribute.pictureWidth}`).on("input",(t=>{var e;const i=parseFloat(null===(e=null==t?void 0:t.target)||void 0===e?void 0:e.value);i&&!isNaN(i)&&this.trigger(s.CentralViewEvents.DidChangePictureSize,{width:i})})),this.$settings.find("input").on("input",(t=>{var i;const n=$(null==t?void 0:t.target).attr("key"),s=null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.value;if(n){if(n===r.DataAttribute.contextFolder)this.contextFolder=s;else if(n in r.WebFileAttribute)this.webSettings[n]=s;else{if(!(n in r.IoFileAttribute))return void console.warn("[settings-view] Warning, could not update setting after input",t);this.ioSettings[n]="version"!==n?this.ioSettings[n]||{id:n,value:""}:this.ioSettings[n]||e.PVSIOWEB_FILE_VERSION,this.ioSettings[n].value=s}this.delayedTrigger(a.DidUpdateSettings)}}))}delayedTrigger(t){clearTimeout(this.timer),this.timer=setTimeout((()=>{this.trigger(a.DidUpdateSettings)}),s.DELAYED_TRIGGER_TIMEOUT)}clearDelayedTriggers(){clearTimeout(this.timer)}getValue(t){var e,i;return null===(i=null===(e=this.$settings)||void 0===e?void 0:e.find(`#${t} input`))||void 0===i?void 0:i.val()}getCurrentIoSettings(){return this.ioSettings}getCurrentWebSettings(){return this.webSettings}events(){return{}}}e.SettingsView=l},248:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SideView=void 0;const n=i(845);class r extends n.View{hide(){this.$el.css({display:"none"})}reveal(){this.$el.css({display:"block"})}}e.SideView=r},347:function(t,e,i){"use strict";var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.SimulatorView=e.SimulatorEvents=void 0;const r=i(490),s=i(93);(e.SimulatorEvents||(e.SimulatorEvents={})).DidRebootPrototype="DidRebootPrototype";class o extends s.CentralView{constructor(t,e){super(t,e),this.simulatorId=r.uuid(),this.installHandlers()}importWidgets(t){this.widgets=t}renderState(t,e){return n(this,void 0,void 0,(function*(){console.log("[simulator-view] renderWidgets",this.widgets);for(let i in this.widgets)this.widgets[i].render(t,e)}))}renderView(t){return n(this,void 0,void 0,(function*(){return this}))}installHandlers(){}}e.SimulatorView=o},420:function(t,e,i){"use strict";var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.SplashScreenView=void 0;const r=i(93);class s extends r.CentralView{constructor(t,e){super(t,e)}renderView(t){const e=Object.create(null,{renderView:{get:()=>super.renderView}});return n(this,void 0,void 0,(function*(){return yield e.renderView.call(this,Object.assign(Object.assign({},this.viewOptions),{content:'\n<div class="splash-screen-view container-fluid p-0">\n <div class="card" style="height:100%;">\n <div class="card-body animated fadeIn align-self-center" style="text-align:center; padding-left:120px; margin-left:-6px;">\n <h5>Welcome to Prototype Builder!</h5>\n <br>\n <div>Define the visual appearance of your prototype</div>\n <br>\n <div>\n <form class="load-picture-form">\n <div class="custom-file">\n <input class="change-picture custom-file-input" type="file" accept="image"">\n <label class="custom-file-label">Select a Picture</label>\n </div>\n </form>\n </br>or<br><br>\n <div class="btn btn-sm btn-outline-dark remove-picture" style="width:100%">Use Whiteboard</div>\n </div>\n </div>\n </div>\n</div>'})),this}))}}e.SplashScreenView=s},100:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WidgetsListView=void 0;const n=i(403),r=i(248);class s extends r.SideView{constructor(t){super(t),this.render()}refresh(t){const e={};for(let i in t)e[i]={"widget-id":t[i].getId(),kind:t[i].getKind(),name:t[i].getName()};const i=Handlebars.compile('\n{{#each widgets}}\n<button type="button" class="py-2 btn-sm list-group-item list-group-item-action widget-list-item" widget-id="{{widget-id}}" widget-name="{{name}}">{{kind}}: {{name}}</button>\n{{/each}}\n',{noEscape:!0})({widgets:e});this.$el.html(i),this.$el.find(".widget-list-item").on("click",(t=>{const e=$(null==t?void 0:t.currentTarget).attr("widget-id");$(null==t?void 0:t.currentTarget).hasClass("active")?this.deselectWidget({id:e}):this.selectWidget({id:e})})),this.$el.find(".widget-list-item").on("dblclick",(t=>{const e=$(null==t?void 0:t.currentTarget).attr("widget-id");this.editWidget({id:e})}))}selectWidget(t){if(null==t?void 0:t.id){this.clearSelection(),this.$el.find(`[widget-id=${t.id}]`).addClass("active");const e={id:t.id};this.trigger(n.BuilderEvents.DidSelectWidget,e)}}deselectWidget(t){if(null==t?void 0:t.id){this.$el.find(`[widget-id=${t.id}]`).removeClass("active");const e={id:t.id};this.trigger(n.BuilderEvents.DidDeselectWidget,e)}}clearSelection(){this.$el.find(".widget-list-item").removeClass("active")}editWidget(t){if(t.id){this.selectWidget(t);const e={id:t.id};this.trigger(n.BuilderEvents.WillEditWidget,e)}}}e.WidgetsListView=s},998:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HotspotEditor=e.getMouseCoords=e.getCoords=e.opacity=e.zIndex=e.HotspotEditorEvents=void 0;const n=i(845),r=i(569),s=i(490);var o,a;e.HotspotEditorEvents={DidCreateHotspot:"DidCreateHotspot",DidSelectHotspot:"DidSelectHotspot",DidMoveHotspot:"DidMoveHotspot",DidResizeHotspot:"DidResizeHotspot",WillEditHotspot:"WillEditHotspot",DidCutHotspot:"DidCutHotspot",DidCopyHotspot:"DidCopyHotspot",DidPasteHotspot:"DidPasteHotspot",DidDeleteHotspot:"DidDeleteHotspot",DidClearSelection:"DidClearSelection"},function(t){t[t.BACK=100]="BACK",t[t.NORMAL=101]="NORMAL",t[t.FRONT=102]="FRONT"}(o=e.zIndex||(e.zIndex={})),function(t){t[t.TRANSPARENT=0]="TRANSPARENT",t[t.LOW=.4]="LOW",t[t.NORMAL=.6]="NORMAL",t[t.HIGH=.9]="HIGH",t[t.OPAQUE=1]="OPAQUE"}(a=e.opacity||(e.opacity={}));const l=`\n<div class="marker" coords=${JSON.stringify({top:0,left:0,width:0,height:0})} id="{{id}}" style="z-index:100; top:{{top}}px; left:{{left}}px; width:{{width}}px; height:{{height}}px; position:absolute;">\n <div class="shader" style="z-index:100; width:100%; height:100%; opacity:${a.LOW}; background:steelblue; position:absolute; border: 1px solid blue; cursor:crosshair;"></div>\n <div class="l corner" style="z-index:100; width:10px; height:100%; top:5px; left:0px; position:absolute; cursor:ew-resize; margin-left:-7px; margin-top:-5px; border: 1px solid blue; opacity:${a.TRANSPARENT};"></div>\n <div class="r corner" style="z-index:100; width:10px; height:100%; top:5px; left:100%; position:absolute; cursor:ew-resize; margin-left:-3px; margin-top:-5px; border: 1px solid blue; opacity:${a.TRANSPARENT};"></div>\n <div class="b corner" style="z-index:100; width:100%; height:10px; top:100%; left:5px; position:absolute; cursor:ns-resize; margin-left:-5px; margin-top:-2px; border: 1px solid blue; opacity:${a.TRANSPARENT};"></div>\n <div class="t corner" style="z-index:100; width:100%; height:10px; top:0px; left:5px; position:absolute; cursor:ns-resize; margin-left:-5px; margin-top:-7px; border: 1px solid blue; opacity:${a.TRANSPARENT};"></div>\n <div class="tl corner" style="z-index:100; width:10px; height:10px; top:0px; left:0px; position:absolute; cursor:nwse-resize; margin-left:-7px; margin-top:-7px; border: 1px solid blue; opacity:${a.TRANSPARENT};"></div>\n <div class="bl corner" style="z-index:100; width:10px; height:10px; top:100%; left:0px; position:absolute; cursor:nesw-resize; margin-left:-7px; margin-top:-3px; border: 1px solid blue; opacity:${a.TRANSPARENT};"></div>\n <div class="br corner" style="z-index:100; width:10px; height:10px; top:100%; left:100%; position:absolute; cursor:nwse-resize; margin-left:-3px; margin-top:-3px; border: 1px solid blue; opacity:${a.TRANSPARENT};"></div>\n <div class="tr corner" style="z-index:100; width:10px; height:10px; top:0px; left:100%; position:absolute; cursor:nesw-resize; margin-left:-3px; margin-top:-7px; border: 1px solid blue; opacity:${a.TRANSPARENT};"></div>\n</div>\n`;function c(t){return{top:+parseFloat(t.css("top")).toFixed(0),left:+parseFloat(t.css("left")).toFixed(0),width:+parseFloat(t.css("width")).toFixed(0),height:+parseFloat(t.css("height")).toFixed(0)}}function d(t,e){const i=e.offset(),n=+((null==t?void 0:t.pageY)-(null==i?void 0:i.top)).toFixed(0),r=+((null==t?void 0:t.pageX)-(null==i?void 0:i.left)).toFixed(0);return{top:n<0?0:n,left:r<0?0:r}}function u(t,e,i){const n=(i=i||{}).showSize?`(top:${e.top}, left:${e.left}, width:${e.width}, height:${e.height})`:`(top:${e.top}, left:${e.left})`;t.text(n)}e.getCoords=c,e.getMouseCoords=d;class h extends n.View{constructor(t,e){super({el:t[0]}),this.triggerEnabled=!0,this.$tooltip=null==e?void 0:e.$tooltip,this.$builderCoords=null==e?void 0:e.$builderCoords,this.triggerTimer=setInterval((()=>{this.triggerEnabled=!0}),1e3)}activate(t){return this.$marker=t.$activeMarker,this.$corner=t.$activeCorner,this.initialMarkerCoords=t.initialMarkerCoords,this.dragStartCoords=t.draftStartCoords,!0}deactivate(){this.$marker=null,this.$corner=null,this.initialMarkerCoords=null,this.dragStartCoords=null}onMouseDown(t){}onMouseMove(t){return!1}onMouseUp(t){}onResizeHotspot(t){const e=d(t,this.$el),i=e.left-this.dragStartCoords.left,n=e.top-this.dragStartCoords.top;this.$marker.find(".corner").css({display:"none"}),this.$corner.css("display","block");const r=this.$corner.hasClass("tl")?{left:this.initialMarkerCoords.left+i,top:this.initialMarkerCoords.top+n,width:this.initialMarkerCoords.width-i,height:this.initialMarkerCoords.height-n}:this.$corner.hasClass("bl")?{left:this.initialMarkerCoords.left+i,top:this.initialMarkerCoords.top,width:this.initialMarkerCoords.width-i,height:this.initialMarkerCoords.height+n}:this.$corner.hasClass("br")?{left:this.initialMarkerCoords.left,top:this.initialMarkerCoords.top,width:this.initialMarkerCoords.width+i,height:this.initialMarkerCoords.height+n}:this.$corner.hasClass("tr")?{left:this.initialMarkerCoords.left,top:this.initialMarkerCoords.top+n,width:this.initialMarkerCoords.width+i,height:this.initialMarkerCoords.height-n}:this.$corner.hasClass("l")?{left:this.initialMarkerCoords.left+i,top:this.initialMarkerCoords.top,width:this.initialMarkerCoords.width-i,height:this.initialMarkerCoords.height}:this.$corner.hasClass("r")?{left:this.initialMarkerCoords.left,top:this.initialMarkerCoords.top,width:this.initialMarkerCoords.width+i,height:this.initialMarkerCoords.height}:this.$corner.hasClass("b")?{left:this.initialMarkerCoords.left,top:this.initialMarkerCoords.top,width:this.initialMarkerCoords.width,height:this.initialMarkerCoords.height+n}:this.$corner.hasClass("t")?{left:this.initialMarkerCoords.left,top:this.initialMarkerCoords.top+n,width:this.initialMarkerCoords.width,height:this.initialMarkerCoords.height-n}:this.initialMarkerCoords;return this.resizeHotspot(r),r}resizeHotspot(t,e){if(t){const i={};t.left&&(i.left=`${parseFloat(`${t.left}`)}px`),t.top&&(i.top=`${parseFloat(`${t.top}`)}px`),t.width&&(i.width=`${parseFloat(`${t.width}`)}px`),t.height&&(i.height=`${parseFloat(`${t.height}`)}px`),((null==e?void 0:e.$activeMarker)||this.$marker).css(i)}}hideTooltip(){this.$tooltip.css({display:"none"})}showCoords(t,e){u(this.$builderCoords,t,e)}}class p extends h{onMouseDown(t){this.dragStartCoords=d(t,this.$el),this.initialMarkerCoords=c(this.$marker)}onMouseMove(t){if(this.dragStartCoords){const i=this.onResizeHotspot(t),n={id:this.$marker.attr("id"),coords:i};this.trigger(e.HotspotEditorEvents.DidResizeHotspot,n);const r=d(t,this.$el);return this.showCoords(Object.assign(Object.assign({},r),{width:+i.width.toFixed(0),height:+i.height.toFixed(0)}),{showSize:!0}),!0}return!1}onMouseUp(t){if(this.dragStartCoords){const i=this.onResizeHotspot(t);this.dragStartCoords=null,this.$marker.attr("coords",JSON.stringify(i)),this.$marker.find(".shader").css({cursor:"default"});const n={id:this.$marker.attr("id"),coords:i};this.trigger(e.HotspotEditorEvents.DidResizeHotspot,n)}this.$marker.find(".corner").css({display:"block"}),this.hideTooltip()}}class f extends h{onMouseDown(t){this.dragStartCoords=d(t,this.$el),this.initialMarkerCoords=c(this.$marker),this.$marker.find(".shader").css({cursor:"move"})}onMouseMove(t){if(this.dragStartCoords){const i=d(t,this.$el),n={left:i.left-this.dragStartCoords.left,top:i.top-this.dragStartCoords.top};this.$marker.css({left:this.initialMarkerCoords.left+n.left,top:this.initialMarkerCoords.top+n.top});const r={left:parseFloat(this.$marker.css("left")),top:parseFloat(this.$marker.css("top"))},s={id:this.$marker.attr("id"),coords:r};return this.trigger(e.HotspotEditorEvents.DidMoveHotspot,s),!0}return!1}onMouseUp(t){if(this.dragStartCoords){const i=d(t,this.$el),n={left:i.left-this.dragStartCoords.left,top:i.top-this.dragStartCoords.top};this.dragStartCoords=null;const r=this.$marker.attr("id");this.$marker.find(".shader").css({cursor:"default"}),this.$marker.css({left:this.initialMarkerCoords.left+n.left,top:this.initialMarkerCoords.top+n.top});const s={left:+parseFloat(this.$marker.css("left")).toFixed(0),top:+parseFloat(this.$marker.css("top")).toFixed(0),width:+parseFloat(this.$marker.css("width")).toFixed(0),height:+parseFloat(this.$marker.css("height")).toFixed(0)},o={id:r,coords:s};0===n.left&&0===n.top?this.trigger(e.HotspotEditorEvents.DidSelectHotspot,o):(this.$marker.attr("coords",JSON.stringify(s)),this.trigger(e.HotspotEditorEvents.DidMoveHotspot,o))}}}class g extends n.View{constructor(t){super(t),this.mode=null,this.dblClick=0,this.hotspots={},this.data=t}renderView(){this.$overlay=$(this.data.overlay),this.createHtmlContent(this.data),this.$tooltip=this.$overlay.find(".marker-tooltip"),this.$builderCoords=$(this.data.builderCoords),this.moveHandler=new f(this.$el,{$tooltip:this.$tooltip,$builderCoords:this.$builderCoords}),this.resizeHandler=new p(this.$el,{$tooltip:this.$tooltip,$builderCoords:this.$builderCoords}),this.moveHandler.on(e.HotspotEditorEvents.DidMoveHotspot,(t=>{this.selectHotspot(t),this.trigger(e.HotspotEditorEvents.DidSelectHotspot,t),this.trigger(e.HotspotEditorEvents.DidMoveHotspot,t)})),this.moveHandler.on(e.HotspotEditorEvents.DidSelectHotspot,(t=>{this.selectHotspot(t),this.trigger(e.HotspotEditorEvents.DidSelectHotspot,t)})),this.resizeHandler.on(e.HotspotEditorEvents.DidResizeHotspot,(t=>{this.selectHotspot(t),this.trigger(e.HotspotEditorEvents.DidSelectHotspot,t),this.trigger(e.HotspotEditorEvents.DidResizeHotspot,t)})),$(window).on("keydown",(t=>{this.onKeyDown(t)}))}getHotspots(){return this.hotspots}getHotspot(t){var e;return null===(e=this.hotspots[t])||void 0===e?void 0:e.$marker}getSelectedHotspot(){const t=this.$overlay.find(".marker.selected").attr("id");return this.getHotspot(t)}getCoords(t){var e;const i=(null===(e=this.hotspots[t])||void 0===e?void 0:e.$marker.attr("coords"))||null;return JSON.parse(i)}createHtmlContent(t){t=t||this.data;const e=Handlebars.compile('\n<style>\n.marker.selected {\n border: 2px solid yellow;\n margin-top: 1px;\n margin-left: 1px;\n}\n</style>\n<div class="marker-tooltip noselect" style="display:none; z-index:100; position:absolute; background-color:white; color:black; opacity:0.8; padding:2px 8px; border-radius:8px;">\n <div class="marker-tooltip-label" style="display:block; z-index:100;"></div>\n</div>\n<div class="marker-areas" style="position:absolute; top:0px; left:0px; display:block; z-index:100; opacity:0.9; background-color:green;"></div>\n')({}),i=(null==t?void 0:t.overlay)||$("body")[0];return $(i).append(e),this.$el.attr("draggable","false"),this.$el.on("contextmenu",(t=>{var e,i,n;const r=d(t,$("body")),s=d(t,this.$el);s.height=parseFloat(`${null===(e=this.clipboard)||void 0===e?void 0:e.coords.height}`),s.width=parseFloat(`${null===(i=this.clipboard)||void 0===i?void 0:i.coords.width}`);const o={id:null===(n=this.clipboard)||void 0===n?void 0:n.id,coords:s};this.openContextMenu(r,o,{edit:!1,delete:!1,cut:!1,copy:!1}),t.preventDefault()})),this}getMarkersLayer(){return this.$overlay.find(".marker-areas")}events(){return{mouseover:"onMouseOver",mousemove:"onMouseMove",mousedown:"onMouseDown",mouseout:"onMouseOut",mouseup:"onMouseUp",scroll:"onScroll"}}showCoords(t,e){u(this.$builderCoords,t,e)}mouseEventHandler(t){var e,i,n,r,o,a;const c=d(t,this.$el);this.anchorCoords=this.anchorCoords||c;const u=Math.abs((null===(e=this.anchorCoords)||void 0===e?void 0:e.left)-(null==c?void 0:c.left)),h=Math.abs((null===(i=this.anchorCoords)||void 0===i?void 0:i.top)-(null==c?void 0:c.top));if(!this.$marker){const t=`hotspot_${s.widgetUUID()}`,e=Handlebars.compile(l)({id:t,top:c.top,left:c.left,width:u,height:h});this.getMarkersLayer().append(e),this.$marker=this.getMarkersLayer().find(`#${t}`),null===(n=this.$marker)||void 0===n||n.find(".shader").on("mousemove",(t=>{this.onMouseMove(t)})),null===(r=this.$marker)||void 0===r||r.find(".shader").on("mouseup",(t=>{this.onMouseUp(t)}))}this.$marker.css({width:u,height:h}),this.$marker.find(".corner").css({display:"none"}),(null==c?void 0:c.left)<(null===(o=this.anchorCoords)||void 0===o?void 0:o.left)&&this.$marker.css({left:c.left}),(null==c?void 0:c.top)<(null===(a=this.anchorCoords)||void 0===a?void 0:a.top)&&this.$marker.css({top:c.top}),this.showCoords(Object.assign(Object.assign({},c),{width:+u.toFixed(0),height:+h.toFixed(0)}),{showSize:!0})}showTooltip(t,e){this.$tooltip.css({display:"block",top:`${t.top+20}px`,left:`${t.left+20}px`,background:"black",color:"white"}),this.$tooltip.find(".marker-tooltip-label").html(e)}hideTooltip(){this.$tooltip.css({display:"none"})}onKeyDown(t){var e;switch(t.key){case"Escape":switch(this.closeContextMenu(),this.mode){case"move":case"resize":break;default:null===(e=this.$marker)||void 0===e||e.remove(),this.$marker=null,this.anchorCoords=null,this.hideTooltip()}this.mode=null,this.showCorners(),this.enableShaderPointer()}}showCorners(){var t;null===(t=this.$overlay)||void 0===t||t.find(".corner").css({display:"block"})}hideCorners(){var t;null===(t=this.$overlay)||void 0===t||t.find(".corner").css({display:"none"})}disableShaderPointer(){var t;null===(t=this.$overlay)||void 0===t||t.find(".shader").css({cursor:"crosshair"})}enableShaderPointer(){var t;null===(t=this.$overlay)||void 0===t||t.find(".shader").css({cursor:"default"})}onScroll(t){t.preventDefault()}onMouseOut(t){t.preventDefault(),this.hideTooltip()}onMouseOver(t){switch(this.mode){case"move":case"resize":break;default:if(this.anchorCoords)this.mouseEventHandler(t);else{const e=d(t,this.$el);this.showCoords(e)}}}isDoubleClick(){return this.dblClick++,setTimeout((()=>{this.dblClick=0}),r.DBLCLICK_TIMEOUT),this.dblClick>1}closeContextMenu(){r.deleteContextMenu()}openContextMenu(t,i,n){n=Object.assign({edit:!!(null==i?void 0:i.id),cut:!!(null==i?void 0:i.id),copy:!!(null==i?void 0:i.id),paste:!!this.clipboard,delete:!!(null==i?void 0:i.id)},n);const s=r.createMenu({top:+parseFloat(`${t.top}`),left:+parseFloat(`${t.left}`),items:[{name:"Edit",disabled:!n.edit,icon:`<i class="fa fa-edit" style="${n.edit?`color:${r.colors.blue};`:""}padding-right:20px;"></i>`},"------",{name:"Cut",disabled:!n.cut,icon:`<i class="fa fa-cut" style="${n.cut?`color:${r.colors.blue};`:""}padding-right:20px;"></i>`},{name:"Copy",disabled:!n.copy,icon:`<i class="fa fa-copy" style="${n.copy?`color:${r.colors.blue};`:""}padding-right:20px;"></i>`},{name:"Paste",disabled:!n.paste,icon:`<i class="fa fa-paste" style="${n.paste?`color:${r.colors.blue};`:""}padding-right:20px;"></i>`},"------",{name:"Delete",disabled:!n.delete,icon:`<i class="fa fa-trash" style="${n.delete?`color:${r.colors.blue};`:""}padding-right:20px;"></i>`}]}).find(".dropdown-item");for(let t=0;t<s.length;t++)$(s[t]).on("click",(t=>{jQuery(null==t?void 0:t.currentTarget).addClass("active");const n=jQuery(null==t?void 0:t.currentTarget).attr("action"),r=null==i?void 0:i.id;let s=this.getCoords(r);switch(n){case"Edit":this.trigger(e.HotspotEditorEvents.WillEditHotspot,{id:r,coords:s});break;case"Cut":this.cutHotspot({id:r,coords:s}),this.trigger(e.HotspotEditorEvents.DidCutHotspot,{id:r,coords:s});break;case"Copy":this.copyHotspot({id:r,coords:s}),this.trigger(e.HotspotEditorEvents.DidCopyHotspot,{id:r,coords:s});break;case"Paste":{const t=this.pasteHotspot(i);this.trigger(e.HotspotEditorEvents.DidPasteHotspot,{origin:i,clone:t});break}case"Delete":this.deleteHotspot({id:r}),this.trigger(e.HotspotEditorEvents.DidDeleteHotspot,{id:r,coords:s})}this.closeContextMenu()}))}createHotspot(t,i){const n=(null==i?void 0:i.useFreshId)?`hotspot_${s.widgetUUID()}`:null==t?void 0:t.id,a=Object.assign(Object.assign({},t),{id:n});let c=this.getMarkersLayer().find(`#${n}`)||this.$marker;if(!c[0]){const t=Handlebars.compile(l)({id:n});this.getMarkersLayer().append(t),c=this.getMarkersLayer().find(`#${n}`),this.resizeHandler.resizeHotspot(a.coords,{$activeMarker:c})}c.attr("coords",JSON.stringify(a.coords));const u=c.find(".shader"),h=[c.find(".tl"),c.find(".bl"),c.find(".br"),c.find(".tr"),c.find(".l"),c.find(".r"),c.find(".b"),c.find(".t")];c.find(".corner").css({display:"block"}),c.css("z-index",o.FRONT),u.on("mouseover",(t=>{null===this.mode&&this.highlightHotspot({id:n})})).on("mouseout",(t=>{null===this.mode&&this.clearHighlight()})).on("mousedown",(t=>{if(this.closeContextMenu(),null===this.mode)switch(t.button){case r.mouseButtons.middle:case r.mouseButtons.right:break;case r.mouseButtons.left:default:this.mode="move",this.moveHandler.activate({$activeMarker:c}),this.moveHandler.onMouseDown(t)}})).on("mousemove",(t=>{const e=d(t,this.$el);switch(this.mode){case"move":this.showCoords(e),this.moveHandler.onMouseMove(t);break;case"resize":this.showCoords(e),this.resizeHandler.onMouseMove(t)}})).on("mouseup",(t=>{if(this.enableShaderPointer(),this.isDoubleClick()){const t=c.attr("id"),i={id:t,coords:this.getCoords(t)};this.trigger(e.HotspotEditorEvents.WillEditHotspot,i)}else switch(this.mode){case"move":{const e=d(t,this.$el);this.showCoords(e),this.moveHandler.onMouseUp(t);break}case"resize":{const e=d(t,this.$el);this.showCoords(e),this.resizeHandler.onMouseUp(t);break}}this.mode=null})).on("contextmenu",(t=>{const e=d(t,$("body"));this.openContextMenu(e,a),t.preventDefault()}));for(let t in h){const e=h[t];e.on("mouseover",(t=>{null===this.mode&&this.highlightHotspot({id:n})})).on("mouseout",(t=>{null===this.mode&&this.clearHighlight()})).on("mousedown",(t=>{this.closeContextMenu(),null===this.mode&&(this.mode="resize",this.resizeHandler.activate({$activeMarker:c,$activeCorner:e}),this.resizeHandler.onMouseDown(t),this.selectHotspot({id:n}))})).on("mousemove",(t=>{const e=d(t,this.$el);switch(this.mode){case"move":this.showCoords(e),this.moveHandler.onMouseMove(t);break;case"resize":this.showCoords(e),this.resizeHandler.onMouseMove(t)}})).on("mouseup",(t=>{switch(this.mode){case"move":{const e=d(t,this.$el);this.showCoords(e),this.moveHandler.onMouseUp(t);break}case"resize":{const e=d(t,this.$el);this.showCoords(e),this.resizeHandler.onMouseUp(t);break}}this.resizeHandler.deactivate(),this.mode=null;const e=d(t,this.$el);this.showCoords(e)}))}return this.hotspots[n]={$marker:c},a}onMouseUp(t){switch(this.mode){case"move":this.moveHandler.onMouseUp(t);break;case"resize":this.resizeHandler.onMouseUp(t);break;case"create":default:if(this.showCorners(),this.$marker){const i=parseFloat(this.$marker.css("width")),n=parseFloat(this.$marker.css("height"));if(n<g.MIN_HEIGHT&&i<g.MIN_WIDTH)this.$marker.remove();else{const r=this.$marker.attr("id"),s=d(t,this.$el),o={id:r,coords:{top:this.anchorCoords.top<s.top?this.anchorCoords.top:s.top,left:this.anchorCoords.left<s.left?this.anchorCoords.left:s.left,width:i,height:n}};this.createHotspot(o),this.trigger(e.HotspotEditorEvents.DidCreateHotspot,o)}this.$marker=null}this.anchorCoords=null,this.mode=null}}onMouseDown(t){switch(this.closeContextMenu(),this.mode){case"move":this.moveHandler.onMouseDown(t);break;case"resize":this.resizeHandler.onMouseDown(t);break;default:t.button===r.mouseButtons.right||(this.hideCorners(),this.disableShaderPointer(),this.mouseEventHandler(t))}}onMouseMove(t){switch(t.preventDefault(),this.mode){case"move":this.moveHandler.onMouseMove(t)||(this.mode=null);break;case"resize":this.resizeHandler.onMouseMove(t)||(this.mode=null);break;default:if(this.anchorCoords)this.mouseEventHandler(t);else{const e=d(t,this.$el);this.showCoords(e)}}}selectHotspot(t){(null==t?void 0:t.id)&&(this.clearSelection(),this.$overlay.find(`#${t.id}`).addClass("selected"),this.highlightHotspot(t))}deselectHotspot(t){(null==t?void 0:t.id)&&(this.$overlay.find(`#${t.id}`).removeClass("selected"),this.highlightHotspot(t))}clearSelection(){this.clearHighlight(),this.$overlay.find(".marker").removeClass("selected"),this.trigger(e.HotspotEditorEvents.DidClearSelection)}highlightHotspot(t){if(null==t?void 0:t.id){const e=this.$overlay.find(`#${t.id}`),i=e.hasClass("selected")?"yellow":r.colors.blue;this.clearHighlight(),e.css("z-index",o.FRONT),e.find(".shader").css({border:`1px solid ${i}`}),e.find(".corner").css({border:`1px solid ${r.colors.blue}`}),e.css({"box-shadow":`${i} 0px 0px 8px`})}}clearHighlight(){$(".marker").css({"z-index":o.NORMAL}),this.$overlay.find(".shader").css({border:"1px solid gray"}),this.$overlay.find(".corner").css({border:"1px solid gray"}),this.$overlay.find(".marker").css({"box-shadow":`${r.colors.blue} 0px 0px 0px`}),this.$overlay.find(".marker.selected .shader").css({border:`1px solid ${r.colors.blue}`}),this.$overlay.find(".marker.selected .corner").css({border:`1px solid ${r.colors.blue}`}),this.$overlay.find(".marker.selected").css({"box-shadow":`${r.colors.blue} 0px 0px 8px`})}copyHotspot(t){t&&(this.clipboard=t)}cutHotspot(t){t&&(this.clipboard=t,this.deleteHotspot(t))}pasteHotspot(t){return this.createHotspot(t,{useFreshId:!0})}deleteHotspot(t){(null==t?void 0:t.id)&&this.$overlay.find(`#${t.id}`).remove()}}e.HotspotEditor=g,g.MIN_WIDTH=10,g.MIN_HEIGHT=10},946:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WidgetEditor=e.WidgetEditorEvents=void 0;const n=i(845),r=i(717),s=i(569),o=i(490);e.WidgetEditorEvents={ok:"ok",cancel:"cancel"};class a extends n.View{constructor(t){super(t),this.editorId=o.widgetUUID(),this.samples={},this.widgetData=null==t?void 0:t.widgetData,this.widgetClassMap=(null==t?void 0:t.widgetClassMap)||{},this.mode="create"}renderView(){this.createHtmlContent(),this.installHandlers()}safeString(t){return(null==t?void 0:t.replace(/[\.\s]/g,"-"))||""}selectTab(t){return!(!t||!t.kind||($(".widget-class").removeClass("active"),$(`#${t.kind}-tab`).addClass("active"),$(".widget-info").removeClass("active show"),$(`#${t.kind}`).addClass("active show"),t.cons&&$(`#${t.kind}-carousel .carousel-indicators li[cons='${t.cons}']`).trigger("click"),0))}createHtmlContent(){var t,e,i,n,a,l,c,d;const u={editorId:this.editorId,widgets:this.widgetClassMap,id:null===(t=this.widgetData)||void 0===t?void 0:t.id,coords:null===(e=this.widgetData)||void 0===e?void 0:e.coords},h=Handlebars.compile('\n<style>\n.widget-class {\n white-space:nowrap;\n}\n.widget-lib {\n margin-left: 0px;\n width: 100%;\n}\n.spinner-left {\n position:absolute;\n left:-160px; \n background:gainsboro; \n border-radius:4px; \n padding-bottom:22px;\n width:140px;\n}\n</style>\n<div id="editorId" class="card">\n <div class="card-header spinner-left px-1">\n <ul class="nav flex-column flex-nowrap nav-pills card-header-tabs widget-lib" style="overflow-y:auto; overflow-x:hidden; max-height:408px;">\n {{#each widgets as |item kind|}}\n <li class="nav-item">\n <a draggable="false" kind="{{kind}}" class="widget-class nav-link{{#if @first}} active{{/if}}" id="{{@key}}-tab" data-toggle="tab" href="#{{@key}}" role="tab" aria-controls="{{@key}}" aria-selected="true">{{@key}}</a>\n </li>\n {{/each}}\n </ul>\n </div>\n <style>\n .carousel-indicators li {\n background-color: #999;\n background-color: rgba(70, 70, 70, 0.25);\n }\n .carousel-indicators .active {\n background-color: #444;\n }\n .carousel-indicators {\n position: relative;\n min-width:290px;\n }\n .carousel-inner {\n min-width: 362px;\n margin: 20px 0;\n }\n .widget-attributes {\n margin-top:42px;\n min-width: 362px;\n }\n .widget-editor-card {\n height:400px;\n padding-top:0px;\n overflow:auto;\n }\n .widget-info {\n position:relative;\n overflow:auto;\n }\n </style>\n <div class="widget-editor-card card-body tab-content">\n {{#each widgets as |item kind|}}\n <div id="{{kind}}" class="widget-info p-0 modal-body container-fluid tab-pane fade show no-gutters{{#if @first}} active{{/if}}" aria-labelledby="{{kind}}-tab">\n <div class="row">\n <div id="{{kind}}-carousel" class="carousel slide col-md-6" data-interval="false">\n \x3c!-- carousel indicators --\x3e\n <ol class="carousel-indicators mx-0">\n {{#each this}}\n <li data-target="#{{kind}}-carousel" kind="{{kind}}" cons="{{cons.constructorName}}" data-slide-to="{{@index}}" {{#if @first}}class="active"{{/if}}></li>\n {{/each}}\n </ol>\n <div class="carousel-inner">\n \x3c!-- carousel screen shows available widgets --\x3e\n {{#each this}}\n <div class="carousel-item {{#if @first}}active{{/if}}">\n <div style="width:60%; margin-left:20%;">\n\n \x3c!-- {{cons.constructorName}}-preview --\x3e\n <div id="{{cons.constructorName}}-preview" class="widget-preview" style="min-width:200px; height:31px; position:relative; box-shadow:0px 0px 10px #666;">\n </div>\n\n \x3c!-- {{cons.constructorName}}-events --\x3e\n <div id="{{cons.constructorName}}-evts" class="text-muted" style="min-width:200px; height:60px; overflow:auto; margin-top:8px;">\n </div>\n\n \x3c!-- {{cons.constructorName}}-description --\x3e\n <h5>{{this.label}}</h5>\n <small id="{{cons.constructorName}}-desc" class="text-muted carousel-description">\n </small>\n </div>\n </div>\n {{/each}}\n \x3c!-- carousel controls --\x3e\n <div class="btn btn-dark carousel-control carousel-control-prev" kind="{{kind}}" href="#{{kind}}-carousel" role="button" data-slide="prev" style="height:31px">\n <span class="carousel-control-prev-icon" aria-hidden="true"></span>\n <span class="sr-only">Previous</span>\n </div>\n <div class="btn btn-dark carousel-control carousel-control-next" kind="{{kind}}" href="#{{kind}}-carousel" role="button" data-slide="next" style="height:31px">\n <span class="carousel-control-next-icon" aria-hidden="true"></span>\n <span class="sr-only">Next</span>\n </div>\n </div>\n </div>\n\n {{#each this}}\n <div id="{{kind}}-{{cons.constructorName}}" class="widget-attributes col-md-6 ml-auto" style="height:400px; overflow:auto; display:{{#if @first}}block{{else}}none{{/if}};">\n <div class="widget-id input-group input-group-sm" style="display:none;">\n <div class="input-group-prepend" style="min-width:40%;">\n <span class="input-group-text" style="width:100%;">ID</span>\n </div>\n <input type="text" class="form-control" value="{{../../id}}" placeholder="{{../../id}}" aria-label="{{../../id}}" aria-describedby="{{cons.constructorName}}-id">\n <br>\n </div>\n \n <div id="{{cons.constructorName}}-attr" class="widget-attr">\n \x3c!-- {{cons.constructorName}}-attributes --\x3e\n </div>\n \n <div id="{{cons.constructorName}}-coords" class="widget-coords" style="display:none;">\n <br>\n {{#each ../../coords}}\n <div class="input-group input-group-sm">\n <div class="input-group-prepend" style="min-width:40%;">\n <span class="input-group-text" id="{{@key}}-label" style="width:100%;">{{@key}}</span>\n </div>\n <input type="text" class="form-control" name="{{@key}}" value="{{this}}px" placeholder="{{this}}px" aria-label="{{this}}" aria-describedby="{{@key}}-label">\n </div>\n {{/each}}\n </div>\n <br>\n <div id="{{cons.constructorName}}-viz" style="display:none;" class="widget-viz"></div>\n <br>\n <div id="{{cons.constructorName}}-css" class="widget-css"></div>\n </div>\n {{/each}}\n </div>\n </div>\n {{/each}}\n </div>\n</div>')(u);this.$dialog=s.createDialog({content:h,largeModal:!0}),s.setDialogTitle("Edit Widget");const p=+parseFloat($(".widget-preview").css("width")).toFixed(0),f=+parseFloat($(".widget-preview").css("height")).toFixed(0);for(let t in this.widgetClassMap){const e=this.widgetClassMap[t];for(let t=0;t<e.length;t++)if(console.log("[widget-editor] loading widget",null===(i=e[t].cons)||void 0===i?void 0:i.constructorName,null===(n=e[t].cons)||void 0===n?void 0:n.constructorName),null===(a=e[t].cons)||void 0===a?void 0:a.constructorName){const i=e[t].cons.constructorName,n={width:p,height:f},s=o.widgetUUID(),a=Object.assign(Object.assign({},null===(l=this.widgetData)||void 0===l?void 0:l.opt),{parent:`${i}-preview`}),c=new e[t].cons(s,n,a);c.setName(this.widgetData.name),this.samples[i]=c;const d=c.getCSSx(),u=Handlebars.compile('\n{{#each style}}\n<div class="input-group input-group-sm">\n <div class="input-group-prepend" style="min-width:40%;">\n <span class="input-group-text" id="{{key}}-label" style="width:100%;">{{key}}</span>\n </div>\n <input type="text" {{#if hints}}list="{{key}}-hints"{{/if}} class="form-control" name="{{key}}" value="{{value}}" placeholder="" aria-label="{{value}}" aria-describedby="{{key}}-label">\n {{#if hints}}\n <datalist id="{{key}}-hints">\n {{#each hints}}\n <option value="{{this}}">\n {{/each}}\n </datalist>\n {{/if}}\n</div>\n{{/each}}')({style:d});$(`#${i}-css`).html(u),$(`#${i}-css input`).on("input",(t=>{var e,i;const n=null===(e=t.currentTarget)||void 0===e?void 0:e.name;if(n){const e=null===(i=t.currentTarget)||void 0===i?void 0:i.value;this.updateInput(n,e);const r={};r[n]=e,c.updateCSS(r),c.renderSample()}}));let h=c.getViz();const g=Handlebars.compile('\n{{#each viz}}\n<div class="input-group input-group-sm">\n <div class="input-group-prepend" style="min-width:40%;">\n <span class="input-group-text" id="{{@key}}-when" style="width:100%;">{{@key}} when...</span>\n </div>\n <input type="text" class="form-control" name="{{@key}}" value="{{this}}" aria-label="{{this}}" aria-describedby="{{@key}}-when">\n</div>\n{{/each}}')({viz:h});$(`#${i}-viz`).html(g),$(`#${i}-viz input`).on("input",(t=>{var e,i;const n=null===(e=t.currentTarget)||void 0===e?void 0:e.name;if(n){const e=null===(i=t.currentTarget)||void 0===i?void 0:i.value;this.updateInput(n,e)}}));const v=Handlebars.compile('\n{{#each attr}}\n<div class="input-group input-group-sm">\n <div class="input-group-prepend" style="min-width:40%;">\n <span class="input-group-text" id="{{@key}}-attr" style="width:100%;">{{@key}}</span>\n </div>\n <input type="text" class="form-control" name="{{@key}}" list="{{@key}}-hints" value="{{val}}" aria-label="{{@key}}" aria-describedby="{{@key}}-attr">\n <datalist id="{{@key}}-hints">\n {{#each hints}}\n <option value="{{this}}">\n {{/each}}\n </datalist>\n</div>\n{{/each}}')({attr:c.getAttrX({keyCode:!1})});$(`#${i}-attr`).html(v),$(`#${i}-attr input`).on("input",(t=>{var e,i;const n=null===(e=t.currentTarget)||void 0===e?void 0:e.value,r=null===(i=t.currentTarget)||void 0===i?void 0:i.name;let s={};r&&(this.updateInput(r,n),"keyCode"!==r&&(s[r]=n,c.setAttr(s),c.renderSample()))}));for(let t in r.WidgetEvent)this.listenTo(c,t,(t=>{var e;const n=null===(e=null==t?void 0:t.fun)||void 0===e?void 0:e.replace(s,this.widgetData.id);$(`#${i}-evts`).append(`<div><i class="fa fa-bolt"></i> ${n}</div>`),clearTimeout(this.timer),this.timer=setTimeout((()=>{$(`#${i}-evts`).html(""),this.timer=null}),1200)}));$(`#${i}-desc`).html(c.getDescription()),c.renderSample()}}return $(".carousel-control").on("click",(t=>{var e,i,n,r,s,o,a;const l=$(t.currentTarget).attr("kind");if(l){const c=$(`#${l}-carousel li.active`).attr("data-slide-to");if(c&&+c<(null===(e=this.widgetClassMap[l])||void 0===e?void 0:e.length)){const e=+c,d=$(null==t?void 0:t.currentTarget).hasClass("carousel-control-next")?(e+1)%(null===(i=this.widgetClassMap[l])||void 0===i?void 0:i.length):Math.abs((e-1)%(null===(n=this.widgetClassMap[l])||void 0===n?void 0:n.length)),u=null===(s=null===(r=this.widgetClassMap[l][e])||void 0===r?void 0:r.cons)||void 0===s?void 0:s.constructorName,h=null===(a=null===(o=this.widgetClassMap[l][d])||void 0===o?void 0:o.cons)||void 0===a?void 0:a.constructorName;$(`#${l}-${u}`).css({display:"none"}),$(`#${l}-${h}`).css({display:"block"})}}else console.warn("[widget-editor] Warning: carousel control disconnected",null==t?void 0:t.currentTarget)})),$(".carousel-indicators li").on("click",(t=>{var e,i,n,r,s,o;const a=$(t.currentTarget).attr("kind");if(a){const l=$(`#${a}-carousel li.active`).attr("data-slide-to"),c=$(t.currentTarget).attr("data-slide-to");if(l&&c&&+l<(null===(e=this.widgetClassMap[a])||void 0===e?void 0:e.length)&&+c<(null===(i=this.widgetClassMap[a])||void 0===i?void 0:i.length)){const t=+l,e=+c,i=null===(r=null===(n=this.widgetClassMap[a][t])||void 0===n?void 0:n.cons)||void 0===r?void 0:r.constructorName,d=null===(o=null===(s=this.widgetClassMap[a][e])||void 0===s?void 0:s.cons)||void 0===o?void 0:o.constructorName;$(`#${a}-${i}`).css({display:"none"}),$(`#${a}-${d}`).css({display:"block"})}}else console.warn("[widget-editor] Warning: carousel control disconnected",null==t?void 0:t.currentTarget)})),this.selectTab({kind:null===(c=this.widgetData)||void 0===c?void 0:c.kind,cons:null===(d=this.widgetData)||void 0===d?void 0:d.cons}),this}setWidgetId(t){this.widgetData.id=t,this.$dialog.find(".widget-id input").val(t),this.updateDialogTitle()}updateDialogTitle(){s.setDialogTitle("Editing "+this.widgetData.id)}updateInput(t,e){t&&this.$dialog.find(`input[name=${t}]`).attr("value",e)}getDialogElement(t){const e=this.$dialog.find(`.active :visible .widget-${t} input`);let i={};for(let t=0;t<e.length;t++){const n=e[t].getAttribute("name");if(n){const r=e[t].getAttribute("value");i[n]=r}}return i}getCurrentCoords(){const t=this.getDialogElement("coords"),e={};for(let i in t)e[i]=parseFloat(t[i]);return e}getCurrentWidgetKind(){return this.$dialog.find(".widget-class.active").attr("kind")}getCurrentCSS(){return this.getDialogElement("css")}getCurrentAttr(){return this.getDialogElement("attr")}getCurrentViz(){return this.getDialogElement("viz")}getCurrentWidgetId(){return this.$dialog.find(".widget-id input").attr("value")}getCurrentWidgetCons(){const t=this.getCurrentWidgetKind();return $(`#${t}-carousel`).find(".carousel-indicators li.active").attr("cons")}getCurrentWidgetName(){const t=this.getCurrentAttr(),e=Object.keys(t);return e&&e.length?t[e[0]]:""}installHandlers(){this.$dialog.find(".ok-btn").on("click",(t=>{this.widgetData={cons:this.getCurrentWidgetCons(),name:this.getCurrentWidgetName(),kind:this.getCurrentWidgetKind(),id:this.getCurrentWidgetId(),coords:this.getCurrentCoords(),opt:Object.assign({css:this.getCurrentCSS(),viz:this.getCurrentViz()},this.getCurrentAttr())},this.trigger(e.WidgetEditorEvents.ok,this.widgetData),this.$dialog.remove()})),this.$dialog.find(".cancel-btn").on("click",(t=>{this.trigger(e.WidgetEditorEvents.cancel,this.widgetData),this.$dialog.remove()})),this.$dialog.find(".widget-id").on("input",(t=>{var e;const i=null===(e=t.currentTarget)||void 0===e?void 0:e.value;this.setWidgetId(i)}))}}e.WidgetEditor=a},647:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BasicDisplayEVO=void 0;const n=i(717);class r extends n.WidgetEVO{constructor(t,e,i){super(t,e,i),this.kind="Display",(i=i||{}).css=i.css||{},this.css.background=i.css.background||i.css["background-color"]||"black",this.css.color=i.css.color||"white",this.css.cursor=i.css.cursor||"default",this.css.overflow=i.css.overflow||"hidden",this.attr.displayName=i.displayName||t}getConstructorName(){return r.constructorName}getDescription(){return"Suitable for rendering text and numbers."}renderSample(){let t={};t[this.attr.displayName]="ABC12",this.render(JSON.stringify(t))}render(t,e){if(e=e||{},super.render(),this.updateDisplayStyle(e.css),this.reveal(),null!=t)if(this.matchStateFlag){const e=this.getName(),i="string"==typeof t?this.matchState(t,e):{name:e,val:t[e]};if(i)if(new RegExp(n.ratNumberMatch).exec(i.val)){const t=n.rat2real(i.val),e=isNaN(t)?`${i.val}`:`${t}`;this.$base.html(e)}else this.$base.html(i.val)}else this.$base.html(`${t}`)}updateDisplayStyle(t){t=t||{},this.applyCSS(Object.assign(Object.assign({},this.css),t));const e=parseFloat(this.css["line-height"])||this.height;this.$base.css("line-height",`${e}px`)}}e.BasicDisplayEVO=r,r.constructorName="BasicDisplayEVO"},304:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ButtonEVO=e.buttonEvents=void 0;const n=i(717),r=i(569);e.buttonEvents=[n.WidgetEvent.click,n.WidgetEvent.dblclick,n.WidgetEvent.press,n.WidgetEvent.release];class s extends n.WidgetEVO{constructor(t,e,i){var r;if(super(t,e,i),this.hoverFlag=!1,this.mouseDownFlag=!1,this.wasDownFlag=!1,this.kind="Button",(i=i||{}).css=i.css||{},this.css.background=i.css.background||i.css["background-color"]||"transparent",this.css.color=i.css.color||"white",this.css.cursor=i.css.cursor||"pointer",this.css["z-index"]=i.css["z-index"]||1,this.lineHeight=parseFloat(i.css["line-height"])||this.height,this.connection=i.connection,this.interval=isNaN(i.rate)?250:Math.max(250,i.rate),this.dblclick_timeout=isNaN(i.dblclick_timeout)?350:Math.max(350,i.rate),i.evts=i.evts||n.WidgetEvent.click,this.evts={},i.actions&&i.actions)this.setActions(i.actions);else if(i.evts)if("object"==typeof i.evts&&(null===(r=i.evts)||void 0===r?void 0:r.length)>0)for(let t in n.WidgetEvent)this.evts[t]=i.evts.filter((e=>e===t)).length>0;else for(let t in n.WidgetEvent)this.evts[t]=i.evts===t;this._timer=null,this.callback=i.callback||((t,e)=>{console.warn("[button-widget] Warning: "+this.id+" does not have a callback :/")}),this._tick_listener=()=>{this._tick?this._tick():console.error("Error in ButtonEVO: undefined handler for tick function.")},this.attr.buttonName=i.buttonName||t,this.attr.customFunction=i.customFunction||"",this.attr.customLabel=i.customLabel||"",this.attr.keyCodes=i.keyCodes,this.attr.actions=this.getActions()}getConstructorName(){return s.constructorName}getActions(){const t=[];for(let e in n.WidgetEvent)this.evts[e]&&t.push(e);return t.join(" ")}setActions(t){if(t){const e=t.split(" ");for(let t in n.WidgetEvent)this.evts[t]=e.includes(t)}}installHandlers(){var t,e;if(this.$overlay.on("mouseover",(t=>{this.hoverFlag=!0,this.onMouseOver(t)})).on("mouseout",(t=>{this.hoverFlag=!1,this.onMouseOut(t)})).on("mousedown",(t=>{this.mouseDownFlag=!0,this.wasDownFlag=!0,t.button===r.mouseButtons.left&&(this.onMouseDown(t),this.dragStart={top:t.pageY||0,left:t.pageX||0},this.$overlay.on("mousemove",(t=>{this.onMouseMove(t)})),$(document).on("mousemove",(t=>{this.onMouseDrag(t)})),$(document).on("mouseup",(t=>{this.dragStart=null,this.mouseDownFlag=!1})))})).on("mouseup",(t=>{this.mouseDownFlag=!1,t.button===r.mouseButtons.left&&this.onMouseUp(t)})).on("blur",(t=>{this.hoverFlag=!1,this.onBlur(t)})),$(document).on("touchstart",(t=>{var e;this.hoverFlag&&(console.log("touchstart"),(null===(e=t.changedTouches)||void 0===e?void 0:e.length)&&(this.touchStart={top:t.changedTouches[0].pageY||0,left:t.changedTouches[0].pageX||0}))})),$(document).on("touchmove",(t=>{this.hoverFlag&&this.onMouseDrag(t)})),$(document).on("touchend",(t=>{this.touchStart=null})),this.attr.keyCodes){const i=null===(e=null===(t=this.attr)||void 0===t?void 0:t.keyCodes)||void 0===e?void 0:e.split(" ").map((t=>t.trim())).filter((t=>""!==t));(null==i?void 0:i.length)>0&&($(document).on("keydown",(t=>{this.touchStart=null,this.dragStart=null,i.includes(t.key)&&this.onKeyDown(t)})),$(document).on("keyup",(t=>{this.touchStart=null,this.dragStart=null,i.includes(t.key)&&this.onKeyUp(t)})))}}onKeyDown(t){this.onMouseDown()}onKeyUp(t){this.onMouseUp()}onButtonPress(){this.evts.press?this.pressAndHold():this.evts.click&&this.click()}onButtonRelease(){this.wasDownFlag=!1,this.evts.release&&this.release(),this.evts.click&&this.evts.press&&this.click()}onButtonDoubleClick(){this.evts.dblclick&&this.dblclick()}onMouseMove(t){}onMouseDrag(t){}onMouseOver(t){this.select()}onMouseOut(t){this.deselect(),this.wasDownFlag&&this._tick?this.onButtonRelease():this.clearTimer()}onMouseDown(t){this.hoverFlag&&(this.onButtonPress(),this.select({background:this.css.background}))}onMouseUp(t){this.onButtonRelease(),this.hoverFlag?this.onMouseOver():this.deselect(),this.dblclick_timer?(this.onButtonDoubleClick(),clearInterval(this.dblclick_timer),this.dblclick_timer=null):this.dblclick_timer=setTimeout((()=>{this.dblclick_timer=null}),this.dblclick_timeout)}onBlur(t){this.deselect(),this._tick&&this.onButtonRelease()}btn_action(t,e){var i,n;const r=(e=e||{}).customFunction||this.attr.customFunction||t+"_"+this.attr.buttonName,s=e.callback||this.callback,o={id:this.id,type:"sendCommand",command:r};null===(i=this.connection)||void 0===i||i.sendRequest("sendCommand",o),s&&(null===(n=this.connection)||void 0===n||n.onRequest("sendCommand",((t,e)=>{s(t,e)})));const a={evt:t,fun:r};this.trigger(t,a),console.log(a)}getAttributes(t){return(t=t||{}).optionals=t.optionals||[],t.optionals=t.optionals.concat(["customFunction","customLabel","keyCode"]),super.getAttributes(t)}getAttrX(t){(t=t||{}).optionals=t.optionals||[],t.optionals=t.optionals.concat(["customFunction","customLabel","keyCode"]);const i=super.getAttrX(t);return i&&(i.actions={val:i.actions.val,hints:e.buttonEvents}),i}render(t,e){var i;if(e=e||{},super.render(),this.updateDisplayStyle(e.css),this.reveal(),null===(i=this.attr)||void 0===i?void 0:i.customLabel)this.$base.html(this.attr.customLabel);else if(null!=t)if(this.matchStateFlag){const e=this.getName(),i="string"==typeof t?this.matchState(t,e):{name:e,val:t[e]};if(i)if(new RegExp(n.ratNumberMatch).exec(i.val)){const t=n.rat2real(i.val),e=isNaN(t)?`${i.val}`:`${t}`;this.$base.html(e)}else this.$base.html(i.val)}else this.$base.html(`${t}`)}updateDisplayStyle(t){t=t||{},this.applyCSS(Object.assign(Object.assign({},this.css),t)),this.$base.css("line-height",`${this.lineHeight}px`)}setAttr(t){t=t||{};for(const e in t)"actions"===e?this.setActions(t[e]):this.attr[e]=t[e]}renderSample(){this.render()}getDescription(){return"Creates transparent hotspot areas over button widgets.\n Click events are emitted when the button is pressed."}click(t){this.btn_action(n.WidgetEvent.click,t)}dblclick(t){this.btn_action(n.WidgetEvent.dblclick,t)}press(t){this.btn_action(n.WidgetEvent.press,t)}pressAndHold(t){this._tick=()=>{this.press(t)},this.clearTimer(),this._timer=setInterval((()=>{this.hoverFlag&&this.mouseDownFlag?this._tick_listener():this.clearTimer()}),this.interval),this.press(t)}clearTimer(){clearInterval(this._timer),this._timer=null}release(t){this.btn_action(n.WidgetEvent.release,t),this.clearTimer()}}e.ButtonEVO=s,s.constructorName="ButtonEVO"},377:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LedEVO=void 0;const n=i(717),r="#00FF66";class s extends n.WidgetEVO{constructor(t,e,i){super(t,e,i),this.kind="LED",(i=i||{}).css=i.css||{},e=e||{};const n=parseFloat(`${e.width}`)||parseFloat(`${e.height}`)||1,s=parseFloat(`${e.height}`)||parseFloat(`${e.width}`)||1,o=parseFloat($(this.sel2jquery(i.parent)).css("width"))||n,a=parseFloat($(this.sel2jquery(i.parent)).css("height"))||s;this.radius=Math.min(n,s,o,a)/2,this.css.background=i.css.color||i.css.background||r,this.css.cursor=i.css.cursor||"default",this.css["border-radius"]=i.css["border-radius"]||`${this.radius}px`,this.css.overflow="visible",delete this.css["font-size"],delete this.css["font-family"],delete this.css["text-align"],delete this.css["white-space"],this.attr={ledName:i.ledName||t}}getConstructorName(){return s.constructorName}render(t,e){super.render(),e=e||{},this.applyCSS(Object.assign(Object.assign({},this.css),e.css)),this.$base.css({width:2*this.radius+"px",height:2*this.radius+"px",left:this.width/2-this.radius+"px"}),"string"==typeof(t=null==t?"":t)&&this.applyCSS({background:t}),this.reveal()}renderSample(){this.render(r)}getDescription(){return"Multi-color LED light."}}e.LedEVO=s,s.constructorName="LedEVO"},884:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NumericDisplayEVO=e.defaultDecimalAccuracy=e.defaultDecimalFontScale=e.digitsTemplate=void 0;const n=i(647),r=i(717);e.digitsTemplate='\n{{#if template_description}}\x3c!-- Template defining the visual appearance of integer and fractional part of a numeric display widget --\x3e{{/if}}\n<div class="{{type}}_whole_part" style="position:absolute; left:0px; margin-left:{{whole.margin-left}}px; width:{{whole.width}}px; height:{{whole.height}}px; {{#if whole.margin-top}}margin-top:{{whole.margin-top}};{{/if}} text-align:right; display:inline-flex;">{{#each whole.digits}}\n <div style="position:absolute; border-radius:2px;text-align:center; width:{{../whole.letter-spacing}}px; min-width:{{../whole.letter-spacing}}px; max-width:{{../whole.letter-spacing}}px; margin-left:{{margin-left}}px; font-size:{{font-size}}px;\n {{#if selected}} color:{{../whole.sel-color}}; background:{{../whole.sel-background}}; transform:scale(0.94);\n {{else}} color:{{../whole.color}}; background:{{../whole.background}};\n {{/if}}">{{val}}</div>{{/each}}\n</div>\n\n{{#if point.viz}}<div class="{{type}}_decimal_point" style="position:absolute; text-align:center; margin-left:{{point.margin-left}}px; left:{{point.left}}px; width:{{point.width}}px; min-width:{{point.width}}px; max-width:{{point.width}}px; height:{{point.height}}px; text-align:center; font-size:{{point.font-size}}px;">\n•</div>{{/if}}\n\n{{#if frac.viz}}<div class="{{type}}_frac_part" style="position:absolute; left:{{frac.left}}px; width:{{frac.width}}px; height:{{frac.height}}px; {{#if frac.margin-top}}margin-top:{{frac.margin-top}};{{/if}} text-align:left; display:inline-flex;">{{#each frac.digits}}\n <div style="position:absolute; border-radius:2px; text-align:center; width:{{../frac.letter-spacing}}px; min-width:{{../frac.letter-spacing}}px; max-width:{{../frac.letter-spacing}}px; margin-left:{{margin-left}}px; font-size:{{font-size}}px;{{#if selected}} color:{{../frac.sel-color}}; background:{{../frac.sel-background}}{{else}} color:{{../frac.color}}; background:{{../frac.background}}{{/if}}">{{val}}</div>{{/each}}\n</div>{{/if}}',e.defaultDecimalFontScale=.7,e.defaultDecimalAccuracy=2;class s extends n.BasicDisplayEVO{constructor(t,i,n){super(t,i,n),(n=n||{}).css=n.css||{},this.letterSpacing=parseFloat(this.css["font-size"])||1;const r=n.decimalFontScale||.7;this.css["decimal-font-scale"]=n.css["decimal-font-scale"]||r;const s=this.getDecimalFontSpacing();this.maxDecimalDigits=isNaN(parseInt(`${n.maxDecimalDigits}`))?e.defaultDecimalAccuracy:parseInt(`${n.maxDecimalDigits}`),this.maxIntegerDigits=isNaN(parseInt(`${n.maxIntegerDigits}`))?Math.floor((this.width-(this.maxDecimalDigits+1)*s)/this.letterSpacing):parseInt(`${n.maxIntegerDigits}`),this.decimalPointOffset=n.decimalPointOffset||0,this.attr.cursorName=n.cursorName||""}getConstructorName(){return s.constructorName}render(t,e){if(e=e||{},super.render(),this.updateDisplayStyle(e.css),this.reveal(),null!=t)if(this.matchStateFlag){if("string"==typeof t){const i=e.cursorName||this.attr.cursorName,n=i?this.matchState(t,i):null,s={whole:[],frac:[],point:!1,whole_zeropadding:[],frac_zeropadding:[],max_integer_digits:this.maxIntegerDigits,max_decimal_digits:this.maxDecimalDigits,cursorPos:n?+n.val:NaN},o=this.attr.displayName,a=this.matchState(t,o);if(a){const t=r.rat2real(a.val);isNaN(t)?this.updateDisplayData(s,a.val):(s.point=`${t}`.indexOf(".")>=0,this.updateDisplayData(s,`${t}`))}const l=this.getBorderWidth(e.css);this.renderData(s,l)}}else this.$base.html(`${t}`)}setCSS(t){super.setCSS(t),this.css["decimal-font-scale"]=t["decimal-font-scale"]}getDecimalFontSize(){const t=parseFloat(`${this.css["font-size"]}`);let i=parseFloat(`${this.css["decimal-font-scale"]}`);return i=isNaN(i)?e.defaultDecimalFontScale:i,t*i}getDecimalFontSpacing(){return 1.076*this.getDecimalFontSize()}updateDisplayData(t,e){let i=e.split(".");const n=parseFloat(`${this.css["font-size"]}`),r=i[0].split("");if(t.cursorPos>r.length-1){const e=t.cursorPos-(r.length-1);t.whole_zeropadding=[];for(let i=0;i<e;i++)t.whole_zeropadding.push({val:"0",selected:0===i,"font-size":n,"margin-left":i*this.letterSpacing})}if(t.whole=r.map(((e,i)=>({val:e,selected:!t.whole_zeropadding.length&&t.whole_zeropadding.length+r.length-1-i===t.cursorPos,"font-size":n,"margin-left":(i+t.whole_zeropadding.length)*this.letterSpacing}))),i.length>1||t.cursorPos<0){t.point=!0;const e=parseFloat(`${this.css["decimal-font-scale"]}`),n=i.length>1?i[1].split(""):[],r=this.getDecimalFontSize();if(t.frac=n.map(((i,n)=>({val:i,selected:n===-t.cursorPos-1,"font-size":r,"margin-left":n*this.letterSpacing*e}))),-t.cursorPos>n.length){const i=-t.cursorPos-n.length;t.frac_zeropadding=[];for(let n=0;n<i;n++){const i=n+t.frac.length===-t.cursorPos-1;t.frac_zeropadding.push({val:"0",selected:i,"font-size":r,"margin-left":(n+t.frac.length)*this.letterSpacing*e})}}}}renderData(t,i){const n={left:(t.max_integer_digits*this.letterSpacing+this.decimalPointOffset).toFixed(2),width:(this.letterSpacing/2).toFixed(2),height:this.height-2*i,"margin-left":(-this.letterSpacing/32).toFixed(2),"font-size":this.getDecimalFontSize().toFixed(2),viz:t.point},r={digits:t.whole_zeropadding.concat(t.whole),width:t.max_integer_digits*this.letterSpacing,height:this.height-2*i,"margin-top":-i+"px",left:parseFloat(n.left)-parseFloat(n.width),"letter-spacing":this.letterSpacing.toFixed(2),color:this.css.color,background:this.css.background,"margin-left":((t.max_integer_digits-t.whole.length-t.whole_zeropadding.length)*this.letterSpacing).toFixed(2),"sel-color":"transparent"==this.css.background?"black"===this.css.color?"white":"black":this.css.background,"sel-background":"transparent"==this.css.color?"white":this.css.color},o=t.frac.concat(t.frac_zeropadding),a={digits:o,width:(t.max_decimal_digits*this.getDecimalFontSpacing()).toFixed(2),height:this.height-2*i,"margin-top":-i/2+"px",left:(parseFloat(n.left)+parseFloat(n.width)).toFixed(2),"letter-spacing":this.getDecimalFontSpacing().toFixed(2),color:this.css.color,background:this.css.background,viz:o.length>0,"sel-color":"transparent"==this.css.background?"black":this.css.background,"sel-background":"transparent"==this.css.color?"white":this.css.color},l=Handlebars.compile(e.digitsTemplate,{noEscape:!0})({type:s.constructorName,whole:r,frac:a,point:n});this.$base.empty(),this.$base.append(l).css("line-height",`${this.height}px`)}updateDisplayStyle(t){t=t||{},this.applyCSS(Object.assign(Object.assign({},this.css),t))}getBorderWidth(t){const e=void 0!==(t=t||{}).border?t.border:this.css.border,i=e?/\d+px/.exec(e):null;let n=void 0!==t["border-width"]?parseFloat(`${t["border-width"]}`):i?parseFloat(i[0]):0;return n=isNaN(n)?0:n,n}renderSample(){let t={};t[this.attr.displayName]=123.4;const e=this.attr.cursorName||"demoCursor";t[e]=0,this.render(JSON.stringify(t),{cursorName:e})}getDescription(){return"Enhances the visibility of digits, and provides a cursor for highlighing digits."}getAttributes(t){return(t=t||{}).optionals=t.optionals||[],t.optionals=t.optionals.concat(["cursorName"]),super.getAttributes(t)}getAttrX(t){return(t=t||{}).optionals=t.optionals||[],t.optionals=t.optionals.concat(["cursorName"]),super.getAttrX(t)}}e.NumericDisplayEVO=s,s.constructorName="NumericDisplayEVO"},371:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TouchScreenEVO=void 0;const n=i(304);class r extends n.ButtonEVO{constructor(t,e,i){var n;super(t,e,i),this.kind="Touchscreen",(i=i||{}).css=i.css||{},this.css.background=i.css.background||"steelblue",this.css["font-color"]=i.css["font-color"]||"white",this.attr.displayName=i.displayName||i.buttonName||(null===(n=this.attr)||void 0===n?void 0:n.buttonName)||t}getConstructorName(){return r.constructorName}onButtonPress(){this.evts.press&&this.pressAndHold()}onButtonRelease(){this.evts.release?this.release():this.evts.click&&this.click()}render(t,e){if(super.render(t,e),!this.attr.customLabel&&t)if(this.matchStateFlag){if("string"==typeof t){const e=this.matchState(t);e&&this.$base.html(`${e.val}`)}}else this.$base.html(`${t}`)}renderSample(){return this.render()}getDescription(){return"Renders touch-screen elements.\n Click events are emitted when the element is released."}}e.TouchScreenEVO=r,r.constructorName="TouchScreenEVO"},717:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WidgetEVO=e.getStateRegexSource=e.rat2real=e.ratNumberMatch=e.ratNumber=e.WidgetEvent=e.cssKeys=e.img_template=e.widget_template=void 0;const n=i(845),r=i(634),s=i(569);function o(t){return[`\\b(${t})\\s*:=\\s*(${e.ratNumber})`,`\\b(${t})\\s*:=\\s*([\\-\\+\\w\\.]+)`,`\\b(${t})\\s*:=\\s*\\"([^\\"]*)\\"`,`\\"(${t})\\"\\s*:\\s*([\\-\\+\\w\\.]+)`,`\\"(${t})"\\s*:s*\\"([^\\"]*)\\"`]}var a;e.widget_template='\n{{#if template_description}}\x3c!--\n Basic widget template. Provides a base layer for rendering the visual appearance of the widget\n The widget has the following layers:\n - an outer div layer defining position and size of the widget\n - an inner base layer renders the visual appearance\n - an inner img layer renders images\n - an inner transparent overlay layer captures user interactions with the widget --\x3e{{/if}}\n<div id="{{id}}"\n style="user-select:none; position:absolute; width:{{width}}px; height:{{height}}px; top:{{top}}px; left:{{left}}px; z-index:{{css.z-index}}; overflow:{{css.overflow}};"\n class="{{type}} noselect {{#if css.class}}{{class}}{{/if}}">\n <div id="{{id}}_base"\n style="position:absolute; top:0; width:{{width}}px; height:{{height}}px; {{#each css}} {{@key}}:{{this}};{{/each}}"\n class="base"></div>\n <div id="{{id}}_img"\n style="position:absolute; top:0;"\n class="img"></div>\n <div id="{{id}}_overlay"\n style="position:absolute; top:0; left:0; width:{{width}}px; height:{{height}}px; {{#if css.z-index}}z-index:{{css.z-index}};{{/if}} border-radius:{{css.border-radius}}; cursor:{{css.cursor}}; opacity:0;"\n class="overlay"></div>\n</div>',e.img_template='\n{{#if template_description}}\x3c!-- Template for embedding an image in a div --\x3e{{/if}}\n{{#if img}}<img src="{{img}}" style="user-select:none; position:absolute; opacity:{{opacity}}; transform-origin:{{transformOrigin}};">{{/if}}\n{{#if svg}}{{svg}}{{/if}}\n',e.cssKeys={position:["absolute","relative"],cursor:["string"],background:["string"],"font-size":["string"],"font-family":["string"],color:["string"],"text-align":["string"],border:["string"],"border-radius":["string"],overflow:["hidden","visible"],opacity:["number"],"z-index":["string"],"letter-spacing":["string"],"white-space":["normal","nowrap"],"line-height":["string"],margin:["string"],padding:["string"],class:["string"],"box-shadow":["string"]},(a=e.WidgetEvent||(e.WidgetEvent={})).press="press",a.release="release",a.click="click",a.dblclick="dblclick",a.rotate="rotate",a.move="move",e.ratNumber="[\\+\\-]?\\d+/\\d+",e.ratNumberMatch="([\\+\\-]?\\d+)/(\\d+)",e.rat2real=function(t){if(null!=t){const i=new RegExp(e.ratNumberMatch).exec(t);return i&&i.length>2&&!isNaN(+i[1])&&!isNaN(+i[2])&&0!=+i[2]?+i[1]/+i[2]:+t}return NaN},e.getStateRegexSource=o;class l extends n.Model{constructor(t,i,n){var r,s,o;super(),this.widget=!0,this.attr={},this.kind="widget",this.matchStateFlag=!0,this.viz={},this.css={},this.evts=null,this.fontPadding=6,this.rendered=!1,(n=n||{}).parent=n.parent||"body",n.css=n.css||{},i=i||{},this.id=t,this.parentSelector="string"==typeof n.parent?"body"===n.parent||n.parent.startsWith("#")||n.parent.startsWith(".")?n.parent:`#${n.parent}`:null,this.$parent=this.sel2jquery(n.parent),this.top=parseFloat(`${i.top}`)||0,this.left=parseFloat(`${i.left}`)||0,this.width=isNaN(parseFloat(`${i.width}`))?32:parseFloat(`${i.width}`),this.height=isNaN(parseFloat(`${i.height}`))?32:parseFloat(`${i.height}`),this.viz={visible:(null===(r=n.viz)||void 0===r?void 0:r.visible)||"true",enabled:(null===(s=n.viz)||void 0===s?void 0:s.enabled)||"true"},"string"===n.renderMode?this.stringRenderer():this.stateRenderer();const a=/\d+px/.exec(null===(o=n.css)||void 0===o?void 0:o.border);let l=n["border-width"]?parseFloat(`${n["border-width"]}`):a?parseFloat(a[0]):0;l=isNaN(l)?0:l;let c=parseFloat(`${n.css["font-size"]}`);c=isNaN(c)?this.height-l-this.fontPadding:c,this.setCSS(n.css),this.css.background=n.css.background||n.css["background-color"]||"transparent",this.css["font-size"]=c+"px",this.css["font-family"]=n.css["font-family"]||"sans-serif",this.css.color=n.css.color||"white",this.css["text-align"]=n.css["text-align"]||"center",this.css.overflow=n.css.overflow||"visible",this.css["white-space"]=n.css["white-space"]||"nowrap",this.css["box-shadow"]=n.css["box-shadow"]||"0px 0px 10px white",this.css["z-index"]=n.css["z-index"]||0,this.widget_template=n.widget_template||e.widget_template}matchState(t,e){if(t&&(e=e||this.getName())){const i=o(e);for(let n=0;n<i.length;n++){const r=new RegExp(i[n],"g").exec(t);if(r&&r.length>2)return{name:e,val:r[2]}}}return null}setMatchStateFlag(t){this.matchStateFlag=!!t}stringRenderer(){this.setMatchStateFlag(!1)}stateRenderer(){this.setMatchStateFlag(!0)}sel2jquery(t){return"string"==typeof t?"body"===t||t.startsWith("#")||t.startsWith(".")?$(t):$(`#${t}`):t}createHTMLElement(){const t=Handlebars.compile(this.widget_template,{noEscape:!0})(this);this.$parent[0]||console.error("Error: "+this.parentSelector+" does not exist. Widget '"+this.id+"' cannot be attached to DOM :(("),this.$parent.append(t),this.$div=$("#"+this.id),this.$img=this.$div.find(".img"),this.$base=this.$div.find(".base"),this.$overlay=this.$div.find(".overlay"),this.applyCSS(this.css),this.rendered=!0}installHandlers(){}render(t,e){this.rendered||(this.createHTMLElement(),this.installHandlers())}reveal(){this.rendered||(this.createHTMLElement(),this.installHandlers()),this.$div.css("display","block")}hide(){this.rendered||(this.createHTMLElement(),this.installHandlers()),this.$div.css("display","none")}move(t,e){e=e||{},this.rendered||(this.createHTMLElement(),this.installHandlers()),t=t||{},e.duration=e.duration||0,e.transitionTimingFunction=e.transitionTimingFunction||"ease-out",this.top=isNaN(parseFloat(`${t.top}`))?this.top:+parseFloat(`${t.top}`).toFixed(l.MAX_COORDINATES_ACCURACY),this.left=isNaN(parseFloat(`${t.left}`))?this.left:+parseFloat(`${t.left}`).toFixed(l.MAX_COORDINATES_ACCURACY),this.$div.animate({top:this.top+"px",left:this.left+"px","transition-timing-function":e.transitionTimingFunction},+e.duration)}resize(t,e){this.rendered||(this.createHTMLElement(),this.installHandlers()),t=t||{},(e=e||{}).duration=e.duration||0,e.transitionTimingFunction=e.transitionTimingFunction||"ease-out",this.height=isNaN(parseFloat(`${t.height}`))?this.height:+parseFloat(`${t.height}`).toFixed(l.MAX_COORDINATES_ACCURACY),this.width=isNaN(parseFloat(`${t.width}`))?this.width:+parseFloat(`${t.width}`).toFixed(l.MAX_COORDINATES_ACCURACY);const i=/\d+px/.exec(null==e?void 0:e.border);let n=e["border-width"]?parseFloat(`${e["border-width"]}`):i?parseFloat(i[0]):0;n=isNaN(n)?0:n,e.duration?(this.$div.animate({height:this.height+"px",width:this.width+"px","transition-timing-function":e.transitionTimingFunction},+e.duration),this.$base.css("font-size",this.css["font-size"]).animate({"line-height":this.height+"px",height:this.height+"px",width:this.width+"px","transition-timing-function":e.transitionTimingFunction},+e.duration),this.$overlay.animate({height:this.height+"px",width:this.width+"px","transition-timing-function":e.transitionTimingFunction},+e.duration)):(this.$div.css("height",this.height+"px").css("width",this.width+"px"),this.$base.css("line-height",this.height+"px").css("height",this.height+"px").css("width",this.width+"px").css("font-size",this.css["font-size"]),this.$overlay.css("height",this.height+"px").css("width",this.width+"px")),this.move(t,e)}rotate(t,e){this.rendered||(this.createHTMLElement(),this.installHandlers()),t=isNaN(parseFloat(`${t}`))?0:parseFloat(`${t}`),(e=e||{}).duration=e.duration||0,e.transitionTimingFunction=e.transitionTimingFunction||"ease-in",e.transformOrigin=e.transformOrigin||"center",this.$div.css({transform:`rotate(${t}deg)`,"transform-origin":e.transformOrigin}),e.duration&&this.$div.css({transition:`all ${e.duration}ms ${e.transitionTimingFunction} 0s`})}remove(){this.$div&&this.$div[0]&&this.$div.remove()}evalViz(t){var e;const i=r.simpleExpressionParser(null===(e=this.viz)||void 0===e?void 0:e.visible);if(i&&i.res&&"constexpr"===i.res.type)return"true"===i.res.constant;if("string"==typeof t){if(i&&i.res&&"boolexpr"===i.res.type&&i.res.binop){const e=this.matchState(t,i.res.attr);if(e){let t=e.val;if(t&&(t=r.evaluate(t),"="===i.res.binop&&t===i.res.constant||"!="===i.res.binop&&t!==i.res.constant))return!0}}return!1}return!0}evaluate(t,e){if(t&&e&&"object"==typeof e){var i=r.resolveAttribute(e,t);if(null!=i)return r.evaluate(i).replace(new RegExp('"',"g"),"");console.log("Warning: WidgetEVO.evaluate could not find state attribute "+t+" requested by "+this.id)}return""}getVizExpression(){var t;return null===(t=this.viz)||void 0===t?void 0:t.visible}setCSS(t){this.css={};for(const i in e.cssKeys)this.css[i]="background"===i?t[i]||t["background-color"]:t[i]}updateCSS(t){if(t)for(let e in t)void 0!==t[e]&&(this.css[e]=t[e])}applyCSS(t){t=t||{};for(const e in t)switch(this.css[e]=t[e],e){case"z-index":this.$div.css(e,t[e]);break;case"width":case"height":this.$overlay.css(e,`${parseFloat(`${t[e]}`)}px`),this.$base.css(e,`${parseFloat(`${t[e]}`)}px`);break;case"border-radius":this.$overlay.css(e,t[e]),this.$base.css(e,t[e]);break;case"class":this.$base[0].className="base",this.$base.addClass(t[e]);break;case"cursor":this.$overlay.css({cursor:t[e]});break;default:this.$base.css(e,t[e])}this.$base.css("position","absolute")}setAttr(t){t=t||{};for(const e in t)this.attr[e]=t[e]}getName(){const t=Object.keys(this.attr);return t&&t.length?this.attr[t[0]]:"..."}getKind(){return this.kind||"widget"}setName(t){const e=Object.keys(this.attr);e&&e.length&&(this.attr[e[0]]=t)}invertColors(){this.$base.css("background",this.css["font-color"]),this.$base.css("color",this.css.background)}isTransparent(t){return"transparent"===t||"rgba(0, 0, 0, 0)"===t}select(t){this.rendered||(this.createHTMLElement(),this.installHandlers());const e=(t=t||{})["box-shadow"]||"0px 0px 10px yellow";this.$base.css(Object.assign(Object.assign({},this.css),t));const i=t.class||this.css.class;i&&this.$base.addClass(i),this.$overlay.css({"box-shadow":e,opacity:1})}deselect(){this.rendered||(this.createHTMLElement(),this.installHandlers()),this.applyCSS(this.css),this.$overlay.css({opacity:0})}getPosition(){return{left:this.left,top:this.top}}getSize(){return{width:this.width,height:this.height}}setPosition(t){return this.move(t)}setSize(t){return this.resize(t)}setPositionAndSize(t){t&&(this.move(t),this.resize(t))}updateLocationAndSize(t){return this.setPositionAndSize(t)}getId(){return this.id}getCSS(t){var i,n;const r=(t=t||{}).all?Object.assign(Object.assign({},this.css),e.cssKeys):this.css,s=null===(i=Object.keys(r))||void 0===i?void 0:i.sort(((t,e)=>t<e?-1:1));if(s&&s.length){const e={};for(let i in s){const r=s[i];(this.css[r]||t.all)&&(e[r]=(null===(n=t.replace)||void 0===n?void 0:n.hasOwnProperty(r))?t.replace[r]:this.css[r])}return e}return{}}getCSSx(){var t;const i=null===(t=Object.keys(Object.assign(Object.assign({},this.css),e.cssKeys)))||void 0===t?void 0:t.sort(((t,e)=>t<e?-1:1));if(i&&i.length){const t=[];for(let e in i){const n=i[e],r=this.css[n],o="class"===n?s.animateCssClasses:"background"===n||"color"===n?Object.keys(s.cssColors):"cursor"===n?s.cssCursorClasses:void 0;t.push({key:n,value:r,hints:o})}return t}return[]}getViz(){return this.viz}getOptions(){return Object.assign({css:this.getCSS(),viz:this.getViz()},this.getAttributes())}getCoordinates(){return{top:+this.top.toFixed(l.MAX_COORDINATES_ACCURACY),left:+this.left.toFixed(l.MAX_COORDINATES_ACCURACY),width:+this.width.toFixed(l.MAX_COORDINATES_ACCURACY),height:+this.height.toFixed(l.MAX_COORDINATES_ACCURACY)}}getAttributes(t){var e;(t=t||{}).optionals=t.optionals||[];const i=null===(e=Object.keys(this.attr))||void 0===e?void 0:e.sort(((t,e)=>t<e?-1:1));if(i&&i.length){const e={},n={};for(let r in i){const s=i[r];t.optionals.includes(s)?n[s]=this.attr[s]:e[s]=this.attr[s]}return Object.assign(Object.assign({},e),n)}return null}getAttrX(t){var e;(t=t||{}).optionals=t.optionals||[];const i=null===(e=Object.keys(this.attr))||void 0===e?void 0:e.sort(((t,e)=>t<e?-1:1));if(i&&i.length){const e={},n={};for(let r in i){const s=i[r];t.optionals.includes(s)?n[s]={val:this.attr[s],hints:null}:e[s]={val:this.attr[s],hints:null}}return Object.assign(Object.assign({},e),n)}return null}getEvents(){const t=[];if(this.evts){const e=Object.keys(this.evts);for(let i in e){const n=e[i];this.evts[n]&&t.push(n)}}return t}setEvents(t){t&&t.length>0?(this.evts={},this.enableEvents(t)):this.evts=null}enableEvents(t){if(t&&t.length>0){this.evts=this.evts||{};for(let e in t)this.evts[t[e]]=!0}else this.evts=null}disableEvents(t){if(t&&t.length>0)for(let e in t)this.evts=this.evts||{},this.evts[t[e]]=!1;else this.evts=null}toJSON(){return{id:this.id,coords:this.getCoordinates(),name:this.getName(),kind:this.kind,cons:this.getConstructorName(),opt:this.getOptions(),evts:this.getEvents()}}setMarker(t){t&&(this.marker=t)}getMarker(){return this.marker}}e.WidgetEVO=l,l.MAX_COORDINATES_ACCURACY=0,l.constructorName="WidgetEVO"},83:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.coreWidgetClassMap=void 0;const n=i(647),r=i(304),s=i(377),o=i(884),a=i(371);e.coreWidgetClassMap={Display:[{id:n.BasicDisplayEVO.constructorName,label:"Basic Display",cons:n.BasicDisplayEVO},{id:o.NumericDisplayEVO.constructorName,label:"Numeric Display",cons:o.NumericDisplayEVO}],Button:[{id:r.ButtonEVO.constructorName,label:"Standard Button",cons:r.ButtonEVO}],Touchscreen:[{id:a.TouchScreenEVO.constructorName,label:"TouchScreen Element",cons:a.TouchScreenEVO}],LED:[{id:s.LedEVO.constructorName,label:"Multicolor LED",cons:s.LedEVO}]}}},e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={exports:{}};return t[n].call(r.exports,r,r.exports,i),r.exports}i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();var n=i(462);builder=n})();
//# sourceMappingURL=prototype-builder.min.js.map