@globules-io/ogx.js 1.49.0 → 1.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- /* globules.io OGX.JS 1.49.0.20 */
2
- window.console||(window.console={});for(var methods=["log","debug","warn","info"],i=0;i<methods.length;i++)console[methods[i]]=function(){};if(OGX.Data={},OGX.Data.weld=function(t,e,r,i){var a;return void 0===r&&(r=!1),void 0===i&&(i=!1),function t(e,i){for(var a in i)!e.hasOwnProperty(a)||r?e[a]=i[a]:"object"==typeof i[a]&&t(e[a],i[a])}(a=i?JSON.parse(JSON.stringify(t)):t,e),a},OGX.Data.merge=function(t,e,r,i,a){for(var s in void 0===r&&(r=!1),void 0===i&&(i=!1),void 0===a&&(a=!1),i&&(t=OGX.Data.clone(t)),e)r?a?t.hasOwnProperty(s)&&(t[s]=e[s]):t[s]=e[s]:t.hasOwnProperty(s)||a||(t[s]=e[s]);return t},OGX.Data.diff=function(t,e,r){void 0===r&&(r=!1);var i={},a=!1;for(var s in e)(!r&&!t.hasOwnProperty(s)||r&&t.hasOwnProperty(s)&&t[s]!==e[s])&&(i[s]=e[s],a=!0);return!!a&&i},OGX.Data.intersect=function(t,e){var r=[];return t.forEach((t=>{e.includes(t)&&r.push(t)})),r},OGX.Data.adiff=function(t,e){var r=[];return t.forEach((t=>{e.includes(t)||r.push(t)})),e.forEach((e=>{t.includes(e)||r.includes(e)||r.push(e)})),r},OGX.Data.props=function(t,e){for(var r in e)if(!t.hasOwnProperty(e[r]))return!1;return!0},OGX.Data.trim=function(t){!function t(e){if(Array.isArray(e))e.forEach((e=>{t(e)}));else for(var r in e)"string"==typeof e[r]?e[r]=e[r].trim():"object"==typeof e[r]&&t(e[r])}(t)},OGX.Data.clone=function(t){return JSON.parse(JSON.stringify(t))},OGX.Data.stringToVal=function(t){if("string"!=typeof t)return t;var e=-1;return"true"===t&&(e=!0),"false"===t&&(e=!1),-1!==e?e:t.match(/^([0-9]+(\.[0-9]+)?)$/g)?Number(t):t.match(/^(\[|{)/g)?JSON.parse(t):t},OGX.Data.pad=function(t,e,r,i){void 0===i&&(i="0"),void 0===r&&(r=-1);for(var a=String(t);a.length<e;)-1===r?a=i+a:a+=i;return a},OGX.Data.addDec=function(t){return parseFloat(Math.round(100*t)/100).toFixed(2)},OGX.Data.isInt=function(t){return Number(t)===t&&t%1==0},OGX.Data.isFloat=function(t){return Number(t)===t&&t%1!=0},OGX.Data.isSizeExp=function(t){return"string"==typeof t&&(!!(t=t.trim()).match(/[|\+\-=\[\]]/g)&&!!t.trim().match(/(\d+(px|%)?\|?)+[\+-]?(\[=?\d+,? ?=?\d+?\])?/g))},OGX.Data.dateToLocale=function(t,e){return"string"==typeof t&&(t=new Date(t+" ")),void 0===e&&(e={}),OGX.Data.merge(e,{weekday:"long",year:"numeric",month:"long",day:"numeric"}),t.toLocaleDateString(navigator.language,e)},OGX.Data.eval=function(__obj,__path,__value){void 0===__value&&(__value=null);var str="__obj."+__path,res;__value&&(str+=" = "+JSON.stringify(__value));try{res=eval(str)}catch(t){}return res},OGX.Data.getBestSize=function(t,e,r,i){var a=!1,s=!1;function n(t,e){return t[0]&&e<t[0]&&(e=Number(t[0])),t[1]&&e>t[1]&&(e=Number(t[1])),a&&e<t[0]&&(e=Number(arr[0])),s&&e>t[1]&&(e=Number(arr[1])),e}void 0===r&&(r=10),void 0===i&&(i=200);var o=null;if(OGX.Data.isSizeExp(e)){var f=/\[=?(\d+),? ?=?(\d+)?\]/g;if(m=f.exec(e)){var l=m[1],h=m[2];void 0===l&&(l=null),void 0===h&&(h=null),l&&-1!==l.indexOf("=")&&(a=!0,l=l.replace("=","")),h&&-1!==h.indexOf("=")&&(s=!0,h=h.replace("=","")),l&&(l=Number(l)),h&&(h=Number(h)),l&&h&&(o=[l,h]),e=e.replace(f,"")}if(-1!==e.indexOf("|")){var c=e.substr(e.length-1,1);["+","-"].includes(c)?e=e.substr(0,e.length-1):c="+",c="+"===c?1:-1;for(var u,p,d=e.split("|"),_=new OGX.List,y=0;y<d.length;y++)-1!==(u=(u=d[y]).replace("px","")).indexOf("%")&&(u=Math.round(Number(u.split("%")[0])*t/100)),(u=Number(u))<=t&&(p={m:t-u,s:d[y],n:u},o?n(o,u)===u&&_.insert(p):_.insert(p));_.order("m",c);var v=!0;"100%"===_[0].s&&_.length>1&&_[1].m<i&&(e=_[1].s,v=!1),v&&(e=_[0].s)}else(m=/(\d+)(%|px)?/gi.exec(e))&&(void 0!==m[2]&&("%"===m[2].trim()?e=Math.round(Number(m[1])*t/100):("px"===m[2].trim()&&(e=m[1]),e=Number(e))),o&&(e=n(o,e)))}return e},OGX.Data.toSizeExp=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=0),OGX.Data.isSizeExp(t)?-1!==t.indexOf("[")?t:t=t+=JSON.stringify([e,r]):t=t.toString()+JSON.stringify([e,r])},OGX.Data.same=function(t,e,r){void 0===r&&(r=!0);var i,a=0,s=0;for(i in t)a++;for(i in e)s++;if(a!==s)return!1;if(typeof t!=typeof e)return!1;if(!["object","array"].includes(typeof t))return t===e;return function t(e,a){for(i in e){if(typeof e[i]!=typeof a[i])return!1;if(r&&"object"==typeof e[i]&&a.hasOwnProperty(i)){if(!t(e[i],a[i]))return!1}else if("array"==typeof e[i]){if(e[i].length!==a[i].length)return!1;if(e[i].sort(),a[i].sort(),r){for(var s=0;s<e[i].length;s++)if(!t(e[i][s],a[i][s]))return!1}else if(JSON.parse(JSON.stringify(e[i]))!==JSON.parse(JSON.stringify(__b[i])))return!1}else if(e[i]!==a[i])return!1}return!0}(t,e)},OGX.Data.clipboard=function(t){if(void 0!==t)if(void 0!==navigator.clipboard)navigator.clipboard.writeText(t);else{var e=document.createElement("textarea");e.value=t,e.style.top="-1000px",e.style.left="0",e.style.position="fixed",document.body.appendChild(e),$(e).trigger("focus"),e.select();try{document.execCommand("copy")}catch(t){}document.body.removeChild(e)}},OGX.Data.encrypt=function(t,e){return void 0===e&&(e=location.hostname),CryptoJS.AES.encrypt(t,e,{mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7})},OGX.Data.decrypt=function(t,e){return void 0===e&&(e=location.hostname),CryptoJS.AES.decrypt(t,e,{mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}).toString(CryptoJS.enc.Utf8)},OGX.Data.get2DTransform=function(t){var e=window.getComputedStyle(t),r=new DOMMatrix(e.transform),i=Math.round(Math.atan2(r.m12,r.m11)*(180/Math.PI));return i+=i>=0?0:360,{x:r.m41,y:r.m42,r:i}},void 0===OGX)var OGX={};OGX.List=function(){var filteringMode="and",filterCount=0,indexes=!1;1===arguments.length&&arguments[0]instanceof Array&&(arguments=arguments[0]);var array=Object.create(Array.prototype);for(var method in array=Array.apply(array,arguments)||array,OGX.List.prototype)OGX.List.prototype.hasOwnProperty(method)&&(array[method]=OGX.List.prototype[method]);function doEval(t,e){return new Function("try{return eval("+t+");}catch(error){}")(e)}function addToCache(t){var e;for(var r in indexes){if(-1!==r.indexOf("|")){r=r.split("|"),e=[];for(var i=0;i<r.length;i++)t.hasOwnProperty(r[i])&&e.push(t[r[i]]);e.sort(),e=e.join("|"),r.sort(),r=r.join("|")}else t.hasOwnProperty(r)&&(e=t[r]);indexes.hasOwnProperty(r)||(indexes[r]={}),indexes[r].hasOwnProperty(e)||(indexes[r][e]=[]),indexes[r][e].push(t)}}function matchesCache(t){var e,r=[],i=[];for(var a in indexes){e=!0,r=-1!==a.indexOf("|")?a.split("|"):[a];for(var s=0;s<r.length;s++)if(!t.hasOwnProperty(r[s])){e=!1;break}e&&i.push(a)}return!!i.length&&i}function dynamicSort(__prop,__way){return function(a,b){return eval("a."+__prop)<eval("b."+__prop)?-1*__way:eval("a."+__prop)>eval("b."+__prop)?__way:0}}function extract(__item,__by,__mode,__param){var data;try{data=eval("__item."+__by)}catch(t){}if(data)switch(__mode){case"substr":return data=data.substr(__param[0],__param[1]),data;case"numrange":return data=Number(data),Array.isArray(__param)?(data=Math.floor(data/__param[0]),data="pre"===__param[2]?__param[1]+data*__param[0]+" - "+__param[1]+(data+1)*__param[0]:data*__param[0]+__param[1]+" - "+(data+1)*__param[0]+__param[1]):(data=Math.floor(data/__param),data=data*__param+" - "+(data+1)*__param),data;case"date":if(!Array.isArray(__param)){if("year"===__param)return data=data.substr(0,4),data;if("month"===__param)return data=data.substr(0,7),data;if("week"===__param)return data=data.substr(0,4)+" week "+moment(data).week(),data;if("day"===__param)return data=data.substr(0,10),data}return data=moment(data).unix(),data=Math.floor(data/(60*__param[0]*60*24)),data*=60*__param[0]*60*24,data=moment(1e3*data).format(__param[1])+" - "+moment(1e3*data+1e3*__param[0]*60*60*24).format(__param[1]),data;default:return data}return!1}return array.insert=function(t,e){return void 0===e?array.push(t):array.splice(e,0,t),indexes&&addToCache(t),!0},array.delete=function(t){var e=this,r=array.splice(t,1);if(r.length){if(indexes){var i=matchesCache(r[0]);i&&setTimeout((()=>{e.rebuild(i)}),0)}return r[0]}return!1},array.last=function(){if(this.length)return this[this.length-1]},array.findDelete=function(__property,__value,__limit){var t=0;void 0===__limit&&(__limit=0);for(var removed=new OGX.List,ev,prop,i=0;i<this.length;i++){prop=null,ev="this["+i+"]."+__property;try{prop=eval(ev)}catch(t){}if(null==prop);else if(prop===__value){if(removed.push(this.splice(i,1)[0]),indexes){var idxs=matchesCache(removed.last());idxs&&this.rebuild(idxs)}if(t++,__limit>0&&__limit===t)return 1===__limit?removed[0]:removed;i--}}return removed},array.findReplace=function(__property,__value,__object,__limit){var t=0;void 0===__limit&&(__limit=0);for(var replaced=new OGX.List,ev,prop,i=0;i<this.length;i++){prop=null,ev="this["+i+"]."+__property;try{prop=eval(ev)}catch(t){}if(null==prop);else if(prop===__value&&(replaced.push(this[i]),t++,this[i]=__object,__limit>0&&__limit===t))return 1===__limit?replaced[0]:replaced}return!!replaced.length&&replaced},array.findUpdate=function(__property,__value,__object,__strict,__limit){var t=0;void 0===__strict&&(__strict=!1),void 0===__limit&&(__limit=0);for(var updated=new OGX.List,upd,ev,prop,i=0;i<this.length;i++){prop=null,ev="this["+i+"]."+__property;try{prop=eval(ev)}catch(t){}if(null==prop);else if(prop===__value){for(var a in upd=!1,__object)__strict?this[i].hasOwnProperty(a)&&(this[i][a]=__object[a],upd=!0):(this[i][a]=__object[a],upd=!0);if(upd&&(t++,updated.push(this[i]),__limit>0&&__limit===t))return 1===__limit?updated[0]:updated}}return!!updated.length&&updated},array.findIndex=function(__property,__value){var isReg=!1,ev,prop;__value instanceof RegExp&&(isReg=!0);for(var i=0;i<this.length;i++){prop=null,ev="this["+i+"]."+__property;try{prop=eval(ev)}catch(t){}if(null!==prop)if(isReg){if(prop.match(__value))return{index:i}}else if(prop===__value)return{index:i}}return!1},array.find=function(t,e,r){var i=0,a=new OGX.List,s=!1;e instanceof RegExp&&(s=!0),void 0===r&&(r=0);for(var n=0;n<this.length;n++)if(s?this[n][t].match(e)&&(a.push(this[n]),i++):this[n][t]===e&&(a.push(this[n]),i++),r>0&&i===r)return 1===r?a[0]:a;return!!a.length&&a},array.swap=function(t,e){var r=this[t];this[t]=this[e],this[e]=r},array.cache=function(){indexes||(indexes={});var t=[],e=[];if(arguments.length>1){for(var r=0;r<arguments.length;r++)t.push(arguments[r]);t.sort(),t=t.join("|")}else t=arguments[0];indexes.hasOwnProperty(t)||(indexes[t]={});for(var i=0;i<this.length;i++){e=[];for(r=0;r<arguments.length;r++)e.push(this[i][arguments[r]]);e.sort(),e=e.join("|"),indexes[t].hasOwnProperty(e)||(indexes[t][e]=[]),indexes[t][e].push(this[i])}return!0},array.uncache=function(t){if(!indexes)return!1;var e=t;return arguments.length>1&&(e=arguments.sort().join("|")),!!indexes.hasOwnProperty(e)&&(delete indexes[e],!0)},array.deleteProperty=function(t){for(var e=0,r=0;r<this.length;r++)this[r].hasOwnProperty(t)&&(delete this[r][t],e++);return indexes&&this.rebuild(),e},array.rebuild=function(t){if(Array.isArray(t))for(var e=0;e<t.length;e++)delete indexes[t[e]],this.cache(t[e]);else if(indexes)for(var r in indexes)delete indexes[r],this.cache.apply(this,r.split("|"))},array.read=function(t,e,r){var i,a,s=arguments;if(void 0===r&&(r=0),!indexes)return!1;if(!s.length)return indexes;if("object"==typeof t){for(var n in r=s[1],i=[],a=[],t)i.push(n),a.push(t[n]);i.sort(),i=i.join("|"),a.sort(),a=a.join("|")}else i=t,a=e;return!(!indexes.hasOwnProperty(i)||!indexes[i].hasOwnProperty(a))&&(r?r>1?indexes[i][a].slice(0,r):indexes[i][a][0]:indexes[i][a])},array.clear=function(){indexes=!1,filterCount=0,this.length=0},array.unique=function(__prop,__as_object,__new_props){void 0===__as_object&&(__as_object=!0),void 0===__new_props?__new_props=[__prop]:Array.isArray(__new_props)||(__new_props=[__new_props]);var q={};q[__prop]={regex:/(.){1,}/};for(var l=this.get(),ar=[],final=new OGX.List,o,ev,i=0;i<l.length;i++){ev=null;try{ev=eval("l[i]."+__prop)}catch(t){}if(ev&&!ar.includes(ev)&&(ar.push(ev),__as_object)){o={};for(var j=0;j<__new_props.length;j++)o[__new_props[j]]=ev;final.push(o)}}return __as_object?final:ar},array.order=function(t,e){array.sort(dynamicSort(t,e))},array.group=function(t,e,r){if(Array.isArray(t))return array.groupm(t,e,r);for(var i,a={},s=0;s<this.length;s++)(i=extract(this[s],t,e,r))&&(i=i.split(".").pop(),a.hasOwnProperty(i)||(a[i]=new OGX.List),a[i].push(this[s]));return a},array.groupm=function(t,e,r){return function i(a,s){var n=new OGX.List(a),o=e,f=r;void 0!==e&&Array.isArray(e)&&(o=e[s]),void 0!==r&&Array.isArray(r)&&(f=r[s]);var l=n.group(t[s],o,f);if(s+1<=t.length-1)for(var h in l)l[h]=i(l[h],s+1);return l}(this,0)},array.filters={},array.addFilter=function(t,e,r){this.filters.hasOwnProperty(t)||(this.filters[t]=[]);var i={};return"function"==typeof e?i.function=[e,r]:i[e]=r,this.filters[t].push(i),filterCount++,!0},array.removeFilter=function(t){return!!this.filters.hasOwnProperty(t)&&(filterCount-=this.filters[t].length,delete this.filters[t],!0)},array.getFilters=function(){return this.filters},array.resetFilters=function(){this.filters={},filterCount=0},array.setFilters=function(t){for(var e in this.resetFilters(),t)for(var r=0;r<t[e].length;r++)for(var i in t[e][r])array.addFilter(e,i,t[e][r][i])},array.setFilteringMode=function(t){filterMode=t},array.get=function(t,e,r,i,a){void 0===e&&(e=!1),void 0===r&&(r=!1),"number"==typeof r&&(i=r,r=!1),void 0===i&&(i=0),void 0===a&&(a=!1);var s=this.getFilters();for(var n in this.resetFilters(),t){if("object"!=typeof t[n]){var o;o={eq:t[n]},t[n]=o}for(var f in t[n])this.addFilter(n,f,t[n][f])}var l=this.filter(i,a);if(this.resetFilters(),this.setFilters(s),a)return l;if(1===i)return!!l.length&&l[0];if(e)for(var n in e){l.order(n,e[n]);break}return r?(!Array.isArray(r)&&(r=[r]),l.group.apply(l,r)):l},array.unset=function(t,e){void 0===e&&(e=0);var r=new OGX.List,i=this.get(t,null,null,e,!0);if(i)for(var a=0;a<i.length;a++)r.push(this.delete(i[a]-r.length));return 1===e&&r.length?r[0]:r},array.update=function(__filterobj,__updateobj,__strict,__limit){void 0===__strict&&(__strict=!1),void 0===__limit&&(__limit=0);var filtered=this.get(__filterobj,null,__limit);if(filtered&&(Array.isArray(filtered)||(filtered=[filtered]),filtered.length)){for(var affected_indexes=[],idx,ev,i=0;i<filtered.length;i++){if("function"==typeof __updateobj)__updateobj(filtered[i]);else for(var a in __updateobj)ev=doEval("__o."+a,filtered[i]),__strict&&void 0===ev||eval("filtered[i]."+a+"=__updateobj[a]");idx=matchesCache(filtered[i]),idx&&-1===affected_indexes.indexOf(idx)&&affected_indexes.push(idx)}return indexes&&affected_indexes.length&&setTimeout((()=>{that.rebuild(affected_indexes)}),0),filtered}return[]},array.filter=function(__limit,__as_position){void 0===__limit&&(__limit=0),void 0===__as_position&&(__as_position=!1);for(var ar=[],positions=[],isDate,isString,isNum,isArray,isObject,hasFilters=!1,reg=/[0-9]{4}\-[0-9]{2}\-[0-9]{2}( [0-9]{2}\:[0-9]{2}\:[0-9]{2})?/g,isMatch=!1,matches=0,str,o,err,counter,total,i=0;i<this.length;i++)for(var a in isMatch=!0,matches=0,this.filters){err=!1,hasFilters=!0;try{o=null,str="this["+i+"]."+a,o=eval(str)}catch(t){err=!0}var exist_filter=!1;for(var j in this.filters[a])for(var b in this.filters[a][j])if("exist"===b){exist_filter=!0,isMatch="undefined"===o&&!this.filters[a][j][b]||o&&this.filters[a][j][b],isMatch&&matches++;break}if(!exist_filter)if(err||void 0===o)isMatch=!1;else{isDate=!1,isString=!1,isNum=!1,isArray=Array.isArray(o),isObject=!isArray&&"object"==typeof o,isArray?"string"==typeof o[0]?(isString=!0,o[0].match(reg)&&(isDate=!0)):isNum="number"==typeof o[0]:"string"==typeof o?(isString=!0,o.match(reg)&&(isDate=!0)):isNum="number"==typeof o;for(var j=0;j<this.filters[a].length;j++)for(var b in this.filters[a][j]){if(String(this.filters[a][j][b]).length)if("function"===b)isMatch=this.filters[a][j][b][0](this[i],this.filters[a][j][b][1]),isMatch&&matches++;else switch(b){case"eq":if(isDate){if("string"!=typeof this.filters[a][j][b]||!this.filters[a][j][b].match(reg)){isMatch=!1;break}moment(o).format("YYYY-MM-DD")!==moment(this.filters[a][j][b]).format("YYYY-MM-DD")?isMatch=!1:matches++}else if(isString){if("string"!=typeof this.filters[a][j][b]){isMatch=!1;break}o.toLowerCase()!==String(this.filters[a][j][b]).toLowerCase()?isMatch=!1:matches++}else o!==this.filters[a][j][b]?isMatch=!1:matches++;break;case"eqjson":JSON.stringify(o)!==JSON.stringify(this.filters[a][j][b])?isMatch=!1:matches++;break;case"neq":if(isDate){if("string"!=typeof this.filters[a][j][b]||!this.filters[a][j][b].match(reg)){isMatch=!0,matches++;break}moment(o).format("YYYY-MM-DD")===moment(this.filters[a][j][b]).format("YYYY-MM-DD")?isMatch=!1:matches++}else if(isString){if("string"!=typeof this.filters[a][j][b]){isMatch=!0,matches++;break}o.toLowerCase()===this.filters[a][j][b].toLowerCase()?isMatch=!1:matches++}else o===this.filters[a][j][b]?isMatch=!1:matches++;break;case"in":if((isString||isNum)&&Array.isArray(this.filters[a][j][b])){isMatch=!1;for(var k=0;k<this.filters[a][j][b].length;k++)if(isString){if(-1!==o.indexOf(String(this.filters[a][j][b][k]))){isMatch=!0;break}}else if(isNum&&o===this.filters[a][j][b][k]){isMatch=!0;break}isMatch&&matches++}else if(isString||isNum)if(isArray)isString&&-1===o.indexOf(String(this.filters[a][j][b]))||isNum&&o!==this.filters[a][j][b]?isMatch=!1:matches++;else{if(isString&&("string"!=typeof o||"string"!=typeof this.filters[a][j][b])){isMatch=!1;break}isString&&-1===o.toLowerCase().indexOf(this.filters[a][j][b].toLowerCase())||isNum&&o!==this.filters[a][j][b]?isMatch=!1:matches++}else if(isArray)-1===o.indexOf(this.filters[a][j][b])?isMatch=!1:matches++;else if(isObject){for(var p in counter=0,total=0,this.filters[a][j][b])total++,o.hasOwnProperty(p)&&-1!==String(o[p]).toLocaleLowerCase().indexOf(String(this.filters[a][j][b][p]).toLowerCase())&&counter++;isMatch=total===counter,isMatch&&matches++}break;case"nin":if(Array.isArray(this.filters[a][j][b])){for(var k=0;k<this.filters[a][j][b].length;k++)if(isString){if("string"!=typeof this.filters[a][j][b][k]){isMatch=!1;break}if(-1!==o.indexOf(this.filters[a][j][b][k])){isMatch=!1;break}}else if(isNum&&o===this.filters[a][j][b][k]){isMatch=!1;break}isMatch&&matches++}else isString&&"string"==typeof this.filters[a][j][b]?-1!==o.toLowerCase().indexOf(this.filters[a][j][b].toLowerCase())&&(isMatch=!1):isNum?o===this.filters[a][j][b]&&(isMatch=!1):-1!==o.indexOf(this.filters[a][j][b])&&(isMatch=!1),isMatch&&matches++;break;case"gt":if(isDate){if("string"!=typeof this.filters[a][j][b]||!this.filters[a][j][b].match(reg)){isMatch=!1;break}moment(o).unix()<=moment(this.filters[a][j][b]).unix()?isMatch=!1:matches++}else{if("number"!=typeof this.filters[a][j][b]){isMatch=!1;break}o<=this.filters[a][j][b]?isMatch=!1:matches++}break;case"gte":if(isDate){if("string"!=typeof this.filters[a][j][b]||!this.filters[a][j][b].match(reg)){isMatch=!1;break}moment(o).unix()<moment(this.filters[a][j][b]).unix()?isMatch=!1:matches++}else{if("number"!=typeof this.filters[a][j][b]){isMatch=!1;break}o<this.filters[a][j][b]?isMatch=!1:matches++}break;case"lt":if(isDate){if("string"!=typeof this.filters[a][j][b]||!this.filters[a][j][b].match(reg)){isMatch=!1;break}moment(o).unix()>=moment(this.filters[a][j][b]).unix()?isMatch=!1:matches++}else{if("number"!=typeof this.filters[a][j][b]){isMatch=!1;break}o>=this.filters[a][j][b]?isMatch=!1:matches++}break;case"lte":if(isDate){if("string"!=typeof this.filters[a][j][b]||!this.filters[a][j][b].match(reg)){isMatch=!1;break}moment(o).unix()>moment(this.filters[a][j][b]).unix()?isMatch=!1:matches++}else{if("number"!=typeof this.filters[a][j][b]){isMatch=!1;break}o>this.filters[a][j][b]?isMatch=!1:matches++}break;case"btw":if(isDate){if("string"!=typeof this.filters[a][j][b]||!this.filters[a][j][b].match(reg)){isMatch=!1;break}moment(this.filters[a][j][b][0]).unix()>moment(o).unix()||moment(this.filters[a][j][b][1]).unix()<moment(o).unix()?isMatch=!1:matches++}else{if("number"!=typeof this.filters[a][j][b]){isMatch=!1;break}this.filters[a][j][b][0]>o||this.filters[a][j][b][1]<o?isMatch=!1:matches++}break;case"substr":o.toLowerCase().substr(this.filters[a][j][b][0],this.filters[a][j][b][1]).toLowerCase()!==this.filters[a][j][b][2].toLowerCase()?isMatch=!1:matches++;break;case"regex":o.toString().match(this.filters[a][j][b])?matches++:isMatch=!1;break;case"size":isArray&&(o.length!==this.filters[a][j][b]?isMatch=!1:matches++);break;case"empty":isArray&&(!!o.length===this.filters[a][j][b]?isMatch=!1:matches++)}else matches++;if(!isMatch)break}}if("or"===filteringMode?isMatch&&(ar.push(this[i]),positions.push(i)):matches===filterCount&&(ar.push(this[i]),positions.push(i)),__limit&&ar.length===__limit)return __as_position?positions:OGX.List.apply(null,ar)}return __as_position?positions:hasFilters?OGX.List.apply(null,ar):array},array},OGX.Object=function(){"use strict";var t=new OGX.List,e=new OGX.List;function r(t){for(var e=t.split("."),r=OGX,i=0;i<e.length;i++)void 0!==r[e[i]]&&(r=r[e[i]]);return r}e.cache("_NAME_","id"),this.isRegistered=function(t,e){return typeof("undefined"!==this.register[t][e])},this.getExtend=function(e){var r=t.get({main:{eq:e}},null,1);return!!r&&r.extends},this.getExtends=function(e){var r=[],i=t.get({main:{eq:e}},null,1);if(i){var a;r=r.concat(i.extends);for(var s=0;s<i.extends.length;s++)(a=this.getExtends(i.extends[s]))&&(r=r.concat(a))}var n=[];for(s=0;s<r.length;s++)n.includes(r[s])||n.push(r[s]);return n},this.register=function(){var e=Array.prototype.slice.call(arguments),r=e.shift();t.push({main:r,extends:e})},this.create=function(t,i){void 0===i&&(i={});var a=this.getExtends(t),s=!1,n=null,o=null;if(a.length){var f,l,h=r(t);h.prototype=Object.create({}),(f=[]).push(h.prototype);for(var c=0;c<a.length;c++)void 0!==(l=r(a[c]))&&f.push(l.prototype);Object.assign.apply(null,f),h.prototype.constructor=h,a.includes("View")||a.includes("Controller")||a.includes("Stage")?(o=(f=t.split(".")).pop(),n=f.join(".").slice(0,-1)):n=t,s=new h(i)}else OGX.hasOwnProperty(t)&&(s=new OGX[t](i));return o?(s._CLASS_=o,s._NAME_=n):s._NAME_=t,OGX.hasOwnProperty(t)&&OGX[t].hasOwnProperty("FLOAT")&&OGX[t].FLOAT&&(s.floating=!0),!!s&&(e.insert(s),s)},this.cache=function(t){if(void 0===t)return e;e.insert(t)},this.uncache=function(t){e.findDelete("id",t.id)},this.get=function(t,r,i){return e.get(t,r,i)},this.destroy=function(t,r){void 0===r&&(r=!0),"function"==typeof t.blur&&t.blur(),"function"==typeof t.destroy&&t.destroy(),"function"==typeof t.__destroy&&t.__destroy(),r&&t.clear(),t.el&&t.el.remove(),t.parent&&t.parent.nodes.findDelete("id",t.id,1),e.findDelete("id",t.id,1)},this.genId=function(){return"u"+(new Date).getTime()+Math.round(1e3*Math.random())}},"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){"use strict";if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(t),i=1;i<arguments.length;i++){var a=arguments[i];if(null!=a)for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(r[s]=a[s])}return r},writable:!0,configurable:!0});if(void 0===OGX)var OGX={};function require(){OGX.Object.register.apply(null,arguments)}function construct(__that,__cls){var ext=OGX.Object.getExtend(__cls);for(var a in ext)eval("OGX."+ext[a]).call(__that,arguments.callee.caller.arguments[0])}OGX.Object=new OGX.Object;if(OGX.OML=function(e){"use strict";var t=OGX.Data.merge({max_time:0,max_depth:2,render_time:!1},e,!0,!1,!0),n=!1,o=null,r={},i={},a=new OGX.List;function s(){n=!0}function d(e,t){var n,o,r=[];for(var i in t)if(n=/^(\S*)\:Bind$/g.exec(i))if(o=-1!==n[1].indexOf(",")?n[1].split(","):n[1],Array.isArray(t[i]))for(var a=0;a<t[i].length;a++)t[i][a].property=o,r.push({uxi:e,config:t[i][a]});else t[i].property=o,r.push({uxi:e,config:t[i]});return r}function l(e){setTimeout((()=>{f(e.config),e.uxi.bind(e.config)}),0)}function u(e){return e.hasOwnProperty("node:OML")||e.hasOwnProperty("node:OML:OSE")||e.hasOwnProperty("instance")&&e.instance||e.hasOwnProperty("scroll")&&e.scroll}function p(e,t){if("string"==typeof t["node:OML"]){var n=null;t.hasOwnProperty("data")&&(n=t.data),t["node:OML"]=c(t["node:OML"],n)}else if(Array.isArray(t["node:OML"]))for(var o=0;o<t["node:OML"].length;o++)"string"==typeof t["node:OML"][o]&&(t["node:OML"][o]=c(t["node:OML"][o]));else if("object"==typeof t["node:OML"])for(var r in t["node:OML"])if(-1!==r.indexOf(":OML")&&"string"==typeof t["node:OML"][r]){if(/((^default)? ?[\.#]+)|(^default)/.test(r)){var i=r.replace("OML",""),a=c(t["node:OML"][r]);for(var s in a)i+=s.split(":").pop(),t["node:OML"][i]=a[s],delete t["node:OML"][r];r=i}-1!==r.indexOf(":OML")&&(t["node:OML"][r.replace(":OML","")]=c(t["node:OML"][r]),delete t["node:OML"][r])}return e.__proto__.hasOwnProperty("placeholder")&&e.placeholder(t),t}function c(e,t){return void 0===t&&(t={}),0===e.indexOf("{{")?OGX.OSE.exec(e,t):OGX.Data.clone(OGX.Cache.read("oml",e))}function f(e,n,o){var a,s=0;return function e(d){if(!(Array.isArray(d)||"object"!=typeof d||s>=t.max_depth)){var l=!1;for(var u in d)-1!==u.indexOf(":OSE")?(a=u.split(":OSE").shift(),"string"!=typeof d[u]?d[a]=d[u]:d[a]=OGX.OSE.exec(d[u],n,r,o,i),delete d[u],l||(l=!0,s++),e(d[a])):-1!==u.indexOf(":")||"object"!=typeof d[u]||Array.isArray(d[u])||d[u]instanceof HTMLElement||d[u]instanceof jQuery||(l||(l=!0,s++),e(d[u]))}}(e),e}function h(e,t){switch(e){case"scope":return OGX.Scope.fork(t);default:return OGX.OSE.fork(e,t)}}function O(e,t,n){var o;if(n.hasOwnProperty("isUxi"))n.parent&&n.detach(),n.floating?n.attach(e,e.el):n.attach(e,t);else if("*"===t){var r=null,i=null;if(n.hasOwnProperty("parent"))if(n.parent.hasOwnProperty("lookup")&&n.parent.hasOwnProperty("lookdown")){if(r=e.lookup(n.parent.lookup)){var a=r.lookdown(n.parent.lookdown);a&&(r=a)}}else n.parent.hasOwnProperty("lookup")?r=e.lookup(n.parent.lookup):n.parent.hasOwnProperty("lookdown")&&(r=e.lookdown(n.parent.lookdown));else r=e;if(r&&(o=r.el),n.hasOwnProperty("parent")&&n.parent.hasOwnProperty("el")?o=n.parent.el:r.hasOwnProperty("pholders")&&r.pholders&&(o=r.pholders[0]),n.hasOwnProperty("target"))if(n.target.hasOwnProperty("lookup")&&n.target.hasOwnProperty("lookdown")){if(i=e.lookup(n.target.lookup)){var s=i.lookdown(n.target.lookdown);s&&(i=s)}}else n.target.hasOwnProperty("lookup")?i=e.lookup(n.target.lookup):n.target.hasOwnProperty("lookdown")&&(i=e.lookdown(n.target.lookdown));r&&i&&(i.detach(),i.attach(r,o))}else{var d=app.cfind(null,t);if(d){if(d.parent&&d.detach(),n.hasOwnProperty("parent")){var l=OGX.Object.get(n.parent,null,1);l&&(e=l)}o=e.el,n.hasOwnProperty("el")?o=n.el:e.hasOwnProperty("pholders")&&e.pholders&&(o=e.pholders[0]),d.attach(e,o)}}}this.maxDepth=function(e){if(void 0===e)return t.max_depth;t.max_depth=e},this.maxRenderTime=function(e){if(void 0===e)return t.max_time;t.max_time=e},this.get=function(e){return OGX.Cache.read("oml",e)},this.make=function(e,t,n){var o={};return o[e+":"+t]=n,o},this.parse=function(e){return"string"==typeof e&&("{"!==e.substr(0,1)&&(e="{"+e+"}"),e=JSON.parse(e)),e},this.rename=function(e,t,n){function o(e,t,n){var o={};for(var r in e)o[r.replace(t,n)]=e[r];return o}void 0===n&&(n="default"),Array.isArray(n)||(n=[n],t=[t]);for(var r=0;r<n.length;r++)e=o(e,n[r],t[r]);return e},this.isOML=function(e){if("string"==typeof e&&0===e.trim().indexOf("{")&&(e=JSON.parse(e)),"object"==typeof e&&!Array.isArray(e))for(var t in e)if(-1!==t.indexOf(":"))return!0;return!1},this.result=function(e,t){if(e){if(void 0===t){var n=a.get({id:{eq:e}},null,1);return!!n&&n.result}a.findDelete("id",e),a.insert({id:e,result:t})}else a=new OGX.List},this.getNodeClass=function(e){for(var t in e)return t.split(":")[1];return null},this.getNodeId=function(e){for(var t in e)if(e[t].hasOwnProperty("id"))return e[t].id;return null},this.getNodeById=function(e,t){return this.getNodeByProp(e,"id",t)},this.getNodeByName=function(e,t){return this.getNodeByProp(e,"name",t)},this.getNodeByProp=function(e,t,n){return function e(o){var r;for(var i in o){if(o[i].hasOwnProperty(t)&&o[i][t]===n)return o[i];if(o[i].hasOwnProperty("node:OML"))if(Array.isArray(o[i]["node:OML"])){for(var a=0;a<o[i]["node:OML"].length;a++)if(r=e(o[i]["node:OML"][a]))return r}else if(r=e(o[i]["node:OML"]))return r}return!1}(e)},this.make=function(e,t,n){void 0===n&&(n={});var o={};return o[e+":"+t]=n,o},this.replaceDataRecursive=function(e,t,n){function o(e){var r,s;for(var d in e)if(-1!==d.indexOf(":OSE"))r=d.split(":OSE"),(s=a(e[d],t,n))&&(e[r[0]]=s,delete e[d],o(e[r[0]]));else if("node:OML"===d)if("string"==typeof e[d]&&0===e[d].indexOf("{{"))e[d]=OGX.OSE.exec(e[d]),i(e[d]);else if(Array.isArray(e[d]))for(var l=0;l<e[d].length;l++)i(e[d][l]);else i(e[d])}function i(e){var r;for(var i in e)-1!==i.indexOf("{{")&&(r=a(i,t,n))&&(e[r]=e[i],delete e[i],i=r),o(e[i])}function a(e,t,n){var o,i,a=/{{([\S ]+)}}/gi;for(n&&(r[n]=t);o=a.exec(e);){if(i=OGX.OSE.exec(o[0],t,r),-1!==["string","number"].indexOf(typeof i))e=e.replace(o[0],i);else if(-1!==["boolean","object"].indexOf(typeof i))return i;a.lastIndex=0}return e}i(e)},this.render=function(e,r,i,a,g){return r=(r=p(e,{"node:OML":r}))["node:OML"],"function"!=typeof g&&(g=!1),t.max_time&&(n=!1,o&&clearTimeout(o),o=setTimeout(s,t.max_time)),function(e,t,o,r,i){var a=[],s=((new Date).getTime(),[]),g=[];function v(e,t){var i,l,m,w,y,x,b,G,M,P,L,X,_,k,S;if(!n)if(Array.isArray(e))for(var A=0;A<e.length;A++)v(e[A],t);else for(G in e)if((L=/((?!:)[\S ]+):(\S+)/gi.exec(G))&&(i=L[1],void 0!==(l=m=L[2])&&(-1!==i.indexOf("{{")&&"object"==typeof e[G]["data:OML"]&&(i=OGX.Templater.make(i,e[G]["data:OML"]),delete e[G]["data:OML"]),"string"==typeof e[G]&&0===e[G].indexOf("{{")&&(e[G]=c(e[G])),-1===["Route","OML"].indexOf(l)))){switch(m.indexOf(".")>0&&(m=m.substr(0,m.indexOf(".")-1)),x=e[G],e[G].hasOwnProperty("node:OML")&&(e[G]=p(e,e[G])),y=!0,w=!0,X=!1,k=!1,m){case"Function":return w=!1,x.parent=t,x.fnc=i,x=f(x,o,r),void OGX.Fonction(x,o,r);case"Uxi":return void O(t,i,e[G]);case"Fork":(P=h(i,e[G]))&&v(P,t),w=!1,y=!1;break;case"Html":x.el=i,x.html=e[G].html,(w=u(x))||(x.template=!1);break;case"Template":x.template=l.split(".")[1],x.el=i,w=u(x),l="Html";break;case"Controller":x.id=i,x.enabled=!1,k=!0;break;case"Scroller":S=$(i),x.el=i,x.content=S.html(),S.empty();break;default:-1!==[".","#"].indexOf(i.substr(0,1))?x.el=i:("node"!==i&&(x.id=i),x.el=t.el[0],x.parent=t,x.floating=!0)}y&&(x=f(x,o,r)),M=!1,w?(b=OGX.Object.create(l,x),s.push(b),t.add(b),M=b):X?(X.blur(),$(i).html(_),X.el=$(i),t.add(X),setTimeout((()=>{t.blured||X.focus()}),0)):(M=t,"Html"===l&&OGX.HtmlRender(x)),M&&e[G].hasOwnProperty("node:OML")&&!X?v(e[G]["node:OML"],M):M&&-1!==G.indexOf(":Point")&&v(b.oml(),b),w&&(b.parent=t,"function"==typeof b.construct&&(k?g.push({object:b,data:[o]}):b.construct.apply(b,[o]))),void 0!==b&&b&&!k&&(a=a.concat(d(b,e[G])))}}v(t,e),!e.floating&&e.parent&&e.focus(1);a.length&&function(e){for(var t=0;t<e.length;t++)l(e[t])}(a);(function(e){for(var t=0;t<e.length;t++)e[t].object.construct.apply(e[t].object,e[t].data),e[t].object.enabled=!0,e[t].object.parent.blured||e[t].object.focus()})(g),i&&i(s);return s}(e,r,i,a,g)}},void 0===OGX)var OGX={};OGX.Stages={},OGX.Views={},OGX.Controllers={},require("Core","Uxi","Touch"),OGX.Core=function(e){construct(this,"Core");var t,n=this,o=OGX.Data.merge(e,{encrypted:!1,exportable:!1,max_render_time:300,max_depth:2,render_time:!1,disable_context:!1,unique:!1,ready:null,exit:!0}),r={jwt:!0,scope:["public"],routing:{},stages:{always_on:!1,blured:!0,closeable:!1,anim:!1},overlays:{delay:200,anim:"fade"},popups:{blured:!1,sleeping:!1},splash:{enabled:!1,image:null,color:null,auto_hide:!1,hide_timeout:0},theater:!1,observe:!1,chromeos:!1},i=!1,a=!1,s=null,d=!1,l=/(iPhone|iPod|iPad)/i.test(navigator.userAgent),u=matchMedia("(prefers-color-scheme: dark)").matches,p=null,c=!1,f=null;function h(e){n.remove("Popup",e.id),e.cb&&e.cb(e.params),i.el.trigger(OGX.Popup.CLOSE,e.id)}function O(e){e.matches}function g(){"function"==typeof n.construct&&n.construct(),function(e){var o,r,i,a,s=0,d=0;for(var l in t.vapps)s++;for(l in t.vapps)r=(o=l.split(":"))[0],i=o[1],(a=OGX.Data.merge(t.vapps[l],t.stages,!1,!0)).id=r,a.hasOwnProperty("node:OML")&&a["node:OML"]?(n.observeOnce({childList:!0,subtree:!0},(()=>{++d===s&&e()})),n.addStage(i,a)):(n.addStage(i,a),++d===s&&e())}(v)}function v(){t.theater&&function(){for(var e=n.gather("Stage"),o=[],r=0;r<e.length;r++)e[r].theater&&o.push(e[r]);t.theater.stages=o,t.theater.el="body",n.theater=n.create("Theater",t.theater)}(),t.routing&&(n.router=new OGX.Router(t.routing),n.router.init(),n.router.start()),!0,$(document).trigger(OGX.App.READY),"function"==typeof o.ready&&o.ready()}function m(e){return e}function w(e,t){var n,o=e.split(" ");return o.sort(),n=t?"in":"out","ogx_stage_"+o.join("_")+"_"+n}function y(){$(window).off(n.touch.down+" scroll",y),c=!0}function x(e){o.unique&&localStorage.removeItem("ogx"),!o.exit&&c&&(e.preventDefault(),e.returnValue=!0)}function b(){OGX.Net=new OGX.Net({ios:l,encrypted:o.encrypted,key:f,app:n}),OGX.Net.load("app.json",G)}function G(e){if(!o.encrypted||(e=function(e){return e=OGX.Data.decrypt(e,f),JSON.parse(e)}(e))){if(o.disable_context&&(window.oncontextmenu=function(){return!1}),o.exportable||(delete OGX.Uxi.prototype.toOML,delete OGX.Controller.prototype.toOML,delete OGX.View.prototype.toOML),o.exit&&!o.unique||window.addEventListener("beforeunload",x),o.unique){var a="function"==typeof o.unique;if(!function(){var e=!1;(p=sessionStorage.getItem("ogx-tab"))?p=OGX.Data.decrypt(p):(p=(new Date).getTime()+"-"+Math.round(1e3*Math.random()),sessionStorage.setItem("ogx-tab",OGX.Data.encrypt(p)));var t=localStorage.getItem("ogx");return t?(t&&(t=OGX.Data.decrypt(t)),t&&("object"!=typeof t&&(t=JSON.parse(t)),t&&t.instance!==p?t.unix+1500<(new Date).getTime()&&(t={instance:p,unix:(new Date).getTime()},localStorage.setItem("ogx",OGX.Data.encrypt(JSON.stringify(t))),e=!0):e=!0)):(t={instance:p,unix:(new Date).getTime()},localStorage.setItem("ogx",OGX.Data.encrypt(JSON.stringify(t))),e=!0),e&&OGX.Workers.run(m,null,null,1e3,p,(function(e){var t={instance:e,unix:(new Date).getTime()};localStorage.setItem("ogx",OGX.Data.encrypt(JSON.stringify(t)))})),e}())return a&&o.unique(!1),void n.el.trigger(OGX.App.DUPLICATE);a&&o.unique(!0)}o.exit&&!o.unique||$(window).on(n.touch.down+" scroll",y),function(e){d=void 0!==window.ontouchstart,l&&$("body").addClass("ios"),t=OGX.Data.weld(e,r,!1,!1),n.el=$("body")}(e),OGX.Scope=new OGX.Scope(t.jwt),OGX.OML=new OGX.OML(o),t.splash.enabled&&(s=new OGX.Splash(t.splash)),OGX.Net.preload(t.preload,g),n.observeSize(!0,(()=>{i&&setTimeout((()=>{i.resize(!1),i.gather().forEach((e=>{void 0!==e.resize&&e.resize(!1)}))}),150)})),function(e){if(e){var t=window.matchMedia("(prefers-color-scheme: dark)");t.addListener(O)}else t.removeListener(O)}(!0)}}if(this.blured=!1,this.router=!1,this.exit=function(e){if(void 0===e)return o.exit;o.exit=e},this.version=function(e){OGX.Net.load("manifest.json",(t=>{"object"==typeof t&&t.hasOwnProperty("version")?e(t.version):e(!1)}))},this.isWebView=function(){return d},this.isTouch=function(){return this.touch.touchable()},this.iOS=function(){return l},this.getURL=function(){return this.router.url()},this.isDarkMode=function(){return u},this.toggleTheme=function(){var e="(prefers-color-scheme: ";return u?($("head").children('link[data="dark"]').attr("media",e+"light)"),$("head").children('link[data="light"]').attr("media",e+"dark)")):($("head").children('link[data="dark"]').attr("media",e+"dark)"),$("head").children('link[data="light"]').attr("media",e+"light)")),u=!u,this},this.moveNode=function(e,t,n){return e.detach(),e.attach(t,n),this},this.dropNode=function(e,t){var n,o;return[n,o]="string"==typeof e?[e,t]:[e._NAME_,e._CLASS_],delete OGX[n+"s"][o],this},this.addStage=function(e,n,o){void 0===o&&(o=!0),OGX.Data.merge(n,t.stages),n.el="body",n.enabled=!1;var r=OGX.Object.create(e,n);return this.add(r),o&&(n.hasOwnProperty("node:OML")?OGX.OML.render(r,n["node:OML"],null,null,(()=>{r.construct(n)})):r.construct(n)),n.enabled||r.sleep(),r},this.removeStage=function(e){var t=this.cfind("Stage",e);return!!t&&(t.destroy(),t.kill(),this.find("Stage",e,"remove"),!0)},this.getStage=function(e){if(void 0===e)return i||a;var t=this.find("Stage",e);return t||!1},this.showStage=function(e,t){if(!i||i.id!==e){var o=this.cfind("Stage",e);return o&&(void 0===t&&(t=o.anim?o.anim:!!a.anim&&a.anim),t?a?(o.enable(),o.wake(),o.show(),a.el.on("animationend",(function(){a.el.off("animationend"),n.el.trigger(OGX.Stage.SWAP,{old:a,new:o}),a.hide(),a.sleep(),o.el.removeClass(w(t,1)),a.el.removeClass(w(t,0)),i=a=o})),o.el.css("display","block"),o.el.addClass(w(t,1)),a.el.addClass(w(t,0))):(o.enable(),o.wake(),o.show(),o.el.css("display","block"),i=a=o):(a&&a.id!==o.id&&(a.hide(),a.sleep()),o.sleeping&&(o.enable(),o.wake()),o.el.css("display","block"),i=a=o,a.show())),this}},this.getWindow=function(e){return this.cfind("Window",e)},this.getWindows=function(){return this.gather("Window")},this.windowExists=function(e){return!1!==this.cfind("Window",e)},this.addWindow=function(e,n){var o;if((e=OGX.Data.merge(e,t.windows)).hasOwnProperty("data")?(o=e.data,delete e.data):o={},void 0===n||!n){if(!a)return!1;n=a}if(n){var r;if(e.el=n.el,e.parent=n,e.hasOwnProperty("node:OML")){e.hasOwnProperty("id")||(e.id=OGX.Object.genId());var i=void 0!==e.scroll&&e.scroll;if(i){delete e.scroll;var s=e["node:OML"];delete e["node:OML"]}var d=OGX.OML.make(e.id,"Window",e);i&&(d[e.id+":Window"]=e,d[e.id+":Window"]["node:OML"]=[{"default:Scroller":{"node:OML":s}}]),r=OGX.OML.render(n,d,o).shift(),i&&(r.scroller=r.children("Scroller")[0],r.scroll=!0)}else r=n.create("Window",e);return r}return!1},this.windowOpen=function(e){return this.cfind("Window",e).status===OGX.Window.OPEN},this.showWindow=function(e,n,o,r){!0===n&&(n=t.anim);var i=this.cfind("Window",e);return!!i&&(i.sleeping&&attachWindow(e),i.blured&&i.focus(),i.show(n,o,r),!0)},this.hideWindow=function(e,n,o,r){return!0===n&&(n=t.anim),"string"!=typeof e&&(e=this.findWindow(e).id),this.cfind("Window",e).hide(n,o,r),this},this.swapWindows=function(e,t){var n,o,r,i;return!(!this.windowExists(e)||!this.windowExists(t))&&(n=this.getWindow(e),o=this.getWindow(t),r=n.el.css("z-index"),i=o.el.css("z-index"),n.el.css("z-index",i),o.el.css("z-index",r),!0)},this.sleepWindow=function(e){return this.cfind("Window",e).sleep(),this},this.blurWindow=function(e){return this.cfind("Window",e).blur(),this},this.focusWindow=function(e){return this.cfind("Window",e).focus(),this},this.removeWindow=function(e){return this.find("Window",e,"remove")},this.removeWindows=function(e){for(var t=0;t<e.length;t++)this.removeWindow(e[t]);return this},this.removeAllWindows=function(e){void 0===e&&(e=[]);for(var t=this.gather("Window"),n=0;n<t.length;n++)e.includes(t[n].id)&&this.removeWindow(t[n].id);return this},this.findWindow=function(e){for(var t=e;t.hasOwnProperty("parent")&&t.parent;){if("Window"===t.parent._NAME_)return t.parent;t=t.parent}return!1},this.addPopup=function(e,n){var o;if(e.hasOwnProperty("data")?(o=e.data,delete e.data):o={},void 0!==n&&n||(n=i),e.el=n.el[0],e.parent=n,e.chromeos=t.chromeos,e.hasOwnProperty("anim")&&!0===e.anim&&(e.anim=t.popup.anim),e.hasOwnProperty("node:OML")){var r=void 0!==e.scroll&&e.scroll;if(r){delete e.scroll;var a=e["node:OML"];delete e["node:OML"]}e.hasOwnProperty("id")||(e.id=OGX.Object.genId());var s=OGX.OML.make(e.id,"Popup",e);r&&(s[e.id+":Popup"]=e,s[e.id+":Popup"]["node:OML"]=[{"default:Scroller":{"node:OML":a}}]),popup=OGX.OML.render(n,s,o).shift(),r&&(popup.scroll=!0,popup.scroller=popup.children("Scroller")[0])}else popup=n.create("Popup",e);return popup},this.removePopup=function(e,t,o,r,i){var s=!1;void 0===i&&(i=a,s=!0),void 0===o&&(o=!1),void 0===r&&(r=!1),void 0===t&&(t=!0);var d=null;return!!(d=s?i.find("Popup",e):n.cfind("Popup",e))&&(d.hide(t,h,{id:e,cb:o,params:r},null,!0),!0)},this.findPopup=function(e){var t;t=e instanceof HTMLElement?e:e.el;var n=$(t).parents(".ogx_popup");if(n.length){var o=$(n[0]).data("ogx-id");return this.cfind("Popup",o)}return!1},this.getVisiblePopups=function(){for(var e=this.gather("Popup"),t=[],n=0;n<e.length;n++)"visible"===e[n].el.css("visibility")&&t.push(e[n]);return t},this.popupExists=function(e){return!1!==this.cfind("Popup",e)},this.groupPopups=function(e,t,o){void 0===o&&(o={});var r={drag:!0,resize:!0,anim:!1,title:!1,icon:!1,icons:!1};o&&OGX.Data.merge(r,o,!0);var i=e.id,a=t.id,s=e.nodes.get({_NAME_:{eq:"Container"}},null,1),d=t.nodes.get({_NAME_:{eq:"Container"}},null,1);if(s&&d){var l=s.nodes.get({_NAME_:{eq:"Carousel"}},null,1),u=s.nodes.get({_NAME_:{eq:"Tabs"}},null,1),p=d.nodes.get({_NAME_:{eq:"Carousel"}},null,1),c=(g=d.nodes.get({_NAME_:{eq:"Tabs"}},null,1)).index(),f=l.panels().slice();e.nodes=new OGX.List;for(var h=0;h<f.length;h++)g.add(u[h]),k=f[h].instance?{"default:Uxi":f[h].instance}:{"default:Html":{html:f[h].html}},p.addNode(k,null,!1);c+=u.length,p.showPanel(c,!1),g.index(c),n.removePopup(e.id,!1,!1,!1,e.parent),$(document).trigger(OGX.Popup.GROUP,{popups:[i,a],popup:t})}else if(s||d){var O,g,v,m;s?(O=s.nodes.get({_NAME_:{eq:"Carousel"}},null,1),g=s.tabs,A=t,v=e):(O=d.nodes.get({_NAME_:{eq:"Carousel"}},null,1),g=d.tabs,A=e,v=t),A.nodes.length?((m=A.nodes[0]).detach(),A.nodes=new OGX.List,k={"default:Uxi":m}):k={"default:Html":{html:A.el.find(".ogx_popup_body").first().html()}};var w=A.title();n.removePopup(A.id,!1,!1,!1,A.parent),O.addNode(k,null,!0,!1,(function(){$(document).trigger(OGX.Popup.GROUP,{popups:[i,a],popup:v})})),g.icons()?g.add({label:w,icon:A.icon()}):g.add({label:w}),g.index(g.set().length-1)}else{var y=e.nodes;y=!!y.length&&y[0];var x,b,G=t.nodes;G=!!G.length&&G[0],y?(y.detach(),x={"default:Uxi":y}):x={"default:Html":{html:e.el.find(".ogx_popup_body").children().first().detach()}},G?(G.detach(),b={"default:Uxi":G}):b={"default:Html":{html:t.el.find(".ogx_popup_body").children().first().detach()}};var M=r.icon||e.group_icon||t.icon()||e.icon();"boolean"==typeof M&&(M=!1),r.icon=M;var P=r.icons||t.icons()||e.icons();"boolean"==typeof P&&(P=!1),!(P&&Array.isArray(P)&&P.length)&&(P=!1),r.icons=P,r.maximize=t.max||e.max,r.maximize_dbc=t.max_dbc||e.max_dbc,r.title=r.title||t.title()||e.title();var L=this.gather("Popup");L=L.get({id:{in:e.group}});var X=e.group+"_"+L.length,_=[{label:t.title()},{label:e.title()}];P&&(_[0].icon=t.icon(),_[1].icon=e.icon());var k={id:X,width:e.el.width(),height:e.el.height(),group:e.group,group_icon:e.group_icon,"node:OML":[{"default:Container":{index:1,tabs:{icons:P,remove:!0,list:_},"node:OML":[b,x]}}]};OGX.Data.merge(k,r,!0);var S=e.parent,A=n.addPopup(k,e.parent);this.removePopup(e.id,!1,!1,!1,S),this.removePopup(t.id,!1,!1,!1,S),$(document).trigger(OGX.Popup.GROUP,{popups:[i,a],popup:A})}return this},this.ungroupPopup=function(e,t,n,o,r){var i=e.nodes.get({_NAME_:{eq:"Container"}},null,1),a=e.icon(),s=e.icons(),d=i.tabs.val();"object"==typeof d&&void 0!==d.icon&&(a=d.icon);var l=i.carousel,u=l.getPanel(t),p=e.parent,c=e.width(),f=e.height(),h=e.resizable,O=e.dragable,g={};if(u.instance){var v=l.nodes.get({id:{eq:u.instance.id},_NAME_:{eq:u.instance._NAME_}},null,1);v&&(g["default:Uxi"]=v)}else g["default:Html"]={html:u.html};l.removePanel(t,!1),l.nodes.length?l.nodes.length:this.removePopup(l.parents("Popup",1).id,!1);var m=OGX.Object.genId(),w={id:m,group:e.group,title:n,resize:h,drag:O,width:c,height:f,icon:a,icons:s,"node:OML":[g]};if(void 0!==o){var y=e.el.position(),x=e.el.offset();w.x=y.left+(o-x.left),w.y=y.top+(r-x.top)}return this.addPopup(w,p),$(document).trigger(OGX.Popup.UNGROUP,{from_popup:e.id,from_index:t,to_popup:m}),this},this.addOverlay=function(e,t){return void 0===t&&(t=a),!!t&&(t.addOverlay(e),!0)},this.removeOverlay=function(e,t){return void 0===t&&(t=a),t&&t.removeOverlay(e),this},this.theater=!1,this.getJSON=function(e){return OGX.Data.clone(OGX.Cache.read("json",e))},this.getOML=function(e){return OGX.Data.clone(OGX.Cache.read("oml",e))},this.goto=function(e,t){return this.router.goto(e,t)},this.splash=function(){return s},this.splash.hide=function(){if(!s)return!1;s.hide((()=>{s.destroy(),s=null}))},this.getDefaults=function(e){return t[e]},o.encrypted)if("function"==typeof o.encrypted){var M=o.encrypted();o.encrypted=!0,M.then((e=>{f=e,setTimeout(b,0)}),(()=>{}))}else(f=document.cookie.match("(^|[^;]+)\\s*ogx_key\\s*=\\s*([^;]+)"))&&(f=decodeURIComponent(f.pop()),document.cookie="ogx_key=; expires=Thu, 01 Jan 1970 00:00:01 GMT;"),setTimeout(b,0);else setTimeout(b,0)},OGX.App=function(e){"use strict";return void 0===e&&(e={}),e.el="document",e.always_on=!0,e.hasOwnProperty("core")&&e.core||(e.core="Core"),OGX.Core=OGX.Object.create(e.core,e),OGX.Core},OGX.App.LOADING="AppLoading",OGX.App.READY="AppReady",OGX.App.DUPLICATE="AppDuplicate";OGX.Audio=function(){"use strict";var e=!1;this.get=function(e){var t;return!!(t=OGX.Cache.read("snd",e))&&t},this.play=function(t,i,n){void 0===i&&(i=1),void 0===n&&(n=!1);var o=this.get(t);return!!o&&(o.hasOwnProperty("howl")?(o.howl.volume(i),o.howl.loop(n)):o.howl=new Howl({src:["snd/"+o.file],loop:n,volume:i}),e?o.howl.play():setTimeout((()=>{o.howl.play()}),0),!0)},this.stop=function(e){if(void 0!==e){var t=this.get(e);if(t)return t.howl.stop(),!0}return!1},this.prepare=function(){for(var e=OGX.Cache.get({ext:{eq:"snd"}}),t=0;t<e.length;t++)e[t].hasOwnProperty("howl")||(e[t].howl=new Howl({src:["snd/"+e[t].file]}))},$(document).on("touchstart mousedown",(function t(){e=!0,$(document).off("touchstart mousedown",t)}))},OGX.Audio=new OGX.Audio,OGX.Bind=function(e){"use strict";var t=this,i={object:null,event:null,mode:"eq",action:"filter",property:null,remote_property:null,function:null,min_length:0,convert:!0},n={};function o(e,i){var n,o,s,l,c="string"==typeof i.object;function d(e,n){if("object"==typeof n){if(function(e,i){for(var n in e.__p)t.unbindFilter(n);e.__p={}}(i),i.remote_property&&Array.isArray(i.remote_property)){var s=0;for(var l in n)i.__p[i.remote_property[s]]=!0,o(i.remote_property[s],i.mode,n[l]),r(i.remote_property[s],n[l]),s++;return}if(i.remote_property){var c=i.object.bindValue();n="object"==typeof c?Array.isArray(c)?(c=new OGX.List(c)).unique(i.remote_property,!1):c[i.remote_property]:c,o(i.property,i.mode,n,i.function),r(i.property,n),a(i,n)}else{if(Array.isArray(i.property)){s=0;for(var l in n)i.__p[i.property[s]]=!0,o(i.property[s],i.mode,n[l],i.function),r(i.property[s],n[l]),s++;return}o(i.property,i.mode,n,i.function),r(i.property,n),a(i,n)}}else i.remote_property?(o(i.remote_property,i.mode,n,i.function),r(i.remote_property,n)):(o(i.property,i.mode,n,i.function),r(i.property,n))}function u(e){if(i.min_length&&e.target.value.length<i.min_length&&e.target.value.length)return!1;var t=e.target.value;i.convert&&(t=OGX.Data.stringToVal(t)),o(i.property,i.mode,t,i.function)}switch(c?(e&&(i.object={el:$(i.object)},n=i.event),s=u):(e&&(n=OGX[i.object._NAME_].BIND),s=d),i.action){case"render":o=t.bindRender;break;case"filter":o=t.bindFilter}e?(i.object.el.on(n,s),c?u({target:{value:i.object.el.val()}}):(null!==(l=i.object.bindValue?i.object.bindValue():i.object.val())&&Array.isArray(l)&&l.hasOwnProperty("insert")&&(l=JSON.parse(JSON.stringify(l))),null!==l&&d(0,l))):i.object.el.off(n,s)}function a(e,t){for(var i in t)e.__p[i]=!0}function r(e,i){t.el.trigger(OGX.Bind.FILTER,{property:e,value:i})}this.bind=function(e){return!!(e=OGX.Data.merge(i,e,!0,!0,!0)).property&&(e.object&&"string"==typeof e.object&&(e.event="input change",e.action="filter"),e.__p={},n.hasOwnProperty(e.property)||(n[e.property]=[]),n[e.property].push(e),o(!0,e),!0)},this.unbind=function(e){for(var t=0;t<n[e].length;t++)o(!1,n[e][t]);return delete n[e],!0},this.clearBinds=function(){for(var e in n){for(var t=0;t<n[e].length;t++)o(!1,n[e][t]);delete n[e]}},e.hasOwnProperty("bind")&&setTimeout((()=>{t.bind(e.bind)}),0)},OGX.Bind.prototype.unbindFilter=function(e){},OGX.Bind.prototype.bindFilter=function(e,t,i){},OGX.Bind.prototype.bindRender=function(e,t){},OGX.Bind.prototype.bindValue=null,OGX.Bind.FILTER="bindFilter",OGX.Cache=function(){"use strict";var e=new OGX.List;e.cache("ext","id"),this.read=function(t,i){var n=e.read({ext:t,id:i},1);return!!n&&("snd"===n.ext?n:n.data)},this.get=function(t,i){return void 0===i&&(i=0),e.get(t,null,null,i)},this.set=function(t){e=new OGX.List(t)},this.add=function(t){if(Array.isArray(t))for(var i=0;i<t.length;i++)e.insert(t[i]);else e.insert(t)},this.remove=function(t,i,n){void 0===n&&(n=1);var o={};return void 0!==t&&t&&(o.ext={eq:t}),void 0!==i&&i&&(o.id={eq:i}),e.unset({ext:{eq:t},id:{eq:i}},n)},"undefined"!=typeof __array&&this.set(__array)},OGX.Cache=new OGX.Cache,require("Calendar","Uxi","Bind","Touch"),OGX.Calendar=function(e){construct(this,"Calendar");var t,i,n,o,a=this,r=e,s={display_date:moment(),date:!1,format:"YYYY-MM-DD",layouts:[{layout:{name:"DECADE_YEARS"},engine:{name:"YEAR_NUMBER"}},{layout:{name:"YEAR_MONTHS"},engine:{name:"CELL_VALUE",config:{format:"MMM"}}},{layout:{name:"MONTH_DAYS"},engine:{name:"DAY_NUMBER"}}],layout:2,simple:!1,selectable:!0,no_selection:!1,off_dates:!1,mode:"select",swipe:!0,browse:!0,chromeos:!1,callbacks:{select:null,unselect:null}},l=[],c={x:1,y:1},d=!1;function u(e){e?(i.on(a.touch.down,".ogx_calendar_left",h),i.on(a.touch.down,".ogx_calendar_right",h),i.on(a.touch.down,".ogx_calendar_up",f),i.on(a.touch.down,".ogx_calendar_down",f)):(i.off(a.touch.down,".ogx_calendar_left",h),i.off(a.touch.down,".ogx_calendar_right",h),i.off(a.touch.down,".ogx_calendar_up",f),i.off(a.touch.down,".ogx_calendar_down",f))}function h(e){e.preventDefault(),e.stopImmediatePropagation(),d||(d=!0,$(this).hasClass("ogx_calendar_left")?(a.el.trigger(OGX.Calendar.BROWSE,-1),t.swipeLeft()):(a.el.trigger(OGX.Calendar.BROWSE,1),t.swipeRight()),setTimeout((()=>{d=!1}),350))}function f(e){e.preventDefault(),e.stopImmediatePropagation(),d||(d=!0,$(this).hasClass("ogx_calendar_up")?o>0&&(a.el.trigger(OGX.Calendar.LAYOUT_CHANGE,1),t.swipeDown()):o+1<r.layouts.length&&(a.el.trigger(OGX.Calendar.LAYOUT_CHANGE,-1),t.swipeUp()),setTimeout((()=>{d=!1}),350))}function _(e){e?i.on("click",".ogx_calendar_layout_item",g):i.off("click",".ogx_calendar_layout_item",g)}function g(e){var t=$(this),i=t.data("ogx-date");r.no_selection&&r.no_selection.includes(i)||("toggle"===r.mode&&t.hasClass("ogx_calendar_selected_item")?(v(),a.onUnselect(),a.el.trigger(OGX.Calendar.UNSELECT,""),r.date=!1):(v(),m(i),r.date=moment(i),r.display_date=r.date.clone(),a.onSelect(r.date.clone()),a.el.trigger(OGX.Calendar.SELECT,r.date),b()),setTimeout(p,0))}function p(){for(var e=t.getCells(),i=0;i<e.length;i++)0==e[i].offset.x&&0==e[i].offset.y||G(e[i].abs,e[i].rel,e[i].offset,$(e[i].element).children(0)[0])}function m(e){a.el.find('.ogx_calendar_layout_item[data-ogx-date="'+e+'"]').addClass("ogx_calendar_selected_item")}function v(){a.el.find(".ogx_calendar_selected_item").removeClass("ogx_calendar_selected_item")}function y(){b(),w(l[o].labels(r.display_date));for(var e=t.getCells(),i=0;i<e.length;i++)G(e[i].abs,e[i].rel,e[i].offset,$(e[i].element).children(0)[0])}function x(e){e?(i.on(OGX.GridSwiper.SWIPE_START,(function(){r.selectable&&_(!1)})),i.on(OGX.GridSwiper.SWIPE_END,(function(){r.selectable&&_(!0)})),i.on(OGX.GridSwiper.SWIPE_LEFT,(function(e,t){var i=l[o].value();O(i.value,i.unit),w(l[o].labels(r.display_date))})),i.on(OGX.GridSwiper.SWIPE_RIGHT,(function(e,t){var i=l[o].value();O(-1*i.value,i.unit),w(l[o].labels(r.display_date))})),i.on(OGX.GridSwiper.SWIPE_UP,(function(e,t){o=t.cell.y-1,b(),w(l[o].labels(r.display_date))})),i.on(OGX.GridSwiper.SWIPE_DOWN,(function(e,t){o=t.cell.y-1,b(),w(l[o].labels(r.display_date))}))):(i.off(OGX.GridSwiper.SWIPE_LEFT),i.off(OGX.GridSwiper.SWIPE_RIGHT),i.off(OGX.GridSwiper.SWIPE_UP),i.off(OGX.GridSwiper.SWIPE_DOWN),i.off(OGX.GridSwiper.SWIPE_START),i.off(OGX.GridSwiper.SWIPE_END))}function O(e,t){r.display_date.add(e,t),b()}function b(){var e=l[o].format(r.display_date),t="",n="";r.browse&&r.layouts.length>1&&(o-1<0&&(n=" ogx_calendar_off"),t+='<span class="ogx_calendar_up '+n+'"></span>'),r.browse&&(t+='<span class="ogx_calendar_left"></span><span class="ogx_calendar_display_date">'+r.display_date.format(e)+"</span>"),r.date&&(t+='<span class="ogx_calendar_selected_date">'+r.date.format(r.format)+"</span>"),r.browse&&(t+='<span class="ogx_calendar_right"></span>'),r.browse&&r.layouts.length>1&&(n="",o+1===r.layouts.length&&(n=" ogx_calendar_off"),t+='<span class="ogx_calendar_down '+n+'"></span>'),i.children(".ogx_calendar_head").children(".ogx_calendar_head_date").html(t)}function w(e){i.children(".ogx_calendar_head").children(".ogx_calendar_head_labels").html(e)}function G(e,t,i,n){if(t.y-1>=0&&t.y-1<r.layouts.length){var a=$(n),s=l[o].value(),c=r.display_date.clone().add(i.x*s.value,s.unit),d=l[t.y-1].html(c,OGX.CalendarEngine[r.layouts[t.y-1].engine.name],r.layouts[t.y-1].engine.config,r.date);a.html(d)}}function X(){for(var e,t=0;t<r.layouts.length;t++)r.layouts[t].layout.hasOwnProperty("config")&&(e=r.layouts[t].layout.config),r.off_dates&&(e.off_dates=r.off_dates),l.push(C(r.layouts[t].layout.name,e))}function C(e,t){return void 0===t&&(t={}),OGX.CalendarLayout[e].prototype=Object.create(OGX.CalendarLayout.BASE_LAYOUT.prototype),OGX.CalendarLayout[e].prototype.constructor=OGX.CalendarLayout[e],new OGX.CalendarLayout[e](t)}function D(){n=[[!1,!1,!1]];for(var e=0;e<r.layouts.length;e++)n.push([G,G,G]);n.push([!1,!1,!1])}this.onFocus=function(){return r.selectable&&_(!0),x(!0),r.browse&&u(!0),this},this.onBlur=function(){return r.selectable&&_(!1),x(!1),r.browse&&u(!1),this},this.onSelect=function(){},this.onUnselect=function(){},this.resetSelection=function(){v(),r.date=null},this.val=function(e,t){return void 0===t&&(t=!0),void 0!==e?(r.date=e,moment.isMoment(r.date)||(r.date=moment(r.date)),r.display_date=r.date.clone(),b(),void(t?setTimeout(y,0):(v(),m(r.date.format("YYYY-MM-DD"))))):r.date?r.date:""},this.refresh=function(){return setTimeout(y,0),this},this.display=function(e){return void 0!==e?(r.display_date=e,moment.isMoment(r.display_date)||(r.display_date=moment(r.display_date)),b(),setTimeout(y,0),!0):r.display_date},this.axis=function(e,t){return r.axis.x=e,r.axis.y=t,this},this.getLayout=function(){return o},this.layouts=function(e,i){return void 0===e?r.layouts:(r.layouts=e,r.layout=void 0!==i?i:0,o=r.layout,l=[],X(),D(),t.setMap(n,{x:0,y:r.layout+1}),y(),this)},this.layout=function(){return o},this.offDates=function(e,i){return void 0===e?r.off_dates:(void 0===i&&(i=!0),r.off_dates=e,i?(l=[],X(),t.setMap(n,{x:0,y:r.layout+1}),y()):l.forEach((t=>{t.off_dates=e})),this)},this.noSelection=function(e,t){return void 0===e?r.no_selection:(void 0===t&&(t=!0),r.no_selection=e,t&&y(),this)},OGX.Data.merge(r,s),r.callbacks.select&&(a.onSelect=r.callbacks.select),r.callbacks.unselect&&(a.onUnselect=r.callbacks.unselect),(i=a.el).addClass("ogx_calendar"),r.date&&(moment.isMoment(r.date)||(r.date=moment(r.date)),r.display_date=r.date.clone()),r.display_date?moment.isMoment(r.display_date)||(r.display_date=moment(r.display_date)):r.display_date=moment(),r.layout>r.layouts.length&&(r.layout=0),o=r.layout,c.y=o+1,r.simple&&(r.layouts=[r.layouts[2]],o=r.layout=0),r.layout>r.layouts.length-1&&(r.layout=0),i.html('<div class="ogx_calendar_head"><div class="ogx_calendar_head_date"></div><div class="ogx_calendar_head_labels"></div></div><div class="ogx_calendar_body"></div>'),D(),X(),t=a.create("GridSwiper",{el:r.el+" .ogx_calendar_body",loop:!0,map:n,start:{x:1,y:o+1},chromeos:r.chromeos,enabled:r.swipe}),b(),w(l[o].labels(r.display_date))},OGX.Calendar.SELECT="CalendarSelect",OGX.Calendar.UNSELECT="CalendarUnselect",OGX.Calendar.BIND=OGX.Calendar.SELECT+" "+OGX.Calendar.UNSELECT,OGX.Calendar.BROWSE="CalendarBrowse",OGX.Calendar.LAYOUT_CHANGE="CalendarLayoutChange",OGX.CalendarLayout={},OGX.CalendarLayout.BASE_LAYOUT=function(e){"use strict";this.off_dates=null,this.labels=function(e){return""},this.html=function(e,t,i,n){return""},this.value=function(){return{value:1,unit:"months"}},this.format=function(){return e.hasOwnProperty("format")?e.format:"YYYY-MM"}},OGX.CalendarLayout.MONTH_DAYS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM"),!e.hasOwnProperty("labels")&&(e.labels="ddd"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){var i="",n=Number(t.format("d")),o=t.clone();n&&o.subtract(n,"day");for(var a=0;a<7;a++)i+='<span class="ogx_calendar_layout_month_days_label">'+o.format(e.labels)+"</span>",o.add(1,"day");return i},this.html=function(e,t,i,n){var o,a=e.format("MM"),r=moment(e.format("YYYY-MM-")+"01").day(),s=moment(e.format("YYYY-MM-")+"01").subtract(r,"days"),l="";n&&(l=n.format("YYYY-MM-DD"));for(var c,d="",u=0;u<35;u++)c="",o=s.format("YYYY-MM-DD"),s.format("MM")!==a&&(c+="ogx_calendar_layout_month_days_offset "),o===moment().format("YYYY-MM-DD")&&(c+="ogx_calendar_layout_month_days_today "),n&&l===o&&(c+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(o)&&(c+="ogx_calendar_layout_off_date "),d+='<div class="ogx_calendar_layout_item ogx_calendar_layout_month_days '+c+'" data-ogx-date="'+o+'">'+t(o,i)+"</div>",s.add(1,"days");return d},this.value=function(){return{value:1,unit:"months"}}},OGX.CalendarLayout.CENTURY_DECADES=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY"),!e.hasOwnProperty("labels")&&(e.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return'<span class="ogx_calendar_layout_century_decades_label">'+(e.labels?t.format(e.labels):100*Math.floor(Number(t.format("YYYY"))/100)+"'s")+"</span>"},this.html=function(e,t,i,n){var o,a,r=moment(),s=100*Math.floor(Number(r.format("YYYY"))/100),l=10*Math.floor(Number(r.format("YYYY").substr(2))/10),c=100*Math.floor(Number(e.format("YYYY"))/100),d=0,u=0;n&&(d=100*Math.floor(Number(n.format("YYYY"))/100),u=10*Math.floor(Number(n.format("YYYY").substr(2))/10));for(var h="",f=0;f<10;f++)a="",s+l===c+(o=10*f)&&(a="ogx_calendar_layout_century_decades_current "),d+u===c+o&&(a+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(c+o)&&(a+="ogx_calendar_layout_off_date "),h+='<div class="ogx_calendar_layout_item ogx_calendar_layout_century_decades '+a+'" data-ogx-date="'+(c+o)+'-01-01">'+t(c+o,i)+"</div>";return h},this.value=function(){return{value:100,unit:"years"}}},OGX.CalendarLayout.CENTURY_YEARS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return'<span class="ogx_calendar_layout_century_decades_label">'+(e.labels?t.format(e.labels):100*Math.floor(Number(t.format("YYYY"))/100)+"'s")+"</span>"},this.html=function(e,t,i,n){var o,a=moment(),r=100*Math.floor(Number(a.format("YYYY"))/100),s=Number(a.format("YYYY").substr(2)),l=100*Math.floor(Number(e.format("YYYY"))/100),c=0,d=0;n&&(c=100*Math.floor(Number(n.format("YYYY"))/100),d=Math.floor(Number(n.format("YYYY").substr(2))));for(var u="",h=0;h<100;h++)o="",l+h===r+s&&(o+="ogx_calendar_layout_century_years_current "),l+h===c+d&&(o+="ogx_calendar_selected_item"),this.off_dates&&this.off_dates.includes(l+h)&&(o+="ogx_calendar_layout_off_date "),u+='<div class="ogx_calendar_layout_item ogx_calendar_layout_century_years '+o+'" data-ogx-date="'+(l+h)+'-01-01">'+t(l+h+"-01-01",i)+"</div>";return u},this.value=function(){return{value:100,unit:"years"}}},OGX.CalendarLayout.DECADE_YEARS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return'<span class="ogx_calendar_layout_century_years_label">'+(e.labels?t.format(e.labels):10*Math.floor(Number(t.format("YYYY"))/10)+"'s")+"</span>"},this.html=function(e,t,i,n){var o,a=10*Math.floor(Number(e.format("YYYY"))/10),r="",s=Number(moment().format("YYYY")),l="";n&&(l=Number(n.format("YYYY")));for(var c=0;c<10;c++)o="",a+c===s&&(o+="ogx_calendar_layout_decade_years_current "),a+c===l&&(o+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(a+c)&&(o+="ogx_calendar_layout_off_date "),r+='<div class="ogx_calendar_layout_item ogx_calendar_layout_decade_years '+o+'" data-ogx-date="'+(a+c)+'-01-01">'+t(a+c+"-01-01",i)+"</div>";return r},this.value=function(){return{value:10,unit:"years"}}},OGX.CalendarLayout.DECADE_MONTHS=function(e){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(e){for(var t=10*Math.floor(Number(e.format("YYYY"))/10),i=Number(String(t).substr(2,2)),n="",o=0;o<10;o++)n+='<span class="ogx_calendar_layout_decade_months_label">\''+i+"</span>",i++;return n},this.html=function(e,t,i,n){var o,a,r,s,l=10*Math.floor(Number(e.format("YYYY"))/10),c="",d=moment().format("YYYY-MM");n&&(o=n.format("YYYY-MM"));for(var u=0;u<12;u++){s=u+1;for(var h=0;h<10;h++)a="",(r=l+h+"-"+(s<10?"0"+s:s))===d&&(a="ogx_calendar_layout_decade_months_current "),r===o&&(a+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(r)&&(a+="ogx_calendar_layout_off_date "),moment(r+"-01"),c+='<div class="ogx_calendar_layout_item ogx_calendar_layout_decade_months '+a+'" data-ogx-date="'+r+'-01">'+t(r+"-01",i)+"</div>"}return c},this.value=function(){return{value:10,unit:"years"}},this.format=function(e){return"["+10*Math.floor(Number(e.format("YYYY"))/10)+"'s]"}},OGX.CalendarLayout.YEAR_MONTHS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels="[Months]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return'<span class="ogx_calendar_layout_year_months_label">'+t.format(e.labels)+"</span>"},this.html=function(e,t,i,n){var o,a,r=moment().format("YYYY-MM"),s=e.format("YYYY"),l="",c="";n&&(c=n.format("YYYY-MM"));for(var d=1;d<13;d++)o="",s+"-"+(a=d<10?"0"+d:d)===r&&(o+="ogx_calendar_layout_year_months_current "),s+"-"+a===c&&(o+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(s+"-"+a)&&(o+="ogx_calendar_layout_off_date "),l+='<div class="ogx_calendar_layout_item ogx_calendar_layout_year_months '+o+'" data-ogx-date="'+s+"-"+a+'-01">'+t(s+"-"+a+"-01",i)+"</div>";return l},this.value=function(){return{value:1,unit:"years"}}},OGX.CalendarLayout.YEAR_WEEKS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels="[Weeks]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return'<span class="ogx_calendar_layout_year_weeks_label">'+t.format(e.labels)+"</span>"},this.html=function(e,t,i,n){var o=moment().week(),a=e.format("YYYY"),r=moment().format("YYYY"),s="",l="";n&&(l=n.week(),s=n.format("YYYY"));for(var c,d,u="",h=1;h<53;h++)c="",d=moment().year(a).week(h).format("YYYY-MM-DD"),o===h&&a===r&&(c="ogx_calendar_layout_year_weeks_current "),l===h&&a===s&&(c+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(d)&&(c+="ogx_calendar_layout_off_date "),u+='<div class="ogx_calendar_layout_item ogx_calendar_layout_year_weeks '+c+'" data-ogx-date="'+d+'">'+t(d,i)+"</div>";return u},this.value=function(){return{value:1,unit:"years"}}},OGX.CalendarLayout.YEAR_DAYS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels="[Nth Day]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return'<span class="ogx_calendar_layout_year_weeks_label">'+t.format(e.labels)+"</span>"},this.html=function(e,t,i,n){var o,a,r,s="",l=e.format("YYYY-MM-DD"),c=moment(e.format("YYYY")+"-01-01"),d="";n&&(d=n.format("YYYY-MM-DD")),a=e.isLeapYear()?366:365;for(var u=0;u<a;u++)o="",(r=c.format("YYYY-MM-DD"))===l&&(o="ogx_calendar_layout_year_days_current "),r===d&&(o+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(r)&&(o+="ogx_calendar_layout_off_date "),s+='<div class="ogx_calendar_layout_item ogx_calendar_layout_year_days '+o+'" data-ogx-date="'+r+'">'+t(r,i)+"</div>",c.add(1,"days");return s},this.value=function(){return{value:1,unit:"years"}}},OGX.CalendarLayout.MONTH_WEEKS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="[(]YYYY-MM[)] W"),!e.hasOwnProperty("labels")&&(e.labels="[Nth Week]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return'<span class="ogx_calendar_layout_year_weeks_label">'+t.format(e.labels)+"</span>"},this.html=function(e,t,i,n){var o,a="",r=moment(),s=Number(r.format("YYYY")),l=Number(r.format("w")),c=Number(e.format("YYYY")),d=0,u=0;n&&(d=Number(n.format("YYYY")),u=Number(n.format("w")));a="";for(var h,f=moment(e.format("YYYY-MM-[01]")),_=0;_<5;_++)h="",o=Number(f.format("w")),c===d&&o===u&&(h+="ogx_calendar_selected_item "),c===s&&o===l&&(h+="ogx_calendar_layout_month_weeks_current"),this.off_dates&&this.off_dates.includes(o)&&(h+="ogx_calendar_layout_off_date "),a+='<div class="ogx_calendar_layout_item ogx_calendar_layout_month_weeks '+h+'" data-ogx-date="'+f.format("YYYY-MM-DD")+'">'+t(f.format("YYYY-MM-DD"),i)+"</div>",f.add(7,"days");return a},this.value=function(){return{value:1,unit:"months"}}},OGX.CalendarLayout.WEEK_DAYS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM (wo [week])"),!e.hasOwnProperty("labels")&&(e.labels="ddd DD"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){var i="",n=Number(t.format("d")),o=t.clone();n&&o.subtract(n,"day");for(var a=0;a<7;a++)i+='<span class="ogx_calendar_layout_month_days_label">'+o.format(e.labels)+"</span>",o.add(1,"day");return i},this.html=function(e,t,i,n){var o,a,r="",s=e.weekday(),l=e.subtract(s,"days"),c=moment().format("YYYY-MM-DD"),d="";n&&(d=n.format("YYYY-MM-DD"));for(var u=0;u<7;u++)o="",(a=l.format("YYYY-MM-DD"))===c&&(o="ogx_calendar_layout_week_days_current "),a===d&&(o+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(a)&&(o+="ogx_calendar_layout_off_date "),r+='<div class="ogx_calendar_layout_item ogx_calendar_layout_week_days '+o+'" data-ogx-date="'+a+'">'+t(a,i)+"</div>",l.add(1,"days");return r},this.value=function(){return{value:1,unit:"weeks"}}},OGX.CalendarLayout.DAY_HOURS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM-DD HH:[00]"),!e.hasOwnProperty("labels")&&(e.labels="[Hours]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return'<span class="ogx_calendar_layout_day_hours_label">'+t.format(e.labels)+"</span>"},this.html=function(e,t,i,n){var o,a,r="",s=Number(moment().format("HH")),l=e.format("YYYY-MM-DD "),c=moment().format("YYYY-MM-DD "),d="",u="";n&&(d=Number(n.format("HH")),u=n.format("YYYY-MM-DD "));for(var h=0;h<24;h++)a="",h===s&&l===c&&(a="ogx_calendar_layout_days_hours_current "),h===d&&l===u&&(a+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(l+o+":00")&&(a+="ogx_calendar_layout_off_date "),r+='<div class="ogx_calendar_layout_item ogx_calendar_layout_days_hours '+a+'" data-ogx-date="'+(l+(o=h<10?"0"+h:String(h)))+':00">'+t(l+o+":00",i)+"</div>";return r},this.value=function(){return{value:1,unit:"days"}}},OGX.CalendarLayout.DAY_WORK_HOURS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM-DD HH:[00]"),!e.hasOwnProperty("labels")&&(e.labels="[Work Hours]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return'<span class="ogx_calendar_layout_day_work_hours_label">'+t.format(e.labels)+"</span>"},this.html=function(e,t,i,n){i&&void 0!==i?i.hasOwnProperty("start")||(i.start=8,i.end=17):i={start:8,end:17};var o,a,r="",s=Number(moment().format("HH")),l=e.format("YYYY-MM-DD "),c=moment().format("YYYY-MM-DD "),d="",u="";n&&(d=Number(n.format("HH")),u=n.format("YYYY-MM-DD "));for(var h=i.start;h<i.end+1;h++)a="",h===s&&l===c&&(a="ogx_calendar_layout_days_work_hours_current "),h===d&&u===l&&(a+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(l+o+":00")&&(a+="ogx_calendar_layout_off_date "),r+='<div class="ogx_calendar_layout_item ogx_calendar_layout_days_work_hours '+a+'" data-ogx-date="'+(l+(o=h<10?"0"+h:h))+':00">'+t(l+o+":00",i)+"</div>";return r},this.value=function(){return{value:1,unit:"days"}}},OGX.CalendarLayout.DAY=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM-DD"),!e.hasOwnProperty("labels")&&(e.labels="dddd DD"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return'<span class="ogx_calendar_layout_day_label">'+t.format(e.labels)+"</span>"},this.html=function(e,t,i,n){var o="",a=e.format("YYYY-MM-DD"),r=moment().format("YYYY-MM-DD");return n&&a===n.format("YYYY-MM-DD")&&(o+="ogx_calendar_selected_item "),a===r&&(o+="ogx_calendar_layout_day_current "),this.off_dates&&this.off_dates.includes(a)&&(o+="ogx_calendar_layout_off_date "),'<div class="ogx_calendar_layout_item ogx_calendar_layout_day '+o+'" data-ogx-date="'+a+'">'+t(a,i)+"</div>"},this.value=function(){return{value:1,unit:"days"}},this.select=function(e){}},OGX.CalendarEngine={},OGX.CalendarEngine.CELL_VALUE=function(e,t){var i=moment(e);return t.hasOwnProperty("css")||(t.css=""),'<div class="ogx_calendar_engine_cell_value '+t.css+'">'+i.format(t.format)+"</div>"},OGX.CalendarEngine.DAY_NUMBER=function(e,t){var i=moment(e);return OGX.CalendarEngine.CELL_VALUE(i,{format:"DD",css:"ogx_calendar_engine_day_number"})},OGX.CalendarEngine.WEEK_NUMBER=function(e,t){return'<div class="ogx_calendar_engine_week_number">'+moment(e).week()+"</div>"},OGX.CalendarEngine.MONTH_NUMBER=function(e,t){return OGX.CalendarEngine.CELL_VALUE(e,{format:"MM",css:"ogx_calendar_engine_month_number"})},OGX.CalendarEngine.YEAR_NUMBER=function(e,t){return OGX.CalendarEngine.CELL_VALUE(e,{format:"YY",css:"ogx_calendar_engine_year_number"})},OGX.CalendarEngine.DECADE_NUMBER=function(e){return'<div class="ogx_calendar_engine_date_day_number">'+String(e).substr(2)+"'s</div>"},require("Carousel","Uxi","Placeholder","Touch"),OGX.Carousel=function(e){construct(this,"Carousel");var t,i,n,o,a,r,s=this,l=e,c={min_x:100,anim:!0,drag:!0,drag_left:!0,drag_right:!0,dots:!1,css:!1,index:0,capture:!1,callbacks:{change:null},display:!1,displays:!1,as:"item",list:null},d={position:"bottom"},u=!1,h=0,f=0,_=new OGX.List,g="ogx_carousel",p=null,m=null,v=null;function y(e){if(void 0!==e&&_[e]&&_[e].instance){var t=s.find(_[e].instance._NAME_,_[e].instance.id);t&&t.blur(2)}}function x(e){if(void 0!==e&&_[e]&&_[e].instance){var t=s.find(_[e].instance._NAME_,_[e].instance.id);t&&s.enabled&&t.focus(1)}}function O(e){i.off("transitionend"),i.removeClass(g+"_anim")}function b(e){if(e.dirX){if(-1===e.dirX&&!l.drag_left)return;if(1===e.dirX&&!l.drag_right)return}if(e.distX>e.distY){var t=r*n*-1+e.distX*e.dirX;t<=0&&t>-1*(i.width()-s.el.width())&&i.css({transform:"translate3d("+t+"px, 0, 0)"})}}function w(e){if(e.dirX){if(-1===e.dirX&&!l.drag_left)return;if(1===e.dirX&&!l.drag_right)return}if(e.distX>l.min_x){var i=r+-1*e.dirX;i>=0&&i<f&&r!==i&&(y(r),r=i,s.onChange(r),t.trigger(OGX.Carousel.CHANGE,r))}var n=0;r&&(n=100/f*(-1*r)),G(n,r,!0)}function G(e,t,n){r=t,i.off("transitionend"),n?(i.addClass(g+"_anim"),i.on("transitionend",(function(){i.off("transitionend"),i.removeClass(g+"_anim"),x(t)}))):(i.removeClass(g+"_anim"),s.enabled&&x(t)),i.css({transform:"translate3d("+e+"%, 0, 0)"})}function X(){u=!0,clearInterval(o),o=setInterval(C,50),n=Math.floor(t.innerWidth()),i.removeClass(g+"_anim")}function C(){u=!1,clearInterval(o),o=!1,l.drag&&m.enable()}function D(){if(f){var e,t,n;_.clear();var o=0;i.children("."+g+"_view").each((function(i,a){e=$(a),(t=e.children().first()).length&&t[0].hasAttribute("data-ogx-id")?(t[0].hasAttribute("data-ogx-id")&&(n=t.data("ogx-id"),t.hasClass("ogx_scroller_outer")&&(n=t.find(".ogx_scroller_inner").first().data("ogx-id"))),void 0!==s.nodes[o]&&(i!==r?s.nodes[o].blur():s.enabled&&s.nodes[o].focus(),o++,_.push({index:i,instance:s.nodes.get({id:{eq:String(n)}},null,1),html:!1}))):_.push({index:i,instance:!1,html:e.html()})}))}}function E(){l.dots&&(a=s.create("Dots",{el:'.ogx_uxi[data-ogx-id="'+s.id+'"] > .carousel_dots',total:f})).bind(s,[OGX.Carousel.CHANGE],[OGX.Carousel.ADDED,OGX.Carousel.REMOVED,OGX.Carousel.RENDER])}function k(){var e=[];if(f>0){s.observeOnce(null,(()=>{n=Math.floor(t.innerWidth()),t.trigger(OGX.Carousel.READY),t.trigger(OGX.Carousel.RENDER,f)}));for(var o=0;o<f;o++)i.append('<div class="'+g+'_view" style="width:'+100/f+'%;" data-ogx-panel-id="'+h+'"></div>'),e.push("."+g+'[data-ogx-id="'+s.id+'"] > .'+g+"_views > ."+g+'_view[data-ogx-panel-id="'+h+'"]'),h++;i.css("width",100*f+"%"),s.placeholders(l,e)}}this.construct=function(){D(),l.index&&this.index(l.index,!1),E()},this.onFocus=function(){l.drag&&m.enable(),setTimeout((()=>{for(var e=0;e<_.length;e++)_[e].instance&&(e!==r?_[e].instance.blur():_[e].instance.focus())}),0)},this.onBlur=function(){l.drag&&m.disable()},this.focus=function(){return this.blured&&(this.blured=!1,this.ux(!0),this.onFocus(),_.length&&void 0!==_[r]&&_[r].instance&&_[r].instance.focus()),this},this.onResize=function(){return l.drag&&m.disable(),setTimeout(X,0),this},this.show=function(e,t){if(!arguments.length)return this._show(),this;var i=this.getNodeIndex(e,t);return i&&this.index(i.index),this},this.onChange=function(){},this.getNodeIndex=function(e,t){var i=_.get({"instance.id":{eq:t},"instance._NAME_":{eq:e}},null,1);return!!i&&{index:i.index}},this.anim=function(e){return void 0===e?l.anim:(l.anim=e,this)},this.drag=function(e){return void 0===e?l.drag:(l.drag!==e&&(l.drag&&m.disable(),e&&m.enable(),l.drag=e),this)},this.dragLeft=function(e){return void 0===e?l.drag_left:(l.drag_left=e,this)},this.dragRight=function(e){return void 0===e?l.drag_right:(l.drag_right=e,this)},this.length=function(){return f},this.destroy=function(){o&&clearInterval(o),l.dots&&(a.unbind(this),a.destroy())},this.prev=function(){return r>0&&this.index(r-1),this},this.next=function(){return r+1<f&&this.index(r+1),this},this.panels=function(){return _},this.addNode=function(e,n,o,a,r){void 0===o&&(o=!1),void 0===a&&(a=!1),void 0===r&&(r=!1),v&&clearTimeout(v);var l=function(e){void 0===e&&(e="");return f++,i.append('<div class="'+g+'_view" style="width:'+100/f+'%;" data-ogx-panel-id="'+h+'">'+e+"</div>"),i.css("width",Math.round(100*f)+"%"),i.children("."+g+"_view").css("width",100/f+"%"),++h-1}(),c="."+g+'[data-ogx-id="'+this.id+'"] > .'+g+"_views > ."+g+'_view[data-ogx-panel-id="'+l+'"]',d={},u=c;if(e.hasOwnProperty("_NAME_"))e.detach(),e.attach(this,c),o&&this.index(f-1,a);else{for(var _ in e){u+=":"+_.split(":")[1],d[u]=e[_];break}setTimeout((()=>{s.observeOnce(null,(()=>{v&&clearTimeout(v),v=setTimeout(D,20),o&&s.index(f-1,a),r?r():t.trigger(OGX.Carousel.ADDED,f)})),OGX.OML.render(s,d,n)}),0)}return this},this.replaceNode=function(e,t,n,o){void 0===o&&(o=null);var a={},r=i.children("."+g+"_view:eq("+e+")").data("ogx-panel-id"),l="."+g+'[data-ogx-id="'+s.id+'"] > .'+g+"_views > ."+g+'_view[data-ogx-panel-id="'+r+'"]';for(var c in t){a[l+=":"+c.split(":")[1]]=t[c];break}OGX.Object.destroy(s.nodes[e]),s.observeOnce(null,(()=>{setTimeout(D,0),setTimeout((()=>{}),1),o&&o()})),OGX.OML.render(s,a,n)},this.removeNode=function(e,t){void 0===t&&(t=e,e=null);for(var i=!1,n=0;n<_.length;n++)if(_[n].instance.id===t)return i=!0,e&&(i=_[n].instance._NAME_===e),i&&this.removePanel(n),!0;return!1},this.index=function(e,i,n,o){if(void 0===e)return r;if((void 0===n&&(n=!1),void 0===o&&(o=!1),e>=0&&e<f&&!u)&&((d=r)!==e||o)){void 0===i&&(i=l.anim),r!==e&&y(r);var c=100/f*(-1*e),d=e;return setTimeout((()=>{G(c,d,i)}),0),l.dots&&a.select(e),n&&(s.onChange(e),t.trigger(OGX.Carousel.CHANGE,e)),!0}return!1},this.getPanel=function(e){return _.get({index:{eq:e}},null,1)},this.swapPanels=function(e,n){var o=i.children("."+g+"_view:eq("+e+")").detach();n>e?i.children("."+g+"_view:eq("+(n-1)+")").after(o):i.children("."+g+"_view:eq("+n+")").before(o);var a=100/f*(-1*n);return i.removeClass(g+"_anim"),i.css({transform:"translate3d("+a+"%, 0, 0)"}),r=n,setTimeout(D,0),s.onChange(r),t.trigger(OGX.Carousel.CHANGE,r),this},this.removePanel=function(e,n){if(void 0===n&&(n=!0),e>=0&&e<f){var o=null;if(n&&(n="remove"),i.children("."+g+"_view:eq("+e+")").children().data("ogx-id")){var a=_[e];a.instance&&(o=this.find(a.instance._NAME_,a.instance.id,n))&&(n||o.detach()),_.splice(e,1)}return f--,i.children("."+g+"_view:eq("+e+")").remove(),i.removeClass(g+"_anim").css("width",Math.round(100*f)+"%"),i.children("."+g+"_view").css("width",100/f+"%"),e>=r?e--:e=--r,e<0&&(e=0),r=e,s.index(e,!1,!0),t.trigger(OGX.Carousel.REMOVED,f),o}return!1},this.empty=function(){return this.clear(),i.empty(),i.removeClass(g+"_anim").css("width","100%"),i.css({transform:"translate3d(0%, 0, 0)"}),f=0,_=new OGX.List,l.index=r=0,l["node:OML"]=[],this},this.render=function(e,i){return this.empty(),E(),l["node:OML"]=e,f=l["node:OML"].length,k(),OGX.OML.render(this,l["node:OML"],i,null,(()=>{D()})),t.trigger(OGX.Carousel.RENDER,f),this},this.destroy=function(){this.touch.wipe()},function(){if(OGX.Data.merge(l,c,!1),l.callbacks.change&&(s.onChange=l.callbacks.change),l.dots&&("boolean"==typeof l.dots&&(l.dots={}),OGX.Data.merge(l.dots,d)),p=new OGX.Display(l),"string"==typeof l.index&&(l.index=OGX.Data.stringToVal(l.index)),r=l.index,t=s.el,n=Math.floor(t.innerWidth()),l.hasOwnProperty("node:OML")&&l["node:OML"].length)f=l["node:OML"].length;else if(l.list&&l.list.length){for(var e,i,o=[],a=0;a<l.list.length;a++)if(p.hasOML())e=p.oml('.ogx_carousel[data-ogx-id="'+s.id+'"] > .ogx_carousel_views > .ogx_carousel_view[data-ogx-panel-id="'+a+'"]',l.list[a],l.as),o.push(e);else{i=p.html(l.list[a]);var u='{"default:Html":{"html":'+JSON.stringify(i)+"}}";e=JSON.parse(u),o.push(e)}l["node:OML"]=o,f=l["node:OML"].length}}(),function(){t.addClass(g);var e="";l.dots&&"top"===l.dots.position&&(e+='<div class="carousel_dots"></div>'),e+='<div class="'+g+'_views" style="width:'+100*f+'%;"></div>',l.dots&&"bottom"===l.dots.position&&(e+='<div class="carousel_dots"></div>'),t.append(e),(i=t.find("."+g+"_views").first()).css({transform:"translate3d("+100/f*(-1*r)+"%, 0, 0)"})}(),k(),m=s.touch.add("Swipe",{x:!0,cb_down:O,cb_swipe:b,cb_up:w,capture:l.capture,state:"manual"}),l.drag?m.enable():s.drag(!1)},OGX.Carousel.READY="CarouselReady",OGX.Carousel.CHANGE="CarouselChange",OGX.Carousel.ADDED="CarouselAdded",OGX.Carousel.REMOVED="CarouselRemoved",OGX.Carousel.RENDER="CarouselRender",OGX.Color={},OGX.Color.hexToRgb=function(e){"use strict";e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,i,n){return t+t+i+i+n+n}));var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:null},OGX.Color.rgbToHex=function(e,t,i){"use strict";var n,o,a;arguments.length>1&&(e=e+", "+t+", "+i),"object"==typeof e&&(e=Array.isArray(e)?e.join(","):e.r+" "+e.g+" "+e.b);var r=/(\d+)[ ,]*(\d+)[ ,]*(\d+)/g,s=r.exec(e);return s&&(s.shift(),n=Number(s[0]),o=Number(s[1]),a=Number(s[2])),"#"+((1<<24)+(n<<16)+(o<<8)+a).toString(16).slice(1)},OGX.Color.rgbToHsl=function(e,t,i){"use strict";var n,o,a;arguments.length>1&&(e=e+", "+t+", "+i),"object"==typeof e&&(e=Array.isArray(e)?e.join(","):e.r+" "+e.g+" "+e.b);var r=/(\d+)[ ,]*(\d+)[ ,]*(\d+)/g,s=r.exec(e);if(s){s.shift(),n=s[0],o=s[1],a=s[2],n/=255,o/=255,a/=255;var l,c,d=Math.max(n,o,a),u=Math.min(n,o,a),h=(d+u)/2;if(d===u)l=c=0;else{var f=d-u;switch(c=h>.5?f/(2-d-u):f/(d+u),d){case n:l=(o-a)/f+(o<a?6:0);break;case o:l=(a-n)/f+2;break;case a:l=(n-o)/f+4}l/=6}return[l,c,h]}return!1},OGX.Color.hslToRgb=function(e,t,i){"use strict";if(1===arguments.length)if("object"==typeof e)Array.isArray(e)?(i=e[2],t=e[1],e=e[0]):(i=e.l,t=e.s,e=e.h);else if("string"==typeof e){var n=/([0-9\.]+)[ ,]*([0-9\.]+)[ ,]*([0-9\.]+)/g,o=n.exec(e);o&&(o.shift(),e=Number(o[0]),t=Number(o[1]),i=Number(o[2]))}var a,r,s;if(0===t)a=r=s=i;else{var l=function(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e},c=i<.5?i*(1+t):i+t-i*t,d=2*i-c;a=l(d,c,e+1/3),r=l(d,c,e),s=l(d,c,e-1/3)}return[Math.round(255*a),Math.round(255*r),Math.round(255*s)]},OGX.Color.formatHex=function(e){return"#"===e.slice(0,1)&&(e=e.slice(1)),e.length>3||e.split("").map((function(e){return e+e})),"#"+e},require("Container","Uxi"),OGX.Container=function(e){construct(this,"Container");var t=this,i={tabs:!0,carousel:{enabled:!0},enabled:!0,reorder:!0,anim:!0,flatten:!1,chromeos:!1,index:0,dots:!1},n=e,o="normal",a=0;function r(e){e?(t.tabs.el.on(OGX.Tabs.SELECT,(function(e,i,n){t.carousel.index(n.index),t.el.trigger(OGX.Container.CHANGE,n.index)})),t.tabs.el.on(OGX.Tabs.REORDER,(function(e,i){t.carousel.swapPanels(i.from,i.to)})),t.carousel.el.on(OGX.Carousel.CHANGE,(function(e,i){t.tabs.index(i),t.el.trigger(OGX.Container.CHANGE,i)}))):(t.tabs.el.off(OGX.Tabs.SELECT),t.tabs.el.off(OGX.Tabs.REORDER),t.carousel.el.off(OGX.Carousel.CHANGE)),s(e)}function s(e){e?t.tabs.el.on(OGX.Tabs.REMOVE,l):t.tabs.el.off(OGX.Tabs.REMOVE,l)}function l(e,i,n){var o;s(!1),"string"==typeof i?o=i:ln=i.label,"Popup"===t.parent._NAME_?OGX.Core.ungroupPopup(t.parent,n.index,o,n.x,n.y):t.carousel.removeNode(t.carousel.nodes[n.index].id),setTimeout((()=>{s(!0)}),200)}this.carousel=null,this.tabs=null,this.bypass=!0,this.construct=function(){this.carousel=this.find("Carousel",this.id+"_carousel")},this.show=function(e,t){if(!arguments.length)return this._show(),this;if(this.carousel&&"normal"===o){var i=this.carousel.getNodeIndex(e,t);i&&(this.carousel.index(i.index),n.tabs&&this.tabs.index(i.index))}},this.index=function(e){return this.carousel&&"normal"===o&&(this.carousel.index(e),n.tabs&&this.tabs.index(e)),this},this.onFocus=function(){return n.tabs&&t.carousel&&r(!0),this},this.onBlur=function(){return n.tabs&&t.carousel&&r(!1),this},this.onResize=function(){var e,t,i;return n.flatten&&(this.carousel&&"flattened"!==o&&this.el.width()>=n.flatten?(o="flattened",n.tabs&&(this.tabs.blur(),this.tabs.hide()),this.carousel.blur(),a=(e=this.carousel.el.children(".ogx_carousel_views"),t=e[0].style.transform,i=/translate3d\(([0-9px%,\.\- ]+)\)/,t=(t=t.match(i))[1].split(","))[0],this.carousel.el.children(".ogx_carousel_views").addClass("ogx_container_flattened").css("transform","translate3d(0px, 0px, 0px)")):this.carousel&&"flattened"===o&&this.el.width()<n.flatten&&(o="normal",n.tabs&&(this.tabs.focus(),this.tabs.show()),this.carousel.focus(),this.carousel.el.children(".ogx_carousel_views").removeClass("ogx_container_flattened").css("transform","translate3d("+a+", 0px, 0px)"))),this},this.empty=function(){return this.carousel.empty(),this.tabs.empty(),this},function(){OGX.Data.merge(n,i,!1),OGX.Data.merge(n.carousel,i.carousel,!1),n.tabs&&"object"!=typeof n.tabs&&(n.tabs={}),t.el.addClass("ogx_container");var e=!1;n.tabs&&(!function(){var e={el:'.ogx_container[data-ogx-id="'+t.id+'"]',reorder:n.reorder,add:!1,remove:!1,chromeos:n.chromeos,index:n.index};if(!0===n.tabs){n.tabs=[];for(var i=0;i<n["node:OML"].length;i++)for(var o in n["node:OML"][i])n["node:OML"][i][o].hasOwnProperty("title")&&n.tabs.push({label:n["node:OML"][i][o].title})}e=OGX.Data.merge(n.tabs,e),t.tabs=t.create("Tabs",e)}(),e="ogx_carousel_shink");var o=n["node:OML"].slice(),a={},r='.ogx_container[data-ogx-id="'+t.id+'"]:Carousel';a["node:OML"]={},a["node:OML"][r]={id:t.id+"_carousel",css:e,anim:n.anim,chromeos:n.chromeos,drag:n.carousel.drag,index:n.index,dots:n.dots,"node:OML":o},n["node:OML"]=a["node:OML"],setTimeout((()=>{t.resize()}),0)}()},OGX.Container.CHANGE="ContainerChange",require("Controller","Touch"),OGX.Controller=function(e){construct(this,"Controller"),this.el=!1,this.id=null,this.blured=!0,this.enabled=!0,this.floating=!1,this.always_on=!1,this.data=null;e=OGX.Data.merge(e,{enabled:!0,blured:!0,always_on:!1},!1),OGX.Data.merge(this,e,!0,!1,!0)},OGX.Controller.prototype.enable=function(){return this.enabled||(this.enabled=!0,this.focus()),this},OGX.Controller.prototype.disable=function(){return this.enabled&&(this.enabled=!1,this.blur()),this},OGX.Controller.prototype.blur=function(){return this.always_on||this.blured||(this.blured=!0,this.ux(!1)),this},OGX.Controller.prototype.focus=function(){return this.blured&&this.enabled&&(this.blured=!1,this.ux(!0)),this},OGX.Controller.prototype.construct=function(){},OGX.Controller.prototype.ux=function(){},OGX.Controller.prototype.resize=function(){},OGX.Controller.prototype.clear=function(){},OGX.Controller.prototype.destroy=function(){},OGX.Controller.prototype.kill=function(){OGX.Object.destroy(this)},OGX.Controller.prototype.toOML=function(){var e={};return e[this.id+":Controllers."+this._CLASS_]={},e},OGX.Display=function(__config){"use strict";var config,config_default={display:!1,displays:!1},display_default={html:!1,css:!1,oml:!1,placeholder:!1,template:!1,view:!1,mapping:!1},display;function getDisplay(e){if(config.display&&(!config.display.hasOwnProperty("bind")||!config.display.bind))return OGX.Data.merge({},config.display);if(config.displays&&config.display.hasOwnProperty("bind")&&config.display.bind){if(e.hasOwnProperty(config.display.bind)){var t=e[config.display.bind];if(config.displays.hasOwnProperty(t))return OGX.Data.merge({},config.displays[t],!0,!1,!1)}if(config.displays.hasOwnProperty("default"))return OGX.Data.clone(config.displays.default)}return!1}function evalDisplay(e,t,i){var n;if(void 0===t&&(t={}),void 0===i&&(i=!1),"string"==typeof e)return-1===e.indexOf("{{")?i?OGX.Templater.get(e):e:(n=OGX.OSE.exec(e,t),i?OGX.Templater.get(n):n);if("object"==typeof e&&e.hasOwnProperty("bind")){var o=evalBind(e.bind,t);return o=mappedVal(e,o),i?OGX.Templater.get(o):o}return e}function mappedVal(e,t){return e.mapping&&e.mapping.hasOwnProperty(t)?e.mapping[t]:t}function evalBind(__bindval,__o){if(-1!==__bindval.indexOf("{{"))return __bindval=OGX.OSE.exec(__bindval,__o),__bindval;if(__bindval){var val=__bindval;try{eval("val = __o."+__bindval)}catch(e){}return val}return __bindval}function formatCSS(e,t){if("object"!=typeof t)return e;(t.hasOwnProperty("add")&&(e+=" "+t.add),t.hasOwnProperty("remove"))&&t.remove.split(" ").forEach((t=>{e=e.replace(t,"")}));return e}function initDisplay(e){return OGX.Data.merge(display_default,e,!0,!0,!1)}function genNodes(e,t,i){var n,o,a=OGX.Data.clone(e.oml);for(var r in a){var s,l;for(var c in a[n=r.replace("default",t)]=a[r],a[n]["node:OML"]=[],e.placeholder){l=i[c].length;for(var d=0;d<l;d++){for(var u in s=OGX.Data.clone(e.placeholder[c]),(o=OGX.Data.clone(i))[c]=o[c][d],s){s[u].data=o;break}a[n]["node:OML"].push(s)}return delete a[r],a}}return!1}function initDefaults(e){if(void 0===e&&(e={}),config=OGX.Data.clone(config_default),!e.hasOwnProperty("display")&&!e.hasOwnProperty("displays"))return config.display=OGX.Data.merge(display_default,e,!0,!0,!1),config.display=initDisplay(config.display),void(display=getDisplay());if(e.hasOwnProperty("display")&&e.display&&!e.display.hasOwnProperty("bind"))return config.display=OGX.Data.merge(display_default,e.display,!0,!0,!1),config.display=initDisplay(config.display),void(display=getDisplay());if(e.hasOwnProperty("display")&&e.display&&e.display.hasOwnProperty("bind")&&e.hasOwnProperty("displays")&&e.displays&&(config.display=e.display,config.displays=OGX.Data.clone(e.displays)),config.displays)for(var t in config.displays)config.displays[t]=OGX.Data.merge(display_default,config.displays[t],!0,!0,!0),config.displays[t]=initDisplay(config.displays[t])}this.val=function(e){if(void 0===e)return OGX.Data.clone(config);initDefaults(e)},this.display=function(e){return config.displays&&config.displays.hasOwnProperty(e)?(display=config.displays[e],!0):display},this.css=function(e){var t,i="";return(t=void 0!==e?getDisplay(e):display)&&t.css&&(i=formatCSS(i=evalDisplay(t.css,e),t.css)),i},this.html=function(e){var t,i="",n=void 0!==e;return(t=n?getDisplay(e):display)&&(t.html?i=t.html:t.template&&(i=evalDisplay(t.template,e,!0)),n&&i&&(i=OGX.Templater.make(i,e))),i},this.oml=function(e,t,i){void 0===i&&(i="&item");var n={},o=getDisplay(t);if(o||(o=display),o){if(o.oml)return n=evalDisplay(OGX.Data.clone(o.oml),t),OGX.OML.isOML(n)||(n=OGX.Core.getOML(n)),n=OGX.OML.rename(n,e),OGX.OML.replaceDataRecursive(n,t,i),o.placeholder?n=genNodes(o,e,t):n;if(o.template)return n[e+":Templates."+evalDisplay(o.template,t)]={data:t},n;if(o.html)return n[e+":Html"]={html:this.html(t)},n}return!1},this.hasOML=function(e){return!1!==getDisplay(e).oml},this.toJSON=function(){return config},initDefaults(__config)},require("Dots","Uxi","Touch"),OGX.Dots=function(e){construct(this,"Dots");var t,i=this,n=e,o={el:"body",total:0,current:0,clickable:!0,callbacks:{select:null}},a={};function r(e){var t="",i="";a[e.id].change.forEach((e=>{t+=e+" "})),a[e.id].render.forEach((e=>{i+=e+" "})),e.el.off(t,s),e.el.off(i,l),delete a[e.id]}function s(e,t){i.select(t)}function l(e,t){n.total=t,d()}function c(e){e?t.on(i.touch.down,".ogx_dots_item",(function(){var e=Number($(this).data("id"));i.select(e),i.onSelect(e),t.trigger(OGX.Dots.SELECT,e),function(e){for(var t in a)switch(a[t]._NAME_){case"Carousel":a[t].val(e)}}(e)})):t.off(i.touch.down)}function d(){for(var e,i="",o=0;o<n.total;o++)e="",n.current===o&&(e="ogx_dots_selected"),i+='<div class="ogx_dots_item" data-id="'+o+'"><span class="ogx_dots_gfx '+e+'"></span></div>';t.html(i)}this.onFocus=function(){return n.clickable&&c(!0),this},this.onBlur=function(){return n.clickable&&c(!1),this},this.bind=function(e,t,i){return!a.hasOwnProperty(e.id)&&function(e,t,i){a[e.id]={uxi:e,change:t,render:i};var n="",o="";return t.forEach((e=>{n+=e+" "})),i.forEach((e=>{o+=e+" "})),e.el.on(n,s),e.el.on(o,l),!0}(e,t,i)},this.unbind=function(e){return!!a.hasOwnProperty(e.id)&&r(e)},this.select=function(e){t.find(".ogx_dots_selected").removeClass("ogx_dots_selected"),t.children(".ogx_dots_item:eq("+e+")").children(".ogx_dots_gfx").first().addClass("ogx_dots_selected"),n.current=e},this.onSelect=function(){},this.destroy=function(){!function(){for(var e in a)r(a[e].uxi)}()},OGX.Data.merge(n,o),n.callbacks.select&&(i.onSelect=n.callbacks.select),(t=i.el).addClass("ogx_dots"),d()},OGX.Dots.SELECT="DotsSelect",require("DynamicList","Uxi","Bind","Touch"),OGX.DynamicList=function(__config){construct(this,"DynamicList");var that=this,config=__config,config_default={el:null,key:!1,as:"item",display:!1,displays:!1,display_max:0,reorder:!1,swipe:!1,reselect:!1,chromeos:!1,min_x:30,chunks:0,hold_time:1e3,interval:5,list:[],selection:[],no_selection:{enabled:!1,prop:"",val:0},shift_selection:!1,callbacks:{select:null,unselect:null,render:null},mode:OGX.DynamicList.SELECT_MODE_SINGLE,trigger:!1,scope:!0,swipe_template:'<div class="ogx_dynamic_list_item ogx_dynamic_list_swiper_back_item" style="height:{{$height}}px; z-index:{{$zindex}}; margin-bottom:{{$margin}}px;">{{$template}}</div>',zindex:1},swipe_default={mode:OGX.DynamicList.SWIPE_MODE_DELETE,options:{},template:!1,html:""},container,filtered,isFiltered,selection=new OGX.List,key_id=1,key_default="__id__",key,drag={mode:!1,stime:0,target:0,si:0,ei:0,y:0},move_intv=null,hold_intv=null,drag_intv=null,swipe_dir=0,display=new OGX.Display(config),ready=!1,scroller=!1,chunk=0,multi_select_shift=!1,multi_select_control=!1,multi_select_started=!1,multi_select_start=null,multi_select_end=null;function isSelectable(__item){if(Array.isArray(config.no_selection)&&config.no_selection.length&&config.no_selection.includes(__item[key]))return!1;var q={};return q[key]=__item[key],!selection.get(q,null,1)&&(!config.no_selection.enabled||eval("__item."+config.no_selection.prop+" !== config.no_selection.val"))}function onUpdate(e,t){var i,n=config.list.getFilters();isFiltered&&((i=new OGX.List(t)).setFilters(n),i.filter().length||(e.remove(),filtered.findDelete(key,t[key],1),selection.findDelete(key,t[key],1)))}function replace(e,t,i){if(display.hasOML(i)){var n,o,a=toDataId(i[t]),r=display.oml('.ogx_dynamic_list[data-ogx-id="'+that.id+'"] > .ogx_dynamic_list_item[data-ogx-id='+a+"]",i,config.as);$('.ogx_dynamic_list[data-ogx-id="'+that.id+'"] > .ogx_dynamic_list_item[data-ogx-id='+a+"]").find(".ogx_uxi").each((function(e,t){n=$(t).data("ogx-id"),(o=that.cfind(!1,n,1))&&that.find(o._NAME_,o.id,"remove")})),OGX.OML.render(that,r,i)}else{var s="";selection.length&&selection.find(t,i[t],1)&&(s="ogx_dynamic_list_selected_item "),e.attr("class","").addClass("ogx_dynamic_list_item "+s+display.css(i)),e.html(display.html(i))}}function render(){var e=getWorkList(),t=selection;isFiltered&&(selection.resetFilters(),selection.setFilters(config.list.getFilters()),(t=selection.filter()).length!==selection.length&&(t.length?container.trigger(OGX.DynamicList.SELECT_FILTERED,[t]):container.trigger(OGX.DynamicList.SELECT_UNFILTERED,[selection])));var i,n,o,a="",r=[],s=e.length;(config.display_max||config.chunks)&&(s=config.display_max||config.chunks)>e.length&&(s=e.length);for(var l=0;l<s;l++)if(!config.scope||!e[l].hasOwnProperty("scope")||config.scope&&!0===config.scope&&OGX.Scope.eval(e[l].scope)||config.scope&&"string"==typeof config.scope&&OGX.Scope.eval(e[l].scope,config.scope)){!1,n="",i=e[l][key],selection.find(key,i,1)&&(n="ogx_dynamic_list_selected_item"),isSelectable(e[l])||(n="ogx_dynamic_list_disabled_item"),display.html(e[l]);var c=toDataId(i);a+='<div class="ogx_dynamic_list_item '+n+" "+display.css(e[l])+'" data-ogx-id='+c+"></div>",o=display.oml('.ogx_dynamic_list[data-ogx-id="'+that.id+'"] .ogx_dynamic_list_item[data-ogx-id='+c+"]",e[l],config.as),r.push(o)}that.observeOnce(null,(()=>{config.trigger&&container.trigger(OGX.DynamicList.RENDER),that.onRender(that)})),container.html(a),parseOML(r)}function parseOML(e){for(var t=0;t<e.length;t++)that.parse(e[t])}function listenScope(e){e?$(document).on(OGX.Scope.CHANGE,onScopeChange):$(document).off(OGX.Scope.CHANGE,onScopeChange)}function onScopeChange(){that.render()}function listenChunks(e){e?that.scroller.el.on(OGX.Scroller.BOTTOM,handleChunks):that.scroller.el.off(OGX.Scroller.BOTTOM,handleChunks)}function handleChunks(e){e.stopImmediatePropagation();var t=config.chunks*(chunk+1),i=config.chunks*(chunk+1)+config.chunks,n=getWorkList();i>n.length?(i=n.length,listenChunks(!1)):chunk++;for(var o=t;o<i;o++)that.insert(n[o],undefined,!1)}function listenShift(e){e?($(document).on("keydown",onShiftDown),$(document).on("keyup",onShiftUp)):($(document).off("keydown",onShiftDown),$(document).off("keyup",onShiftUp))}function onShiftDown(e){16===e.keyCode&&(multi_select_shift=!0),17===e.keyCode&&(multi_select_control=!0)}function onShiftUp(e){16===e.keyCode&&(multi_select_shift=!1,multi_select_started=!1),17===e.keyCode&&(multi_select_control=!1)}function listenItems(e){void 0!==container&&ready&&(e?container.on(that.touch.click,".ogx_dynamic_list_item",onClick):container.off(that.touch.click,".ogx_dynamic_list_item",onClick))}function listenTouch(e){e?container.on(that.touch.down,".ogx_dynamic_list_item",onTouchStart):container.off(that.touch.down,".ogx_dynamic_list_item",onTouchStart)}function listenTouchHold(e){e?hold_intv=setInterval(onTouchHold,20):(clearInterval(hold_intv),hold_intv=null)}function listenTouchMove(e){e?container.on(that.touch.move,".ogx_dynamic_list_item",onTouchMove):container.off(that.touch.move,".ogx_dynamic_list_item")}function onTouchStart(e){drag.mode=!1,drag.target=$(e.currentTarget),drag.si=drag.target.index(),drag.cy=container.offset().top,e=that.event(e),drag.startx=e.pageX,drag.starty=e.pageY,drag_intv&&clearInterval(drag_intv),drag.stime=(new Date).getTime(),config.reorder&&listenTouchHold(!0),listenTouchMove(!0),$("body").on(that.touch.up,onTouchEnd)}function onTouchMove(e){e=that.event(e),drag.y=-1*(drag.starty-e.pageY),drag.mx=e.pageX-drag.startx,drag.px=e.pageX,drag.py=e.pageY,drag.st=!1,config.swipe&&!drag.mode&&Math.abs(drag.mx)>config.min_x&&(drag.mode="swipe",config.scroll&&!drag.st&&(drag.st=!0,scroller.disable(),scroller.container().css("cssText","height:"+scroller.container().height()+"px !important;")),config.reorder&&listenTouchHold(!1),listenSwipeMove(!0))}function onTouchHold(){if(!drag.mode&&(new Date).getTime()-drag.stime>config.hold_time){drag.mode="reorder";var e=drag.target.data("ogx-id"),t=getWorkList();drag.item=t.find(key,e,1),container.trigger(OGX.DynamicList.HOLD,[drag.item]),listenTouchHold(!1),setTimeout(startDrag(),0)}}function onTouchEnd(e){if($("body").off(that.touch.up,onTouchEnd),(config.reorder||config.swipe)&&(clearInterval(drag_intv),drag_intv=!1,listenTouchMove(!1)),config.swipe&&listenSwipeMove(!1),config.reorder&&listenTouchHold(!1),config.scroll&&(scroller.enable(),scroller.container().removeAttr("style")),config.reorder){if("reorder"===drag.mode&&(container.off(that.touch.move,handleMove),drag.clone)){var t=JSON.parse(JSON.stringify(config.list[drag.si]));return config.list.delete(drag.si),config.list.insert(t,drag.ei),drag.clone.remove(),drag.clone=!1,drag.target.removeClass("ogx_dynamic_list_frozen"),void container.trigger(OGX.DynamicList.DROP,[drag.item])}var i=drag.target.data("ogx-id"),n=config.list.find(key,i,1);that.onSelect(n),container.trigger(OGX.DynamicList.SELECT,[n],data.target),that.select(key,i)}else if(config.swipe&&"swipe"===drag.mode){var o=drag.target.outerWidth(!0),a=Math.abs(100*drag.mx/o);a<50?a?(drag.target.addClass("ogx_dynamic_list_swiper_trans_item_restore"),drag.target.addClass("ogx_dynamic_list_swiper_trans_item").css("transform","translateX(0px)")):(drag.target.next(".ogx_dynamic_list_swiper_back_item").remove(),drag.target.css("transform","translateX(0px)")):drag.mx>0?(drag.target.attr("data-side","left"),drag.target.addClass("ogx_dynamic_list_swiper_trans_item").css("transform","translateX("+o+"px)")):(drag.target.attr("data-side","right"),drag.target.addClass("ogx_dynamic_list_swiper_trans_item").css("transform","translateX("+-1*o+"px)"))}drag.mode=!1}function listenSwipeMove(e){e?move_intv=setInterval(onSwipeMove,config.interval):(clearInterval(move_intv),move_intv=!1)}function onSwipeMove(){if("swipe"===drag.mode&&Math.abs(drag.mx)>config.min_x){var e=parseInt(drag.target.css("border-top-width").split("px")[0]),t=parseInt(drag.target.css("border-bottom-width").split("px")[0]),i=drag.target.outerHeight();if(!drag.target.hasClass("ogx_dynamic_list_swiper_work")){drag.target.addClass("ogx_dynamic_list_swiper_work");var n={};n.height=i,n.margin=-2*(e+t),n.top=drag.target.position().top,n.zindex=config.zindex;var o="";config.swipe.template?o=OGX.Templater.get(config.swipe.template):config.swipe.html&&(o=config.swipe.html),n.template=o,o=OGX.Templater.make(config.swipe_template,n),drag.target.after(o)}if(config.swipe.mode===OGX.DynamicList.SWIPE_MODE_SIDE&&(drag.mx<0?(swipe_dir=1,drag.target.next(".ogx_dynamic_list_swiper_back_item").addClass("ogx_dynamic_list_swiper_side_left").removeClass("ogx_dynamic_list_swiper_side_right")):(swipe_dir=-1,drag.target.next(".ogx_dynamic_list_swiper_back_item").addClass("ogx_dynamic_list_swiper_side_right").removeClass("ogx_dynamic_list_swiper_side_left"))),drag.py>=drag.target.offset().top&&drag.py<=drag.target.offset().top+i){drag.target.css("transform","translateX("+drag.mx+"px)");var a=drag.target.next(".ogx_dynamic_list_swiper_back_item");drag.mx<0?a.addClass("ogx_dynamic_list_swiper_right").removeClass("ogx_dynamic_list_swiper_left"):a.addClass("ogx_dynamic_list_swiper_left").removeClass("ogx_dynamic_list_swiper_right")}else onTouchEnd(drag.target)}}function listenTrans(e){e?container.on("transitionend",".ogx_dynamic_list_swiper_trans_item",onTransEnd):container.off("transitionend",".ogx_dynamic_list_swiper_trans_item",onTransEnd)}function onTransEnd(e){var t=$(this),i=t.next(".ogx_dynamic_list_swiper_back_item");if(t.hasClass("ogx_dynamic_list_swiper_trans_item_restore"))i.remove(),t.css("transform","translateX(0px)"),t.removeClass("ogx_dynamic_list_swiper_trans_item");else{var n,o=t.index(),a=t.data("ogx-id");switch(config.swipe.mode){case OGX.DynamicList.SWIPE_MODE_DELETE:t.remove(),shrink(i),n=config.list.findDelete(config.key,String(a),1),container.trigger(OGX.DynamicList.DELETE,{item:n,index:o});break;case OGX.DynamicList.SWIPE_MODE_SIDE:var r;n=config.list.find(config.key,a,1),r=-1===swipe_dir?"right":"left",container.trigger(OGX.DynamicList.SIDED,{side:r,item:n,index:o});break;case OGX.DynamicList.SWIPE_MODE_CUSTOM:}}t.removeClass("ogx_dynamic_list_swiper_work"),t.removeClass("ogx_dynamic_list_swiper_trans_item_restore")}function shrink(e,t){e.addClass("ogx_dynamic_list_swiper_delete"),e.on("transitionend",(function(){e.off("transitionend"),e.remove()}))}function startDrag(){drag.tgy=drag.target.position().top,drag.tgx=drag.target.position().left,drag.y=0;var e=drag.target.outerWidth(),t=drag.target.outerHeight();drag.clone=drag.target.clone().css({position:"absolute",left:drag.tgx+"px",top:drag.tgy+"px",width:e+"px",height:t+"px"}).addClass("ogx_dynamic_list_reorder").prependTo(container),drag.clone.addClass("ogx_dynamic_list_drag"),drag.target.addClass("ogx_dynamic_list_frozen"),drag_intv=setInterval(handleDrag,config.interval),container.on(that.touch.move,handleMove)}function handleMove(e){e.preventDefault(),e.stopImmediatePropagation(),e=that.event(e),drag.y=-1*(drag.starty-e.pageY)}function handleDrag(){if(Math.abs(container.offset().top-drag.cy)>1)return clearInterval(drag_intv),drag_intv=!1,drag.clone.remove(),drag.clone=!1,drag.target.removeClass("ogx_dynamic_list_frozen"),void container.trigger(OGX.DynamicList.RELEASE);var e=!1,t=container.children(".ogx_dynamic_list_item").last(),i=t.offset().top+-1*drag.cy;if(drag.tgy+drag.y<i?drag.clone.css({top:drag.tgy+drag.y}):e=t,!e){var n,o,a,r,s=0;container.children(".ogx_dynamic_list_item").each((function(t,i){if((i=$(i))[0]!==drag.clone[0]&&!i.hasClass("ogx_dynamic_list_frozen")){if(n=i.offset().top,o=i.outerHeight(),r=n+o/2,(a=drag.clone.offset().top)>n&&a<r)return s=-1,void(e=i);if(a>r&&a<n+o)return s=1,void(e=i)}}))}if(e){var l,c=$(e).data("ogx-id");switch(drag.ei=config.list.findIndex(key,c).index,s){case-1:e.index()-1!==drag.target.index()&&((l=drag.target.detach()).removeClass("ogx_dynamic_list_drag"),l.insertBefore(e));break;case 1:e.index()+1!==drag.target.index()&&((l=drag.target.detach()).removeClass("ogx_dynamic_list_drag"),l.insertAfter(e))}e=!1}}function onClick(e){e.preventDefault(),e.stopImmediatePropagation();var t=$(this);switch(config.mode){case OGX.DynamicList.SELECT_MODE_SINGLE:!config.reselect&&t.hasClass("ogx_dynamic_list_selected_item")||t.hasClass("ogx_dynamic_list_swiper_trans_item")||(r=selectIndex(t.index(),!0))&&(that.onSelect(r),container.trigger(OGX.DynamicList.SELECT,[r,t]));break;case OGX.DynamicList.SELECT_MODE_TOGGLE:t.hasClass("ogx_dynamic_list_selected_item")||t.hasClass("ogx_dynamic_list_swiper_trans_item")?(r=selectIndex(t.index(),!1))&&(that.onUnselect(r),container.trigger(OGX.DynamicList.UNSELECT,[r,t])):(that.resetSelection(),(r=selectIndex(t.index(),!0))&&(that.onSelect(r),container.trigger(OGX.DynamicList.SELECT,[r,t])));break;case OGX.DynamicList.SELECT_MODE_MULTI:if(t.hasClass("ogx_dynamic_list_selected_item")||t.hasClass("ogx_dynamic_list_swiper_trans_item"))(r=selectIndex(t.index(),!1))&&(that.onUnselect(r),container.trigger(OGX.DynamicList.UNSELECT,[r,t]));else if(config.shift_selection&&multi_select_shift)if(multi_select_started){if((multi_select_end=t.index())<multi_select_start){var i=multi_select_end;multi_select_end=multi_select_start,multi_select_start=i}for(var n=multi_select_start;n<multi_select_end+1;n++)r=selectIndex(n,!0),that.onSelect(r),container.trigger(OGX.DynamicList.SELECT,[r,t])}else multi_select_started=!0,multi_select_start=t.index(),multi_select_control||(that.resetSelection(),r=selectIndex(multi_select_start),that.onSelect(r),container.trigger(OGX.DynamicList.SELECT,[r,t]));else(r=selectIndex(t.index(),!0))&&(that.onSelect(r),container.trigger(OGX.DynamicList.SELECT,[r,t]));break;case OGX.DynamicList.SELECT_MODE_SET:var o=getWorkList();t.hasClass("ogx_dynamic_list_swiper_trans_item")||(r=t.hasClass("ogx_dynamic_list_selected_item")?o[t.index()]:selectIndex(t.index(),!0))&&(that.onSelect(r),container.trigger(OGX.DynamicList.SELECT,[r,t]));break;case OGX.DynamicList.SELECT_MODE_HIT:o=getWorkList();if(t.hasClass("ogx_dynamic_list_swiper_back_item")){var a="left";t.hasClass("ogx_dynamic_list_swiper_side_right")&&(a="right"),container.trigger(OGX.DynamicList.BACK_HIT,{side:a,item:o[t.index()]})}else{var r=selectIndex(t.index(),!1);that.onSelect(r),container.trigger(OGX.DynamicList.SELECT,[r,t])}}}function select(e,t,i,n){void 0===n&&(n=!1);var o=null;"single"===config.mode&&(that.resetSelection(),o=1);var a,r,s=getWorkList(),l={};Array.isArray(t)?(l[e]={in:t},sel=s.get(l,null,o)):(l[e]={eq:t},sel=s.get(l)),sel&&!Array.isArray(sel)&&(sel=[sel]);for(var c=0;c<sel.length;c++)r=toDataId(sel[c][key]),(a=container.find(".ogx_dynamic_list_item[data-ogx-id="+r+"]"))&&(i?(a.addClass("ogx_dynamic_list_selected_item"),selection.push(sel[c]),n&&(that.el.trigger(OGX.DynamicList.SELECT,[sel[c],a]),that.onSelect(sel[c]))):(a.removeClass("ogx_dynamic_list_selected_item"),selection.findDelete(key,sel[c][key],1)));return["single","hit"].includes(config.mode)&&sel.length?sel[0]:sel}function selectIndex(e,t,i){var n,o;void 0===i&&(i=!1);var a=getWorkList();if((n=container.find(".ogx_dynamic_list_item:eq("+e+")")).length>0){var r=n.data("ogx-id");return o=a.find(key,r,1),t?isSelectable(o)&&(config.mode===OGX.DynamicList.SELECT_MODE_SINGLE&&that.resetSelection(),n.addClass("ogx_dynamic_list_selected_item"),selection.push(a[e]),i&&(that.el.trigger(OGX.DynamicList.SELECT,[a[e],n]),that.onSelect(a[e]))):(n.removeClass("ogx_dynamic_list_selected_item"),selection.findDelete(key,r,1)),o}return!1}function noSelectionCSS(){if(container.find(".ogx_dynamic_list_item_disabled").removeClass("ogx_dynamic_list_item_disabled"),Array.isArray(config.no_selection)&&config.no_selection.length){var e,t={};t[key]={in:config.no_selection},config.list.get(t).forEach((t=>{(e=that.getElement(key,t[key]))&&(e=$(e)).addClass("ogx_dynamic_list_item_disabled")}))}}function getWorkList(){return isFiltered?filtered:config.list}function toDataId(e){return"string"==typeof e&&(e='"'+e+'"'),e}function forceIds(){for(var e=0;e<config.list.length;e++)config.list[e][key]=key_id,key_id++}function clearIds(e){for(var t=0;t<e.length;t++)delete e[t][key];return e}function finalize(){config.selection.length&&that.observeOnce({childList:!0,subtree:!0},(function(){for(var e=0;e<config.selection.length;e++)that.select(key,config.selection[e])})),that.val(config.list,!1,!1),ready=!0,!that.blured&&config.enabled&&(listenItems(!0),config.chunks&&listenChunks(!0)),!0===config.scope&&listenScope(!0),container.trigger(OGX.DynamicList.READY)}function initDefaults(){config||(config={}),OGX.Data.merge(config,config_default),config.list.hasOwnProperty("_NAME_")||(config.list=new OGX.List(config.list)),!config.key&&config.list.length>0?(key=key_default,forceIds()):key=config.key,config.swipe&&("object"!=typeof config.swipe&&(config.swipe={}),OGX.Data.merge(config.swipe,swipe_default)),config.callbacks.select&&(that.onSelect=config.callbacks.select),config.callbacks.unselect&&(that.onUnselect=config.callbacks.unselect),config.callbacks.render&&(that.onRender=config.callbacks.render),(container=that.el).addClass("ogx_dynamic_list")}function init(){initDefaults(),finalize(),config.scroll&&(scroller=that.find("Scroller",config.id+"_scroller"))}this.onFocus=function(e){return void 0===e&&(e=!1),(e||config.mode!==OGX.DynamicList.STATIC)&&(listenItems(!0),(config.reorder||config.swipe)&&(listenTouch(!0),config.swipe&&listenTrans(!0))),config.chunks&&listenChunks(!0),"multi"===config.mode&&config.shift_selection&&listenShift(!0),this},this.onBlur=function(e){return void 0===e&&(e=!1),(e||config.mode!==OGX.DynamicList.STATIC)&&(listenItems(!1),(config.reorder||config.swipe)&&(listenTouch(!1),config.swipe&&listenTrans(!1))),config.chunks&&listenChunks(!1),"multi"===config.mode&&config.shift_selection&&listenShift(!1),this},this.bindFilter=function(e,t,i,n){void 0!==i&&("function"==typeof n?(config.list.removeFilter(e),config.list.addFilter(e,n,i)):(config.list.removeFilter(e),config.list.addFilter(e,t,i))),config.list.getFilters()&&(filtered=config.list.filter(),isFiltered=!0),chunk=0,config.chunks&&listenChunks(!0),setTimeout(render,0)},this.unbindFilter=function(e){return config.list.removeFilter(e),filtered=config.list.filter(),isFiltered=!0,setTimeout(render,0),this},this.bindValue=function(){var e=this.getSelection();return e||null},this.destroy=function(){!0===config.scope&&listenScope(!1),this.clearBinds(),container.empty(),container.removeClass("ogx_dynamic_list")},this.val=function(e,t,i){if(void 0===e){if(!config.key){var n=JSON.parse(JSON.stringify(config.list));return clearIds(OGX.List(n))}return config.list}var o;return config.scroll?this.clear(this.scroller.id):this.clear(),void 0===t&&(t=!1),void 0===i&&(i=!0),e.hasOwnProperty("insert")||(e=new OGX.List(e)),this.resetSelection(),t||(o=config.list.getFilters()),config.list=e,config.key&&key!==key_default||(key_id=1,key=key_default,e=JSON.parse(JSON.stringify(e)),forceIds()),!t&&Object.keys(o).length?(config.list.setFilters(o),setTimeout(this.filter,0)):i?setTimeout(render,0):render(),this},this.scope=function(e){return void 0!==e&&"string"==typeof e?(config.scope=e,void this.render()):config.scope},this.onSelect=function(e){},this.onUnselect=function(e){},this.onRender=function(){},this.getFilteredList=function(){if(isFiltered){if(!config.key){var e=JSON.parse(JSON.stringify(filtered));return clearIds(OGX.List(e))}return filtered}return!1},this.display=function(e){return void 0===e?config.display:display.val(e)},this.key=function(e){if(void 0===e)return e;config.key=e,config.key||(key=key_default)},this.mode=function(e){return void 0===e?config.mode:(config.mode!==e&&(config.mode===OGX.DynamicList.STATIC?this.onFocus(!0):e===OGX.DynamicList.STATIC?this.onBlur(!0):e===OGX.DynamicList.SELECT_MODE_MULTI&&config.shift_selection&&!this.blured&&listenShift(!0),config.mode=e),this)},this.noSelection=function(e,t){if(1===arguments.length){if("object"==typeof e&&!Array.isArray(e))return config.no_selection=e,void noSelectionCSS();if("boolean"==typeof e)return config.no_selection.enabled=e,void noSelectionCSS();if(Array.isArray(e))return config.no_selection=e,void noSelectionCSS()}return 2===arguments.length?(config.no_selection.enabled=!0,config.no_selection.prop=e,config.no_selection.val=t,void noSelectionCSS()):config.no_selection},this.order=function(e,t){return config.list.order(e,t),setTimeout(render,0),this},this.filter=function(){return filtered=config.list.filter(),isFiltered=!0,setTimeout(render,0),filtered},this.unfilter=function(){return isFiltered=!1,setTimeout(render,0),this},this.addFilter=function(e,t,i){return config.list.addFilter(e,t,i)},this.removeFilter=function(e,t,i){return config.list.removeFilter(e,t,i)},this.resetFilters=function(){return config.list.resetFilters()},this.getFilters=function(){return config.list.getFilters()},this.insert=function(e,t,i){if(void 0===i&&(i=!0),!Array.isArray(e)){config.key||(e[key]=key_id++);var n=!1,o=!0;if(isFiltered){var a=new OGX.List(e);a.setFilters(config.list.getFilters()),0===a.filter().length?o=!1:filtered.push(e)}var r=toDataId(e[key]),s='<div class="ogx_dynamic_list_item '+display.css(e)+'" data-ogx-id='+r+"></div>",l=display.oml('.ogx_dynamic_list[data-ogx-id="'+this.id+'"] .ogx_dynamic_list_item[data-ogx-id='+r+"]",e,config.as);if(void 0===t)i&&config.list.push(e),o&&container.append(s);else if(i&&config.list.insert(e,t),o&&(isFiltered?n=(filtered=config.list.filter()).findIndex(key,e[key]):0===t?container.prepend(s):n=config.list.findIndex(key,e[key]),n)){var c=container.children(".ogx_dynamic_list_item:nth-child("+(n.index+1)+")");c.length>0?c.before(s):container.append(s)}return this.parse(l),config.trigger&&container.trigger(OGX.DynamicList.RENDER),this.onRender(),o}for(var d=0;d<e.length;d++)void 0!==t?this.insert(e[d],t+d):this.insert(e[d])},this.delete=function(e){var t=getWorkList().delete(e);if(t){config.list.findDelete(key,t[key],1),isFiltered&&filtered.findDelete(key,t[key],1),selection.findDelete(key,t[key],1);var i=container.children(".ogx_dynamic_list_item:eq("+e+")");return this.remove(t[key]),i.remove(),!0}return!1},this.deleteSelection=function(){for(var e=0;e<selection.length;e++)config.list.findDelete(key,selection[e][key],1),isFiltered&&filtered.findDelete(key,selection[e][key],1),this.remove(selection[e][key]),selection.findDelete(key,selection[e][key],1),container.children(".ogx_dynamic_list_selected_item").remove();return!0},this.findDelete=function(e,t,i){void 0===i&&1===arguments.length&&(t=e,e=key);var n,o,a,r=config.list.findDelete(e,t,i);r&&!Array.isArray(r)&&(r=[r]),selection.findDelete(e,t,i);for(var s=0;s<r.length;s++)isFiltered&&filtered.findDelete(e,t,i),a=toDataId(r[s][key]),o=(n=container.children(".ogx_dynamic_list_item[data-ogx-id="+a+"]")).next(".ogx_dynamic_list_swiper_back_item"),n.remove(),this.remove(r[s][key]),shrink(o);return 1===i?r[0]:r},this.findMove=function(e,t,i){void 0===i&&([i,t,e]=[t,e,key]);var n=this.findDelete(e,t,1);n&&this.insert(n,i)},this.findIndex=function(e,t){var i=arguments.length;1===i&&(t=e,e=key);var n=config.list.find(e,t,1);if(n){var o=toDataId(n[key]);return container.children(".ogx_dynamic_list_item[data-ogx-id="+o+"]").index()}return-1},this.findReplace=function(e,t,i){var n=arguments.length;2===n&&(i=t,t=e,e=key),config.key||(i[key]=key_id++);var o=config.list.findReplace(e,t,i,1);if(o){isFiltered&&filtered.findReplace(e,t,i,1);var a=toDataId(o[key]),r=container.children(".ogx_dynamic_list_item[data-ogx-id="+a+"]").first();return r.length&&(r.attr("data-ogx-id",i[key]),replace(r,key,i),config.trigger&&container.trigger(OGX.DynamicList.RENDER),this.onRender()),!0}return!1},this.replaceAt=function(e,t){var i=getWorkList();if(void 0===i[e])return!1;if(config.key)i[e]=t;else{var n=i[e][key];i[e]=t,i[e].key=n}return this.refreshAt(e)},this.select=function(e,t,i){return void 0===i&&(void 0===t&&(t=e,e=key),i=!1),select(e,t,!0,i)},this.selectIndex=function(e,t){return selectIndex(e,!0,t)},this.index=function(e){if(void 0!==e){var t=getWorkList();return this.select(key,t[e][key])}return container.children(".ogx_dynamic_list_selected_item").index()},this.unselect=function(e,t){return void 0===t&&(t=e,e=key),select(e,t,!1)},this.unselectIndex=function(e){return selectIndex(e,!1)},this.resetSelection=function(){return selection=new OGX.List,container.children(".ogx_dynamic_list_selected_item").removeClass("ogx_dynamic_list_selected_item"),this},this.getSelection=function(e){if(void 0===e&&(e=!1),!e){var t,i=selection;if(isFiltered&&(selection.resetFilters(),selection.setFilters(config.list.getFilters()),i=selection.filter()),config.key)t=i;else t=clearIds(OGX.Data.clone(i));return config.mode===OGX.DynamicList.SELECT_MODE_SINGLE?!!t.length&&t[0]:t=new OGX.List(t)}return container.children(".ogx_dynamic_list_selected_item")},this.getElement=function(e,t){var i=arguments.length;1===i&&(t=e,e=key);var n=config.list.find(e,t,1);if(n){var o=toDataId(n[key]);return container.children(".ogx_dynamic_list_item[data-ogx-id="+o+"]")[0]}return!1},this.findUpdate=function(e,t,i,n,o,a){var r;"number"==typeof n&&(a=o,Array.prototype.unshift.call(arguments,key)),void 0===a&&(a=!0);var s=config.list.findUpdate.apply(config.list,arguments);if(s&&!Array.isArray(s)&&(s=[s]),s.length&&a){var l;isFiltered&&filtered.findUpdate.apply(filtered,arguments);for(var c=0;c<s.length;c++)l=toDataId(s[c][key]),(r=container.children(".ogx_dynamic_list_item[data-ogx-id="+l+"]").first()).length&&(replace(r,key,s[c]),onUpdate(r,s[c]),config.trigger&&container.trigger(OGX.DynamicList.RENDER),this.onRender());return s.length}return!1},this.update=function(e,t,i,n,o){void 0===o&&(o=!0);var a=config.list.update(e,t,i,n);if(a&&!Array.isArray(a)&&(a=[a]),a.length&&o){var r;isFiltered&&filtered.update(arguments);for(var s=0;s<a.length;s++)r=toDataId(a[s][key]),el=container.children(".ogx_dynamic_list_item[data-ogx-id="+r+"]").first(),el.length&&(replace(el,key,a[s]),onUpdate(el,a[s]),config.trigger&&container.trigger(OGX.DynamicList.RENDER),this.onRender());return a.length}return!1},this.refresh=function(e,t,i){var n=arguments.length;void 0!==i&&n--,1===n&&(t=e,e=key);var o=config.list.find(e,t,i);if(o&&(1===i&&(o=[o]),o.length))for(var a,r,s=0;s<o.length;s++)r=toDataId(o[s][key]),(a=container.children(".ogx_dynamic_list_item[data-ogx-id="+r+"]")).length>0&&replace(a,key,o[s]);return this},this.refreshAt=function(e){var t=getWorkList();if(void 0!==t[e]){var i=toDataId(t[e][key]),n=container.children(".ogx_dynamic_list_item[data-ogx-id="+i+"]");if(n.length>0)return replace(n,key,t[e]),!0}return!1},this.restore=function(e,t){var i=arguments.length;1===i&&(t=e,e=key);var n=config.list.find(e,t,1),o=toDataId(n[key]),a=container.children(".ogx_dynamic_list_item[data-ogx-id="+o+"]");a.addClass("ogx_dynamic_list_swiper_trans_item_restore"),a.css({transform:"translateX(0px)","z-index":config.zindex+1}),setTimeout((()=>{a.next(".ogx_dynamic_list_swiper_back_item").remove()}),200)},this.wipe=function(){return config.scroll?this.clear([this.scroller.id]):this.clear(),this.val([])},this.reset=function(){return container.empty(),isFiltered=!1,config.list=new OGX.List,selection=new OGX.List,filtered=new OGX.List,this},this.render=function(){return setTimeout(render,0),this},this.scroll=function(e,t){if(config.scroll){void 0===t&&([t,e]=[e,key]);var i=this.getElement(key,t);i&&scroller.scroll($(i).position().top)}},init()},OGX.DynamicList.HOLD="DynamicListHold",OGX.DynamicList.RELEASE="DynamicListRelease",OGX.DynamicList.DROP="DynamicListDrop",OGX.DynamicList.SELECT="DynamicListSelect",OGX.DynamicList.DELETE="DynamicListDelete",OGX.DynamicList.SIDED="DynamicListSided",OGX.DynamicList.BACK_HIT="DynamicListBackHit",OGX.DynamicList.UNSELECT="DynamicListUnselect",OGX.DynamicList.RENDER="DynamicListRender",OGX.DynamicList.SELECT_MODE_SINGLE="single",OGX.DynamicList.SELECT_MODE_TOGGLE="toggle",OGX.DynamicList.SELECT_MODE_MULTI="multi",OGX.DynamicList.SELECT_MODE_SET="set",OGX.DynamicList.SELECT_MODE_HIT="hit",OGX.DynamicList.SELECT_FILTERED="DynamicListSelectFiltered",OGX.DynamicList.SELECT_UNFILTERED="DynamicListSelecUnfiltered",OGX.DynamicList.STATIC="static",OGX.DynamicList.SWIPE_LEFT="DynamicListSwipeLeft",OGX.DynamicList.SWIPE_RIGHT="DynamicListSwipeRight",OGX.DynamicList.SWIPE_MODE_DELETE="DynamicListSwipeModeDelete",OGX.DynamicList.SWIPE_MODE_SIDE="DynamicListSwipeModeSide",OGX.DynamicList.SWIPE_MODE_CUSTOM="DynamicListSwipeModeCustom",OGX.DynamicList.READY="DynamicListReady",OGX.DynamicList.BIND=OGX.DynamicList.SELECT+" "+OGX.DynamicList.UNSELECT,OGX.Fonction=function(__config,__data,__route_data){var that=this,config=__config,config_default={id:1,parent:null,fnc:null,data:null,success:null,error:null};OGX.Data.merge(config,config_default,!1);var fnc=eval(config.fnc),oml,promise=fnc.apply(null,[config.data]);promise.then((function(e){OGX.OML.result(config.id,e),oml=config.success,OGX.OML.render(config.parent,oml,__data,__route_data)}),(function(e){OGX.OML.result(config.id,e),oml=config.error,OGX.OML.render(config.parent,oml,__data,__route_data)}))},OGX.Form=function(){"use strict";var e=this,t={el:!1,allowed:!1,forbidden:!1,change_cb:!1,submit_cb:!1,validate:!1,diff:!0,params:null,elem_types:["input","select","textarea"],wait:1e3,fields:{},buffer:null},i={el:!1,allowed:/[0-9a-zA-Z‘’'"à-úÀ-Ú\\-\\!\\.\\?\\#\\@\\$\\:\\(\\)\\/_,;%' ]/,forbidden:/[<>]/,pattern:!1,validate:!1,mask:!1,mask_char:"%",paste:!0,autocomplete:null,multiline:!1,input_cb:!1,change_cb:!1,submit:!1,submit_cb:!1,diff:!0,val:null,last_change:!1,wait:2e3,intv:!1,max:2500,type:"string",params:null},n=new OGX.List,o=new OGX.List,a=!1;function r(e,i){$(i).find(t.elem_types.join(",")).each((function(t,i){$(i).prop("disabled",!e)}))}function s(t,i){if(!a){var o,r=n.find("el",i,1);if(r&&r.config.change_cb){for(var s in r.fields)if(r.fields[s].intv)return;var l=u(r.form,!0);for(var d in l)r.config.fields.hasOwnProperty(d)&&r.config.fields[d].hasOwnProperty("type")?l[d]=c(r.config.fields[d].type,l[d]):r.config.hasOwnProperty("type")&&(l[d]=c(r.config.type,l[d]));if(o=JSON.stringify(l),!r.diff||r.val!==o){var h;if(r.val=o,r.config.validate){h={obj:l,form:i,valid:!1};var f=e.validate(r.form);!0===f?h.valid=!0:(h.valid=!1,h.error=f)}else h=l;r.config.params&&(h.params=r.config.params),r.buffer&&clearTimeout(r.buffer),r.buffer=setTimeout((()=>{r.config.change_cb(h)}),10)}}}}function l(t){var i={el:t.el,config:t,field:$(t.el),intv:!1,fnc:"val"};"DIV"===i.field[0].nodeName&&"true"===i.field.prop("contenteditable")&&(i.fnc="text");var o=i.field.data("ogx-type");o&&(i.config.type=o),i.name=i.field.attr("name"),i.val=i.field[i.fnc](),i.field[i.fnc](i.val),t.pattern&&i.field.attr("pattern",t.pattern),n.insert(i),$(document).on("input change",i.el,(function(e){if(!a){var t=$(this)[i.fnc]();if(!i.config.diff||i.config.diff&&t!==i.val){if(i.config.input_cb){var n={value:null,obj:{},el:null};t=c(i.config.type,t),n.el=i.field[0],n.value=t,n.property=i.name,n.obj[i.name]=t,i.config.input_cb(n,i.config.params)}i.intv&&clearTimeout(i.intv),i.intv=setTimeout((()=>{!function(e){var t=$(e.el)[e.fnc]();if(e.val=t,e.config.change_cb){var i={value:null,obj:{},el:null};t=c(e.config.type,t),i.el=e.field[0],i.property=e.name,i.value=t,i.obj[i.property]=t,e.config.validate&&(i.valid=i.el.checkValidity()),e.config.change_cb(i,e.config.params)}}(i)}),i.config.wait)}}})),t.multiline||$(document).on("keydown",i.el,(function(e){var t=$(this);if(void 0!==e.which&&void 0!==e.key){if(!a){if(i.config.mask&&8===e.which||46===e.which){var n=t[0].selectionStart,o=t[i.fnc]();return o=8===e.which?o.substr(0,n-1):o.substr(0,n),t[i.fnc](o),!1}if(8!==e.which&&13!==e.which&&1===e.key.length){var r=e.key;if(13!==e.which&&i.config.mask){if((o=t[i.fnc]()).length>=i.config.mask.length)return e.preventDefault(),e.stopImmediatePropagation(),!1;for(var s=i.config.mask,l=0;l<o.length;l++)i.config.mask.substr(l,1)===i.config.mask_char&&(s=s.replace(i.config.mask_char,o.substr(l,1)));var d=s.indexOf(i.config.mask_char),u=!1;return d+1<s.length+1&&(u=s.substr(d+1,1)),-1!==d&&(r===i.config.mask.substr(s.indexOf(i.config.mask_char)-1,1)?s=s.substr(0,s.indexOf(i.config.mask_char)-1):(s=s.substr(0,s.indexOf(i.config.mask_char)),u&&u!==i.config.mask_char&&setTimeout((()=>{i.field[i.fnc](s+r+u)}),0))),void i.field[i.fnc](s)}}if(13===e.which){e.preventDefault(),e.stopImmediatePropagation();o=$(this)[i.fnc]();if(i.intv&&(clearInterval(i.intv),i.intv=null),i.config.change_cb||i.config.submit){var h={value:null,obj:{},el:null};o=c(i.config.type,o),h.el=i.field[0],h.property=i.name,h.value=o,h.obj[i.name]=o,i.config.validate&&(h.valid=i.field[0].checkValidity()),i.config.change_cb&&i.config.change_cb(h,i.config.params),i.config.submit&&(i.config.submit_cb?i.config.submit_cb(h):i.field.trigger("submit"))}else i.field.trigger("change",o)}}}else i.config.mask&&setTimeout((()=>{for(var e=t[i.fnc](),n="",o=0,a=0;a<i.config.mask.length&&a-o!==e.length;a++)i.config.mask.substr(a,1)===i.config.mask_char||i.config.mask.substr(a,1)===e.substr(a-o,1)?n+=e.substr(a-o,1):i.config.mask.substr(a,1)!==i.config.mask_char&&(n+=i.config.mask.substr(a,1),a&&o++);t[i.fnc](n)}),0)})),(i.config.allowed||i.config.forbidden)&&e.restrictField(i.config)}function c(e,t){switch(e){case"string":return String(t);case"number":return Number(t);case"int":return parseInt(t);case"bool":if([!0,"true",1].includes(t))return!0;case"json":var i;try{i=JSON.parse(t)}catch(e){i=null}return i}return t}function d(){for(var e=0;e<n.length;e++)n[e].hasOwnProperty("field")&&n[e].field.length&&(n[e].val=$(n[e].field[0])[n[e].fnc]())}function u(e,i){void 0===i&&(i=!1);var o,a=$(e),r=[];if(i){var s="";t.elem_types.forEach((e=>{s+=e+":disabled,"})),s=s.slice(0,-1),a.find(s).each((function(e,t){r.push(t.getAttribute("name"))}))}return a.serializeArray().map(function(e){var t;return t=e.name,(o=n.get({name:{in:t}},null,1))&&(e.value=c(o.config.type,e.value)),r.length&&r.includes(e.name)||(this[e.name]=e.value),this}.bind({}))[0]}this.updateBind=function(e,t){var i=this.getBind(e);return!!i&&(OGX.Data.merge(i.config,t,!0,!1,!1),!0)},this.getBind=function(e){return n.get({el:{in:e}},null,null,1)},this.bindForm=function(o){return OGX.Data.merge(o,t,!1),function(t){for(var o,r,c={el:t.el,config:t,form:$(t.el),fields:new OGX.List,val:""},d=0;d<t.elem_types.length;d++)c.form.find(t.elem_types[d]).each((function(e,n){n.hasAttribute("name")&&(r=n.getAttribute("name"),o=OGX.Data.clone(i),OGX.Data.merge(o,t,!0,!1,!0),t.fields.hasOwnProperty(r)&&(o=OGX.Data.merge(o,t.fields[r],!0)),o.el=t.el+" "+t.elem_types[d]+'[name="'+r+'"]',o.change_cb=s,o.params=t.el,l(o),c.fields.insert({el:o.el}))}));c.form.on("submit",(function(t){if(t.preventDefault(),t.stopImmediatePropagation(),!a){var i={obj:u(c.el),form:c.el};if(c.config.params&&(i.params=c.config.params),c.config.validate){var n=e.validate(c.el);!0===n?i.valid=!0:(i.valid=!1,i.error=n)}c.config.submit_cb?c.config.submit_cb(i):c.form.trigger("submit",i)}})),n.insert(c)}(o),!0},this.enableForm=function(e){void 0===e?n.forEach((e=>{e.hasOwnProperty("fields")&&r(!0,e.el)})):r(!0,e)},this.disableForm=function(e){void 0===e?n.forEach((e=>{e.hasOwnProperty("fields")&&r(!1,e.el)})):r(!1,e)},this.enable=function(){a&&(a=!1)},this.disable=function(){a||(a=!0)},this.change=e=>{var t=n.get({el:{eq:e}},null,1);t&&t.fields.length&&s(this.toObj(t.el),t.el)},this.unbindForm=function(e){if(void 0===e)unbindAll("form");else{var t=n.find("el",e,1);if(t){for(var i in $(document).off("submit",t.el),t.fields)this.unbindField(t.fields[i].el);n.findDelete("el",e,1)}}},this.unbindAll=function(t){void 0===t&&(t="all");for(var i=0;i<n.length;i++)["form","all"].includes(t)&&n[i].hasOwnProperty("fields")?e.unbindForm(n[i].el):["field","all"].includes(t)&&!n[i].hasOwnProperty("fields")&&e.unbindField(n[i].el)},this.bindField=function(e){return OGX.Data.merge(e,i),l(e),!0},this.unbindField=function(e){var t=n.find("el",e,1);t&&($(document).off("input change",t.el),t.config.multiline||$(document).off("keydown",t.el),t.intv&&clearInterval(t.intv),o.find("el",t.el,1)&&this.unrestrictField(t.el),n.findDelete("el",t.el,1))},this.restrictField=function(e){return OGX.Data.merge(e,i),function(e){var t={el:e.el,config:e,field:$(e.el),keys:[],content:null},i=[8,9];null===e.autocomplete&&t.field[0].hasAttribute("autocomplete")&&"off"!==t.field.attr("autocomplete")?t.config.autocomplete=!0:(null===e.autocomplete&&(e.autocomplete=!0),t.config.autocomplete=e.autocomplete);e.autocomplete||t.keys.push(229);-1!==["input","texarea"].indexOf(t.field.get(0).tagName.toLowerCase())?t.content="val":t.content="text";t.config.multiline||t.keys.push(13);$(document).on("textInput keydown",t.el,(function(e){if("keydown"===e.type&&8==e.keyCode||46==e.keyCode)$(this).trigger("input");else if("textInput"===e.type){var n=e.originalEvent.data;if(n.length>1)return t.config.autocomplete?void 0:(e.preventDefault(),e.stopImmediatePropagation(),!1);if(1===n.length&&-1!==t.keys.indexOf(e.which)&&-1===e.which.indexOf(i))return e.preventDefault(),e.stopImmediatePropagation(),!1;if(t.config.multiline&&13===e.keyCode)return!1;if(t.config.allowed&&!n.match(t.config.allowed))return e.preventDefault(),e.stopImmediatePropagation(),!1;if(t.config.forbidden&&n.match(t.config.forbidden))return e.preventDefault(),e.stopImmediatePropagation(),!1;if($(e.originalEvent.target)[t.content]().length>=t.config.max)return e.preventDefault(),e.stopImmediatePropagation(),!1}})),$(document).on("paste",t.el,(function(e){if(!t.config.paste)return e.preventDefault(),e.stopImmediatePropagation(),!1;var i=e.originalEvent.clipboardData.getData("Text");return t.config.forbidden&&i.match(t.config.forbidden)?(e.preventDefault(),e.stopImmediatePropagation(),!1):void 0})),o.insert(t)}(e),!0},this.unrestrictField=function(e){var t=o.find("el",e,1);return!!t&&($(document).off("textInput keydown",t.el),$(document).off("paste",t.el),o.findDelete("el",e,1),!0)},this.toObj=function(e,t){return u(e,t)},this.populate=function(e,t,i){var n,o,a,r;void 0===i&&(i=null),$(e).find("*[name]").each((function(e,s){n=s.getAttribute("name"),a=!1,"string"!=typeof(a=OGX.Data.eval(t,n))&&(a=JSON.stringify(a)),void 0!==a&&(i&&i.hasOwnProperty(n)&&"function"==typeof i[n]&&(a=i[n](a)),o=$(s),r="val","true"===o.prop("editablecontent")&&(r="text"),o[r](a),s.hasAttribute("type")&&"hidden"===o.attr("type")&&o.trigger("change"))})),setTimeout(d,0)},this.validate=function(e){var i,n=$(e),o=t.elem_types,a=[];return n.find(o.join(",")).each((function(e,t){"submit"!==(i=$(t)).attr("type")&&(t.checkValidity()||a.push(i))})),!a.length||a}},OGX.Form=new OGX.Form,OGX.Form.fromObject=function(e,t,i,n){var o={el:t.selector+" "+i,data:e,fullpath:!1};return OGX.Data.merge(o,n),t.create("FormInstance",o)},require("FormInstance","Uxi","Placeholder"),OGX.FormInstance=function(__config){construct(this,"FormInstance");var that=this,config_defaults={fullpath:!1},config=OGX.Data.merge(__config,OGX.Form.defaults,!1,!0);function render(){var html="",oml='{"default:Html":{"html": {{$html}}, "node:OML": {{$oml}} }}',render_oml=!1,row,nodes=[];function cycle(__o,__path){for(var a in __o){var t=typeof __o[a],p;switch(p=__path?__path+"."+a:a,t){case"object":if(Array.isArray(__o[a]))if(["string","number","boolean"].includes(typeof __o[a][0]))row=genRow("array",a,JSON.stringify(__o[a])),html+=row.html,row.oml&&(nodes.push(row.oml),render_oml=!0);else for(var i=0;i<__o[a].length;i++)cycle(__o[a][i],__path?__path+"."+a+"["+i+"]":a+"["+i+"]");else cycle(__o[a],__path?__path+"."+a:a);break;case"string":case"number":case"boolean":var pattern="",required=!1,readonly=!1,oo;if(config.hasOwnProperty("fields")){try{oo=eval("config.fields."+p)}catch(e){}void 0!==oo&&(oo.hasOwnProperty("pattern")&&(pattern=oo.pattern),oo.hasOwnProperty("required")&&(required=oo.required),oo.hasOwnProperty("readonly")&&(readonly=oo.readonly))}row=genRow(t,p,__o[a],required,pattern,readonly),html+=row.html,row.oml&&(nodes.push(row.oml),render_oml=!0)}}}cycle(config.data,null),html=OGX.Templater.make(OGX.Form.defaults.templates.form,{rows:html}),oml=render_oml?nodes.join(","):null,oml=JSON.parse(oml),oml=OGX.OML.rename(oml,that.selector),that.el.html(html),oml&&OGX.OML.render(that,oml)}function genRow(e,t,i,n,o,a){var r={html:"",oml:null},s=config.types[e],l="",c="",d="";void 0!==n&&n&&(l="required",c='pattern="'+o+'"'),void 0!==a&&a&&(d="readonly");var u=t;return config.fullpath||(u=t.split(".").pop()),r.html=OGX.Templater.make(s.html,{name:u,prop:t,val:i,required:l,pattern:c,readonly:d}),r.html=OGX.Templater.make(OGX.Form.defaults.templates.row,{html:r.html,name:u,prop:t}),s.hasOwnProperty("oml")&&(r.oml=OGX.Templater.make(s.oml,{name:u,prop:t,val:i,required:l,pattern:c,readonly:d})),r}function init(){that.el.addClass("ogx_form"),render(),setTimeout((()=>{OGX.Form.bindForm({el:that.selector+">form",change_cb:that.onChange,submit_cb:that.onSubmit})}),300)}OGX.Data.merge(config,config_defaults,!1),this.destroy=function(){OGX.Form.unbindForm(that.selector)},this.onChange=function(e){},this.onSubmit=function(e){},init()},OGX.Form.defaults={templates:{form:"<form>{{$rows}}</form>",row:'<span class="row"><span class="label">{{$name}}</span>{{$html}}</span>'},types:{boolean:{html:'<span class="{{$name}}"></span>',oml:'{"default .{{$name}}:Switch":{"name" : "{{$prop}}", "val":{{$val}}, "editable" : {{!$readonly}} } }'},string:{html:'<input type="text" name="{{$prop}}" value="{{$val}}" {{$required}} {{$pattern}} {{$readonly}}>'},number:{html:'<input type="number" name="{{$prop}}" value="{{$val}}" {{$required}} {{$pattern}} {{$readonly}}>'},array:{html:'<span class="{{$name}}"></span>',oml:'{"default .{{$name}}:Tags":{"name" : "{{$prop}}", "editable" : {{!$readonly}}, "current_tags":{{$val}} } }'}}},OGX.Geo=function(e){"use strict";var t=this;void 0===e&&(e={});var i,n,o,a,r=OGX.Data.merge(e,{map:null,markers:[],icon:"",browser_loc:null});function s(e,i){for(var n,o={},a=0;a<e.length;a++){n=!1;for(var r=0;r<i.length;r++){for(var s=0;s<i[r].address_components.length;s++)if(-1!==i[r].address_components[s].types.indexOf(e[a][0])){o.hasOwnProperty(e[a][1])&&o[e[a][1]].length||(o[e[a][1]]=i[r].address_components[s].short_name),n=!0;break}if(n)break}}return o=t.clean(o)}function l(e){return e*(Math.PI/180)}function c(e){return Array.isArray(e)?new google.maps.LatLng(e[0],e[1]):"function"!=typeof e.lat?new google.maps.LatLng(e.lat,e.lng):e}function d(e){var t={gmap:new google.maps.LatLng(e.coords.latitude,e.coords.longitude),raw:{lat:e.coords.latitude,lng:e.coords.longitude}};a?(a(t),a=null):$(document).trigger(OGX.Geo.BROWSER_LOC_SUCCESS,t)}function u(e){$(document).trigger(OGX.Geo.BROWSER_LOC_ERROR,e)}function h(){i||(i=new google.maps.Geocoder)}this.setMap=function(e){r.map=e,google.maps.event.addListenerOnce(r.map,"tilesloaded",(function(){$(document).trigger(OGX.Geo.MAP_LOADED)}))},this.getMap=function(){return r.map},this.getMapRadius=function(){return!!r.map&&function(){if(r.map){var e=r.map.getBounds(),t=e.getCenter(),i=e.getNorthEast(),n=3963,o=t.lat()/57.2958,a=t.lng()/57.2958,s=i.lat()/57.2958,l=i.lng()/57.2958;return n*Math.acos(Math.sin(o)*Math.sin(s)+Math.cos(o)*Math.cos(s)*Math.cos(l-a))}return!1}()},this.getCurrentLocation=function(){return!!r.map&&(e=r.map.getCenter(),new google.maps.LatLng(e.lat(),e.lng()));var e},this.getBrowserLocation=function(e){a=void 0===e?null:e,navigator.geolocation.getCurrentPosition(d,u,{maximumAge:0,timeout:1e4,enableHighAccuracy:!0})},this.getDistance=function(e,t,i,n){var o=l(i-e),a=l(n-t),r=Math.sin(o/2)*Math.sin(o/2)+Math.cos(l(e))*Math.cos(l(i))*Math.sin(a/2)*Math.sin(a/2),s=6371*(2*Math.atan2(Math.sqrt(r),Math.sqrt(1-r)));return Math.round(1e3*s)/1e3},this.addressToLatLng=function(e,t,n){h(),i.geocode({address:e},(function(e,i){i==google.maps.GeocoderStatus.OK?t(e[0].geometry.location,n):t(!1,n)}))},this.getCityBoundaries=function(e,t,n,o,a){h(),i.geocode({address:e+", "+t+", "+n},(function(e,t){t==google.maps.GeocoderStatus.OK?o(e[0].geometry,a):o(!1,a)}))},this.latLngToZip=function(e,t,n){e=c(e),h(),i.geocode({location:e},(function(e,i){if(i===google.maps.GeocoderStatus.OK){var n=s([["postal_code","zip"]],e);t(n)}}))},this.latLngToCountryStateCity=function(e,t,n){e=c(e),h(),i.geocode({location:e},(function(e,i){if(i===google.maps.GeocoderStatus.OK){var o=s([["country","country"],["administrative_area_level_1","state"],["locality","city"],["administrative_area_level_2","city"]],e);t(o,n)}else t(!1,n)}))},this.partialAddressToCountryStateCity=function(e,t,n){h(),i.geocode({address:e},(function(e,i){if(i===google.maps.GeocoderStatus.OK){var o=s([["country","country"],["administrative_area_level_1","state"],["locality","city"],["administrative_area_level_2","city"]],e);t(o,n)}else t(!1,n)}))},this.latLngToAddress=function(e,t,n){e=c(e),h(),i.geocode({location:e},(function(e,i){if(i===google.maps.GeocoderStatus.OK){var o=s([["street_number","number"],["route","street"],["postal_code","zip"],["country","country"],["administrative_area_level_1","state"],["locality","city"],["administrative_area_level_2","city"]],e);e[0].hasOwnProperty("formatted_address")&&(o.formatted=e[0].formatted_address),t(o,n)}else t(!1,n)}))},this.partialAddressToAddress=function(e,t,n){h(),i.geocode({address:e},(function(e,i){if(i===google.maps.GeocoderStatus.OK){var o=s([["street_number","number"],["route","street"],["postal_code","zip"],["country","country"],["administrative_area_level_1","state"],["locality","city"],["administrative_area_level_2","city"]],e);e[0].hasOwnProperty("formatted_address")&&(o.formatted=e[0].formatted_address),o.lat=e[0].geometry.location.lat(),o.lng=e[0].geometry.location.lng(),t(o,n)}else t(!1,n)}))},this.zipToAddress=function(e,t,i){this.partialAddressToAddress(e,t,i)},this.zipToLatLng=function(e,t,n){h(),i.geocode({address:e},(function(e,i){if(i===google.maps.GeocoderStatus.OK){var o={};o.lat=e[0].geometry.location.lat(),o.lng=e[0].geometry.location.lng(),t(o,n)}else t(!1,n)}))},this.getRoute=function(e){n||(n=new google.maps.DirectionsService);var t={start:!1,end:!1,waypoints:!1,optimize:!0,mode:OGX.Geo.TRAVEL_MODE_CAR,callback:!1,params:!1};for(var i in t)e.hasOwnProperty(i)||(e[i]=t[i]);var o={origin:e.start,destination:e.end,travelMode:e.mode};e.waypoints&&(o.waypoints=e.waypoints,e.optimize&&(o.optimizeWaypoints=!0)),n.route(o,(function(t,i){i===google.maps.DirectionsStatus.OK?e.callback(t,e.params):e.callback(!1,e.params)}))},this.calcRouteMinutes=function(e){for(var t=0,i=0;i<e.legs.length;i++)t+=e.legs[i].duration.value;return t=Math.round(t/60)},this.drawRoute=function(e,t){void 0===t&&(t=!0),o||(o=new google.maps.DirectionsRenderer({suppressMarkers:!t})),o.setMap(r.map),o.setDirections(e)},this.clearRoute=function(){r.map&&o&&o.setMap(null)},this.latLngToLoc=function(e,t){return new google.maps.LatLng(e,t)},this.clean=function(e,t){var i;if(void 0===t&&(t=!1),e.hasOwnProperty("city")&&e.hasOwnProperty("vicinity")&&-1!==e.vicinity.indexOf(",")&&(i=new RegExp(", ([a-z -']+)$","gi").exec(e.vicinity))&&i.length>1&&(e.city===i[1]?e.vicinity=e.vicinity.replace(i[0],""):e.city?e.city.length>i[1].length&&(e.city=i[1],e.vicinity=e.vicinity.replace(i[0],"")):e.city=i[1]),t)for(var n in e)-1===t.indexOf(n)&&delete e[n];return e},"undefined"!=typeof google&&void 0!==google.maps||$(document).trigger(OGX.Geo.ERROR_GMAP)},OGX.Geo.ERROR="GEO_error",OGX.Geo.ERROR_GMAP="GEO_GMAP_ERROR",OGX.Geo.TRAVEL_MODE_CAR="DRIVING",OGX.Geo.TRAVEL_MODE_TRANSIT="TRANSIT",OGX.Geo.TRAVEL_MODE_WALK="WALKING",OGX.Geo.TRAVEL_MODE_BIKE="BICYCLING",OGX.Geo.BROWSER_LOC_SUCCESS="GEO_BROWSER_LOC_SUCCESS",OGX.Geo.BROWSER_LOC_ERROR="GEO_BROWSER_LOC_ERROR",OGX.Geo.MAP_LOADED="GEO_MAP_LOADED",require("Ghost","Uxi","Placeholder"),OGX.Ghost=function(e){construct(this,"Ghost"),this.el=$(e.el),css="ogx_ghost",this.el.addClass(css),delete css},require("GridSwiper","Uxi","Touch"),OGX.GridSwiper=function(e){construct(this,"GridSwiper");var t,i,n,o,a,r,s,l,c,d,u,h,f=this,_=e,g={map:[[!0,!0,!0],[!0,!0,!0],[!0,!0,!0]],axis:{x:!0,y:!0},loop:!0,start:!1,chromeos:!1,capture:!1,callbacks:{up:null,down:null,left:null,right:null}},p=!1,m={x:null,y:null},v={x:0,y:0},y=".ogx_grid_swiper_cell",x=!1,O=!1,b=!1,w={x:0,y:0},G={x:0,y:0},X=(new Date).getTime()+Math.round(1e3*Math.random()),C=[];function D(e){e?t.on(f.touch.down,E):t.off(f.touch.down,E)}function E(e){p=!1,a=0,r=0,s=0,l=0,e=Y(e),m.x=e.pageX,m.y=e.pageY,x=!0,L(!0)}function k(e){e?$("body").on(f.touch.up,S):$("body").off(f.touch.up,S)}function S(e){x&&(x=!1,L(!1),!T()&&b&&(t.trigger(OGX.GridSwiper.SWIPE_END),O=!1,b=!1))}function T(e,t,a){var r,s;return void 0===e&&(e=0),void 0===t&&(t=0),void 0===a&&(a=!0),a&&I(!0),i.addClass("ogx_grid_swiper_anim"),v=R(i),r=-1*Math.round((v.x+e)/n)*n*-1,s=-1*Math.round((v.y+t)/o)*o*-1,i.css({transform:"translate3d("+r+"px, "+s+"px, 0px)"}),v.x-r||v.y-s}function L(e){e?(N(!0),t.on(f.touch.move,M)):(N(!1),t.off(f.touch.move,M))}function M(e){e=Y(e),_.capture&&(e.preventDefault(),e.stopImmediatePropagation()),a=0,r=0,s=0,l=0,p||(_.axis.x&&Math.abs(e.pageX-m.x)>Math.abs(e.pageY-m.y)?p="x":_.axis.y&&Math.abs(e.pageX-m.x)<Math.abs(e.pageY-m.y)&&(p="y")),p&&(_.axis.x&&"x"===p?(a=Math.abs(e.pageX-m.x),s=e.pageX-m.x>0?1:-1):_.axis.y&&"y"===p&&(r=Math.abs(e.pageY-m.y),l=e.pageY-m.y>0?1:-1))}function N(e){e?h||(O=!1,h=setInterval(A,10)):h&&(clearInterval(h),h=null)}function A(){if((a||r)&&(O||(b=!0,t.trigger(OGX.GridSwiper.SWIPE_START)),O=!0),_.axis.x&&"x"===p&&a&&s&&a<=n){if(!_.loop&&(w.x+-1*s<0||w.x+-1*s>_.map[0].length-1))return;if((c=(w.x+-1*s)%_.map[0].length)<0&&(c=Math.abs(_.map[0].length+c)),!1===_.map[G.y][c])return;u=a*s,i.css({transform:"translate3d("+(-1*w.x*n+u)+"px, "+v.y+"px, 0px)"})}else if(_.axis.y&&"y"===p&&r&&l&&r<=o){if(!_.loop&&(w.y+-1*l<0||w.y+-1*l>_.map.length-1))return;if((d=(w.y+-1*l)%_.map.length)<0&&(d=Math.abs(_.map.length+d)),!1===_.map[d][G.x])return;u=r*l,i.css({transform:"translate3d("+v.x+"px, "+(-1*w.y*o+u)+"px, 0px)"})}}function I(e){e?(i.off("transitionend"),i.on("transitionend",(function(){O&&b&&(t.trigger(OGX.GridSwiper.SWIPE_END),O=!1,b=!1),i.off("transitionend"),i.removeClass("ogx_grid_swiper_anim"),v=R(i);var e={x:null,y:null};e.x=-1*Math.round(v.x/n),e.y=-1*Math.round(v.y/o),w.x!==e.x?(s=w.x>e.x?1:-1,w.x=e.x,G.x=P(w).x,-1===s?(i.children(y+"[data-y="+(w.y-1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-y="+(w.y+1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-x="+(w.x-2)+"][data-y="+w.y+"]").attr("data-x",w.x+1).css("left",(w.x+1)*n),f.onLeft({cell:G,point:w}),t.trigger(OGX.GridSwiper.SWIPE_LEFT,{cell:G,point:w}),z(C=[{x:w.x+1,y:w.y},{x:w.x,y:w.y-1},{x:w.x,y:w.y+1}]),U()):(i.children(y+"[data-y="+(w.y-1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-y="+(w.y+1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-x="+(w.x+2)+"][data-y="+w.y+"]").attr("data-x",w.x-1).css("left",(w.x-1)*n),f.onRight({cell:G,point:w}),t.trigger(OGX.GridSwiper.SWIPE_RIGHT,{cell:G,point:w}),z(C=[{x:w.x-1,y:w.y},{x:w.x,y:w.y-1},{x:w.x,y:w.y+1}]),U())):w.y!==e.y&&(l=w.y>e.y?1:-1,w.y=e.y,G.y=P(w).y,-1===l?(i.children(y+"[data-x="+(w.x-1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-x="+(w.x+1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-y="+(w.y-2)+"][data-x="+w.x+"]").attr("data-y",w.y+1).css("top",(w.y+1)*o),f.onUp({cell:G,point:w}),t.trigger(OGX.GridSwiper.SWIPE_UP,{cell:G,point:w}),z(C=[{x:w.x,y:w.y+1},{x:w.x-1,y:w.y},{x:w.x+1,y:w.y}]),U()):(i.children(y+"[data-x="+(w.x-1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-x="+(w.x+1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-y="+(w.y+2)+"][data-x="+w.x+"]").attr("data-y",w.y-1).css("top",(w.y-1)*o),f.onDown({cell:G,point:w}),t.trigger(OGX.GridSwiper.SWIPE_DOWN,{cell:G,point:w}),z(C=[{x:w.x,y:w.y-1},{x:w.x-1,y:w.y},{x:w.x+1,y:w.y}]),U())),p=0}))):i.off("transitionend")}function R(e,t){var i=e.css("transform");return"none"===i?0:(i=(i=(i=i.substr(7)).substr(0,i.length-1)).split(","),{x:Number(i[4]),y:Number(i[5])})}function Y(e){return e.hasOwnProperty("originalEvent")&&void 0!==e.originalEvent.changedTouches?e.originalEvent.changedTouches[0]:e}function P(e){var t={x:0,y:0};return t.x=e.x%_.map[0].length,t.x<0&&(t.x=Math.abs(_.map[0].length+t.x)),t.y=e.y%_.map.length,t.y<0&&(t.y=Math.abs(_.map.length+t.y)),t}function z(e){for(var t,i={x:null,y:null},n=0;n<e.length;n++){if(e[n].y<0||e[n].y>_.map.length-1){if(!_.loop)return!1;i.y=P(e[n]).y}else i.y=e[n].y;if(e[n].x<0||e[n].x>_.map[0].length-1){if(!_.loop)return!1;i.x=P(e[n]).x}else i.x=e[n].x;t=_.map[i.y][i.x],F(e[n],t),f.onRender(i)}}function F(e,t){var n=!1;switch(typeof t){case"string":i.children(y+'[data-x="'+e.x+'"][data-y="'+e.y+'"]').children(y+"_content").first().html(t);break;case"function":(n=t(e,P(e),{x:e.x-w.x,y:e.y-w.y},i.children(y+'[data-x="'+e.x+'"][data-y="'+e.y+'"]').children(y+"_content").first()[0]))&&i.children(y+'[data-x="'+e.x+'"][data-y="'+e.y+'"]').children(y+"_content").first().html(n);break;case"object":var o='.ogx_grid_swiper[data-ogx-id="'+X+'"] > .ogx_grid_swiper_container > '+y+'[data-x="'+e.x+'"][data-y="'+e.y+'"] > '+y+"_content",a=P(e);for(var r in t){t[r].id="cell_"+a.x+"_"+a.y;break}t=OGX.OML.rename(t,o);var s=f.nodes.find("id","cell_"+a.x+"_"+a.y,1);s&&f.remove(s._NAME_,s.id),$(o).empty(),OGX.OML.render(f,t,{abs:e,rel:P(e)}),U()}}function U(){for(var e=0;e<f.nodes.length;e++)f.nodes[e].id==="cell_"+G.x+"_"+G.y?f.nodes[e].focus():f.nodes[e].blur()}function B(){C=[],_.axis.x&&(C.push({x:_.start.x-1,y:_.start.y}),C.push({x:_.start.x+1,y:_.start.y})),C.push({x:_.start.x,y:_.start.y}),_.axis.y&&(C.push({x:_.start.x,y:_.start.y-1}),C.push({x:_.start.x,y:_.start.y+1})),z(C)}function W(){_.map.length||(_.map=[[]],_.axis.y=!1),_.map.length&&!Array.isArray(_.map[0])&&(_.map=[_.map],_.axis.y=!1),_.start||(_.start={x:null,y:null},_.start.y=Math.floor(_.map.length/2),_.start.x=Math.floor(_.map[0].length/2))}function H(){var e=_.start.x*-n,a=_.start.y*-o,r=_.start.y-1,s=_.start.x,l='<div class="ogx_grid_swiper_container" style="transform:translate3d('+e+"px, "+a+'px, 0px);">',c=-1*e,d=-1*a-o;_.axis.y&&(l+='<div class="ogx_grid_swiper_cell" style="left:'+c+"px; top:"+d+'px;" data-x="'+s+'" data-y="'+r+'"><div class="ogx_grid_swiper_cell_content"></div></div>',l+='<div class="ogx_grid_swiper_cell" style="left:'+c+"px; top:"+(d+2*o)+'px;" data-x="'+s+'" data-y="'+(r+2)+'"><div class="ogx_grid_swiper_cell_content"></div></div>'),l+='<div class="ogx_grid_swiper_cell" style="left:'+c+"px; top:"+(d+o)+'px;" data-x="'+s+'" data-y="'+(r+1)+'"><div class="ogx_grid_swiper_cell_content"></div></div>',_.axis.x&&(l+='<div class="ogx_grid_swiper_cell" style="left:'+(c-n)+"px; top:"+-1*a+'px;" data-x="'+(s-1)+'" data-y="'+_.start.y+'"><div class="ogx_grid_swiper_cell_content"></div></div>',l+='<div class="ogx_grid_swiper_cell" style="left:'+(c+n)+"px; top:"+-1*a+'px;" data-x="'+(s+1)+'" data-y="'+_.start.y+'"><div class="ogx_grid_swiper_cell_content"></div></div>'),l+="</div>",t.html(l),i=t.children(".ogx_grid_swiper_container").first(),w.x=_.start.x,w.y=_.start.y,v.x=e,v.y=a,G.x=_.start.x,G.y=_.start.y}this.onFocus=function(){return D(!0),k(!0),U(),this},this.onBlur=function(){return D(!1),k(!1),N(!1),this},this.focus=function(){return this.blured&&(this.blured=!1,this.onFocus()),this},this.resize=function(){I(!1),i.removeClass("ogx_grid_swiper_anim"),n=t.width(),o=t.height();var e=w.x*-n,a=w.y*-o;i.children(y+"[data-y="+(w.y-1)+"]").css({top:(w.y-1)*o,left:w.x*n}),i.children(y+"[data-y="+w.y+"]").css({top:w.y*o,left:w.x*n}),i.children(y+"[data-y="+(w.y+1)+"]").css({top:(w.y+1)*o,left:w.x*n}),i.children(y+"[data-x="+(w.x-1)+"]").css({top:w.y*o,left:(w.x-1)*n}),i.children(y+"[data-x="+(w.x+1)+"]").css({top:w.y*o,left:(w.x+1)*n}),i.css("transform","translate3d("+e+"px, "+a+"px, 0px"),L(!1),setTimeout((()=>{T(0,0,!1),i.addClass("ogx_grid_swiper_anim"),f.resizeNodes()}),0)},this.onUp=function(){},this.onDown=function(){},this.onLeft=function(){},this.onRight=function(){},this.onRender=function(){},this.setMap=function(e,t){return _.map=e,void 0!==t&&(_.start=t),w={x:0,y:0},G={x:0,y:0},m={x:null,y:null},v={x:0,y:0},W(),H(),B(),this},this.setMapCell=function(e,t){return _.map[e.y]||(_.map[e.y]=[]),_.map[e.y][e.x]=t,this},this.getMapCell=function(e){return e.y>0&&_.map.length<e.y&&e.x>0&&_.map[e.y].length<e.x&&_.map[e.y][e.x]},this.getCells=function(){var e,t,n,o,a=[];return i.children(y).each((function(i,r){e=$(r),t={x:Number(e.attr("data-x")),y:Number(e.attr("data-y"))},n=P(t),o={x:t.x-w.x,y:t.y-w.y},a.push({abs:t,rel:n,offset:o,element:r})})),a},this.getCellContent=function(e){return i.children(y+"[data-x="+e.x+"][data-y="+e.y+"]").children(y+"_content").first()[0]},this.getCurrentCell=function(){return G},this.renderCellContent=function(e){return z([e]),this},this.setTopCell=function(e){return this.setOffsetCell({x:0,y:-1},e),this},this.setBottomCell=function(e){return this.setOffsetCell({x:0,y:1},e),this},this.setLeftCell=function(e){return this.setOffsetCell({x:-1,y:0},e),this},this.setRightCell=function(e){return this.setOffsetCell({x:1,y:0},e),this},this.setOffsetCell=function(e,t){var i={x:e.x+w.x,y:e.y+w.y};return this.setMapCell(i,t),this},this.getOffsetCell=function(e){var t={x:e.x+w.x,y:e.y+w.y};return this.getMapCell(t)},this.getOffsetCellContent=function(e){var t={x:e.x+w.x,y:e.y+w.y};return this.getCellContent(t)},this.swipeRight=function(){return T(-n),this},this.swipeLeft=function(){return T(n),this},this.swipeUp=function(){return T(0,-o),this},this.swipeDown=function(){return T(0,o),this},OGX.Data.merge(_,g),_.callbacks.up&&(f.onUp=_.callbacks.up),_.callbacks.down&&(f.onDown=_.callbacks.down),_.callbacks.right&&(f.onRight=_.callbacks.right),_.callbacks.left&&(f.onLeft=_.callbacks.left),(t=f.el).addClass("ogx_grid_swiper"),t.attr("data-ogx-id",X),n=t.width(),o=t.height(),W(),H(),B()},OGX.GridSwiper.SWIPE_LEFT="GridSwiperSwipeLeft",OGX.GridSwiper.SWIPE_RIGHT="GridSwiperSwipeRight",OGX.GridSwiper.SWIPE_UP="GridSwiperSwipeUp",OGX.GridSwiper.SWIPE_DOWN="GridSwiperSwipeDown",OGX.GridSwiper.SWIPE_START="GridSwiperSwipeStart",OGX.GridSwiper.SWIPE_END="GridSwiperSwipeEnd",require("GroupedList","Uxi","Bind","Touch"),OGX.GroupedList=function(e){construct(this,"GroupedList");var t,i,n,o,a,r,s=this,l=e,c={group_by:"name",group_mode:null,group_param:null,group_order:null,order:null,list:new OGX.List,key:null,swipe:!1,reorder:!1,display:!1,mode:OGX.DynamicList.SELECT_MODE_HIT,scope:"public"},d=[];function u(e){e?t.on(s.touch.down,".ogx_grouped_list_item",h):t.off(s.touch.down,".ogx_grouped_list_item",h)}function h(){t.find(".ogx_grouped_list_selected_item").removeClass("ogx_grouped_list_selected_item"),$(this).addClass("ogx_grouped_list_selected_item");var e=l.list[Number($(this).data("id"))];t.trigger(OGX.GroupedList.SELECT,e)}function f(e){var t=l.group_order.indexOf(e);if(-1===t)return t;for(var i=t,n=0;n<t;n++)-1===d.indexOf(l.group_order[n])&&i--;return i}function _(e,t){for(var n,o=0;o<i.nodes.length;o++)if(n=i.nodes[o].val().find(e,t,1))return{list:i.nodes[o],item:n};return!1}function g(e){void 0===e&&(e=!1);var t=!1,n=!1;if(l.list&&(t=l.list,a&&(t=o),t.length&&(n=r,r=t.group(l.group_by,l.group_mode,l.group_param))),t&&t.length){if(e||JSON.stringify(n)!==JSON.stringify(r)){s.find("NestList",s.id+"_nests","remove");var c=function(){var e='.ogx_grouped_list[data-ogx-id="'+s.id+'"]',t={};t[e+":NestList"]={id:s.id+"_nests",list:[],"node:OML":[]};var i,n=[],o=OGX.Data.clone(l.group_order);for(var a in r)i=l.group_order?l.group_order.indexOf(a):n.length,t[e+":NestList"].list.push({title:a}),d.push(a),n[i]={"default:DynamicList":{list:r[a],key:l.key,mode:l.mode,display:l.display,swipe:l.swipe,reorder:l.reorder,order:l.order}};for(var c=0;c<n.length;c++)void 0===n[c]&&(n.splice(c,1),o.splice(c,1),c--);return t[e+":NestList"]["node:OML"]=n,t[e+":NestList"].order=o,t}();OGX.OML.render(s,c),(i=s.find("NestList",s.id+"_nests")).updateNestsHeight()}}else r=!1,s.el.empty()}this.onFocus=function(){return u(!0),this},this.onBlured=function(){return u(!1),this},this.bindFilter=function(e,t,i){return l.list.removeFilter(e),void 0!==i&&l.list.addFilter(e,t,i),l.list.getFilters()&&(o=l.list.filter(),a=!0),setTimeout(g,0),this},this.bindValue=function(){var e=this.getSelection();return e||null},this.destroy=function(){this.clearBinds()},this.scope=function(e){return void 0!==e?(l.scope=e,i.scope(e),!0):l.scope},this.val=function(e){if(void 0===e)return l.list;e.hasOwnProperty("insert")||(e=new OGX.List(e));var t=l.list.getFilters();"{}"!==JSON.stringify(t)&&(a=!0,e.setFilters(t),o=e.filter()),l.list=e,setTimeout(g,0)},this.nests=function(){return i||!1},this.filter=function(){return o=l.list.filter(),a=!0,setTimeout(g,0),this},this.unfilter=function(){return a=!1,setTimeout(g,0),this},this.addFilter=function(e,t,i){return l.list.addFilter(e,t,i)},this.removeFilter=function(e,t,i){return l.list.removeFilter(e,t,i)},this.resetFilters=function(){return l.list.resetFilters()},this.getFilters=function(){return l.list.getFilters()},this.addGroup=function(e,t,n){if(l.list.length){var a={title:e,scope:l.scope},r={};if(void 0===t&&(t=[]),r["default:DynamicList"]={list:t,key:l.key,mode:l.mode,display:l.display,swipe:l.swipe,reorder:l.reorder},i.addNest(a,r,n),l.group_order&&l.group_order.insert(e,n),o)var s=l.list.getFilters();l.list=new OGX.List(l.list.concat(t)),o&&l.list.setFilters(s),d.push(e)}else l.list.insert(t),g();return this},this.removeGroup=function(e){return!!this.getGroupList(e)&&(i.removeNest(e),l.list.findDelete(l.group_by,e),d.splice(d.indexOf(e),1),!0)},this.addToGroup=function(e,t){var n=this.getGroupList(e);return n&&(n.insert(t),l.list.push(t),setTimeout((()=>{i.updateNestHeight(e)}),0)),this},this.removeFromGroup=function(e,t,n){2===arguments.length&&(n=t,t=l.key);var o=this.getGroupList(e);return o&&(o.findDelete(t,n,1),l.list.findDelete(t,n,1),o.val().length?setTimeout((()=>{i.updateNestHeight(e)}),0):this.removeGroup(e)),this},this.updateGroupItem=function(e,t,i,n){return this.getGroupList(e).findUpdate(t,i,n,!1,1),l.list.findUpdate(t,i,n,1),this},this.replaceGroupItem=function(e,t,i,n){return this.getGroupList(e).findReplace(t,i,n),l.list.findReplace(t,i,n,1),this},this.getGroupList=function(e){var t=-1;return l.group_order&&(t=f(e)),-1!==t&&t<i.nodes.length&&i.nodes[t]},this.hasGroup=function(e){return-1!==d.indexOf(e)},this.addItem=function(e,t){if(void 0===t&&(t=!1),l.list.length){if(a){var r=new OGX.List(e),s=l.list.getFilters();if(r.setFilters(s),!r.filter().length)return void l.list.insert(e);l.list.insert(e),o.insert(e)}var c=e[l.group_by];if(this.hasGroup(c))this.addToGroup(c,e);else{var d=-1;l.group_order&&-1!==l.group_order.indexOf(c)&&(d=f(c)),-1!==d?this.addGroup(c,[e],d):this.addGroup(c,[e])}!t&&l.scroll&&this.observeOnce(null,(()=>{setTimeout(n.resize,0)}),null,i.el),i.updateNestHeight(c)}else l.list.insert(e),t||g();return this},this.addItems=function(e){l.scroll&&this.observeOnce(null,(()=>{setTimeout(n.resize,0)}),null,i.el);var t=!!l.list.length;e.forEach((e=>{this.addItem(e,!0)})),t&&g()},this.removeItem=function(e,t){l.key&&1===arguments.length&&(t=e,e=l.key);var n=l.list.find(e,t,1);if(n){var o=n[l.group_by];return this.removeFromGroup(o,e,t),setTimeout((()=>{i.updateNestHeight(o)}),0),!0}return!1},this.replaceItem=function(e,t,n){l.key&&2===arguments.length&&(t=e,e=l.key);var o=_(e,t);if(o){var a=null;return o.item[l.group_by]!==n[l.group_by]?(a=o.item[l.group_by],o.list.findDelete(e,t,1),l.list.findDelete(e,t,1),-1===l.list.unique(l.group_by,!1).indexOf(a)&&(this.removeGroup(a),a=!1),this.addItem(n),setTimeout((()=>{a&&i.updateNestHeight(o.item[l.group_by]),i.updateNestHeight(n[l.group_by])}),0)):o.list.findReplace(e,t,n),!0}return!1},this.updateItem=function(e,t,n,o){if(l.key){var a=arguments.length;void 0!==o&&(a--,o=!1),2===a&&(n=t,t=e,e=l.key)}var r=_(e,t);if(r){if(n.hasOwnProperty(l.group_by)&&r.item[l.group_by]!==n[l.group_by]){var s=r.item[l.group_by],c=r.list.findDelete(e,t,1);r.list.val().length||this.removeGroup(s),l.list.findDelete(e,t,1),c=OGX.Data.merge(c,n,!0,!1,o),this.addItem(c),r.list.val().length&&setTimeout((()=>{i.updateNestHeight(s)}),0)}else r.list.findUpdate(e,t,n,o,1);return!0}return!1},this.render=function(){return setTimeout(g,0),this},this.refresh=function(){var e=t.find(".ogx_grouped_list_selected_item").first();if(e.length>0){var i=e.data("id");e.html(OGX.Templater.make(l.template,l.list[i]))}return this},this.grouping=function(e,t,i,n){return void 0===n&&(n=null),l.group_by=e,l.group_mode=t,l.group_param=i,n&&(l.group_order=n),setTimeout((()=>{g(!0)}),0),this},OGX.Data.merge(l,c),l.list.hasOwnProperty("insert")||(l.list=new OGX.List(l.list)),l.group_order&&!l.group_order.hasOwnProperty("insert")&&(l.group_order=new OGX.List(l.group_order)),l.display&&l.display.hasOwnProperty("css")&&("object"!=typeof l.display.css&&l.display.css?l.display.css+=" ogx_grouped_list_item":l.display.hasOwnProperty("add")?l.display.add="ogx_grouped_list_item "+l.display.add:l.display.add="ogx_grouped_list_item"),r=!1,(t=s.el).addClass("ogx_grouped_list"),g(),l.scroll&&(n=s.find("Scroller",l.id+"_scroller"))},OGX.GroupedList.SELECT="GroupedListSelect",OGX.GroupedList.BIND=OGX.GroupedList.SELECT,require("Html","Uxi","Placeholder"),OGX.Html=function(e){construct(this,"Html"),void 0!==e&&e&&(this.el=$(e.el),OGX.HtmlRender(e))},OGX.HtmlRender=function(e){var t=$(e.el),i=new OGX.Display(e);data=!1,e.data&&Object.keys(e.data).length&&(data=e.data),t.html(i.html(data)),e.css&&t.addClass(i.css(data)),e.hasOwnProperty("id")&&e.id&&"#"===e.id.substr(0,1)&&t.attr("id",e.id.substr(1))},require("Iceberg","Uxi","Touch"),OGX.Iceberg=function(e){construct(this,"Iceberg");var t,i,n,o,a,r,s=this,l={left:0,right:0,top:0,bottom:0,min:50,drag:!0,flatten:!1,capture:!0,"node:OML":{},callbacks:{up:null,down:null,left:null,right:null,restore:null}},c=e,d=!1,u="normal",h="main",f={left:null,main:null,right:null,top:null,bottom:null},_=[0,0,0],g=0,p=0,m=0,v=0;function y(e){for(var t in f)f[t]&&f[t].instance&&(e===t?f[t].instance.focus():f[t].instance.blur())}function x(){d.hasClass("ogx_iceberg_anim")||(d.off("transitionend"),_=G(d))}function O(e){var t=0;return e.dirY&&e.distY>e.distX&&(t=1),t}function b(e){c.drag&&e.dist&&(!(n=O(e))&&["main","left","right"].includes(h)?e.dirX&&e.distX&&(t=_[0]+e.distX*e.dirX)<=p&&t>=g&&d.css({transform:"translate3d("+t+"px, 0, 0)"}):["main","top","bottom"].includes(h)&&e.dirY&&e.distY&&(i=_[1]+e.distY*e.dirY)<=v&&i>=m&&d.css({transform:"translate3d(0, "+i+"px, 0)"}))}function w(e){if(t=0,i=0,n=O(e),e.swipe&&e.dist){var r;switch(e.swipe=!1,h){case"main":-1===e.dirX&&c.right&&!n?(t=-f.right.outerWidth(),r="right",e.swipe=!0):1===e.dirX&&c.left&&!n?(t=f.left.outerWidth(),r="left",e.swipe=!0):1===e.dirY&&c.top&&n?(i=f.top.outerHeight(),r="top",e.swipe=!0):-1===e.dirY&&c.bottom&&n&&(i=-f.bottom.outerHeight(),r="bottom",e.swipe=!0);break;case"left":-1!==e.dirX||n||(t=0,r="main",e.swipe=!0);break;case"right":1!==e.dirX||n||(t=0,r="main",e.swipe=!0);break;case"top":-1===e.dirY&&n&&(i=0,r="main",e.swipe=!0);break;case"bottom":1===e.dirY&&n&&(i=0,r="main",e.swipe=!0)}n?1===e.dirY?(o=OGX.Iceberg.SWIPE_DOWN,a=s.onDown):(o=OGX.Iceberg.SWIPE_UP,a=s.onUp):1===e.dirX?(o=OGX.Iceberg.SWIPE_RIGHT,a=s.onRight):(o=OGX.Iceberg.SWIPE_LEFT,a=s.onLeft),e.swipe&&e.dist&&(d.addClass("ogx_iceberg_anim"),d.on("transitionend",(function(){d.off("transitionend"),d.removeClass("ogx_iceberg_anim"),_=G(d),y(h=r),a(h),d.trigger(o,h)})),d.css({transform:"translate3d("+t+"px, "+i+"px, 0)"}))}else if(e.dist){switch(t=0,i=0,h){case"left":t=f.left.outerWidth();break;case"right":t=-f.right.outerWidth();break;case"top":i=f.top.outerHeight();break;case"bottom":i=-f.bottom.outerHeight()}d.addClass("ogx_iceberg_anim"),d.on("transitionend",(function(){d.off("transitionend"),d.removeClass("ogx_iceberg_anim"),_=G(d),s.onRestore(h),d.trigger(OGX.Iceberg.RESTORE,h)})),d.css({transform:"translate3d("+t+"px, "+i+"px, 0)"})}}function G(e){var t=e[0].style.transform;if(t=t.match(/translate3d\(([0-9px%,\.\- ]+)\)/)){t=t[1].split(",");for(var i=0;i<t.length;i++)t[i]=Number(t[i].split("px")[0]);return t}return[0,0,0]}function X(){var e;for(var t in f)f[t]&&((e=f[t].children().first()).length&&e[0].hasAttribute("data-ogx-id")?f[t].instance=s.nodes.find("id",String(e.data("ogx-id")),1):f[t].instance=!1)}this.show=function(e,t){if(void 0===e&&(e=!1),"normal"===u)for(var i in f)if(f[i]&&f[i].instance&&f[i].instance.id===t){if(!e)return this.val(i),!0;if(f[i].instance._NAME_===f[i].instance.NAME)return this.val(i),!0}return!1},this.val=function(e){if(void 0===e)return h;if(t=0,i=0,"normal"===u){switch(e){case"left":t=f.left.outerWidth();break;case"top":i=f.top.outerHeight();break;case"main":t=0;break;case"right":t=f.left.outerWidth();break;case"bottom":i=-f.bottom.outerHeight()}f[h].instance&&f[h].instance.blur(),f[h=e].instance&&f[h].instance.focus(),d.css({transform:"translate3d("+t+"px, "+i+"px, 0)"})}},this.onFocus=function(){"flattened"!==u&&(r.enable(),setTimeout((()=>{y(h)}),0))},this.onBlur=function(){r.disable()},this.focus=function(){return this.blured&&(this.blured=!1,this.onFocus()),this},this.onResize=function(){return f.left&&(p=f.left.outerWidth()),f.right&&(g=-f.right.outerWidth()),f.top&&(v=f.top.outerHeight()),f.bottom&&(m=-f.bottom.outerHeight()),c.flatten&&("flattened"!==u&&this.el.outerWidth()>=c.flatten?(u="flattened",_=G(d),d.addClass("ogx_iceberg_views_flattened").css("transform","translate3d(0px, 0px, 0px)"),d.children(".ogx_iceberg_view").addClass("ogx_iceberg_view_flattened"),this.onBlur()):"flattened"===u&&this.el.width()<c.flatten&&(u="normal",d.children(".ogx_iceberg_view").removeClass("ogx_iceberg_view_flattened"),d.removeClass("ogx_iceberg_views_flattened").css("transform","translate3d("+_[0]+"px, 0px, 0px)"),this.onFocus())),this},this.destroy=function(){this.touch.wipe()},this.onUp=function(){},this.onDown=function(){},this.onLeft=function(){},this.onRight=function(){},this.onRestore=function(){},OGX.Data.merge(c,l),c.callbacks.up&&(s.onUp=c.callbacks.up),c.callbacks.down&&(s.onDown=c.callbacks.down),c.callbacks.right&&(s.onRight=c.callbacks.right),c.callbacks.left&&(s.onLeft=c.callbacks.left),c.callbacks.restore&&(s.onRestore=c.callbacks.restore),width=Math.round($(c.el).innerWidth()),height=$(c.el).innerHeight(),s.el.addClass("ogx_iceberg"),function(){var e,t,i='<div class="ogx_iceberg_views ogx_hw">',n={},o='.ogx_iceberg[data-ogx-id="'+s.id+'"] > .ogx_iceberg_views > .ogx_iceberg_view[data-ogx-panel-id="';for(var a in c["node:OML"])for(var r in c["node:OML"][a])0===r.indexOf("left")&&(i+='<div class="ogx_iceberg_view_left ogx_view ogx_iceberg_view" data-ogx-panel-id="left" style="width:'+(isNaN(c.left)?c.left:c.left+"px")+';"></div>',n.left=o+'left"]',f.left=!0),0===r.indexOf("top")&&(i+='<div class="ogx_iceberg_view_top ogx_view ogx_iceberg_view" data-ogx-panel-id="top" style="height:'+(isNaN(c.top)?c.top:c.top+"px")+';"></div>',n.top=o+'top"]',f.top=!0),0===r.indexOf("main")&&(i+='<div class="ogx_iceberg_view_main ogx_view ogx_iceberg_view" data-ogx-panel-id="main"></div>',n.main=o+'main"]'),0===r.indexOf("right")&&(i+='<div class="ogx_iceberg_view_right ogx_view ogx_iceberg_view" data-ogx-panel-id="right" style="width:'+(isNaN(c.right)?c.right:c.right+"px")+';"></div>',n.right=o+'right"]',f.right=!0),0===r.indexOf("bottom")&&(i+='<div class="ogx_iceberg_view_bottom ogx_view ogx_iceberg_view" data-ogx-panel-id="bottom" style="height:'+(isNaN(c.bottom)?c.bottom:c.bottom+"px")+';"></div>',n.bottom=o+'bottom"]',f.bottom=!0);for(s.el.html(i),a=0;a<c["node:OML"].length;a++)for(var r in c["node:OML"][a])e=r.split(":")[0],t=r.replace(e,n[e]),c["node:OML"][a][t]=c["node:OML"][a][r],delete c["node:OML"][a][r];d=s.el.children(".ogx_iceberg_views").first(),f.left&&(f.left=d.children(".ogx_iceberg_view_left").first(),p=f.left.outerWidth()),f.top&&(f.top=d.children(".ogx_iceberg_view_top").first(),v=f.top.outerHeight()),f.main=d.children(".ogx_iceberg_view_main").first(),f.right&&(f.right=d.children(".ogx_iceberg_view_right").first(),g=-f.right.outerWidth()),f.bottom&&(f.bottom=d.children(".ogx_iceberg_view_bottom").first(),m=-f.bottom.outerHeight())}(),setTimeout(X,0),r=s.touch.add("Swipe",{state:"manual",capture:c.capture,x:!0,y:!0,min_x:c.min,min_y:c.min,cb_down:x,cb_swipe:b,cb_up:w}),s.resize()},OGX.Iceberg.SWIPE_UP="icebergSwipeUp",OGX.Iceberg.SWIPE_DOWN="icebergSwipeDown",OGX.Iceberg.SWIPE_LEFT="icebergSwipeLeft",OGX.Iceberg.SWIPE_RIGHT="icebergSwipeRight",OGX.Iceberg.RESTORE="icebergRestore",OGX.Loading=function(e){"use strict";var t=this,i=!1,n={display:{css:"ogx_loading",html:" ",anim:OGX.Overlay.FADE}};e.hasOwnProperty("loading")&&e.loading&&setTimeout(t.addLoading,0),this.hasLoading=function(){return!!i},this.addLoading=function(e){return t.hasOverlay()||(i=!0,void 0===e&&(e={}),OGX.Data.merge(e,n),t.addOverlay(e)),this},this.removeLoading=function(e,n){return t.hasOverlay()&&(t.removeOverlay(e,n),i=!1),this}},OGX.Math={},OGX.Math.rotate=function(e,t){t=-t*(Math.PI/180);var i=Math.cos(t),n=Math.sin(t);return new Array(Math.round(1e4*(e[0]*i-e[1]*n))/1e4,Math.round(1e4*(e[0]*n+e[1]*i))/1e4)},OGX.Math.dist=function(e,t){return Math.sqrt((e.x-t.x)**2+(e.x-t.y)**2)},OGX.Math.angle=function(e,t){var i=function(e,t,i,n){var o=n-t,a=i-e,r=Math.atan2(o,a);return r*=180/Math.PI}(e.x,e.y,t.x,t.y);return i<0&&(i=360+i),i},OGX.Media=function(){"use strict";this.crop=function(e,t,i,n,o,a){void 0===o&&(o=0),void 0===a&&(a=0);const r=document.createElement("canvas"),s=r.getContext("2d");r.width=i,r.height=n;var l=new Image;l.onload=function(){s.drawImage(l,o,a,i,n,0,0,i,n),t(r.toDataURL("image/png",1))},l.src="data:image/png;base64,"+e},this.read=function(e,t){var i=new FileReader;i.onload=function(i){t(e,i.target.result)},i.readAsDataURL(e)},this.load=async function(e,t){const i=await fetch(e),n=await i.blob();this.read(n,t)}},OGX.Media=new OGX.Media,require("NestList","Uxi","Bind"),OGX.NestList=function(e){construct(this,"NestList");var t,i,n=this,o={scope:["public"],template:'<div class="ogx_nest_list_item {{$dsp}}" data-ogx-nest-id="{{$id}}"><div class="ogx_nest_list_item_head {{$css}}"><span class="ogx_nest_list_item_title">{{$title}}</span><span class="ogx_nest_list_item_icon"></span></div><div class="ogx_nest_list_item_body"><div class="ogx_nest_list_item_content">{{$body}}</div></div></div>',list:new OGX.List,item_default:!1,map:{title:"title",scope:"scope",id:"id"},order:!1,callbacks:{open:null,close:null}},a={title:"",scope:[],open:!0},r={id:0,title:!1,scope:[],height:0,y:0,hidden:!1,open:!0,selector:!1},s=e,l=!1,c=0,d=0,u=1,h={y:0,h:0,way:1},f=!1,_=new OGX.List;function g(e){e?t.on("click",".ogx_nest_list_item_head",p):t.off("click",".ogx_nest_list_item_head",p)}function p(e){l||(l=!0,m($(this)))}function m(e){var i=e.parent(0).data("ogx-nest-id"),o=!1;e.hasClass("ogx_nest_list_item_head_closed")?(h.way=1,e.addClass("ogx_nest_list_item_head_open").removeClass("ogx_nest_list_item_head_closed"),_.findUpdate("id",i,{open:!0},!1,1),o=!0):(h.way=0,e.removeClass("ogx_nest_list_item_head_open").addClass("ogx_nest_list_item_head_closed"),_.findUpdate("id",i,{open:!1},!1,1));var a=_.find("id",i,1);o?(!function(e){var t=v(e);if(t)return t.focus(),!0}(a),n.onOpen(a),t.trigger(OGX.NestList.OPEN,a)):(!function(e){var t=v(e);if(t)return t.blur(),!0}(a),n.onClose(a),t.trigger(OGX.NestList.CLOSE,a)),setTimeout(x,0)}function v(e){var t=$(e.selector).find(".ogx_uxi").first();if(t.length){var i=String(t.data("ogx-id")),o=n.nodes.find("id",i,1);if(o)return o}return!1}function y(e){if(e.hasOwnProperty("scope"))for(var t=0;t<e.scope.length;t++)if(-1!==s.scope.indexOf(e.scope[t]))return!0;return!1}function x(){var e;!function(){var e=0;d=0,h.y=0,h.h=0;for(var i=0;i<_.length;i++)_[i].y=e,_[i].hidden||(c||(c=t.children(".ogx_nest_list_item:eq("+i+")").children(".ogx_nest_list_item_head").outerHeight(!0)),d+=c,h.y=e,_[i].open&&(h.y+=_[i].height,e+=_[i].height,d+=_[i].height),h.h=_[i].height);d-=h.h}();for(var i=t.children(".ogx_nest_list_mask").first(),o=0;o<_.length;o++)(e=t.children('.ogx_nest_list_item[data-ogx-nest-id="'+_[o].id+'"]')).removeClass("ogx_nest_list_item_noanim"),e.css("transform","translateY("+_[o].y+"px)");var a="height:"+Math.ceil(d+h.h)+"px !important;";i.on("transitionend",(function(){h.way||t.css("cssText",a),l=!1,n.scroller&&n.scroller.resize()})),h.way&&t.css("cssText",a),setTimeout((()=>{i.css({transform:"translateY("+h.y+"px)"})}),0)}function O(e,i){OGX.Data.merge(e,a);var o=OGX.Data.merge(r,e,!0,!0);e.hasOwnProperty(s.map.id)?o.id=e[s.map.id]:(o.id=u,u++);var l,c,d=((c={css:"",dsp:"ogx_nest_list_prep",id:(l=o).id})[s.map.title]=l[s.map.title],l.open?c.css="ogx_nest_list_item_head_open":c.css="ogx_nest_list_item_head_closed",OGX.Templater.make(s.template,c));void 0!==i&&i<s.list.length-1?t.children(".ogx_nest_list_item:eq("+i+")").before(d):t.children(".ogx_nest_list_mask").first().before(d),o.selector='.ogx_nest_list[data-ogx-id="'+n.id+'"] > .ogx_nest_list_item[data-ogx-nest-id="'+o.id+'"] > .ogx_nest_list_item_body > .ogx_nest_list_item_content';var h=$('.ogx_nest_list[data-ogx-id="'+n.id+'"] > .ogx_nest_list_item[data-ogx-nest-id="'+o.id+'"]');return o.hidden&&h.addClass("ogx_nest_list_item_hidden"),h.removeClass("ogx_nest_list_prep"),o}function b(){var e=s.list;f&&(e=i),t.empty(),_.clear();var o;t.html('<div class="ogx_nest_list_mask"></div>'),s.hasOwnProperty("node:OML")||(s["node:OML"]=[]);for(var a=0;a<e.length;a++)o=O(e[a]),_.push(o),s["node:OML"][a]=OGX.OML.rename(s["node:OML"][a],o.selector);n.observe(!0,{childList:!0,subtree:!0},(function(){n.updateNestsHeight()}))}function w(){for(var e=[],t=0;t<s.list.length;t++)e[s.order.indexOf(s.list[t][s.map.title])]=s.list[t];return s.list=new OGX.List(e)}function G(){s.list.hasOwnProperty("insert")||(s.list=new OGX.List(s.list));for(var e=0;e<s.list.length;e++)s.item_default?OGX.Data.merge(s.list[e],s.item_default):OGX.Data.merge(s.list[e],a),s.order&&w()}this.onFocus=function(){return g(!0),this},this.onBlur=function(){return g(!1),this},this.show=function(e,t){arguments.length||this._show();var i=this.find(e,t);if(i){var n=i.el.parents(".ogx_nest_list_item").first().children(".ogx_nest_list_item_head").first();m(n)}return this},this.bindFilter=function(e,t,n){s.list.removeFilter(e),void 0!==n&&s.list.addFilter(e,t,n),s.list.getFilters()&&(i=s.list.filter(),f=!0),setTimeout(b,0)},this.destroy=function(){t.children(".ogx_nest_list_mask").off("transitionend"),n.observe(!1)},this.onOpen=function(){},this.onClose=function(){},this.scope=function(e){return void 0!==e?(s.scope=e,function(){for(var e,i=0;i<_.length;i++)(e=t.children(_[i].selector)).addClass("ogx_nest_list_item_noanim"),y(_[i])?(_[i].hidden=!1,e.removeClass("ogx_nest_list_item_hidden")):(_[i].hidden=!0,e.addClass("ogx_nest_list_item_hidden"));setTimeout(x,0)}(),!0):s.scope},this.val=function(e){if(void 0===e)return s.list;s.list=e,G(),setTimeout(b,0)},this.addNest=function(e,t,i){var n=O(e,i);if(_.insert(n,i),t=OGX.OML.rename(t,n.selector),OGX.OML.render(this,t),void 0!==i){var o=this.nodes.pop();this.nodes.insert(o,i)}},this.removeNest=function(e){var t=_.findIndex(s.map.title,e);t&&(this.nodes[t.index].kill(),this.nodes.splice(t.index,1),$('.ogx_nest_list[data-ogx-id="'+n.id+'"] > .ogx_nest_list_item[data-ogx-nest-id="'+_[t.index].id+'"]').remove(),_.splice(t.index,1),setTimeout(x,0))},this.updateNestHeight=function(e){var t=_.find(s.map.title,e,1);setTimeout((()=>{var e,i;e=t,i=$(e.selector).outerHeight(!0),e.height=i,x()}),0)},this.updateNestsHeight=function(){for(var e,t=0;t<_.length;t++)e=_[t],this.updateNestHeight(e[s.map.title])},this.updateMask=function(){x()},OGX.Data.merge(s,o),s.callbacks.open&&(n.onOpen=s.callbacks.open),s.callbacks.close&&(n.onClose=s.callbacks.close),G(),s.template=s.template.replace("{{$title}}","{{$"+s.map.title+"}}"),(t=n.el).addClass("ogx_nest_list"),s.list.length&&b()},OGX.NestList.OPEN="NestListOpen",OGX.NestList.CLOSE="NestListClose",OGX.NestList.READY="NestListReady",OGX.Net=function(e){"use strict";var t=this,i=1,n=OGX.Data.merge({core:null,file_default:{file:!1,path:!1},extensions:[{ext:"json",path:"/json",type:"json"},{ext:"js",path:"/js",type:"text"},{ext:"html",path:"/html",type:"text"},{ext:"oml",path:"/oml",type:"json"},{ext:"ose",path:"/ose",type:"text"},{ext:"ejs",path:"/js/min",type:"text"},{ext:"mp3",path:"/snd",type:"mp3"},{ext:"wav",path:"/snd"},{ext:"ogg",path:"/snd"},{ext:"png",path:"/img"},{ext:"jpg",path:"/img"},{ext:"gif",path:"/img"},{ext:"svg",path:"/img"}],ios:!1,encrypted:!1,key:null},e,!0,!0,!0);function o(e,t){var i=new FileReader;i.onload=function(){var e=i.result.split(",")[1];t(e)},i.readAsDataURL(e)}function a(e,i,o,a){switch(e.ext){case"json":case"txt":case"oml":case"ose":case"html":case"snd":["app.json","manifest.json"].includes(e.file)||OGX.Cache.add(e);break;case"ejs":e.data=OGX.Data.decrypt(e.data,n.key);var r=document.createElement("script"),s=document.createTextNode(e.data);r.appendChild(s),r.onload=()=>{r.remove()},document.body.appendChild(r)}void 0!==i&&setTimeout((()=>{i(e.data,o,a)}),0),$(document).trigger(t.LOAD_SUCCESS,e)}function r(e,t,i){!function(){var o=e.path+"/"+e.file;"/"===o.substr(0,1)&&(o=o.substr(1)),(n.encrypted&&"app.json"===o||"pak"===e.ext)&&(e.type="text"),fetch(o,{method:"GET",mode:"no-cors",cache:"no-cache",credentials:"same-origin",headers:{"Content-Type":s(e.type)},redirect:"follow",referrerPolicy:"same-origin"}).then((t=>{switch(e.type){case"text":return t.text();case"json":return t.json();default:return t.blob()}})).catch((e=>{$(document).trigger(OGX.Net.NETWORK_ERROR,e)})).then((n=>{e.data=n,a(e,t,i)}))}()}function s(e){switch(e){case"text":case"json":return"text/plain";default:return"application/zip"}}n.extensions.hasOwnProperty("insert")||(n.extensions=new OGX.List(n.extensions)),this.LOAD_SUCCESS="NET_LOAD_SUCCESS",this.LOAD_START="NET_LOAD_START",this.NETWORK_ERROR="NET_NETWORK_ERROR",this.download=function(t){e.app.getStage().observeOnce(null,(()=>{var e=$("#ogx_net_download");e[0].click(),e.remove()})),e.app.getStage().el.append('<a id="ogx_net_download" style="display:none;" href="'+t+'" download></a>')},this.preload=function(e,i,n){var o={loaded:0,total:0,files:new OGX.List};for(var a in e)for(var r=0;r<e[a].length;r++)o.total++;for(var a in $(document).trigger(t.LOAD_START,o.total),e)for(r=0;r<e[a].length;r++)this.load(a+"/"+e[a][r],s);function s(e,t){o.loaded++,o.files.insert(e),o.loaded===o.total&&setTimeout((()=>{i(o.files,n)}),0)}},this.load=function(e,t,o){var s,l={file:null,path:null};-1!==e.indexOf("/")?(s=e.split("/"),l.file=s.pop(),l.path=s.join("/")):(l.path="",l.file=e),OGX.Data.merge(l,n.file_default);var c=function(e){var t;if(t=/([a-z0-9\_\-]+\.)?([a-z0-9\_\-]+)\.([a-z0-9]{3,4})/gi.exec(e))return t.shift(),t;return!1}(l.file);if(c)switch(l.ext=c[2],l.id=c[1],l.ext){case"json":case"txt":case"oml":case"ose":case"html":case"ejs":l.type=n.extensions.find("ext",l.ext,1).type,r(l,t,o);break;case"mp3":case"ogg":case"wav":!function(e,t,i){var n;function o(){var o=e.path+"/"+e.file;"/"===o.substr(0,1)&&(o=o.substr(1)),n=new Audio(o),e.data=n,e.ext="snd",e.format=e.file.split(".").pop(),a(e,t,i)}o()}(l,t,o);break;case"png":case"gif":case"jpg":case"svg":!function(e,t,i){var n=new Image;function o(){n.onload=function(){e.data=n,a(e,t,i,n)};var o=e.path+"/"+e.file;"/"===o.substr(0,1)&&(o=o.substr(1)),n.src=o}o()}(l,t,o);break;case"ttf":case"eot":case"woff":case"woff2":!function(e,t,n){function o(){var o,r='<div class="ogx_font_loader" style="font-family:'+e.file.split(".")[0]+';" data-ogx-id="font-loader-'+i+'"><b>ogx</b> <i>font</i> init</div>';$("body").append(r),a(e,t,n),o=i,setTimeout((()=>{$('.ogx_font_loader[data-ogx-id="font-loader-'+o+'"]').remove()}),150),i++}o()}(l,t,o);break;case"pak":!function(e,t,i){function o(o){var r;n.encrypted&&n.key&&(o=OGX.Data.decrypt(o,n.key));for(var s=/<!--\[([a-zA-Z0-9_\-]+)\]-->/gi,l=[];r=s.exec(o);)l.push(r[1]);s=/<!--\[[a-zA-Z0-9_\-]+\]-->/gi;var c,d,u,h=o.split(s);h.shift();for(var f=0;f<l.length;f++){switch(e.path){case"/html":d="template."+l[f]+".html",u=h[f];break;default:d=l[f]+"."+e.path.substr(1),u=JSON.parse(h[f])}c={ext:e.path.substr(1),data:u,path:e.path,id:l[f],file:d},OGX.Cache.add(c)}a(e,t,i)}r(e,o,i)}(l,t,o)}},this.upload=function(e,t,i){var n=[],a="";t&&(a="multiple");var r='<input id="ogx_net_upload" type="file" name="file" accept="'+e.join(",")+'" style="display:none;" '+a+">";$("body").append(r);var s=$("#ogx_net_upload");s.on("change",(function(){s.off("change");for(var e=0;e<this.files.length;e++)o(this.files[e],(e=>{n.push(e),n.length===this.files.length&&(i(t?n:n[0]),s.remove())}))})),s.trigger("click")}},OGX.OSE=function(){"use strict";var charcode,to="__thread_object",lo="__local_object",ro="__route_object",oo="__object",fn=0;function convertValue(e){if(-1===e.indexOf(":"))return e;var t=e.split(":");switch(t[1]){case"Boolean":return"true"===t[0];case"Number":var i=Number(t[0]);return!isNaN(i)&&i}}function convertKeywords(e,t){for(var i=["echo","scope","method","screen","mongogx","uxi","loop","json","ose","template","oml","crumb","function","result"],n=["eko","sco","met","scr","mgx","ixu","loo","jsn","eso","tpl","lmo","crb","fnk","rst"],o=["$","@","#","&"],a=0;a<i.length;a++)for(var r=0;r<o.length;r++)e=t?e.replaceAll(o[r]+i[a],o[r]+"___"+n[a]):e.replaceAll(o[r]+"___"+n[a],o[r]+i[a]);return e}function convertToJS(e,t,i,n,o){var a,r,s,l,c,d=0,u="";if(e=convertKeywords(e=(e=e.replace(/^[ \n\r]*{{|}}[\r\n ]*$/g,"").trim()).replace(/(\/\*+((?!\*+\/)[\S\s])*\*+\/)/g,""),!0),(r=/(screen ?([<>=!+]+ ?\d+) ?\? ?([\S\s]+) ?\: ?([\S\s]+);?)/gi.exec(e))&&(l=(l=(l="var a;"+r[0]).replace("screen","screen.width")).replace(r[3],'a="'+r[3].trim()+'"'),l="null"!==r[4]?l.replace(r[4],'a="'+r[4].trim()+'"'):l.replace(r[4],"a=false;"),l+=";if(a){return a;}",c=new Function(l),e=e.replace(r[0],c())),(r=/(scope ([\S ]+) ?\? ?([\S ]+)\: ?([\S ]+);?)/gi.exec(e))&&(l=r[0],e="null"===(l=(s=OGX.Scope.eval(r[2]))?r[3]:r[4])?e.replace(r[0],""):e.replace(r[0],l)),(r=/(uxi\.?([a-z0-9_]+)? *(?:#|\$|&|@|%)*([a-z0-9_\-]+):([a-z0-9]+))/gi.exec(e))&&(s=void 0===r[2]?'OGX.Object.get({_NAME_:{eq:"'+r[4]+'"}, id:{eq:"'+r[3]+'"}}, null, 1);':'OGX.Object.get({_NAME_:{eq:"'+r[4]+'"}, "'+r[2]+'":{eq:"'+r[3]+'"}}, null, 1);')===(e=e.replace(r[0],s)))return"return "+e;if(r=/function *([\s\S]+)(\(\))?/gi.exec(e))return r[1]&&(isSingleVar(r[1])?(s="return "+r[1],void 0!==r[2]&&(s+="( __object )")):(s="function __f"+fn+"(__object){"+r[1]+"}; return __f"+fn+"( __object );",fn++)),e=convertKeywords(e=replaceVars(e=e.replace(r[0],s),t,i,n,o),!1);if((r=/method *([a-zA-Z0-9_\-]+)(\(\))? ([a-zA-Z0-9_\-]+):([a-zA-Z0-9_\-]+)/gi.exec(e))&&(s='OGX.Object.get({_NAME_:{eq:"'+r[4]+'"}, id:{eq:"'+r[3]+'"}}, null, 1).'+r[1],e=e.replace(r[0],s),void 0!==r[2]&&(e+="(__object)"),s===e))return"return "+e;if((r=/mongogx ([a-z0-9_\-]+)\.([a-z0-9_\-]+)\.([a-z]+)\(([\S ]+)\)/gi.exec(e))&&(s="mongogx.setDatabase('"+r[1]+"'); ",s+="mongogx.setCollection('"+r[2]+"'); ",(s+="return mongogx."+r[3]+"("+r[4]+");")===(e=e.replace(r[0],s))))return s;if(isSingleVar(e))return"return "+replaceVars(e=convertKeywords(e,!1),t,i,n,o)+";";for(e=convertKeywords(e+="\r\n",!1);a=/[\S ]+(\r\n|\n)?/gi.exec(e);){if(l=replaceLoop(l=a[0].replace(/(\r\n|\n)/gi,"").trim(),t,i,n,o),charcode++,l=replaceVars(l,t,i,n,o),/^(app|OGX)\.\S+;?/g.test(l))return"return "+l+";";if(e=e.replace(a[0],""),u+=l+"\n",++d>100)return}return u="var __echo=[];\n"+u+'\nif(!__echo.length){return;}else{return __echo.join("");}'}function runJS(e,t,i,n,o,a){var r;try{r=new Function(oo,to,ro,lo,e)(t,i,n,o)}catch(e){return}if(void 0!==r)return r}function isSingleVar(e){return/^[ ]*\S+( \S+)?[ ]*$/g.test(e)}function getTrueVal(__string,__object,__thread_object,__route_object,__local_object,__as_string){void 0===__as_string&&(__as_string=!0);var e=!1,err=!1;__string=__string.trim().replace(/;/g,"");var reg=new RegExp(oo+"|"+to+"|"+ro+"|"+lo);if(reg.test(__string))return __string;if(["$","%","@"].includes(__string))switch(__string){case"&":return to;case"@":return lo;case"$":return oo;case"%":return ro}try{e=eval(__string)}catch(e){err=!0}return err||!e||"function"==typeof e||e&&e instanceof HTMLElement?'"'+__string+'"':e?"string"!=typeof e?__string:__as_string?'"'+e+'"':e:__string}function replaceLoop(e,t,i,n,o){var a,r,s,l,c;return(a=/loop (\S+) ?(as (\S+) ?(\S+ )?)?{/gi.exec(e))&&(r="__"+String.fromCharCode(charcode).toLowerCase()+"__",charcode++,c="__"+String.fromCharCode(charcode).toLowerCase()+"__",charcode++,s=(s=a[0]).replace(a[0],"var "+c+"=JSON.parse(JSON.stringify("+a[1]+"));for(var "+r+" in "+c+"){"),a[2]&&(l=a[4]?"&"+a[3]+"="+r+"; &"+a[4]+"="+a[1]+"["+r+"]; ":"&"+a[3]+"="+a[1]+"["+r+"]; "),s+=l,e=e.replace(a[0],s)),e}function replaceVars(__exp,__object,__thread_object,__route_object,__local_object){for(var str,m,mm,o,total=0,safe=300;m=/((&|#|@|\$|%)([a-zA-Z_]{1}[a-zA-Z0-9\-_]*))(\.[a-z0-9\-_\.\[\]\$]+|\.\$|\.)?(;)?/gi.exec(__exp);){switch(o=!1,m[2]){case"&":o=to+"."+m[3];break;case"@":o=lo+"."+m[3];break;case"$":o=oo+"."+m[3];break;case"#":o=m[3];break;case"%":o=ro+"."+m[3]}if(str=m[0].replace(m[1],o),__exp=__exp.replace(m[0],str),total++,total>safe)return __exp}for(;m=/([a-z_\-\.]+)\( *(\$|@|&|%).*\)/gi.exec(__exp);)o=getTrueVal(m[2]),str=m[0].replace(m[2],o),__exp=__exp.replace(m[0],str);for(;mm=/^(json|ose|template|oml|crumb|result) (\S+)/g.test(__exp);){if(m=/crumb ([a-z0-9_\-]+) ?(\$[a-z0-9_\-]+)?/gi.exec(__exp)){str="__route_object."+m[1],m[2]&&(str+="."+m[2].slice(1));var r=null;try{r=eval(str)}catch(e){}r||(str="{}"),__exp=__exp.replace(m[0],str)}if((m=/json (\S+)(;)?/gi.exec(__exp))&&(m[1]=getTrueVal(m[1],__object,__thread_object,__route_object,__local_object),__exp=__exp.replace(m[0],"OGX.Core.getJSON("+m[1]+")")),(m=/^template (\S+)( \S+)?[ ;]?/gi.exec(__exp))&&(m[1]=getTrueVal(m[1],__object,__thread_object,__route_object,__local_object),void 0===m[2]?m[2]="__object":m[2]=getTrueVal(m[2].trim(),__object,__thread_object,__route_object,__local_object),__exp=__exp.replace(m[0],"OGX.Templater.make(OGX.Templater.get("+m[1]+"), "+m[2]+", "+to+","+ro+","+lo+")")),(m=/^ose (\S+)(;)?/gi.exec(__exp))&&(m[1]=getTrueVal(m[1],__object,__thread_object,__route_object,__local_object),script=that.get(m[1]),script&&(__exp=exp.replace(m[0],script.replace(/({{|}})/g,"")))),(m=/^oml (\S+) *(\S+)? *;?/gi.exec(__exp))&&(m[1]=getTrueVal(m[1],__object,__thread_object,__route_object,__local_object),m[2]?(m[2]=getTrueVal(m[2]),__exp=__exp.replace(m[0],"OGX.Templater.jmake(OGX.Core.getOML("+m[1]+"), "+m[2]+")")):__exp=__exp.replace(m[0],"OGX.Core.getOML("+m[1]+")")),(m=/^result (\S+)(;)?$/gi.exec(__exp))&&(__exp=__exp.replace(m[0],'OGX.OML.result("'+m[1]+'")')),total++,total>safe)return __exp}if(["$","@","%","&"].includes(__exp.trim())){switch(__exp.trim()){case"$":__exp=oo;break;case"@":__exp=lo;break;case"%":__exp=ro;break;case"&":__exp=to}return __exp}for(;m=/echo ('|")?(((?![;}\r\n]+|$)([\S\s]))*)(?:'|")?/gi.exec(__exp);){var e="+$1+",gill="'";if(void 0!==m[1]&&(gill="\\"+m[1]),e=gill+e+gill,m[2]=m[2].replace(/(__(?!;\n\r)[a-z0-9_\-\.]+)/gi,e),str="__echo.push("+gill+m[2]+gill+");",__exp=__exp.replace(m[0],str),total++,total>safe)return __exp}return __exp}this.get=function(e){return OGX.Cache.read("ose",e)},this.fork=function(e,t){var i,n;if(i=e.split(":")[0],void 0===t.data&&(t.data={}),void 0!==(n=OGX.OSE.exec(i,t.data)))for(var o in t.values)if(convertValue(o)===n)return t.values[o];return!1},this.execScript=function(e,t,i,n){var o=this.get(e);return o&&this.exec(o,t,i,n),!1},this.exec=function(e,t,i,n,o){void 0===t&&(t={}),void 0===i&&(i={}),void 0===n&&(n={}),void 0===o&&(o={}),charcode=65;var a=runJS(convertToJS(e,t,i,n,o),t,i,n,o,e);if(void 0!==a)return a}},OGX.OSE=new OGX.OSE,OGX.OSE.SCRIPT_LOADED="OSE_SCRIPT_LOADED",OGX.OSE.SCRIPTS_LOADED="OSE_SCRIPTS_LOADED",OGX.Overlay=function(e){"use strict";var t=this,i=!1,n=!1,o={anim:OGX.Overlay.FADE,display:{css:"",html:" "},index:!1,close_on_click:!1},a=!1,r="mousedown";function s(e){i&&(e?i.on(r,l):i.off(r,l))}function l(){"function"==typeof a.close_on_click&&a.close_on_click.apply(null,t),t.removeOverlay()}e.hasOwnProperty("overlay")&&e.overlay&&setTimeout((()=>{t.addOverlay(e.overlay)}),0),this.hasOverlay=function(){return!!i},this.addOverlay=function(e){if("object"!=typeof e&&(e={}),OGX.Data.merge(e,o),e.display.hasOwnProperty("_NAME_")||(e.display=new OGX.Display(e.display)),a=e,!this.hasOverlay()){var t=this.el;a.hasOwnProperty("el")&&(t=$(a.el));var n="z-index:"+(a.zindex?a.zindex:this.topIndex(t))+";",r='<div class="ogx_overlay '+a.display.css()+'" style="'+n+'">'+a.display.html()+"</div>";if(t.prepend(r),(i=t.children(".ogx_overlay").first()).off("transitionend"),a.anim)switch(a.anim){case OGX.Overlay.FADE:setTimeout((()=>{i&&i.removeClass("ogx_overlay_fade_out").addClass("ogx_overlay_fade_in")}),50)}else i.css("opacity",1)}return e.close_on_click&&s(!0),this},this.removeOverlay=function(e,t){s(!1);var n=!1;if(void 0===e||!0===e?a.anim&&(n=a.anim):n=e,i){if(n){switch(n){case OGX.Overlay.FADE:i.removeClass("ogx_overlay_fade_in").addClass("ogx_overlay_fade_out"),i.css("opacity")>0?i.on("transitionend",(function(){i&&(i.off("transitionend"),i.remove(),i=!1),"function"==typeof t&&t()})):i&&(i.removeClass("ogx_overlay_fade_in").removeClass("ogx_overlay_fade_out"),i.off("transitionend"),i.remove(),i=!1)}return}return i.remove(),void(i=!1)}return this},this.addGroupOverlay=function(){return n||(this.el.prepend('<div class="ogx_group_overlay" style="z-index:'+(this.topIndex()+1e3)+'"></div>'),n=!0),this},this.removeGroupOverlay=function(){return n&&(this.el.children(".ogx_group_overlay").remove(),n=!1),this}},OGX.Overlay.FADE="fade",OGX.Overlay.REMOVE="OverlayRemove",OGX.Placeholder=function(e){"use strict";this.pholder=null,this.pholders=null,e.hasOwnProperty("placeholder")&&(this.pholder=e.placeholder),this.pholder&&this.pholder.length&&"default"!==this.pholder||(this.pholder=""),this.placeholder(e)},OGX.Placeholder.prototype.placeholder=function(e){if("object"==typeof e["node:OML"]){var t=this.selector;this.pholder&&(t+=" "+this.pholder),Array.isArray(e["node:OML"])||function(e,i){for(var n in e)0===n.indexOf("default")&&(e[n.replace("default",t)]=e[n],delete e[n])}(e["node:OML"])}},OGX.Placeholder.prototype.placeholders=function(e,t){function i(e,t){for(var i in e)0===i.indexOf("default")&&(e[i.replace("default",t)]=e[i],delete e[i])}if(this.pholders=t,void 0!==e&&void 0!==t){e.hasOwnProperty("node:OML")||(e["node:OML"]=[]);var n,o=e["node:OML"];if(o&&"string"==typeof o&&(0===o.indexOf("{{")?e["node:OML"]=OGX.OSE.exec(o):e["node:OML"]=OGX.Cache.read("oml",e["node:OML"])),!Array.isArray(e["node:OML"]))return;for(var a=0;a<e["node:OML"].length;a++)if("string"==typeof(n=e["node:OML"][a])&&(n=0===n.indexOf("{{")?OGX.OSE.exec(n):OGX.Cache.read("oml",n)),"object"==typeof n&&t.length)if(Array.isArray(t[0]))for(var r=0;r<t[a].length;r++)i(n,t[a][r]);else i(n,t[a]);return e}return!1},require("Point"),OGX.Point=function(e){construct(this,"Point");var t,i=this,n={id:OGX.Object.genId(),target:null,el:null},o=OGX.Data.merge(e,n,!1,!1);function a(){var e=OGX.OML.render(i.parent,i.points[i.point].oml,o.data,o.route_data);t&&t.forEach((e=>{e.kill()})),t=e,i.el.trigger(OGX.Point.CHANGE,{min:i.points[i.point].min,max:i.points[i.point].max,index:i.point,id:i.id})}function r(e,t,i,n){return-1!==i.indexOf("%")?(i=parseInt(i.replace("%",""),10),n=parseInt(n.replace("%",""),10),e>=i&&e<=n):(i=parseInt(i,10),n=parseInt(n,10),t>=i&&t<n)}function s(){var e=function(){var e,t;e=o.target?i.el.find(o.target).first().width():i.el.width(),t=i.el.width();for(var n=0;n<i.points.length;n++)if(r(t?100*e/t:0,e,i.points[n].min,i.points[n].max))return{id:n,oml:i.points[n].oml};return!1}();return e?e.id!==i.point&&(i.point=e.id,i.el.attr("data-ogx-point",i.point),!0):(i.point=0,i.el.attr("data-ogx-point",i.point),!1)}function l(e){var t;for(var i in e)0===i.indexOf("default")&&(t=i.replace("default",""),e[o.el+" "+t]=e[i],delete e[i])}this.points=[],this.point=null,this.el=$(o.el),this.id=o.id,this.construct=function(){s(),a()},this.onResize=function(){s()&&a()},this.resize=this.onResize,this.oml=function(){return null===this.point&&s(),this.points[this.point].oml},this.getPoint=function(){return{min:this.points[this.point].min,max:this.points[this.point].max}},i.el.addClass("ogx_point"),function(){var e;for(var t in o)if(/^\d+%?\-\d+%?$/gi.test(t)){e=t.split("-");var n=OGX.Data.clone(o[t]);if(Array.isArray(n))for(var a=0;a<n.length;a++)l(n[a]);else l(n);i.points.push({min:e[0],max:e[1],oml:n})}}(),s()},OGX.Point.CHANGE="PointChange",require("Popup","Uxi","Placeholder","Touch","Resize"),OGX.Popup=function(e){construct(this,"Popup");var t,i,n,o=this,a={el:!1,width:"80%",height:"80%",min_width:0,min_height:0,max_width:0,max_height:0,html:!1,template:!1,title:!1,icon:!1,icons:!1,view:!1,drag:!1,resize:!1,keep_ratio:!1,maximize:!1,maximize_dbc:!1,center:!0,keep_centered:!1,x:null,y:null,show:!0,group:!1,group_icon:null,data:{},buttons:[],buttons_enabled:!0,anim:OGX.Popup.FADE,responsive:!0,overlay:!1,zindex:!1,chromeos:!1,parent:null,floating:!0,callbacks:{drag:null,drag_end:null,resize:null}},r={label:"",callback:null,params:null,enabled:!0},s=null,l=null,c=null,d="ogx_popup",u=[],h=[],f={w:0,h:0},_=!1,g=!1,p=null,m=!1,v=null,y=null,x=1,O=null,b=!1;function w(){o.el.addClass("ogx_popup_notrans"),g=!0,G(!0)}function G(e){if(void 0===e&&(e=!1),t.anim&&(o.el.removeClass(U(t.anim,0)),o.el.removeClass(U(t.anim,1))),e)t.width=o.el.width(),t.height=o.el.height(),t.keep_centered=o.centered=!1;else if(!g){var i=L();o.el.css({width:i.w,height:i.h})}t.keep_centered&&o.center(),o.resizeNodes()}function X(){t.anim&&o.el.removeClass(d+"_notrans");var e={};OGX.Data.isSizeExp(t.width)?e.width=OGX.Data.getBestSize(c.width(),t.width):e.width=t.width,OGX.Data.isSizeExp(t.height)?e.height=OGX.Data.getBestSize(c.height(),t.height):e.height=t.height,o.el.css(e),o.resizeNodes()}function C(){var e=u.length;return e>2&&(e=2),u.slice(0,e).join(" ").replace(/matrix\([0-9,\. ]+\)/,"")}function D(){o.blurNodes(),t.keep_centered&&(t.keep_centered=!1)}function E(){o.focusNodes(),o.el.removeClass("ogx_popup_notrans"),t.anim&&o.el.addClass(d+"_"+t.anim)}function k(){o.front(),s.addClass(d+"_drag"),t.keep_centered&&(t.keep_centered=!1)}function S(e){if(s.removeClass(d+"_drag"),t.callbacks.drag_end?t.callbacks.drag_end():o.el.trigger(OGX.Popup.MOVED,o),_){for(var i=0;i<h.length;i++)h[i].removeGroupOverlay();return h=[],void OGX.Core.groupPopups(o,_,{drag:t.drag,resize:t.resize,anim:t.anim})}"function"==typeof t.drag&&t.drag(o,!1)}function T(e){if(i=o.el.position(),o.x=i.left,o.y=i.top,u[0]="translate3d("+o.x+"px, "+o.y+"px, 0)",t.callbacks.drag?t.callbacks.drag({x:o.x,y:o.y}):o.el.trigger(OGX.Popup.MOVE,[o,e]),t.group&&o.parent&&(h=o.parent.nodes.get({_NAME_:{eq:"Popup"},group:{eq:o.group},blured:{eq:!1}},{z:-1})).length){_=!1;for(var a=0;a<h.length;a++)o.id!==h[a].id&&h[a].group===o.group&&(n={left:h[a].x,top:h[a].y},f.w=h[a].el.width(),f.h=h[a].el.height(),i.left>n.left&&i.left<n.left+f.w&&i.top>n.top&&i.top<n.top+f.h&&(_||(_=h[a],h[a].addGroupOverlay())),_||h[a].removeGroupOverlay())}_||"function"==typeof t.drag&&t.drag(o,e)}function L(e){void 0===e&&(e=!1);var i=c.outerWidth(!0),n=c.outerHeight(!0);i>screen.width&&(i=screen.width),n>screen.height&&(n=screen.height);var a=t.width,r=t.height,s=0,l=0,d=0,u=0;if(g||(a=OGX.Data.getBestSize(i,a),r=OGX.Data.getBestSize(n,r)),t.max_height&&!m){var h=H(t.max_height,n);r>h&&(r=h)}return e||t.keep_centered?(a=H(a,i),r=H(r,n),d=Math.round(i/2-a/2),u=Math.round(n/2-r/2)):(m?(d=o.x,u=o.y):t.x&&t.y?(-1!==String(t.x).indexOf("%")?(s=a/2,d=i*Number(t.x.slice(0,-1))/100-s):d=t.x,-1!==String(t.y).indexOf("%")?(l=r/2,u=n*Number(t.y.slice(0,-1))/100-l):u=t.y):(d=Math.round(i/2-a/2),u=Math.round(n/2-r/2)),m||(d>i&&(d=i-d),d<-a&&(d=0),u>n&&(u=n-r),u<0&&(u=0))),t.keep_ratio&&!m&&(r=a*x),{x:d,y:u,w:a,h:r}}function M(e,i,n,a,r,l){var c=!1;void 0===l&&(l=!1),void 0!==i&&!0!==i||(i=t.anim),i&&(c=i),!i&&p&&(c=p),i?s.removeClass(d+"_notrans"):s.addClass(d+"_notrans"),e?(o.front(),l||o.el.trigger(OGX.Popup.SHOW,o)):l||o.el.trigger(OGX.Popup.HIDE,o),i?(e&&s.removeClass("ogx_popup_hidden"),s.off("transitionend animationend",N),s.on("transitionend animationend",{anim:c,way:e,cb:n,params:a,appcb:r},N),p=c,s.addClass(U(c,e))):(e?s.removeClass("ogx_popup_hidden"):s.addClass("ogx_popup_hidden"),A(n,a,r))}function N(e){s.off("transitionend animationend",N),e.data.way,s.removeClass(U(e.data.anim,e.data.way)),e.data.way?o.resizeNodes():s.addClass("ogx_popup_hidden"),A(e.data.cb,e.data.params,e.data.appcb)}function A(e,t,i){void 0!==e&&e&&e(t),void 0!==i&&i&&i(o.id)}function I(e){e?s.on(o.touch.down,"."+d+"_button",R):s.off(o.touch.down,"."+d+"_button",R)}function R(e){e.preventDefault(),e.stopImmediatePropagation();var i=$(this);if(!i.hasClass(d+"_button_disabled")){var n=i.index();s.trigger(OGX.Popup.CLICK_BUTTON,{index:n,value:t.buttons[n].label}),t.buttons[n].hasOwnProperty("callback")&&t.buttons[n].callback&&(t.buttons[n].hasOwnProperty("params")?t.buttons[n].callback.apply(null,[t.buttons[n].params]):t.buttons[n].callback())}}function Y(){for(var e,i="",n=0;n<t.buttons.length;n++)t.buttons.length>0&&(e=t.buttons[n].enabled?"":d+"_button_disabled",i+='<span class="'+d+"_button "+e+'">'+t.buttons[n].label+"</span>");return i}function P(e,i){void 0===i&&(i=!0),t.buttons=new OGX.List(e);for(var n=0;n<e.length;n++)t.buttons[n]=OGX.Data.merge(t.buttons[n],r);if(i){var o=Y();l.html(o)}}function z(e){e?o.el.on(o.touch.down,"."+d+"_icons_icon",(function(e){e.preventDefault(),e.stopImmediatePropagation();var i=$(this).index(),n=t.icons[i];if("object"==typeof n&&n.hasOwnProperty("callback")){var a=o;n.hasOwnProperty("params")&&(a=n.params),n.callback.call(null,a)}})):o.el.off(o.touch.down,"."+d+"_icons_icon")}function F(){for(var e,i="",n=0;n<t.icons.length;n++)e="string"==typeof t.icons[n]?t.icons[n]:t.icons[n].icon,i+='<div class="'+d+'_icons_icon" style="background-image:url(\''+e+"')\"></div>";return i}function U(e,t){var i,n=e.split(" ");return n.sort(),i=t?"in":"out","ogx_popup_"+n.join("_")+"_"+i}function B(e){e?s.on(o.touch.down,".ogx_popup_body",W):s.off(o.touch.down,".ogx_popup_body",W)}function W(){o.front()}function H(e,t){return"string"==typeof e&&(e=-1!==e.indexOf("%")?Math.round(t*Number(e.slice(0,-1))/100):Number(e)),e}this.anim=null,this.group=null,this.group_icon=null,this.max=null,this.max_dbc=null,this.x=0,this.y=0,this.z=0,this.construct=function(){t.keep_ratio&&(x=this.el.width()/this.el.height()),this.resizeNodes(),t.show&&this.show()},this.onFocus=function(){t.resize&&o.enableResize(),t.icons&&t.icons.length&&z(!0),t.buttons&&t.buttons.length&&t.buttons_enabled&&I(!0),y&&y.enable(),B(!0)},this.onBlur=function(){t.resize&&o.disableResize(),t.icons&&t.icons.length&&z(!1),t.buttons&&t.buttons.length&&t.buttons_enabled&&I(!1),y&&y.disable(),B(!1)},this.show=function(e,t,i){return this.visible||(this._show(),M(1,e,t,i),this.focus(1)),this},this.hide=function(e,t,i,n,o){return this.visible&&(this._hide(),M(0,e,t,i,n,o),this.blur(1)),this},this.onResize=function(){return G(),this},this.maximize=function(e){if(void 0===e||!y)return t.maximize&&!m&&(m=!0,v={width:t.width,height:t.height,x:this.x,y:this.y},t.width=t.height="100%",X(),this.move(0,0)),this;e?(y.enable(),t.maximize=!0):(y.disable(),t.maximize=!1)},this.normalize=function(){return t.maximize&&m&&(m=!1,t.width=v.width,t.height=v.height,X(),this.move(v.x,v.y),v=null),this},this.drag=function(e){return void 0===e?t.drag:"function"==typeof e?(t.callbacks.drag=e,!0):void(t.drag!==e&&(e?O.enable():O.disable(),t.drag=e))},this.uresize=function(e){return void 0===e?t.resize:"function"==typeof e?(t.callbacks.resize=e,!0):void(t.resize!==e&&(e?this.enableResize():this.disableResize(),t.resize=e))},this.width=function(e,i,n){return void 0===e?t.width:(void 0===n&&(n=!1),void 0===i&&(i=!1),i&&(this.el.removeClass("ogx_popup_notrans"),this.observeSizeOnce((()=>{this.el.addClass("ogx_popup_notrans"),n()}))),t.width=e,this.el.css("width",e+"px"),t.keep_centered&&this.center(),this)},this.height=function(e,i,n){return void 0===e?t.height:(void 0===n&&(n=!1),void 0===i&&(i=!1),i&&(this.el.removeClass("ogx_popup_notrans"),this.observeSizeOnce((()=>{this.el.addClass("ogx_popup_notrans"),n()}))),t.height=e,this.el.css("height",e+"px"),t.keep_centered&&this.center(),this)},this.destroy=function(){s.off("transitionend animationend"),this.touch.wipe()},this.buttons=function(e){if(void 0===e)return t.buttons;P(e)},this.enableButton=function(e){return t.buttons[e].enabled=!0,l.children("."+d+"_button:eq("+e+")").removeClass(d+"_button_disabled"),t.buttons_enabled||(t.buttons_enabled=!0),this},this.disableButton=function(e){return t.buttons[e].enabled=!1,l.children("."+d+"_button:eq("+e+")").addClass(d+"_button_disabled"),this},this.enableButtons=function(){if(t.buttons.length)for(var e=0;e<t.buttons.length;e++)this.enableButton(e);return t.buttons_enabled=!0,this},this.disableButtons=function(){if(t.buttons.length)for(var e=0;e<t.buttons.length;e++)this.disableButton(e);return t.buttons_enabled=!1,this},this.center=function(e){if(void 0===e&&(e=null),null!==e&&(t.keep_centered=e),null===e){var i=L(!0);return u[0]="translate3d("+i.x+"px, "+i.y+"px, 0px)",this.x=i.x,this.y=i.y,o.el.css({transform:C()}),this}},this.move=function(e,t){return null===e&&(e=o.el.position().left),null===t&&(t=o.el.position().top),u[0]="translate3d("+e+"px, "+t+"px, 0px)",this.x=e,this.y=t,this.el.css({transform:C()}),this},this.front=function(){return this.z=t.parent.topIndex(),this.el.css("z-index",this.z),this},this.icon=function(e){if(void 0===e)return t.icon;t.icon=e,this.el.children("."+d+"_head").children("."+d+"_icon").first().css("background-image","url("+e+")")},this.title=function(e){if(void 0===e)return t.title;t.title=e,this.el.find("."+d+"_title").first().html(e)},this.icons=function(e){if(void 0===e)return t.icons;t.icons&&t.icons.length&&z(!1),t.icons=e,this.el.find("."+d+"_icons").first().html(F()),z(!0)},this.shake=function(){this.el.on("animationend",(function(){o.el.off("animationend"),o.el.removeClass("ogx_popup_shake")})),this.el.addClass("ogx_popup_shake")},function(){if(OGX.Data.merge(a,OGX.Core.getDefaults("popups"),!0,!1,!0),null===(t=OGX.Data.merge(a,e,!0,!0)).x&&null===t.y||(t.center=!1,t.keep_centered=!1),"auto"===t.height&&(b=!0,t.height=t.width),t.center&&!e.hasOwnProperty("keep_centered")&&(t.keep_centered=!0),P(t.buttons,!1),(s=o.el).addClass(d),t.group&&s.attr("data-ogx-group",t.group),c=s.parent(),o.anim=t.anim,o.centered=t.center,o.group=t.group,o.group_icon=t.group_icon,o.max=t.maximize,o.max_dbc=t.maximize_dbc,function(){t.index?o.z=t.index:o.z=t.parent.topIndex();var e=L(t.center);o.x=e.x,o.y=e.y;var i=e.w,n=e.h;-1===String(i).indexOf("%")&&(i+="px"),-1===String(n).indexOf("%")&&(n+="px");var a="";(t.icon||t.title||t.icons||t.drag)&&(a+='<div class="'+d+'_head">',t.icon&&(a+='<div class="'+d+'_icon" style="background-image:url(\''+t.icon+"')\"></div>"),t.title&&(a+='<div class="'+d+'_title">'+t.title+"</div>"),a+='<div class="'+d+'_icons">',t.icons&&(a+=F()),a+="</div></div>"),u=["translate3d("+e.x+"px, "+e.y+"px, 0)"],a+='<div class="'+d+'_body ogx_view">',t.html?a+=t.html:t.template&&(a+=OGX.Templater.make(OGX.Templater.get(t.template),t.data)),a+="</div>",t.buttons&&t.buttons.length&&(a+='<div class="'+d+'_buttons">',a+=Y(),a+="</div>"),b&&o.observeOnce(null,(()=>{o.observeSizeOnce((()=>{var e=$(o.scroller.inner()).height(),i=o.parent.el.height();if(t.title&&(e+=s.children(".ogx_popup_head").height()),t.buttons&&t.buttons.length&&(e+=s.children(".ogx_popup_buttons").height()),t.max_height){var n=t.max_height;e>(n=H(n,i))&&(e=n)}e>i&&(e=i),t.height=e,o.height(e)}))})),s.html(a),s.css({width:i,height:n,transform:C(),"z-index":o.z}),t.anim&&t.show&&s.addClass(U(t.anim,1)),o.el=s,l=s.children("."+d+"_buttons").first()}(),t.drag&&function(e){if(e)if(O)O.enable();else{var i={x:!0,y:!0,cb_down:k,cb_up:S,cb_drag:T,target:"."+d+"_head"};t.group||"function"==typeof t.drag&&(i.cb_drag=e=>{t.drag(o,e)}),O=o.touch.add("Drag",i),o.dragable=!0}else O&&O.disable()}(!0),t.resize){var i,n=/\[=?(\d+),? ?=?(\d+)?\]/g;OGX.Data.isSizeExp(t.width)&&(i=n.exec(t.width))&&(t.min_width=Number(i[1].replace("=","")),void 0!==i[2]&&(t.max_width=Number(i[2].replace("=","")))),n.lastIndex=0,OGX.Data.isSizeExp(t.height)&&(i=n.exec(t.height))&&(t.min_height=Number(i[1].replace("=","")),void 0!==i[2]&&(t.max_height=Number(i[2].replace("=","")))),o.setResize({top:!1,keep_ratio:t.keep_ratio,min_width:t.min_width,max_width:t.max_width,min_height:t.min_height,max_height:t.max_height,cb_resize:w,cb_down:D,cb_up:E})}if(t.hasOwnProperty("html")&&t.html)t["node:OML"]=[{"default:Html":{html:t.html}}];else if(t.hasOwnProperty("view")&&t.view){var r={};r["default:Views."+t.view.id]=t,t["node:OML"].push(r)}o.placeholders(t,["."+d+'[data-ogx-id="'+t.id+'"] > .'+d+"_body"]),t.overlay&&o.addOverlay(),y=o.touch.add("Double",{state:"manual",tg:o.selector+" > .ogx_popup_head",cb_down:()=>{o.front()},cb:()=>{t.maximize&&t.maximize_dbc&&(y.disable(),m?setTimeout((()=>{o.normalize()}),180):setTimeout((()=>{o.maximize()}),180),"function"==typeof t.maximize_dbc&&t.maximize_dbc(!m),y.enable())}})}()},OGX.Popup.FADE="fade",OGX.Popup.SCALE="scale",OGX.Popup.SLIDE="slide",OGX.Popup.MOVE="PopupMove",OGX.Popup.MOVED="PopupMoved",OGX.Popup.HIDE="PopupHide",OGX.Popup.SHOW="PopupShow",OGX.Popup.CLOSE="PopupClose",OGX.Popup.DRAG="PopupDrag",OGX.Popup.GROUP="PopupGroup",OGX.Popup.UNGROUP="PopupUngroup",OGX.Popup.CLICK_BUTTON="PopupClickButton",OGX.Popup.FLOAT=!0,OGX.Resize=function(e){"use strict";var t,i,n,o,a,r,s,l,c,d,u,h=this,f=e,_={enabled:!0,top:!0,left:!0,right:!0,bottom:!0,keep_ratio:!1,min_width:100,min_height:100,max_width:0,max_height:0,border:10,cb_up:!1,cb_down:!1,cb_resize:!1},g=!1,p=(f=!1,{w:0,h:0}),m=1;function v(e){f&&(e?h.el.on(h.touch.down,G):h.el.off(h.touch.down,G))}function y(e){e?(h.el.on("mouseenter",(()=>{x(!0)})),h.el.on("mouseleave",(()=>{x(!1)}))):(h.el.off("mouseenter"),h.el.off("mouseleave"),x(!1))}function x(e){e?h.el.on("mousemove",w):h.el.off("mousemove",w)}function O(e){e?g||(g=setInterval(X,5)):g&&(clearInterval(g),g=!1)}function b(e){var t=$("body");e?(t.on(h.touch.move,C),t.on(h.touch.up,D)):(t.off(h.touch.move,C),t.off(h.touch.up,D))}function w(e){var t=E(e);r=t.pageX,s=t.pageY;var i,n=h.el.offset(),o=r-n.left,a=s-n.top,l=!1,c=!1,d=h.el.width(),u=h.el.height();(f.top&&a<f.border||f.bottom&&a>u-f.border)&&(l=!0),f.left&&o<f.border&&(c=!0,i="nwse",a>u/2&&(i="nesw")),f.right&&o>d-f.border&&(c=!0,i="nesw",a>u/2&&(i="nwse")),h.el.removeClass("ogx_resize_nesw ogx_resize_nwse ogx_resize_h ogx_resize_v"),l&&c?h.el.addClass("ogx_resize_"+i):l?h.el.addClass("ogx_resize_v"):c&&h.el.addClass("ogx_resize_h")}function G(e){y(!1);var _=E(e);i=r=_.pageX,n=s=_.pageY;var g=h.el.offset(),v=r-g.left,x=s-g.top;p.w=h.el.width(),p.h=h.el.height(),f.keep_ratio&&(m=p.w/p.h),l=0,c=0,d=0,u=0,o=0,a=0,t=OGX.Data.get2DTransform(h.el[0]),f.top&&x<f.border&&(a=-1),f.bottom&&x>p.h-f.border&&(a=1),f.left&&v<f.border&&(o=-1),f.right&&v>p.w-f.border&&(o=1),(o||a)&&(e.preventDefault(),O(!0),b(!0),f.cb_down&&f.cb_down())}function X(){l=Math.abs(r-i),c=Math.abs(s-n),d=0,u=0,r>i&&(d=1),r<i&&(d=-1),s>n&&(u=1),s<n&&(u=-1),i=r,n=s,(d&&l||u&&c)&&(-1!==o&&-1!==a||(-1===o&&(d*=-1),-1===a&&(u*=-1)),o&&d&&l&&(p.w+=l*d),a&&u&&c&&(p.h+=c*u),o&&d&&l&&(f.min_width&&p.w<f.min_width&&(p.w=f.min_width),f.max_width&&p.w>f.max_width&&(p.w=f.max_width)),a&&u&&c&&(f.min_height&&p.h<f.min_height&&(p.h=f.min_height),f.max_height&&p.h>f.max_height&&(p.h=f.max_height)),f.keep_ratio&&(o&&l?p.h=Math.round(p.w*m):a&&c&&(p.w=Math.round(p.h/m))),(o&&d&&l||a&&u&&c)&&((f.left||f.right||f.keep_ratio)&&h.el.width(p.w),(f.top||f.bottom||f.keep_ratio)&&h.el.height(p.h)),p.h!==f.min_height&&p.h!==f.max_height&&p.w!==f.min_width&&p.w!==f.max_width&&(-1===o&&(t.x+=l*d*-1),-1===a&&(t.y+=c*u*-1)),p.h!==f.min_height&&p.h!==f.max_height&&p.w!==f.min_width&&p.w!==f.max_width&&h.el.css("transform","translate3d("+t.x+"px, "+t.y+"px, 0) rotate("+t.r+"deg)"),f.cb_resize&&f.cb_resize(),h.el.trigger(OGX.Resize.RESIZING))}function C(e){e.preventDefault(),e.stopImmediatePropagation(),e=E(e),r=e.pageX,s=e.pageY}function D(e){h.el.removeClass("ogx_resize_nesw ogx_resize_nwse ogx_resize_h ogx_resize_v"),O(!1),b(!1),y(!0),e=E(e),f.cb_up&&f.cb_up(),h.el.trigger(OGX.Resize.RESIZED)}function E(e){return e.hasOwnProperty("originalEvent")&&void 0!==e.originalEvent.changedTouches?e.originalEvent.changedTouches[0]:e}this.resizable=!0,this.setResize=function(e){OGX.Data.merge(e,_,!1),f=e},this.enableResize=function(){return v(!0),y(!0),this},this.disableResize=function(){return v(!1),y(!1),this},this.destroy=function(){v(!1),y(!1),this.touch.wipe()},f||(f={}),OGX.Data.merge(f,_,!1),!f.max_width&&(f.max_width=998001),!f.max_height&&(f.max_height=998001)},OGX.Resize.RESIZING="resizeResizing",OGX.Resize.RESIZED="resizeResized",require("Roulette","Uxi","Bind","Touch"),OGX.Roulette=function(e){construct(this,"Roulette");var t,i,n,o,a,r,s,l,c,d=this,u=e,h={force_coef:10,time_coef:.1,min_force_pitch:2,max_slide:5,value:null,name:!1,required:!1,display:!1,key:null,keys:{},search:!1,mode:OGX.Roulette.MODE_REWIND,icon:!1,list:new OGX.List,capture:!0,callbacks:{change:null,input:null}},f={label:"label",value:"value",search:"label"},_="object",g=0,p=0,m="ogx_roulette";function v(e){var t=M(u.keys.value,e).index;if(t>-1&&Math.abs(p-t)>u.max_slide){var i=1;p>t&&(i=-1),k(t-i*u.max_slide,!1)}return t}function y(e,t){void 0===t&&(t=!0),d.el.children('input[name="'+u.name+'"]').val(e),t&&d.el.children('input[name="'+u.name+'"]').trigger("change")}function x(e){e?i.on(d.touch.down,"."+m+"_icon",(function(e){e.preventDefault(),e.stopImmediatePropagation(),d.next(!0),u.search&&d.el.find(".ogx_roulette_input").val("")})):i.off(d.touch.down,"."+m+"_icon")}function O(e){e?i.on("change","input[type=hidden]",b):i.off("change","input[type=hidden]",b)}function b(e){e.preventDefault(),e.stopImmediatePropagation();var t=OGX.Data.stringToVal(e.target.value);v(t),d.loopval(0,t,!1)}function w(e){return p+e>u.list.length-1?u.list[0]:p+e<0?u.list[u.list.length-1]:u.list[p+e]}function G(e){a=e.y,D(!0)}function X(e){var t;e.dirY!==r?(t=0,a=e.pt1.y):(t=e.pt1.y-a,a=e.pt1.y),r=e.dirY,n.css({transition:"none",transform:"translate3D(0px, "+(L(n)+t)+"px, 0px)"})}function C(e){D(!1),trans=L(n);var t=Math.round(trans/o)*o,i=Math.round(t/o%u.list.length);if(i=i<=0?Math.abs(i):u.list.length-i,p!==i){switch(p=i,_){case"string":u.value=u.list[p];break;case"object":u.value=u.list[p][u.keys.value]}u.name&&d.el.children('input[name="'+u.name+'"]').val(u.value).trigger("input"),d.el.trigger(OGX.Roulette.CHANGE,[u.value])}n.css({transition:"all 0.2s ease-out",transform:"translate3D(0px, "+t+"px, 0px)"})}function D(e){e?s=setInterval(E,10):clearInterval(s)}function E(){var e,t,i;void 0!==r&&r&&((e=Math.floor((n.position().top+o*r)/(o*u.list.length)*-1))!==g&&(0===n.children("."+m+'_stripe[data-id="'+e+'"]').length&&((t=l.clone()).css("top",e*(o*u.list.length)+"px"),t.attr("data-id",e),n.append(t)),n.children("."+m+"_stripe").each((function(e,t){i=n.position().top+$(t).position().top,(Math.ceil(i+o*u.list.length)<-o||i>o)&&$(t).remove()})),g=e))}function k(e,t){void 0===t&&(t=!0),n.off("transitionend",S),D(!1),r=-1;var i=L(n),a=Math.round(i/o)*o,s=i-a,l=Math.round(a/o%u.list.length),c=(l=l<=0?Math.abs(l):u.list.length-l)-e;u.mode===OGX.Roulette.MODE_CLOSEST&&c>u.list.length/2&&(c=-1*(u.list.length-l+e));var d=i+c*o-s,h=20*Math.round(Math.abs(c*o)*u.time_coef);D(!0),n.on("transitionend",S),t?n.css({transition:"all "+h+"ms ease-out",transform:"translate3D(0px, "+d+"px, 0px)"}):n.css({transition:"none",transform:"translate3D(0px, "+d+"px, 0px)"}),p=e}function S(){D(!1),n.off("transitionend",S)}function T(){for(var e="",t="",a=0;a<2;a++){t+='<div class="'+m+'_stripe" style="top:'+a*(u.list.length*o)+'px;" data-id="'+a+'">';for(var r=0;r<u.list.length;r++){switch(_){case"string":e=OGX.Templater.make(u.display.html(),{label:u.list[r]});break;case"object":e=u.display.html(u.list[r])}t+='<div class="'+m+"_block "+u.display.css(u.list[r])+'" style="height:'+o+"px; line-height:"+o+'px;" data-ogx-id="'+r+'">'+e+"</div>"}t+="</div>"}d.observeOnce(null,(()=>{o=i.height(),l=(l=n.children("."+m+"_stripe").last()).detach();var e=p*o*-1;n.css({transition:"none",transform:"translate3D(0px, "+e+"px, 0px)"})})),n.html(t)}function L(e){var t=0,i=e.css("transform");return"none"!==i&&(i=i.split(",")).length>5&&(t=Number(e.css("transform").split(",")[5].split(")")[0])),t}function M(e,t){switch(_){case"string":return{index:u.list.indexOf(t)};case"object":return u.list.findIndex(e,t)}}function N(e){e?(c.on("blur",(function(){c.val("")})),c.on("keypress",(function(e){13===e.which&&c.val("")})),OGX.Form.bindField({el:d.selector+" .ogx_roulette_input",input_cb:e=>{d.onInput(e.value);var t={};t[u.keys.search]={regex:new RegExp("^"+e.value,"i")};var i=u.list.get(t,{},1);if(i){d.el.find(".ogx_roulette_container").removeClass("ogx_hidden");var n=M(u.keys.search,i[u.keys.search]);if(Math.abs(p-n.index)>u.max_slide){var o=1;p>n.index&&(o=-1),k(n.index-o*u.max_slide,!1)}n.index!==p&&(d.val(i[u.keys.value],!0),u.name&&(O(!1),d.el.children('input[name="'+u.name+'"]').trigger("change"),O(!0)))}else d.el.find(".ogx_roulette_container").addClass("ogx_hidden")}})):OGX.Form.unbindField(d.selector+" .ogx_roulette_input")}function A(){u.list.length>0&&!u.list.hasOwnProperty("insert")&&(u.list=new OGX.List(u.list)),"string"==typeof u.list[0]&&(_="string"),1===u.list.length&&(u.list[1]=u.list[0])}this.construct=function(){u.name&&O(!0)},this.onFocus=function(){return i.removeClass(m+"_disabled"),u.icon&&x(!0),this},this.onBlur=function(){i.addClass(m+"_disabled"),u.icon&&x(!1),D(!1)},this.bindFilter=function(e,t,i){return u.list.removeFilter(e),u.list.addFilter(e,t,i),u.list.filter(),setTimeout(T,0),this},this.bindValue=this.val,this.bindRender=function(e,t){},this.destroy=function(){u.name&&O(!1),u.search?N(!1):this.touch.wipe()},this.onChange=function(){},this.onInput=function(){},this.val=function(e,t){if(void 0!==e){var i=v(e);return i>-1&&(k(i),u.name&&y(e,!1)),void 0!==t&&t&&(this.onChange(e),this.el.trigger(OGX.Roulette.CHANGE,[e])),this}switch(_){case"string":return u.list[p];case"object":return u.list[p][u.keys.value]}},this.selection=function(){switch(_){case"object":return u.list[p]}return null},this.list=function(e,t){return u.value=t,u.list=e,A(),p=void 0===t?0:M(u.keys.value,t).index,setTimeout(T,0),this},this.item=function(){return u.list[p]},this.loopval=function(e,t,i){var a=p,r=M(u.keys.value,t).index;r>-1&&(p=r);var s=a-r,l=u.time_coef*Math.abs(s+e*u.list.length);return D(!0),n.css({transition:"all "+l+"s ease-out",transform:"translate3D(0px, "+(L(n)+(s*o-u.list.length*o*e))+"px, 0px)"}),n.on("transitionend",S),u.name&&y(t,i),void 0!==i&&i&&(this.onChange(val),this.el.trigger(OGX.Roulette.CHANGE,[val])),this},this.next=function(e){var t,i=w(1);switch(r=1,_){case"string":t=i;break;case"object":t=i[u.keys.value]}return this.val(t),void 0!==e&&e&&(this.onChange(t),this.el.trigger(OGX.Roulette.CHANGE,[t]),u.name&&this.el.children('input[name="'+u.name+'"]').trigger("input")),this},this.prev=function(e){var t,i=w(-1);switch(_){case"string":t=i;break;case"object":t=i[u.keys.value]}return this.val(t),void 0!==e&&e&&(this.onChange(t),this.el.trigger(OGX.Roulette.CHANGE,[t]),u.name&&this.el.children('input[name="'+u.name+'"]').trigger("change")),this},this.setData=function(e,t){return this.list(e,t)},function(){if(u.key&&(u.keys.label="label",u.keys.search="label",u.keys.value=u.key,delete u.key),OGX.Data.merge(u,h),OGX.Data.merge(u.keys,f),t={template:!1,html:'<span class="ogx_roulette_block_label">{{$'+u.keys.label+"}}</span>",css:!1},u.callbacks.change&&(d.onChange=u.callbacks.change),u.callbacks.input&&(d.onInput=u.callbacks.input),A(),u.display?u.display=new OGX.Display(u.display):u.display=new OGX.Display(t),(i=d.el).addClass(m),i.width(),o=i.height(),u.list.length){var e=i.parent();e[0].hasAttribute("data-value")&&(u.value=OGX.Data.stringToVal(e.data("value")),e.removeAttr("data-value")),null===u.value&&(u.value=u.list[0],"object"==typeof u.value&&(u.value=u.value.value)),p=M(u.keys.value,u.value).index}}(),function(){var e="";if(u.search&&(e+='<input type="text" class="'+m+'_input">'),e+='<div class="'+m+'_container"><div class="'+m+'_stripes"></div></div>',u.icon&&(e+='<div class="'+m+'_icon"></div>'),void 0===p&&(p=0),u.name){var t="";switch(u.required&&(t=" required"),_){case"string":e+='<input type="hidden" name="'+u.name+'" value="'+u.list[p]+'" '+t+">";break;case"object":e+='<input type="hidden" name="'+u.name+'" value="'+u.list[p][u.keys.value]+'" '+t+">"}}i.html(e),n=i.children("."+m+"_container").children("."+m+"_stripes").first(),u.search?(c=d.el.find('input[type="text"]').first(),u.search&&N(!0)):d.touch.add("Swipe",{x:!1,y:!0,cb_down:G,cb_swipe:X,cb_up:C,target:'.ogx_roulette[data-ogx-id="'+d.id+'"] .ogx_roulette_container',capture:u.capture}),T()}()},OGX.Roulette.CHANGE="RouletteChange",OGX.Roulette.MODE_REWIND="RouletteModeRewind",OGX.Roulette.MODE_CLOSEST="RouetteModeClosest",OGX.Roulette.BIND=OGX.Roulette.CHANGE,require("RouletteTree","Uxi"),OGX.RouletteTree=function(e){construct(this,"RouletteTree");var t,n,o=this,a=e,r={groups:!1,data:!1,value:!1,required:!1},s=!1;function l(e){e?t.on(OGX.Roulette.CHANGE,d):t.off(OGX.Roulette.CHANGE,d)}function c(){for(var e,t=0;t<s.length;t++)t>0&&(e=s[t-1].roulette.val()),0===t||t-1>=0&&null!==e&&String(e).length>0?s[t].roulette.enable():t>0&&s[t].roulette.disable()}function d(e,o){e.stopImmediatePropagation();var a,r=$(e.target).data("ogx-id"),l=s.findIndex("id",String(r)),c=s[l.index].roulette.item().hasOwnProperty("head");if(n=l.index,l.index+1<s.length)for(i=l.index+1;i<s.length;i++)c?(s[i].roulette.val(""),s[i].roulette.disable()):(a=u(i-1,s[i-1].roulette.val()),s[i].roulette.list(a,a[0].value),i===l.index+1?s[i].roulette.enable():s[i].roulette.disable());var d=h(n);t.trigger(OGX.RouletteTree.CHANGE,d),c&&!n&&(n=-1)}function u(e,t){for(var i=[],n=0;n<e+1;n++)i.push(s[n].roulette.val());return _(i)}function h(e){if(void 0===e&&(e=s.length),e<0)return!1;for(var t={},i=0;i<e+1;i++)t[a.groups[i]]=s[i].roulette.val();return t}function f(e){for(var t,i=[],o=0;o<a.groups.length;o++)e.hasOwnProperty(a.groups[o])&&(t=e[a.groups[o]],String(t).length&&(!isNaN(t)&&(t=String(t)),s[o].roulette.val(t),n=o,o>0&&s[o].roulette.list(_(i),t),i.push(t)));setTimeout(c,0)}function _(e){for(var t=a.data,i=0;i<e.length;i++)e[i].length&&(t=t[e[i]]);var n=[{label:a.groups[e.length],value:""}];for(var o in t)n.push({label:o,value:o});return n}this.onFocus=function(){return s&&(c(),l(!0)),this},this.disable=function(){return s&&l(!1),this},this.val=function(e){if(void 0===e)return n>-1?h(n):{};f(e)},a=OGX.Data.merge(a,r),(t=o.el).addClass("ogx_roulette_tree"),o.observeOnce({childList:!0},(function(){setTimeout((()=>{a.value?f(a.value):c()}),10)})),function(){s=new OGX.List;var e,i,n=0;!function r(l,c){var d;if(!Array.isArray(l)&&"object"==typeof l){if(c>n){for(var u in n=c,t.append('<div class="ogx_roulette_tree_roulette" data-ogx-roulette="'+c+'"></div>'),i=a.groups[c-1],e=[{label:i,value:"",head:!0}],l)e.push({label:u,value:u});d=o.create("Roulette",{el:'.ogx_roulette_tree[data-ogx-id="'+o.id+'"] .ogx_roulette_tree_roulette[data-ogx-roulette="'+c+'"]',list:e,icon:a.icon,value:null,name:i,enabled:!1,required:a.required}),s.push({roulette:d,group:i,id:d.id})}if(c<a.groups.length)for(var u in l)r(l[u],c+1)}}(a.data,1)}(),n=-1},OGX.RouletteTree.CHANGE="RouletteTreeChange",OGX.RouletteTree.BIND=OGX.RouletteTree.CHANGE,OGX.Router=function(__config){"use strict";var that=this,config_default={options:{history:!0,bookmark:!0,jail:!0,cache:!1,eval:!1,idle:!1,hide_window:!0,hide_popup:!1},cache:!1,errors:{403:!1,404:!1},routes:{}},options_default={history:!0,reload:!1,data:null},rewrite_default={qsa:!1,url:null},route_default={enabled:!0,oml:null},config=__config;for(var route in OGX.Data.merge(config,config_default,!1),OGX.Data.merge(config.options,config_default.options,!1),OGX.Data.merge(config.errors,config_default.errors,!1),config.routes)OGX.Data.merge(config.routes[route],route_default,!1);var page=window.location.pathname.split("/").slice(-1)[0],locked=!1,global_url=null,route=null,request=null,route_rendered=!1,isCached=!1,cache=new OGX.List,gate=null,blured=!1,time=0,init_url=window.location.hash.slice(3);function urlToQSA(e){var t,i=e.split("?").pop().split("&"),n={};return i.forEach((e=>{t=e.split("="),n[t.shift()]=t.pop()})),n}function isCachable(e){return!(!config.options.cache||!e.route.hasOwnProperty("cache")||!1===e.route.cache)}function cacheExpired(e){var t=getCache(e);if(!t)return!0;var i=0;return"once"===config.options.cache||(!0!==config.options.cache||!0!==e.route.cache&&0!==e.route.cache)&&(!e.route.hasOwnProperty("cache")||!1===e.route.cache||(!0===e.route.cache&&"boolean"!=typeof config.cache&&(i=config.options.cache),"boolean"!=typeof e.route.cache&&(i=e.route.cache),Math.round((new Date).getTime()/1e3)>t.time+i))}function doCache(e){var t=getStageDefault(OGX.Core.getStage());if(t){t.uxi.detach();var i={url:e.url,uxi:t.uxi,time:Math.round((new Date).getTime()/1e3)};cache.insert(i)}}function unCache(e){var t=getCache(e);t&&(t.uxi.kill(),cache.findDelete("url",e.url,1))}function useCache(e){var t=getCache(e);if(t){isCached=!0;var i=OGX.Core.getStage();t.uxi.attach(i,$(i.pholder)),cache.findDelete("url",e.url,1),route=e}}function getCache(e){return cache.get({url:{eq:e.url}},null,1)}function findRoute(e,t){var i,n,o,a;void 0===t&&(t=!0);var r,s,l=[];for(var c in r=t?OGX.Data.clone(config.routes):config.routes){for(l=[],s=r[c],o=c;n=/(?!\/)([a-z0-9_\-]+)\:([^\/]+)/gi.exec(o);)o=o.replace(n[0],n[2]),l.push(n[1]);if((i=e.match("^"+o.replace("/","\\/")+"$"))&&i.length){i.shift(),"string"==typeof s.oml&&(s.oml=OGX.Data.clone(OGX.Cache.read("oml",s.oml))),a={};for(var d=0;d<i.length;d++)a[l[d]]=i[d];return{stage:e.split("/").shift(),route:s,data:a,pattern:c}}}return!1}function clearStage(e){var t=getStageDefault(e);t&&(t.uxi.kill(),t.pl.empty())}function getStageDefault(e){var t=e.selector+" "+e.pholder,i=$(t),n=OGX.Core.cfind(null,String(i.find(".ogx_uxi").first().data("ogx-id")));return!!n&&("Scroller"===n._NAME_&&(n=n.parent),{uxi:n,pl:i})}function onCordovaBackButton(e){e.preventDefault(),e.stopImmediatePropagation(),locked||(navigator.app.backHistory(),setTimeout((()=>{OGX.Core.el.trigger(OGX.Router.BACK,url)}),10))}function onPopState(e){if(locked)return history.forward(),!1;if(that.onpopstate&&that.onpopstate(e.originalEvent.state.url))OGX.Core.getStage().url=e.originalEvent.state.url;else{if(config.options.hide_popup){var t=OGX.Core.gather("Popup").get({visible:!0,blured:!1},null,1);if(t)return t.parent.hasOverlay()&&t.parent.removeOverlay(),OGX.Core.removePopup(t.id,!1),void history.forward()}if(config.options.hide_window){var i=OGX.Core.gather("Window").get({visible:!0,blured:!1},null,1);if(i)return i.hide(),void history.forward()}if(null!==e.originalEvent.state)OGX.Core.el.trigger(OGX.Router.BACK,e.originalEvent.state.url),that.goto(e.originalEvent.state.url,{history:!1});else if(-1!==window.location.href.indexOf("#")){var n=window.location.href.split("#!/").pop();OGX.Core.el.trigger(OGX.Router.BACK,n),that.goto(n,{history:!1})}}}function captureLink(e){var t=e.originalEvent,i=$(this),n=i.attr("href"),o=i.attr("download");if(0===n.indexOf("/")&&void 0===o){if(e.preventDefault(),e.stopImmediatePropagation(),n=n.slice(1),t.ctrlKey||t.shiftKey||t.metaKey||t.button&&1==t.button)return config.options.jail?($(document).trigger(OGX.Router.GOTO,n),void setTimeout((()=>{that.goto(n)}),0)):(n=window.location.protocol+"//"+window.location.host+"/app#!/"+n,window.open(n,"_blank").focus());$(document).trigger(OGX.Router.GOTO,n);var a=!1,r=!0;i[0].hasAttribute("data-reload")&&(a=i.data("reload")),i[0].hasAttribute("data-history")&&(r=i.data("history")),setTimeout((()=>{that.goto(n,{reload:a,history:r})}),0)}}function onFocus(){blured=!1;var e=0;config.options.idle&&"boolean"!=typeof config.options.idle&&(e=config.options.idle),route.route.hasOwnProperty("idle")&&route.route.idle&&(e=route.route.idle),route&&time&&e&&(new Date).getTime()-time>1e3*e&&(that.uncache(request.url),that.goto(route.url,{reload:!0,history:!1}))}function onBlur(){blured=!0,time=(new Date).getTime()}function handleVisibilityChange(){"visible"===document.visibilityState?onFocus():onBlur()}this.onpopstate=null,this.url=function(){return global_url},this.start=function(){$(document).on("backbutton",onCordovaBackButton),$(window).on("popstate",onPopState)},this.stop=function(){$(document).off("backbutton",onCordovaBackButton),$(window).off("popstate",onPopState)},this.enable=function(e){return!!config.routes.hasOwnProperty(e)&&(config.routes[e].enabled=!1,!0)},this.disable=function(e){return!!config.routes.hasOwnProperty(e)&&(config.routes[e].enabled=!1,!0)},this.lock=function(){locked=!0},this.unlock=function(){locked=!1},this.reload=function(){var e=this.request();return this.goto(e.url,{history:!1,reload:!0}),this},this.gate=function(e){gate=e},this.isLocked=function(){return locked},this.cache=function(e){var t=findRoute(request.url,!1);t.route.cache=e,route_rendered&&(route.route.cache=t.route.cache)},this.getCache=function(e){return getCache({url:e})},this.cacheOnce=function(){var e=findRoute(request.url,!1);e.route.cache="once",route_rendered&&(route.route.cache=e.route.cache)},this.uncache=function(e){var t=findRoute(e,!1);t&&(route.route.cache=t.route.cache=!1,cache.findDelete("url",e,1))},this.isCached=function(){return isCached},this.add=function(e,t,i){if(void 0===i&&(i=!0),void 0===t&&(t=config.options.history),t){var n={url:e};history.pushState(n,"title"+(new Date).getTime(),page+"#!/"+e),global_url=e}i&&(OGX.Core.getStage().url=e)},this.request=function(){return request.origin?request.window=!1:request.window=init_url,request},this.expire=function(e){var t=getCache({url:e});t&&unCache(t)},this.gather=function(e){void 0===e&&(e=null),"string"==typeof e&&(e=new RegExp(e));var t=[],i=!1;for(var n in config.routes)i=!1,config.routes[n].hasOwnProperty("scope")?OGX.Scope.eval(config.routes[n].scope)&&(i=!0):i=!0,i&&(e&&(i=n.match(e)),i&&t.push(n));return t},this.goto=function(__url,__options,__cb){if(isCached=!1,!locked){void 0===__cb&&(__cb=null),void 0!==__options&&__options||(__options={}),OGX.Data.merge(__options,options_default);var qsa_str=null,qsa_obj=null;if(-1!==__url.indexOf("?")){var arr=__url.split("?"),url=arr.shift();qsa_str=arr.pop(),qsa_obj=urlToQSA(__url),__url=url}var r=findRoute(__url);if(request.url=__url,request.origin=global_url,r){if(!r.route.enabled)return void history.forward();request.route=r,stage=OGX.Core.getStage(),stage||(OGX.Core.showStage(r.stage),stage=OGX.Core.getStage()),r.route.hasOwnProperty("reload")&&(__options.reload=r.route.reload),r.route.hasOwnProperty("scope")||(r.route.scope="public");var access=!0;if(OGX.Scope.eval(r.route.scope)||(access=!1),config.options.eval){var fnc=eval(config.options.eval);if(fnc){var res=fnc(r);res||(access=!1)}}if(!access)return config.errors.hasOwnProperty("403")?setTimeout((()=>{OGX.Core.goto(config.errors[403],{history:!0})}),0):$(document).trigger(OGX.Router.FORBIDDEN,{url:__url,scope:r.route.scope}),!1;if(delete r.route.scope,r.route.hasOwnProperty("origin")){for(var valid=!1,origins=r.route.origin.split(","),reg,i=0;i<origins.length;i++){if("null"===origins[i]&&!global_url){valid=!0;break}if("self"===origins[i]){if(reg=r.pattern.replace(/([a-z]+:)/,""),RegExp(reg).test(global_url)){valid=!0;break}}else if(0===global_url.indexOf(origins[i])){valid=!0;break}}if(!valid)return;delete r.route.origin}if(gate){if(!gate(__url,__options))return;gate=null}if(r.route.hasOwnProperty("rewrite"))return void 0===r.route.options&&(r.route.options={}),OGX.Data.merge(r.route.options,options_default),r.route.rewrite=OGX.Data.merge(r.route.rewrite,rewrite_default,!1,!0),r.route.rewrite.qsa&&(r.route.rewrite.url+="?"+qsa_str),r.route.options.history&&that.add(__url,r.route.options.history,!1),void that.goto(r.route.rewrite.url);qsa_obj&&(r.data=qsa_obj,__url+="?"+qsa_str),route&&isCachable(route)&&route_rendered&&!__options.reload&&doCache(route),r.url=__url;var pattern=r.pattern,stage=OGX.Core.getStage(),render=!0,same=r.stage===stage.id;if(stage&&!same&&(stage=OGX.Core.cfind("Stage",r.stage)),qsa_obj&&(__options.reload=!0),stage.url!==r.url||stage.url===r.url&&__options.reload?clearStage(stage):(render=!1,__options.history=!1),same||(OGX.Core.showStage(r.stage),stage=OGX.Core.getStage(r.stage)),stage.pattern=pattern,__options.history?this.add(__url,__options.history):(stage.url=__url,global_url=__url),config.options.cache&&cache.length&&isCachable(r)){var c=getCache(r);if(c){var cache_valid=!cacheExpired(r);if(cache_valid)return useCache(r),!0;unCache(r)}}return route=r,render?(route_rendered=!1,void 0===r.route.oml?(r.route.oml={},__cb&&__cb(),route_rendered=!0):stage.observeOnce(null,(()=>{__cb&&__cb(),route_rendered=!0})),OGX.OML.render(stage,r.route.oml,__options.data,r.data)):(__cb&&__cb(),route_rendered=!0),time=(new Date).getTime(),!0}return config.errors[404]?setTimeout((()=>{OGX.Core.goto(config.errors[404],{history:!0})}),0):$(document).trigger(OGX.Router.NOT_FOUND,{url:__url}),!1}return!1},this.init=function(){request={route:null,url:global_url,origin:global_url};var e=null;e=-1===window.location.href.indexOf("#")?config.index:window.location.href.split("#!/").pop(),request.url=e;var t=findRoute(e);t?request.route=t:config.errors[404]?(t=findRoute(config.errors[404]),request.route=t):$(document).trigger(OGX.Router.NOT_FOUND,{url:e});var i=that.request();i.window&&config.options.bookmark||(i.window=config.index),that.goto(i.window,{history:config.options.history}),$(document).on("click touchstart mousedown","a",captureLink),config.options.idle&&$(document).on("visibilitychange",handleVisibilityChange)}},OGX.Router.BACK="RouterBack",OGX.Router.EXIT="RouterExit",OGX.Router.GOTO="RouterGoto",OGX.Router.FORBIDDEN="403",OGX.Router.NOT_FOUND="404",OGX.Scope=function(e){"use strict";var t="public",i=!1,n=e;this.CHANGE="ScopeChange",this.scope=function(e){return void 0===e?t:n?($(document).trigger(OGX.Scope.CHANGE),!1):(t=e,!0)},this.token=function(e,n){if(void 0===e)return!!i;var o=function(e){var t=JSON.parse(atob(e.split(".")[1]));if(t)return t;return!1}(e);return!(!o||o.iss!==n)&&(i=e,t=o.scope,$(document).trigger(OGX.Scope.CHANGE),!0)},this.eval=function(e,i){void 0===i&&(i=t),Array.isArray(e)&&(e=e.join(" ")),e=function(e){if(!e.match(/^\/\^?/))return e;for(var i,n=e.split(" "),o=0;o<n.length;o++)n[o].match(/^\/\^?/)&&(i=(i=(i=n[o].trim()).replace(/^\/\^?/,"")).replace(/\$?\/$/,""),i=new RegExp(i,"g"),e=t.match(i)?e.replace(n[o],"1"):e.replace(n[o],"0"));return e}(e);var n=i;"string"==typeof n&&(n=n.split(" "));var o=e.match(/(?!0|1)([a-z0-9_]+)/gi);if(o&&o.length)for(var a=0;a<o.length;a++)e=n.includes(o[a])?e.replace(o[a],"1"):e.replace(o[a],"0");e=e.replace(/ /g,"|");try{var r=new Function("return "+e+";")();return"number"==typeof r&&r>0}catch(e){}return!1},this.fork=function(e){for(var t in e)if(this.eval(t))return e[t];return!1}},require("Scroller","Uxi","Placeholder","Touch"),OGX.Scroller=function(e){construct(this,"Scroller");var t,i,n,o,a,r,s,l,c,d,u=this,h=e,f=(h=OGX.Data.merge(e,{check_delay:30,fade_delay:300,css:!1,zindex:9999,observe:!0,auto_scroll:!1,scroll_callback:!1,trigger:!0,content:!1,overflow:!0,callbacks:{down:null,up:null,scroll:null,top:null,bottom:null}}),0),_="init",g=!1,p=!1,m=null,v=0,y=0;function x(e){e?i.on(u.touch.down,O):i.off(u.touch.down,O)}function O(e){e=u.event(e),u.onDown(),S(!1),G(!0),b(!0),x(!1),T("in"),E(!0)}function b(e){e?(c=setInterval(D,10),i.on(u.touch.move,w)):(clearInterval(c),i.off(u.touch.move,w))}function w(e){e=u.event(e)}function G(e){e?$(document).on(u.touch.up,X):$(document).off(u.touch.up,X)}function X(){u.onUp(),b(!1),G(!1),x(!0),E(!1),T("out")}function C(e){e?(window.addEventListener("resize",N),i.on("scroll",(function(e){e.stopImmediatePropagation(),D()})),i.on("wheel",(function(e){E(!0)})),void 0!==OGX.NestedList&&$(document).on(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED,(function(){u.update()}))):(window.removeEventListener("resize",N),i.off("scroll"),i.off("wheel"),void 0!==OGX.NestedList&&$(document).off(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED))}function D(){var e,n=(e=i.scrollTop())/s,o=Math.floor(Math.abs(i.outerHeight(!0)-t.outerHeight(!0)));a.css("top",n+"px");var r=v,l=0;if((v=100*e/o)<r?l=-1:v>r&&(l=1),h.trigger&&!g){if(l){var c={top:e,percent:v,dir:l};e>0&&e<o&&(u.onScroll(u,c),u.el.trigger(OGX.Scroller.SCROLL,c))}e>=o&&r!==v?(u.onBottom(u),u.el.trigger(OGX.Scroller.BOTTOM)):0===e&&r!==v&&(u.onTop(u),u.el.trigger(OGX.Scroller.TOP))}h.scroll_callback&&h.scroll_callback()}function E(e){e?(l&&E(!1),y=t.position().top,l=setInterval(k,h.check_delay-10)):(l&&(clearInterval(l),l=null),p=!1,u.el.trigger(OGX.Scroller.END))}function k(){var e=t.position().top;e!==y?(p||(p=!0,u.el.trigger(OGX.Scroller.START)),T("in")):T("out"),y=e}function S(e){e?d=setInterval(D,h.check_delay):clearInterval(d)}function T(e){a.hasClass("ogx_scroller_track_anim")||a.addClass("ogx_scroller_track_anim"),"in"===e?(clearTimeout(m),m=null,a.addClass("ogx_scroller_track_anim_fade_in").removeClass("ogx_scroller_track_anim_fade_out")):m||(m=setTimeout((()=>{a.addClass("ogx_scroller_track_anim_fade_out").removeClass("ogx_scroller_track_anim_fade_in")}),h.fade_delay))}function L(e){e?u.observeSize(!0,M,null,t):u.observeSize(!1)}function M(){var e=t.height();f!==e&&(f=e,N(),h.auto_scroll&&u.bottom())}function N(){if(o=i.innerHeight(),n=t.height(),s=n/o,n>o){var e=Math.round(o/s);a.css("height",e+"px"),r.css("display","block")}else r.css("display","none");"init"===_&&(_=OGX.Scroller.READY,u.el.trigger(OGX.Scroller.READY))}this.onFocus=function(){return N(),C(!0),h.observe&&setTimeout((()=>{L(!0)}),0),x(!0),y&&i.scrollTop(Math.abs(y)),this},this.onBlur=function(){return C(!1),h.observe&&L(!1),G(!1),b(!1),x(!1),E(!1),S(!1),a.removeClass("ogx_scroller_track_anim_fade_in"),a.removeClass("ogx_scroller_track_anim_fade_out"),this},this.onResize=function(){return N(),this},this.destroy=function(){u.el.removeClass("ogx_scroller_outer"),t.remove(),r.remove()},this.onDown=function(){h.callbacks.down&&h.callbacks.down(u)},this.onUp=function(){h.callbacks.up&&h.callbacks.up(u)},this.onScroll=function(){h.callbacks.scroll&&h.callbacks.scroll(u)},this.onTop=function(){h.callbacks.top&&h.callbacks.top(u)},this.onBottom=function(){h.callbacks.bottom&&h.callbacks.bottom(u)},this.overflow=function(e){if(void 0===e)return h.overflow;h.overflow!==e&&(h.overflow=e,e?(this.onFocus(),this.el.removeClass("ogx_scroller_no_overflow")):(this.onBlur(),this.el.addClass("ogx_scroller_no_overflow")))},this.overflows=function(){return!(n<=o)&&n-o},this.top=function(){return n>o&&(i[0].scrollTop=0,N()),this},this.bottom=function(){return n>o&&(i.scrollTop(n),N()),this},this.isTopped=function(){return 0===i[0].scrollTop},this.isBottomed=function(){return i[0].scrollTop===n-o},this.max=function(){return t.height()-i.height()},this.scroll=function(e){return void 0===e?i[0].scrollTop:(i[0].scrollTop=e,N(),this)},this.mute=function(){return g=!0,this},this.vocal=function(){return g=!1,this},this.container=function(){return t},this.inner=function(){return t[0]},this.outer=function(){return i[0]},this.state=function(){return _},this.percent=function(){return v},u.placeholders(h,['.ogx_scroller_outer[data-ogx-id="'+h.id+'"] > .ogx_scroller_inner']),function(){u.el=$(h.el),u.el.addClass("ogx_scroller_outer ogx_hw"),(i=u.el).html('<div class="ogx_scroller_inner ogx_hw"></div>'),t=i.children(".ogx_scroller_inner"),h.content&&t.append(h.content);var e='<div class=ogx_scroller_track ogx_hw" style="z-index:'+h.zindex+';" data-ogx-scroller="'+u.id+'"><div class="ogx_scroller_track_button" data-ogx-scroller="'+u.id+'"></div></div>';i.parent().append(e),r=i.parent().find(".ogx_scroller_track"),a=r.find(".ogx_scroller_track_button")}(),N()},OGX.Scroller.READY="ScrollerReady",OGX.Scroller.TOP="ScrollerTop",OGX.Scroller.BOTTOM="ScrollerBottom",OGX.Scroller.SCROLL="ScrollerScroll",OGX.Scroller.START="ScrollerStart",OGX.Scroller.END="ScrollerEnd",OGX.Splash=function(e){"use strict";var t=this,i=e,n=0,o=0,a=null,r=!1,s='<div id="ogx_splash" class="ogx_splash" style="background-color:'+i.color+'"><span class="ogx_splash_content"><span class="ogx_splash_image" style="background-image:url('+i.image+');"></span><span class="ogx_splash_progress"><span class="ogx_splash_bar"></span></span></span></div>';$("body").append(s);var l=$("#ogx_splash");function c(){r=!0,$(document).off(OGX.App.READY,c),i.auto_hide&&(a=setTimeout((()=>{OGX.Core.splash.hide()}),i.hide_timeout))}function d(e){document.hidden?i.auto_hide&&a&&(clearTimeout(a),a=null):r&&i.auto_hide&&(t.show(),a=setTimeout((()=>{OGX.Core.splash.hide()}),i.hide_timeout))}this.show=function(){l.addClass("ogx_splash_show")},this.hide=function(e){l&&(l.hasClass("ogx_splash_show")?(l.on("transitionend",(function(){l&&(l.off("transitionend").remove(),l=null,e())})),l.removeClass("ogx_splash_show")):(l.remove(),e()))},this.destroy=function(){$(document).off("visibilitychange",d),$(document).off(OGX.App.READY,c)},$(document).on("NET_LOAD_START",(function(e,t){$(document).off(OGX.Net.LOAD_START),n=t})),$(document).on("NET_LOAD_SUCCESS",(function(e,t){o++;var i=Math.round(100*o/n);$("#ogx_splash .ogx_splash_bar").css("width",i+"%"),n===o&&$(document).off(OGX.Net.LOAD_SUCCESS)})),$(document).on("visibilitychange",d),$(document).on(OGX.App.READY,c),setTimeout(this.show,200)},OGX.Splash.DONE="SplashDone",require("StackedTree","Uxi","Touch"),OGX.StackedTree=function(e){construct(this,"StackedTree");var t,i,n,o,a=this,r={scope:["public"],speed:200,list:[],display:{html:"{{$label}}"},displays:!1,chromeos:!1},s=e,l=[],c=[0],d=0,u=!1,h="ogx_stacked_tree";function f(e){e>0&&g(new CustomEvent("event"),f)}function _(e){e?(t.on(a.touch.down,".ogx_stacked_tree_level .ogx_stacked_tree_level_prev",g),t.on(a.touch.down,".ogx_stacked_tree_level_list .ogx_dynamic_list_item",(function(e){var t=$(this).data("ogx-id");t--,function(e,t){u=t;var i=l[d].findIndex("__id__",t.__id__);t.hasOwnProperty("items")&&t.items.length&&function(e){if(!e.hasOwnProperty("scope"))return!0;for(var t=0;t<s.scope.length;t++)if(-1!==e.scope.indexOf(s.scope[t]))return!0;return!1}(t)?(c.push(i),v(d+1,t.items),a.el.trigger(OGX.StackedTree.ENTER,[t,a]),setTimeout((()=>{y(d+1)}),0)):a.el.trigger(OGX.StackedTree.SELECT,[t,a])}(0,l[d].val()[t])}))):(t.off(a.touch.down,".ogx_stacked_tree_level .ogx_stacked_tree_level_prev",g),t.off(a.touch.down,".ogx_stacked_tree_level_list .ogx_dynamic_list_item"))}function g(e,t){e.preventDefault(),e.stopImmediatePropagation(),y(d-1,!0,t),c.pop(),a.el.trigger(OGX.StackedTree.BACK,a)}function p(e){e?$(window).on("resize",m):$(window).off("resize",m)}function m(){i.removeClass(h+"_anim"),n=i.width(),i.css("transform","translateX("+d*Math.round(n/c.length)*-1+"px)")}function v(e,t){i.removeClass(h+"_anim").css("width",100*(e+1)+"%"),n=i.width();var r,c='<div class="'+h+'_level" data-level="'+e+'">';e>0&&(r=(r=o.css(u)).replace(h+"_door",""),c+='<div class="'+h+"_item ogx_stacked_tree_level_prev "+r+'">'+o.html(u)+"</div>"),c+='<div class="'+h+'_level_list"></div></div>',i.append(c),i.children("."+h+"_level").css("flex-basis",Math.floor(100/(e+1)*100)/100+"%"),function(e,t,i){l[e]&&a.remove(l[e].id,"DynamicList");var n=a.create("DynamicList",{el:t,mode:"static",scroll:!1,display:s.display,displays:s.displays,list:i});l[e]=n}(e,"."+h+'[data-ogx-id="'+a.id+'"] > .'+h+"_container > ."+h+'_level[data-level="'+e+'"] > .'+h+"_level_list",t)}function y(e,t,o){void 0===o&&(o=null),_(!1),i.addClass(h+"_anim"),i.on("transitionend",(function(){i.off("transitionend"),void 0!==t&&t&&(i.removeClass(h+"_anim").css("width",100*(e+1)+"%"),a.remove(l[e+1].id,"DynamicList"),l.splice(e+1,1),i.children("."+h+'_level[data-level="'+(e+1)+'"]').remove(),i.children("."+h+"_level").css("flex-basis",Math.floor(100/(e+1)*100)/100+"%"),n=i.width(),u=!1),d=e,o&&o(d),_(!0)})),n=i.width(),i.css("transform","translateX("+e*Math.round(n/c.length)*-1+"px)")}this.onFocus=function(){_(!0),p(!0)},this.onBlur=function(){_(!1),p(!1)},this.onResize=function(){return m(),this},this.destroy=function(){},this.val=function(e){if(e.length){var t=e.slice();return s.list={items:t},!0}return!1},this.scope=function(e){return void 0!==e?(s.scope=e,c=[0],d=0,u=!1,!0):s.scope},this.prev=function(){g(new CustomEvent("event"))},this.reset=function(){f(d)},function(){s=OGX.Data.merge(s,r,!1,!0);var e=(o=new OGX.Display(s)).val();if(e=function(e){if(e.display&&"object"==typeof e.display&&!e.display.hasOwnProperty("bind")&&(e.display=i(e.display)),e.displays)for(var t in e.displays)e.displays[t]=i(e.displays[t]);function i(e){if(e.hasOwnProperty("css"))if("object"==typeof e.css)e.css.hasOwnProperty("add")&&e.css.add?e.css.add+=" ogx_stacked_tree_item":e.css.add="ogx_stacked_tree_item";else{var t="";e.css&&(t=e.css),t+=" ogx_stacked_tree_item",e.css={add:t}}else e.css={add:"ogx_stacked_tree_item"};return e}return e}(e),o.val(e),s.display=e.display,s.displays=e.displays,(t=a.el).addClass(h),s.list.length){var i=s.list.slice();s.list={items:i}}}(),t.html('<div class="'+h+'_container" style="width:100%"></div>'),i=t.children("."+h+"_container").first(),s.list.items.length&&v(c[0],s.list.items)},OGX.StackedTree.BACK="StackedTreeBack",OGX.StackedTree.ENTER="StackedTreeEnter",OGX.StackedTree.SELECT="StackedTreeSelect",require("Stage","Uxi","Placeholder","Touch"),OGX.Stage=function(e){construct(this,"Stage");var t=this,i=OGX.Data.merge({id:"stage",anim:null,group_watch:!1,always_on:!1},e,!0,!0);function n(e){e?t.el.on(t.touch.down,".ogx_stage_exit",(function(){OGX.Core.theater.show()})):t.el.off(t.touch.down,".ogx_stage_exit")}this.id=i.id,this.anim=i.anim,this.theater=!1,this.home=null,this.url=null,this.route=null,this.always_on=i.always_on,this.__proto__.onFocus=function(){return i.closeable&&n(!0),this},this.__proto__.onBlur=function(){return i.closeable&&n(!1),this},function(){i.hasOwnProperty("theater")&&(t.theater=i.theater),t.home=i.home;var e=new OGX.Display(i),n="block";i.hasOwnProperty("use")&&i.use||(n="none");var o="";i.closeable&&(o='<div class="ogx_stage_exit"></div>');var a=e.html();i.hasOwnProperty("data")&&(a=OGX.Templater.make(a,i.data)),o+=a,container=t.el,container.html(o),container.addClass("ogx_stage").css("display",n)}()},OGX.Stage.SWAP="swap",OGX.Stage.FLIP="flip",require("Switch","Uxi","Bind","Touch"),OGX.Switch=function(e){construct(this,"Switch");var t,i=this,n=e,o={el:"document",bind:!1,labels:!0,data:[{label:"OFF",value:!1},{label:"ON",value:!0}],value:!1,name:!1,callbacks:{change:null}},a="ogx_switch";function r(e){n.value===n.data[0].value?n.value=n.data[1].value:n.value=n.data[0].value,s(e)}function s(e){e=void 0!==e;var i=t.find("."+a+"_dot").first(),o=t.find("."+a+"_label").first(),r=t.find("."+a+"_label").last();n.value==n.data[0].value?(i.removeClass(a+"_dot_right").addClass(a+"_dot_left"),o.removeClass(a+"_label_off").addClass(a+"_label_on").addClass(a+"_selected"),r.removeClass(a+"_label_on").addClass(a+"_label_off").removeClass(a+"_selected")):(i.removeClass(a+"_dot_left").addClass(a+"_dot_right"),r.removeClass(a+"_label_off").addClass(a+"_label_on").addClass(a+"_selected"),o.removeClass(a+"_label_on").addClass(a+"_label_off").removeClass(a+"_selected")),n.name&&t.find('input[type="hidden"]').attr("value",n.value),e&&t.children("."+a+"_val").trigger("input")}function l(e){e?t.on(i.touch.down,c):t.off(i.touch.down,c)}function c(e){e.preventDefault(),e.stopImmediatePropagation(),r(),d(!1),i.onChange(n.value),t.trigger(OGX.Switch.CHANGE,[n.value]),t.children("."+a+"_val").trigger("input"),d(!0)}function d(e){e?t.on("change","input[type=hidden]",u):t.off("change","input[type=hidden]",u)}function u(e){e.preventDefault(),e.stopImmediatePropagation(),n.value=OGX.Data.stringToVal(e.target.value),s()}this.construct=function(){n.name&&d(!0)},this.onFocus=function(){return l(!0),t.removeClass(a+"_disabled"),this},this.onBlur=function(){return l(!1),t.addClass(a+"_disabled"),this},this.destroy=function(){n.name&&d(!1)},this.bindRender=function(e,t){},this.val=function(e,i){return void 0===i&&(i=!0),void 0!==e&&n.value!==e&&(r(),i&&t.children("."+a+"_val").first().trigger("input")),n.value},this.onChange=function(){},this.toggle=function(e){return r(e=void 0===e),this},function(){var e;void 0===n&&(n={}),n.hasOwnProperty("data")&&!n.hasOwnProperty("value")&&(e=n.data[0].value),OGX.Data.merge(n,o),void 0!==e&&(n.value=e),(t=i.el).addClass(a+"_disabled");var r=t.parent();r[0].hasAttribute("data-value")&&(n.value=OGX.Data.stringToVal(r.data("value")),r.removeAttr("data-value"))}(),function(){var e="";n.labels&&(e+='<span class="'+a+'_label_on ogx_switch_label">'+n.data[0].label+"</span>");var i="";n.value===n.data[1].value&&(i=a+"_dot_right"),e+='<div class="'+a+'_track"><div class="'+a+'_track_bg"></div><div class="'+a+"_dot "+i+'"></div></div>',n.labels&&(e+='<span class="'+a+'_label_off ogx_switch_label">'+n.data[1].label+"</span>"),n.name&&(e+='<input class="'+a+'_val" type="hidden" name="'+n.name+'" value="'+n.value+'"></div>'),t.html(e),t.addClass(a)}(),setTimeout(s,0)},OGX.Switch.CHANGE="SwitchChange",OGX.Switch.BIND=OGX.Switch.CHANGE,require("Tabs","Uxi","Touch"),OGX.Tabs=function(e){construct(this,"Tabs");var t,i=this,n=e,o={detach:!1,detach_min:-4,add:!0,remove:!0,reorder:!0,icons:!1,icon_path:"",index:0,list:new OGX.List,display:{html:"",css:""},callbacks:{select:null,close:null,add:null,remove:null}},a=!1,r=0,s=!1,l=!1,c=!1,d=!1,u=!1,h={x:0,y:0},f="ogx_tabs";function _(){r>0?r--:r=0,i.index(r)}function g(e){var t=!1;return"string"==typeof n.list[e]?t=n.list[e]:n.list[e].hasOwnProperty("label")&&(t=n.list[e].label),t}function p(){for(var e,i,o='<div class="'+f+'_container">',s=0;s<n.list.length;s++)i=n.display.css(n.list[s]),s===r&&(i+=" ogx_tabs_tab_active"),e=g(s),n.list[s].hasOwnProperty("enabled")&&!n.list[s].enabled&&(i+=" "+f+"_tab_disabled"),o+='<div class="'+f+"_tab "+i+'">',n.icons&&(o+='<span class="'+f+'_tab_icon" style="background-image:url('+n.icon_path+n.list[s].icon+')"></span>'),e&&(o+='<span class="'+f+'_tab_label">'+e+"</span>"),n.remove?o+='<span class="'+f+'_tab_close"></span>':o+='<span class="'+f+'_tab_grad"></span>',o+="</div>",i="";o+="</div>",n.add&&(o+='<div class="'+f+'_tab_add"></div>',t.addClass(f+"_editable")),t.html(o),a=t.children("."+f+"_container").children("."+f+"_tab:eq("+r+")")}function m(e){s||(u=!1,l=$(e),r=l.index(),c={from:r},t.children("."+f+"_container").children("."+f+"_tab_active").first().removeClass(f+"_tab_active"),h.x=l.position().left,h.y=l.position().top,(s={el:$(e).clone(),x:h.x,y:l.position().top}).w=l.width(),s.el.width(s.w),l.addClass(f+"_tab_active").addClass(f+"_frozen"),a=l,s.el.addClass(f+"_tab_active").addClass(f+"_float").css("transform","translate3d("+h.x+"px, "+s.y+"px, 0px)"),t.children("."+f+"_container").prepend(s.el),t.trigger(OGX.Tabs.SELECT,[n.list[r],{index:r}]),d=setInterval(y,5))}function v(e){if(s)if(u=e,Math.abs(u.distX)>Math.abs(u.distY)){var o=s.x+u.distX;s.el.css("transform","translate3d("+o+"px, "+s.y+"px, 0px)")}else{var a=s.y+u.distY;s.el.css("transform","translate3d("+s.x+"px, "+a+"px, 0px)");var r=s.el.offset();if(u.distY<n.detach_min){c.to=l.index(),x();var d=n.list[c.from];i.removeAt(c.to),i.onRemove(d),t.trigger(OGX.Tabs.REMOVE,[d,{index:c.to,x:r.left,y:r.top}])}}}function y(){var e,i,n;s&&u&&(idx=l.index(),Math.abs(u.distX)>Math.abs(u.distY)&&t.children("."+f+"_container").children("."+f+"_tab").each((function(t,o){(e=$(o)).hasClass(f+"_tab_active")||(i=e.position(),n=e.width(),idx!==t&&(s.x+u.distX>i.left+n/2&&s.x+u.distX<i.left+n?(l.detach(),e.after(l)):s.x+u.distX>i.left&&s.x+u.distX<i.left+n/2&&(l.detach(),e.before(l))))})))}function x(){if(s&&(clearInterval(d),d=!1,u=!1,s.el.remove(),s=!1,l.removeClass(f+"_frozen"),c.to=l.index(),c.to!==c.from)){var e=n.list.splice(c.from,1);n.list.insert(e[0],c.to),r=c.to,i.el.trigger(OGX.Tabs.REORDER,c)}}function O(e){e?(t.on(i.touch.down,"."+f+"_tab",b),n.add&&t.on(i.touch.down,".ogx_tabs_tab_add",w),n.remove&&t.on(i.touch.down,"."+f+"_tab_close",G)):(t.off(i.touch.down,"."+f+"_tab",b),n.add&&t.off(i.touch.down,"."+f+"_tab_add",w),n.remove&&t.off(i.touch.down,"."+f+"_tab_close",G))}function b(e){var o=$(this);o.hasClass(f+"_tab_disabled")||(a&&a.removeClass(f+"_tab_active"),o.addClass(f+"_tab_active"),r!==(a=o).index()&&(r=a.index(),i.onSelect(n.list[r]),t.trigger(OGX.Tabs.SELECT,[n.list[r],{index:r}])))}function w(e){i.addTab({label:"New tab"}),t.trigger(OGX.Tabs.ADD)}function G(e){e.preventDefault(),e.stopImmediatePropagation();var o=n.list[r];return t.trigger(OGX.Tabs.REMOVE,[o,{index:r}]),i.onClose(o),i.removeCurrent(),!1}this.onFocus=function(){return O(!0),n.reorder&&this.touch.get("tabs_hold").enable(),this},this.onBlur=function(){return O(!1),n.reorder&&this.touch.get("tabs_hold").disable(),this},this.empty=function(){return this.clear(),r=0,a=null,n.list=new OGX.List,t.empty(),this},this.destroy=function(){this.touch.wipe()},this.val=function(e){if(void 0===e)return n.list[r];var t;"string"==typeof e?t=n.list.indexOf(e):e.hasOwnProperty("label")&&(t=(t=n.list.findIndex("label",e.label)).index),this.index(t)},this.set=function(e){return void 0===e?n.list:(e.hasOwnProperty("insert")||(e=new OGX.List(e)),n.list=e,setTimeout(p,0),this)},this.onSelect=function(){},this.onClose=function(){},this.onAdd=function(){},this.onRemove=function(){},this.icons=function(e){if(void 0===e)return n.icons;n.icons=e},this.add=function(e){return n.icons&&(e.hasOwnProperty("icon")||(e.icon=n.icon_default)),n.list.push(e),r=n.list.length-1,setTimeout((()=>{var e,i,n;p(),e=t.width(),i=t.children("."+f+"_container").first(),(n=i.width())>e&&i.css("transform","translateX("+-1*(n-e)+"px)")}),0),this},this.addAt=function(e,t){return n.icons&&(e.hasOwnProperty("icon")||(e.icon=n.icon_default)),n.list.insert(e,t),r=t,setTimeout(p,0),this},this.remove=function(e,i){void 0===i&&(i=e,e="label");var o=n.list.findIndex(e,i);n.list.findDelete(e,i,1)&&(t.children("."+f+"_container").first().children("."+f+"_tab:eq("+o.index+")").remove(),_())},this.removeCurrent=function(){return a&&this.removeAt(r),this},this.removeAt=function(e){return n.list.delete(e)&&(t.children("."+f+"_container").first().children("."+f+"_tab:eq("+e+")").remove(),_()),this},this.enableTab=function(e){return t.children("."+f+"_container").first().children("."+f+"_tab:eq("+e+")").removeClass(f+"_tab_disabled"),this},this.disableTab=function(e){return t.children("."+f+"_container").first().children("."+f+"_tab:eq("+e+")").addClass(f+"_tab_disabled"),this},this.index=function(e){return void 0!==e?(a&&(a.removeClass(f+"_tab_active"),a=null),(a=t.children("."+f+"_container").first().children("."+f+"_tab:eq("+e+")")).addClass(f+"_tab_active"),r=e,!0):a?r:-1},this.select=function(e){a&&a.removeClass(f+"_tab_active");var t=n.list.findIndex("label",e);return this.index(t.index),this},n||(n={}),OGX.Data.merge(n,o),n.list.hasOwnProperty("insert")||(n.list=new OGX.List(n.list)),n.display.hasOwnProperty("_NAME_")||(n.display=new OGX.Display(n.display)),n.callbacks.select&&(i.onSelect=n.callbacks.select),n.callbacks.close&&(i.onClose=n.callbacks.close),n.callbacks.add&&(i.onAdd=n.callbacks.add),n.callbacks.remove&&(i.onRemove=n.callbacks.remove),(t=i.el).addClass(f),(n.add||n.remove)&&t.addClass(f+"_editable"),r=n.index,setTimeout(p,0),n.reorder&&i.touch.add("Hold",{id:"tabs_hold",cb_hold:m,cb_move:v,cb_up:x,state:"manual",time:1e3,target:".ogx_tabs_tab",capture:!0})},OGX.Tabs.SELECT="TabsSelect",OGX.Tabs.REORDER="TabsReorder",OGX.Tabs.ADD="TabsAdded",OGX.Tabs.REMOVE="TabsRemoved",require("Tags","Uxi","Touch"),OGX.Tags=function(e){construct(this,"Tags");var t,i,n,o,a,r=this,s={max:0,displays:null,display:null,display_max:0,display_more:!1,min_length:0,search_min_length:3,add:!0,remove:!0,strict:!1,name:null,required:!1,lowercase:!1,restrict:!1,enabled:!0,placeholder:"Search",keycode:13,tags:[],current_tags:[],keys:{},callbacks:{input:null,select:null,change:null,add:null,remove:null}},l={id:"id",label:"label",value:"label"},c={html:'<span class="ogx_tag_content">{{$content}}</span>{{$remove}}',css:"ogx_tag"},d='<span class="ogx_tag_label">{{$label}}</span>',u={default:c,more:{html:null,css:"ogx_tag ogx_tag_more"}},h={bind:"type"},f=0;function _(e){e.sliced.length&&(e.insert(e.sliced),e.sliced=[])}function g(e){var i=$(this).parent().data("ogx-id"),s=t.findDelete(a.keys.id,i,1),l=t.val();a.max&&a.max>l.length&&n.removeClass("ogx_hidden"),a.name&&o.val(O(!0)),r.el.trigger(OGX.Tags.REMOVED,s[a.keys.label]),r.onRemove(s[a.keys.label]),x(),a.name&&o.trigger("change")}function p(e,s){if(a.display_more&&!s[a.keys.id]&&"more"===s.type)return i.findDelete(a.keys.id,0,1),void _(i);t.find(a.keys.id,s[a.keys.id],1)||(t.insert(s),a.name&&o.val(O(!0)),a.max&&a.max===t.val().length&&n.addClass("ogx_hidden"),r.el.trigger(OGX.Tags.ADDED,s[a.keys.label]),r.onAdd(s[a.keys.label]),x(),a.name&&o.trigger("change")),n.val(""),i.val([])}function m(e,s){void 0===s&&(s=!0);var l=n.val();if(!a.strict&&l.length>=a.min_length&&e.which===a.keycode&&a.add){if((d={})[a.keys.label]=l,t.val().get(d,null,1))return;f++;var c={};c[a.keys.label]=l,c[a.keys.value]=l,c[a.keys.id]="t"+f,t.insert(c),r.onAdd(c),x(),a.name&&o.trigger("change"),n.val(""),i.val([])}else if(l.length>=a.search_min_length){var d;(d={})[a.keys.label]={regex:new RegExp(l,"i")};var u=a.tags.get(d);i.val(y(u,i)),s&&r.onInput(l)}else i.val([])}function v(e,t){if(e=OGX.Data.clone(e),t&&(t.sliced={org:OGX.Data.clone(e),rem:[]},Array.isArray(e)&&a.display_max&&e.length>a.display_max&&(t.sliced=e.slice(a.display_max),e=e.slice(0,a.display_max)),a.display_more&&t.sliced.length)){var i={type:"more"};i[a.keys.id]=0,i[a.keys.label]=t.sliced.length+" more",e.push(i)}return new OGX.List(e)}function y(e,t){if(!e.length)return new OGX.List;if("object"==typeof e[0]){e.hasOwnProperty("insert")||(e=new OGX.List(e));for(var i=0;i<e.length;i++)e[i].hasOwnProperty(a.keys.id)||(e[i][a.keys.id]="t"+i);return v(e,t)}var n,o=new OGX.List;for(i=0;i<e.length;i++)(n={})[a.keys.id]="t"+i,n[a.keys.label]=e[i],n[a.keys.value]=e[i],o.push(n),f=i;return v(o,t)}function x(){var e=O();r.onChange(e),r.el.trigger(OGX.Tags.CHANGE,[e])}function O(e){void 0===e&&(e=!1);var i=t.val();if(!i.length)return 1===a.max?"":e?"[]":[];if(i=i.unique(a.keys.value,!1),a.lowercase)for(var n=0;n<i.length;n++)i[n]=i[n].toLowerCase();return a.max&&i.length&&(i=i.splice(0,a.max),1===a.max&&i.length&&(i=i[0])),e&&(a.max>1||!a.max)&&(i=JSON.stringify(i)),i}this.ux=function(e){a.add&&function(e){e?n.on("keyup",m):n.off("keyup",m)}(e),e?(t.el.on(OGX.DynamicList.SELECT,(function(e,i){if(a.display_more&&!i[a.keys.id])return t.findDelete(a.keys.id,0,1),void _(t);r.el.trigger(OGX.Tags.SELECT,i[a.keys.label]),r.onSelect(i[a.keys.label]),x(),a.name&&o.trigger("change")})),t.el.on(this.touch.down,".ogx_tag_remove",g),i.el.on(OGX.DynamicList.SELECT,p)):(t.el.off(OGX.DynamicList.SELECT),t.el.off(this.touch.down,".ogx_tag_remove",g),i.el.off(OGX.DynamicList.SELECT,p))},this.onFocus=function(){return a.add&&n.removeAttr("disabled"),a.name&&o.removeAttr("disabled"),this},this.onBlur=function(){return a.add&&n.prop("disabled",!0),a.name&&o.prop("disabled",!0),this},this.onSelect=function(){},this.onAdd=function(){},this.onRemove=function(){},this.onChange=function(){},this.onInput=function(){},this.val=function(e,i){if(void 0===i&&(i=!1),void 0===e)return i?r:O();if(e.length){var r=y(e,t);t.val(r),a.name&&o.val(O(!0))}else a.add&&n.removeClass("ogx_hidden"),a.name&&o.val("[]"),t.val(e);return this},this.tags=function(e){return void 0===e?a.tags:(a.tags=y(e,null),a.add&&m({},!1),this)},this.wipe=function(){return t.val([]),i.val([]),a.add?n.removeClass("ogx_hidden"):n.addClass("ogx_hidden"),this},this.destroy=function(){a.restrict&&OGX.Form.unrestrictField(r.selector+" .ogx_tags_input > input")},a=OGX.Data.merge(e,s),OGX.Data.merge(a.keys,l),a.tags.hasOwnProperty("insert")||(a.tags=new OGX.List(a.tags)),c.html=c.html.replace("{{$id}}","{{$"+a.keys.id+"}}"),c.html=c.html.replace("{{$label}}","{{$"+a.keys.label+"}}"),a.remove?c.html=c.html.replace("{{$remove}}",'<span class="ogx_tag_remove"></span>'):c.html=c.html.replace("{{$remove}}",""),a.displays&&OGX.Data.merge(u,a.displays),d=d.replace("{{$label}}","{{$"+a.keys.label+"}}"),u.more.html=d,a.display?c.html=c.html.replace("{{$content}}",a.display.html):c.html=c.html.replace("{{$content}}",d),u.default=c,a.callbacks.select&&(r.onSelect=a.callbacks.select),a.callbacks.add&&(r.onAdd=a.callbacks.add),a.callbacks.remove&&(r.onRemove=a.callbacks.remove),a.callbacks.remove&&(r.onChange=a.callbacks.change),a.callbacks.input&&(r.onInput=a.callbacks.input),function(){var e="",t="",i="";a.required&&(e="required"),a.name&&(t='name="'+a.name+'"'),a.enabled||(i="disabled");var s='<div class="ogx_tags_tags"></div>';if(a.add&&(s+='<div class="ogx_tags_input"><input type="text" placeholder="'+a.placeholder+'" '+i+"></div>"),s+='<div class="ogx_tags_sug"></div>',a.name&&(s+='<input class="ogx_tags_hidden" type="hidden" '+t+" "+e+" "+i+' data-ogx-type="json">'),r.el.html(s).addClass("ogx_tags"),a.add&&(n=r.el.find(".ogx_tags_input > input")),a.name&&(o=r.el.find('input[type="hidden"]')),a.restrict){var l={multiline:!1,max:30};"object"==typeof a.restrict&&(l=a.restrict),l.el=r.selector+" .ogx_tags_input > input",OGX.Form.restrictField(l)}}(),function(){t=r.create("DynamicList",{el:'.ogx_uxi[data-ogx-id="'+r.id+'"] > .ogx_tags_tags',mode:"hit",displays:u,display:h,key:a.keys.id}),i=r.create("DynamicList",{el:'.ogx_uxi[data-ogx-id="'+r.id+'"] > .ogx_tags_sug',mode:"hit",displays:u,display:h,key:a.keys.id});var e=y(a.current_tags,t);t.val(e),a.tags=y(a.tags,null),a.name&&o.val(O(!0))}()},OGX.Tags.CHANGE="TagsChange",OGX.Tags.SELECT="TagsSelect",OGX.Tags.ADDED="TagsAdded",OGX.Tags.REMOVED="TagsRemoved",OGX.Tags.BIND=OGX.Tags.CHANGE,OGX.Tasker=function(){"use strict";var e=0,t=null,i=new OGX.List,n=(Date.now(),!1);function o(e){for(var a=function(){var e=Date.now(),t=i.get({recurring:{gt:0}}),o=[];return t.forEach((t=>{(!t.last_run||e-t.last_run>=t.recurring)&&(t.blur_only?n&&o.push(t):o.push(t))})),i.get({recurring:0}).concat(o)}();(e.timeRemaining()>0||e.didTimeout)&&a.length;){var r=a.shift();r.recurring?(!r.last_run||Date.now()>=r.last_run+r.recurring)&&(r.method.apply(null,r.params),r.last_run=Date.now()):r.method.apply(null,r.params)}Date.now(),t=requestIdleCallback(o,{timeout:1e3})}this.add=function(n,a,r,s,l){void 0===n&&(n=++e),void 0===r&&(r=null),void 0===s&&(s=0),void 0===l&&(l=0);var c={id:n,method:a,params:r,recurring:s,last_run:0,blur_only:l};return i.insert(c),t||(t=requestIdleCallback(o,{timeout:1e3})),n},this.remove=function(e){if(!i.get({id:{eq:e}},null,1))return!1;i.findDelete("id",e,1)},$(document).on("visibilitychange",(function(){n="visible"!==document.visibilityState}))},OGX.Tasker=new OGX.Tasker,require("Template"),OGX.Template=function(e){construct(this,"Template");var t=new OGX.Display(e),i=t.html(e.data),n=t.css(e.data);i&&this.el.html(i),n&&this.el.addClass(n)},OGX.Templater=function(){"use strict";var e;this.jmake=function(e,t){for(var i,n,o=JSON.stringify(e);m=/({{(\$|#)[a-z0-9_\.]*}})|("{{(\$)}}")/gi.exec(o);)m[0].match(/"{{(\$)}}"/)?(i="<-"+(i=JSON.stringify(t)).substring(1).slice(0,-1)+"->",o=(o=(o=o.replace(m[0],i)).replace(/<\-/,"{")).replace(/\->/,"}")):("object"==typeof(n=OGX.OSE.exec(m[0],t))&&(n=JSON.stringify(n),m[0]='"'+m[0]+'"'),o=o.replace(m[0],n));return JSON.parse(o)},this.make=function(t,i,n,o,a){var r,s;for(e={},void 0===a&&(a={}),OGX.Data.merge(e,a);r=/{{[^{]+(({[^{]+)+)?}}/gi.exec(t);)void 0===(s=OGX.OSE.exec(r[0],i,n,o,e))&&(s=""),t=t.replace(r[0],s);return t},this.amake=function(e,t,i,n,o){for(var a="",r=0;r<t.length;r++)a+=this.make(e,t[r],i,n,o);return a},this.get=function(e){var t=OGX.Cache.read("html",e);return t||!1}},OGX.Templater=new OGX.Templater,require("Theater","Uxi","Touch"),OGX.Theater=function(e){construct(this,"Theater");var t,i,n,o=this,a=e,r={anim:!1,display:!0,icon_size:50,timeout:30},s={template:!1,html:'<span class="ogx_theater_stage_icon" style="background-image:url(\'{{$icon}}\')"></span><span class="ogx_theater_stage_label">{{$label}}</span>'},l='<div class="list"></div>',c=!0;function d(e){e?($(document).on("backbutton",u),$(window).on("popstate",u),list.el.on(OGX.DynamicList.SELECT,(function(e,t){!function(e){o.el.trigger(OGX.Theater.HIDE);var t=OGX.Core.find("Stage",e);t.wake(),t.resizeNodes();var n,r=list.el.find('.ogx_theater_stage[data-ogx-id="'+t.id+'"]').position();o.observe(!0,{childList:!0},(function(){o.observe(!1),(n=i.children(".ogx_theater_trans")).on("transitionend",(function(){n.off("transitionend"),o.hide(),n.remove(),t.url?(OGX.Core.showStage(t.id,!1),OGX.Core.router.addToHist(t.url)):OGX.Core.goto(t.id+"/"+t.home)})),n.removeClass("ogx_theater_trans_hide"),setTimeout((()=>{n.addClass("ogx_theater_trans_grow").css({opacity:1,width:"100%",height:"100%",transform:"translate3d(0px, 0px, 0px)"})}),a.timeout)}),null,i),i.append('<div class="ogx_theater_trans ogx_theater_trans_hide" style="width:'+a.icon_size+"px; height:"+a.icon_size+"px; transform:translate3d("+r.left+"px,"+r.top+'px, 0px);" data-ogx-id="'+t.id+'"><div class="icon" style="background-image:url(\'/img/'+t.theater.icon+"')\"></div></div>")}(t.id)}))):($(document).off("backbutton",u),$(window).off("popstate",u),list.el.off(OGX.DynamicList.SELECT))}function u(){o.hide()}function h(){t.prepend(l);for(var e,i=[],r=0;r<n.length;r++)e={id:n[r].id,name:"",icon:""},"object"==typeof n[r].theater&&n[r].theater.hasOwnProperty("icon")&&(e.icon="./img/"+n[r].theater.icon,e.label=n[r].theater.label),i.push(e);$(".ogx_theater > .list").on(OGX.DynamicList.RENDER,(function(e){$(".ogx_theater > .list").off(OGX.DynamicList.RENDER),setTimeout((()=>{l=$(".ogx_theater").detach()}),0)})),list=o.create("DynamicList",{el:".ogx_theater > .list",display:{html:a.display.html,css:"ogx_theater_stage"},key:"id",scroll:!0,mode:"hit",list:i,trigger:!0})}function f(){var e=OGX.Core.gather(OGX.Stage.NAME);n=[];for(var t=0;t<e.length;t++)e[t].theater&&n.push(e[t])}this.update=function(){f()},this.show=function(){return c&&(i.prepend(l),function(){o.el.trigger(OGX.Theater.SHOW);var e,n=OGX.Core.getStage();o.observe(!0,{childList:!0},(function(t){o.observe(!1),n.sleep(),e=i.children(".ogx_theater_trans");var r=list.el.find('.ogx_theater_stage[data-ogx-id="'+n.id+'"]').position();e.removeClass("ogx_theater_trans_hide"),setTimeout((()=>{e.on("transitionend",(function(){e.off("transitionend"),setTimeout((()=>{e.remove()}),0)})),e.addClass("ogx_theater_trans_show").addClass("ogx_theater_trans_shrink").css({opacity:0,width:a.icon_size+"px",height:a.icon_size+"px",transform:"translate3d("+r.left+"px, "+r.top+"px, 0px)"})}),a.timeout)}),null,i),i.append('<div class="ogx_theater_trans ogx_theater_trans_hide" data-ogx-id="'+n.id+'"><div class="icon" style="background-image:url(\'/img/'+n.theater.icon+"')\"></div></div>"),t.css("visibility","visible")}(),this.focusNodes(),d(!0),c=!1),this},this.hide=function(){return c||(this.blurNodes(),l=t.detach(),d(!1),c=!0),this},this.tile=function(e,t){void 0===t&&(t="x")},OGX.Data.merge(a,r),a.display&&("object"!=typeof a.display&&(a.display={}),OGX.Data.merge(a.display,s),a.display.template&&(a.display.html=OGX.Templater.get(a.display.template))),(t=o.el).addClass("ogx_theater").css("visibility","hidden"),i=$("body"),f(),$(document).on(OGX.App.READY,h)},OGX.Theater.ZOOM="TheaterZoom",OGX.Theater.SHOW="TheaterShow",OGX.Theater.HIDE="TheaterHide",OGX.Touch=function(e){"use strict";var t=this,i=0;this.touch=!1,this.touch||this.initTouch(e.chromeos);var n=new OGX.List;this.touch.add=function(e,o){var a=new OGX.Touches[e](t),r=a.set(o);return!r.hasOwnProperty("id")&&(r.id=i++),a.id=r.id,"auto"===r.state&&!t.blured&&t.enabled&&a.onFocus(),n.insert(a),a},this.touch.remove=function(e){"object"==typeof e&&(e=e.id),n.findDelete("id",e,1).disable()},this.touch.get=function(e){return n.get({id:{eq:e}},null,1)},this.touch.wipe=function(){for(var e=0;e<n.length;e++)n[e].disable();n.clear()},this.touch.isRightClick=function(e){var i=t.event(e),n=!1;return i.which?n=3===i.which:i.button&&(n=2===i.button),n},this.touch.enable=function(){for(var e=n.get({state:{eq:"manual"}}),t=0;t<e.length;t++)e[t].enable()},this.touch.disable=function(){for(var e=n.get({state:{eq:"manual"}}),t=0;t<e.length;t++)e[t].disable()}},OGX.Touch.prototype.initTouch=function(e){void 0===e&&(e=!1),this.touch={hold:{}},this.touch.click="click",this.touch.dclick="dblclick",this.touch.down="mousedown",this.touch.up="mouseup",this.touch.move="mousemove",this.touch.enter="mouseenter",this.touch.leave="mouseleave",this.touch.over="mouseover",this.touch.out="mouseout",void 0===window.ontouchstart||e||(this.touch.down="touchstart",this.touch.up="touchend",this.touch.move="touchmove")},OGX.Touch.prototype.touchable=function(){return void 0!==window.ontouchstart},OGX.Touch.prototype.event=function(e){return e.hasOwnProperty("originalEvent")&&void 0!==e.originalEvent.changedTouches?e.originalEvent.changedTouches[0]:e},OGX.Touches={},OGX.Touches.Double=function(e){"use strict";var t,i=this,n=e,o={delay:180,target:!1,capture:!1,cb_down:null,cb:!1,state:"auto"},a=!1,r=!1,s=!0,l=$("body"),c=null,d=null,u=0;function h(){s&&i.onFocus(),n.focus(),c&&c()}function f(){s&&i.onBlur(),n.blur(),d&&d()}function _(e){e?l.on(n.touch.down,t,g):l.off(n.touch.down,t,g)}function g(e){a.capture&&e.cancelable&&(e.preventDefault(),e.stopImmediatePropagation());var t=(new Date).getTime();return!u||t-u>a.delay?(u=(new Date).getTime(),void(a.cb_down&&a.cb_down())):t-u<=a.delay?(u=0,void(a.cb&&a.cb())):(u=t,void(a.cb_down&&a.cb_down()))}this.set=function(e){return a=e,OGX.Data.merge(a,o),t=n.selector,this.state=a.state,a.target&&(t=a.target),"auto"===a.state?(c=n.onFocus,d=n.onBlur,n.onFocus=h,n.onBlur=f):s=!1,a},this.onFocus=function(){!r&&a&&(r=!0,_(!0))},this.onBlur=function(){r&&(r=!1,_(!1))},this.enable=function(){s||(s=!0,this.onFocus())},this.disable=function(){s&&(s=!1,this.onBlur())}},OGX.Touches.Swipe=function(e){"use strict";var t,i=this,n=e,o={speed:10,x:!0,y:!1,min_x:100,min_y:100,cb_down:!1,cb_swipe:!1,cb_up:!1,target:!1,capture:!1,state:"auto"},a=!1,r={x:0,y:0},s={x:0,y:0},l=0,c=0,d=0,u=0,h=0,f=!1,_=!1,g=!0,p=!1,m=null,v=null,y=$("body"),x=!1;function O(){g&&i.onFocus(),n.focus(),m&&m()}function b(){g&&i.onBlur(),n.blur(),v&&v()}function w(e){x=!0,a.capture&&e.cancelable&&(e.preventDefault(),e.stopImmediatePropagation()),p||(p=!0,e=n.event(e),r.x=e.pageX,r.y=e.pageY,r.target=e.target,d=u=0,l=c=h=0,G(!0),a.cb_down&&a.cb_down(r))}function G(e){e?(X(!0),f=setInterval(k,a.speed)):(X(!1),f&&(clearInterval(f),f=!1))}function X(e){e?$(t).on(n.touch.move,E):$(t).off(n.touch.move,E)}function C(e){e?(y.on(n.touch.up,D),y.on(n.touch.down,t,w)):(y.off(n.touch.up,D),y.off(n.touch.down,t,w))}function D(e,t){x&&(x=!1,a.capture&&e&&e.cancelable&&(e.preventDefault(),e.stopImmediatePropagation()),_&&(void 0===t&&(t=!1),G(!1),p&&a.cb_up&&a.cb_up({pt0:r,pt1:s,distX:d,distY:u,dist:h,dirX:l,dirY:c,swipe:t}),p=!1))}function E(e){a.capture&&e.cancelable&&(e.preventDefault(),e.stopImmediatePropagation()),e=n.event(e),s.x=e.pageX,s.y=e.pageY,l=s.x>r.x?1:-1,c=s.y>r.y?1:-1,d=Math.abs(s.x-r.x),u=Math.abs(s.y-r.y),h=Math.sqrt(Math.abs(Math.pow(s.x-r.x,2)-Math.pow(s.y-r.y,2)))}function k(){a.cb_swipe&&(a.x&&a.min_x&&d>=a.min_x||a.y&&a.min_y&&u>=a.min_y?D(null,!0):a.cb_swipe({pt0:r,pt1:s,dirX:l,dirY:c,distX:d,distY:u,dist:h}))}this.set=function(e){return a=e,OGX.Data.merge(a,o),t=n.selector,this.state=a.state,"auto"===a.state?(m=n.onFocus,v=n.onBlur,n.onFocus=O,n.onBlur=b):g=!1,a.target&&(t=a.target),a},this.onFocus=function(){!_&&a&&(_=!0,C(!0))},this.onBlur=function(){_&&(_=!1,C(!1),G(!1))},this.enable=function(){g||(g=!0,this.onFocus())},this.disable=function(){g&&(g=!1,this.onBlur())}},OGX.Touches.Hold=function(e){"use strict";var t=this,i={cb_hold:!1,cb_up:!1,cb_move:!1,time:1e3,el:this.el,target:!1,capture:!1,parent:null,state:"auto"},n=!1,o=!1,a=!1,r=!1,s=!1,l=!1,c=!0,d=e,u={x:0,y:0},h={x:0,y:0},f={x:0,y:0},_={x:0,y:0},g=null,p=null,m=null,v=$("body");function y(){c&&t.onFocus(),d.focus(),p&&p()}function x(){c&&t.onBlur(),d.blur(),m&&m()}function O(e){var t=[];e?n.parent?n.parent.on.apply(n.parent,[d.touch.down,b]):(t=n.target?[d.touch.down,n.target,b]:[d.touch.down,b],d.el.on.apply(d.el,t)):n.parent?n.parent.off.apply(n.parent,[d.touch.down,b]):(t=n.target?[d.touch.down,n.target,b]:[d.touch.down,b],d.el.off.apply(d.el,t))}function b(e){n.capture&&e.cancelable&&(e.preventDefault(),e.stopImmediatePropagation()),e=d.event(e),g=e.target,r||(r=!0,o=(new Date).getTime(),_.x=u.x=e.pageX,_.y=u.y=e.pageY,a=setInterval(G,1))}function w(e){n.capture&&e.cancelable&&(e.preventDefault(),e.stopImmediatePropagation()),e=d.event(e),h.x=e.pageX,h.y=e.pageY,h.x<_.x?f.x=-1:f.x=1,h.y<_.y?f.y=-1:f.y=1,0===h.x&&(f.x=0),0===h.y&&(f.y=0),_.x=h.x,_.y=h.y,s?n.cb_move&&n.cb_move({x:h.x,y:h.y,distX:h.x-u.x,distY:h.y-u.y,dirX:f.x,dirY:f.y}):(Math.abs(u.x-h.x)>5||Math.abs(u.y-h.y)>5)&&(clearInterval(a),a=!1)}function G(){r&&(new Date).getTime()-o>n.time&&(s||(s=!0,v.on(d.touch.move,w),n.cb_hold?n.cb_hold(g,u):d.el.trigger(OGX.Touch.HOLD_START)))}function X(t){t=e.event(t),r=!1,clearInterval(a),a=!1,s&&(s=!1,v.off(d.touch.move,w),n.cb_up?n.cb_up({x:t.pageX,y:t.pageY}):d.el.trigger(OGX.Touch.HOLD_END,{x:t.pageX,y:t.pageY}))}this.set=function(e){return n=e,OGX.Data.merge(n,i),d.selector,this.state=n.state,"auto"===n.state?(p=d.onFocus,m=d.onBlur,d.onFocus=y,d.onBlur=x):c=!1,n.target&&n.target,n},this.onFocus=function(){!l&&n&&(l=!0,O(!0),v.on(d.touch.up,X))},this.onBlur=function(){l&&(l=!1,(r||a)&&(s=!1,r=!1,clearInterval(a),a=!1),O(!1),v.off(d.touch.up,X),v.off(d.touch.move,w))},this.enable=function(){c||(c=!0,this.onFocus())},this.disable=function(){c&&(c=!1,this.onBlur())}},OGX.Touches.Drag=function(e){"use strict";var t,i,n,o,a,r,s=this,l=!1,c={min:10,x:!0,y:!0,limit_x:null,limit_y:null,target:!1,cb_down:!1,cb_drag:!1,cb_up:!1,border:10,capture:!1,parent:null,state:"auto"},d=e,u=!1,h=!1,f=!0,_=null,g=null,p=$("body"),m=null,v=!1;function y(){f&&s.onFocus(),d.focus(),_&&_(),s.onFocus()}function x(){f&&s.onBlur(),d.blur(),g&&g()}function O(e){var t=[];e?l.parent?l.parent.on.apply(l.parent,[d.touch.down,b]):(t=l.target?[d.touch.down,l.target,b]:[d.touch.down,b],d.el.on.apply(d.el,t)):l.parent?l.parent.off.apply(l.parent,[d.touch.down,b]):(t=l.target?[d.touch.down,l.target,b]:[d.touch.down,b],d.el.off.apply(d.el,t))}function b(s){v=!0,l.capture&&s.cancelable&&(s.preventDefault(),s.stopImmediatePropagation()),s=e.event(s),m=OGX.Data.get2DTransform(d.el[0]),n=s.pageX,o=s.pageY;var c=d.el.position();t=c.left,i=c.top;var u=d.el.offset(),h=n-u.left,f=o-u.top;if(l.border){if(h<l.border||h>d.el.width()-l.border)return;if(f<l.border||f>d.el.height()-l.border)return}a=0,r=0,w(!0),G(!0),l.cb_down&&l.cb_down({x:n,y:o,target:s.target})}function w(e){e?u||(u=setInterval(D,10)):u&&(clearInterval(u),u=null)}function G(e){e?(p.on(d.touch.move,C),p.on(d.touch.up,X)):(p.off(d.touch.move,C),p.off(d.touch.up,X))}function X(t){v&&(v=!1,w(!1),G(!1),t=e.event(t),l.x&&(a=t.pageX-n),l.y&&(r=t.pageY-o),l.cb_up&&l.cb_up({distX:a,distY:r}))}function C(t){l.capture&&t.cancelable&&(t.preventDefault(),t.stopImmediatePropagation()),t=e.event(t);var i,s=!1;l.x&&(i=t.pageX-n,null!==l.limit_x?i>=l.limit_x.min&&i<=l.limit_x.max&&(l.min?Math.abs(i)>l.min&&(a=i,s=!0):(a=i,s=!0)):l.min?Math.abs(i)>l.min&&(a=i,s=!0):a=i),l.y&&(i=t.pageY-o,null!==l.limit_y?i>=l.limit_y.min&&i<=l.limit_y.max&&(l.min?Math.abs(i)>l.min&&(r=i,s=!0):(r=i,s=!0)):r=i),s&&l.cb_drag&&l.cb_drag({distX:a,distY:r,x:t.pageX,y:t.pageY})}function D(){var e,n;e=n=0,(a||r)&&(l.x&&(e=t+a),l.y&&(n=i+r),d.el.css("transform","translate3d("+e+"px, "+n+"px, 0) rotate("+m.r+"deg)"))}this.dragable=!0,this.set=function(e){return l=e,OGX.Data.merge(l,c),"auto"===l.state?(_=d.onFocus,g=d.onBlur,d.onFocus=y,d.onBlur=x):f=!1,this.state=l.state,l},this.onFocus=function(){!h&&l&&(h=!0,O(!0))},this.onBlur=function(){h&&(h=!1,O(!1),G(!1),w(!1))},this.enable=function(){f||(f=!0,this.onFocus())},this.disable=function(){f&&(f=!1,this.onBlur())}},OGX.Touches.Move=function(e){"use strict";var t,i,n,o,a,r,s,l,c,d,u=this,h=!1,f={min:0,x:!0,y:!0,limit_x:null,limit_y:null,target:null,cb_down:null,cb_move:null,cb_up:null,cb_click:null,capture:!1,parent:null,state:"auto"},_=e,g=!1,p=!0,m=null,v=null,y=$("body");function x(){p&&u.onFocus(),_.focus(),m&&m()}function O(){u.onBlur(),_.blur(),v&&v()}function b(e){var t=[];e?h.parent?h.parent.on.apply(h.parent,[_.touch.down,w]):(t=h.target?[_.touch.down,h.target,w]:[_.touch.down,w],_.el.on.apply(_.el,t)):h.parent?h.parent.off.apply(h.parent,[_.touch.down,w]):(t=h.target?[_.touch.down,h.target,w]:[_.touch.down,w],_.el.off.apply(_.el,t))}function w(c){h.capture&&c.cancelable&&(c.preventDefault(),c.stopImmediatePropagation()),c=e.event(c),t=c.pageX,i=c.pageY,n=0,o=0,a=0,r=0,s=0,l=0,G(!0),h.cb_down&&h.cb_down({target:c.target,x:t,y:i})}function G(e){e?(y.on(_.touch.move,C),y.on(_.touch.up,X)):(y.off(_.touch.move,C),y.off(_.touch.up,X))}function X(s){if(h.capture&&s.cancelable&&(s.preventDefault(),s.stopImmediatePropagation()),G(!1),s=e.event(s),h.x&&(n=s.pageX-t),h.y&&(o=s.pageY-i),h.cb_up&&h.cb_up({x:s.pageX,y:s.pageY,distX:n,distY:o,dirX:a,dirY:r}),h.cb_click){var l=!1;h.x&&Math.abs(n)<2&&(l=!0),h.y&&Math.abs(o)<2&&(l=!0),l&&h.cb_click(s)}}function C(u){h.capture&&u.cancelable&&(u.preventDefault(),u.stopImmediatePropagation()),u=e.event(u);var f,_=!1;c=Math.abs(s-u.pageX),d=Math.abs(l-u.pageY),h.x&&(a=0,s||(s=u.pageX),s<u.pageX?a=1:s>u.pageX&&(a=-1),s=u.pageX,f=u.pageX-t,null!==h.limit_x?f>=h.limit_x.min&&f<=h.limit_x.max&&(h.min?Math.abs(f)>h.min&&(n=f,_=!0):(n=f,_=!0)):h.min?Math.abs(f)>h.min&&(n=f,_=!0):(n=f,_=!0)),h.y&&(r=0,l||(l=u.pageY),l<u.pageY?r=1:l>u.pageY&&(r=-1),l=u.pageY,f=u.pageY-i,null!==h.limit_y?f>=h.limit_y.min&&f<=h.limit_y.max&&(h.min?Math.abs(f)>h.min&&(o=f,_=!0):(o=f,_=!0)):(o=f,_=!0)),_&&h.cb_move&&h.cb_move({distX:n,distY:o,dirX:a,dirY:r,stepX:c,stepY:d,x:u.pageX,y:u.pageY})}this.set=function(e){return h=e,OGX.Data.merge(h,f),"auto"===h.state?(m=_.onFocus,v=_.onBlur,_.onFocus=x,_.onBlur=O):p=!1,this.state=h.state,h},this.onFocus=function(){!g&&h&&(g=!0,b(!0))},this.onBlur=function(){g&&(g=!1,b(!1),G(!1))},this.enable=function(){p||(p=!0,this.onFocus())},this.disable=function(){p&&(p=!1,this.onBlur())}},OGX.Touch.HOLD_START="TouchHoldStart",OGX.Touch.HOLD_END="TouchHoldEnd",require("Tree","Uxi","Touch"),OGX.Tree=function(e){construct(this,"Tree");var t,i,n,o,a,r,s,l,c=this,d='<span class="ogx_tree_item_icon"></span><span class="ogx_tree_item_label">{{$label}}</span>',u=e,h={show_root:!0,root_label:"root",editable:!1,sort:{enabled:!0,property:"label",way:1},type:"type",toggle:!0,drag_after:1e3,key:null,scope:["public"],chromeos:!1,types:{root:{mode:"folder",display:{html:d}},file:{mode:"file",display:{html:d}},folder:{mode:"folder",display:{html:d}}},data:{_id:0,type:"root",state:"closed",label:null,items:[]},display:null,callbacks:{select:null,unselect:null,open:null,close:null,move:null}},f="_id",_=1;function g(e){return"root"===e.type?"":M(p,e)}function p(e,t,i,n,o){return e[f]===o[f]&&t}function m(e,t){var i={container_display:"",container_css:"",arrow_display:"",arrow_style:"ogx_tree_item_arrow_open",state:"open",type:t.type};return i[f]=t[f],OGX.Data.merge(i,e,!0),OGX.Templater.make('<div class="ogx_tree_item" data-id="{{$_id}}" data-state="{{$state}}" data-type="{{$type}}" data-compound="{{$type}}-{{$state}}" data-children="{{!$empty}}"><div class="ogx_tree_item_arrow {{$arrow_style}} {{$arrow_display}}"><span></span></div><div class="ogx_tree_item_content"></div><div class="ogx_tree_item_container {{$container_display}} {{$container_css}}"></div></div>',i)}function v(){var e=m({},u.data);t.html(e),u.data.element=t.children(".ogx_tree_item").first(),u.data.uxi=c,b(u.data,c),u.show_root||u.data.element.addClass("ogx_tree_root_hidden")}function y(){v(),x(u.data,c)}function x(e,t){if(e.parent=t,e.hasOwnProperty("items")){var i,n;!e.items.hasOwnProperty("insert")&&(e.items=new OGX.List(e.items)),u.sort.enabled&&e.items.order(u.sort.property,u.sort.way),e.element.children(".ogx_tree_item_container").first().empty();for(var o=0;o<e.items.length;o++)n=t,i=N(e.items[o]),O(e.element.children(".ogx_tree_item_container").first(),e.items[o]),b(e.items[o],t),i.display.hasOML()&&(n=t.nodes.last()),x(e.items[o],n)}}function O(e,t){var i=N(t),n={_id:t[f],container_display:"",arrow_display:"",arrow_style:"",state:"open"};t.hasOwnProperty("state")&&(n.state=t.state),t.state=n.state,"folder"===i.mode?(t.hasOwnProperty("items")&&t.items.length?n.empty=!!t.items.length:(n.state="closed",n.arrow_style="ogx_tree_item_arrow_disabled",n.empty=!0),"open"===n.state?n.arrow_style="ogx_tree_item_arrow_open":(n.arrow_style+=" ogx_tree_item_arrow_close",n.container_display="ogx_tree_item_container_hidden",n.state="closed")):n.arrow_display="ogx_tree_item_arrow_hidden";var o=m(n,t);e.append(o),t.element=e.children().last()}function b(e,t){var i=N(e),n='.ogx_tree[data-ogx-id="'+c.id+'"] .ogx_tree_item[data-id="'+e[f]+'"] > .ogx_tree_item_content';if(i.display.hasOML()){var o=i.display.oml(n,e,!1);OGX.OML.render(t,o,e),e.uxi=t.nodes.last()}else{var a=i.display.html(e);a=OGX.Templater.make(a,e),$(n).html(a)}}function w(e){return delete e.element,delete e.parent,delete e.uxi,delete e.state,l||delete e[f],!1}function G(e){"folder"===N(e).mode&&(e.items.length?e.element.attr("data-empty",!1):(e.element.attr("data-state","closed").attr("data-compound",e.type+"-closed").attr("data-empty",!0),e.element.children(".ogx_tree_item_arrow").addClass("ogx_tree_item_arrow_disabled")),"open"===e.state?(e.element.attr("data-state","open").attr("data-compound",e.type+"-open"),e.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_close").removeClass("ogx_tree_item_arrow_disabled").addClass("ogx_tree_item_arrow_open"),e.element.children(".ogx_tree_item_container").removeClass("ogx_tree_item_container_hidden")):(e.element.attr("data-state","open").attr("data-compound",e.type+"-closed"),e.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_open").addClass("ogx_tree_item_arrow_close"),e.element.children(".ogx_tree_item_container").addClass("ogx_tree_item_container_hidden")))}function X(){if(s){var e=S(s);e&&e.children(".ogx_tree_item_content").removeClass("ogx_tree_selected_item"),s=null}}function C(){return!!s&&k(s)}function D(e){X();var t=S(e);t&&(s=e,t.children(".ogx_tree_item_content").addClass("ogx_tree_selected_item"))}function E(e,t){return M((function(i){return i[f]===t&&(i.hasOwnProperty("items")||(i.items=new OGX.List),!i.items.hasOwnProperty("insert")&&(i.items=new OGX.List(i.items)),i.items.push(e),i.state="open",G(i),!0)}))}function k(e){if(!e||"root"===e)return u.data;return M((function(t,i){return t[f]===e&&t}))}function S(e){var t=k(e);return!!t&&t.element}function T(e){return!(!e.hasOwnProperty("uxi")||!e.uxi)&&(e.uxi.kill(),delete e.uxi,!1)}function L(){return M((function(e){return e.hasOwnProperty(f)||(_++,e[f]=_),e.hasOwnProperty("type")||(e.hasOwnProperty("items")?e.type="folder":e.type="file"),!1}))}function M(e,t,i,n){var o;return void 0===t&&(t=null),void 0===i&&(i=u.data),void 0===n&&(n=!1),(o=function i(a,r,s,l){if(!n&&(o=e(a,r,s,l,t)))return o;if(a.hasOwnProperty("items")&&a.items.length)for(var c=0;c<a.items.length;c++)if(o=i(a.items[c],r+"/"+a[f],a,c))return o;return!1}(i,""))||i}function N(e){return!!u.types.hasOwnProperty(e.type)&&u.types[e.type]}function A(e){var i,n,o=e.data("id");n=g(i=k(o)),u.toggle?e.children(".ogx_tree_item_content").hasClass("ogx_tree_selected_item")?X():(X(),e.children(".ogx_tree_item_content").addClass("ogx_tree_selected_item"),s=o):(X(),s=o,e.children(".ogx_tree_item_content").addClass("ogx_tree_selected_item")),c.onSelect({path:n,item:i}),t.trigger(OGX.Tree.SELECT,{path:n,item:i})}function I(e){e?(u.editable?(t.on(c.touch.down,".ogx_tree_item > .ogx_tree_item_content",(function(e){e.preventDefault(),A($(this).parent(0)),1!==$(this).parent(0).data("id")&&function(){a&&clearInterval(a);r=(new Date).getTime(),a=setInterval(R,50)}()})),$(document).on(c.touch.up,(function(){var e,a,r,s,l,d,u,h,_,g,p;P(),n&&(Y(!1),e=n.offset().left,a=n.offset().top,l=e,d=a,r=M((function(e,t){return u=e.element.offset(),h=e.element.children(".ogx_tree_item_content").children(".ogx_tree_item_icon"),l>=u.left&&l<=u.left+h.width()&&d>=u.top&&d<=u.top+h.height()&&e})),s=N(r),!r||r&&(r[f]===i[f]||"folder"!==s.mode)?(o.css("opacity",1),n.remove(),n=null,i=null):(g=r,p=(_=i)[f],M((function(e,t,i,n){return e[f]===p&&(i.items.splice(n,1),i.items.length||(i.state="closed"),G(i),!0)})),E(_,g[f]),g.element.children(".ogx_tree_item_container").empty(),g.state="open",x(g,g.element),G(g),o.remove(),n.remove(),n=null,c.onMove(i),t.trigger(OGX.Tree.DROP,i),i=null))}))):t.on("click",".ogx_tree_item > .ogx_tree_item_content",(function(e){A($(this).parent(0))})),t.on(c.touch.down,".ogx_tree_item_arrow",(function(e){e.preventDefault(),P();var i=k($(this).parent(0).data("id"));i&&i.hasOwnProperty("items")&&i.items.length&&("open"===i.state?(c.onClose(i),t.trigger(OGX.Tree.CLOSE,i)):(c.onOpen(i),t.trigger(OGX.Tree.OPEN,i)),"open"===i.state?i.state="closed":i.state="open",G(i))}))):(u.editable?t.off(c.touch.down,".ogx_tree_item > .ogx_tree_item_content"):t.off("click",".ogx_tree_item > .ogx_tree_item_content"),t.off(c.touch.down,".ogx_tree_item_arrow"))}function R(){var e;(new Date).getTime()-r>=u.drag_after&&(s&&(i=k(s))&&(e=i.element,o=e,(n=e.clone()).children(".ogx_tree_item_arrow").css("display","none"),e.css("opacity",.3),n.addClass("ogx_tree_item_drag"),n.css({top:e.offset().top,left:e.offset().left}),t.prepend(n),Y(!0),t.trigger(OGX.Tree.DRAG,i)),P())}function Y(e){e?$(document).on(c.touch.move,(function(e){e=function(e){if(e.hasOwnProperty("originalEvent")&&void 0!==e.originalEvent.changedTouches)return e.originalEvent.changedTouches[0];return e}(e),n.css({top:e.pageY+"px",left:e.pageX+"px"})})):$(document).off(c.touch.move)}function P(){a&&(clearInterval(a),a=null)}this.onFocus=function(){return I(!0),this},this.onBlur=function(){return I(!1),this},this.onSelect=function(){},this.onUnselect=function(){},this.onOpen=function(){},this.onClose=function(){},this.onMove=function(){},this.addItem=function(e,t,i){if(void 0===i&&(i=!0),void 0===t&&(t=s),t){var n;n=Array.isArray(e)?e:[e];var o=k(t);if("folder"===N(o).mode)return n.forEach((e=>{l||(_++,e[f]=_),e.hasOwnProperty("items")||(e.items=[]),X(),E(e,t),M(T,null,o,!0),x(o,o.parent),o.element.data("state","open"),o.element.data("compound",e.type+"-close"),o.element.children(".ogx_tree_item_container").removeClass("ogx_tree_item_container_hidden"),o.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_disabled ogx_tree_item_arrow_close").addClass("ogx_tree_item_arrow_open")})),1!==n.length||c.selectItem(e[f],i)}return!1},this.test=function(){return u.data},this.getItem=function(e,t){void 0===t&&(t=!1);var i,n,o=k(e);return!!o&&(t?(i=o,w(n={...i}),n):o)},this.getItemByPath=function(e){var t=e.split("/"),i=t.pop();return t=t.join("/"),M((function(e,n){return n===t&&i===e[f]&&e}))},this.selectItem=function(e,t){void 0===t&&(t=!1),D(e);var i=C();return t&&this.el.trigger(OGX.Tree.SELECT,{item:i,path:g(i)}),i},this.selectItemByPropVal=function(e,t,i){void 0===i&&(i=!1);var n=function(e,t){function i(i,n){return!(!i.data.hasOwnProperty(e)||i.data[e]!==t)&&n+"/"+i.label}return M(i)}(e,t);return!!n&&(X(),D(n[f]),n=C(),i&&this.el.trigger(OGX.Tree.SELECT,{item:n,path:g(n)}),n)},this.selectItemByPath=function(e,t){var i=function(e){function t(t,i){return e===i+"/"+t[f]&&t.element}return M(t)}(e);if(i){X(),i.children(".ogx_tree_item_content").addClass("ogx_tree_selected_item"),s=i.data("id");var n=C();return t&&this.el.trigger(OGX.Tree.SELECT,{item:n,path:g(n)}),n}return!1},this.updateItem=function(e,t,i){void 0===i&&(i=!0);var n=k(e);if(n){if(n.uxi){var o=n.uxi.el;n.uxi.kill(),o.empty()}else i&&n.element.children(".ogx_tree_item_container").empty();OGX.Data.merge(n,t,!0),i&&!l&&L(),b(n,n.parent),i&&n.hasOwnProperty("items")&&n.items.length&&(x(n,n.parent),n.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_disabled ogx_tree_item_arrow_close").addClass("ogx_tree_item_arrow_open"),n.element.attr("state","open").attr("state",n.type+"-open"),n.element.children(".ogx_tree_item_container").removeClass("ogx_tree_item_container_hidden"))}},this.replaceItem=function(e){var t=k(e[f]);t&&(M(T,null,t,!0),t.uxi&&t.uxi.kill(),OGX.Data.merge(e,t,!1),b(t,t.parent),t.hasOwnProperty("items")&&t.items.length&&x(t,t.parent))},this.deleteItem=function(e){var t=k(e);if(t){var i=function(e){function t(t){return!(!t.hasOwnProperty("items")||!t.items.get({_id:{eq:e}},null,1))&&t}return M(t)}(e);return M(T,null,t,!0),t.uxi&&t.uxi.kill(),i.items.findDelete("_id",e,1),t.element.remove(),i.items.length||(i.state="closed"),G(i),t}return!1},this.openItem=function(e){var t=k(e);return!!t&&("closed"===t.state&&t.items.length&&(t.state="open",G(t)),t)},this.closeItem=function(e){var t=k(e);return!!t&&("open"===t.state&&(t.state="closed",G(t)),t)},this.deleteSelectedItem=function(){return function(){function e(e,t,i,n){if(e[f]===s)return e.element.remove(),i.items.splice(n,1),i.items.length||(i.state="closed"),G(i),!0}if(s)return M(e);return!1}()},this.getSelectedItem=function(){return C()},this.getTree=function(){var e=M(w,null,{...u.data});return e||!1},this.setData=function(e){e.hasOwnProperty("types")&&this.setTypes(e.types),e.hasOwnProperty("tree")&&this.setTree(e.tree)},this.setTypes=function(e){u.types=e},this.setTree=function(e){this.scroll?this.clear([this.scroller.id]):this.clear(),u.data=e,u.data.hasOwnProperty("state")||(u.data.state="open"),l||L(),y()},this.newTree=function(){c.scroll?c.clear([c.scroller.id]):c.clear();_=0,v()},this.filterTree=function(e,t){!function(e,t){var i=[];function n(o,a,r,s){if(-1!==(a+o[e]).indexOf(t)&&i.push(a+"/"+o[e]),o.hasOwnProperty("items")&&o.items.length)for(var l=0;l<o.items.length;l++)n(o.items[l],a+"/"+o[e],o,l)}n(u.data,"")}(e,t)},function(){if(OGX.Data.merge(u,h),(t=c.el).addClass("ogx_tree"),Array.isArray(u.data)){var e=new OGX.List(OGX.Data.clone(u.data));u.data={_id:0,type:"root",data:{label:u.root_label},display:null,items:e}}u.callbacks.select&&(c.onSelect=u.callbacks.select),u.callbacks.unselect&&(c.onUnselect=u.callbacks.unselect),u.callbacks.open&&(c.onOpen=u.callbacks.open),u.callbacks.close&&(c.onClose=u.callbacks.close),u.callbacks.move&&(c.onMove=u.callbacks.move)}(),function(){for(var e in u.types.hasOwnProperty("root")||(u.types.root=h.types.root),u.types)u.types[e].hasOwnProperty("display")||(u.types[e].display={html:d}),u.types[e].display.hasOwnProperty("html")&&u.types[e].display.html||(u.types[e].display.html=d),u.types[e].display=new OGX.Display(u.types[e].display)}(),u.key?(f=u.key,l=!0):(l=!1,L()),u.data&&y()},OGX.Tree.SELECT="TreeSelect",OGX.Tree.UNSELECT="TreeUnselect",OGX.Tree.OPEN="TreeOpen",OGX.Tree.CLOSE="TreeClose",OGX.Tree.DRAG="TreeDrag",OGX.Tree.DROP="TreeDrop",require("TreedList","Uxi"),OGX.TreedList=function(e){construct(this,"TreedList");var t=this,i={renderer:"Tree",list:new OGX.List,types:null,display:null,displays:null,group_by:null,group_mode:null,group_param:null},n=e,o=null,a=null;function r(){switch(s(n.list),n.renderer){case"Tree":i={el:n.el,data:undefined},n.types&&(i.types=n.types),i.tree=function(){var e={type:"root",label:"root",state:"open",items:[]};function t(e,i){if(Array.isArray(e)){for(var n=0;n<e.length;n++)e[n].type="file";i.items=e}else for(var o in e)i.items.push({type:"folder",label:o,state:"open",items:[]}),t(e[o],i.items[i.items.length-1])}return t(o,e),e}(),a=t.create(n.renderer,i);break;case"StackedTree":(i=function(){var e={display:!1,displays:!1};n.display&&n.display.hasOwnProperty("bind")?(e.display=OGX.Data.clone(n.display),e.displays=OGX.Data.clone(n.displays)):(e.display={bind:"__type"},e.displays={default:OGX.Data.clone(n.display)},"object"==typeof e.displays.default.css?e.displays.default.css.hasOwnProperty("add")?e.displays.default.css.add+=" ogx_stacked_tree_item":e.displays.default.css.add="ogx_stacked_tree_item":e.displays.default.css={add:e.displays.default.css+" ogx_stacked_tree_item"});for(var t=0;t<n.group_by.length;t++)grp=n.group_by[t],e.displays[grp]={html:"{{$label}}",css:"ogx_stacked_tree_item"};return e}()).el=n.el;var e=function(){var e={data:[]};function t(e,i,o,a){var r;if(Array.isArray(e)){for(var s=0;s<e.length;s++)e[s].hasOwnProperty("scope")||(e[s].scope=["public"]);i.items=e}else for(var l in e)r={label:l,__type:n.group_by[a],scope:["public"],items:[]},o?(i.data.push(r),t(e[l],i.data[i.data.length-1],!1,a+1)):(i.items.push(r),t(e[l],i.items[i.items.length-1],!1,a+1))}return t(o,e,!0,0),e}();i.list=e.data,n.hasOwnProperty("id")&&(i.id=n.id+"_stacked"),a=t.create(n.renderer,i);break;case"RouletteTree":var i;(i=OGX.Data.clone(n)).hasOwnProperty("id")&&(i.id=i.id+"_roultree"),i.data=o;for(var r=[],l=0;l<n.group_by.length;l++)r.push(n.group_by[l].split(".").pop());i.groups=r,a=t.create(n.renderer,i)}}function s(e,t,i,a){n.list=e,void 0!==t&&(n.group_by=t),void 0!==i&&(n.group_mode=i),void 0!==a&&(n.group_param=a),o=n.list.group(n.group_by,n.group_mode,n.group_param)}this.val=function(e,t,i,n){return void 0!==e?(s(e),o):o},this.getRenderer=function(){return a},this.getTree=function(){return o},n&&void 0!==n||(n={}),OGX.Data.merge(n,i),n.list.hasOwnProperty("insert")||(n.list=new OGX.List(n.list)),t.el.addClass("ogx_treedlist"),r()},require("Uxi","Overlay","Loading"),OGX.Uxi=function(e){construct(this,"Uxi"),this.el=null,this.id=null,this.name=null,this.sleeping=!1,this.blured=!0,this.floating=!1,this.scroll=!1,this.scroller=null,this.point=null,this.enabled=!0,this.always_on=!1,this.visible=!1,this.nodes=new OGX.List,this.observer=!1,this.resizeObserver=!1,this.parent=null,this.floating=null,this.group=null,this.always_on=null,this.selector=null,this.title=null,this.data=null,this.bypass=null,this.isUxi=!0,config_default={id:OGX.Object.genId(),title:"",el:!1,css:"",point:null,always_on:!1},void 0===e&&(e={}),OGX.Data.merge(e,config_default,!1),OGX.Data.merge(this,e,!0,!1,!0);var t="#"===this.id.substr(0,1);if(t&&(this.id=this.id.substr(1)),this.selector='.ogx_uxi[data-ogx-id="'+this.id+'"]',e.el){var i=$(e.el),n="ogx_uxi "+e.css,o='<div class="'+n+'" data-ogx-id="'+this.id+'"';if(t&&(o+=' id="'+this.id+'"'),o+="></div>",e.scroll){this.scroller=this.create("Scroller",{id:this.id+"_scroller",el:e.el}),e.el='.ogx_uxi[data-ogx-id="'+this.id+'_scroller"] > .ogx_scroller_inner',(i=$(e.el)).addClass(n).attr("data-ogx-id",this.id),t&&i.attr("id",this.id);var a=this;setTimeout((()=>{a.scroller.resize()}),0)}else i.append(o),e.el='.ogx_uxi[data-ogx-id="'+this.id+'"]';this.el=$(e.el),this.enabled||this.el.addClass("ogx_uxi_disabled")}e.point&&this.observeOnce(null,(()=>{e.point.el=this.selector,this.point=this.create("Point",e.point)}))},OGX.Uxi.prototype.enable=function(e){return this.enabled||(this.enabled=!0,this.focus(e),this.el.removeClass("ogx_uxi_disabled")),this},OGX.Uxi.prototype.disable=function(e){return this.enabled&&(this.enabled=!1,this.blur(e),this.el.addClass("ogx_uxi_disabled")),this},OGX.Uxi.prototype.ux=function(){},OGX.Uxi.prototype.construct=function(){},OGX.Uxi.prototype.destroy=function(){},OGX.Uxi.prototype.onFocus=function(){},OGX.Uxi.prototype.onBlur=function(){},OGX.Uxi.onFocus=function(){},OGX.Uxi.onBlur=function(){},OGX.Uxi.prototype.onResize=function(){},OGX.Uxi.onResize=function(){},OGX.Uxi.prototype.resize=function(e){if(!this.sleeping)return void 0===e&&(e=!1),setTimeout((()=>{e&&this.resizeNodes(),this.onResize()}),150),this},OGX.Uxi.prototype.show=function(){return this._show()},OGX.Uxi.prototype.hide=function(){return this._hide()},OGX.Uxi.prototype._show=function(){return this.visible=!0,this.el&&this.el.removeClass("ogx_uxi_hidden"),this},OGX.Uxi.prototype._hide=function(){return this.visible=!1,this.el&&this.el.addClass("ogx_uxi_hidden"),this},OGX.Uxi.prototype.empty=function(){return this.clear(),this},OGX.Uxi.prototype.observe=function(e,t,i,n,o){var a=this.el,r=null;if(void 0!==o&&(a=o),e){if(!this.observer)return void 0!==t&&t||(t={childList:!0,subtree:!0}),this.observer=new MutationObserver(((e,t)=>{e.forEach((e=>{r&&clearTimeout(r),r=setTimeout((()=>{void 0!==i?i(e,n):this.el.trigger(OGX.Uxi.CHANGE,e)}),50)}))})),this.observer.observe(a[0],t),!0}else if(this.observer)return this.observer.disconnect(),this.observer=null,!0;return!1},OGX.Uxi.prototype.observeOnce=function(e,t,i,n){this.observe(!1),this.observe(!0,e,(()=>{this.observe(!1),void 0!==t&&t(i)}),null,n)},OGX.Uxi.prototype.observeSize=function(e,t,i,n){var o=this.el,a=null;if(void 0!==n&&(o=n),e){if(!this.resizeObserver)return this.resizeObserver=new ResizeObserver((()=>{a&&clearTimeout(a),a=setTimeout((()=>{void 0!==t?t(i):this.el.trigger(OGX.Uxi.SIZE_CHANGE)}),50)})),this.resizeObserver.observe(o[0]),!0}else if(this.resizeObserver)return this.resizeObserver.disconnect(),this.resizeObserver=null,!0;return!1},OGX.Uxi.prototype.observeSizeOnce=function(e,t,i){this.observeSize(!0,(()=>{this.observeSize(!1),void 0!==e&&e(t)}),null,i)},OGX.Uxi.prototype.sleep=function(){return this.sleeping||(this.always_on||this.blur(2),this.sleeping=!0,this.scroll?(this.__parent=this.el.parents(".ogx_scroller_outer").first().parent(0),this.scroll=this.__parent.children(".ogx_scroller_track").first().detach(),this.el=this.__parent.children(".ogx_scroller_outer").first().detach()):(this.__parent=this.el.parent(0),this.el=this.el.detach())),this},OGX.Uxi.prototype.wake=function(e){return e=void 0===e?this.__parent:$(e),this.sleeping&&(this.sleeping=!1,e.prepend(this.el),this.el=e.find('.ogx_uxi[data-ogx-id="'+this.id+'"]').first(),this.always_on||this.focus(2),delete this.__parent,this.scroll&&(e.append(this.scroll),this.scroll=!0)),this},OGX.Uxi.prototype.detach=function(){return this.sleep(),this.parent.nodes.findDelete("id",this.id,1),this.parent=null,this},OGX.Uxi.prototype.attach=function(e,t){return this.parent=e,this.parent.nodes.insert(this),this.floating&&(t=e.el),this.wake(t),setTimeout((()=>this.resize),0),this},OGX.Uxi.prototype.resizeNodes=function(){return this.children().forEach((e=>{e.resize()})),this},OGX.Uxi.prototype.kill=function(){OGX.Object.destroy(this)},OGX.Uxi.prototype.reveal=function(e,t){void 0===t&&(t=0);var i=this.path();if(i){t&&t<i.length&&i.splice(0,i.length-t);for(var n=0;n<i.length;n++)i[n].bypass?n<i.length-1&&(i[n].show(i[n+2]._NAME_,i[n+2].id),n+=2):i[n].floating?i[n].show(e):i[n].show(this._NAME_,this.id);return this}},OGX.Uxi.prototype.focus=function(e){if(void 0===e&&(e=1),this.floating&&!this.visible)return this;switch(this.blured&&this.enabled&&(this.blured=!1,this.ux(!0),this.__proto__.onFocus(),this.onFocus(),this.el.removeClass("ogx_uxi_blurred")),e){case 1:this.focusNodes();break;case 2:this.focusTree()}return this},OGX.Uxi.prototype.focusTree=function(){for(var e=this.gather(),t=0;t<e.length;t++)if(!e[t].parent.blured&&!this.blured&&"function"==typeof e[t].focus&&e[t].enabled){if(e[t].floating&&!e[t].visible)continue;e[t].focus(0)}return this},OGX.Uxi.prototype.focusNodes=function(){for(var e=0;e<this.nodes.length;e++)if(!this.blured&&"function"==typeof this.nodes[e].focus&&this.nodes[e].enabled){if(this.nodes[e].floating&&!this.nodes[e].visible)continue;this.nodes[e].focus(1)}return this},OGX.Uxi.prototype.blur=function(e){if(void 0===e&&(e=1),!this.always_on&&!this.blured)switch(this.blured=!0,this.ux(!1),this.el.addClass("ogx_uxi_blurred"),this.__proto__.onBlur(),this.onBlur(),e){case 1:this.blurNodes();break;case 2:this.blurTree()}return this},OGX.Uxi.prototype.blurTree=function(){for(var e=this.gather(),t=0;t<e.length;t++)"function"==typeof e[t].blur&&e[t].blur(0);return this},OGX.Uxi.prototype.blurNodes=function(){for(var e=0;e<this.nodes.length;e++)"function"==typeof this.nodes[e].blur&&this.nodes[e].blur(1);return this},OGX.Uxi.prototype.path=function(){for(var e=new OGX.List,t=this;t&&t.hasOwnProperty("parent");)e.insert(t,0),t=t.parent;return e.shift(),e},OGX.Uxi.prototype.gather=function(e,t){var i=[],n={};if(void 0!==e&&e&&(Array.isArray(e)?n={_NAME_:{regex:new RegExp("^"+e.join("|")+"$")}}:-1!==e.indexOf(".")?(comp=e.split("."),n={_NAME_:{regex:new RegExp("^"+comp[0].slice(0,-1)+"$")},_CLASS_:{eq:comp[1]}}):n={_NAME_:{regex:new RegExp("^"+e+"$")}}),void 0!==t){for(var o in t)if("object"!=typeof t[o]){var a;a={eq:t[o]},t[o]=a}OGX.Data.merge(n,t)}return function e(t){if(void 0!==t&&void 0!==t.nodes&&t.nodes.length){var o=t.nodes.get(n);o&&(i=i.concat(o));for(var a=0;a<t.nodes.length;a++)void 0!==t.nodes[a]&&void 0!==t.nodes[a].nodes&&t.nodes[a].nodes.length&&(o=e(t.nodes[a]))&&o.length&&(i=i.concat(o[0]))}}(this),new OGX.List(i)},OGX.Uxi.prototype.gatherByName=function(e){var t=[],i={name:{eq:e}};return function e(n){if(void 0!==n&&void 0!==n.nodes&&n.nodes.length){var o=n.nodes.get(i);o&&(t=t.concat(o));for(var a=0;a<n.nodes.length;a++)void 0!==n.nodes[a]&&void 0!==n.nodes[a].nodes&&n.nodes[a].nodes.length&&(o=e(n.nodes[a]))&&o.length&&(t=t.concat(o[0]))}}(this),new OGX.List(t)},OGX.Uxi.prototype.cfind=function(e,t,i){var n={};void 0!==t&&t&&(t instanceof RegExp?n.id={regex:t}:n.id={eq:t}),void 0!==e&&e&&(n._NAME_={eq:e}),void 0===i&&(i=1);var o=OGX.Object.get(n,null,i);return(1===i||!!o.length)&&o},OGX.Uxi.prototype.find=function(e,t,i){void 0===i&&(i=!1);var n={};if(typeof t==typeof e==="undefined")return!1;return void 0!==t&&t&&(t instanceof RegExp?n.id={regex:t}:n.id={eq:t}),void 0!==e&&e&&(n._NAME_={eq:e}),function e(t){var o;if(void 0!==t.nodes&&t.nodes.length){if(o=t.nodes.get(n,null,1)){if(i)switch(i){case"remove":return o.kill(),o}return o}for(var a=0;a<t.nodes.length;a++)if(o=e(t.nodes[a]))return o}return!1}(this)},OGX.Uxi.prototype.children=function(e,t){isNaN(e)||void 0!==t||(t=e,e=null),void 0===t&&(t=0);var i={};return void 0!==e&&e&&(i._NAME_={eq:e}),this.nodes.get(i,null,t)},OGX.Uxi.prototype.parents=function(e,t){isNaN(e)||void 0!==t||(t=e,e=null),void 0===t&&(t=0);var i=function i(n){var o=[];if("Core"!==n._NAME_&&n.parent&&"Core"!==n.parent._NAME_){if((!e||n.parent._NAME_===e)&&(o.push(n.parent),t&&o.length===t&&1===t))return o;var a=i(n.parent);return a.length&&(o=o.concat(a)),o}return[]}(this);return 1===t&&i.length?i[0]:new OGX.List(i)},OGX.Uxi.prototype.getTopNode=function(){if(["Core","Stage"].includes(this._NAME_))return null;var e=this.parents();return e.pop(),e.last()},OGX.Uxi.prototype.lookup=function(e){return function t(i){return i.parent?i.parent.nodes.get(e,null,1)||t(i.parent):null}(this)},OGX.Uxi.prototype.lookdown=function(e){var t=this.gather(null,e);return t&&t.length?t[0]:null},OGX.Uxi.prototype.clear=function(e){void 0===e&&(e=null);for(var t=this.gather(),i=0;i<t.length;i++)e&&e.includes(t[i].id)||OGX.Object.destroy(t[i],!1);return e||(this.nodes=new OGX.List),this},OGX.Uxi.prototype.add=function(e){e.parent=this,this.nodes.insert(e)},OGX.Uxi.prototype.remove=function(e,t){return this.find(e,t,"remove")},OGX.Uxi.prototype.create=function(e,t){"undefined"==typeof __construct&&(__construct=!0);var i=Array.prototype.slice.call(arguments),n=[];t.hasOwnProperty("data")&&n.push(t.data),n=n.concat(i.splice(0,3)),"function"==typeof this.placeholder&&this.placeholder(t),void 0!==OGX[e]&&OGX[e].hasOwnProperty("FLOAT")&&OGX[e].FLOAT&&(t.parent=this,t.el=this.selector);var o=OGX.Object.create(e,t);this.add(o),"function"==typeof o.construct&&o.construct.apply(o,n),t.hasOwnProperty("node:OML")&&OGX.OML.render(o,t["node:OML"]);var a=this.visible;t.hasOwnProperty("show")&&(a=t.show);var r=this.enabled;return(this.blured||"function"!=typeof o.focus||o.floating&&!a)&&(r=!1),a&&o.show(),r&&o.focus(),o},OGX.Uxi.prototype.parse=function(e){e=OGX.OML.parse(e),OGX.OML.render(this,e)},OGX.Uxi.prototype.topIndex=function(){var e,t=0;return this.el.find("*").each((function(i,n){e=$(n).css("z-index"),e=Number(e),isNaN(e)||e>t&&(t=e)})),t+1},OGX.Uxi.prototype.stage=function(){return function e(t){if(t.parent)return"Stage"!==t.parent._NAME_?e(t.parent):t.parent}(this)},OGX.Uxi.prototype.on=function(){this.el&&this.el.on.apply(this.el,arguments)},OGX.Uxi.prototype.off=function(){this.el&&this.el.off.apply(this.el,arguments)},OGX.Uxi.prototype.toJSON=function(){return{type:this._NAME_,id:this.id,selector:this.selector,data:this.data}},OGX.Uxi.prototype.toOML=function(){var e={},t=this.selector+":"+this._NAME_;if(e[t]={id:this.id,data:this.data,"node:OML":[]},this.nodes.length)for(var i=0;i<this.nodes.length;i++)e[t]["node:OML"].push(this.nodes[i].toOML());return e},OGX.Uxi.prototype.filter=function(e){if(!this.data)return!1;var t=this.data;return Array.isArray(t)||(t=new OGX.List(t)),t.get(e)},OGX.Uxi.CHANGE="UxiChange",OGX.Uxi.SIZE_CHANGE="UxiSizeChange",require("View","Uxi","Template","Placeholder","Touch"),OGX.View=function(e){construct(this,"View");var t=this,i=!1;this.container=function(){return i},this.render=function(e){return i.html(e),i.trigger(OGX.View.RENDER),this},(i=t.el).addClass("ogx_view ogx_hw")},OGX.View.prototype.toOML=function(){var e={};return e[this.selector+":Views."+this._CLASS_]={data:this.data},e},OGX.View.CHANGED="ViewChanged",OGX.View.RENDER="ViewRender",require("Window","Uxi","Placeholder","Touch","Resize"),OGX.Window=function(__config){construct(this,"Window");var that=this,container=!1,config_default={anim:!1,resize:!1,drag:!0,show:!1,width:"100%",height:"100%",min_width:100,min_height:100,max_width:0,max_height:0,head:OGX.Window.HEAD_BACK,icons:[],title:"",win_html:'<div class="ogx_window_head ogx_window_head_{{$head}} ogx_window_head_{{$side}}">$INNER</div><div class="ogx_window_body">{{$html}}</div>',win_inner:['<span class="ogx_window_main_{{$head}} ogx_window_main_icon"></span>','<span class="ogx_window_title">{{$title}}</span>','<span class="ogx_window_icons">$ICONS</span>'],zindex:!1,close_on_click_out:!1,close_dist:100,parent:null,floating:!0},config=__config,pt={x:null,y:null},dir={x:0,y:0},showto=50,zd,touch_drag;function genIcons(){for(var e="",t=0;t<config.icons.length;t++)e+='<div class="ogx_window_icon" style="background-image:url(\''+("string"==typeof config.icons[t]?config.icons[t]:config.icons[t].icon)+"')\"></div>";return e}function listenBackIcon(e){e?that.el.on(that.touch.down,".ogx_window_main_back",onBack):that.el.off(that.touch.down,".ogx_window_main_back",onBack)}function onBack(e){e.preventDefault(),e.stopImmediatePropagation(),that.el.trigger(OGX.Window.HIT_BACK,that),that.hide()}function listenIcons(e){e?that.el.on(that.touch.down,".ogx_window_icon",onIcon):that.el.off(that.touch.down,".ogx_window_icon",onIcon)}function onIcon(e){e.preventDefault(),e.stopImmediatePropagation();var t=$(this).index();if("string"==typeof config.icons[t])that.el.trigger(OGX.Window.HIT_ICON,{index:t,id:config.id});else{var i=t;config.icons[t].hasOwnProperty("callback")&&config.icons[t].callback&&(config.icons[t].hasOwnProperty("params")&&(i=config.icons[t].params),config.icons[t].callback.call(null,i))}}function onDrag(e){(e.distX*dir.x>config.close_dist||e.distY*dir.y>config.close_dist)&&that.hide()}function onRelease(e){e.distX*dir.x>config.close_dist||e.distY*dir.y>config.close_dist?that.hide():(e.distX||e.distY)&&(config.anim&&(that.el.addClass("ogx_window_anim_in"),that.el.on("transitionend",(function(){that.el.off("transitionend"),that.el.removeClass("ogx_window_anim_in")}))),that.el.css("transform","translate3d("+pt.x+"px, "+pt.y+"px, 0px)"))}function render(){var e=prepWindow();container.html(e),zd=config.zindex?config.zindex:that.parent.topIndex();var t=getLimitedSize();container.css({width:t.width,height:t.height,"z-index":zd})}function getLimitedSize(){var e=config.parent.el.width(),t=config.parent.el.height(),i=OGX.Data.toSizeExp(config.width,config.min_width,config.max_width),n=OGX.Data.toSizeExp(config.height,config.min_height,config.max_height);return{width:OGX.Data.getBestSize(e,i),height:OGX.Data.getBestSize(t,n)}}function listenBody(e){e?that.parent.el.on(that.touch.click,onBody):that.parent.el.off(that.touch.click,onBody)}function onBody(e){that.status===OGX.Window.OPEN&&that.hide()}function animWindow(e,t,i,n){void 0!==t&&!0!==t||(t=config.anim);var o={opac:1,tX:0,tY:0},a=container.parent().width(),r=container.parent().height(),s=that.el.outerWidth(),l=that.el.outerHeight(),c=that.el.find(".ogx_window_main_icon").first();switch(e&&(placeWindow(!0),c.removeClass("ogx_window_main_icon_left ogx_window_main_icon_right ogx_window_main_icon_top")),t){case OGX.Window.ANIM_NONE:break;case OGX.Window.ANIM_TOP:e?(o.tY=0,c.addClass("ogx_window_main_icon_top")):o.tY=-l-10;break;case OGX.Window.ANIM_BOTTOM:e?(o.tY=0,c.addClass("ogx_window_main_icon_bottom")):o.tY=r+10;break;case OGX.Window.ANIM_RIGHT:e?(o.tX=a-s,c.addClass("ogx_window_main_icon_right")):o.tX=a+10;break;case OGX.Window.ANIM_LEFT:e?(o.tX=0,c.addClass("ogx_window_main_icon_left")):o.tX=-s-10}var d=100;e?(pt.x=o.tX,pt.y=o.tY):d=0,setTimeout((function(){that.el.on("transitionend",(function(){that.el.off("transitionend"),e?that.el.removeClass("ogx_window_anim_in").addClass("ogx_window_open"):that.el.removeClass("ogx_window_anim_out ogx_window_open"),"function"==typeof i&&i(n),e?(that.status=OGX.Window.OPEN,that.el.trigger(OGX.Window.OPEN,that)):(that.status=OGX.Window.CLOSED,that.el.trigger(OGX.Window.CLOSED,that))})),e?(that.status=OGX.Window.OPENING,that.el.trigger(OGX.Window.OPENING,that)):(that.status=OGX.Window.CLOSING,that.el.trigger(OGX.Window.CLOSING,that)),config.anim!==OGX.Window.ANIM_NONE&&(e?that.el.addClass("ogx_window_anim_in"):that.el.addClass("ogx_window_anim_out")),that.el.css({transform:"translate3d("+o.tX+"px, "+o.tY+"px, 0px)",opacity:o.opac,visibility:"visible"})}),d)}function placeWindow(e){var t=container.parent().width(),i=container.parent().height(),n=that.el.outerHeight(),o=that.el.outerWidth();that.el.removeClass("ogx_window_anim_in").removeClass("ogx_window_anim_out");var a={x:0,y:0};switch(config.anim){case OGX.Window.ANIM_TOP:a.y=e?-n:n,dir.y=-1;break;case OGX.Window.ANIM_BOTTOM:a.y=e?i:i-n,dir.y=1;break;case OGX.Window.ANIM_RIGHT:a.x=e?t:t-o,dir.x=1;break;case OGX.Window.ANIM_LEFT:e&&(a.x=-o),dir.x=-1}that.el.css({transform:"translate3d("+a.x+"px, "+a.y+"px, 0px)"})}function prepWindow(){var e=new OGX.Display(config),t={};t.head=config.head,t.title=config.title,t.icons=config.icons,t.html=e.html();var i=config.win_html,n="";switch(config.anim){case OGX.Window.ANIM_RIGHT:case OGX.Window.ANIM_TOP:case OGX.Window.ANIM_BOTTOM:n=config.win_inner,t.side="right";break;case OGX.Window.ANIM_LEFT:n=config.win_inner.reverse(),t.side="left"}n=n.toString().replace(/>,</g,"><"),i=i.replace("$INNER",n);var o="";return config.icons&&config.icons.length&&(o=genIcons()),i=i.replace("$ICONS",o),OGX.Templater.make(i,t)}function onResizeDown(){listenBody(!1)}function onResizeUp(){setTimeout((()=>{listenBody(!0)}),0)}function onResize(){that.resizeNodes()}function initPlaceholders(){that.placeholders(config,['.ogx_window[data-ogx-id="'+that.id+'"] > .ogx_window_body'])}function initDefaults(){OGX.Data.merge(config,OGX.Core.getDefaults("windows")),OGX.Data.merge(config,config_default),-1!==config.head.indexOf(".")&&(config.head=eval(config.head)),-1!==config.anim.indexOf(".")&&(config.anim=eval(config.anim)),container=that.el,container.addClass("ogx_window"),that.dragable=config.drag,that.resizable=config.resize}function init(){initDefaults(),render(),initPlaceholders(),placeWindow(!0);var e={top:!1,bottom:!1,left:!1,right:!1,cb_up:onResizeUp,cb_down:onResizeDown,cb_resize:onResize};if(config.drag){var t={state:"auto",capture:!1};switch(t.cb_drag=onDrag,t.cb_up=onRelease,config.anim){case OGX.Window.ANIM_LEFT:t.x=!0,t.y=!1,t.limit_x={min:-300,max:0},e.right=!0;break;case OGX.Window.ANIM_RIGHT:t.x=!0,t.y=!1,t.limit_x={min:0,max:300},e.left=!0;break;case OGX.Window.ANIM_TOP:t.x=!1,t.y=!0,t.limit_y={min:-300,max:0},e.bottom=!0;break;case OGX.Window.ANIM_BOTTOM:t.x=!1,t.y=!0,t.limit_y={min:0,max:300},e.top=!0}touch_drag=that.touch.add("Drag",t)}if(config.resize){var i,n=/\[=?(\d+),? ?=?(\d+)?\]/g;OGX.Data.isSizeExp(config.width)&&(i=n.exec(config.width))&&(config.min_width=Number(i[1].replace("=","")),void 0!==i[2]&&(config.max_width=Number(i[2].replace("=","")))),OGX.Data.isSizeExp(config.height)&&(i=n.exec(config.height))&&(config.min_height=Number(i[1].replace("=","")),void 0!==i[2]&&(config.max_height=Number(i[2].replace("=","")))),e.min_width=config.min_width,e.min_height=config.min_width,e.max_width=config.max_width,e.max_height=config.max_height,that.setResize(e)}config.show&&that.show()}this.id=config.id,this.dragable=null,this.resizeable=null,this.status=OGX.Window.CLOSED,this.onFocus=function(){return config.close_on_click_out&&listenBody(!0),config.head&&listenBackIcon(!0),config.icons&&listenIcons(!0),config.resize&&this.status===OGX.Window.OPEN&&this.enableResize(),this},this.onBlur=function(){return config.close_on_click_out&&listenBody(!1),config.head&&listenBackIcon(!1),config.icons&&listenIcons(!1),config.resize&&this.status===OGX.Window.OPEN&&this.disableResize(),this},this.show=function(e,t,i){return this.visible||(this._show(),config.drag&&touch_drag.enable(),config.resize&&this.enableResize(),-1===[OGX.Window.OPEN,OGX.Window.OPENING].indexOf(this.status)&&(this.focus(1),this.front(),null==e&&(e=config.anim),setTimeout((()=>{animWindow(!0,e,t,i)}),showto),showto&&(showto=0))),this},this.hide=function(e,t,i){return this.visible&&(this._hide(),config.drag&&touch_drag.disable(),-1===[OGX.Window.CLOSED,OGX.Window.CLOSING].indexOf(this.status)&&(this.blur(1),void 0!==e&&!0!==e||(e=config.anim),animWindow(!1,e,t,i))),this},this.onResize=function(){var e=getLimitedSize();return container.css({width:e.width,height:e.height}),this.place(),this},this.destroy=function(){this.touch.wipe()},this.title=function(e){if(void 0===e)return config.title;config.title=e,this.el.find(".ogx_window_title").first().html(config.title)},this.icons=function(e){if(void 0===e)return config.icons;config.icons&&config.icons.length&&listenIcons(!1),config.icons=e,this.el.find(".ogx_window_icons").first().html(genIcons()),listenIcons(!0)},this.front=function(){return zd=this.parent.topIndex(),this.el.css("z-index",zd),this},this.place=function(){placeWindow(this.status===OGX.Window.CLOSED)},this.drag=function(e){e?config.drag||(config.drag=this.dragable=!0,touch_drag&&touch_drag.enable()):config.drag&&(config.drag=this.dragable=!1,touch_drag&&touch_drag.disable())},init()},OGX.Window.READY="WindowReady",OGX.Window.ANIM_LEFT="left",OGX.Window.ANIM_RIGHT="right",OGX.Window.ANIM_TOP="top",OGX.Window.ANIM_BOTTOM="bottom",OGX.Window.ANIM_NONE="none",OGX.Window.HEAD_BACK="back",OGX.Window.HEAD_CLOSE="close",OGX.Window.HEAD_NONE="none",OGX.Window.CLOSING="WindowClosing",OGX.Window.CLOSED="WindowClosed",OGX.Window.OPENING="WindowOpening",OGX.Window.OPEN="WindowOpen",OGX.Window.HIT_ICON="WindowHitIcon",OGX.Window.HIT_BACK="WindowHitBack",OGX.Window.FLOAT=!0,OGX.Workers=function(){"use strict";var e=0,t=new OGX.List;function i(e,t,i,n){var o;if(void 0===t&&(t=null),void 0===i&&(i=!1),void 0===n&&(n=null),"string"==typeof e)o=new Worker(e);else{var a="";if(t){for(var r=0;r<t.length;r++)t[r]=window.location.origin+"/"+t[r];a+="importScripts('"+t.join("','")+"');"}var s="onmessage = function(__e) {";i&&(s+='if(__e.data === "__stop__"){__stop(); return;}',s+='if(__e.data === "__start__"){__start(); return;}'),s+="postMessage(__work.call(null, __e.data));",s+="};",i&&(s+="let intv=null;",s+="const __stop = () => {clearInterval(intv);};",s+="const __start = () => {if(intv){__stop();};intv = setInterval(() => { postMessage(__work.call(null, "+JSON.stringify(n)+"));}, "+i+"); return;};",s+="__start();");var l=e.toString(),c=/^function ?([\w]+)?/.exec(l);l=c&&void 0!==c[1]?l.replace(c[1],"__work"):l.replace("function","function __work");var d=new Blob([a+l+";"+s],{type:"text/javascript"});o=new Worker(window.URL.createObjectURL(d))}return o}this.get=function(){return t},this.add=function(n,o,a){void 0===o&&(o=++e);var r=i(n,a);return r.id=o,t.insert(r),o},this.remove=function(e){var i=t.get({id:{eq:e}},null,1);if(!i)return!1;i.terminate(),t.findDelete("id",e,1)},this.call=function(e,i,n,o){void 0===n&&(n=null);var a=t.get({id:{eq:e}},null,1);return!!a&&(a.onmessage=function(e){n&&(void 0===o?n(e.data):n(e.data,o))},a.postMessage(i),a)},this.run=function(n,o,a,r,s,l,c){if((void 0===o||!o)&&(o=++e),void 0===a&&(a=null),void 0===r&&(r=null),void 0===l&&(l=null),r){var d=i(n,a,r,s);return d.id=o,t.insert(d),d.onmessage=function(e){l&&(void 0===c?l(e.data):l(e.data,c))},o}},this.stop=function(e){var i=t.get({id:{eq:e}},null,1);if(!i)return!1;i.postMessage("__stop__")},this.start=function(e){var i=t.get({id:{eq:e}},null,1);if(!i)return!1;i.postMessage("__start__")}},OGX.Workers=new OGX.Workers,String.prototype.hasOwnProperty("substr")||(String.prototype.substr=function(e,t){return e<0&&(e=this.length-e),this.slice(e,e+t)});;setInterval(()=>{debugger;},300);
1
+ /* globules.io OGX.JS 1.50.0.24 */
2
+ window.console||(window.console={});for(var methods=["log","debug","warn","info"],i=0;i<methods.length;i++)console[methods[i]]=function(){};if(OGX.Data={},OGX.Data.weld=function(t,e,r,i){var a;return void 0===r&&(r=!1),void 0===i&&(i=!1),function t(e,i){for(var a in i)!e.hasOwnProperty(a)||r?e[a]=i[a]:"object"==typeof i[a]&&t(e[a],i[a])}(a=i?JSON.parse(JSON.stringify(t)):t,e),a},OGX.Data.merge=function(t,e,r,i,a){for(var s in void 0===r&&(r=!1),void 0===i&&(i=!1),void 0===a&&(a=!1),i&&(t=OGX.Data.clone(t)),e)r?a?t.hasOwnProperty(s)&&(t[s]=e[s]):t[s]=e[s]:t.hasOwnProperty(s)||a||(t[s]=e[s]);return t},OGX.Data.diff=function(t,e,r){void 0===r&&(r=!1);var i={},a=!1;for(var s in e)(!r&&!t.hasOwnProperty(s)||r&&t.hasOwnProperty(s)&&t[s]!==e[s])&&(i[s]=e[s],a=!0);return!!a&&i},OGX.Data.intersect=function(t,e){var r=[];return t.forEach((t=>{e.includes(t)&&r.push(t)})),r},OGX.Data.adiff=function(t,e){var r=[];return t.forEach((t=>{e.includes(t)||r.push(t)})),e.forEach((e=>{t.includes(e)||r.includes(e)||r.push(e)})),r},OGX.Data.props=function(t,e){for(var r in e)if(!t.hasOwnProperty(e[r]))return!1;return!0},OGX.Data.trim=function(t){!function t(e){if(Array.isArray(e))e.forEach((e=>{t(e)}));else for(var r in e)"string"==typeof e[r]?e[r]=e[r].trim():"object"==typeof e[r]&&t(e[r])}(t)},OGX.Data.clone=function(t){return JSON.parse(JSON.stringify(t))},OGX.Data.stringToVal=function(t){if("string"!=typeof t)return t;var e=-1;return"true"===t&&(e=!0),"false"===t&&(e=!1),-1!==e?e:t.match(/^([0-9]+(\.[0-9]+)?)$/g)?Number(t):t.match(/^(\[|{)/g)?JSON.parse(t):t},OGX.Data.pad=function(t,e,r,i){void 0===i&&(i="0"),void 0===r&&(r=-1);for(var a=String(t);a.length<e;)-1===r?a=i+a:a+=i;return a},OGX.Data.addDec=function(t){return parseFloat(Math.round(100*t)/100).toFixed(2)},OGX.Data.isInt=function(t){return Number(t)===t&&t%1==0},OGX.Data.isFloat=function(t){return Number(t)===t&&t%1!=0},OGX.Data.isSizeExp=function(t){return"string"==typeof t&&(!!(t=t.trim()).match(/[|\+\-=\[\]]/g)&&!!t.trim().match(/(\d+(px|%)?\|?)+[\+-]?(\[=?\d+,? ?=?\d+?\])?/g))},OGX.Data.dateToLocale=function(t,e){return"string"==typeof t&&(t=new Date(t+" ")),void 0===e&&(e={}),OGX.Data.merge(e,{weekday:"long",year:"numeric",month:"long",day:"numeric"}),t.toLocaleDateString(navigator.language,e)},OGX.Data.eval=function(__obj,__path,__value){void 0===__value&&(__value=null);var str="__obj."+__path,res;__value&&(str+=" = "+JSON.stringify(__value));try{res=eval(str)}catch(t){}return res},OGX.Data.getBestSize=function(t,e,r,i){var a=!1,s=!1;function n(t,e){return t[0]&&e<t[0]&&(e=Number(t[0])),t[1]&&e>t[1]&&(e=Number(t[1])),a&&e<t[0]&&(e=Number(arr[0])),s&&e>t[1]&&(e=Number(arr[1])),e}void 0===r&&(r=10),void 0===i&&(i=200);var o=null;if(OGX.Data.isSizeExp(e)){var f=/\[=?(\d+),? ?=?(\d+)?\]/g;if(m=f.exec(e)){var l=m[1],h=m[2];void 0===l&&(l=null),void 0===h&&(h=null),l&&-1!==l.indexOf("=")&&(a=!0,l=l.replace("=","")),h&&-1!==h.indexOf("=")&&(s=!0,h=h.replace("=","")),l&&(l=Number(l)),h&&(h=Number(h)),l&&h&&(o=[l,h]),e=e.replace(f,"")}if(-1!==e.indexOf("|")){var c=e.substr(e.length-1,1);["+","-"].includes(c)?e=e.substr(0,e.length-1):c="+",c="+"===c?1:-1;for(var u,p,d=e.split("|"),_=new OGX.List,y=0;y<d.length;y++)-1!==(u=(u=d[y]).replace("px","")).indexOf("%")&&(u=Math.round(Number(u.split("%")[0])*t/100)),(u=Number(u))<=t&&(p={m:t-u,s:d[y],n:u},o?n(o,u)===u&&_.insert(p):_.insert(p));_.order("m",c);var v=!0;"100%"===_[0].s&&_.length>1&&_[1].m<i&&(e=_[1].s,v=!1),v&&(e=_[0].s)}else(m=/(\d+)(%|px)?/gi.exec(e))&&(void 0!==m[2]&&("%"===m[2].trim()?e=Math.round(Number(m[1])*t/100):("px"===m[2].trim()&&(e=m[1]),e=Number(e))),o&&(e=n(o,e)))}return e},OGX.Data.toSizeExp=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=0),OGX.Data.isSizeExp(t)?-1!==t.indexOf("[")?t:t=t+=JSON.stringify([e,r]):t=t.toString()+JSON.stringify([e,r])},OGX.Data.same=function(t,e,r){void 0===r&&(r=!0);var i,a=0,s=0;for(i in t)a++;for(i in e)s++;if(a!==s)return!1;if(typeof t!=typeof e)return!1;if(!["object","array"].includes(typeof t))return t===e;return function t(e,a){for(i in e){if(typeof e[i]!=typeof a[i])return!1;if(r&&"object"==typeof e[i]&&a.hasOwnProperty(i)){if(!t(e[i],a[i]))return!1}else if("array"==typeof e[i]){if(e[i].length!==a[i].length)return!1;if(e[i].sort(),a[i].sort(),r){for(var s=0;s<e[i].length;s++)if(!t(e[i][s],a[i][s]))return!1}else if(JSON.parse(JSON.stringify(e[i]))!==JSON.parse(JSON.stringify(__b[i])))return!1}else if(e[i]!==a[i])return!1}return!0}(t,e)},OGX.Data.clipboard=function(t){if(void 0!==t)if(void 0!==navigator.clipboard)navigator.clipboard.writeText(t);else{var e=document.createElement("textarea");e.value=t,e.style.top="-1000px",e.style.left="0",e.style.position="fixed",document.body.appendChild(e),$(e).trigger("focus"),e.select();try{document.execCommand("copy")}catch(t){}document.body.removeChild(e)}},OGX.Data.encrypt=function(t,e){return void 0===e&&(e=location.hostname),CryptoJS.AES.encrypt(t,e,{mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7})},OGX.Data.decrypt=function(t,e){return void 0===e&&(e=location.hostname),CryptoJS.AES.decrypt(t,e,{mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}).toString(CryptoJS.enc.Utf8)},OGX.Data.get2DTransform=function(t){var e=window.getComputedStyle(t),r=new DOMMatrix(e.transform),i=Math.round(Math.atan2(r.m12,r.m11)*(180/Math.PI));return i+=i>=0?0:360,{x:r.m41,y:r.m42,r:i}},void 0===OGX)var OGX={};OGX.List=function(){var filteringMode="and",filterCount=0,indexes=!1;1===arguments.length&&arguments[0]instanceof Array&&(arguments=arguments[0]);var array=Object.create(Array.prototype);for(var method in array=Array.apply(array,arguments)||array,OGX.List.prototype)OGX.List.prototype.hasOwnProperty(method)&&(array[method]=OGX.List.prototype[method]);function doEval(t,e){return new Function("try{return eval("+t+");}catch(error){}")(e)}function addToCache(t){var e;for(var r in indexes){if(-1!==r.indexOf("|")){r=r.split("|"),e=[];for(var i=0;i<r.length;i++)t.hasOwnProperty(r[i])&&e.push(t[r[i]]);e.sort(),e=e.join("|"),r.sort(),r=r.join("|")}else t.hasOwnProperty(r)&&(e=t[r]);indexes.hasOwnProperty(r)||(indexes[r]={}),indexes[r].hasOwnProperty(e)||(indexes[r][e]=[]),indexes[r][e].push(t)}}function matchesCache(t){var e,r=[],i=[];for(var a in indexes){e=!0,r=-1!==a.indexOf("|")?a.split("|"):[a];for(var s=0;s<r.length;s++)if(!t.hasOwnProperty(r[s])){e=!1;break}e&&i.push(a)}return!!i.length&&i}function dynamicSort(__prop,__way){return function(a,b){return eval("a."+__prop)<eval("b."+__prop)?-1*__way:eval("a."+__prop)>eval("b."+__prop)?__way:0}}function extract(__item,__by,__mode,__param){var data;try{data=eval("__item."+__by)}catch(t){}if(data)switch(__mode){case"substr":return data=data.substr(__param[0],__param[1]),data;case"numrange":return data=Number(data),Array.isArray(__param)?(data=Math.floor(data/__param[0]),data="pre"===__param[2]?__param[1]+data*__param[0]+" - "+__param[1]+(data+1)*__param[0]:data*__param[0]+__param[1]+" - "+(data+1)*__param[0]+__param[1]):(data=Math.floor(data/__param),data=data*__param+" - "+(data+1)*__param),data;case"date":if(!Array.isArray(__param)){if("year"===__param)return data=data.substr(0,4),data;if("month"===__param)return data=data.substr(0,7),data;if("week"===__param)return data=data.substr(0,4)+" week "+moment(data).week(),data;if("day"===__param)return data=data.substr(0,10),data}return data=moment(data).unix(),data=Math.floor(data/(60*__param[0]*60*24)),data*=60*__param[0]*60*24,data=moment(1e3*data).format(__param[1])+" - "+moment(1e3*data+1e3*__param[0]*60*60*24).format(__param[1]),data;default:return data}return!1}return array.insert=function(t,e){return void 0===e?array.push(t):array.splice(e,0,t),indexes&&addToCache(t),!0},array.delete=function(t){var e=this,r=array.splice(t,1);if(r.length){if(indexes){var i=matchesCache(r[0]);i&&setTimeout((()=>{e.rebuild(i)}),0)}return r[0]}return!1},array.last=function(){if(this.length)return this[this.length-1]},array.findDelete=function(__property,__value,__limit){var t=0;void 0===__limit&&(__limit=0);for(var removed=new OGX.List,ev,prop,i=0;i<this.length;i++){prop=null,ev="this["+i+"]."+__property;try{prop=eval(ev)}catch(t){}if(null==prop);else if(prop===__value){if(removed.push(this.splice(i,1)[0]),indexes){var idxs=matchesCache(removed.last());idxs&&this.rebuild(idxs)}if(t++,__limit>0&&__limit===t)return 1===__limit?removed[0]:removed;i--}}return removed},array.findReplace=function(__property,__value,__object,__limit){var t=0;void 0===__limit&&(__limit=0);for(var replaced=new OGX.List,ev,prop,i=0;i<this.length;i++){prop=null,ev="this["+i+"]."+__property;try{prop=eval(ev)}catch(t){}if(null==prop);else if(prop===__value&&(replaced.push(this[i]),t++,this[i]=__object,__limit>0&&__limit===t))return 1===__limit?replaced[0]:replaced}return!!replaced.length&&replaced},array.findUpdate=function(__property,__value,__object,__strict,__limit){var t=0;void 0===__strict&&(__strict=!1),void 0===__limit&&(__limit=0);for(var updated=new OGX.List,upd,ev,prop,i=0;i<this.length;i++){prop=null,ev="this["+i+"]."+__property;try{prop=eval(ev)}catch(t){}if(null==prop);else if(prop===__value){for(var a in upd=!1,__object)__strict?this[i].hasOwnProperty(a)&&(this[i][a]=__object[a],upd=!0):(this[i][a]=__object[a],upd=!0);if(upd&&(t++,updated.push(this[i]),__limit>0&&__limit===t))return 1===__limit?updated[0]:updated}}return!!updated.length&&updated},array.findIndex=function(__property,__value){var isReg=!1,ev,prop;__value instanceof RegExp&&(isReg=!0);for(var i=0;i<this.length;i++){prop=null,ev="this["+i+"]."+__property;try{prop=eval(ev)}catch(t){}if(null!==prop)if(isReg){if(prop.match(__value))return{index:i}}else if(prop===__value)return{index:i}}return!1},array.find=function(t,e,r){var i=0,a=new OGX.List,s=!1;e instanceof RegExp&&(s=!0),void 0===r&&(r=0);for(var n=0;n<this.length;n++)if(s?this[n][t].match(e)&&(a.push(this[n]),i++):this[n][t]===e&&(a.push(this[n]),i++),r>0&&i===r)return 1===r?a[0]:a;return!!a.length&&a},array.swap=function(t,e){var r=this[t];this[t]=this[e],this[e]=r},array.cache=function(){indexes||(indexes={});var t=[],e=[];if(arguments.length>1){for(var r=0;r<arguments.length;r++)t.push(arguments[r]);t.sort(),t=t.join("|")}else t=arguments[0];indexes.hasOwnProperty(t)||(indexes[t]={});for(var i=0;i<this.length;i++){e=[];for(r=0;r<arguments.length;r++)e.push(this[i][arguments[r]]);e.sort(),e=e.join("|"),indexes[t].hasOwnProperty(e)||(indexes[t][e]=[]),indexes[t][e].push(this[i])}return!0},array.uncache=function(t){if(!indexes)return!1;var e=t;return arguments.length>1&&(e=arguments.sort().join("|")),!!indexes.hasOwnProperty(e)&&(delete indexes[e],!0)},array.deleteProperty=function(t){for(var e=0,r=0;r<this.length;r++)this[r].hasOwnProperty(t)&&(delete this[r][t],e++);return indexes&&this.rebuild(),e},array.rebuild=function(t){if(Array.isArray(t))for(var e=0;e<t.length;e++)delete indexes[t[e]],this.cache(t[e]);else if(indexes)for(var r in indexes)delete indexes[r],this.cache.apply(this,r.split("|"))},array.read=function(t,e,r){var i,a,s=arguments;if(void 0===r&&(r=0),!indexes)return!1;if(!s.length)return indexes;if("object"==typeof t){for(var n in r=s[1],i=[],a=[],t)i.push(n),a.push(t[n]);i.sort(),i=i.join("|"),a.sort(),a=a.join("|")}else i=t,a=e;return!(!indexes.hasOwnProperty(i)||!indexes[i].hasOwnProperty(a))&&(r?r>1?indexes[i][a].slice(0,r):indexes[i][a][0]:indexes[i][a])},array.clear=function(){indexes=!1,filterCount=0,this.length=0},array.unique=function(__prop,__as_object,__new_props){void 0===__as_object&&(__as_object=!0),void 0===__new_props?__new_props=[__prop]:Array.isArray(__new_props)||(__new_props=[__new_props]);var q={};q[__prop]={regex:/(.){1,}/};for(var l=this.get(),ar=[],final=new OGX.List,o,ev,i=0;i<l.length;i++){ev=null;try{ev=eval("l[i]."+__prop)}catch(t){}if(ev&&!ar.includes(ev)&&(ar.push(ev),__as_object)){o={};for(var j=0;j<__new_props.length;j++)o[__new_props[j]]=ev;final.push(o)}}return __as_object?final:ar},array.order=function(t,e){array.sort(dynamicSort(t,e))},array.group=function(t,e,r){if(Array.isArray(t))return array.groupm(t,e,r);for(var i,a={},s=0;s<this.length;s++)(i=extract(this[s],t,e,r))&&(i=i.split(".").pop(),a.hasOwnProperty(i)||(a[i]=new OGX.List),a[i].push(this[s]));return a},array.groupm=function(t,e,r){return function i(a,s){var n=new OGX.List(a),o=e,f=r;void 0!==e&&Array.isArray(e)&&(o=e[s]),void 0!==r&&Array.isArray(r)&&(f=r[s]);var l=n.group(t[s],o,f);if(s+1<=t.length-1)for(var h in l)l[h]=i(l[h],s+1);return l}(this,0)},array.filters={},array.addFilter=function(t,e,r){this.filters.hasOwnProperty(t)||(this.filters[t]=[]);var i={};return"function"==typeof e?i.function=[e,r]:i[e]=r,this.filters[t].push(i),filterCount++,!0},array.removeFilter=function(t){return!!this.filters.hasOwnProperty(t)&&(filterCount-=this.filters[t].length,delete this.filters[t],!0)},array.getFilters=function(){return this.filters},array.resetFilters=function(){this.filters={},filterCount=0},array.setFilters=function(t){for(var e in this.resetFilters(),t)for(var r=0;r<t[e].length;r++)for(var i in t[e][r])array.addFilter(e,i,t[e][r][i])},array.setFilteringMode=function(t){filterMode=t},array.get=function(t,e,r,i,a){void 0===e&&(e=!1),void 0===r&&(r=!1),"number"==typeof r&&(i=r,r=!1),void 0===i&&(i=0),void 0===a&&(a=!1);var s=this.getFilters();for(var n in this.resetFilters(),t){if("object"!=typeof t[n]){var o;o={eq:t[n]},t[n]=o}for(var f in t[n])this.addFilter(n,f,t[n][f])}var l=this.filter(i,a);if(this.resetFilters(),this.setFilters(s),a)return l;if(1===i)return!!l.length&&l[0];if(e)for(var n in e){l.order(n,e[n]);break}return r?(!Array.isArray(r)&&(r=[r]),l.group.apply(l,r)):l},array.unset=function(t,e){void 0===e&&(e=0);var r=new OGX.List,i=this.get(t,null,null,e,!0);if(i)for(var a=0;a<i.length;a++)r.push(this.delete(i[a]-r.length));return 1===e&&r.length?r[0]:r},array.update=function(__filterobj,__updateobj,__strict,__limit){void 0===__strict&&(__strict=!1),void 0===__limit&&(__limit=0);var filtered=this.get(__filterobj,null,__limit);if(filtered&&(Array.isArray(filtered)||(filtered=[filtered]),filtered.length)){for(var affected_indexes=[],idx,ev,i=0;i<filtered.length;i++){if("function"==typeof __updateobj)__updateobj(filtered[i]);else for(var a in __updateobj)ev=doEval("__o."+a,filtered[i]),__strict&&void 0===ev||eval("filtered[i]."+a+"=__updateobj[a]");idx=matchesCache(filtered[i]),idx&&-1===affected_indexes.indexOf(idx)&&affected_indexes.push(idx)}return indexes&&affected_indexes.length&&setTimeout((()=>{that.rebuild(affected_indexes)}),0),filtered}return[]},array.filter=function(__limit,__as_position){void 0===__limit&&(__limit=0),void 0===__as_position&&(__as_position=!1);for(var ar=[],positions=[],isDate,isString,isNum,isArray,isObject,hasFilters=!1,reg=/[0-9]{4}\-[0-9]{2}\-[0-9]{2}( [0-9]{2}\:[0-9]{2}\:[0-9]{2})?/g,isMatch=!1,matches=0,str,o,err,counter,total,i=0;i<this.length;i++)for(var a in isMatch=!0,matches=0,this.filters){err=!1,hasFilters=!0;try{o=null,str="this["+i+"]."+a,o=eval(str)}catch(t){err=!0}var exist_filter=!1;for(var j in this.filters[a])for(var b in this.filters[a][j])if("exist"===b){exist_filter=!0,isMatch="undefined"===o&&!this.filters[a][j][b]||o&&this.filters[a][j][b],isMatch&&matches++;break}if(!exist_filter)if(err||void 0===o)isMatch=!1;else{isDate=!1,isString=!1,isNum=!1,isArray=Array.isArray(o),isObject=!isArray&&"object"==typeof o,isArray?"string"==typeof o[0]?(isString=!0,o[0].match(reg)&&(isDate=!0)):isNum="number"==typeof o[0]:"string"==typeof o?(isString=!0,o.match(reg)&&(isDate=!0)):isNum="number"==typeof o;for(var j=0;j<this.filters[a].length;j++)for(var b in this.filters[a][j]){if(String(this.filters[a][j][b]).length)if("function"===b)isMatch=this.filters[a][j][b][0](this[i],this.filters[a][j][b][1]),isMatch&&matches++;else switch(b){case"eq":if(isDate){if("string"!=typeof this.filters[a][j][b]||!this.filters[a][j][b].match(reg)){isMatch=!1;break}moment(o).format("YYYY-MM-DD")!==moment(this.filters[a][j][b]).format("YYYY-MM-DD")?isMatch=!1:matches++}else if(isString){if("string"!=typeof this.filters[a][j][b]){isMatch=!1;break}o.toLowerCase()!==String(this.filters[a][j][b]).toLowerCase()?isMatch=!1:matches++}else o!==this.filters[a][j][b]?isMatch=!1:matches++;break;case"eqjson":JSON.stringify(o)!==JSON.stringify(this.filters[a][j][b])?isMatch=!1:matches++;break;case"neq":if(isDate){if("string"!=typeof this.filters[a][j][b]||!this.filters[a][j][b].match(reg)){isMatch=!0,matches++;break}moment(o).format("YYYY-MM-DD")===moment(this.filters[a][j][b]).format("YYYY-MM-DD")?isMatch=!1:matches++}else if(isString){if("string"!=typeof this.filters[a][j][b]){isMatch=!0,matches++;break}o.toLowerCase()===this.filters[a][j][b].toLowerCase()?isMatch=!1:matches++}else o===this.filters[a][j][b]?isMatch=!1:matches++;break;case"in":if((isString||isNum)&&Array.isArray(this.filters[a][j][b])){isMatch=!1;for(var k=0;k<this.filters[a][j][b].length;k++)if(isString){if(-1!==o.indexOf(String(this.filters[a][j][b][k]))){isMatch=!0;break}}else if(isNum&&o===this.filters[a][j][b][k]){isMatch=!0;break}isMatch&&matches++}else if(isString||isNum)if(isArray)isString&&-1===o.indexOf(String(this.filters[a][j][b]))||isNum&&o!==this.filters[a][j][b]?isMatch=!1:matches++;else{if(isString&&("string"!=typeof o||"string"!=typeof this.filters[a][j][b])){isMatch=!1;break}isString&&-1===o.toLowerCase().indexOf(this.filters[a][j][b].toLowerCase())||isNum&&o!==this.filters[a][j][b]?isMatch=!1:matches++}else if(isArray)-1===o.indexOf(this.filters[a][j][b])?isMatch=!1:matches++;else if(isObject){for(var p in counter=0,total=0,this.filters[a][j][b])total++,o.hasOwnProperty(p)&&-1!==String(o[p]).toLocaleLowerCase().indexOf(String(this.filters[a][j][b][p]).toLowerCase())&&counter++;isMatch=total===counter,isMatch&&matches++}break;case"nin":if(Array.isArray(this.filters[a][j][b])){for(var k=0;k<this.filters[a][j][b].length;k++)if(isString){if("string"!=typeof this.filters[a][j][b][k]){isMatch=!1;break}if(-1!==o.indexOf(this.filters[a][j][b][k])){isMatch=!1;break}}else if(isNum&&o===this.filters[a][j][b][k]){isMatch=!1;break}isMatch&&matches++}else isString&&"string"==typeof this.filters[a][j][b]?-1!==o.toLowerCase().indexOf(this.filters[a][j][b].toLowerCase())&&(isMatch=!1):isNum?o===this.filters[a][j][b]&&(isMatch=!1):-1!==o.indexOf(this.filters[a][j][b])&&(isMatch=!1),isMatch&&matches++;break;case"gt":if(isDate){if("string"!=typeof this.filters[a][j][b]||!this.filters[a][j][b].match(reg)){isMatch=!1;break}moment(o).unix()<=moment(this.filters[a][j][b]).unix()?isMatch=!1:matches++}else{if("number"!=typeof this.filters[a][j][b]){isMatch=!1;break}o<=this.filters[a][j][b]?isMatch=!1:matches++}break;case"gte":if(isDate){if("string"!=typeof this.filters[a][j][b]||!this.filters[a][j][b].match(reg)){isMatch=!1;break}moment(o).unix()<moment(this.filters[a][j][b]).unix()?isMatch=!1:matches++}else{if("number"!=typeof this.filters[a][j][b]){isMatch=!1;break}o<this.filters[a][j][b]?isMatch=!1:matches++}break;case"lt":if(isDate){if("string"!=typeof this.filters[a][j][b]||!this.filters[a][j][b].match(reg)){isMatch=!1;break}moment(o).unix()>=moment(this.filters[a][j][b]).unix()?isMatch=!1:matches++}else{if("number"!=typeof this.filters[a][j][b]){isMatch=!1;break}o>=this.filters[a][j][b]?isMatch=!1:matches++}break;case"lte":if(isDate){if("string"!=typeof this.filters[a][j][b]||!this.filters[a][j][b].match(reg)){isMatch=!1;break}moment(o).unix()>moment(this.filters[a][j][b]).unix()?isMatch=!1:matches++}else{if("number"!=typeof this.filters[a][j][b]){isMatch=!1;break}o>this.filters[a][j][b]?isMatch=!1:matches++}break;case"btw":if(isDate){if("string"!=typeof this.filters[a][j][b]||!this.filters[a][j][b].match(reg)){isMatch=!1;break}moment(this.filters[a][j][b][0]).unix()>moment(o).unix()||moment(this.filters[a][j][b][1]).unix()<moment(o).unix()?isMatch=!1:matches++}else{if("number"!=typeof this.filters[a][j][b]){isMatch=!1;break}this.filters[a][j][b][0]>o||this.filters[a][j][b][1]<o?isMatch=!1:matches++}break;case"substr":o.toLowerCase().substr(this.filters[a][j][b][0],this.filters[a][j][b][1]).toLowerCase()!==this.filters[a][j][b][2].toLowerCase()?isMatch=!1:matches++;break;case"regex":o.toString().match(this.filters[a][j][b])?matches++:isMatch=!1;break;case"size":isArray&&(o.length!==this.filters[a][j][b]?isMatch=!1:matches++);break;case"empty":isArray&&(!!o.length===this.filters[a][j][b]?isMatch=!1:matches++)}else matches++;if(!isMatch)break}}if("or"===filteringMode?isMatch&&(ar.push(this[i]),positions.push(i)):matches===filterCount&&(ar.push(this[i]),positions.push(i)),__limit&&ar.length===__limit)return __as_position?positions:OGX.List.apply(null,ar)}return __as_position?positions:hasFilters?OGX.List.apply(null,ar):array},array},OGX.Object=function(){"use strict";var t=new OGX.List,e=new OGX.List;function r(t){for(var e=t.split("."),r=OGX,i=0;i<e.length;i++)void 0!==r[e[i]]&&(r=r[e[i]]);return r}e.cache("_NAME_","id"),this.isRegistered=function(t,e){return typeof("undefined"!==this.register[t][e])},this.getExtend=function(e){var r=t.get({main:{eq:e}},null,1);return!!r&&r.extends},this.getExtends=function(e){var r=[],i=t.get({main:{eq:e}},null,1);if(i){var a;r=r.concat(i.extends);for(var s=0;s<i.extends.length;s++)(a=this.getExtends(i.extends[s]))&&(r=r.concat(a))}var n=[];for(s=0;s<r.length;s++)n.includes(r[s])||n.push(r[s]);return n},this.register=function(){var e=Array.prototype.slice.call(arguments),r=e.shift();t.push({main:r,extends:e})},this.create=function(t,i){void 0===i&&(i={});var a=this.getExtends(t),s=!1,n=null,o=null;if(a.length){var f,l,h=r(t);h.prototype=Object.create({}),(f=[]).push(h.prototype);for(var c=0;c<a.length;c++)void 0!==(l=r(a[c]))&&f.push(l.prototype);Object.assign.apply(null,f),h.prototype.constructor=h,a.includes("View")||a.includes("Controller")||a.includes("Stage")?(o=(f=t.split(".")).pop(),n=f.join(".").slice(0,-1)):n=t,s=new h(i)}else OGX.hasOwnProperty(t)&&(s=new OGX[t](i));return o?(s._CLASS_=o,s._NAME_=n):s._NAME_=t,OGX.hasOwnProperty(t)&&OGX[t].hasOwnProperty("FLOAT")&&OGX[t].FLOAT&&(s.floating=!0),!!s&&(e.insert(s),s)},this.cache=function(t){if(void 0===t)return e;e.insert(t)},this.uncache=function(t){e.findDelete("id",t.id)},this.get=function(t,r,i){return e.get(t,r,i)},this.destroy=function(t,r){void 0===r&&(r=!0),"function"==typeof t.blur&&t.blur(),"function"==typeof t.destroy&&t.destroy(),"function"==typeof t.__destroy&&t.__destroy(),r&&t.clear(),t.el&&t.el.remove(),t.parent&&t.parent.nodes.findDelete("id",t.id,1),e.findDelete("id",t.id,1)},this.genId=function(){return"u"+(new Date).getTime()+Math.round(1e3*Math.random())}},"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){"use strict";if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(t),i=1;i<arguments.length;i++){var a=arguments[i];if(null!=a)for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(r[s]=a[s])}return r},writable:!0,configurable:!0});if(void 0===OGX)var OGX={};function require(){OGX.Object.register.apply(null,arguments)}function construct(__that,__cls){var ext=OGX.Object.getExtend(__cls);for(var a in ext)eval("OGX."+ext[a]).call(__that,arguments.callee.caller.arguments[0])}OGX.Object=new OGX.Object;if(OGX.OML=function(e){"use strict";var t=OGX.Data.merge({max_time:0,max_depth:2,render_time:!1},e,!0,!1,!0),n=!1,o=null,r={},i={},a=new OGX.List;function s(){n=!0}function d(e,t){var n,o,r=[];for(var i in t)if(n=/^(\S*)\:Bind$/g.exec(i))if(o=-1!==n[1].indexOf(",")?n[1].split(","):n[1],Array.isArray(t[i]))for(var a=0;a<t[i].length;a++)t[i][a].property=o,r.push({uxi:e,config:t[i][a]});else t[i].property=o,r.push({uxi:e,config:t[i]});return r}function l(e){setTimeout((()=>{f(e.config),e.uxi.bind(e.config)}),0)}function u(e){return e.hasOwnProperty("node:OML")||e.hasOwnProperty("node:OML:OSE")||e.hasOwnProperty("instance")&&e.instance||e.hasOwnProperty("scroll")&&e.scroll}function p(e,t){if("string"==typeof t["node:OML"]){var n=null;t.hasOwnProperty("data")&&(n=t.data),t["node:OML"]=c(t["node:OML"],n)}else if(Array.isArray(t["node:OML"]))for(var o=0;o<t["node:OML"].length;o++)"string"==typeof t["node:OML"][o]&&(t["node:OML"][o]=c(t["node:OML"][o]));else if("object"==typeof t["node:OML"])for(var r in t["node:OML"])if(-1!==r.indexOf(":OML")&&"string"==typeof t["node:OML"][r]){if(/((^default)? ?[\.#]+)|(^default)/.test(r)){var i=r.replace("OML",""),a=c(t["node:OML"][r]);for(var s in a)i+=s.split(":").pop(),t["node:OML"][i]=a[s],delete t["node:OML"][r];r=i}-1!==r.indexOf(":OML")&&(t["node:OML"][r.replace(":OML","")]=c(t["node:OML"][r]),delete t["node:OML"][r])}return e.__proto__.hasOwnProperty("placeholder")&&e.placeholder(t),t}function c(e,t){return void 0===t&&(t={}),0===e.indexOf("{{")?OGX.OSE.exec(e,t):OGX.Data.clone(OGX.Cache.read("oml",e))}function f(e,n,o){var a,s=0;return function e(d){if(!(Array.isArray(d)||"object"!=typeof d||s>=t.max_depth)){var l=!1;for(var u in d)-1!==u.indexOf(":OSE")?(a=u.split(":OSE").shift(),"string"!=typeof d[u]?d[a]=d[u]:d[a]=OGX.OSE.exec(d[u],n,r,o,i),delete d[u],l||(l=!0,s++),e(d[a])):-1!==u.indexOf(":")||"object"!=typeof d[u]||Array.isArray(d[u])||d[u]instanceof HTMLElement||d[u]instanceof jQuery||(l||(l=!0,s++),e(d[u]))}}(e),e}function h(e,t){switch(e){case"scope":return OGX.Scope.fork(t);default:return OGX.OSE.fork(e,t)}}function O(e,t,n){var o;if(n.hasOwnProperty("isUxi"))n.parent&&n.detach(),n.floating?n.attach(e,e.el):n.attach(e,t);else if("*"===t){var r=null,i=null;if(n.hasOwnProperty("parent"))if(n.parent.hasOwnProperty("lookup")&&n.parent.hasOwnProperty("lookdown")){if(r=e.lookup(n.parent.lookup)){var a=r.lookdown(n.parent.lookdown);a&&(r=a)}}else n.parent.hasOwnProperty("lookup")?r=e.lookup(n.parent.lookup):n.parent.hasOwnProperty("lookdown")&&(r=e.lookdown(n.parent.lookdown));else r=e;if(r&&(o=r.el),n.hasOwnProperty("parent")&&n.parent.hasOwnProperty("el")?o=n.parent.el:r.hasOwnProperty("pholders")&&r.pholders&&(o=r.pholders[0]),n.hasOwnProperty("target"))if(n.target.hasOwnProperty("lookup")&&n.target.hasOwnProperty("lookdown")){if(i=e.lookup(n.target.lookup)){var s=i.lookdown(n.target.lookdown);s&&(i=s)}}else n.target.hasOwnProperty("lookup")?i=e.lookup(n.target.lookup):n.target.hasOwnProperty("lookdown")&&(i=e.lookdown(n.target.lookdown));r&&i&&(i.detach(),i.attach(r,o))}else{var d=app.cfind(null,t);if(d){if(d.parent&&d.detach(),n.hasOwnProperty("parent")){var l=OGX.Object.get(n.parent,null,1);l&&(e=l)}o=e.el,n.hasOwnProperty("el")?o=n.el:e.hasOwnProperty("pholders")&&e.pholders&&(o=e.pholders[0]),d.attach(e,o)}}}this.maxDepth=function(e){if(void 0===e)return t.max_depth;t.max_depth=e},this.maxRenderTime=function(e){if(void 0===e)return t.max_time;t.max_time=e},this.get=function(e){return OGX.Cache.read("oml",e)},this.make=function(e,t,n){var o={};return o[e+":"+t]=n,o},this.parse=function(e){return"string"==typeof e&&("{"!==e.substr(0,1)&&(e="{"+e+"}"),e=JSON.parse(e)),e},this.rename=function(e,t,n){function o(e,t,n){var o={};for(var r in e)o[r.replace(t,n)]=e[r];return o}void 0===n&&(n="default"),Array.isArray(n)||(n=[n],t=[t]);for(var r=0;r<n.length;r++)e=o(e,n[r],t[r]);return e},this.isOML=function(e){if("string"==typeof e&&0===e.trim().indexOf("{")&&(e=JSON.parse(e)),"object"==typeof e&&!Array.isArray(e))for(var t in e)if(-1!==t.indexOf(":"))return!0;return!1},this.result=function(e,t){if(e){if(void 0===t){var n=a.get({id:{eq:e}},null,1);return!!n&&n.result}a.findDelete("id",e),a.insert({id:e,result:t})}else a=new OGX.List},this.getNodeClass=function(e){for(var t in e)return t.split(":")[1];return null},this.getNodeId=function(e){for(var t in e)if(e[t].hasOwnProperty("id"))return e[t].id;return null},this.getNodeById=function(e,t){return this.getNodeByProp(e,"id",t)},this.getNodeByName=function(e,t){return this.getNodeByProp(e,"name",t)},this.getNodeByProp=function(e,t,n){return function e(o){var r;for(var i in o){if(o[i].hasOwnProperty(t)&&o[i][t]===n)return o[i];if(o[i].hasOwnProperty("node:OML"))if(Array.isArray(o[i]["node:OML"])){for(var a=0;a<o[i]["node:OML"].length;a++)if(r=e(o[i]["node:OML"][a]))return r}else if(r=e(o[i]["node:OML"]))return r}return!1}(e)},this.make=function(e,t,n){void 0===n&&(n={});var o={};return o[e+":"+t]=n,o},this.replaceDataRecursive=function(e,t,n){function o(e){var r,s;for(var d in e)if(-1!==d.indexOf(":OSE"))r=d.split(":OSE"),(s=a(e[d],t,n))&&(e[r[0]]=s,delete e[d],o(e[r[0]]));else if("node:OML"===d)if("string"==typeof e[d]&&0===e[d].indexOf("{{"))e[d]=OGX.OSE.exec(e[d]),i(e[d]);else if(Array.isArray(e[d]))for(var l=0;l<e[d].length;l++)i(e[d][l]);else i(e[d])}function i(e){var r;for(var i in e)-1!==i.indexOf("{{")&&(r=a(i,t,n))&&(e[r]=e[i],delete e[i],i=r),o(e[i])}function a(e,t,n){var o,i,a=/{{([\S ]+)}}/gi;for(n&&(r[n]=t);o=a.exec(e);){if(i=OGX.OSE.exec(o[0],t,r),-1!==["string","number"].indexOf(typeof i))e=e.replace(o[0],i);else if(-1!==["boolean","object"].indexOf(typeof i))return i;a.lastIndex=0}return e}i(e)},this.render=function(e,r,i,a,g){return r=(r=p(e,{"node:OML":r}))["node:OML"],"function"!=typeof g&&(g=!1),t.max_time&&(n=!1,o&&clearTimeout(o),o=setTimeout(s,t.max_time)),function(e,t,o,r,i){var a=[],s=((new Date).getTime(),[]),g=[];function v(e,t){var i,l,m,w,y,x,b,G,M,P,L,X,_,k,S;if(!n)if(Array.isArray(e))for(var A=0;A<e.length;A++)v(e[A],t);else for(G in e)if((L=/((?!:)[\S ]+):(\S+)/gi.exec(G))&&(i=L[1],void 0!==(l=m=L[2])&&(-1!==i.indexOf("{{")&&"object"==typeof e[G]["data:OML"]&&(i=OGX.Templater.make(i,e[G]["data:OML"]),delete e[G]["data:OML"]),"string"==typeof e[G]&&0===e[G].indexOf("{{")&&(e[G]=c(e[G])),-1===["Route","OML"].indexOf(l)))){switch(m.indexOf(".")>0&&(m=m.substr(0,m.indexOf(".")-1)),x=e[G],e[G].hasOwnProperty("node:OML")&&(e[G]=p(e,e[G])),y=!0,w=!0,X=!1,k=!1,m){case"Function":return w=!1,x.parent=t,x.fnc=i,x=f(x,o,r),void OGX.Fonction(x,o,r);case"Uxi":return void O(t,i,e[G]);case"Fork":(P=h(i,e[G]))&&v(P,t),w=!1,y=!1;break;case"Html":x.el=i,x.html=e[G].html,(w=u(x))||(x.template=!1);break;case"Template":x.template=l.split(".")[1],x.el=i,w=u(x),l="Html";break;case"Controller":x.id=i,x.enabled=!1,k=!0;break;case"Scroller":S=$(i),x.el=i,x.content=S.html(),S.empty();break;default:-1!==[".","#"].indexOf(i.substr(0,1))?x.el=i:("node"!==i&&(x.id=i),x.el=t.el[0],x.parent=t,x.floating=!0)}y&&(x=f(x,o,r)),M=!1,w?(b=OGX.Object.create(l,x),s.push(b),t.add(b),M=b):X?(X.blur(),$(i).html(_),X.el=$(i),t.add(X),setTimeout((()=>{t.blured||X.focus()}),0)):(M=t,"Html"===l&&OGX.HtmlRender(x)),M&&e[G].hasOwnProperty("node:OML")&&!X?v(e[G]["node:OML"],M):M&&-1!==G.indexOf(":Point")&&v(b.oml(),b),w&&(b.parent=t,"function"==typeof b.construct&&(k?g.push({object:b,data:[o]}):b.construct.apply(b,[o]))),void 0!==b&&b&&!k&&(a=a.concat(d(b,e[G])))}}v(t,e),!e.floating&&e.parent&&e.focus(1);a.length&&function(e){for(var t=0;t<e.length;t++)l(e[t])}(a);(function(e){for(var t=0;t<e.length;t++)e[t].object.construct.apply(e[t].object,e[t].data),e[t].object.enabled=!0,e[t].object.parent.blured||e[t].object.focus()})(g),i&&i(s);return s}(e,r,i,a,g)}},void 0===OGX)var OGX={};OGX.Stages={},OGX.Views={},OGX.Controllers={},require("Core","Uxi","Touch"),OGX.Core=function(e){construct(this,"Core");var t,n=this,o=OGX.Data.merge(e,{encrypted:!1,exportable:!1,max_render_time:300,max_depth:2,render_time:!1,disable_context:!1,unique:!1,ready:null,exit:!0}),r={jwt:!0,scope:["public"],routing:{},stages:{always_on:!1,blured:!0,closeable:!1,anim:!1},overlays:{delay:200,anim:"fade"},popups:{blured:!1,sleeping:!1},splash:{enabled:!1,image:null,color:null,auto_hide:!1,hide_timeout:0},theater:!1,observe:!1,chromeos:!1},i=!1,a=!1,s=null,d=!1,l=/(iPhone|iPod|iPad)/i.test(navigator.userAgent),u=matchMedia("(prefers-color-scheme: dark)").matches,p=null,c=!1,f=null;function h(e){n.remove("Popup",e.id),e.cb&&e.cb(e.params),i.el.trigger(OGX.Popup.CLOSE,e.id)}function O(e){e.matches}function g(){"function"==typeof n.construct&&n.construct(),function(e){var o,r,i,a,s=0,d=0;for(var l in t.vapps)s++;for(l in t.vapps)r=(o=l.split(":"))[0],i=o[1],(a=OGX.Data.merge(t.vapps[l],t.stages,!1,!0)).id=r,a.hasOwnProperty("node:OML")&&a["node:OML"]?(n.observeOnce({childList:!0,subtree:!0},(()=>{++d===s&&e()})),n.addStage(i,a)):(n.addStage(i,a),++d===s&&e())}(v)}function v(){t.theater&&function(){for(var e=n.gather("Stage"),o=[],r=0;r<e.length;r++)e[r].theater&&o.push(e[r]);t.theater.stages=o,t.theater.el="body",n.theater=n.create("Theater",t.theater)}(),t.routing&&(n.router=new OGX.Router(t.routing),n.router.init(),n.router.start()),!0,$(document).trigger(OGX.App.READY),"function"==typeof o.ready&&o.ready()}function m(e){return e}function w(e,t){var n,o=e.split(" ");return o.sort(),n=t?"in":"out","ogx_stage_"+o.join("_")+"_"+n}function y(){$(window).off(n.touch.down+" scroll",y),c=!0}function x(e){o.unique&&localStorage.removeItem("ogx"),!o.exit&&c&&(e.preventDefault(),e.returnValue=!0)}function b(){OGX.Net=new OGX.Net({ios:l,encrypted:o.encrypted,key:f,app:n}),OGX.Net.load("app.json",G)}function G(e){if(!o.encrypted||(e=function(e){return e=OGX.Data.decrypt(e,f),JSON.parse(e)}(e))){if(o.disable_context&&(window.oncontextmenu=function(){return!1}),o.exportable||(delete OGX.Uxi.prototype.toOML,delete OGX.Controller.prototype.toOML,delete OGX.View.prototype.toOML),o.exit&&!o.unique||window.addEventListener("beforeunload",x),o.unique){var a="function"==typeof o.unique;if(!function(){var e=!1;(p=sessionStorage.getItem("ogx-tab"))?p=OGX.Data.decrypt(p):(p=(new Date).getTime()+"-"+Math.round(1e3*Math.random()),sessionStorage.setItem("ogx-tab",OGX.Data.encrypt(p)));var t=localStorage.getItem("ogx");return t?(t&&(t=OGX.Data.decrypt(t)),t&&("object"!=typeof t&&(t=JSON.parse(t)),t&&t.instance!==p?t.unix+1500<(new Date).getTime()&&(t={instance:p,unix:(new Date).getTime()},localStorage.setItem("ogx",OGX.Data.encrypt(JSON.stringify(t))),e=!0):e=!0)):(t={instance:p,unix:(new Date).getTime()},localStorage.setItem("ogx",OGX.Data.encrypt(JSON.stringify(t))),e=!0),e&&OGX.Workers.run(m,null,null,1e3,p,(function(e){var t={instance:e,unix:(new Date).getTime()};localStorage.setItem("ogx",OGX.Data.encrypt(JSON.stringify(t)))})),e}())return a&&o.unique(!1),void n.el.trigger(OGX.App.DUPLICATE);a&&o.unique(!0)}o.exit&&!o.unique||$(window).on(n.touch.down+" scroll",y),function(e){d=void 0!==window.ontouchstart,l&&$("body").addClass("ios"),t=OGX.Data.weld(e,r,!1,!1),n.el=$("body")}(e),OGX.Scope=new OGX.Scope(t.jwt),OGX.OML=new OGX.OML(o),t.splash.enabled&&(s=new OGX.Splash(t.splash)),OGX.Net.preload(t.preload,g),n.observeSize(!0,(()=>{i&&setTimeout((()=>{i.resize(!1),i.gather().forEach((e=>{void 0!==e.resize&&e.resize(!1)}))}),150)})),function(e){if(e){var t=window.matchMedia("(prefers-color-scheme: dark)");t.addListener(O)}else t.removeListener(O)}(!0)}}if(this.blured=!1,this.router=!1,this.exit=function(e){if(void 0===e)return o.exit;o.exit=e},this.version=function(e){OGX.Net.load("manifest.json",(t=>{"object"==typeof t&&t.hasOwnProperty("version")?e(t.version):e(!1)}))},this.isWebView=function(){return d},this.isTouch=function(){return this.touch.touchable()},this.iOS=function(){return l},this.getURL=function(){return this.router.url()},this.isDarkMode=function(){return u},this.toggleTheme=function(){var e="(prefers-color-scheme: ";return u?($("head").children('link[data="dark"]').attr("media",e+"light)"),$("head").children('link[data="light"]').attr("media",e+"dark)")):($("head").children('link[data="dark"]').attr("media",e+"dark)"),$("head").children('link[data="light"]').attr("media",e+"light)")),u=!u,this},this.moveNode=function(e,t,n){return e.detach(),e.attach(t,n),this},this.dropNode=function(e,t){var n,o;return[n,o]="string"==typeof e?[e,t]:[e._NAME_,e._CLASS_],delete OGX[n+"s"][o],this},this.addStage=function(e,n,o){void 0===o&&(o=!0),OGX.Data.merge(n,t.stages),n.el="body",n.enabled=!1;var r=OGX.Object.create(e,n);return this.add(r),o&&(n.hasOwnProperty("node:OML")?OGX.OML.render(r,n["node:OML"],null,null,(()=>{r.construct(n)})):r.construct(n)),n.enabled||r.sleep(),r},this.removeStage=function(e){var t=this.cfind("Stage",e);return!!t&&(t.destroy(),t.kill(),this.find("Stage",e,"remove"),!0)},this.getStage=function(e){if(void 0===e)return i||a;var t=this.find("Stage",e);return t||!1},this.showStage=function(e,t){if(!i||i.id!==e){var o=this.cfind("Stage",e);return o&&(void 0===t&&(t=o.anim?o.anim:!!a.anim&&a.anim),t?a?(o.enable(),o.wake(),o.show(),a.el.on("animationend",(function(){a.el.off("animationend"),n.el.trigger(OGX.Stage.SWAP,{old:a,new:o}),a.hide(),a.sleep(),o.el.removeClass(w(t,1)),a.el.removeClass(w(t,0)),i=a=o})),o.el.css("display","block"),o.el.addClass(w(t,1)),a.el.addClass(w(t,0))):(o.enable(),o.wake(),o.show(),o.el.css("display","block"),i=a=o):(a&&a.id!==o.id&&(a.hide(),a.sleep()),o.sleeping&&(o.enable(),o.wake()),o.el.css("display","block"),i=a=o,a.show())),this}},this.getWindow=function(e){return this.cfind("Window",e)},this.getWindows=function(){return this.gather("Window")},this.windowExists=function(e){return!1!==this.cfind("Window",e)},this.addWindow=function(e,n){var o;if((e=OGX.Data.merge(e,t.windows)).hasOwnProperty("data")?(o=e.data,delete e.data):o={},void 0===n||!n){if(!a)return!1;n=a}if(n){var r;if(e.el=n.el,e.parent=n,e.hasOwnProperty("node:OML")){e.hasOwnProperty("id")||(e.id=OGX.Object.genId());var i=void 0!==e.scroll&&e.scroll;if(i){delete e.scroll;var s=e["node:OML"];delete e["node:OML"]}var d=OGX.OML.make(e.id,"Window",e);i&&(d[e.id+":Window"]=e,d[e.id+":Window"]["node:OML"]=[{"default:Scroller":{"node:OML":s}}]),r=OGX.OML.render(n,d,o).shift(),i&&(r.scroller=r.children("Scroller")[0],r.scroll=!0)}else r=n.create("Window",e);return r}return!1},this.windowOpen=function(e){return this.cfind("Window",e).status===OGX.Window.OPEN},this.showWindow=function(e,n,o,r){!0===n&&(n=t.anim);var i=this.cfind("Window",e);return!!i&&(i.sleeping&&attachWindow(e),i.blured&&i.focus(),i.show(n,o,r),!0)},this.hideWindow=function(e,n,o,r){return!0===n&&(n=t.anim),"string"!=typeof e&&(e=this.findWindow(e).id),this.cfind("Window",e).hide(n,o,r),this},this.swapWindows=function(e,t){var n,o,r,i;return!(!this.windowExists(e)||!this.windowExists(t))&&(n=this.getWindow(e),o=this.getWindow(t),r=n.el.css("z-index"),i=o.el.css("z-index"),n.el.css("z-index",i),o.el.css("z-index",r),!0)},this.sleepWindow=function(e){return this.cfind("Window",e).sleep(),this},this.blurWindow=function(e){return this.cfind("Window",e).blur(),this},this.focusWindow=function(e){return this.cfind("Window",e).focus(),this},this.removeWindow=function(e){return this.find("Window",e,"remove")},this.removeWindows=function(e){for(var t=0;t<e.length;t++)this.removeWindow(e[t]);return this},this.removeAllWindows=function(e){void 0===e&&(e=[]);for(var t=this.gather("Window"),n=0;n<t.length;n++)e.includes(t[n].id)&&this.removeWindow(t[n].id);return this},this.findWindow=function(e){for(var t=e;t.hasOwnProperty("parent")&&t.parent;){if("Window"===t.parent._NAME_)return t.parent;t=t.parent}return!1},this.addPopup=function(e,n){var o;if(e.hasOwnProperty("data")?(o=e.data,delete e.data):o={},void 0!==n&&n||(n=i),e.el=n.el[0],e.parent=n,e.chromeos=t.chromeos,e.hasOwnProperty("anim")&&!0===e.anim&&(e.anim=t.popup.anim),e.hasOwnProperty("node:OML")){var r=void 0!==e.scroll&&e.scroll;if(r){delete e.scroll;var a=e["node:OML"];delete e["node:OML"]}e.hasOwnProperty("id")||(e.id=OGX.Object.genId());var s=OGX.OML.make(e.id,"Popup",e);r&&(s[e.id+":Popup"]=e,s[e.id+":Popup"]["node:OML"]=[{"default:Scroller":{"node:OML":a}}]),popup=OGX.OML.render(n,s,o).shift(),r&&(popup.scroll=!0,popup.scroller=popup.children("Scroller")[0])}else popup=n.create("Popup",e);return popup},this.removePopup=function(e,t,o,r,i){var s=!1;void 0===i&&(i=a,s=!0),void 0===o&&(o=!1),void 0===r&&(r=!1),void 0===t&&(t=!0);var d=null;return!!(d=s?i.find("Popup",e):n.cfind("Popup",e))&&(d.hide(t,h,{id:e,cb:o,params:r},null,!0),!0)},this.findPopup=function(e){var t;t=e instanceof HTMLElement?e:e.el;var n=$(t).parents(".ogx_popup");if(n.length){var o=$(n[0]).data("ogx-id");return this.cfind("Popup",o)}return!1},this.getVisiblePopups=function(){for(var e=this.gather("Popup"),t=[],n=0;n<e.length;n++)"visible"===e[n].el.css("visibility")&&t.push(e[n]);return t},this.popupExists=function(e){return!1!==this.cfind("Popup",e)},this.groupPopups=function(e,t,o){void 0===o&&(o={});var r={drag:!0,resize:!0,anim:!1,title:!1,icon:!1,icons:!1};o&&OGX.Data.merge(r,o,!0);var i=e.id,a=t.id,s=e.nodes.get({_NAME_:{eq:"Container"}},null,1),d=t.nodes.get({_NAME_:{eq:"Container"}},null,1);if(s&&d){var l=s.nodes.get({_NAME_:{eq:"Carousel"}},null,1),u=s.nodes.get({_NAME_:{eq:"Tabs"}},null,1),p=d.nodes.get({_NAME_:{eq:"Carousel"}},null,1),c=(g=d.nodes.get({_NAME_:{eq:"Tabs"}},null,1)).index(),f=l.panels().slice();e.nodes=new OGX.List;for(var h=0;h<f.length;h++)g.add(u[h]),k=f[h].instance?{"default:Uxi":f[h].instance}:{"default:Html":{html:f[h].html}},p.addNode(k,null,!1);c+=u.length,p.showPanel(c,!1),g.index(c),n.removePopup(e.id,!1,!1,!1,e.parent),$(document).trigger(OGX.Popup.GROUP,{popups:[i,a],popup:t})}else if(s||d){var O,g,v,m;s?(O=s.nodes.get({_NAME_:{eq:"Carousel"}},null,1),g=s.tabs,A=t,v=e):(O=d.nodes.get({_NAME_:{eq:"Carousel"}},null,1),g=d.tabs,A=e,v=t),A.nodes.length?((m=A.nodes[0]).detach(),A.nodes=new OGX.List,k={"default:Uxi":m}):k={"default:Html":{html:A.el.find(".ogx_popup_body").first().html()}};var w=A.title();n.removePopup(A.id,!1,!1,!1,A.parent),O.addNode(k,null,!0,!1,(function(){$(document).trigger(OGX.Popup.GROUP,{popups:[i,a],popup:v})})),g.icons()?g.add({label:w,icon:A.icon()}):g.add({label:w}),g.index(g.set().length-1)}else{var y=e.nodes;y=!!y.length&&y[0];var x,b,G=t.nodes;G=!!G.length&&G[0],y?(y.detach(),x={"default:Uxi":y}):x={"default:Html":{html:e.el.find(".ogx_popup_body").children().first().detach()}},G?(G.detach(),b={"default:Uxi":G}):b={"default:Html":{html:t.el.find(".ogx_popup_body").children().first().detach()}};var M=r.icon||e.group_icon||t.icon()||e.icon();"boolean"==typeof M&&(M=!1),r.icon=M;var P=r.icons||t.icons()||e.icons();"boolean"==typeof P&&(P=!1),!(P&&Array.isArray(P)&&P.length)&&(P=!1),r.icons=P,r.maximize=t.max||e.max,r.maximize_dbc=t.max_dbc||e.max_dbc,r.title=r.title||t.title()||e.title();var L=this.gather("Popup");L=L.get({id:{in:e.group}});var X=e.group+"_"+L.length,_=[{label:t.title()},{label:e.title()}];P&&(_[0].icon=t.icon(),_[1].icon=e.icon());var k={id:X,width:e.el.width(),height:e.el.height(),group:e.group,group_icon:e.group_icon,"node:OML":[{"default:Container":{index:1,tabs:{icons:P,remove:!0,list:_},"node:OML":[b,x]}}]};OGX.Data.merge(k,r,!0);var S=e.parent,A=n.addPopup(k,e.parent);this.removePopup(e.id,!1,!1,!1,S),this.removePopup(t.id,!1,!1,!1,S),$(document).trigger(OGX.Popup.GROUP,{popups:[i,a],popup:A})}return this},this.ungroupPopup=function(e,t,n,o,r){var i=e.nodes.get({_NAME_:{eq:"Container"}},null,1),a=e.icon(),s=e.icons(),d=i.tabs.val();"object"==typeof d&&void 0!==d.icon&&(a=d.icon);var l=i.carousel,u=l.getPanel(t),p=e.parent,c=e.width(),f=e.height(),h=e.resizable,O=e.dragable,g={};if(u.instance){var v=l.nodes.get({id:{eq:u.instance.id},_NAME_:{eq:u.instance._NAME_}},null,1);v&&(g["default:Uxi"]=v)}else g["default:Html"]={html:u.html};l.removePanel(t,!1),l.nodes.length?l.nodes.length:this.removePopup(l.parents("Popup",1).id,!1);var m=OGX.Object.genId(),w={id:m,group:e.group,title:n,resize:h,drag:O,width:c,height:f,icon:a,icons:s,"node:OML":[g]};if(void 0!==o){var y=e.el.position(),x=e.el.offset();w.x=y.left+(o-x.left),w.y=y.top+(r-x.top)}return this.addPopup(w,p),$(document).trigger(OGX.Popup.UNGROUP,{from_popup:e.id,from_index:t,to_popup:m}),this},this.addOverlay=function(e,t){return void 0===t&&(t=a),!!t&&(t.addOverlay(e),!0)},this.removeOverlay=function(e,t){return void 0===t&&(t=a),t&&t.removeOverlay(e),this},this.theater=!1,this.getJSON=function(e){return OGX.Data.clone(OGX.Cache.read("json",e))},this.getOML=function(e){return OGX.Data.clone(OGX.Cache.read("oml",e))},this.goto=function(e,t){return this.router.goto(e,t)},this.splash=function(){return s},this.splash.hide=function(){if(!s)return!1;s.hide((()=>{s.destroy(),s=null}))},this.getDefaults=function(e){return t[e]},o.encrypted)if("function"==typeof o.encrypted){var M=o.encrypted();o.encrypted=!0,M.then((e=>{f=e,setTimeout(b,0)}),(()=>{}))}else(f=document.cookie.match("(^|[^;]+)\\s*ogx_key\\s*=\\s*([^;]+)"))&&(f=decodeURIComponent(f.pop()),document.cookie="ogx_key=; expires=Thu, 01 Jan 1970 00:00:01 GMT;"),setTimeout(b,0);else setTimeout(b,0)},OGX.App=function(e){"use strict";return void 0===e&&(e={}),e.el="document",e.always_on=!0,e.hasOwnProperty("core")&&e.core||(e.core="Core"),OGX.Core=OGX.Object.create(e.core,e),OGX.Core},OGX.App.LOADING="AppLoading",OGX.App.READY="AppReady",OGX.App.DUPLICATE="AppDuplicate";OGX.Audio=function(){"use strict";var e=!1;this.get=function(e){var t;return!!(t=OGX.Cache.read("snd",e))&&t},this.play=function(t,i,n){void 0===i&&(i=1),void 0===n&&(n=!1);var o=this.get(t);return!!o&&(o.hasOwnProperty("howl")?(o.howl.volume(i),o.howl.loop(n)):o.howl=new Howl({src:["snd/"+o.file],loop:n,volume:i}),e?o.howl.play():setTimeout((()=>{o.howl.play()}),0),!0)},this.stop=function(e){if(void 0!==e){var t=this.get(e);if(t)return t.howl.stop(),!0}return!1},this.prepare=function(){for(var e=OGX.Cache.get({ext:{eq:"snd"}}),t=0;t<e.length;t++)e[t].hasOwnProperty("howl")||(e[t].howl=new Howl({src:["snd/"+e[t].file]}))},$(document).on("touchstart mousedown",(function t(){e=!0,$(document).off("touchstart mousedown",t)}))},OGX.Audio=new OGX.Audio,OGX.Bind=function(e){"use strict";var t=this,i={object:null,event:null,mode:"eq",action:"filter",property:null,remote_property:null,function:null,min_length:0,convert:!0},n={};function o(e,i){var n,o,s,l,c="string"==typeof i.object;function d(e,n){if("object"==typeof n){if(function(e,i){for(var n in e.__p)t.unbindFilter(n);e.__p={}}(i),i.remote_property&&Array.isArray(i.remote_property)){var s=0;for(var l in n)i.__p[i.remote_property[s]]=!0,o(i.remote_property[s],i.mode,n[l]),r(i.remote_property[s],n[l]),s++;return}if(i.remote_property){var c=i.object.bindValue();n="object"==typeof c?Array.isArray(c)?(c=new OGX.List(c)).unique(i.remote_property,!1):c[i.remote_property]:c,o(i.property,i.mode,n,i.function),r(i.property,n),a(i,n)}else{if(Array.isArray(i.property)){s=0;for(var l in n)i.__p[i.property[s]]=!0,o(i.property[s],i.mode,n[l],i.function),r(i.property[s],n[l]),s++;return}o(i.property,i.mode,n,i.function),r(i.property,n),a(i,n)}}else i.remote_property?(o(i.remote_property,i.mode,n,i.function),r(i.remote_property,n)):(o(i.property,i.mode,n,i.function),r(i.property,n))}function u(e){if(i.min_length&&e.target.value.length<i.min_length&&e.target.value.length)return!1;var t=e.target.value;i.convert&&(t=OGX.Data.stringToVal(t)),o(i.property,i.mode,t,i.function)}switch(c?(e&&(i.object={el:$(i.object)},n=i.event),s=u):(e&&(n=OGX[i.object._NAME_].BIND),s=d),i.action){case"render":o=t.bindRender;break;case"filter":o=t.bindFilter}e?(i.object.el.on(n,s),c?u({target:{value:i.object.el.val()}}):(null!==(l=i.object.bindValue?i.object.bindValue():i.object.val())&&Array.isArray(l)&&l.hasOwnProperty("insert")&&(l=JSON.parse(JSON.stringify(l))),null!==l&&d(0,l))):i.object.el.off(n,s)}function a(e,t){for(var i in t)e.__p[i]=!0}function r(e,i){t.el.trigger(OGX.Bind.FILTER,{property:e,value:i})}this.bind=function(e){return!!(e=OGX.Data.merge(i,e,!0,!0,!0)).property&&(e.object&&"string"==typeof e.object&&(e.event="input change",e.action="filter"),e.__p={},n.hasOwnProperty(e.property)||(n[e.property]=[]),n[e.property].push(e),o(!0,e),!0)},this.unbind=function(e){for(var t=0;t<n[e].length;t++)o(!1,n[e][t]);return delete n[e],!0},this.clearBinds=function(){for(var e in n){for(var t=0;t<n[e].length;t++)o(!1,n[e][t]);delete n[e]}},e.hasOwnProperty("bind")&&setTimeout((()=>{t.bind(e.bind)}),0)},OGX.Bind.prototype.unbindFilter=function(e){},OGX.Bind.prototype.bindFilter=function(e,t,i){},OGX.Bind.prototype.bindRender=function(e,t){},OGX.Bind.prototype.bindValue=null,OGX.Bind.FILTER="bindFilter",OGX.Cache=function(){"use strict";var e=new OGX.List;e.cache("ext","id"),this.read=function(t,i){var n=e.read({ext:t,id:i},1);return!!n&&("snd"===n.ext?n:n.data)},this.get=function(t,i){return void 0===i&&(i=0),e.get(t,null,null,i)},this.set=function(t){e=new OGX.List(t)},this.add=function(t){if(Array.isArray(t))for(var i=0;i<t.length;i++)e.insert(t[i]);else e.insert(t)},this.remove=function(t,i,n){void 0===n&&(n=1);var o={};return void 0!==t&&t&&(o.ext={eq:t}),void 0!==i&&i&&(o.id={eq:i}),e.unset({ext:{eq:t},id:{eq:i}},n)},"undefined"!=typeof __array&&this.set(__array)},OGX.Cache=new OGX.Cache,require("Calendar","Uxi","Bind","Touch"),OGX.Calendar=function(e){construct(this,"Calendar");var t,i,n,o,a=this,r=e,s={display_date:moment(),date:!1,format:"YYYY-MM-DD",layouts:[{layout:{name:"DECADE_YEARS"},engine:{name:"YEAR_NUMBER"}},{layout:{name:"YEAR_MONTHS"},engine:{name:"CELL_VALUE",config:{format:"MMM"}}},{layout:{name:"MONTH_DAYS"},engine:{name:"DAY_NUMBER"}}],layout:2,simple:!1,selectable:!0,no_selection:!1,off_dates:!1,mode:"select",swipe:!0,browse:!0,chromeos:!1,callbacks:{select:null,unselect:null}},l=[],c={x:1,y:1},d=!1;function u(e){e?(i.on(a.touch.down,".ogx_calendar_left",h),i.on(a.touch.down,".ogx_calendar_right",h),i.on(a.touch.down,".ogx_calendar_up",f),i.on(a.touch.down,".ogx_calendar_down",f)):(i.off(a.touch.down,".ogx_calendar_left",h),i.off(a.touch.down,".ogx_calendar_right",h),i.off(a.touch.down,".ogx_calendar_up",f),i.off(a.touch.down,".ogx_calendar_down",f))}function h(e){e.preventDefault(),e.stopImmediatePropagation(),d||(d=!0,$(this).hasClass("ogx_calendar_left")?(a.el.trigger(OGX.Calendar.BROWSE,-1),t.swipeLeft()):(a.el.trigger(OGX.Calendar.BROWSE,1),t.swipeRight()),setTimeout((()=>{d=!1}),350))}function f(e){e.preventDefault(),e.stopImmediatePropagation(),d||(d=!0,$(this).hasClass("ogx_calendar_up")?o>0&&(a.el.trigger(OGX.Calendar.LAYOUT_CHANGE,1),t.swipeDown()):o+1<r.layouts.length&&(a.el.trigger(OGX.Calendar.LAYOUT_CHANGE,-1),t.swipeUp()),setTimeout((()=>{d=!1}),350))}function _(e){e?i.on("click",".ogx_calendar_layout_item",g):i.off("click",".ogx_calendar_layout_item",g)}function g(e){var t=$(this),i=t.data("ogx-date");r.no_selection&&r.no_selection.includes(i)||("toggle"===r.mode&&t.hasClass("ogx_calendar_selected_item")?(v(),a.onUnselect(),a.el.trigger(OGX.Calendar.UNSELECT,""),r.date=!1):(v(),m(i),r.date=moment(i),r.display_date=r.date.clone(),a.onSelect(r.date.clone()),a.el.trigger(OGX.Calendar.SELECT,r.date),b()),setTimeout(p,0))}function p(){for(var e=t.getCells(),i=0;i<e.length;i++)0==e[i].offset.x&&0==e[i].offset.y||G(e[i].abs,e[i].rel,e[i].offset,$(e[i].element).children(0)[0])}function m(e){a.el.find('.ogx_calendar_layout_item[data-ogx-date="'+e+'"]').addClass("ogx_calendar_selected_item")}function v(){a.el.find(".ogx_calendar_selected_item").removeClass("ogx_calendar_selected_item")}function y(){b(),w(l[o].labels(r.display_date));for(var e=t.getCells(),i=0;i<e.length;i++)G(e[i].abs,e[i].rel,e[i].offset,$(e[i].element).children(0)[0])}function x(e){e?(i.on(OGX.GridSwiper.SWIPE_START,(function(){r.selectable&&_(!1)})),i.on(OGX.GridSwiper.SWIPE_END,(function(){r.selectable&&_(!0)})),i.on(OGX.GridSwiper.SWIPE_LEFT,(function(e,t){var i=l[o].value();O(i.value,i.unit),w(l[o].labels(r.display_date))})),i.on(OGX.GridSwiper.SWIPE_RIGHT,(function(e,t){var i=l[o].value();O(-1*i.value,i.unit),w(l[o].labels(r.display_date))})),i.on(OGX.GridSwiper.SWIPE_UP,(function(e,t){o=t.cell.y-1,b(),w(l[o].labels(r.display_date))})),i.on(OGX.GridSwiper.SWIPE_DOWN,(function(e,t){o=t.cell.y-1,b(),w(l[o].labels(r.display_date))}))):(i.off(OGX.GridSwiper.SWIPE_LEFT),i.off(OGX.GridSwiper.SWIPE_RIGHT),i.off(OGX.GridSwiper.SWIPE_UP),i.off(OGX.GridSwiper.SWIPE_DOWN),i.off(OGX.GridSwiper.SWIPE_START),i.off(OGX.GridSwiper.SWIPE_END))}function O(e,t){r.display_date.add(e,t),b()}function b(){var e=l[o].format(r.display_date),t="",n="";r.browse&&r.layouts.length>1&&(o-1<0&&(n=" ogx_calendar_off"),t+='<span class="ogx_calendar_up '+n+'"></span>'),r.browse&&(t+='<span class="ogx_calendar_left"></span><span class="ogx_calendar_display_date">'+r.display_date.format(e)+"</span>"),r.date&&(t+='<span class="ogx_calendar_selected_date">'+r.date.format(r.format)+"</span>"),r.browse&&(t+='<span class="ogx_calendar_right"></span>'),r.browse&&r.layouts.length>1&&(n="",o+1===r.layouts.length&&(n=" ogx_calendar_off"),t+='<span class="ogx_calendar_down '+n+'"></span>'),i.children(".ogx_calendar_head").children(".ogx_calendar_head_date").html(t)}function w(e){i.children(".ogx_calendar_head").children(".ogx_calendar_head_labels").html(e)}function G(e,t,i,n){if(t.y-1>=0&&t.y-1<r.layouts.length){var a=$(n),s=l[o].value(),c=r.display_date.clone().add(i.x*s.value,s.unit),d=l[t.y-1].html(c,OGX.CalendarEngine[r.layouts[t.y-1].engine.name],r.layouts[t.y-1].engine.config,r.date);a.html(d)}}function X(){for(var e,t=0;t<r.layouts.length;t++)r.layouts[t].layout.hasOwnProperty("config")&&(e=r.layouts[t].layout.config),r.off_dates&&(e.off_dates=r.off_dates),l.push(C(r.layouts[t].layout.name,e))}function C(e,t){return void 0===t&&(t={}),OGX.CalendarLayout[e].prototype=Object.create(OGX.CalendarLayout.BASE_LAYOUT.prototype),OGX.CalendarLayout[e].prototype.constructor=OGX.CalendarLayout[e],new OGX.CalendarLayout[e](t)}function D(){n=[[!1,!1,!1]];for(var e=0;e<r.layouts.length;e++)n.push([G,G,G]);n.push([!1,!1,!1])}this.onFocus=function(){return r.selectable&&_(!0),x(!0),r.browse&&u(!0),this},this.onBlur=function(){return r.selectable&&_(!1),x(!1),r.browse&&u(!1),this},this.onSelect=function(){},this.onUnselect=function(){},this.resetSelection=function(){v(),r.date=null},this.val=function(e,t){return void 0===t&&(t=!0),void 0!==e?(r.date=e,moment.isMoment(r.date)||(r.date=moment(r.date)),r.display_date=r.date.clone(),b(),void(t?setTimeout(y,0):(v(),m(r.date.format("YYYY-MM-DD"))))):r.date?r.date:""},this.refresh=function(){return setTimeout(y,0),this},this.display=function(e){return void 0!==e?(r.display_date=e,moment.isMoment(r.display_date)||(r.display_date=moment(r.display_date)),b(),setTimeout(y,0),!0):r.display_date},this.axis=function(e,t){return r.axis.x=e,r.axis.y=t,this},this.getLayout=function(){return o},this.layouts=function(e,i){return void 0===e?r.layouts:(r.layouts=e,r.layout=void 0!==i?i:0,o=r.layout,l=[],X(),D(),t.setMap(n,{x:0,y:r.layout+1}),y(),this)},this.layout=function(){return o},this.offDates=function(e,i){return void 0===e?r.off_dates:(void 0===i&&(i=!0),r.off_dates=e,i?(l=[],X(),t.setMap(n,{x:0,y:r.layout+1}),y()):l.forEach((t=>{t.off_dates=e})),this)},this.noSelection=function(e,t){return void 0===e?r.no_selection:(void 0===t&&(t=!0),r.no_selection=e,t&&y(),this)},OGX.Data.merge(r,s),r.callbacks.select&&(a.onSelect=r.callbacks.select),r.callbacks.unselect&&(a.onUnselect=r.callbacks.unselect),(i=a.el).addClass("ogx_calendar"),r.date&&(moment.isMoment(r.date)||(r.date=moment(r.date)),r.display_date=r.date.clone()),r.display_date?moment.isMoment(r.display_date)||(r.display_date=moment(r.display_date)):r.display_date=moment(),r.layout>r.layouts.length&&(r.layout=0),o=r.layout,c.y=o+1,r.simple&&(r.layouts=[r.layouts[2]],o=r.layout=0),r.layout>r.layouts.length-1&&(r.layout=0),i.html('<div class="ogx_calendar_head"><div class="ogx_calendar_head_date"></div><div class="ogx_calendar_head_labels"></div></div><div class="ogx_calendar_body"></div>'),D(),X(),t=a.create("GridSwiper",{el:r.el+" .ogx_calendar_body",loop:!0,map:n,start:{x:1,y:o+1},chromeos:r.chromeos,enabled:r.swipe}),b(),w(l[o].labels(r.display_date))},OGX.Calendar.SELECT="CalendarSelect",OGX.Calendar.UNSELECT="CalendarUnselect",OGX.Calendar.BIND=OGX.Calendar.SELECT+" "+OGX.Calendar.UNSELECT,OGX.Calendar.BROWSE="CalendarBrowse",OGX.Calendar.LAYOUT_CHANGE="CalendarLayoutChange",OGX.CalendarLayout={},OGX.CalendarLayout.BASE_LAYOUT=function(e){"use strict";this.off_dates=null,this.labels=function(e){return""},this.html=function(e,t,i,n){return""},this.value=function(){return{value:1,unit:"months"}},this.format=function(){return e.hasOwnProperty("format")?e.format:"YYYY-MM"}},OGX.CalendarLayout.MONTH_DAYS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM"),!e.hasOwnProperty("labels")&&(e.labels="ddd"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){var i="",n=Number(t.format("d")),o=t.clone();n&&o.subtract(n,"day");for(var a=0;a<7;a++)i+='<span class="ogx_calendar_layout_month_days_label">'+o.format(e.labels)+"</span>",o.add(1,"day");return i},this.html=function(e,t,i,n){var o,a=e.format("MM"),r=moment(e.format("YYYY-MM-")+"01").day(),s=moment(e.format("YYYY-MM-")+"01").subtract(r,"days"),l="";n&&(l=n.format("YYYY-MM-DD"));for(var c,d="",u=0;u<35;u++)c="",o=s.format("YYYY-MM-DD"),s.format("MM")!==a&&(c+="ogx_calendar_layout_month_days_offset "),o===moment().format("YYYY-MM-DD")&&(c+="ogx_calendar_layout_month_days_today "),n&&l===o&&(c+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(o)&&(c+="ogx_calendar_layout_off_date "),d+='<div class="ogx_calendar_layout_item ogx_calendar_layout_month_days '+c+'" data-ogx-date="'+o+'">'+t(o,i)+"</div>",s.add(1,"days");return d},this.value=function(){return{value:1,unit:"months"}}},OGX.CalendarLayout.CENTURY_DECADES=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY"),!e.hasOwnProperty("labels")&&(e.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return'<span class="ogx_calendar_layout_century_decades_label">'+(e.labels?t.format(e.labels):100*Math.floor(Number(t.format("YYYY"))/100)+"'s")+"</span>"},this.html=function(e,t,i,n){var o,a,r=moment(),s=100*Math.floor(Number(r.format("YYYY"))/100),l=10*Math.floor(Number(r.format("YYYY").substr(2))/10),c=100*Math.floor(Number(e.format("YYYY"))/100),d=0,u=0;n&&(d=100*Math.floor(Number(n.format("YYYY"))/100),u=10*Math.floor(Number(n.format("YYYY").substr(2))/10));for(var h="",f=0;f<10;f++)a="",s+l===c+(o=10*f)&&(a="ogx_calendar_layout_century_decades_current "),d+u===c+o&&(a+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(c+o)&&(a+="ogx_calendar_layout_off_date "),h+='<div class="ogx_calendar_layout_item ogx_calendar_layout_century_decades '+a+'" data-ogx-date="'+(c+o)+'-01-01">'+t(c+o,i)+"</div>";return h},this.value=function(){return{value:100,unit:"years"}}},OGX.CalendarLayout.CENTURY_YEARS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return'<span class="ogx_calendar_layout_century_decades_label">'+(e.labels?t.format(e.labels):100*Math.floor(Number(t.format("YYYY"))/100)+"'s")+"</span>"},this.html=function(e,t,i,n){var o,a=moment(),r=100*Math.floor(Number(a.format("YYYY"))/100),s=Number(a.format("YYYY").substr(2)),l=100*Math.floor(Number(e.format("YYYY"))/100),c=0,d=0;n&&(c=100*Math.floor(Number(n.format("YYYY"))/100),d=Math.floor(Number(n.format("YYYY").substr(2))));for(var u="",h=0;h<100;h++)o="",l+h===r+s&&(o+="ogx_calendar_layout_century_years_current "),l+h===c+d&&(o+="ogx_calendar_selected_item"),this.off_dates&&this.off_dates.includes(l+h)&&(o+="ogx_calendar_layout_off_date "),u+='<div class="ogx_calendar_layout_item ogx_calendar_layout_century_years '+o+'" data-ogx-date="'+(l+h)+'-01-01">'+t(l+h+"-01-01",i)+"</div>";return u},this.value=function(){return{value:100,unit:"years"}}},OGX.CalendarLayout.DECADE_YEARS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return'<span class="ogx_calendar_layout_century_years_label">'+(e.labels?t.format(e.labels):10*Math.floor(Number(t.format("YYYY"))/10)+"'s")+"</span>"},this.html=function(e,t,i,n){var o,a=10*Math.floor(Number(e.format("YYYY"))/10),r="",s=Number(moment().format("YYYY")),l="";n&&(l=Number(n.format("YYYY")));for(var c=0;c<10;c++)o="",a+c===s&&(o+="ogx_calendar_layout_decade_years_current "),a+c===l&&(o+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(a+c)&&(o+="ogx_calendar_layout_off_date "),r+='<div class="ogx_calendar_layout_item ogx_calendar_layout_decade_years '+o+'" data-ogx-date="'+(a+c)+'-01-01">'+t(a+c+"-01-01",i)+"</div>";return r},this.value=function(){return{value:10,unit:"years"}}},OGX.CalendarLayout.DECADE_MONTHS=function(e){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(e){for(var t=10*Math.floor(Number(e.format("YYYY"))/10),i=Number(String(t).substr(2,2)),n="",o=0;o<10;o++)n+='<span class="ogx_calendar_layout_decade_months_label">\''+i+"</span>",i++;return n},this.html=function(e,t,i,n){var o,a,r,s,l=10*Math.floor(Number(e.format("YYYY"))/10),c="",d=moment().format("YYYY-MM");n&&(o=n.format("YYYY-MM"));for(var u=0;u<12;u++){s=u+1;for(var h=0;h<10;h++)a="",(r=l+h+"-"+(s<10?"0"+s:s))===d&&(a="ogx_calendar_layout_decade_months_current "),r===o&&(a+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(r)&&(a+="ogx_calendar_layout_off_date "),moment(r+"-01"),c+='<div class="ogx_calendar_layout_item ogx_calendar_layout_decade_months '+a+'" data-ogx-date="'+r+'-01">'+t(r+"-01",i)+"</div>"}return c},this.value=function(){return{value:10,unit:"years"}},this.format=function(e){return"["+10*Math.floor(Number(e.format("YYYY"))/10)+"'s]"}},OGX.CalendarLayout.YEAR_MONTHS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels="[Months]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return'<span class="ogx_calendar_layout_year_months_label">'+t.format(e.labels)+"</span>"},this.html=function(e,t,i,n){var o,a,r=moment().format("YYYY-MM"),s=e.format("YYYY"),l="",c="";n&&(c=n.format("YYYY-MM"));for(var d=1;d<13;d++)o="",s+"-"+(a=d<10?"0"+d:d)===r&&(o+="ogx_calendar_layout_year_months_current "),s+"-"+a===c&&(o+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(s+"-"+a)&&(o+="ogx_calendar_layout_off_date "),l+='<div class="ogx_calendar_layout_item ogx_calendar_layout_year_months '+o+'" data-ogx-date="'+s+"-"+a+'-01">'+t(s+"-"+a+"-01",i)+"</div>";return l},this.value=function(){return{value:1,unit:"years"}}},OGX.CalendarLayout.YEAR_WEEKS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels="[Weeks]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return'<span class="ogx_calendar_layout_year_weeks_label">'+t.format(e.labels)+"</span>"},this.html=function(e,t,i,n){var o=moment().week(),a=e.format("YYYY"),r=moment().format("YYYY"),s="",l="";n&&(l=n.week(),s=n.format("YYYY"));for(var c,d,u="",h=1;h<53;h++)c="",d=moment().year(a).week(h).format("YYYY-MM-DD"),o===h&&a===r&&(c="ogx_calendar_layout_year_weeks_current "),l===h&&a===s&&(c+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(d)&&(c+="ogx_calendar_layout_off_date "),u+='<div class="ogx_calendar_layout_item ogx_calendar_layout_year_weeks '+c+'" data-ogx-date="'+d+'">'+t(d,i)+"</div>";return u},this.value=function(){return{value:1,unit:"years"}}},OGX.CalendarLayout.YEAR_DAYS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels="[Nth Day]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return'<span class="ogx_calendar_layout_year_weeks_label">'+t.format(e.labels)+"</span>"},this.html=function(e,t,i,n){var o,a,r,s="",l=e.format("YYYY-MM-DD"),c=moment(e.format("YYYY")+"-01-01"),d="";n&&(d=n.format("YYYY-MM-DD")),a=e.isLeapYear()?366:365;for(var u=0;u<a;u++)o="",(r=c.format("YYYY-MM-DD"))===l&&(o="ogx_calendar_layout_year_days_current "),r===d&&(o+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(r)&&(o+="ogx_calendar_layout_off_date "),s+='<div class="ogx_calendar_layout_item ogx_calendar_layout_year_days '+o+'" data-ogx-date="'+r+'">'+t(r,i)+"</div>",c.add(1,"days");return s},this.value=function(){return{value:1,unit:"years"}}},OGX.CalendarLayout.MONTH_WEEKS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="[(]YYYY-MM[)] W"),!e.hasOwnProperty("labels")&&(e.labels="[Nth Week]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return'<span class="ogx_calendar_layout_year_weeks_label">'+t.format(e.labels)+"</span>"},this.html=function(e,t,i,n){var o,a="",r=moment(),s=Number(r.format("YYYY")),l=Number(r.format("w")),c=Number(e.format("YYYY")),d=0,u=0;n&&(d=Number(n.format("YYYY")),u=Number(n.format("w")));a="";for(var h,f=moment(e.format("YYYY-MM-[01]")),_=0;_<5;_++)h="",o=Number(f.format("w")),c===d&&o===u&&(h+="ogx_calendar_selected_item "),c===s&&o===l&&(h+="ogx_calendar_layout_month_weeks_current"),this.off_dates&&this.off_dates.includes(o)&&(h+="ogx_calendar_layout_off_date "),a+='<div class="ogx_calendar_layout_item ogx_calendar_layout_month_weeks '+h+'" data-ogx-date="'+f.format("YYYY-MM-DD")+'">'+t(f.format("YYYY-MM-DD"),i)+"</div>",f.add(7,"days");return a},this.value=function(){return{value:1,unit:"months"}}},OGX.CalendarLayout.WEEK_DAYS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM (wo [week])"),!e.hasOwnProperty("labels")&&(e.labels="ddd DD"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){var i="",n=Number(t.format("d")),o=t.clone();n&&o.subtract(n,"day");for(var a=0;a<7;a++)i+='<span class="ogx_calendar_layout_month_days_label">'+o.format(e.labels)+"</span>",o.add(1,"day");return i},this.html=function(e,t,i,n){var o,a,r="",s=e.weekday(),l=e.subtract(s,"days"),c=moment().format("YYYY-MM-DD"),d="";n&&(d=n.format("YYYY-MM-DD"));for(var u=0;u<7;u++)o="",(a=l.format("YYYY-MM-DD"))===c&&(o="ogx_calendar_layout_week_days_current "),a===d&&(o+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(a)&&(o+="ogx_calendar_layout_off_date "),r+='<div class="ogx_calendar_layout_item ogx_calendar_layout_week_days '+o+'" data-ogx-date="'+a+'">'+t(a,i)+"</div>",l.add(1,"days");return r},this.value=function(){return{value:1,unit:"weeks"}}},OGX.CalendarLayout.DAY_HOURS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM-DD HH:[00]"),!e.hasOwnProperty("labels")&&(e.labels="[Hours]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return'<span class="ogx_calendar_layout_day_hours_label">'+t.format(e.labels)+"</span>"},this.html=function(e,t,i,n){var o,a,r="",s=Number(moment().format("HH")),l=e.format("YYYY-MM-DD "),c=moment().format("YYYY-MM-DD "),d="",u="";n&&(d=Number(n.format("HH")),u=n.format("YYYY-MM-DD "));for(var h=0;h<24;h++)a="",h===s&&l===c&&(a="ogx_calendar_layout_days_hours_current "),h===d&&l===u&&(a+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(l+o+":00")&&(a+="ogx_calendar_layout_off_date "),r+='<div class="ogx_calendar_layout_item ogx_calendar_layout_days_hours '+a+'" data-ogx-date="'+(l+(o=h<10?"0"+h:String(h)))+':00">'+t(l+o+":00",i)+"</div>";return r},this.value=function(){return{value:1,unit:"days"}}},OGX.CalendarLayout.DAY_WORK_HOURS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM-DD HH:[00]"),!e.hasOwnProperty("labels")&&(e.labels="[Work Hours]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return'<span class="ogx_calendar_layout_day_work_hours_label">'+t.format(e.labels)+"</span>"},this.html=function(e,t,i,n){i&&void 0!==i?i.hasOwnProperty("start")||(i.start=8,i.end=17):i={start:8,end:17};var o,a,r="",s=Number(moment().format("HH")),l=e.format("YYYY-MM-DD "),c=moment().format("YYYY-MM-DD "),d="",u="";n&&(d=Number(n.format("HH")),u=n.format("YYYY-MM-DD "));for(var h=i.start;h<i.end+1;h++)a="",h===s&&l===c&&(a="ogx_calendar_layout_days_work_hours_current "),h===d&&u===l&&(a+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(l+o+":00")&&(a+="ogx_calendar_layout_off_date "),r+='<div class="ogx_calendar_layout_item ogx_calendar_layout_days_work_hours '+a+'" data-ogx-date="'+(l+(o=h<10?"0"+h:h))+':00">'+t(l+o+":00",i)+"</div>";return r},this.value=function(){return{value:1,unit:"days"}}},OGX.CalendarLayout.DAY=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM-DD"),!e.hasOwnProperty("labels")&&(e.labels="dddd DD"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return'<span class="ogx_calendar_layout_day_label">'+t.format(e.labels)+"</span>"},this.html=function(e,t,i,n){var o="",a=e.format("YYYY-MM-DD"),r=moment().format("YYYY-MM-DD");return n&&a===n.format("YYYY-MM-DD")&&(o+="ogx_calendar_selected_item "),a===r&&(o+="ogx_calendar_layout_day_current "),this.off_dates&&this.off_dates.includes(a)&&(o+="ogx_calendar_layout_off_date "),'<div class="ogx_calendar_layout_item ogx_calendar_layout_day '+o+'" data-ogx-date="'+a+'">'+t(a,i)+"</div>"},this.value=function(){return{value:1,unit:"days"}},this.select=function(e){}},OGX.CalendarEngine={},OGX.CalendarEngine.CELL_VALUE=function(e,t){var i=moment(e);return t.hasOwnProperty("css")||(t.css=""),'<div class="ogx_calendar_engine_cell_value '+t.css+'">'+i.format(t.format)+"</div>"},OGX.CalendarEngine.DAY_NUMBER=function(e,t){var i=moment(e);return OGX.CalendarEngine.CELL_VALUE(i,{format:"DD",css:"ogx_calendar_engine_day_number"})},OGX.CalendarEngine.WEEK_NUMBER=function(e,t){return'<div class="ogx_calendar_engine_week_number">'+moment(e).week()+"</div>"},OGX.CalendarEngine.MONTH_NUMBER=function(e,t){return OGX.CalendarEngine.CELL_VALUE(e,{format:"MM",css:"ogx_calendar_engine_month_number"})},OGX.CalendarEngine.YEAR_NUMBER=function(e,t){return OGX.CalendarEngine.CELL_VALUE(e,{format:"YY",css:"ogx_calendar_engine_year_number"})},OGX.CalendarEngine.DECADE_NUMBER=function(e){return'<div class="ogx_calendar_engine_date_day_number">'+String(e).substr(2)+"'s</div>"},require("Carousel","Uxi","Placeholder","Touch"),OGX.Carousel=function(e){construct(this,"Carousel");var t,i,n,o,a,r,s=this,l=e,c={min_x:100,anim:!0,drag:!0,drag_left:!0,drag_right:!0,dots:!1,css:!1,index:0,capture:!1,callbacks:{change:null},display:!1,displays:!1,as:"item",list:null},d={position:"bottom"},u=!1,h=0,f=0,_=new OGX.List,g="ogx_carousel",p=null,m=null,v=null;function y(e){if(void 0!==e&&_[e]&&_[e].instance){var t=s.find(_[e].instance._NAME_,_[e].instance.id);t&&t.blur(2)}}function x(e){if(void 0!==e&&_[e]&&_[e].instance){var t=s.find(_[e].instance._NAME_,_[e].instance.id);t&&s.enabled&&t.focus(1)}}function O(e){i.off("transitionend"),i.removeClass(g+"_anim")}function b(e){if(e.dirX){if(-1===e.dirX&&!l.drag_left)return;if(1===e.dirX&&!l.drag_right)return}if(e.distX>e.distY){var t=r*n*-1+e.distX*e.dirX;t<=0&&t>-1*(i.width()-s.el.width())&&i.css({transform:"translate3d("+t+"px, 0, 0)"})}}function w(e){if(e.dirX){if(-1===e.dirX&&!l.drag_left)return;if(1===e.dirX&&!l.drag_right)return}if(e.distX>l.min_x){var i=r+-1*e.dirX;i>=0&&i<f&&r!==i&&(y(r),r=i,s.onChange(r),t.trigger(OGX.Carousel.CHANGE,r))}var n=0;r&&(n=100/f*(-1*r)),G(n,r,!0)}function G(e,t,n){r=t,i.off("transitionend"),n?(i.addClass(g+"_anim"),i.on("transitionend",(function(){i.off("transitionend"),i.removeClass(g+"_anim"),x(t)}))):(i.removeClass(g+"_anim"),s.enabled&&x(t)),i.css({transform:"translate3d("+e+"%, 0, 0)"})}function X(){u=!0,clearInterval(o),o=setInterval(C,50),n=Math.floor(t.innerWidth()),i.removeClass(g+"_anim")}function C(){u=!1,clearInterval(o),o=!1,l.drag&&m.enable()}function D(){if(f){var e,t,n;_.clear();var o=0;i.children("."+g+"_view").each((function(i,a){e=$(a),(t=e.children().first()).length&&t[0].hasAttribute("data-ogx-id")?(t[0].hasAttribute("data-ogx-id")&&(n=t.data("ogx-id"),t.hasClass("ogx_scroller_outer")&&(n=t.find(".ogx_scroller_inner").first().data("ogx-id"))),void 0!==s.nodes[o]&&(i!==r?s.nodes[o].blur():s.enabled&&s.nodes[o].focus(),o++,_.push({index:i,instance:s.nodes.get({id:{eq:String(n)}},null,1),html:!1}))):_.push({index:i,instance:!1,html:e.html()})}))}}function E(){l.dots&&(a=s.create("Dots",{el:'.ogx_uxi[data-ogx-id="'+s.id+'"] > .carousel_dots',total:f})).bind(s,[OGX.Carousel.CHANGE],[OGX.Carousel.ADDED,OGX.Carousel.REMOVED,OGX.Carousel.RENDER])}function k(){var e=[];if(f>0){s.observeOnce(null,(()=>{n=Math.floor(t.innerWidth()),t.trigger(OGX.Carousel.READY),t.trigger(OGX.Carousel.RENDER,f)}));for(var o=0;o<f;o++)i.append('<div class="'+g+'_view" style="width:'+100/f+'%;" data-ogx-panel-id="'+h+'"></div>'),e.push("."+g+'[data-ogx-id="'+s.id+'"] > .'+g+"_views > ."+g+'_view[data-ogx-panel-id="'+h+'"]'),h++;i.css("width",100*f+"%"),s.placeholders(l,e)}}this.construct=function(){D(),l.index&&this.index(l.index,!1),E()},this.onFocus=function(){l.drag&&m.enable(),setTimeout((()=>{for(var e=0;e<_.length;e++)_[e].instance&&(e!==r?_[e].instance.blur():_[e].instance.focus())}),0)},this.onBlur=function(){l.drag&&m.disable()},this.focus=function(){return this.blured&&(this.blured=!1,this.ux(!0),this.onFocus()),_.length&&void 0!==_[r]&&_[r].instance&&_[r].instance.focus(),this},this.onResize=function(){return l.drag&&m.disable(),setTimeout(X,0),this},this.show=function(e,t){if(!arguments.length)return this._show(),this;var i=this.getNodeIndex(e,t);return i&&this.index(i.index),this},this.onChange=function(){},this.getNodeIndex=function(e,t){var i=_.get({"instance.id":{eq:t},"instance._NAME_":{eq:e}},null,1);return!!i&&{index:i.index}},this.anim=function(e){return void 0===e?l.anim:(l.anim=e,this)},this.drag=function(e){return void 0===e?l.drag:(l.drag!==e&&(l.drag&&m.disable(),e&&m.enable(),l.drag=e),this)},this.dragLeft=function(e){return void 0===e?l.drag_left:(l.drag_left=e,this)},this.dragRight=function(e){return void 0===e?l.drag_right:(l.drag_right=e,this)},this.length=function(){return f},this.destroy=function(){o&&clearInterval(o),l.dots&&(a.unbind(this),a.destroy())},this.prev=function(){return r>0&&this.index(r-1),this},this.next=function(){return r+1<f&&this.index(r+1),this},this.panels=function(){return _},this.addNode=function(e,n,o,a,r){void 0===o&&(o=!1),void 0===a&&(a=!1),void 0===r&&(r=!1),v&&clearTimeout(v);var l=function(e){void 0===e&&(e="");return f++,i.append('<div class="'+g+'_view" style="width:'+100/f+'%;" data-ogx-panel-id="'+h+'">'+e+"</div>"),i.css("width",Math.round(100*f)+"%"),i.children("."+g+"_view").css("width",100/f+"%"),++h-1}(),c="."+g+'[data-ogx-id="'+this.id+'"] > .'+g+"_views > ."+g+'_view[data-ogx-panel-id="'+l+'"]',d={},u=c;if(e.hasOwnProperty("_NAME_"))e.detach(),e.attach(this,c),o&&this.index(f-1,a);else{for(var _ in e){u+=":"+_.split(":")[1],d[u]=e[_];break}setTimeout((()=>{s.observeOnce(null,(()=>{v&&clearTimeout(v),v=setTimeout(D,20),o&&s.index(f-1,a),r?r():t.trigger(OGX.Carousel.ADDED,f)})),OGX.OML.render(s,d,n)}),0)}return this},this.replaceNode=function(e,t,n,o){void 0===o&&(o=null);var a={},r=i.children("."+g+"_view:eq("+e+")").data("ogx-panel-id"),l="."+g+'[data-ogx-id="'+s.id+'"] > .'+g+"_views > ."+g+'_view[data-ogx-panel-id="'+r+'"]';for(var c in t){a[l+=":"+c.split(":")[1]]=t[c];break}OGX.Object.destroy(s.nodes[e]),s.observeOnce(null,(()=>{setTimeout(D,0),setTimeout((()=>{}),1),o&&o()})),OGX.OML.render(s,a,n)},this.removeNode=function(e,t){void 0===t&&(t=e,e=null);for(var i=!1,n=0;n<_.length;n++)if(_[n].instance.id===t)return i=!0,e&&(i=_[n].instance._NAME_===e),i&&this.removePanel(n),!0;return!1},this.index=function(e,i,n,o){if(void 0===e)return r;if((void 0===n&&(n=!1),void 0===o&&(o=!1),e>=0&&e<f&&!u)&&((d=r)!==e||o)){void 0===i&&(i=l.anim),r!==e&&y(r);var c=100/f*(-1*e),d=e;return setTimeout((()=>{G(c,d,i)}),0),l.dots&&a.select(e),n&&(s.onChange(e),t.trigger(OGX.Carousel.CHANGE,e)),!0}return!1},this.getPanel=function(e){return _.get({index:{eq:e}},null,1)},this.swapPanels=function(e,n){var o=i.children("."+g+"_view:eq("+e+")").detach();n>e?i.children("."+g+"_view:eq("+(n-1)+")").after(o):i.children("."+g+"_view:eq("+n+")").before(o);var a=100/f*(-1*n);return i.removeClass(g+"_anim"),i.css({transform:"translate3d("+a+"%, 0, 0)"}),r=n,setTimeout(D,0),s.onChange(r),t.trigger(OGX.Carousel.CHANGE,r),this},this.removePanel=function(e,n){if(void 0===n&&(n=!0),e>=0&&e<f){var o=null;if(n&&(n="remove"),i.children("."+g+"_view:eq("+e+")").children().data("ogx-id")){var a=_[e];a.instance&&(o=this.find(a.instance._NAME_,a.instance.id,n))&&(n||o.detach()),_.splice(e,1)}return f--,i.children("."+g+"_view:eq("+e+")").remove(),i.removeClass(g+"_anim").css("width",Math.round(100*f)+"%"),i.children("."+g+"_view").css("width",100/f+"%"),e>=r?e--:e=--r,e<0&&(e=0),r=e,s.index(e,!1,!0),t.trigger(OGX.Carousel.REMOVED,f),o}return!1},this.empty=function(){return this.clear(),i.empty(),i.removeClass(g+"_anim").css("width","100%"),i.css({transform:"translate3d(0%, 0, 0)"}),f=0,_=new OGX.List,l.index=r=0,l["node:OML"]=[],this},this.render=function(e,i){return this.empty(),E(),l["node:OML"]=e,f=l["node:OML"].length,k(),OGX.OML.render(this,l["node:OML"],i,null,(()=>{D(),s.focus()})),t.trigger(OGX.Carousel.RENDER,f),this},this.destroy=function(){this.touch.wipe()},function(){if(OGX.Data.merge(l,c,!1),l.callbacks.change&&(s.onChange=l.callbacks.change),l.dots&&("boolean"==typeof l.dots&&(l.dots={}),OGX.Data.merge(l.dots,d)),p=new OGX.Display(l),"string"==typeof l.index&&(l.index=OGX.Data.stringToVal(l.index)),r=l.index,t=s.el,n=Math.floor(t.innerWidth()),l.hasOwnProperty("node:OML")&&l["node:OML"].length)f=l["node:OML"].length;else if(l.list&&l.list.length){for(var e,i,o=[],a=0;a<l.list.length;a++)if(p.hasOML())e=p.oml('.ogx_carousel[data-ogx-id="'+s.id+'"] > .ogx_carousel_views > .ogx_carousel_view[data-ogx-panel-id="'+a+'"]',l.list[a],l.as),o.push(e);else{i=p.html(l.list[a]);var u='{"default:Html":{"html":'+JSON.stringify(i)+"}}";e=JSON.parse(u),o.push(e)}l["node:OML"]=o,f=l["node:OML"].length}}(),function(){t.addClass(g);var e="";l.dots&&"top"===l.dots.position&&(e+='<div class="carousel_dots"></div>'),e+='<div class="'+g+'_views" style="width:'+100*f+'%;"></div>',l.dots&&"bottom"===l.dots.position&&(e+='<div class="carousel_dots"></div>'),t.append(e),(i=t.find("."+g+"_views").first()).css({transform:"translate3d("+100/f*(-1*r)+"%, 0, 0)"})}(),k(),m=s.touch.add("Swipe",{x:!0,cb_down:O,cb_swipe:b,cb_up:w,capture:l.capture,state:"manual"}),l.drag?m.enable():s.drag(!1)},OGX.Carousel.READY="CarouselReady",OGX.Carousel.CHANGE="CarouselChange",OGX.Carousel.ADDED="CarouselAdded",OGX.Carousel.REMOVED="CarouselRemoved",OGX.Carousel.RENDER="CarouselRender",OGX.Color={},OGX.Color.hexToRgb=function(e){"use strict";e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,i,n){return t+t+i+i+n+n}));var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:null},OGX.Color.rgbToHex=function(e,t,i){"use strict";var n,o,a;arguments.length>1&&(e=e+", "+t+", "+i),"object"==typeof e&&(e=Array.isArray(e)?e.join(","):e.r+" "+e.g+" "+e.b);var r=/(\d+)[ ,]*(\d+)[ ,]*(\d+)/g,s=r.exec(e);return s&&(s.shift(),n=Number(s[0]),o=Number(s[1]),a=Number(s[2])),"#"+((1<<24)+(n<<16)+(o<<8)+a).toString(16).slice(1)},OGX.Color.rgbToHsl=function(e,t,i){"use strict";var n,o,a;arguments.length>1&&(e=e+", "+t+", "+i),"object"==typeof e&&(e=Array.isArray(e)?e.join(","):e.r+" "+e.g+" "+e.b);var r=/(\d+)[ ,]*(\d+)[ ,]*(\d+)/g,s=r.exec(e);if(s){s.shift(),n=s[0],o=s[1],a=s[2],n/=255,o/=255,a/=255;var l,c,d=Math.max(n,o,a),u=Math.min(n,o,a),h=(d+u)/2;if(d===u)l=c=0;else{var f=d-u;switch(c=h>.5?f/(2-d-u):f/(d+u),d){case n:l=(o-a)/f+(o<a?6:0);break;case o:l=(a-n)/f+2;break;case a:l=(n-o)/f+4}l/=6}return[l,c,h]}return!1},OGX.Color.hslToRgb=function(e,t,i){"use strict";if(1===arguments.length)if("object"==typeof e)Array.isArray(e)?(i=e[2],t=e[1],e=e[0]):(i=e.l,t=e.s,e=e.h);else if("string"==typeof e){var n=/([0-9\.]+)[ ,]*([0-9\.]+)[ ,]*([0-9\.]+)/g,o=n.exec(e);o&&(o.shift(),e=Number(o[0]),t=Number(o[1]),i=Number(o[2]))}var a,r,s;if(0===t)a=r=s=i;else{var l=function(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e},c=i<.5?i*(1+t):i+t-i*t,d=2*i-c;a=l(d,c,e+1/3),r=l(d,c,e),s=l(d,c,e-1/3)}return[Math.round(255*a),Math.round(255*r),Math.round(255*s)]},OGX.Color.formatHex=function(e){return"#"===e.slice(0,1)&&(e=e.slice(1)),e.length>3||e.split("").map((function(e){return e+e})),"#"+e},require("Container","Uxi"),OGX.Container=function(e){construct(this,"Container");var t=this,i={tabs:!0,carousel:{enabled:!0},enabled:!0,reorder:!0,anim:!0,flatten:!1,chromeos:!1,index:0,dots:!1},n=e,o="normal",a=0;function r(e){e?(t.tabs.el.on(OGX.Tabs.SELECT,(function(e,i,n){t.carousel.index(n.index),t.el.trigger(OGX.Container.CHANGE,n.index)})),t.tabs.el.on(OGX.Tabs.REORDER,(function(e,i){t.carousel.swapPanels(i.from,i.to)})),t.carousel.el.on(OGX.Carousel.CHANGE,(function(e,i){t.tabs.index(i),t.el.trigger(OGX.Container.CHANGE,i)}))):(t.tabs.el.off(OGX.Tabs.SELECT),t.tabs.el.off(OGX.Tabs.REORDER),t.carousel.el.off(OGX.Carousel.CHANGE)),s(e)}function s(e){e?t.tabs.el.on(OGX.Tabs.REMOVE,l):t.tabs.el.off(OGX.Tabs.REMOVE,l)}function l(e,i,n){var o;s(!1),"string"==typeof i?o=i:ln=i.label,"Popup"===t.parent._NAME_?OGX.Core.ungroupPopup(t.parent,n.index,o,n.x,n.y):t.carousel.removeNode(t.carousel.nodes[n.index].id),setTimeout((()=>{s(!0)}),200)}this.carousel=null,this.tabs=null,this.bypass=!0,this.construct=function(){this.carousel=this.find("Carousel",this.id+"_carousel")},this.show=function(e,t){if(!arguments.length)return this._show(),this;if(this.carousel&&"normal"===o){var i=this.carousel.getNodeIndex(e,t);i&&(this.carousel.index(i.index),n.tabs&&this.tabs.index(i.index))}},this.index=function(e){return this.carousel&&"normal"===o&&(this.carousel.index(e),n.tabs&&this.tabs.index(e)),this},this.onFocus=function(){return n.tabs&&t.carousel&&r(!0),this},this.onBlur=function(){return n.tabs&&t.carousel&&r(!1),this},this.onResize=function(){var e,t,i;return n.flatten&&(this.carousel&&"flattened"!==o&&this.el.width()>=n.flatten?(o="flattened",n.tabs&&(this.tabs.blur(),this.tabs.hide()),this.carousel.blur(),a=(e=this.carousel.el.children(".ogx_carousel_views"),t=e[0].style.transform,i=/translate3d\(([0-9px%,\.\- ]+)\)/,t=(t=t.match(i))[1].split(","))[0],this.carousel.el.children(".ogx_carousel_views").addClass("ogx_container_flattened").css("transform","translate3d(0px, 0px, 0px)")):this.carousel&&"flattened"===o&&this.el.width()<n.flatten&&(o="normal",n.tabs&&(this.tabs.focus(),this.tabs.show()),this.carousel.focus(),this.carousel.el.children(".ogx_carousel_views").removeClass("ogx_container_flattened").css("transform","translate3d("+a+", 0px, 0px)"))),this},this.empty=function(){return this.carousel.empty(),this.tabs.empty(),this},function(){OGX.Data.merge(n,i,!1),OGX.Data.merge(n.carousel,i.carousel,!1),n.tabs&&"object"!=typeof n.tabs&&(n.tabs={}),t.el.addClass("ogx_container");var e=!1;n.tabs&&(!function(){var e={el:'.ogx_container[data-ogx-id="'+t.id+'"]',reorder:n.reorder,add:!1,remove:!1,chromeos:n.chromeos,index:n.index};if(!0===n.tabs){n.tabs=[];for(var i=0;i<n["node:OML"].length;i++)for(var o in n["node:OML"][i])n["node:OML"][i][o].hasOwnProperty("title")&&n.tabs.push({label:n["node:OML"][i][o].title})}e=OGX.Data.merge(n.tabs,e),t.tabs=t.create("Tabs",e)}(),e="ogx_carousel_shink");var o=n["node:OML"].slice(),a={},r='.ogx_container[data-ogx-id="'+t.id+'"]:Carousel';a["node:OML"]={},a["node:OML"][r]={id:t.id+"_carousel",css:e,anim:n.anim,chromeos:n.chromeos,drag:n.carousel.drag,index:n.index,dots:n.dots,"node:OML":o},n["node:OML"]=a["node:OML"],setTimeout((()=>{t.resize()}),0)}()},OGX.Container.CHANGE="ContainerChange",require("Controller","Touch"),OGX.Controller=function(e){construct(this,"Controller"),this.el=!1,this.id=null,this.blured=!0,this.enabled=!0,this.floating=!1,this.always_on=!1,this.data=null;e=OGX.Data.merge(e,{enabled:!0,blured:!0,always_on:!1},!1),OGX.Data.merge(this,e,!0,!1,!0)},OGX.Controller.prototype.enable=function(){return this.enabled||(this.enabled=!0,this.focus()),this},OGX.Controller.prototype.disable=function(){return this.enabled&&(this.enabled=!1,this.blur()),this},OGX.Controller.prototype.blur=function(){return this.always_on||this.blured||(this.blured=!0,this.ux(!1)),this},OGX.Controller.prototype.focus=function(){return this.blured&&this.enabled&&(this.blured=!1,this.ux(!0)),this},OGX.Controller.prototype.construct=function(){},OGX.Controller.prototype.ux=function(){},OGX.Controller.prototype.resize=function(){},OGX.Controller.prototype.clear=function(){},OGX.Controller.prototype.destroy=function(){},OGX.Controller.prototype.kill=function(){OGX.Object.destroy(this)},OGX.Controller.prototype.toOML=function(){var e={};return e[this.id+":Controllers."+this._CLASS_]={},e},OGX.Display=function(__config){"use strict";var config,config_default={display:!1,displays:!1},display_default={html:!1,css:!1,oml:!1,placeholder:!1,template:!1,view:!1,mapping:!1},display;function getDisplay(e){if(config.display&&(!config.display.hasOwnProperty("bind")||!config.display.bind))return OGX.Data.merge({},config.display);if(config.displays&&config.display.hasOwnProperty("bind")&&config.display.bind){if(e.hasOwnProperty(config.display.bind)){var t=e[config.display.bind];if(config.displays.hasOwnProperty(t))return OGX.Data.merge({},config.displays[t],!0,!1,!1)}if(config.displays.hasOwnProperty("default"))return OGX.Data.clone(config.displays.default)}return!1}function evalDisplay(e,t,i){var n;if(void 0===t&&(t={}),void 0===i&&(i=!1),"string"==typeof e)return-1===e.indexOf("{{")?i?OGX.Templater.get(e):e:(n=OGX.OSE.exec(e,t),i?OGX.Templater.get(n):n);if("object"==typeof e&&e.hasOwnProperty("bind")){var o=evalBind(e.bind,t);return o=mappedVal(e,o),i?OGX.Templater.get(o):o}return e}function mappedVal(e,t){return e.mapping&&e.mapping.hasOwnProperty(t)?e.mapping[t]:t}function evalBind(__bindval,__o){if(-1!==__bindval.indexOf("{{"))return __bindval=OGX.OSE.exec(__bindval,__o),__bindval;if(__bindval){var val=__bindval;try{eval("val = __o."+__bindval)}catch(e){}return val}return __bindval}function formatCSS(e,t){if("object"!=typeof t)return e;(t.hasOwnProperty("add")&&(e+=" "+t.add),t.hasOwnProperty("remove"))&&t.remove.split(" ").forEach((t=>{e=e.replace(t,"")}));return e}function initDisplay(e){return OGX.Data.merge(display_default,e,!0,!0,!1)}function genNodes(e,t,i){var n,o,a=OGX.Data.clone(e.oml);for(var r in a){var s,l;for(var c in a[n=r.replace("default",t)]=a[r],a[n]["node:OML"]=[],e.placeholder){l=i[c].length;for(var d=0;d<l;d++){for(var u in s=OGX.Data.clone(e.placeholder[c]),(o=OGX.Data.clone(i))[c]=o[c][d],s){s[u].data=o;break}a[n]["node:OML"].push(s)}return delete a[r],a}}return!1}function initDefaults(e){if(void 0===e&&(e={}),config=OGX.Data.clone(config_default),!e.hasOwnProperty("display")&&!e.hasOwnProperty("displays"))return config.display=OGX.Data.merge(display_default,e,!0,!0,!1),config.display=initDisplay(config.display),void(display=getDisplay());if(e.hasOwnProperty("display")&&e.display&&!e.display.hasOwnProperty("bind"))return config.display=OGX.Data.merge(display_default,e.display,!0,!0,!1),config.display=initDisplay(config.display),void(display=getDisplay());if(e.hasOwnProperty("display")&&e.display&&e.display.hasOwnProperty("bind")&&e.hasOwnProperty("displays")&&e.displays&&(config.display=e.display,config.displays=OGX.Data.clone(e.displays)),config.displays)for(var t in config.displays)config.displays[t]=OGX.Data.merge(display_default,config.displays[t],!0,!0,!0),config.displays[t]=initDisplay(config.displays[t])}this.val=function(e){if(void 0===e)return OGX.Data.clone(config);initDefaults(e)},this.display=function(e){return config.displays&&config.displays.hasOwnProperty(e)?(display=config.displays[e],!0):display},this.css=function(e){var t,i="";return(t=void 0!==e?getDisplay(e):display)&&t.css&&(i=formatCSS(i=evalDisplay(t.css,e),t.css)),i},this.html=function(e){var t,i="",n=void 0!==e;return(t=n?getDisplay(e):display)&&(t.html?i=t.html:t.template&&(i=evalDisplay(t.template,e,!0)),n&&i&&(i=OGX.Templater.make(i,e))),i},this.oml=function(e,t,i){void 0===i&&(i="&item");var n={},o=getDisplay(t);if(o||(o=display),o){if(o.oml)return n=evalDisplay(OGX.Data.clone(o.oml),t),OGX.OML.isOML(n)||(n=OGX.Core.getOML(n)),n=OGX.OML.rename(n,e),OGX.OML.replaceDataRecursive(n,t,i),o.placeholder?n=genNodes(o,e,t):n;if(o.template)return n[e+":Templates."+evalDisplay(o.template,t)]={data:t},n;if(o.html)return n[e+":Html"]={html:this.html(t)},n}return!1},this.hasOML=function(e){return!1!==getDisplay(e).oml},this.toJSON=function(){return config},initDefaults(__config)},require("Dots","Uxi","Touch"),OGX.Dots=function(e){construct(this,"Dots");var t,i=this,n=e,o={el:"body",total:0,current:0,clickable:!0,callbacks:{select:null}},a={};function r(e){var t="",i="";a[e.id].change.forEach((e=>{t+=e+" "})),a[e.id].render.forEach((e=>{i+=e+" "})),e.el.off(t,s),e.el.off(i,l),delete a[e.id]}function s(e,t){i.select(t)}function l(e,t){n.total=t,d()}function c(e){e?t.on(i.touch.down,".ogx_dots_item",(function(){var e=Number($(this).data("id"));i.select(e),i.onSelect(e),t.trigger(OGX.Dots.SELECT,e),function(e){for(var t in a)switch(a[t]._NAME_){case"Carousel":a[t].val(e)}}(e)})):t.off(i.touch.down)}function d(){for(var e,i="",o=0;o<n.total;o++)e="",n.current===o&&(e="ogx_dots_selected"),i+='<div class="ogx_dots_item" data-id="'+o+'"><span class="ogx_dots_gfx '+e+'"></span></div>';t.html(i)}this.onFocus=function(){return n.clickable&&c(!0),this},this.onBlur=function(){return n.clickable&&c(!1),this},this.bind=function(e,t,i){return!a.hasOwnProperty(e.id)&&function(e,t,i){a[e.id]={uxi:e,change:t,render:i};var n="",o="";return t.forEach((e=>{n+=e+" "})),i.forEach((e=>{o+=e+" "})),e.el.on(n,s),e.el.on(o,l),!0}(e,t,i)},this.unbind=function(e){return!!a.hasOwnProperty(e.id)&&r(e)},this.select=function(e){t.find(".ogx_dots_selected").removeClass("ogx_dots_selected"),t.children(".ogx_dots_item:eq("+e+")").children(".ogx_dots_gfx").first().addClass("ogx_dots_selected"),n.current=e},this.onSelect=function(){},this.destroy=function(){!function(){for(var e in a)r(a[e].uxi)}()},OGX.Data.merge(n,o),n.callbacks.select&&(i.onSelect=n.callbacks.select),(t=i.el).addClass("ogx_dots"),d()},OGX.Dots.SELECT="DotsSelect",require("DynamicList","Uxi","Bind","Touch"),OGX.DynamicList=function(__config){construct(this,"DynamicList");var that=this,config=__config,config_default={el:null,key:!1,as:"item",display:!1,displays:!1,display_max:0,reorder:!1,swipe:!1,reselect:!1,chromeos:!1,min_x:30,chunks:0,hold_time:1e3,interval:5,list:[],selection:[],no_selection:{enabled:!1,prop:"",val:0},shift_selection:!1,callbacks:{select:null,unselect:null,render:null},mode:OGX.DynamicList.SELECT_MODE_SINGLE,trigger:!1,scope:!0,swipe_template:'<div class="ogx_dynamic_list_item ogx_dynamic_list_swiper_back_item" style="height:{{$height}}px; z-index:{{$zindex}}; margin-bottom:{{$margin}}px;">{{$template}}</div>',zindex:1},swipe_default={mode:OGX.DynamicList.SWIPE_MODE_DELETE,options:{},template:!1,html:""},container,filtered,isFiltered,selection=new OGX.List,key_id=1,key_default="__id__",key,drag={mode:!1,stime:0,target:0,si:0,ei:0,y:0},move_intv=null,hold_intv=null,drag_intv=null,swipe_dir=0,display=new OGX.Display(config),ready=!1,scroller=!1,chunk=0,multi_select_shift=!1,multi_select_control=!1,multi_select_started=!1,multi_select_start=null,multi_select_end=null;function isSelectable(__item){if(Array.isArray(config.no_selection)&&config.no_selection.length&&config.no_selection.includes(__item[key]))return!1;var q={};return q[key]=__item[key],!selection.get(q,null,1)&&(!config.no_selection.enabled||eval("__item."+config.no_selection.prop+" !== config.no_selection.val"))}function onUpdate(e,t){var i,n=config.list.getFilters();isFiltered&&((i=new OGX.List(t)).setFilters(n),i.filter().length||(e.remove(),filtered.findDelete(key,t[key],1),selection.findDelete(key,t[key],1)))}function replace(e,t,i){if(display.hasOML(i)){var n,o,a=toDataId(i[t]),r=display.oml('.ogx_dynamic_list[data-ogx-id="'+that.id+'"] > .ogx_dynamic_list_item[data-ogx-id='+a+"]",i,config.as);$('.ogx_dynamic_list[data-ogx-id="'+that.id+'"] > .ogx_dynamic_list_item[data-ogx-id='+a+"]").find(".ogx_uxi").each((function(e,t){n=$(t).data("ogx-id"),(o=that.cfind(!1,n,1))&&that.find(o._NAME_,o.id,"remove")})),OGX.OML.render(that,r,i)}else{var s="";selection.length&&selection.find(t,i[t],1)&&(s="ogx_dynamic_list_selected_item "),e.attr("class","").addClass("ogx_dynamic_list_item "+s+display.css(i)),e.html(display.html(i))}}function render(){var e=getWorkList(),t=selection;isFiltered&&(selection.resetFilters(),selection.setFilters(config.list.getFilters()),(t=selection.filter()).length!==selection.length&&(t.length?container.trigger(OGX.DynamicList.SELECT_FILTERED,[t]):container.trigger(OGX.DynamicList.SELECT_UNFILTERED,[selection])));var i,n,o,a="",r=[],s=e.length;(config.display_max||config.chunks)&&(s=config.display_max||config.chunks)>e.length&&(s=e.length);for(var l=0;l<s;l++)if(!config.scope||!e[l].hasOwnProperty("scope")||config.scope&&!0===config.scope&&OGX.Scope.eval(e[l].scope)||config.scope&&"string"==typeof config.scope&&OGX.Scope.eval(e[l].scope,config.scope)){!1,n="",i=e[l][key],selection.find(key,i,1)&&(n="ogx_dynamic_list_selected_item"),isSelectable(e[l])||(n="ogx_dynamic_list_disabled_item"),display.html(e[l]);var c=toDataId(i);a+='<div class="ogx_dynamic_list_item '+n+" "+display.css(e[l])+'" data-ogx-id='+c+"></div>",o=display.oml('.ogx_dynamic_list[data-ogx-id="'+that.id+'"] .ogx_dynamic_list_item[data-ogx-id='+c+"]",e[l],config.as),r.push(o)}that.observeOnce(null,(()=>{config.trigger&&container.trigger(OGX.DynamicList.RENDER),that.onRender(that)})),container.html(a),parseOML(r)}function parseOML(e){for(var t=0;t<e.length;t++)that.parse(e[t])}function listenScope(e){e?$(document).on(OGX.Scope.CHANGE,onScopeChange):$(document).off(OGX.Scope.CHANGE,onScopeChange)}function onScopeChange(){that.render()}function listenChunks(e){e?that.scroller.el.on(OGX.Scroller.BOTTOM,handleChunks):that.scroller.el.off(OGX.Scroller.BOTTOM,handleChunks)}function handleChunks(e){e.stopImmediatePropagation();var t=config.chunks*(chunk+1),i=config.chunks*(chunk+1)+config.chunks,n=getWorkList();i>n.length?(i=n.length,listenChunks(!1)):chunk++;for(var o=t;o<i;o++)that.insert(n[o],undefined,!1)}function listenShift(e){e?($(document).on("keydown",onShiftDown),$(document).on("keyup",onShiftUp)):($(document).off("keydown",onShiftDown),$(document).off("keyup",onShiftUp))}function onShiftDown(e){16===e.keyCode&&(multi_select_shift=!0),17===e.keyCode&&(multi_select_control=!0)}function onShiftUp(e){16===e.keyCode&&(multi_select_shift=!1,multi_select_started=!1),17===e.keyCode&&(multi_select_control=!1)}function listenItems(e){void 0!==container&&ready&&(e?container.on(that.touch.click,".ogx_dynamic_list_item",onClick):container.off(that.touch.click,".ogx_dynamic_list_item",onClick))}function listenTouch(e){e?container.on(that.touch.down,".ogx_dynamic_list_item",onTouchStart):container.off(that.touch.down,".ogx_dynamic_list_item",onTouchStart)}function listenTouchHold(e){e?hold_intv=setInterval(onTouchHold,20):(clearInterval(hold_intv),hold_intv=null)}function listenTouchMove(e){e?container.on(that.touch.move,".ogx_dynamic_list_item",onTouchMove):container.off(that.touch.move,".ogx_dynamic_list_item")}function onTouchStart(e){drag.mode=!1,drag.target=$(e.currentTarget),drag.si=drag.target.index(),drag.cy=container.offset().top,e=that.event(e),drag.startx=e.pageX,drag.starty=e.pageY,drag_intv&&clearInterval(drag_intv),drag.stime=(new Date).getTime(),config.reorder&&listenTouchHold(!0),listenTouchMove(!0),$("body").on(that.touch.up,onTouchEnd)}function onTouchMove(e){e=that.event(e),drag.y=-1*(drag.starty-e.pageY),drag.mx=e.pageX-drag.startx,drag.px=e.pageX,drag.py=e.pageY,drag.st=!1,config.swipe&&!drag.mode&&Math.abs(drag.mx)>config.min_x&&(drag.mode="swipe",config.scroll&&!drag.st&&(drag.st=!0,scroller.disable(),scroller.container().css("cssText","height:"+scroller.container().height()+"px !important;")),config.reorder&&listenTouchHold(!1),listenSwipeMove(!0))}function onTouchHold(){if(!drag.mode&&(new Date).getTime()-drag.stime>config.hold_time){drag.mode="reorder";var e=drag.target.data("ogx-id"),t=getWorkList();drag.item=t.find(key,e,1),container.trigger(OGX.DynamicList.HOLD,[drag.item]),listenTouchHold(!1),setTimeout(startDrag(),0)}}function onTouchEnd(e){if($("body").off(that.touch.up,onTouchEnd),(config.reorder||config.swipe)&&(clearInterval(drag_intv),drag_intv=!1,listenTouchMove(!1)),config.swipe&&listenSwipeMove(!1),config.reorder&&listenTouchHold(!1),config.scroll&&(scroller.enable(),scroller.container().removeAttr("style")),config.reorder){if("reorder"===drag.mode&&(container.off(that.touch.move,handleMove),drag.clone)){var t=JSON.parse(JSON.stringify(config.list[drag.si]));return config.list.delete(drag.si),config.list.insert(t,drag.ei),drag.clone.remove(),drag.clone=!1,drag.target.removeClass("ogx_dynamic_list_frozen"),void container.trigger(OGX.DynamicList.DROP,[drag.item])}var i=drag.target.data("ogx-id"),n=config.list.find(key,i,1);that.onSelect(n),container.trigger(OGX.DynamicList.SELECT,[n],data.target),that.select(key,i)}else if(config.swipe&&"swipe"===drag.mode){var o=drag.target.outerWidth(!0),a=Math.abs(100*drag.mx/o);a<50?a?(drag.target.addClass("ogx_dynamic_list_swiper_trans_item_restore"),drag.target.addClass("ogx_dynamic_list_swiper_trans_item").css("transform","translateX(0px)")):(drag.target.next(".ogx_dynamic_list_swiper_back_item").remove(),drag.target.css("transform","translateX(0px)")):drag.mx>0?(drag.target.attr("data-side","left"),drag.target.addClass("ogx_dynamic_list_swiper_trans_item").css("transform","translateX("+o+"px)")):(drag.target.attr("data-side","right"),drag.target.addClass("ogx_dynamic_list_swiper_trans_item").css("transform","translateX("+-1*o+"px)"))}drag.mode=!1}function listenSwipeMove(e){e?move_intv=setInterval(onSwipeMove,config.interval):(clearInterval(move_intv),move_intv=!1)}function onSwipeMove(){if("swipe"===drag.mode&&Math.abs(drag.mx)>config.min_x){var e=parseInt(drag.target.css("border-top-width").split("px")[0]),t=parseInt(drag.target.css("border-bottom-width").split("px")[0]),i=drag.target.outerHeight();if(!drag.target.hasClass("ogx_dynamic_list_swiper_work")){drag.target.addClass("ogx_dynamic_list_swiper_work");var n={};n.height=i,n.margin=-2*(e+t),n.top=drag.target.position().top,n.zindex=config.zindex;var o="";config.swipe.template?o=OGX.Templater.get(config.swipe.template):config.swipe.html&&(o=config.swipe.html),n.template=o,o=OGX.Templater.make(config.swipe_template,n),drag.target.after(o)}if(config.swipe.mode===OGX.DynamicList.SWIPE_MODE_SIDE&&(drag.mx<0?(swipe_dir=1,drag.target.next(".ogx_dynamic_list_swiper_back_item").addClass("ogx_dynamic_list_swiper_side_left").removeClass("ogx_dynamic_list_swiper_side_right")):(swipe_dir=-1,drag.target.next(".ogx_dynamic_list_swiper_back_item").addClass("ogx_dynamic_list_swiper_side_right").removeClass("ogx_dynamic_list_swiper_side_left"))),drag.py>=drag.target.offset().top&&drag.py<=drag.target.offset().top+i){drag.target.css("transform","translateX("+drag.mx+"px)");var a=drag.target.next(".ogx_dynamic_list_swiper_back_item");drag.mx<0?a.addClass("ogx_dynamic_list_swiper_right").removeClass("ogx_dynamic_list_swiper_left"):a.addClass("ogx_dynamic_list_swiper_left").removeClass("ogx_dynamic_list_swiper_right")}else onTouchEnd(drag.target)}}function listenTrans(e){e?container.on("transitionend",".ogx_dynamic_list_swiper_trans_item",onTransEnd):container.off("transitionend",".ogx_dynamic_list_swiper_trans_item",onTransEnd)}function onTransEnd(e){var t=$(this),i=t.next(".ogx_dynamic_list_swiper_back_item");if(t.hasClass("ogx_dynamic_list_swiper_trans_item_restore"))i.remove(),t.css("transform","translateX(0px)"),t.removeClass("ogx_dynamic_list_swiper_trans_item");else{var n,o=t.index(),a=t.data("ogx-id");switch(config.swipe.mode){case OGX.DynamicList.SWIPE_MODE_DELETE:t.remove(),shrink(i),n=config.list.findDelete(config.key,String(a),1),container.trigger(OGX.DynamicList.DELETE,{item:n,index:o});break;case OGX.DynamicList.SWIPE_MODE_SIDE:var r;n=config.list.find(config.key,a,1),r=-1===swipe_dir?"right":"left",container.trigger(OGX.DynamicList.SIDED,{side:r,item:n,index:o});break;case OGX.DynamicList.SWIPE_MODE_CUSTOM:}}t.removeClass("ogx_dynamic_list_swiper_work"),t.removeClass("ogx_dynamic_list_swiper_trans_item_restore")}function shrink(e,t){e.addClass("ogx_dynamic_list_swiper_delete"),e.on("transitionend",(function(){e.off("transitionend"),e.remove()}))}function startDrag(){drag.tgy=drag.target.position().top,drag.tgx=drag.target.position().left,drag.y=0;var e=drag.target.outerWidth(),t=drag.target.outerHeight();drag.clone=drag.target.clone().css({position:"absolute",left:drag.tgx+"px",top:drag.tgy+"px",width:e+"px",height:t+"px"}).addClass("ogx_dynamic_list_reorder").prependTo(container),drag.clone.addClass("ogx_dynamic_list_drag"),drag.target.addClass("ogx_dynamic_list_frozen"),drag_intv=setInterval(handleDrag,config.interval),container.on(that.touch.move,handleMove)}function handleMove(e){e.preventDefault(),e.stopImmediatePropagation(),e=that.event(e),drag.y=-1*(drag.starty-e.pageY)}function handleDrag(){if(Math.abs(container.offset().top-drag.cy)>1)return clearInterval(drag_intv),drag_intv=!1,drag.clone.remove(),drag.clone=!1,drag.target.removeClass("ogx_dynamic_list_frozen"),void container.trigger(OGX.DynamicList.RELEASE);var e=!1,t=container.children(".ogx_dynamic_list_item").last(),i=t.offset().top+-1*drag.cy;if(drag.tgy+drag.y<i?drag.clone.css({top:drag.tgy+drag.y}):e=t,!e){var n,o,a,r,s=0;container.children(".ogx_dynamic_list_item").each((function(t,i){if((i=$(i))[0]!==drag.clone[0]&&!i.hasClass("ogx_dynamic_list_frozen")){if(n=i.offset().top,o=i.outerHeight(),r=n+o/2,(a=drag.clone.offset().top)>n&&a<r)return s=-1,void(e=i);if(a>r&&a<n+o)return s=1,void(e=i)}}))}if(e){var l,c=$(e).data("ogx-id");switch(drag.ei=config.list.findIndex(key,c).index,s){case-1:e.index()-1!==drag.target.index()&&((l=drag.target.detach()).removeClass("ogx_dynamic_list_drag"),l.insertBefore(e));break;case 1:e.index()+1!==drag.target.index()&&((l=drag.target.detach()).removeClass("ogx_dynamic_list_drag"),l.insertAfter(e))}e=!1}}function onClick(e){e.preventDefault(),e.stopImmediatePropagation();var t=$(this);switch(config.mode){case OGX.DynamicList.SELECT_MODE_SINGLE:!config.reselect&&t.hasClass("ogx_dynamic_list_selected_item")||t.hasClass("ogx_dynamic_list_swiper_trans_item")||(r=selectIndex(t.index(),!0))&&(that.onSelect(r),container.trigger(OGX.DynamicList.SELECT,[r,t]));break;case OGX.DynamicList.SELECT_MODE_TOGGLE:t.hasClass("ogx_dynamic_list_selected_item")||t.hasClass("ogx_dynamic_list_swiper_trans_item")?(r=selectIndex(t.index(),!1))&&(that.onUnselect(r),container.trigger(OGX.DynamicList.UNSELECT,[r,t])):(that.resetSelection(),(r=selectIndex(t.index(),!0))&&(that.onSelect(r),container.trigger(OGX.DynamicList.SELECT,[r,t])));break;case OGX.DynamicList.SELECT_MODE_MULTI:if(t.hasClass("ogx_dynamic_list_selected_item")||t.hasClass("ogx_dynamic_list_swiper_trans_item"))(r=selectIndex(t.index(),!1))&&(that.onUnselect(r),container.trigger(OGX.DynamicList.UNSELECT,[r,t]));else if(config.shift_selection&&multi_select_shift)if(multi_select_started){if((multi_select_end=t.index())<multi_select_start){var i=multi_select_end;multi_select_end=multi_select_start,multi_select_start=i}for(var n=multi_select_start;n<multi_select_end+1;n++)r=selectIndex(n,!0),that.onSelect(r),container.trigger(OGX.DynamicList.SELECT,[r,t])}else multi_select_started=!0,multi_select_start=t.index(),multi_select_control||(that.resetSelection(),r=selectIndex(multi_select_start),that.onSelect(r),container.trigger(OGX.DynamicList.SELECT,[r,t]));else(r=selectIndex(t.index(),!0))&&(that.onSelect(r),container.trigger(OGX.DynamicList.SELECT,[r,t]));break;case OGX.DynamicList.SELECT_MODE_SET:var o=getWorkList();t.hasClass("ogx_dynamic_list_swiper_trans_item")||(r=t.hasClass("ogx_dynamic_list_selected_item")?o[t.index()]:selectIndex(t.index(),!0))&&(that.onSelect(r),container.trigger(OGX.DynamicList.SELECT,[r,t]));break;case OGX.DynamicList.SELECT_MODE_HIT:o=getWorkList();if(t.hasClass("ogx_dynamic_list_swiper_back_item")){var a="left";t.hasClass("ogx_dynamic_list_swiper_side_right")&&(a="right"),container.trigger(OGX.DynamicList.BACK_HIT,{side:a,item:o[t.index()]})}else{var r=selectIndex(t.index(),!1);that.onSelect(r),container.trigger(OGX.DynamicList.SELECT,[r,t])}}}function select(e,t,i,n){void 0===n&&(n=!1);var o=null;"single"===config.mode&&(that.resetSelection(),o=1);var a,r,s=getWorkList(),l={};Array.isArray(t)?(l[e]={in:t},sel=s.get(l,null,o)):(l[e]={eq:t},sel=s.get(l)),sel&&!Array.isArray(sel)&&(sel=[sel]);for(var c=0;c<sel.length;c++)r=toDataId(sel[c][key]),(a=container.find(".ogx_dynamic_list_item[data-ogx-id="+r+"]"))&&(i?(a.addClass("ogx_dynamic_list_selected_item"),selection.push(sel[c]),n&&(that.el.trigger(OGX.DynamicList.SELECT,[sel[c],a]),that.onSelect(sel[c]))):(a.removeClass("ogx_dynamic_list_selected_item"),selection.findDelete(key,sel[c][key],1)));return["single","hit"].includes(config.mode)&&sel.length?sel[0]:sel}function selectIndex(e,t,i){var n,o;void 0===i&&(i=!1);var a=getWorkList();if((n=container.find(".ogx_dynamic_list_item:eq("+e+")")).length>0){var r=n.data("ogx-id");return o=a.find(key,r,1),t?isSelectable(o)&&(config.mode===OGX.DynamicList.SELECT_MODE_SINGLE&&that.resetSelection(),n.addClass("ogx_dynamic_list_selected_item"),selection.push(a[e]),i&&(that.el.trigger(OGX.DynamicList.SELECT,[a[e],n]),that.onSelect(a[e]))):(n.removeClass("ogx_dynamic_list_selected_item"),selection.findDelete(key,r,1)),o}return!1}function noSelectionCSS(){if(container.find(".ogx_dynamic_list_item_disabled").removeClass("ogx_dynamic_list_item_disabled"),Array.isArray(config.no_selection)&&config.no_selection.length){var e,t={};t[key]={in:config.no_selection},config.list.get(t).forEach((t=>{(e=that.getElement(key,t[key]))&&(e=$(e)).addClass("ogx_dynamic_list_item_disabled")}))}}function getWorkList(){return isFiltered?filtered:config.list}function toDataId(e){return"string"==typeof e&&(e='"'+e+'"'),e}function forceIds(){for(var e=0;e<config.list.length;e++)config.list[e][key]=key_id,key_id++}function clearIds(e){for(var t=0;t<e.length;t++)delete e[t][key];return e}function finalize(){config.selection.length&&that.observeOnce({childList:!0,subtree:!0},(function(){for(var e=0;e<config.selection.length;e++)that.select(key,config.selection[e])})),that.val(config.list,!1,!1),ready=!0,!that.blured&&config.enabled&&(listenItems(!0),config.chunks&&listenChunks(!0)),!0===config.scope&&listenScope(!0),container.trigger(OGX.DynamicList.READY)}function initDefaults(){config||(config={}),OGX.Data.merge(config,config_default),config.list.hasOwnProperty("_NAME_")||(config.list=new OGX.List(config.list)),!config.key&&config.list.length>0?(key=key_default,forceIds()):key=config.key,config.swipe&&("object"!=typeof config.swipe&&(config.swipe={}),OGX.Data.merge(config.swipe,swipe_default)),config.callbacks.select&&(that.onSelect=config.callbacks.select),config.callbacks.unselect&&(that.onUnselect=config.callbacks.unselect),config.callbacks.render&&(that.onRender=config.callbacks.render),(container=that.el).addClass("ogx_dynamic_list")}function init(){initDefaults(),finalize(),config.scroll&&(scroller=that.find("Scroller",config.id+"_scroller"))}this.onFocus=function(e){return void 0===e&&(e=!1),(e||config.mode!==OGX.DynamicList.STATIC)&&(listenItems(!0),(config.reorder||config.swipe)&&(listenTouch(!0),config.swipe&&listenTrans(!0))),config.chunks&&listenChunks(!0),"multi"===config.mode&&config.shift_selection&&listenShift(!0),this},this.onBlur=function(e){return void 0===e&&(e=!1),(e||config.mode!==OGX.DynamicList.STATIC)&&(listenItems(!1),(config.reorder||config.swipe)&&(listenTouch(!1),config.swipe&&listenTrans(!1))),config.chunks&&listenChunks(!1),"multi"===config.mode&&config.shift_selection&&listenShift(!1),this},this.bindFilter=function(e,t,i,n){void 0!==i&&("function"==typeof n?(config.list.removeFilter(e),config.list.addFilter(e,n,i)):(config.list.removeFilter(e),config.list.addFilter(e,t,i))),config.list.getFilters()&&(filtered=config.list.filter(),isFiltered=!0),chunk=0,config.chunks&&listenChunks(!0),setTimeout(render,0)},this.unbindFilter=function(e){return config.list.removeFilter(e),filtered=config.list.filter(),isFiltered=!0,setTimeout(render,0),this},this.bindValue=function(){var e=this.getSelection();return e||null},this.destroy=function(){!0===config.scope&&listenScope(!1),this.clearBinds(),container.empty(),container.removeClass("ogx_dynamic_list")},this.val=function(e,t,i){if(void 0===e){if(!config.key){var n=JSON.parse(JSON.stringify(config.list));return clearIds(OGX.List(n))}return config.list}var o;return config.scroll?this.clear(this.scroller.id):this.clear(),void 0===t&&(t=!1),void 0===i&&(i=!0),e.hasOwnProperty("insert")||(e=new OGX.List(e)),this.resetSelection(),t||(o=config.list.getFilters()),config.list=e,config.key&&key!==key_default||(key_id=1,key=key_default,e=JSON.parse(JSON.stringify(e)),forceIds()),!t&&Object.keys(o).length?(config.list.setFilters(o),setTimeout(this.filter,0)):i?setTimeout(render,0):render(),this},this.scope=function(e){return void 0!==e&&"string"==typeof e?(config.scope=e,void this.render()):config.scope},this.onSelect=function(e){},this.onUnselect=function(e){},this.onRender=function(){},this.getFilteredList=function(){if(isFiltered){if(!config.key){var e=JSON.parse(JSON.stringify(filtered));return clearIds(OGX.List(e))}return filtered}return!1},this.display=function(e){return void 0===e?config.display:display.val(e)},this.key=function(e){if(void 0===e)return e;config.key=e,config.key||(key=key_default)},this.mode=function(e){return void 0===e?config.mode:(config.mode!==e&&(config.mode===OGX.DynamicList.STATIC?this.onFocus(!0):e===OGX.DynamicList.STATIC?this.onBlur(!0):e===OGX.DynamicList.SELECT_MODE_MULTI&&config.shift_selection&&!this.blured&&listenShift(!0),config.mode=e),this)},this.noSelection=function(e,t){if(1===arguments.length){if("object"==typeof e&&!Array.isArray(e))return config.no_selection=e,void noSelectionCSS();if("boolean"==typeof e)return config.no_selection.enabled=e,void noSelectionCSS();if(Array.isArray(e))return config.no_selection=e,void noSelectionCSS()}return 2===arguments.length?(config.no_selection.enabled=!0,config.no_selection.prop=e,config.no_selection.val=t,void noSelectionCSS()):config.no_selection},this.order=function(e,t){return config.list.order(e,t),setTimeout(render,0),this},this.filter=function(){return filtered=config.list.filter(),isFiltered=!0,setTimeout(render,0),filtered},this.unfilter=function(){return isFiltered=!1,setTimeout(render,0),this},this.addFilter=function(e,t,i){return config.list.addFilter(e,t,i)},this.removeFilter=function(e,t,i){return config.list.removeFilter(e,t,i)},this.resetFilters=function(){return config.list.resetFilters()},this.getFilters=function(){return config.list.getFilters()},this.insert=function(e,t,i){if(void 0===i&&(i=!0),!Array.isArray(e)){config.key||(e[key]=key_id++);var n=!1,o=!0;if(isFiltered){var a=new OGX.List(e);a.setFilters(config.list.getFilters()),0===a.filter().length?o=!1:filtered.push(e)}var r=toDataId(e[key]),s='<div class="ogx_dynamic_list_item '+display.css(e)+'" data-ogx-id='+r+"></div>",l=display.oml('.ogx_dynamic_list[data-ogx-id="'+this.id+'"] .ogx_dynamic_list_item[data-ogx-id='+r+"]",e,config.as);if(void 0===t)i&&config.list.push(e),o&&container.append(s);else if(i&&config.list.insert(e,t),o&&(isFiltered?n=(filtered=config.list.filter()).findIndex(key,e[key]):0===t?container.prepend(s):n=config.list.findIndex(key,e[key]),n)){var c=container.children(".ogx_dynamic_list_item:nth-child("+(n.index+1)+")");c.length>0?c.before(s):container.append(s)}return this.parse(l),config.trigger&&container.trigger(OGX.DynamicList.RENDER),this.onRender(),o}for(var d=0;d<e.length;d++)void 0!==t?this.insert(e[d],t+d):this.insert(e[d])},this.delete=function(e){var t=getWorkList().delete(e);if(t){config.list.findDelete(key,t[key],1),isFiltered&&filtered.findDelete(key,t[key],1),selection.findDelete(key,t[key],1);var i=container.children(".ogx_dynamic_list_item:eq("+e+")");return this.remove(t[key]),i.remove(),!0}return!1},this.deleteSelection=function(){for(var e=0;e<selection.length;e++)config.list.findDelete(key,selection[e][key],1),isFiltered&&filtered.findDelete(key,selection[e][key],1),this.remove(selection[e][key]),selection.findDelete(key,selection[e][key],1),container.children(".ogx_dynamic_list_selected_item").remove();return!0},this.findDelete=function(e,t,i){void 0===i&&1===arguments.length&&(t=e,e=key);var n,o,a,r=config.list.findDelete(e,t,i);r&&!Array.isArray(r)&&(r=[r]),selection.findDelete(e,t,i);for(var s=0;s<r.length;s++)isFiltered&&filtered.findDelete(e,t,i),a=toDataId(r[s][key]),o=(n=container.children(".ogx_dynamic_list_item[data-ogx-id="+a+"]")).next(".ogx_dynamic_list_swiper_back_item"),n.remove(),this.remove(r[s][key]),shrink(o);return 1===i?r[0]:r},this.findMove=function(e,t,i){void 0===i&&([i,t,e]=[t,e,key]);var n=this.findDelete(e,t,1);n&&this.insert(n,i)},this.findIndex=function(e,t){var i=arguments.length;1===i&&(t=e,e=key);var n=config.list.find(e,t,1);if(n){var o=toDataId(n[key]);return container.children(".ogx_dynamic_list_item[data-ogx-id="+o+"]").index()}return-1},this.findReplace=function(e,t,i){var n=arguments.length;2===n&&(i=t,t=e,e=key),config.key||(i[key]=key_id++);var o=config.list.findReplace(e,t,i,1);if(o){isFiltered&&filtered.findReplace(e,t,i,1);var a=toDataId(o[key]),r=container.children(".ogx_dynamic_list_item[data-ogx-id="+a+"]").first();return r.length&&(r.attr("data-ogx-id",i[key]),replace(r,key,i),config.trigger&&container.trigger(OGX.DynamicList.RENDER),this.onRender()),!0}return!1},this.replaceAt=function(e,t){var i=getWorkList();if(void 0===i[e])return!1;if(config.key)i[e]=t;else{var n=i[e][key];i[e]=t,i[e].key=n}return this.refreshAt(e)},this.select=function(e,t,i){return void 0===i&&(void 0===t&&(t=e,e=key),i=!1),select(e,t,!0,i)},this.selectIndex=function(e,t){return selectIndex(e,!0,t)},this.index=function(e){if(void 0!==e){var t=getWorkList();return this.select(key,t[e][key])}return container.children(".ogx_dynamic_list_selected_item").index()},this.unselect=function(e,t){return void 0===t&&(t=e,e=key),select(e,t,!1)},this.unselectIndex=function(e){return selectIndex(e,!1)},this.resetSelection=function(){return selection=new OGX.List,container.children(".ogx_dynamic_list_selected_item").removeClass("ogx_dynamic_list_selected_item"),this},this.getSelection=function(e){if(void 0===e&&(e=!1),!e){var t,i=selection;if(isFiltered&&(selection.resetFilters(),selection.setFilters(config.list.getFilters()),i=selection.filter()),config.key)t=i;else t=clearIds(OGX.Data.clone(i));return config.mode===OGX.DynamicList.SELECT_MODE_SINGLE?!!t.length&&t[0]:t=new OGX.List(t)}return container.children(".ogx_dynamic_list_selected_item")},this.getElement=function(e,t){var i=arguments.length;1===i&&(t=e,e=key);var n=config.list.find(e,t,1);if(n){var o=toDataId(n[key]);return container.children(".ogx_dynamic_list_item[data-ogx-id="+o+"]")[0]}return!1},this.findUpdate=function(e,t,i,n,o,a){var r;"number"==typeof n&&(a=o,Array.prototype.unshift.call(arguments,key)),void 0===a&&(a=!0);var s=config.list.findUpdate.apply(config.list,arguments);if(s&&!Array.isArray(s)&&(s=[s]),s.length&&a){var l;isFiltered&&filtered.findUpdate.apply(filtered,arguments);for(var c=0;c<s.length;c++)l=toDataId(s[c][key]),(r=container.children(".ogx_dynamic_list_item[data-ogx-id="+l+"]").first()).length&&(replace(r,key,s[c]),onUpdate(r,s[c]),config.trigger&&container.trigger(OGX.DynamicList.RENDER),this.onRender());return s.length}return!1},this.update=function(e,t,i,n,o){void 0===o&&(o=!0);var a=config.list.update(e,t,i,n);if(a&&!Array.isArray(a)&&(a=[a]),a.length&&o){var r;isFiltered&&filtered.update(arguments);for(var s=0;s<a.length;s++)r=toDataId(a[s][key]),el=container.children(".ogx_dynamic_list_item[data-ogx-id="+r+"]").first(),el.length&&(replace(el,key,a[s]),onUpdate(el,a[s]),config.trigger&&container.trigger(OGX.DynamicList.RENDER),this.onRender());return a.length}return!1},this.refresh=function(e,t,i){var n=arguments.length;void 0!==i&&n--,1===n&&(t=e,e=key);var o=config.list.find(e,t,i);if(o&&(1===i&&(o=[o]),o.length))for(var a,r,s=0;s<o.length;s++)r=toDataId(o[s][key]),(a=container.children(".ogx_dynamic_list_item[data-ogx-id="+r+"]")).length>0&&replace(a,key,o[s]);return this},this.refreshAt=function(e){var t=getWorkList();if(void 0!==t[e]){var i=toDataId(t[e][key]),n=container.children(".ogx_dynamic_list_item[data-ogx-id="+i+"]");if(n.length>0)return replace(n,key,t[e]),!0}return!1},this.restore=function(e,t){var i=arguments.length;1===i&&(t=e,e=key);var n=config.list.find(e,t,1),o=toDataId(n[key]),a=container.children(".ogx_dynamic_list_item[data-ogx-id="+o+"]");a.addClass("ogx_dynamic_list_swiper_trans_item_restore"),a.css({transform:"translateX(0px)","z-index":config.zindex+1}),setTimeout((()=>{a.next(".ogx_dynamic_list_swiper_back_item").remove()}),200)},this.wipe=function(){return config.scroll?this.clear([this.scroller.id]):this.clear(),this.val([])},this.reset=function(){return container.empty(),isFiltered=!1,config.list=new OGX.List,selection=new OGX.List,filtered=new OGX.List,this},this.render=function(){return setTimeout(render,0),this},this.scroll=function(e,t){if(config.scroll){void 0===t&&([t,e]=[e,key]);var i=this.getElement(key,t);i&&scroller.scroll($(i).position().top)}},init()},OGX.DynamicList.HOLD="DynamicListHold",OGX.DynamicList.RELEASE="DynamicListRelease",OGX.DynamicList.DROP="DynamicListDrop",OGX.DynamicList.SELECT="DynamicListSelect",OGX.DynamicList.DELETE="DynamicListDelete",OGX.DynamicList.SIDED="DynamicListSided",OGX.DynamicList.BACK_HIT="DynamicListBackHit",OGX.DynamicList.UNSELECT="DynamicListUnselect",OGX.DynamicList.RENDER="DynamicListRender",OGX.DynamicList.SELECT_MODE_SINGLE="single",OGX.DynamicList.SELECT_MODE_TOGGLE="toggle",OGX.DynamicList.SELECT_MODE_MULTI="multi",OGX.DynamicList.SELECT_MODE_SET="set",OGX.DynamicList.SELECT_MODE_HIT="hit",OGX.DynamicList.SELECT_FILTERED="DynamicListSelectFiltered",OGX.DynamicList.SELECT_UNFILTERED="DynamicListSelecUnfiltered",OGX.DynamicList.STATIC="static",OGX.DynamicList.SWIPE_LEFT="DynamicListSwipeLeft",OGX.DynamicList.SWIPE_RIGHT="DynamicListSwipeRight",OGX.DynamicList.SWIPE_MODE_DELETE="DynamicListSwipeModeDelete",OGX.DynamicList.SWIPE_MODE_SIDE="DynamicListSwipeModeSide",OGX.DynamicList.SWIPE_MODE_CUSTOM="DynamicListSwipeModeCustom",OGX.DynamicList.READY="DynamicListReady",OGX.DynamicList.BIND=OGX.DynamicList.SELECT+" "+OGX.DynamicList.UNSELECT,OGX.Fonction=function(__config,__data,__route_data){var that=this,config=__config,config_default={id:1,parent:null,fnc:null,data:null,success:null,error:null};OGX.Data.merge(config,config_default,!1);var fnc=eval(config.fnc),oml,promise=fnc.apply(null,[config.data]);promise.then((function(e){OGX.OML.result(config.id,e),oml=config.success,OGX.OML.render(config.parent,oml,__data,__route_data)}),(function(e){OGX.OML.result(config.id,e),oml=config.error,OGX.OML.render(config.parent,oml,__data,__route_data)}))},OGX.Form=function(){"use strict";var e=this,t={el:!1,allowed:!1,forbidden:!1,change_cb:!1,submit_cb:!1,validate:!1,diff:!0,params:null,elem_types:["input","select","textarea"],wait:1e3,fields:{},buffer:null},i={el:!1,allowed:/[0-9a-zA-Z‘’'"à-úÀ-Ú\\-\\!\\.\\?\\#\\@\\$\\:\\(\\)\\/_,;%' ]/,forbidden:/[<>]/,pattern:!1,validate:!1,mask:!1,mask_char:"%",paste:!0,autocomplete:null,multiline:!1,input_cb:!1,change_cb:!1,submit:!1,submit_cb:!1,diff:!0,val:null,last_change:!1,wait:2e3,intv:!1,max:2500,type:"string",params:null},n=new OGX.List,o=new OGX.List,a=!1;function r(e,i){$(i).find(t.elem_types.join(",")).each((function(t,i){$(i).prop("disabled",!e)}))}function s(t,i){if(!a){var o,r=n.find("el",i,1);if(r&&r.config.change_cb){for(var s in r.fields)if(r.fields[s].intv)return;var l=u(r.form,!0);for(var d in l)r.config.fields.hasOwnProperty(d)&&r.config.fields[d].hasOwnProperty("type")?l[d]=c(r.config.fields[d].type,l[d]):r.config.hasOwnProperty("type")&&(l[d]=c(r.config.type,l[d]));if(o=JSON.stringify(l),!r.diff||r.val!==o){var h;if(r.val=o,r.config.validate){h={obj:l,form:i,valid:!1};var f=e.validate(r.form);!0===f?h.valid=!0:(h.valid=!1,h.error=f)}else h=l;r.config.params&&(h.params=r.config.params),r.buffer&&clearTimeout(r.buffer),r.buffer=setTimeout((()=>{r.config.change_cb(h)}),10)}}}}function l(t){var i={el:t.el,config:t,field:$(t.el),intv:!1,fnc:"val"};"DIV"===i.field[0].nodeName&&"true"===i.field.prop("contenteditable")&&(i.fnc="text");var o=i.field.data("ogx-type");o&&(i.config.type=o),i.name=i.field.attr("name"),i.val=i.field[i.fnc](),i.field[i.fnc](i.val),t.pattern&&i.field.attr("pattern",t.pattern),n.insert(i),$(document).on("input change",i.el,(function(e){if(!a){var t=$(this)[i.fnc]();if(!i.config.diff||i.config.diff&&t!==i.val){if(i.config.input_cb){var n={value:null,obj:{},el:null};t=c(i.config.type,t),n.el=i.field[0],n.value=t,n.property=i.name,n.obj[i.name]=t,i.config.input_cb(n,i.config.params)}i.intv&&clearTimeout(i.intv),i.intv=setTimeout((()=>{!function(e){var t=$(e.el)[e.fnc]();if(e.val=t,e.config.change_cb){var i={value:null,obj:{},el:null};t=c(e.config.type,t),i.el=e.field[0],i.property=e.name,i.value=t,i.obj[i.property]=t,e.config.validate&&(i.valid=i.el.checkValidity()),e.config.change_cb(i,e.config.params)}}(i)}),i.config.wait)}}})),t.multiline||$(document).on("keydown",i.el,(function(e){var t=$(this);if(void 0!==e.which&&void 0!==e.key){if(!a){if(i.config.mask&&8===e.which||46===e.which){var n=t[0].selectionStart,o=t[i.fnc]();return o=8===e.which?o.substr(0,n-1):o.substr(0,n),t[i.fnc](o),!1}if(8!==e.which&&13!==e.which&&1===e.key.length){var r=e.key;if(13!==e.which&&i.config.mask){if((o=t[i.fnc]()).length>=i.config.mask.length)return e.preventDefault(),e.stopImmediatePropagation(),!1;for(var s=i.config.mask,l=0;l<o.length;l++)i.config.mask.substr(l,1)===i.config.mask_char&&(s=s.replace(i.config.mask_char,o.substr(l,1)));var d=s.indexOf(i.config.mask_char),u=!1;return d+1<s.length+1&&(u=s.substr(d+1,1)),-1!==d&&(r===i.config.mask.substr(s.indexOf(i.config.mask_char)-1,1)?s=s.substr(0,s.indexOf(i.config.mask_char)-1):(s=s.substr(0,s.indexOf(i.config.mask_char)),u&&u!==i.config.mask_char&&setTimeout((()=>{i.field[i.fnc](s+r+u)}),0))),void i.field[i.fnc](s)}}if(13===e.which){e.preventDefault(),e.stopImmediatePropagation();o=$(this)[i.fnc]();if(i.intv&&(clearInterval(i.intv),i.intv=null),i.config.change_cb||i.config.submit){var h={value:null,obj:{},el:null};o=c(i.config.type,o),h.el=i.field[0],h.property=i.name,h.value=o,h.obj[i.name]=o,i.config.validate&&(h.valid=i.field[0].checkValidity()),i.config.change_cb&&i.config.change_cb(h,i.config.params),i.config.submit&&(i.config.submit_cb?i.config.submit_cb(h):i.field.trigger("submit"))}else i.field.trigger("change",o)}}}else i.config.mask&&setTimeout((()=>{for(var e=t[i.fnc](),n="",o=0,a=0;a<i.config.mask.length&&a-o!==e.length;a++)i.config.mask.substr(a,1)===i.config.mask_char||i.config.mask.substr(a,1)===e.substr(a-o,1)?n+=e.substr(a-o,1):i.config.mask.substr(a,1)!==i.config.mask_char&&(n+=i.config.mask.substr(a,1),a&&o++);t[i.fnc](n)}),0)})),(i.config.allowed||i.config.forbidden)&&e.restrictField(i.config)}function c(e,t){switch(e){case"string":return String(t);case"number":return Number(t);case"int":return parseInt(t);case"bool":if([!0,"true",1].includes(t))return!0;case"json":var i;try{i=JSON.parse(t)}catch(e){i=null}return i}return t}function d(){for(var e=0;e<n.length;e++)n[e].hasOwnProperty("field")&&n[e].field.length&&(n[e].val=$(n[e].field[0])[n[e].fnc]())}function u(e,i){void 0===i&&(i=!1);var o,a=$(e),r=[];if(i){var s="";t.elem_types.forEach((e=>{s+=e+":disabled,"})),s=s.slice(0,-1),a.find(s).each((function(e,t){r.push(t.getAttribute("name"))}))}return a.serializeArray().map(function(e){var t;return t=e.name,(o=n.get({name:{in:t}},null,1))&&(e.value=c(o.config.type,e.value)),r.length&&r.includes(e.name)||(this[e.name]=e.value),this}.bind({}))[0]}this.updateBind=function(e,t){var i=this.getBind(e);return!!i&&(OGX.Data.merge(i.config,t,!0,!1,!1),!0)},this.getBind=function(e){return n.get({el:{in:e}},null,null,1)},this.bindForm=function(o){return OGX.Data.merge(o,t,!1),function(t){for(var o,r,c={el:t.el,config:t,form:$(t.el),fields:new OGX.List,val:""},d=0;d<t.elem_types.length;d++)c.form.find(t.elem_types[d]).each((function(e,n){n.hasAttribute("name")&&(r=n.getAttribute("name"),o=OGX.Data.clone(i),OGX.Data.merge(o,t,!0,!1,!0),t.fields.hasOwnProperty(r)&&(o=OGX.Data.merge(o,t.fields[r],!0)),o.el=t.el+" "+t.elem_types[d]+'[name="'+r+'"]',o.change_cb=s,o.params=t.el,l(o),c.fields.insert({el:o.el}))}));c.form.on("submit",(function(t){if(t.preventDefault(),t.stopImmediatePropagation(),!a){var i={obj:u(c.el),form:c.el};if(c.config.params&&(i.params=c.config.params),c.config.validate){var n=e.validate(c.el);!0===n?i.valid=!0:(i.valid=!1,i.error=n)}c.config.submit_cb?c.config.submit_cb(i):c.form.trigger("submit",i)}})),n.insert(c)}(o),!0},this.enableForm=function(e){void 0===e?n.forEach((e=>{e.hasOwnProperty("fields")&&r(!0,e.el)})):r(!0,e)},this.disableForm=function(e){void 0===e?n.forEach((e=>{e.hasOwnProperty("fields")&&r(!1,e.el)})):r(!1,e)},this.enable=function(){a&&(a=!1)},this.disable=function(){a||(a=!0)},this.change=e=>{var t=n.get({el:{eq:e}},null,1);t&&t.fields.length&&s(this.toObj(t.el),t.el)},this.unbindForm=function(e){if(void 0===e)unbindAll("form");else{var t=n.find("el",e,1);if(t){for(var i in $(document).off("submit",t.el),t.fields)this.unbindField(t.fields[i].el);n.findDelete("el",e,1)}}},this.unbindAll=function(t){void 0===t&&(t="all"),[...n].forEach((i=>{["form","all"].includes(t)&&i.hasOwnProperty("fields")?e.unbindForm(i.el):["field","all"].includes(t)&&!i.hasOwnProperty("fields")&&e.unbindField(i.el)}))},this.bindField=function(e){return OGX.Data.merge(e,i),l(e),!0},this.unbindField=function(e){var t=n.find("el",e,1);t&&($(document).off("input change",t.el),t.config.multiline||$(document).off("keydown",t.el),t.intv&&clearInterval(t.intv),o.find("el",t.el,1)&&this.unrestrictField(t.el),n.findDelete("el",t.el,1))},this.restrictField=function(e){return OGX.Data.merge(e,i),function(e){var t={el:e.el,config:e,field:$(e.el),keys:[],content:null},i=[8,9];null===e.autocomplete&&t.field[0].hasAttribute("autocomplete")&&"off"!==t.field.attr("autocomplete")?t.config.autocomplete=!0:(null===e.autocomplete&&(e.autocomplete=!0),t.config.autocomplete=e.autocomplete);e.autocomplete||t.keys.push(229);-1!==["input","texarea"].indexOf(t.field.get(0).tagName.toLowerCase())?t.content="val":t.content="text";t.config.multiline||t.keys.push(13);$(document).on("textInput keydown",t.el,(function(e){if("keydown"===e.type&&8==e.keyCode||46==e.keyCode)$(this).trigger("input");else if("textInput"===e.type){var n=e.originalEvent.data;if(n.length>1)return t.config.autocomplete?void 0:(e.preventDefault(),e.stopImmediatePropagation(),!1);if(1===n.length&&-1!==t.keys.indexOf(e.which)&&-1===e.which.indexOf(i))return e.preventDefault(),e.stopImmediatePropagation(),!1;if(t.config.multiline&&13===e.keyCode)return!1;if(t.config.allowed&&!n.match(t.config.allowed))return e.preventDefault(),e.stopImmediatePropagation(),!1;if(t.config.forbidden&&n.match(t.config.forbidden))return e.preventDefault(),e.stopImmediatePropagation(),!1;if($(e.originalEvent.target)[t.content]().length>=t.config.max)return e.preventDefault(),e.stopImmediatePropagation(),!1}})),$(document).on("paste",t.el,(function(e){if(!t.config.paste)return e.preventDefault(),e.stopImmediatePropagation(),!1;var i=e.originalEvent.clipboardData.getData("Text");return t.config.forbidden&&i.match(t.config.forbidden)?(e.preventDefault(),e.stopImmediatePropagation(),!1):void 0})),o.insert(t)}(e),!0},this.unrestrictField=function(e){var t=o.find("el",e,1);return!!t&&($(document).off("textInput keydown",t.el),$(document).off("paste",t.el),o.findDelete("el",e,1),!0)},this.toObj=function(e,t){return u(e,t)},this.populate=function(e,t,i){var n,o,a,r;void 0===i&&(i=null),$(e).find("*[name]").each((function(e,s){n=s.getAttribute("name"),a=!1,"string"!=typeof(a=OGX.Data.eval(t,n))&&(a=JSON.stringify(a)),void 0!==a&&(i&&i.hasOwnProperty(n)&&"function"==typeof i[n]&&(a=i[n](a)),o=$(s),r="val","true"===o.prop("editablecontent")&&(r="text"),o[r](a),s.hasAttribute("type")&&"hidden"===o.attr("type")&&o.trigger("change"))})),setTimeout(d,0)},this.validate=function(e){var i,n=$(e),o=t.elem_types,a=[];return n.find(o.join(",")).each((function(e,t){"submit"!==(i=$(t)).attr("type")&&(t.checkValidity()||a.push(i))})),!a.length||a}},OGX.Form=new OGX.Form,OGX.Form.fromObject=function(e,t,i,n){var o={el:t.selector+" "+i,data:e,fullpath:!1};return OGX.Data.merge(o,n),t.create("FormInstance",o)},require("FormInstance","Uxi","Placeholder"),OGX.FormInstance=function(__config){construct(this,"FormInstance");var that=this,config_defaults={fullpath:!1},config=OGX.Data.merge(__config,OGX.Form.defaults,!1,!0);function render(){var html="",oml='{"default:Html":{"html": {{$html}}, "node:OML": {{$oml}} }}',render_oml=!1,row,nodes=[];function cycle(__o,__path){for(var a in __o){var t=typeof __o[a],p;switch(p=__path?__path+"."+a:a,t){case"object":if(Array.isArray(__o[a]))if(["string","number","boolean"].includes(typeof __o[a][0]))row=genRow("array",a,JSON.stringify(__o[a])),html+=row.html,row.oml&&(nodes.push(row.oml),render_oml=!0);else for(var i=0;i<__o[a].length;i++)cycle(__o[a][i],__path?__path+"."+a+"["+i+"]":a+"["+i+"]");else cycle(__o[a],__path?__path+"."+a:a);break;case"string":case"number":case"boolean":var pattern="",required=!1,readonly=!1,oo;if(config.hasOwnProperty("fields")){try{oo=eval("config.fields."+p)}catch(e){}void 0!==oo&&(oo.hasOwnProperty("pattern")&&(pattern=oo.pattern),oo.hasOwnProperty("required")&&(required=oo.required),oo.hasOwnProperty("readonly")&&(readonly=oo.readonly))}row=genRow(t,p,__o[a],required,pattern,readonly),html+=row.html,row.oml&&(nodes.push(row.oml),render_oml=!0)}}}cycle(config.data,null),html=OGX.Templater.make(OGX.Form.defaults.templates.form,{rows:html}),oml=render_oml?nodes.join(","):null,oml=JSON.parse(oml),oml=OGX.OML.rename(oml,that.selector),that.el.html(html),oml&&OGX.OML.render(that,oml)}function genRow(e,t,i,n,o,a){var r={html:"",oml:null},s=config.types[e],l="",c="",d="";void 0!==n&&n&&(l="required",c='pattern="'+o+'"'),void 0!==a&&a&&(d="readonly");var u=t;return config.fullpath||(u=t.split(".").pop()),r.html=OGX.Templater.make(s.html,{name:u,prop:t,val:i,required:l,pattern:c,readonly:d}),r.html=OGX.Templater.make(OGX.Form.defaults.templates.row,{html:r.html,name:u,prop:t}),s.hasOwnProperty("oml")&&(r.oml=OGX.Templater.make(s.oml,{name:u,prop:t,val:i,required:l,pattern:c,readonly:d})),r}function init(){that.el.addClass("ogx_form"),render(),setTimeout((()=>{OGX.Form.bindForm({el:that.selector+">form",change_cb:that.onChange,submit_cb:that.onSubmit})}),300)}OGX.Data.merge(config,config_defaults,!1),this.destroy=function(){OGX.Form.unbindForm(that.selector)},this.onChange=function(e){},this.onSubmit=function(e){},init()},OGX.Form.defaults={templates:{form:"<form>{{$rows}}</form>",row:'<span class="row"><span class="label">{{$name}}</span>{{$html}}</span>'},types:{boolean:{html:'<span class="{{$name}}"></span>',oml:'{"default .{{$name}}:Switch":{"name" : "{{$prop}}", "val":{{$val}}, "editable" : {{!$readonly}} } }'},string:{html:'<input type="text" name="{{$prop}}" value="{{$val}}" {{$required}} {{$pattern}} {{$readonly}}>'},number:{html:'<input type="number" name="{{$prop}}" value="{{$val}}" {{$required}} {{$pattern}} {{$readonly}}>'},array:{html:'<span class="{{$name}}"></span>',oml:'{"default .{{$name}}:Tags":{"name" : "{{$prop}}", "editable" : {{!$readonly}}, "current_tags":{{$val}} } }'}}},OGX.Geo=function(e){"use strict";var t=this;void 0===e&&(e={});var i,n,o,a,r=OGX.Data.merge(e,{map:null,markers:[],icon:"",browser_loc:null});function s(e,i){for(var n,o={},a=0;a<e.length;a++){n=!1;for(var r=0;r<i.length;r++){for(var s=0;s<i[r].address_components.length;s++)if(-1!==i[r].address_components[s].types.indexOf(e[a][0])){o.hasOwnProperty(e[a][1])&&o[e[a][1]].length||(o[e[a][1]]=i[r].address_components[s].short_name),n=!0;break}if(n)break}}return o=t.clean(o)}function l(e){return e*(Math.PI/180)}function c(e){return Array.isArray(e)?new google.maps.LatLng(e[0],e[1]):"function"!=typeof e.lat?new google.maps.LatLng(e.lat,e.lng):e}function d(e){var t={gmap:new google.maps.LatLng(e.coords.latitude,e.coords.longitude),raw:{lat:e.coords.latitude,lng:e.coords.longitude}};a?(a(t),a=null):$(document).trigger(OGX.Geo.BROWSER_LOC_SUCCESS,t)}function u(e){$(document).trigger(OGX.Geo.BROWSER_LOC_ERROR,e)}function h(){i||(i=new google.maps.Geocoder)}this.setMap=function(e){r.map=e,google.maps.event.addListenerOnce(r.map,"tilesloaded",(function(){$(document).trigger(OGX.Geo.MAP_LOADED)}))},this.getMap=function(){return r.map},this.getMapRadius=function(){return!!r.map&&function(){if(r.map){var e=r.map.getBounds(),t=e.getCenter(),i=e.getNorthEast(),n=3963,o=t.lat()/57.2958,a=t.lng()/57.2958,s=i.lat()/57.2958,l=i.lng()/57.2958;return n*Math.acos(Math.sin(o)*Math.sin(s)+Math.cos(o)*Math.cos(s)*Math.cos(l-a))}return!1}()},this.getCurrentLocation=function(){return!!r.map&&(e=r.map.getCenter(),new google.maps.LatLng(e.lat(),e.lng()));var e},this.getBrowserLocation=function(e){a=void 0===e?null:e,navigator.geolocation.getCurrentPosition(d,u,{maximumAge:0,timeout:1e4,enableHighAccuracy:!0})},this.getDistance=function(e,t,i,n){var o=l(i-e),a=l(n-t),r=Math.sin(o/2)*Math.sin(o/2)+Math.cos(l(e))*Math.cos(l(i))*Math.sin(a/2)*Math.sin(a/2),s=6371*(2*Math.atan2(Math.sqrt(r),Math.sqrt(1-r)));return Math.round(1e3*s)/1e3},this.addressToLatLng=function(e,t,n){h(),i.geocode({address:e},(function(e,i){i==google.maps.GeocoderStatus.OK?t(e[0].geometry.location,n):t(!1,n)}))},this.getCityBoundaries=function(e,t,n,o,a){h(),i.geocode({address:e+", "+t+", "+n},(function(e,t){t==google.maps.GeocoderStatus.OK?o(e[0].geometry,a):o(!1,a)}))},this.latLngToZip=function(e,t,n){e=c(e),h(),i.geocode({location:e},(function(e,i){if(i===google.maps.GeocoderStatus.OK){var n=s([["postal_code","zip"]],e);t(n)}}))},this.latLngToCountryStateCity=function(e,t,n){e=c(e),h(),i.geocode({location:e},(function(e,i){if(i===google.maps.GeocoderStatus.OK){var o=s([["country","country"],["administrative_area_level_1","state"],["locality","city"],["administrative_area_level_2","city"]],e);t(o,n)}else t(!1,n)}))},this.partialAddressToCountryStateCity=function(e,t,n){h(),i.geocode({address:e},(function(e,i){if(i===google.maps.GeocoderStatus.OK){var o=s([["country","country"],["administrative_area_level_1","state"],["locality","city"],["administrative_area_level_2","city"]],e);t(o,n)}else t(!1,n)}))},this.latLngToAddress=function(e,t,n){e=c(e),h(),i.geocode({location:e},(function(e,i){if(i===google.maps.GeocoderStatus.OK){var o=s([["street_number","number"],["route","street"],["postal_code","zip"],["country","country"],["administrative_area_level_1","state"],["locality","city"],["administrative_area_level_2","city"]],e);e[0].hasOwnProperty("formatted_address")&&(o.formatted=e[0].formatted_address),t(o,n)}else t(!1,n)}))},this.partialAddressToAddress=function(e,t,n){h(),i.geocode({address:e},(function(e,i){if(i===google.maps.GeocoderStatus.OK){var o=s([["street_number","number"],["route","street"],["postal_code","zip"],["country","country"],["administrative_area_level_1","state"],["locality","city"],["administrative_area_level_2","city"]],e);e[0].hasOwnProperty("formatted_address")&&(o.formatted=e[0].formatted_address),o.lat=e[0].geometry.location.lat(),o.lng=e[0].geometry.location.lng(),t(o,n)}else t(!1,n)}))},this.zipToAddress=function(e,t,i){this.partialAddressToAddress(e,t,i)},this.zipToLatLng=function(e,t,n){h(),i.geocode({address:e},(function(e,i){if(i===google.maps.GeocoderStatus.OK){var o={};o.lat=e[0].geometry.location.lat(),o.lng=e[0].geometry.location.lng(),t(o,n)}else t(!1,n)}))},this.getRoute=function(e){n||(n=new google.maps.DirectionsService);var t={start:!1,end:!1,waypoints:!1,optimize:!0,mode:OGX.Geo.TRAVEL_MODE_CAR,callback:!1,params:!1};for(var i in t)e.hasOwnProperty(i)||(e[i]=t[i]);var o={origin:e.start,destination:e.end,travelMode:e.mode};e.waypoints&&(o.waypoints=e.waypoints,e.optimize&&(o.optimizeWaypoints=!0)),n.route(o,(function(t,i){i===google.maps.DirectionsStatus.OK?e.callback(t,e.params):e.callback(!1,e.params)}))},this.calcRouteMinutes=function(e){for(var t=0,i=0;i<e.legs.length;i++)t+=e.legs[i].duration.value;return t=Math.round(t/60)},this.drawRoute=function(e,t){void 0===t&&(t=!0),o||(o=new google.maps.DirectionsRenderer({suppressMarkers:!t})),o.setMap(r.map),o.setDirections(e)},this.clearRoute=function(){r.map&&o&&o.setMap(null)},this.latLngToLoc=function(e,t){return new google.maps.LatLng(e,t)},this.clean=function(e,t){var i;if(void 0===t&&(t=!1),e.hasOwnProperty("city")&&e.hasOwnProperty("vicinity")&&-1!==e.vicinity.indexOf(",")&&(i=new RegExp(", ([a-z -']+)$","gi").exec(e.vicinity))&&i.length>1&&(e.city===i[1]?e.vicinity=e.vicinity.replace(i[0],""):e.city?e.city.length>i[1].length&&(e.city=i[1],e.vicinity=e.vicinity.replace(i[0],"")):e.city=i[1]),t)for(var n in e)-1===t.indexOf(n)&&delete e[n];return e},"undefined"!=typeof google&&void 0!==google.maps||$(document).trigger(OGX.Geo.ERROR_GMAP)},OGX.Geo.ERROR="GEO_error",OGX.Geo.ERROR_GMAP="GEO_GMAP_ERROR",OGX.Geo.TRAVEL_MODE_CAR="DRIVING",OGX.Geo.TRAVEL_MODE_TRANSIT="TRANSIT",OGX.Geo.TRAVEL_MODE_WALK="WALKING",OGX.Geo.TRAVEL_MODE_BIKE="BICYCLING",OGX.Geo.BROWSER_LOC_SUCCESS="GEO_BROWSER_LOC_SUCCESS",OGX.Geo.BROWSER_LOC_ERROR="GEO_BROWSER_LOC_ERROR",OGX.Geo.MAP_LOADED="GEO_MAP_LOADED",require("Ghost","Uxi","Placeholder"),OGX.Ghost=function(e){construct(this,"Ghost"),this.el=$(e.el),css="ogx_ghost",this.el.addClass(css),delete css},require("GridSwiper","Uxi","Touch"),OGX.GridSwiper=function(e){construct(this,"GridSwiper");var t,i,n,o,a,r,s,l,c,d,u,h,f=this,_=e,g={map:[[!0,!0,!0],[!0,!0,!0],[!0,!0,!0]],axis:{x:!0,y:!0},loop:!0,start:!1,chromeos:!1,capture:!1,callbacks:{up:null,down:null,left:null,right:null}},p=!1,m={x:null,y:null},v={x:0,y:0},y=".ogx_grid_swiper_cell",x=!1,O=!1,b=!1,w={x:0,y:0},G={x:0,y:0},X=(new Date).getTime()+Math.round(1e3*Math.random()),C=[];function D(e){e?t.on(f.touch.down,E):t.off(f.touch.down,E)}function E(e){p=!1,a=0,r=0,s=0,l=0,e=Y(e),m.x=e.pageX,m.y=e.pageY,x=!0,L(!0)}function k(e){e?$("body").on(f.touch.up,S):$("body").off(f.touch.up,S)}function S(e){x&&(x=!1,L(!1),!T()&&b&&(t.trigger(OGX.GridSwiper.SWIPE_END),O=!1,b=!1))}function T(e,t,a){var r,s;return void 0===e&&(e=0),void 0===t&&(t=0),void 0===a&&(a=!0),a&&R(!0),i.addClass("ogx_grid_swiper_anim"),v=I(i),r=-1*Math.round((v.x+e)/n)*n*-1,s=-1*Math.round((v.y+t)/o)*o*-1,i.css({transform:"translate3d("+r+"px, "+s+"px, 0px)"}),v.x-r||v.y-s}function L(e){e?(N(!0),t.on(f.touch.move,M)):(N(!1),t.off(f.touch.move,M))}function M(e){e=Y(e),_.capture&&(e.preventDefault(),e.stopImmediatePropagation()),a=0,r=0,s=0,l=0,p||(_.axis.x&&Math.abs(e.pageX-m.x)>Math.abs(e.pageY-m.y)?p="x":_.axis.y&&Math.abs(e.pageX-m.x)<Math.abs(e.pageY-m.y)&&(p="y")),p&&(_.axis.x&&"x"===p?(a=Math.abs(e.pageX-m.x),s=e.pageX-m.x>0?1:-1):_.axis.y&&"y"===p&&(r=Math.abs(e.pageY-m.y),l=e.pageY-m.y>0?1:-1))}function N(e){e?h||(O=!1,h=setInterval(A,10)):h&&(clearInterval(h),h=null)}function A(){if((a||r)&&(O||(b=!0,t.trigger(OGX.GridSwiper.SWIPE_START)),O=!0),_.axis.x&&"x"===p&&a&&s&&a<=n){if(!_.loop&&(w.x+-1*s<0||w.x+-1*s>_.map[0].length-1))return;if((c=(w.x+-1*s)%_.map[0].length)<0&&(c=Math.abs(_.map[0].length+c)),!1===_.map[G.y][c])return;u=a*s,i.css({transform:"translate3d("+(-1*w.x*n+u)+"px, "+v.y+"px, 0px)"})}else if(_.axis.y&&"y"===p&&r&&l&&r<=o){if(!_.loop&&(w.y+-1*l<0||w.y+-1*l>_.map.length-1))return;if((d=(w.y+-1*l)%_.map.length)<0&&(d=Math.abs(_.map.length+d)),!1===_.map[d][G.x])return;u=r*l,i.css({transform:"translate3d("+v.x+"px, "+(-1*w.y*o+u)+"px, 0px)"})}}function R(e){e?(i.off("transitionend"),i.on("transitionend",(function(){O&&b&&(t.trigger(OGX.GridSwiper.SWIPE_END),O=!1,b=!1),i.off("transitionend"),i.removeClass("ogx_grid_swiper_anim"),v=I(i);var e={x:null,y:null};e.x=-1*Math.round(v.x/n),e.y=-1*Math.round(v.y/o),w.x!==e.x?(s=w.x>e.x?1:-1,w.x=e.x,G.x=P(w).x,-1===s?(i.children(y+"[data-y="+(w.y-1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-y="+(w.y+1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-x="+(w.x-2)+"][data-y="+w.y+"]").attr("data-x",w.x+1).css("left",(w.x+1)*n),f.onLeft({cell:G,point:w}),t.trigger(OGX.GridSwiper.SWIPE_LEFT,{cell:G,point:w}),z(C=[{x:w.x+1,y:w.y},{x:w.x,y:w.y-1},{x:w.x,y:w.y+1}]),U()):(i.children(y+"[data-y="+(w.y-1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-y="+(w.y+1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-x="+(w.x+2)+"][data-y="+w.y+"]").attr("data-x",w.x-1).css("left",(w.x-1)*n),f.onRight({cell:G,point:w}),t.trigger(OGX.GridSwiper.SWIPE_RIGHT,{cell:G,point:w}),z(C=[{x:w.x-1,y:w.y},{x:w.x,y:w.y-1},{x:w.x,y:w.y+1}]),U())):w.y!==e.y&&(l=w.y>e.y?1:-1,w.y=e.y,G.y=P(w).y,-1===l?(i.children(y+"[data-x="+(w.x-1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-x="+(w.x+1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-y="+(w.y-2)+"][data-x="+w.x+"]").attr("data-y",w.y+1).css("top",(w.y+1)*o),f.onUp({cell:G,point:w}),t.trigger(OGX.GridSwiper.SWIPE_UP,{cell:G,point:w}),z(C=[{x:w.x,y:w.y+1},{x:w.x-1,y:w.y},{x:w.x+1,y:w.y}]),U()):(i.children(y+"[data-x="+(w.x-1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-x="+(w.x+1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-y="+(w.y+2)+"][data-x="+w.x+"]").attr("data-y",w.y-1).css("top",(w.y-1)*o),f.onDown({cell:G,point:w}),t.trigger(OGX.GridSwiper.SWIPE_DOWN,{cell:G,point:w}),z(C=[{x:w.x,y:w.y-1},{x:w.x-1,y:w.y},{x:w.x+1,y:w.y}]),U())),p=0}))):i.off("transitionend")}function I(e,t){var i=e.css("transform");return"none"===i?0:(i=(i=(i=i.substr(7)).substr(0,i.length-1)).split(","),{x:Number(i[4]),y:Number(i[5])})}function Y(e){return e.hasOwnProperty("originalEvent")&&void 0!==e.originalEvent.changedTouches?e.originalEvent.changedTouches[0]:e}function P(e){var t={x:0,y:0};return t.x=e.x%_.map[0].length,t.x<0&&(t.x=Math.abs(_.map[0].length+t.x)),t.y=e.y%_.map.length,t.y<0&&(t.y=Math.abs(_.map.length+t.y)),t}function z(e){for(var t,i={x:null,y:null},n=0;n<e.length;n++){if(e[n].y<0||e[n].y>_.map.length-1){if(!_.loop)return!1;i.y=P(e[n]).y}else i.y=e[n].y;if(e[n].x<0||e[n].x>_.map[0].length-1){if(!_.loop)return!1;i.x=P(e[n]).x}else i.x=e[n].x;t=_.map[i.y][i.x],F(e[n],t),f.onRender(i)}}function F(e,t){var n=!1;switch(typeof t){case"string":i.children(y+'[data-x="'+e.x+'"][data-y="'+e.y+'"]').children(y+"_content").first().html(t);break;case"function":(n=t(e,P(e),{x:e.x-w.x,y:e.y-w.y},i.children(y+'[data-x="'+e.x+'"][data-y="'+e.y+'"]').children(y+"_content").first()[0]))&&i.children(y+'[data-x="'+e.x+'"][data-y="'+e.y+'"]').children(y+"_content").first().html(n);break;case"object":var o='.ogx_grid_swiper[data-ogx-id="'+X+'"] > .ogx_grid_swiper_container > '+y+'[data-x="'+e.x+'"][data-y="'+e.y+'"] > '+y+"_content",a=P(e);for(var r in t){t[r].id="cell_"+a.x+"_"+a.y;break}t=OGX.OML.rename(t,o);var s=f.nodes.find("id","cell_"+a.x+"_"+a.y,1);s&&f.remove(s._NAME_,s.id),$(o).empty(),OGX.OML.render(f,t,{abs:e,rel:P(e)}),U()}}function U(){for(var e=0;e<f.nodes.length;e++)f.nodes[e].id==="cell_"+G.x+"_"+G.y?f.nodes[e].focus():f.nodes[e].blur()}function B(){C=[],_.axis.x&&(C.push({x:_.start.x-1,y:_.start.y}),C.push({x:_.start.x+1,y:_.start.y})),C.push({x:_.start.x,y:_.start.y}),_.axis.y&&(C.push({x:_.start.x,y:_.start.y-1}),C.push({x:_.start.x,y:_.start.y+1})),z(C)}function W(){_.map.length||(_.map=[[]],_.axis.y=!1),_.map.length&&!Array.isArray(_.map[0])&&(_.map=[_.map],_.axis.y=!1),_.start||(_.start={x:null,y:null},_.start.y=Math.floor(_.map.length/2),_.start.x=Math.floor(_.map[0].length/2))}function H(){var e=_.start.x*-n,a=_.start.y*-o,r=_.start.y-1,s=_.start.x,l='<div class="ogx_grid_swiper_container" style="transform:translate3d('+e+"px, "+a+'px, 0px);">',c=-1*e,d=-1*a-o;_.axis.y&&(l+='<div class="ogx_grid_swiper_cell" style="left:'+c+"px; top:"+d+'px;" data-x="'+s+'" data-y="'+r+'"><div class="ogx_grid_swiper_cell_content"></div></div>',l+='<div class="ogx_grid_swiper_cell" style="left:'+c+"px; top:"+(d+2*o)+'px;" data-x="'+s+'" data-y="'+(r+2)+'"><div class="ogx_grid_swiper_cell_content"></div></div>'),l+='<div class="ogx_grid_swiper_cell" style="left:'+c+"px; top:"+(d+o)+'px;" data-x="'+s+'" data-y="'+(r+1)+'"><div class="ogx_grid_swiper_cell_content"></div></div>',_.axis.x&&(l+='<div class="ogx_grid_swiper_cell" style="left:'+(c-n)+"px; top:"+-1*a+'px;" data-x="'+(s-1)+'" data-y="'+_.start.y+'"><div class="ogx_grid_swiper_cell_content"></div></div>',l+='<div class="ogx_grid_swiper_cell" style="left:'+(c+n)+"px; top:"+-1*a+'px;" data-x="'+(s+1)+'" data-y="'+_.start.y+'"><div class="ogx_grid_swiper_cell_content"></div></div>'),l+="</div>",t.html(l),i=t.children(".ogx_grid_swiper_container").first(),w.x=_.start.x,w.y=_.start.y,v.x=e,v.y=a,G.x=_.start.x,G.y=_.start.y}this.onFocus=function(){return D(!0),k(!0),U(),this},this.onBlur=function(){return D(!1),k(!1),N(!1),this},this.focus=function(){return this.blured&&(this.blured=!1,this.onFocus()),this},this.resize=function(){R(!1),i.removeClass("ogx_grid_swiper_anim"),n=t.width(),o=t.height();var e=w.x*-n,a=w.y*-o;i.children(y+"[data-y="+(w.y-1)+"]").css({top:(w.y-1)*o,left:w.x*n}),i.children(y+"[data-y="+w.y+"]").css({top:w.y*o,left:w.x*n}),i.children(y+"[data-y="+(w.y+1)+"]").css({top:(w.y+1)*o,left:w.x*n}),i.children(y+"[data-x="+(w.x-1)+"]").css({top:w.y*o,left:(w.x-1)*n}),i.children(y+"[data-x="+(w.x+1)+"]").css({top:w.y*o,left:(w.x+1)*n}),i.css("transform","translate3d("+e+"px, "+a+"px, 0px"),L(!1),setTimeout((()=>{T(0,0,!1),i.addClass("ogx_grid_swiper_anim"),f.resizeNodes()}),0)},this.onUp=function(){},this.onDown=function(){},this.onLeft=function(){},this.onRight=function(){},this.onRender=function(){},this.setMap=function(e,t){return _.map=e,void 0!==t&&(_.start=t),w={x:0,y:0},G={x:0,y:0},m={x:null,y:null},v={x:0,y:0},W(),H(),B(),this},this.setMapCell=function(e,t){return _.map[e.y]||(_.map[e.y]=[]),_.map[e.y][e.x]=t,this},this.getMapCell=function(e){return e.y>0&&_.map.length<e.y&&e.x>0&&_.map[e.y].length<e.x&&_.map[e.y][e.x]},this.getCells=function(){var e,t,n,o,a=[];return i.children(y).each((function(i,r){e=$(r),t={x:Number(e.attr("data-x")),y:Number(e.attr("data-y"))},n=P(t),o={x:t.x-w.x,y:t.y-w.y},a.push({abs:t,rel:n,offset:o,element:r})})),a},this.getCellContent=function(e){return i.children(y+"[data-x="+e.x+"][data-y="+e.y+"]").children(y+"_content").first()[0]},this.getCurrentCell=function(){return G},this.renderCellContent=function(e){return z([e]),this},this.setTopCell=function(e){return this.setOffsetCell({x:0,y:-1},e),this},this.setBottomCell=function(e){return this.setOffsetCell({x:0,y:1},e),this},this.setLeftCell=function(e){return this.setOffsetCell({x:-1,y:0},e),this},this.setRightCell=function(e){return this.setOffsetCell({x:1,y:0},e),this},this.setOffsetCell=function(e,t){var i={x:e.x+w.x,y:e.y+w.y};return this.setMapCell(i,t),this},this.getOffsetCell=function(e){var t={x:e.x+w.x,y:e.y+w.y};return this.getMapCell(t)},this.getOffsetCellContent=function(e){var t={x:e.x+w.x,y:e.y+w.y};return this.getCellContent(t)},this.swipeRight=function(){return T(-n),this},this.swipeLeft=function(){return T(n),this},this.swipeUp=function(){return T(0,-o),this},this.swipeDown=function(){return T(0,o),this},OGX.Data.merge(_,g),_.callbacks.up&&(f.onUp=_.callbacks.up),_.callbacks.down&&(f.onDown=_.callbacks.down),_.callbacks.right&&(f.onRight=_.callbacks.right),_.callbacks.left&&(f.onLeft=_.callbacks.left),(t=f.el).addClass("ogx_grid_swiper"),t.attr("data-ogx-id",X),n=t.width(),o=t.height(),W(),H(),B()},OGX.GridSwiper.SWIPE_LEFT="GridSwiperSwipeLeft",OGX.GridSwiper.SWIPE_RIGHT="GridSwiperSwipeRight",OGX.GridSwiper.SWIPE_UP="GridSwiperSwipeUp",OGX.GridSwiper.SWIPE_DOWN="GridSwiperSwipeDown",OGX.GridSwiper.SWIPE_START="GridSwiperSwipeStart",OGX.GridSwiper.SWIPE_END="GridSwiperSwipeEnd",require("GroupedList","Uxi","Bind","Touch"),OGX.GroupedList=function(e){construct(this,"GroupedList");var t,i,n,o,a,r,s=this,l=e,c={group_by:"name",group_mode:null,group_param:null,group_order:null,order:null,list:new OGX.List,key:null,swipe:!1,reorder:!1,display:!1,mode:OGX.DynamicList.SELECT_MODE_HIT,scope:"public"},d=[];function u(e){e?t.on(s.touch.down,".ogx_grouped_list_item",h):t.off(s.touch.down,".ogx_grouped_list_item",h)}function h(){t.find(".ogx_grouped_list_selected_item").removeClass("ogx_grouped_list_selected_item"),$(this).addClass("ogx_grouped_list_selected_item");var e=l.list[Number($(this).data("id"))];t.trigger(OGX.GroupedList.SELECT,e)}function f(e){var t=l.group_order.indexOf(e);if(-1===t)return t;for(var i=t,n=0;n<t;n++)-1===d.indexOf(l.group_order[n])&&i--;return i}function _(e,t){for(var n,o=0;o<i.nodes.length;o++)if(n=i.nodes[o].val().find(e,t,1))return{list:i.nodes[o],item:n};return!1}function g(e){void 0===e&&(e=!1);var t=!1,n=!1;if(l.list&&(t=l.list,a&&(t=o),t.length&&(n=r,r=t.group(l.group_by,l.group_mode,l.group_param))),t&&t.length){if(e||JSON.stringify(n)!==JSON.stringify(r)){s.find("NestList",s.id+"_nests","remove");var c=function(){var e='.ogx_grouped_list[data-ogx-id="'+s.id+'"]',t={};t[e+":NestList"]={id:s.id+"_nests",list:[],"node:OML":[]};var i,n=[],o=OGX.Data.clone(l.group_order);for(var a in r)i=l.group_order?l.group_order.indexOf(a):n.length,t[e+":NestList"].list.push({title:a}),d.push(a),n[i]={"default:DynamicList":{list:r[a],key:l.key,mode:l.mode,display:l.display,swipe:l.swipe,reorder:l.reorder,order:l.order}};for(var c=0;c<n.length;c++)void 0===n[c]&&(n.splice(c,1),o.splice(c,1),c--);return t[e+":NestList"]["node:OML"]=n,t[e+":NestList"].order=o,t}();OGX.OML.render(s,c),(i=s.find("NestList",s.id+"_nests")).updateNestsHeight()}}else r=!1,s.el.empty()}this.onFocus=function(){return u(!0),this},this.onBlured=function(){return u(!1),this},this.bindFilter=function(e,t,i){return l.list.removeFilter(e),void 0!==i&&l.list.addFilter(e,t,i),l.list.getFilters()&&(o=l.list.filter(),a=!0),setTimeout(g,0),this},this.bindValue=function(){var e=this.getSelection();return e||null},this.destroy=function(){this.clearBinds()},this.scope=function(e){return void 0!==e?(l.scope=e,i.scope(e),!0):l.scope},this.val=function(e){if(void 0===e)return l.list;e.hasOwnProperty("insert")||(e=new OGX.List(e));var t=l.list.getFilters();"{}"!==JSON.stringify(t)&&(a=!0,e.setFilters(t),o=e.filter()),l.list=e,setTimeout(g,0)},this.nests=function(){return i||!1},this.filter=function(){return o=l.list.filter(),a=!0,setTimeout(g,0),this},this.unfilter=function(){return a=!1,setTimeout(g,0),this},this.addFilter=function(e,t,i){return l.list.addFilter(e,t,i)},this.removeFilter=function(e,t,i){return l.list.removeFilter(e,t,i)},this.resetFilters=function(){return l.list.resetFilters()},this.getFilters=function(){return l.list.getFilters()},this.addGroup=function(e,t,n){if(l.list.length){var a={title:e,scope:l.scope},r={};if(void 0===t&&(t=[]),r["default:DynamicList"]={list:t,key:l.key,mode:l.mode,display:l.display,swipe:l.swipe,reorder:l.reorder},i.addNest(a,r,n),l.group_order&&l.group_order.insert(e,n),o)var s=l.list.getFilters();l.list=new OGX.List(l.list.concat(t)),o&&l.list.setFilters(s),d.push(e)}else l.list.insert(t),g();return this},this.removeGroup=function(e){return!!this.getGroupList(e)&&(i.removeNest(e),l.list.findDelete(l.group_by,e),d.splice(d.indexOf(e),1),!0)},this.addToGroup=function(e,t){var n=this.getGroupList(e);return n&&(n.insert(t),l.list.push(t),setTimeout((()=>{i.updateNestHeight(e)}),0)),this},this.removeFromGroup=function(e,t,n){2===arguments.length&&(n=t,t=l.key);var o=this.getGroupList(e);return o&&(o.findDelete(t,n,1),l.list.findDelete(t,n,1),o.val().length?setTimeout((()=>{i.updateNestHeight(e)}),0):this.removeGroup(e)),this},this.updateGroupItem=function(e,t,i,n){return this.getGroupList(e).findUpdate(t,i,n,!1,1),l.list.findUpdate(t,i,n,1),this},this.replaceGroupItem=function(e,t,i,n){return this.getGroupList(e).findReplace(t,i,n),l.list.findReplace(t,i,n,1),this},this.getGroupList=function(e){var t=-1;return l.group_order&&(t=f(e)),-1!==t&&t<i.nodes.length&&i.nodes[t]},this.hasGroup=function(e){return-1!==d.indexOf(e)},this.addItem=function(e,t){if(void 0===t&&(t=!1),l.list.length){if(a){var r=new OGX.List(e),s=l.list.getFilters();if(r.setFilters(s),!r.filter().length)return void l.list.insert(e);l.list.insert(e),o.insert(e)}var c=e[l.group_by];if(this.hasGroup(c))this.addToGroup(c,e);else{var d=-1;l.group_order&&-1!==l.group_order.indexOf(c)&&(d=f(c)),-1!==d?this.addGroup(c,[e],d):this.addGroup(c,[e])}!t&&l.scroll&&this.observeOnce(null,(()=>{setTimeout(n.resize,0)}),null,i.el),i.updateNestHeight(c)}else l.list.insert(e),t||g();return this},this.addItems=function(e){l.scroll&&this.observeOnce(null,(()=>{setTimeout(n.resize,0)}),null,i.el);var t=!!l.list.length;e.forEach((e=>{this.addItem(e,!0)})),t&&g()},this.removeItem=function(e,t){l.key&&1===arguments.length&&(t=e,e=l.key);var n=l.list.find(e,t,1);if(n){var o=n[l.group_by];return this.removeFromGroup(o,e,t),setTimeout((()=>{i.updateNestHeight(o)}),0),!0}return!1},this.replaceItem=function(e,t,n){l.key&&2===arguments.length&&(t=e,e=l.key);var o=_(e,t);if(o){var a=null;return o.item[l.group_by]!==n[l.group_by]?(a=o.item[l.group_by],o.list.findDelete(e,t,1),l.list.findDelete(e,t,1),-1===l.list.unique(l.group_by,!1).indexOf(a)&&(this.removeGroup(a),a=!1),this.addItem(n),setTimeout((()=>{a&&i.updateNestHeight(o.item[l.group_by]),i.updateNestHeight(n[l.group_by])}),0)):o.list.findReplace(e,t,n),!0}return!1},this.updateItem=function(e,t,n,o){if(l.key){var a=arguments.length;void 0!==o&&(a--,o=!1),2===a&&(n=t,t=e,e=l.key)}var r=_(e,t);if(r){if(n.hasOwnProperty(l.group_by)&&r.item[l.group_by]!==n[l.group_by]){var s=r.item[l.group_by],c=r.list.findDelete(e,t,1);r.list.val().length||this.removeGroup(s),l.list.findDelete(e,t,1),c=OGX.Data.merge(c,n,!0,!1,o),this.addItem(c),r.list.val().length&&setTimeout((()=>{i.updateNestHeight(s)}),0)}else r.list.findUpdate(e,t,n,o,1);return!0}return!1},this.render=function(){return setTimeout(g,0),this},this.refresh=function(){var e=t.find(".ogx_grouped_list_selected_item").first();if(e.length>0){var i=e.data("id");e.html(OGX.Templater.make(l.template,l.list[i]))}return this},this.grouping=function(e,t,i,n){return void 0===n&&(n=null),l.group_by=e,l.group_mode=t,l.group_param=i,n&&(l.group_order=n),setTimeout((()=>{g(!0)}),0),this},OGX.Data.merge(l,c),l.list.hasOwnProperty("insert")||(l.list=new OGX.List(l.list)),l.group_order&&!l.group_order.hasOwnProperty("insert")&&(l.group_order=new OGX.List(l.group_order)),l.display&&l.display.hasOwnProperty("css")&&("object"!=typeof l.display.css&&l.display.css?l.display.css+=" ogx_grouped_list_item":l.display.hasOwnProperty("add")?l.display.add="ogx_grouped_list_item "+l.display.add:l.display.add="ogx_grouped_list_item"),r=!1,(t=s.el).addClass("ogx_grouped_list"),g(),l.scroll&&(n=s.find("Scroller",l.id+"_scroller"))},OGX.GroupedList.SELECT="GroupedListSelect",OGX.GroupedList.BIND=OGX.GroupedList.SELECT,require("Html","Uxi","Placeholder"),OGX.Html=function(e){construct(this,"Html"),void 0!==e&&e&&(this.el=$(e.el),OGX.HtmlRender(e))},OGX.HtmlRender=function(e){var t=$(e.el),i=new OGX.Display(e);data=!1,e.data&&Object.keys(e.data).length&&(data=e.data),t.html(i.html(data)),e.css&&t.addClass(i.css(data)),e.hasOwnProperty("id")&&e.id&&"#"===e.id.substr(0,1)&&t.attr("id",e.id.substr(1))},require("Iceberg","Uxi","Touch"),OGX.Iceberg=function(e){construct(this,"Iceberg");var t,i,n,o,a,r,s=this,l={left:0,right:0,top:0,bottom:0,min:50,drag:!0,flatten:!1,capture:!0,"node:OML":{},callbacks:{up:null,down:null,left:null,right:null,restore:null}},c=e,d=!1,u="normal",h="main",f={left:null,main:null,right:null,top:null,bottom:null},_=[0,0,0],g=0,p=0,m=0,v=0;function y(e){for(var t in f)f[t]&&f[t].instance&&(e===t?f[t].instance.focus():f[t].instance.blur())}function x(){d.hasClass("ogx_iceberg_anim")||(d.off("transitionend"),_=G(d))}function O(e){var t=0;return e.dirY&&e.distY>e.distX&&(t=1),t}function b(e){c.drag&&e.dist&&(!(n=O(e))&&["main","left","right"].includes(h)?e.dirX&&e.distX&&(t=_[0]+e.distX*e.dirX)<=p&&t>=g&&d.css({transform:"translate3d("+t+"px, 0, 0)"}):["main","top","bottom"].includes(h)&&e.dirY&&e.distY&&(i=_[1]+e.distY*e.dirY)<=v&&i>=m&&d.css({transform:"translate3d(0, "+i+"px, 0)"}))}function w(e){if(t=0,i=0,n=O(e),e.swipe&&e.dist){var r;switch(e.swipe=!1,h){case"main":-1===e.dirX&&c.right&&!n?(t=-f.right.outerWidth(),r="right",e.swipe=!0):1===e.dirX&&c.left&&!n?(t=f.left.outerWidth(),r="left",e.swipe=!0):1===e.dirY&&c.top&&n?(i=f.top.outerHeight(),r="top",e.swipe=!0):-1===e.dirY&&c.bottom&&n&&(i=-f.bottom.outerHeight(),r="bottom",e.swipe=!0);break;case"left":-1!==e.dirX||n||(t=0,r="main",e.swipe=!0);break;case"right":1!==e.dirX||n||(t=0,r="main",e.swipe=!0);break;case"top":-1===e.dirY&&n&&(i=0,r="main",e.swipe=!0);break;case"bottom":1===e.dirY&&n&&(i=0,r="main",e.swipe=!0)}n?1===e.dirY?(o=OGX.Iceberg.SWIPE_DOWN,a=s.onDown):(o=OGX.Iceberg.SWIPE_UP,a=s.onUp):1===e.dirX?(o=OGX.Iceberg.SWIPE_RIGHT,a=s.onRight):(o=OGX.Iceberg.SWIPE_LEFT,a=s.onLeft),e.swipe&&e.dist&&(d.addClass("ogx_iceberg_anim"),d.on("transitionend",(function(){d.off("transitionend"),d.removeClass("ogx_iceberg_anim"),_=G(d),y(h=r),a(h),d.trigger(o,h)})),d.css({transform:"translate3d("+t+"px, "+i+"px, 0)"}))}else if(e.dist){switch(t=0,i=0,h){case"left":t=f.left.outerWidth();break;case"right":t=-f.right.outerWidth();break;case"top":i=f.top.outerHeight();break;case"bottom":i=-f.bottom.outerHeight()}d.addClass("ogx_iceberg_anim"),d.on("transitionend",(function(){d.off("transitionend"),d.removeClass("ogx_iceberg_anim"),_=G(d),s.onRestore(h),d.trigger(OGX.Iceberg.RESTORE,h)})),d.css({transform:"translate3d("+t+"px, "+i+"px, 0)"})}}function G(e){var t=e[0].style.transform;if(t=t.match(/translate3d\(([0-9px%,\.\- ]+)\)/)){t=t[1].split(",");for(var i=0;i<t.length;i++)t[i]=Number(t[i].split("px")[0]);return t}return[0,0,0]}function X(){var e;for(var t in f)f[t]&&((e=f[t].children().first()).length&&e[0].hasAttribute("data-ogx-id")?f[t].instance=s.nodes.find("id",String(e.data("ogx-id")),1):f[t].instance=!1)}this.show=function(e,t){if(void 0===e&&(e=!1),"normal"===u)for(var i in f)if(f[i]&&f[i].instance&&f[i].instance.id===t){if(!e)return this.val(i),!0;if(f[i].instance._NAME_===f[i].instance.NAME)return this.val(i),!0}return!1},this.val=function(e){if(void 0===e)return h;if(t=0,i=0,"normal"===u){switch(e){case"left":t=f.left.outerWidth();break;case"top":i=f.top.outerHeight();break;case"main":t=0;break;case"right":t=f.left.outerWidth();break;case"bottom":i=-f.bottom.outerHeight()}f[h].instance&&f[h].instance.blur(),f[h=e].instance&&f[h].instance.focus(),d.css({transform:"translate3d("+t+"px, "+i+"px, 0)"})}},this.onFocus=function(){"flattened"!==u&&(r.enable(),setTimeout((()=>{y(h)}),0))},this.onBlur=function(){r.disable()},this.focus=function(){return this.blured&&(this.blured=!1,this.onFocus()),this},this.onResize=function(){return f.left&&(p=f.left.outerWidth()),f.right&&(g=-f.right.outerWidth()),f.top&&(v=f.top.outerHeight()),f.bottom&&(m=-f.bottom.outerHeight()),c.flatten&&("flattened"!==u&&this.el.outerWidth()>=c.flatten?(u="flattened",_=G(d),d.addClass("ogx_iceberg_views_flattened").css("transform","translate3d(0px, 0px, 0px)"),d.children(".ogx_iceberg_view").addClass("ogx_iceberg_view_flattened"),this.onBlur()):"flattened"===u&&this.el.width()<c.flatten&&(u="normal",d.children(".ogx_iceberg_view").removeClass("ogx_iceberg_view_flattened"),d.removeClass("ogx_iceberg_views_flattened").css("transform","translate3d("+_[0]+"px, 0px, 0px)"),this.onFocus())),this},this.destroy=function(){this.touch.wipe()},this.onUp=function(){},this.onDown=function(){},this.onLeft=function(){},this.onRight=function(){},this.onRestore=function(){},OGX.Data.merge(c,l),c.callbacks.up&&(s.onUp=c.callbacks.up),c.callbacks.down&&(s.onDown=c.callbacks.down),c.callbacks.right&&(s.onRight=c.callbacks.right),c.callbacks.left&&(s.onLeft=c.callbacks.left),c.callbacks.restore&&(s.onRestore=c.callbacks.restore),width=Math.round($(c.el).innerWidth()),height=$(c.el).innerHeight(),s.el.addClass("ogx_iceberg"),function(){var e,t,i='<div class="ogx_iceberg_views ogx_hw">',n={},o='.ogx_iceberg[data-ogx-id="'+s.id+'"] > .ogx_iceberg_views > .ogx_iceberg_view[data-ogx-panel-id="';for(var a in c["node:OML"])for(var r in c["node:OML"][a])0===r.indexOf("left")&&(i+='<div class="ogx_iceberg_view_left ogx_view ogx_iceberg_view" data-ogx-panel-id="left" style="width:'+(isNaN(c.left)?c.left:c.left+"px")+';"></div>',n.left=o+'left"]',f.left=!0),0===r.indexOf("top")&&(i+='<div class="ogx_iceberg_view_top ogx_view ogx_iceberg_view" data-ogx-panel-id="top" style="height:'+(isNaN(c.top)?c.top:c.top+"px")+';"></div>',n.top=o+'top"]',f.top=!0),0===r.indexOf("main")&&(i+='<div class="ogx_iceberg_view_main ogx_view ogx_iceberg_view" data-ogx-panel-id="main"></div>',n.main=o+'main"]'),0===r.indexOf("right")&&(i+='<div class="ogx_iceberg_view_right ogx_view ogx_iceberg_view" data-ogx-panel-id="right" style="width:'+(isNaN(c.right)?c.right:c.right+"px")+';"></div>',n.right=o+'right"]',f.right=!0),0===r.indexOf("bottom")&&(i+='<div class="ogx_iceberg_view_bottom ogx_view ogx_iceberg_view" data-ogx-panel-id="bottom" style="height:'+(isNaN(c.bottom)?c.bottom:c.bottom+"px")+';"></div>',n.bottom=o+'bottom"]',f.bottom=!0);for(s.el.html(i),a=0;a<c["node:OML"].length;a++)for(var r in c["node:OML"][a])e=r.split(":")[0],t=r.replace(e,n[e]),c["node:OML"][a][t]=c["node:OML"][a][r],delete c["node:OML"][a][r];d=s.el.children(".ogx_iceberg_views").first(),f.left&&(f.left=d.children(".ogx_iceberg_view_left").first(),p=f.left.outerWidth()),f.top&&(f.top=d.children(".ogx_iceberg_view_top").first(),v=f.top.outerHeight()),f.main=d.children(".ogx_iceberg_view_main").first(),f.right&&(f.right=d.children(".ogx_iceberg_view_right").first(),g=-f.right.outerWidth()),f.bottom&&(f.bottom=d.children(".ogx_iceberg_view_bottom").first(),m=-f.bottom.outerHeight())}(),setTimeout(X,0),r=s.touch.add("Swipe",{state:"manual",capture:c.capture,x:!0,y:!0,min_x:c.min,min_y:c.min,cb_down:x,cb_swipe:b,cb_up:w}),s.resize()},OGX.Iceberg.SWIPE_UP="icebergSwipeUp",OGX.Iceberg.SWIPE_DOWN="icebergSwipeDown",OGX.Iceberg.SWIPE_LEFT="icebergSwipeLeft",OGX.Iceberg.SWIPE_RIGHT="icebergSwipeRight",OGX.Iceberg.RESTORE="icebergRestore",OGX.Loading=function(e){"use strict";var t=this,i=!1,n={display:{css:"ogx_loading",html:" ",anim:OGX.Overlay.FADE}};e.hasOwnProperty("loading")&&e.loading&&setTimeout(t.addLoading,0),this.hasLoading=function(){return!!i},this.addLoading=function(e){return t.hasOverlay()||(i=!0,void 0===e&&(e={}),OGX.Data.merge(e,n),t.addOverlay(e)),this},this.removeLoading=function(e,n){return t.hasOverlay()&&(t.removeOverlay(e,n),i=!1),this}},OGX.Math={},OGX.Math.rotate=function(e,t){t=-t*(Math.PI/180);var i=Math.cos(t),n=Math.sin(t);return new Array(Math.round(1e4*(e[0]*i-e[1]*n))/1e4,Math.round(1e4*(e[0]*n+e[1]*i))/1e4)},OGX.Math.dist=function(e,t){return Math.sqrt((e.x-t.x)**2+(e.x-t.y)**2)},OGX.Math.angle=function(e,t){var i=function(e,t,i,n){var o=n-t,a=i-e,r=Math.atan2(o,a);return r*=180/Math.PI}(e.x,e.y,t.x,t.y);return i<0&&(i=360+i),i},OGX.Media=function(){"use strict";this.toFile=function(e,t){for(var i=e.split(","),n=i[0].match(/:(.*?);/)[1],o=atob(i[i.length-1]),a=o.length,r=new Uint8Array(a);a--;)r[a]=o.charCodeAt(a);return new File([r],t,{type:n})},this.toURL=function(e){return URL.createObjectURL(e)},this.crop=function(e,t,i,n,o,a){void 0===o&&(o=0),void 0===a&&(a=0);const r=document.createElement("canvas"),s=r.getContext("2d");r.width=i,r.height=n;var l=new Image;l.onload=()=>{s.drawImage(l,o,a,i,n,0,0,i,n),t(r.toDataURL("image/png",1))},l.src="data:image/png;base64,"+e},this.read=function(e,t,i){void 0===i&&(i=null);var n=new FileReader;i&&(n.onerror=t=>{i(e,t)}),n.onload=i=>{t(e,i.target.result)},n.readAsDataURL(e)},this.load=async function(e,t,i){void 0===i&&(i=null);const n=await fetch(e),o=await n.blob();this.read(o,t,i)}},OGX.Media=new OGX.Media,require("NestList","Uxi","Bind"),OGX.NestList=function(e){construct(this,"NestList");var t,i,n=this,o={scope:["public"],template:'<div class="ogx_nest_list_item {{$dsp}}" data-ogx-nest-id="{{$id}}"><div class="ogx_nest_list_item_head {{$css}}"><span class="ogx_nest_list_item_title">{{$title}}</span><span class="ogx_nest_list_item_icon"></span></div><div class="ogx_nest_list_item_body"><div class="ogx_nest_list_item_content">{{$body}}</div></div></div>',list:new OGX.List,item_default:!1,map:{title:"title",scope:"scope",id:"id"},order:!1,callbacks:{open:null,close:null}},a={title:"",scope:[],open:!0},r={id:0,title:!1,scope:[],height:0,y:0,hidden:!1,open:!0,selector:!1},s=e,l=!1,c=0,d=0,u=1,h={y:0,h:0,way:1},f=!1,_=new OGX.List;function g(e){e?t.on("click",".ogx_nest_list_item_head",p):t.off("click",".ogx_nest_list_item_head",p)}function p(e){l||(l=!0,m($(this)))}function m(e){var i=e.parent(0).data("ogx-nest-id"),o=!1;e.hasClass("ogx_nest_list_item_head_closed")?(h.way=1,e.addClass("ogx_nest_list_item_head_open").removeClass("ogx_nest_list_item_head_closed"),_.findUpdate("id",i,{open:!0},!1,1),o=!0):(h.way=0,e.removeClass("ogx_nest_list_item_head_open").addClass("ogx_nest_list_item_head_closed"),_.findUpdate("id",i,{open:!1},!1,1));var a=_.find("id",i,1);o?(!function(e){var t=v(e);if(t)return t.focus(),!0}(a),n.onOpen(a),t.trigger(OGX.NestList.OPEN,a)):(!function(e){var t=v(e);if(t)return t.blur(),!0}(a),n.onClose(a),t.trigger(OGX.NestList.CLOSE,a)),setTimeout(x,0)}function v(e){var t=$(e.selector).find(".ogx_uxi").first();if(t.length){var i=String(t.data("ogx-id")),o=n.nodes.find("id",i,1);if(o)return o}return!1}function y(e){if(e.hasOwnProperty("scope"))for(var t=0;t<e.scope.length;t++)if(-1!==s.scope.indexOf(e.scope[t]))return!0;return!1}function x(){var e;!function(){var e=0;d=0,h.y=0,h.h=0;for(var i=0;i<_.length;i++)_[i].y=e,_[i].hidden||(c||(c=t.children(".ogx_nest_list_item:eq("+i+")").children(".ogx_nest_list_item_head").outerHeight(!0)),d+=c,h.y=e,_[i].open&&(h.y+=_[i].height,e+=_[i].height,d+=_[i].height),h.h=_[i].height);d-=h.h}();for(var i=t.children(".ogx_nest_list_mask").first(),o=0;o<_.length;o++)(e=t.children('.ogx_nest_list_item[data-ogx-nest-id="'+_[o].id+'"]')).removeClass("ogx_nest_list_item_noanim"),e.css("transform","translateY("+_[o].y+"px)");var a="height:"+Math.ceil(d+h.h)+"px !important;";i.on("transitionend",(function(){h.way||t.css("cssText",a),l=!1,n.scroller&&n.scroller.resize()})),h.way&&t.css("cssText",a),setTimeout((()=>{i.css({transform:"translateY("+h.y+"px)"})}),0)}function O(e,i){OGX.Data.merge(e,a);var o=OGX.Data.merge(r,e,!0,!0);e.hasOwnProperty(s.map.id)?o.id=e[s.map.id]:(o.id=u,u++);var l,c,d=((c={css:"",dsp:"ogx_nest_list_prep",id:(l=o).id})[s.map.title]=l[s.map.title],l.open?c.css="ogx_nest_list_item_head_open":c.css="ogx_nest_list_item_head_closed",OGX.Templater.make(s.template,c));void 0!==i&&i<s.list.length-1?t.children(".ogx_nest_list_item:eq("+i+")").before(d):t.children(".ogx_nest_list_mask").first().before(d),o.selector='.ogx_nest_list[data-ogx-id="'+n.id+'"] > .ogx_nest_list_item[data-ogx-nest-id="'+o.id+'"] > .ogx_nest_list_item_body > .ogx_nest_list_item_content';var h=$('.ogx_nest_list[data-ogx-id="'+n.id+'"] > .ogx_nest_list_item[data-ogx-nest-id="'+o.id+'"]');return o.hidden&&h.addClass("ogx_nest_list_item_hidden"),h.removeClass("ogx_nest_list_prep"),o}function b(){var e=s.list;f&&(e=i),t.empty(),_.clear();var o;t.html('<div class="ogx_nest_list_mask"></div>'),s.hasOwnProperty("node:OML")||(s["node:OML"]=[]);for(var a=0;a<e.length;a++)o=O(e[a]),_.push(o),s["node:OML"][a]=OGX.OML.rename(s["node:OML"][a],o.selector);n.observe(!0,{childList:!0,subtree:!0},(function(){n.updateNestsHeight()}))}function w(){for(var e=[],t=0;t<s.list.length;t++)e[s.order.indexOf(s.list[t][s.map.title])]=s.list[t];return s.list=new OGX.List(e)}function G(){s.list.hasOwnProperty("insert")||(s.list=new OGX.List(s.list));for(var e=0;e<s.list.length;e++)s.item_default?OGX.Data.merge(s.list[e],s.item_default):OGX.Data.merge(s.list[e],a),s.order&&w()}this.onFocus=function(){return g(!0),this},this.onBlur=function(){return g(!1),this},this.show=function(e,t){arguments.length||this._show();var i=this.find(e,t);if(i){var n=i.el.parents(".ogx_nest_list_item").first().children(".ogx_nest_list_item_head").first();m(n)}return this},this.bindFilter=function(e,t,n){s.list.removeFilter(e),void 0!==n&&s.list.addFilter(e,t,n),s.list.getFilters()&&(i=s.list.filter(),f=!0),setTimeout(b,0)},this.destroy=function(){t.children(".ogx_nest_list_mask").off("transitionend"),n.observe(!1)},this.onOpen=function(){},this.onClose=function(){},this.scope=function(e){return void 0!==e?(s.scope=e,function(){for(var e,i=0;i<_.length;i++)(e=t.children(_[i].selector)).addClass("ogx_nest_list_item_noanim"),y(_[i])?(_[i].hidden=!1,e.removeClass("ogx_nest_list_item_hidden")):(_[i].hidden=!0,e.addClass("ogx_nest_list_item_hidden"));setTimeout(x,0)}(),!0):s.scope},this.val=function(e){if(void 0===e)return s.list;s.list=e,G(),setTimeout(b,0)},this.addNest=function(e,t,i){var n=O(e,i);if(_.insert(n,i),t=OGX.OML.rename(t,n.selector),OGX.OML.render(this,t),void 0!==i){var o=this.nodes.pop();this.nodes.insert(o,i)}},this.removeNest=function(e){var t=_.findIndex(s.map.title,e);t&&(this.nodes[t.index].kill(),this.nodes.splice(t.index,1),$('.ogx_nest_list[data-ogx-id="'+n.id+'"] > .ogx_nest_list_item[data-ogx-nest-id="'+_[t.index].id+'"]').remove(),_.splice(t.index,1),setTimeout(x,0))},this.updateNestHeight=function(e){var t=_.find(s.map.title,e,1);setTimeout((()=>{var e,i;e=t,i=$(e.selector).outerHeight(!0),e.height=i,x()}),0)},this.updateNestsHeight=function(){for(var e,t=0;t<_.length;t++)e=_[t],this.updateNestHeight(e[s.map.title])},this.updateMask=function(){x()},OGX.Data.merge(s,o),s.callbacks.open&&(n.onOpen=s.callbacks.open),s.callbacks.close&&(n.onClose=s.callbacks.close),G(),s.template=s.template.replace("{{$title}}","{{$"+s.map.title+"}}"),(t=n.el).addClass("ogx_nest_list"),s.list.length&&b()},OGX.NestList.OPEN="NestListOpen",OGX.NestList.CLOSE="NestListClose",OGX.NestList.READY="NestListReady",OGX.Net=function(e){"use strict";var t=this,i=1,n=OGX.Data.merge({core:null,file_default:{file:!1,path:!1},extensions:[{ext:"json",path:"/json",type:"json"},{ext:"js",path:"/js",type:"text"},{ext:"html",path:"/html",type:"text"},{ext:"oml",path:"/oml",type:"json"},{ext:"ose",path:"/ose",type:"text"},{ext:"ejs",path:"/js/min",type:"text"},{ext:"mp3",path:"/snd",type:"mp3"},{ext:"wav",path:"/snd"},{ext:"ogg",path:"/snd"},{ext:"png",path:"/img"},{ext:"jpg",path:"/img"},{ext:"gif",path:"/img"},{ext:"svg",path:"/img"}],ios:!1,encrypted:!1,key:null},e,!0,!0,!0);function o(e,t){var i=new FileReader;i.onload=function(){var e=i.result.split(",")[1];t(e)},i.readAsDataURL(e)}function a(e,i,o,a){switch(e.ext){case"json":case"txt":case"oml":case"ose":case"html":case"snd":["app.json","manifest.json"].includes(e.file)||OGX.Cache.add(e);break;case"ejs":e.data=OGX.Data.decrypt(e.data,n.key);var r=document.createElement("script"),s=document.createTextNode(e.data);r.appendChild(s),r.onload=()=>{r.remove()},document.body.appendChild(r)}void 0!==i&&setTimeout((()=>{i(e.data,o,a)}),0),$(document).trigger(t.LOAD_SUCCESS,e)}function r(e,t,i){!function(){var o=e.path+"/"+e.file;"/"===o.substr(0,1)&&(o=o.substr(1)),(n.encrypted&&"app.json"===o||"pak"===e.ext)&&(e.type="text"),fetch(o,{method:"GET",mode:"no-cors",cache:"no-cache",credentials:"same-origin",headers:{"Content-Type":s(e.type)},redirect:"follow",referrerPolicy:"same-origin"}).then((t=>{switch(e.type){case"text":return t.text();case"json":return t.json();default:return t.blob()}})).catch((e=>{$(document).trigger(OGX.Net.NETWORK_ERROR,e)})).then((n=>{e.data=n,a(e,t,i)}))}()}function s(e){switch(e){case"text":case"json":return"text/plain";default:return"application/zip"}}n.extensions.hasOwnProperty("insert")||(n.extensions=new OGX.List(n.extensions)),this.LOAD_SUCCESS="NET_LOAD_SUCCESS",this.LOAD_START="NET_LOAD_START",this.NETWORK_ERROR="NET_NETWORK_ERROR",this.download=function(t){e.app.getStage().observeOnce(null,(()=>{var e=$("#ogx_net_download");e[0].click(),e.remove()})),e.app.getStage().el.append('<a id="ogx_net_download" style="display:none;" href="'+t+'" download></a>')},this.preload=function(e,i,n){var o={loaded:0,total:0,files:new OGX.List};for(var a in e)for(var r=0;r<e[a].length;r++)o.total++;for(var a in $(document).trigger(t.LOAD_START,o.total),e)for(r=0;r<e[a].length;r++)this.load(a+"/"+e[a][r],s);function s(e,t){o.loaded++,o.files.insert(e),o.loaded===o.total&&setTimeout((()=>{i(o.files,n)}),0)}},this.load=function(e,t,o){var s,l={file:null,path:null};-1!==e.indexOf("/")?(s=e.split("/"),l.file=s.pop(),l.path=s.join("/")):(l.path="",l.file=e),OGX.Data.merge(l,n.file_default);var c=function(e){var t;if(t=/([a-z0-9\_\-]+\.)?([a-z0-9\_\-]+)\.([a-z0-9]{3,4})/gi.exec(e))return t.shift(),t;return!1}(l.file);if(c)switch(l.ext=c[2],l.id=c[1],l.ext){case"json":case"txt":case"oml":case"ose":case"html":case"ejs":l.type=n.extensions.find("ext",l.ext,1).type,r(l,t,o);break;case"mp3":case"ogg":case"wav":!function(e,t,i){var n;function o(){var o=e.path+"/"+e.file;"/"===o.substr(0,1)&&(o=o.substr(1)),n=new Audio(o),e.data=n,e.ext="snd",e.format=e.file.split(".").pop(),a(e,t,i)}o()}(l,t,o);break;case"png":case"gif":case"jpg":case"svg":!function(e,t,i){var n=new Image;function o(){n.onload=function(){e.data=n,a(e,t,i,n)};var o=e.path+"/"+e.file;"/"===o.substr(0,1)&&(o=o.substr(1)),n.src=o}o()}(l,t,o);break;case"ttf":case"eot":case"woff":case"woff2":!function(e,t,n){function o(){var o,r='<div class="ogx_font_loader" style="font-family:'+e.file.split(".")[0]+';" data-ogx-id="font-loader-'+i+'"><b>ogx</b> <i>font</i> init</div>';$("body").append(r),a(e,t,n),o=i,setTimeout((()=>{$('.ogx_font_loader[data-ogx-id="font-loader-'+o+'"]').remove()}),150),i++}o()}(l,t,o);break;case"pak":!function(e,t,i){function o(o){var r;n.encrypted&&n.key&&(o=OGX.Data.decrypt(o,n.key));for(var s=/<!--\[([a-zA-Z0-9_\-]+)\]-->/gi,l=[];r=s.exec(o);)l.push(r[1]);s=/<!--\[[a-zA-Z0-9_\-]+\]-->/gi;var c,d,u,h=o.split(s);h.shift();for(var f=0;f<l.length;f++){switch(e.path){case"/html":d="template."+l[f]+".html",u=h[f];break;default:d=l[f]+"."+e.path.substr(1),u=JSON.parse(h[f])}c={ext:e.path.substr(1),data:u,path:e.path,id:l[f],file:d},OGX.Cache.add(c)}a(e,t,i)}r(e,o,i)}(l,t,o)}},this.upload=function(e,t,i){var n=[],a="";t&&(a="multiple");var r='<input id="ogx_net_upload" type="file" name="file" accept="'+e.join(",")+'" style="display:none;" '+a+">";$("body").append(r);var s=$("#ogx_net_upload");s.on("change",(function(){s.off("change");for(var e=0;e<this.files.length;e++)o(this.files[e],(e=>{n.push(e),n.length===this.files.length&&(i(t?n:n[0]),s.remove())}))})),s.trigger("click")}},OGX.OSE=function(){"use strict";var charcode,to="__thread_object",lo="__local_object",ro="__route_object",oo="__object",fn=0;function convertValue(e){if(-1===e.indexOf(":"))return e;var t=e.split(":");switch(t[1]){case"Boolean":return"true"===t[0];case"Number":var i=Number(t[0]);return!isNaN(i)&&i}}function convertKeywords(e,t){for(var i=["echo","scope","method","screen","mongogx","uxi","loop","json","ose","template","oml","crumb","function","result"],n=["eko","sco","met","scr","mgx","ixu","loo","jsn","eso","tpl","lmo","crb","fnk","rst"],o=["$","@","#","&"],a=0;a<i.length;a++)for(var r=0;r<o.length;r++)e=t?e.replaceAll(o[r]+i[a],o[r]+"___"+n[a]):e.replaceAll(o[r]+"___"+n[a],o[r]+i[a]);return e}function convertToJS(e,t,i,n,o){var a,r,s,l,c,d=0,u="";if(e=convertKeywords(e=(e=e.replace(/^[ \n\r]*{{|}}[\r\n ]*$/g,"").trim()).replace(/(\/\*+((?!\*+\/)[\S\s])*\*+\/)/g,""),!0),(r=/(screen ?([<>=!+]+ ?\d+) ?\? ?([\S\s]+) ?\: ?([\S\s]+);?)/gi.exec(e))&&(l=(l=(l="var a;"+r[0]).replace("screen","screen.width")).replace(r[3],'a="'+r[3].trim()+'"'),l="null"!==r[4]?l.replace(r[4],'a="'+r[4].trim()+'"'):l.replace(r[4],"a=false;"),l+=";if(a){return a;}",c=new Function(l),e=e.replace(r[0],c())),(r=/(scope ([\S ]+) ?\? ?([\S ]+)\: ?([\S ]+);?)/gi.exec(e))&&(l=r[0],e="null"===(l=(s=OGX.Scope.eval(r[2]))?r[3]:r[4])?e.replace(r[0],""):e.replace(r[0],l)),(r=/(uxi\.?([a-z0-9_]+)? *(?:#|\$|&|@|%)*([a-z0-9_\-]+):([a-z0-9]+))/gi.exec(e))&&(s=void 0===r[2]?'OGX.Object.get({_NAME_:{eq:"'+r[4]+'"}, id:{eq:"'+r[3]+'"}}, null, 1);':'OGX.Object.get({_NAME_:{eq:"'+r[4]+'"}, "'+r[2]+'":{eq:"'+r[3]+'"}}, null, 1);')===(e=e.replace(r[0],s)))return"return "+e;if(r=/function *([\s\S]+)(\(\))?/gi.exec(e))return r[1]&&(isSingleVar(r[1])?(s="return "+r[1],void 0!==r[2]&&(s+="( __object )")):(s="function __f"+fn+"(__object){"+r[1]+"}; return __f"+fn+"( __object );",fn++)),e=convertKeywords(e=replaceVars(e=e.replace(r[0],s),t,i,n,o),!1);if((r=/method *([a-zA-Z0-9_\-]+)(\(\))? ([a-zA-Z0-9_\-]+):([a-zA-Z0-9_\-]+)/gi.exec(e))&&(s='OGX.Object.get({_NAME_:{eq:"'+r[4]+'"}, id:{eq:"'+r[3]+'"}}, null, 1).'+r[1],e=e.replace(r[0],s),void 0!==r[2]&&(e+="(__object)"),s===e))return"return "+e;if((r=/mongogx ([a-z0-9_\-]+)\.([a-z0-9_\-]+)\.([a-z]+)\(([\S ]+)\)/gi.exec(e))&&(s="mongogx.setDatabase('"+r[1]+"'); ",s+="mongogx.setCollection('"+r[2]+"'); ",(s+="return mongogx."+r[3]+"("+r[4]+");")===(e=e.replace(r[0],s))))return s;if(isSingleVar(e))return"return "+replaceVars(e=convertKeywords(e,!1),t,i,n,o)+";";for(e=convertKeywords(e+="\r\n",!1);a=/[\S ]+(\r\n|\n)?/gi.exec(e);){if(l=replaceLoop(l=a[0].replace(/(\r\n|\n)/gi,"").trim(),t,i,n,o),charcode++,l=replaceVars(l,t,i,n,o),/^(app|OGX)\.\S+;?/g.test(l))return"return "+l+";";if(e=e.replace(a[0],""),u+=l+"\n",++d>100)return}return u="var __echo=[];\n"+u+'\nif(!__echo.length){return;}else{return __echo.join("");}'}function runJS(e,t,i,n,o,a){var r;try{r=new Function(oo,to,ro,lo,e)(t,i,n,o)}catch(e){return}if(void 0!==r)return r}function isSingleVar(e){return/^[ ]*\S+( \S+)?[ ]*$/g.test(e)}function getTrueVal(__string,__object,__thread_object,__route_object,__local_object,__as_string){void 0===__as_string&&(__as_string=!0);var e=!1,err=!1;__string=__string.trim().replace(/;/g,"");var reg=new RegExp(oo+"|"+to+"|"+ro+"|"+lo);if(reg.test(__string))return __string;if(["$","%","@"].includes(__string))switch(__string){case"&":return to;case"@":return lo;case"$":return oo;case"%":return ro}try{e=eval(__string)}catch(e){err=!0}return err||!e||"function"==typeof e||e&&e instanceof HTMLElement?'"'+__string+'"':e?"string"!=typeof e?__string:__as_string?'"'+e+'"':e:__string}function replaceLoop(e,t,i,n,o){var a,r,s,l,c;return(a=/loop (\S+) ?(as (\S+) ?(\S+ )?)?{/gi.exec(e))&&(r="__"+String.fromCharCode(charcode).toLowerCase()+"__",charcode++,c="__"+String.fromCharCode(charcode).toLowerCase()+"__",charcode++,s=(s=a[0]).replace(a[0],"var "+c+"=JSON.parse(JSON.stringify("+a[1]+"));for(var "+r+" in "+c+"){"),a[2]&&(l=a[4]?"&"+a[3]+"="+r+"; &"+a[4]+"="+a[1]+"["+r+"]; ":"&"+a[3]+"="+a[1]+"["+r+"]; "),s+=l,e=e.replace(a[0],s)),e}function replaceVars(__exp,__object,__thread_object,__route_object,__local_object){for(var str,m,mm,o,total=0,safe=300;m=/((&|#|@|\$|%)([a-zA-Z_]{1}[a-zA-Z0-9\-_]*))(\.[a-z0-9\-_\.\[\]\$]+|\.\$|\.)?(;)?/gi.exec(__exp);){switch(o=!1,m[2]){case"&":o=to+"."+m[3];break;case"@":o=lo+"."+m[3];break;case"$":o=oo+"."+m[3];break;case"#":o=m[3];break;case"%":o=ro+"."+m[3]}if(str=m[0].replace(m[1],o),__exp=__exp.replace(m[0],str),total++,total>safe)return __exp}for(;m=/([a-z_\-\.]+)\( *(\$|@|&|%).*\)/gi.exec(__exp);)o=getTrueVal(m[2]),str=m[0].replace(m[2],o),__exp=__exp.replace(m[0],str);for(;mm=/^(json|ose|template|oml|crumb|result) (\S+)/g.test(__exp);){if(m=/crumb ([a-z0-9_\-]+) ?(\$[a-z0-9_\-]+)?/gi.exec(__exp)){str="__route_object."+m[1],m[2]&&(str+="."+m[2].slice(1));var r=null;try{r=eval(str)}catch(e){}r||(str="{}"),__exp=__exp.replace(m[0],str)}if((m=/json (\S+)(;)?/gi.exec(__exp))&&(m[1]=getTrueVal(m[1],__object,__thread_object,__route_object,__local_object),__exp=__exp.replace(m[0],"OGX.Core.getJSON("+m[1]+")")),(m=/^template (\S+)( \S+)?[ ;]?/gi.exec(__exp))&&(m[1]=getTrueVal(m[1],__object,__thread_object,__route_object,__local_object),void 0===m[2]?m[2]="__object":m[2]=getTrueVal(m[2].trim(),__object,__thread_object,__route_object,__local_object),__exp=__exp.replace(m[0],"OGX.Templater.make(OGX.Templater.get("+m[1]+"), "+m[2]+", "+to+","+ro+","+lo+")")),(m=/^ose (\S+)(;)?/gi.exec(__exp))&&(m[1]=getTrueVal(m[1],__object,__thread_object,__route_object,__local_object),script=that.get(m[1]),script&&(__exp=exp.replace(m[0],script.replace(/({{|}})/g,"")))),(m=/^oml (\S+) *(\S+)? *;?/gi.exec(__exp))&&(m[1]=getTrueVal(m[1],__object,__thread_object,__route_object,__local_object),m[2]?(m[2]=getTrueVal(m[2]),__exp=__exp.replace(m[0],"OGX.Templater.jmake(OGX.Core.getOML("+m[1]+"), "+m[2]+")")):__exp=__exp.replace(m[0],"OGX.Core.getOML("+m[1]+")")),(m=/^result (\S+)(;)?$/gi.exec(__exp))&&(__exp=__exp.replace(m[0],'OGX.OML.result("'+m[1]+'")')),total++,total>safe)return __exp}if(["$","@","%","&"].includes(__exp.trim())){switch(__exp.trim()){case"$":__exp=oo;break;case"@":__exp=lo;break;case"%":__exp=ro;break;case"&":__exp=to}return __exp}for(;m=/echo ('|")?(((?![;}\r\n]+|$)([\S\s]))*)(?:'|")?/gi.exec(__exp);){var e="+$1+",gill="'";if(void 0!==m[1]&&(gill="\\"+m[1]),e=gill+e+gill,m[2]=m[2].replace(/(__(?!;\n\r)[a-z0-9_\-\.]+)/gi,e),str="__echo.push("+gill+m[2]+gill+");",__exp=__exp.replace(m[0],str),total++,total>safe)return __exp}return __exp}this.get=function(e){return OGX.Cache.read("ose",e)},this.fork=function(e,t){var i,n;if(i=e.split(":")[0],void 0===t.data&&(t.data={}),void 0!==(n=OGX.OSE.exec(i,t.data)))for(var o in t.values)if(convertValue(o)===n)return t.values[o];return!1},this.execScript=function(e,t,i,n){var o=this.get(e);return o&&this.exec(o,t,i,n),!1},this.exec=function(e,t,i,n,o){void 0===t&&(t={}),void 0===i&&(i={}),void 0===n&&(n={}),void 0===o&&(o={}),charcode=65;var a=runJS(convertToJS(e,t,i,n,o),t,i,n,o,e);if(void 0!==a)return a}},OGX.OSE=new OGX.OSE,OGX.OSE.SCRIPT_LOADED="OSE_SCRIPT_LOADED",OGX.OSE.SCRIPTS_LOADED="OSE_SCRIPTS_LOADED",OGX.Overlay=function(e){"use strict";var t=this,i=!1,n=!1,o={anim:OGX.Overlay.FADE,display:{css:"",html:" "},index:!1,close_on_click:!1},a=!1,r="mousedown";function s(e){i&&(e?i.on(r,l):i.off(r,l))}function l(){"function"==typeof a.close_on_click&&a.close_on_click.apply(null,t),t.removeOverlay()}e.hasOwnProperty("overlay")&&e.overlay&&setTimeout((()=>{t.addOverlay(e.overlay)}),0),this.hasOverlay=function(){return!!i},this.addOverlay=function(e){if("object"!=typeof e&&(e={}),OGX.Data.merge(e,o),e.display.hasOwnProperty("_NAME_")||(e.display=new OGX.Display(e.display)),a=e,!this.hasOverlay()){var t=this.el;a.hasOwnProperty("el")&&(t=$(a.el));var n="z-index:"+(a.zindex?a.zindex:this.topIndex(t))+";",r='<div class="ogx_overlay '+a.display.css()+'" style="'+n+'">'+a.display.html()+"</div>";if(t.prepend(r),(i=t.children(".ogx_overlay").first()).off("transitionend"),a.anim)switch(a.anim){case OGX.Overlay.FADE:setTimeout((()=>{i&&i.removeClass("ogx_overlay_fade_out").addClass("ogx_overlay_fade_in")}),50)}else i.css("opacity",1)}return e.close_on_click&&s(!0),this},this.removeOverlay=function(e,t){s(!1);var n=!1;if(void 0===e||!0===e?a.anim&&(n=a.anim):n=e,i){if(n){switch(n){case OGX.Overlay.FADE:i.removeClass("ogx_overlay_fade_in").addClass("ogx_overlay_fade_out"),i.css("opacity")>0?i.on("transitionend",(function(){i&&(i.off("transitionend"),i.remove(),i=!1),"function"==typeof t&&t()})):i&&(i.removeClass("ogx_overlay_fade_in").removeClass("ogx_overlay_fade_out"),i.off("transitionend"),i.remove(),i=!1)}return}return i.remove(),void(i=!1)}return this},this.addGroupOverlay=function(){return n||(this.el.prepend('<div class="ogx_group_overlay" style="z-index:'+(this.topIndex()+1e3)+'"></div>'),n=!0),this},this.removeGroupOverlay=function(){return n&&(this.el.children(".ogx_group_overlay").remove(),n=!1),this}},OGX.Overlay.FADE="fade",OGX.Overlay.REMOVE="OverlayRemove",OGX.Placeholder=function(e){"use strict";this.pholder=null,this.pholders=null,e.hasOwnProperty("placeholder")&&(this.pholder=e.placeholder),this.pholder&&this.pholder.length&&"default"!==this.pholder||(this.pholder=""),this.placeholder(e)},OGX.Placeholder.prototype.placeholder=function(e){if("object"==typeof e["node:OML"]){var t=this.selector;this.pholder&&(t+=" "+this.pholder),Array.isArray(e["node:OML"])||function(e,i){for(var n in e)0===n.indexOf("default")&&(e[n.replace("default",t)]=e[n],delete e[n])}(e["node:OML"])}},OGX.Placeholder.prototype.placeholders=function(e,t){function i(e,t){for(var i in e)0===i.indexOf("default")&&(e[i.replace("default",t)]=e[i],delete e[i])}if(this.pholders=t,void 0!==e&&void 0!==t){e.hasOwnProperty("node:OML")||(e["node:OML"]=[]);var n,o=e["node:OML"];if(o&&"string"==typeof o&&(0===o.indexOf("{{")?e["node:OML"]=OGX.OSE.exec(o):e["node:OML"]=OGX.Cache.read("oml",e["node:OML"])),!Array.isArray(e["node:OML"]))return;for(var a=0;a<e["node:OML"].length;a++)if("string"==typeof(n=e["node:OML"][a])&&(n=0===n.indexOf("{{")?OGX.OSE.exec(n):OGX.Cache.read("oml",n)),"object"==typeof n&&t.length)if(Array.isArray(t[0]))for(var r=0;r<t[a].length;r++)i(n,t[a][r]);else i(n,t[a]);return e}return!1},require("Point"),OGX.Point=function(e){construct(this,"Point");var t,i=this,n={id:OGX.Object.genId(),target:null,el:null},o=OGX.Data.merge(e,n,!1,!1);function a(){var e=OGX.OML.render(i.parent,i.points[i.point].oml,o.data,o.route_data);t&&t.forEach((e=>{e.kill()})),t=e,i.el.trigger(OGX.Point.CHANGE,{min:i.points[i.point].min,max:i.points[i.point].max,index:i.point,id:i.id})}function r(e,t,i,n){return-1!==i.indexOf("%")?(i=parseInt(i.replace("%",""),10),n=parseInt(n.replace("%",""),10),e>=i&&e<=n):(i=parseInt(i,10),n=parseInt(n,10),t>=i&&t<n)}function s(){var e=function(){var e,t;e=o.target?i.el.find(o.target).first().width():i.el.width(),t=i.el.width();for(var n=0;n<i.points.length;n++)if(r(t?100*e/t:0,e,i.points[n].min,i.points[n].max))return{id:n,oml:i.points[n].oml};return!1}();return e?e.id!==i.point&&(i.point=e.id,i.el.attr("data-ogx-point",i.point),!0):(i.point=0,i.el.attr("data-ogx-point",i.point),!1)}function l(e){var t;for(var i in e)0===i.indexOf("default")&&(t=i.replace("default",""),e[o.el+" "+t]=e[i],delete e[i])}this.points=[],this.point=null,this.el=$(o.el),this.id=o.id,this.construct=function(){s(),a()},this.onResize=function(){s()&&a()},this.resize=this.onResize,this.oml=function(){return null===this.point&&s(),this.points[this.point].oml},this.getPoint=function(){return{min:this.points[this.point].min,max:this.points[this.point].max}},i.el.addClass("ogx_point"),function(){var e;for(var t in o)if(/^\d+%?\-\d+%?$/gi.test(t)){e=t.split("-");var n=OGX.Data.clone(o[t]);if(Array.isArray(n))for(var a=0;a<n.length;a++)l(n[a]);else l(n);i.points.push({min:e[0],max:e[1],oml:n})}}(),s()},OGX.Point.CHANGE="PointChange",require("Popup","Uxi","Placeholder","Touch","Resize"),OGX.Popup=function(e){construct(this,"Popup");var t,i,n,o=this,a={el:!1,width:"80%",height:"80%",min_width:0,min_height:0,max_width:0,max_height:0,html:!1,template:!1,title:!1,icon:!1,icons:!1,view:!1,drag:!1,resize:!1,keep_ratio:!1,maximize:!1,maximize_dbc:!1,center:!0,keep_centered:!1,x:null,y:null,show:!0,group:!1,group_icon:null,data:{},buttons:[],buttons_enabled:!0,anim:OGX.Popup.FADE,responsive:!0,overlay:!1,zindex:!1,chromeos:!1,parent:null,floating:!0,callbacks:{drag:null,drag_end:null,resize:null}},r={label:"",callback:null,params:null,enabled:!0},s=null,l=null,c=null,d="ogx_popup",u=[],h=[],f={w:0,h:0},_=!1,g=!1,p=null,m=!1,v=null,y=null,x=1,O=null,b=!1;function w(){o.el.addClass("ogx_popup_notrans"),g=!0,G(!0)}function G(e){if(void 0===e&&(e=!1),t.anim&&(o.el.removeClass(U(t.anim,0)),o.el.removeClass(U(t.anim,1))),e)t.width=o.el.width(),t.height=o.el.height(),t.keep_centered=o.centered=!1;else if(!g){var i=L();o.el.css({width:i.w,height:i.h})}t.keep_centered&&o.center(),o.resizeNodes()}function X(){t.anim&&o.el.removeClass(d+"_notrans");var e={};OGX.Data.isSizeExp(t.width)?e.width=OGX.Data.getBestSize(c.width(),t.width):e.width=t.width,OGX.Data.isSizeExp(t.height)?e.height=OGX.Data.getBestSize(c.height(),t.height):e.height=t.height,o.el.css(e),o.resizeNodes()}function C(){var e=u.length;return e>2&&(e=2),u.slice(0,e).join(" ").replace(/matrix\([0-9,\. ]+\)/,"")}function D(){o.blurNodes(),t.keep_centered&&(t.keep_centered=!1)}function E(){o.focusNodes(),o.el.removeClass("ogx_popup_notrans"),t.anim&&o.el.addClass(d+"_"+t.anim)}function k(){o.front(),s.addClass(d+"_drag"),t.keep_centered&&(t.keep_centered=!1)}function S(e){if(s.removeClass(d+"_drag"),t.callbacks.drag_end?t.callbacks.drag_end():o.el.trigger(OGX.Popup.MOVED,o),_){for(var i=0;i<h.length;i++)h[i].removeGroupOverlay();return h=[],void OGX.Core.groupPopups(o,_,{drag:t.drag,resize:t.resize,anim:t.anim})}"function"==typeof t.drag&&t.drag(o,!1)}function T(e){if(i=o.el.position(),o.x=i.left,o.y=i.top,u[0]="translate3d("+o.x+"px, "+o.y+"px, 0)",t.callbacks.drag?t.callbacks.drag({x:o.x,y:o.y}):o.el.trigger(OGX.Popup.MOVE,[o,e]),t.group&&o.parent&&(h=o.parent.nodes.get({_NAME_:{eq:"Popup"},group:{eq:o.group},blured:{eq:!1}},{z:-1})).length){_=!1;for(var a=0;a<h.length;a++)o.id!==h[a].id&&h[a].group===o.group&&(n={left:h[a].x,top:h[a].y},f.w=h[a].el.width(),f.h=h[a].el.height(),i.left>n.left&&i.left<n.left+f.w&&i.top>n.top&&i.top<n.top+f.h&&(_||(_=h[a],h[a].addGroupOverlay())),_||h[a].removeGroupOverlay())}_||"function"==typeof t.drag&&t.drag(o,e)}function L(e){void 0===e&&(e=!1);var i=c.outerWidth(!0),n=c.outerHeight(!0);i>screen.width&&(i=screen.width),n>screen.height&&(n=screen.height);var a=t.width,r=t.height,s=0,l=0,d=0,u=0;if(g||(a=OGX.Data.getBestSize(i,a),r=OGX.Data.getBestSize(n,r)),t.max_height&&!m){var h=H(t.max_height,n);r>h&&(r=h)}return e||t.keep_centered?(a=H(a,i),r=H(r,n),d=Math.round(i/2-a/2),u=Math.round(n/2-r/2)):(m?(d=o.x,u=o.y):t.x&&t.y?(-1!==String(t.x).indexOf("%")?(s=a/2,d=i*Number(t.x.slice(0,-1))/100-s):d=t.x,-1!==String(t.y).indexOf("%")?(l=r/2,u=n*Number(t.y.slice(0,-1))/100-l):u=t.y):(d=Math.round(i/2-a/2),u=Math.round(n/2-r/2)),m||(d>i&&(d=i-d),d<-a&&(d=0),u>n&&(u=n-r),u<0&&(u=0))),t.keep_ratio&&!m&&(r=a*x),{x:d,y:u,w:a,h:r}}function M(e,i,n,a,r,l){var c=!1;void 0===l&&(l=!1),void 0!==i&&!0!==i||(i=t.anim),i&&(c=i),!i&&p&&(c=p),i?s.removeClass(d+"_notrans"):s.addClass(d+"_notrans"),e?(o.front(),l||o.el.trigger(OGX.Popup.SHOW,o)):l||o.el.trigger(OGX.Popup.HIDE,o),i?(e&&s.removeClass("ogx_popup_hidden"),s.off("transitionend animationend",N),s.on("transitionend animationend",{anim:c,way:e,cb:n,params:a,appcb:r},N),p=c,s.addClass(U(c,e))):(e?s.removeClass("ogx_popup_hidden"):s.addClass("ogx_popup_hidden"),A(n,a,r))}function N(e){s.off("transitionend animationend",N),e.data.way,s.removeClass(U(e.data.anim,e.data.way)),e.data.way?o.resizeNodes():s.addClass("ogx_popup_hidden"),A(e.data.cb,e.data.params,e.data.appcb)}function A(e,t,i){void 0!==e&&e&&e(t),void 0!==i&&i&&i(o.id)}function R(e){e?s.on(o.touch.down,"."+d+"_button",I):s.off(o.touch.down,"."+d+"_button",I)}function I(e){e.preventDefault(),e.stopImmediatePropagation();var i=$(this);if(!i.hasClass(d+"_button_disabled")){var n=i.index();s.trigger(OGX.Popup.CLICK_BUTTON,{index:n,value:t.buttons[n].label}),t.buttons[n].hasOwnProperty("callback")&&t.buttons[n].callback&&(t.buttons[n].hasOwnProperty("params")?t.buttons[n].callback.apply(null,[t.buttons[n].params]):t.buttons[n].callback())}}function Y(){for(var e,i="",n=0;n<t.buttons.length;n++)t.buttons.length>0&&(e=t.buttons[n].enabled?"":d+"_button_disabled",i+='<span class="'+d+"_button "+e+'">'+t.buttons[n].label+"</span>");return i}function P(e,i){void 0===i&&(i=!0),t.buttons=new OGX.List(e);for(var n=0;n<e.length;n++)t.buttons[n]=OGX.Data.merge(t.buttons[n],r);if(i){var o=Y();l.html(o)}}function z(e){e?o.el.on(o.touch.down,"."+d+"_icons_icon",(function(e){e.preventDefault(),e.stopImmediatePropagation();var i=$(this).index(),n=t.icons[i];if("object"==typeof n&&n.hasOwnProperty("callback")){var a=o;n.hasOwnProperty("params")&&(a=n.params),n.callback.call(null,a)}})):o.el.off(o.touch.down,"."+d+"_icons_icon")}function F(){for(var e,i="",n=0;n<t.icons.length;n++)e="string"==typeof t.icons[n]?t.icons[n]:t.icons[n].icon,i+='<div class="'+d+'_icons_icon" style="background-image:url(\''+e+"')\"></div>";return i}function U(e,t){var i,n=e.split(" ");return n.sort(),i=t?"in":"out","ogx_popup_"+n.join("_")+"_"+i}function B(e){e?s.on(o.touch.down,".ogx_popup_body",W):s.off(o.touch.down,".ogx_popup_body",W)}function W(){o.front()}function H(e,t){return"string"==typeof e&&(e=-1!==e.indexOf("%")?Math.round(t*Number(e.slice(0,-1))/100):Number(e)),e}this.anim=null,this.group=null,this.group_icon=null,this.max=null,this.max_dbc=null,this.x=0,this.y=0,this.z=0,this.construct=function(){t.keep_ratio&&(x=this.el.width()/this.el.height()),this.resizeNodes(),t.show&&this.show()},this.onFocus=function(){t.resize&&o.enableResize(),t.icons&&t.icons.length&&z(!0),t.buttons&&t.buttons.length&&t.buttons_enabled&&R(!0),y&&y.enable(),B(!0)},this.onBlur=function(){t.resize&&o.disableResize(),t.icons&&t.icons.length&&z(!1),t.buttons&&t.buttons.length&&t.buttons_enabled&&R(!1),y&&y.disable(),B(!1)},this.show=function(e,t,i){return this.visible||(this._show(),M(1,e,t,i),this.focus(1)),this},this.hide=function(e,t,i,n,o){return this.visible&&(this._hide(),M(0,e,t,i,n,o),this.blur(1)),this},this.onResize=function(){return G(),this},this.maximize=function(e){if(void 0===e||!y)return t.maximize&&!m&&(m=!0,v={width:t.width,height:t.height,x:this.x,y:this.y},t.width=t.height="100%",X(),this.move(0,0)),this;e?(y.enable(),t.maximize=!0):(y.disable(),t.maximize=!1)},this.normalize=function(){return t.maximize&&m&&(m=!1,t.width=v.width,t.height=v.height,X(),this.move(v.x,v.y),v=null),this},this.drag=function(e){return void 0===e?t.drag:"function"==typeof e?(t.callbacks.drag=e,!0):void(t.drag!==e&&(e?O.enable():O.disable(),t.drag=e))},this.uresize=function(e){return void 0===e?t.resize:"function"==typeof e?(t.callbacks.resize=e,!0):void(t.resize!==e&&(e?this.enableResize():this.disableResize(),t.resize=e))},this.width=function(e,i,n){return void 0===e?t.width:(void 0===n&&(n=!1),void 0===i&&(i=!1),i&&(this.el.removeClass("ogx_popup_notrans"),this.observeSizeOnce((()=>{this.el.addClass("ogx_popup_notrans"),n()}))),t.width=e,this.el.css("width",e+"px"),t.keep_centered&&this.center(),this)},this.height=function(e,i,n){return void 0===e?t.height:(void 0===n&&(n=!1),void 0===i&&(i=!1),i&&(this.el.removeClass("ogx_popup_notrans"),this.observeSizeOnce((()=>{this.el.addClass("ogx_popup_notrans"),n()}))),t.height=e,this.el.css("height",e+"px"),t.keep_centered&&this.center(),this)},this.destroy=function(){s.off("transitionend animationend"),this.touch.wipe()},this.buttons=function(e){if(void 0===e)return t.buttons;P(e)},this.enableButton=function(e){return t.buttons[e].enabled=!0,l.children("."+d+"_button:eq("+e+")").removeClass(d+"_button_disabled"),t.buttons_enabled||(t.buttons_enabled=!0),this},this.disableButton=function(e){return t.buttons[e].enabled=!1,l.children("."+d+"_button:eq("+e+")").addClass(d+"_button_disabled"),this},this.enableButtons=function(){if(t.buttons.length)for(var e=0;e<t.buttons.length;e++)this.enableButton(e);return t.buttons_enabled=!0,this},this.disableButtons=function(){if(t.buttons.length)for(var e=0;e<t.buttons.length;e++)this.disableButton(e);return t.buttons_enabled=!1,this},this.center=function(e){if(void 0===e&&(e=null),null!==e&&(t.keep_centered=e),null===e){var i=L(!0);return u[0]="translate3d("+i.x+"px, "+i.y+"px, 0px)",this.x=i.x,this.y=i.y,o.el.css({transform:C()}),this}},this.move=function(e,t){return null===e&&(e=o.el.position().left),null===t&&(t=o.el.position().top),u[0]="translate3d("+e+"px, "+t+"px, 0px)",this.x=e,this.y=t,this.el.css({transform:C()}),this},this.front=function(){return this.z=t.parent.topIndex(),this.el.css("z-index",this.z),this},this.icon=function(e){if(void 0===e)return t.icon;t.icon=e,this.el.children("."+d+"_head").children("."+d+"_icon").first().css("background-image","url("+e+")")},this.title=function(e){if(void 0===e)return t.title;t.title=e,this.el.find("."+d+"_title").first().html(e)},this.icons=function(e){if(void 0===e)return t.icons;t.icons&&t.icons.length&&z(!1),t.icons=e,this.el.find("."+d+"_icons").first().html(F()),z(!0)},this.shake=function(){this.el.on("animationend",(function(){o.el.off("animationend"),o.el.removeClass("ogx_popup_shake")})),this.el.addClass("ogx_popup_shake")},function(){if(OGX.Data.merge(a,OGX.Core.getDefaults("popups"),!0,!1,!0),null===(t=OGX.Data.merge(a,e,!0,!0)).x&&null===t.y||(t.center=!1,t.keep_centered=!1),"auto"===t.height&&(b=!0,t.height=t.width),t.center&&!e.hasOwnProperty("keep_centered")&&(t.keep_centered=!0),P(t.buttons,!1),(s=o.el).addClass(d),t.group&&s.attr("data-ogx-group",t.group),c=s.parent(),o.anim=t.anim,o.centered=t.center,o.group=t.group,o.group_icon=t.group_icon,o.max=t.maximize,o.max_dbc=t.maximize_dbc,function(){t.index?o.z=t.index:o.z=t.parent.topIndex();var e=L(t.center);o.x=e.x,o.y=e.y;var i=e.w,n=e.h;-1===String(i).indexOf("%")&&(i+="px"),-1===String(n).indexOf("%")&&(n+="px");var a="";(t.icon||t.title||t.icons||t.drag)&&(a+='<div class="'+d+'_head">',t.icon&&(a+='<div class="'+d+'_icon" style="background-image:url(\''+t.icon+"')\"></div>"),t.title&&(a+='<div class="'+d+'_title">'+t.title+"</div>"),a+='<div class="'+d+'_icons">',t.icons&&(a+=F()),a+="</div></div>"),u=["translate3d("+e.x+"px, "+e.y+"px, 0)"],a+='<div class="'+d+'_body ogx_view">',t.html?a+=t.html:t.template&&(a+=OGX.Templater.make(OGX.Templater.get(t.template),t.data)),a+="</div>",t.buttons&&t.buttons.length&&(a+='<div class="'+d+'_buttons">',a+=Y(),a+="</div>"),b&&o.observeOnce(null,(()=>{o.observeSizeOnce((()=>{var e=$(o.scroller.inner()).height(),i=o.parent.el.height();if(t.title&&(e+=s.children(".ogx_popup_head").height()),t.buttons&&t.buttons.length&&(e+=s.children(".ogx_popup_buttons").height()),t.max_height){var n=t.max_height;e>(n=H(n,i))&&(e=n)}e>i&&(e=i),t.height=e,o.height(e)}))})),s.html(a),s.css({width:i,height:n,transform:C(),"z-index":o.z}),t.anim&&t.show&&s.addClass(U(t.anim,1)),o.el=s,l=s.children("."+d+"_buttons").first()}(),t.drag&&function(e){if(e)if(O)O.enable();else{var i={x:!0,y:!0,cb_down:k,cb_up:S,cb_drag:T,target:"."+d+"_head"};t.group||"function"==typeof t.drag&&(i.cb_drag=e=>{t.drag(o,e)}),O=o.touch.add("Drag",i),o.dragable=!0}else O&&O.disable()}(!0),t.resize){var i,n=/\[=?(\d+),? ?=?(\d+)?\]/g;OGX.Data.isSizeExp(t.width)&&(i=n.exec(t.width))&&(t.min_width=Number(i[1].replace("=","")),void 0!==i[2]&&(t.max_width=Number(i[2].replace("=","")))),n.lastIndex=0,OGX.Data.isSizeExp(t.height)&&(i=n.exec(t.height))&&(t.min_height=Number(i[1].replace("=","")),void 0!==i[2]&&(t.max_height=Number(i[2].replace("=","")))),o.setResize({top:!1,keep_ratio:t.keep_ratio,min_width:t.min_width,max_width:t.max_width,min_height:t.min_height,max_height:t.max_height,cb_resize:w,cb_down:D,cb_up:E})}if(t.hasOwnProperty("html")&&t.html)t["node:OML"]=[{"default:Html":{html:t.html}}];else if(t.hasOwnProperty("view")&&t.view){var r={};r["default:Views."+t.view.id]=t,t["node:OML"].push(r)}o.placeholders(t,["."+d+'[data-ogx-id="'+t.id+'"] > .'+d+"_body"]),t.overlay&&o.addOverlay(),y=o.touch.add("Double",{state:"manual",tg:o.selector+" > .ogx_popup_head",cb_down:()=>{o.front()},cb:()=>{t.maximize&&t.maximize_dbc&&(y.disable(),m?setTimeout((()=>{o.normalize()}),180):setTimeout((()=>{o.maximize()}),180),"function"==typeof t.maximize_dbc&&t.maximize_dbc(!m),y.enable())}})}()},OGX.Popup.FADE="fade",OGX.Popup.SCALE="scale",OGX.Popup.SLIDE="slide",OGX.Popup.MOVE="PopupMove",OGX.Popup.MOVED="PopupMoved",OGX.Popup.HIDE="PopupHide",OGX.Popup.SHOW="PopupShow",OGX.Popup.CLOSE="PopupClose",OGX.Popup.DRAG="PopupDrag",OGX.Popup.GROUP="PopupGroup",OGX.Popup.UNGROUP="PopupUngroup",OGX.Popup.CLICK_BUTTON="PopupClickButton",OGX.Popup.FLOAT=!0,OGX.Resize=function(e){"use strict";var t,i,n,o,a,r,s,l,c,d,u,h=this,f=e,_={enabled:!0,top:!0,left:!0,right:!0,bottom:!0,keep_ratio:!1,min_width:100,min_height:100,max_width:0,max_height:0,border:10,cb_up:!1,cb_down:!1,cb_resize:!1},g=!1,p=(f=!1,{w:0,h:0}),m=1;function v(e){f&&(e?h.el.on(h.touch.down,G):h.el.off(h.touch.down,G))}function y(e){e?(h.el.on("mouseenter",(()=>{x(!0)})),h.el.on("mouseleave",(()=>{x(!1)}))):(h.el.off("mouseenter"),h.el.off("mouseleave"),x(!1))}function x(e){e?h.el.on("mousemove",w):h.el.off("mousemove",w)}function O(e){e?g||(g=setInterval(X,5)):g&&(clearInterval(g),g=!1)}function b(e){var t=$("body");e?(t.on(h.touch.move,C),t.on(h.touch.up,D)):(t.off(h.touch.move,C),t.off(h.touch.up,D))}function w(e){var t=E(e);r=t.pageX,s=t.pageY;var i,n=h.el.offset(),o=r-n.left,a=s-n.top,l=!1,c=!1,d=h.el.width(),u=h.el.height();(f.top&&a<f.border||f.bottom&&a>u-f.border)&&(l=!0),f.left&&o<f.border&&(c=!0,i="nwse",a>u/2&&(i="nesw")),f.right&&o>d-f.border&&(c=!0,i="nesw",a>u/2&&(i="nwse")),h.el.removeClass("ogx_resize_nesw ogx_resize_nwse ogx_resize_h ogx_resize_v"),l&&c?h.el.addClass("ogx_resize_"+i):l?h.el.addClass("ogx_resize_v"):c&&h.el.addClass("ogx_resize_h")}function G(e){y(!1);var _=E(e);i=r=_.pageX,n=s=_.pageY;var g=h.el.offset(),v=r-g.left,x=s-g.top;p.w=h.el.width(),p.h=h.el.height(),f.keep_ratio&&(m=p.w/p.h),l=0,c=0,d=0,u=0,o=0,a=0,t=OGX.Data.get2DTransform(h.el[0]),f.top&&x<f.border&&(a=-1),f.bottom&&x>p.h-f.border&&(a=1),f.left&&v<f.border&&(o=-1),f.right&&v>p.w-f.border&&(o=1),(o||a)&&(e.preventDefault(),O(!0),b(!0),f.cb_down&&f.cb_down())}function X(){l=Math.abs(r-i),c=Math.abs(s-n),d=0,u=0,r>i&&(d=1),r<i&&(d=-1),s>n&&(u=1),s<n&&(u=-1),i=r,n=s,(d&&l||u&&c)&&(-1!==o&&-1!==a||(-1===o&&(d*=-1),-1===a&&(u*=-1)),o&&d&&l&&(p.w+=l*d),a&&u&&c&&(p.h+=c*u),o&&d&&l&&(f.min_width&&p.w<f.min_width&&(p.w=f.min_width),f.max_width&&p.w>f.max_width&&(p.w=f.max_width)),a&&u&&c&&(f.min_height&&p.h<f.min_height&&(p.h=f.min_height),f.max_height&&p.h>f.max_height&&(p.h=f.max_height)),f.keep_ratio&&(o&&l?p.h=Math.round(p.w*m):a&&c&&(p.w=Math.round(p.h/m))),(o&&d&&l||a&&u&&c)&&((f.left||f.right||f.keep_ratio)&&h.el.width(p.w),(f.top||f.bottom||f.keep_ratio)&&h.el.height(p.h)),p.h!==f.min_height&&p.h!==f.max_height&&p.w!==f.min_width&&p.w!==f.max_width&&(-1===o&&(t.x+=l*d*-1),-1===a&&(t.y+=c*u*-1)),p.h!==f.min_height&&p.h!==f.max_height&&p.w!==f.min_width&&p.w!==f.max_width&&h.el.css("transform","translate3d("+t.x+"px, "+t.y+"px, 0) rotate("+t.r+"deg)"),f.cb_resize&&f.cb_resize(),h.el.trigger(OGX.Resize.RESIZING))}function C(e){e.preventDefault(),e.stopImmediatePropagation(),e=E(e),r=e.pageX,s=e.pageY}function D(e){h.el.removeClass("ogx_resize_nesw ogx_resize_nwse ogx_resize_h ogx_resize_v"),O(!1),b(!1),y(!0),e=E(e),f.cb_up&&f.cb_up(),h.el.trigger(OGX.Resize.RESIZED)}function E(e){return e.hasOwnProperty("originalEvent")&&void 0!==e.originalEvent.changedTouches?e.originalEvent.changedTouches[0]:e}this.resizable=!0,this.setResize=function(e){OGX.Data.merge(e,_,!1),f=e},this.enableResize=function(){return v(!0),y(!0),this},this.disableResize=function(){return v(!1),y(!1),this},this.destroy=function(){v(!1),y(!1),this.touch.wipe()},f||(f={}),OGX.Data.merge(f,_,!1),!f.max_width&&(f.max_width=998001),!f.max_height&&(f.max_height=998001)},OGX.Resize.RESIZING="resizeResizing",OGX.Resize.RESIZED="resizeResized",require("Roulette","Uxi","Bind","Touch"),OGX.Roulette=function(e){construct(this,"Roulette");var t,i,n,o,a,r,s,l,c,d=this,u=e,h={force_coef:10,time_coef:.1,min_force_pitch:2,max_slide:5,value:null,name:!1,required:!1,display:!1,key:null,keys:{},search:!1,mode:OGX.Roulette.MODE_REWIND,icon:!1,list:new OGX.List,capture:!0,callbacks:{change:null,input:null}},f={label:"label",value:"value",search:"label"},_="object",g=0,p=0,m="ogx_roulette";function v(e){var t=M(u.keys.value,e).index;if(t>-1&&Math.abs(p-t)>u.max_slide){var i=1;p>t&&(i=-1),k(t-i*u.max_slide,!1)}return t}function y(e,t){void 0===t&&(t=!0),d.el.children('input[name="'+u.name+'"]').val(e),t&&d.el.children('input[name="'+u.name+'"]').trigger("change")}function x(e){e?i.on(d.touch.down,"."+m+"_icon",(function(e){e.preventDefault(),e.stopImmediatePropagation(),d.next(!0),u.search&&d.el.find(".ogx_roulette_input").val("")})):i.off(d.touch.down,"."+m+"_icon")}function O(e){e?i.on("change","input[type=hidden]",b):i.off("change","input[type=hidden]",b)}function b(e){e.preventDefault(),e.stopImmediatePropagation();var t=OGX.Data.stringToVal(e.target.value);v(t),d.loopval(0,t,!1)}function w(e){return p+e>u.list.length-1?u.list[0]:p+e<0?u.list[u.list.length-1]:u.list[p+e]}function G(e){a=e.y,D(!0)}function X(e){var t;e.dirY!==r?(t=0,a=e.pt1.y):(t=e.pt1.y-a,a=e.pt1.y),r=e.dirY,n.css({transition:"none",transform:"translate3D(0px, "+(L(n)+t)+"px, 0px)"})}function C(e){D(!1),trans=L(n);var t=Math.round(trans/o)*o,i=Math.round(t/o%u.list.length);if(i=i<=0?Math.abs(i):u.list.length-i,p!==i){switch(p=i,_){case"string":u.value=u.list[p];break;case"object":u.value=u.list[p][u.keys.value]}u.name&&d.el.children('input[name="'+u.name+'"]').val(u.value).trigger("input"),d.el.trigger(OGX.Roulette.CHANGE,[u.value])}n.css({transition:"all 0.2s ease-out",transform:"translate3D(0px, "+t+"px, 0px)"})}function D(e){e?s=setInterval(E,10):clearInterval(s)}function E(){var e,t,i;void 0!==r&&r&&((e=Math.floor((n.position().top+o*r)/(o*u.list.length)*-1))!==g&&(0===n.children("."+m+'_stripe[data-id="'+e+'"]').length&&((t=l.clone()).css("top",e*(o*u.list.length)+"px"),t.attr("data-id",e),n.append(t)),n.children("."+m+"_stripe").each((function(e,t){i=n.position().top+$(t).position().top,(Math.ceil(i+o*u.list.length)<-o||i>o)&&$(t).remove()})),g=e))}function k(e,t){void 0===t&&(t=!0),n.off("transitionend",S),D(!1),r=-1;var i=L(n),a=Math.round(i/o)*o,s=i-a,l=Math.round(a/o%u.list.length),c=(l=l<=0?Math.abs(l):u.list.length-l)-e;u.mode===OGX.Roulette.MODE_CLOSEST&&c>u.list.length/2&&(c=-1*(u.list.length-l+e));var d=i+c*o-s,h=20*Math.round(Math.abs(c*o)*u.time_coef);D(!0),n.on("transitionend",S),t?n.css({transition:"all "+h+"ms ease-out",transform:"translate3D(0px, "+d+"px, 0px)"}):n.css({transition:"none",transform:"translate3D(0px, "+d+"px, 0px)"}),p=e}function S(){D(!1),n.off("transitionend",S)}function T(){for(var e="",t="",a=0;a<2;a++){t+='<div class="'+m+'_stripe" style="top:'+a*(u.list.length*o)+'px;" data-id="'+a+'">';for(var r=0;r<u.list.length;r++){switch(_){case"string":e=OGX.Templater.make(u.display.html(),{label:u.list[r]});break;case"object":e=u.display.html(u.list[r])}t+='<div class="'+m+"_block "+u.display.css(u.list[r])+'" style="height:'+o+"px; line-height:"+o+'px;" data-ogx-id="'+r+'">'+e+"</div>"}t+="</div>"}d.observeOnce(null,(()=>{o=i.height(),l=(l=n.children("."+m+"_stripe").last()).detach();var e=p*o*-1;n.css({transition:"none",transform:"translate3D(0px, "+e+"px, 0px)"})})),n.html(t)}function L(e){var t=0,i=e.css("transform");return"none"!==i&&(i=i.split(",")).length>5&&(t=Number(e.css("transform").split(",")[5].split(")")[0])),t}function M(e,t){switch(_){case"string":return{index:u.list.indexOf(t)};case"object":return u.list.findIndex(e,t)}}function N(e){e?(c.on("blur",(function(){c.val("")})),c.on("keypress",(function(e){13===e.which&&c.val("")})),OGX.Form.bindField({el:d.selector+" .ogx_roulette_input",input_cb:e=>{d.onInput(e.value);var t={};t[u.keys.search]={regex:new RegExp("^"+e.value,"i")};var i=u.list.get(t,{},1);if(i){d.el.find(".ogx_roulette_container").removeClass("ogx_hidden");var n=M(u.keys.search,i[u.keys.search]);if(Math.abs(p-n.index)>u.max_slide){var o=1;p>n.index&&(o=-1),k(n.index-o*u.max_slide,!1)}n.index!==p&&(d.val(i[u.keys.value],!0),u.name&&(O(!1),d.el.children('input[name="'+u.name+'"]').trigger("change"),O(!0)))}else d.el.find(".ogx_roulette_container").addClass("ogx_hidden")}})):OGX.Form.unbindField(d.selector+" .ogx_roulette_input")}function A(){u.list.length>0&&!u.list.hasOwnProperty("insert")&&(u.list=new OGX.List(u.list)),"string"==typeof u.list[0]&&(_="string"),1===u.list.length&&(u.list[1]=u.list[0])}this.construct=function(){u.name&&O(!0)},this.onFocus=function(){return i.removeClass(m+"_disabled"),u.icon&&x(!0),this},this.onBlur=function(){i.addClass(m+"_disabled"),u.icon&&x(!1),D(!1)},this.bindFilter=function(e,t,i){return u.list.removeFilter(e),u.list.addFilter(e,t,i),u.list.filter(),setTimeout(T,0),this},this.bindValue=this.val,this.bindRender=function(e,t){},this.destroy=function(){u.name&&O(!1),u.search?N(!1):this.touch.wipe()},this.onChange=function(){},this.onInput=function(){},this.val=function(e,t){if(void 0!==e){var i=v(e);return i>-1&&(k(i),u.name&&y(e,!1)),void 0!==t&&t&&(this.onChange(e),this.el.trigger(OGX.Roulette.CHANGE,[e])),this}switch(_){case"string":return u.list[p];case"object":return u.list[p][u.keys.value]}},this.selection=function(){switch(_){case"object":return u.list[p]}return null},this.list=function(e,t){return u.value=t,u.list=e,A(),p=void 0===t?0:M(u.keys.value,t).index,setTimeout(T,0),this},this.item=function(){return u.list[p]},this.loopval=function(e,t,i){var a=p,r=M(u.keys.value,t).index;r>-1&&(p=r);var s=a-r,l=u.time_coef*Math.abs(s+e*u.list.length);return D(!0),n.css({transition:"all "+l+"s ease-out",transform:"translate3D(0px, "+(L(n)+(s*o-u.list.length*o*e))+"px, 0px)"}),n.on("transitionend",S),u.name&&y(t,i),void 0!==i&&i&&(this.onChange(val),this.el.trigger(OGX.Roulette.CHANGE,[val])),this},this.next=function(e){var t,i=w(1);switch(r=1,_){case"string":t=i;break;case"object":t=i[u.keys.value]}return this.val(t),void 0!==e&&e&&(this.onChange(t),this.el.trigger(OGX.Roulette.CHANGE,[t]),u.name&&this.el.children('input[name="'+u.name+'"]').trigger("input")),this},this.prev=function(e){var t,i=w(-1);switch(_){case"string":t=i;break;case"object":t=i[u.keys.value]}return this.val(t),void 0!==e&&e&&(this.onChange(t),this.el.trigger(OGX.Roulette.CHANGE,[t]),u.name&&this.el.children('input[name="'+u.name+'"]').trigger("change")),this},this.setData=function(e,t){return this.list(e,t)},function(){if(u.key&&(u.keys.label="label",u.keys.search="label",u.keys.value=u.key,delete u.key),OGX.Data.merge(u,h),OGX.Data.merge(u.keys,f),t={template:!1,html:'<span class="ogx_roulette_block_label">{{$'+u.keys.label+"}}</span>",css:!1},u.callbacks.change&&(d.onChange=u.callbacks.change),u.callbacks.input&&(d.onInput=u.callbacks.input),A(),u.display?u.display=new OGX.Display(u.display):u.display=new OGX.Display(t),(i=d.el).addClass(m),i.width(),o=i.height(),u.list.length){var e=i.parent();e[0].hasAttribute("data-value")&&(u.value=OGX.Data.stringToVal(e.data("value")),e.removeAttr("data-value")),null===u.value&&(u.value=u.list[0],"object"==typeof u.value&&(u.value=u.value.value)),p=M(u.keys.value,u.value).index}}(),function(){var e="";if(u.search&&(e+='<input type="text" class="'+m+'_input">'),e+='<div class="'+m+'_container"><div class="'+m+'_stripes"></div></div>',u.icon&&(e+='<div class="'+m+'_icon"></div>'),void 0===p&&(p=0),u.name){var t="";switch(u.required&&(t=" required"),_){case"string":e+='<input type="hidden" name="'+u.name+'" value="'+u.list[p]+'" '+t+">";break;case"object":e+='<input type="hidden" name="'+u.name+'" value="'+u.list[p][u.keys.value]+'" '+t+">"}}i.html(e),n=i.children("."+m+"_container").children("."+m+"_stripes").first(),u.search?(c=d.el.find('input[type="text"]').first(),u.search&&N(!0)):d.touch.add("Swipe",{x:!1,y:!0,cb_down:G,cb_swipe:X,cb_up:C,target:'.ogx_roulette[data-ogx-id="'+d.id+'"] .ogx_roulette_container',capture:u.capture}),T()}()},OGX.Roulette.CHANGE="RouletteChange",OGX.Roulette.MODE_REWIND="RouletteModeRewind",OGX.Roulette.MODE_CLOSEST="RouetteModeClosest",OGX.Roulette.BIND=OGX.Roulette.CHANGE,require("RouletteTree","Uxi"),OGX.RouletteTree=function(e){construct(this,"RouletteTree");var t,n,o=this,a=e,r={groups:!1,data:!1,value:!1,required:!1},s=!1;function l(e){e?t.on(OGX.Roulette.CHANGE,d):t.off(OGX.Roulette.CHANGE,d)}function c(){for(var e,t=0;t<s.length;t++)t>0&&(e=s[t-1].roulette.val()),0===t||t-1>=0&&null!==e&&String(e).length>0?s[t].roulette.enable():t>0&&s[t].roulette.disable()}function d(e,o){e.stopImmediatePropagation();var a,r=$(e.target).data("ogx-id"),l=s.findIndex("id",String(r)),c=s[l.index].roulette.item().hasOwnProperty("head");if(n=l.index,l.index+1<s.length)for(i=l.index+1;i<s.length;i++)c?(s[i].roulette.val(""),s[i].roulette.disable()):(a=u(i-1,s[i-1].roulette.val()),s[i].roulette.list(a,a[0].value),i===l.index+1?s[i].roulette.enable():s[i].roulette.disable());var d=h(n);t.trigger(OGX.RouletteTree.CHANGE,d),c&&!n&&(n=-1)}function u(e,t){for(var i=[],n=0;n<e+1;n++)i.push(s[n].roulette.val());return _(i)}function h(e){if(void 0===e&&(e=s.length),e<0)return!1;for(var t={},i=0;i<e+1;i++)t[a.groups[i]]=s[i].roulette.val();return t}function f(e){for(var t,i=[],o=0;o<a.groups.length;o++)e.hasOwnProperty(a.groups[o])&&(t=e[a.groups[o]],String(t).length&&(!isNaN(t)&&(t=String(t)),s[o].roulette.val(t),n=o,o>0&&s[o].roulette.list(_(i),t),i.push(t)));setTimeout(c,0)}function _(e){for(var t=a.data,i=0;i<e.length;i++)e[i].length&&(t=t[e[i]]);var n=[{label:a.groups[e.length],value:""}];for(var o in t)n.push({label:o,value:o});return n}this.onFocus=function(){return s&&(c(),l(!0)),this},this.disable=function(){return s&&l(!1),this},this.val=function(e){if(void 0===e)return n>-1?h(n):{};f(e)},a=OGX.Data.merge(a,r),(t=o.el).addClass("ogx_roulette_tree"),o.observeOnce({childList:!0},(function(){setTimeout((()=>{a.value?f(a.value):c()}),10)})),function(){s=new OGX.List;var e,i,n=0;!function r(l,c){var d;if(!Array.isArray(l)&&"object"==typeof l){if(c>n){for(var u in n=c,t.append('<div class="ogx_roulette_tree_roulette" data-ogx-roulette="'+c+'"></div>'),i=a.groups[c-1],e=[{label:i,value:"",head:!0}],l)e.push({label:u,value:u});d=o.create("Roulette",{el:'.ogx_roulette_tree[data-ogx-id="'+o.id+'"] .ogx_roulette_tree_roulette[data-ogx-roulette="'+c+'"]',list:e,icon:a.icon,value:null,name:i,enabled:!1,required:a.required}),s.push({roulette:d,group:i,id:d.id})}if(c<a.groups.length)for(var u in l)r(l[u],c+1)}}(a.data,1)}(),n=-1},OGX.RouletteTree.CHANGE="RouletteTreeChange",OGX.RouletteTree.BIND=OGX.RouletteTree.CHANGE,OGX.Router=function(__config){"use strict";var that=this,config_default={options:{history:!0,bookmark:!0,jail:!0,cache:!1,eval:!1,idle:!1,hide_window:!0,hide_popup:!1},cache:!1,errors:{403:!1,404:!1},routes:{}},options_default={history:!0,reload:!1,data:null},rewrite_default={qsa:!1,url:null},route_default={enabled:!0,oml:null},config=__config;for(var route in OGX.Data.merge(config,config_default,!1),OGX.Data.merge(config.options,config_default.options,!1),OGX.Data.merge(config.errors,config_default.errors,!1),config.routes)OGX.Data.merge(config.routes[route],route_default,!1);var page=window.location.pathname.split("/").slice(-1)[0],locked=!1,global_url=null,route=null,request=null,route_rendered=!1,isCached=!1,cache=new OGX.List,gate=null,blured=!1,time=0,init_url=window.location.hash.slice(3);function urlToQSA(e){var t,i=e.split("?").pop().split("&"),n={};return i.forEach((e=>{t=e.split("="),n[t.shift()]=t.pop()})),n}function isCachable(e){return!(!config.options.cache||!e.route.hasOwnProperty("cache")||!1===e.route.cache)}function cacheExpired(e){var t=getCache(e);if(!t)return!0;var i=0;return"once"===config.options.cache||(!0!==config.options.cache||!0!==e.route.cache&&0!==e.route.cache)&&(!e.route.hasOwnProperty("cache")||!1===e.route.cache||(!0===e.route.cache&&"boolean"!=typeof config.cache&&(i=config.options.cache),"boolean"!=typeof e.route.cache&&(i=e.route.cache),Math.round((new Date).getTime()/1e3)>t.time+i))}function doCache(e){var t=getStageDefault(OGX.Core.getStage());if(t){t.uxi.detach();var i={url:e.url,uxi:t.uxi,time:Math.round((new Date).getTime()/1e3)};cache.insert(i)}}function unCache(e){var t=getCache(e);t&&(t.uxi.kill(),cache.findDelete("url",e.url,1))}function useCache(e){var t=getCache(e);if(t){isCached=!0;var i=OGX.Core.getStage();t.uxi.attach(i,$(i.pholder)),cache.findDelete("url",e.url,1),route=e}}function getCache(e){return cache.get({url:{eq:e.url}},null,1)}function findRoute(e,t){var i,n,o,a;void 0===t&&(t=!0);var r,s,l=[];for(var c in r=t?OGX.Data.clone(config.routes):config.routes){for(l=[],s=r[c],o=c;n=/(?!\/)([a-z0-9_\-]+)\:([^\/]+)/gi.exec(o);)o=o.replace(n[0],n[2]),l.push(n[1]);if((i=e.match("^"+o.replace("/","\\/")+"$"))&&i.length){i.shift(),"string"==typeof s.oml&&(s.oml=OGX.Data.clone(OGX.Cache.read("oml",s.oml))),a={};for(var d=0;d<i.length;d++)a[l[d]]=i[d];return{stage:e.split("/").shift(),route:s,data:a,pattern:c}}}return!1}function clearStage(e){var t=getStageDefault(e);t&&(t.uxi.kill(),t.pl.empty())}function getStageDefault(e){var t=e.selector+" "+e.pholder,i=$(t),n=OGX.Core.cfind(null,String(i.find(".ogx_uxi").first().data("ogx-id")));return!!n&&("Scroller"===n._NAME_&&(n=n.parent),{uxi:n,pl:i})}function onCordovaBackButton(e){e.preventDefault(),e.stopImmediatePropagation(),locked||(navigator.app.backHistory(),setTimeout((()=>{OGX.Core.el.trigger(OGX.Router.BACK,url)}),10))}function onPopState(e){if(locked)return history.forward(),!1;if(that.onpopstate&&that.onpopstate(e.originalEvent.state.url))OGX.Core.getStage().url=e.originalEvent.state.url;else{if(config.options.hide_popup){var t=OGX.Core.gather("Popup").get({visible:!0,blured:!1},null,1);if(t)return t.parent.hasOverlay()&&t.parent.removeOverlay(),OGX.Core.removePopup(t.id,!1),void history.forward()}if(config.options.hide_window){var i=OGX.Core.gather("Window").get({visible:!0,blured:!1},null,1);if(i)return i.hide(),void history.forward()}if(null!==e.originalEvent.state)OGX.Core.el.trigger(OGX.Router.BACK,e.originalEvent.state.url),that.goto(e.originalEvent.state.url,{history:!1});else if(-1!==window.location.href.indexOf("#")){var n=window.location.href.split("#!/").pop();OGX.Core.el.trigger(OGX.Router.BACK,n),that.goto(n,{history:!1})}}}function captureLink(e){var t=e.originalEvent,i=$(this),n=i.attr("href"),o=i.attr("download");if(0===n.indexOf("/")&&void 0===o){if(e.preventDefault(),e.stopImmediatePropagation(),n=n.slice(1),t.ctrlKey||t.shiftKey||t.metaKey||t.button&&1==t.button)return config.options.jail?($(document).trigger(OGX.Router.GOTO,n),void setTimeout((()=>{that.goto(n)}),0)):(n=window.location.protocol+"//"+window.location.host+"/app#!/"+n,window.open(n,"_blank").focus());$(document).trigger(OGX.Router.GOTO,n);var a=!1,r=!0;i[0].hasAttribute("data-reload")&&(a=i.data("reload")),i[0].hasAttribute("data-history")&&(r=i.data("history")),setTimeout((()=>{that.goto(n,{reload:a,history:r})}),0)}}function onFocus(){blured=!1;var e=0;config.options.idle&&"boolean"!=typeof config.options.idle&&(e=config.options.idle),route.route.hasOwnProperty("idle")&&route.route.idle&&(e=route.route.idle),route&&time&&e&&(new Date).getTime()-time>1e3*e&&(that.uncache(request.url),that.goto(route.url,{reload:!0,history:!1}))}function onBlur(){blured=!0,time=(new Date).getTime()}function handleVisibilityChange(){"visible"===document.visibilityState?onFocus():onBlur()}this.onpopstate=null,this.url=function(){return global_url},this.start=function(){$(document).on("backbutton",onCordovaBackButton),$(window).on("popstate",onPopState)},this.stop=function(){$(document).off("backbutton",onCordovaBackButton),$(window).off("popstate",onPopState)},this.enable=function(e){return!!config.routes.hasOwnProperty(e)&&(config.routes[e].enabled=!1,!0)},this.disable=function(e){return!!config.routes.hasOwnProperty(e)&&(config.routes[e].enabled=!1,!0)},this.lock=function(){locked=!0},this.unlock=function(){locked=!1},this.reload=function(){var e=this.request();return this.goto(e.url,{history:!1,reload:!0}),this},this.gate=function(e){gate=e},this.isLocked=function(){return locked},this.cache=function(e){var t=findRoute(request.url,!1);t.route.cache=e,route_rendered&&(route.route.cache=t.route.cache)},this.getCache=function(e){return getCache({url:e})},this.cacheOnce=function(){var e=findRoute(request.url,!1);e.route.cache="once",route_rendered&&(route.route.cache=e.route.cache)},this.uncache=function(e){var t=findRoute(e,!1);t&&(route.route.cache=t.route.cache=!1,cache.findDelete("url",e,1))},this.isCached=function(){return isCached},this.add=function(e,t,i){if(void 0===i&&(i=!0),void 0===t&&(t=config.options.history),t){var n={url:e};history.pushState(n,"title"+(new Date).getTime(),page+"#!/"+e),global_url=e}i&&(OGX.Core.getStage().url=e)},this.request=function(){return request.origin?request.window=!1:request.window=init_url,request},this.expire=function(e){var t=getCache({url:e});t&&unCache(t)},this.gather=function(e){void 0===e&&(e=null),"string"==typeof e&&(e=new RegExp(e));var t=[],i=!1;for(var n in config.routes)i=!1,config.routes[n].hasOwnProperty("scope")?OGX.Scope.eval(config.routes[n].scope)&&(i=!0):i=!0,i&&(e&&(i=n.match(e)),i&&t.push(n));return t},this.goto=function(__url,__options,__cb){if(isCached=!1,!locked){void 0===__cb&&(__cb=null),void 0!==__options&&__options||(__options={}),OGX.Data.merge(__options,options_default);var qsa_str=null,qsa_obj=null;if(-1!==__url.indexOf("?")){var arr=__url.split("?"),url=arr.shift();qsa_str=arr.pop(),qsa_obj=urlToQSA(__url),__url=url}var r=findRoute(__url);if(request.url=__url,request.origin=global_url,r){if(!r.route.enabled)return void history.forward();request.route=r,stage=OGX.Core.getStage(),stage||(OGX.Core.showStage(r.stage),stage=OGX.Core.getStage()),r.route.hasOwnProperty("reload")&&(__options.reload=r.route.reload),r.route.hasOwnProperty("scope")||(r.route.scope="public");var access=!0;if(OGX.Scope.eval(r.route.scope)||(access=!1),config.options.eval){var fnc=eval(config.options.eval);if(fnc){var res=fnc(r);res||(access=!1)}}if(!access)return config.errors.hasOwnProperty("403")?setTimeout((()=>{OGX.Core.goto(config.errors[403],{history:!0})}),0):$(document).trigger(OGX.Router.FORBIDDEN,{url:__url,scope:r.route.scope}),!1;if(delete r.route.scope,r.route.hasOwnProperty("origin")){for(var valid=!1,origins=r.route.origin.split(","),reg,i=0;i<origins.length;i++){if("null"===origins[i]&&!global_url){valid=!0;break}if("self"===origins[i]){if(reg=r.pattern.replace(/([a-z]+:)/,""),RegExp(reg).test(global_url)){valid=!0;break}}else if(0===global_url.indexOf(origins[i])){valid=!0;break}}if(!valid)return;delete r.route.origin}if(gate){if(!gate(__url,__options))return;gate=null}if(r.route.hasOwnProperty("rewrite"))return void 0===r.route.options&&(r.route.options={}),OGX.Data.merge(r.route.options,options_default),r.route.rewrite=OGX.Data.merge(r.route.rewrite,rewrite_default,!1,!0),r.route.rewrite.qsa&&(r.route.rewrite.url+="?"+qsa_str),r.route.options.history&&that.add(__url,r.route.options.history,!1),void that.goto(r.route.rewrite.url);qsa_obj&&(r.data=qsa_obj,__url+="?"+qsa_str),route&&isCachable(route)&&route_rendered&&!__options.reload&&doCache(route),r.url=__url;var pattern=r.pattern,stage=OGX.Core.getStage(),render=!0,same=r.stage===stage.id;if(stage&&!same&&(stage=OGX.Core.cfind("Stage",r.stage)),qsa_obj&&(__options.reload=!0),stage.url!==r.url||stage.url===r.url&&__options.reload?clearStage(stage):(render=!1,__options.history=!1),same||(OGX.Core.showStage(r.stage),stage=OGX.Core.getStage(r.stage)),stage.pattern=pattern,__options.history?this.add(__url,__options.history):(stage.url=__url,global_url=__url),config.options.cache&&cache.length&&isCachable(r)){var c=getCache(r);if(c){var cache_valid=!cacheExpired(r);if(cache_valid)return useCache(r),!0;unCache(r)}}return route=r,render?(route_rendered=!1,void 0===r.route.oml?(r.route.oml={},__cb&&__cb(),route_rendered=!0):stage.observeOnce(null,(()=>{__cb&&__cb(),route_rendered=!0})),OGX.OML.render(stage,r.route.oml,__options.data,r.data)):(__cb&&__cb(),route_rendered=!0),time=(new Date).getTime(),!0}return config.errors[404]?setTimeout((()=>{OGX.Core.goto(config.errors[404],{history:!0})}),0):$(document).trigger(OGX.Router.NOT_FOUND,{url:__url}),!1}return!1},this.init=function(){request={route:null,url:global_url,origin:global_url};var e=null;e=-1===window.location.href.indexOf("#")?config.index:window.location.href.split("#!/").pop(),request.url=e;var t=findRoute(e);t?request.route=t:config.errors[404]?(t=findRoute(config.errors[404]),request.route=t):$(document).trigger(OGX.Router.NOT_FOUND,{url:e});var i=that.request();i.window&&config.options.bookmark||(i.window=config.index),that.goto(i.window,{history:config.options.history}),$(document).on("click touchstart mousedown","a",captureLink),config.options.idle&&$(document).on("visibilitychange",handleVisibilityChange)}},OGX.Router.BACK="RouterBack",OGX.Router.EXIT="RouterExit",OGX.Router.GOTO="RouterGoto",OGX.Router.FORBIDDEN="403",OGX.Router.NOT_FOUND="404",OGX.Scope=function(e){"use strict";var t="public",i=!1,n=e;this.CHANGE="ScopeChange",this.scope=function(e){return void 0===e?t:n?($(document).trigger(OGX.Scope.CHANGE),!1):(t=e,!0)},this.token=function(e,n){if(void 0===e)return!!i;var o=function(e){var t=JSON.parse(atob(e.split(".")[1]));if(t)return t;return!1}(e);return!(!o||o.iss!==n)&&(i=e,t=o.scope,$(document).trigger(OGX.Scope.CHANGE),!0)},this.eval=function(e,i){void 0===i&&(i=t),Array.isArray(e)&&(e=e.join(" ")),e=function(e){if(!e.match(/^\/\^?/))return e;for(var i,n=e.split(" "),o=0;o<n.length;o++)n[o].match(/^\/\^?/)&&(i=(i=(i=n[o].trim()).replace(/^\/\^?/,"")).replace(/\$?\/$/,""),i=new RegExp(i,"g"),e=t.match(i)?e.replace(n[o],"1"):e.replace(n[o],"0"));return e}(e);var n=i;"string"==typeof n&&(n=n.split(" "));var o=e.match(/(?!0|1)([a-z0-9_]+)/gi);if(o&&o.length)for(var a=0;a<o.length;a++)e=n.includes(o[a])?e.replace(o[a],"1"):e.replace(o[a],"0");e=e.replace(/ /g,"|");try{var r=new Function("return "+e+";")();return"number"==typeof r&&r>0}catch(e){}return!1},this.fork=function(e){for(var t in e)if(this.eval(t))return e[t];return!1}},require("Scroller","Uxi","Placeholder","Touch"),OGX.Scroller=function(e){construct(this,"Scroller");var t,i,n,o,a,r,s,l,c,d,u=this,h=e,f=(h=OGX.Data.merge(e,{check_delay:30,fade_delay:300,css:!1,zindex:9999,observe:!0,auto_scroll:!1,trigger:!0,content:!1,overflow:!0,callbacks:{down:null,up:null,scroll:null,top:null,bottom:null}}),0),_="init",g=!1,p=!1,m=null,v=0,y=0;function x(e){e?i.on(u.touch.down,O):i.off(u.touch.down,O)}function O(e){e=u.event(e),u.onDown(),S(!1),G(!0),b(!0),x(!1),T("in"),E(!0)}function b(e){e?(c=setInterval(D,10),i.on(u.touch.move,w)):(clearInterval(c),i.off(u.touch.move,w))}function w(e){e=u.event(e)}function G(e){e?$(document).on(u.touch.up,X):$(document).off(u.touch.up,X)}function X(){u.onUp(),b(!1),G(!1),x(!0),E(!1),T("out")}function C(e){e?(window.addEventListener("resize",N),i.on("scroll",(function(e){e.stopImmediatePropagation(),D()})),i.on("wheel",(function(e){E(!0)})),void 0!==OGX.NestedList&&$(document).on(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED,(function(){u.update()}))):(window.removeEventListener("resize",N),i.off("scroll"),i.off("wheel"),void 0!==OGX.NestedList&&$(document).off(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED))}function D(){var e,n=(e=i.scrollTop())/s,o=Math.floor(Math.abs(i.outerHeight(!0)-t.outerHeight(!0)));a.css("top",n+"px");var r=v,l=0;if((v=Math.round(100*e/o*10)/10)<r?l=-1:v>r&&(l=1),h.trigger&&!g){if(l){var c={top:e,percent:v,dir:l};e>0&&e<o&&(u.onScroll(u,c),u.el.trigger(OGX.Scroller.SCROLL,c))}v>=100?(u.onBottom(u),u.el.trigger(OGX.Scroller.BOTTOM)):0===e&&(u.onTop(u),u.el.trigger(OGX.Scroller.TOP))}}function E(e){e?(l&&E(!1),y=t.position().top,l=setInterval(k,h.check_delay-10)):(l&&(clearInterval(l),l=null),p=!1,u.el.trigger(OGX.Scroller.END))}function k(){var e=t.position().top;e!==y?(p||(p=!0,u.el.trigger(OGX.Scroller.START)),T("in")):T("out"),y=e}function S(e){e?d=setInterval(D,h.check_delay):clearInterval(d)}function T(e){a.hasClass("ogx_scroller_track_anim")||a.addClass("ogx_scroller_track_anim"),"in"===e?(clearTimeout(m),m=null,a.addClass("ogx_scroller_track_anim_fade_in").removeClass("ogx_scroller_track_anim_fade_out")):m||(m=setTimeout((()=>{a.addClass("ogx_scroller_track_anim_fade_out").removeClass("ogx_scroller_track_anim_fade_in")}),h.fade_delay))}function L(e){e?u.observeSize(!0,M,null,t):u.observeSize(!1)}function M(){var e=t.height();f!==e&&(f=e,N(),h.auto_scroll&&u.bottom())}function N(){if(o=i.innerHeight(),n=t.height(),s=n/o,n>o){var e=Math.round(o/s);a.css("height",e+"px"),r.css("display","block")}else r.css("display","none");"init"===_&&(_=OGX.Scroller.READY,u.el.trigger(OGX.Scroller.READY))}this.onFocus=function(){return N(),C(!0),h.observe&&setTimeout((()=>{L(!0)}),0),x(!0),y&&i.scrollTop(Math.abs(y)),this},this.onBlur=function(){return C(!1),h.observe&&L(!1),G(!1),b(!1),x(!1),E(!1),S(!1),a.removeClass("ogx_scroller_track_anim_fade_in"),a.removeClass("ogx_scroller_track_anim_fade_out"),this},this.onResize=function(){return N(),this},this.destroy=function(){u.el.removeClass("ogx_scroller_outer"),t.remove(),r.remove()},this.onDown=function(){h.callbacks.down&&h.callbacks.down(u)},this.onUp=function(){h.callbacks.up&&h.callbacks.up(u)},this.onScroll=function(){h.callbacks.scroll&&h.callbacks.scroll(u)},this.onTop=function(){h.callbacks.top&&h.callbacks.top(u)},this.onBottom=function(){h.callbacks.bottom&&h.callbacks.bottom(u)},this.overflow=function(e){if(void 0===e)return h.overflow;h.overflow!==e&&(h.overflow=e,e?(this.onFocus(),this.el.removeClass("ogx_scroller_no_overflow")):(this.onBlur(),this.el.addClass("ogx_scroller_no_overflow")))},this.overflows=function(){return!(n<=o)&&n-o},this.top=function(){return n>o&&(i[0].scrollTop=0,N()),this},this.bottom=function(){return n>o&&(i.scrollTop(n),N()),this},this.isTopped=function(){return 0===i[0].scrollTop},this.isBottomed=function(){return 100===v},this.max=function(){return t.height()-i.height()},this.scroll=function(e){return void 0===e?i[0].scrollTop:(i[0].scrollTop=e,N(),this)},this.mute=function(){return g=!0,this},this.vocal=function(){return g=!1,this},this.container=function(){return t},this.inner=function(){return t[0]},this.outer=function(){return i[0]},this.state=function(){return _},this.percent=function(){return v},u.placeholders(h,['.ogx_scroller_outer[data-ogx-id="'+h.id+'"] > .ogx_scroller_inner']),function(){u.el=$(h.el),u.el.addClass("ogx_scroller_outer ogx_hw"),(i=u.el).html('<div class="ogx_scroller_inner ogx_hw"></div>'),t=i.children(".ogx_scroller_inner"),h.content&&t.append(h.content);var e='<div class=ogx_scroller_track ogx_hw" style="z-index:'+h.zindex+';" data-ogx-scroller="'+u.id+'"><div class="ogx_scroller_track_button" data-ogx-scroller="'+u.id+'"></div></div>';i.parent().append(e),r=i.parent().find(".ogx_scroller_track"),a=r.find(".ogx_scroller_track_button")}(),N()},OGX.Scroller.READY="ScrollerReady",OGX.Scroller.TOP="ScrollerTop",OGX.Scroller.BOTTOM="ScrollerBottom",OGX.Scroller.SCROLL="ScrollerScroll",OGX.Scroller.START="ScrollerStart",OGX.Scroller.END="ScrollerEnd",OGX.Splash=function(e){"use strict";var t=this,i=e,n=0,o=0,a=null,r=!1,s='<div id="ogx_splash" class="ogx_splash" style="background-color:'+i.color+'"><span class="ogx_splash_content"><span class="ogx_splash_image" style="background-image:url('+i.image+');"></span><span class="ogx_splash_progress"><span class="ogx_splash_bar"></span></span></span></div>';$("body").append(s);var l=$("#ogx_splash");function c(){r=!0,$(document).off(OGX.App.READY,c),i.auto_hide&&(a=setTimeout((()=>{OGX.Core.splash.hide()}),i.hide_timeout))}function d(e){document.hidden?i.auto_hide&&a&&(clearTimeout(a),a=null):r&&i.auto_hide&&(t.show(),a=setTimeout((()=>{OGX.Core.splash.hide()}),i.hide_timeout))}this.show=function(){l.addClass("ogx_splash_show")},this.hide=function(e){l&&(l.hasClass("ogx_splash_show")?(l.on("transitionend",(function(){l&&(l.off("transitionend").remove(),l=null,e())})),l.removeClass("ogx_splash_show")):(l.remove(),e()))},this.destroy=function(){$(document).off("visibilitychange",d),$(document).off(OGX.App.READY,c)},$(document).on("NET_LOAD_START",(function(e,t){$(document).off(OGX.Net.LOAD_START),n=t})),$(document).on("NET_LOAD_SUCCESS",(function(e,t){o++;var i=Math.round(100*o/n);$("#ogx_splash .ogx_splash_bar").css("width",i+"%"),n===o&&$(document).off(OGX.Net.LOAD_SUCCESS)})),$(document).on("visibilitychange",d),$(document).on(OGX.App.READY,c),setTimeout(this.show,200)},OGX.Splash.DONE="SplashDone",require("StackedTree","Uxi","Touch"),OGX.StackedTree=function(e){construct(this,"StackedTree");var t,i,n,o,a=this,r={scope:["public"],speed:200,list:[],display:{html:"{{$label}}",css:""},displays:!1,chromeos:!1},s=e,l=[],c=[0],d=0,u=!1,h="ogx_stacked_tree";function f(e){e>0&&g(new CustomEvent("event"),f)}function _(e){e?(t.on(a.touch.down,".ogx_stacked_tree_level .ogx_stacked_tree_level_prev",g),t.on(a.touch.down,".ogx_stacked_tree_level_list .ogx_dynamic_list_item",(function(e){var t=$(this).data("ogx-id");t--,function(e,t){u=t;var i=l[d].findIndex("__id__",t.__id__);t.hasOwnProperty("items")&&t.items.length&&function(e){if(!e.hasOwnProperty("scope"))return!0;for(var t=0;t<s.scope.length;t++)if(-1!==e.scope.indexOf(s.scope[t]))return!0;return!1}(t)?(c.push(i),v(d+1,t.items),a.el.trigger(OGX.StackedTree.ENTER,[t,a]),setTimeout((()=>{y(d+1)}),0)):a.el.trigger(OGX.StackedTree.SELECT,[t,a])}(0,l[d].val()[t])}))):(t.off(a.touch.down,".ogx_stacked_tree_level .ogx_stacked_tree_level_prev",g),t.off(a.touch.down,".ogx_stacked_tree_level_list .ogx_dynamic_list_item"))}function g(e,t){e.preventDefault(),e.stopImmediatePropagation(),y(d-1,!0,t),c.pop(),a.el.trigger(OGX.StackedTree.BACK,a)}function p(e){e?$(window).on("resize",m):$(window).off("resize",m)}function m(){i.removeClass(h+"_anim"),n=i.width(),i.css("transform","translateX("+d*Math.round(n/c.length)*-1+"px)")}function v(e,t){i.removeClass(h+"_anim").css("width",100*(e+1)+"%"),n=i.width();var r,c='<div class="'+h+'_level" data-level="'+e+'">';e>0&&(r=(r=o.css(u)).replace(h+"_door",""),c+='<div class="'+h+"_item ogx_stacked_tree_level_prev "+r+'">'+o.html(u)+"</div>"),c+='<div class="'+h+'_level_list"></div></div>',i.append(c),i.children("."+h+"_level").css("flex-basis",Math.floor(100/(e+1)*100)/100+"%"),function(e,t,i){l[e]&&a.remove(l[e].id,"DynamicList");var n=a.create("DynamicList",{el:t,mode:"static",scroll:!1,display:s.display,displays:s.displays,list:i});l[e]=n}(e,"."+h+'[data-ogx-id="'+a.id+'"] > .'+h+"_container > ."+h+'_level[data-level="'+e+'"] > .'+h+"_level_list",t)}function y(e,t,o){void 0===o&&(o=null),_(!1),i.addClass(h+"_anim"),i.on("transitionend",(function(){i.off("transitionend"),void 0!==t&&t&&(i.removeClass(h+"_anim").css("width",100*(e+1)+"%"),a.remove(l[e+1].id,"DynamicList"),l.splice(e+1,1),i.children("."+h+'_level[data-level="'+(e+1)+'"]').remove(),i.children("."+h+"_level").css("flex-basis",Math.floor(100/(e+1)*100)/100+"%"),n=i.width(),u=!1),d=e,o&&o(d),_(!0)})),n=i.width(),i.css("transform","translateX("+e*Math.round(n/c.length)*-1+"px)")}this.onFocus=function(){_(!0),p(!0)},this.onBlur=function(){_(!1),p(!1)},this.onResize=function(){return m(),this},this.destroy=function(){},this.val=function(e){if(e.length){var t=e.slice();return s.list={items:t},!0}return!1},this.scope=function(e){return void 0!==e?(s.scope=e,c=[0],d=0,u=!1,!0):s.scope},this.prev=function(){g(new CustomEvent("event"))},this.reset=function(){f(d)},function(){s=OGX.Data.merge(s,r,!1,!0);var e=(o=new OGX.Display(s)).val();if(e=function(e){if(e.display&&"object"==typeof e.display&&!e.display.hasOwnProperty("bind")&&(e.display=i(e.display)),e.displays)for(var t in e.displays)e.displays[t]=i(e.displays[t]);function i(e){if(e.hasOwnProperty("css"))if("object"==typeof e.css)e.css.hasOwnProperty("add")&&e.css.add?e.css.add+=" ogx_stacked_tree_item":e.css.add="ogx_stacked_tree_item";else{var t="";e.css&&(t=e.css),t+=" ogx_stacked_tree_item",e.css=t}else e.css="ogx_stacked_tree_item";return e}return e}(e),o.val(e),s.display=e.display,s.displays=e.displays,(t=a.el).addClass(h),s.list.length){var i=s.list.slice();s.list={items:i}}}(),t.html('<div class="'+h+'_container" style="width:100%"></div>'),i=t.children("."+h+"_container").first(),s.list.items.length&&v(c[0],s.list.items)},OGX.StackedTree.BACK="StackedTreeBack",OGX.StackedTree.ENTER="StackedTreeEnter",OGX.StackedTree.SELECT="StackedTreeSelect",require("Stage","Uxi","Placeholder","Touch"),OGX.Stage=function(e){construct(this,"Stage");var t=this,i=OGX.Data.merge({id:"stage",anim:null,group_watch:!1,always_on:!1},e,!0,!0);function n(e){e?t.el.on(t.touch.down,".ogx_stage_exit",(function(){OGX.Core.theater.show()})):t.el.off(t.touch.down,".ogx_stage_exit")}this.id=i.id,this.anim=i.anim,this.theater=!1,this.home=null,this.url=null,this.route=null,this.always_on=i.always_on,this.__proto__.onFocus=function(){return i.closeable&&n(!0),this},this.__proto__.onBlur=function(){return i.closeable&&n(!1),this},function(){i.hasOwnProperty("theater")&&(t.theater=i.theater),t.home=i.home;var e=new OGX.Display(i),n="block";i.hasOwnProperty("use")&&i.use||(n="none");var o="";i.closeable&&(o='<div class="ogx_stage_exit"></div>');var a=e.html();i.hasOwnProperty("data")&&(a=OGX.Templater.make(a,i.data)),o+=a,container=t.el,container.html(o),container.addClass("ogx_stage").css("display",n)}()},OGX.Stage.SWAP="swap",OGX.Stage.FLIP="flip",require("Switch","Uxi","Bind","Touch"),OGX.Switch=function(e){construct(this,"Switch");var t,i=this,n=e,o={el:"document",bind:!1,labels:!0,data:[{label:"OFF",value:!1},{label:"ON",value:!0}],value:!1,name:!1,callbacks:{change:null}},a="ogx_switch";function r(e){n.value===n.data[0].value?n.value=n.data[1].value:n.value=n.data[0].value,s(e)}function s(e){e=void 0!==e;var i=t.find("."+a+"_dot").first(),o=t.find("."+a+"_label").first(),r=t.find("."+a+"_label").last();n.value==n.data[0].value?(i.removeClass(a+"_dot_right").addClass(a+"_dot_left"),o.removeClass(a+"_label_off").addClass(a+"_label_on").addClass(a+"_selected"),r.removeClass(a+"_label_on").addClass(a+"_label_off").removeClass(a+"_selected")):(i.removeClass(a+"_dot_left").addClass(a+"_dot_right"),r.removeClass(a+"_label_off").addClass(a+"_label_on").addClass(a+"_selected"),o.removeClass(a+"_label_on").addClass(a+"_label_off").removeClass(a+"_selected")),n.name&&t.find('input[type="hidden"]').attr("value",n.value),e&&t.children("."+a+"_val").trigger("input")}function l(e){e?t.on(i.touch.down,c):t.off(i.touch.down,c)}function c(e){e.preventDefault(),e.stopImmediatePropagation(),r(),d(!1),i.onChange(n.value),t.trigger(OGX.Switch.CHANGE,[n.value]),t.children("."+a+"_val").trigger("input"),d(!0)}function d(e){e?t.on("change","input[type=hidden]",u):t.off("change","input[type=hidden]",u)}function u(e){e.preventDefault(),e.stopImmediatePropagation(),n.value=OGX.Data.stringToVal(e.target.value),s()}this.construct=function(){n.name&&d(!0)},this.onFocus=function(){return l(!0),t.removeClass(a+"_disabled"),this},this.onBlur=function(){return l(!1),t.addClass(a+"_disabled"),this},this.destroy=function(){n.name&&d(!1)},this.bindRender=function(e,t){},this.val=function(e,i){return void 0===i&&(i=!0),void 0!==e&&n.value!==e&&(r(),i&&t.children("."+a+"_val").first().trigger("input")),n.value},this.onChange=function(){},this.toggle=function(e){return r(e=void 0===e),this},function(){var e;void 0===n&&(n={}),n.hasOwnProperty("data")&&!n.hasOwnProperty("value")&&(e=n.data[0].value),OGX.Data.merge(n,o),void 0!==e&&(n.value=e),(t=i.el).addClass(a+"_disabled");var r=t.parent();r[0].hasAttribute("data-value")&&(n.value=OGX.Data.stringToVal(r.data("value")),r.removeAttr("data-value"))}(),function(){var e="";n.labels&&(e+='<span class="'+a+'_label_on ogx_switch_label">'+n.data[0].label+"</span>");var i="";n.value===n.data[1].value&&(i=a+"_dot_right"),e+='<div class="'+a+'_track"><div class="'+a+'_track_bg"></div><div class="'+a+"_dot "+i+'"></div></div>',n.labels&&(e+='<span class="'+a+'_label_off ogx_switch_label">'+n.data[1].label+"</span>"),n.name&&(e+='<input class="'+a+'_val" type="hidden" name="'+n.name+'" value="'+n.value+'"></div>'),t.html(e),t.addClass(a)}(),setTimeout(s,0)},OGX.Switch.CHANGE="SwitchChange",OGX.Switch.BIND=OGX.Switch.CHANGE,require("Tabs","Uxi","Touch"),OGX.Tabs=function(e){construct(this,"Tabs");var t,i=this,n=e,o={detach:!1,detach_min:-4,add:!0,remove:!0,reorder:!0,icons:!1,icon_path:"",index:0,list:new OGX.List,display:{html:"",css:""},callbacks:{select:null,close:null,add:null,remove:null}},a=!1,r=0,s=!1,l=!1,c=!1,d=!1,u=!1,h={x:0,y:0},f="ogx_tabs";function _(){r>0?r--:r=0,i.index(r)}function g(e){var t=!1;return"string"==typeof n.list[e]?t=n.list[e]:n.list[e].hasOwnProperty("label")&&(t=n.list[e].label),t}function p(){for(var e,i,o='<div class="'+f+'_container">',s=0;s<n.list.length;s++)i=n.display.css(n.list[s]),s===r&&(i+=" ogx_tabs_tab_active"),e=g(s),n.list[s].hasOwnProperty("enabled")&&!n.list[s].enabled&&(i+=" "+f+"_tab_disabled"),o+='<div class="'+f+"_tab "+i+'">',n.icons&&(o+='<span class="'+f+'_tab_icon" style="background-image:url('+n.icon_path+n.list[s].icon+')"></span>'),e&&(o+='<span class="'+f+'_tab_label">'+e+"</span>"),n.remove?o+='<span class="'+f+'_tab_close"></span>':o+='<span class="'+f+'_tab_grad"></span>',o+="</div>",i="";o+="</div>",n.add&&(o+='<div class="'+f+'_tab_add"></div>',t.addClass(f+"_editable")),t.html(o),a=t.children("."+f+"_container").children("."+f+"_tab:eq("+r+")")}function m(e){s||(u=!1,l=$(e),r=l.index(),c={from:r},t.children("."+f+"_container").children("."+f+"_tab_active").first().removeClass(f+"_tab_active"),h.x=l.position().left,h.y=l.position().top,(s={el:$(e).clone(),x:h.x,y:l.position().top}).w=l.width(),s.el.width(s.w),l.addClass(f+"_tab_active").addClass(f+"_frozen"),a=l,s.el.addClass(f+"_tab_active").addClass(f+"_float").css("transform","translate3d("+h.x+"px, "+s.y+"px, 0px)"),t.children("."+f+"_container").prepend(s.el),t.trigger(OGX.Tabs.SELECT,[n.list[r],{index:r}]),d=setInterval(y,5))}function v(e){if(s)if(u=e,Math.abs(u.distX)>Math.abs(u.distY)){var o=s.x+u.distX;s.el.css("transform","translate3d("+o+"px, "+s.y+"px, 0px)")}else{var a=s.y+u.distY;s.el.css("transform","translate3d("+s.x+"px, "+a+"px, 0px)");var r=s.el.offset();if(u.distY<n.detach_min){c.to=l.index(),x();var d=n.list[c.from];i.removeAt(c.to),i.onRemove(d),t.trigger(OGX.Tabs.REMOVE,[d,{index:c.to,x:r.left,y:r.top}])}}}function y(){var e,i,n;s&&u&&(idx=l.index(),Math.abs(u.distX)>Math.abs(u.distY)&&t.children("."+f+"_container").children("."+f+"_tab").each((function(t,o){(e=$(o)).hasClass(f+"_tab_active")||(i=e.position(),n=e.width(),idx!==t&&(s.x+u.distX>i.left+n/2&&s.x+u.distX<i.left+n?(l.detach(),e.after(l)):s.x+u.distX>i.left&&s.x+u.distX<i.left+n/2&&(l.detach(),e.before(l))))})))}function x(){if(s&&(clearInterval(d),d=!1,u=!1,s.el.remove(),s=!1,l.removeClass(f+"_frozen"),c.to=l.index(),c.to!==c.from)){var e=n.list.splice(c.from,1);n.list.insert(e[0],c.to),r=c.to,i.el.trigger(OGX.Tabs.REORDER,c)}}function O(e){e?(t.on(i.touch.down,"."+f+"_tab",b),n.add&&t.on(i.touch.down,".ogx_tabs_tab_add",w),n.remove&&t.on(i.touch.down,"."+f+"_tab_close",G)):(t.off(i.touch.down,"."+f+"_tab",b),n.add&&t.off(i.touch.down,"."+f+"_tab_add",w),n.remove&&t.off(i.touch.down,"."+f+"_tab_close",G))}function b(e){var o=$(this);o.hasClass(f+"_tab_disabled")||(a&&a.removeClass(f+"_tab_active"),o.addClass(f+"_tab_active"),r!==(a=o).index()&&(r=a.index(),i.onSelect(n.list[r]),t.trigger(OGX.Tabs.SELECT,[n.list[r],{index:r}])))}function w(e){i.addTab({label:"New tab"}),t.trigger(OGX.Tabs.ADD)}function G(e){e.preventDefault(),e.stopImmediatePropagation();var o=n.list[r];return t.trigger(OGX.Tabs.REMOVE,[o,{index:r}]),i.onClose(o),i.removeCurrent(),!1}this.onFocus=function(){return O(!0),n.reorder&&this.touch.get("tabs_hold").enable(),this},this.onBlur=function(){return O(!1),n.reorder&&this.touch.get("tabs_hold").disable(),this},this.empty=function(){return this.clear(),r=0,a=null,n.list=new OGX.List,t.empty(),this},this.destroy=function(){this.touch.wipe()},this.val=function(e){if(void 0===e)return n.list[r];var t;"string"==typeof e?t=n.list.indexOf(e):e.hasOwnProperty("label")&&(t=(t=n.list.findIndex("label",e.label)).index),this.index(t)},this.set=function(e){return void 0===e?n.list:(e.hasOwnProperty("insert")||(e=new OGX.List(e)),n.list=e,setTimeout(p,0),this)},this.onSelect=function(){},this.onClose=function(){},this.onAdd=function(){},this.onRemove=function(){},this.icons=function(e){if(void 0===e)return n.icons;n.icons=e},this.add=function(e){return n.icons&&(e.hasOwnProperty("icon")||(e.icon=n.icon_default)),n.list.push(e),r=n.list.length-1,setTimeout((()=>{var e,i,n;p(),e=t.width(),i=t.children("."+f+"_container").first(),(n=i.width())>e&&i.css("transform","translateX("+-1*(n-e)+"px)")}),0),this},this.addAt=function(e,t){return n.icons&&(e.hasOwnProperty("icon")||(e.icon=n.icon_default)),n.list.insert(e,t),r=t,setTimeout(p,0),this},this.remove=function(e,i){void 0===i&&(i=e,e="label");var o=n.list.findIndex(e,i);n.list.findDelete(e,i,1)&&(t.children("."+f+"_container").first().children("."+f+"_tab:eq("+o.index+")").remove(),_())},this.removeCurrent=function(){return a&&this.removeAt(r),this},this.removeAt=function(e){return n.list.delete(e)&&(t.children("."+f+"_container").first().children("."+f+"_tab:eq("+e+")").remove(),_()),this},this.enableTab=function(e){return t.children("."+f+"_container").first().children("."+f+"_tab:eq("+e+")").removeClass(f+"_tab_disabled"),this},this.disableTab=function(e){return t.children("."+f+"_container").first().children("."+f+"_tab:eq("+e+")").addClass(f+"_tab_disabled"),this},this.index=function(e){return void 0!==e?(a&&(a.removeClass(f+"_tab_active"),a=null),(a=t.children("."+f+"_container").first().children("."+f+"_tab:eq("+e+")")).addClass(f+"_tab_active"),r=e,!0):a?r:-1},this.select=function(e){a&&a.removeClass(f+"_tab_active");var t=n.list.findIndex("label",e);return this.index(t.index),this},n||(n={}),OGX.Data.merge(n,o),n.list.hasOwnProperty("insert")||(n.list=new OGX.List(n.list)),n.display.hasOwnProperty("_NAME_")||(n.display=new OGX.Display(n.display)),n.callbacks.select&&(i.onSelect=n.callbacks.select),n.callbacks.close&&(i.onClose=n.callbacks.close),n.callbacks.add&&(i.onAdd=n.callbacks.add),n.callbacks.remove&&(i.onRemove=n.callbacks.remove),(t=i.el).addClass(f),(n.add||n.remove)&&t.addClass(f+"_editable"),r=n.index,setTimeout(p,0),n.reorder&&i.touch.add("Hold",{id:"tabs_hold",cb_hold:m,cb_move:v,cb_up:x,state:"manual",time:1e3,target:".ogx_tabs_tab",capture:!0})},OGX.Tabs.SELECT="TabsSelect",OGX.Tabs.REORDER="TabsReorder",OGX.Tabs.ADD="TabsAdded",OGX.Tabs.REMOVE="TabsRemoved",require("Tags","Uxi","Touch"),OGX.Tags=function(e){construct(this,"Tags");var t,i,n,o,a,r=this,s={max:0,displays:null,display:null,display_max:0,display_more:!1,min_length:0,search_min_length:3,add:!0,remove:!0,strict:!1,name:null,required:!1,lowercase:!1,restrict:!1,enabled:!0,placeholder:"Search",keycode:13,tags:[],current_tags:[],keys:{},callbacks:{input:null,select:null,change:null,add:null,remove:null}},l={id:"id",label:"label",value:"label"},c={html:'<span class="ogx_tag_content">{{$content}}</span>{{$remove}}',css:"ogx_tag"},d='<span class="ogx_tag_label">{{$label}}</span>',u={default:c,more:{html:null,css:"ogx_tag ogx_tag_more"}},h={bind:"type"},f=0;function _(e){e.sliced.length&&(e.insert(e.sliced),e.sliced=[])}function g(e){var i=$(this).parent().data("ogx-id"),s=t.findDelete(a.keys.id,i,1),l=t.val();a.max&&a.max>l.length&&n.removeClass("ogx_hidden"),a.name&&o.val(O(!0)),r.el.trigger(OGX.Tags.REMOVED,s[a.keys.label]),r.onRemove(s[a.keys.label]),x(),a.name&&o.trigger("change")}function p(e,s){if(a.display_more&&!s[a.keys.id]&&"more"===s.type)return i.findDelete(a.keys.id,0,1),void _(i);t.find(a.keys.id,s[a.keys.id],1)||(t.insert(s),a.name&&o.val(O(!0)),a.max&&a.max===t.val().length&&n.addClass("ogx_hidden"),r.el.trigger(OGX.Tags.ADDED,s[a.keys.label]),r.onAdd(s[a.keys.label]),x(),a.name&&o.trigger("change")),n.val(""),i.val([])}function m(e,s){void 0===s&&(s=!0);var l=n.val();if(!a.strict&&l.length>=a.min_length&&e.which===a.keycode&&a.add){if((d={})[a.keys.label]=l,t.val().get(d,null,1))return;f++;var c={};c[a.keys.label]=l,c[a.keys.value]=l,c[a.keys.id]="t"+f,t.insert(c),r.onAdd(c),x(),a.name&&o.trigger("change"),n.val(""),i.val([])}else if(l.length>=a.search_min_length){var d;(d={})[a.keys.label]={regex:new RegExp(l,"i")};var u=a.tags.get(d);i.val(y(u,i)),s&&r.onInput(l)}else i.val([])}function v(e,t){if(e=OGX.Data.clone(e),t&&(t.sliced={org:OGX.Data.clone(e),rem:[]},Array.isArray(e)&&a.display_max&&e.length>a.display_max&&(t.sliced=e.slice(a.display_max),e=e.slice(0,a.display_max)),a.display_more&&t.sliced.length)){var i={type:"more"};i[a.keys.id]=0,i[a.keys.label]=t.sliced.length+" more",e.push(i)}return new OGX.List(e)}function y(e,t){if(!e.length)return new OGX.List;if("object"==typeof e[0]){e.hasOwnProperty("insert")||(e=new OGX.List(e));for(var i=0;i<e.length;i++)e[i].hasOwnProperty(a.keys.id)||(e[i][a.keys.id]="t"+i);return v(e,t)}var n,o=new OGX.List;for(i=0;i<e.length;i++)(n={})[a.keys.id]="t"+i,n[a.keys.label]=e[i],n[a.keys.value]=e[i],o.push(n),f=i;return v(o,t)}function x(){var e=O();r.onChange(e),r.el.trigger(OGX.Tags.CHANGE,[e])}function O(e){void 0===e&&(e=!1);var i=t.val();if(!i.length)return 1===a.max?"":e?"[]":[];if(i=i.unique(a.keys.value,!1),a.lowercase)for(var n=0;n<i.length;n++)i[n]=i[n].toLowerCase();return a.max&&i.length&&(i=i.splice(0,a.max),1===a.max&&i.length&&(i=i[0])),e&&(a.max>1||!a.max)&&(i=JSON.stringify(i)),i}this.ux=function(e){a.add&&function(e){e?n.on("keyup",m):n.off("keyup",m)}(e),e?(t.el.on(OGX.DynamicList.SELECT,(function(e,i){if(a.display_more&&!i[a.keys.id])return t.findDelete(a.keys.id,0,1),void _(t);r.el.trigger(OGX.Tags.SELECT,i[a.keys.label]),r.onSelect(i[a.keys.label]),x(),a.name&&o.trigger("change")})),t.el.on(this.touch.down,".ogx_tag_remove",g),i.el.on(OGX.DynamicList.SELECT,p)):(t.el.off(OGX.DynamicList.SELECT),t.el.off(this.touch.down,".ogx_tag_remove",g),i.el.off(OGX.DynamicList.SELECT,p))},this.onFocus=function(){return a.add&&n.removeAttr("disabled"),a.name&&o.removeAttr("disabled"),this},this.onBlur=function(){return a.add&&n.prop("disabled",!0),a.name&&o.prop("disabled",!0),this},this.onSelect=function(){},this.onAdd=function(){},this.onRemove=function(){},this.onChange=function(){},this.onInput=function(){},this.val=function(e,i){if(void 0===i&&(i=!1),void 0===e)return i?r:O();if(e.length){var r=y(e,t);t.val(r),a.name&&o.val(O(!0))}else a.add&&n.removeClass("ogx_hidden"),a.name&&o.val("[]"),t.val(e);return this},this.tags=function(e){return void 0===e?a.tags:(a.tags=y(e,null),a.add&&m({},!1),this)},this.wipe=function(){return t.val([]),i.val([]),a.add?n.removeClass("ogx_hidden"):n.addClass("ogx_hidden"),this},this.destroy=function(){a.restrict&&OGX.Form.unrestrictField(r.selector+" .ogx_tags_input > input")},a=OGX.Data.merge(e,s),OGX.Data.merge(a.keys,l),a.tags.hasOwnProperty("insert")||(a.tags=new OGX.List(a.tags)),c.html=c.html.replace("{{$id}}","{{$"+a.keys.id+"}}"),c.html=c.html.replace("{{$label}}","{{$"+a.keys.label+"}}"),a.remove?c.html=c.html.replace("{{$remove}}",'<span class="ogx_tag_remove"></span>'):c.html=c.html.replace("{{$remove}}",""),a.displays&&OGX.Data.merge(u,a.displays),d=d.replace("{{$label}}","{{$"+a.keys.label+"}}"),u.more.html=d,a.display?c.html=c.html.replace("{{$content}}",a.display.html):c.html=c.html.replace("{{$content}}",d),u.default=c,a.callbacks.select&&(r.onSelect=a.callbacks.select),a.callbacks.add&&(r.onAdd=a.callbacks.add),a.callbacks.remove&&(r.onRemove=a.callbacks.remove),a.callbacks.remove&&(r.onChange=a.callbacks.change),a.callbacks.input&&(r.onInput=a.callbacks.input),function(){var e="",t="",i="";a.required&&(e="required"),a.name&&(t='name="'+a.name+'"'),a.enabled||(i="disabled");var s='<div class="ogx_tags_tags"></div>';if(a.add&&(s+='<div class="ogx_tags_input"><input type="text" placeholder="'+a.placeholder+'" '+i+"></div>"),s+='<div class="ogx_tags_sug"></div>',a.name&&(s+='<input class="ogx_tags_hidden" type="hidden" '+t+" "+e+" "+i+' data-ogx-type="json">'),r.el.html(s).addClass("ogx_tags"),a.add&&(n=r.el.find(".ogx_tags_input > input")),a.name&&(o=r.el.find('input[type="hidden"]')),a.restrict){var l={multiline:!1,max:30};"object"==typeof a.restrict&&(l=a.restrict),l.el=r.selector+" .ogx_tags_input > input",OGX.Form.restrictField(l)}}(),function(){t=r.create("DynamicList",{el:'.ogx_uxi[data-ogx-id="'+r.id+'"] > .ogx_tags_tags',mode:"hit",displays:u,display:h,key:a.keys.id}),i=r.create("DynamicList",{el:'.ogx_uxi[data-ogx-id="'+r.id+'"] > .ogx_tags_sug',mode:"hit",displays:u,display:h,key:a.keys.id});var e=y(a.current_tags,t);t.val(e),a.tags=y(a.tags,null),a.name&&o.val(O(!0))}()},OGX.Tags.CHANGE="TagsChange",OGX.Tags.SELECT="TagsSelect",OGX.Tags.ADDED="TagsAdded",OGX.Tags.REMOVED="TagsRemoved",OGX.Tags.BIND=OGX.Tags.CHANGE,OGX.Tasker=function(){"use strict";var e=0,t=null,i=new OGX.List,n=(Date.now(),!1);function o(e){for(var a=function(){var e=Date.now(),t=i.get({recurring:{gt:0}}),o=[];return t.forEach((t=>{(!t.last_run||e-t.last_run>=t.recurring)&&(t.blur_only?n&&o.push(t):o.push(t))})),i.get({recurring:0}).concat(o)}();(e.timeRemaining()>0||e.didTimeout)&&a.length;){var r=a.shift();r.recurring?(!r.last_run||Date.now()>=r.last_run+r.recurring)&&(r.method.apply(null,r.params),r.last_run=Date.now()):r.method.apply(null,r.params)}Date.now(),t=requestIdleCallback(o,{timeout:1e3})}this.add=function(n,a,r,s,l){void 0===n&&(n=++e),void 0===r&&(r=null),void 0===s&&(s=0),void 0===l&&(l=0);var c={id:n,method:a,params:r,recurring:s,last_run:0,blur_only:l};return i.insert(c),t||(t=requestIdleCallback(o,{timeout:1e3})),n},this.remove=function(e){if(!i.get({id:{eq:e}},null,1))return!1;i.findDelete("id",e,1)},$(document).on("visibilitychange",(function(){n="visible"!==document.visibilityState}))},OGX.Tasker=new OGX.Tasker,require("Template"),OGX.Template=function(e){construct(this,"Template");var t=new OGX.Display(e),i=t.html(e.data),n=t.css(e.data);i&&this.el.html(i),n&&this.el.addClass(n)},OGX.Templater=function(){"use strict";var e;this.jmake=function(e,t){for(var i,n,o=JSON.stringify(e);m=/({{(\$|#)[a-z0-9_\.]*}})|("{{(\$)}}")/gi.exec(o);)m[0].match(/"{{(\$)}}"/)?(i="<-"+(i=JSON.stringify(t)).substring(1).slice(0,-1)+"->",o=(o=(o=o.replace(m[0],i)).replace(/<\-/,"{")).replace(/\->/,"}")):("object"==typeof(n=OGX.OSE.exec(m[0],t))&&(n=JSON.stringify(n),m[0]='"'+m[0]+'"'),o=o.replace(m[0],n));return JSON.parse(o)},this.make=function(t,i,n,o,a){var r,s;for(e={},void 0===a&&(a={}),OGX.Data.merge(e,a);r=/{{[^{]+(({[^{]+)+)?}}/gi.exec(t);)void 0===(s=OGX.OSE.exec(r[0],i,n,o,e))&&(s=""),t=t.replace(r[0],s);return t},this.amake=function(e,t,i,n,o){for(var a="",r=0;r<t.length;r++)a+=this.make(e,t[r],i,n,o);return a},this.get=function(e){var t=OGX.Cache.read("html",e);return t||!1}},OGX.Templater=new OGX.Templater,require("Theater","Uxi","Touch"),OGX.Theater=function(e){construct(this,"Theater");var t,i,n,o=this,a=e,r={anim:!1,display:!0,icon_size:50,timeout:30},s={template:!1,html:'<span class="ogx_theater_stage_icon" style="background-image:url(\'{{$icon}}\')"></span><span class="ogx_theater_stage_label">{{$label}}</span>'},l='<div class="list"></div>',c=!0;function d(e){e?($(document).on("backbutton",u),$(window).on("popstate",u),list.el.on(OGX.DynamicList.SELECT,(function(e,t){!function(e){o.el.trigger(OGX.Theater.HIDE);var t=OGX.Core.find("Stage",e);t.wake(),t.resizeNodes();var n,r=list.el.find('.ogx_theater_stage[data-ogx-id="'+t.id+'"]').position();o.observe(!0,{childList:!0},(function(){o.observe(!1),(n=i.children(".ogx_theater_trans")).on("transitionend",(function(){n.off("transitionend"),o.hide(),n.remove(),t.url?(OGX.Core.showStage(t.id,!1),OGX.Core.router.addToHist(t.url)):OGX.Core.goto(t.id+"/"+t.home)})),n.removeClass("ogx_theater_trans_hide"),setTimeout((()=>{n.addClass("ogx_theater_trans_grow").css({opacity:1,width:"100%",height:"100%",transform:"translate3d(0px, 0px, 0px)"})}),a.timeout)}),null,i),i.append('<div class="ogx_theater_trans ogx_theater_trans_hide" style="width:'+a.icon_size+"px; height:"+a.icon_size+"px; transform:translate3d("+r.left+"px,"+r.top+'px, 0px);" data-ogx-id="'+t.id+'"><div class="icon" style="background-image:url(\'/img/'+t.theater.icon+"')\"></div></div>")}(t.id)}))):($(document).off("backbutton",u),$(window).off("popstate",u),list.el.off(OGX.DynamicList.SELECT))}function u(){o.hide()}function h(){t.prepend(l);for(var e,i=[],r=0;r<n.length;r++)e={id:n[r].id,name:"",icon:""},"object"==typeof n[r].theater&&n[r].theater.hasOwnProperty("icon")&&(e.icon="./img/"+n[r].theater.icon,e.label=n[r].theater.label),i.push(e);$(".ogx_theater > .list").on(OGX.DynamicList.RENDER,(function(e){$(".ogx_theater > .list").off(OGX.DynamicList.RENDER),setTimeout((()=>{l=$(".ogx_theater").detach()}),0)})),list=o.create("DynamicList",{el:".ogx_theater > .list",display:{html:a.display.html,css:"ogx_theater_stage"},key:"id",scroll:!0,mode:"hit",list:i,trigger:!0})}function f(){var e=OGX.Core.gather(OGX.Stage.NAME);n=[];for(var t=0;t<e.length;t++)e[t].theater&&n.push(e[t])}this.update=function(){f()},this.show=function(){return c&&(i.prepend(l),function(){o.el.trigger(OGX.Theater.SHOW);var e,n=OGX.Core.getStage();o.observe(!0,{childList:!0},(function(t){o.observe(!1),n.sleep(),e=i.children(".ogx_theater_trans");var r=list.el.find('.ogx_theater_stage[data-ogx-id="'+n.id+'"]').position();e.removeClass("ogx_theater_trans_hide"),setTimeout((()=>{e.on("transitionend",(function(){e.off("transitionend"),setTimeout((()=>{e.remove()}),0)})),e.addClass("ogx_theater_trans_show").addClass("ogx_theater_trans_shrink").css({opacity:0,width:a.icon_size+"px",height:a.icon_size+"px",transform:"translate3d("+r.left+"px, "+r.top+"px, 0px)"})}),a.timeout)}),null,i),i.append('<div class="ogx_theater_trans ogx_theater_trans_hide" data-ogx-id="'+n.id+'"><div class="icon" style="background-image:url(\'/img/'+n.theater.icon+"')\"></div></div>"),t.css("visibility","visible")}(),this.focusNodes(),d(!0),c=!1),this},this.hide=function(){return c||(this.blurNodes(),l=t.detach(),d(!1),c=!0),this},this.tile=function(e,t){void 0===t&&(t="x")},OGX.Data.merge(a,r),a.display&&("object"!=typeof a.display&&(a.display={}),OGX.Data.merge(a.display,s),a.display.template&&(a.display.html=OGX.Templater.get(a.display.template))),(t=o.el).addClass("ogx_theater").css("visibility","hidden"),i=$("body"),f(),$(document).on(OGX.App.READY,h)},OGX.Theater.ZOOM="TheaterZoom",OGX.Theater.SHOW="TheaterShow",OGX.Theater.HIDE="TheaterHide",OGX.Touch=function(e){"use strict";var t=this,i=0;this.touch=!1,this.touch||this.initTouch(e.chromeos);var n=new OGX.List;this.touch.add=function(e,o){var a=new OGX.Touches[e](t),r=a.set(o);return!r.hasOwnProperty("id")&&(r.id=i++),a.id=r.id,"auto"===r.state&&!t.blured&&t.enabled&&a.onFocus(),n.insert(a),a},this.touch.remove=function(e){"object"==typeof e&&(e=e.id),n.findDelete("id",e,1).disable()},this.touch.get=function(e){return n.get({id:{eq:e}},null,1)},this.touch.wipe=function(){for(var e=0;e<n.length;e++)n[e].disable();n.clear()},this.touch.isRightClick=function(e){var i=t.event(e),n=!1;return i.which?n=3===i.which:i.button&&(n=2===i.button),n},this.touch.enable=function(){for(var e=n.get({state:{eq:"manual"}}),t=0;t<e.length;t++)e[t].enable()},this.touch.disable=function(){for(var e=n.get({state:{eq:"manual"}}),t=0;t<e.length;t++)e[t].disable()}},OGX.Touch.prototype.initTouch=function(e){void 0===e&&(e=!1),this.touch={hold:{}},this.touch.click="click",this.touch.dclick="dblclick",this.touch.down="mousedown",this.touch.up="mouseup",this.touch.move="mousemove",this.touch.enter="mouseenter",this.touch.leave="mouseleave",this.touch.over="mouseover",this.touch.out="mouseout",void 0===window.ontouchstart||e||(this.touch.down="touchstart",this.touch.up="touchend",this.touch.move="touchmove")},OGX.Touch.prototype.touchable=function(){return void 0!==window.ontouchstart},OGX.Touch.prototype.event=function(e){return e.hasOwnProperty("originalEvent")&&void 0!==e.originalEvent.changedTouches?e.originalEvent.changedTouches[0]:e},OGX.Touches={},OGX.Touches.Double=function(e){"use strict";var t,i=this,n=e,o={delay:180,target:!1,capture:!1,cb_down:null,cb:!1,state:"auto"},a=!1,r=!1,s=!0,l=$("body"),c=null,d=null,u=0;function h(){s&&i.onFocus(),n.focus(),c&&c()}function f(){s&&i.onBlur(),n.blur(),d&&d()}function _(e){e?l.on(n.touch.down,t,g):l.off(n.touch.down,t,g)}function g(e){a.capture&&e.cancelable&&(e.preventDefault(),e.stopImmediatePropagation());var t=(new Date).getTime();return!u||t-u>a.delay?(u=(new Date).getTime(),void(a.cb_down&&a.cb_down())):t-u<=a.delay?(u=0,void(a.cb&&a.cb())):(u=t,void(a.cb_down&&a.cb_down()))}this.set=function(e){return a=e,OGX.Data.merge(a,o),t=n.selector,this.state=a.state,a.target&&(t=a.target),"auto"===a.state?(c=n.onFocus,d=n.onBlur,n.onFocus=h,n.onBlur=f):s=!1,a},this.onFocus=function(){!r&&a&&(r=!0,_(!0))},this.onBlur=function(){r&&(r=!1,_(!1))},this.enable=function(){s||(s=!0,this.onFocus())},this.disable=function(){s&&(s=!1,this.onBlur())}},OGX.Touches.Swipe=function(e){"use strict";var t,i=this,n=e,o={speed:10,x:!0,y:!1,min_x:100,min_y:100,cb_down:!1,cb_swipe:!1,cb_up:!1,target:!1,capture:!1,state:"auto"},a=!1,r={x:0,y:0},s={x:0,y:0},l=0,c=0,d=0,u=0,h=0,f=!1,_=!1,g=!0,p=!1,m=null,v=null,y=$("body"),x=!1;function O(){g&&i.onFocus(),n.focus(),m&&m()}function b(){g&&i.onBlur(),n.blur(),v&&v()}function w(e){x=!0,a.capture&&e.cancelable&&(e.preventDefault(),e.stopImmediatePropagation()),p||(p=!0,e=n.event(e),r.x=e.pageX,r.y=e.pageY,r.target=e.target,d=u=0,l=c=h=0,G(!0),a.cb_down&&a.cb_down(r))}function G(e){e?(X(!0),f=setInterval(k,a.speed)):(X(!1),f&&(clearInterval(f),f=!1))}function X(e){e?$(t).on(n.touch.move,E):$(t).off(n.touch.move,E)}function C(e){e?(y.on(n.touch.up,D),y.on(n.touch.down,t,w)):(y.off(n.touch.up,D),y.off(n.touch.down,t,w))}function D(e,t){x&&(x=!1,a.capture&&e&&e.cancelable&&(e.preventDefault(),e.stopImmediatePropagation()),_&&(void 0===t&&(t=!1),G(!1),p&&a.cb_up&&a.cb_up({pt0:r,pt1:s,distX:d,distY:u,dist:h,dirX:l,dirY:c,swipe:t}),p=!1))}function E(e){a.capture&&e.cancelable&&(e.preventDefault(),e.stopImmediatePropagation()),e=n.event(e),s.x=e.pageX,s.y=e.pageY,l=s.x>r.x?1:-1,c=s.y>r.y?1:-1,d=Math.abs(s.x-r.x),u=Math.abs(s.y-r.y),h=Math.sqrt(Math.abs(Math.pow(s.x-r.x,2)-Math.pow(s.y-r.y,2)))}function k(){a.cb_swipe&&(a.x&&a.min_x&&d>=a.min_x||a.y&&a.min_y&&u>=a.min_y?D(null,!0):a.cb_swipe({pt0:r,pt1:s,dirX:l,dirY:c,distX:d,distY:u,dist:h}))}this.set=function(e){return a=e,OGX.Data.merge(a,o),t=n.selector,this.state=a.state,"auto"===a.state?(m=n.onFocus,v=n.onBlur,n.onFocus=O,n.onBlur=b):g=!1,a.target&&(t=a.target),a},this.onFocus=function(){!_&&a&&(_=!0,C(!0))},this.onBlur=function(){_&&(_=!1,C(!1),G(!1))},this.enable=function(){g||(g=!0,this.onFocus())},this.disable=function(){g&&(g=!1,this.onBlur())}},OGX.Touches.Hold=function(e){"use strict";var t=this,i={cb_hold:!1,cb_up:!1,cb_move:!1,time:1e3,el:this.el,target:!1,capture:!1,parent:null,state:"auto"},n=!1,o=!1,a=!1,r=!1,s=!1,l=!1,c=!0,d=e,u={x:0,y:0},h={x:0,y:0},f={x:0,y:0},_={x:0,y:0},g=null,p=null,m=null,v=$("body");function y(){c&&t.onFocus(),d.focus(),p&&p()}function x(){c&&t.onBlur(),d.blur(),m&&m()}function O(e){var t=[];e?n.parent?n.parent.on.apply(n.parent,[d.touch.down,b]):(t=n.target?[d.touch.down,n.target,b]:[d.touch.down,b],d.el.on.apply(d.el,t)):n.parent?n.parent.off.apply(n.parent,[d.touch.down,b]):(t=n.target?[d.touch.down,n.target,b]:[d.touch.down,b],d.el.off.apply(d.el,t))}function b(e){n.capture&&e.cancelable&&(e.preventDefault(),e.stopImmediatePropagation()),e=d.event(e),g=e.target,r||(r=!0,o=(new Date).getTime(),_.x=u.x=e.pageX,_.y=u.y=e.pageY,a=setInterval(G,1))}function w(e){n.capture&&e.cancelable&&(e.preventDefault(),e.stopImmediatePropagation()),e=d.event(e),h.x=e.pageX,h.y=e.pageY,h.x<_.x?f.x=-1:f.x=1,h.y<_.y?f.y=-1:f.y=1,0===h.x&&(f.x=0),0===h.y&&(f.y=0),_.x=h.x,_.y=h.y,s?n.cb_move&&n.cb_move({x:h.x,y:h.y,distX:h.x-u.x,distY:h.y-u.y,dirX:f.x,dirY:f.y}):(Math.abs(u.x-h.x)>5||Math.abs(u.y-h.y)>5)&&(clearInterval(a),a=!1)}function G(){r&&(new Date).getTime()-o>n.time&&(s||(s=!0,v.on(d.touch.move,w),n.cb_hold?n.cb_hold(g,u):d.el.trigger(OGX.Touch.HOLD_START)))}function X(t){t=e.event(t),r=!1,clearInterval(a),a=!1,s&&(s=!1,v.off(d.touch.move,w),n.cb_up?n.cb_up({x:t.pageX,y:t.pageY}):d.el.trigger(OGX.Touch.HOLD_END,{x:t.pageX,y:t.pageY}))}this.set=function(e){return n=e,OGX.Data.merge(n,i),d.selector,this.state=n.state,"auto"===n.state?(p=d.onFocus,m=d.onBlur,d.onFocus=y,d.onBlur=x):c=!1,n.target&&n.target,n},this.onFocus=function(){!l&&n&&(l=!0,O(!0),v.on(d.touch.up,X))},this.onBlur=function(){l&&(l=!1,(r||a)&&(s=!1,r=!1,clearInterval(a),a=!1),O(!1),v.off(d.touch.up,X),v.off(d.touch.move,w))},this.enable=function(){c||(c=!0,this.onFocus())},this.disable=function(){c&&(c=!1,this.onBlur())}},OGX.Touches.Drag=function(e){"use strict";var t,i,n,o,a,r,s=this,l=!1,c={min:10,x:!0,y:!0,limit_x:null,limit_y:null,target:!1,cb_down:!1,cb_drag:!1,cb_up:!1,border:10,capture:!1,parent:null,state:"auto"},d=e,u=!1,h=!1,f=!0,_=null,g=null,p=$("body"),m=null,v=!1;function y(){f&&s.onFocus(),d.focus(),_&&_(),s.onFocus()}function x(){f&&s.onBlur(),d.blur(),g&&g()}function O(e){var t=[];e?l.parent?l.parent.on.apply(l.parent,[d.touch.down,b]):(t=l.target?[d.touch.down,l.target,b]:[d.touch.down,b],d.el.on.apply(d.el,t)):l.parent?l.parent.off.apply(l.parent,[d.touch.down,b]):(t=l.target?[d.touch.down,l.target,b]:[d.touch.down,b],d.el.off.apply(d.el,t))}function b(s){v=!0,l.capture&&s.cancelable&&(s.preventDefault(),s.stopImmediatePropagation()),s=e.event(s),m=OGX.Data.get2DTransform(d.el[0]),n=s.pageX,o=s.pageY;var c=d.el.position();t=c.left,i=c.top;var u=d.el.offset(),h=n-u.left,f=o-u.top;if(l.border){if(h<l.border||h>d.el.width()-l.border)return;if(f<l.border||f>d.el.height()-l.border)return}a=0,r=0,w(!0),G(!0),l.cb_down&&l.cb_down({x:n,y:o,target:s.target})}function w(e){e?u||(u=setInterval(D,10)):u&&(clearInterval(u),u=null)}function G(e){e?(p.on(d.touch.move,C),p.on(d.touch.up,X)):(p.off(d.touch.move,C),p.off(d.touch.up,X))}function X(t){v&&(v=!1,w(!1),G(!1),t=e.event(t),l.x&&(a=t.pageX-n),l.y&&(r=t.pageY-o),l.cb_up&&l.cb_up({distX:a,distY:r}))}function C(t){l.capture&&t.cancelable&&(t.preventDefault(),t.stopImmediatePropagation()),t=e.event(t);var i,s=!1;l.x&&(i=t.pageX-n,null!==l.limit_x?i>=l.limit_x.min&&i<=l.limit_x.max&&(l.min?Math.abs(i)>l.min&&(a=i,s=!0):(a=i,s=!0)):l.min?Math.abs(i)>l.min&&(a=i,s=!0):a=i),l.y&&(i=t.pageY-o,null!==l.limit_y?i>=l.limit_y.min&&i<=l.limit_y.max&&(l.min?Math.abs(i)>l.min&&(r=i,s=!0):(r=i,s=!0)):r=i),s&&l.cb_drag&&l.cb_drag({distX:a,distY:r,x:t.pageX,y:t.pageY})}function D(){var e,n;e=n=0,(a||r)&&(l.x&&(e=t+a),l.y&&(n=i+r),d.el.css("transform","translate3d("+e+"px, "+n+"px, 0) rotate("+m.r+"deg)"))}this.dragable=!0,this.set=function(e){return l=e,OGX.Data.merge(l,c),"auto"===l.state?(_=d.onFocus,g=d.onBlur,d.onFocus=y,d.onBlur=x):f=!1,this.state=l.state,l},this.onFocus=function(){!h&&l&&(h=!0,O(!0))},this.onBlur=function(){h&&(h=!1,O(!1),G(!1),w(!1))},this.enable=function(){f||(f=!0,this.onFocus())},this.disable=function(){f&&(f=!1,this.onBlur())}},OGX.Touches.Move=function(e){"use strict";var t,i,n,o,a,r,s,l,c,d,u=this,h=!1,f={min:0,x:!0,y:!0,limit_x:null,limit_y:null,target:null,cb_down:null,cb_move:null,cb_up:null,cb_click:null,capture:!1,parent:null,state:"auto"},_=e,g=!1,p=!0,m=null,v=null,y=$("body");function x(){p&&u.onFocus(),_.focus(),m&&m()}function O(){u.onBlur(),_.blur(),v&&v()}function b(e){var t=[];e?h.parent?h.parent.on.apply(h.parent,[_.touch.down,w]):(t=h.target?[_.touch.down,h.target,w]:[_.touch.down,w],_.el.on.apply(_.el,t)):h.parent?h.parent.off.apply(h.parent,[_.touch.down,w]):(t=h.target?[_.touch.down,h.target,w]:[_.touch.down,w],_.el.off.apply(_.el,t))}function w(c){h.capture&&c.cancelable&&(c.preventDefault(),c.stopImmediatePropagation()),c=e.event(c),t=c.pageX,i=c.pageY,n=0,o=0,a=0,r=0,s=0,l=0,G(!0),h.cb_down&&h.cb_down({target:c.target,x:t,y:i})}function G(e){e?(y.on(_.touch.move,C),y.on(_.touch.up,X)):(y.off(_.touch.move,C),y.off(_.touch.up,X))}function X(s){if(h.capture&&s.cancelable&&(s.preventDefault(),s.stopImmediatePropagation()),G(!1),s=e.event(s),h.x&&(n=s.pageX-t),h.y&&(o=s.pageY-i),h.cb_up&&h.cb_up({x:s.pageX,y:s.pageY,distX:n,distY:o,dirX:a,dirY:r}),h.cb_click){var l=!1;h.x&&Math.abs(n)<2&&(l=!0),h.y&&Math.abs(o)<2&&(l=!0),l&&h.cb_click(s)}}function C(u){h.capture&&u.cancelable&&(u.preventDefault(),u.stopImmediatePropagation()),u=e.event(u);var f,_=!1;c=Math.abs(s-u.pageX),d=Math.abs(l-u.pageY),h.x&&(a=0,s||(s=u.pageX),s<u.pageX?a=1:s>u.pageX&&(a=-1),s=u.pageX,f=u.pageX-t,null!==h.limit_x?f>=h.limit_x.min&&f<=h.limit_x.max&&(h.min?Math.abs(f)>h.min&&(n=f,_=!0):(n=f,_=!0)):h.min?Math.abs(f)>h.min&&(n=f,_=!0):(n=f,_=!0)),h.y&&(r=0,l||(l=u.pageY),l<u.pageY?r=1:l>u.pageY&&(r=-1),l=u.pageY,f=u.pageY-i,null!==h.limit_y?f>=h.limit_y.min&&f<=h.limit_y.max&&(h.min?Math.abs(f)>h.min&&(o=f,_=!0):(o=f,_=!0)):(o=f,_=!0)),_&&h.cb_move&&h.cb_move({distX:n,distY:o,dirX:a,dirY:r,stepX:c,stepY:d,x:u.pageX,y:u.pageY})}this.set=function(e){return h=e,OGX.Data.merge(h,f),"auto"===h.state?(m=_.onFocus,v=_.onBlur,_.onFocus=x,_.onBlur=O):p=!1,this.state=h.state,h},this.onFocus=function(){!g&&h&&(g=!0,b(!0))},this.onBlur=function(){g&&(g=!1,b(!1),G(!1))},this.enable=function(){p||(p=!0,this.onFocus())},this.disable=function(){p&&(p=!1,this.onBlur())}},OGX.Touch.HOLD_START="TouchHoldStart",OGX.Touch.HOLD_END="TouchHoldEnd",require("Tree","Uxi","Touch"),OGX.Tree=function(e){construct(this,"Tree");var t,i,n,o,a,r,s,l,c=this,d='<span class="ogx_tree_item_icon"></span><span class="ogx_tree_item_label">{{$label}}</span>',u=e,h={show_root:!0,root_label:"root",editable:!1,sort:{enabled:!0,property:"label",way:1},type:"type",toggle:!0,drag_after:1e3,key:null,scope:["public"],chromeos:!1,types:{root:{mode:"folder",display:{html:d}},file:{mode:"file",display:{html:d}},folder:{mode:"folder",display:{html:d}}},data:{_id:0,type:"root",state:"closed",label:null,items:[]},display:null,callbacks:{select:null,unselect:null,open:null,close:null,move:null}},f="_id",_=1;function g(e){return"root"===e.type?"":M(p,e)}function p(e,t,i,n,o){return e[f]===o[f]&&t}function m(e,t){var i={container_display:"",container_css:"",arrow_display:"",arrow_style:"ogx_tree_item_arrow_open",state:"open",type:t.type};return i[f]=t[f],OGX.Data.merge(i,e,!0),OGX.Templater.make('<div class="ogx_tree_item" data-id="{{$_id}}" data-state="{{$state}}" data-type="{{$type}}" data-compound="{{$type}}-{{$state}}" data-children="{{!$empty}}"><div class="ogx_tree_item_arrow {{$arrow_style}} {{$arrow_display}}"><span></span></div><div class="ogx_tree_item_content"></div><div class="ogx_tree_item_container {{$container_display}} {{$container_css}}"></div></div>',i)}function v(){var e=m({},u.data);t.html(e),u.data.element=t.children(".ogx_tree_item").first(),u.data.uxi=c,b(u.data,c),u.show_root||u.data.element.addClass("ogx_tree_root_hidden")}function y(){v(),x(u.data,c)}function x(e,t){if(e.parent=t,e.hasOwnProperty("items")){var i,n;!e.items.hasOwnProperty("insert")&&(e.items=new OGX.List(e.items)),u.sort.enabled&&e.items.order(u.sort.property,u.sort.way),e.element.children(".ogx_tree_item_container").first().empty();for(var o=0;o<e.items.length;o++)n=t,i=N(e.items[o]),O(e.element.children(".ogx_tree_item_container").first(),e.items[o]),b(e.items[o],t),i.display.hasOML()&&(n=t.nodes.last()),x(e.items[o],n)}}function O(e,t){var i=N(t),n={_id:t[f],container_display:"",arrow_display:"",arrow_style:"",state:"open"};t.hasOwnProperty("state")&&(n.state=t.state),t.state=n.state,"folder"===i.mode?(t.hasOwnProperty("items")&&t.items.length?n.empty=!!t.items.length:(n.state="closed",n.arrow_style="ogx_tree_item_arrow_disabled",n.empty=!0),"open"===n.state?n.arrow_style="ogx_tree_item_arrow_open":(n.arrow_style+=" ogx_tree_item_arrow_close",n.container_display="ogx_tree_item_container_hidden",n.state="closed")):n.arrow_display="ogx_tree_item_arrow_hidden";var o=m(n,t);e.append(o),t.element=e.children().last()}function b(e,t){var i=N(e),n='.ogx_tree[data-ogx-id="'+c.id+'"] .ogx_tree_item[data-id="'+e[f]+'"] > .ogx_tree_item_content';if(i.display.hasOML()){var o=i.display.oml(n,e,!1);OGX.OML.render(t,o,e),e.uxi=t.nodes.last()}else{var a=i.display.html(e);a=OGX.Templater.make(a,e),$(n).html(a)}}function w(e){return delete e.element,delete e.parent,delete e.uxi,delete e.state,l||delete e[f],!1}function G(e){"folder"===N(e).mode&&(e.items.length?e.element.attr("data-empty",!1):(e.element.attr("data-state","closed").attr("data-compound",e.type+"-closed").attr("data-empty",!0),e.element.children(".ogx_tree_item_arrow").addClass("ogx_tree_item_arrow_disabled")),"open"===e.state?(e.element.attr("data-state","open").attr("data-compound",e.type+"-open"),e.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_close").removeClass("ogx_tree_item_arrow_disabled").addClass("ogx_tree_item_arrow_open"),e.element.children(".ogx_tree_item_container").removeClass("ogx_tree_item_container_hidden")):(e.element.attr("data-state","open").attr("data-compound",e.type+"-closed"),e.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_open").addClass("ogx_tree_item_arrow_close"),e.element.children(".ogx_tree_item_container").addClass("ogx_tree_item_container_hidden")))}function X(){if(s){var e=S(s);e&&e.children(".ogx_tree_item_content").removeClass("ogx_tree_selected_item"),s=null}}function C(){return!!s&&k(s)}function D(e){X();var t=S(e);t&&(s=e,t.children(".ogx_tree_item_content").addClass("ogx_tree_selected_item"))}function E(e,t){return M((function(i){return i[f]===t&&(i.hasOwnProperty("items")||(i.items=new OGX.List),!i.items.hasOwnProperty("insert")&&(i.items=new OGX.List(i.items)),i.items.push(e),i.state="open",G(i),!0)}))}function k(e){if(!e||"root"===e)return u.data;return M((function(t,i){return t[f]===e&&t}))}function S(e){var t=k(e);return!!t&&t.element}function T(e){return!(!e.hasOwnProperty("uxi")||!e.uxi)&&(e.uxi.kill(),delete e.uxi,!1)}function L(){return M((function(e){return e.hasOwnProperty(f)||(_++,e[f]=_),e.hasOwnProperty("type")||(e.hasOwnProperty("items")?e.type="folder":e.type="file"),!1}))}function M(e,t,i,n){var o;return void 0===t&&(t=null),void 0===i&&(i=u.data),void 0===n&&(n=!1),(o=function i(a,r,s,l){if(!n&&(o=e(a,r,s,l,t)))return o;if(a.hasOwnProperty("items")&&a.items.length)for(var c=0;c<a.items.length;c++)if(o=i(a.items[c],r+"/"+a[f],a,c))return o;return!1}(i,""))||i}function N(e){return!!u.types.hasOwnProperty(e.type)&&u.types[e.type]}function A(e){var i,n,o=e.data("id");n=g(i=k(o)),u.toggle?e.children(".ogx_tree_item_content").hasClass("ogx_tree_selected_item")?X():(X(),e.children(".ogx_tree_item_content").addClass("ogx_tree_selected_item"),s=o):(X(),s=o,e.children(".ogx_tree_item_content").addClass("ogx_tree_selected_item")),c.onSelect({path:n,item:i}),t.trigger(OGX.Tree.SELECT,{path:n,item:i})}function R(e){e?(u.editable?(t.on(c.touch.down,".ogx_tree_item > .ogx_tree_item_content",(function(e){e.preventDefault(),A($(this).parent(0)),1!==$(this).parent(0).data("id")&&function(){a&&clearInterval(a);r=(new Date).getTime(),a=setInterval(I,50)}()})),$(document).on(c.touch.up,(function(){var e,a,r,s,l,d,u,h,_,g,p;P(),n&&(Y(!1),e=n.offset().left,a=n.offset().top,l=e,d=a,r=M((function(e,t){return u=e.element.offset(),h=e.element.children(".ogx_tree_item_content").children(".ogx_tree_item_icon"),l>=u.left&&l<=u.left+h.width()&&d>=u.top&&d<=u.top+h.height()&&e})),s=N(r),!r||r&&(r[f]===i[f]||"folder"!==s.mode)?(o.css("opacity",1),n.remove(),n=null,i=null):(g=r,p=(_=i)[f],M((function(e,t,i,n){return e[f]===p&&(i.items.splice(n,1),i.items.length||(i.state="closed"),G(i),!0)})),E(_,g[f]),g.element.children(".ogx_tree_item_container").empty(),g.state="open",x(g,g.element),G(g),o.remove(),n.remove(),n=null,c.onMove(i),t.trigger(OGX.Tree.DROP,i),i=null))}))):t.on("click",".ogx_tree_item > .ogx_tree_item_content",(function(e){A($(this).parent(0))})),t.on(c.touch.down,".ogx_tree_item_arrow",(function(e){e.preventDefault(),P();var i=k($(this).parent(0).data("id"));i&&i.hasOwnProperty("items")&&i.items.length&&("open"===i.state?(c.onClose(i),t.trigger(OGX.Tree.CLOSE,i)):(c.onOpen(i),t.trigger(OGX.Tree.OPEN,i)),"open"===i.state?i.state="closed":i.state="open",G(i))}))):(u.editable?t.off(c.touch.down,".ogx_tree_item > .ogx_tree_item_content"):t.off("click",".ogx_tree_item > .ogx_tree_item_content"),t.off(c.touch.down,".ogx_tree_item_arrow"))}function I(){var e;(new Date).getTime()-r>=u.drag_after&&(s&&(i=k(s))&&(e=i.element,o=e,(n=e.clone()).children(".ogx_tree_item_arrow").css("display","none"),e.css("opacity",.3),n.addClass("ogx_tree_item_drag"),n.css({top:e.offset().top,left:e.offset().left}),t.prepend(n),Y(!0),t.trigger(OGX.Tree.DRAG,i)),P())}function Y(e){e?$(document).on(c.touch.move,(function(e){e=function(e){if(e.hasOwnProperty("originalEvent")&&void 0!==e.originalEvent.changedTouches)return e.originalEvent.changedTouches[0];return e}(e),n.css({top:e.pageY+"px",left:e.pageX+"px"})})):$(document).off(c.touch.move)}function P(){a&&(clearInterval(a),a=null)}this.onFocus=function(){return R(!0),this},this.onBlur=function(){return R(!1),this},this.onSelect=function(){},this.onUnselect=function(){},this.onOpen=function(){},this.onClose=function(){},this.onMove=function(){},this.addItem=function(e,t,i){if(void 0===i&&(i=!0),void 0===t&&(t=s),t){var n;n=Array.isArray(e)?e:[e];var o=k(t);if("folder"===N(o).mode)return n.forEach((e=>{l||(_++,e[f]=_),e.hasOwnProperty("items")||(e.items=[]),X(),E(e,t),M(T,null,o,!0),x(o,o.parent),o.element.data("state","open"),o.element.data("compound",e.type+"-close"),o.element.children(".ogx_tree_item_container").removeClass("ogx_tree_item_container_hidden"),o.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_disabled ogx_tree_item_arrow_close").addClass("ogx_tree_item_arrow_open")})),1!==n.length||c.selectItem(e[f],i)}return!1},this.test=function(){return u.data},this.getItem=function(e,t){void 0===t&&(t=!1);var i,n,o=k(e);return!!o&&(t?(i=o,w(n={...i}),n):o)},this.getItemByPath=function(e){var t=e.split("/"),i=t.pop();return t=t.join("/"),M((function(e,n){return n===t&&i===e[f]&&e}))},this.selectItem=function(e,t){void 0===t&&(t=!1),D(e);var i=C();return t&&this.el.trigger(OGX.Tree.SELECT,{item:i,path:g(i)}),i},this.selectItemByPropVal=function(e,t,i){void 0===i&&(i=!1);var n=function(e,t){function i(i,n){return!(!i.data.hasOwnProperty(e)||i.data[e]!==t)&&n+"/"+i.label}return M(i)}(e,t);return!!n&&(X(),D(n[f]),n=C(),i&&this.el.trigger(OGX.Tree.SELECT,{item:n,path:g(n)}),n)},this.selectItemByPath=function(e,t){var i=function(e){function t(t,i){return e===i+"/"+t[f]&&t.element}return M(t)}(e);if(i){X(),i.children(".ogx_tree_item_content").addClass("ogx_tree_selected_item"),s=i.data("id");var n=C();return t&&this.el.trigger(OGX.Tree.SELECT,{item:n,path:g(n)}),n}return!1},this.updateItem=function(e,t,i){void 0===i&&(i=!0);var n=k(e);if(n){if(n.uxi){var o=n.uxi.el;n.uxi.kill(),o.empty()}else i&&n.element.children(".ogx_tree_item_container").empty();OGX.Data.merge(n,t,!0),i&&!l&&L(),b(n,n.parent),i&&n.hasOwnProperty("items")&&n.items.length&&(x(n,n.parent),n.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_disabled ogx_tree_item_arrow_close").addClass("ogx_tree_item_arrow_open"),n.element.attr("state","open").attr("state",n.type+"-open"),n.element.children(".ogx_tree_item_container").removeClass("ogx_tree_item_container_hidden"))}},this.replaceItem=function(e){var t=k(e[f]);t&&(M(T,null,t,!0),t.uxi&&t.uxi.kill(),OGX.Data.merge(e,t,!1),b(t,t.parent),t.hasOwnProperty("items")&&t.items.length&&x(t,t.parent))},this.deleteItem=function(e){var t=k(e);if(t){var i=function(e){function t(t){return!(!t.hasOwnProperty("items")||!t.items.get({_id:{eq:e}},null,1))&&t}return M(t)}(e);return M(T,null,t,!0),t.uxi&&t.uxi.kill(),i.items.findDelete("_id",e,1),t.element.remove(),i.items.length||(i.state="closed"),G(i),t}return!1},this.openItem=function(e){var t=k(e);return!!t&&("closed"===t.state&&t.items.length&&(t.state="open",G(t)),t)},this.closeItem=function(e){var t=k(e);return!!t&&("open"===t.state&&(t.state="closed",G(t)),t)},this.deleteSelectedItem=function(){return function(){function e(e,t,i,n){if(e[f]===s)return e.element.remove(),i.items.splice(n,1),i.items.length||(i.state="closed"),G(i),!0}if(s)return M(e);return!1}()},this.getSelectedItem=function(){return C()},this.getTree=function(){var e=M(w,null,{...u.data});return e||!1},this.setData=function(e){e.hasOwnProperty("types")&&this.setTypes(e.types),e.hasOwnProperty("tree")&&this.setTree(e.tree)},this.setTypes=function(e){u.types=e},this.setTree=function(e){this.scroll?this.clear([this.scroller.id]):this.clear(),u.data=e,u.data.hasOwnProperty("state")||(u.data.state="open"),l||L(),y()},this.newTree=function(){c.scroll?c.clear([c.scroller.id]):c.clear();_=0,v()},this.filterTree=function(e,t){!function(e,t){var i=[];function n(o,a,r,s){if(-1!==(a+o[e]).indexOf(t)&&i.push(a+"/"+o[e]),o.hasOwnProperty("items")&&o.items.length)for(var l=0;l<o.items.length;l++)n(o.items[l],a+"/"+o[e],o,l)}n(u.data,"")}(e,t)},function(){if(OGX.Data.merge(u,h),(t=c.el).addClass("ogx_tree"),Array.isArray(u.data)){var e=new OGX.List(OGX.Data.clone(u.data));u.data={_id:0,type:"root",data:{label:u.root_label},display:null,items:e}}u.callbacks.select&&(c.onSelect=u.callbacks.select),u.callbacks.unselect&&(c.onUnselect=u.callbacks.unselect),u.callbacks.open&&(c.onOpen=u.callbacks.open),u.callbacks.close&&(c.onClose=u.callbacks.close),u.callbacks.move&&(c.onMove=u.callbacks.move)}(),function(){for(var e in u.types.hasOwnProperty("root")||(u.types.root=h.types.root),u.types)u.types[e].hasOwnProperty("display")||(u.types[e].display={html:d}),u.types[e].display.hasOwnProperty("html")&&u.types[e].display.html||(u.types[e].display.html=d),u.types[e].display=new OGX.Display(u.types[e].display)}(),u.key?(f=u.key,l=!0):(l=!1,L()),u.data&&y()},OGX.Tree.SELECT="TreeSelect",OGX.Tree.UNSELECT="TreeUnselect",OGX.Tree.OPEN="TreeOpen",OGX.Tree.CLOSE="TreeClose",OGX.Tree.DRAG="TreeDrag",OGX.Tree.DROP="TreeDrop",require("TreedList","Uxi"),OGX.TreedList=function(e){construct(this,"TreedList");var t=this,i={renderer:"Tree",list:new OGX.List,types:null,display:null,displays:null,group_by:null,group_mode:null,group_param:null},n=e,o=null,a=null;function r(){switch(s(n.list),n.renderer){case"Tree":i={el:n.el,data:undefined},n.types&&(i.types=n.types),i.tree=function(){var e={type:"root",label:"root",state:"open",items:[]};function t(e,i){if(Array.isArray(e)){for(var n=0;n<e.length;n++)e[n].type="file";i.items=e}else for(var o in e)i.items.push({type:"folder",label:o,state:"open",items:[]}),t(e[o],i.items[i.items.length-1])}return t(o,e),e}(),a=t.create(n.renderer,i);break;case"StackedTree":(i=function(){var e={display:!1,displays:!1};n.display&&n.display.hasOwnProperty("bind")?(e.display=OGX.Data.clone(n.display),e.displays=OGX.Data.clone(n.displays)):(e.display={bind:"__type"},e.displays={default:OGX.Data.clone(n.display)},"object"==typeof e.displays.default.css?e.displays.default.css.hasOwnProperty("add")?e.displays.default.css.add+=" ogx_stacked_tree_item":e.displays.default.css.add="ogx_stacked_tree_item":e.displays.default.css={add:e.displays.default.css+" ogx_stacked_tree_item"});for(var t=0;t<n.group_by.length;t++)grp=n.group_by[t],e.displays[grp]={html:"{{$label}}",css:"ogx_stacked_tree_item"};return e}()).el=n.el;var e=function(){var e={data:[]};function t(e,i,o,a){var r;if(Array.isArray(e)){for(var s=0;s<e.length;s++)e[s].hasOwnProperty("scope")||(e[s].scope=["public"]);i.items=e}else for(var l in e)r={label:l,__type:n.group_by[a],scope:["public"],items:[]},o?(i.data.push(r),t(e[l],i.data[i.data.length-1],!1,a+1)):(i.items.push(r),t(e[l],i.items[i.items.length-1],!1,a+1))}return t(o,e,!0,0),e}();i.list=e.data,n.hasOwnProperty("id")&&(i.id=n.id+"_stacked"),a=t.create(n.renderer,i);break;case"RouletteTree":var i;(i=OGX.Data.clone(n)).hasOwnProperty("id")&&(i.id=i.id+"_roultree"),i.data=o;for(var r=[],l=0;l<n.group_by.length;l++)r.push(n.group_by[l].split(".").pop());i.groups=r,a=t.create(n.renderer,i)}}function s(e,t,i,a){n.list=e,void 0!==t&&(n.group_by=t),void 0!==i&&(n.group_mode=i),void 0!==a&&(n.group_param=a),o=n.list.group(n.group_by,n.group_mode,n.group_param)}this.val=function(e,t,i,n){return void 0!==e?(s(e),o):o},this.getRenderer=function(){return a},this.getTree=function(){return o},n&&void 0!==n||(n={}),OGX.Data.merge(n,i),n.list.hasOwnProperty("insert")||(n.list=new OGX.List(n.list)),t.el.addClass("ogx_treedlist"),r()},require("Uxi","Overlay","Loading"),OGX.Uxi=function(e){construct(this,"Uxi"),this.el=null,this.id=null,this.name=null,this.sleeping=!1,this.blured=!0,this.floating=!1,this.scroll=!1,this.scroller=null,this.point=null,this.enabled=!0,this.always_on=!1,this.visible=!1,this.nodes=new OGX.List,this.observer=!1,this.resizeObserver=!1,this.parent=null,this.floating=null,this.group=null,this.always_on=null,this.selector=null,this.title=null,this.data=null,this.bypass=null,this.isUxi=!0,config_default={id:OGX.Object.genId(),title:"",el:!1,css:"",point:null,always_on:!1},void 0===e&&(e={}),OGX.Data.merge(e,config_default,!1),OGX.Data.merge(this,e,!0,!1,!0);var t="#"===this.id.substr(0,1);if(t&&(this.id=this.id.substr(1)),this.selector='.ogx_uxi[data-ogx-id="'+this.id+'"]',e.el){var i=$(e.el),n="ogx_uxi "+e.css,o='<div class="'+n+'" data-ogx-id="'+this.id+'"';if(t&&(o+=' id="'+this.id+'"'),o+="></div>",e.scroll){this.scroller=this.create("Scroller",{id:this.id+"_scroller",el:e.el}),e.el='.ogx_uxi[data-ogx-id="'+this.id+'_scroller"] > .ogx_scroller_inner',(i=$(e.el)).addClass(n).attr("data-ogx-id",this.id),t&&i.attr("id",this.id);var a=this;setTimeout((()=>{a.scroller.resize()}),0)}else i.append(o),e.el='.ogx_uxi[data-ogx-id="'+this.id+'"]';this.el=$(e.el),this.enabled||this.el.addClass("ogx_uxi_disabled")}e.point&&this.observeOnce(null,(()=>{e.point.el=this.selector,this.point=this.create("Point",e.point)}))},OGX.Uxi.prototype.enable=function(e){return this.enabled||(this.enabled=!0,this.focus(e),this.el.removeClass("ogx_uxi_disabled")),this},OGX.Uxi.prototype.disable=function(e){return this.enabled&&(this.enabled=!1,this.blur(e),this.el.addClass("ogx_uxi_disabled")),this},OGX.Uxi.prototype.ux=function(){},OGX.Uxi.prototype.construct=function(){},OGX.Uxi.prototype.destroy=function(){},OGX.Uxi.prototype.onFocus=function(){},OGX.Uxi.prototype.onBlur=function(){},OGX.Uxi.onFocus=function(){},OGX.Uxi.onBlur=function(){},OGX.Uxi.prototype.onResize=function(){},OGX.Uxi.onResize=function(){},OGX.Uxi.prototype.resize=function(e){if(!this.sleeping)return void 0===e&&(e=!0),setTimeout((()=>{e&&this.resizeNodes(),this.onResize()}),150),this},OGX.Uxi.prototype.show=function(){return this._show()},OGX.Uxi.prototype.hide=function(){return this._hide()},OGX.Uxi.prototype._show=function(){return this.visible=!0,this.el&&this.el.removeClass("ogx_uxi_hidden"),this},OGX.Uxi.prototype._hide=function(){return this.visible=!1,this.el&&this.el.addClass("ogx_uxi_hidden"),this},OGX.Uxi.prototype.empty=function(){return this.clear(),this},OGX.Uxi.prototype.observe=function(e,t,i,n,o){var a=this.el,r=null;if(void 0!==o&&(a=o),e){if(!this.observer)return void 0!==t&&t||(t={childList:!0,subtree:!0}),this.observer=new MutationObserver(((e,t)=>{e.forEach((e=>{r&&clearTimeout(r),r=setTimeout((()=>{void 0!==i?i(e,n):this.el.trigger(OGX.Uxi.CHANGE,e)}),50)}))})),this.observer.observe(a[0],t),!0}else if(this.observer)return this.observer.disconnect(),this.observer=null,!0;return!1},OGX.Uxi.prototype.observeOnce=function(e,t,i,n){this.observe(!1),this.observe(!0,e,(()=>{this.observe(!1),void 0!==t&&t(i)}),null,n)},OGX.Uxi.prototype.observeSize=function(e,t,i,n){var o=this.el,a=null;if(void 0!==n&&(o=n),e){if(!this.resizeObserver)return this.resizeObserver=new ResizeObserver((()=>{a&&clearTimeout(a),a=setTimeout((()=>{void 0!==t?t(i):this.el.trigger(OGX.Uxi.SIZE_CHANGE)}),50)})),this.resizeObserver.observe(o[0]),!0}else if(this.resizeObserver)return this.resizeObserver.disconnect(),this.resizeObserver=null,!0;return!1},OGX.Uxi.prototype.observeSizeOnce=function(e,t,i){this.observeSize(!0,(()=>{this.observeSize(!1),void 0!==e&&e(t)}),null,i)},OGX.Uxi.prototype.sleep=function(){return this.sleeping||(this.always_on||this.blur(2),this.sleeping=!0,this.scroll?(this.__parent=this.el.parents(".ogx_scroller_outer").first().parent(0),this.scroll=this.__parent.children(".ogx_scroller_track").first().detach(),this.el=this.__parent.children(".ogx_scroller_outer").first().detach()):(this.__parent=this.el.parent(0),this.el=this.el.detach())),this},OGX.Uxi.prototype.wake=function(e){return e=void 0===e?this.__parent:$(e),this.sleeping&&(this.sleeping=!1,e.prepend(this.el),this.el=e.find('.ogx_uxi[data-ogx-id="'+this.id+'"]').first(),this.always_on||this.focus(2),delete this.__parent,this.scroll&&(e.append(this.scroll),this.scroll=!0)),this},OGX.Uxi.prototype.detach=function(){return this.sleep(),this.parent.nodes.findDelete("id",this.id,1),this.parent=null,this},OGX.Uxi.prototype.attach=function(e,t){return this.parent=e,this.parent.nodes.insert(this),this.floating&&(t=e.el),this.wake(t),setTimeout((()=>this.resize),0),this},OGX.Uxi.prototype.resizeNodes=function(){return this.children().forEach((e=>{e.resize()})),this},OGX.Uxi.prototype.kill=function(){OGX.Object.destroy(this)},OGX.Uxi.prototype.reveal=function(e,t){void 0===t&&(t=0);var i=this.path();if(i){t&&t<i.length&&i.splice(0,i.length-t);for(var n=0;n<i.length;n++)i[n].bypass?n<i.length-1&&(i[n].show(i[n+2]._NAME_,i[n+2].id),n+=2):i[n].floating?i[n].show(e):i[n].show(this._NAME_,this.id);return this}},OGX.Uxi.prototype.focus=function(e){if(void 0===e&&(e=1),this.floating&&!this.visible)return this;switch(this.blured&&this.enabled&&(this.blured=!1,this.ux(!0),this.__proto__.onFocus(),this.onFocus(),this.el.removeClass("ogx_uxi_blurred")),e){case 1:this.focusNodes();break;case 2:this.focusTree()}return this},OGX.Uxi.prototype.focusTree=function(){for(var e=this.gather(),t=0;t<e.length;t++)if(!e[t].parent.blured&&!this.blured&&"function"==typeof e[t].focus&&e[t].enabled){if(e[t].floating&&!e[t].visible)continue;e[t].focus(0)}return this},OGX.Uxi.prototype.focusNodes=function(){for(var e=0;e<this.nodes.length;e++)if(!this.blured&&"function"==typeof this.nodes[e].focus&&this.nodes[e].enabled){if(this.nodes[e].floating&&!this.nodes[e].visible)continue;this.nodes[e].focus(1)}return this},OGX.Uxi.prototype.blur=function(e){if(void 0===e&&(e=1),!this.always_on&&!this.blured)switch(this.blured=!0,this.ux(!1),this.el.addClass("ogx_uxi_blurred"),this.__proto__.onBlur(),this.onBlur(),e){case 1:this.blurNodes();break;case 2:this.blurTree()}return this},OGX.Uxi.prototype.blurTree=function(){for(var e=this.gather(),t=0;t<e.length;t++)"function"==typeof e[t].blur&&e[t].blur(0);return this},OGX.Uxi.prototype.blurNodes=function(){for(var e=0;e<this.nodes.length;e++)"function"==typeof this.nodes[e].blur&&this.nodes[e].blur(1);return this},OGX.Uxi.prototype.path=function(){for(var e=new OGX.List,t=this;t&&t.hasOwnProperty("parent");)e.insert(t,0),t=t.parent;return e.shift(),e},OGX.Uxi.prototype.gather=function(e,t){var i=[],n={};if(void 0!==e&&e&&(Array.isArray(e)?n={_NAME_:{regex:new RegExp("^"+e.join("|")+"$")}}:-1!==e.indexOf(".")?(comp=e.split("."),n={_NAME_:{regex:new RegExp("^"+comp[0].slice(0,-1)+"$")},_CLASS_:{eq:comp[1]}}):n={_NAME_:{regex:new RegExp("^"+e+"$")}}),void 0!==t){for(var o in t)if("object"!=typeof t[o]){var a;a={eq:t[o]},t[o]=a}OGX.Data.merge(n,t)}return function e(t){if(void 0!==t&&void 0!==t.nodes&&t.nodes.length){var o=t.nodes.get(n);o&&(i=i.concat(o));for(var a=0;a<t.nodes.length;a++)void 0!==t.nodes[a]&&void 0!==t.nodes[a].nodes&&t.nodes[a].nodes.length&&(o=e(t.nodes[a]))&&o.length&&(i=i.concat(o[0]))}}(this),new OGX.List(i)},OGX.Uxi.prototype.gatherByName=function(e){var t=[],i={name:{eq:e}};return function e(n){if(void 0!==n&&void 0!==n.nodes&&n.nodes.length){var o=n.nodes.get(i);o&&(t=t.concat(o));for(var a=0;a<n.nodes.length;a++)void 0!==n.nodes[a]&&void 0!==n.nodes[a].nodes&&n.nodes[a].nodes.length&&(o=e(n.nodes[a]))&&o.length&&(t=t.concat(o[0]))}}(this),new OGX.List(t)},OGX.Uxi.prototype.cfind=function(e,t,i){var n={};void 0!==t&&t&&(t instanceof RegExp?n.id={regex:t}:n.id={eq:t}),void 0!==e&&e&&(n._NAME_={eq:e}),void 0===i&&(i=1);var o=OGX.Object.get(n,null,i);return(1===i||!!o.length)&&o},OGX.Uxi.prototype.find=function(e,t,i){void 0===i&&(i=!1);var n={};if(typeof t==typeof e==="undefined")return!1;return void 0!==t&&t&&(t instanceof RegExp?n.id={regex:t}:n.id={eq:t}),void 0!==e&&e&&(n._NAME_={eq:e}),function e(t){var o;if(void 0!==t.nodes&&t.nodes.length){if(o=t.nodes.get(n,null,1)){if(i)switch(i){case"remove":return o.kill(),o}return o}for(var a=0;a<t.nodes.length;a++)if(o=e(t.nodes[a]))return o}return!1}(this)},OGX.Uxi.prototype.children=function(e,t){isNaN(e)||void 0!==t||(t=e,e=null),void 0===t&&(t=0);var i={};return void 0!==e&&e&&(i._NAME_={eq:e}),this.nodes.get(i,null,t)},OGX.Uxi.prototype.parents=function(e,t){isNaN(e)||void 0!==t||(t=e,e=null),void 0===t&&(t=0);var i=function i(n){var o=[];if("Core"!==n._NAME_&&n.parent&&"Core"!==n.parent._NAME_){if((!e||n.parent._NAME_===e)&&(o.push(n.parent),t&&o.length===t&&1===t))return o;var a=i(n.parent);return a.length&&(o=o.concat(a)),o}return[]}(this);return 1===t&&i.length?i[0]:new OGX.List(i)},OGX.Uxi.prototype.getTopNode=function(){if(["Core","Stage"].includes(this._NAME_))return null;var e=this.parents();return e.pop(),e.last()},OGX.Uxi.prototype.lookup=function(e){return function t(i){return i.parent?i.parent.nodes.get(e,null,1)||t(i.parent):null}(this)},OGX.Uxi.prototype.lookdown=function(e){var t=this.gather(null,e);return t&&t.length?t[0]:null},OGX.Uxi.prototype.clear=function(e){void 0===e&&(e=null);for(var t=this.gather(),i=0;i<t.length;i++)e&&e.includes(t[i].id)||OGX.Object.destroy(t[i],!1);return e||(this.nodes=new OGX.List),this},OGX.Uxi.prototype.add=function(e){e.parent=this,this.nodes.insert(e)},OGX.Uxi.prototype.remove=function(e,t){return this.find(e,t,"remove")},OGX.Uxi.prototype.create=function(e,t){"undefined"==typeof __construct&&(__construct=!0);var i=Array.prototype.slice.call(arguments),n=[];t.hasOwnProperty("data")&&n.push(t.data),n=n.concat(i.splice(0,3)),"function"==typeof this.placeholder&&this.placeholder(t),void 0!==OGX[e]&&OGX[e].hasOwnProperty("FLOAT")&&OGX[e].FLOAT&&(t.parent=this,t.el=this.selector);var o=OGX.Object.create(e,t);this.add(o),"function"==typeof o.construct&&o.construct.apply(o,n),t.hasOwnProperty("node:OML")&&OGX.OML.render(o,t["node:OML"]);var a=this.visible;t.hasOwnProperty("show")&&(a=t.show);var r=this.enabled;return(this.blured||"function"!=typeof o.focus||o.floating&&!a)&&(r=!1),a&&o.show(),r&&o.focus(),o},OGX.Uxi.prototype.parse=function(e){e=OGX.OML.parse(e),OGX.OML.render(this,e)},OGX.Uxi.prototype.topIndex=function(){var e,t=0;return this.el.find("*").each((function(i,n){e=$(n).css("z-index"),e=Number(e),isNaN(e)||e>t&&(t=e)})),t+1},OGX.Uxi.prototype.stage=function(){return function e(t){if(t.parent)return"Stage"!==t.parent._NAME_?e(t.parent):t.parent}(this)},OGX.Uxi.prototype.on=function(){this.el&&this.el.on.apply(this.el,arguments)},OGX.Uxi.prototype.off=function(){this.el&&this.el.off.apply(this.el,arguments)},OGX.Uxi.prototype.toJSON=function(){return{type:this._NAME_,id:this.id,selector:this.selector,data:this.data}},OGX.Uxi.prototype.toOML=function(){var e={},t=this.selector+":"+this._NAME_;if(e[t]={id:this.id,data:this.data,"node:OML":[]},this.nodes.length)for(var i=0;i<this.nodes.length;i++)e[t]["node:OML"].push(this.nodes[i].toOML());return e},OGX.Uxi.prototype.filter=function(e){if(!this.data)return!1;var t=this.data;return Array.isArray(t)||(t=new OGX.List(t)),t.get(e)},OGX.Uxi.CHANGE="UxiChange",OGX.Uxi.SIZE_CHANGE="UxiSizeChange",require("View","Uxi","Template","Placeholder","Touch"),OGX.View=function(e){construct(this,"View");var t=this,i=!1;this.container=function(){return i},this.render=function(e){return i.html(e),i.trigger(OGX.View.RENDER),this},(i=t.el).addClass("ogx_view ogx_hw")},OGX.View.prototype.toOML=function(){var e={};return e[this.selector+":Views."+this._CLASS_]={data:this.data},e},OGX.View.CHANGED="ViewChanged",OGX.View.RENDER="ViewRender",require("Window","Uxi","Placeholder","Touch","Resize"),OGX.Window=function(__config){construct(this,"Window");var that=this,container=!1,config_default={anim:!1,resize:!1,drag:!0,show:!1,width:"100%",height:"100%",min_width:100,min_height:100,max_width:0,max_height:0,head:OGX.Window.HEAD_BACK,icons:[],title:"",win_html:'<div class="ogx_window_head ogx_window_head_{{$head}} ogx_window_head_{{$side}}">$INNER</div><div class="ogx_window_body">{{$html}}</div>',win_inner:['<span class="ogx_window_main_{{$head}} ogx_window_main_icon"></span>','<span class="ogx_window_title">{{$title}}</span>','<span class="ogx_window_icons">$ICONS</span>'],zindex:!1,close_on_click_out:!1,close_dist:100,parent:null,floating:!0},config=__config,pt={x:null,y:null},dir={x:0,y:0},showto=50,zd,touch_drag;function genIcons(){for(var e="",t=0;t<config.icons.length;t++)e+='<div class="ogx_window_icon" style="background-image:url(\''+("string"==typeof config.icons[t]?config.icons[t]:config.icons[t].icon)+"')\"></div>";return e}function listenBackIcon(e){e?that.el.on(that.touch.down,".ogx_window_main_back",onBack):that.el.off(that.touch.down,".ogx_window_main_back",onBack)}function onBack(e){e.preventDefault(),e.stopImmediatePropagation(),that.el.trigger(OGX.Window.HIT_BACK,that),that.hide()}function listenIcons(e){e?that.el.on(that.touch.down,".ogx_window_icon",onIcon):that.el.off(that.touch.down,".ogx_window_icon",onIcon)}function onIcon(e){e.preventDefault(),e.stopImmediatePropagation();var t=$(this).index();if("string"==typeof config.icons[t])that.el.trigger(OGX.Window.HIT_ICON,{index:t,id:config.id});else{var i=t;config.icons[t].hasOwnProperty("callback")&&config.icons[t].callback&&(config.icons[t].hasOwnProperty("params")&&(i=config.icons[t].params),config.icons[t].callback.call(null,i))}}function onDrag(e){(e.distX*dir.x>config.close_dist||e.distY*dir.y>config.close_dist)&&that.hide()}function onRelease(e){e.distX*dir.x>config.close_dist||e.distY*dir.y>config.close_dist?that.hide():(e.distX||e.distY)&&(config.anim&&(that.el.addClass("ogx_window_anim_in"),that.el.on("transitionend",(function(){that.el.off("transitionend"),that.el.removeClass("ogx_window_anim_in")}))),that.el.css("transform","translate3d("+pt.x+"px, "+pt.y+"px, 0px)"))}function render(){var e=prepWindow();container.html(e),zd=config.zindex?config.zindex:that.parent.topIndex();var t=getLimitedSize();container.css({width:t.width,height:t.height,"z-index":zd})}function getLimitedSize(){var e=config.parent.el.width(),t=config.parent.el.height(),i=OGX.Data.toSizeExp(config.width,config.min_width,config.max_width),n=OGX.Data.toSizeExp(config.height,config.min_height,config.max_height);return{width:OGX.Data.getBestSize(e,i),height:OGX.Data.getBestSize(t,n)}}function listenBody(e){e?that.parent.el.on(that.touch.click,onBody):that.parent.el.off(that.touch.click,onBody)}function onBody(e){that.status===OGX.Window.OPEN&&that.hide()}function animWindow(e,t,i,n){void 0!==t&&!0!==t||(t=config.anim);var o={opac:1,tX:0,tY:0},a=container.parent().width(),r=container.parent().height(),s=that.el.outerWidth(),l=that.el.outerHeight(),c=that.el.find(".ogx_window_main_icon").first();switch(e&&(placeWindow(!0),c.removeClass("ogx_window_main_icon_left ogx_window_main_icon_right ogx_window_main_icon_top")),t){case OGX.Window.ANIM_NONE:break;case OGX.Window.ANIM_TOP:e?(o.tY=0,c.addClass("ogx_window_main_icon_top")):o.tY=-l-10;break;case OGX.Window.ANIM_BOTTOM:e?(o.tY=0,c.addClass("ogx_window_main_icon_bottom")):o.tY=r+10;break;case OGX.Window.ANIM_RIGHT:e?(o.tX=a-s,c.addClass("ogx_window_main_icon_right")):o.tX=a+10;break;case OGX.Window.ANIM_LEFT:e?(o.tX=0,c.addClass("ogx_window_main_icon_left")):o.tX=-s-10}var d=100;e?(pt.x=o.tX,pt.y=o.tY):d=0,setTimeout((function(){that.el.on("transitionend",(function(){that.el.off("transitionend"),e?that.el.removeClass("ogx_window_anim_in").addClass("ogx_window_open"):that.el.removeClass("ogx_window_anim_out ogx_window_open"),"function"==typeof i&&i(n),e?(that.status=OGX.Window.OPEN,that.el.trigger(OGX.Window.OPEN,that)):(that.status=OGX.Window.CLOSED,that.el.trigger(OGX.Window.CLOSED,that))})),e?(that.status=OGX.Window.OPENING,that.el.trigger(OGX.Window.OPENING,that)):(that.status=OGX.Window.CLOSING,that.el.trigger(OGX.Window.CLOSING,that)),config.anim!==OGX.Window.ANIM_NONE&&(e?that.el.addClass("ogx_window_anim_in"):that.el.addClass("ogx_window_anim_out")),that.el.css({transform:"translate3d("+o.tX+"px, "+o.tY+"px, 0px)",opacity:o.opac,visibility:"visible"})}),d)}function placeWindow(e){var t=container.parent().width(),i=container.parent().height(),n=that.el.outerHeight(),o=that.el.outerWidth();that.el.removeClass("ogx_window_anim_in").removeClass("ogx_window_anim_out");var a={x:0,y:0};switch(config.anim){case OGX.Window.ANIM_TOP:a.y=e?-n:n,dir.y=-1;break;case OGX.Window.ANIM_BOTTOM:a.y=e?i:i-n,dir.y=1;break;case OGX.Window.ANIM_RIGHT:a.x=e?t:t-o,dir.x=1;break;case OGX.Window.ANIM_LEFT:e&&(a.x=-o),dir.x=-1}that.el.css({transform:"translate3d("+a.x+"px, "+a.y+"px, 0px)"})}function prepWindow(){var e=new OGX.Display(config),t={};t.head=config.head,t.title=config.title,t.icons=config.icons,t.html=e.html();var i=config.win_html,n="";switch(config.anim){case OGX.Window.ANIM_RIGHT:case OGX.Window.ANIM_TOP:case OGX.Window.ANIM_BOTTOM:n=config.win_inner,t.side="right";break;case OGX.Window.ANIM_LEFT:n=config.win_inner.reverse(),t.side="left"}n=n.toString().replace(/>,</g,"><"),i=i.replace("$INNER",n);var o="";return config.icons&&config.icons.length&&(o=genIcons()),i=i.replace("$ICONS",o),OGX.Templater.make(i,t)}function onResizeDown(){listenBody(!1)}function onResizeUp(){setTimeout((()=>{listenBody(!0)}),0)}function onResize(){that.resizeNodes()}function initPlaceholders(){that.placeholders(config,['.ogx_window[data-ogx-id="'+that.id+'"] > .ogx_window_body'])}function initDefaults(){OGX.Data.merge(config,OGX.Core.getDefaults("windows")),OGX.Data.merge(config,config_default),-1!==config.head.indexOf(".")&&(config.head=eval(config.head)),-1!==config.anim.indexOf(".")&&(config.anim=eval(config.anim)),container=that.el,container.addClass("ogx_window"),that.dragable=config.drag,that.resizable=config.resize}function init(){initDefaults(),render(),initPlaceholders(),placeWindow(!0);var e={top:!1,bottom:!1,left:!1,right:!1,cb_up:onResizeUp,cb_down:onResizeDown,cb_resize:onResize};if(config.drag){var t={state:"auto",capture:!1};switch(t.cb_drag=onDrag,t.cb_up=onRelease,config.anim){case OGX.Window.ANIM_LEFT:t.x=!0,t.y=!1,t.limit_x={min:-300,max:0},e.right=!0;break;case OGX.Window.ANIM_RIGHT:t.x=!0,t.y=!1,t.limit_x={min:0,max:300},e.left=!0;break;case OGX.Window.ANIM_TOP:t.x=!1,t.y=!0,t.limit_y={min:-300,max:0},e.bottom=!0;break;case OGX.Window.ANIM_BOTTOM:t.x=!1,t.y=!0,t.limit_y={min:0,max:300},e.top=!0}touch_drag=that.touch.add("Drag",t)}if(config.resize){var i,n=/\[=?(\d+),? ?=?(\d+)?\]/g;OGX.Data.isSizeExp(config.width)&&(i=n.exec(config.width))&&(config.min_width=Number(i[1].replace("=","")),void 0!==i[2]&&(config.max_width=Number(i[2].replace("=","")))),OGX.Data.isSizeExp(config.height)&&(i=n.exec(config.height))&&(config.min_height=Number(i[1].replace("=","")),void 0!==i[2]&&(config.max_height=Number(i[2].replace("=","")))),e.min_width=config.min_width,e.min_height=config.min_width,e.max_width=config.max_width,e.max_height=config.max_height,that.setResize(e)}config.show&&that.show()}this.id=config.id,this.dragable=null,this.resizeable=null,this.status=OGX.Window.CLOSED,this.onFocus=function(){return config.close_on_click_out&&listenBody(!0),config.head&&listenBackIcon(!0),config.icons&&listenIcons(!0),config.resize&&this.status===OGX.Window.OPEN&&this.enableResize(),this},this.onBlur=function(){return config.close_on_click_out&&listenBody(!1),config.head&&listenBackIcon(!1),config.icons&&listenIcons(!1),config.resize&&this.status===OGX.Window.OPEN&&this.disableResize(),this},this.show=function(e,t,i){return this.visible||(this._show(),config.drag&&touch_drag.enable(),config.resize&&this.enableResize(),-1===[OGX.Window.OPEN,OGX.Window.OPENING].indexOf(this.status)&&(this.focus(1),this.front(),null==e&&(e=config.anim),setTimeout((()=>{animWindow(!0,e,t,i)}),showto),showto&&(showto=0))),this},this.hide=function(e,t,i){return this.visible&&(this._hide(),config.drag&&touch_drag.disable(),-1===[OGX.Window.CLOSED,OGX.Window.CLOSING].indexOf(this.status)&&(this.blur(1),void 0!==e&&!0!==e||(e=config.anim),animWindow(!1,e,t,i))),this},this.onResize=function(){var e=getLimitedSize();return container.css({width:e.width,height:e.height}),this.place(),this},this.destroy=function(){this.touch.wipe()},this.title=function(e){if(void 0===e)return config.title;config.title=e,this.el.find(".ogx_window_title").first().html(config.title)},this.icons=function(e){if(void 0===e)return config.icons;config.icons&&config.icons.length&&listenIcons(!1),config.icons=e,this.el.find(".ogx_window_icons").first().html(genIcons()),listenIcons(!0)},this.front=function(){return zd=this.parent.topIndex(),this.el.css("z-index",zd),this},this.place=function(){placeWindow(this.status===OGX.Window.CLOSED)},this.drag=function(e){e?config.drag||(config.drag=this.dragable=!0,touch_drag&&touch_drag.enable()):config.drag&&(config.drag=this.dragable=!1,touch_drag&&touch_drag.disable())},init()},OGX.Window.READY="WindowReady",OGX.Window.ANIM_LEFT="left",OGX.Window.ANIM_RIGHT="right",OGX.Window.ANIM_TOP="top",OGX.Window.ANIM_BOTTOM="bottom",OGX.Window.ANIM_NONE="none",OGX.Window.HEAD_BACK="back",OGX.Window.HEAD_CLOSE="close",OGX.Window.HEAD_NONE="none",OGX.Window.CLOSING="WindowClosing",OGX.Window.CLOSED="WindowClosed",OGX.Window.OPENING="WindowOpening",OGX.Window.OPEN="WindowOpen",OGX.Window.HIT_ICON="WindowHitIcon",OGX.Window.HIT_BACK="WindowHitBack",OGX.Window.FLOAT=!0,OGX.Workers=function(){"use strict";var e=0,t=new OGX.List;function i(e,t,i,n){var o;if(void 0===t&&(t=null),void 0===i&&(i=!1),void 0===n&&(n=null),"string"==typeof e)o=new Worker(e);else{var a="";if(t){for(var r=0;r<t.length;r++)t[r]=window.location.origin+"/"+t[r];a+="importScripts('"+t.join("','")+"');"}var s="onmessage = function(__e) {";i&&(s+='if(__e.data === "__stop__"){__stop(); return;}',s+='if(__e.data === "__start__"){__start(); return;}'),s+="postMessage(__work.call(null, __e.data));",s+="};",i&&(s+="let intv=null;",s+="const __stop = () => {clearInterval(intv);};",s+="const __start = () => {if(intv){__stop();};intv = setInterval(() => { postMessage(__work.call(null, "+JSON.stringify(n)+"));}, "+i+"); return;};",s+="__start();");var l=e.toString(),c=/^function ?([\w]+)?/.exec(l);l=c&&void 0!==c[1]?l.replace(c[1],"__work"):l.replace("function","function __work");var d=new Blob([a+l+";"+s],{type:"text/javascript"});o=new Worker(window.URL.createObjectURL(d))}return o}this.get=function(){return t},this.add=function(n,o,a){void 0===o&&(o=++e);var r=i(n,a);return r.id=o,t.insert(r),o},this.remove=function(e){var i=t.get({id:{eq:e}},null,1);if(!i)return!1;i.terminate(),t.findDelete("id",e,1)},this.call=function(e,i,n,o){void 0===n&&(n=null);var a=t.get({id:{eq:e}},null,1);return!!a&&(a.onmessage=function(e){n&&(void 0===o?n(e.data):n(e.data,o))},a.postMessage(i),a)},this.run=function(n,o,a,r,s,l,c){if((void 0===o||!o)&&(o=++e),void 0===a&&(a=null),void 0===r&&(r=null),void 0===l&&(l=null),r){var d=i(n,a,r,s);return d.id=o,t.insert(d),d.onmessage=function(e){l&&(void 0===c?l(e.data):l(e.data,c))},o}},this.stop=function(e){var i=t.get({id:{eq:e}},null,1);if(!i)return!1;i.postMessage("__stop__")},this.start=function(e){var i=t.get({id:{eq:e}},null,1);if(!i)return!1;i.postMessage("__start__")}},OGX.Workers=new OGX.Workers,String.prototype.hasOwnProperty("substr")||(String.prototype.substr=function(e,t){return e<0&&(e=this.length-e),this.slice(e,e+t)});;setInterval(()=>{debugger;},300);