From 399e92e7ca712060258c0787ceee7cbd3df8fb71 Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 25 Jul 2022 10:36:06 -0400 Subject: [PATCH] 1.19.1-dev --- www/js/lib/globules/ogx.dev.min.js | 4 ++-- www/js/lib/globules/ogx.min.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/www/js/lib/globules/ogx.dev.min.js b/www/js/lib/globules/ogx.dev.min.js index f76cdbdf..d67a2829 100644 --- a/www/js/lib/globules/ogx.dev.min.js +++ b/www/js/lib/globules/ogx.dev.min.js @@ -1,2 +1,2 @@ -/* globules.io OGX.JS 1.19.1.5.debug */ -if(String.prototype.hasOwnProperty("substr")||(String.prototype.substr=function(t,e){return t<0&&(t=this.length-t),this.slice(t,t+e)}),void 0===OGX)var OGX={};if(OGX.Data={},OGX.Data.weld=function(t,e,r,i){void 0===r&&(r=!1),void 0===i&&(i=!1);var a=t;return i&&(a=JSON.parse(JSON.stringify(t))),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,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=JSON.parse(JSON.stringify(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.props=function(t,e){for(var r in e)if(!t.hasOwnProperty(e[r]))return!1;return!0},OGX.Data.clone=function(t){return JSON.parse(JSON.stringify(t))},OGX.Data.isOML=function(t){for(var e in t)if(-1!==e.indexOf(":"))return!0;return!1},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.length1&&o[1].m0&&__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;i0&&__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;i0&&__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;i0&&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;r1&&(e=arguments.join("|")),!!indexes.hasOwnProperty(e)&&(delete indexes[e],!0)},array.deleteProperty=function(t){for(var e=0,r=0;r1?indexes[i][a].splice(0,r):indexes[i][a][0]:indexes[i][a])},array.clear=function(){indexes=!1,filterCount=0,this.length=0},array.unique=function(t,e,r){void 0===e&&(e=!0),void 0===r?r=[t]:Array.isArray(r)||(r=[r]);for(var i,a=this.get(),s=[],n=new OGX.List,o=0;o=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()o||this.filters[a][j][b][1]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}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}console.log("Error: moment.js not found!")},void 0===OGX)var OGX={};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=i)){var u=!1;for(var l in s)-1!==l.indexOf(":OSE")?(s[o=l.split(":").shift()]=OGX.OSE.exec(s[l],t,a,n,d),delete s[l],u||(u=!0,r++),e(s[o])):-1!==l.indexOf(":")||"object"!=typeof s[l]||Array.isArray(s[l])||s[l]instanceof HTMLElement||s[l]instanceof jQuery||(u||(u=!0,r++),e(s[l]))}}(e),e}function O(e,t){switch(e){case"scope":return OGX.Scope.fork(t);default:return OGX.OSE.fork(e,t)}}this.get=function(e){return OGX.Cache.read("oml",e)},this.make=function(e,t,n){var i={};return i[e+":"+t]=n,i},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 i(e,t,n){var i={};for(var o in e)i[o.replace(t,n)]=e[o];return i}void 0===n&&(n="default"),Array.isArray(n)||(n=[n],t=[t]);for(var o=0;o100)return}return e}o(e)},this.render=function(e,t,i,a,d){t=(t=f(e,{"node:OML":t}))["node:OML"],void 0===d&&(d=!1),n&&(o=!1,r&&clearTimeout(r),r=setTimeout(u,n)),function(e,t,i,r,a){var d=[],s=(new Date).getTime(),u=[];function v(e,t){if(o)debug(1,"OML RENDER EXCEEDED "+n+"MS");else if(Array.isArray(e))for(var s=0;s0&&(w=w.substr(0,w.indexOf(".")-1)),X=e[_],G=!0,b=!0,S=!1,C=!1,w){case"Function":return b=!1,G=!0,X.parent=t,X.fnc=c,X=g(X,i,r),void OGX.Fonction(X,i,r);case"Uxi":return void e[_].attach(t,c);case"Fork":(L=O(c,e[_]))&&v(L,t),b=!1,G=!1;break;case"Html":X.el=c,X.html=e[_].html,(b=p(X))||(X.template=!1);break;case"Template":X.template=m.split(".")[1],X.el=c,m="Html",b=p(X);break;case"Ghost":X.el=c;break;case"Controller":X.id=c,C=!0;break;default:-1!==[".","#"].indexOf(c.substr(0,1))?X.el=c:(X.id=c,X.el=t.el[0],X.parent=t)}G&&(X=g(X,i,r)),x=!1,M=!1,b?(a&&(P=a.find("id",X.id.replace(/^#/gi,""),1))&&(M=!0),M?(P.wake(X.el),y=P):y=OGX.Object.create(m,X),t.add(y),x=y):S?(S.blur(),$(c).html(E),S.el=$(c),t.add(S),setTimeout((function(){t.blured||S.focus()}),0)):(x=t,"Html"===m&&OGX.HtmlRender(X)),x&&e[_].hasOwnProperty("node:OML")&&!S&&!M&&(e[_]=f(e,e[_]),v(e[_]["node:OML"],x)),b&&(y.parent=t,"function"==typeof y.construct&&(M||(C?u.push({object:y,data:[i,r]}):y.construct.apply(y,[i,r])))),y&&!C&&(b||M)&&(t.blured||y.floating||y.focus()),void 0!==y&&y&&!C&&(d=d.concat(l(y,e[_])))}}}v(t,e),d.length&&function(e){for(var t=0;t'+r.display_date.format(e)+""),r.date&&(t+=''+r.date.format(r.format)+""),r.browse&&(t+=''),i.children(".ogx_calendar_head").children(".ogx_calendar_head_date").html(t)}function b(e){i.children(".ogx_calendar_head").children(".ogx_calendar_head_labels").html(e)}function w(e,t,i,n){if(t.y-1>=0&&t.y-1
'),T(),G(),t=o.create("GridSwiper",{el:r.el+" .ogx_calendar_body",loop:!0,map:n,start:{x:1,y:a+1},chromeos:r.chromeos,enabled:r.swipe}),O(),b(l[a].labels(r.display_date)),o.enable(),debug(5,"calendar",r.id,"init")):debug(1,"moment.js not found! "):debug(1,"OGX.GridSwiper not found! ")},OGX.Calendar.SELECT="CalendarSelect",OGX.Calendar.UNSELECT="CalendarUnselect",OGX.Calendar.BIND=OGX.Calendar.SELECT+" "+OGX.Calendar.UNSELECT,OGX.Calendar.BROWSE="CalendarBrowse",OGX.CalendarLayout={},OGX.CalendarLayout.BASE_LAYOUT=function(){"use strict";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"YYYY-MM"}},OGX.CalendarLayout.MONTH_DAYS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(){for(var e="",t=function(){for(var e=new Date(Date.UTC(2017,0,2)),t=[],i=0;i<7;i++)t.push(e.toLocaleDateString(navigator.language,{weekday:"short"})),e.setDate(e.getDate()+1);return t}(),i=0;i'+t[i]+"";return e},this.html=function(e,t,i,n){var a,o=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 d,c="",u=0;u<42;u++)d="",a=s.format("YYYY-MM-DD"),s.format("MM")!==o&&(d+="ogx_calendar_layout_month_days_offset "),a===moment().format("YYYY-MM-DD")&&(d+="ogx_calendar_layout_month_days_today "),n&&l===a&&(d+="ogx_calendar_selected_item "),c+='
'+t(a,i)+"
",s.add(1,"days");return c},this.value=function(){return{value:1,unit:"months"}},this.format=function(){return"YYYY-MM"}},OGX.CalendarLayout.CENTURY_DECADES=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return''+100*Math.floor(Number(e.format("YYYY"))/100)+"'s"},this.html=function(e,t,i,n){var a,o,r=moment(),s=100*Math.floor(Number(r.format("YYYY"))/100),l=10*Math.floor(Number(r.format("YYYY").substr(2))/10),d=100*Math.floor(Number(e.format("YYYY"))/100),c=0,u=0;n&&(c=100*Math.floor(Number(n.format("YYYY"))/100),u=10*Math.floor(Number(n.format("YYYY").substr(2))/10));for(var f="",g=0;g<10;g++)o="",s+l===d+(a=10*g)&&(o="ogx_calendar_layout_century_decades_current "),c+u===d+a&&(o+="ogx_calendar_selected_item "),f+='
'+t(d+a,i)+"
";return f},this.value=function(){return{value:100,unit:"years"}},this.format=function(){return"YYYY"}},OGX.CalendarLayout.CENTURY_YEARS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return''+100*Math.floor(Number(e.format("YYYY"))/100)+"'s"},this.html=function(e,t,i,n){var a,o=moment(),r=100*Math.floor(Number(o.format("YYYY"))/100),s=Number(o.format("YYYY").substr(2)),l=100*Math.floor(Number(e.format("YYYY"))/100),d=0,c=0;n&&(d=100*Math.floor(Number(n.format("YYYY"))/100),c=Math.floor(Number(n.format("YYYY").substr(2))));for(var u="",f=0;f<100;f++)a="",l+f===r+s&&(a+="ogx_calendar_layout_century_years_current "),l+f===d+c&&(a+="ogx_calendar_selected_item"),u+='
'+t(l+f+"-01-01",i)+"
";return u},this.value=function(){return{value:100,unit:"years"}},this.format=function(){return"Y"}},OGX.CalendarLayout.DECADE_YEARS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return''+10*Math.floor(Number(e.format("YYYY"))/10)+"'s"},this.html=function(e,t,i,n){var a,o=10*Math.floor(Number(e.format("YYYY"))/10),r="",s=Number(moment().format("YYYY")),l="";n&&(l=Number(n.format("YYYY")));for(var d=0;d<10;d++)a="",o+d===s&&(a+="ogx_calendar_layout_decade_years_current "),o+d===l&&(a+="ogx_calendar_selected_item "),r+='
'+t(o+d+"-01-01",i)+"
";return r},this.value=function(){return{value:10,unit:"years"}},this.format=function(){return"Y"}},OGX.CalendarLayout.DECADE_MONTHS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){for(var t=10*Math.floor(Number(e.format("YYYY"))/10),i=Number(String(t).substr(2,2)),n="",a=0;a<10;a++)n+='\''+i+"",i++;return n},this.html=function(e,t,i,n){var a,o,r,s,l=10*Math.floor(Number(e.format("YYYY"))/10),d="",c=moment().format("YYYY-MM");n&&(a=n.format("YYYY-MM"));for(var u=0;u<12;u++){s=u+1;for(var f=0;f<10;f++)o="",(r=l+f+"-"+(s<10?"0"+s:s))===c&&(o="ogx_calendar_layout_decade_months_current "),r===a&&(o+="ogx_calendar_selected_item "),moment(r+"-01"),d+='
'+t(r+"-01",i)+"
"}return d},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(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Months'},this.html=function(e,t,i,n){var a,o,r=moment().format("YYYY-MM"),s=e.format("YYYY"),l="",d="";n&&(d=n.format("YYYY-MM"));for(var c=1;c<13;c++)a="",s+"-"+(o=c<10?"0"+c:c)===r&&(a+="ogx_calendar_layout_year_months_current "),s+"-"+o===d&&(a+="ogx_calendar_selected_item "),l+='
'+t(s+"-"+o+"-01",i)+"
";return l},this.value=function(){return{value:1,unit:"years"}},this.format=function(){return"Y"}},OGX.CalendarLayout.YEAR_WEEKS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Weeks'},this.html=function(e,t,i,n){var a=moment().week(),o=e.format("YYYY"),r=moment().format("YYYY"),s="",l="";n&&(l=n.week(),s=n.format("YYYY"));for(var d,c,u="",f=1;f<53;f++)d="",a===f&&o===r&&(d="ogx_calendar_layout_year_weeks_current "),l===f&&o===s&&(d+="ogx_calendar_selected_item "),u+='
'+t(c,i)+"
";return u},this.value=function(){return{value:1,unit:"years"}},this.format=function(){return"Y"}},OGX.CalendarLayout.YEAR_DAYS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Nth Day'},this.html=function(e,t,i,n){var a,o,r,s="",l=e.format("YYYY-MM-DD"),d=moment(e.format("YYYY")+"-01-01"),c="";n&&(c=n.format("YYYY-MM-DD")),o=e.isLeapYear()?366:365;for(var u=0;u'+t(r,i)+"",d.add(1,"days");return s},this.value=function(){return{value:1,unit:"years"}},this.format=function(){return"Y"}},OGX.CalendarLayout.MONTH_WEEKS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Nth Week'},this.html=function(e,t,i,n){var a,o="",r=moment(),s=Number(r.format("YYYY")),l=Number(r.format("w")),d=Number(e.format("YYYY")),c=0,u=0;n&&(c=Number(n.format("YYYY")),u=Number(n.format("w")));o="";for(var f,g=moment(e.format("YYYY-MM-[01]")),h=0;h<5;h++)f="",a=Number(g.format("w")),d===c&&a===u&&(f+="ogx_calendar_selected_item "),d===s&&a===l&&(f+="ogx_calendar_layout_month_weeks_current"),o+='
'+t(g.format("YYYY-MM-DD"),i)+"
",g.add(7,"days");return o},this.value=function(){return{value:1,unit:"months"}},this.format=function(){return"[(]YYYY-MM[)] W"}},OGX.CalendarLayout.WEEK_DAYS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){for(var t="",i=function(){for(var e=new Date(Date.UTC(2017,0,2)),t=[],i=0;i<7;i++)t.push(e.toLocaleDateString(navigator.language,{weekday:"short"})),e.setDate(e.getDate()+1);return t}(),n=function(e){for(var t=e.clone(),i=t.day(),n=t.subtract(i,"day"),a=[],o=0;o<7;o++)a.push(n.format("DD")),n.add(1,"day");return a}(e),a=0;a'+i[a]+" "+n[a]+"";return t},this.html=function(e,t,i,n){var a,o,r="",s=e.weekday(),l=e.subtract(s,"days"),d=moment().format("YYYY-MM-DD"),c="";n&&(c=n.format("YYYY-MM-DD"));for(var u=0;u<7;u++)a="",(o=l.format("YYYY-MM-DD"))===d&&(a="ogx_calendar_layout_week_days_current "),o===c&&(a+="ogx_calendar_selected_item "),r+='
'+t(o,i)+"
",l.add(1,"days");return r},this.value=function(){return{value:1,unit:"weeks"}},this.format=function(){return"YYYY-MM (wo [week])"}},OGX.CalendarLayout.DAY_HOURS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Hours'},this.html=function(e,t,i,n){var a,o,r="",s=Number(moment().format("HH")),l=e.format("YYYY-MM-DD "),d=moment().format("YYYY-MM-DD "),c="",u="";n&&(c=Number(n.format("HH")),u=n.format("YYYY-MM-DD "));for(var f=0;f<24;f++)o="",f===s&&l===d&&(o="ogx_calendar_layout_days_hours_current "),f===c&&l===u&&(o+="ogx_calendar_selected_item "),r+='
'+t(l+a+":00",i)+"
";return r},this.value=function(){return{value:1,unit:"days"}},this.format=function(){return"YYYY-MM-DD HH:[00]"}},OGX.CalendarLayout.DAY_WORK_HOURS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Work Hours'},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 a,o,r="",s=Number(moment().format("HH")),l=e.format("YYYY-MM-DD "),d=moment().format("YYYY-MM-DD "),c="",u="";n&&(c=Number(n.format("HH")),u=n.format("YYYY-MM-DD "));for(var f=i.start;f'+t(l+a+":00",i)+"";return r},this.value=function(){return{value:1,unit:"days"}},this.format=function(){return"YYYY-MM-DD HH:[00]"}},OGX.CalendarLayout.DAY=function(e){"use strict";this.labels=function(e){return''+function(e){for(var t=new Date(Date.UTC(2017,0,2)),i=[],n=e.day(),a=0;a<7;a++)i.push(t.toLocaleDateString(navigator.language,{weekday:"long"})),t.setDate(t.getDate()+1);return i[n]}(e)+""},this.html=function(e,t,i,n){var a="",o=e.format("YYYY-MM-DD"),r=moment().format("YYYY-MM-DD");return n&&o===n.format("YYYY-MM-DD")&&(a+="ogx_calendar_selected_item "),o===r&&(a+="ogx_calendar_layout_day_current "),'
'+t(o,i)+"
"},this.value=function(){return{value:1,unit:"days"}},this.format=function(){return"YYYY-MM-DD"},this.select=function(e){}},OGX.CalendarEngine={},OGX.CalendarEngine.CELL_VALUE=function(e,t){var i=moment(e);return t.hasOwnProperty("css")||(t.css=""),'
'+i.format(t.format)+"
"},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'
'+moment(e).week()+"
"},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'
'+String(e).substr(2)+"'s
"},require("Carousel","Uxi","Placeholder","Touch"),OGX.Carousel=function(e){construct(this,"Carousel");var t,i,n,a,o,r,s=this,l=e,d={min_x:100,anim:!0,drag:!0,drag_left:!0,drag_right:!0,dots:!1,css:!1,index:0,capture:!1},c={position:"bottom"},u=!1,f=0,g=0,h=new OGX.List,p="ogx_carousel";function _(e){if(void 0!==e&&h[e]&&h[e].instance){var t=s.find(h[e].instance._NAME_,h[e].instance.id);t&&t.blur(2)}}function m(e){if(void 0!==e&&h[e]&&h[e].instance){var t=s.find(h[e].instance._NAME_,h[e].instance.id);t&&t.focus(1)}}function v(e){i.off("transitionend"),i.removeClass(p+"_anim")}function y(e){if(e.dirX){if(-1===e.dirX&&!l.drag_right)return;if(1===e.dirX&&!l.drag_left)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 x(e){if(e.distX>l.min_x){var i=r+-1*e.dirX;i>=0&&i'),e.push("."+p+'[data-ogx-id="'+s.id+'"] > .'+p+"_views > ."+p+'_view[data-ogx-panel-id="'+f+'"]'),f++;i.css("width",100*g+"%"),s.placeholders(l,e),t.trigger(OGX.Carousel.READY)}this.construct=function(){G(),l.index&&this.showPanel(l.index,!1)},this.enable=function(){return l.drag&&this.touch.swipe.enable(),debug(5,"carousel",l.id,"enabled"),setTimeout((function(){for(var e=0;e0&&this.showPanel(r-1),this},this.next=function(){return r+1'+e+""),i.css("width",Math.round(100*g)+"%"),i.children("."+p+"_view").css("width",100/g+"%"),++f-1}(),l="."+p+'[data-ogx-id="'+this.id+'"] > .'+p+"_views > ."+p+'_view[data-ogx-panel-id="'+r+'"]',d={},c=l;if(e.hasOwnProperty("_NAME_"));else{for(var u in e){c+=":"+u.split(":")[1],d[c]=e[u];break}var h=null;setTimeout((function(){s.observe(!0,{childList:!0,subtree:!0},(function(){s.observe(!1),h&&clearTimeout(h),h=setTimeout(G,20),a&&s.showPanel(g-1,o)})),OGX.OML.render(s,d,n)}),0)}return t.trigger(OGX.Carousel.ADDED,g),this},this.removeNode=function(e){for(var t=0;t=0&&ee?i.children("."+p+"_view:eq("+(n-1)+")").after(a):i.children("."+p+"_view:eq("+n+")").before(a);var o=100/g*(-1*n);return i.removeClass(p+"_anim"),i.css({transform:"translate3d("+o+"%, 0, 0)"}),r=n,setTimeout(G,0),t.trigger(OGX.Carousel.CHANGE,r),this},this.removePanel=function(e,n){if(void 0===n&&(n=!0),e>=0&&e=r?e--:e=r,e<0&&(e=0),s.showPanel(e,!1,!0),t.trigger(OGX.Carousel.REMOVED,g),a}return!1},this.empty=function(){return this.clear(),i.empty(),i.removeClass(p+"_anim").css("width","100%"),i.css({transform:"translate3d(0%, 0, 0)"}),g=0,h=new OGX.List,l.index=0,l["node:OML"]=[],this},this.render=function(e,t){return l["node:OML"]=e,g=l["node:OML"].length,X(),OGX.OML.render(this,l["node:OML"],t),this},function(){if(void 0===OGX.Data)return debug(1,"OGX.Data not found!"),!1;OGX.Data.merge(l,d,!1),l.dots&&("boolean"==typeof l.dots&&(l.dots={}),OGX.Data.merge(l.dots,c)),r=l.index,t=s.el,n=Math.floor(t.innerWidth()),l.hasOwnProperty("node:OML")&&(g=l["node:OML"].length),function(){t.addClass(p);var e="";l.dots&&"top"===l.dots.position&&(e+=''),e+='
',l.dots&&"bottom"===l.dots.position&&(e+=''),t.append(e),(i=t.find("."+p+"_views").first()).css({transform:"translate3d("+100/g*(-1*r)+"%, 0, 0)"})}(),l.dots&&(o=s.create("Dots",{el:"."+p+'[data-ogx-id="'+s.id+'"] > .carousel_dots',total:g})).bind("dots",s),X(),s.touch.swipe=s.touch.add("Swipe",{x:!0,cb_down:v,cb_swipe:y,cb_up:x,capture:l.capture,state:"manual"}),l.drag||s.drag(!1),debug(5,"carousel",l.id,"init")}()},OGX.Carousel.READY="CarouselReady",OGX.Carousel.DRAG="CarouselDrag",OGX.Carousel.CHANGE="CarouselChange",OGX.Carousel.RESTORE="CarouselRestore",OGX.Carousel.ADDED="CarouselAdded",OGX.Carousel.REMOVED="CarouselRemoved",void 0===OGX)var OGX={};if(require("Chat","Uxi","Touch"),OGX.Chat=function(__config){construct(this,"Chat");var that=this,config=__config,config_default={placeholder:"Type a message",dot_speed:600,on_keyb_update_delay:300,messages:[],handle_keyboard:!0,hide_keyboard_on_send:!1,emojis:!1,template_left:'
{{$letter}}{{$body}}{{$date}}
',template_right:'
{{$body}}{{$date}}
',key:"_id",from_key:"from",users:[],user:!1,display_mode:OGX.Chat.DISPLAY_INITIALS,picture_key:"",restrict:{multiline:!1,length:500,allowed:/./},date_format:"YYYY-MM-DD h:mm:ss A",url_encode:!0},emojis_default={template:'{{$emoji}}',button:!1,list:[],map:{emoji:"char",search:"name"}},container,inner,scroller,composer,emojis,emoji_list,intv,oldh=!1,typing={},type=".",enabled=!1;function render(){if(config.messages.length>0){for(var e=0;e.';inner.append(t),animTyping(!0)}function removeTyping(e){typing[e]=!1,inner.find('.ogx_chat_typing[data-user="'+e+'"]').remove(),0===inner.find(".ogx_chat_typing").length&&animTyping(!1)}function animTyping(e){e?intv||(intv=setInterval(typeDot,config.dot_speed)):(clearInterval(intv),intv=null)}function typeDot(){(type+=".").length>3&&(type="."),inner.find(".ogx_chat_typing_body").html(type)}function getTemplate(e){return e[config.from_key]===config.user?config.template_right:config.template_left}function sendMessage(){var e=composer.find("textarea").val();if(e.length&&(e=(e=(e=e.replace(/^[\r|\n\r]+/,"")).replace(/<\/?[^>]+(>|$)/g,"")).replace(/’/,"'")).length){var t={body:e=e.replace(/[\r\n]/g,"
"),date:moment().format(config.date_format)};t[config.from_key]=config.user,addMessage(t);var i=OGX.Data.clone(t);config.url_encode&&(i.body=encodeURIComponent(i.body)),delete i.bg,delete i.letter,composer.find("textarea").val(""),that.el.trigger(OGX.Chat.SEND_MESSAGE,i)}}function handleShowKeyb(e){oldh||(oldh=container.height()),container.height(oldh-e.keyboardHeight),updateScroller()}function handleHideKeyb(){container.height(oldh),updateScroller()}function updateScroller(){setTimeout((function(){scroller.resize(),scroller.bottom()}),config.on_keyb_update_delay)}function renderEmojis(){var e,t=[];config.emojis.list=config.emojis.list.slice(0,250);for(var i=0;i',e+="
",config.emojis&&(e+=''),e+='',container.append(e),composer=container.find(".ogx_chat_composer"),config.emojis&&(emojis=container.find(".ogx_chat_emojis"),setTimeout(renderEmojis,10))}function initUsers(){for(var e in config.users)typing[e]=!1}function initDefaults(){config.hasOwnProperty("emojis")&&config.emojis&&(OGX.Data.merge(config.emojis,emojis_default,!1),config.emojis.list=new OGX.List(config.emojis.list)),OGX.Data.merge(config,config_default,!1),config.users.hasOwnProperty("find")||(config.users=new OGX.List(config.users)),(container=that.el).addClass("ogx_chat")}function init(){if(void 0!==OGX.Scroller)if(void 0!==OGX.Templater)if("undefined"!=typeof moment)if(config.restrict&&void 0===OGX.Form)debug(1,"OGX.Form not found! ");else{if(initDefaults(),initMarkup(),initUsers(),initScroller(),config.restrict){var e=OGX.Data.clone(config.restrict);config.restrict.hasOwnProperty("forbidden")&&(e.forbidden=config.restrict.forbidden),config.restrict.hasOwnProperty("allowed")&&(e.allowed=config.restrict.allowed),e.el=that.el.find(".ogx_chat_composer .ogx_chat_composer_input textarea")[0],OGX.Form.restrictField(e)}that.enable(),debug(5,"chat",config.id,"init")}else debug(1,"moment.js not found! ");else debug(1,"OGX.Templater not found! ");else debug(1,"OGX.Scroller not found! ")}this.enable=function(){return enabled||(enabled=!0,debug(5,"chat",config.id,"enabled"),config.handle_keyboard&&listenKeyb(!0),listenComposer(!0),listenArea(!0)),this},this.disable=function(){return this.el.find(".ogx_chat_composer .ogx_chat_composer_input textarea").trigger("blur"),enabled&&(enabled=!1,debug(5,"chat",config.id,"disabled"),config.handle_keyboard&&listenKeyb(!1),listenComposer(!1),listenArea(!1)),this},this.users=function(e){return void 0!==e?(e.hasOwnProperty("find")||(e=new OGX.List(e)),config.users=e,!0):config.users},this.user=function(e){return void 0===e?config.user:(config.user=e,this)},this.typing=function(e,t){return e&&!typing[t]?addTyping(t):!e&&typing[t]&&removeTyping(t),this},this.compose=function(e){return composer.find("textarea").val(e),this},this.wipe=function(){return inner.empty(),this},this.clear=function(){return debug(2,"Chat clear is deprecated, use wipe"),this.wipe()},this.getScroller=function(){return scroller},this.addMessage=function(e){return addMessage(e),this},this.setMessages=function(e){return config.messages=e,render(),this},this.prependMessages=function(e){for(var t=this.el.find(".ogx_scroller_outer").first(),i=inner.height(),n=t.scrollTop(),a=0;a1&&(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]),a=Number(s[1]),o=Number(s[2])),"#"+((1<<24)+(n<<16)+(a<<8)+o).toString(16).slice(1)},OGX.Color.rgbToHsl=function(e,t,i){"use strict";var n,a,o;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],a=s[1],o=s[2],n/=255,a/=255,o/=255;var l,d,c=Math.max(n,a,o),u=Math.min(n,a,o),f=(c+u)/2;if(c===u)l=d=0;else{var g=c-u;switch(d=f>.5?g/(2-c-u):g/(c+u),c){case n:l=(a-o)/g+(a1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e},d=i<.5?i*(1+t):i+t-i*t,c=2*i-d;o=l(c,d,e+1/3),r=l(c,d,e),s=l(c,d,e-1/3)}return[Math.round(255*o),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,a="normal",o=0;function r(e){e?(t.tabs.el.on(OGX.Tabs.SELECT,(function(e,i){var n=t.tabs.index();t.carousel.val(n),t.el.trigger(OGX.Container.CHANGE,n)})),t.tabs.el.on(OGX.Tabs.CLOSE,(function(){})),t.tabs.el.on(OGX.Tabs.REORDER,(function(e,i){t.carousel.swapPanels(i.from,i.to)})),t.tabs.el.on(OGX.Tabs.ADD,(function(){})),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.CLOSE),t.tabs.el.off(OGX.Tabs.REORDER),t.tabs.el.off(OGX.Tabs.ADD),t.carousel.el.off(OGX.Carousel.CHANGE)),s(e)}function s(e){e?t.tabs.el.on(OGX.Tabs.REMOVE,(function(e,i){s(!1);var n=t.el.parents(".ogx_popup").first().data("ogx-id");n=app.cfind("Popup",n),app.ungroupPopup(n,i.index,i.label),setTimeout((function(){s(!0)}),200)})):t.tabs.el.off(OGX.Tabs.REMOVE)}this.carousel=null,this.tabs=null,this.construct=function(){this.carousel=this.find("Carousel",this.id+"_carousel")},this.show=function(e,t){if(this.carousel&&"normal"===a){var i=this.carousel.getNodeIndex(e,t);i&&(this.carousel.val(i.index),n.tabs&&this.tabs.index(i.index))}},this.index=function(e){return this.carousel&&"normal"===a&&(this.carousel.val(e),n.tabs&&this.tabs.index(e)),this},this.showIndex=function(e){return debug(1,"Container.showIndex has been deprecated, use Container.index"),this.index(e),this},this.enable=function(){return n.tabs&&this.carousel&&r(!0),debug(5,"container",n.id,"enabled"),this},this.disable=function(){return n.tabs&&this.carousel&&r(!1),debug(5,"container",n.id,"disabled"),this},this.resize=function(){var e,t,i;return n.flatten&&(this.carousel&&"flattened"!==a&&this.el.width()>=n.flatten?(a="flattened",n.tabs&&(this.tabs.blur(),this.tabs.hide()),this.carousel.blur(),o=(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"===a&&this.el.width()';t.html(i)}this.enable=function(){n.clickable&&d(!0),debug(5,"dots",n.id,"enabled")},this.disable=function(){n.clickable&&d(!1),debug(5,"dots",n.id,"disabled")},this.bind=function(e,t){return!(o.hasOwnProperty(e)||!t.hasOwnProperty("_NAME_"))&&function(e,t){switch(o[e]=t,t._NAME_){case"Carousel":n.total=t.panels().length,n.current=t.val(),t.el.on(OGX.Carousel.CHANGE,s),t.el.on(OGX.Carousel.ADDED+" "+OGX.Carousel.REMOVED,l);break;case"Iceberg":n.total=t.panels().length,n.current=t.val(),t.el.on(OGX.Iceberg.SHOW,s)}return!0}(e,t)},this.unbind=function(e){return!!o.hasOwnProperty(e)&&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.destroy=function(){!function(){for(var e in o)r(e)}()},OGX.Data.merge(n,a),(t=i.el).addClass("ogx_dots"),c(),debug(5,"dots",n.id,"init")},OGX.Dots.SELECT="DotsSelect",void 0===OGX)var OGX={};if(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,reorder:!1,swipe:!1,reselect:!1,chromeos:!1,min_x:30,hold_time:1e3,interval:5,list:[],selection:[],no_selection:{enabled:!1,prop:"",val:0},mode:OGX.DynamicList.SELECT_MODE_SINGLE,trigger:!1,scope:!0,swipe_template:'
{{$template}}
',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;function isSelectable(__item){return!config.no_selection.enabled||eval("__item."+config.no_selection.prop+" === config.no_selection.val")}function replace(e,t,i){if(display.hasOML()){var n,a,o=toDataId(i[t]),r=display.oml('.ogx_dynamic_list[data-ogx-id="'+that.id+'"] > .ogx_dynamic_list_item[data-ogx-id='+o+"]",i,config.as);$('.ogx_dynamic_list[data-ogx-id="'+that.id+'"] > .ogx_dynamic_list_item[data-ogx-id='+o+"]").find(".ogx_uxi").each((function(e,t){n=$(t).data("ogx-id"),(a=that.cfind(!1,n,1))&&that.find(a._NAME_,a.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)));for(var i,n,a,o="",r=[],s=0;s0?(key=key_default,forceIds()):key=config.key,config.swipe&&("object"!=typeof config.swipe&&(config.swipe={}),OGX.Data.merge(config.swipe,swipe_default)),(container=that.el).addClass("ogx_dynamic_list")}function init(){void 0!==OGX.Templater?void 0!==OGX.List?void 0!==OGX.Display?(checkMissing(),initDefaults(),finalize(),config.scroll&&(scroller=that.find("Scroller",config.id+"_scroller")),debug(5,"dyanmiclist",config.id,"init")):debug(1,"OGX.Display not found! "):debug(1,"OGX.List not found! "):debug(1,"OGX.Templater not found! ")}this.enable=function(e){return debug(5,"dynamicList",this.id,"enabled"),void 0===e&&(e=!1),(e||config.mode!==OGX.DynamicList.STATIC)&&(listenItems(!0),(config.reorder||config.swipe)&&(listenTouch(!0),config.swipe&&listenTrans(!0))),this},this.disable=function(e){return debug(5,"dynamicList",this.id,"disabled"),void 0===e&&(e=!1),(e||config.mode!==OGX.DynamicList.STATIC)&&(listenItems(!1),(config.reorder||config.swipe)&&(listenTouch(!1),config.swipe&&listenTrans(!1))),this},this.bindFilter=function(e,t,i){debug(4,"dynamicList",this.id,"filter",e,JSON.stringify(i)),void 0!==i&&(config.list.removeFilter(e),config.list.addFilter(e,t,i)),config.list.getFilters()&&(filtered=config.list.filter(),isFiltered=!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(){return this.getSelection()},this.destroy=function(){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 a;debug(4,"dynamicList",this.id,"set",e.length,"items"),void 0===t&&(t=!1),void 0===i&&(i=!0),e.hasOwnProperty("insert")||(e=new OGX.List(e)),this.resetSelection(),t||(a=config.list.getFilters()),config.list=e,config.key||(key_id=1,key=key_default,e=JSON.parse(JSON.stringify(e)),forceIds()),!t&&Object.keys(a).length?(config.list.setFilters(a),setTimeout(this.filter,0)):i?setTimeout(render,0):render()},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:config.display.val(e)},this.mode=function(e){return void 0===e?config.mode:(config.mode!==e&&(config.mode===OGX.DynamicList.STATIC?this.enable(!0):e===OGX.DynamicList.STATIC&&this.disable(!0),config.mode=e),this)},this.noSelection=function(e,t){return 1===arguments.length?"object"==typeof e?void(config.no_selection=e):void(config.no_selection.enabled=e):2===arguments.length?(config.no_selection.enabled=!0,config.no_selection.prop=e,void(config.no_selection.val=t)):config.no_selection},this.order=function(e,t){return config.list.order(e,t),setTimeout(render,0),this},this.filter=function(){return debug(4,"dynamicList",config.id,"filtering with",Object.keys(config.list.getFilters()).length,"filters"),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){if(!Array.isArray(e)){config.key||(e[key]=key_id++);var i=!1,n=!0;if(isFiltered){var a=new OGX.List(e);a.setFilters(config.list.getFilters()),0===a.filter().length?n=!1:filtered.push(e)}var o=toDataId(e[key]),r='
]/,pattern:!1,validate:!1,mask:!1,mask_char:"%",paste:!0,autocomplete:null,multiline:!1,input_cb:!1,change_cb:!1,diff:!0,val:null,last_change:!1,wait:2e3,intv:!1,max:2500,type:"string",params:null},n=new OGX.List,a=new OGX.List,o=!1;function r(t,i){if(!o){var a,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 d=c(r.form);for(var u in d)r.config.fields.hasOwnProperty(u)&&r.config.fields[u].hasOwnProperty("type")?d[u]=l(r.config.fields[u].type,d[u]):r.config.hasOwnProperty("type")&&(d[u]=l(r.config.type,d[u]));if(a=JSON.stringify(d),!r.diff||r.val!==a){var f;if(r.val=a,r.config.validate){f={obj:d,form:i,valid:!1};var g=e.validate(r.form);!0===g?f.valid=!0:(f.valid=!1,f.error=g)}else f=d;r.config.params&&(f.params=r.config.params),r.buffer&&clearTimeout(r.buffer),r.buffer=setTimeout((function(){r.config.change_cb(f)}),10)}}}}function s(t){var i={el:t.el,config:t,field:$(t.el),intv:!1};i.name=i.field.attr("name"),i.val=i.field.val(),i.field.val(i.val),t.pattern&&i.field.attr("pattern",t.pattern),n.insert(i),$(document).on("input change",i.el,(function(e){if(!o){var t=$(this).val();if(!i.config.diff||i.config.diff&&t!==i.val){if(i.config.input_cb){var n={value:null,obj:{},el:null};t=l(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(){!function(e){var t=$(e.el).val();if(e.val=t,e.config.change_cb){var i={value:null,obj:{},el:null};t=l(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(!o){if(i.config.mask&&8===e.which||46===e.which){var n=t[0].selectionStart,a=t.val();return a=8===e.which?a.substr(0,n-1):a.substr(0,n),t.val(a),!1}if(8!==e.which&&13!==e.which&&1===e.key.length){var r=e.key;if(13!==e.which&&i.config.mask){if((a=t.val()).length>=i.config.mask.length)return e.preventDefault(),e.stopImmediatePropagation(),!1;for(var s=i.config.mask,d=0;d=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})),a.insert(t)}(e),!0)},this.unrestrictField=function(e){if(!a.find("el",e,1))return!1;var t=a.find("el",e,1);return!!t&&($(document).off("textInput keydown",t.el),$(document).off("paste",t.el),a.findDelete("el",e,1),!0)},this.toObj=function(e){return c(e)},this.populate=function(e,t,i){var n,a,o;void 0===i&&(i=null),$(e).find("*[name]").each((function(e,r){n=r.getAttribute("name"),o=!1,"string"!=typeof(o=OGX.Data.eval(t,n))&&(o=JSON.stringify(o)),void 0!==o&&(i&&i.hasOwnProperty(n)&&"function"==typeof i[n]&&(o=i[n](o)),(a=$(r)).val(o),r.hasAttribute("type")&&"hidden"===a.attr("type")&&a.trigger("change"))})),setTimeout(d,0)},this.validate=function(e){var i,n=$(e),a=t.elem_types,o=[];return n.find(a.join(",")).each((function(e,t){"submit"!==(i=$(t)).attr("type")&&(t.checkValidity()||o.push(i))})),!o.length||o}},OGX.Form=new OGX.Form,void 0===OGX)var OGX={};if(OGX.Geo=function(e){"use strict";var t=this;void 0===e&&(e={});var i,n,a,o={map:null,markers:[],icon:"",browser_loc:null},r=e;function s(e,i){for(var n,a={},o=0;o1&&(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?(i=new google.maps.Geocoder,function(){for(var e in o)r.hasOwnProperty(e)||(r[e]=o[e])}(),r.map&&r.markers.length):$(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",void 0===OGX)var OGX={};if(require("Ghost","Uxi"),OGX.Ghost=function(e){construct(this,"Ghost"),this.el=$(e.el),css="ogx_ghost",this.el.addClass(css),delete css},void 0===OGX)var OGX={};if(require("GridSwiper","Uxi","Touch"),OGX.GridSwiper=function(e){construct(this,"GridSwiper");var t,i,n,a,o,r,s,l,d,c,u,f,g=this,h=e,p={map:[[!0,!0,!0],[!0,!0,!0],[!0,!0,!0]],axis:{x:!0,y:!0},loop:!0,start:!1,chromeos:!1,capture:!1},_=!1,m={x:null,y:null},v={x:0,y:0},y=".ogx_grid_swiper_cell",x=!1,O=!1,b={x:0,y:0},w={x:0,y:0},G=(new Date).getTime()+Math.round(1e3*Math.random()),X=[];function T(e){e?t.on(g.touch.down,E):t.off(g.touch.down,E)}function E(e){_=!1,o=0,r=0,s=0,l=0,e=Y(e),m.x=e.pageX,m.y=e.pageY,x=!0,L(!0)}function D(e){e?$("body").on(g.touch.up,C):$("body").off(g.touch.up,C)}function C(e){x&&(x=!1,L(!1),S())}function S(e,t,o){var r,s;void 0===e&&(e=0),void 0===t&&(t=0),void 0===o&&(o=!0),o&&I(!0),i.addClass("ogx_grid_swiper_anim"),v=A(i),r=-1*Math.round((v.x+e)/n)*n*-1,s=-1*Math.round((v.y+t)/a)*a*-1,i.css({transform:"translate3d("+r+"px, "+s+"px, 0px)"})}function L(e){e?(M(!0),t.on(g.touch.move,k)):(M(!1),t.off(g.touch.move,k))}function k(e){e=Y(e),h.capture&&(e.preventDefault(),e.stopImmediatePropagation()),o=0,r=0,s=0,l=0,_||(h.axis.x&&Math.abs(e.pageX-m.x)>Math.abs(e.pageY-m.y)?_="x":h.axis.y&&Math.abs(e.pageX-m.x)0?1:-1):h.axis.y&&"y"===_&&(r=Math.abs(e.pageY-m.y),l=e.pageY-m.y>0?1:-1))}function M(e){e?f||(O=!1,f=setInterval(N,10)):f&&(clearInterval(f),f=null)}function N(){if((o||r)&&(O||t.trigger(OGX.GridSwiper.SWIPE_START),O=!0),h.axis.x&&"x"===_&&o&&s&&o<=n){if(!h.loop&&(b.x+-1*s<0||b.x+-1*s>h.map[0].length-1))return;if((d=(b.x+-1*s)%h.map[0].length)<0&&(d=Math.abs(h.map[0].length+d)),!1===h.map[w.y][d])return;u=o*s,i.css({transform:"translate3d("+(-1*b.x*n+u)+"px, "+v.y+"px, 0px)"})}else if(h.axis.y&&"y"===_&&r&&l&&r<=a){if(!h.loop&&(b.y+-1*l<0||b.y+-1*l>h.map.length-1))return;if((c=(b.y+-1*l)%h.map.length)<0&&(c=Math.abs(h.map.length+c)),!1===h.map[c][w.x])return;u=r*l,i.css({transform:"translate3d("+v.x+"px, "+(-1*b.y*a+u)+"px, 0px)"})}}function I(e){e?(i.off("transitionend"),i.on("transitionend",(function(){O&&(t.trigger(OGX.GridSwiper.SWIPE_END),O=!1),i.off("transitionend"),i.removeClass("ogx_grid_swiper_anim"),v=A(i);var e={x:null,y:null};e.x=-1*Math.round(v.x/n),e.y=-1*Math.round(v.y/a),b.x!==e.x?(s=b.x>e.x?1:-1,b.x=e.x,w.x=P(b).x,-1===s?(i.children(y+"[data-y="+(b.y-1)+"]").attr("data-x",b.x).css("left",b.x*n),i.children(y+"[data-y="+(b.y+1)+"]").attr("data-x",b.x).css("left",b.x*n),i.children(y+"[data-x="+(b.x-2)+"][data-y="+b.y+"]").attr("data-x",b.x+1).css("left",(b.x+1)*n),t.trigger(OGX.GridSwiper.SWIPE_LEFT,{cell:w,point:b}),R(X=[{x:b.x+1,y:b.y},{x:b.x,y:b.y-1},{x:b.x,y:b.y+1}]),W()):(i.children(y+"[data-y="+(b.y-1)+"]").attr("data-x",b.x).css("left",b.x*n),i.children(y+"[data-y="+(b.y+1)+"]").attr("data-x",b.x).css("left",b.x*n),i.children(y+"[data-x="+(b.x+2)+"][data-y="+b.y+"]").attr("data-x",b.x-1).css("left",(b.x-1)*n),t.trigger(OGX.GridSwiper.SWIPE_RIGHT,{cell:w,point:b}),R(X=[{x:b.x-1,y:b.y},{x:b.x,y:b.y-1},{x:b.x,y:b.y+1}]),W())):b.y!==e.y&&(l=b.y>e.y?1:-1,b.y=e.y,w.y=P(b).y,-1===l?(i.children(y+"[data-x="+(b.x-1)+"]").attr("data-y",b.y).css("top",b.y*a),i.children(y+"[data-x="+(b.x+1)+"]").attr("data-y",b.y).css("top",b.y*a),i.children(y+"[data-y="+(b.y-2)+"][data-x="+b.x+"]").attr("data-y",b.y+1).css("top",(b.y+1)*a),t.trigger(OGX.GridSwiper.SWIPE_UP,{cell:w,point:b}),R(X=[{x:b.x,y:b.y+1},{x:b.x-1,y:b.y},{x:b.x+1,y:b.y}]),W()):(i.children(y+"[data-x="+(b.x-1)+"]").attr("data-y",b.y).css("top",b.y*a),i.children(y+"[data-x="+(b.x+1)+"]").attr("data-y",b.y).css("top",b.y*a),i.children(y+"[data-y="+(b.y+2)+"][data-x="+b.x+"]").attr("data-y",b.y-1).css("top",(b.y-1)*a),t.trigger(OGX.GridSwiper.SWIPE_DOWN,{cell:w,point:b}),R(X=[{x:b.x,y:b.y-1},{x:b.x-1,y:b.y},{x:b.x+1,y:b.y}]),W())),_=0}))):i.off("transitionend")}function A(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%h.map[0].length,t.x<0&&(t.x=Math.abs(h.map[0].length+t.x)),t.y=e.y%h.map.length,t.y<0&&(t.y=Math.abs(h.map.length+t.y)),t}function R(e){for(var t,i={x:null,y:null},n=0;nh.map.length-1){if(!h.loop)return!1;i.y=P(e[n]).y}else i.y=e[n].y;if(e[n].x<0||e[n].x>h.map[0].length-1){if(!h.loop)return!1;i.x=P(e[n]).x}else i.x=e[n].x;t=h.map[i.y][i.x],H(e[n],t)}}function H(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-b.x,y:e.y-b.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 a='.ogx_grid_swiper[data-ogx-id="'+G+'"] > .ogx_grid_swiper_container > '+y+'[data-x="'+e.x+'"][data-y="'+e.y+'"] > '+y+"_content",o=P(e);for(var r in t){t[r].id="cell_"+o.x+"_"+o.y;break}t=OGX.OML.rename(t,a);var s=g.nodes.find("id","cell_"+o.x+"_"+o.y,1);s&&g.remove(s._NAME_,s.id),$(a).empty(),OGX.OML.render(g,t,{abs:e,rel:P(e)}),W()}}function W(){for(var e=0;e',d=-1*e,c=-1*o-a;h.axis.y&&(l+='
',l+='
'),l+='
',h.axis.x&&(l+='
',l+='
'),l+="
",t.html(l),i=t.children(".ogx_grid_swiper_container").first(),b.x=h.start.x,b.y=h.start.y,v.x=e,v.y=o,w.x=h.start.x,w.y=h.start.y}this.enable=function(){return debug(5,"gridwwiper",h.id,"enabled"),T(!0),D(!0),W(),this},this.disable=function(){return debug(5,"gridwwiper",h.id,"disabled"),T(!1),D(!1),M(!1),this},this.focus=function(){return this.blured&&(this.blured=!1,this.enabled&&(this.ux(!0),this.enable())),this},this.resize=function(){I(!1),i.removeClass("ogx_grid_swiper_anim"),n=t.width(),a=t.height();var e=b.x*-n,o=b.y*-a;i.children(y+"[data-y="+(b.y-1)+"]").css({top:(b.y-1)*a,left:b.x*n}),i.children(y+"[data-y="+b.y+"]").css({top:b.y*a,left:b.x*n}),i.children(y+"[data-y="+(b.y+1)+"]").css({top:(b.y+1)*a,left:b.x*n}),i.children(y+"[data-x="+(b.x-1)+"]").css({top:b.y*a,left:(b.x-1)*n}),i.children(y+"[data-x="+(b.x+1)+"]").css({top:b.y*a,left:(b.x+1)*n}),i.css("transform","translate3d("+e+"px, "+o+"px, 0px"),L(!1),setTimeout((function(){S(0,0,!1),i.addClass("ogx_grid_swiper_anim")}),0)},this.setMap=function(e,t){return h.map=e,void 0!==t&&(h.start=t),b={x:0,y:0},w={x:0,y:0},m={x:null,y:null},v={x:0,y:0},z(),U(),j(),this},this.setMapCell=function(e,t){return h.map[e.y]||(h.map[e.y]=[]),h.map[e.y][e.x]=t,this},this.getMapCell=function(e){return e.y>0&&h.map.length0&&h.map[e.y].length0){var i=e.data("id");e.html(OGX.Templater.make(s.template,s.list[i]))}return this},"undefined"!=typeof moment?void 0!==OGX.List?void 0!==OGX.Templater?void 0!==OGX.NestList?(OGX.Data.merge(s,l),s.list.hasOwnProperty("insert")||(s.list=new OGX.List(s.list)),s.group_order&&!s.group_order.hasOwnProperty("insert")&&(s.group_order=new OGX.List(s.group_order)),s.display&&s.display.hasOwnProperty("css")&&("object"!=typeof s.display.css&&s.display.css?s.display.css+=" ogx_grouped_list_item":s.display.hasOwnProperty("add")?s.display.add="ogx_grouped_list_item "+s.display.add:s.display.add="ogx_grouped_list_item"),o=!1,(t=r.el).addClass("ogx_grouped_list"),h(),debug(5,"groupedlist",s.id,"init")):debug(1,"OGX.NestList not found! "):debug(1,"OGX.Templater not found! "):debug(1,"OGX.List not found! "):debug(1,"moment.js not found! ")},OGX.GroupedList.SELECT="GroupedListSelect",OGX.GroupedList.BIND=OGX.GroupedList.SELECT,void 0===OGX)var OGX={};if(require("Html","Uxi","Placeholder"),OGX.Html=function(e){construct(this,"Html"),this.rendered=!1,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))},void 0===OGX)var OGX={};if(require("Iceberg","Uxi","Touch"),OGX.Iceberg=function(e){construct(this,"Iceberg");var t,i,n,a,o=this,r={left:0,right:0,top:0,bottom:0,min:50,drag:!0,flatten:!1,"node:OML":{}},s=e,l=!1,d="normal",c="main",u={left:null,main:null,right:null,top:null,bottom:null},f=[0,0,0],g=0,h=0,p=0,_=0;function m(e){for(var t in u)u[t]&&u[t].instance&&(e===t?u[t].instance.focus():u[t].instance.blur())}function v(){l.hasClass("ogx_iceberg_anim")||(l.off("transitionend"),f=b(l))}function y(e){var t=0;return e.dirY&&e.distY>e.distX&&(t=1),t}function x(e){s.drag&&e.dist&&(!(n=y(e))&&["main","left","right"].includes(c)?e.dirX&&e.distX&&(t=f[0]+e.distX*e.dirX)<=h&&t>=g&&l.css({transform:"translate3d("+t+"px, 0, 0)"}):["main","top","bottom"].includes(c)&&e.dirY&&e.distY&&(i=f[1]+e.distY*e.dirY)<=_&&i>=p&&l.css({transform:"translate3d(0, "+i+"px, 0)"}))}function O(e){if(t=0,i=0,n=y(e),e.swipe&&e.dist){var o;switch(e.swipe=!1,c){case"main":-1===e.dirX&&s.right&&!n?(t=-u.right.outerWidth(),o="right",e.swipe=!0):1===e.dirX&&s.left&&!n?(t=u.left.outerWidth(),o="left",e.swipe=!0):1===e.dirY&&s.top&&n?(i=u.top.outerHeight(),o="top",e.swipe=!0):-1===e.dirY&&s.bottom&&n&&(i=-u.bottom.outerHeight(),o="bottom",e.swipe=!0);break;case"left":-1!==e.dirX||n||(t=0,o="main",e.swipe=!0);break;case"right":1!==e.dirX||n||(t=0,o="main",e.swipe=!0);break;case"top":-1===e.dirY&&n&&(i=0,o="main",e.swipe=!0);break;case"bottom":1===e.dirY&&n&&(i=0,o="main",e.swipe=!0)}a=n?1===e.dirY?OGX.Iceberg.SWIPE_DOWN:OGX.Iceberg.SWIPE_UP:1===e.dirX?OGX.Iceberg.SWIPE_RIGHT:OGX.Iceberg.SWIPE_LEFT,e.swipe&&e.dist&&(l.addClass("ogx_iceberg_anim"),l.on("transitionend",(function(){l.off("transitionend"),l.removeClass("ogx_iceberg_anim"),f=b(l),m(c=o),l.trigger(a,c)})),l.css({transform:"translate3d("+t+"px, "+i+"px, 0)"}))}else if(e.dist){switch(t=0,i=0,c){case"left":t=u.left.outerWidth();break;case"right":t=-u.right.outerWidth();break;case"top":i=u.top.outerHeight();break;case"bottom":i=-u.bottom.outerHeight()}l.addClass("ogx_iceberg_anim"),l.on("transitionend",(function(){l.off("transitionend"),l.removeClass("ogx_iceberg_anim"),f=b(l),l.trigger(OGX.Iceberg.RESTORE,c)})),l.css({transform:"translate3d("+t+"px, "+i+"px, 0)"})}}function b(e){var t=e[0].style.transform;if(t=t.match(/translate3d\(([0-9px%,\.\- ]+)\)/)){t=t[1].split(",");for(var i=0;i=s.flatten?(d="flattened",f=b(l),l.addClass("ogx_iceberg_views_flattened").css("transform","translate3d(0px, 0px, 0px)"),l.children(".ogx_iceberg_view").addClass("ogx_iceberg_view_flattened"),this.disable()):"flattened"===d&&this.el.width() .ogx_iceberg_views > .ogx_iceberg_view[data-ogx-panel-id="';for(var r in s["node:OML"])for(var d in s["node:OML"][r])0===d.indexOf("left")&&(i+='
',n.left=a+'left"]',u.left=!0),0===d.indexOf("top")&&(i+='
',n.top=a+'top"]',u.top=!0),0===d.indexOf("main")&&(i+='
',n.main=a+'main"]'),0===d.indexOf("right")&&(i+='
',n.right=a+'right"]',u.right=!0),0===d.indexOf("bottom")&&(i+='
',n.bottom=a+'bottom"]',u.bottom=!0);for(o.el.html(i),r=0;rt.width/t.height?(i.width=t.width,i.height=Math.round(e.height*(t.width/e.width))):(i.width=Math.round(e.width*(t.height/e.height)),i.height=t.height),i}({width:t,height:i},{width:a,height:o}),s=(a-r.width)/2,l=(o-r.height)/2;n.css("left",s+"px"),n.css("top",l+"px"),n.prop("width",r.width),n.prop("height",r.height)}function a(e){var t,i=$(e);i&&(i.find(".ogx_video").each((function(e,i){t=$(i),function(e,t,i){var n=$(e),a=t/i,o=n.parent().innerWidth(),r=n.parent().innerHeight(),s=o,l=Math.ceil(s/a);lo?d=(s-o)/2*-1:sr?c=(l-r)/2*-1:l0&&(r=0),n.parent().css("overflow","hidden"),n.prop("width",a),n.prop("height",o),n.css("top",r+"px")}(i,parseInt(t.data("width"),10),parseInt(t.data("height"),10))})),i.find(".ogx_image_fit").each((function(e,i){t=$(i),function(e,t,i){var n=$(e),a=t/i,o=n.parent().innerWidth(),r=o,s=Math.ceil(r/a),l=0;r>o?l=(r-o)/2*-1:rt&&(o=t);var r=Math.ceil(o/a);n.prop("width",o),n.prop("height",r)}(i,parseInt(t.data("width"),10),parseInt(t.data("height"),10))})))}function o(e){e?$(window).on("resize",r):$(window).off("resize",r)}function r(){for(var e in t)a(t[e].selector)}function s(e){var t;e.find(".ogx_video, .ogx_video_resp, .ogx_video_poster").each((function(e,i){(t=$(i)).parent().css("overflow","hidden"),i.hasAttribute("data-width")||(t.attr("data-width",t.attr("width")),t.attr("data-height",t.attr("height")))})),e.find(".ogx_image_cover, .ogx_image_contain, .ogx_image_fit, .ogx_image_scale, .ogx_image_resp").each((function(e,i){(t=$(i)).css("position","relative"),i.hasAttribute("data-width")||(t.attr("data-width",t.attr("width")),t.attr("data-height",t.attr("height")))})),a(e)}this.resize=function(e){void 0!==e?a(e):r()},this.bind=function(n,a){return!t.hasOwnProperty(n)&&(t[n]={observer:null,element:a},t[n].observer=(r=a,l=null,(d=new(window.MutationObserver||window.WebKitMutationObserver)((function(e,t){e.forEach((function(e){l&&clearTimeout(l),l=setTimeout((()=>{s($(r))}),10)}))}))).observe(document.querySelector(r),{childList:!0,subtree:!0}),d),t[n].selector=a,i++,e||(e=!0,o(!0)),s($(a)),!0);var r,l,d},this.unbind=function(n){return!(!t.hasOwnProperty(n)||!t[n].observer)&&(t[n].observer.disconnect(),delete t[n],!--i&&e&&(e=!1,o(!1)),!0)}},OGX.Media=new OGX.Media,void 0===OGX)var OGX={};if(require("NestList","Uxi","Bind"),OGX.NestList=function(e){construct(this,"NestList");var t,i,n=this,a={scope:["public"],template:'
{{$title}}
{{$body}}
',list:new OGX.List,item_default:!1,map:{title:"title",scope:"scope",id:"id"},order:!1},o={title:"",scope:[],open:!0},r={id:0,title:!1,scope:[],height:0,y:0,hidden:!1,open:!0,selector:!1},s=e,l=!1,d=0,c=0,u=1,f={y:0,h:0,way:1},g=!1,h=new OGX.List;function p(e){e?t.on("click",".ogx_nest_list_item_head",_):t.off("click",".ogx_nest_list_item_head",_)}function _(e){l||(l=!0,m($(this)))}function m(e){var i=e.parent(0).data("ogx-nest-id"),n=!1;e.hasClass("ogx_nest_list_item_head_closed")?(f.way=1,e.addClass("ogx_nest_list_item_head_open").removeClass("ogx_nest_list_item_head_closed"),h.findUpdate("id",i,{open:!0},!1,1),n=!0):(f.way=0,e.removeClass("ogx_nest_list_item_head_open").addClass("ogx_nest_list_item_head_closed"),h.findUpdate("id",i,{open:!1},!1,1));var a=h.find("id",i,1);n?(!function(e){var t=v(e);if(t)return t.focus(),!0}(a),t.trigger(OGX.NestList.OPEN,a)):(!function(e){var t=v(e);if(t)return t.blur(),!0}(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")),a=n.nodes.find("id",i,1);if(a)return a}return!1}function y(e){if(e.hasOwnProperty("scope"))for(var t=0;t .ogx_nest_list_item[data-ogx-nest-id="'+a.id+'"] > .ogx_nest_list_item_body > .ogx_nest_list_item_content';var f=$('.ogx_nest_list[data-ogx-id="'+n.id+'"] > .ogx_nest_list_item[data-ogx-nest-id="'+a.id+'"]');return a.hidden&&f.addClass("ogx_nest_list_item_hidden"),f.removeClass("ogx_nest_list_prep"),a}function b(){var e=s.list;g&&(e=i),t.empty(),h.clear();var a;t.html('
'),s.hasOwnProperty("node:OML")||(s["node:OML"]=[]);for(var o=0;o .ogx_nest_list_item[data-ogx-nest-id="'+h[t.index].id+'"]').remove(),h.splice(t.index,1),setTimeout(x,0))},this.updateNestHeight=function(e){var t=h.find(s.map.title,e,1);setTimeout((function(){var e,i;e=t,i=$(e.selector).outerHeight(!0),e.height=i,x()}),0)},this.updateNestsHeight=function(){for(var e,t=0;t{switch(e.type){case"text":return t.text();case"json":return t.json();default:return t.blob()}})).catch((e=>{$(document).trigger(OGX.Api.NETWORK_ERROR,e)})).then((n=>{e.data=n,a(e,t,i)}))}function r(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.preload=function(e,t,i){debug(4,"NET bulk preload init");var n={loaded:0,total:0,files:new OGX.List};for(var a in e)for(var o=0;oogx font init';$("body").append(o),a(e,i,n),function(e){setTimeout((function(){$('.ogx_font_loader[data-ogx-id="font-loader-'+e+'"]').remove()}),150)}(t),t++}o()}(l,i,r);break;case"pak":!function(e,t,i){function n(n){for(var o,r=//gi,s=[];o=r.exec(n);)s.push(o[1]);r=//gi;var l,d,c,u=n.split(r);u.shift();for(var f=0;f=!+]+ ?\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;}",d=new Function(l),e=e.replace(r[0],d())),(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]+))/gi.exec(e))&&(s='OGX.Object.get({_NAME_:{eq:"'+r[3]+'"}, id:{eq:"'+r[2]+'"}}, null, 1);')===(e=e.replace(r[0],s)))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]+")[0];")===(e=e.replace(r[0],s))))return s;if(isSingleVar(e))return"return "+replaceVars(e,t,i,n,a)+";";for(e+="\r\n";o=/[\S ]+(\r\n|\n)?/gi.exec(e);){if(l=replaceLoop(l=o[0].replace(/(\r\n|\n)/gi,"").trim(),t,i,n,a),charcode++,l=replaceVars(l,t,i,n,a),/^(app|OGX)\.\S+;?/g.test(l))return"return "+l+";";if(e=e.replace(o[0],""),u+=l+"\n",++c>100)return}return u="var __echo=[];\n"+u+'\nif(!__echo.length){return;}else{return __echo.join("");}'}function runJS(e,t,i,n,a,o){var r;try{r=new Function(oo,to,ro,lo,e)(t,i,n,a)}catch(e){return void debug(1,"Invalid script",o,"\n",e.toString())}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,str=__string.trim();if(["$","%","@"].includes(str))switch(str){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,a){var o,r,s,l;return(o=/loop (\S+) ?(as (\S+) ?(\S+ )?)?{/gi.exec(e))&&(r="__"+String.fromCharCode(charcode).toLowerCase()+"__",s=(s=o[0]).replace(o[0],"for(var "+r+" in JSON.parse(JSON.stringify("+o[1]+"))){"),o[2]&&(l=o[4]?"&"+o[3]+"="+r+"; &"+o[4]+"="+o[1]+"["+r+"]; ":"&"+o[3]+"="+o[1]+"["+r+"]; "),s+=l,e=e.replace(o[0],s)),e}function replaceVars(e,t,i,n,a){for(var o,r,s,l=0;r=/((&|#|@|\$|%)([a-zA-Z_]{1}[a-zA-Z0-9\-_]*))(\.[a-z0-9\-_\.\[\]\$]+|\.\$|\.)?(;)?/gi.exec(e);){switch(s=!1,r[2]){case"&":s=to+"."+r[3];break;case"@":s=lo+"."+r[3];break;case"$":s=oo+"."+r[3];break;case"#":s=r[3];break;case"%":s=ro+"."+r[3]}if(o=r[0].replace(r[1],s),e=e.replace(r[0],o),++l>300)return debug(1,"OSE script exceeded safe pool at replaceVars"),e}for(;r=/([a-z_\-]+)\( *(\$|@|&|%) *\)/gi.exec(e);)s=getTrueVal(r[2]),o=r[1]+"("+s+")",e=e.replace(r[0],o);for(;/^(json|ose|template|oml|crumb|result) (\S+)/g.test(e);)if((r=/crumb (\S+)?/gi.exec(e))&&(o=n.hasOwnProperty(r[1])?"__route_object."+r[1]:"{}",e=e.replace(r[0],o)),(r=/json (\S+)(;)?/gi.exec(e))&&(r[1]=getTrueVal(r[1],t,i,n,a),r[1]||debug(1,"OSE Error",e),e=e.replace(r[0],"app.getJSON("+r[1]+")")),(r=/^template (\S+)( \S+)?[ ;]?/gi.exec(e))&&(r[1]=getTrueVal(r[1],t,i,n,a),r[1]||debug(1,"OSE Error",e),void 0===r[2]?r[2]="__object":r[2]=getTrueVal(r[2].trim(),t,i,n,a),e=e.replace(r[0],"OGX.Templater.make(OGX.Templater.get("+r[1]+"), "+r[2]+", "+to+","+ro+","+lo+")")),(r=/^ose (\S+)(;)?/gi.exec(e))&&(r[1]=getTrueVal(r[1],t,i,n,a),r[1]||debug(1,"OSE Error",e),script=that.get(r[1]),script&&(e=exp.replace(r[0],script.replace(/({{|}})/g,"")))),(r=/^oml (\S+)(;)?/gi.exec(e))&&(r[1]=getTrueVal(r[1],t,i,n,a),r[1]||debug(1,"OSE Error",e),e=e.replace(r[0],"app.getOML("+r[1]+")")),(r=/^result (\S+)(;)?$/gi.exec(e))&&(e=e.replace(r[0],'OGX.OML.result("'+r[1]+'")')),++l>300)return debug(1,"OSE script exceeded safe pool"),e;if(["$","@","%","&"].includes(e.trim())){switch(e.trim()){case"$":e=oo;break;case"@":e=lo;break;case"%":e=ro;break;case"&":e=to}return e}for(;r=/echo ('|")?(((?![;}\r\n]+|$)([\S\s]))*)(?:'|")?/gi.exec(e);){var d="+$1+",c="'";if(void 0!==r[1]&&(c="\\"+r[1]),d=c+d+c,r[2]=r[2].replace(/(__(?!;\n\r)[a-z0-9_\-\.]+)/gi,d),o="__echo.push("+c+r[2]+c+");",e=e.replace(r[0],o),++l>300)return debug(1,"OSE script exceeded safe pool"),e}return e}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 a in t.values)if(convertValue(a)===n)return t.values[a];return!1},this.execScript=function(e,t,i,n){var a=this.get(e);return a&&this.exec(a,t,i,n),!1},this.exec=function(e,t,i,n,a){void 0===t&&(t={}),void 0===i&&(i={}),void 0===n&&(n={}),void 0===a&&(a={}),charcode=65;var o=runJS(convertToJS(e,t,i,n,a),t,i,n,a,e);if(void 0!==o)return o}},OGX.OSE=new OGX.OSE,OGX.OSE.SCRIPT_LOADED="OSE_SCRIPT_LOADED",OGX.OSE.SCRIPTS_LOADED="OSE_SCRIPTS_LOADED",void 0===OGX)var OGX={};if(OGX.Overlay=function(e){"use strict";var t=this,i=!1,n=!1,a={anim:OGX.Overlay.FADE,display:{css:"",html:" "},index:!1,close_on_click:!1},o=!1,r="mousedown";function s(e){i&&(e?i.on(r,l):i.off(r,l))}function l(){"function"==typeof o.close_on_click&&o.close_on_click.apply(null,t),s(!1),t.removeOverlay()}e.hasOwnProperty("overlay")&&e.overlay&&setTimeout((function(){t.addOverlay(e.overlay)}),0),this.hasOverlay=function(){return!!i},this.addOverlay=function(e){if("object"!=typeof e&&(e={}),OGX.Data.merge(e,a),e.display.hasOwnProperty("_NAME_")||(e.display=new OGX.Display(e.display)),o=e,!this.hasOverlay()){var t=this.el;o.hasOwnProperty("el")&&(t=$(o.el));var n="z-index:"+(o.zindex?o.zindex:this.topIndex(t))+";",r='
'+o.display.html()+"
";if(t.prepend(r),(i=t.children(".ogx_overlay").first()).off("transitionend"),o.anim)switch(o.anim){case OGX.Overlay.FADE:setTimeout((function(){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){s(!1);var t=!1;if(void 0===e||!0===e?o.anim&&(t=o.anim):t=e,i){if(t){switch(t){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)})):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 debug(2,"No overlay to remove"),this},this.addGroupOverlay=function(){return n||(this.el.prepend('
'),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,e.hasOwnProperty("placeholder")&&(this.pholder=e.placeholder),this.placeholder(e)},OGX.Placeholder.prototype.placeholder=function(e){var t;if("object"==typeof e["node:OML"]&&!Array.isArray(e["node:OML"])){var i=this.selector;for(var n in this.pholder&&(i+=" "+this.pholder),e["node:OML"])0===n.indexOf("default")&&(t=n.replace("default",i),e["node:OML"][t]=e["node:OML"][n],delete e["node:OML"][n])}},OGX.Placeholder.prototype.placeholders=function(e,t){if(void 0!==e&&void 0!==t){e.hasOwnProperty("node:OML")||(e["node:OML"]=[]);var i,n,a=e["node:OML"];a&&"string"==typeof a&&(0===a.indexOf("{{")?e["node:OML"]=OGX.OSE.exec(a):e["node:OML"]=OGX.Cache.read("oml",e["node:OML"]));for(var o=0;o=i.points[t].min&&oi.left&&t.lefti.top&&t.topscreen.width&&(e=screen.width),t>screen.height&&(t=screen.height);var i=r.width,n=r.height;if(p||(i=OGX.Data.getBestSize(e,i),n=OGX.Data.getBestSize(t,n)),r.center)"string"==typeof i&&(i=-1!==i.indexOf("%")?Math.round(e*Number(i.substr(0,i.length-1))/100):Number(i)),"string"==typeof n&&(n=-1!==n.indexOf("%")?Math.round(t*Number(n.substr(0,n.length-1))/100):Number(n)),x=Math.round(e/2-i/2),y=Math.round(t/2-n/2),r.drag&&(r.center=!1);else{var a=s.position();x=a.left,y=a.top,x>e&&(x=e-x),x<-i&&(x=0),y>t&&(y=t-n),y<0&&(y=0)}return{x:x,y:y,w:i,h:n}}function S(e,t,i,a,o,l){var d=!1,f=null;if(void 0===l&&(l=!1),void 0!==t&&!0!==t||(t=r.anim),t&&(d=t),!t&&_&&(d=_),t?n.el.removeClass(c+"_notrans"):n.el.addClass(c+"_notrans"),e?(n.front(),l||n.el.trigger(OGX.Popup.SHOW,n)):l||n.el.trigger(OGX.Popup.HIDE,n),d){var g={};switch(f=c+"_"+d,d){case OGX.Popup.SCALE:u[1]=e?"scale(1,1)":"scale("+r.anim_param.scale+", "+r.anim_param.scale+")",g.transform=u.join(" ");break;case OGX.Popup.FADE:g.opacity=e?1:0}e&&(s.css("display","flex"),g.visibility="visible",g.display="flex"),t||e||(g.visibility="hidden",g.display="none"),setTimeout((function(){s.css(g)}),50),t?(_=d,s.on("transitionend",(function(){s.off("transitionend"),e?n.resizeNodes():s.css({display:"none",visibility:"hidden"}),f&&s.removeClass(f),L(i,a,o)})),f&&s.addClass(f)):(s.removeClass(f),L(i,a,o))}else e?s.css({opacity:e,display:"flex",visibility:"visible"}):s.css({display:"none",visibility:"hidden"}),L(i,a,o)}function L(e,t,i){void 0!==e&&e&&e(t),void 0!==i&&i&&i(n.id)}function k(e){e?s.on(n.touch.down,"."+c+"_button",M):s.off(n.touch.down,"."+c+"_button",M)}function M(e){e.preventDefault(),e.stopImmediatePropagation();var t=$(this);if(!t.hasClass(c+"_button_disabled")){var i=t.index();s.trigger(OGX.Popup.CLICK_BUTTON,{index:i,value:r.buttons[i].label}),r.buttons[i].hasOwnProperty("callback")&&r.buttons[i].callback&&(r.buttons[i].hasOwnProperty("params")?r.buttons[i].callback.apply(null,[r.buttons[i].params]):r.buttons[i].callback())}}function N(){for(var e,t="",i=0;i0&&(e=r.buttons[i].enabled?"":c+"_button_disabled",t+=''+r.buttons[i].label+"");return t}function I(e,t){void 0===t&&(t=!0),r.buttons=new OGX.List(e);for(var i=0;i";return t}this.anim=null,this.group=r.group,this.x=0,this.y=0,this.z=0,this.construct=function(){},this.enable=function(){return this.enableResize(),r.icons&&r.icons.length&&A(!0),r.buttons&&r.buttons.length&&r.buttons_enabled&&k(!0),debug(5,"popup",r.id,"enabled"),this},this.disable=function(){return this.disableResize(),r.icons&&r.icons.length&&A(!1),r.buttons&&r.buttons.length&&r.buttons_enabled&&k(!1),debug(5,"popup",r.id,"disabled"),this},this.show=function(e,t,i){return S(1,e,t,i),this.focus(1),this},this.hide=function(e,t,i,n,a){return S(0,e,t,i,n,a),this.blur(1),this},this.resize=function(){return b(),this},this.maximize=function(){return r.maximize&&!m&&(m=!0,v={width:r.width,height:r.height,x:this.x,y:this.y},r.width=r.height="100%",b(!1),this.x=this.y=0,this.move(this.x,this.y)),this},this.normalize=function(){return r.maximize&&m&&(m=!1,r.width=v.width,r.height=v.height,b(!1),this.x=v.x,this.y=v.y,v=null,this.move(this.x,this.y)),this},this.destroy=function(){s.off("transitionend"),this.touch.wipe()},this.buttons=function(e){if(void 0===e)return r.buttons;I(e)},this.enableButton=function(e){return r.buttons[e].enabled=!0,l.children("."+c+"_button:eq("+e+")").removeClass(c+"_button_disabled"),r.buttons_enabled||(r.buttons_enabled=!0),this},this.disableButton=function(e){return r.buttons[e].enabled=!1,l.children("."+c+"_button:eq("+e+")").addClass(c+"_button_disabled"),this},this.enableButtons=function(){if(r.buttons.length)for(var e=0;e',r.icon&&(a+='
"),r.title&&(a+='
'+r.title+"
"),a+='
',r.icons&&(a+=Y()),a+="
");var o,d=1;if(u=["translate3d("+e.x+"px, "+e.y+"px, 0)"],r.anim)switch(r.anim){case OGX.Popup.FADE:d=0,o=c+"_fade";break;case OGX.Popup.SCALE:o=c+"_scale",u[1]="scale("+r.anim_param.scale+", "+r.anim_param.scale+")"}a+='
',r.html?a+=r.html:r.template&&(a+=OGX.Templater.make(OGX.Templater.get(r.template),r.data)),a+="
",r.buttons&&r.buttons.length&&(a+='
',a+=N(),a+="
"),s.html(a),s.css({width:t,height:i,opacity:d,transform:u.join(" "),"z-index":n.z}),r.anim&&s.addClass(o),n.el=s,l=s.children("."+c+"_buttons").first()}(),r.drag){var e={x:!0,y:!0,cb_down:T,cb_up:E,target:"."+c+"_head"};r.group?e.cb_drag=D:"function"==typeof r.drag&&(e.cb_drag=function(e){r.drag(n,e)}),n.touch.add("Drag",e)}if(r.resize&&n.setResize({top:!1,cb_resize:O,cb_down:G,cb_up:X}),r.hasOwnProperty("html")&&r.html)r["node:OML"]=[{"default:Html":{html:r.html}}];else if(r.hasOwnProperty("view")&&r.view){var t={};t["default:Views."+r.view.id]=r,r["node:OML"].push(t)}n.placeholders(r,["."+c+'[data-ogx-id="'+r.id+'"] > .'+c+"_body"]),r.overlay&&n.addOverlay(),n.observe(!0,undefined,(function(){n.resizeNodes(),n.observe(!1),r.show&&n.show()})),debug(5,"popup",r.id,"init")}else debug(1,"OGX.Container not found! ");else debug(1,"OGX.Data not found! ");else debug(1,"OGX.Templater not found! ")}()},OGX.Popup.FADE="fade",OGX.Popup.SCALE="scale",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,void 0===OGX)var OGX={};if(OGX.Resize=function(e){"use strict";var t,i,n,a,o,r,s,l,d=this,c=e,u={enabled:!0,top:!0,left:!0,right:!0,bottom:!0,min_width:100,min_height:100,max_width:0,max_height:0,border:10,cb_up:!1,cb_down:!1,cb_resize:!1},f=!1,g="mousedown",h="mouseup",p="mousemove",_=(c=!1,!1),m=!1,v={w:0,h:0};function y(e){c&&(e?d.el.on(g,x):d.el.off(g,x))}function x(e){var u=T(e);n=u.pageX,a=u.pageY;var f=d.el.position();t=f.left,i=f.top;var g=d.el.offset(),h=n-g.left,p=a-g.top;v.w=d.el.width(),v.h=d.el.height(),o=0,r=0,s=0,l=0,c.top&&pd.el.height()-c.border&&(l=1),c.left&&hd.el.width()-c.border&&(s=1),_=-1!==window.getComputedStyle(d.el[0],"width"),m=-1!==window.getComputedStyle(d.el[0],"height"),(s||l)&&(e.preventDefault(),d.hasOwnProperty("dragable")&&d.dragable&&d.touch.drag.disable(),O(!0),w(!0),c.cb_down&&c.cb_down())}function O(e){e?f||(f=setInterval(b,5)):f&&(clearInterval(f),f=!1)}function b(){if(-1===s||-1===l){var e=t,n=i;o&&s&&(e+=o),r&&l&&(n+=r),o&&-1===s&&r&&1===l&&(n=i),d.el.css("transform","translate3d("+e+"px, "+n+"px, 0)")}s&&v.w+o*s>c.min_width&&(_?d.el.width(Math.round(100*(v.w+o*s)/d.el.parent().width()*100)/100+"%"):d.el.width(v.w+o*s)),l&&v.h+r*l>c.min_height&&(m?d.el.height(Math.round(100*(v.h+r*l)/d.el.parent().height()*100)/100+"%"):d.el.height(v.h+r*l)),(o||r)&&(c.cb_resize?c.cb_resize():d.el.trigger(OGX.Resize.RESIZING))}function w(e){e?($("body").on(p,G),$("body").on(h,X)):($("body").off(p,G),$("body").off(h,X))}function G(e){e.preventDefault(),e.stopImmediatePropagation(),e=T(e),o=e.pageX-n,r=e.pageY-a}function X(e){O(!1),w(!1),e=T(e),o=e.pageX-n,r=e.pageY-a,c.cb_up&&c.cb_up(),d.hasOwnProperty("dragable")&&d.dragable&&(y(!1),d.touch.drag.enable(),setTimeout((function(){y(!0)}),0))}function T(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,u,!1),c=e},this.enableResize=function(){return y(!0),this},this.disableResize=function(){return y(!1),this},this.destroy=function(){this.touch.wipe()},OGX.Data.merge(c,u,!1),void 0===window.ontouchstart||c.chromeos||(g="touchstart",p="touchmove",h="touchend"),d.hasOwnProperty("dragable")&&d.dragable&&(d.touch.drag=d.touch.add("Drag",{state:"manual"}))},OGX.Resize.RESIZING="resizeResizing",void 0===OGX)var OGX={};if(require("Roulette","Uxi","Bind","Touch"),OGX.Roulette=function(e){construct(this,"Roulette");var t,i,n,a,o,r,s,l=this,d=e,c={force_coef:10,time_coef:.1,min_force_pitch:2,value:null,name:!1,required:!1,display:!1,key:"value",mode:OGX.Roulette.MODE_REWIND,icon:!1,list:new OGX.List,capture:!1},u={template:!1,html:'{{$label}}',css:!1},f="object",g=0,h=0,p="ogx_roulette";function _(e,t){void 0===t&&(t=!0),l.el.children('input[name="'+d.name+'"]').val(e),t&&l.el.children('input[name="'+d.name+'"]').trigger("change")}function m(e){e?t.on(l.touch.down,"."+p+"_icon",(function(e){e.preventDefault(),e.stopImmediatePropagation(),l.next(!0)})):t.off(l.touch.down,"."+p+"_icon")}function v(e){e?t.on("change","input[type=hidden]",y):t.off("change","input[type=hidden]",y)}function y(e){e.preventDefault(),e.stopImmediatePropagation(),l.loopval(0,OGX.Data.stringToVal(e.target.value),!1)}function x(e){return h+e>d.list.length-1?d.list[0]:h+e<0?d.list[d.list.length-1]:d.list[h+e]}function O(e){a=e.y,G(!0)}function b(e){var t;e.dirY!==o?(t=0,a=e.pt1.y):(t=e.pt1.y-a,a=e.pt1.y),o=e.dirY,i.css({transition:"none",transform:"translate3D(0px, "+(D(i)+t)+"px, 0px)"})}function w(e){G(!1),trans=D(i);var t=Math.round(trans/n)*n,a=Math.round(t/n%d.list.length);if(a=a<=0?Math.abs(a):d.list.length-a,h!==a){switch(h=a,f){case"string":d.value=d.list[h];break;case"object":d.value=d.list[h][d.key]}d.name&&l.el.children('input[name="'+d.name+'"]').val(d.value).trigger("input"),l.el.trigger(OGX.Roulette.CHANGE,d.value)}i.css({transition:"all 0.2s ease-out",transform:"translate3D(0px, "+t+"px, 0px)"})}function G(e){e?r=setInterval(X,10):clearInterval(r)}function X(){var e,t,a;(e=Math.floor((i.position().top+n*o)/(n*d.list.length)*-1))!==g&&(0===i.children("."+p+'_stripe[data-id="'+e+'"]').length&&((t=s.clone()).css("top",e*(n*d.list.length)+"px"),t.attr("data-id",e),i.append(t)),i.children("."+p+"_stripe").each((function(e,t){a=i.position().top+$(t).position().top,(Math.ceil(a+n*d.list.length)<-n||a>n)&&$(t).remove()})),g=e)}function T(){G(!1),i.off("transitionend",T)}function E(){var e="",a="";d.icon&&(a+='
'),a+='
';for(var o=0;o<2;o++){a+='
';for(var r=0;r'+e+"
"}a+="
"}if(a+="
",d.icon&&(a+='
'),void 0===h&&(h=0),d.name){var l="";switch(d.required&&(l=" required"),f){case"string":a+='";break;case"object":a+='"}}t.html(a),i=t.children("."+p+"_stripes").first(),d.icon&&(i=t.children("."+p+"_container").children("."+p+"_stripes").first()),s=(s=i.children("."+p+"_stripe:last")).detach();var c=h*n*-1;i.css({transition:"none",transform:"translate3D(0px, "+c+"px, 0px)"})}function D(e){var t=0;return"none"!==e.css("transform")&&(t=Number(e.css("transform").split(",")[5].split(")")[0])),t}function C(e){switch(f){case"string":return{index:d.list.indexOf(e)};case"object":return d.list.findIndex(d.key,e)}}function S(){d.list.length>0&&!d.list.hasOwnProperty("insert")&&(d.list=new OGX.List(d.list)),"string"==typeof d.list[0]&&(f="string"),1===d.list.length&&(d.list[1]=d.list[0])}this.enable=function(){return t.removeClass(p+"_disabled"),d.icon&&m(!0),d.name&&v(!0),debug(5,"roulette",d.id,"enabled"),this},this.disable=function(){return t.addClass(p+"_disabled"),d.icon&&m(!1),d.name&&v(!1),G(!1),debug(5,"roulette",d.id,"disabled"),this},this.bindFilter=function(e,t,i){return d.list.removeFilter(e),d.list.addFilter(e,t,i),d.list.filter(),setTimeout(E,0),this},this.destroy=function(){this.touch.wipe()},this.bindRender=function(e,t){},this.val=function(e,t){if(void 0!==e){var a=C(e).index;return a>-1&&(!function(e,t){void 0===t&&(t=!0);i.off("transitionend",T),G(!1),o=-1;var a=D(i),r=Math.round(a/n)*n,s=a-r,l=Math.round(r/n%d.list.length);l=l<=0?Math.abs(l):d.list.length-l;var c=l-e;d.mode===OGX.Roulette.MODE_CLOSEST&&c>d.list.length/2&&(c=-1*(d.list.length-l+e));var u=a+c*n-s,f=20*Math.round(Math.abs(c*n)*d.time_coef);G(!0),i.on("transitionend",T),i.css({transition:"all "+f+"ms ease-out",transform:"translate3D(0px, "+u+"px, 0px)"}),h=e}(a),d.name&&_(e,!1)),this}switch(f){case"string":return d.list[h];case"object":return d.list[h][d.key]}},this.item=function(){return d.list[h]},this.loopval=function(e,t,a){var o=h,r=C(t).index;r>-1&&(h=r);var s=o-r,l=d.time_coef*Math.abs(s+e*d.list.length);return G(!0),i.css({transition:"all "+l+"s ease-out",transform:"translate3D(0px, "+(D(i)+(s*n-d.list.length*n*e))+"px, 0px)"}),i.on("transitionend",T),d.name&&_(t,a),void 0!==a&&a&&this.el.trigger(OGX.Roulette.CHANGE,val),this},this.next=function(e){var t,i=x(1);switch(o=1,f){case"string":t=i;break;case"object":t=i[d.key]}return this.val(t),void 0!==e&&e&&(this.el.trigger(OGX.Roulette.CHANGE,t),d.name&&this.el.children('input[name="'+d.name+'"]').trigger("input")),this},this.prev=function(e){var t,i=x(-1);switch(f){case"string":t=i;break;case"object":t=i[d.key]}return this.val(t),void 0!==e&&e&&(this.el.trigger(OGX.Roulette.CHANGE,t),d.name&&this.el.children('input[name="'+d.name+'"]').trigger("change")),this},this.setData=function(e,t){return d.value=t,d.list=e,S(),h=void 0===t?0:C(t).index,setTimeout(E,0),this},void 0!==OGX.List?void 0!==OGX.Templater?void 0!==OGX.Display?(debug(5,"roulette init",d.id),function(){if(OGX.Data.merge(d,c),S(),d.display?d.display=new OGX.Display(d.display):d.display=new OGX.Display(u),(t=l.el=$(d.el)).addClass(p),t.width(),n=t.height(),d.list.length){var e=t.parent();e[0].hasAttribute("data-value")&&(d.value=OGX.Data.stringToVal(e.data("value")),e.removeAttr("data-value")),null===d.value&&(d.value=d.list[0],"object"==typeof d.value&&(d.value=d.value.value)),h=C(d.value).index}}(),l.observe(!0,{childList:!0},(function(){l.observe(!1),l.touch.swipe=l.touch.add("Swipe",{x:!1,y:!0,cb_down:O,cb_swipe:b,cb_up:w,target:'.ogx_roulette[data-ogx-id="'+l.id+'"] > .ogx_roulette_container',capture:d.capture})}),null),E(),debug(5,"roulette",d.id,"init")):debug(1,"OGX.Display not found! "):debug(1,"OGX.Templater not found! "):debug(1,"OGX.List not found! ")},OGX.Roulette.CHANGE="RouletteChange",OGX.Roulette.MODE_REWIND="RouletteModeRewind",OGX.Roulette.MODE_CLOSEST="RouetteModeClosest",OGX.Roulette.BIND=OGX.Roulette.CHANGE,void 0===OGX)var OGX={};if(require("RouletteTree","Uxi"),OGX.RouletteTree=function(e){construct(this,"RouletteTree");var t,n,a=this,o=e,r={groups:!1,data:!1,value:!1,required:!1},s=!1;function l(e){e?t.on(OGX.Roulette.CHANGE,c):t.off(OGX.Roulette.CHANGE,c)}function d(){for(var e,t=0;t0&&(e=s[t-1].roulette.val()),0===t||t-1>=0&&null!==e&&String(e).length>0?s[t].roulette.focus():t>0&&p(s[t].roulette)}function c(e,a){e.stopImmediatePropagation();var o,r=$(e.target).data("ogx-id"),l=s.findIndex("id",String(r)),d=s[l.index].roulette.item().hasOwnProperty("head");if(n=l.index,l.index+10&&s[a].roulette.setData(h(i),t),i.push(t)));setTimeout(d,0)}function h(e){for(var t=o.data,i=0;i-1?f(n):{};g(e)},o=OGX.Data.merge(o,r),(t=a.el).addClass("ogx_roulette_tree"),function(){s=new OGX.List;var e,i,n=0;!function r(l,d){var c;if(!Array.isArray(l)&&"object"==typeof l){if(d>n){for(var u in n=d,t.append('
'),i=o.groups[d-1],e=[{label:i,value:"",head:!0}],l)e.push({label:u,value:u});c=a.create("Roulette",{el:'.ogx_roulette_tree[data-ogx-id="'+a.id+'"] .ogx_roulette_tree_roulette[data-ogx-roulette="'+d+'"]',list:e,icon:o.icon,value:null,name:i,required:o.required}),n>1&&p(c),s.push({roulette:c,group:i,id:c.id})}if(de.unix+e.expiration)}function getCache(e){if(void 0===e)return!1;for(var t,i,n=0;n0}catch(e){debug(1,e)}return!1},this.fork=function(e){for(var t in e)if(this.eval(t))return e[t];return!1}},void 0===OGX)var OGX={};if(require("Scroller","Uxi","Touch"),OGX.Scroller=function(e){construct(this,"Scroller");var t,i,n,a,o,r,s,l,d,c,u,f=this,g=e,h={check_delay:30,fade_delay:300,css:!1,zindex:9999,observe:!0,auto_scroll:!1,scroll_callback:!1,trigger:!0},p=0,_="init",m=!1,v=!1,y=null;function x(e){e?i.on(f.touch.down,O):i.off(f.touch.down,O)}function O(e){e=f.event(e),S(!1),G(!0),b(!0),x(!1),L("in"),D(!0)}function b(e){e?(c=setInterval(E,10),i.on(f.touch.move,w)):(clearInterval(c),i.off(f.touch.move,w))}function w(e){e=f.event(e)}function G(e){e?$(document).on(f.touch.up,X):$(document).off(f.touch.up,X)}function X(){b(!1),G(!1),x(!0),D(!1),L("out")}function T(e){e?(window.addEventListener("resize",N),i.on("scroll",(function(e){e.stopImmediatePropagation(),E()})),i.on("wheel",(function(e){D(!0)})),void 0!==OGX.NestedList&&$(document).on(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED,(function(){f.update()}))):(window.removeEventListener("resize",N),i.off("scroll"),i.off("wheel"),void 0!==OGX.NestedList&&$(document).off(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED))}function E(){var e,a=(e=i.scrollTop())/s,r=Math.round(o.position().top);o.css("top",a+"px"),g.trigger&&!m&&(f.el.trigger(OGX.Scroller.SCROLL,{top:e,percent:100*e/n}),-1*e==i.outerHeight(!0)-t.outerHeight(!0)?r!==Math.round(a)&&f.el.trigger(OGX.Scroller.BOTTOM):0===e&&(r&&r!==Math.round(a)||!r)&&f.el.trigger(OGX.Scroller.TOP)),g.scroll_callback&&g.scroll_callback()}function D(e){e?(d&&D(!1),l=t.position().top,d=setInterval(C,g.check_delay-10)):(d&&(clearInterval(d),d=null),v=!1,f.el.trigger(OGX.Scroller.END))}function C(){var e=t.position().top;e!==l?(v||(v=!0,f.el.trigger(OGX.Scroller.START)),L("in")):L("out"),l=e}function S(e){e?u=setInterval(E,g.check_delay):clearInterval(u)}function L(e){o.hasClass("ogx_scroller_track_anim")||o.addClass("ogx_scroller_track_anim"),"in"===e?(clearTimeout(y),y=null,o.addClass("ogx_scroller_track_anim_fade_in").removeClass("ogx_scroller_track_anim_fade_out")):y||(y=setTimeout((function(){o.addClass("ogx_scroller_track_anim_fade_out").removeClass("ogx_scroller_track_anim_fade_in")}),g.fade_delay))}function k(e){e?f.observe(!0,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","src","width","height"]},M):f.observe(!1)}function M(){p!==t.height()&&(p=t.height(),N(),g.auto_scroll&&f.bottom())}function N(){if(a=i.innerHeight(),n=t.height(),s=n/a,n>a){var e=Math.round(a/s);o.css("height",e+"px"),r.css("display","block")}else r.css("display","none");"init"===_&&(_=OGX.Scroller.READY,f.el.trigger(OGX.Scroller.READY))}this.enable=function(){return N(),T(!0),g.observe&&setTimeout((function(){k(!0)}),0),x(!0),debug(5,"scroller",g.id,"enabled"),this},this.disable=function(){return T(!1),g.observe&&k(!1),G(!1),b(!1),x(!1),D(!1),S(!1),o.removeClass("ogx_scroller_track_anim_fade_in"),o.removeClass("ogx_scroller_track_anim_fade_out"),debug(5,"scroller",g.id,"disabled"),this},this.resize=function(){return N(),this},this.destroy=function(){f.el.removeClass("ogx_scroller_outer"),t.remove(),r.remove()},this.top=function(){return n>a&&(i[0].scrollTop=0,N()),this},this.bottom=function(){return n>a&&(i.scrollTop(n),N()),this},this.scroll=function(e){return void 0===e?i[0].scrollTop:(i[0].scrollTop=e,N(),this)},this.mute=function(){return m=!0,this},this.vocal=function(){return m=!1,this},this.container=function(){return t},this.inner=function(){return t[0]},this.outer=function(){return i[0]},this.state=function(){return _},OGX.Data.merge(g,h),function(){f.el=$(g.el),f.el.addClass("ogx_scroller_outer ogx_hw"),(i=f.el).html('
'),t=i.children(".ogx_scroller_inner");var e='
';i.parent().append(e),r=i.parent().find(".ogx_scroller_track"),o=r.find(".ogx_scroller_track_button")}(),N(),debug(5,"scroller",g.id,"init")},OGX.Scroller.READY="ScrollerReady",OGX.Scroller.TOP="ScrollerTop",OGX.Scroller.BOTTOM="ScrollerBottom",OGX.Scroller.SCROLL="ScrollerScroll",OGX.Scroller.START="ScrollerStart",OGX.Scroller.END="ScrollerEnd",void 0===OGX)var OGX={};if(require("StackedTree","Uxi","Touch"),OGX.StackedTree=function(e){construct(this,"StackedTree");var t,i,n,a,o=this,r={scope:["public"],speed:200,list:[],display:{html:"{{$label}}"},displays:!1,chromeos:!1},s=e,l=[],d=[0],c=0,u=!1,f="ogx_stacked_tree";function g(e){e?(t.on(o.touch.down,".ogx_stacked_tree_level .ogx_stacked_tree_level_prev",h),t.on(o.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[c].findIndex("__id__",t.__id__);t.hasOwnProperty("items")&&t.items.length&&function(e){if(!e.hasOwnProperty("scope"))return!0;for(var t=0;t';e>0&&(r=(r=a.css(u)).replace(f+"_door",""),d+='
'+a.html(u)+"
"),d+='
',i.append(d);var c=i.children("."+f+'_level[data-level="'+e+'"]').children("."+f+"_level_list");i.children("."+f+"_level").css("flex-basis",Math.floor(100/(e+1)*100)/100+"%"),function(e,t,i){l[e]&&o.remove(l[e].id,"DynamicList");var n=o.create("DynamicList",{el:t,mode:"static",scroll:!0,display:s.display,displays:s.displays,list:i});l[e]=n}(e,c[0],t)}function v(e,t){g(!1),i.addClass(f+"_anim"),void 0!==t&&t?i.on("transitionend",(function(){i.off("transitionend"),i.removeClass(f+"_anim").css("width",100*(e+1)+"%"),o.remove(l[e+1].id,OGX.DynamicList.NAME),l.splice(e+1,1),i.children("."+f+'_level[data-level="'+(e+1)+'"]').remove(),i.children("."+f+"_level").css("flex-basis",Math.floor(100/(e+1)*100)/100+"%"),n=i.width(),u=!1,c=e,g(!0)})):(c=e,g(!0)),n=i.width(),i.css("transform","translateX("+e*Math.round(n/d.length)*-1+"px)")}this.enable=function(){return g(!0),p(!0),debug(5,"stackedtree",s.id,"enabled"),this},this.disable=function(){return g(!1),p(!1),debug(5,"stackedtree",s.id,"disabled"),this},this.resize=function(){return _(),this},this.destroy=function(){debug(5,"stackedtree destroy",s.id)},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,d=[0],c=0,u=!1,!0):s.scope},debug(5,"stackedtree",s.id,"init"),function(){if(void 0!==OGX.DynamicList)if(void 0!==OGX.Display){s=OGX.Data.merge(s,r,!1,!0);var e=(a=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){var t=['{{return typeof($items) !== "undefined" && $items.length > 0}}',{add:"ogx_stacked_tree_door"}];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",e.css.hasOwnProperty("conditions")?e.css.conditions.push(t):e.css.conditions=[t];else{var i="";e.css&&(i=e.css),i+=" ogx_stacked_tree_item",e.css={add:i,conditions:[t]}}else e.css={add:"ogx_stacked_tree_item",conditions:[t]};return e}return e}(e),a.val(e),s.display=e.display,s.displays=e.displays,(t=o.el).addClass(f),s.list.length){var i=s.list.slice();s.list={items:i}}}else debug(1,"OGX.Display not found! ");else debug(1,"OGX.DynamicList not found! ")}(),t.html('
'),i=t.children("."+f+"_container").first(),s.list.items.length&&m(d[0],s.list.items)},OGX.StackedTree.BACK="StackedTreeBack",OGX.StackedTree.ENTER="StackedTreeEnter",OGX.StackedTree.SELECT="StackedTreeSelect",require("Stage","Uxi","Touch","Placeholder"),OGX.Stage=function(e){construct(this,"Stage");var t=this,i=OGX.Data.merge({id:"stage",anim:null,group_watch:!1},e,!0,!0);function n(e){e?t.el.on(t.touch.down,".ogx_stage_exit",(function(){app.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.enable=function(){return i.closeable&&n(!0),this},this.disable=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 a="";i.closeable&&(a='
');var o=e.html();i.hasOwnProperty("data")&&(o=OGX.Templater.make(o,i.data)),a+=o,container=t.el,container.html(a),container.addClass("ogx_stage").css("display",n)}()},OGX.Stage.SWAP="swap",OGX.Stage.FLIP="flip",void 0===OGX)var OGX={};if(require("Switch","Uxi","Bind","Touch"),OGX.Switch=function(e){construct(this,"Switch");var t,i=this,n=e,a={el:"document",bind:!1,labels:!0,data:[{label:"OFF",value:!1},{label:"ON",value:!0}],value:!1,name:!1},o="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("."+o+"_dot").first(),a=t.find("."+o+"_label").first(),r=t.find("."+o+"_label").last();n.value==n.data[0].value?(i.removeClass(o+"_dot_right").addClass(o+"_dot_left"),a.removeClass(o+"_label_off").addClass(o+"_label_on").addClass(o+"_selected"),r.removeClass(o+"_label_on").addClass(o+"_label_off").removeClass(o+"_selected")):(i.removeClass(o+"_dot_left").addClass(o+"_dot_right"),r.removeClass(o+"_label_off").addClass(o+"_label_on").addClass(o+"_selected"),a.removeClass(o+"_label_on").addClass(o+"_label_off").removeClass(o+"_selected")),n.name&&t.find('input[type="hidden"]').attr("value",n.value),e&&t.children("."+o+"_val").trigger("input")}function l(e){e?t.on(i.touch.down,d):t.off(i.touch.down,d)}function d(e){e.preventDefault(),e.stopImmediatePropagation(),r(),c(!1),t.trigger(OGX.Switch.CHANGE,n.value),t.children("."+o+"_val").trigger("input"),c(!0)}function c(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.enable=function(){return l(!0),n.name&&c(!0),t.removeClass(o+"_disabled"),debug(5,"switch",n.id,"enabled"),this},this.disable=function(){return l(!1),n.name&&c(!1),t.addClass(o+"_disabled"),debug(5,"switch",n.id,"disabled"),this},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("."+o+"_val").first().trigger("input")),n.value},this.toggle=function(e){return r(e=void 0===e),this},debug(5,"switch",n.id,"init"),function(){var e;void 0===n&&(n={}),n.hasOwnProperty("data")&&!n.hasOwnProperty("value")&&(e=n.data[0].value),OGX.Data.merge(n,a),void 0!==e&&(n.value=e),(t=i.el).addClass(o+"_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+=''+n.data[0].label+"");var i="";n.value===n.data[1].value&&(i=o+"_dot_right"),e+='
',n.labels&&(e+=''+n.data[1].label+""),n.name&&(e+=''),t.html(e),t.addClass(o)}(),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,a={editable:!0,detachable:!1,detach_min:20,reorder:!0,icons:!1,index:0,list:new OGX.List,display:{html:"",css:""}},o=!1,r=0,s=!1,l=!1,d=!1,c=!1,u=!1,f={x:0,y:0},g="ogx_tabs";function h(){for(var e,i,a='
',s=0;s',e&&(a+=''+e+""),n.editable&&(a+=''),a+="
",i="";a+="",n.editable&&(a+='
',t.addClass(g+"_editable")),t.html(a),o=t.children("."+g+"_container").children("."+g+"_tab:eq("+r+")")}function p(e){s||(u=!1,l=$(e),d={from:l.index()},t.children("."+g+"_container").children("."+g+"_tab_active").first().removeClass(g+"_tab_active"),f.x=l.position().left,f.y=l.position().top,(s={el:$(e).clone(),x:f.x,y:l.position().top}).w=l.width(),s.el.width(s.w),l.addClass(g+"_tab_active").addClass(g+"_frozen"),o=l,s.el.addClass(g+"_tab_active").addClass(g+"_float").css("transform","translate3d("+f.x+"px, "+s.y+"px, 0px)"),t.children("."+g+"_container").prepend(s.el),c=setInterval(m,5))}function _(e,a){if(s)if(u=a,Math.abs(a.x)>Math.abs(a.y)){var o=s.x+a.x;s.el.css("transform","translate3d("+o+"px, "+s.y+"px, 0px)")}else{var r=s.y+a.y;if(s.el.css("transform","translate3d("+s.x+"px, "+r+"px, 0px)"),Math.abs(a.y)>4){d.to=l.index(),v();var c=n.list[d.from];"object"==typeof c&&(c=c.label);var f={label:c,index:d.to};i.removeAt(d.to),t.trigger(OGX.Tabs.REMOVE,f)}}}function m(){var e,i,n;s&&u&&(idx=l.index(),Math.abs(u.x)>Math.abs(u.y)&&t.children("."+g+"_container").children("."+g+"_tab").each((function(t,a){(e=$(a)).hasClass(g+"_tab_active")||(i=e.position(),n=e.width(),idx!==t&&(s.x+u.x>i.left+n/2&&s.x+u.xi.left&&s.x+u.xe&&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(h,0),this},this.removeCurrent=function(){return o&&this.removeTabAt(r),this},this.removeAt=function(e){return n.list.delete(e)&&(t.children("."+g+"_container").first().children("."+g+"_tab:eq("+e+")").remove(),o=null,function(){r>0?r--:r=0;i.index(r)}()),this},this.enableTab=function(e){return t.children("."+g+"_container").first().children("."+g+"_tab:eq("+e+")").removeClass(g+"_tab_disabled"),this},this.disableTab=function(e){return t.children("."+g+"_container").first().children("."+g+"_tab:eq("+e+")").addClass(g+"_tab_disabled"),this},this.index=function(e){return void 0!==e?(o&&(o.removeClass(g+"_tab_active"),o=null),(o=t.children("."+g+"_container").first().children("."+g+"_tab:eq("+e+")")).addClass(g+"_tab_active"),r=e,!0):o?r:-1},this.select=function(e){o&&o.removeClass(g+"_tab_active");var t=n.list.findIndex("label",e);return this.index(t.index),this},void 0!==OGX.List?(debug(5,"tabs",n.id,"init"),n||(n={}),OGX.Data.merge(n,a),n.list.hasOwnProperty("insert")||(n.list=new OGX.List(n.list)),n.display.hasOwnProperty("_NAME_")||(n.display=new OGX.Display(n.display)),(t=i.el).addClass(g),n.editable&&t.addClass(g+"_editable"),r=n.index,setTimeout(h,0),n.reorder&&i.touch.hold.set({target:".ogx_tabs_tab",cb_hold:p,cb_move:_,cb_up:v})):debug(1,"OGX.List not found! ")},OGX.Tabs.SELECT="TabsSelect",OGX.Tabs.CLOSE="TabsClose",OGX.Tabs.REORDER="TabsReoroder",OGX.Tabs.ADD="TabsAdded",OGX.Tabs.REMOVE="TabsRemoved",void 0===OGX)var OGX={};if(require("Tags","Uxi","Touch"),OGX.Tags=function(__config){construct(this,"Tags");var that=this,config=__config,config_default={remove:!0,add:!0,name:!1,tags:[],current_tags:[],tags_ascii:[],mode:OGX.Tags.MODE_STRING,keycode:13,placeholder:"keywords",restrict:!1,strict:!1,required:!1,max:0,display_max:0,display_more:!1,click_more:!1,hide_input_on_disable:!0,more_word:"other"},container,input,sliced={org:[],rem:[]};function updateHidden(e){var t;t=1===config.max&&config.current_tags.length?config.current_tags[0]:JSON.stringify(config.current_tags),container.find("input[type=hidden]").val(t),e&&container.find("input[type=hidden]").trigger("change")}function addTag(e){var t=!1;switch(config.mode){case OGX.Tags.MODE_STRING:case OGX.Tags.MODE_ASCII:-1===config.current_tags.indexOf(e)&&(config.current_tags.push(e),t=!0);break;case OGX.Tags.MODE_OBJECT:var i=config.current_tags.find("label",e,1);i||((i=config.tags.find("label",e,1))?config.current_tags.push(i):config.current_tags.push({label:e}),t=!0)}if(t){var n="";!0===config.remove&&(n='');var a=''+e+""+n+"";container.find(".ogx_tags_tags").first().append(a),listenHidden(!1),updateHidden(!0),listenHidden(!0),container.trigger(OGX.Tags.TAG_ADDED,e),container.trigger(OGX.Tags.CHANGE,[config.current_tags])}container.find(".ogx_tags_input").trigger("focus")}function removeTag(e){var t=!1;switch(config.mode){case OGX.Tags.MODE_STRING:case OGX.Tags.MODE_ASCII:var i=config.current_tags.indexOf(e);i>-1&&(t=config.current_tags.splice(i,1));break;case OGX.Tags.MODE_OBJECT:t=config.current_tags.findDelete("label",e)}return t&&container.find(".ogx_tags_tags").first().find(".ogx_tags_tag").each((function(t,i){if($(i).find("span").first().text()===e)return $(i).remove(),listenHidden(!1),updateHidden(!0),void listenHidden(!0)})),t}function displayTags(e,t){if(e){container.find(".ogx_tags_container").length>0&&(displayTags(!1),listenTagAdd(!1));for(var i='
',n=!1,a=0;a";break;case OGX.Tags.MODE_OBJECT:i+=''+t[a].label+""}n&&(i+='+'+n+" "+config.more_word+""),i+="
",container.append(i),listenTagAdd(!0)}else container.find(".ogx_tags_container").remove(),listenTagAdd(!1)}function renderTags(e){for(var t="",i="",n=0;n':"",config.mode){case OGX.Tags.MODE_STRING:case OGX.Tags.MODE_ASCII:t+=''+e[n]+""+i+"";break;case OGX.Tags.MODE_OBJECT:t+=''+e[n].label+""+i+""}return config.current_tags=e,container.find(".ogx_tags_tags").first().html(t),updateHidden(!1),!0}function trimTags(e){return e=OGX.Data.clone(e),sliced={org:OGX.Data.clone(e),rem:[]},Array.isArray(e)&&config.display_max&&e.length>config.display_max&&(sliced.rem=e.slice(config.display_max),e=e.slice(0,config.display_max)),config.display_more&&sliced.rem.length&&e.push({__m__:sliced.rem.length}),new OGX.List(e)}function findTags(e){for(var t,i=[],n=0;n=3)if(!config.strict&&e.which===config.keycode&&config.add)addTag(t),input.val(""),displayTags(!1);else{var i;switch(config.mode){case OGX.Tags.MODE_STRING:i=findTags(t);break;case OGX.Tags.MODE_OBJECT:i=findTagsObj(t);break;case OGX.Tags.MODE_ASCII:i=findTagsAscii(t)}i.length>0?displayTags(!0,i):displayTags(!1)}else displayTags(!1)})):input.off("keyup")}function listenSelect(e){e?container.on(that.touch.down,".ogx_tags_tag",onSelect):container.off(that.touch.down,".ogx_tags_tag",onSelect)}function onSelect(e){var t=$(this).text();switch(config.mode){case OGX.Tags.MODE_OBJECT:t=config.current_tags.get({label:{eq:t}},null,1)}that.el.trigger(OGX.Tags.SELECT,t)}function listenMore(e){e?container.on(that.touch.down,".ogx_tags_more",onMore):container.off(that.touch.down,".ogx_tags_more",onMore)}function onMore(e){e.preventDefault(),e.stopImmediatePropagation(),sliced.rem.length&&($(this).remove(),displayTags(!0,sliced.org))}function listenTagAdd(e){e?container.on(that.touch.down,".ogx_tags_container_tag",onAdd):container.off(that.touch.down,".ogx_tags_container_tag",onAdd)}function onAdd(e){addTag($(this).text()),input.val(""),displayTags(!1),config.max&&config.current_tags.length===config.max&&(listenInput(!1),input.css("display","none"))}function listenTagRemove(e){e?container.on(that.touch.down,".ogx_tags_remove",onRemove):container.off(that.touch.down,".ogx_tags_remove",onRemove)}function onRemove(e){e.preventDefault(),e.stopImmediatePropagation();var t=removeTag($(this).parent("span").first().find("span").first().text());container.trigger(OGX.Tags.TAG_REMOVED,t),container.trigger(OGX.Tags.CHANGE,[config.current_tags]),config.max&&config.current_tags.length'),config.name){var t="";config.required&&(t="required"),e+='"}if(container.html(e),input=container.find(".ogx_tags_input").first(),config.restrict){var i={multiline:!1,max:30};"object"==typeof config.restrict&&(i=config.restrict),i.el=input[0],OGX.Form.restrictField(i)}}function initDefaults(){for(var a in config||(config={}),config_default)config.hasOwnProperty(a)||(config[a]=config_default[a]);config.tags.hasOwnProperty("insert")||(config.tags=new OGX.List(config.tags)),config.current_tags.hasOwnProperty("insert")||(config.current_tags=new OGX.List(config.current_tags)),config.restrict&&("string"==typeof config.restrict.allowed&&(config.restrict.allowed=eval(config.restrict.allowed)),"string"==typeof config.restrict.forbidden&&(config.restrict.forbidden=eval(config.restrict.forbidden))),container=that.el,container.addClass("ogx_tags")}function init(){void 0!==OGX.List?config&&config.restrict&&void 0===OGX.Form?debug(1,"OGX.Form not found! "):(initDefaults(),initInput(),config.current_tags.length>0&&renderTags(config.current_tags)):debug(1,"OGX.List not found! ")}this.enable=function(){if(config.remove&&(listenInput(!0),listenTagAdd(!0),listenTagRemove(!0)),config.display_more&&config.click_more&&listenMore(!0),config.name&&listenHidden(!0),listenSelect(!0),config.add){var e=container.find(".ogx_tags_input").first();e.prop("placeholder",config.placeholder),e.prop("disabled",!1),config.hide_input_on_disable&&e.removeClass("ogx_tags_hidden")}return debug(5,"tags",config.id,"enabled"),this},this.disable=function(){if(config.remove&&(listenInput(!1),listenTagAdd(!1),listenTagRemove(!1)),config.display_more&&config.click_more&&listenMore(!1),config.name&&listenHidden(!1),listenSelect(!1),config.add){var e=container.find(".ogx_tags_input").first();e.prop("placeholder",""),e.prop("disabled",!0),config.hide_input_on_disable&&e.addClass("ogx_tags_hidden")}return debug(5,"tags",config.id,"disabled"),this},this.destroy=function(){config.restrict&&OGX.Form.unrestrictField(container.find(".ogx_tags_input").first()[0])},this.tags=function(e){return void 0!==e?(e.hasOwnProperty("insert")||(e=new OGX.List(e)),config.tags=e,!0):config.tags},this.val=function(e,t){if(displayTags(!1),listenTagAdd(!1),void 0!==e){if(void 0!==t){var i=e,n=config.tags.find(i,t,1);n&&(e=[n])}return e.hasOwnProperty("insert")||(e=new OGX.List(e)),config.current_tags=e,config.max&&config.current_tags.length>=config.max&&container.find(".ogx_tags_input").first().css("display","none"),renderTags(config.current_tags)}return config.current_tags},this.wipe=function(){return config.max&&config.current_tags.length===config.max&&(container.find(".ogx_tags_input").first().css("display","block"),listenInput(!0)),config.current_tags=new OGX.List,container.find(".ogx_tags_tags").first().empty(),container.find("input[type=hidden]").first().val(""),this},this.clear=function(){return debug(2,"Tags clear is deprecated, use wipe"),this.wipe()},this.render=function(e){return renderTags(trimTags(e))},this.add=function(e){return addTag(e)},this.remove=function(e){return removeTag(e)},init()},OGX.Tags.prototype.tagDataset=function(e,t,i){"use strict";void 0===i&&(i=!1);for(var n,a=[],o=0;o-1&&(i.includes(n.items[a][o])||i.push(n.items[a][o]));return e(n.items[a]),!0}}(e));}(e,t)},OGX.Tags.CHANGE="TagsChange",OGX.Tags.SELECT="TagsSelect",OGX.Tags.TAG_ADDED="TagsTagAdded",OGX.Tags.TAG_REMOVED="TagsTagRemoved",OGX.Tags.MODE_STRING="string",OGX.Tags.MODE_OBJECT="object",OGX.Tags.MODE_ASCII="ascii",OGX.Tags.BIND=OGX.Tags.CHANGE,void 0===OGX)var OGX={};if(OGX.Templater=function(){"use strict";var e;this.jmake=function(e,t){for(var i,n,a=JSON.stringify(e);m=/({{(\$|#)[a-z0-9_\.]*}})|("{{(\$)}}")/gi.exec(a);)m[0].match(/"{{(\$)}}"/)?(i="<-"+(i=JSON.stringify(t)).substring(1).slice(0,-1)+"->",a=(a=(a=a.replace(m[0],i)).replace(/<\-/,"{")).replace(/\->/,"}")):("object"==typeof(n=OGX.OSE.exec(m[0],t))&&(n=JSON.stringify(n),m[0]='"'+m[0]+'"'),a=a.replace(m[0],n));return JSON.parse(a)},this.make=function(t,i,n,a,o){var r,s;for(e={},void 0===o&&(o={}),OGX.Data.merge(e,o),debug(5,"Templatizing",t);r=/{{[^{]+(({[^{]+)+)?}}/gi.exec(t);)void 0===(s=OGX.OSE.exec(r[0],i,n,a,e))&&(s=""),t=t.replace(r[0],s);return debug(5,"Templatized",t),t},this.get=function(e){var t=OGX.Cache.read("html",e);return t||(debug(1,"Template",e,"not found"),!1)}},OGX.Templater=new OGX.Templater,require("Theater","Uxi","Touch"),OGX.Theater=function(e){construct(this,"Theater");var t,i,n,a=this,o=e,r={anim:!1,display:!0,icon_size:50,timeout:30},s={template:!1,html:'{{$label}}'},l='
',d=!0;function c(e){e?($(document).on("backbutton",u),$(window).on("popstate",u),list.el.on(OGX.DynamicList.SELECT,(function(e,t){!function(e){debug(3,"theater show stage",e),a.el.trigger(OGX.Theater.HIDE);var t=app.find("Stage",e);t.wake(),t.resizeNodes();var n,r=list.el.find('.ogx_theater_stage[data-ogx-id="'+t.id+'"]').position();a.observe(!0,{childList:!0},(function(){a.observe(!1),(n=i.children(".ogx_theater_trans")).on("transitionend",(function(){n.off("transitionend"),a.hide(),n.remove(),t.url?(app.showStage(t.id,!1),app.router.addToHist(t.url)):app.goto(t.id+"/"+t.home)})),n.removeClass("ogx_theater_trans_hide"),setTimeout((function(){n.addClass("ogx_theater_trans_grow").css({opacity:1,width:"100%",height:"100%",transform:"translate3d(0px, 0px, 0px)"})}),o.timeout)}),null,i),i.append('
")}(t.id)}))):($(document).off("backbutton",u),$(window).off("popstate",u),list.el.off(OGX.DynamicList.SELECT))}function u(){a.hide()}function f(){t.prepend(l);for(var e,i=[],r=0;r .list").on(OGX.DynamicList.RENDER,(function(e){$(".ogx_theater > .list").off(OGX.DynamicList.RENDER),setTimeout((function(){l=$(".ogx_theater").detach()}),0)})),list=a.create("DynamicList",{el:".ogx_theater > .list",display:{html:o.display.html,css:"ogx_theater_stage"},key:"id",scroll:!0,mode:"hit",list:i,trigger:!0})}function g(){var e=app.gather(OGX.Stage.NAME);n=[];for(var t=0;t
"),t.css("visibility","visible")}(),this.focusNodes(),c(!0),d=!1),this},this.hide=function(){return d||(debug(3,"hide theater"),this.blurNodes(),l=t.detach(),c(!1),d=!0),this},this.tile=function(e,t){void 0===t&&(t="x")},void 0!==OGX.DynamicList?(OGX.Data.merge(o,r),o.display&&("object"!=typeof o.display&&(o.display={}),OGX.Data.merge(o.display,s),o.display.template&&(o.display.html=OGX.Templater.get(o.display.template))),(t=a.el).addClass("ogx_theater").css("visibility","hidden"),i=$("body"),"undefined"!=typeof app?(g(),$(document).on(OGX.App.READY,f),debug(5,"theater init")):debug(1,"No instance of OGX.App!")):debug(1,"OGX.DynamicList not found! ")},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,a){var o=new OGX.Touches[e](t),r=o.set(a);return!r.hasOwnProperty("id")&&(r.id=i++),o.id=r.id,"auto"===r.status&&!t.blured&&t.enabled&&o.enable(),n.insert(o),o},this.touch.remove=function(e){"object"==typeof e&&(e=e.id),n.findDelete("id",__id,1).disable()},this.touch.get=function(e){return n.get({id:{eq:e}},null,1)},this.touch.wipe=function(){for(var e=0;eo.x?1:-1,l=r.y>o.y?1:-1,d=Math.abs(r.x-o.x),c=Math.abs(r.y-o.y),u=Math.sqrt(Math.abs(Math.pow(r.x-o.x,2)-Math.pow(r.y-o.y,2)))}function O(){a.cb_swipe&&(a.x&&a.min_x&&d>=a.min_x||a.y&&a.min_y&&c>=a.min_y?y(0,!0):a.cb_swipe({pt0:o,pt1:r,dirX:s,dirY:l,distX:d,distY:c,dist:u}))}this.set=function(e){return a=e,OGX.Data.merge(a,n),t=i.selector,this.state=a.state,"auto"===a.state&&(i.enable,i.disable),a.target&&(t=a.target),a},this.enable=function(){!g&&a&&(g=!0,v(!0))},this.disable=function(){g&&(g=!1,v(!1),_(!1))}},OGX.Touches.Hold=function(e){"use strict";var t={cb_hold:!1,cb_up:!1,cb_move:!1,time:1e3,el:this.el,target:!1,capture:!1,state:"auto"},i=!1,n=!1,a=!1,o=!1,r=!1,s=!1,l=e,d={x:0,y:0},c={x:0,y:0},u={x:0,y:0},f={x:0,y:0},g=null;function h(e){var t=[];t=i.target?[l.touch.down,i.target,p]:[l.touch.down,p],e?l.el.on.apply(l.el,t):l.el.off.apply(l.el,t)}function p(e){e=l.event(e),g=e.currentTarget,o||(o=!0,n=(new Date).getTime(),f.x=d.x=e.pageX,f.y=d.y=e.pageY,a=setInterval(m,1))}function _(e){i.capture&&(e.preventDefault(),e.stopImmediatePropagation()),e=l.event(e),c.x=e.pageX,c.y=e.pageY,c.x5||Math.abs(d.y-c.y)>5)&&(clearInterval(a),a=!1)}function m(){o&&(new Date).getTime()-n>i.time&&(r||(r=!0,$("body").on(l.touch.move,_),i.cb_hold?i.cb_hold(g,d):l.el.trigger(OGX.Touch.HOLD_START)))}function v(t){t=e.event(t),o=!1,clearInterval(a),a=!1,r&&(r=!1,$("body").off(l.touch.move,_),i.cb_up?i.cb_up({x:t.pageX,y:t.pageY}):l.el.trigger(OGX.Touch.HOLD_END,{x:t.pageX,y:t.pageY}))}this.set=function(e){return i=e,OGX.Data.merge(i,t),l.selector,this.state=i.state,"auto"===i.state&&(l.enable,l.disable),i.target&&i.target,i},this.enable=function(){!s&&i&&(s=!0,h(!0),$("body").on(l.touch.up,v))},this.disable=function(){s&&(s=!1,(o||a)&&(r=!1,o=!1,clearInterval(a),a=!1),h(!1),$("body").off(l.touch.up,v),$("body").off(l.touch.move,_))}},OGX.Touches.Drag=function(e){"use strict";var t,i,n,a,o,r,s=!1,l={min:10,limit_x:null,limit_y:null,target:!1,cb_down:!1,cb_drag:!1,cb_up:!1,border:10,capture:!1,state:"auto"},d=e,c=!1,u=!1;function f(e){var t=[];t=s.target?[d.touch.down,s.target,g]:[d.touch.down,g],e?d.el.on.apply(d.el,t):d.el.off.apply(d.el,t)}function g(l){s.capture&&(l.preventDefault(),l.stopImmediatePropagation()),l=e.event(l),n=l.pageX,a=l.pageY;var c=d.el.position();t=c.left,i=c.top;var u=d.el.offset(),f=n-u.left,g=a-u.top;if(s.border){if(fd.el.width()-s.border)return;if(gd.el.height()-s.border)return}o=0,r=0,h(!0),p(!0),s.cb_down&&s.cb_down()}function h(e){e?c||(c=setInterval(v,10)):c&&(clearInterval(c),c=null)}function p(e){e?($("body").on(d.touch.move,m),$("body").on(d.touch.up,_)):($("body").off(d.touch.move,m),$("body").off(d.touch.up,_))}function _(t){h(!1),p(!1),t=e.event(t),s.x&&(o=t.pageX-n),s.y&&(r=t.pageY-a),s.cb_up&&s.cb_up({distX:o,distY:r})}function m(t){s.capture&&(t.preventDefault(),t.stopImmediatePropagation()),t=e.event(t);var i,l=!1;s.x&&(i=t.pageX-n,null!==s.limit_x?i>=s.limit_x.min&&i<=s.limit_x.max&&(s.min?Math.abs(i)>s.min&&(o=i,l=!0):(o=i,l=!0)):s.min?Math.abs(i)>s.min&&(o=i,l=!0):o=i),s.y&&(i=t.pageY-a,null!==s.limit_y?i>=s.limit_y.min&&i<=s.limit_y.max&&(s.min?Math.abs(i)>s.min&&(r=i,l=!0):(r=i,l=!0)):r=i),l&&s.cb_drag&&s.cb_drag({distX:o,distY:r,x:t.pageX,y:t.pageY})}function v(){d.el.css({transform:"translate3d("+(t+o)+"px, "+(i+r)+"px, 0px)"})}this.dragable=!0,this.set=function(e){return s=e,OGX.Data.merge(s,l),"auto"===s.state&&(d.enable,d.disable,this.enable()),this.state=s.state,s},this.enable=function(){!u&&s&&(u=!0,f(!0))},this.disable=function(){u&&(u=!1,f(!1),p(!1),h(!1))}},OGX.Touches.Move=function(e){"use strict";var t,i,n,a,o,r,s,l,d=!1,c={min:0,limit_x:null,limit_y:null,target:null,cb_down:null,cb_move:null,cb_up:null,cb_click:null,capture:!1,state:"auto"},u=e,f=!1;function g(e){var t=[];t=d.target?[u.touch.down,d.target,h]:[u.touch.down,h],e?u.el.on.apply(u.el,t):u.el.off.apply(u.el,t)}function h(c){d.capture&&(c.preventDefault(),c.stopImmediatePropagation()),c=e.event(c),t=c.pageX,i=c.pageY,n=0,a=0,o=0,r=0,s=0,l=0,p(!0),d.cb_down&&d.cb_down(c)}function p(e){e?($("body").on(u.touch.move,m),$("body").on(u.touch.up,_)):($("body").off(u.touch.move,m),$("body").off(u.touch.up,_))}function _(s){if(p(!1),s=e.event(s),d.x&&(n=s.pageX-t),d.y&&(a=s.pageY-i),d.cb_up&&d.cb_up({x:s.pageX,y:s.pageY,distX:n,distY:a,dirX:o,dirY:r}),d.cb_click){var l=!1;d.x&&Math.abs(n)<2&&(l=!0),d.y&&Math.abs(a)<2&&(l=!0),l&&d.cb_click(s)}}function m(c){d.capture&&(c.preventDefault(),c.stopImmediatePropagation()),c=e.event(c);var u,f=!1;d.x&&(o=0,sc.pageX&&(o=-1),s=c.pageX,u=c.pageX-t,null!==d.limit_x?u>=d.limit_x.min&&u<=d.limit_x.max&&(d.min?Math.abs(u)>d.min&&(n=u,f=!0):(n=u,f=!0)):d.min?Math.abs(u)>d.min&&(n=u,f=!0):(n=u,f=!0)),d.y&&(r=0,lc.pageY&&(r=-1),l=c.pageY,u=c.pageY-i,null!==d.limit_y?u>=d.limit_y.min&&u<=d.limit_y.max&&(d.min?Math.abs(u)>d.min&&(a=u,f=!0):(a=u,f=!0)):(a=u,f=!0)),f&&d.cb_move&&d.cb_move({distX:n,distY:a,dirX:o,dirY:r,x:c.pageX,y:c.pageY})}this.set=function(e){return d=e,OGX.Data.merge(d,c),"auto"===d.state&&(u.enable,u.disable,this.enable()),this.state=d.state,d},this.enable=function(){!f&&d&&(f=!0,g(!0))},this.disable=function(){f&&(f=!1,g(!1),p(!1))}},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,a,o,r,s,l,d,c=this,u='{{$label}}',f=e,g={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:u},icons:{open:"folder_open",close:"folder_closed",empty:null}},file:{mode:"file",display:{html:u},icon:"file"},folder:{mode:"folder",display:{html:u},icons:{open:"folder_open",close:"folder_closed",empty:null}}},data:{id:0,type:"root",state:"closed",data:{label:null,icon:null},items:[]},display:null},h="_id";function p(e,t){var i={_id:t._id,container_display:"",container_css:"",arrow_display:"",arrow_style:"ogx_tree_item_arrow_open",state:"open"};return OGX.Data.merge(i,e,!0),OGX.Templater.make('
',i)}function _(){var e=p({},{_id:"root",type:"root",label:f.root_label});t.html(e),f.data.element=t.children(".ogx_tree_item").first(),f.data.uxi=c,f.show_root||f.data.element.addClass("ogx_tree_root_hidden")}function m(){_(),v(f.data,c)}function v(e,t){if(e.parent=t,e.hasOwnProperty("items")){var i,n;!e.items.hasOwnProperty("insert")&&(e.items=new OGX.List(e.items)),f.sort.enabled&&e.items.order(f.sort.property,f.sort.way);for(var a=0;a .ogx_tree_item_content';if(i.display.hasOML()){var a=i.display.oml(n,e,!1);OGX.OML.render(t,a,e),e.uxi=t.nodes.last()}else{var o=i.display.html(e);o=OGX.Templater.make(o,e),$(n).html(o)}}function O(e){var t={};return OGX.Data.merge(t,e),delete t.element,delete t.parent,d||delete t[h],t}function b(e){"folder"===S(e).mode&&(e.items.length||(e.element.data("state","close"),e.element.children(".ogx_tree_item_arrow").addClass("ogx_tree_item_arrow_disabled")),"open"===e.element.data("state")?(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").css("display","block")):(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").css("display","none")))}function w(){if(s){var e=E(s);e&&(e.children(".ogx_tree_item_icon").removeClass("ogx_tree_selected_item"),s=null)}}function G(e){var t=E(e);t&&(s=e,t.children(".ogx_tree_item_icon").addClass("ogx_tree_selected_item"))}function X(e,t){return C((function(i){return i[h]===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",b(i),!0)}))}function T(e){return C((function(t,i){return t[h]===e&&t}))}function E(e){var t=T(e);return!!t&&t.element}function D(){l=1,C((function(e){return e[h]=l++,e.hasOwnProperty("type")||(e.hasOwnProperty("items")?e.type="folder":e.type="file"),!1}))}function C(e,t){var i;if(void 0===t&&(t=f.data),i=function t(n,a,o,r){if(i=e(n,a,o,r))return i;if(n.hasOwnProperty("items")&&n.items.length)for(var s=0;s .ogx_tree_item_content",(function(e){e.preventDefault(),L($(this).parent(0)),1!==$(this).parent(0).data("id")&&function(){o&&clearInterval(o);r=(new Date).getTime(),o=setInterval(M,50)}()})),$(document).on(c.touch.up,(function(){I(),n&&(N(!1),function(){var e=n.offset().left,o=n.offset().top,r=(l=e,d=o,C((function(e,t){return c=e.element.offset(),u=e.element.children(".ogx_tree_item_icon"),l>=c.left&&l<=c.left+u.width()&&d>=c.top&&d<=c.top+u.height()&&e}))),s=S(r);var l,d,c,u;!r||r&&(r[h]===i[h]||"folder"!==s.mode)?(a.css("opacity",1),n.remove(),n=null,i=null):(g=r,function(e){C((function(t,i,n,a){return t[h]===e&&(n.items.splice(a,1),n.items.length||(n.state="close"),b(n),!0)}))}((f=i)[h]),X(f,g[h]),g.element.children(".ogx_tree_item_container").empty(),g.state="open",v(g,g.element),b(g),a.remove(),n.remove(),n=null,t.trigger(OGX.Tree.DROP,i),i=null);var f,g}())}))):t.on("click",".ogx_tree_item > .ogx_tree_item_content",(function(e){L($(this).parent(0))})),t.on(c.touch.down,".ogx_tree_item_arrow",(function(e){e.preventDefault(),I();var i=$(this).parent(0),n=i.data("state"),a=T(i.data("id"));a.hasOwnProperty("items")&&a.items.length&&("open"===n?(i.data("state","close"),t.trigger(OGX.Tree.CLOSE,a)):(i.data("state","open"),t.trigger(OGX.Tree.OPEN,a)),b(a))}))):(f.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 M(){var e;(new Date).getTime()-r>=f.drag_after&&(s&&(i=T(s))&&(e=i.element,a=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),N(!0),t.trigger(OGX.Tree.DRAG,i)),I())}function N(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 I(){o&&(clearInterval(o),o=null)}this.enable=function(){return k(!0),debug(5,"tree",f.id,"enabled"),this},this.disable=function(){return k(!1),debug(5,"tree",f.id,"disabled"),this},this.addItem=function(e,t){if(void 0===t&&(t=s),t){var i=T(t);if("folder"===S(i).mode){d||(e[h]=++l),X(e,t);var n=S(e);y(i.uxi,i.element.children(".ogx_tree_item_container").first(),e),x(e,i.parent);var a=i.uxi;return n.display.hasOML()&&(a=i.uxi.nodes.last()),v(e,a),i.element.data("state","open"),i.element.children(".ogx_tree_item_container").css("display","block"),i.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_disabled ogx_tree_item_arrow_close").addClass("ogx_tree_item_arrow_open"),!0}}return!1},this.getItem=function(e){var t=T(e);return!!t&&O(t)},this.selectItem=function(e){G(e)},this.selectItemByPropVal=function(e,t){var i=function(e,t){function i(i,n){return!(!i.data.hasOwnProperty(e)||i.data[e]!==t)&&n+"/"+i.label}return C(i)}(e,t);return!!i&&(w(),G(i[h]),!0)},this.selectItemByPath=function(e){var t=function(e){var t=function(e){function t(t,i){return e===i+"/"+t.label&&t}return C(t)}(e);if(t)return t.element;return!1}(e);return!!t&&(w(),t.addClass("ogx_tree_selected_item"),s=t.data("id"),!0)},this.updateItem=function(e,t){var i=T(e);if(i){if(i.uxi){var n=i.uxi.el;i.uxi.kill(),n.empty()}OGX.Data.merge(i,t,!0),x(i,i.parent),i.hasOwnProperty("items")&&i.items.length&&(v(i,i.parent),i.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_disabled ogx_tree_item_arrow_close").addClass("ogx_tree_item_arrow_open"),i.element.data("state","open"))}},this.replaceItem=function(e){var t=T(e[h]);t&&(t.uxi&&t.uxi.kill(),OGX.Data.merge(e,t,!1),x(t,t.parent),t.hasOwnProperty("items")&&t.items.length&&v(t,t.parent))},this.deleteItem=function(e){var t=T(e);if(t){var i=function(e){function t(t){return!(!t.hasOwnProperty("items")||!t.items.get({_id:{eq:e}},null,1))&&t}return C(t)}(e);t.uxi&&t.uxi.kill(),i.items.findDelete("_id",e,1),t.element.remove()}},this.deleteSelectedItem=function(){return function(){function e(e,t,i,n){if(e[h]===s)return e.element.remove(),i.items.splice(n,1),b(i),!0}if(s)return C(e);return!1}()},this.getSelectedItem=function(){return function(){if(s)return T(s);return!1}()},this.getTree=function(){var e=C(O,JSON.parse(JSON.stringify(f.data)));if(e)return e},this.setData=function(e){e.hasOwnProperty("types")&&this.setTypes(e.types),e.hasOwnProperty("tree")&&this.setTree(e.tree)},this.setTypes=function(e){f.types=e},this.setTree=function(e){this.clear(),f.data=e,f.data.hasOwnProperty("state")||(f.data.state="open"),d||D(),m()},this.newTree=function(){c.clear(),l=1,_()},this.filterTree=function(e){!function(e){var t=[];function i(n,a,o,r){if(-1!==(a+n.label).indexOf(e)&&t.push(a+"/"+n.label),n.hasOwnProperty("items")&&n.items.length)for(var s=0;s .ogx_scroller_inner',(i=$(e.el)).addClass(n).attr("data-ogx-id",this.id),t&&i.attr("id",this.id);var o=this;setTimeout((function(){o.scroller.resize()}),0)}else i.append(a),e.el='.ogx_uxi[data-ogx-id="'+this.id+'"]';this.el=$(e.el)}},OGX.Uxi.prototype.enable=function(){return this},OGX.Uxi.prototype.disable=function(){return this},OGX.Uxi.prototype.ux=function(){},OGX.Uxi.prototype.construct=function(){},OGX.Uxi.prototype.destroy=function(){},OGX.Uxi.prototype.resize=function(){return this},OGX.Uxi.prototype.show=function(){return this.el&&this.el.removeClass("ogx_uxi_hide"),this},OGX.Uxi.prototype.hide=function(){return this.el&&this.el.addClass("ogx_uxi_hide"),this},OGX.Uxi.prototype.render=function(e,t){return debug(2,"Uxi.render has been deprecated, use OGX.OML.render instead"),OGX.OML.render(this,e,t),this},OGX.Uxi.prototype.empty=function(){return this.clear(),this},OGX.Uxi.prototype.observe=function(e,t,i,n,a){var o=this,r=this.el,s=null;if(void 0!==a&&(r=a),e){if(!this.observer)return void 0!==t&&t||(t={childList:!0,subtree:!0}),this.observer=new MutationObserver((function(e,t){e.forEach((function(e){s&&clearTimeout(s),s=setTimeout((()=>{void 0!==i?i(e,n):o.el.trigger(OGX.View.CHANGED,e)}),10)}))})),this.observer.observe(r[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){var a=this;this.observe(!0,e,(function(){a.observe(!1),void 0!==t&&t(i)}),null,n)},OGX.Uxi.prototype.sleep=function(){return this.sleeping||(this.blur(2),this.sleeping=!0,this.scroll?(this.__parent=this.el.parent(".ogx_scroller_outer").first().parent(0),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+'"]'),this.focus(2),delete this.__parent),this},OGX.Uxi.prototype.detach=function(){return this.sleep(),this.parent.nodes.findDelete("id",this.id,1),this},OGX.Uxi.prototype.attach=function(e,t){return this.parent=e,this.parent.nodes.insert(this),this.wake(t),setTimeout((()=>this.resizeNodes),0),this},OGX.Uxi.prototype.resizeNodes=function(){for(var e=this.gather(),t=0;t0&&"Carousel"===t[i]._NAME_&&"Container"===t[i-1]._NAME_||(t[i].floating?t[i].show(e):t[i].show(this._NAME_,this.id));return this}},OGX.Uxi.prototype.focus=function(e){if(void 0===e&&(e=1),this.blured)switch(this.blured=!1,this.enabled&&(this.ux(!0),this.enable()),e){case 1:this.focusNodes();break;case 2:this.focusTree()}return this},OGX.Uxi.prototype.focusTree=function(){for(var e=this.gather(),t=0;tt&&(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)},require("View","Uxi","Placeholder","Touch"),OGX.View=function(e){construct(this,"View");var t=this,i=!1,n=e;this.enable=function(){return n.observe&&this.observe(!0),this},this.disable=function(){return n.observe&&this.observe(!1),this},this.container=function(){return i},this.render=function(e){return void 0===e?n.hasOwnProperty("html")&&n.html&&i.html(n.html):i.html(e),i.trigger(OGX.View.RENDER),this},function(){i=t.el;var a=new OGX.Display(e);n.html=a.html(e.data),i.addClass("ogx_view ogx_hw"),t.render()}()},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:'
$INNER
{{$html}}
',win_inner:['','{{$title}}','$ICONS'],zindex:!1,close_on_click_out:!1,close_dist:100,parent:null},config=__config,pt={x:null,y:null},dir={x:0,y:0},showto=50,user_resized=!1,zd;function genIcons(){for(var e="",t=0;t";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:config.parent.topIndex();var t=getLimitedSize();container.css({width:t.width,height:t.height,"z-index":zd})}function getLimitedSize(){var e,t,i,n=config.parent.el.width(),a=config.parent.el.height();user_resized?(n=config.width,a=config.height):(e=OGX.Data.getBestSize(n,config.width),t=OGX.Data.getBestSize(a,config.height));var o={width:e,height:t};return(config.min_width||config.max_width)&&(-1!==config.width.indexOf("%")?(n=config.parent.el.width(),i=Number(config.width.split("%")[0])*n/100,config.min_width&&iconfig.max_width&&(o.width=config.max_width+"px")):(-1!==(i=config.width).indexOf("px")&&(i=Number(i.split("px")[0])),config.min_width&&iconfig.max_width&&(o.width=config.max_width+"px"))),(config.min_height||config.max_height)&&(-1!==config.height.indexOf("%")?(a=config.parent.el.height(),i=Number(config.height.split("%")[0])*a/100,config.min_height&&iconfig.max_height&&(o.height=config.max_height+"px")):(-1!==(i=config.height).indexOf("px")&&(i=Number(i.split("px")[0])),config.min_height&&iconfig.max_height&&(o.height=config.max_height+"px"))),o}function listenBody(e){e?that.parent.el.on(that.touch.down,".ogx_overlay",onBody):that.parent.el.off(that.touch.down,".ogx_overlay",onBody)}function onBody(e){that.status===OGX.Window.OPEN&&(that.hide(),that.parent.removeOverlay(OGX.Overlay.Fade))}function animWindow(e,t,i,n){void 0===t&&(t=config.anim);var a={opac:1,tX:0,tY:0},o=container.parent().width(),r=container.parent().height(),s=that.el.outerWidth(),l=that.el.outerHeight(),d=that.el.find(".ogx_window_main_icon").first();switch(e&&(placeWindow(!0),d.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?(a.tY=0,d.addClass("ogx_window_main_icon_top")):a.tY=-l-10;break;case OGX.Window.ANIM_BOTTOM:e?(a.tY=0,d.addClass("ogx_window_main_icon_bottom")):a.tY=r+10;break;case OGX.Window.ANIM_RIGHT:e?(a.tX=o-s,d.addClass("ogx_window_main_icon_right")):a.tX=o+10;break;case OGX.Window.ANIM_LEFT:e?(a.tX=0,d.addClass("ogx_window_main_icon_left")):a.tX=-s-10}var c=100;e?(pt.x=a.tX,pt.y=a.tY):c=0,setTimeout((function(){dir.x,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("+a.tX+"px, "+a.tY+"px, 0px)",opacity:a.opac,visibility:"visible"})}),c)}function placeWindow(e){var t=container.parent().width(),i=container.parent().height(),n=that.el.outerHeight(),a=that.el.outerWidth();that.el.removeClass("ogx_window_anim_in").removeClass("ogx_window_anim_out");var o={x:0,y:0};switch(config.anim){case OGX.Window.ANIM_TOP:o.y=e?-n:n,dir.y=-1;break;case OGX.Window.ANIM_BOTTOM:o.y=e?i:i-n,dir.y=1;break;case OGX.Window.ANIM_RIGHT:o.x=e?t:t-a,dir.x=1;break;case OGX.Window.ANIM_LEFT:e&&(o.x=-a),dir.x=-1}that.el.css({transform:"translate3d("+o.x+"px, "+o.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(/>,<"),i=i.replace("$INNER",n);var a="";return config.icons&&config.icons.length&&(a=genIcons()),i=i.replace("$ICONS",a),OGX.Templater.make(i,t)}function onResize(){user_resized=!0,that.resizeNodes()}function listenScroll(e){e?(that.el.on(OGX.Scroller.START,(function(){that.disable()})),that.el.on(OGX.Scroller.END,(function(){that.enable()}))):(that.el.off(OGX.Scroller.START),that.el.off(OGX.Scroller.END))}function initPlaceholders(){that.placeholders(config,['.ogx_window[data-ogx-id="'+that.id+'"] > .ogx_window_body'])}function initDefaults(){OGX.Data.merge(config,app.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(){if(initDefaults(),render(),initPlaceholders(),placeWindow(!0),config.drag){var e={},t={top:!1,bottom:!1,left:!1,right:!1,cb_resize:onResize};switch(t.min_width=config.min_width,t.min_height=config.min_width,t.max_width=config.max_width,t.max_height=config.max_height,e.cb_drag=onDrag,e.cb_up=onRelease,config.anim){case OGX.Window.ANIM_LEFT:e.x=!0,e.y=!1,e.limit_x={min:-300,max:0},t.right=!0;break;case OGX.Window.ANIM_RIGHT:e.x=!0,e.y=!1,e.limit_x={min:0,max:300},t.left=!0;break;case OGX.Window.ANIM_TOP:e.x=!1,e.y=!0,e.limit_y={min:-300,max:0},t.bottom=!0;break;case OGX.Window.ANIM_BOTTOM:e.x=!1,e.y=!0,e.limit_y={min:0,max:300},t.top=!0}that.touch.drag=that.touch.add("Drag",e)}config.resize&&that.setResize(t),config.show&&that.show(),listenScroll(!0),debug(5,"window",config.id,"init")}this.id=config.id,this.dragable=null,this.resizeable=null,this.status=OGX.Window.CLOSED,this.enable=function(){return config.close_on_click_out&&listenBody(!0),config.head&&listenBackIcon(!0),config.icons&&listenIcons(!0),config.drag,config.resize&&this.enableResize(),debug(5,"window",config.id,"enabled"),this},this.disable=function(){return config.close_on_click_out&&listenBody(!1),config.head&&listenBackIcon(!1),config.icons&&listenIcons(!1),config.drag,config.resize&&this.disableResize(),debug(5,"window",config.id,"disabled"),this},this.show=function(e,t,i){return config.drag,config.resize&&this.enableResize(),listenScroll(!0),-1===[OGX.Window.OPEN,OGX.Window.OPENING].indexOf(this.status)&&(this.focus(1),this.front(),null==e&&(e=config.anim),setTimeout((function(){animWindow(!0,e,t,i)}),showto),showto&&(showto=0)),this},this.hide=function(e,t,i){return config.drag,config.resize&&this.disableResize(),listenScroll(!1),-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.resize=function(){var e=getLimitedSize();return container.css({width:e.width,height:e.height}),this.place(),this},this.destroy=function(){config.drag,listenScroll(!1)},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=config.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):config.drag&&(config.drag=this.dragable=!1)},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; \ No newline at end of file +/* globules.io OGX.JS 1.19.1.6.debug */ +if(String.prototype.hasOwnProperty("substr")||(String.prototype.substr=function(t,e){return t<0&&(t=this.length-t),this.slice(t,t+e)}),void 0===OGX)var OGX={};if(OGX.Data={},OGX.Data.weld=function(t,e,r,i){void 0===r&&(r=!1),void 0===i&&(i=!1);var a=t;return i&&(a=JSON.parse(JSON.stringify(t))),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,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=JSON.parse(JSON.stringify(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.props=function(t,e){for(var r in e)if(!t.hasOwnProperty(e[r]))return!1;return!0},OGX.Data.clone=function(t){return JSON.parse(JSON.stringify(t))},OGX.Data.isOML=function(t){for(var e in t)if(-1!==e.indexOf(":"))return!0;return!1},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.length1&&o[1].m0&&__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;i0&&__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;i0&&__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;i0&&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;r1&&(e=arguments.join("|")),!!indexes.hasOwnProperty(e)&&(delete indexes[e],!0)},array.deleteProperty=function(t){for(var e=0,r=0;r1?indexes[i][a].splice(0,r):indexes[i][a][0]:indexes[i][a])},array.clear=function(){indexes=!1,filterCount=0,this.length=0},array.unique=function(t,e,r){void 0===e&&(e=!0),void 0===r?r=[t]:Array.isArray(r)||(r=[r]);for(var i,a=this.get(),s=[],n=new OGX.List,o=0;o=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()o||this.filters[a][j][b][1]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}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}console.log("Error: moment.js not found!")},void 0===OGX)var OGX={};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=i)){var u=!1;for(var l in s)-1!==l.indexOf(":OSE")?(s[o=l.split(":").shift()]=OGX.OSE.exec(s[l],t,a,n,d),delete s[l],u||(u=!0,r++),e(s[o])):-1!==l.indexOf(":")||"object"!=typeof s[l]||Array.isArray(s[l])||s[l]instanceof HTMLElement||s[l]instanceof jQuery||(u||(u=!0,r++),e(s[l]))}}(e),e}function O(e,t){switch(e){case"scope":return OGX.Scope.fork(t);default:return OGX.OSE.fork(e,t)}}this.get=function(e){return OGX.Cache.read("oml",e)},this.make=function(e,t,n){var i={};return i[e+":"+t]=n,i},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 i(e,t,n){var i={};for(var o in e)i[o.replace(t,n)]=e[o];return i}void 0===n&&(n="default"),Array.isArray(n)||(n=[n],t=[t]);for(var o=0;o100)return}return e}o(e)},this.render=function(e,t,i,a,d){t=(t=f(e,{"node:OML":t}))["node:OML"],void 0===d&&(d=!1),n&&(o=!1,r&&clearTimeout(r),r=setTimeout(u,n)),function(e,t,i,r,a){var d=[],s=(new Date).getTime(),u=[];function v(e,t){if(o)debug(1,"OML RENDER EXCEEDED "+n+"MS");else if(Array.isArray(e))for(var s=0;s0&&(w=w.substr(0,w.indexOf(".")-1)),X=e[_],G=!0,b=!0,S=!1,C=!1,w){case"Function":return b=!1,G=!0,X.parent=t,X.fnc=c,X=g(X,i,r),void OGX.Fonction(X,i,r);case"Uxi":return void e[_].attach(t,c);case"Fork":(L=O(c,e[_]))&&v(L,t),b=!1,G=!1;break;case"Html":X.el=c,X.html=e[_].html,(b=p(X))||(X.template=!1);break;case"Template":X.template=m.split(".")[1],X.el=c,m="Html",b=p(X);break;case"Ghost":X.el=c;break;case"Controller":X.id=c,C=!0;break;default:-1!==[".","#"].indexOf(c.substr(0,1))?X.el=c:(X.id=c,X.el=t.el[0],X.parent=t)}G&&(X=g(X,i,r)),x=!1,M=!1,b?(a&&(P=a.find("id",X.id.replace(/^#/gi,""),1))&&(M=!0),M?(P.wake(X.el),y=P):y=OGX.Object.create(m,X),t.add(y),x=y):S?(S.blur(),$(c).html(E),S.el=$(c),t.add(S),setTimeout((function(){t.blured||S.focus()}),0)):(x=t,"Html"===m&&OGX.HtmlRender(X)),x&&e[_].hasOwnProperty("node:OML")&&!S&&!M&&(e[_]=f(e,e[_]),v(e[_]["node:OML"],x)),b&&(y.parent=t,"function"==typeof y.construct&&(M||(C?u.push({object:y,data:[i,r]}):y.construct.apply(y,[i,r])))),y&&!C&&(b||M)&&(t.blured||y.floating||y.focus()),void 0!==y&&y&&!C&&(d=d.concat(l(y,e[_])))}}}v(t,e),d.length&&function(e){for(var t=0;t'+r.display_date.format(e)+""),r.date&&(t+=''+r.date.format(r.format)+""),r.browse&&(t+=''),i.children(".ogx_calendar_head").children(".ogx_calendar_head_date").html(t)}function b(e){i.children(".ogx_calendar_head").children(".ogx_calendar_head_labels").html(e)}function w(e,t,i,n){if(t.y-1>=0&&t.y-1
'),T(),G(),t=o.create("GridSwiper",{el:r.el+" .ogx_calendar_body",loop:!0,map:n,start:{x:1,y:a+1},chromeos:r.chromeos,enabled:r.swipe}),O(),b(l[a].labels(r.display_date)),o.enable(),debug(5,"calendar",r.id,"init")):debug(1,"moment.js not found! "):debug(1,"OGX.GridSwiper not found! ")},OGX.Calendar.SELECT="CalendarSelect",OGX.Calendar.UNSELECT="CalendarUnselect",OGX.Calendar.BIND=OGX.Calendar.SELECT+" "+OGX.Calendar.UNSELECT,OGX.Calendar.BROWSE="CalendarBrowse",OGX.CalendarLayout={},OGX.CalendarLayout.BASE_LAYOUT=function(){"use strict";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"YYYY-MM"}},OGX.CalendarLayout.MONTH_DAYS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(){for(var e="",t=function(){for(var e=new Date(Date.UTC(2017,0,2)),t=[],i=0;i<7;i++)t.push(e.toLocaleDateString(navigator.language,{weekday:"short"})),e.setDate(e.getDate()+1);return t}(),i=0;i'+t[i]+"";return e},this.html=function(e,t,i,n){var a,o=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 d,c="",u=0;u<42;u++)d="",a=s.format("YYYY-MM-DD"),s.format("MM")!==o&&(d+="ogx_calendar_layout_month_days_offset "),a===moment().format("YYYY-MM-DD")&&(d+="ogx_calendar_layout_month_days_today "),n&&l===a&&(d+="ogx_calendar_selected_item "),c+='
'+t(a,i)+"
",s.add(1,"days");return c},this.value=function(){return{value:1,unit:"months"}},this.format=function(){return"YYYY-MM"}},OGX.CalendarLayout.CENTURY_DECADES=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return''+100*Math.floor(Number(e.format("YYYY"))/100)+"'s"},this.html=function(e,t,i,n){var a,o,r=moment(),s=100*Math.floor(Number(r.format("YYYY"))/100),l=10*Math.floor(Number(r.format("YYYY").substr(2))/10),d=100*Math.floor(Number(e.format("YYYY"))/100),c=0,u=0;n&&(c=100*Math.floor(Number(n.format("YYYY"))/100),u=10*Math.floor(Number(n.format("YYYY").substr(2))/10));for(var f="",g=0;g<10;g++)o="",s+l===d+(a=10*g)&&(o="ogx_calendar_layout_century_decades_current "),c+u===d+a&&(o+="ogx_calendar_selected_item "),f+='
'+t(d+a,i)+"
";return f},this.value=function(){return{value:100,unit:"years"}},this.format=function(){return"YYYY"}},OGX.CalendarLayout.CENTURY_YEARS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return''+100*Math.floor(Number(e.format("YYYY"))/100)+"'s"},this.html=function(e,t,i,n){var a,o=moment(),r=100*Math.floor(Number(o.format("YYYY"))/100),s=Number(o.format("YYYY").substr(2)),l=100*Math.floor(Number(e.format("YYYY"))/100),d=0,c=0;n&&(d=100*Math.floor(Number(n.format("YYYY"))/100),c=Math.floor(Number(n.format("YYYY").substr(2))));for(var u="",f=0;f<100;f++)a="",l+f===r+s&&(a+="ogx_calendar_layout_century_years_current "),l+f===d+c&&(a+="ogx_calendar_selected_item"),u+='
'+t(l+f+"-01-01",i)+"
";return u},this.value=function(){return{value:100,unit:"years"}},this.format=function(){return"Y"}},OGX.CalendarLayout.DECADE_YEARS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return''+10*Math.floor(Number(e.format("YYYY"))/10)+"'s"},this.html=function(e,t,i,n){var a,o=10*Math.floor(Number(e.format("YYYY"))/10),r="",s=Number(moment().format("YYYY")),l="";n&&(l=Number(n.format("YYYY")));for(var d=0;d<10;d++)a="",o+d===s&&(a+="ogx_calendar_layout_decade_years_current "),o+d===l&&(a+="ogx_calendar_selected_item "),r+='
'+t(o+d+"-01-01",i)+"
";return r},this.value=function(){return{value:10,unit:"years"}},this.format=function(){return"Y"}},OGX.CalendarLayout.DECADE_MONTHS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){for(var t=10*Math.floor(Number(e.format("YYYY"))/10),i=Number(String(t).substr(2,2)),n="",a=0;a<10;a++)n+='\''+i+"",i++;return n},this.html=function(e,t,i,n){var a,o,r,s,l=10*Math.floor(Number(e.format("YYYY"))/10),d="",c=moment().format("YYYY-MM");n&&(a=n.format("YYYY-MM"));for(var u=0;u<12;u++){s=u+1;for(var f=0;f<10;f++)o="",(r=l+f+"-"+(s<10?"0"+s:s))===c&&(o="ogx_calendar_layout_decade_months_current "),r===a&&(o+="ogx_calendar_selected_item "),moment(r+"-01"),d+='
'+t(r+"-01",i)+"
"}return d},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(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Months'},this.html=function(e,t,i,n){var a,o,r=moment().format("YYYY-MM"),s=e.format("YYYY"),l="",d="";n&&(d=n.format("YYYY-MM"));for(var c=1;c<13;c++)a="",s+"-"+(o=c<10?"0"+c:c)===r&&(a+="ogx_calendar_layout_year_months_current "),s+"-"+o===d&&(a+="ogx_calendar_selected_item "),l+='
'+t(s+"-"+o+"-01",i)+"
";return l},this.value=function(){return{value:1,unit:"years"}},this.format=function(){return"Y"}},OGX.CalendarLayout.YEAR_WEEKS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Weeks'},this.html=function(e,t,i,n){var a=moment().week(),o=e.format("YYYY"),r=moment().format("YYYY"),s="",l="";n&&(l=n.week(),s=n.format("YYYY"));for(var d,c,u="",f=1;f<53;f++)d="",a===f&&o===r&&(d="ogx_calendar_layout_year_weeks_current "),l===f&&o===s&&(d+="ogx_calendar_selected_item "),u+='
'+t(c,i)+"
";return u},this.value=function(){return{value:1,unit:"years"}},this.format=function(){return"Y"}},OGX.CalendarLayout.YEAR_DAYS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Nth Day'},this.html=function(e,t,i,n){var a,o,r,s="",l=e.format("YYYY-MM-DD"),d=moment(e.format("YYYY")+"-01-01"),c="";n&&(c=n.format("YYYY-MM-DD")),o=e.isLeapYear()?366:365;for(var u=0;u'+t(r,i)+"",d.add(1,"days");return s},this.value=function(){return{value:1,unit:"years"}},this.format=function(){return"Y"}},OGX.CalendarLayout.MONTH_WEEKS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Nth Week'},this.html=function(e,t,i,n){var a,o="",r=moment(),s=Number(r.format("YYYY")),l=Number(r.format("w")),d=Number(e.format("YYYY")),c=0,u=0;n&&(c=Number(n.format("YYYY")),u=Number(n.format("w")));o="";for(var f,g=moment(e.format("YYYY-MM-[01]")),h=0;h<5;h++)f="",a=Number(g.format("w")),d===c&&a===u&&(f+="ogx_calendar_selected_item "),d===s&&a===l&&(f+="ogx_calendar_layout_month_weeks_current"),o+='
'+t(g.format("YYYY-MM-DD"),i)+"
",g.add(7,"days");return o},this.value=function(){return{value:1,unit:"months"}},this.format=function(){return"[(]YYYY-MM[)] W"}},OGX.CalendarLayout.WEEK_DAYS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){for(var t="",i=function(){for(var e=new Date(Date.UTC(2017,0,2)),t=[],i=0;i<7;i++)t.push(e.toLocaleDateString(navigator.language,{weekday:"short"})),e.setDate(e.getDate()+1);return t}(),n=function(e){for(var t=e.clone(),i=t.day(),n=t.subtract(i,"day"),a=[],o=0;o<7;o++)a.push(n.format("DD")),n.add(1,"day");return a}(e),a=0;a'+i[a]+" "+n[a]+"";return t},this.html=function(e,t,i,n){var a,o,r="",s=e.weekday(),l=e.subtract(s,"days"),d=moment().format("YYYY-MM-DD"),c="";n&&(c=n.format("YYYY-MM-DD"));for(var u=0;u<7;u++)a="",(o=l.format("YYYY-MM-DD"))===d&&(a="ogx_calendar_layout_week_days_current "),o===c&&(a+="ogx_calendar_selected_item "),r+='
'+t(o,i)+"
",l.add(1,"days");return r},this.value=function(){return{value:1,unit:"weeks"}},this.format=function(){return"YYYY-MM (wo [week])"}},OGX.CalendarLayout.DAY_HOURS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Hours'},this.html=function(e,t,i,n){var a,o,r="",s=Number(moment().format("HH")),l=e.format("YYYY-MM-DD "),d=moment().format("YYYY-MM-DD "),c="",u="";n&&(c=Number(n.format("HH")),u=n.format("YYYY-MM-DD "));for(var f=0;f<24;f++)o="",f===s&&l===d&&(o="ogx_calendar_layout_days_hours_current "),f===c&&l===u&&(o+="ogx_calendar_selected_item "),r+='
'+t(l+a+":00",i)+"
";return r},this.value=function(){return{value:1,unit:"days"}},this.format=function(){return"YYYY-MM-DD HH:[00]"}},OGX.CalendarLayout.DAY_WORK_HOURS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Work Hours'},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 a,o,r="",s=Number(moment().format("HH")),l=e.format("YYYY-MM-DD "),d=moment().format("YYYY-MM-DD "),c="",u="";n&&(c=Number(n.format("HH")),u=n.format("YYYY-MM-DD "));for(var f=i.start;f'+t(l+a+":00",i)+"";return r},this.value=function(){return{value:1,unit:"days"}},this.format=function(){return"YYYY-MM-DD HH:[00]"}},OGX.CalendarLayout.DAY=function(e){"use strict";this.labels=function(e){return''+function(e){for(var t=new Date(Date.UTC(2017,0,2)),i=[],n=e.day(),a=0;a<7;a++)i.push(t.toLocaleDateString(navigator.language,{weekday:"long"})),t.setDate(t.getDate()+1);return i[n]}(e)+""},this.html=function(e,t,i,n){var a="",o=e.format("YYYY-MM-DD"),r=moment().format("YYYY-MM-DD");return n&&o===n.format("YYYY-MM-DD")&&(a+="ogx_calendar_selected_item "),o===r&&(a+="ogx_calendar_layout_day_current "),'
'+t(o,i)+"
"},this.value=function(){return{value:1,unit:"days"}},this.format=function(){return"YYYY-MM-DD"},this.select=function(e){}},OGX.CalendarEngine={},OGX.CalendarEngine.CELL_VALUE=function(e,t){var i=moment(e);return t.hasOwnProperty("css")||(t.css=""),'
'+i.format(t.format)+"
"},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'
'+moment(e).week()+"
"},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'
'+String(e).substr(2)+"'s
"},require("Carousel","Uxi","Placeholder","Touch"),OGX.Carousel=function(e){construct(this,"Carousel");var t,i,n,a,o,r,s=this,l=e,d={min_x:100,anim:!0,drag:!0,drag_left:!0,drag_right:!0,dots:!1,css:!1,index:0,capture:!1},c={position:"bottom"},u=!1,f=0,g=0,h=new OGX.List,p="ogx_carousel";function _(e){if(void 0!==e&&h[e]&&h[e].instance){var t=s.find(h[e].instance._NAME_,h[e].instance.id);t&&t.blur(2)}}function m(e){if(void 0!==e&&h[e]&&h[e].instance){var t=s.find(h[e].instance._NAME_,h[e].instance.id);t&&t.focus(1)}}function v(e){i.off("transitionend"),i.removeClass(p+"_anim")}function y(e){if(e.dirX){if(-1===e.dirX&&!l.drag_right)return;if(1===e.dirX&&!l.drag_left)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 x(e){if(e.distX>l.min_x){var i=r+-1*e.dirX;i>=0&&i'),e.push("."+p+'[data-ogx-id="'+s.id+'"] > .'+p+"_views > ."+p+'_view[data-ogx-panel-id="'+f+'"]'),f++;i.css("width",100*g+"%"),s.placeholders(l,e),t.trigger(OGX.Carousel.READY)}this.construct=function(){G(),l.index&&this.showPanel(l.index,!1)},this.enable=function(){return l.drag&&this.touch.swipe.enable(),debug(5,"carousel",l.id,"enabled"),setTimeout((function(){for(var e=0;e0&&this.showPanel(r-1),this},this.next=function(){return r+1'+e+""),i.css("width",Math.round(100*g)+"%"),i.children("."+p+"_view").css("width",100/g+"%"),++f-1}(),l="."+p+'[data-ogx-id="'+this.id+'"] > .'+p+"_views > ."+p+'_view[data-ogx-panel-id="'+r+'"]',d={},c=l;if(e.hasOwnProperty("_NAME_"));else{for(var u in e){c+=":"+u.split(":")[1],d[c]=e[u];break}var h=null;setTimeout((function(){s.observe(!0,{childList:!0,subtree:!0},(function(){s.observe(!1),h&&clearTimeout(h),h=setTimeout(G,20),a&&s.showPanel(g-1,o)})),OGX.OML.render(s,d,n)}),0)}return t.trigger(OGX.Carousel.ADDED,g),this},this.removeNode=function(e){for(var t=0;t=0&&ee?i.children("."+p+"_view:eq("+(n-1)+")").after(a):i.children("."+p+"_view:eq("+n+")").before(a);var o=100/g*(-1*n);return i.removeClass(p+"_anim"),i.css({transform:"translate3d("+o+"%, 0, 0)"}),r=n,setTimeout(G,0),t.trigger(OGX.Carousel.CHANGE,r),this},this.removePanel=function(e,n){if(void 0===n&&(n=!0),e>=0&&e=r?e--:e=r,e<0&&(e=0),s.showPanel(e,!1,!0),t.trigger(OGX.Carousel.REMOVED,g),a}return!1},this.empty=function(){return this.clear(),i.empty(),i.removeClass(p+"_anim").css("width","100%"),i.css({transform:"translate3d(0%, 0, 0)"}),g=0,h=new OGX.List,l.index=0,l["node:OML"]=[],this},this.render=function(e,t){return l["node:OML"]=e,g=l["node:OML"].length,X(),OGX.OML.render(this,l["node:OML"],t),this},function(){if(void 0===OGX.Data)return debug(1,"OGX.Data not found!"),!1;OGX.Data.merge(l,d,!1),l.dots&&("boolean"==typeof l.dots&&(l.dots={}),OGX.Data.merge(l.dots,c)),r=l.index,t=s.el,n=Math.floor(t.innerWidth()),l.hasOwnProperty("node:OML")&&(g=l["node:OML"].length),function(){t.addClass(p);var e="";l.dots&&"top"===l.dots.position&&(e+=''),e+='
',l.dots&&"bottom"===l.dots.position&&(e+=''),t.append(e),(i=t.find("."+p+"_views").first()).css({transform:"translate3d("+100/g*(-1*r)+"%, 0, 0)"})}(),l.dots&&(o=s.create("Dots",{el:"."+p+'[data-ogx-id="'+s.id+'"] > .carousel_dots',total:g})).bind("dots",s),X(),s.touch.swipe=s.touch.add("Swipe",{x:!0,cb_down:v,cb_swipe:y,cb_up:x,capture:l.capture,state:"manual"}),l.drag||s.drag(!1),debug(5,"carousel",l.id,"init")}()},OGX.Carousel.READY="CarouselReady",OGX.Carousel.DRAG="CarouselDrag",OGX.Carousel.CHANGE="CarouselChange",OGX.Carousel.RESTORE="CarouselRestore",OGX.Carousel.ADDED="CarouselAdded",OGX.Carousel.REMOVED="CarouselRemoved",void 0===OGX)var OGX={};if(require("Chat","Uxi","Touch"),OGX.Chat=function(__config){construct(this,"Chat");var that=this,config=__config,config_default={placeholder:"Type a message",dot_speed:600,on_keyb_update_delay:300,messages:[],handle_keyboard:!0,hide_keyboard_on_send:!1,emojis:!1,template_left:'
{{$letter}}{{$body}}{{$date}}
',template_right:'
{{$body}}{{$date}}
',key:"_id",from_key:"from",users:[],user:!1,display_mode:OGX.Chat.DISPLAY_INITIALS,picture_key:"",restrict:{multiline:!1,length:500,allowed:/./},date_format:"YYYY-MM-DD h:mm:ss A",url_encode:!0},emojis_default={template:'{{$emoji}}',button:!1,list:[],map:{emoji:"char",search:"name"}},container,inner,scroller,composer,emojis,emoji_list,intv,oldh=!1,typing={},type=".",enabled=!1;function render(){if(config.messages.length>0){for(var e=0;e.';inner.append(t),animTyping(!0)}function removeTyping(e){typing[e]=!1,inner.find('.ogx_chat_typing[data-user="'+e+'"]').remove(),0===inner.find(".ogx_chat_typing").length&&animTyping(!1)}function animTyping(e){e?intv||(intv=setInterval(typeDot,config.dot_speed)):(clearInterval(intv),intv=null)}function typeDot(){(type+=".").length>3&&(type="."),inner.find(".ogx_chat_typing_body").html(type)}function getTemplate(e){return e[config.from_key]===config.user?config.template_right:config.template_left}function sendMessage(){var e=composer.find("textarea").val();if(e.length&&(e=(e=(e=e.replace(/^[\r|\n\r]+/,"")).replace(/<\/?[^>]+(>|$)/g,"")).replace(/’/,"'")).length){var t={body:e=e.replace(/[\r\n]/g,"
"),date:moment().format(config.date_format)};t[config.from_key]=config.user,addMessage(t);var i=OGX.Data.clone(t);config.url_encode&&(i.body=encodeURIComponent(i.body)),delete i.bg,delete i.letter,composer.find("textarea").val(""),that.el.trigger(OGX.Chat.SEND_MESSAGE,i)}}function handleShowKeyb(e){oldh||(oldh=container.height()),container.height(oldh-e.keyboardHeight),updateScroller()}function handleHideKeyb(){container.height(oldh),updateScroller()}function updateScroller(){setTimeout((function(){scroller.resize(),scroller.bottom()}),config.on_keyb_update_delay)}function renderEmojis(){var e,t=[];config.emojis.list=config.emojis.list.slice(0,250);for(var i=0;i',e+="
",config.emojis&&(e+=''),e+='',container.append(e),composer=container.find(".ogx_chat_composer"),config.emojis&&(emojis=container.find(".ogx_chat_emojis"),setTimeout(renderEmojis,10))}function initUsers(){for(var e in config.users)typing[e]=!1}function initDefaults(){config.hasOwnProperty("emojis")&&config.emojis&&(OGX.Data.merge(config.emojis,emojis_default,!1),config.emojis.list=new OGX.List(config.emojis.list)),OGX.Data.merge(config,config_default,!1),config.users.hasOwnProperty("find")||(config.users=new OGX.List(config.users)),(container=that.el).addClass("ogx_chat")}function init(){if(void 0!==OGX.Scroller)if(void 0!==OGX.Templater)if("undefined"!=typeof moment)if(config.restrict&&void 0===OGX.Form)debug(1,"OGX.Form not found! ");else{if(initDefaults(),initMarkup(),initUsers(),initScroller(),config.restrict){var e=OGX.Data.clone(config.restrict);config.restrict.hasOwnProperty("forbidden")&&(e.forbidden=config.restrict.forbidden),config.restrict.hasOwnProperty("allowed")&&(e.allowed=config.restrict.allowed),e.el=that.el.find(".ogx_chat_composer .ogx_chat_composer_input textarea")[0],OGX.Form.restrictField(e)}that.enable(),debug(5,"chat",config.id,"init")}else debug(1,"moment.js not found! ");else debug(1,"OGX.Templater not found! ");else debug(1,"OGX.Scroller not found! ")}this.enable=function(){return enabled||(enabled=!0,debug(5,"chat",config.id,"enabled"),config.handle_keyboard&&listenKeyb(!0),listenComposer(!0),listenArea(!0)),this},this.disable=function(){return this.el.find(".ogx_chat_composer .ogx_chat_composer_input textarea").trigger("blur"),enabled&&(enabled=!1,debug(5,"chat",config.id,"disabled"),config.handle_keyboard&&listenKeyb(!1),listenComposer(!1),listenArea(!1)),this},this.users=function(e){return void 0!==e?(e.hasOwnProperty("find")||(e=new OGX.List(e)),config.users=e,!0):config.users},this.user=function(e){return void 0===e?config.user:(config.user=e,this)},this.typing=function(e,t){return e&&!typing[t]?addTyping(t):!e&&typing[t]&&removeTyping(t),this},this.compose=function(e){return composer.find("textarea").val(e),this},this.wipe=function(){return inner.empty(),this},this.clear=function(){return debug(2,"Chat clear is deprecated, use wipe"),this.wipe()},this.getScroller=function(){return scroller},this.addMessage=function(e){return addMessage(e),this},this.setMessages=function(e){return config.messages=e,render(),this},this.prependMessages=function(e){for(var t=this.el.find(".ogx_scroller_outer").first(),i=inner.height(),n=t.scrollTop(),a=0;a1&&(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]),a=Number(s[1]),o=Number(s[2])),"#"+((1<<24)+(n<<16)+(a<<8)+o).toString(16).slice(1)},OGX.Color.rgbToHsl=function(e,t,i){"use strict";var n,a,o;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],a=s[1],o=s[2],n/=255,a/=255,o/=255;var l,d,c=Math.max(n,a,o),u=Math.min(n,a,o),f=(c+u)/2;if(c===u)l=d=0;else{var g=c-u;switch(d=f>.5?g/(2-c-u):g/(c+u),c){case n:l=(a-o)/g+(a1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e},d=i<.5?i*(1+t):i+t-i*t,c=2*i-d;o=l(c,d,e+1/3),r=l(c,d,e),s=l(c,d,e-1/3)}return[Math.round(255*o),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,a="normal",o=0;function r(e){e?(t.tabs.el.on(OGX.Tabs.SELECT,(function(e,i){var n=t.tabs.index();t.carousel.val(n),t.el.trigger(OGX.Container.CHANGE,n)})),t.tabs.el.on(OGX.Tabs.CLOSE,(function(){})),t.tabs.el.on(OGX.Tabs.REORDER,(function(e,i){t.carousel.swapPanels(i.from,i.to)})),t.tabs.el.on(OGX.Tabs.ADD,(function(){})),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.CLOSE),t.tabs.el.off(OGX.Tabs.REORDER),t.tabs.el.off(OGX.Tabs.ADD),t.carousel.el.off(OGX.Carousel.CHANGE)),s(e)}function s(e){e?t.tabs.el.on(OGX.Tabs.REMOVE,(function(e,i){s(!1);var n=t.el.parents(".ogx_popup").first().data("ogx-id");n=app.cfind("Popup",n),app.ungroupPopup(n,i.index,i.label),setTimeout((function(){s(!0)}),200)})):t.tabs.el.off(OGX.Tabs.REMOVE)}this.carousel=null,this.tabs=null,this.construct=function(){this.carousel=this.find("Carousel",this.id+"_carousel")},this.show=function(e,t){if(this.carousel&&"normal"===a){var i=this.carousel.getNodeIndex(e,t);i&&(this.carousel.val(i.index),n.tabs&&this.tabs.index(i.index))}},this.index=function(e){return this.carousel&&"normal"===a&&(this.carousel.val(e),n.tabs&&this.tabs.index(e)),this},this.showIndex=function(e){return debug(1,"Container.showIndex has been deprecated, use Container.index"),this.index(e),this},this.enable=function(){return n.tabs&&this.carousel&&r(!0),debug(5,"container",n.id,"enabled"),this},this.disable=function(){return n.tabs&&this.carousel&&r(!1),debug(5,"container",n.id,"disabled"),this},this.resize=function(){var e,t,i;return n.flatten&&(this.carousel&&"flattened"!==a&&this.el.width()>=n.flatten?(a="flattened",n.tabs&&(this.tabs.blur(),this.tabs.hide()),this.carousel.blur(),o=(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"===a&&this.el.width()';t.html(i)}this.enable=function(){n.clickable&&d(!0),debug(5,"dots",n.id,"enabled")},this.disable=function(){n.clickable&&d(!1),debug(5,"dots",n.id,"disabled")},this.bind=function(e,t){return!(o.hasOwnProperty(e)||!t.hasOwnProperty("_NAME_"))&&function(e,t){switch(o[e]=t,t._NAME_){case"Carousel":n.total=t.panels().length,n.current=t.val(),t.el.on(OGX.Carousel.CHANGE,s),t.el.on(OGX.Carousel.ADDED+" "+OGX.Carousel.REMOVED,l);break;case"Iceberg":n.total=t.panels().length,n.current=t.val(),t.el.on(OGX.Iceberg.SHOW,s)}return!0}(e,t)},this.unbind=function(e){return!!o.hasOwnProperty(e)&&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.destroy=function(){!function(){for(var e in o)r(e)}()},OGX.Data.merge(n,a),(t=i.el).addClass("ogx_dots"),c(),debug(5,"dots",n.id,"init")},OGX.Dots.SELECT="DotsSelect",void 0===OGX)var OGX={};if(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,reorder:!1,swipe:!1,reselect:!1,chromeos:!1,min_x:30,hold_time:1e3,interval:5,list:[],selection:[],no_selection:{enabled:!1,prop:"",val:0},mode:OGX.DynamicList.SELECT_MODE_SINGLE,trigger:!1,scope:!0,swipe_template:'
{{$template}}
',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;function isSelectable(__item){return!config.no_selection.enabled||eval("__item."+config.no_selection.prop+" === config.no_selection.val")}function replace(e,t,i){if(display.hasOML()){var n,a,o=toDataId(i[t]),r=display.oml('.ogx_dynamic_list[data-ogx-id="'+that.id+'"] > .ogx_dynamic_list_item[data-ogx-id='+o+"]",i,config.as);$('.ogx_dynamic_list[data-ogx-id="'+that.id+'"] > .ogx_dynamic_list_item[data-ogx-id='+o+"]").find(".ogx_uxi").each((function(e,t){n=$(t).data("ogx-id"),(a=that.cfind(!1,n,1))&&that.find(a._NAME_,a.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)));for(var i,n,a,o="",r=[],s=0;s0?(key=key_default,forceIds()):key=config.key,config.swipe&&("object"!=typeof config.swipe&&(config.swipe={}),OGX.Data.merge(config.swipe,swipe_default)),(container=that.el).addClass("ogx_dynamic_list")}function init(){void 0!==OGX.Templater?void 0!==OGX.List?void 0!==OGX.Display?(checkMissing(),initDefaults(),finalize(),config.scroll&&(scroller=that.find("Scroller",config.id+"_scroller")),debug(5,"dyanmiclist",config.id,"init")):debug(1,"OGX.Display not found! "):debug(1,"OGX.List not found! "):debug(1,"OGX.Templater not found! ")}this.enable=function(e){return debug(5,"dynamicList",this.id,"enabled"),void 0===e&&(e=!1),(e||config.mode!==OGX.DynamicList.STATIC)&&(listenItems(!0),(config.reorder||config.swipe)&&(listenTouch(!0),config.swipe&&listenTrans(!0))),this},this.disable=function(e){return debug(5,"dynamicList",this.id,"disabled"),void 0===e&&(e=!1),(e||config.mode!==OGX.DynamicList.STATIC)&&(listenItems(!1),(config.reorder||config.swipe)&&(listenTouch(!1),config.swipe&&listenTrans(!1))),this},this.bindFilter=function(e,t,i){debug(4,"dynamicList",this.id,"filter",e,JSON.stringify(i)),void 0!==i&&(config.list.removeFilter(e),config.list.addFilter(e,t,i)),config.list.getFilters()&&(filtered=config.list.filter(),isFiltered=!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(){return this.getSelection()},this.destroy=function(){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 a;debug(4,"dynamicList",this.id,"set",e.length,"items"),void 0===t&&(t=!1),void 0===i&&(i=!0),e.hasOwnProperty("insert")||(e=new OGX.List(e)),this.resetSelection(),t||(a=config.list.getFilters()),config.list=e,config.key||(key_id=1,key=key_default,e=JSON.parse(JSON.stringify(e)),forceIds()),!t&&Object.keys(a).length?(config.list.setFilters(a),setTimeout(this.filter,0)):i?setTimeout(render,0):render()},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:config.display.val(e)},this.mode=function(e){return void 0===e?config.mode:(config.mode!==e&&(config.mode===OGX.DynamicList.STATIC?this.enable(!0):e===OGX.DynamicList.STATIC&&this.disable(!0),config.mode=e),this)},this.noSelection=function(e,t){return 1===arguments.length?"object"==typeof e?void(config.no_selection=e):void(config.no_selection.enabled=e):2===arguments.length?(config.no_selection.enabled=!0,config.no_selection.prop=e,void(config.no_selection.val=t)):config.no_selection},this.order=function(e,t){return config.list.order(e,t),setTimeout(render,0),this},this.filter=function(){return debug(4,"dynamicList",config.id,"filtering with",Object.keys(config.list.getFilters()).length,"filters"),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){if(!Array.isArray(e)){config.key||(e[key]=key_id++);var i=!1,n=!0;if(isFiltered){var a=new OGX.List(e);a.setFilters(config.list.getFilters()),0===a.filter().length?n=!1:filtered.push(e)}var o=toDataId(e[key]),r='
]/,pattern:!1,validate:!1,mask:!1,mask_char:"%",paste:!0,autocomplete:null,multiline:!1,input_cb:!1,change_cb:!1,diff:!0,val:null,last_change:!1,wait:2e3,intv:!1,max:2500,type:"string",params:null},n=new OGX.List,a=new OGX.List,o=!1;function r(t,i){if(!o){var a,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 d=c(r.form);for(var u in d)r.config.fields.hasOwnProperty(u)&&r.config.fields[u].hasOwnProperty("type")?d[u]=l(r.config.fields[u].type,d[u]):r.config.hasOwnProperty("type")&&(d[u]=l(r.config.type,d[u]));if(a=JSON.stringify(d),!r.diff||r.val!==a){var f;if(r.val=a,r.config.validate){f={obj:d,form:i,valid:!1};var g=e.validate(r.form);!0===g?f.valid=!0:(f.valid=!1,f.error=g)}else f=d;r.config.params&&(f.params=r.config.params),r.buffer&&clearTimeout(r.buffer),r.buffer=setTimeout((function(){r.config.change_cb(f)}),10)}}}}function s(t){var i={el:t.el,config:t,field:$(t.el),intv:!1};i.name=i.field.attr("name"),i.val=i.field.val(),i.field.val(i.val),t.pattern&&i.field.attr("pattern",t.pattern),n.insert(i),$(document).on("input change",i.el,(function(e){if(!o){var t=$(this).val();if(!i.config.diff||i.config.diff&&t!==i.val){if(i.config.input_cb){var n={value:null,obj:{},el:null};t=l(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(){!function(e){var t=$(e.el).val();if(e.val=t,e.config.change_cb){var i={value:null,obj:{},el:null};t=l(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(!o){if(i.config.mask&&8===e.which||46===e.which){var n=t[0].selectionStart,a=t.val();return a=8===e.which?a.substr(0,n-1):a.substr(0,n),t.val(a),!1}if(8!==e.which&&13!==e.which&&1===e.key.length){var r=e.key;if(13!==e.which&&i.config.mask){if((a=t.val()).length>=i.config.mask.length)return e.preventDefault(),e.stopImmediatePropagation(),!1;for(var s=i.config.mask,d=0;d=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})),a.insert(t)}(e),!0)},this.unrestrictField=function(e){if(!a.find("el",e,1))return!1;var t=a.find("el",e,1);return!!t&&($(document).off("textInput keydown",t.el),$(document).off("paste",t.el),a.findDelete("el",e,1),!0)},this.toObj=function(e){return c(e)},this.populate=function(e,t,i){var n,a,o;void 0===i&&(i=null),$(e).find("*[name]").each((function(e,r){n=r.getAttribute("name"),o=!1,"string"!=typeof(o=OGX.Data.eval(t,n))&&(o=JSON.stringify(o)),void 0!==o&&(i&&i.hasOwnProperty(n)&&"function"==typeof i[n]&&(o=i[n](o)),(a=$(r)).val(o),r.hasAttribute("type")&&"hidden"===a.attr("type")&&a.trigger("change"))})),setTimeout(d,0)},this.validate=function(e){var i,n=$(e),a=t.elem_types,o=[];return n.find(a.join(",")).each((function(e,t){"submit"!==(i=$(t)).attr("type")&&(t.checkValidity()||o.push(i))})),!o.length||o}},OGX.Form=new OGX.Form,void 0===OGX)var OGX={};if(OGX.Geo=function(e){"use strict";var t=this;void 0===e&&(e={});var i,n,a,o={map:null,markers:[],icon:"",browser_loc:null},r=e;function s(e,i){for(var n,a={},o=0;o1&&(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?(i=new google.maps.Geocoder,function(){for(var e in o)r.hasOwnProperty(e)||(r[e]=o[e])}(),r.map&&r.markers.length):$(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",void 0===OGX)var OGX={};if(require("Ghost","Uxi"),OGX.Ghost=function(e){construct(this,"Ghost"),this.el=$(e.el),css="ogx_ghost",this.el.addClass(css),delete css},void 0===OGX)var OGX={};if(require("GridSwiper","Uxi","Touch"),OGX.GridSwiper=function(e){construct(this,"GridSwiper");var t,i,n,a,o,r,s,l,d,c,u,f,g=this,h=e,p={map:[[!0,!0,!0],[!0,!0,!0],[!0,!0,!0]],axis:{x:!0,y:!0},loop:!0,start:!1,chromeos:!1,capture:!1},_=!1,m={x:null,y:null},v={x:0,y:0},y=".ogx_grid_swiper_cell",x=!1,O=!1,b={x:0,y:0},w={x:0,y:0},G=(new Date).getTime()+Math.round(1e3*Math.random()),X=[];function T(e){e?t.on(g.touch.down,E):t.off(g.touch.down,E)}function E(e){_=!1,o=0,r=0,s=0,l=0,e=Y(e),m.x=e.pageX,m.y=e.pageY,x=!0,L(!0)}function D(e){e?$("body").on(g.touch.up,C):$("body").off(g.touch.up,C)}function C(e){x&&(x=!1,L(!1),S())}function S(e,t,o){var r,s;void 0===e&&(e=0),void 0===t&&(t=0),void 0===o&&(o=!0),o&&I(!0),i.addClass("ogx_grid_swiper_anim"),v=A(i),r=-1*Math.round((v.x+e)/n)*n*-1,s=-1*Math.round((v.y+t)/a)*a*-1,i.css({transform:"translate3d("+r+"px, "+s+"px, 0px)"})}function L(e){e?(M(!0),t.on(g.touch.move,k)):(M(!1),t.off(g.touch.move,k))}function k(e){e=Y(e),h.capture&&(e.preventDefault(),e.stopImmediatePropagation()),o=0,r=0,s=0,l=0,_||(h.axis.x&&Math.abs(e.pageX-m.x)>Math.abs(e.pageY-m.y)?_="x":h.axis.y&&Math.abs(e.pageX-m.x)0?1:-1):h.axis.y&&"y"===_&&(r=Math.abs(e.pageY-m.y),l=e.pageY-m.y>0?1:-1))}function M(e){e?f||(O=!1,f=setInterval(N,10)):f&&(clearInterval(f),f=null)}function N(){if((o||r)&&(O||t.trigger(OGX.GridSwiper.SWIPE_START),O=!0),h.axis.x&&"x"===_&&o&&s&&o<=n){if(!h.loop&&(b.x+-1*s<0||b.x+-1*s>h.map[0].length-1))return;if((d=(b.x+-1*s)%h.map[0].length)<0&&(d=Math.abs(h.map[0].length+d)),!1===h.map[w.y][d])return;u=o*s,i.css({transform:"translate3d("+(-1*b.x*n+u)+"px, "+v.y+"px, 0px)"})}else if(h.axis.y&&"y"===_&&r&&l&&r<=a){if(!h.loop&&(b.y+-1*l<0||b.y+-1*l>h.map.length-1))return;if((c=(b.y+-1*l)%h.map.length)<0&&(c=Math.abs(h.map.length+c)),!1===h.map[c][w.x])return;u=r*l,i.css({transform:"translate3d("+v.x+"px, "+(-1*b.y*a+u)+"px, 0px)"})}}function I(e){e?(i.off("transitionend"),i.on("transitionend",(function(){O&&(t.trigger(OGX.GridSwiper.SWIPE_END),O=!1),i.off("transitionend"),i.removeClass("ogx_grid_swiper_anim"),v=A(i);var e={x:null,y:null};e.x=-1*Math.round(v.x/n),e.y=-1*Math.round(v.y/a),b.x!==e.x?(s=b.x>e.x?1:-1,b.x=e.x,w.x=P(b).x,-1===s?(i.children(y+"[data-y="+(b.y-1)+"]").attr("data-x",b.x).css("left",b.x*n),i.children(y+"[data-y="+(b.y+1)+"]").attr("data-x",b.x).css("left",b.x*n),i.children(y+"[data-x="+(b.x-2)+"][data-y="+b.y+"]").attr("data-x",b.x+1).css("left",(b.x+1)*n),t.trigger(OGX.GridSwiper.SWIPE_LEFT,{cell:w,point:b}),R(X=[{x:b.x+1,y:b.y},{x:b.x,y:b.y-1},{x:b.x,y:b.y+1}]),W()):(i.children(y+"[data-y="+(b.y-1)+"]").attr("data-x",b.x).css("left",b.x*n),i.children(y+"[data-y="+(b.y+1)+"]").attr("data-x",b.x).css("left",b.x*n),i.children(y+"[data-x="+(b.x+2)+"][data-y="+b.y+"]").attr("data-x",b.x-1).css("left",(b.x-1)*n),t.trigger(OGX.GridSwiper.SWIPE_RIGHT,{cell:w,point:b}),R(X=[{x:b.x-1,y:b.y},{x:b.x,y:b.y-1},{x:b.x,y:b.y+1}]),W())):b.y!==e.y&&(l=b.y>e.y?1:-1,b.y=e.y,w.y=P(b).y,-1===l?(i.children(y+"[data-x="+(b.x-1)+"]").attr("data-y",b.y).css("top",b.y*a),i.children(y+"[data-x="+(b.x+1)+"]").attr("data-y",b.y).css("top",b.y*a),i.children(y+"[data-y="+(b.y-2)+"][data-x="+b.x+"]").attr("data-y",b.y+1).css("top",(b.y+1)*a),t.trigger(OGX.GridSwiper.SWIPE_UP,{cell:w,point:b}),R(X=[{x:b.x,y:b.y+1},{x:b.x-1,y:b.y},{x:b.x+1,y:b.y}]),W()):(i.children(y+"[data-x="+(b.x-1)+"]").attr("data-y",b.y).css("top",b.y*a),i.children(y+"[data-x="+(b.x+1)+"]").attr("data-y",b.y).css("top",b.y*a),i.children(y+"[data-y="+(b.y+2)+"][data-x="+b.x+"]").attr("data-y",b.y-1).css("top",(b.y-1)*a),t.trigger(OGX.GridSwiper.SWIPE_DOWN,{cell:w,point:b}),R(X=[{x:b.x,y:b.y-1},{x:b.x-1,y:b.y},{x:b.x+1,y:b.y}]),W())),_=0}))):i.off("transitionend")}function A(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%h.map[0].length,t.x<0&&(t.x=Math.abs(h.map[0].length+t.x)),t.y=e.y%h.map.length,t.y<0&&(t.y=Math.abs(h.map.length+t.y)),t}function R(e){for(var t,i={x:null,y:null},n=0;nh.map.length-1){if(!h.loop)return!1;i.y=P(e[n]).y}else i.y=e[n].y;if(e[n].x<0||e[n].x>h.map[0].length-1){if(!h.loop)return!1;i.x=P(e[n]).x}else i.x=e[n].x;t=h.map[i.y][i.x],H(e[n],t)}}function H(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-b.x,y:e.y-b.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 a='.ogx_grid_swiper[data-ogx-id="'+G+'"] > .ogx_grid_swiper_container > '+y+'[data-x="'+e.x+'"][data-y="'+e.y+'"] > '+y+"_content",o=P(e);for(var r in t){t[r].id="cell_"+o.x+"_"+o.y;break}t=OGX.OML.rename(t,a);var s=g.nodes.find("id","cell_"+o.x+"_"+o.y,1);s&&g.remove(s._NAME_,s.id),$(a).empty(),OGX.OML.render(g,t,{abs:e,rel:P(e)}),W()}}function W(){for(var e=0;e',d=-1*e,c=-1*o-a;h.axis.y&&(l+='
',l+='
'),l+='
',h.axis.x&&(l+='
',l+='
'),l+="
",t.html(l),i=t.children(".ogx_grid_swiper_container").first(),b.x=h.start.x,b.y=h.start.y,v.x=e,v.y=o,w.x=h.start.x,w.y=h.start.y}this.enable=function(){return debug(5,"gridwwiper",h.id,"enabled"),T(!0),D(!0),W(),this},this.disable=function(){return debug(5,"gridwwiper",h.id,"disabled"),T(!1),D(!1),M(!1),this},this.focus=function(){return this.blured&&(this.blured=!1,this.enabled&&(this.ux(!0),this.enable())),this},this.resize=function(){I(!1),i.removeClass("ogx_grid_swiper_anim"),n=t.width(),a=t.height();var e=b.x*-n,o=b.y*-a;i.children(y+"[data-y="+(b.y-1)+"]").css({top:(b.y-1)*a,left:b.x*n}),i.children(y+"[data-y="+b.y+"]").css({top:b.y*a,left:b.x*n}),i.children(y+"[data-y="+(b.y+1)+"]").css({top:(b.y+1)*a,left:b.x*n}),i.children(y+"[data-x="+(b.x-1)+"]").css({top:b.y*a,left:(b.x-1)*n}),i.children(y+"[data-x="+(b.x+1)+"]").css({top:b.y*a,left:(b.x+1)*n}),i.css("transform","translate3d("+e+"px, "+o+"px, 0px"),L(!1),setTimeout((function(){S(0,0,!1),i.addClass("ogx_grid_swiper_anim")}),0)},this.setMap=function(e,t){return h.map=e,void 0!==t&&(h.start=t),b={x:0,y:0},w={x:0,y:0},m={x:null,y:null},v={x:0,y:0},z(),U(),j(),this},this.setMapCell=function(e,t){return h.map[e.y]||(h.map[e.y]=[]),h.map[e.y][e.x]=t,this},this.getMapCell=function(e){return e.y>0&&h.map.length0&&h.map[e.y].length0){var i=e.data("id");e.html(OGX.Templater.make(s.template,s.list[i]))}return this},"undefined"!=typeof moment?void 0!==OGX.List?void 0!==OGX.Templater?void 0!==OGX.NestList?(OGX.Data.merge(s,l),s.list.hasOwnProperty("insert")||(s.list=new OGX.List(s.list)),s.group_order&&!s.group_order.hasOwnProperty("insert")&&(s.group_order=new OGX.List(s.group_order)),s.display&&s.display.hasOwnProperty("css")&&("object"!=typeof s.display.css&&s.display.css?s.display.css+=" ogx_grouped_list_item":s.display.hasOwnProperty("add")?s.display.add="ogx_grouped_list_item "+s.display.add:s.display.add="ogx_grouped_list_item"),o=!1,(t=r.el).addClass("ogx_grouped_list"),h(),debug(5,"groupedlist",s.id,"init")):debug(1,"OGX.NestList not found! "):debug(1,"OGX.Templater not found! "):debug(1,"OGX.List not found! "):debug(1,"moment.js not found! ")},OGX.GroupedList.SELECT="GroupedListSelect",OGX.GroupedList.BIND=OGX.GroupedList.SELECT,void 0===OGX)var OGX={};if(require("Html","Uxi","Placeholder"),OGX.Html=function(e){construct(this,"Html"),this.rendered=!1,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))},void 0===OGX)var OGX={};if(require("Iceberg","Uxi","Touch"),OGX.Iceberg=function(e){construct(this,"Iceberg");var t,i,n,a,o=this,r={left:0,right:0,top:0,bottom:0,min:50,drag:!0,flatten:!1,"node:OML":{}},s=e,l=!1,d="normal",c="main",u={left:null,main:null,right:null,top:null,bottom:null},f=[0,0,0],g=0,h=0,p=0,_=0;function m(e){for(var t in u)u[t]&&u[t].instance&&(e===t?u[t].instance.focus():u[t].instance.blur())}function v(){l.hasClass("ogx_iceberg_anim")||(l.off("transitionend"),f=b(l))}function y(e){var t=0;return e.dirY&&e.distY>e.distX&&(t=1),t}function x(e){s.drag&&e.dist&&(!(n=y(e))&&["main","left","right"].includes(c)?e.dirX&&e.distX&&(t=f[0]+e.distX*e.dirX)<=h&&t>=g&&l.css({transform:"translate3d("+t+"px, 0, 0)"}):["main","top","bottom"].includes(c)&&e.dirY&&e.distY&&(i=f[1]+e.distY*e.dirY)<=_&&i>=p&&l.css({transform:"translate3d(0, "+i+"px, 0)"}))}function O(e){if(t=0,i=0,n=y(e),e.swipe&&e.dist){var o;switch(e.swipe=!1,c){case"main":-1===e.dirX&&s.right&&!n?(t=-u.right.outerWidth(),o="right",e.swipe=!0):1===e.dirX&&s.left&&!n?(t=u.left.outerWidth(),o="left",e.swipe=!0):1===e.dirY&&s.top&&n?(i=u.top.outerHeight(),o="top",e.swipe=!0):-1===e.dirY&&s.bottom&&n&&(i=-u.bottom.outerHeight(),o="bottom",e.swipe=!0);break;case"left":-1!==e.dirX||n||(t=0,o="main",e.swipe=!0);break;case"right":1!==e.dirX||n||(t=0,o="main",e.swipe=!0);break;case"top":-1===e.dirY&&n&&(i=0,o="main",e.swipe=!0);break;case"bottom":1===e.dirY&&n&&(i=0,o="main",e.swipe=!0)}a=n?1===e.dirY?OGX.Iceberg.SWIPE_DOWN:OGX.Iceberg.SWIPE_UP:1===e.dirX?OGX.Iceberg.SWIPE_RIGHT:OGX.Iceberg.SWIPE_LEFT,e.swipe&&e.dist&&(l.addClass("ogx_iceberg_anim"),l.on("transitionend",(function(){l.off("transitionend"),l.removeClass("ogx_iceberg_anim"),f=b(l),m(c=o),l.trigger(a,c)})),l.css({transform:"translate3d("+t+"px, "+i+"px, 0)"}))}else if(e.dist){switch(t=0,i=0,c){case"left":t=u.left.outerWidth();break;case"right":t=-u.right.outerWidth();break;case"top":i=u.top.outerHeight();break;case"bottom":i=-u.bottom.outerHeight()}l.addClass("ogx_iceberg_anim"),l.on("transitionend",(function(){l.off("transitionend"),l.removeClass("ogx_iceberg_anim"),f=b(l),l.trigger(OGX.Iceberg.RESTORE,c)})),l.css({transform:"translate3d("+t+"px, "+i+"px, 0)"})}}function b(e){var t=e[0].style.transform;if(t=t.match(/translate3d\(([0-9px%,\.\- ]+)\)/)){t=t[1].split(",");for(var i=0;i=s.flatten?(d="flattened",f=b(l),l.addClass("ogx_iceberg_views_flattened").css("transform","translate3d(0px, 0px, 0px)"),l.children(".ogx_iceberg_view").addClass("ogx_iceberg_view_flattened"),this.disable()):"flattened"===d&&this.el.width() .ogx_iceberg_views > .ogx_iceberg_view[data-ogx-panel-id="';for(var r in s["node:OML"])for(var d in s["node:OML"][r])0===d.indexOf("left")&&(i+='
',n.left=a+'left"]',u.left=!0),0===d.indexOf("top")&&(i+='
',n.top=a+'top"]',u.top=!0),0===d.indexOf("main")&&(i+='
',n.main=a+'main"]'),0===d.indexOf("right")&&(i+='
',n.right=a+'right"]',u.right=!0),0===d.indexOf("bottom")&&(i+='
',n.bottom=a+'bottom"]',u.bottom=!0);for(o.el.html(i),r=0;rt.width/t.height?(i.width=t.width,i.height=Math.round(e.height*(t.width/e.width))):(i.width=Math.round(e.width*(t.height/e.height)),i.height=t.height),i}({width:t,height:i},{width:a,height:o}),s=(a-r.width)/2,l=(o-r.height)/2;n.css("left",s+"px"),n.css("top",l+"px"),n.prop("width",r.width),n.prop("height",r.height)}function a(e){var t,i=$(e);i&&(i.find(".ogx_video").each((function(e,i){t=$(i),function(e,t,i){var n=$(e),a=t/i,o=n.parent().innerWidth(),r=n.parent().innerHeight(),s=o,l=Math.ceil(s/a);lo?d=(s-o)/2*-1:sr?c=(l-r)/2*-1:l0&&(r=0),n.parent().css("overflow","hidden"),n.prop("width",a),n.prop("height",o),n.css("top",r+"px")}(i,parseInt(t.data("width"),10),parseInt(t.data("height"),10))})),i.find(".ogx_image_fit").each((function(e,i){t=$(i),function(e,t,i){var n=$(e),a=t/i,o=n.parent().innerWidth(),r=o,s=Math.ceil(r/a),l=0;r>o?l=(r-o)/2*-1:rt&&(o=t);var r=Math.ceil(o/a);n.prop("width",o),n.prop("height",r)}(i,parseInt(t.data("width"),10),parseInt(t.data("height"),10))})))}function o(e){e?$(window).on("resize",r):$(window).off("resize",r)}function r(){for(var e in t)a(t[e].selector)}function s(e){var t;e.find(".ogx_video, .ogx_video_resp, .ogx_video_poster").each((function(e,i){(t=$(i)).parent().css("overflow","hidden"),i.hasAttribute("data-width")||(t.attr("data-width",t.attr("width")),t.attr("data-height",t.attr("height")))})),e.find(".ogx_image_cover, .ogx_image_contain, .ogx_image_fit, .ogx_image_scale, .ogx_image_resp").each((function(e,i){(t=$(i)).css("position","relative"),i.hasAttribute("data-width")||(t.attr("data-width",t.attr("width")),t.attr("data-height",t.attr("height")))})),a(e)}this.resize=function(e){void 0!==e?a(e):r()},this.bind=function(n,a){return!t.hasOwnProperty(n)&&(t[n]={observer:null,element:a},t[n].observer=(r=a,l=null,(d=new(window.MutationObserver||window.WebKitMutationObserver)((function(e,t){e.forEach((function(e){l&&clearTimeout(l),l=setTimeout((()=>{s($(r))}),10)}))}))).observe(document.querySelector(r),{childList:!0,subtree:!0}),d),t[n].selector=a,i++,e||(e=!0,o(!0)),s($(a)),!0);var r,l,d},this.unbind=function(n){return!(!t.hasOwnProperty(n)||!t[n].observer)&&(t[n].observer.disconnect(),delete t[n],!--i&&e&&(e=!1,o(!1)),!0)}},OGX.Media=new OGX.Media,void 0===OGX)var OGX={};if(require("NestList","Uxi","Bind"),OGX.NestList=function(e){construct(this,"NestList");var t,i,n=this,a={scope:["public"],template:'
{{$title}}
{{$body}}
',list:new OGX.List,item_default:!1,map:{title:"title",scope:"scope",id:"id"},order:!1},o={title:"",scope:[],open:!0},r={id:0,title:!1,scope:[],height:0,y:0,hidden:!1,open:!0,selector:!1},s=e,l=!1,d=0,c=0,u=1,f={y:0,h:0,way:1},g=!1,h=new OGX.List;function p(e){e?t.on("click",".ogx_nest_list_item_head",_):t.off("click",".ogx_nest_list_item_head",_)}function _(e){l||(l=!0,m($(this)))}function m(e){var i=e.parent(0).data("ogx-nest-id"),n=!1;e.hasClass("ogx_nest_list_item_head_closed")?(f.way=1,e.addClass("ogx_nest_list_item_head_open").removeClass("ogx_nest_list_item_head_closed"),h.findUpdate("id",i,{open:!0},!1,1),n=!0):(f.way=0,e.removeClass("ogx_nest_list_item_head_open").addClass("ogx_nest_list_item_head_closed"),h.findUpdate("id",i,{open:!1},!1,1));var a=h.find("id",i,1);n?(!function(e){var t=v(e);if(t)return t.focus(),!0}(a),t.trigger(OGX.NestList.OPEN,a)):(!function(e){var t=v(e);if(t)return t.blur(),!0}(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")),a=n.nodes.find("id",i,1);if(a)return a}return!1}function y(e){if(e.hasOwnProperty("scope"))for(var t=0;t .ogx_nest_list_item[data-ogx-nest-id="'+a.id+'"] > .ogx_nest_list_item_body > .ogx_nest_list_item_content';var f=$('.ogx_nest_list[data-ogx-id="'+n.id+'"] > .ogx_nest_list_item[data-ogx-nest-id="'+a.id+'"]');return a.hidden&&f.addClass("ogx_nest_list_item_hidden"),f.removeClass("ogx_nest_list_prep"),a}function b(){var e=s.list;g&&(e=i),t.empty(),h.clear();var a;t.html('
'),s.hasOwnProperty("node:OML")||(s["node:OML"]=[]);for(var o=0;o .ogx_nest_list_item[data-ogx-nest-id="'+h[t.index].id+'"]').remove(),h.splice(t.index,1),setTimeout(x,0))},this.updateNestHeight=function(e){var t=h.find(s.map.title,e,1);setTimeout((function(){var e,i;e=t,i=$(e.selector).outerHeight(!0),e.height=i,x()}),0)},this.updateNestsHeight=function(){for(var e,t=0;t{switch(e.type){case"text":return t.text();case"json":return t.json();default:return t.blob()}})).catch((e=>{$(document).trigger(OGX.Api.NETWORK_ERROR,e)})).then((n=>{e.data=n,a(e,t,i)}))}function r(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.preload=function(e,t,i){debug(4,"NET bulk preload init");var n={loaded:0,total:0,files:new OGX.List};for(var a in e)for(var o=0;oogx font init';$("body").append(o),a(e,i,n),function(e){setTimeout((function(){$('.ogx_font_loader[data-ogx-id="font-loader-'+e+'"]').remove()}),150)}(t),t++}o()}(l,i,r);break;case"pak":!function(e,t,i){function n(n){for(var o,r=//gi,s=[];o=r.exec(n);)s.push(o[1]);r=//gi;var l,d,c,u=n.split(r);u.shift();for(var f=0;f=!+]+ ?\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;}",d=new Function(l),e=e.replace(r[0],d())),(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]+))/gi.exec(e))&&(s='OGX.Object.get({_NAME_:{eq:"'+r[3]+'"}, id:{eq:"'+r[2]+'"}}, null, 1);')===(e=e.replace(r[0],s)))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]+")[0];")===(e=e.replace(r[0],s))))return s;if(isSingleVar(e))return"return "+replaceVars(e,t,i,n,a)+";";for(e+="\r\n";o=/[\S ]+(\r\n|\n)?/gi.exec(e);){if(l=replaceLoop(l=o[0].replace(/(\r\n|\n)/gi,"").trim(),t,i,n,a),charcode++,l=replaceVars(l,t,i,n,a),/^(app|OGX)\.\S+;?/g.test(l))return"return "+l+";";if(e=e.replace(o[0],""),u+=l+"\n",++c>100)return}return u="var __echo=[];\n"+u+'\nif(!__echo.length){return;}else{return __echo.join("");}'}function runJS(e,t,i,n,a,o){var r;try{r=new Function(oo,to,ro,lo,e)(t,i,n,a)}catch(e){return void debug(1,"Invalid script",o,"\n",e.toString())}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,str=__string.trim();if(["$","%","@"].includes(str))switch(str){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,a){var o,r,s,l;return(o=/loop (\S+) ?(as (\S+) ?(\S+ )?)?{/gi.exec(e))&&(r="__"+String.fromCharCode(charcode).toLowerCase()+"__",s=(s=o[0]).replace(o[0],"for(var "+r+" in JSON.parse(JSON.stringify("+o[1]+"))){"),o[2]&&(l=o[4]?"&"+o[3]+"="+r+"; &"+o[4]+"="+o[1]+"["+r+"]; ":"&"+o[3]+"="+o[1]+"["+r+"]; "),s+=l,e=e.replace(o[0],s)),e}function replaceVars(e,t,i,n,a){for(var o,r,s,l=0;r=/((&|#|@|\$|%)([a-zA-Z_]{1}[a-zA-Z0-9\-_]*))(\.[a-z0-9\-_\.\[\]\$]+|\.\$|\.)?(;)?/gi.exec(e);){switch(s=!1,r[2]){case"&":s=to+"."+r[3];break;case"@":s=lo+"."+r[3];break;case"$":s=oo+"."+r[3];break;case"#":s=r[3];break;case"%":s=ro+"."+r[3]}if(o=r[0].replace(r[1],s),e=e.replace(r[0],o),++l>300)return debug(1,"OSE script exceeded safe pool at replaceVars"),e}for(;r=/([a-z_\-]+)\( *(\$|@|&|%) *\)/gi.exec(e);)s=getTrueVal(r[2]),o=r[1]+"("+s+")",e=e.replace(r[0],o);for(;/^(json|ose|template|oml|crumb|result) (\S+)/g.test(e);)if((r=/crumb (\S+)?/gi.exec(e))&&(o=n.hasOwnProperty(r[1])?"__route_object."+r[1]:"{}",e=e.replace(r[0],o)),(r=/json (\S+)(;)?/gi.exec(e))&&(r[1]=getTrueVal(r[1],t,i,n,a),r[1]||debug(1,"OSE Error",e),e=e.replace(r[0],"app.getJSON("+r[1]+")")),(r=/^template (\S+)( \S+)?[ ;]?/gi.exec(e))&&(r[1]=getTrueVal(r[1],t,i,n,a),r[1]||debug(1,"OSE Error",e),void 0===r[2]?r[2]="__object":r[2]=getTrueVal(r[2].trim(),t,i,n,a),e=e.replace(r[0],"OGX.Templater.make(OGX.Templater.get("+r[1]+"), "+r[2]+", "+to+","+ro+","+lo+")")),(r=/^ose (\S+)(;)?/gi.exec(e))&&(r[1]=getTrueVal(r[1],t,i,n,a),r[1]||debug(1,"OSE Error",e),script=that.get(r[1]),script&&(e=exp.replace(r[0],script.replace(/({{|}})/g,"")))),(r=/^oml (\S+)(;)?/gi.exec(e))&&(r[1]=getTrueVal(r[1],t,i,n,a),r[1]||debug(1,"OSE Error",e),e=e.replace(r[0],"app.getOML("+r[1]+")")),(r=/^result (\S+)(;)?$/gi.exec(e))&&(e=e.replace(r[0],'OGX.OML.result("'+r[1]+'")')),++l>300)return debug(1,"OSE script exceeded safe pool"),e;if(["$","@","%","&"].includes(e.trim())){switch(e.trim()){case"$":e=oo;break;case"@":e=lo;break;case"%":e=ro;break;case"&":e=to}return e}for(;r=/echo ('|")?(((?![;}\r\n]+|$)([\S\s]))*)(?:'|")?/gi.exec(e);){var d="+$1+",c="'";if(void 0!==r[1]&&(c="\\"+r[1]),d=c+d+c,r[2]=r[2].replace(/(__(?!;\n\r)[a-z0-9_\-\.]+)/gi,d),o="__echo.push("+c+r[2]+c+");",e=e.replace(r[0],o),++l>300)return debug(1,"OSE script exceeded safe pool"),e}return e}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 a in t.values)if(convertValue(a)===n)return t.values[a];return!1},this.execScript=function(e,t,i,n){var a=this.get(e);return a&&this.exec(a,t,i,n),!1},this.exec=function(e,t,i,n,a){void 0===t&&(t={}),void 0===i&&(i={}),void 0===n&&(n={}),void 0===a&&(a={}),charcode=65;var o=runJS(convertToJS(e,t,i,n,a),t,i,n,a,e);if(void 0!==o)return o}},OGX.OSE=new OGX.OSE,OGX.OSE.SCRIPT_LOADED="OSE_SCRIPT_LOADED",OGX.OSE.SCRIPTS_LOADED="OSE_SCRIPTS_LOADED",void 0===OGX)var OGX={};if(OGX.Overlay=function(e){"use strict";var t=this,i=!1,n=!1,a={anim:OGX.Overlay.FADE,display:{css:"",html:" "},index:!1,close_on_click:!1},o=!1,r="mousedown";function s(e){i&&(e?i.on(r,l):i.off(r,l))}function l(){"function"==typeof o.close_on_click&&o.close_on_click.apply(null,t),s(!1),t.removeOverlay()}e.hasOwnProperty("overlay")&&e.overlay&&setTimeout((function(){t.addOverlay(e.overlay)}),0),this.hasOverlay=function(){return!!i},this.addOverlay=function(e){if("object"!=typeof e&&(e={}),OGX.Data.merge(e,a),e.display.hasOwnProperty("_NAME_")||(e.display=new OGX.Display(e.display)),o=e,!this.hasOverlay()){var t=this.el;o.hasOwnProperty("el")&&(t=$(o.el));var n="z-index:"+(o.zindex?o.zindex:this.topIndex(t))+";",r='
'+o.display.html()+"
";if(t.prepend(r),(i=t.children(".ogx_overlay").first()).off("transitionend"),o.anim)switch(o.anim){case OGX.Overlay.FADE:setTimeout((function(){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){s(!1);var t=!1;if(void 0===e||!0===e?o.anim&&(t=o.anim):t=e,i){if(t){switch(t){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)})):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 debug(2,"No overlay to remove"),this},this.addGroupOverlay=function(){return n||(this.el.prepend('
'),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,e.hasOwnProperty("placeholder")&&(this.pholder=e.placeholder),this.placeholder(e)},OGX.Placeholder.prototype.placeholder=function(e){var t;if("object"==typeof e["node:OML"]&&!Array.isArray(e["node:OML"])){var i=this.selector;for(var n in this.pholder&&(i+=" "+this.pholder),e["node:OML"])0===n.indexOf("default")&&(t=n.replace("default",i),e["node:OML"][t]=e["node:OML"][n],delete e["node:OML"][n])}},OGX.Placeholder.prototype.placeholders=function(e,t){if(void 0!==e&&void 0!==t){e.hasOwnProperty("node:OML")||(e["node:OML"]=[]);var i,n,a=e["node:OML"];a&&"string"==typeof a&&(0===a.indexOf("{{")?e["node:OML"]=OGX.OSE.exec(a):e["node:OML"]=OGX.Cache.read("oml",e["node:OML"]));for(var o=0;o=i.points[t].min&&oi.left&&t.lefti.top&&t.topscreen.width&&(e=screen.width),t>screen.height&&(t=screen.height);var i=r.width,n=r.height;if(p||(i=OGX.Data.getBestSize(e,i),n=OGX.Data.getBestSize(t,n)),r.center)"string"==typeof i&&(i=-1!==i.indexOf("%")?Math.round(e*Number(i.substr(0,i.length-1))/100):Number(i)),"string"==typeof n&&(n=-1!==n.indexOf("%")?Math.round(t*Number(n.substr(0,n.length-1))/100):Number(n)),x=Math.round(e/2-i/2),y=Math.round(t/2-n/2),r.drag&&(r.center=!1);else{var a=s.position();x=a.left,y=a.top,x>e&&(x=e-x),x<-i&&(x=0),y>t&&(y=t-n),y<0&&(y=0)}return{x:x,y:y,w:i,h:n}}function S(e,t,i,a,o,l){var d=!1,f=null;if(void 0===l&&(l=!1),void 0!==t&&!0!==t||(t=r.anim),t&&(d=t),!t&&_&&(d=_),t?n.el.removeClass(c+"_notrans"):n.el.addClass(c+"_notrans"),e?(n.front(),l||n.el.trigger(OGX.Popup.SHOW,n)):l||n.el.trigger(OGX.Popup.HIDE,n),d){var g={};switch(f=c+"_"+d,d){case OGX.Popup.SCALE:u[1]=e?"scale(1,1)":"scale("+r.anim_param.scale+", "+r.anim_param.scale+")",g.transform=u.join(" ");break;case OGX.Popup.FADE:g.opacity=e?1:0}e&&(s.css("display","flex"),g.visibility="visible",g.display="flex"),t||e||(g.visibility="hidden",g.display="none"),setTimeout((function(){s.css(g)}),50),t?(_=d,s.on("transitionend",(function(){s.off("transitionend"),e?n.resizeNodes():s.css({display:"none",visibility:"hidden"}),f&&s.removeClass(f),L(i,a,o)})),f&&s.addClass(f)):(s.removeClass(f),L(i,a,o))}else e?s.css({opacity:e,display:"flex",visibility:"visible"}):s.css({display:"none",visibility:"hidden"}),L(i,a,o)}function L(e,t,i){void 0!==e&&e&&e(t),void 0!==i&&i&&i(n.id)}function k(e){e?s.on(n.touch.down,"."+c+"_button",M):s.off(n.touch.down,"."+c+"_button",M)}function M(e){e.preventDefault(),e.stopImmediatePropagation();var t=$(this);if(!t.hasClass(c+"_button_disabled")){var i=t.index();s.trigger(OGX.Popup.CLICK_BUTTON,{index:i,value:r.buttons[i].label}),r.buttons[i].hasOwnProperty("callback")&&r.buttons[i].callback&&(r.buttons[i].hasOwnProperty("params")?r.buttons[i].callback.apply(null,[r.buttons[i].params]):r.buttons[i].callback())}}function N(){for(var e,t="",i=0;i0&&(e=r.buttons[i].enabled?"":c+"_button_disabled",t+=''+r.buttons[i].label+"");return t}function I(e,t){void 0===t&&(t=!0),r.buttons=new OGX.List(e);for(var i=0;i";return t}this.anim=null,this.group=r.group,this.x=0,this.y=0,this.z=0,this.construct=function(){},this.enable=function(){return this.enableResize(),r.icons&&r.icons.length&&A(!0),r.buttons&&r.buttons.length&&r.buttons_enabled&&k(!0),debug(5,"popup",r.id,"enabled"),this},this.disable=function(){return this.disableResize(),r.icons&&r.icons.length&&A(!1),r.buttons&&r.buttons.length&&r.buttons_enabled&&k(!1),debug(5,"popup",r.id,"disabled"),this},this.show=function(e,t,i){return S(1,e,t,i),this.focus(1),this},this.hide=function(e,t,i,n,a){return S(0,e,t,i,n,a),this.blur(1),this},this.resize=function(){return b(),this},this.maximize=function(){return r.maximize&&!m&&(m=!0,v={width:r.width,height:r.height,x:this.x,y:this.y},r.width=r.height="100%",b(!1),this.x=this.y=0,this.move(this.x,this.y)),this},this.normalize=function(){return r.maximize&&m&&(m=!1,r.width=v.width,r.height=v.height,b(!1),this.x=v.x,this.y=v.y,v=null,this.move(this.x,this.y)),this},this.destroy=function(){s.off("transitionend"),this.touch.wipe()},this.buttons=function(e){if(void 0===e)return r.buttons;I(e)},this.enableButton=function(e){return r.buttons[e].enabled=!0,l.children("."+c+"_button:eq("+e+")").removeClass(c+"_button_disabled"),r.buttons_enabled||(r.buttons_enabled=!0),this},this.disableButton=function(e){return r.buttons[e].enabled=!1,l.children("."+c+"_button:eq("+e+")").addClass(c+"_button_disabled"),this},this.enableButtons=function(){if(r.buttons.length)for(var e=0;e',r.icon&&(a+='
"),r.title&&(a+='
'+r.title+"
"),a+='
',r.icons&&(a+=Y()),a+="
");var o,d=1;if(u=["translate3d("+e.x+"px, "+e.y+"px, 0)"],r.anim)switch(r.anim){case OGX.Popup.FADE:d=0,o=c+"_fade";break;case OGX.Popup.SCALE:o=c+"_scale",u[1]="scale("+r.anim_param.scale+", "+r.anim_param.scale+")"}a+='
',r.html?a+=r.html:r.template&&(a+=OGX.Templater.make(OGX.Templater.get(r.template),r.data)),a+="
",r.buttons&&r.buttons.length&&(a+='
',a+=N(),a+="
"),s.html(a),s.css({width:t,height:i,opacity:d,transform:u.join(" "),"z-index":n.z}),r.anim&&s.addClass(o),n.el=s,l=s.children("."+c+"_buttons").first()}(),r.drag){var e={x:!0,y:!0,cb_down:T,cb_up:E,target:"."+c+"_head"};r.group?e.cb_drag=D:"function"==typeof r.drag&&(e.cb_drag=function(e){r.drag(n,e)}),n.touch.add("Drag",e)}if(r.resize&&n.setResize({top:!1,cb_resize:O,cb_down:G,cb_up:X}),r.hasOwnProperty("html")&&r.html)r["node:OML"]=[{"default:Html":{html:r.html}}];else if(r.hasOwnProperty("view")&&r.view){var t={};t["default:Views."+r.view.id]=r,r["node:OML"].push(t)}n.placeholders(r,["."+c+'[data-ogx-id="'+r.id+'"] > .'+c+"_body"]),r.overlay&&n.addOverlay(),n.observe(!0,undefined,(function(){n.resizeNodes(),n.observe(!1),r.show&&n.show()})),debug(5,"popup",r.id,"init")}else debug(1,"OGX.Container not found! ");else debug(1,"OGX.Data not found! ");else debug(1,"OGX.Templater not found! ")}()},OGX.Popup.FADE="fade",OGX.Popup.SCALE="scale",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,void 0===OGX)var OGX={};if(OGX.Resize=function(e){"use strict";var t,i,n,a,o,r,s,l,d=this,c=e,u={enabled:!0,top:!0,left:!0,right:!0,bottom:!0,min_width:100,min_height:100,max_width:0,max_height:0,border:10,cb_up:!1,cb_down:!1,cb_resize:!1},f=!1,g="mousedown",h="mouseup",p="mousemove",_=(c=!1,!1),m=!1,v={w:0,h:0};function y(e){c&&(e?d.el.on(g,x):d.el.off(g,x))}function x(e){var u=T(e);n=u.pageX,a=u.pageY;var f=d.el.position();t=f.left,i=f.top;var g=d.el.offset(),h=n-g.left,p=a-g.top;v.w=d.el.width(),v.h=d.el.height(),o=0,r=0,s=0,l=0,c.top&&pd.el.height()-c.border&&(l=1),c.left&&hd.el.width()-c.border&&(s=1),_=-1!==window.getComputedStyle(d.el[0],"width"),m=-1!==window.getComputedStyle(d.el[0],"height"),(s||l)&&(e.preventDefault(),d.hasOwnProperty("dragable")&&d.dragable&&d.touch.drag.disable(),O(!0),w(!0),c.cb_down&&c.cb_down())}function O(e){e?f||(f=setInterval(b,5)):f&&(clearInterval(f),f=!1)}function b(){if(-1===s||-1===l){var e=t,n=i;o&&s&&(e+=o),r&&l&&(n+=r),o&&-1===s&&r&&1===l&&(n=i),d.el.css("transform","translate3d("+e+"px, "+n+"px, 0)")}s&&v.w+o*s>c.min_width&&(_?d.el.width(Math.round(100*(v.w+o*s)/d.el.parent().width()*100)/100+"%"):d.el.width(v.w+o*s)),l&&v.h+r*l>c.min_height&&(m?d.el.height(Math.round(100*(v.h+r*l)/d.el.parent().height()*100)/100+"%"):d.el.height(v.h+r*l)),(o||r)&&(c.cb_resize?c.cb_resize():d.el.trigger(OGX.Resize.RESIZING))}function w(e){e?($("body").on(p,G),$("body").on(h,X)):($("body").off(p,G),$("body").off(h,X))}function G(e){e.preventDefault(),e.stopImmediatePropagation(),e=T(e),o=e.pageX-n,r=e.pageY-a}function X(e){O(!1),w(!1),e=T(e),o=e.pageX-n,r=e.pageY-a,c.cb_up&&c.cb_up(),d.hasOwnProperty("dragable")&&d.dragable&&(y(!1),d.touch.drag.enable(),setTimeout((function(){y(!0)}),0))}function T(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,u,!1),c=e},this.enableResize=function(){return y(!0),this},this.disableResize=function(){return y(!1),this},this.destroy=function(){this.touch.wipe()},OGX.Data.merge(c,u,!1),void 0===window.ontouchstart||c.chromeos||(g="touchstart",p="touchmove",h="touchend"),d.hasOwnProperty("dragable")&&d.dragable&&(d.touch.drag=d.touch.add("Drag",{state:"manual"}))},OGX.Resize.RESIZING="resizeResizing",void 0===OGX)var OGX={};if(require("Roulette","Uxi","Bind","Touch"),OGX.Roulette=function(e){construct(this,"Roulette");var t,i,n,a,o,r,s,l=this,d=e,c={force_coef:10,time_coef:.1,min_force_pitch:2,value:null,name:!1,required:!1,display:!1,key:"value",mode:OGX.Roulette.MODE_REWIND,icon:!1,list:new OGX.List,capture:!1},u={template:!1,html:'{{$label}}',css:!1},f="object",g=0,h=0,p="ogx_roulette";function _(e,t){void 0===t&&(t=!0),l.el.children('input[name="'+d.name+'"]').val(e),t&&l.el.children('input[name="'+d.name+'"]').trigger("change")}function m(e){e?t.on(l.touch.down,"."+p+"_icon",(function(e){e.preventDefault(),e.stopImmediatePropagation(),l.next(!0)})):t.off(l.touch.down,"."+p+"_icon")}function v(e){e?t.on("change","input[type=hidden]",y):t.off("change","input[type=hidden]",y)}function y(e){e.preventDefault(),e.stopImmediatePropagation(),l.loopval(0,OGX.Data.stringToVal(e.target.value),!1)}function x(e){return h+e>d.list.length-1?d.list[0]:h+e<0?d.list[d.list.length-1]:d.list[h+e]}function O(e){a=e.y,G(!0)}function b(e){var t;e.dirY!==o?(t=0,a=e.pt1.y):(t=e.pt1.y-a,a=e.pt1.y),o=e.dirY,i.css({transition:"none",transform:"translate3D(0px, "+(D(i)+t)+"px, 0px)"})}function w(e){G(!1),trans=D(i);var t=Math.round(trans/n)*n,a=Math.round(t/n%d.list.length);if(a=a<=0?Math.abs(a):d.list.length-a,h!==a){switch(h=a,f){case"string":d.value=d.list[h];break;case"object":d.value=d.list[h][d.key]}d.name&&l.el.children('input[name="'+d.name+'"]').val(d.value).trigger("input"),l.el.trigger(OGX.Roulette.CHANGE,d.value)}i.css({transition:"all 0.2s ease-out",transform:"translate3D(0px, "+t+"px, 0px)"})}function G(e){e?r=setInterval(X,10):clearInterval(r)}function X(){var e,t,a;(e=Math.floor((i.position().top+n*o)/(n*d.list.length)*-1))!==g&&(0===i.children("."+p+'_stripe[data-id="'+e+'"]').length&&((t=s.clone()).css("top",e*(n*d.list.length)+"px"),t.attr("data-id",e),i.append(t)),i.children("."+p+"_stripe").each((function(e,t){a=i.position().top+$(t).position().top,(Math.ceil(a+n*d.list.length)<-n||a>n)&&$(t).remove()})),g=e)}function T(){G(!1),i.off("transitionend",T)}function E(){var e="",a="";d.icon&&(a+='
'),a+='
';for(var o=0;o<2;o++){a+='
';for(var r=0;r'+e+"
"}a+="
"}if(a+="
",d.icon&&(a+='
'),void 0===h&&(h=0),d.name){var l="";switch(d.required&&(l=" required"),f){case"string":a+='";break;case"object":a+='"}}t.html(a),i=t.children("."+p+"_stripes").first(),d.icon&&(i=t.children("."+p+"_container").children("."+p+"_stripes").first()),s=(s=i.children("."+p+"_stripe:last")).detach();var c=h*n*-1;i.css({transition:"none",transform:"translate3D(0px, "+c+"px, 0px)"})}function D(e){var t=0;return"none"!==e.css("transform")&&(t=Number(e.css("transform").split(",")[5].split(")")[0])),t}function C(e){switch(f){case"string":return{index:d.list.indexOf(e)};case"object":return d.list.findIndex(d.key,e)}}function S(){d.list.length>0&&!d.list.hasOwnProperty("insert")&&(d.list=new OGX.List(d.list)),"string"==typeof d.list[0]&&(f="string"),1===d.list.length&&(d.list[1]=d.list[0])}this.enable=function(){return t.removeClass(p+"_disabled"),d.icon&&m(!0),d.name&&v(!0),debug(5,"roulette",d.id,"enabled"),this},this.disable=function(){return t.addClass(p+"_disabled"),d.icon&&m(!1),d.name&&v(!1),G(!1),debug(5,"roulette",d.id,"disabled"),this},this.bindFilter=function(e,t,i){return d.list.removeFilter(e),d.list.addFilter(e,t,i),d.list.filter(),setTimeout(E,0),this},this.destroy=function(){this.touch.wipe()},this.bindRender=function(e,t){},this.val=function(e,t){if(void 0!==e){var a=C(e).index;return a>-1&&(!function(e,t){void 0===t&&(t=!0);i.off("transitionend",T),G(!1),o=-1;var a=D(i),r=Math.round(a/n)*n,s=a-r,l=Math.round(r/n%d.list.length);l=l<=0?Math.abs(l):d.list.length-l;var c=l-e;d.mode===OGX.Roulette.MODE_CLOSEST&&c>d.list.length/2&&(c=-1*(d.list.length-l+e));var u=a+c*n-s,f=20*Math.round(Math.abs(c*n)*d.time_coef);G(!0),i.on("transitionend",T),i.css({transition:"all "+f+"ms ease-out",transform:"translate3D(0px, "+u+"px, 0px)"}),h=e}(a),d.name&&_(e,!1)),this}switch(f){case"string":return d.list[h];case"object":return d.list[h][d.key]}},this.item=function(){return d.list[h]},this.loopval=function(e,t,a){var o=h,r=C(t).index;r>-1&&(h=r);var s=o-r,l=d.time_coef*Math.abs(s+e*d.list.length);return G(!0),i.css({transition:"all "+l+"s ease-out",transform:"translate3D(0px, "+(D(i)+(s*n-d.list.length*n*e))+"px, 0px)"}),i.on("transitionend",T),d.name&&_(t,a),void 0!==a&&a&&this.el.trigger(OGX.Roulette.CHANGE,val),this},this.next=function(e){var t,i=x(1);switch(o=1,f){case"string":t=i;break;case"object":t=i[d.key]}return this.val(t),void 0!==e&&e&&(this.el.trigger(OGX.Roulette.CHANGE,t),d.name&&this.el.children('input[name="'+d.name+'"]').trigger("input")),this},this.prev=function(e){var t,i=x(-1);switch(f){case"string":t=i;break;case"object":t=i[d.key]}return this.val(t),void 0!==e&&e&&(this.el.trigger(OGX.Roulette.CHANGE,t),d.name&&this.el.children('input[name="'+d.name+'"]').trigger("change")),this},this.setData=function(e,t){return d.value=t,d.list=e,S(),h=void 0===t?0:C(t).index,setTimeout(E,0),this},void 0!==OGX.List?void 0!==OGX.Templater?void 0!==OGX.Display?(debug(5,"roulette init",d.id),function(){if(OGX.Data.merge(d,c),S(),d.display?d.display=new OGX.Display(d.display):d.display=new OGX.Display(u),(t=l.el=$(d.el)).addClass(p),t.width(),n=t.height(),d.list.length){var e=t.parent();e[0].hasAttribute("data-value")&&(d.value=OGX.Data.stringToVal(e.data("value")),e.removeAttr("data-value")),null===d.value&&(d.value=d.list[0],"object"==typeof d.value&&(d.value=d.value.value)),h=C(d.value).index}}(),l.observe(!0,{childList:!0},(function(){l.observe(!1),l.touch.swipe=l.touch.add("Swipe",{x:!1,y:!0,cb_down:O,cb_swipe:b,cb_up:w,target:'.ogx_roulette[data-ogx-id="'+l.id+'"] > .ogx_roulette_container',capture:d.capture})}),null),E(),debug(5,"roulette",d.id,"init")):debug(1,"OGX.Display not found! "):debug(1,"OGX.Templater not found! "):debug(1,"OGX.List not found! ")},OGX.Roulette.CHANGE="RouletteChange",OGX.Roulette.MODE_REWIND="RouletteModeRewind",OGX.Roulette.MODE_CLOSEST="RouetteModeClosest",OGX.Roulette.BIND=OGX.Roulette.CHANGE,void 0===OGX)var OGX={};if(require("RouletteTree","Uxi"),OGX.RouletteTree=function(e){construct(this,"RouletteTree");var t,n,a=this,o=e,r={groups:!1,data:!1,value:!1,required:!1},s=!1;function l(e){e?t.on(OGX.Roulette.CHANGE,c):t.off(OGX.Roulette.CHANGE,c)}function d(){for(var e,t=0;t0&&(e=s[t-1].roulette.val()),0===t||t-1>=0&&null!==e&&String(e).length>0?s[t].roulette.focus():t>0&&p(s[t].roulette)}function c(e,a){e.stopImmediatePropagation();var o,r=$(e.target).data("ogx-id"),l=s.findIndex("id",String(r)),d=s[l.index].roulette.item().hasOwnProperty("head");if(n=l.index,l.index+10&&s[a].roulette.setData(h(i),t),i.push(t)));setTimeout(d,0)}function h(e){for(var t=o.data,i=0;i-1?f(n):{};g(e)},o=OGX.Data.merge(o,r),(t=a.el).addClass("ogx_roulette_tree"),function(){s=new OGX.List;var e,i,n=0;!function r(l,d){var c;if(!Array.isArray(l)&&"object"==typeof l){if(d>n){for(var u in n=d,t.append('
'),i=o.groups[d-1],e=[{label:i,value:"",head:!0}],l)e.push({label:u,value:u});c=a.create("Roulette",{el:'.ogx_roulette_tree[data-ogx-id="'+a.id+'"] .ogx_roulette_tree_roulette[data-ogx-roulette="'+d+'"]',list:e,icon:o.icon,value:null,name:i,required:o.required}),n>1&&p(c),s.push({roulette:c,group:i,id:c.id})}if(de.unix+e.expiration)}function getCache(e){if(void 0===e)return!1;for(var t,i,n=0;n0}catch(e){debug(1,e)}return!1},this.fork=function(e){for(var t in e)if(this.eval(t))return e[t];return!1}},void 0===OGX)var OGX={};if(require("Scroller","Uxi","Touch"),OGX.Scroller=function(e){construct(this,"Scroller");var t,i,n,a,o,r,s,l,d,c,u,f=this,g=e,h={check_delay:30,fade_delay:300,css:!1,zindex:9999,observe:!0,auto_scroll:!1,scroll_callback:!1,trigger:!0},p=0,_="init",m=!1,v=!1,y=null;function x(e){e?i.on(f.touch.down,O):i.off(f.touch.down,O)}function O(e){e=f.event(e),S(!1),G(!0),b(!0),x(!1),L("in"),D(!0)}function b(e){e?(c=setInterval(E,10),i.on(f.touch.move,w)):(clearInterval(c),i.off(f.touch.move,w))}function w(e){e=f.event(e)}function G(e){e?$(document).on(f.touch.up,X):$(document).off(f.touch.up,X)}function X(){b(!1),G(!1),x(!0),D(!1),L("out")}function T(e){e?(window.addEventListener("resize",N),i.on("scroll",(function(e){e.stopImmediatePropagation(),E()})),i.on("wheel",(function(e){D(!0)})),void 0!==OGX.NestedList&&$(document).on(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED,(function(){f.update()}))):(window.removeEventListener("resize",N),i.off("scroll"),i.off("wheel"),void 0!==OGX.NestedList&&$(document).off(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED))}function E(){var e,a=(e=i.scrollTop())/s,r=Math.round(o.position().top);o.css("top",a+"px"),g.trigger&&!m&&(f.el.trigger(OGX.Scroller.SCROLL,{top:e,percent:100*e/n}),-1*e==i.outerHeight(!0)-t.outerHeight(!0)?r!==Math.round(a)&&f.el.trigger(OGX.Scroller.BOTTOM):0===e&&(r&&r!==Math.round(a)||!r)&&f.el.trigger(OGX.Scroller.TOP)),g.scroll_callback&&g.scroll_callback()}function D(e){e?(d&&D(!1),l=t.position().top,d=setInterval(C,g.check_delay-10)):(d&&(clearInterval(d),d=null),v=!1,f.el.trigger(OGX.Scroller.END))}function C(){var e=t.position().top;e!==l?(v||(v=!0,f.el.trigger(OGX.Scroller.START)),L("in")):L("out"),l=e}function S(e){e?u=setInterval(E,g.check_delay):clearInterval(u)}function L(e){o.hasClass("ogx_scroller_track_anim")||o.addClass("ogx_scroller_track_anim"),"in"===e?(clearTimeout(y),y=null,o.addClass("ogx_scroller_track_anim_fade_in").removeClass("ogx_scroller_track_anim_fade_out")):y||(y=setTimeout((function(){o.addClass("ogx_scroller_track_anim_fade_out").removeClass("ogx_scroller_track_anim_fade_in")}),g.fade_delay))}function k(e){e?f.observe(!0,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","src","width","height"]},M):f.observe(!1)}function M(){p!==t.height()&&(p=t.height(),N(),g.auto_scroll&&f.bottom())}function N(){if(a=i.innerHeight(),n=t.height(),s=n/a,n>a){var e=Math.round(a/s);o.css("height",e+"px"),r.css("display","block")}else r.css("display","none");"init"===_&&(_=OGX.Scroller.READY,f.el.trigger(OGX.Scroller.READY))}this.enable=function(){return N(),T(!0),g.observe&&setTimeout((function(){k(!0)}),0),x(!0),debug(5,"scroller",g.id,"enabled"),this},this.disable=function(){return T(!1),g.observe&&k(!1),G(!1),b(!1),x(!1),D(!1),S(!1),o.removeClass("ogx_scroller_track_anim_fade_in"),o.removeClass("ogx_scroller_track_anim_fade_out"),debug(5,"scroller",g.id,"disabled"),this},this.resize=function(){return N(),this},this.destroy=function(){f.el.removeClass("ogx_scroller_outer"),t.remove(),r.remove()},this.top=function(){return n>a&&(i[0].scrollTop=0,N()),this},this.bottom=function(){return n>a&&(i.scrollTop(n),N()),this},this.scroll=function(e){return void 0===e?i[0].scrollTop:(i[0].scrollTop=e,N(),this)},this.mute=function(){return m=!0,this},this.vocal=function(){return m=!1,this},this.container=function(){return t},this.inner=function(){return t[0]},this.outer=function(){return i[0]},this.state=function(){return _},OGX.Data.merge(g,h),function(){f.el=$(g.el),f.el.addClass("ogx_scroller_outer ogx_hw"),(i=f.el).html('
'),t=i.children(".ogx_scroller_inner");var e='
';i.parent().append(e),r=i.parent().find(".ogx_scroller_track"),o=r.find(".ogx_scroller_track_button")}(),N(),debug(5,"scroller",g.id,"init")},OGX.Scroller.READY="ScrollerReady",OGX.Scroller.TOP="ScrollerTop",OGX.Scroller.BOTTOM="ScrollerBottom",OGX.Scroller.SCROLL="ScrollerScroll",OGX.Scroller.START="ScrollerStart",OGX.Scroller.END="ScrollerEnd",void 0===OGX)var OGX={};if(require("StackedTree","Uxi","Touch"),OGX.StackedTree=function(e){construct(this,"StackedTree");var t,i,n,a,o=this,r={scope:["public"],speed:200,list:[],display:{html:"{{$label}}"},displays:!1,chromeos:!1},s=e,l=[],d=[0],c=0,u=!1,f="ogx_stacked_tree";function g(e){e?(t.on(o.touch.down,".ogx_stacked_tree_level .ogx_stacked_tree_level_prev",h),t.on(o.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[c].findIndex("__id__",t.__id__);t.hasOwnProperty("items")&&t.items.length&&function(e){if(!e.hasOwnProperty("scope"))return!0;for(var t=0;t';e>0&&(r=(r=a.css(u)).replace(f+"_door",""),d+='
'+a.html(u)+"
"),d+='
',i.append(d);var c=i.children("."+f+'_level[data-level="'+e+'"]').children("."+f+"_level_list");i.children("."+f+"_level").css("flex-basis",Math.floor(100/(e+1)*100)/100+"%"),function(e,t,i){l[e]&&o.remove(l[e].id,"DynamicList");var n=o.create("DynamicList",{el:t,mode:"static",scroll:!0,display:s.display,displays:s.displays,list:i});l[e]=n}(e,c[0],t)}function v(e,t){g(!1),i.addClass(f+"_anim"),void 0!==t&&t?i.on("transitionend",(function(){i.off("transitionend"),i.removeClass(f+"_anim").css("width",100*(e+1)+"%"),o.remove(l[e+1].id,OGX.DynamicList.NAME),l.splice(e+1,1),i.children("."+f+'_level[data-level="'+(e+1)+'"]').remove(),i.children("."+f+"_level").css("flex-basis",Math.floor(100/(e+1)*100)/100+"%"),n=i.width(),u=!1,c=e,g(!0)})):(c=e,g(!0)),n=i.width(),i.css("transform","translateX("+e*Math.round(n/d.length)*-1+"px)")}this.enable=function(){return g(!0),p(!0),debug(5,"stackedtree",s.id,"enabled"),this},this.disable=function(){return g(!1),p(!1),debug(5,"stackedtree",s.id,"disabled"),this},this.resize=function(){return _(),this},this.destroy=function(){debug(5,"stackedtree destroy",s.id)},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,d=[0],c=0,u=!1,!0):s.scope},debug(5,"stackedtree",s.id,"init"),function(){if(void 0!==OGX.DynamicList)if(void 0!==OGX.Display){s=OGX.Data.merge(s,r,!1,!0);var e=(a=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){var t=['{{return typeof($items) !== "undefined" && $items.length > 0}}',{add:"ogx_stacked_tree_door"}];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",e.css.hasOwnProperty("conditions")?e.css.conditions.push(t):e.css.conditions=[t];else{var i="";e.css&&(i=e.css),i+=" ogx_stacked_tree_item",e.css={add:i,conditions:[t]}}else e.css={add:"ogx_stacked_tree_item",conditions:[t]};return e}return e}(e),a.val(e),s.display=e.display,s.displays=e.displays,(t=o.el).addClass(f),s.list.length){var i=s.list.slice();s.list={items:i}}}else debug(1,"OGX.Display not found! ");else debug(1,"OGX.DynamicList not found! ")}(),t.html('
'),i=t.children("."+f+"_container").first(),s.list.items.length&&m(d[0],s.list.items)},OGX.StackedTree.BACK="StackedTreeBack",OGX.StackedTree.ENTER="StackedTreeEnter",OGX.StackedTree.SELECT="StackedTreeSelect",require("Stage","Uxi","Touch","Placeholder"),OGX.Stage=function(e){construct(this,"Stage");var t=this,i=OGX.Data.merge({id:"stage",anim:null,group_watch:!1},e,!0,!0);function n(e){e?t.el.on(t.touch.down,".ogx_stage_exit",(function(){app.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.enable=function(){return i.closeable&&n(!0),this},this.disable=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 a="";i.closeable&&(a='
');var o=e.html();i.hasOwnProperty("data")&&(o=OGX.Templater.make(o,i.data)),a+=o,container=t.el,container.html(a),container.addClass("ogx_stage").css("display",n)}()},OGX.Stage.SWAP="swap",OGX.Stage.FLIP="flip",void 0===OGX)var OGX={};if(require("Switch","Uxi","Bind","Touch"),OGX.Switch=function(e){construct(this,"Switch");var t,i=this,n=e,a={el:"document",bind:!1,labels:!0,data:[{label:"OFF",value:!1},{label:"ON",value:!0}],value:!1,name:!1},o="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("."+o+"_dot").first(),a=t.find("."+o+"_label").first(),r=t.find("."+o+"_label").last();n.value==n.data[0].value?(i.removeClass(o+"_dot_right").addClass(o+"_dot_left"),a.removeClass(o+"_label_off").addClass(o+"_label_on").addClass(o+"_selected"),r.removeClass(o+"_label_on").addClass(o+"_label_off").removeClass(o+"_selected")):(i.removeClass(o+"_dot_left").addClass(o+"_dot_right"),r.removeClass(o+"_label_off").addClass(o+"_label_on").addClass(o+"_selected"),a.removeClass(o+"_label_on").addClass(o+"_label_off").removeClass(o+"_selected")),n.name&&t.find('input[type="hidden"]').attr("value",n.value),e&&t.children("."+o+"_val").trigger("input")}function l(e){e?t.on(i.touch.down,d):t.off(i.touch.down,d)}function d(e){e.preventDefault(),e.stopImmediatePropagation(),r(),c(!1),t.trigger(OGX.Switch.CHANGE,n.value),t.children("."+o+"_val").trigger("input"),c(!0)}function c(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.enable=function(){return l(!0),n.name&&c(!0),t.removeClass(o+"_disabled"),debug(5,"switch",n.id,"enabled"),this},this.disable=function(){return l(!1),n.name&&c(!1),t.addClass(o+"_disabled"),debug(5,"switch",n.id,"disabled"),this},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("."+o+"_val").first().trigger("input")),n.value},this.toggle=function(e){return r(e=void 0===e),this},debug(5,"switch",n.id,"init"),function(){var e;void 0===n&&(n={}),n.hasOwnProperty("data")&&!n.hasOwnProperty("value")&&(e=n.data[0].value),OGX.Data.merge(n,a),void 0!==e&&(n.value=e),(t=i.el).addClass(o+"_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+=''+n.data[0].label+"");var i="";n.value===n.data[1].value&&(i=o+"_dot_right"),e+='
',n.labels&&(e+=''+n.data[1].label+""),n.name&&(e+=''),t.html(e),t.addClass(o)}(),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,a={editable:!0,detachable:!1,detach_min:20,reorder:!0,icons:!1,index:0,list:new OGX.List,display:{html:"",css:""}},o=!1,r=0,s=!1,l=!1,d=!1,c=!1,u=!1,f={x:0,y:0},g="ogx_tabs";function h(){for(var e,i,a='
',s=0;s',e&&(a+=''+e+""),n.editable&&(a+=''),a+="
",i="";a+="",n.editable&&(a+='
',t.addClass(g+"_editable")),t.html(a),o=t.children("."+g+"_container").children("."+g+"_tab:eq("+r+")")}function p(e){s||(u=!1,l=$(e),d={from:l.index()},t.children("."+g+"_container").children("."+g+"_tab_active").first().removeClass(g+"_tab_active"),f.x=l.position().left,f.y=l.position().top,(s={el:$(e).clone(),x:f.x,y:l.position().top}).w=l.width(),s.el.width(s.w),l.addClass(g+"_tab_active").addClass(g+"_frozen"),o=l,s.el.addClass(g+"_tab_active").addClass(g+"_float").css("transform","translate3d("+f.x+"px, "+s.y+"px, 0px)"),t.children("."+g+"_container").prepend(s.el),c=setInterval(m,5))}function _(e,a){if(s)if(u=a,Math.abs(a.x)>Math.abs(a.y)){var o=s.x+a.x;s.el.css("transform","translate3d("+o+"px, "+s.y+"px, 0px)")}else{var r=s.y+a.y;if(s.el.css("transform","translate3d("+s.x+"px, "+r+"px, 0px)"),Math.abs(a.y)>4){d.to=l.index(),v();var c=n.list[d.from];"object"==typeof c&&(c=c.label);var f={label:c,index:d.to};i.removeAt(d.to),t.trigger(OGX.Tabs.REMOVE,f)}}}function m(){var e,i,n;s&&u&&(idx=l.index(),Math.abs(u.x)>Math.abs(u.y)&&t.children("."+g+"_container").children("."+g+"_tab").each((function(t,a){(e=$(a)).hasClass(g+"_tab_active")||(i=e.position(),n=e.width(),idx!==t&&(s.x+u.x>i.left+n/2&&s.x+u.xi.left&&s.x+u.xe&&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(h,0),this},this.removeCurrent=function(){return o&&this.removeTabAt(r),this},this.removeAt=function(e){return n.list.delete(e)&&(t.children("."+g+"_container").first().children("."+g+"_tab:eq("+e+")").remove(),o=null,function(){r>0?r--:r=0;i.index(r)}()),this},this.enableTab=function(e){return t.children("."+g+"_container").first().children("."+g+"_tab:eq("+e+")").removeClass(g+"_tab_disabled"),this},this.disableTab=function(e){return t.children("."+g+"_container").first().children("."+g+"_tab:eq("+e+")").addClass(g+"_tab_disabled"),this},this.index=function(e){return void 0!==e?(o&&(o.removeClass(g+"_tab_active"),o=null),(o=t.children("."+g+"_container").first().children("."+g+"_tab:eq("+e+")")).addClass(g+"_tab_active"),r=e,!0):o?r:-1},this.select=function(e){o&&o.removeClass(g+"_tab_active");var t=n.list.findIndex("label",e);return this.index(t.index),this},void 0!==OGX.List?(debug(5,"tabs",n.id,"init"),n||(n={}),OGX.Data.merge(n,a),n.list.hasOwnProperty("insert")||(n.list=new OGX.List(n.list)),n.display.hasOwnProperty("_NAME_")||(n.display=new OGX.Display(n.display)),(t=i.el).addClass(g),n.editable&&t.addClass(g+"_editable"),r=n.index,setTimeout(h,0),n.reorder&&i.touch.hold.set({target:".ogx_tabs_tab",cb_hold:p,cb_move:_,cb_up:v})):debug(1,"OGX.List not found! ")},OGX.Tabs.SELECT="TabsSelect",OGX.Tabs.CLOSE="TabsClose",OGX.Tabs.REORDER="TabsReoroder",OGX.Tabs.ADD="TabsAdded",OGX.Tabs.REMOVE="TabsRemoved",void 0===OGX)var OGX={};if(require("Tags","Uxi","Touch"),OGX.Tags=function(__config){construct(this,"Tags");var that=this,config=__config,config_default={remove:!0,add:!0,name:!1,tags:[],current_tags:[],tags_ascii:[],mode:OGX.Tags.MODE_STRING,keycode:13,placeholder:"keywords",restrict:!1,strict:!1,required:!1,max:0,display_max:0,display_more:!1,click_more:!1,hide_input_on_disable:!0,more_word:"other"},container,input,sliced={org:[],rem:[]};function updateHidden(e){var t;t=1===config.max&&config.current_tags.length?config.current_tags[0]:JSON.stringify(config.current_tags),container.find("input[type=hidden]").val(t),e&&container.find("input[type=hidden]").trigger("change")}function addTag(e){var t=!1;switch(config.mode){case OGX.Tags.MODE_STRING:case OGX.Tags.MODE_ASCII:-1===config.current_tags.indexOf(e)&&(config.current_tags.push(e),t=!0);break;case OGX.Tags.MODE_OBJECT:var i=config.current_tags.find("label",e,1);i||((i=config.tags.find("label",e,1))?config.current_tags.push(i):config.current_tags.push({label:e}),t=!0)}if(t){var n="";!0===config.remove&&(n='');var a=''+e+""+n+"";container.find(".ogx_tags_tags").first().append(a),listenHidden(!1),updateHidden(!0),listenHidden(!0),container.trigger(OGX.Tags.TAG_ADDED,e),container.trigger(OGX.Tags.CHANGE,[config.current_tags])}container.find(".ogx_tags_input").trigger("focus")}function removeTag(e){var t=!1;switch(config.mode){case OGX.Tags.MODE_STRING:case OGX.Tags.MODE_ASCII:var i=config.current_tags.indexOf(e);i>-1&&(t=config.current_tags.splice(i,1));break;case OGX.Tags.MODE_OBJECT:t=config.current_tags.findDelete("label",e)}return t&&container.find(".ogx_tags_tags").first().find(".ogx_tags_tag").each((function(t,i){if($(i).find("span").first().text()===e)return $(i).remove(),listenHidden(!1),updateHidden(!0),void listenHidden(!0)})),t}function displayTags(e,t){if(e){container.find(".ogx_tags_container").length>0&&(displayTags(!1),listenTagAdd(!1));for(var i='
',n=!1,a=0;a";break;case OGX.Tags.MODE_OBJECT:i+=''+t[a].label+""}n&&(i+='+'+n+" "+config.more_word+""),i+="
",container.append(i),listenTagAdd(!0)}else container.find(".ogx_tags_container").remove(),listenTagAdd(!1)}function renderTags(e){for(var t="",i="",n=0;n':"",config.mode){case OGX.Tags.MODE_STRING:case OGX.Tags.MODE_ASCII:t+=''+e[n]+""+i+"";break;case OGX.Tags.MODE_OBJECT:t+=''+e[n].label+""+i+""}return config.current_tags=e,container.find(".ogx_tags_tags").first().html(t),updateHidden(!1),!0}function trimTags(e){return e=OGX.Data.clone(e),sliced={org:OGX.Data.clone(e),rem:[]},Array.isArray(e)&&config.display_max&&e.length>config.display_max&&(sliced.rem=e.slice(config.display_max),e=e.slice(0,config.display_max)),config.display_more&&sliced.rem.length&&e.push({__m__:sliced.rem.length}),new OGX.List(e)}function findTags(e){for(var t,i=[],n=0;n=3)if(!config.strict&&e.which===config.keycode&&config.add)addTag(t),input.val(""),displayTags(!1);else{var i;switch(config.mode){case OGX.Tags.MODE_STRING:i=findTags(t);break;case OGX.Tags.MODE_OBJECT:i=findTagsObj(t);break;case OGX.Tags.MODE_ASCII:i=findTagsAscii(t)}i.length>0?displayTags(!0,i):displayTags(!1)}else displayTags(!1)})):input.off("keyup")}function listenSelect(e){e?container.on(that.touch.down,".ogx_tags_tag",onSelect):container.off(that.touch.down,".ogx_tags_tag",onSelect)}function onSelect(e){var t=$(this).text();switch(config.mode){case OGX.Tags.MODE_OBJECT:t=config.current_tags.get({label:{eq:t}},null,1)}that.el.trigger(OGX.Tags.SELECT,t)}function listenMore(e){e?container.on(that.touch.down,".ogx_tags_more",onMore):container.off(that.touch.down,".ogx_tags_more",onMore)}function onMore(e){e.preventDefault(),e.stopImmediatePropagation(),sliced.rem.length&&($(this).remove(),displayTags(!0,sliced.org))}function listenTagAdd(e){e?container.on(that.touch.down,".ogx_tags_container_tag",onAdd):container.off(that.touch.down,".ogx_tags_container_tag",onAdd)}function onAdd(e){addTag($(this).text()),input.val(""),displayTags(!1),config.max&&config.current_tags.length===config.max&&(listenInput(!1),input.css("display","none"))}function listenTagRemove(e){e?container.on(that.touch.down,".ogx_tags_remove",onRemove):container.off(that.touch.down,".ogx_tags_remove",onRemove)}function onRemove(e){e.preventDefault(),e.stopImmediatePropagation();var t=removeTag($(this).parent("span").first().find("span").first().text());container.trigger(OGX.Tags.TAG_REMOVED,t),container.trigger(OGX.Tags.CHANGE,[config.current_tags]),config.max&&config.current_tags.length'),config.name){var t="";config.required&&(t="required"),e+='"}if(container.html(e),input=container.find(".ogx_tags_input").first(),config.restrict){var i={multiline:!1,max:30};"object"==typeof config.restrict&&(i=config.restrict),i.el=input[0],OGX.Form.restrictField(i)}}function initDefaults(){for(var a in config||(config={}),config_default)config.hasOwnProperty(a)||(config[a]=config_default[a]);config.tags.hasOwnProperty("insert")||(config.tags=new OGX.List(config.tags)),config.current_tags.hasOwnProperty("insert")||(config.current_tags=new OGX.List(config.current_tags)),config.restrict&&("string"==typeof config.restrict.allowed&&(config.restrict.allowed=eval(config.restrict.allowed)),"string"==typeof config.restrict.forbidden&&(config.restrict.forbidden=eval(config.restrict.forbidden))),container=that.el,container.addClass("ogx_tags")}function init(){void 0!==OGX.List?config&&config.restrict&&void 0===OGX.Form?debug(1,"OGX.Form not found! "):(initDefaults(),initInput(),config.current_tags.length>0&&renderTags(config.current_tags)):debug(1,"OGX.List not found! ")}this.enable=function(){if(config.remove&&(listenInput(!0),listenTagAdd(!0),listenTagRemove(!0)),config.display_more&&config.click_more&&listenMore(!0),config.name&&listenHidden(!0),listenSelect(!0),config.add){var e=container.find(".ogx_tags_input").first();e.prop("placeholder",config.placeholder),e.prop("disabled",!1),config.hide_input_on_disable&&e.removeClass("ogx_tags_hidden")}return debug(5,"tags",config.id,"enabled"),this},this.disable=function(){if(config.remove&&(listenInput(!1),listenTagAdd(!1),listenTagRemove(!1)),config.display_more&&config.click_more&&listenMore(!1),config.name&&listenHidden(!1),listenSelect(!1),config.add){var e=container.find(".ogx_tags_input").first();e.prop("placeholder",""),e.prop("disabled",!0),config.hide_input_on_disable&&e.addClass("ogx_tags_hidden")}return debug(5,"tags",config.id,"disabled"),this},this.destroy=function(){config.restrict&&OGX.Form.unrestrictField(container.find(".ogx_tags_input").first()[0])},this.tags=function(e){return void 0!==e?(e.hasOwnProperty("insert")||(e=new OGX.List(e)),config.tags=e,!0):config.tags},this.val=function(e,t){if(displayTags(!1),listenTagAdd(!1),void 0!==e){if(void 0!==t){var i=e,n=config.tags.find(i,t,1);n&&(e=[n])}return e.hasOwnProperty("insert")||(e=new OGX.List(e)),config.current_tags=e,config.max&&config.current_tags.length>=config.max&&container.find(".ogx_tags_input").first().css("display","none"),renderTags(config.current_tags)}return config.current_tags},this.wipe=function(){return config.max&&config.current_tags.length===config.max&&(container.find(".ogx_tags_input").first().css("display","block"),listenInput(!0)),config.current_tags=new OGX.List,container.find(".ogx_tags_tags").first().empty(),container.find("input[type=hidden]").first().val(""),this},this.clear=function(){return debug(2,"Tags clear is deprecated, use wipe"),this.wipe()},this.render=function(e){return renderTags(trimTags(e))},this.add=function(e){return addTag(e)},this.remove=function(e){return removeTag(e)},init()},OGX.Tags.prototype.tagDataset=function(e,t,i){"use strict";void 0===i&&(i=!1);for(var n,a=[],o=0;o-1&&(i.includes(n.items[a][o])||i.push(n.items[a][o]));return e(n.items[a]),!0}}(e));}(e,t)},OGX.Tags.CHANGE="TagsChange",OGX.Tags.SELECT="TagsSelect",OGX.Tags.TAG_ADDED="TagsTagAdded",OGX.Tags.TAG_REMOVED="TagsTagRemoved",OGX.Tags.MODE_STRING="string",OGX.Tags.MODE_OBJECT="object",OGX.Tags.MODE_ASCII="ascii",OGX.Tags.BIND=OGX.Tags.CHANGE,void 0===OGX)var OGX={};if(OGX.Templater=function(){"use strict";var e;this.jmake=function(e,t){for(var i,n,a=JSON.stringify(e);m=/({{(\$|#)[a-z0-9_\.]*}})|("{{(\$)}}")/gi.exec(a);)m[0].match(/"{{(\$)}}"/)?(i="<-"+(i=JSON.stringify(t)).substring(1).slice(0,-1)+"->",a=(a=(a=a.replace(m[0],i)).replace(/<\-/,"{")).replace(/\->/,"}")):("object"==typeof(n=OGX.OSE.exec(m[0],t))&&(n=JSON.stringify(n),m[0]='"'+m[0]+'"'),a=a.replace(m[0],n));return JSON.parse(a)},this.make=function(t,i,n,a,o){var r,s;for(e={},void 0===o&&(o={}),OGX.Data.merge(e,o),debug(5,"Templatizing",t);r=/{{[^{]+(({[^{]+)+)?}}/gi.exec(t);)void 0===(s=OGX.OSE.exec(r[0],i,n,a,e))&&(s=""),t=t.replace(r[0],s);return debug(5,"Templatized",t),t},this.get=function(e){var t=OGX.Cache.read("html",e);return t||(debug(1,"Template",e,"not found"),!1)}},OGX.Templater=new OGX.Templater,require("Theater","Uxi","Touch"),OGX.Theater=function(e){construct(this,"Theater");var t,i,n,a=this,o=e,r={anim:!1,display:!0,icon_size:50,timeout:30},s={template:!1,html:'{{$label}}'},l='
',d=!0;function c(e){e?($(document).on("backbutton",u),$(window).on("popstate",u),list.el.on(OGX.DynamicList.SELECT,(function(e,t){!function(e){debug(3,"theater show stage",e),a.el.trigger(OGX.Theater.HIDE);var t=app.find("Stage",e);t.wake(),t.resizeNodes();var n,r=list.el.find('.ogx_theater_stage[data-ogx-id="'+t.id+'"]').position();a.observe(!0,{childList:!0},(function(){a.observe(!1),(n=i.children(".ogx_theater_trans")).on("transitionend",(function(){n.off("transitionend"),a.hide(),n.remove(),t.url?(app.showStage(t.id,!1),app.router.addToHist(t.url)):app.goto(t.id+"/"+t.home)})),n.removeClass("ogx_theater_trans_hide"),setTimeout((function(){n.addClass("ogx_theater_trans_grow").css({opacity:1,width:"100%",height:"100%",transform:"translate3d(0px, 0px, 0px)"})}),o.timeout)}),null,i),i.append('
")}(t.id)}))):($(document).off("backbutton",u),$(window).off("popstate",u),list.el.off(OGX.DynamicList.SELECT))}function u(){a.hide()}function f(){t.prepend(l);for(var e,i=[],r=0;r .list").on(OGX.DynamicList.RENDER,(function(e){$(".ogx_theater > .list").off(OGX.DynamicList.RENDER),setTimeout((function(){l=$(".ogx_theater").detach()}),0)})),list=a.create("DynamicList",{el:".ogx_theater > .list",display:{html:o.display.html,css:"ogx_theater_stage"},key:"id",scroll:!0,mode:"hit",list:i,trigger:!0})}function g(){var e=app.gather(OGX.Stage.NAME);n=[];for(var t=0;t
"),t.css("visibility","visible")}(),this.focusNodes(),c(!0),d=!1),this},this.hide=function(){return d||(debug(3,"hide theater"),this.blurNodes(),l=t.detach(),c(!1),d=!0),this},this.tile=function(e,t){void 0===t&&(t="x")},void 0!==OGX.DynamicList?(OGX.Data.merge(o,r),o.display&&("object"!=typeof o.display&&(o.display={}),OGX.Data.merge(o.display,s),o.display.template&&(o.display.html=OGX.Templater.get(o.display.template))),(t=a.el).addClass("ogx_theater").css("visibility","hidden"),i=$("body"),"undefined"!=typeof app?(g(),$(document).on(OGX.App.READY,f),debug(5,"theater init")):debug(1,"No instance of OGX.App!")):debug(1,"OGX.DynamicList not found! ")},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,a){var o=new OGX.Touches[e](t),r=o.set(a);return!r.hasOwnProperty("id")&&(r.id=i++),o.id=r.id,"auto"===r.status&&!t.blured&&t.enabled&&o.enable(),n.insert(o),o},this.touch.remove=function(e){"object"==typeof e&&(e=e.id),n.findDelete("id",__id,1).disable()},this.touch.get=function(e){return n.get({id:{eq:e}},null,1)},this.touch.wipe=function(){for(var e=0;eo.x?1:-1,l=r.y>o.y?1:-1,d=Math.abs(r.x-o.x),c=Math.abs(r.y-o.y),u=Math.sqrt(Math.abs(Math.pow(r.x-o.x,2)-Math.pow(r.y-o.y,2)))}function O(){a.cb_swipe&&(a.x&&a.min_x&&d>=a.min_x||a.y&&a.min_y&&c>=a.min_y?y(0,!0):a.cb_swipe({pt0:o,pt1:r,dirX:s,dirY:l,distX:d,distY:c,dist:u}))}this.set=function(e){return a=e,OGX.Data.merge(a,n),t=i.selector,this.state=a.state,"auto"===a.state&&(i.enable,i.disable),a.target&&(t=a.target),a},this.enable=function(){!g&&a&&(g=!0,v(!0))},this.disable=function(){g&&(g=!1,v(!1),_(!1))}},OGX.Touches.Hold=function(e){"use strict";var t={cb_hold:!1,cb_up:!1,cb_move:!1,time:1e3,el:this.el,target:!1,capture:!1,state:"auto"},i=!1,n=!1,a=!1,o=!1,r=!1,s=!1,l=e,d={x:0,y:0},c={x:0,y:0},u={x:0,y:0},f={x:0,y:0},g=null;function h(e){var t=[];t=i.target?[l.touch.down,i.target,p]:[l.touch.down,p],e?l.el.on.apply(l.el,t):l.el.off.apply(l.el,t)}function p(e){e=l.event(e),g=e.currentTarget,o||(o=!0,n=(new Date).getTime(),f.x=d.x=e.pageX,f.y=d.y=e.pageY,a=setInterval(m,1))}function _(e){i.capture&&(e.preventDefault(),e.stopImmediatePropagation()),e=l.event(e),c.x=e.pageX,c.y=e.pageY,c.x5||Math.abs(d.y-c.y)>5)&&(clearInterval(a),a=!1)}function m(){o&&(new Date).getTime()-n>i.time&&(r||(r=!0,$("body").on(l.touch.move,_),i.cb_hold?i.cb_hold(g,d):l.el.trigger(OGX.Touch.HOLD_START)))}function v(t){t=e.event(t),o=!1,clearInterval(a),a=!1,r&&(r=!1,$("body").off(l.touch.move,_),i.cb_up?i.cb_up({x:t.pageX,y:t.pageY}):l.el.trigger(OGX.Touch.HOLD_END,{x:t.pageX,y:t.pageY}))}this.set=function(e){return i=e,OGX.Data.merge(i,t),l.selector,this.state=i.state,"auto"===i.state&&(l.enable,l.disable),i.target&&i.target,i},this.enable=function(){!s&&i&&(s=!0,h(!0),$("body").on(l.touch.up,v))},this.disable=function(){s&&(s=!1,(o||a)&&(r=!1,o=!1,clearInterval(a),a=!1),h(!1),$("body").off(l.touch.up,v),$("body").off(l.touch.move,_))}},OGX.Touches.Drag=function(e){"use strict";var t,i,n,a,o,r,s=!1,l={min:10,limit_x:null,limit_y:null,target:!1,cb_down:!1,cb_drag:!1,cb_up:!1,border:10,capture:!1,state:"auto"},d=e,c=!1,u=!1;function f(e){var t=[];t=s.target?[d.touch.down,s.target,g]:[d.touch.down,g],e?d.el.on.apply(d.el,t):d.el.off.apply(d.el,t)}function g(l){s.capture&&(l.preventDefault(),l.stopImmediatePropagation()),l=e.event(l),n=l.pageX,a=l.pageY;var c=d.el.position();t=c.left,i=c.top;var u=d.el.offset(),f=n-u.left,g=a-u.top;if(s.border){if(fd.el.width()-s.border)return;if(gd.el.height()-s.border)return}o=0,r=0,h(!0),p(!0),s.cb_down&&s.cb_down()}function h(e){e?c||(c=setInterval(v,10)):c&&(clearInterval(c),c=null)}function p(e){e?($("body").on(d.touch.move,m),$("body").on(d.touch.up,_)):($("body").off(d.touch.move,m),$("body").off(d.touch.up,_))}function _(t){h(!1),p(!1),t=e.event(t),s.x&&(o=t.pageX-n),s.y&&(r=t.pageY-a),s.cb_up&&s.cb_up({distX:o,distY:r})}function m(t){s.capture&&(t.preventDefault(),t.stopImmediatePropagation()),t=e.event(t);var i,l=!1;s.x&&(i=t.pageX-n,null!==s.limit_x?i>=s.limit_x.min&&i<=s.limit_x.max&&(s.min?Math.abs(i)>s.min&&(o=i,l=!0):(o=i,l=!0)):s.min?Math.abs(i)>s.min&&(o=i,l=!0):o=i),s.y&&(i=t.pageY-a,null!==s.limit_y?i>=s.limit_y.min&&i<=s.limit_y.max&&(s.min?Math.abs(i)>s.min&&(r=i,l=!0):(r=i,l=!0)):r=i),l&&s.cb_drag&&s.cb_drag({distX:o,distY:r,x:t.pageX,y:t.pageY})}function v(){d.el.css({transform:"translate3d("+(t+o)+"px, "+(i+r)+"px, 0px)"})}this.dragable=!0,this.set=function(e){return s=e,OGX.Data.merge(s,l),"auto"===s.state&&(d.enable,d.disable,this.enable()),this.state=s.state,s},this.enable=function(){!u&&s&&(u=!0,f(!0))},this.disable=function(){u&&(u=!1,f(!1),p(!1),h(!1))}},OGX.Touches.Move=function(e){"use strict";var t,i,n,a,o,r,s,l,d=!1,c={min:0,limit_x:null,limit_y:null,target:null,cb_down:null,cb_move:null,cb_up:null,cb_click:null,capture:!1,state:"auto"},u=e,f=!1;function g(e){var t=[];t=d.target?[u.touch.down,d.target,h]:[u.touch.down,h],e?u.el.on.apply(u.el,t):u.el.off.apply(u.el,t)}function h(c){d.capture&&(c.preventDefault(),c.stopImmediatePropagation()),c=e.event(c),t=c.pageX,i=c.pageY,n=0,a=0,o=0,r=0,s=0,l=0,p(!0),d.cb_down&&d.cb_down(c)}function p(e){e?($("body").on(u.touch.move,m),$("body").on(u.touch.up,_)):($("body").off(u.touch.move,m),$("body").off(u.touch.up,_))}function _(s){if(p(!1),s=e.event(s),d.x&&(n=s.pageX-t),d.y&&(a=s.pageY-i),d.cb_up&&d.cb_up({x:s.pageX,y:s.pageY,distX:n,distY:a,dirX:o,dirY:r}),d.cb_click){var l=!1;d.x&&Math.abs(n)<2&&(l=!0),d.y&&Math.abs(a)<2&&(l=!0),l&&d.cb_click(s)}}function m(c){d.capture&&(c.preventDefault(),c.stopImmediatePropagation()),c=e.event(c);var u,f=!1;d.x&&(o=0,sc.pageX&&(o=-1),s=c.pageX,u=c.pageX-t,null!==d.limit_x?u>=d.limit_x.min&&u<=d.limit_x.max&&(d.min?Math.abs(u)>d.min&&(n=u,f=!0):(n=u,f=!0)):d.min?Math.abs(u)>d.min&&(n=u,f=!0):(n=u,f=!0)),d.y&&(r=0,lc.pageY&&(r=-1),l=c.pageY,u=c.pageY-i,null!==d.limit_y?u>=d.limit_y.min&&u<=d.limit_y.max&&(d.min?Math.abs(u)>d.min&&(a=u,f=!0):(a=u,f=!0)):(a=u,f=!0)),f&&d.cb_move&&d.cb_move({distX:n,distY:a,dirX:o,dirY:r,x:c.pageX,y:c.pageY})}this.set=function(e){return d=e,OGX.Data.merge(d,c),"auto"===d.state&&(u.enable,u.disable,this.enable()),this.state=d.state,d},this.enable=function(){!f&&d&&(f=!0,g(!0))},this.disable=function(){f&&(f=!1,g(!1),p(!1))}},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,a,o,r,s,l,d,c=this,u='{{$label}}',f=e,g={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:u},icons:{open:"folder_open",close:"folder_closed",empty:null}},file:{mode:"file",display:{html:u},icon:"file"},folder:{mode:"folder",display:{html:u},icons:{open:"folder_open",close:"folder_closed",empty:null}}},data:{id:0,type:"root",state:"closed",data:{label:null,icon:null},items:[]},display:null},h="_id";function p(e,t){var i={_id:t._id,container_display:"",container_css:"",arrow_display:"",arrow_style:"ogx_tree_item_arrow_open",state:"open"};return OGX.Data.merge(i,e,!0),OGX.Templater.make('
',i)}function _(){var e=p({},{_id:"root",type:"root",label:f.root_label});t.html(e),f.data.element=t.children(".ogx_tree_item").first(),f.data.uxi=c,f.show_root||f.data.element.addClass("ogx_tree_root_hidden")}function m(){_(),v(f.data,c)}function v(e,t){if(e.parent=t,e.hasOwnProperty("items")){var i,n;!e.items.hasOwnProperty("insert")&&(e.items=new OGX.List(e.items)),f.sort.enabled&&e.items.order(f.sort.property,f.sort.way);for(var a=0;a .ogx_tree_item_content';if(i.display.hasOML()){var a=i.display.oml(n,e,!1);OGX.OML.render(t,a,e),e.uxi=t.nodes.last()}else{var o=i.display.html(e);o=OGX.Templater.make(o,e),$(n).html(o)}}function O(e){var t={};return OGX.Data.merge(t,e),delete t.element,delete t.parent,d||delete t[h],t}function b(e){"folder"===S(e).mode&&(e.items.length||(e.element.data("state","close"),e.element.children(".ogx_tree_item_arrow").addClass("ogx_tree_item_arrow_disabled")),"open"===e.element.data("state")?(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").css("display","block")):(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").css("display","none")))}function w(){if(s){var e=E(s);e&&(e.children(".ogx_tree_item_icon").removeClass("ogx_tree_selected_item"),s=null)}}function G(e){var t=E(e);t&&(s=e,t.children(".ogx_tree_item_icon").addClass("ogx_tree_selected_item"))}function X(e,t){return C((function(i){return i[h]===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",b(i),!0)}))}function T(e){return C((function(t,i){return t[h]===e&&t}))}function E(e){var t=T(e);return!!t&&t.element}function D(){l=1,C((function(e){return e[h]=l++,e.hasOwnProperty("type")||(e.hasOwnProperty("items")?e.type="folder":e.type="file"),!1}))}function C(e,t){var i;if(void 0===t&&(t=f.data),i=function t(n,a,o,r){if(i=e(n,a,o,r))return i;if(n.hasOwnProperty("items")&&n.items.length)for(var s=0;s .ogx_tree_item_content",(function(e){e.preventDefault(),L($(this).parent(0)),1!==$(this).parent(0).data("id")&&function(){o&&clearInterval(o);r=(new Date).getTime(),o=setInterval(M,50)}()})),$(document).on(c.touch.up,(function(){I(),n&&(N(!1),function(){var e=n.offset().left,o=n.offset().top,r=(l=e,d=o,C((function(e,t){return c=e.element.offset(),u=e.element.children(".ogx_tree_item_icon"),l>=c.left&&l<=c.left+u.width()&&d>=c.top&&d<=c.top+u.height()&&e}))),s=S(r);var l,d,c,u;!r||r&&(r[h]===i[h]||"folder"!==s.mode)?(a.css("opacity",1),n.remove(),n=null,i=null):(g=r,function(e){C((function(t,i,n,a){return t[h]===e&&(n.items.splice(a,1),n.items.length||(n.state="close"),b(n),!0)}))}((f=i)[h]),X(f,g[h]),g.element.children(".ogx_tree_item_container").empty(),g.state="open",v(g,g.element),b(g),a.remove(),n.remove(),n=null,t.trigger(OGX.Tree.DROP,i),i=null);var f,g}())}))):t.on("click",".ogx_tree_item > .ogx_tree_item_content",(function(e){L($(this).parent(0))})),t.on(c.touch.down,".ogx_tree_item_arrow",(function(e){e.preventDefault(),I();var i=$(this).parent(0),n=i.data("state"),a=T(i.data("id"));a.hasOwnProperty("items")&&a.items.length&&("open"===n?(i.data("state","close"),t.trigger(OGX.Tree.CLOSE,a)):(i.data("state","open"),t.trigger(OGX.Tree.OPEN,a)),b(a))}))):(f.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 M(){var e;(new Date).getTime()-r>=f.drag_after&&(s&&(i=T(s))&&(e=i.element,a=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),N(!0),t.trigger(OGX.Tree.DRAG,i)),I())}function N(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 I(){o&&(clearInterval(o),o=null)}this.enable=function(){return k(!0),debug(5,"tree",f.id,"enabled"),this},this.disable=function(){return k(!1),debug(5,"tree",f.id,"disabled"),this},this.addItem=function(e,t){if(void 0===t&&(t=s),t){var i=T(t);if("folder"===S(i).mode){d||(e[h]=++l),X(e,t);var n=S(e);y(i.uxi,i.element.children(".ogx_tree_item_container").first(),e),x(e,i.parent);var a=i.uxi;return n.display.hasOML()&&(a=i.uxi.nodes.last()),v(e,a),i.element.data("state","open"),i.element.children(".ogx_tree_item_container").css("display","block"),i.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_disabled ogx_tree_item_arrow_close").addClass("ogx_tree_item_arrow_open"),!0}}return!1},this.getItem=function(e){var t=T(e);return!!t&&O(t)},this.selectItem=function(e){G(e)},this.selectItemByPropVal=function(e,t){var i=function(e,t){function i(i,n){return!(!i.data.hasOwnProperty(e)||i.data[e]!==t)&&n+"/"+i.label}return C(i)}(e,t);return!!i&&(w(),G(i[h]),!0)},this.selectItemByPath=function(e){var t=function(e){var t=function(e){function t(t,i){return e===i+"/"+t.label&&t}return C(t)}(e);if(t)return t.element;return!1}(e);return!!t&&(w(),t.addClass("ogx_tree_selected_item"),s=t.data("id"),!0)},this.updateItem=function(e,t){var i=T(e);if(i){if(i.uxi){var n=i.uxi.el;i.uxi.kill(),n.empty()}OGX.Data.merge(i,t,!0),x(i,i.parent),i.hasOwnProperty("items")&&i.items.length&&(v(i,i.parent),i.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_disabled ogx_tree_item_arrow_close").addClass("ogx_tree_item_arrow_open"),i.element.data("state","open"))}},this.replaceItem=function(e){var t=T(e[h]);t&&(t.uxi&&t.uxi.kill(),OGX.Data.merge(e,t,!1),x(t,t.parent),t.hasOwnProperty("items")&&t.items.length&&v(t,t.parent))},this.deleteItem=function(e){var t=T(e);if(t){var i=function(e){function t(t){return!(!t.hasOwnProperty("items")||!t.items.get({_id:{eq:e}},null,1))&&t}return C(t)}(e);t.uxi&&t.uxi.kill(),i.items.findDelete("_id",e,1),t.element.remove()}},this.deleteSelectedItem=function(){return function(){function e(e,t,i,n){if(e[h]===s)return e.element.remove(),i.items.splice(n,1),b(i),!0}if(s)return C(e);return!1}()},this.getSelectedItem=function(){return function(){if(s)return T(s);return!1}()},this.getTree=function(){var e=C(O,JSON.parse(JSON.stringify(f.data)));if(e)return e},this.setData=function(e){e.hasOwnProperty("types")&&this.setTypes(e.types),e.hasOwnProperty("tree")&&this.setTree(e.tree)},this.setTypes=function(e){f.types=e},this.setTree=function(e){this.clear(),f.data=e,f.data.hasOwnProperty("state")||(f.data.state="open"),d||D(),m()},this.newTree=function(){c.clear(),l=1,_()},this.filterTree=function(e){!function(e){var t=[];function i(n,a,o,r){if(-1!==(a+n.label).indexOf(e)&&t.push(a+"/"+n.label),n.hasOwnProperty("items")&&n.items.length)for(var s=0;s .ogx_scroller_inner',(i=$(e.el)).addClass(n).attr("data-ogx-id",this.id),t&&i.attr("id",this.id);var o=this;setTimeout((function(){o.scroller.resize()}),0)}else i.append(a),e.el='.ogx_uxi[data-ogx-id="'+this.id+'"]';this.el=$(e.el)}},OGX.Uxi.prototype.enable=function(){return this},OGX.Uxi.prototype.disable=function(){return this},OGX.Uxi.prototype.ux=function(){},OGX.Uxi.prototype.construct=function(){},OGX.Uxi.prototype.destroy=function(){},OGX.Uxi.prototype.resize=function(){return this},OGX.Uxi.prototype.show=function(){return this.el&&this.el.removeClass("ogx_uxi_hide"),this},OGX.Uxi.prototype.hide=function(){return this.el&&this.el.addClass("ogx_uxi_hide"),this},OGX.Uxi.prototype.render=function(e,t){return debug(2,"Uxi.render has been deprecated, use OGX.OML.render instead"),OGX.OML.render(this,e,t),this},OGX.Uxi.prototype.empty=function(){return this.clear(),this},OGX.Uxi.prototype.observe=function(e,t,i,n,a){var o=this,r=this.el,s=null;if(void 0!==a&&(r=a),e){if(!this.observer)return void 0!==t&&t||(t={childList:!0,subtree:!0}),this.observer=new MutationObserver((function(e,t){e.forEach((function(e){s&&clearTimeout(s),s=setTimeout((()=>{void 0!==i?i(e,n):o.el.trigger(OGX.View.CHANGED,e)}),10)}))})),this.observer.observe(r[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){var a=this;this.observe(!0,e,(function(){a.observe(!1),void 0!==t&&t(i)}),null,n)},OGX.Uxi.prototype.sleep=function(){return this.sleeping||(this.blur(2),this.sleeping=!0,this.scroll?(this.__parent=this.el.parent(".ogx_scroller_outer").first().parent(0),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+'"]'),this.focus(2),delete this.__parent),this},OGX.Uxi.prototype.detach=function(){return this.sleep(),this.parent.nodes.findDelete("id",this.id,1),this},OGX.Uxi.prototype.attach=function(e,t){return this.parent=e,this.parent.nodes.insert(this),this.wake(t),setTimeout((()=>this.resizeNodes),0),this},OGX.Uxi.prototype.resizeNodes=function(){for(var e=this.gather(),t=0;t0&&"Carousel"===t[i]._NAME_&&"Container"===t[i-1]._NAME_||(t[i].floating?t[i].show(e):t[i].show(this._NAME_,this.id));return this}},OGX.Uxi.prototype.focus=function(e){if(void 0===e&&(e=1),this.blured)switch(this.blured=!1,this.enabled&&(this.ux(!0),this.enable()),e){case 1:this.focusNodes();break;case 2:this.focusTree()}return this},OGX.Uxi.prototype.focusTree=function(){for(var e=this.gather(),t=0;tt&&(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)},require("View","Uxi","Placeholder","Touch"),OGX.View=function(e){construct(this,"View");var t=this,i=!1,n=e;this.enable=function(){return n.observe&&this.observe(!0),this},this.disable=function(){return n.observe&&this.observe(!1),this},this.container=function(){return i},this.render=function(e){return void 0===e?n.hasOwnProperty("html")&&n.html&&i.html(n.html):i.html(e),i.trigger(OGX.View.RENDER),this},function(){i=t.el;var a=new OGX.Display(e);n.html=a.html(e.data),i.addClass("ogx_view ogx_hw"),t.render()}()},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:'
$INNER
{{$html}}
',win_inner:['','{{$title}}','$ICONS'],zindex:!1,close_on_click_out:!1,close_dist:100,parent:null},config=__config,pt={x:null,y:null},dir={x:0,y:0},showto=50,user_resized=!1,zd;function genIcons(){for(var e="",t=0;t";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:config.parent.topIndex();var t=getLimitedSize();container.css({width:t.width,height:t.height,"z-index":zd})}function getLimitedSize(){var e,t,i,n=config.parent.el.width(),a=config.parent.el.height();user_resized?(n=config.width,a=config.height):(e=OGX.Data.getBestSize(n,config.width),t=OGX.Data.getBestSize(a,config.height));var o={width:e,height:t};return(config.min_width||config.max_width)&&(-1!==config.width.indexOf("%")?(n=config.parent.el.width(),i=Number(config.width.split("%")[0])*n/100,config.min_width&&iconfig.max_width&&(o.width=config.max_width+"px")):(-1!==(i=config.width).indexOf("px")&&(i=Number(i.split("px")[0])),config.min_width&&iconfig.max_width&&(o.width=config.max_width+"px"))),(config.min_height||config.max_height)&&(-1!==config.height.indexOf("%")?(a=config.parent.el.height(),i=Number(config.height.split("%")[0])*a/100,config.min_height&&iconfig.max_height&&(o.height=config.max_height+"px")):(-1!==(i=config.height).indexOf("px")&&(i=Number(i.split("px")[0])),config.min_height&&iconfig.max_height&&(o.height=config.max_height+"px"))),o}function listenBody(e){e?that.parent.el.on(that.touch.down,".ogx_overlay",onBody):that.parent.el.off(that.touch.down,".ogx_overlay",onBody)}function onBody(e){that.status===OGX.Window.OPEN&&(that.hide(),that.parent.removeOverlay(OGX.Overlay.Fade))}function animWindow(e,t,i,n){void 0===t&&(t=config.anim);var a={opac:1,tX:0,tY:0},o=container.parent().width(),r=container.parent().height(),s=that.el.outerWidth(),l=that.el.outerHeight(),d=that.el.find(".ogx_window_main_icon").first();switch(e&&(placeWindow(!0),d.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?(a.tY=0,d.addClass("ogx_window_main_icon_top")):a.tY=-l-10;break;case OGX.Window.ANIM_BOTTOM:e?(a.tY=0,d.addClass("ogx_window_main_icon_bottom")):a.tY=r+10;break;case OGX.Window.ANIM_RIGHT:e?(a.tX=o-s,d.addClass("ogx_window_main_icon_right")):a.tX=o+10;break;case OGX.Window.ANIM_LEFT:e?(a.tX=0,d.addClass("ogx_window_main_icon_left")):a.tX=-s-10}var c=100;e?(pt.x=a.tX,pt.y=a.tY):c=0,setTimeout((function(){dir.x,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("+a.tX+"px, "+a.tY+"px, 0px)",opacity:a.opac,visibility:"visible"})}),c)}function placeWindow(e){var t=container.parent().width(),i=container.parent().height(),n=that.el.outerHeight(),a=that.el.outerWidth();that.el.removeClass("ogx_window_anim_in").removeClass("ogx_window_anim_out");var o={x:0,y:0};switch(config.anim){case OGX.Window.ANIM_TOP:o.y=e?-n:n,dir.y=-1;break;case OGX.Window.ANIM_BOTTOM:o.y=e?i:i-n,dir.y=1;break;case OGX.Window.ANIM_RIGHT:o.x=e?t:t-a,dir.x=1;break;case OGX.Window.ANIM_LEFT:e&&(o.x=-a),dir.x=-1}that.el.css({transform:"translate3d("+o.x+"px, "+o.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(/>,<"),i=i.replace("$INNER",n);var a="";return config.icons&&config.icons.length&&(a=genIcons()),i=i.replace("$ICONS",a),OGX.Templater.make(i,t)}function onResize(){user_resized=!0,that.resizeNodes()}function listenScroll(e){e?(that.el.on(OGX.Scroller.START,(function(){that.disable()})),that.el.on(OGX.Scroller.END,(function(){that.enable()}))):(that.el.off(OGX.Scroller.START),that.el.off(OGX.Scroller.END))}function initPlaceholders(){that.placeholders(config,['.ogx_window[data-ogx-id="'+that.id+'"] > .ogx_window_body'])}function initDefaults(){OGX.Data.merge(config,app.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(){if(initDefaults(),render(),initPlaceholders(),placeWindow(!0),config.drag){var e={},t={top:!1,bottom:!1,left:!1,right:!1,cb_resize:onResize};switch(t.min_width=config.min_width,t.min_height=config.min_width,t.max_width=config.max_width,t.max_height=config.max_height,e.cb_drag=onDrag,e.cb_up=onRelease,config.anim){case OGX.Window.ANIM_LEFT:e.x=!0,e.y=!1,e.limit_x={min:-300,max:0},t.right=!0;break;case OGX.Window.ANIM_RIGHT:e.x=!0,e.y=!1,e.limit_x={min:0,max:300},t.left=!0;break;case OGX.Window.ANIM_TOP:e.x=!1,e.y=!0,e.limit_y={min:-300,max:0},t.bottom=!0;break;case OGX.Window.ANIM_BOTTOM:e.x=!1,e.y=!0,e.limit_y={min:0,max:300},t.top=!0}that.touch.drag=that.touch.add("Drag",e)}config.resize&&that.setResize(t),config.show&&that.show(),listenScroll(!0),debug(5,"window",config.id,"init")}this.id=config.id,this.dragable=null,this.resizeable=null,this.status=OGX.Window.CLOSED,this.enable=function(){return config.close_on_click_out&&listenBody(!0),config.head&&listenBackIcon(!0),config.icons&&listenIcons(!0),config.drag,config.resize&&this.enableResize(),debug(5,"window",config.id,"enabled"),this},this.disable=function(){return config.close_on_click_out&&listenBody(!1),config.head&&listenBackIcon(!1),config.icons&&listenIcons(!1),config.drag,config.resize&&this.disableResize(),debug(5,"window",config.id,"disabled"),this},this.show=function(e,t,i){return config.drag,config.resize&&this.enableResize(),listenScroll(!0),-1===[OGX.Window.OPEN,OGX.Window.OPENING].indexOf(this.status)&&(this.focus(1),this.front(),null==e&&(e=config.anim),setTimeout((function(){animWindow(!0,e,t,i)}),showto),showto&&(showto=0)),this},this.hide=function(e,t,i){return config.drag,config.resize&&this.disableResize(),listenScroll(!1),-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.resize=function(){var e=getLimitedSize();return container.css({width:e.width,height:e.height}),this.place(),this},this.destroy=function(){config.drag,listenScroll(!1)},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=config.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):config.drag&&(config.drag=this.dragable=!1)},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; \ No newline at end of file diff --git a/www/js/lib/globules/ogx.min.js b/www/js/lib/globules/ogx.min.js index ff98fc1e..1e1ec58d 100644 --- a/www/js/lib/globules/ogx.min.js +++ b/www/js/lib/globules/ogx.min.js @@ -1,2 +1,2 @@ -/* globules.io OGX.JS 1.19.1.5 */ -window.console||(window.console={});for(var methods=["log","debug","warn","info"],i=0;i1&&o[1].meval("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}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((function(){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;i0&&__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;i0&&__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;i0&&__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;i0&&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;r1&&(e=arguments.join("|")),!!indexes.hasOwnProperty(e)&&(delete indexes[e],!0)},array.deleteProperty=function(t){for(var e=0,r=0;r1?indexes[i][a].splice(0,r):indexes[i][a][0]:indexes[i][a])},array.clear=function(){indexes=!1,filterCount=0,this.length=0},array.unique=function(t,e,r){void 0===e&&(e=!0),void 0===r?r=[t]:Array.isArray(r)||(r=[r]);for(var i,a=this.get(),s=[],n=new OGX.List,o=0;o=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()o||this.filters[a][j][b][1]=i)){var l=!1;for(var u in d)-1!==u.indexOf(":OSE")?(d[o=u.split(":").shift()]=OGX.OSE.exec(d[u],t,a,n,s),delete d[u],l||(l=!0,r++),e(d[o])):-1!==u.indexOf(":")||"object"!=typeof d[u]||Array.isArray(d[u])||d[u]instanceof HTMLElement||d[u]instanceof jQuery||(l||(l=!0,r++),e(d[u]))}}(e),e}function O(e,t){switch(e){case"scope":return OGX.Scope.fork(t);default:return OGX.OSE.fork(e,t)}}this.get=function(e){return OGX.Cache.read("oml",e)},this.make=function(e,t,n){var i={};return i[e+":"+t]=n,i},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 i(e,t,n){var i={};for(var o in e)i[o.replace(t,n)]=e[o];return i}void 0===n&&(n="default"),Array.isArray(n)||(n=[n],t=[t]);for(var o=0;o0&&(v=v.substr(0,v.indexOf(".")-1)),y=e[G],_=!0,w=!0,L=!1,W=!1,v){case"Function":return w=!1,_=!0,y.parent=t,y.fnc=c,y=g(y,n,i),void OGX.Fonction(y,n,i);case"Uxi":return void e[G].attach(t,c);case"Fork":(A=O(c,e[G]))&&d(A,t),w=!1,_=!1;break;case"Html":y.el=c,y.html=e[G].html,(w=f(y))||(y.template=!1);break;case"Template":y.template=m.split(".")[1],y.el=c,m="Html",w=f(y);break;case"Ghost":y.el=c;break;case"Controller":y.id=c,W=!0;break;default:-1!==[".","#"].indexOf(c.substr(0,1))?y.el=c:(y.id=c,y.el=t.el[0],y.parent=t)}_&&(y=g(y,n,i)),b=!1,X=!1,w?(r&&(M=r.find("id",y.id.replace(/^#/gi,""),1))&&(X=!0),X?(M.wake(y.el),x=M):x=OGX.Object.create(m,y),t.add(x),b=x):L?(L.blur(),$(c).html(S),L.el=$(c),t.add(L),setTimeout((function(){t.blured||L.focus()}),0)):(b=t,"Html"===m&&OGX.HtmlRender(y)),b&&e[G].hasOwnProperty("node:OML")&&!L&&!X&&(e[G]=p(e,e[G]),d(e[G]["node:OML"],b)),w&&(x.parent=t,"function"==typeof x.construct&&(X||(W?s.push({object:x,data:[n,i]}):x.construct.apply(x,[n,i])))),x&&!W&&(w||X)&&(t.blured||x.floating||x.focus()),void 0!==x&&x&&!W&&(a=a.concat(u(x,e[G])))}}}d(t,e),a.length&&function(e){for(var t=0;t'+r.display_date.format(e)+""),r.date&&(t+=''+r.date.format(r.format)+""),r.browse&&(t+=''),i.children(".ogx_calendar_head").children(".ogx_calendar_head_date").html(t)}function b(e){i.children(".ogx_calendar_head").children(".ogx_calendar_head_labels").html(e)}function w(e,t,i,n){if(t.y-1>=0&&t.y-1
'),T(),G(),t=o.create("GridSwiper",{el:r.el+" .ogx_calendar_body",loop:!0,map:n,start:{x:1,y:a+1},chromeos:r.chromeos,enabled:r.swipe}),O(),b(l[a].labels(r.display_date)),o.enable()},OGX.Calendar.SELECT="CalendarSelect",OGX.Calendar.UNSELECT="CalendarUnselect",OGX.Calendar.BIND=OGX.Calendar.SELECT+" "+OGX.Calendar.UNSELECT,OGX.Calendar.BROWSE="CalendarBrowse",OGX.CalendarLayout={},OGX.CalendarLayout.BASE_LAYOUT=function(){"use strict";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"YYYY-MM"}},OGX.CalendarLayout.MONTH_DAYS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(){for(var e="",t=function(){for(var e=new Date(Date.UTC(2017,0,2)),t=[],i=0;i<7;i++)t.push(e.toLocaleDateString(navigator.language,{weekday:"short"})),e.setDate(e.getDate()+1);return t}(),i=0;i'+t[i]+"";return e},this.html=function(e,t,i,n){var a,o=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<42;u++)c="",a=s.format("YYYY-MM-DD"),s.format("MM")!==o&&(c+="ogx_calendar_layout_month_days_offset "),a===moment().format("YYYY-MM-DD")&&(c+="ogx_calendar_layout_month_days_today "),n&&l===a&&(c+="ogx_calendar_selected_item "),d+='
'+t(a,i)+"
",s.add(1,"days");return d},this.value=function(){return{value:1,unit:"months"}},this.format=function(){return"YYYY-MM"}},OGX.CalendarLayout.CENTURY_DECADES=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return''+100*Math.floor(Number(e.format("YYYY"))/100)+"'s"},this.html=function(e,t,i,n){var a,o,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++)o="",s+l===c+(a=10*f)&&(o="ogx_calendar_layout_century_decades_current "),d+u===c+a&&(o+="ogx_calendar_selected_item "),h+='
'+t(c+a,i)+"
";return h},this.value=function(){return{value:100,unit:"years"}},this.format=function(){return"YYYY"}},OGX.CalendarLayout.CENTURY_YEARS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return''+100*Math.floor(Number(e.format("YYYY"))/100)+"'s"},this.html=function(e,t,i,n){var a,o=moment(),r=100*Math.floor(Number(o.format("YYYY"))/100),s=Number(o.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++)a="",l+h===r+s&&(a+="ogx_calendar_layout_century_years_current "),l+h===c+d&&(a+="ogx_calendar_selected_item"),u+='
'+t(l+h+"-01-01",i)+"
";return u},this.value=function(){return{value:100,unit:"years"}},this.format=function(){return"Y"}},OGX.CalendarLayout.DECADE_YEARS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return''+10*Math.floor(Number(e.format("YYYY"))/10)+"'s"},this.html=function(e,t,i,n){var a,o=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++)a="",o+c===s&&(a+="ogx_calendar_layout_decade_years_current "),o+c===l&&(a+="ogx_calendar_selected_item "),r+='
'+t(o+c+"-01-01",i)+"
";return r},this.value=function(){return{value:10,unit:"years"}},this.format=function(){return"Y"}},OGX.CalendarLayout.DECADE_MONTHS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){for(var t=10*Math.floor(Number(e.format("YYYY"))/10),i=Number(String(t).substr(2,2)),n="",a=0;a<10;a++)n+='\''+i+"",i++;return n},this.html=function(e,t,i,n){var a,o,r,s,l=10*Math.floor(Number(e.format("YYYY"))/10),c="",d=moment().format("YYYY-MM");n&&(a=n.format("YYYY-MM"));for(var u=0;u<12;u++){s=u+1;for(var h=0;h<10;h++)o="",(r=l+h+"-"+(s<10?"0"+s:s))===d&&(o="ogx_calendar_layout_decade_months_current "),r===a&&(o+="ogx_calendar_selected_item "),moment(r+"-01"),c+='
'+t(r+"-01",i)+"
"}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(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Months'},this.html=function(e,t,i,n){var a,o,r=moment().format("YYYY-MM"),s=e.format("YYYY"),l="",c="";n&&(c=n.format("YYYY-MM"));for(var d=1;d<13;d++)a="",s+"-"+(o=d<10?"0"+d:d)===r&&(a+="ogx_calendar_layout_year_months_current "),s+"-"+o===c&&(a+="ogx_calendar_selected_item "),l+='
'+t(s+"-"+o+"-01",i)+"
";return l},this.value=function(){return{value:1,unit:"years"}},this.format=function(){return"Y"}},OGX.CalendarLayout.YEAR_WEEKS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Weeks'},this.html=function(e,t,i,n){var a=moment().week(),o=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="",a===h&&o===r&&(c="ogx_calendar_layout_year_weeks_current "),l===h&&o===s&&(c+="ogx_calendar_selected_item "),u+='
'+t(d,i)+"
";return u},this.value=function(){return{value:1,unit:"years"}},this.format=function(){return"Y"}},OGX.CalendarLayout.YEAR_DAYS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Nth Day'},this.html=function(e,t,i,n){var a,o,r,s="",l=e.format("YYYY-MM-DD"),c=moment(e.format("YYYY")+"-01-01"),d="";n&&(d=n.format("YYYY-MM-DD")),o=e.isLeapYear()?366:365;for(var u=0;u'+t(r,i)+"",c.add(1,"days");return s},this.value=function(){return{value:1,unit:"years"}},this.format=function(){return"Y"}},OGX.CalendarLayout.MONTH_WEEKS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Nth Week'},this.html=function(e,t,i,n){var a,o="",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")));o="";for(var h,f=moment(e.format("YYYY-MM-[01]")),g=0;g<5;g++)h="",a=Number(f.format("w")),c===d&&a===u&&(h+="ogx_calendar_selected_item "),c===s&&a===l&&(h+="ogx_calendar_layout_month_weeks_current"),o+='
'+t(f.format("YYYY-MM-DD"),i)+"
",f.add(7,"days");return o},this.value=function(){return{value:1,unit:"months"}},this.format=function(){return"[(]YYYY-MM[)] W"}},OGX.CalendarLayout.WEEK_DAYS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){for(var t="",i=function(){for(var e=new Date(Date.UTC(2017,0,2)),t=[],i=0;i<7;i++)t.push(e.toLocaleDateString(navigator.language,{weekday:"short"})),e.setDate(e.getDate()+1);return t}(),n=function(e){for(var t=e.clone(),i=t.day(),n=t.subtract(i,"day"),a=[],o=0;o<7;o++)a.push(n.format("DD")),n.add(1,"day");return a}(e),a=0;a'+i[a]+" "+n[a]+"";return t},this.html=function(e,t,i,n){var a,o,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++)a="",(o=l.format("YYYY-MM-DD"))===c&&(a="ogx_calendar_layout_week_days_current "),o===d&&(a+="ogx_calendar_selected_item "),r+='
'+t(o,i)+"
",l.add(1,"days");return r},this.value=function(){return{value:1,unit:"weeks"}},this.format=function(){return"YYYY-MM (wo [week])"}},OGX.CalendarLayout.DAY_HOURS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Hours'},this.html=function(e,t,i,n){var a,o,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++)o="",h===s&&l===c&&(o="ogx_calendar_layout_days_hours_current "),h===d&&l===u&&(o+="ogx_calendar_selected_item "),r+='
'+t(l+a+":00",i)+"
";return r},this.value=function(){return{value:1,unit:"days"}},this.format=function(){return"YYYY-MM-DD HH:[00]"}},OGX.CalendarLayout.DAY_WORK_HOURS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Work Hours'},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 a,o,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'+t(l+a+":00",i)+"";return r},this.value=function(){return{value:1,unit:"days"}},this.format=function(){return"YYYY-MM-DD HH:[00]"}},OGX.CalendarLayout.DAY=function(e){"use strict";this.labels=function(e){return''+function(e){for(var t=new Date(Date.UTC(2017,0,2)),i=[],n=e.day(),a=0;a<7;a++)i.push(t.toLocaleDateString(navigator.language,{weekday:"long"})),t.setDate(t.getDate()+1);return i[n]}(e)+""},this.html=function(e,t,i,n){var a="",o=e.format("YYYY-MM-DD"),r=moment().format("YYYY-MM-DD");return n&&o===n.format("YYYY-MM-DD")&&(a+="ogx_calendar_selected_item "),o===r&&(a+="ogx_calendar_layout_day_current "),'
'+t(o,i)+"
"},this.value=function(){return{value:1,unit:"days"}},this.format=function(){return"YYYY-MM-DD"},this.select=function(e){}},OGX.CalendarEngine={},OGX.CalendarEngine.CELL_VALUE=function(e,t){var i=moment(e);return t.hasOwnProperty("css")||(t.css=""),'
'+i.format(t.format)+"
"},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'
'+moment(e).week()+"
"},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'
'+String(e).substr(2)+"'s
"},require("Carousel","Uxi","Placeholder","Touch"),OGX.Carousel=function(e){construct(this,"Carousel");var t,i,n,a,o,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},d={position:"bottom"},u=!1,h=0,f=0,g=new OGX.List,_="ogx_carousel";function p(e){if(void 0!==e&&g[e]&&g[e].instance){var t=s.find(g[e].instance._NAME_,g[e].instance.id);t&&t.blur(2)}}function m(e){if(void 0!==e&&g[e]&&g[e].instance){var t=s.find(g[e].instance._NAME_,g[e].instance.id);t&&t.focus(1)}}function v(e){i.off("transitionend"),i.removeClass(_+"_anim")}function y(e){if(e.dirX){if(-1===e.dirX&&!l.drag_right)return;if(1===e.dirX&&!l.drag_left)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 x(e){if(e.distX>l.min_x){var i=r+-1*e.dirX;i>=0&&i'),e.push("."+_+'[data-ogx-id="'+s.id+'"] > .'+_+"_views > ."+_+'_view[data-ogx-panel-id="'+h+'"]'),h++;i.css("width",100*f+"%"),s.placeholders(l,e),t.trigger(OGX.Carousel.READY)}this.construct=function(){G(),l.index&&this.showPanel(l.index,!1)},this.enable=function(){return l.drag&&this.touch.swipe.enable(),setTimeout((function(){for(var e=0;e0&&this.showPanel(r-1),this},this.next=function(){return r+1'+e+""),i.css("width",Math.round(100*f)+"%"),i.children("."+_+"_view").css("width",100/f+"%"),++h-1}(),l="."+_+'[data-ogx-id="'+this.id+'"] > .'+_+"_views > ."+_+'_view[data-ogx-panel-id="'+r+'"]',c={},d=l;if(e.hasOwnProperty("_NAME_"));else{for(var u in e){d+=":"+u.split(":")[1],c[d]=e[u];break}var g=null;setTimeout((function(){s.observe(!0,{childList:!0,subtree:!0},(function(){s.observe(!1),g&&clearTimeout(g),g=setTimeout(G,20),a&&s.showPanel(f-1,o)})),OGX.OML.render(s,c,n)}),0)}return t.trigger(OGX.Carousel.ADDED,f),this},this.removeNode=function(e){for(var t=0;t=0&&ee?i.children("."+_+"_view:eq("+(n-1)+")").after(a):i.children("."+_+"_view:eq("+n+")").before(a);var o=100/f*(-1*n);return i.removeClass(_+"_anim"),i.css({transform:"translate3d("+o+"%, 0, 0)"}),r=n,setTimeout(G,0),t.trigger(OGX.Carousel.CHANGE,r),this},this.removePanel=function(e,n){if(void 0===n&&(n=!0),e>=0&&e=r?e--:e=r,e<0&&(e=0),s.showPanel(e,!1,!0),t.trigger(OGX.Carousel.REMOVED,f),a}return!1},this.empty=function(){return this.clear(),i.empty(),i.removeClass(_+"_anim").css("width","100%"),i.css({transform:"translate3d(0%, 0, 0)"}),f=0,g=new OGX.List,l.index=0,l["node:OML"]=[],this},this.render=function(e,t){return l["node:OML"]=e,f=l["node:OML"].length,X(),OGX.OML.render(this,l["node:OML"],t),this},OGX.Data.merge(l,c,!1),l.dots&&("boolean"==typeof l.dots&&(l.dots={}),OGX.Data.merge(l.dots,d)),r=l.index,t=s.el,n=Math.floor(t.innerWidth()),l.hasOwnProperty("node:OML")&&(f=l["node:OML"].length),function(){t.addClass(_);var e="";l.dots&&"top"===l.dots.position&&(e+=''),e+='
',l.dots&&"bottom"===l.dots.position&&(e+=''),t.append(e),(i=t.find("."+_+"_views").first()).css({transform:"translate3d("+100/f*(-1*r)+"%, 0, 0)"})}(),l.dots&&(o=s.create("Dots",{el:"."+_+'[data-ogx-id="'+s.id+'"] > .carousel_dots',total:f})).bind("dots",s),X(),s.touch.swipe=s.touch.add("Swipe",{x:!0,cb_down:v,cb_swipe:y,cb_up:x,capture:l.capture,state:"manual"}),l.drag||s.drag(!1)},OGX.Carousel.READY="CarouselReady",OGX.Carousel.DRAG="CarouselDrag",OGX.Carousel.CHANGE="CarouselChange",OGX.Carousel.RESTORE="CarouselRestore",OGX.Carousel.ADDED="CarouselAdded",OGX.Carousel.REMOVED="CarouselRemoved",void 0===OGX)var OGX={};require("Chat","Uxi","Touch"),OGX.Chat=function(__config){construct(this,"Chat");var that=this,config=__config,config_default={placeholder:"Type a message",dot_speed:600,on_keyb_update_delay:300,messages:[],handle_keyboard:!0,hide_keyboard_on_send:!1,emojis:!1,template_left:'
{{$letter}}{{$body}}{{$date}}
',template_right:'
{{$body}}{{$date}}
',key:"_id",from_key:"from",users:[],user:!1,display_mode:OGX.Chat.DISPLAY_INITIALS,picture_key:"",restrict:{multiline:!1,length:500,allowed:/./},date_format:"YYYY-MM-DD h:mm:ss A",url_encode:!0},emojis_default={template:'{{$emoji}}',button:!1,list:[],map:{emoji:"char",search:"name"}},container,inner,scroller,composer,emojis,emoji_list,intv,oldh=!1,typing={},type=".",enabled=!1;function render(){if(config.messages.length>0){for(var e=0;e.';inner.append(t),animTyping(!0)}function removeTyping(e){typing[e]=!1,inner.find('.ogx_chat_typing[data-user="'+e+'"]').remove(),0===inner.find(".ogx_chat_typing").length&&animTyping(!1)}function animTyping(e){e?intv||(intv=setInterval(typeDot,config.dot_speed)):(clearInterval(intv),intv=null)}function typeDot(){(type+=".").length>3&&(type="."),inner.find(".ogx_chat_typing_body").html(type)}function getTemplate(e){return e[config.from_key]===config.user?config.template_right:config.template_left}function sendMessage(){var e=composer.find("textarea").val();if(e.length&&(e=(e=(e=e.replace(/^[\r|\n\r]+/,"")).replace(/<\/?[^>]+(>|$)/g,"")).replace(/’/,"'")).length){var t={body:e=e.replace(/[\r\n]/g,"
"),date:moment().format(config.date_format)};t[config.from_key]=config.user,addMessage(t);var i=OGX.Data.clone(t);config.url_encode&&(i.body=encodeURIComponent(i.body)),delete i.bg,delete i.letter,composer.find("textarea").val(""),that.el.trigger(OGX.Chat.SEND_MESSAGE,i)}}function handleShowKeyb(e){oldh||(oldh=container.height()),container.height(oldh-e.keyboardHeight),updateScroller()}function handleHideKeyb(){container.height(oldh),updateScroller()}function updateScroller(){setTimeout((function(){scroller.resize(),scroller.bottom()}),config.on_keyb_update_delay)}function renderEmojis(){var e,t=[];config.emojis.list=config.emojis.list.slice(0,250);for(var i=0;i',e+="
",config.emojis&&(e+=''),e+='',container.append(e),composer=container.find(".ogx_chat_composer"),config.emojis&&(emojis=container.find(".ogx_chat_emojis"),setTimeout(renderEmojis,10))}function initUsers(){for(var e in config.users)typing[e]=!1}function initDefaults(){config.hasOwnProperty("emojis")&&config.emojis&&(OGX.Data.merge(config.emojis,emojis_default,!1),config.emojis.list=new OGX.List(config.emojis.list)),OGX.Data.merge(config,config_default,!1),config.users.hasOwnProperty("find")||(config.users=new OGX.List(config.users)),(container=that.el).addClass("ogx_chat")}function init(){if(initDefaults(),initMarkup(),initUsers(),initScroller(),config.restrict){var e=OGX.Data.clone(config.restrict);config.restrict.hasOwnProperty("forbidden")&&(e.forbidden=config.restrict.forbidden),config.restrict.hasOwnProperty("allowed")&&(e.allowed=config.restrict.allowed),e.el=that.el.find(".ogx_chat_composer .ogx_chat_composer_input textarea")[0],OGX.Form.restrictField(e)}that.enable()}this.enable=function(){return enabled||(enabled=!0,config.handle_keyboard&&listenKeyb(!0),listenComposer(!0),listenArea(!0)),this},this.disable=function(){return this.el.find(".ogx_chat_composer .ogx_chat_composer_input textarea").trigger("blur"),enabled&&(enabled=!1,config.handle_keyboard&&listenKeyb(!1),listenComposer(!1),listenArea(!1)),this},this.users=function(e){return void 0!==e?(e.hasOwnProperty("find")||(e=new OGX.List(e)),config.users=e,!0):config.users},this.user=function(e){return void 0===e?config.user:(config.user=e,this)},this.typing=function(e,t){return e&&!typing[t]?addTyping(t):!e&&typing[t]&&removeTyping(t),this},this.compose=function(e){return composer.find("textarea").val(e),this},this.wipe=function(){return inner.empty(),this},this.clear=function(){return debug(2,"Chat clear is deprecated, use wipe"),this.wipe()},this.getScroller=function(){return scroller},this.addMessage=function(e){return addMessage(e),this},this.setMessages=function(e){return config.messages=e,render(),this},this.prependMessages=function(e){for(var t=this.el.find(".ogx_scroller_outer").first(),i=inner.height(),n=t.scrollTop(),a=0;a1&&(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]),a=Number(s[1]),o=Number(s[2])),"#"+((1<<24)+(n<<16)+(a<<8)+o).toString(16).slice(1)},OGX.Color.rgbToHsl=function(e,t,i){"use strict";var n,a,o;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],a=s[1],o=s[2],n/=255,a/=255,o/=255;var l,c,d=Math.max(n,a,o),u=Math.min(n,a,o),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=(a-o)/f+(a1&&(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;o=l(d,c,e+1/3),r=l(d,c,e),s=l(d,c,e-1/3)}return[Math.round(255*o),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,a="normal",o=0;function r(e){e?(t.tabs.el.on(OGX.Tabs.SELECT,(function(e,i){var n=t.tabs.index();t.carousel.val(n),t.el.trigger(OGX.Container.CHANGE,n)})),t.tabs.el.on(OGX.Tabs.CLOSE,(function(){})),t.tabs.el.on(OGX.Tabs.REORDER,(function(e,i){t.carousel.swapPanels(i.from,i.to)})),t.tabs.el.on(OGX.Tabs.ADD,(function(){})),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.CLOSE),t.tabs.el.off(OGX.Tabs.REORDER),t.tabs.el.off(OGX.Tabs.ADD),t.carousel.el.off(OGX.Carousel.CHANGE)),s(e)}function s(e){e?t.tabs.el.on(OGX.Tabs.REMOVE,(function(e,i){s(!1);var n=t.el.parents(".ogx_popup").first().data("ogx-id");n=app.cfind("Popup",n),app.ungroupPopup(n,i.index,i.label),setTimeout((function(){s(!0)}),200)})):t.tabs.el.off(OGX.Tabs.REMOVE)}this.carousel=null,this.tabs=null,this.construct=function(){this.carousel=this.find("Carousel",this.id+"_carousel")},this.show=function(e,t){if(this.carousel&&"normal"===a){var i=this.carousel.getNodeIndex(e,t);i&&(this.carousel.val(i.index),n.tabs&&this.tabs.index(i.index))}},this.index=function(e){return this.carousel&&"normal"===a&&(this.carousel.val(e),n.tabs&&this.tabs.index(e)),this},this.enable=function(){return n.tabs&&this.carousel&&r(!0),this},this.disable=function(){return n.tabs&&this.carousel&&r(!1),this},this.resize=function(){var e,t,i;return n.flatten&&(this.carousel&&"flattened"!==a&&this.el.width()>=n.flatten?(a="flattened",n.tabs&&(this.tabs.blur(),this.tabs.hide()),this.carousel.blur(),o=(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"===a&&this.el.width()';t.html(i)}this.enable=function(){n.clickable&&c(!0)},this.disable=function(){n.clickable&&c(!1)},this.bind=function(e,t){return!(o.hasOwnProperty(e)||!t.hasOwnProperty("_NAME_"))&&function(e,t){switch(o[e]=t,t._NAME_){case"Carousel":n.total=t.panels().length,n.current=t.val(),t.el.on(OGX.Carousel.CHANGE,s),t.el.on(OGX.Carousel.ADDED+" "+OGX.Carousel.REMOVED,l);break;case"Iceberg":n.total=t.panels().length,n.current=t.val(),t.el.on(OGX.Iceberg.SHOW,s)}return!0}(e,t)},this.unbind=function(e){return!!o.hasOwnProperty(e)&&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.destroy=function(){!function(){for(var e in o)r(e)}()},OGX.Data.merge(n,a),(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,reorder:!1,swipe:!1,reselect:!1,chromeos:!1,min_x:30,hold_time:1e3,interval:5,list:[],selection:[],no_selection:{enabled:!1,prop:"",val:0},mode:OGX.DynamicList.SELECT_MODE_SINGLE,trigger:!1,scope:!0,swipe_template:'
{{$template}}
',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;function isSelectable(__item){return!config.no_selection.enabled||eval("__item."+config.no_selection.prop+" === config.no_selection.val")}function replace(e,t,i){if(display.hasOML()){var n,a,o=toDataId(i[t]),r=display.oml('.ogx_dynamic_list[data-ogx-id="'+that.id+'"] > .ogx_dynamic_list_item[data-ogx-id='+o+"]",i,config.as);$('.ogx_dynamic_list[data-ogx-id="'+that.id+'"] > .ogx_dynamic_list_item[data-ogx-id='+o+"]").find(".ogx_uxi").each((function(e,t){n=$(t).data("ogx-id"),(a=that.cfind(!1,n,1))&&that.find(a._NAME_,a.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)));for(var i,n,a,o="",r=[],s=0;s0?(key=key_default,forceIds()):key=config.key,config.swipe&&("object"!=typeof config.swipe&&(config.swipe={}),OGX.Data.merge(config.swipe,swipe_default)),(container=that.el).addClass("ogx_dynamic_list")}function init(){initDefaults(),finalize(),config.scroll&&(scroller=that.find("Scroller",config.id+"_scroller"))}this.enable=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))),this},this.disable=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))),this},this.bindFilter=function(e,t,i){void 0!==i&&(config.list.removeFilter(e),config.list.addFilter(e,t,i)),config.list.getFilters()&&(filtered=config.list.filter(),isFiltered=!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(){return this.getSelection()},this.destroy=function(){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 a;void 0===t&&(t=!1),void 0===i&&(i=!0),e.hasOwnProperty("insert")||(e=new OGX.List(e)),this.resetSelection(),t||(a=config.list.getFilters()),config.list=e,config.key||(key_id=1,key=key_default,e=JSON.parse(JSON.stringify(e)),forceIds()),!t&&Object.keys(a).length?(config.list.setFilters(a),setTimeout(this.filter,0)):i?setTimeout(render,0):render()},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:config.display.val(e)},this.mode=function(e){return void 0===e?config.mode:(config.mode!==e&&(config.mode===OGX.DynamicList.STATIC?this.enable(!0):e===OGX.DynamicList.STATIC&&this.disable(!0),config.mode=e),this)},this.noSelection=function(e,t){return 1===arguments.length?"object"==typeof e?void(config.no_selection=e):void(config.no_selection.enabled=e):2===arguments.length?(config.no_selection.enabled=!0,config.no_selection.prop=e,void(config.no_selection.val=t)):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){if(!Array.isArray(e)){config.key||(e[key]=key_id++);var i=!1,n=!0;if(isFiltered){var a=new OGX.List(e);a.setFilters(config.list.getFilters()),0===a.filter().length?n=!1:filtered.push(e)}var o=toDataId(e[key]),r='
]/,pattern:!1,validate:!1,mask:!1,mask_char:"%",paste:!0,autocomplete:null,multiline:!1,input_cb:!1,change_cb:!1,diff:!0,val:null,last_change:!1,wait:2e3,intv:!1,max:2500,type:"string",params:null},n=new OGX.List,a=new OGX.List,o=!1;function r(t,i){if(!o){var a,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 c=d(r.form);for(var u in c)r.config.fields.hasOwnProperty(u)&&r.config.fields[u].hasOwnProperty("type")?c[u]=l(r.config.fields[u].type,c[u]):r.config.hasOwnProperty("type")&&(c[u]=l(r.config.type,c[u]));if(a=JSON.stringify(c),!r.diff||r.val!==a){var h;if(r.val=a,r.config.validate){h={obj:c,form:i,valid:!1};var f=e.validate(r.form);!0===f?h.valid=!0:(h.valid=!1,h.error=f)}else h=c;r.config.params&&(h.params=r.config.params),r.buffer&&clearTimeout(r.buffer),r.buffer=setTimeout((function(){r.config.change_cb(h)}),10)}}}}function s(t){var i={el:t.el,config:t,field:$(t.el),intv:!1};i.name=i.field.attr("name"),i.val=i.field.val(),i.field.val(i.val),t.pattern&&i.field.attr("pattern",t.pattern),n.insert(i),$(document).on("input change",i.el,(function(e){if(!o){var t=$(this).val();if(!i.config.diff||i.config.diff&&t!==i.val){if(i.config.input_cb){var n={value:null,obj:{},el:null};t=l(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(){!function(e){var t=$(e.el).val();if(e.val=t,e.config.change_cb){var i={value:null,obj:{},el:null};t=l(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(!o){if(i.config.mask&&8===e.which||46===e.which){var n=t[0].selectionStart,a=t.val();return a=8===e.which?a.substr(0,n-1):a.substr(0,n),t.val(a),!1}if(8!==e.which&&13!==e.which&&1===e.key.length){var r=e.key;if(13!==e.which&&i.config.mask){if((a=t.val()).length>=i.config.mask.length)return e.preventDefault(),e.stopImmediatePropagation(),!1;for(var s=i.config.mask,c=0;c=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})),a.insert(t)}(e),!0},this.unrestrictField=function(e){var t=a.find("el",e,1);return!!t&&($(document).off("textInput keydown",t.el),$(document).off("paste",t.el),a.findDelete("el",e,1),!0)},this.toObj=function(e){return d(e)},this.populate=function(e,t,i){var n,a,o;void 0===i&&(i=null),$(e).find("*[name]").each((function(e,r){n=r.getAttribute("name"),o=!1,"string"!=typeof(o=OGX.Data.eval(t,n))&&(o=JSON.stringify(o)),void 0!==o&&(i&&i.hasOwnProperty(n)&&"function"==typeof i[n]&&(o=i[n](o)),(a=$(r)).val(o),r.hasAttribute("type")&&"hidden"===a.attr("type")&&a.trigger("change"))})),setTimeout(c,0)},this.validate=function(e){var i,n=$(e),a=t.elem_types,o=[];return n.find(a.join(",")).each((function(e,t){"submit"!==(i=$(t)).attr("type")&&(t.checkValidity()||o.push(i))})),!o.length||o}},OGX.Form=new OGX.Form,OGX.Geo=function(e){"use strict";var t=this;void 0===e&&(e={});var i,n,a,o={map:null,markers:[],icon:"",browser_loc:null},r=e;function s(e,i){for(var n,a={},o=0;o1&&(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?(i=new google.maps.Geocoder,function(){for(var e in o)r.hasOwnProperty(e)||(r[e]=o[e])}(),r.map&&r.markers.length):$(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"),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,a,o,r,s,l,c,d,u,h,f=this,g=e,_={map:[[!0,!0,!0],[!0,!0,!0],[!0,!0,!0]],axis:{x:!0,y:!0},loop:!0,start:!1,chromeos:!1,capture:!1},p=!1,m={x:null,y:null},v={x:0,y:0},y=".ogx_grid_swiper_cell",x=!1,O=!1,b={x:0,y:0},w={x:0,y:0},G=(new Date).getTime()+Math.round(1e3*Math.random()),X=[];function T(e){e?t.on(f.touch.down,E):t.off(f.touch.down,E)}function E(e){p=!1,o=0,r=0,s=0,l=0,e=Y(e),m.x=e.pageX,m.y=e.pageY,x=!0,L(!0)}function D(e){e?$("body").on(f.touch.up,C):$("body").off(f.touch.up,C)}function C(e){x&&(x=!1,L(!1),S())}function S(e,t,o){var r,s;void 0===e&&(e=0),void 0===t&&(t=0),void 0===o&&(o=!0),o&&N(!0),i.addClass("ogx_grid_swiper_anim"),v=A(i),r=-1*Math.round((v.x+e)/n)*n*-1,s=-1*Math.round((v.y+t)/a)*a*-1,i.css({transform:"translate3d("+r+"px, "+s+"px, 0px)"})}function L(e){e?(k(!0),t.on(f.touch.move,M)):(k(!1),t.off(f.touch.move,M))}function M(e){e=Y(e),g.capture&&(e.preventDefault(),e.stopImmediatePropagation()),o=0,r=0,s=0,l=0,p||(g.axis.x&&Math.abs(e.pageX-m.x)>Math.abs(e.pageY-m.y)?p="x":g.axis.y&&Math.abs(e.pageX-m.x)0?1:-1):g.axis.y&&"y"===p&&(r=Math.abs(e.pageY-m.y),l=e.pageY-m.y>0?1:-1))}function k(e){e?h||(O=!1,h=setInterval(I,10)):h&&(clearInterval(h),h=null)}function I(){if((o||r)&&(O||t.trigger(OGX.GridSwiper.SWIPE_START),O=!0),g.axis.x&&"x"===p&&o&&s&&o<=n){if(!g.loop&&(b.x+-1*s<0||b.x+-1*s>g.map[0].length-1))return;if((c=(b.x+-1*s)%g.map[0].length)<0&&(c=Math.abs(g.map[0].length+c)),!1===g.map[w.y][c])return;u=o*s,i.css({transform:"translate3d("+(-1*b.x*n+u)+"px, "+v.y+"px, 0px)"})}else if(g.axis.y&&"y"===p&&r&&l&&r<=a){if(!g.loop&&(b.y+-1*l<0||b.y+-1*l>g.map.length-1))return;if((d=(b.y+-1*l)%g.map.length)<0&&(d=Math.abs(g.map.length+d)),!1===g.map[d][w.x])return;u=r*l,i.css({transform:"translate3d("+v.x+"px, "+(-1*b.y*a+u)+"px, 0px)"})}}function N(e){e?(i.off("transitionend"),i.on("transitionend",(function(){O&&(t.trigger(OGX.GridSwiper.SWIPE_END),O=!1),i.off("transitionend"),i.removeClass("ogx_grid_swiper_anim"),v=A(i);var e={x:null,y:null};e.x=-1*Math.round(v.x/n),e.y=-1*Math.round(v.y/a),b.x!==e.x?(s=b.x>e.x?1:-1,b.x=e.x,w.x=P(b).x,-1===s?(i.children(y+"[data-y="+(b.y-1)+"]").attr("data-x",b.x).css("left",b.x*n),i.children(y+"[data-y="+(b.y+1)+"]").attr("data-x",b.x).css("left",b.x*n),i.children(y+"[data-x="+(b.x-2)+"][data-y="+b.y+"]").attr("data-x",b.x+1).css("left",(b.x+1)*n),t.trigger(OGX.GridSwiper.SWIPE_LEFT,{cell:w,point:b}),R(X=[{x:b.x+1,y:b.y},{x:b.x,y:b.y-1},{x:b.x,y:b.y+1}]),W()):(i.children(y+"[data-y="+(b.y-1)+"]").attr("data-x",b.x).css("left",b.x*n),i.children(y+"[data-y="+(b.y+1)+"]").attr("data-x",b.x).css("left",b.x*n),i.children(y+"[data-x="+(b.x+2)+"][data-y="+b.y+"]").attr("data-x",b.x-1).css("left",(b.x-1)*n),t.trigger(OGX.GridSwiper.SWIPE_RIGHT,{cell:w,point:b}),R(X=[{x:b.x-1,y:b.y},{x:b.x,y:b.y-1},{x:b.x,y:b.y+1}]),W())):b.y!==e.y&&(l=b.y>e.y?1:-1,b.y=e.y,w.y=P(b).y,-1===l?(i.children(y+"[data-x="+(b.x-1)+"]").attr("data-y",b.y).css("top",b.y*a),i.children(y+"[data-x="+(b.x+1)+"]").attr("data-y",b.y).css("top",b.y*a),i.children(y+"[data-y="+(b.y-2)+"][data-x="+b.x+"]").attr("data-y",b.y+1).css("top",(b.y+1)*a),t.trigger(OGX.GridSwiper.SWIPE_UP,{cell:w,point:b}),R(X=[{x:b.x,y:b.y+1},{x:b.x-1,y:b.y},{x:b.x+1,y:b.y}]),W()):(i.children(y+"[data-x="+(b.x-1)+"]").attr("data-y",b.y).css("top",b.y*a),i.children(y+"[data-x="+(b.x+1)+"]").attr("data-y",b.y).css("top",b.y*a),i.children(y+"[data-y="+(b.y+2)+"][data-x="+b.x+"]").attr("data-y",b.y-1).css("top",(b.y-1)*a),t.trigger(OGX.GridSwiper.SWIPE_DOWN,{cell:w,point:b}),R(X=[{x:b.x,y:b.y-1},{x:b.x-1,y:b.y},{x:b.x+1,y:b.y}]),W())),p=0}))):i.off("transitionend")}function A(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%g.map[0].length,t.x<0&&(t.x=Math.abs(g.map[0].length+t.x)),t.y=e.y%g.map.length,t.y<0&&(t.y=Math.abs(g.map.length+t.y)),t}function R(e){for(var t,i={x:null,y:null},n=0;ng.map.length-1){if(!g.loop)return!1;i.y=P(e[n]).y}else i.y=e[n].y;if(e[n].x<0||e[n].x>g.map[0].length-1){if(!g.loop)return!1;i.x=P(e[n]).x}else i.x=e[n].x;t=g.map[i.y][i.x],H(e[n],t)}}function H(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-b.x,y:e.y-b.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 a='.ogx_grid_swiper[data-ogx-id="'+G+'"] > .ogx_grid_swiper_container > '+y+'[data-x="'+e.x+'"][data-y="'+e.y+'"] > '+y+"_content",o=P(e);for(var r in t){t[r].id="cell_"+o.x+"_"+o.y;break}t=OGX.OML.rename(t,a);var s=f.nodes.find("id","cell_"+o.x+"_"+o.y,1);s&&f.remove(s._NAME_,s.id),$(a).empty(),OGX.OML.render(f,t,{abs:e,rel:P(e)}),W()}}function W(){for(var e=0;e',c=-1*e,d=-1*o-a;g.axis.y&&(l+='
',l+='
'),l+='
',g.axis.x&&(l+='
',l+='
'),l+="
",t.html(l),i=t.children(".ogx_grid_swiper_container").first(),b.x=g.start.x,b.y=g.start.y,v.x=e,v.y=o,w.x=g.start.x,w.y=g.start.y}this.enable=function(){return T(!0),D(!0),W(),this},this.disable=function(){return T(!1),D(!1),k(!1),this},this.focus=function(){return this.blured&&(this.blured=!1,this.enabled&&(this.ux(!0),this.enable())),this},this.resize=function(){N(!1),i.removeClass("ogx_grid_swiper_anim"),n=t.width(),a=t.height();var e=b.x*-n,o=b.y*-a;i.children(y+"[data-y="+(b.y-1)+"]").css({top:(b.y-1)*a,left:b.x*n}),i.children(y+"[data-y="+b.y+"]").css({top:b.y*a,left:b.x*n}),i.children(y+"[data-y="+(b.y+1)+"]").css({top:(b.y+1)*a,left:b.x*n}),i.children(y+"[data-x="+(b.x-1)+"]").css({top:b.y*a,left:(b.x-1)*n}),i.children(y+"[data-x="+(b.x+1)+"]").css({top:b.y*a,left:(b.x+1)*n}),i.css("transform","translate3d("+e+"px, "+o+"px, 0px"),L(!1),setTimeout((function(){S(0,0,!1),i.addClass("ogx_grid_swiper_anim")}),0)},this.setMap=function(e,t){return g.map=e,void 0!==t&&(g.start=t),b={x:0,y:0},w={x:0,y:0},m={x:null,y:null},v={x:0,y:0},z(),U(),j(),this},this.setMapCell=function(e,t){return g.map[e.y]||(g.map[e.y]=[]),g.map[e.y][e.x]=t,this},this.getMapCell=function(e){return e.y>0&&g.map.length0&&g.map[e.y].length0){var i=e.data("id");e.html(OGX.Templater.make(s.template,s.list[i]))}return this},OGX.Data.merge(s,l),s.list.hasOwnProperty("insert")||(s.list=new OGX.List(s.list)),s.group_order&&!s.group_order.hasOwnProperty("insert")&&(s.group_order=new OGX.List(s.group_order)),s.display&&s.display.hasOwnProperty("css")&&("object"!=typeof s.display.css&&s.display.css?s.display.css+=" ogx_grouped_list_item":s.display.hasOwnProperty("add")?s.display.add="ogx_grouped_list_item "+s.display.add:s.display.add="ogx_grouped_list_item"),o=!1,(t=r.el).addClass("ogx_grouped_list"),g()},OGX.GroupedList.SELECT="GroupedListSelect",OGX.GroupedList.BIND=OGX.GroupedList.SELECT,require("Html","Uxi","Placeholder"),OGX.Html=function(e){construct(this,"Html"),this.rendered=!1,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,a,o=this,r={left:0,right:0,top:0,bottom:0,min:50,drag:!0,flatten:!1,"node:OML":{}},s=e,l=!1,c="normal",d="main",u={left:null,main:null,right:null,top:null,bottom:null},h=[0,0,0],f=0,g=0,_=0,p=0;function m(e){for(var t in u)u[t]&&u[t].instance&&(e===t?u[t].instance.focus():u[t].instance.blur())}function v(){l.hasClass("ogx_iceberg_anim")||(l.off("transitionend"),h=b(l))}function y(e){var t=0;return e.dirY&&e.distY>e.distX&&(t=1),t}function x(e){s.drag&&e.dist&&(!(n=y(e))&&["main","left","right"].includes(d)?e.dirX&&e.distX&&(t=h[0]+e.distX*e.dirX)<=g&&t>=f&&l.css({transform:"translate3d("+t+"px, 0, 0)"}):["main","top","bottom"].includes(d)&&e.dirY&&e.distY&&(i=h[1]+e.distY*e.dirY)<=p&&i>=_&&l.css({transform:"translate3d(0, "+i+"px, 0)"}))}function O(e){if(t=0,i=0,n=y(e),e.swipe&&e.dist){var o;switch(e.swipe=!1,d){case"main":-1===e.dirX&&s.right&&!n?(t=-u.right.outerWidth(),o="right",e.swipe=!0):1===e.dirX&&s.left&&!n?(t=u.left.outerWidth(),o="left",e.swipe=!0):1===e.dirY&&s.top&&n?(i=u.top.outerHeight(),o="top",e.swipe=!0):-1===e.dirY&&s.bottom&&n&&(i=-u.bottom.outerHeight(),o="bottom",e.swipe=!0);break;case"left":-1!==e.dirX||n||(t=0,o="main",e.swipe=!0);break;case"right":1!==e.dirX||n||(t=0,o="main",e.swipe=!0);break;case"top":-1===e.dirY&&n&&(i=0,o="main",e.swipe=!0);break;case"bottom":1===e.dirY&&n&&(i=0,o="main",e.swipe=!0)}a=n?1===e.dirY?OGX.Iceberg.SWIPE_DOWN:OGX.Iceberg.SWIPE_UP:1===e.dirX?OGX.Iceberg.SWIPE_RIGHT:OGX.Iceberg.SWIPE_LEFT,e.swipe&&e.dist&&(l.addClass("ogx_iceberg_anim"),l.on("transitionend",(function(){l.off("transitionend"),l.removeClass("ogx_iceberg_anim"),h=b(l),m(d=o),l.trigger(a,d)})),l.css({transform:"translate3d("+t+"px, "+i+"px, 0)"}))}else if(e.dist){switch(t=0,i=0,d){case"left":t=u.left.outerWidth();break;case"right":t=-u.right.outerWidth();break;case"top":i=u.top.outerHeight();break;case"bottom":i=-u.bottom.outerHeight()}l.addClass("ogx_iceberg_anim"),l.on("transitionend",(function(){l.off("transitionend"),l.removeClass("ogx_iceberg_anim"),h=b(l),l.trigger(OGX.Iceberg.RESTORE,d)})),l.css({transform:"translate3d("+t+"px, "+i+"px, 0)"})}}function b(e){var t=e[0].style.transform;if(t=t.match(/translate3d\(([0-9px%,\.\- ]+)\)/)){t=t[1].split(",");for(var i=0;i=s.flatten?(c="flattened",h=b(l),l.addClass("ogx_iceberg_views_flattened").css("transform","translate3d(0px, 0px, 0px)"),l.children(".ogx_iceberg_view").addClass("ogx_iceberg_view_flattened"),this.disable()):"flattened"===c&&this.el.width() .ogx_iceberg_views > .ogx_iceberg_view[data-ogx-panel-id="';for(var r in s["node:OML"])for(var c in s["node:OML"][r])0===c.indexOf("left")&&(i+='
',n.left=a+'left"]',u.left=!0),0===c.indexOf("top")&&(i+='
',n.top=a+'top"]',u.top=!0),0===c.indexOf("main")&&(i+='
',n.main=a+'main"]'),0===c.indexOf("right")&&(i+='
',n.right=a+'right"]',u.right=!0),0===c.indexOf("bottom")&&(i+='
',n.bottom=a+'bottom"]',u.bottom=!0);for(o.el.html(i),r=0;rt.width/t.height?(i.width=t.width,i.height=Math.round(e.height*(t.width/e.width))):(i.width=Math.round(e.width*(t.height/e.height)),i.height=t.height),i}({width:t,height:i},{width:a,height:o}),s=(a-r.width)/2,l=(o-r.height)/2;n.css("left",s+"px"),n.css("top",l+"px"),n.prop("width",r.width),n.prop("height",r.height)}function a(e){var t,i=$(e);i&&(i.find(".ogx_video").each((function(e,i){t=$(i),function(e,t,i){var n=$(e),a=t/i,o=n.parent().innerWidth(),r=n.parent().innerHeight(),s=o,l=Math.ceil(s/a);lo?c=(s-o)/2*-1:sr?d=(l-r)/2*-1:l0&&(r=0),n.parent().css("overflow","hidden"),n.prop("width",a),n.prop("height",o),n.css("top",r+"px")}(i,parseInt(t.data("width"),10),parseInt(t.data("height"),10))})),i.find(".ogx_image_fit").each((function(e,i){t=$(i),function(e,t,i){var n=$(e),a=t/i,o=n.parent().innerWidth(),r=o,s=Math.ceil(r/a),l=0;r>o?l=(r-o)/2*-1:rt&&(o=t);var r=Math.ceil(o/a);n.prop("width",o),n.prop("height",r)}(i,parseInt(t.data("width"),10),parseInt(t.data("height"),10))})))}function o(e){e?$(window).on("resize",r):$(window).off("resize",r)}function r(){for(var e in t)a(t[e].selector)}function s(e){var t;e.find(".ogx_video, .ogx_video_resp, .ogx_video_poster").each((function(e,i){(t=$(i)).parent().css("overflow","hidden"),i.hasAttribute("data-width")||(t.attr("data-width",t.attr("width")),t.attr("data-height",t.attr("height")))})),e.find(".ogx_image_cover, .ogx_image_contain, .ogx_image_fit, .ogx_image_scale, .ogx_image_resp").each((function(e,i){(t=$(i)).css("position","relative"),i.hasAttribute("data-width")||(t.attr("data-width",t.attr("width")),t.attr("data-height",t.attr("height")))})),a(e)}this.resize=function(e){void 0!==e?a(e):r()},this.bind=function(n,a){return!t.hasOwnProperty(n)&&(t[n]={observer:null,element:a},t[n].observer=(r=a,l=null,(c=new(window.MutationObserver||window.WebKitMutationObserver)((function(e,t){e.forEach((function(e){l&&clearTimeout(l),l=setTimeout((()=>{s($(r))}),10)}))}))).observe(document.querySelector(r),{childList:!0,subtree:!0}),c),t[n].selector=a,i++,e||(e=!0,o(!0)),s($(a)),!0);var r,l,c},this.unbind=function(n){return!(!t.hasOwnProperty(n)||!t[n].observer)&&(t[n].observer.disconnect(),delete t[n],!--i&&e&&(e=!1,o(!1)),!0)}},OGX.Media=new OGX.Media,require("NestList","Uxi","Bind"),OGX.NestList=function(e){construct(this,"NestList");var t,i,n=this,a={scope:["public"],template:'
{{$title}}
{{$body}}
',list:new OGX.List,item_default:!1,map:{title:"title",scope:"scope",id:"id"},order:!1},o={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,g=new OGX.List;function _(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"),n=!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"),g.findUpdate("id",i,{open:!0},!1,1),n=!0):(h.way=0,e.removeClass("ogx_nest_list_item_head_open").addClass("ogx_nest_list_item_head_closed"),g.findUpdate("id",i,{open:!1},!1,1));var a=g.find("id",i,1);n?(!function(e){var t=v(e);if(t)return t.focus(),!0}(a),t.trigger(OGX.NestList.OPEN,a)):(!function(e){var t=v(e);if(t)return t.blur(),!0}(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")),a=n.nodes.find("id",i,1);if(a)return a}return!1}function y(e){if(e.hasOwnProperty("scope"))for(var t=0;t .ogx_nest_list_item[data-ogx-nest-id="'+a.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="'+a.id+'"]');return a.hidden&&h.addClass("ogx_nest_list_item_hidden"),h.removeClass("ogx_nest_list_prep"),a}function b(){var e=s.list;f&&(e=i),t.empty(),g.clear();var a;t.html('
'),s.hasOwnProperty("node:OML")||(s["node:OML"]=[]);for(var o=0;o .ogx_nest_list_item[data-ogx-nest-id="'+g[t.index].id+'"]').remove(),g.splice(t.index,1),setTimeout(x,0))},this.updateNestHeight=function(e){var t=g.find(s.map.title,e,1);setTimeout((function(){var e,i;e=t,i=$(e.selector).outerHeight(!0),e.height=i,x()}),0)},this.updateNestsHeight=function(){for(var e,t=0;t{switch(e.type){case"text":return t.text();case"json":return t.json();default:return t.blob()}})).catch((e=>{$(document).trigger(OGX.Api.NETWORK_ERROR,e)})).then((i=>{e.data=i,n(e,t,a)}))}function o(e){switch(e){case"text":case"json":return"text/plain";default:return"application/zip"}}i.extensions.hasOwnProperty("insert")||(i.extensions=new OGX.List(i.extensions)),this.preload=function(e,t,i){var n={loaded:0,total:0,files:new OGX.List};for(var a in e)for(var o=0;oogx font init';$("body").append(o),n(e,i,a),function(e){setTimeout((function(){$('.ogx_font_loader[data-ogx-id="font-loader-'+e+'"]').remove()}),150)}(t),t++}o()}(l,o,r);break;case"pak":!function(e,t,i){function o(a){for(var o,r=//gi,s=[];o=r.exec(a);)s.push(o[1]);r=//gi;var l,c,d,u=a.split(r);u.shift();for(var h=0;h=!+]+ ?\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]+))/gi.exec(e))&&(s='OGX.Object.get({_NAME_:{eq:"'+r[3]+'"}, id:{eq:"'+r[2]+'"}}, null, 1);')===(e=e.replace(r[0],s)))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]+")[0];")===(e=e.replace(r[0],s))))return s;if(isSingleVar(e))return"return "+replaceVars(e,t,i,n,a)+";";for(e+="\r\n";o=/[\S ]+(\r\n|\n)?/gi.exec(e);){if(l=replaceLoop(l=o[0].replace(/(\r\n|\n)/gi,"").trim(),t,i,n,a),charcode++,l=replaceVars(l,t,i,n,a),/^(app|OGX)\.\S+;?/g.test(l))return"return "+l+";";if(e=e.replace(o[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,a,o){var r;try{r=new Function(oo,to,ro,lo,e)(t,i,n,a)}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,str=__string.trim();if(["$","%","@"].includes(str))switch(str){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,a){var o,r,s,l;return(o=/loop (\S+) ?(as (\S+) ?(\S+ )?)?{/gi.exec(e))&&(r="__"+String.fromCharCode(charcode).toLowerCase()+"__",s=(s=o[0]).replace(o[0],"for(var "+r+" in JSON.parse(JSON.stringify("+o[1]+"))){"),o[2]&&(l=o[4]?"&"+o[3]+"="+r+"; &"+o[4]+"="+o[1]+"["+r+"]; ":"&"+o[3]+"="+o[1]+"["+r+"]; "),s+=l,e=e.replace(o[0],s)),e}function replaceVars(e,t,i,n,a){for(var o,r,s,l=0;r=/((&|#|@|\$|%)([a-zA-Z_]{1}[a-zA-Z0-9\-_]*))(\.[a-z0-9\-_\.\[\]\$]+|\.\$|\.)?(;)?/gi.exec(e);){switch(s=!1,r[2]){case"&":s=to+"."+r[3];break;case"@":s=lo+"."+r[3];break;case"$":s=oo+"."+r[3];break;case"#":s=r[3];break;case"%":s=ro+"."+r[3]}if(o=r[0].replace(r[1],s),e=e.replace(r[0],o),++l>300)return e}for(;r=/([a-z_\-]+)\( *(\$|@|&|%) *\)/gi.exec(e);)s=getTrueVal(r[2]),o=r[1]+"("+s+")",e=e.replace(r[0],o);for(;/^(json|ose|template|oml|crumb|result) (\S+)/g.test(e);)if((r=/crumb (\S+)?/gi.exec(e))&&(o=n.hasOwnProperty(r[1])?"__route_object."+r[1]:"{}",e=e.replace(r[0],o)),(r=/json (\S+)(;)?/gi.exec(e))&&(r[1]=getTrueVal(r[1],t,i,n,a),e=e.replace(r[0],"app.getJSON("+r[1]+")")),(r=/^template (\S+)( \S+)?[ ;]?/gi.exec(e))&&(r[1]=getTrueVal(r[1],t,i,n,a),void 0===r[2]?r[2]="__object":r[2]=getTrueVal(r[2].trim(),t,i,n,a),e=e.replace(r[0],"OGX.Templater.make(OGX.Templater.get("+r[1]+"), "+r[2]+", "+to+","+ro+","+lo+")")),(r=/^ose (\S+)(;)?/gi.exec(e))&&(r[1]=getTrueVal(r[1],t,i,n,a),script=that.get(r[1]),script&&(e=exp.replace(r[0],script.replace(/({{|}})/g,"")))),(r=/^oml (\S+)(;)?/gi.exec(e))&&(r[1]=getTrueVal(r[1],t,i,n,a),e=e.replace(r[0],"app.getOML("+r[1]+")")),(r=/^result (\S+)(;)?$/gi.exec(e))&&(e=e.replace(r[0],'OGX.OML.result("'+r[1]+'")')),++l>300)return e;if(["$","@","%","&"].includes(e.trim())){switch(e.trim()){case"$":e=oo;break;case"@":e=lo;break;case"%":e=ro;break;case"&":e=to}return e}for(;r=/echo ('|")?(((?![;}\r\n]+|$)([\S\s]))*)(?:'|")?/gi.exec(e);){var c="+$1+",d="'";if(void 0!==r[1]&&(d="\\"+r[1]),c=d+c+d,r[2]=r[2].replace(/(__(?!;\n\r)[a-z0-9_\-\.]+)/gi,c),o="__echo.push("+d+r[2]+d+");",e=e.replace(r[0],o),++l>300)return e}return e}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 a in t.values)if(convertValue(a)===n)return t.values[a];return!1},this.execScript=function(e,t,i,n){var a=this.get(e);return a&&this.exec(a,t,i,n),!1},this.exec=function(e,t,i,n,a){void 0===t&&(t={}),void 0===i&&(i={}),void 0===n&&(n={}),void 0===a&&(a={}),charcode=65;var o=runJS(convertToJS(e,t,i,n,a),t,i,n,a,e);if(void 0!==o)return o}},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,a={anim:OGX.Overlay.FADE,display:{css:"",html:" "},index:!1,close_on_click:!1},o=!1,r="mousedown";function s(e){i&&(e?i.on(r,l):i.off(r,l))}function l(){"function"==typeof o.close_on_click&&o.close_on_click.apply(null,t),s(!1),t.removeOverlay()}e.hasOwnProperty("overlay")&&e.overlay&&setTimeout((function(){t.addOverlay(e.overlay)}),0),this.hasOverlay=function(){return!!i},this.addOverlay=function(e){if("object"!=typeof e&&(e={}),OGX.Data.merge(e,a),e.display.hasOwnProperty("_NAME_")||(e.display=new OGX.Display(e.display)),o=e,!this.hasOverlay()){var t=this.el;o.hasOwnProperty("el")&&(t=$(o.el));var n="z-index:"+(o.zindex?o.zindex:this.topIndex(t))+";",r='
'+o.display.html()+"
";if(t.prepend(r),(i=t.children(".ogx_overlay").first()).off("transitionend"),o.anim)switch(o.anim){case OGX.Overlay.FADE:setTimeout((function(){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){s(!1);var t=!1;if(void 0===e||!0===e?o.anim&&(t=o.anim):t=e,i){if(t){switch(t){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)})):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('
'),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,e.hasOwnProperty("placeholder")&&(this.pholder=e.placeholder),this.placeholder(e)},OGX.Placeholder.prototype.placeholder=function(e){var t;if("object"==typeof e["node:OML"]&&!Array.isArray(e["node:OML"])){var i=this.selector;for(var n in this.pholder&&(i+=" "+this.pholder),e["node:OML"])0===n.indexOf("default")&&(t=n.replace("default",i),e["node:OML"][t]=e["node:OML"][n],delete e["node:OML"][n])}},OGX.Placeholder.prototype.placeholders=function(e,t){if(void 0!==e&&void 0!==t){e.hasOwnProperty("node:OML")||(e["node:OML"]=[]);var i,n,a=e["node:OML"];a&&"string"==typeof a&&(0===a.indexOf("{{")?e["node:OML"]=OGX.OSE.exec(a):e["node:OML"]=OGX.Cache.read("oml",e["node:OML"]));for(var o=0;o=i.points[t].min&&oi.left&&t.lefti.top&&t.topscreen.width&&(e=screen.width),t>screen.height&&(t=screen.height);var i=r.width,n=r.height;if(_||(i=OGX.Data.getBestSize(e,i),n=OGX.Data.getBestSize(t,n)),r.center)"string"==typeof i&&(i=-1!==i.indexOf("%")?Math.round(e*Number(i.substr(0,i.length-1))/100):Number(i)),"string"==typeof n&&(n=-1!==n.indexOf("%")?Math.round(t*Number(n.substr(0,n.length-1))/100):Number(n)),x=Math.round(e/2-i/2),y=Math.round(t/2-n/2),r.drag&&(r.center=!1);else{var a=s.position();x=a.left,y=a.top,x>e&&(x=e-x),x<-i&&(x=0),y>t&&(y=t-n),y<0&&(y=0)}return{x:x,y:y,w:i,h:n}}function S(e,t,i,a,o,l){var c=!1,h=null;if(void 0===l&&(l=!1),void 0!==t&&!0!==t||(t=r.anim),t&&(c=t),!t&&p&&(c=p),t?n.el.removeClass(d+"_notrans"):n.el.addClass(d+"_notrans"),e?(n.front(),l||n.el.trigger(OGX.Popup.SHOW,n)):l||n.el.trigger(OGX.Popup.HIDE,n),c){var f={};switch(h=d+"_"+c,c){case OGX.Popup.SCALE:u[1]=e?"scale(1,1)":"scale("+r.anim_param.scale+", "+r.anim_param.scale+")",f.transform=u.join(" ");break;case OGX.Popup.FADE:f.opacity=e?1:0}e&&(s.css("display","flex"),f.visibility="visible",f.display="flex"),t||e||(f.visibility="hidden",f.display="none"),setTimeout((function(){s.css(f)}),50),t?(p=c,s.on("transitionend",(function(){s.off("transitionend"),e?n.resizeNodes():s.css({display:"none",visibility:"hidden"}),h&&s.removeClass(h),L(i,a,o)})),h&&s.addClass(h)):(s.removeClass(h),L(i,a,o))}else e?s.css({opacity:e,display:"flex",visibility:"visible"}):s.css({display:"none",visibility:"hidden"}),L(i,a,o)}function L(e,t,i){void 0!==e&&e&&e(t),void 0!==i&&i&&i(n.id)}function M(e){e?s.on(n.touch.down,"."+d+"_button",k):s.off(n.touch.down,"."+d+"_button",k)}function k(e){e.preventDefault(),e.stopImmediatePropagation();var t=$(this);if(!t.hasClass(d+"_button_disabled")){var i=t.index();s.trigger(OGX.Popup.CLICK_BUTTON,{index:i,value:r.buttons[i].label}),r.buttons[i].hasOwnProperty("callback")&&r.buttons[i].callback&&(r.buttons[i].hasOwnProperty("params")?r.buttons[i].callback.apply(null,[r.buttons[i].params]):r.buttons[i].callback())}}function I(){for(var e,t="",i=0;i0&&(e=r.buttons[i].enabled?"":d+"_button_disabled",t+=''+r.buttons[i].label+"");return t}function N(e,t){void 0===t&&(t=!0),r.buttons=new OGX.List(e);for(var i=0;i";return t}this.anim=null,this.group=r.group,this.x=0,this.y=0,this.z=0,this.construct=function(){},this.enable=function(){return this.enableResize(),r.icons&&r.icons.length&&A(!0),r.buttons&&r.buttons.length&&r.buttons_enabled&&M(!0),this},this.disable=function(){return this.disableResize(),r.icons&&r.icons.length&&A(!1),r.buttons&&r.buttons.length&&r.buttons_enabled&&M(!1),this},this.show=function(e,t,i){return S(1,e,t,i),this.focus(1),this},this.hide=function(e,t,i,n,a){return S(0,e,t,i,n,a),this.blur(1),this},this.resize=function(){return b(),this},this.maximize=function(){return r.maximize&&!m&&(m=!0,v={width:r.width,height:r.height,x:this.x,y:this.y},r.width=r.height="100%",b(!1),this.x=this.y=0,this.move(this.x,this.y)),this},this.normalize=function(){return r.maximize&&m&&(m=!1,r.width=v.width,r.height=v.height,b(!1),this.x=v.x,this.y=v.y,v=null,this.move(this.x,this.y)),this},this.destroy=function(){s.off("transitionend"),this.touch.wipe()},this.buttons=function(e){if(void 0===e)return r.buttons;N(e)},this.enableButton=function(e){return r.buttons[e].enabled=!0,l.children("."+d+"_button:eq("+e+")").removeClass(d+"_button_disabled"),r.buttons_enabled||(r.buttons_enabled=!0),this},this.disableButton=function(e){return r.buttons[e].enabled=!1,l.children("."+d+"_button:eq("+e+")").addClass(d+"_button_disabled"),this},this.enableButtons=function(){if(r.buttons.length)for(var e=0;e',r.icon&&(a+='
"),r.title&&(a+='
'+r.title+"
"),a+='
',r.icons&&(a+=Y()),a+="
");var o,c=1;if(u=["translate3d("+e.x+"px, "+e.y+"px, 0)"],r.anim)switch(r.anim){case OGX.Popup.FADE:c=0,o=d+"_fade";break;case OGX.Popup.SCALE:o=d+"_scale",u[1]="scale("+r.anim_param.scale+", "+r.anim_param.scale+")"}a+='
',r.html?a+=r.html:r.template&&(a+=OGX.Templater.make(OGX.Templater.get(r.template),r.data)),a+="
",r.buttons&&r.buttons.length&&(a+='
',a+=I(),a+="
"),s.html(a),s.css({width:t,height:i,opacity:c,transform:u.join(" "),"z-index":n.z}),r.anim&&s.addClass(o),n.el=s,l=s.children("."+d+"_buttons").first()}(),r.drag){var e={x:!0,y:!0,cb_down:T,cb_up:E,target:"."+d+"_head"};r.group?e.cb_drag=D:"function"==typeof r.drag&&(e.cb_drag=function(e){r.drag(n,e)}),n.touch.add("Drag",e)}if(r.resize&&n.setResize({top:!1,cb_resize:O,cb_down:G,cb_up:X}),r.hasOwnProperty("html")&&r.html)r["node:OML"]=[{"default:Html":{html:r.html}}];else if(r.hasOwnProperty("view")&&r.view){var t={};t["default:Views."+r.view.id]=r,r["node:OML"].push(t)}n.placeholders(r,["."+d+'[data-ogx-id="'+r.id+'"] > .'+d+"_body"]),r.overlay&&n.addOverlay(),n.observe(!0,undefined,(function(){n.resizeNodes(),n.observe(!1),r.show&&n.show()}))}()},OGX.Popup.FADE="fade",OGX.Popup.SCALE="scale",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,a,o,r,s,l,c=this,d=e,u={enabled:!0,top:!0,left:!0,right:!0,bottom:!0,min_width:100,min_height:100,max_width:0,max_height:0,border:10,cb_up:!1,cb_down:!1,cb_resize:!1},h=!1,f="mousedown",g="mouseup",_="mousemove",p=(d=!1,!1),m=!1,v={w:0,h:0};function y(e){d&&(e?c.el.on(f,x):c.el.off(f,x))}function x(e){var u=T(e);n=u.pageX,a=u.pageY;var h=c.el.position();t=h.left,i=h.top;var f=c.el.offset(),g=n-f.left,_=a-f.top;v.w=c.el.width(),v.h=c.el.height(),o=0,r=0,s=0,l=0,d.top&&_c.el.height()-d.border&&(l=1),d.left&&gc.el.width()-d.border&&(s=1),p=-1!==window.getComputedStyle(c.el[0],"width"),m=-1!==window.getComputedStyle(c.el[0],"height"),(s||l)&&(e.preventDefault(),c.hasOwnProperty("dragable")&&c.dragable&&c.touch.drag.disable(),O(!0),w(!0),d.cb_down&&d.cb_down())}function O(e){e?h||(h=setInterval(b,5)):h&&(clearInterval(h),h=!1)}function b(){if(-1===s||-1===l){var e=t,n=i;o&&s&&(e+=o),r&&l&&(n+=r),o&&-1===s&&r&&1===l&&(n=i),c.el.css("transform","translate3d("+e+"px, "+n+"px, 0)")}s&&v.w+o*s>d.min_width&&(p?c.el.width(Math.round(100*(v.w+o*s)/c.el.parent().width()*100)/100+"%"):c.el.width(v.w+o*s)),l&&v.h+r*l>d.min_height&&(m?c.el.height(Math.round(100*(v.h+r*l)/c.el.parent().height()*100)/100+"%"):c.el.height(v.h+r*l)),(o||r)&&(d.cb_resize?d.cb_resize():c.el.trigger(OGX.Resize.RESIZING))}function w(e){e?($("body").on(_,G),$("body").on(g,X)):($("body").off(_,G),$("body").off(g,X))}function G(e){e.preventDefault(),e.stopImmediatePropagation(),e=T(e),o=e.pageX-n,r=e.pageY-a}function X(e){O(!1),w(!1),e=T(e),o=e.pageX-n,r=e.pageY-a,d.cb_up&&d.cb_up(),c.hasOwnProperty("dragable")&&c.dragable&&(y(!1),c.touch.drag.enable(),setTimeout((function(){y(!0)}),0))}function T(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,u,!1),d=e},this.enableResize=function(){return y(!0),this},this.disableResize=function(){return y(!1),this},this.destroy=function(){this.touch.wipe()},OGX.Data.merge(d,u,!1),void 0===window.ontouchstart||d.chromeos||(f="touchstart",_="touchmove",g="touchend"),c.hasOwnProperty("dragable")&&c.dragable&&(c.touch.drag=c.touch.add("Drag",{state:"manual"}))},OGX.Resize.RESIZING="resizeResizing",require("Roulette","Uxi","Bind","Touch"),OGX.Roulette=function(e){construct(this,"Roulette");var t,i,n,a,o,r,s,l=this,c=e,d={force_coef:10,time_coef:.1,min_force_pitch:2,value:null,name:!1,required:!1,display:!1,key:"value",mode:OGX.Roulette.MODE_REWIND,icon:!1,list:new OGX.List,capture:!1},u={template:!1,html:'{{$label}}',css:!1},h="object",f=0,g=0,_="ogx_roulette";function p(e,t){void 0===t&&(t=!0),l.el.children('input[name="'+c.name+'"]').val(e),t&&l.el.children('input[name="'+c.name+'"]').trigger("change")}function m(e){e?t.on(l.touch.down,"."+_+"_icon",(function(e){e.preventDefault(),e.stopImmediatePropagation(),l.next(!0)})):t.off(l.touch.down,"."+_+"_icon")}function v(e){e?t.on("change","input[type=hidden]",y):t.off("change","input[type=hidden]",y)}function y(e){e.preventDefault(),e.stopImmediatePropagation(),l.loopval(0,OGX.Data.stringToVal(e.target.value),!1)}function x(e){return g+e>c.list.length-1?c.list[0]:g+e<0?c.list[c.list.length-1]:c.list[g+e]}function O(e){a=e.y,G(!0)}function b(e){var t;e.dirY!==o?(t=0,a=e.pt1.y):(t=e.pt1.y-a,a=e.pt1.y),o=e.dirY,i.css({transition:"none",transform:"translate3D(0px, "+(D(i)+t)+"px, 0px)"})}function w(e){G(!1),trans=D(i);var t=Math.round(trans/n)*n,a=Math.round(t/n%c.list.length);if(a=a<=0?Math.abs(a):c.list.length-a,g!==a){switch(g=a,h){case"string":c.value=c.list[g];break;case"object":c.value=c.list[g][c.key]}c.name&&l.el.children('input[name="'+c.name+'"]').val(c.value).trigger("input"),l.el.trigger(OGX.Roulette.CHANGE,c.value)}i.css({transition:"all 0.2s ease-out",transform:"translate3D(0px, "+t+"px, 0px)"})}function G(e){e?r=setInterval(X,10):clearInterval(r)}function X(){var e,t,a;(e=Math.floor((i.position().top+n*o)/(n*c.list.length)*-1))!==f&&(0===i.children("."+_+'_stripe[data-id="'+e+'"]').length&&((t=s.clone()).css("top",e*(n*c.list.length)+"px"),t.attr("data-id",e),i.append(t)),i.children("."+_+"_stripe").each((function(e,t){a=i.position().top+$(t).position().top,(Math.ceil(a+n*c.list.length)<-n||a>n)&&$(t).remove()})),f=e)}function T(){G(!1),i.off("transitionend",T)}function E(){var e="",a="";c.icon&&(a+='
'),a+='
';for(var o=0;o<2;o++){a+='
';for(var r=0;r'+e+"
"}a+="
"}if(a+="
",c.icon&&(a+='
'),void 0===g&&(g=0),c.name){var l="";switch(c.required&&(l=" required"),h){case"string":a+='";break;case"object":a+='"}}t.html(a),i=t.children("."+_+"_stripes").first(),c.icon&&(i=t.children("."+_+"_container").children("."+_+"_stripes").first()),s=(s=i.children("."+_+"_stripe:last")).detach();var d=g*n*-1;i.css({transition:"none",transform:"translate3D(0px, "+d+"px, 0px)"})}function D(e){var t=0;return"none"!==e.css("transform")&&(t=Number(e.css("transform").split(",")[5].split(")")[0])),t}function C(e){switch(h){case"string":return{index:c.list.indexOf(e)};case"object":return c.list.findIndex(c.key,e)}}function S(){c.list.length>0&&!c.list.hasOwnProperty("insert")&&(c.list=new OGX.List(c.list)),"string"==typeof c.list[0]&&(h="string"),1===c.list.length&&(c.list[1]=c.list[0])}this.enable=function(){return t.removeClass(_+"_disabled"),c.icon&&m(!0),c.name&&v(!0),this},this.disable=function(){return t.addClass(_+"_disabled"),c.icon&&m(!1),c.name&&v(!1),G(!1),this},this.bindFilter=function(e,t,i){return c.list.removeFilter(e),c.list.addFilter(e,t,i),c.list.filter(),setTimeout(E,0),this},this.destroy=function(){this.touch.wipe()},this.bindRender=function(e,t){},this.val=function(e,t){if(void 0!==e){var a=C(e).index;return a>-1&&(!function(e,t){void 0===t&&(t=!0);i.off("transitionend",T),G(!1),o=-1;var a=D(i),r=Math.round(a/n)*n,s=a-r,l=Math.round(r/n%c.list.length);l=l<=0?Math.abs(l):c.list.length-l;var d=l-e;c.mode===OGX.Roulette.MODE_CLOSEST&&d>c.list.length/2&&(d=-1*(c.list.length-l+e));var u=a+d*n-s,h=20*Math.round(Math.abs(d*n)*c.time_coef);G(!0),i.on("transitionend",T),i.css({transition:"all "+h+"ms ease-out",transform:"translate3D(0px, "+u+"px, 0px)"}),g=e}(a),c.name&&p(e,!1)),this}switch(h){case"string":return c.list[g];case"object":return c.list[g][c.key]}},this.item=function(){return c.list[g]},this.loopval=function(e,t,a){var o=g,r=C(t).index;r>-1&&(g=r);var s=o-r,l=c.time_coef*Math.abs(s+e*c.list.length);return G(!0),i.css({transition:"all "+l+"s ease-out",transform:"translate3D(0px, "+(D(i)+(s*n-c.list.length*n*e))+"px, 0px)"}),i.on("transitionend",T),c.name&&p(t,a),void 0!==a&&a&&this.el.trigger(OGX.Roulette.CHANGE,val),this},this.next=function(e){var t,i=x(1);switch(o=1,h){case"string":t=i;break;case"object":t=i[c.key]}return this.val(t),void 0!==e&&e&&(this.el.trigger(OGX.Roulette.CHANGE,t),c.name&&this.el.children('input[name="'+c.name+'"]').trigger("input")),this},this.prev=function(e){var t,i=x(-1);switch(h){case"string":t=i;break;case"object":t=i[c.key]}return this.val(t),void 0!==e&&e&&(this.el.trigger(OGX.Roulette.CHANGE,t),c.name&&this.el.children('input[name="'+c.name+'"]').trigger("change")),this},this.setData=function(e,t){return c.value=t,c.list=e,S(),g=void 0===t?0:C(t).index,setTimeout(E,0),this},function(){if(OGX.Data.merge(c,d),S(),c.display?c.display=new OGX.Display(c.display):c.display=new OGX.Display(u),(t=l.el=$(c.el)).addClass(_),t.width(),n=t.height(),c.list.length){var e=t.parent();e[0].hasAttribute("data-value")&&(c.value=OGX.Data.stringToVal(e.data("value")),e.removeAttr("data-value")),null===c.value&&(c.value=c.list[0],"object"==typeof c.value&&(c.value=c.value.value)),g=C(c.value).index}}(),l.observe(!0,{childList:!0},(function(){l.observe(!1),l.touch.swipe=l.touch.add("Swipe",{x:!1,y:!0,cb_down:O,cb_swipe:b,cb_up:w,target:'.ogx_roulette[data-ogx-id="'+l.id+'"] > .ogx_roulette_container',capture:c.capture})}),null),E()},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,a=this,o=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;t0&&(e=s[t-1].roulette.val()),0===t||t-1>=0&&null!==e&&String(e).length>0?s[t].roulette.focus():t>0&&_(s[t].roulette)}function d(e,a){e.stopImmediatePropagation();var o,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+10&&s[a].roulette.setData(g(i),t),i.push(t)));setTimeout(c,0)}function g(e){for(var t=o.data,i=0;i-1?h(n):{};f(e)},o=OGX.Data.merge(o,r),(t=a.el).addClass("ogx_roulette_tree"),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('
'),i=o.groups[c-1],e=[{label:i,value:"",head:!0}],l)e.push({label:u,value:u});d=a.create("Roulette",{el:'.ogx_roulette_tree[data-ogx-id="'+a.id+'"] .ogx_roulette_tree_roulette[data-ogx-roulette="'+c+'"]',list:e,icon:o.icon,value:null,name:i,required:o.required}),n>1&&_(d),s.push({roulette:d,group:i,id:d.id})}if(ce.unix+e.expiration)}function getCache(e){if(void 0===e)return!1;for(var t,i,n=0;n0}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","Touch"),OGX.Scroller=function(e){construct(this,"Scroller");var t,i,n,a,o,r,s,l,c,d,u,h=this,f=e,g={check_delay:30,fade_delay:300,css:!1,zindex:9999,observe:!0,auto_scroll:!1,scroll_callback:!1,trigger:!0},_=0,p="init",m=!1,v=!1,y=null;function x(e){e?i.on(h.touch.down,O):i.off(h.touch.down,O)}function O(e){e=h.event(e),S(!1),G(!0),b(!0),x(!1),L("in"),D(!0)}function b(e){e?(d=setInterval(E,10),i.on(h.touch.move,w)):(clearInterval(d),i.off(h.touch.move,w))}function w(e){e=h.event(e)}function G(e){e?$(document).on(h.touch.up,X):$(document).off(h.touch.up,X)}function X(){b(!1),G(!1),x(!0),D(!1),L("out")}function T(e){e?(window.addEventListener("resize",I),i.on("scroll",(function(e){e.stopImmediatePropagation(),E()})),i.on("wheel",(function(e){D(!0)})),void 0!==OGX.NestedList&&$(document).on(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED,(function(){h.update()}))):(window.removeEventListener("resize",I),i.off("scroll"),i.off("wheel"),void 0!==OGX.NestedList&&$(document).off(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED))}function E(){var e,a=(e=i.scrollTop())/s,r=Math.round(o.position().top);o.css("top",a+"px"),f.trigger&&!m&&(h.el.trigger(OGX.Scroller.SCROLL,{top:e,percent:100*e/n}),-1*e==i.outerHeight(!0)-t.outerHeight(!0)?r!==Math.round(a)&&h.el.trigger(OGX.Scroller.BOTTOM):0===e&&(r&&r!==Math.round(a)||!r)&&h.el.trigger(OGX.Scroller.TOP)),f.scroll_callback&&f.scroll_callback()}function D(e){e?(c&&D(!1),l=t.position().top,c=setInterval(C,f.check_delay-10)):(c&&(clearInterval(c),c=null),v=!1,h.el.trigger(OGX.Scroller.END))}function C(){var e=t.position().top;e!==l?(v||(v=!0,h.el.trigger(OGX.Scroller.START)),L("in")):L("out"),l=e}function S(e){e?u=setInterval(E,f.check_delay):clearInterval(u)}function L(e){o.hasClass("ogx_scroller_track_anim")||o.addClass("ogx_scroller_track_anim"),"in"===e?(clearTimeout(y),y=null,o.addClass("ogx_scroller_track_anim_fade_in").removeClass("ogx_scroller_track_anim_fade_out")):y||(y=setTimeout((function(){o.addClass("ogx_scroller_track_anim_fade_out").removeClass("ogx_scroller_track_anim_fade_in")}),f.fade_delay))}function M(e){e?h.observe(!0,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","src","width","height"]},k):h.observe(!1)}function k(){_!==t.height()&&(_=t.height(),I(),f.auto_scroll&&h.bottom())}function I(){if(a=i.innerHeight(),n=t.height(),s=n/a,n>a){var e=Math.round(a/s);o.css("height",e+"px"),r.css("display","block")}else r.css("display","none");"init"===p&&(p=OGX.Scroller.READY,h.el.trigger(OGX.Scroller.READY))}this.enable=function(){return I(),T(!0),f.observe&&setTimeout((function(){M(!0)}),0),x(!0),this},this.disable=function(){return T(!1),f.observe&&M(!1),G(!1),b(!1),x(!1),D(!1),S(!1),o.removeClass("ogx_scroller_track_anim_fade_in"),o.removeClass("ogx_scroller_track_anim_fade_out"),this},this.resize=function(){return I(),this},this.destroy=function(){h.el.removeClass("ogx_scroller_outer"),t.remove(),r.remove()},this.top=function(){return n>a&&(i[0].scrollTop=0,I()),this},this.bottom=function(){return n>a&&(i.scrollTop(n),I()),this},this.scroll=function(e){return void 0===e?i[0].scrollTop:(i[0].scrollTop=e,I(),this)},this.mute=function(){return m=!0,this},this.vocal=function(){return m=!1,this},this.container=function(){return t},this.inner=function(){return t[0]},this.outer=function(){return i[0]},this.state=function(){return p},OGX.Data.merge(f,g),function(){h.el=$(f.el),h.el.addClass("ogx_scroller_outer ogx_hw"),(i=h.el).html('
'),t=i.children(".ogx_scroller_inner");var e='
';i.parent().append(e),r=i.parent().find(".ogx_scroller_track"),o=r.find(".ogx_scroller_track_button")}(),I()},OGX.Scroller.READY="ScrollerReady",OGX.Scroller.TOP="ScrollerTop",OGX.Scroller.BOTTOM="ScrollerBottom",OGX.Scroller.SCROLL="ScrollerScroll",OGX.Scroller.START="ScrollerStart",OGX.Scroller.END="ScrollerEnd",require("StackedTree","Uxi","Touch"),OGX.StackedTree=function(e){construct(this,"StackedTree");var t,i,n,a,o=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?(t.on(o.touch.down,".ogx_stacked_tree_level .ogx_stacked_tree_level_prev",g),t.on(o.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';e>0&&(r=(r=a.css(u)).replace(h+"_door",""),c+='
'+a.html(u)+"
"),c+='
',i.append(c);var d=i.children("."+h+'_level[data-level="'+e+'"]').children("."+h+"_level_list");i.children("."+h+"_level").css("flex-basis",Math.floor(100/(e+1)*100)/100+"%"),function(e,t,i){l[e]&&o.remove(l[e].id,"DynamicList");var n=o.create("DynamicList",{el:t,mode:"static",scroll:!0,display:s.display,displays:s.displays,list:i});l[e]=n}(e,d[0],t)}function v(e,t){f(!1),i.addClass(h+"_anim"),void 0!==t&&t?i.on("transitionend",(function(){i.off("transitionend"),i.removeClass(h+"_anim").css("width",100*(e+1)+"%"),o.remove(l[e+1].id,OGX.DynamicList.NAME),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,f(!0)})):(d=e,f(!0)),n=i.width(),i.css("transform","translateX("+e*Math.round(n/c.length)*-1+"px)")}this.enable=function(){return f(!0),_(!0),this},this.disable=function(){return f(!1),_(!1),this},this.resize=function(){return p(),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},function(){s=OGX.Data.merge(s,r,!1,!0);var e=(a=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){var t=['{{return typeof($items) !== "undefined" && $items.length > 0}}',{add:"ogx_stacked_tree_door"}];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",e.css.hasOwnProperty("conditions")?e.css.conditions.push(t):e.css.conditions=[t];else{var i="";e.css&&(i=e.css),i+=" ogx_stacked_tree_item",e.css={add:i,conditions:[t]}}else e.css={add:"ogx_stacked_tree_item",conditions:[t]};return e}return e}(e),a.val(e),s.display=e.display,s.displays=e.displays,(t=o.el).addClass(h),s.list.length){var i=s.list.slice();s.list={items:i}}}(),t.html('
'),i=t.children("."+h+"_container").first(),s.list.items.length&&m(c[0],s.list.items)},OGX.StackedTree.BACK="StackedTreeBack",OGX.StackedTree.ENTER="StackedTreeEnter",OGX.StackedTree.SELECT="StackedTreeSelect",require("Stage","Uxi","Touch","Placeholder"),OGX.Stage=function(e){construct(this,"Stage");var t=this,i=OGX.Data.merge({id:"stage",anim:null,group_watch:!1},e,!0,!0);function n(e){e?t.el.on(t.touch.down,".ogx_stage_exit",(function(){app.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.enable=function(){return i.closeable&&n(!0),this},this.disable=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 a="";i.closeable&&(a='
');var o=e.html();i.hasOwnProperty("data")&&(o=OGX.Templater.make(o,i.data)),a+=o,container=t.el,container.html(a),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,a={el:"document",bind:!1,labels:!0,data:[{label:"OFF",value:!1},{label:"ON",value:!0}],value:!1,name:!1},o="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("."+o+"_dot").first(),a=t.find("."+o+"_label").first(),r=t.find("."+o+"_label").last();n.value==n.data[0].value?(i.removeClass(o+"_dot_right").addClass(o+"_dot_left"),a.removeClass(o+"_label_off").addClass(o+"_label_on").addClass(o+"_selected"),r.removeClass(o+"_label_on").addClass(o+"_label_off").removeClass(o+"_selected")):(i.removeClass(o+"_dot_left").addClass(o+"_dot_right"),r.removeClass(o+"_label_off").addClass(o+"_label_on").addClass(o+"_selected"),a.removeClass(o+"_label_on").addClass(o+"_label_off").removeClass(o+"_selected")),n.name&&t.find('input[type="hidden"]').attr("value",n.value),e&&t.children("."+o+"_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),t.trigger(OGX.Switch.CHANGE,n.value),t.children("."+o+"_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.enable=function(){return l(!0),n.name&&d(!0),t.removeClass(o+"_disabled"),this},this.disable=function(){return l(!1),n.name&&d(!1),t.addClass(o+"_disabled"),this},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("."+o+"_val").first().trigger("input")),n.value},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,a),void 0!==e&&(n.value=e),(t=i.el).addClass(o+"_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+=''+n.data[0].label+"");var i="";n.value===n.data[1].value&&(i=o+"_dot_right"),e+='
',n.labels&&(e+=''+n.data[1].label+""),n.name&&(e+=''),t.html(e),t.addClass(o)}(),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,a={editable:!0,detachable:!1,detach_min:20,reorder:!0,icons:!1,index:0,list:new OGX.List,display:{html:"",css:""}},o=!1,r=0,s=!1,l=!1,c=!1,d=!1,u=!1,h={x:0,y:0},f="ogx_tabs";function g(){for(var e,i,a='
',s=0;s',e&&(a+=''+e+""),n.editable&&(a+=''),a+="
",i="";a+="",n.editable&&(a+='
',t.addClass(f+"_editable")),t.html(a),o=t.children("."+f+"_container").children("."+f+"_tab:eq("+r+")")}function _(e){s||(u=!1,l=$(e),c={from:l.index()},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"),o=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),d=setInterval(m,5))}function p(e,a){if(s)if(u=a,Math.abs(a.x)>Math.abs(a.y)){var o=s.x+a.x;s.el.css("transform","translate3d("+o+"px, "+s.y+"px, 0px)")}else{var r=s.y+a.y;if(s.el.css("transform","translate3d("+s.x+"px, "+r+"px, 0px)"),Math.abs(a.y)>4){c.to=l.index(),v();var d=n.list[c.from];"object"==typeof d&&(d=d.label);var h={label:d,index:c.to};i.removeAt(c.to),t.trigger(OGX.Tabs.REMOVE,h)}}}function m(){var e,i,n;s&&u&&(idx=l.index(),Math.abs(u.x)>Math.abs(u.y)&&t.children("."+f+"_container").children("."+f+"_tab").each((function(t,a){(e=$(a)).hasClass(f+"_tab_active")||(i=e.position(),n=e.width(),idx!==t&&(s.x+u.x>i.left+n/2&&s.x+u.xi.left&&s.x+u.xe&&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(g,0),this},this.removeCurrent=function(){return o&&this.removeTabAt(r),this},this.removeAt=function(e){return n.list.delete(e)&&(t.children("."+f+"_container").first().children("."+f+"_tab:eq("+e+")").remove(),o=null,function(){r>0?r--:r=0;i.index(r)}()),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?(o&&(o.removeClass(f+"_tab_active"),o=null),(o=t.children("."+f+"_container").first().children("."+f+"_tab:eq("+e+")")).addClass(f+"_tab_active"),r=e,!0):o?r:-1},this.select=function(e){o&&o.removeClass(f+"_tab_active");var t=n.list.findIndex("label",e);return this.index(t.index),this},n||(n={}),OGX.Data.merge(n,a),n.list.hasOwnProperty("insert")||(n.list=new OGX.List(n.list)),n.display.hasOwnProperty("_NAME_")||(n.display=new OGX.Display(n.display)),(t=i.el).addClass(f),n.editable&&t.addClass(f+"_editable"),r=n.index,setTimeout(g,0),n.reorder&&i.touch.hold.set({target:".ogx_tabs_tab",cb_hold:_,cb_move:p,cb_up:v})},OGX.Tabs.SELECT="TabsSelect",OGX.Tabs.CLOSE="TabsClose",OGX.Tabs.REORDER="TabsReoroder",OGX.Tabs.ADD="TabsAdded",OGX.Tabs.REMOVE="TabsRemoved",require("Tags","Uxi","Touch"),OGX.Tags=function(__config){construct(this,"Tags");var that=this,config=__config,config_default={remove:!0,add:!0,name:!1,tags:[],current_tags:[],tags_ascii:[],mode:OGX.Tags.MODE_STRING,keycode:13,placeholder:"keywords",restrict:!1,strict:!1,required:!1,max:0,display_max:0,display_more:!1,click_more:!1,hide_input_on_disable:!0,more_word:"other"},container,input,sliced={org:[],rem:[]};function updateHidden(e){var t;t=1===config.max&&config.current_tags.length?config.current_tags[0]:JSON.stringify(config.current_tags),container.find("input[type=hidden]").val(t),e&&container.find("input[type=hidden]").trigger("change")}function addTag(e){var t=!1;switch(config.mode){case OGX.Tags.MODE_STRING:case OGX.Tags.MODE_ASCII:-1===config.current_tags.indexOf(e)&&(config.current_tags.push(e),t=!0);break;case OGX.Tags.MODE_OBJECT:var i=config.current_tags.find("label",e,1);i||((i=config.tags.find("label",e,1))?config.current_tags.push(i):config.current_tags.push({label:e}),t=!0)}if(t){var n="";!0===config.remove&&(n='');var a=''+e+""+n+"";container.find(".ogx_tags_tags").first().append(a),listenHidden(!1),updateHidden(!0),listenHidden(!0),container.trigger(OGX.Tags.TAG_ADDED,e),container.trigger(OGX.Tags.CHANGE,[config.current_tags])}container.find(".ogx_tags_input").trigger("focus")}function removeTag(e){var t=!1;switch(config.mode){case OGX.Tags.MODE_STRING:case OGX.Tags.MODE_ASCII:var i=config.current_tags.indexOf(e);i>-1&&(t=config.current_tags.splice(i,1));break;case OGX.Tags.MODE_OBJECT:t=config.current_tags.findDelete("label",e)}return t&&container.find(".ogx_tags_tags").first().find(".ogx_tags_tag").each((function(t,i){if($(i).find("span").first().text()===e)return $(i).remove(),listenHidden(!1),updateHidden(!0),void listenHidden(!0)})),t}function displayTags(e,t){if(e){container.find(".ogx_tags_container").length>0&&(displayTags(!1),listenTagAdd(!1));for(var i='
',n=!1,a=0;a";break;case OGX.Tags.MODE_OBJECT:i+=''+t[a].label+""}n&&(i+='+'+n+" "+config.more_word+""),i+="
",container.append(i),listenTagAdd(!0)}else container.find(".ogx_tags_container").remove(),listenTagAdd(!1)}function renderTags(e){for(var t="",i="",n=0;n':"",config.mode){case OGX.Tags.MODE_STRING:case OGX.Tags.MODE_ASCII:t+=''+e[n]+""+i+"";break;case OGX.Tags.MODE_OBJECT:t+=''+e[n].label+""+i+""}return config.current_tags=e,container.find(".ogx_tags_tags").first().html(t),updateHidden(!1),!0}function trimTags(e){return e=OGX.Data.clone(e),sliced={org:OGX.Data.clone(e),rem:[]},Array.isArray(e)&&config.display_max&&e.length>config.display_max&&(sliced.rem=e.slice(config.display_max),e=e.slice(0,config.display_max)),config.display_more&&sliced.rem.length&&e.push({__m__:sliced.rem.length}),new OGX.List(e)}function findTags(e){for(var t,i=[],n=0;n=3)if(!config.strict&&e.which===config.keycode&&config.add)addTag(t),input.val(""),displayTags(!1);else{var i;switch(config.mode){case OGX.Tags.MODE_STRING:i=findTags(t);break;case OGX.Tags.MODE_OBJECT:i=findTagsObj(t);break;case OGX.Tags.MODE_ASCII:i=findTagsAscii(t)}i.length>0?displayTags(!0,i):displayTags(!1)}else displayTags(!1)})):input.off("keyup")}function listenSelect(e){e?container.on(that.touch.down,".ogx_tags_tag",onSelect):container.off(that.touch.down,".ogx_tags_tag",onSelect)}function onSelect(e){var t=$(this).text();switch(config.mode){case OGX.Tags.MODE_OBJECT:t=config.current_tags.get({label:{eq:t}},null,1)}that.el.trigger(OGX.Tags.SELECT,t)}function listenMore(e){e?container.on(that.touch.down,".ogx_tags_more",onMore):container.off(that.touch.down,".ogx_tags_more",onMore)}function onMore(e){e.preventDefault(),e.stopImmediatePropagation(),sliced.rem.length&&($(this).remove(),displayTags(!0,sliced.org))}function listenTagAdd(e){e?container.on(that.touch.down,".ogx_tags_container_tag",onAdd):container.off(that.touch.down,".ogx_tags_container_tag",onAdd)}function onAdd(e){addTag($(this).text()),input.val(""),displayTags(!1),config.max&&config.current_tags.length===config.max&&(listenInput(!1),input.css("display","none"))}function listenTagRemove(e){e?container.on(that.touch.down,".ogx_tags_remove",onRemove):container.off(that.touch.down,".ogx_tags_remove",onRemove)}function onRemove(e){e.preventDefault(),e.stopImmediatePropagation();var t=removeTag($(this).parent("span").first().find("span").first().text());container.trigger(OGX.Tags.TAG_REMOVED,t),container.trigger(OGX.Tags.CHANGE,[config.current_tags]),config.max&&config.current_tags.length'),config.name){var t="";config.required&&(t="required"),e+='"}if(container.html(e),input=container.find(".ogx_tags_input").first(),config.restrict){var i={multiline:!1,max:30};"object"==typeof config.restrict&&(i=config.restrict),i.el=input[0],OGX.Form.restrictField(i)}}function initDefaults(){for(var a in config||(config={}),config_default)config.hasOwnProperty(a)||(config[a]=config_default[a]);config.tags.hasOwnProperty("insert")||(config.tags=new OGX.List(config.tags)),config.current_tags.hasOwnProperty("insert")||(config.current_tags=new OGX.List(config.current_tags)),config.restrict&&("string"==typeof config.restrict.allowed&&(config.restrict.allowed=eval(config.restrict.allowed)),"string"==typeof config.restrict.forbidden&&(config.restrict.forbidden=eval(config.restrict.forbidden))),container=that.el,container.addClass("ogx_tags")}function init(){initDefaults(),initInput(),config.current_tags.length>0&&renderTags(config.current_tags)}this.enable=function(){if(config.remove&&(listenInput(!0),listenTagAdd(!0),listenTagRemove(!0)),config.display_more&&config.click_more&&listenMore(!0),config.name&&listenHidden(!0),listenSelect(!0),config.add){var e=container.find(".ogx_tags_input").first();e.prop("placeholder",config.placeholder),e.prop("disabled",!1),config.hide_input_on_disable&&e.removeClass("ogx_tags_hidden")}return this},this.disable=function(){if(config.remove&&(listenInput(!1),listenTagAdd(!1),listenTagRemove(!1)),config.display_more&&config.click_more&&listenMore(!1),config.name&&listenHidden(!1),listenSelect(!1),config.add){var e=container.find(".ogx_tags_input").first();e.prop("placeholder",""),e.prop("disabled",!0),config.hide_input_on_disable&&e.addClass("ogx_tags_hidden")}return this},this.destroy=function(){config.restrict&&OGX.Form.unrestrictField(container.find(".ogx_tags_input").first()[0])},this.tags=function(e){return void 0!==e?(e.hasOwnProperty("insert")||(e=new OGX.List(e)),config.tags=e,!0):config.tags},this.val=function(e,t){if(displayTags(!1),listenTagAdd(!1),void 0!==e){if(void 0!==t){var i=e,n=config.tags.find(i,t,1);n&&(e=[n])}return e.hasOwnProperty("insert")||(e=new OGX.List(e)),config.current_tags=e,config.max&&config.current_tags.length>=config.max&&container.find(".ogx_tags_input").first().css("display","none"),renderTags(config.current_tags)}return config.current_tags},this.wipe=function(){return config.max&&config.current_tags.length===config.max&&(container.find(".ogx_tags_input").first().css("display","block"),listenInput(!0)),config.current_tags=new OGX.List,container.find(".ogx_tags_tags").first().empty(),container.find("input[type=hidden]").first().val(""),this},this.clear=function(){return this.wipe()},this.render=function(e){return renderTags(trimTags(e))},this.add=function(e){return addTag(e)},this.remove=function(e){return removeTag(e)},init()},OGX.Tags.prototype.tagDataset=function(e,t,i){"use strict";void 0===i&&(i=!1);for(var n,a=[],o=0;o-1&&(i.includes(n.items[a][o])||i.push(n.items[a][o]));return e(n.items[a]),!0}}(e));}(e,t)},OGX.Tags.CHANGE="TagsChange",OGX.Tags.SELECT="TagsSelect",OGX.Tags.TAG_ADDED="TagsTagAdded",OGX.Tags.TAG_REMOVED="TagsTagRemoved",OGX.Tags.MODE_STRING="string",OGX.Tags.MODE_OBJECT="object",OGX.Tags.MODE_ASCII="ascii",OGX.Tags.BIND=OGX.Tags.CHANGE,OGX.Templater=function(){"use strict";var e;this.jmake=function(e,t){for(var i,n,a=JSON.stringify(e);m=/({{(\$|#)[a-z0-9_\.]*}})|("{{(\$)}}")/gi.exec(a);)m[0].match(/"{{(\$)}}"/)?(i="<-"+(i=JSON.stringify(t)).substring(1).slice(0,-1)+"->",a=(a=(a=a.replace(m[0],i)).replace(/<\-/,"{")).replace(/\->/,"}")):("object"==typeof(n=OGX.OSE.exec(m[0],t))&&(n=JSON.stringify(n),m[0]='"'+m[0]+'"'),a=a.replace(m[0],n));return JSON.parse(a)},this.make=function(t,i,n,a,o){var r,s;for(e={},void 0===o&&(o={}),OGX.Data.merge(e,o);r=/{{[^{]+(({[^{]+)+)?}}/gi.exec(t);)void 0===(s=OGX.OSE.exec(r[0],i,n,a,e))&&(s=""),t=t.replace(r[0],s);return t},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,a=this,o=e,r={anim:!1,display:!0,icon_size:50,timeout:30},s={template:!1,html:'{{$label}}'},l='
',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){a.el.trigger(OGX.Theater.HIDE);var t=app.find("Stage",e);t.wake(),t.resizeNodes();var n,r=list.el.find('.ogx_theater_stage[data-ogx-id="'+t.id+'"]').position();a.observe(!0,{childList:!0},(function(){a.observe(!1),(n=i.children(".ogx_theater_trans")).on("transitionend",(function(){n.off("transitionend"),a.hide(),n.remove(),t.url?(app.showStage(t.id,!1),app.router.addToHist(t.url)):app.goto(t.id+"/"+t.home)})),n.removeClass("ogx_theater_trans_hide"),setTimeout((function(){n.addClass("ogx_theater_trans_grow").css({opacity:1,width:"100%",height:"100%",transform:"translate3d(0px, 0px, 0px)"})}),o.timeout)}),null,i),i.append('
")}(t.id)}))):($(document).off("backbutton",u),$(window).off("popstate",u),list.el.off(OGX.DynamicList.SELECT))}function u(){a.hide()}function h(){t.prepend(l);for(var e,i=[],r=0;r .list").on(OGX.DynamicList.RENDER,(function(e){$(".ogx_theater > .list").off(OGX.DynamicList.RENDER),setTimeout((function(){l=$(".ogx_theater").detach()}),0)})),list=a.create("DynamicList",{el:".ogx_theater > .list",display:{html:o.display.html,css:"ogx_theater_stage"},key:"id",scroll:!0,mode:"hit",list:i,trigger:!0})}function f(){var e=app.gather(OGX.Stage.NAME);n=[];for(var t=0;t
"),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(o,r),o.display&&("object"!=typeof o.display&&(o.display={}),OGX.Data.merge(o.display,s),o.display.template&&(o.display.html=OGX.Templater.get(o.display.template))),(t=a.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,a){var o=new OGX.Touches[e](t),r=o.set(a);return!r.hasOwnProperty("id")&&(r.id=i++),o.id=r.id,"auto"===r.status&&!t.blured&&t.enabled&&o.enable(),n.insert(o),o},this.touch.remove=function(e){"object"==typeof e&&(e=e.id),n.findDelete("id",__id,1).disable()},this.touch.get=function(e){return n.get({id:{eq:e}},null,1)},this.touch.wipe=function(){for(var e=0;eo.x?1:-1,l=r.y>o.y?1:-1,c=Math.abs(r.x-o.x),d=Math.abs(r.y-o.y),u=Math.sqrt(Math.abs(Math.pow(r.x-o.x,2)-Math.pow(r.y-o.y,2)))}function O(){a.cb_swipe&&(a.x&&a.min_x&&c>=a.min_x||a.y&&a.min_y&&d>=a.min_y?y(0,!0):a.cb_swipe({pt0:o,pt1:r,dirX:s,dirY:l,distX:c,distY:d,dist:u}))}this.set=function(e){return a=e,OGX.Data.merge(a,n),t=i.selector,this.state=a.state,"auto"===a.state&&(i.enable,i.disable),a.target&&(t=a.target),a},this.enable=function(){!f&&a&&(f=!0,v(!0))},this.disable=function(){f&&(f=!1,v(!1),p(!1))}},OGX.Touches.Hold=function(e){"use strict";var t={cb_hold:!1,cb_up:!1,cb_move:!1,time:1e3,el:this.el,target:!1,capture:!1,state:"auto"},i=!1,n=!1,a=!1,o=!1,r=!1,s=!1,l=e,c={x:0,y:0},d={x:0,y:0},u={x:0,y:0},h={x:0,y:0},f=null;function g(e){var t=[];t=i.target?[l.touch.down,i.target,_]:[l.touch.down,_],e?l.el.on.apply(l.el,t):l.el.off.apply(l.el,t)}function _(e){e=l.event(e),f=e.currentTarget,o||(o=!0,n=(new Date).getTime(),h.x=c.x=e.pageX,h.y=c.y=e.pageY,a=setInterval(m,1))}function p(e){i.capture&&(e.preventDefault(),e.stopImmediatePropagation()),e=l.event(e),d.x=e.pageX,d.y=e.pageY,d.x5||Math.abs(c.y-d.y)>5)&&(clearInterval(a),a=!1)}function m(){o&&(new Date).getTime()-n>i.time&&(r||(r=!0,$("body").on(l.touch.move,p),i.cb_hold?i.cb_hold(f,c):l.el.trigger(OGX.Touch.HOLD_START)))}function v(t){t=e.event(t),o=!1,clearInterval(a),a=!1,r&&(r=!1,$("body").off(l.touch.move,p),i.cb_up?i.cb_up({x:t.pageX,y:t.pageY}):l.el.trigger(OGX.Touch.HOLD_END,{x:t.pageX,y:t.pageY}))}this.set=function(e){return i=e,OGX.Data.merge(i,t),l.selector,this.state=i.state,"auto"===i.state&&(l.enable,l.disable),i.target&&i.target,i},this.enable=function(){!s&&i&&(s=!0,g(!0),$("body").on(l.touch.up,v))},this.disable=function(){s&&(s=!1,(o||a)&&(r=!1,o=!1,clearInterval(a),a=!1),g(!1),$("body").off(l.touch.up,v),$("body").off(l.touch.move,p))}},OGX.Touches.Drag=function(e){"use strict";var t,i,n,a,o,r,s=!1,l={min:10,limit_x:null,limit_y:null,target:!1,cb_down:!1,cb_drag:!1,cb_up:!1,border:10,capture:!1,state:"auto"},c=e,d=!1,u=!1;function h(e){var t=[];t=s.target?[c.touch.down,s.target,f]:[c.touch.down,f],e?c.el.on.apply(c.el,t):c.el.off.apply(c.el,t)}function f(l){s.capture&&(l.preventDefault(),l.stopImmediatePropagation()),l=e.event(l),n=l.pageX,a=l.pageY;var d=c.el.position();t=d.left,i=d.top;var u=c.el.offset(),h=n-u.left,f=a-u.top;if(s.border){if(hc.el.width()-s.border)return;if(fc.el.height()-s.border)return}o=0,r=0,g(!0),_(!0),s.cb_down&&s.cb_down()}function g(e){e?d||(d=setInterval(v,10)):d&&(clearInterval(d),d=null)}function _(e){e?($("body").on(c.touch.move,m),$("body").on(c.touch.up,p)):($("body").off(c.touch.move,m),$("body").off(c.touch.up,p))}function p(t){g(!1),_(!1),t=e.event(t),s.x&&(o=t.pageX-n),s.y&&(r=t.pageY-a),s.cb_up&&s.cb_up({distX:o,distY:r})}function m(t){s.capture&&(t.preventDefault(),t.stopImmediatePropagation()),t=e.event(t);var i,l=!1;s.x&&(i=t.pageX-n,null!==s.limit_x?i>=s.limit_x.min&&i<=s.limit_x.max&&(s.min?Math.abs(i)>s.min&&(o=i,l=!0):(o=i,l=!0)):s.min?Math.abs(i)>s.min&&(o=i,l=!0):o=i),s.y&&(i=t.pageY-a,null!==s.limit_y?i>=s.limit_y.min&&i<=s.limit_y.max&&(s.min?Math.abs(i)>s.min&&(r=i,l=!0):(r=i,l=!0)):r=i),l&&s.cb_drag&&s.cb_drag({distX:o,distY:r,x:t.pageX,y:t.pageY})}function v(){c.el.css({transform:"translate3d("+(t+o)+"px, "+(i+r)+"px, 0px)"})}this.dragable=!0,this.set=function(e){return s=e,OGX.Data.merge(s,l),"auto"===s.state&&(c.enable,c.disable,this.enable()),this.state=s.state,s},this.enable=function(){!u&&s&&(u=!0,h(!0))},this.disable=function(){u&&(u=!1,h(!1),_(!1),g(!1))}},OGX.Touches.Move=function(e){"use strict";var t,i,n,a,o,r,s,l,c=!1,d={min:0,limit_x:null,limit_y:null,target:null,cb_down:null,cb_move:null,cb_up:null,cb_click:null,capture:!1,state:"auto"},u=e,h=!1;function f(e){var t=[];t=c.target?[u.touch.down,c.target,g]:[u.touch.down,g],e?u.el.on.apply(u.el,t):u.el.off.apply(u.el,t)}function g(d){c.capture&&(d.preventDefault(),d.stopImmediatePropagation()),d=e.event(d),t=d.pageX,i=d.pageY,n=0,a=0,o=0,r=0,s=0,l=0,_(!0),c.cb_down&&c.cb_down(d)}function _(e){e?($("body").on(u.touch.move,m),$("body").on(u.touch.up,p)):($("body").off(u.touch.move,m),$("body").off(u.touch.up,p))}function p(s){if(_(!1),s=e.event(s),c.x&&(n=s.pageX-t),c.y&&(a=s.pageY-i),c.cb_up&&c.cb_up({x:s.pageX,y:s.pageY,distX:n,distY:a,dirX:o,dirY:r}),c.cb_click){var l=!1;c.x&&Math.abs(n)<2&&(l=!0),c.y&&Math.abs(a)<2&&(l=!0),l&&c.cb_click(s)}}function m(d){c.capture&&(d.preventDefault(),d.stopImmediatePropagation()),d=e.event(d);var u,h=!1;c.x&&(o=0,sd.pageX&&(o=-1),s=d.pageX,u=d.pageX-t,null!==c.limit_x?u>=c.limit_x.min&&u<=c.limit_x.max&&(c.min?Math.abs(u)>c.min&&(n=u,h=!0):(n=u,h=!0)):c.min?Math.abs(u)>c.min&&(n=u,h=!0):(n=u,h=!0)),c.y&&(r=0,ld.pageY&&(r=-1),l=d.pageY,u=d.pageY-i,null!==c.limit_y?u>=c.limit_y.min&&u<=c.limit_y.max&&(c.min?Math.abs(u)>c.min&&(a=u,h=!0):(a=u,h=!0)):(a=u,h=!0)),h&&c.cb_move&&c.cb_move({distX:n,distY:a,dirX:o,dirY:r,x:d.pageX,y:d.pageY})}this.set=function(e){return c=e,OGX.Data.merge(c,d),"auto"===c.state&&(u.enable,u.disable,this.enable()),this.state=c.state,c},this.enable=function(){!h&&c&&(h=!0,f(!0))},this.disable=function(){h&&(h=!1,f(!1),_(!1))}},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,a,o,r,s,l,c,d=this,u='{{$label}}',h=e,f={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:u},icons:{open:"folder_open",close:"folder_closed",empty:null}},file:{mode:"file",display:{html:u},icon:"file"},folder:{mode:"folder",display:{html:u},icons:{open:"folder_open",close:"folder_closed",empty:null}}},data:{id:0,type:"root",state:"closed",data:{label:null,icon:null},items:[]},display:null},g="_id";function _(e,t){var i={_id:t._id,container_display:"",container_css:"",arrow_display:"",arrow_style:"ogx_tree_item_arrow_open",state:"open"};return OGX.Data.merge(i,e,!0),OGX.Templater.make('
',i)}function p(){var e=_({},{_id:"root",type:"root",label:h.root_label});t.html(e),h.data.element=t.children(".ogx_tree_item").first(),h.data.uxi=d,h.show_root||h.data.element.addClass("ogx_tree_root_hidden")}function m(){p(),v(h.data,d)}function v(e,t){if(e.parent=t,e.hasOwnProperty("items")){var i,n;!e.items.hasOwnProperty("insert")&&(e.items=new OGX.List(e.items)),h.sort.enabled&&e.items.order(h.sort.property,h.sort.way);for(var a=0;a .ogx_tree_item_content';if(i.display.hasOML()){var a=i.display.oml(n,e,!1);OGX.OML.render(t,a,e),e.uxi=t.nodes.last()}else{var o=i.display.html(e);o=OGX.Templater.make(o,e),$(n).html(o)}}function O(e){var t={};return OGX.Data.merge(t,e),delete t.element,delete t.parent,c||delete t[g],t}function b(e){"folder"===S(e).mode&&(e.items.length||(e.element.data("state","close"),e.element.children(".ogx_tree_item_arrow").addClass("ogx_tree_item_arrow_disabled")),"open"===e.element.data("state")?(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").css("display","block")):(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").css("display","none")))}function w(){if(s){var e=E(s);e&&(e.children(".ogx_tree_item_icon").removeClass("ogx_tree_selected_item"),s=null)}}function G(e){var t=E(e);t&&(s=e,t.children(".ogx_tree_item_icon").addClass("ogx_tree_selected_item"))}function X(e,t){return C((function(i){return i[g]===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",b(i),!0)}))}function T(e){return C((function(t,i){return t[g]===e&&t}))}function E(e){var t=T(e);return!!t&&t.element}function D(){l=1,C((function(e){return e[g]=l++,e.hasOwnProperty("type")||(e.hasOwnProperty("items")?e.type="folder":e.type="file"),!1}))}function C(e,t){var i;if(void 0===t&&(t=h.data),i=function t(n,a,o,r){if(i=e(n,a,o,r))return i;if(n.hasOwnProperty("items")&&n.items.length)for(var s=0;s .ogx_tree_item_content",(function(e){e.preventDefault(),L($(this).parent(0)),1!==$(this).parent(0).data("id")&&function(){o&&clearInterval(o);r=(new Date).getTime(),o=setInterval(k,50)}()})),$(document).on(d.touch.up,(function(){N(),n&&(I(!1),function(){var e=n.offset().left,o=n.offset().top,r=(l=e,c=o,C((function(e,t){return d=e.element.offset(),u=e.element.children(".ogx_tree_item_icon"),l>=d.left&&l<=d.left+u.width()&&c>=d.top&&c<=d.top+u.height()&&e}))),s=S(r);var l,c,d,u;!r||r&&(r[g]===i[g]||"folder"!==s.mode)?(a.css("opacity",1),n.remove(),n=null,i=null):(f=r,function(e){C((function(t,i,n,a){return t[g]===e&&(n.items.splice(a,1),n.items.length||(n.state="close"),b(n),!0)}))}((h=i)[g]),X(h,f[g]),f.element.children(".ogx_tree_item_container").empty(),f.state="open",v(f,f.element),b(f),a.remove(),n.remove(),n=null,t.trigger(OGX.Tree.DROP,i),i=null);var h,f}())}))):t.on("click",".ogx_tree_item > .ogx_tree_item_content",(function(e){L($(this).parent(0))})),t.on(d.touch.down,".ogx_tree_item_arrow",(function(e){e.preventDefault(),N();var i=$(this).parent(0),n=i.data("state"),a=T(i.data("id"));a.hasOwnProperty("items")&&a.items.length&&("open"===n?(i.data("state","close"),t.trigger(OGX.Tree.CLOSE,a)):(i.data("state","open"),t.trigger(OGX.Tree.OPEN,a)),b(a))}))):(h.editable?t.off(d.touch.down,".ogx_tree_item > .ogx_tree_item_content"):t.off("click",".ogx_tree_item > .ogx_tree_item_content"),t.off(d.touch.down,".ogx_tree_item_arrow"))}function k(){var e;(new Date).getTime()-r>=h.drag_after&&(s&&(i=T(s))&&(e=i.element,a=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),I(!0),t.trigger(OGX.Tree.DRAG,i)),N())}function I(e){e?$(document).on(d.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(d.touch.move)}function N(){o&&(clearInterval(o),o=null)}this.enable=function(){return M(!0),this},this.disable=function(){return M(!1),this},this.addItem=function(e,t){if(void 0===t&&(t=s),t){var i=T(t);if("folder"===S(i).mode){c||(e[g]=++l),X(e,t);var n=S(e);y(i.uxi,i.element.children(".ogx_tree_item_container").first(),e),x(e,i.parent);var a=i.uxi;return n.display.hasOML()&&(a=i.uxi.nodes.last()),v(e,a),i.element.data("state","open"),i.element.children(".ogx_tree_item_container").css("display","block"),i.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_disabled ogx_tree_item_arrow_close").addClass("ogx_tree_item_arrow_open"),!0}}return!1},this.getItem=function(e){var t=T(e);return!!t&&O(t)},this.selectItem=function(e){G(e)},this.selectItemByPropVal=function(e,t){var i=function(e,t){function i(i,n){return!(!i.data.hasOwnProperty(e)||i.data[e]!==t)&&n+"/"+i.label}return C(i)}(e,t);return!!i&&(w(),G(i[g]),!0)},this.selectItemByPath=function(e){var t=function(e){var t=function(e){function t(t,i){return e===i+"/"+t.label&&t}return C(t)}(e);if(t)return t.element;return!1}(e);return!!t&&(w(),t.addClass("ogx_tree_selected_item"),s=t.data("id"),!0)},this.updateItem=function(e,t){var i=T(e);if(i){if(i.uxi){var n=i.uxi.el;i.uxi.kill(),n.empty()}OGX.Data.merge(i,t,!0),x(i,i.parent),i.hasOwnProperty("items")&&i.items.length&&(v(i,i.parent),i.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_disabled ogx_tree_item_arrow_close").addClass("ogx_tree_item_arrow_open"),i.element.data("state","open"))}},this.replaceItem=function(e){var t=T(e[g]);t&&(t.uxi&&t.uxi.kill(),OGX.Data.merge(e,t,!1),x(t,t.parent),t.hasOwnProperty("items")&&t.items.length&&v(t,t.parent))},this.deleteItem=function(e){var t=T(e);if(t){var i=function(e){function t(t){return!(!t.hasOwnProperty("items")||!t.items.get({_id:{eq:e}},null,1))&&t}return C(t)}(e);t.uxi&&t.uxi.kill(),i.items.findDelete("_id",e,1),t.element.remove()}},this.deleteSelectedItem=function(){return function(){function e(e,t,i,n){if(e[g]===s)return e.element.remove(),i.items.splice(n,1),b(i),!0}if(s)return C(e);return!1}()},this.getSelectedItem=function(){return function(){if(s)return T(s);return!1}()},this.getTree=function(){var e=C(O,JSON.parse(JSON.stringify(h.data)));if(e)return e},this.setData=function(e){e.hasOwnProperty("types")&&this.setTypes(e.types),e.hasOwnProperty("tree")&&this.setTree(e.tree)},this.setTypes=function(e){h.types=e},this.setTree=function(e){this.clear(),h.data=e,h.data.hasOwnProperty("state")||(h.data.state="open"),c||D(),m()},this.newTree=function(){d.clear(),l=1,p()},this.filterTree=function(e){!function(e){var t=[];function i(n,a,o,r){if(-1!==(a+n.label).indexOf(e)&&t.push(a+"/"+n.label),n.hasOwnProperty("items")&&n.items.length)for(var s=0;s .ogx_scroller_inner',(i=$(e.el)).addClass(n).attr("data-ogx-id",this.id),t&&i.attr("id",this.id);var o=this;setTimeout((function(){o.scroller.resize()}),0)}else i.append(a),e.el='.ogx_uxi[data-ogx-id="'+this.id+'"]';this.el=$(e.el)}},OGX.Uxi.prototype.enable=function(){return this},OGX.Uxi.prototype.disable=function(){return this},OGX.Uxi.prototype.ux=function(){},OGX.Uxi.prototype.construct=function(){},OGX.Uxi.prototype.destroy=function(){},OGX.Uxi.prototype.resize=function(){return this},OGX.Uxi.prototype.show=function(){return this.el&&this.el.removeClass("ogx_uxi_hide"),this},OGX.Uxi.prototype.hide=function(){return this.el&&this.el.addClass("ogx_uxi_hide"),this},OGX.Uxi.prototype.empty=function(){return this.clear(),this},OGX.Uxi.prototype.observe=function(e,t,i,n,a){var o=this,r=this.el,s=null;if(void 0!==a&&(r=a),e){if(!this.observer)return void 0!==t&&t||(t={childList:!0,subtree:!0}),this.observer=new MutationObserver((function(e,t){e.forEach((function(e){s&&clearTimeout(s),s=setTimeout((()=>{void 0!==i?i(e,n):o.el.trigger(OGX.View.CHANGED,e)}),10)}))})),this.observer.observe(r[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){var a=this;this.observe(!0,e,(function(){a.observe(!1),void 0!==t&&t(i)}),null,n)},OGX.Uxi.prototype.sleep=function(){return this.sleeping||(this.blur(2),this.sleeping=!0,this.scroll?(this.__parent=this.el.parent(".ogx_scroller_outer").first().parent(0),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+'"]'),this.focus(2),delete this.__parent),this},OGX.Uxi.prototype.detach=function(){return this.sleep(),this.parent.nodes.findDelete("id",this.id,1),this},OGX.Uxi.prototype.attach=function(e,t){return this.parent=e,this.parent.nodes.insert(this),this.wake(t),setTimeout((()=>this.resizeNodes),0),this},OGX.Uxi.prototype.resizeNodes=function(){for(var e=this.gather(),t=0;t0&&"Carousel"===t[i]._NAME_&&"Container"===t[i-1]._NAME_||(t[i].floating?t[i].show(e):t[i].show(this._NAME_,this.id));return this}},OGX.Uxi.prototype.focus=function(e){if(void 0===e&&(e=1),this.blured)switch(this.blured=!1,this.enabled&&(this.ux(!0),this.enable()),e){case 1:this.focusNodes();break;case 2:this.focusTree()}return this},OGX.Uxi.prototype.focusTree=function(){for(var e=this.gather(),t=0;tt&&(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)},require("View","Uxi","Placeholder","Touch"),OGX.View=function(e){construct(this,"View");var t=this,i=!1,n=e;this.enable=function(){return n.observe&&this.observe(!0),this},this.disable=function(){return n.observe&&this.observe(!1),this},this.container=function(){return i},this.render=function(e){return void 0===e?n.hasOwnProperty("html")&&n.html&&i.html(n.html):i.html(e),i.trigger(OGX.View.RENDER),this},function(){i=t.el;var a=new OGX.Display(e);n.html=a.html(e.data),i.addClass("ogx_view ogx_hw"),t.render()}()},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:'
$INNER
{{$html}}
',win_inner:['','{{$title}}','$ICONS'],zindex:!1,close_on_click_out:!1,close_dist:100,parent:null},config=__config,pt={x:null,y:null},dir={x:0,y:0},showto=50,user_resized=!1,zd;function genIcons(){for(var e="",t=0;t";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:config.parent.topIndex();var t=getLimitedSize();container.css({width:t.width,height:t.height,"z-index":zd})}function getLimitedSize(){var e,t,i,n=config.parent.el.width(),a=config.parent.el.height();user_resized?(n=config.width,a=config.height):(e=OGX.Data.getBestSize(n,config.width),t=OGX.Data.getBestSize(a,config.height));var o={width:e,height:t};return(config.min_width||config.max_width)&&(-1!==config.width.indexOf("%")?(n=config.parent.el.width(),i=Number(config.width.split("%")[0])*n/100,config.min_width&&iconfig.max_width&&(o.width=config.max_width+"px")):(-1!==(i=config.width).indexOf("px")&&(i=Number(i.split("px")[0])),config.min_width&&iconfig.max_width&&(o.width=config.max_width+"px"))),(config.min_height||config.max_height)&&(-1!==config.height.indexOf("%")?(a=config.parent.el.height(),i=Number(config.height.split("%")[0])*a/100,config.min_height&&iconfig.max_height&&(o.height=config.max_height+"px")):(-1!==(i=config.height).indexOf("px")&&(i=Number(i.split("px")[0])),config.min_height&&iconfig.max_height&&(o.height=config.max_height+"px"))),o}function listenBody(e){e?that.parent.el.on(that.touch.down,".ogx_overlay",onBody):that.parent.el.off(that.touch.down,".ogx_overlay",onBody)}function onBody(e){that.status===OGX.Window.OPEN&&(that.hide(),that.parent.removeOverlay(OGX.Overlay.Fade))}function animWindow(e,t,i,n){void 0===t&&(t=config.anim);var a={opac:1,tX:0,tY:0},o=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?(a.tY=0,c.addClass("ogx_window_main_icon_top")):a.tY=-l-10;break;case OGX.Window.ANIM_BOTTOM:e?(a.tY=0,c.addClass("ogx_window_main_icon_bottom")):a.tY=r+10;break;case OGX.Window.ANIM_RIGHT:e?(a.tX=o-s,c.addClass("ogx_window_main_icon_right")):a.tX=o+10;break;case OGX.Window.ANIM_LEFT:e?(a.tX=0,c.addClass("ogx_window_main_icon_left")):a.tX=-s-10}var d=100;e?(pt.x=a.tX,pt.y=a.tY):d=0,setTimeout((function(){dir.x,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("+a.tX+"px, "+a.tY+"px, 0px)",opacity:a.opac,visibility:"visible"})}),d)}function placeWindow(e){var t=container.parent().width(),i=container.parent().height(),n=that.el.outerHeight(),a=that.el.outerWidth();that.el.removeClass("ogx_window_anim_in").removeClass("ogx_window_anim_out");var o={x:0,y:0};switch(config.anim){case OGX.Window.ANIM_TOP:o.y=e?-n:n,dir.y=-1;break;case OGX.Window.ANIM_BOTTOM:o.y=e?i:i-n,dir.y=1;break;case OGX.Window.ANIM_RIGHT:o.x=e?t:t-a,dir.x=1;break;case OGX.Window.ANIM_LEFT:e&&(o.x=-a),dir.x=-1}that.el.css({transform:"translate3d("+o.x+"px, "+o.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(/>,<"),i=i.replace("$INNER",n);var a="";return config.icons&&config.icons.length&&(a=genIcons()),i=i.replace("$ICONS",a),OGX.Templater.make(i,t)}function onResize(){user_resized=!0,that.resizeNodes()}function listenScroll(e){e?(that.el.on(OGX.Scroller.START,(function(){that.disable()})),that.el.on(OGX.Scroller.END,(function(){that.enable()}))):(that.el.off(OGX.Scroller.START),that.el.off(OGX.Scroller.END))}function initPlaceholders(){that.placeholders(config,['.ogx_window[data-ogx-id="'+that.id+'"] > .ogx_window_body'])}function initDefaults(){OGX.Data.merge(config,app.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(){if(initDefaults(),render(),initPlaceholders(),placeWindow(!0),config.drag){var e={},t={top:!1,bottom:!1,left:!1,right:!1,cb_resize:onResize};switch(t.min_width=config.min_width,t.min_height=config.min_width,t.max_width=config.max_width,t.max_height=config.max_height,e.cb_drag=onDrag,e.cb_up=onRelease,config.anim){case OGX.Window.ANIM_LEFT:e.x=!0,e.y=!1,e.limit_x={min:-300,max:0},t.right=!0;break;case OGX.Window.ANIM_RIGHT:e.x=!0,e.y=!1,e.limit_x={min:0,max:300},t.left=!0;break;case OGX.Window.ANIM_TOP:e.x=!1,e.y=!0,e.limit_y={min:-300,max:0},t.bottom=!0;break;case OGX.Window.ANIM_BOTTOM:e.x=!1,e.y=!0,e.limit_y={min:0,max:300},t.top=!0}that.touch.drag=that.touch.add("Drag",e)}config.resize&&that.setResize(t),config.show&&that.show(),listenScroll(!0)}this.id=config.id,this.dragable=null,this.resizeable=null,this.status=OGX.Window.CLOSED,this.enable=function(){return config.close_on_click_out&&listenBody(!0),config.head&&listenBackIcon(!0),config.icons&&listenIcons(!0),config.drag,config.resize&&this.enableResize(),this},this.disable=function(){return config.close_on_click_out&&listenBody(!1),config.head&&listenBackIcon(!1),config.icons&&listenIcons(!1),config.drag,config.resize&&this.disableResize(),this},this.show=function(e,t,i){return config.drag,config.resize&&this.enableResize(),listenScroll(!0),-1===[OGX.Window.OPEN,OGX.Window.OPENING].indexOf(this.status)&&(this.focus(1),this.front(),null==e&&(e=config.anim),setTimeout((function(){animWindow(!0,e,t,i)}),showto),showto&&(showto=0)),this},this.hide=function(e,t,i){return config.drag,config.resize&&this.disableResize(),listenScroll(!1),-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.resize=function(){var e=getLimitedSize();return container.css({width:e.width,height:e.height}),this.place(),this},this.destroy=function(){config.drag,listenScroll(!1)},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=config.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):config.drag&&(config.drag=this.dragable=!1)},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,String.prototype.hasOwnProperty("substr")||(String.prototype.substr=function(e,t){return e<0&&(e=this.length-e),this.slice(e,e+t)}); \ No newline at end of file +/* globules.io OGX.JS 1.19.1.6 */ +window.console||(window.console={});for(var methods=["log","debug","warn","info"],i=0;i1&&o[1].meval("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}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((function(){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;i0&&__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;i0&&__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;i0&&__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;i0&&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;r1&&(e=arguments.join("|")),!!indexes.hasOwnProperty(e)&&(delete indexes[e],!0)},array.deleteProperty=function(t){for(var e=0,r=0;r1?indexes[i][a].splice(0,r):indexes[i][a][0]:indexes[i][a])},array.clear=function(){indexes=!1,filterCount=0,this.length=0},array.unique=function(t,e,r){void 0===e&&(e=!0),void 0===r?r=[t]:Array.isArray(r)||(r=[r]);for(var i,a=this.get(),s=[],n=new OGX.List,o=0;o=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()o||this.filters[a][j][b][1]=i)){var l=!1;for(var u in d)-1!==u.indexOf(":OSE")?(d[o=u.split(":").shift()]=OGX.OSE.exec(d[u],t,a,n,s),delete d[u],l||(l=!0,r++),e(d[o])):-1!==u.indexOf(":")||"object"!=typeof d[u]||Array.isArray(d[u])||d[u]instanceof HTMLElement||d[u]instanceof jQuery||(l||(l=!0,r++),e(d[u]))}}(e),e}function O(e,t){switch(e){case"scope":return OGX.Scope.fork(t);default:return OGX.OSE.fork(e,t)}}this.get=function(e){return OGX.Cache.read("oml",e)},this.make=function(e,t,n){var i={};return i[e+":"+t]=n,i},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 i(e,t,n){var i={};for(var o in e)i[o.replace(t,n)]=e[o];return i}void 0===n&&(n="default"),Array.isArray(n)||(n=[n],t=[t]);for(var o=0;o0&&(v=v.substr(0,v.indexOf(".")-1)),y=e[G],_=!0,w=!0,L=!1,W=!1,v){case"Function":return w=!1,_=!0,y.parent=t,y.fnc=c,y=g(y,n,i),void OGX.Fonction(y,n,i);case"Uxi":return void e[G].attach(t,c);case"Fork":(A=O(c,e[G]))&&d(A,t),w=!1,_=!1;break;case"Html":y.el=c,y.html=e[G].html,(w=f(y))||(y.template=!1);break;case"Template":y.template=m.split(".")[1],y.el=c,m="Html",w=f(y);break;case"Ghost":y.el=c;break;case"Controller":y.id=c,W=!0;break;default:-1!==[".","#"].indexOf(c.substr(0,1))?y.el=c:(y.id=c,y.el=t.el[0],y.parent=t)}_&&(y=g(y,n,i)),b=!1,X=!1,w?(r&&(M=r.find("id",y.id.replace(/^#/gi,""),1))&&(X=!0),X?(M.wake(y.el),x=M):x=OGX.Object.create(m,y),t.add(x),b=x):L?(L.blur(),$(c).html(S),L.el=$(c),t.add(L),setTimeout((function(){t.blured||L.focus()}),0)):(b=t,"Html"===m&&OGX.HtmlRender(y)),b&&e[G].hasOwnProperty("node:OML")&&!L&&!X&&(e[G]=p(e,e[G]),d(e[G]["node:OML"],b)),w&&(x.parent=t,"function"==typeof x.construct&&(X||(W?s.push({object:x,data:[n,i]}):x.construct.apply(x,[n,i])))),x&&!W&&(w||X)&&(t.blured||x.floating||x.focus()),void 0!==x&&x&&!W&&(a=a.concat(u(x,e[G])))}}}d(t,e),a.length&&function(e){for(var t=0;t'+r.display_date.format(e)+""),r.date&&(t+=''+r.date.format(r.format)+""),r.browse&&(t+=''),i.children(".ogx_calendar_head").children(".ogx_calendar_head_date").html(t)}function b(e){i.children(".ogx_calendar_head").children(".ogx_calendar_head_labels").html(e)}function w(e,t,i,n){if(t.y-1>=0&&t.y-1
'),T(),G(),t=o.create("GridSwiper",{el:r.el+" .ogx_calendar_body",loop:!0,map:n,start:{x:1,y:a+1},chromeos:r.chromeos,enabled:r.swipe}),O(),b(l[a].labels(r.display_date)),o.enable()},OGX.Calendar.SELECT="CalendarSelect",OGX.Calendar.UNSELECT="CalendarUnselect",OGX.Calendar.BIND=OGX.Calendar.SELECT+" "+OGX.Calendar.UNSELECT,OGX.Calendar.BROWSE="CalendarBrowse",OGX.CalendarLayout={},OGX.CalendarLayout.BASE_LAYOUT=function(){"use strict";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"YYYY-MM"}},OGX.CalendarLayout.MONTH_DAYS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(){for(var e="",t=function(){for(var e=new Date(Date.UTC(2017,0,2)),t=[],i=0;i<7;i++)t.push(e.toLocaleDateString(navigator.language,{weekday:"short"})),e.setDate(e.getDate()+1);return t}(),i=0;i'+t[i]+"";return e},this.html=function(e,t,i,n){var a,o=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<42;u++)c="",a=s.format("YYYY-MM-DD"),s.format("MM")!==o&&(c+="ogx_calendar_layout_month_days_offset "),a===moment().format("YYYY-MM-DD")&&(c+="ogx_calendar_layout_month_days_today "),n&&l===a&&(c+="ogx_calendar_selected_item "),d+='
'+t(a,i)+"
",s.add(1,"days");return d},this.value=function(){return{value:1,unit:"months"}},this.format=function(){return"YYYY-MM"}},OGX.CalendarLayout.CENTURY_DECADES=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return''+100*Math.floor(Number(e.format("YYYY"))/100)+"'s"},this.html=function(e,t,i,n){var a,o,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++)o="",s+l===c+(a=10*f)&&(o="ogx_calendar_layout_century_decades_current "),d+u===c+a&&(o+="ogx_calendar_selected_item "),h+='
'+t(c+a,i)+"
";return h},this.value=function(){return{value:100,unit:"years"}},this.format=function(){return"YYYY"}},OGX.CalendarLayout.CENTURY_YEARS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return''+100*Math.floor(Number(e.format("YYYY"))/100)+"'s"},this.html=function(e,t,i,n){var a,o=moment(),r=100*Math.floor(Number(o.format("YYYY"))/100),s=Number(o.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++)a="",l+h===r+s&&(a+="ogx_calendar_layout_century_years_current "),l+h===c+d&&(a+="ogx_calendar_selected_item"),u+='
'+t(l+h+"-01-01",i)+"
";return u},this.value=function(){return{value:100,unit:"years"}},this.format=function(){return"Y"}},OGX.CalendarLayout.DECADE_YEARS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return''+10*Math.floor(Number(e.format("YYYY"))/10)+"'s"},this.html=function(e,t,i,n){var a,o=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++)a="",o+c===s&&(a+="ogx_calendar_layout_decade_years_current "),o+c===l&&(a+="ogx_calendar_selected_item "),r+='
'+t(o+c+"-01-01",i)+"
";return r},this.value=function(){return{value:10,unit:"years"}},this.format=function(){return"Y"}},OGX.CalendarLayout.DECADE_MONTHS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){for(var t=10*Math.floor(Number(e.format("YYYY"))/10),i=Number(String(t).substr(2,2)),n="",a=0;a<10;a++)n+='\''+i+"",i++;return n},this.html=function(e,t,i,n){var a,o,r,s,l=10*Math.floor(Number(e.format("YYYY"))/10),c="",d=moment().format("YYYY-MM");n&&(a=n.format("YYYY-MM"));for(var u=0;u<12;u++){s=u+1;for(var h=0;h<10;h++)o="",(r=l+h+"-"+(s<10?"0"+s:s))===d&&(o="ogx_calendar_layout_decade_months_current "),r===a&&(o+="ogx_calendar_selected_item "),moment(r+"-01"),c+='
'+t(r+"-01",i)+"
"}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(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Months'},this.html=function(e,t,i,n){var a,o,r=moment().format("YYYY-MM"),s=e.format("YYYY"),l="",c="";n&&(c=n.format("YYYY-MM"));for(var d=1;d<13;d++)a="",s+"-"+(o=d<10?"0"+d:d)===r&&(a+="ogx_calendar_layout_year_months_current "),s+"-"+o===c&&(a+="ogx_calendar_selected_item "),l+='
'+t(s+"-"+o+"-01",i)+"
";return l},this.value=function(){return{value:1,unit:"years"}},this.format=function(){return"Y"}},OGX.CalendarLayout.YEAR_WEEKS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Weeks'},this.html=function(e,t,i,n){var a=moment().week(),o=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="",a===h&&o===r&&(c="ogx_calendar_layout_year_weeks_current "),l===h&&o===s&&(c+="ogx_calendar_selected_item "),u+='
'+t(d,i)+"
";return u},this.value=function(){return{value:1,unit:"years"}},this.format=function(){return"Y"}},OGX.CalendarLayout.YEAR_DAYS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Nth Day'},this.html=function(e,t,i,n){var a,o,r,s="",l=e.format("YYYY-MM-DD"),c=moment(e.format("YYYY")+"-01-01"),d="";n&&(d=n.format("YYYY-MM-DD")),o=e.isLeapYear()?366:365;for(var u=0;u'+t(r,i)+"",c.add(1,"days");return s},this.value=function(){return{value:1,unit:"years"}},this.format=function(){return"Y"}},OGX.CalendarLayout.MONTH_WEEKS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Nth Week'},this.html=function(e,t,i,n){var a,o="",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")));o="";for(var h,f=moment(e.format("YYYY-MM-[01]")),g=0;g<5;g++)h="",a=Number(f.format("w")),c===d&&a===u&&(h+="ogx_calendar_selected_item "),c===s&&a===l&&(h+="ogx_calendar_layout_month_weeks_current"),o+='
'+t(f.format("YYYY-MM-DD"),i)+"
",f.add(7,"days");return o},this.value=function(){return{value:1,unit:"months"}},this.format=function(){return"[(]YYYY-MM[)] W"}},OGX.CalendarLayout.WEEK_DAYS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){for(var t="",i=function(){for(var e=new Date(Date.UTC(2017,0,2)),t=[],i=0;i<7;i++)t.push(e.toLocaleDateString(navigator.language,{weekday:"short"})),e.setDate(e.getDate()+1);return t}(),n=function(e){for(var t=e.clone(),i=t.day(),n=t.subtract(i,"day"),a=[],o=0;o<7;o++)a.push(n.format("DD")),n.add(1,"day");return a}(e),a=0;a'+i[a]+" "+n[a]+"";return t},this.html=function(e,t,i,n){var a,o,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++)a="",(o=l.format("YYYY-MM-DD"))===c&&(a="ogx_calendar_layout_week_days_current "),o===d&&(a+="ogx_calendar_selected_item "),r+='
'+t(o,i)+"
",l.add(1,"days");return r},this.value=function(){return{value:1,unit:"weeks"}},this.format=function(){return"YYYY-MM (wo [week])"}},OGX.CalendarLayout.DAY_HOURS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Hours'},this.html=function(e,t,i,n){var a,o,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++)o="",h===s&&l===c&&(o="ogx_calendar_layout_days_hours_current "),h===d&&l===u&&(o+="ogx_calendar_selected_item "),r+='
'+t(l+a+":00",i)+"
";return r},this.value=function(){return{value:1,unit:"days"}},this.format=function(){return"YYYY-MM-DD HH:[00]"}},OGX.CalendarLayout.DAY_WORK_HOURS=function(){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this),this.labels=function(e){return'Work Hours'},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 a,o,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'+t(l+a+":00",i)+"";return r},this.value=function(){return{value:1,unit:"days"}},this.format=function(){return"YYYY-MM-DD HH:[00]"}},OGX.CalendarLayout.DAY=function(e){"use strict";this.labels=function(e){return''+function(e){for(var t=new Date(Date.UTC(2017,0,2)),i=[],n=e.day(),a=0;a<7;a++)i.push(t.toLocaleDateString(navigator.language,{weekday:"long"})),t.setDate(t.getDate()+1);return i[n]}(e)+""},this.html=function(e,t,i,n){var a="",o=e.format("YYYY-MM-DD"),r=moment().format("YYYY-MM-DD");return n&&o===n.format("YYYY-MM-DD")&&(a+="ogx_calendar_selected_item "),o===r&&(a+="ogx_calendar_layout_day_current "),'
'+t(o,i)+"
"},this.value=function(){return{value:1,unit:"days"}},this.format=function(){return"YYYY-MM-DD"},this.select=function(e){}},OGX.CalendarEngine={},OGX.CalendarEngine.CELL_VALUE=function(e,t){var i=moment(e);return t.hasOwnProperty("css")||(t.css=""),'
'+i.format(t.format)+"
"},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'
'+moment(e).week()+"
"},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'
'+String(e).substr(2)+"'s
"},require("Carousel","Uxi","Placeholder","Touch"),OGX.Carousel=function(e){construct(this,"Carousel");var t,i,n,a,o,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},d={position:"bottom"},u=!1,h=0,f=0,g=new OGX.List,_="ogx_carousel";function p(e){if(void 0!==e&&g[e]&&g[e].instance){var t=s.find(g[e].instance._NAME_,g[e].instance.id);t&&t.blur(2)}}function m(e){if(void 0!==e&&g[e]&&g[e].instance){var t=s.find(g[e].instance._NAME_,g[e].instance.id);t&&t.focus(1)}}function v(e){i.off("transitionend"),i.removeClass(_+"_anim")}function y(e){if(e.dirX){if(-1===e.dirX&&!l.drag_right)return;if(1===e.dirX&&!l.drag_left)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 x(e){if(e.distX>l.min_x){var i=r+-1*e.dirX;i>=0&&i'),e.push("."+_+'[data-ogx-id="'+s.id+'"] > .'+_+"_views > ."+_+'_view[data-ogx-panel-id="'+h+'"]'),h++;i.css("width",100*f+"%"),s.placeholders(l,e),t.trigger(OGX.Carousel.READY)}this.construct=function(){G(),l.index&&this.showPanel(l.index,!1)},this.enable=function(){return l.drag&&this.touch.swipe.enable(),setTimeout((function(){for(var e=0;e0&&this.showPanel(r-1),this},this.next=function(){return r+1'+e+""),i.css("width",Math.round(100*f)+"%"),i.children("."+_+"_view").css("width",100/f+"%"),++h-1}(),l="."+_+'[data-ogx-id="'+this.id+'"] > .'+_+"_views > ."+_+'_view[data-ogx-panel-id="'+r+'"]',c={},d=l;if(e.hasOwnProperty("_NAME_"));else{for(var u in e){d+=":"+u.split(":")[1],c[d]=e[u];break}var g=null;setTimeout((function(){s.observe(!0,{childList:!0,subtree:!0},(function(){s.observe(!1),g&&clearTimeout(g),g=setTimeout(G,20),a&&s.showPanel(f-1,o)})),OGX.OML.render(s,c,n)}),0)}return t.trigger(OGX.Carousel.ADDED,f),this},this.removeNode=function(e){for(var t=0;t=0&&ee?i.children("."+_+"_view:eq("+(n-1)+")").after(a):i.children("."+_+"_view:eq("+n+")").before(a);var o=100/f*(-1*n);return i.removeClass(_+"_anim"),i.css({transform:"translate3d("+o+"%, 0, 0)"}),r=n,setTimeout(G,0),t.trigger(OGX.Carousel.CHANGE,r),this},this.removePanel=function(e,n){if(void 0===n&&(n=!0),e>=0&&e=r?e--:e=r,e<0&&(e=0),s.showPanel(e,!1,!0),t.trigger(OGX.Carousel.REMOVED,f),a}return!1},this.empty=function(){return this.clear(),i.empty(),i.removeClass(_+"_anim").css("width","100%"),i.css({transform:"translate3d(0%, 0, 0)"}),f=0,g=new OGX.List,l.index=0,l["node:OML"]=[],this},this.render=function(e,t){return l["node:OML"]=e,f=l["node:OML"].length,X(),OGX.OML.render(this,l["node:OML"],t),this},OGX.Data.merge(l,c,!1),l.dots&&("boolean"==typeof l.dots&&(l.dots={}),OGX.Data.merge(l.dots,d)),r=l.index,t=s.el,n=Math.floor(t.innerWidth()),l.hasOwnProperty("node:OML")&&(f=l["node:OML"].length),function(){t.addClass(_);var e="";l.dots&&"top"===l.dots.position&&(e+=''),e+='
',l.dots&&"bottom"===l.dots.position&&(e+=''),t.append(e),(i=t.find("."+_+"_views").first()).css({transform:"translate3d("+100/f*(-1*r)+"%, 0, 0)"})}(),l.dots&&(o=s.create("Dots",{el:"."+_+'[data-ogx-id="'+s.id+'"] > .carousel_dots',total:f})).bind("dots",s),X(),s.touch.swipe=s.touch.add("Swipe",{x:!0,cb_down:v,cb_swipe:y,cb_up:x,capture:l.capture,state:"manual"}),l.drag||s.drag(!1)},OGX.Carousel.READY="CarouselReady",OGX.Carousel.DRAG="CarouselDrag",OGX.Carousel.CHANGE="CarouselChange",OGX.Carousel.RESTORE="CarouselRestore",OGX.Carousel.ADDED="CarouselAdded",OGX.Carousel.REMOVED="CarouselRemoved",void 0===OGX)var OGX={};require("Chat","Uxi","Touch"),OGX.Chat=function(__config){construct(this,"Chat");var that=this,config=__config,config_default={placeholder:"Type a message",dot_speed:600,on_keyb_update_delay:300,messages:[],handle_keyboard:!0,hide_keyboard_on_send:!1,emojis:!1,template_left:'
{{$letter}}{{$body}}{{$date}}
',template_right:'
{{$body}}{{$date}}
',key:"_id",from_key:"from",users:[],user:!1,display_mode:OGX.Chat.DISPLAY_INITIALS,picture_key:"",restrict:{multiline:!1,length:500,allowed:/./},date_format:"YYYY-MM-DD h:mm:ss A",url_encode:!0},emojis_default={template:'{{$emoji}}',button:!1,list:[],map:{emoji:"char",search:"name"}},container,inner,scroller,composer,emojis,emoji_list,intv,oldh=!1,typing={},type=".",enabled=!1;function render(){if(config.messages.length>0){for(var e=0;e.';inner.append(t),animTyping(!0)}function removeTyping(e){typing[e]=!1,inner.find('.ogx_chat_typing[data-user="'+e+'"]').remove(),0===inner.find(".ogx_chat_typing").length&&animTyping(!1)}function animTyping(e){e?intv||(intv=setInterval(typeDot,config.dot_speed)):(clearInterval(intv),intv=null)}function typeDot(){(type+=".").length>3&&(type="."),inner.find(".ogx_chat_typing_body").html(type)}function getTemplate(e){return e[config.from_key]===config.user?config.template_right:config.template_left}function sendMessage(){var e=composer.find("textarea").val();if(e.length&&(e=(e=(e=e.replace(/^[\r|\n\r]+/,"")).replace(/<\/?[^>]+(>|$)/g,"")).replace(/’/,"'")).length){var t={body:e=e.replace(/[\r\n]/g,"
"),date:moment().format(config.date_format)};t[config.from_key]=config.user,addMessage(t);var i=OGX.Data.clone(t);config.url_encode&&(i.body=encodeURIComponent(i.body)),delete i.bg,delete i.letter,composer.find("textarea").val(""),that.el.trigger(OGX.Chat.SEND_MESSAGE,i)}}function handleShowKeyb(e){oldh||(oldh=container.height()),container.height(oldh-e.keyboardHeight),updateScroller()}function handleHideKeyb(){container.height(oldh),updateScroller()}function updateScroller(){setTimeout((function(){scroller.resize(),scroller.bottom()}),config.on_keyb_update_delay)}function renderEmojis(){var e,t=[];config.emojis.list=config.emojis.list.slice(0,250);for(var i=0;i',e+="
",config.emojis&&(e+=''),e+='',container.append(e),composer=container.find(".ogx_chat_composer"),config.emojis&&(emojis=container.find(".ogx_chat_emojis"),setTimeout(renderEmojis,10))}function initUsers(){for(var e in config.users)typing[e]=!1}function initDefaults(){config.hasOwnProperty("emojis")&&config.emojis&&(OGX.Data.merge(config.emojis,emojis_default,!1),config.emojis.list=new OGX.List(config.emojis.list)),OGX.Data.merge(config,config_default,!1),config.users.hasOwnProperty("find")||(config.users=new OGX.List(config.users)),(container=that.el).addClass("ogx_chat")}function init(){if(initDefaults(),initMarkup(),initUsers(),initScroller(),config.restrict){var e=OGX.Data.clone(config.restrict);config.restrict.hasOwnProperty("forbidden")&&(e.forbidden=config.restrict.forbidden),config.restrict.hasOwnProperty("allowed")&&(e.allowed=config.restrict.allowed),e.el=that.el.find(".ogx_chat_composer .ogx_chat_composer_input textarea")[0],OGX.Form.restrictField(e)}that.enable()}this.enable=function(){return enabled||(enabled=!0,config.handle_keyboard&&listenKeyb(!0),listenComposer(!0),listenArea(!0)),this},this.disable=function(){return this.el.find(".ogx_chat_composer .ogx_chat_composer_input textarea").trigger("blur"),enabled&&(enabled=!1,config.handle_keyboard&&listenKeyb(!1),listenComposer(!1),listenArea(!1)),this},this.users=function(e){return void 0!==e?(e.hasOwnProperty("find")||(e=new OGX.List(e)),config.users=e,!0):config.users},this.user=function(e){return void 0===e?config.user:(config.user=e,this)},this.typing=function(e,t){return e&&!typing[t]?addTyping(t):!e&&typing[t]&&removeTyping(t),this},this.compose=function(e){return composer.find("textarea").val(e),this},this.wipe=function(){return inner.empty(),this},this.clear=function(){return debug(2,"Chat clear is deprecated, use wipe"),this.wipe()},this.getScroller=function(){return scroller},this.addMessage=function(e){return addMessage(e),this},this.setMessages=function(e){return config.messages=e,render(),this},this.prependMessages=function(e){for(var t=this.el.find(".ogx_scroller_outer").first(),i=inner.height(),n=t.scrollTop(),a=0;a1&&(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]),a=Number(s[1]),o=Number(s[2])),"#"+((1<<24)+(n<<16)+(a<<8)+o).toString(16).slice(1)},OGX.Color.rgbToHsl=function(e,t,i){"use strict";var n,a,o;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],a=s[1],o=s[2],n/=255,a/=255,o/=255;var l,c,d=Math.max(n,a,o),u=Math.min(n,a,o),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=(a-o)/f+(a1&&(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;o=l(d,c,e+1/3),r=l(d,c,e),s=l(d,c,e-1/3)}return[Math.round(255*o),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,a="normal",o=0;function r(e){e?(t.tabs.el.on(OGX.Tabs.SELECT,(function(e,i){var n=t.tabs.index();t.carousel.val(n),t.el.trigger(OGX.Container.CHANGE,n)})),t.tabs.el.on(OGX.Tabs.CLOSE,(function(){})),t.tabs.el.on(OGX.Tabs.REORDER,(function(e,i){t.carousel.swapPanels(i.from,i.to)})),t.tabs.el.on(OGX.Tabs.ADD,(function(){})),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.CLOSE),t.tabs.el.off(OGX.Tabs.REORDER),t.tabs.el.off(OGX.Tabs.ADD),t.carousel.el.off(OGX.Carousel.CHANGE)),s(e)}function s(e){e?t.tabs.el.on(OGX.Tabs.REMOVE,(function(e,i){s(!1);var n=t.el.parents(".ogx_popup").first().data("ogx-id");n=app.cfind("Popup",n),app.ungroupPopup(n,i.index,i.label),setTimeout((function(){s(!0)}),200)})):t.tabs.el.off(OGX.Tabs.REMOVE)}this.carousel=null,this.tabs=null,this.construct=function(){this.carousel=this.find("Carousel",this.id+"_carousel")},this.show=function(e,t){if(this.carousel&&"normal"===a){var i=this.carousel.getNodeIndex(e,t);i&&(this.carousel.val(i.index),n.tabs&&this.tabs.index(i.index))}},this.index=function(e){return this.carousel&&"normal"===a&&(this.carousel.val(e),n.tabs&&this.tabs.index(e)),this},this.enable=function(){return n.tabs&&this.carousel&&r(!0),this},this.disable=function(){return n.tabs&&this.carousel&&r(!1),this},this.resize=function(){var e,t,i;return n.flatten&&(this.carousel&&"flattened"!==a&&this.el.width()>=n.flatten?(a="flattened",n.tabs&&(this.tabs.blur(),this.tabs.hide()),this.carousel.blur(),o=(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"===a&&this.el.width()';t.html(i)}this.enable=function(){n.clickable&&c(!0)},this.disable=function(){n.clickable&&c(!1)},this.bind=function(e,t){return!(o.hasOwnProperty(e)||!t.hasOwnProperty("_NAME_"))&&function(e,t){switch(o[e]=t,t._NAME_){case"Carousel":n.total=t.panels().length,n.current=t.val(),t.el.on(OGX.Carousel.CHANGE,s),t.el.on(OGX.Carousel.ADDED+" "+OGX.Carousel.REMOVED,l);break;case"Iceberg":n.total=t.panels().length,n.current=t.val(),t.el.on(OGX.Iceberg.SHOW,s)}return!0}(e,t)},this.unbind=function(e){return!!o.hasOwnProperty(e)&&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.destroy=function(){!function(){for(var e in o)r(e)}()},OGX.Data.merge(n,a),(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,reorder:!1,swipe:!1,reselect:!1,chromeos:!1,min_x:30,hold_time:1e3,interval:5,list:[],selection:[],no_selection:{enabled:!1,prop:"",val:0},mode:OGX.DynamicList.SELECT_MODE_SINGLE,trigger:!1,scope:!0,swipe_template:'
{{$template}}
',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;function isSelectable(__item){return!config.no_selection.enabled||eval("__item."+config.no_selection.prop+" === config.no_selection.val")}function replace(e,t,i){if(display.hasOML()){var n,a,o=toDataId(i[t]),r=display.oml('.ogx_dynamic_list[data-ogx-id="'+that.id+'"] > .ogx_dynamic_list_item[data-ogx-id='+o+"]",i,config.as);$('.ogx_dynamic_list[data-ogx-id="'+that.id+'"] > .ogx_dynamic_list_item[data-ogx-id='+o+"]").find(".ogx_uxi").each((function(e,t){n=$(t).data("ogx-id"),(a=that.cfind(!1,n,1))&&that.find(a._NAME_,a.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)));for(var i,n,a,o="",r=[],s=0;s0?(key=key_default,forceIds()):key=config.key,config.swipe&&("object"!=typeof config.swipe&&(config.swipe={}),OGX.Data.merge(config.swipe,swipe_default)),(container=that.el).addClass("ogx_dynamic_list")}function init(){initDefaults(),finalize(),config.scroll&&(scroller=that.find("Scroller",config.id+"_scroller"))}this.enable=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))),this},this.disable=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))),this},this.bindFilter=function(e,t,i){void 0!==i&&(config.list.removeFilter(e),config.list.addFilter(e,t,i)),config.list.getFilters()&&(filtered=config.list.filter(),isFiltered=!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(){return this.getSelection()},this.destroy=function(){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 a;void 0===t&&(t=!1),void 0===i&&(i=!0),e.hasOwnProperty("insert")||(e=new OGX.List(e)),this.resetSelection(),t||(a=config.list.getFilters()),config.list=e,config.key||(key_id=1,key=key_default,e=JSON.parse(JSON.stringify(e)),forceIds()),!t&&Object.keys(a).length?(config.list.setFilters(a),setTimeout(this.filter,0)):i?setTimeout(render,0):render()},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:config.display.val(e)},this.mode=function(e){return void 0===e?config.mode:(config.mode!==e&&(config.mode===OGX.DynamicList.STATIC?this.enable(!0):e===OGX.DynamicList.STATIC&&this.disable(!0),config.mode=e),this)},this.noSelection=function(e,t){return 1===arguments.length?"object"==typeof e?void(config.no_selection=e):void(config.no_selection.enabled=e):2===arguments.length?(config.no_selection.enabled=!0,config.no_selection.prop=e,void(config.no_selection.val=t)):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){if(!Array.isArray(e)){config.key||(e[key]=key_id++);var i=!1,n=!0;if(isFiltered){var a=new OGX.List(e);a.setFilters(config.list.getFilters()),0===a.filter().length?n=!1:filtered.push(e)}var o=toDataId(e[key]),r='
]/,pattern:!1,validate:!1,mask:!1,mask_char:"%",paste:!0,autocomplete:null,multiline:!1,input_cb:!1,change_cb:!1,diff:!0,val:null,last_change:!1,wait:2e3,intv:!1,max:2500,type:"string",params:null},n=new OGX.List,a=new OGX.List,o=!1;function r(t,i){if(!o){var a,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 c=d(r.form);for(var u in c)r.config.fields.hasOwnProperty(u)&&r.config.fields[u].hasOwnProperty("type")?c[u]=l(r.config.fields[u].type,c[u]):r.config.hasOwnProperty("type")&&(c[u]=l(r.config.type,c[u]));if(a=JSON.stringify(c),!r.diff||r.val!==a){var h;if(r.val=a,r.config.validate){h={obj:c,form:i,valid:!1};var f=e.validate(r.form);!0===f?h.valid=!0:(h.valid=!1,h.error=f)}else h=c;r.config.params&&(h.params=r.config.params),r.buffer&&clearTimeout(r.buffer),r.buffer=setTimeout((function(){r.config.change_cb(h)}),10)}}}}function s(t){var i={el:t.el,config:t,field:$(t.el),intv:!1};i.name=i.field.attr("name"),i.val=i.field.val(),i.field.val(i.val),t.pattern&&i.field.attr("pattern",t.pattern),n.insert(i),$(document).on("input change",i.el,(function(e){if(!o){var t=$(this).val();if(!i.config.diff||i.config.diff&&t!==i.val){if(i.config.input_cb){var n={value:null,obj:{},el:null};t=l(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(){!function(e){var t=$(e.el).val();if(e.val=t,e.config.change_cb){var i={value:null,obj:{},el:null};t=l(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(!o){if(i.config.mask&&8===e.which||46===e.which){var n=t[0].selectionStart,a=t.val();return a=8===e.which?a.substr(0,n-1):a.substr(0,n),t.val(a),!1}if(8!==e.which&&13!==e.which&&1===e.key.length){var r=e.key;if(13!==e.which&&i.config.mask){if((a=t.val()).length>=i.config.mask.length)return e.preventDefault(),e.stopImmediatePropagation(),!1;for(var s=i.config.mask,c=0;c=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})),a.insert(t)}(e),!0},this.unrestrictField=function(e){var t=a.find("el",e,1);return!!t&&($(document).off("textInput keydown",t.el),$(document).off("paste",t.el),a.findDelete("el",e,1),!0)},this.toObj=function(e){return d(e)},this.populate=function(e,t,i){var n,a,o;void 0===i&&(i=null),$(e).find("*[name]").each((function(e,r){n=r.getAttribute("name"),o=!1,"string"!=typeof(o=OGX.Data.eval(t,n))&&(o=JSON.stringify(o)),void 0!==o&&(i&&i.hasOwnProperty(n)&&"function"==typeof i[n]&&(o=i[n](o)),(a=$(r)).val(o),r.hasAttribute("type")&&"hidden"===a.attr("type")&&a.trigger("change"))})),setTimeout(c,0)},this.validate=function(e){var i,n=$(e),a=t.elem_types,o=[];return n.find(a.join(",")).each((function(e,t){"submit"!==(i=$(t)).attr("type")&&(t.checkValidity()||o.push(i))})),!o.length||o}},OGX.Form=new OGX.Form,OGX.Geo=function(e){"use strict";var t=this;void 0===e&&(e={});var i,n,a,o={map:null,markers:[],icon:"",browser_loc:null},r=e;function s(e,i){for(var n,a={},o=0;o1&&(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?(i=new google.maps.Geocoder,function(){for(var e in o)r.hasOwnProperty(e)||(r[e]=o[e])}(),r.map&&r.markers.length):$(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"),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,a,o,r,s,l,c,d,u,h,f=this,g=e,_={map:[[!0,!0,!0],[!0,!0,!0],[!0,!0,!0]],axis:{x:!0,y:!0},loop:!0,start:!1,chromeos:!1,capture:!1},p=!1,m={x:null,y:null},v={x:0,y:0},y=".ogx_grid_swiper_cell",x=!1,O=!1,b={x:0,y:0},w={x:0,y:0},G=(new Date).getTime()+Math.round(1e3*Math.random()),X=[];function T(e){e?t.on(f.touch.down,E):t.off(f.touch.down,E)}function E(e){p=!1,o=0,r=0,s=0,l=0,e=Y(e),m.x=e.pageX,m.y=e.pageY,x=!0,L(!0)}function D(e){e?$("body").on(f.touch.up,C):$("body").off(f.touch.up,C)}function C(e){x&&(x=!1,L(!1),S())}function S(e,t,o){var r,s;void 0===e&&(e=0),void 0===t&&(t=0),void 0===o&&(o=!0),o&&N(!0),i.addClass("ogx_grid_swiper_anim"),v=A(i),r=-1*Math.round((v.x+e)/n)*n*-1,s=-1*Math.round((v.y+t)/a)*a*-1,i.css({transform:"translate3d("+r+"px, "+s+"px, 0px)"})}function L(e){e?(k(!0),t.on(f.touch.move,M)):(k(!1),t.off(f.touch.move,M))}function M(e){e=Y(e),g.capture&&(e.preventDefault(),e.stopImmediatePropagation()),o=0,r=0,s=0,l=0,p||(g.axis.x&&Math.abs(e.pageX-m.x)>Math.abs(e.pageY-m.y)?p="x":g.axis.y&&Math.abs(e.pageX-m.x)0?1:-1):g.axis.y&&"y"===p&&(r=Math.abs(e.pageY-m.y),l=e.pageY-m.y>0?1:-1))}function k(e){e?h||(O=!1,h=setInterval(I,10)):h&&(clearInterval(h),h=null)}function I(){if((o||r)&&(O||t.trigger(OGX.GridSwiper.SWIPE_START),O=!0),g.axis.x&&"x"===p&&o&&s&&o<=n){if(!g.loop&&(b.x+-1*s<0||b.x+-1*s>g.map[0].length-1))return;if((c=(b.x+-1*s)%g.map[0].length)<0&&(c=Math.abs(g.map[0].length+c)),!1===g.map[w.y][c])return;u=o*s,i.css({transform:"translate3d("+(-1*b.x*n+u)+"px, "+v.y+"px, 0px)"})}else if(g.axis.y&&"y"===p&&r&&l&&r<=a){if(!g.loop&&(b.y+-1*l<0||b.y+-1*l>g.map.length-1))return;if((d=(b.y+-1*l)%g.map.length)<0&&(d=Math.abs(g.map.length+d)),!1===g.map[d][w.x])return;u=r*l,i.css({transform:"translate3d("+v.x+"px, "+(-1*b.y*a+u)+"px, 0px)"})}}function N(e){e?(i.off("transitionend"),i.on("transitionend",(function(){O&&(t.trigger(OGX.GridSwiper.SWIPE_END),O=!1),i.off("transitionend"),i.removeClass("ogx_grid_swiper_anim"),v=A(i);var e={x:null,y:null};e.x=-1*Math.round(v.x/n),e.y=-1*Math.round(v.y/a),b.x!==e.x?(s=b.x>e.x?1:-1,b.x=e.x,w.x=P(b).x,-1===s?(i.children(y+"[data-y="+(b.y-1)+"]").attr("data-x",b.x).css("left",b.x*n),i.children(y+"[data-y="+(b.y+1)+"]").attr("data-x",b.x).css("left",b.x*n),i.children(y+"[data-x="+(b.x-2)+"][data-y="+b.y+"]").attr("data-x",b.x+1).css("left",(b.x+1)*n),t.trigger(OGX.GridSwiper.SWIPE_LEFT,{cell:w,point:b}),R(X=[{x:b.x+1,y:b.y},{x:b.x,y:b.y-1},{x:b.x,y:b.y+1}]),W()):(i.children(y+"[data-y="+(b.y-1)+"]").attr("data-x",b.x).css("left",b.x*n),i.children(y+"[data-y="+(b.y+1)+"]").attr("data-x",b.x).css("left",b.x*n),i.children(y+"[data-x="+(b.x+2)+"][data-y="+b.y+"]").attr("data-x",b.x-1).css("left",(b.x-1)*n),t.trigger(OGX.GridSwiper.SWIPE_RIGHT,{cell:w,point:b}),R(X=[{x:b.x-1,y:b.y},{x:b.x,y:b.y-1},{x:b.x,y:b.y+1}]),W())):b.y!==e.y&&(l=b.y>e.y?1:-1,b.y=e.y,w.y=P(b).y,-1===l?(i.children(y+"[data-x="+(b.x-1)+"]").attr("data-y",b.y).css("top",b.y*a),i.children(y+"[data-x="+(b.x+1)+"]").attr("data-y",b.y).css("top",b.y*a),i.children(y+"[data-y="+(b.y-2)+"][data-x="+b.x+"]").attr("data-y",b.y+1).css("top",(b.y+1)*a),t.trigger(OGX.GridSwiper.SWIPE_UP,{cell:w,point:b}),R(X=[{x:b.x,y:b.y+1},{x:b.x-1,y:b.y},{x:b.x+1,y:b.y}]),W()):(i.children(y+"[data-x="+(b.x-1)+"]").attr("data-y",b.y).css("top",b.y*a),i.children(y+"[data-x="+(b.x+1)+"]").attr("data-y",b.y).css("top",b.y*a),i.children(y+"[data-y="+(b.y+2)+"][data-x="+b.x+"]").attr("data-y",b.y-1).css("top",(b.y-1)*a),t.trigger(OGX.GridSwiper.SWIPE_DOWN,{cell:w,point:b}),R(X=[{x:b.x,y:b.y-1},{x:b.x-1,y:b.y},{x:b.x+1,y:b.y}]),W())),p=0}))):i.off("transitionend")}function A(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%g.map[0].length,t.x<0&&(t.x=Math.abs(g.map[0].length+t.x)),t.y=e.y%g.map.length,t.y<0&&(t.y=Math.abs(g.map.length+t.y)),t}function R(e){for(var t,i={x:null,y:null},n=0;ng.map.length-1){if(!g.loop)return!1;i.y=P(e[n]).y}else i.y=e[n].y;if(e[n].x<0||e[n].x>g.map[0].length-1){if(!g.loop)return!1;i.x=P(e[n]).x}else i.x=e[n].x;t=g.map[i.y][i.x],H(e[n],t)}}function H(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-b.x,y:e.y-b.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 a='.ogx_grid_swiper[data-ogx-id="'+G+'"] > .ogx_grid_swiper_container > '+y+'[data-x="'+e.x+'"][data-y="'+e.y+'"] > '+y+"_content",o=P(e);for(var r in t){t[r].id="cell_"+o.x+"_"+o.y;break}t=OGX.OML.rename(t,a);var s=f.nodes.find("id","cell_"+o.x+"_"+o.y,1);s&&f.remove(s._NAME_,s.id),$(a).empty(),OGX.OML.render(f,t,{abs:e,rel:P(e)}),W()}}function W(){for(var e=0;e',c=-1*e,d=-1*o-a;g.axis.y&&(l+='
',l+='
'),l+='
',g.axis.x&&(l+='
',l+='
'),l+="
",t.html(l),i=t.children(".ogx_grid_swiper_container").first(),b.x=g.start.x,b.y=g.start.y,v.x=e,v.y=o,w.x=g.start.x,w.y=g.start.y}this.enable=function(){return T(!0),D(!0),W(),this},this.disable=function(){return T(!1),D(!1),k(!1),this},this.focus=function(){return this.blured&&(this.blured=!1,this.enabled&&(this.ux(!0),this.enable())),this},this.resize=function(){N(!1),i.removeClass("ogx_grid_swiper_anim"),n=t.width(),a=t.height();var e=b.x*-n,o=b.y*-a;i.children(y+"[data-y="+(b.y-1)+"]").css({top:(b.y-1)*a,left:b.x*n}),i.children(y+"[data-y="+b.y+"]").css({top:b.y*a,left:b.x*n}),i.children(y+"[data-y="+(b.y+1)+"]").css({top:(b.y+1)*a,left:b.x*n}),i.children(y+"[data-x="+(b.x-1)+"]").css({top:b.y*a,left:(b.x-1)*n}),i.children(y+"[data-x="+(b.x+1)+"]").css({top:b.y*a,left:(b.x+1)*n}),i.css("transform","translate3d("+e+"px, "+o+"px, 0px"),L(!1),setTimeout((function(){S(0,0,!1),i.addClass("ogx_grid_swiper_anim")}),0)},this.setMap=function(e,t){return g.map=e,void 0!==t&&(g.start=t),b={x:0,y:0},w={x:0,y:0},m={x:null,y:null},v={x:0,y:0},z(),U(),j(),this},this.setMapCell=function(e,t){return g.map[e.y]||(g.map[e.y]=[]),g.map[e.y][e.x]=t,this},this.getMapCell=function(e){return e.y>0&&g.map.length0&&g.map[e.y].length0){var i=e.data("id");e.html(OGX.Templater.make(s.template,s.list[i]))}return this},OGX.Data.merge(s,l),s.list.hasOwnProperty("insert")||(s.list=new OGX.List(s.list)),s.group_order&&!s.group_order.hasOwnProperty("insert")&&(s.group_order=new OGX.List(s.group_order)),s.display&&s.display.hasOwnProperty("css")&&("object"!=typeof s.display.css&&s.display.css?s.display.css+=" ogx_grouped_list_item":s.display.hasOwnProperty("add")?s.display.add="ogx_grouped_list_item "+s.display.add:s.display.add="ogx_grouped_list_item"),o=!1,(t=r.el).addClass("ogx_grouped_list"),g()},OGX.GroupedList.SELECT="GroupedListSelect",OGX.GroupedList.BIND=OGX.GroupedList.SELECT,require("Html","Uxi","Placeholder"),OGX.Html=function(e){construct(this,"Html"),this.rendered=!1,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,a,o=this,r={left:0,right:0,top:0,bottom:0,min:50,drag:!0,flatten:!1,"node:OML":{}},s=e,l=!1,c="normal",d="main",u={left:null,main:null,right:null,top:null,bottom:null},h=[0,0,0],f=0,g=0,_=0,p=0;function m(e){for(var t in u)u[t]&&u[t].instance&&(e===t?u[t].instance.focus():u[t].instance.blur())}function v(){l.hasClass("ogx_iceberg_anim")||(l.off("transitionend"),h=b(l))}function y(e){var t=0;return e.dirY&&e.distY>e.distX&&(t=1),t}function x(e){s.drag&&e.dist&&(!(n=y(e))&&["main","left","right"].includes(d)?e.dirX&&e.distX&&(t=h[0]+e.distX*e.dirX)<=g&&t>=f&&l.css({transform:"translate3d("+t+"px, 0, 0)"}):["main","top","bottom"].includes(d)&&e.dirY&&e.distY&&(i=h[1]+e.distY*e.dirY)<=p&&i>=_&&l.css({transform:"translate3d(0, "+i+"px, 0)"}))}function O(e){if(t=0,i=0,n=y(e),e.swipe&&e.dist){var o;switch(e.swipe=!1,d){case"main":-1===e.dirX&&s.right&&!n?(t=-u.right.outerWidth(),o="right",e.swipe=!0):1===e.dirX&&s.left&&!n?(t=u.left.outerWidth(),o="left",e.swipe=!0):1===e.dirY&&s.top&&n?(i=u.top.outerHeight(),o="top",e.swipe=!0):-1===e.dirY&&s.bottom&&n&&(i=-u.bottom.outerHeight(),o="bottom",e.swipe=!0);break;case"left":-1!==e.dirX||n||(t=0,o="main",e.swipe=!0);break;case"right":1!==e.dirX||n||(t=0,o="main",e.swipe=!0);break;case"top":-1===e.dirY&&n&&(i=0,o="main",e.swipe=!0);break;case"bottom":1===e.dirY&&n&&(i=0,o="main",e.swipe=!0)}a=n?1===e.dirY?OGX.Iceberg.SWIPE_DOWN:OGX.Iceberg.SWIPE_UP:1===e.dirX?OGX.Iceberg.SWIPE_RIGHT:OGX.Iceberg.SWIPE_LEFT,e.swipe&&e.dist&&(l.addClass("ogx_iceberg_anim"),l.on("transitionend",(function(){l.off("transitionend"),l.removeClass("ogx_iceberg_anim"),h=b(l),m(d=o),l.trigger(a,d)})),l.css({transform:"translate3d("+t+"px, "+i+"px, 0)"}))}else if(e.dist){switch(t=0,i=0,d){case"left":t=u.left.outerWidth();break;case"right":t=-u.right.outerWidth();break;case"top":i=u.top.outerHeight();break;case"bottom":i=-u.bottom.outerHeight()}l.addClass("ogx_iceberg_anim"),l.on("transitionend",(function(){l.off("transitionend"),l.removeClass("ogx_iceberg_anim"),h=b(l),l.trigger(OGX.Iceberg.RESTORE,d)})),l.css({transform:"translate3d("+t+"px, "+i+"px, 0)"})}}function b(e){var t=e[0].style.transform;if(t=t.match(/translate3d\(([0-9px%,\.\- ]+)\)/)){t=t[1].split(",");for(var i=0;i=s.flatten?(c="flattened",h=b(l),l.addClass("ogx_iceberg_views_flattened").css("transform","translate3d(0px, 0px, 0px)"),l.children(".ogx_iceberg_view").addClass("ogx_iceberg_view_flattened"),this.disable()):"flattened"===c&&this.el.width() .ogx_iceberg_views > .ogx_iceberg_view[data-ogx-panel-id="';for(var r in s["node:OML"])for(var c in s["node:OML"][r])0===c.indexOf("left")&&(i+='
',n.left=a+'left"]',u.left=!0),0===c.indexOf("top")&&(i+='
',n.top=a+'top"]',u.top=!0),0===c.indexOf("main")&&(i+='
',n.main=a+'main"]'),0===c.indexOf("right")&&(i+='
',n.right=a+'right"]',u.right=!0),0===c.indexOf("bottom")&&(i+='
',n.bottom=a+'bottom"]',u.bottom=!0);for(o.el.html(i),r=0;rt.width/t.height?(i.width=t.width,i.height=Math.round(e.height*(t.width/e.width))):(i.width=Math.round(e.width*(t.height/e.height)),i.height=t.height),i}({width:t,height:i},{width:a,height:o}),s=(a-r.width)/2,l=(o-r.height)/2;n.css("left",s+"px"),n.css("top",l+"px"),n.prop("width",r.width),n.prop("height",r.height)}function a(e){var t,i=$(e);i&&(i.find(".ogx_video").each((function(e,i){t=$(i),function(e,t,i){var n=$(e),a=t/i,o=n.parent().innerWidth(),r=n.parent().innerHeight(),s=o,l=Math.ceil(s/a);lo?c=(s-o)/2*-1:sr?d=(l-r)/2*-1:l0&&(r=0),n.parent().css("overflow","hidden"),n.prop("width",a),n.prop("height",o),n.css("top",r+"px")}(i,parseInt(t.data("width"),10),parseInt(t.data("height"),10))})),i.find(".ogx_image_fit").each((function(e,i){t=$(i),function(e,t,i){var n=$(e),a=t/i,o=n.parent().innerWidth(),r=o,s=Math.ceil(r/a),l=0;r>o?l=(r-o)/2*-1:rt&&(o=t);var r=Math.ceil(o/a);n.prop("width",o),n.prop("height",r)}(i,parseInt(t.data("width"),10),parseInt(t.data("height"),10))})))}function o(e){e?$(window).on("resize",r):$(window).off("resize",r)}function r(){for(var e in t)a(t[e].selector)}function s(e){var t;e.find(".ogx_video, .ogx_video_resp, .ogx_video_poster").each((function(e,i){(t=$(i)).parent().css("overflow","hidden"),i.hasAttribute("data-width")||(t.attr("data-width",t.attr("width")),t.attr("data-height",t.attr("height")))})),e.find(".ogx_image_cover, .ogx_image_contain, .ogx_image_fit, .ogx_image_scale, .ogx_image_resp").each((function(e,i){(t=$(i)).css("position","relative"),i.hasAttribute("data-width")||(t.attr("data-width",t.attr("width")),t.attr("data-height",t.attr("height")))})),a(e)}this.resize=function(e){void 0!==e?a(e):r()},this.bind=function(n,a){return!t.hasOwnProperty(n)&&(t[n]={observer:null,element:a},t[n].observer=(r=a,l=null,(c=new(window.MutationObserver||window.WebKitMutationObserver)((function(e,t){e.forEach((function(e){l&&clearTimeout(l),l=setTimeout((()=>{s($(r))}),10)}))}))).observe(document.querySelector(r),{childList:!0,subtree:!0}),c),t[n].selector=a,i++,e||(e=!0,o(!0)),s($(a)),!0);var r,l,c},this.unbind=function(n){return!(!t.hasOwnProperty(n)||!t[n].observer)&&(t[n].observer.disconnect(),delete t[n],!--i&&e&&(e=!1,o(!1)),!0)}},OGX.Media=new OGX.Media,require("NestList","Uxi","Bind"),OGX.NestList=function(e){construct(this,"NestList");var t,i,n=this,a={scope:["public"],template:'
{{$title}}
{{$body}}
',list:new OGX.List,item_default:!1,map:{title:"title",scope:"scope",id:"id"},order:!1},o={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,g=new OGX.List;function _(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"),n=!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"),g.findUpdate("id",i,{open:!0},!1,1),n=!0):(h.way=0,e.removeClass("ogx_nest_list_item_head_open").addClass("ogx_nest_list_item_head_closed"),g.findUpdate("id",i,{open:!1},!1,1));var a=g.find("id",i,1);n?(!function(e){var t=v(e);if(t)return t.focus(),!0}(a),t.trigger(OGX.NestList.OPEN,a)):(!function(e){var t=v(e);if(t)return t.blur(),!0}(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")),a=n.nodes.find("id",i,1);if(a)return a}return!1}function y(e){if(e.hasOwnProperty("scope"))for(var t=0;t .ogx_nest_list_item[data-ogx-nest-id="'+a.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="'+a.id+'"]');return a.hidden&&h.addClass("ogx_nest_list_item_hidden"),h.removeClass("ogx_nest_list_prep"),a}function b(){var e=s.list;f&&(e=i),t.empty(),g.clear();var a;t.html('
'),s.hasOwnProperty("node:OML")||(s["node:OML"]=[]);for(var o=0;o .ogx_nest_list_item[data-ogx-nest-id="'+g[t.index].id+'"]').remove(),g.splice(t.index,1),setTimeout(x,0))},this.updateNestHeight=function(e){var t=g.find(s.map.title,e,1);setTimeout((function(){var e,i;e=t,i=$(e.selector).outerHeight(!0),e.height=i,x()}),0)},this.updateNestsHeight=function(){for(var e,t=0;t{switch(e.type){case"text":return t.text();case"json":return t.json();default:return t.blob()}})).catch((e=>{$(document).trigger(OGX.Api.NETWORK_ERROR,e)})).then((i=>{e.data=i,n(e,t,a)}))}function o(e){switch(e){case"text":case"json":return"text/plain";default:return"application/zip"}}i.extensions.hasOwnProperty("insert")||(i.extensions=new OGX.List(i.extensions)),this.preload=function(e,t,i){var n={loaded:0,total:0,files:new OGX.List};for(var a in e)for(var o=0;oogx font init';$("body").append(o),n(e,i,a),function(e){setTimeout((function(){$('.ogx_font_loader[data-ogx-id="font-loader-'+e+'"]').remove()}),150)}(t),t++}o()}(l,o,r);break;case"pak":!function(e,t,i){function o(a){for(var o,r=//gi,s=[];o=r.exec(a);)s.push(o[1]);r=//gi;var l,c,d,u=a.split(r);u.shift();for(var h=0;h=!+]+ ?\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]+))/gi.exec(e))&&(s='OGX.Object.get({_NAME_:{eq:"'+r[3]+'"}, id:{eq:"'+r[2]+'"}}, null, 1);')===(e=e.replace(r[0],s)))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]+")[0];")===(e=e.replace(r[0],s))))return s;if(isSingleVar(e))return"return "+replaceVars(e,t,i,n,a)+";";for(e+="\r\n";o=/[\S ]+(\r\n|\n)?/gi.exec(e);){if(l=replaceLoop(l=o[0].replace(/(\r\n|\n)/gi,"").trim(),t,i,n,a),charcode++,l=replaceVars(l,t,i,n,a),/^(app|OGX)\.\S+;?/g.test(l))return"return "+l+";";if(e=e.replace(o[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,a,o){var r;try{r=new Function(oo,to,ro,lo,e)(t,i,n,a)}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,str=__string.trim();if(["$","%","@"].includes(str))switch(str){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,a){var o,r,s,l;return(o=/loop (\S+) ?(as (\S+) ?(\S+ )?)?{/gi.exec(e))&&(r="__"+String.fromCharCode(charcode).toLowerCase()+"__",s=(s=o[0]).replace(o[0],"for(var "+r+" in JSON.parse(JSON.stringify("+o[1]+"))){"),o[2]&&(l=o[4]?"&"+o[3]+"="+r+"; &"+o[4]+"="+o[1]+"["+r+"]; ":"&"+o[3]+"="+o[1]+"["+r+"]; "),s+=l,e=e.replace(o[0],s)),e}function replaceVars(e,t,i,n,a){for(var o,r,s,l=0;r=/((&|#|@|\$|%)([a-zA-Z_]{1}[a-zA-Z0-9\-_]*))(\.[a-z0-9\-_\.\[\]\$]+|\.\$|\.)?(;)?/gi.exec(e);){switch(s=!1,r[2]){case"&":s=to+"."+r[3];break;case"@":s=lo+"."+r[3];break;case"$":s=oo+"."+r[3];break;case"#":s=r[3];break;case"%":s=ro+"."+r[3]}if(o=r[0].replace(r[1],s),e=e.replace(r[0],o),++l>300)return e}for(;r=/([a-z_\-]+)\( *(\$|@|&|%) *\)/gi.exec(e);)s=getTrueVal(r[2]),o=r[1]+"("+s+")",e=e.replace(r[0],o);for(;/^(json|ose|template|oml|crumb|result) (\S+)/g.test(e);)if((r=/crumb (\S+)?/gi.exec(e))&&(o=n.hasOwnProperty(r[1])?"__route_object."+r[1]:"{}",e=e.replace(r[0],o)),(r=/json (\S+)(;)?/gi.exec(e))&&(r[1]=getTrueVal(r[1],t,i,n,a),e=e.replace(r[0],"app.getJSON("+r[1]+")")),(r=/^template (\S+)( \S+)?[ ;]?/gi.exec(e))&&(r[1]=getTrueVal(r[1],t,i,n,a),void 0===r[2]?r[2]="__object":r[2]=getTrueVal(r[2].trim(),t,i,n,a),e=e.replace(r[0],"OGX.Templater.make(OGX.Templater.get("+r[1]+"), "+r[2]+", "+to+","+ro+","+lo+")")),(r=/^ose (\S+)(;)?/gi.exec(e))&&(r[1]=getTrueVal(r[1],t,i,n,a),script=that.get(r[1]),script&&(e=exp.replace(r[0],script.replace(/({{|}})/g,"")))),(r=/^oml (\S+)(;)?/gi.exec(e))&&(r[1]=getTrueVal(r[1],t,i,n,a),e=e.replace(r[0],"app.getOML("+r[1]+")")),(r=/^result (\S+)(;)?$/gi.exec(e))&&(e=e.replace(r[0],'OGX.OML.result("'+r[1]+'")')),++l>300)return e;if(["$","@","%","&"].includes(e.trim())){switch(e.trim()){case"$":e=oo;break;case"@":e=lo;break;case"%":e=ro;break;case"&":e=to}return e}for(;r=/echo ('|")?(((?![;}\r\n]+|$)([\S\s]))*)(?:'|")?/gi.exec(e);){var c="+$1+",d="'";if(void 0!==r[1]&&(d="\\"+r[1]),c=d+c+d,r[2]=r[2].replace(/(__(?!;\n\r)[a-z0-9_\-\.]+)/gi,c),o="__echo.push("+d+r[2]+d+");",e=e.replace(r[0],o),++l>300)return e}return e}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 a in t.values)if(convertValue(a)===n)return t.values[a];return!1},this.execScript=function(e,t,i,n){var a=this.get(e);return a&&this.exec(a,t,i,n),!1},this.exec=function(e,t,i,n,a){void 0===t&&(t={}),void 0===i&&(i={}),void 0===n&&(n={}),void 0===a&&(a={}),charcode=65;var o=runJS(convertToJS(e,t,i,n,a),t,i,n,a,e);if(void 0!==o)return o}},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,a={anim:OGX.Overlay.FADE,display:{css:"",html:" "},index:!1,close_on_click:!1},o=!1,r="mousedown";function s(e){i&&(e?i.on(r,l):i.off(r,l))}function l(){"function"==typeof o.close_on_click&&o.close_on_click.apply(null,t),s(!1),t.removeOverlay()}e.hasOwnProperty("overlay")&&e.overlay&&setTimeout((function(){t.addOverlay(e.overlay)}),0),this.hasOverlay=function(){return!!i},this.addOverlay=function(e){if("object"!=typeof e&&(e={}),OGX.Data.merge(e,a),e.display.hasOwnProperty("_NAME_")||(e.display=new OGX.Display(e.display)),o=e,!this.hasOverlay()){var t=this.el;o.hasOwnProperty("el")&&(t=$(o.el));var n="z-index:"+(o.zindex?o.zindex:this.topIndex(t))+";",r='
'+o.display.html()+"
";if(t.prepend(r),(i=t.children(".ogx_overlay").first()).off("transitionend"),o.anim)switch(o.anim){case OGX.Overlay.FADE:setTimeout((function(){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){s(!1);var t=!1;if(void 0===e||!0===e?o.anim&&(t=o.anim):t=e,i){if(t){switch(t){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)})):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('
'),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,e.hasOwnProperty("placeholder")&&(this.pholder=e.placeholder),this.placeholder(e)},OGX.Placeholder.prototype.placeholder=function(e){var t;if("object"==typeof e["node:OML"]&&!Array.isArray(e["node:OML"])){var i=this.selector;for(var n in this.pholder&&(i+=" "+this.pholder),e["node:OML"])0===n.indexOf("default")&&(t=n.replace("default",i),e["node:OML"][t]=e["node:OML"][n],delete e["node:OML"][n])}},OGX.Placeholder.prototype.placeholders=function(e,t){if(void 0!==e&&void 0!==t){e.hasOwnProperty("node:OML")||(e["node:OML"]=[]);var i,n,a=e["node:OML"];a&&"string"==typeof a&&(0===a.indexOf("{{")?e["node:OML"]=OGX.OSE.exec(a):e["node:OML"]=OGX.Cache.read("oml",e["node:OML"]));for(var o=0;o=i.points[t].min&&oi.left&&t.lefti.top&&t.topscreen.width&&(e=screen.width),t>screen.height&&(t=screen.height);var i=r.width,n=r.height;if(_||(i=OGX.Data.getBestSize(e,i),n=OGX.Data.getBestSize(t,n)),r.center)"string"==typeof i&&(i=-1!==i.indexOf("%")?Math.round(e*Number(i.substr(0,i.length-1))/100):Number(i)),"string"==typeof n&&(n=-1!==n.indexOf("%")?Math.round(t*Number(n.substr(0,n.length-1))/100):Number(n)),x=Math.round(e/2-i/2),y=Math.round(t/2-n/2),r.drag&&(r.center=!1);else{var a=s.position();x=a.left,y=a.top,x>e&&(x=e-x),x<-i&&(x=0),y>t&&(y=t-n),y<0&&(y=0)}return{x:x,y:y,w:i,h:n}}function S(e,t,i,a,o,l){var c=!1,h=null;if(void 0===l&&(l=!1),void 0!==t&&!0!==t||(t=r.anim),t&&(c=t),!t&&p&&(c=p),t?n.el.removeClass(d+"_notrans"):n.el.addClass(d+"_notrans"),e?(n.front(),l||n.el.trigger(OGX.Popup.SHOW,n)):l||n.el.trigger(OGX.Popup.HIDE,n),c){var f={};switch(h=d+"_"+c,c){case OGX.Popup.SCALE:u[1]=e?"scale(1,1)":"scale("+r.anim_param.scale+", "+r.anim_param.scale+")",f.transform=u.join(" ");break;case OGX.Popup.FADE:f.opacity=e?1:0}e&&(s.css("display","flex"),f.visibility="visible",f.display="flex"),t||e||(f.visibility="hidden",f.display="none"),setTimeout((function(){s.css(f)}),50),t?(p=c,s.on("transitionend",(function(){s.off("transitionend"),e?n.resizeNodes():s.css({display:"none",visibility:"hidden"}),h&&s.removeClass(h),L(i,a,o)})),h&&s.addClass(h)):(s.removeClass(h),L(i,a,o))}else e?s.css({opacity:e,display:"flex",visibility:"visible"}):s.css({display:"none",visibility:"hidden"}),L(i,a,o)}function L(e,t,i){void 0!==e&&e&&e(t),void 0!==i&&i&&i(n.id)}function M(e){e?s.on(n.touch.down,"."+d+"_button",k):s.off(n.touch.down,"."+d+"_button",k)}function k(e){e.preventDefault(),e.stopImmediatePropagation();var t=$(this);if(!t.hasClass(d+"_button_disabled")){var i=t.index();s.trigger(OGX.Popup.CLICK_BUTTON,{index:i,value:r.buttons[i].label}),r.buttons[i].hasOwnProperty("callback")&&r.buttons[i].callback&&(r.buttons[i].hasOwnProperty("params")?r.buttons[i].callback.apply(null,[r.buttons[i].params]):r.buttons[i].callback())}}function I(){for(var e,t="",i=0;i0&&(e=r.buttons[i].enabled?"":d+"_button_disabled",t+=''+r.buttons[i].label+"");return t}function N(e,t){void 0===t&&(t=!0),r.buttons=new OGX.List(e);for(var i=0;i";return t}this.anim=null,this.group=r.group,this.x=0,this.y=0,this.z=0,this.construct=function(){},this.enable=function(){return this.enableResize(),r.icons&&r.icons.length&&A(!0),r.buttons&&r.buttons.length&&r.buttons_enabled&&M(!0),this},this.disable=function(){return this.disableResize(),r.icons&&r.icons.length&&A(!1),r.buttons&&r.buttons.length&&r.buttons_enabled&&M(!1),this},this.show=function(e,t,i){return S(1,e,t,i),this.focus(1),this},this.hide=function(e,t,i,n,a){return S(0,e,t,i,n,a),this.blur(1),this},this.resize=function(){return b(),this},this.maximize=function(){return r.maximize&&!m&&(m=!0,v={width:r.width,height:r.height,x:this.x,y:this.y},r.width=r.height="100%",b(!1),this.x=this.y=0,this.move(this.x,this.y)),this},this.normalize=function(){return r.maximize&&m&&(m=!1,r.width=v.width,r.height=v.height,b(!1),this.x=v.x,this.y=v.y,v=null,this.move(this.x,this.y)),this},this.destroy=function(){s.off("transitionend"),this.touch.wipe()},this.buttons=function(e){if(void 0===e)return r.buttons;N(e)},this.enableButton=function(e){return r.buttons[e].enabled=!0,l.children("."+d+"_button:eq("+e+")").removeClass(d+"_button_disabled"),r.buttons_enabled||(r.buttons_enabled=!0),this},this.disableButton=function(e){return r.buttons[e].enabled=!1,l.children("."+d+"_button:eq("+e+")").addClass(d+"_button_disabled"),this},this.enableButtons=function(){if(r.buttons.length)for(var e=0;e',r.icon&&(a+='
"),r.title&&(a+='
'+r.title+"
"),a+='
',r.icons&&(a+=Y()),a+="
");var o,c=1;if(u=["translate3d("+e.x+"px, "+e.y+"px, 0)"],r.anim)switch(r.anim){case OGX.Popup.FADE:c=0,o=d+"_fade";break;case OGX.Popup.SCALE:o=d+"_scale",u[1]="scale("+r.anim_param.scale+", "+r.anim_param.scale+")"}a+='
',r.html?a+=r.html:r.template&&(a+=OGX.Templater.make(OGX.Templater.get(r.template),r.data)),a+="
",r.buttons&&r.buttons.length&&(a+='
',a+=I(),a+="
"),s.html(a),s.css({width:t,height:i,opacity:c,transform:u.join(" "),"z-index":n.z}),r.anim&&s.addClass(o),n.el=s,l=s.children("."+d+"_buttons").first()}(),r.drag){var e={x:!0,y:!0,cb_down:T,cb_up:E,target:"."+d+"_head"};r.group?e.cb_drag=D:"function"==typeof r.drag&&(e.cb_drag=function(e){r.drag(n,e)}),n.touch.add("Drag",e)}if(r.resize&&n.setResize({top:!1,cb_resize:O,cb_down:G,cb_up:X}),r.hasOwnProperty("html")&&r.html)r["node:OML"]=[{"default:Html":{html:r.html}}];else if(r.hasOwnProperty("view")&&r.view){var t={};t["default:Views."+r.view.id]=r,r["node:OML"].push(t)}n.placeholders(r,["."+d+'[data-ogx-id="'+r.id+'"] > .'+d+"_body"]),r.overlay&&n.addOverlay(),n.observe(!0,undefined,(function(){n.resizeNodes(),n.observe(!1),r.show&&n.show()}))}()},OGX.Popup.FADE="fade",OGX.Popup.SCALE="scale",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,a,o,r,s,l,c=this,d=e,u={enabled:!0,top:!0,left:!0,right:!0,bottom:!0,min_width:100,min_height:100,max_width:0,max_height:0,border:10,cb_up:!1,cb_down:!1,cb_resize:!1},h=!1,f="mousedown",g="mouseup",_="mousemove",p=(d=!1,!1),m=!1,v={w:0,h:0};function y(e){d&&(e?c.el.on(f,x):c.el.off(f,x))}function x(e){var u=T(e);n=u.pageX,a=u.pageY;var h=c.el.position();t=h.left,i=h.top;var f=c.el.offset(),g=n-f.left,_=a-f.top;v.w=c.el.width(),v.h=c.el.height(),o=0,r=0,s=0,l=0,d.top&&_c.el.height()-d.border&&(l=1),d.left&&gc.el.width()-d.border&&(s=1),p=-1!==window.getComputedStyle(c.el[0],"width"),m=-1!==window.getComputedStyle(c.el[0],"height"),(s||l)&&(e.preventDefault(),c.hasOwnProperty("dragable")&&c.dragable&&c.touch.drag.disable(),O(!0),w(!0),d.cb_down&&d.cb_down())}function O(e){e?h||(h=setInterval(b,5)):h&&(clearInterval(h),h=!1)}function b(){if(-1===s||-1===l){var e=t,n=i;o&&s&&(e+=o),r&&l&&(n+=r),o&&-1===s&&r&&1===l&&(n=i),c.el.css("transform","translate3d("+e+"px, "+n+"px, 0)")}s&&v.w+o*s>d.min_width&&(p?c.el.width(Math.round(100*(v.w+o*s)/c.el.parent().width()*100)/100+"%"):c.el.width(v.w+o*s)),l&&v.h+r*l>d.min_height&&(m?c.el.height(Math.round(100*(v.h+r*l)/c.el.parent().height()*100)/100+"%"):c.el.height(v.h+r*l)),(o||r)&&(d.cb_resize?d.cb_resize():c.el.trigger(OGX.Resize.RESIZING))}function w(e){e?($("body").on(_,G),$("body").on(g,X)):($("body").off(_,G),$("body").off(g,X))}function G(e){e.preventDefault(),e.stopImmediatePropagation(),e=T(e),o=e.pageX-n,r=e.pageY-a}function X(e){O(!1),w(!1),e=T(e),o=e.pageX-n,r=e.pageY-a,d.cb_up&&d.cb_up(),c.hasOwnProperty("dragable")&&c.dragable&&(y(!1),c.touch.drag.enable(),setTimeout((function(){y(!0)}),0))}function T(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,u,!1),d=e},this.enableResize=function(){return y(!0),this},this.disableResize=function(){return y(!1),this},this.destroy=function(){this.touch.wipe()},OGX.Data.merge(d,u,!1),void 0===window.ontouchstart||d.chromeos||(f="touchstart",_="touchmove",g="touchend"),c.hasOwnProperty("dragable")&&c.dragable&&(c.touch.drag=c.touch.add("Drag",{state:"manual"}))},OGX.Resize.RESIZING="resizeResizing",require("Roulette","Uxi","Bind","Touch"),OGX.Roulette=function(e){construct(this,"Roulette");var t,i,n,a,o,r,s,l=this,c=e,d={force_coef:10,time_coef:.1,min_force_pitch:2,value:null,name:!1,required:!1,display:!1,key:"value",mode:OGX.Roulette.MODE_REWIND,icon:!1,list:new OGX.List,capture:!1},u={template:!1,html:'{{$label}}',css:!1},h="object",f=0,g=0,_="ogx_roulette";function p(e,t){void 0===t&&(t=!0),l.el.children('input[name="'+c.name+'"]').val(e),t&&l.el.children('input[name="'+c.name+'"]').trigger("change")}function m(e){e?t.on(l.touch.down,"."+_+"_icon",(function(e){e.preventDefault(),e.stopImmediatePropagation(),l.next(!0)})):t.off(l.touch.down,"."+_+"_icon")}function v(e){e?t.on("change","input[type=hidden]",y):t.off("change","input[type=hidden]",y)}function y(e){e.preventDefault(),e.stopImmediatePropagation(),l.loopval(0,OGX.Data.stringToVal(e.target.value),!1)}function x(e){return g+e>c.list.length-1?c.list[0]:g+e<0?c.list[c.list.length-1]:c.list[g+e]}function O(e){a=e.y,G(!0)}function b(e){var t;e.dirY!==o?(t=0,a=e.pt1.y):(t=e.pt1.y-a,a=e.pt1.y),o=e.dirY,i.css({transition:"none",transform:"translate3D(0px, "+(D(i)+t)+"px, 0px)"})}function w(e){G(!1),trans=D(i);var t=Math.round(trans/n)*n,a=Math.round(t/n%c.list.length);if(a=a<=0?Math.abs(a):c.list.length-a,g!==a){switch(g=a,h){case"string":c.value=c.list[g];break;case"object":c.value=c.list[g][c.key]}c.name&&l.el.children('input[name="'+c.name+'"]').val(c.value).trigger("input"),l.el.trigger(OGX.Roulette.CHANGE,c.value)}i.css({transition:"all 0.2s ease-out",transform:"translate3D(0px, "+t+"px, 0px)"})}function G(e){e?r=setInterval(X,10):clearInterval(r)}function X(){var e,t,a;(e=Math.floor((i.position().top+n*o)/(n*c.list.length)*-1))!==f&&(0===i.children("."+_+'_stripe[data-id="'+e+'"]').length&&((t=s.clone()).css("top",e*(n*c.list.length)+"px"),t.attr("data-id",e),i.append(t)),i.children("."+_+"_stripe").each((function(e,t){a=i.position().top+$(t).position().top,(Math.ceil(a+n*c.list.length)<-n||a>n)&&$(t).remove()})),f=e)}function T(){G(!1),i.off("transitionend",T)}function E(){var e="",a="";c.icon&&(a+='
'),a+='
';for(var o=0;o<2;o++){a+='
';for(var r=0;r'+e+"
"}a+="
"}if(a+="
",c.icon&&(a+='
'),void 0===g&&(g=0),c.name){var l="";switch(c.required&&(l=" required"),h){case"string":a+='";break;case"object":a+='"}}t.html(a),i=t.children("."+_+"_stripes").first(),c.icon&&(i=t.children("."+_+"_container").children("."+_+"_stripes").first()),s=(s=i.children("."+_+"_stripe:last")).detach();var d=g*n*-1;i.css({transition:"none",transform:"translate3D(0px, "+d+"px, 0px)"})}function D(e){var t=0;return"none"!==e.css("transform")&&(t=Number(e.css("transform").split(",")[5].split(")")[0])),t}function C(e){switch(h){case"string":return{index:c.list.indexOf(e)};case"object":return c.list.findIndex(c.key,e)}}function S(){c.list.length>0&&!c.list.hasOwnProperty("insert")&&(c.list=new OGX.List(c.list)),"string"==typeof c.list[0]&&(h="string"),1===c.list.length&&(c.list[1]=c.list[0])}this.enable=function(){return t.removeClass(_+"_disabled"),c.icon&&m(!0),c.name&&v(!0),this},this.disable=function(){return t.addClass(_+"_disabled"),c.icon&&m(!1),c.name&&v(!1),G(!1),this},this.bindFilter=function(e,t,i){return c.list.removeFilter(e),c.list.addFilter(e,t,i),c.list.filter(),setTimeout(E,0),this},this.destroy=function(){this.touch.wipe()},this.bindRender=function(e,t){},this.val=function(e,t){if(void 0!==e){var a=C(e).index;return a>-1&&(!function(e,t){void 0===t&&(t=!0);i.off("transitionend",T),G(!1),o=-1;var a=D(i),r=Math.round(a/n)*n,s=a-r,l=Math.round(r/n%c.list.length);l=l<=0?Math.abs(l):c.list.length-l;var d=l-e;c.mode===OGX.Roulette.MODE_CLOSEST&&d>c.list.length/2&&(d=-1*(c.list.length-l+e));var u=a+d*n-s,h=20*Math.round(Math.abs(d*n)*c.time_coef);G(!0),i.on("transitionend",T),i.css({transition:"all "+h+"ms ease-out",transform:"translate3D(0px, "+u+"px, 0px)"}),g=e}(a),c.name&&p(e,!1)),this}switch(h){case"string":return c.list[g];case"object":return c.list[g][c.key]}},this.item=function(){return c.list[g]},this.loopval=function(e,t,a){var o=g,r=C(t).index;r>-1&&(g=r);var s=o-r,l=c.time_coef*Math.abs(s+e*c.list.length);return G(!0),i.css({transition:"all "+l+"s ease-out",transform:"translate3D(0px, "+(D(i)+(s*n-c.list.length*n*e))+"px, 0px)"}),i.on("transitionend",T),c.name&&p(t,a),void 0!==a&&a&&this.el.trigger(OGX.Roulette.CHANGE,val),this},this.next=function(e){var t,i=x(1);switch(o=1,h){case"string":t=i;break;case"object":t=i[c.key]}return this.val(t),void 0!==e&&e&&(this.el.trigger(OGX.Roulette.CHANGE,t),c.name&&this.el.children('input[name="'+c.name+'"]').trigger("input")),this},this.prev=function(e){var t,i=x(-1);switch(h){case"string":t=i;break;case"object":t=i[c.key]}return this.val(t),void 0!==e&&e&&(this.el.trigger(OGX.Roulette.CHANGE,t),c.name&&this.el.children('input[name="'+c.name+'"]').trigger("change")),this},this.setData=function(e,t){return c.value=t,c.list=e,S(),g=void 0===t?0:C(t).index,setTimeout(E,0),this},function(){if(OGX.Data.merge(c,d),S(),c.display?c.display=new OGX.Display(c.display):c.display=new OGX.Display(u),(t=l.el=$(c.el)).addClass(_),t.width(),n=t.height(),c.list.length){var e=t.parent();e[0].hasAttribute("data-value")&&(c.value=OGX.Data.stringToVal(e.data("value")),e.removeAttr("data-value")),null===c.value&&(c.value=c.list[0],"object"==typeof c.value&&(c.value=c.value.value)),g=C(c.value).index}}(),l.observe(!0,{childList:!0},(function(){l.observe(!1),l.touch.swipe=l.touch.add("Swipe",{x:!1,y:!0,cb_down:O,cb_swipe:b,cb_up:w,target:'.ogx_roulette[data-ogx-id="'+l.id+'"] > .ogx_roulette_container',capture:c.capture})}),null),E()},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,a=this,o=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;t0&&(e=s[t-1].roulette.val()),0===t||t-1>=0&&null!==e&&String(e).length>0?s[t].roulette.focus():t>0&&_(s[t].roulette)}function d(e,a){e.stopImmediatePropagation();var o,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+10&&s[a].roulette.setData(g(i),t),i.push(t)));setTimeout(c,0)}function g(e){for(var t=o.data,i=0;i-1?h(n):{};f(e)},o=OGX.Data.merge(o,r),(t=a.el).addClass("ogx_roulette_tree"),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('
'),i=o.groups[c-1],e=[{label:i,value:"",head:!0}],l)e.push({label:u,value:u});d=a.create("Roulette",{el:'.ogx_roulette_tree[data-ogx-id="'+a.id+'"] .ogx_roulette_tree_roulette[data-ogx-roulette="'+c+'"]',list:e,icon:o.icon,value:null,name:i,required:o.required}),n>1&&_(d),s.push({roulette:d,group:i,id:d.id})}if(ce.unix+e.expiration)}function getCache(e){if(void 0===e)return!1;for(var t,i,n=0;n0}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","Touch"),OGX.Scroller=function(e){construct(this,"Scroller");var t,i,n,a,o,r,s,l,c,d,u,h=this,f=e,g={check_delay:30,fade_delay:300,css:!1,zindex:9999,observe:!0,auto_scroll:!1,scroll_callback:!1,trigger:!0},_=0,p="init",m=!1,v=!1,y=null;function x(e){e?i.on(h.touch.down,O):i.off(h.touch.down,O)}function O(e){e=h.event(e),S(!1),G(!0),b(!0),x(!1),L("in"),D(!0)}function b(e){e?(d=setInterval(E,10),i.on(h.touch.move,w)):(clearInterval(d),i.off(h.touch.move,w))}function w(e){e=h.event(e)}function G(e){e?$(document).on(h.touch.up,X):$(document).off(h.touch.up,X)}function X(){b(!1),G(!1),x(!0),D(!1),L("out")}function T(e){e?(window.addEventListener("resize",I),i.on("scroll",(function(e){e.stopImmediatePropagation(),E()})),i.on("wheel",(function(e){D(!0)})),void 0!==OGX.NestedList&&$(document).on(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED,(function(){h.update()}))):(window.removeEventListener("resize",I),i.off("scroll"),i.off("wheel"),void 0!==OGX.NestedList&&$(document).off(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED))}function E(){var e,a=(e=i.scrollTop())/s,r=Math.round(o.position().top);o.css("top",a+"px"),f.trigger&&!m&&(h.el.trigger(OGX.Scroller.SCROLL,{top:e,percent:100*e/n}),-1*e==i.outerHeight(!0)-t.outerHeight(!0)?r!==Math.round(a)&&h.el.trigger(OGX.Scroller.BOTTOM):0===e&&(r&&r!==Math.round(a)||!r)&&h.el.trigger(OGX.Scroller.TOP)),f.scroll_callback&&f.scroll_callback()}function D(e){e?(c&&D(!1),l=t.position().top,c=setInterval(C,f.check_delay-10)):(c&&(clearInterval(c),c=null),v=!1,h.el.trigger(OGX.Scroller.END))}function C(){var e=t.position().top;e!==l?(v||(v=!0,h.el.trigger(OGX.Scroller.START)),L("in")):L("out"),l=e}function S(e){e?u=setInterval(E,f.check_delay):clearInterval(u)}function L(e){o.hasClass("ogx_scroller_track_anim")||o.addClass("ogx_scroller_track_anim"),"in"===e?(clearTimeout(y),y=null,o.addClass("ogx_scroller_track_anim_fade_in").removeClass("ogx_scroller_track_anim_fade_out")):y||(y=setTimeout((function(){o.addClass("ogx_scroller_track_anim_fade_out").removeClass("ogx_scroller_track_anim_fade_in")}),f.fade_delay))}function M(e){e?h.observe(!0,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","src","width","height"]},k):h.observe(!1)}function k(){_!==t.height()&&(_=t.height(),I(),f.auto_scroll&&h.bottom())}function I(){if(a=i.innerHeight(),n=t.height(),s=n/a,n>a){var e=Math.round(a/s);o.css("height",e+"px"),r.css("display","block")}else r.css("display","none");"init"===p&&(p=OGX.Scroller.READY,h.el.trigger(OGX.Scroller.READY))}this.enable=function(){return I(),T(!0),f.observe&&setTimeout((function(){M(!0)}),0),x(!0),this},this.disable=function(){return T(!1),f.observe&&M(!1),G(!1),b(!1),x(!1),D(!1),S(!1),o.removeClass("ogx_scroller_track_anim_fade_in"),o.removeClass("ogx_scroller_track_anim_fade_out"),this},this.resize=function(){return I(),this},this.destroy=function(){h.el.removeClass("ogx_scroller_outer"),t.remove(),r.remove()},this.top=function(){return n>a&&(i[0].scrollTop=0,I()),this},this.bottom=function(){return n>a&&(i.scrollTop(n),I()),this},this.scroll=function(e){return void 0===e?i[0].scrollTop:(i[0].scrollTop=e,I(),this)},this.mute=function(){return m=!0,this},this.vocal=function(){return m=!1,this},this.container=function(){return t},this.inner=function(){return t[0]},this.outer=function(){return i[0]},this.state=function(){return p},OGX.Data.merge(f,g),function(){h.el=$(f.el),h.el.addClass("ogx_scroller_outer ogx_hw"),(i=h.el).html('
'),t=i.children(".ogx_scroller_inner");var e='
';i.parent().append(e),r=i.parent().find(".ogx_scroller_track"),o=r.find(".ogx_scroller_track_button")}(),I()},OGX.Scroller.READY="ScrollerReady",OGX.Scroller.TOP="ScrollerTop",OGX.Scroller.BOTTOM="ScrollerBottom",OGX.Scroller.SCROLL="ScrollerScroll",OGX.Scroller.START="ScrollerStart",OGX.Scroller.END="ScrollerEnd",require("StackedTree","Uxi","Touch"),OGX.StackedTree=function(e){construct(this,"StackedTree");var t,i,n,a,o=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?(t.on(o.touch.down,".ogx_stacked_tree_level .ogx_stacked_tree_level_prev",g),t.on(o.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';e>0&&(r=(r=a.css(u)).replace(h+"_door",""),c+='
'+a.html(u)+"
"),c+='
',i.append(c);var d=i.children("."+h+'_level[data-level="'+e+'"]').children("."+h+"_level_list");i.children("."+h+"_level").css("flex-basis",Math.floor(100/(e+1)*100)/100+"%"),function(e,t,i){l[e]&&o.remove(l[e].id,"DynamicList");var n=o.create("DynamicList",{el:t,mode:"static",scroll:!0,display:s.display,displays:s.displays,list:i});l[e]=n}(e,d[0],t)}function v(e,t){f(!1),i.addClass(h+"_anim"),void 0!==t&&t?i.on("transitionend",(function(){i.off("transitionend"),i.removeClass(h+"_anim").css("width",100*(e+1)+"%"),o.remove(l[e+1].id,OGX.DynamicList.NAME),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,f(!0)})):(d=e,f(!0)),n=i.width(),i.css("transform","translateX("+e*Math.round(n/c.length)*-1+"px)")}this.enable=function(){return f(!0),_(!0),this},this.disable=function(){return f(!1),_(!1),this},this.resize=function(){return p(),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},function(){s=OGX.Data.merge(s,r,!1,!0);var e=(a=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){var t=['{{return typeof($items) !== "undefined" && $items.length > 0}}',{add:"ogx_stacked_tree_door"}];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",e.css.hasOwnProperty("conditions")?e.css.conditions.push(t):e.css.conditions=[t];else{var i="";e.css&&(i=e.css),i+=" ogx_stacked_tree_item",e.css={add:i,conditions:[t]}}else e.css={add:"ogx_stacked_tree_item",conditions:[t]};return e}return e}(e),a.val(e),s.display=e.display,s.displays=e.displays,(t=o.el).addClass(h),s.list.length){var i=s.list.slice();s.list={items:i}}}(),t.html('
'),i=t.children("."+h+"_container").first(),s.list.items.length&&m(c[0],s.list.items)},OGX.StackedTree.BACK="StackedTreeBack",OGX.StackedTree.ENTER="StackedTreeEnter",OGX.StackedTree.SELECT="StackedTreeSelect",require("Stage","Uxi","Touch","Placeholder"),OGX.Stage=function(e){construct(this,"Stage");var t=this,i=OGX.Data.merge({id:"stage",anim:null,group_watch:!1},e,!0,!0);function n(e){e?t.el.on(t.touch.down,".ogx_stage_exit",(function(){app.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.enable=function(){return i.closeable&&n(!0),this},this.disable=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 a="";i.closeable&&(a='
');var o=e.html();i.hasOwnProperty("data")&&(o=OGX.Templater.make(o,i.data)),a+=o,container=t.el,container.html(a),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,a={el:"document",bind:!1,labels:!0,data:[{label:"OFF",value:!1},{label:"ON",value:!0}],value:!1,name:!1},o="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("."+o+"_dot").first(),a=t.find("."+o+"_label").first(),r=t.find("."+o+"_label").last();n.value==n.data[0].value?(i.removeClass(o+"_dot_right").addClass(o+"_dot_left"),a.removeClass(o+"_label_off").addClass(o+"_label_on").addClass(o+"_selected"),r.removeClass(o+"_label_on").addClass(o+"_label_off").removeClass(o+"_selected")):(i.removeClass(o+"_dot_left").addClass(o+"_dot_right"),r.removeClass(o+"_label_off").addClass(o+"_label_on").addClass(o+"_selected"),a.removeClass(o+"_label_on").addClass(o+"_label_off").removeClass(o+"_selected")),n.name&&t.find('input[type="hidden"]').attr("value",n.value),e&&t.children("."+o+"_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),t.trigger(OGX.Switch.CHANGE,n.value),t.children("."+o+"_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.enable=function(){return l(!0),n.name&&d(!0),t.removeClass(o+"_disabled"),this},this.disable=function(){return l(!1),n.name&&d(!1),t.addClass(o+"_disabled"),this},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("."+o+"_val").first().trigger("input")),n.value},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,a),void 0!==e&&(n.value=e),(t=i.el).addClass(o+"_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+=''+n.data[0].label+"");var i="";n.value===n.data[1].value&&(i=o+"_dot_right"),e+='
',n.labels&&(e+=''+n.data[1].label+""),n.name&&(e+=''),t.html(e),t.addClass(o)}(),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,a={editable:!0,detachable:!1,detach_min:20,reorder:!0,icons:!1,index:0,list:new OGX.List,display:{html:"",css:""}},o=!1,r=0,s=!1,l=!1,c=!1,d=!1,u=!1,h={x:0,y:0},f="ogx_tabs";function g(){for(var e,i,a='
',s=0;s',e&&(a+=''+e+""),n.editable&&(a+=''),a+="
",i="";a+="",n.editable&&(a+='
',t.addClass(f+"_editable")),t.html(a),o=t.children("."+f+"_container").children("."+f+"_tab:eq("+r+")")}function _(e){s||(u=!1,l=$(e),c={from:l.index()},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"),o=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),d=setInterval(m,5))}function p(e,a){if(s)if(u=a,Math.abs(a.x)>Math.abs(a.y)){var o=s.x+a.x;s.el.css("transform","translate3d("+o+"px, "+s.y+"px, 0px)")}else{var r=s.y+a.y;if(s.el.css("transform","translate3d("+s.x+"px, "+r+"px, 0px)"),Math.abs(a.y)>4){c.to=l.index(),v();var d=n.list[c.from];"object"==typeof d&&(d=d.label);var h={label:d,index:c.to};i.removeAt(c.to),t.trigger(OGX.Tabs.REMOVE,h)}}}function m(){var e,i,n;s&&u&&(idx=l.index(),Math.abs(u.x)>Math.abs(u.y)&&t.children("."+f+"_container").children("."+f+"_tab").each((function(t,a){(e=$(a)).hasClass(f+"_tab_active")||(i=e.position(),n=e.width(),idx!==t&&(s.x+u.x>i.left+n/2&&s.x+u.xi.left&&s.x+u.xe&&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(g,0),this},this.removeCurrent=function(){return o&&this.removeTabAt(r),this},this.removeAt=function(e){return n.list.delete(e)&&(t.children("."+f+"_container").first().children("."+f+"_tab:eq("+e+")").remove(),o=null,function(){r>0?r--:r=0;i.index(r)}()),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?(o&&(o.removeClass(f+"_tab_active"),o=null),(o=t.children("."+f+"_container").first().children("."+f+"_tab:eq("+e+")")).addClass(f+"_tab_active"),r=e,!0):o?r:-1},this.select=function(e){o&&o.removeClass(f+"_tab_active");var t=n.list.findIndex("label",e);return this.index(t.index),this},n||(n={}),OGX.Data.merge(n,a),n.list.hasOwnProperty("insert")||(n.list=new OGX.List(n.list)),n.display.hasOwnProperty("_NAME_")||(n.display=new OGX.Display(n.display)),(t=i.el).addClass(f),n.editable&&t.addClass(f+"_editable"),r=n.index,setTimeout(g,0),n.reorder&&i.touch.hold.set({target:".ogx_tabs_tab",cb_hold:_,cb_move:p,cb_up:v})},OGX.Tabs.SELECT="TabsSelect",OGX.Tabs.CLOSE="TabsClose",OGX.Tabs.REORDER="TabsReoroder",OGX.Tabs.ADD="TabsAdded",OGX.Tabs.REMOVE="TabsRemoved",require("Tags","Uxi","Touch"),OGX.Tags=function(__config){construct(this,"Tags");var that=this,config=__config,config_default={remove:!0,add:!0,name:!1,tags:[],current_tags:[],tags_ascii:[],mode:OGX.Tags.MODE_STRING,keycode:13,placeholder:"keywords",restrict:!1,strict:!1,required:!1,max:0,display_max:0,display_more:!1,click_more:!1,hide_input_on_disable:!0,more_word:"other"},container,input,sliced={org:[],rem:[]};function updateHidden(e){var t;t=1===config.max&&config.current_tags.length?config.current_tags[0]:JSON.stringify(config.current_tags),container.find("input[type=hidden]").val(t),e&&container.find("input[type=hidden]").trigger("change")}function addTag(e){var t=!1;switch(config.mode){case OGX.Tags.MODE_STRING:case OGX.Tags.MODE_ASCII:-1===config.current_tags.indexOf(e)&&(config.current_tags.push(e),t=!0);break;case OGX.Tags.MODE_OBJECT:var i=config.current_tags.find("label",e,1);i||((i=config.tags.find("label",e,1))?config.current_tags.push(i):config.current_tags.push({label:e}),t=!0)}if(t){var n="";!0===config.remove&&(n='');var a=''+e+""+n+"";container.find(".ogx_tags_tags").first().append(a),listenHidden(!1),updateHidden(!0),listenHidden(!0),container.trigger(OGX.Tags.TAG_ADDED,e),container.trigger(OGX.Tags.CHANGE,[config.current_tags])}container.find(".ogx_tags_input").trigger("focus")}function removeTag(e){var t=!1;switch(config.mode){case OGX.Tags.MODE_STRING:case OGX.Tags.MODE_ASCII:var i=config.current_tags.indexOf(e);i>-1&&(t=config.current_tags.splice(i,1));break;case OGX.Tags.MODE_OBJECT:t=config.current_tags.findDelete("label",e)}return t&&container.find(".ogx_tags_tags").first().find(".ogx_tags_tag").each((function(t,i){if($(i).find("span").first().text()===e)return $(i).remove(),listenHidden(!1),updateHidden(!0),void listenHidden(!0)})),t}function displayTags(e,t){if(e){container.find(".ogx_tags_container").length>0&&(displayTags(!1),listenTagAdd(!1));for(var i='
',n=!1,a=0;a";break;case OGX.Tags.MODE_OBJECT:i+=''+t[a].label+""}n&&(i+='+'+n+" "+config.more_word+""),i+="
",container.append(i),listenTagAdd(!0)}else container.find(".ogx_tags_container").remove(),listenTagAdd(!1)}function renderTags(e){for(var t="",i="",n=0;n':"",config.mode){case OGX.Tags.MODE_STRING:case OGX.Tags.MODE_ASCII:t+=''+e[n]+""+i+"";break;case OGX.Tags.MODE_OBJECT:t+=''+e[n].label+""+i+""}return config.current_tags=e,container.find(".ogx_tags_tags").first().html(t),updateHidden(!1),!0}function trimTags(e){return e=OGX.Data.clone(e),sliced={org:OGX.Data.clone(e),rem:[]},Array.isArray(e)&&config.display_max&&e.length>config.display_max&&(sliced.rem=e.slice(config.display_max),e=e.slice(0,config.display_max)),config.display_more&&sliced.rem.length&&e.push({__m__:sliced.rem.length}),new OGX.List(e)}function findTags(e){for(var t,i=[],n=0;n=3)if(!config.strict&&e.which===config.keycode&&config.add)addTag(t),input.val(""),displayTags(!1);else{var i;switch(config.mode){case OGX.Tags.MODE_STRING:i=findTags(t);break;case OGX.Tags.MODE_OBJECT:i=findTagsObj(t);break;case OGX.Tags.MODE_ASCII:i=findTagsAscii(t)}i.length>0?displayTags(!0,i):displayTags(!1)}else displayTags(!1)})):input.off("keyup")}function listenSelect(e){e?container.on(that.touch.down,".ogx_tags_tag",onSelect):container.off(that.touch.down,".ogx_tags_tag",onSelect)}function onSelect(e){var t=$(this).text();switch(config.mode){case OGX.Tags.MODE_OBJECT:t=config.current_tags.get({label:{eq:t}},null,1)}that.el.trigger(OGX.Tags.SELECT,t)}function listenMore(e){e?container.on(that.touch.down,".ogx_tags_more",onMore):container.off(that.touch.down,".ogx_tags_more",onMore)}function onMore(e){e.preventDefault(),e.stopImmediatePropagation(),sliced.rem.length&&($(this).remove(),displayTags(!0,sliced.org))}function listenTagAdd(e){e?container.on(that.touch.down,".ogx_tags_container_tag",onAdd):container.off(that.touch.down,".ogx_tags_container_tag",onAdd)}function onAdd(e){addTag($(this).text()),input.val(""),displayTags(!1),config.max&&config.current_tags.length===config.max&&(listenInput(!1),input.css("display","none"))}function listenTagRemove(e){e?container.on(that.touch.down,".ogx_tags_remove",onRemove):container.off(that.touch.down,".ogx_tags_remove",onRemove)}function onRemove(e){e.preventDefault(),e.stopImmediatePropagation();var t=removeTag($(this).parent("span").first().find("span").first().text());container.trigger(OGX.Tags.TAG_REMOVED,t),container.trigger(OGX.Tags.CHANGE,[config.current_tags]),config.max&&config.current_tags.length'),config.name){var t="";config.required&&(t="required"),e+='"}if(container.html(e),input=container.find(".ogx_tags_input").first(),config.restrict){var i={multiline:!1,max:30};"object"==typeof config.restrict&&(i=config.restrict),i.el=input[0],OGX.Form.restrictField(i)}}function initDefaults(){for(var a in config||(config={}),config_default)config.hasOwnProperty(a)||(config[a]=config_default[a]);config.tags.hasOwnProperty("insert")||(config.tags=new OGX.List(config.tags)),config.current_tags.hasOwnProperty("insert")||(config.current_tags=new OGX.List(config.current_tags)),config.restrict&&("string"==typeof config.restrict.allowed&&(config.restrict.allowed=eval(config.restrict.allowed)),"string"==typeof config.restrict.forbidden&&(config.restrict.forbidden=eval(config.restrict.forbidden))),container=that.el,container.addClass("ogx_tags")}function init(){initDefaults(),initInput(),config.current_tags.length>0&&renderTags(config.current_tags)}this.enable=function(){if(config.remove&&(listenInput(!0),listenTagAdd(!0),listenTagRemove(!0)),config.display_more&&config.click_more&&listenMore(!0),config.name&&listenHidden(!0),listenSelect(!0),config.add){var e=container.find(".ogx_tags_input").first();e.prop("placeholder",config.placeholder),e.prop("disabled",!1),config.hide_input_on_disable&&e.removeClass("ogx_tags_hidden")}return this},this.disable=function(){if(config.remove&&(listenInput(!1),listenTagAdd(!1),listenTagRemove(!1)),config.display_more&&config.click_more&&listenMore(!1),config.name&&listenHidden(!1),listenSelect(!1),config.add){var e=container.find(".ogx_tags_input").first();e.prop("placeholder",""),e.prop("disabled",!0),config.hide_input_on_disable&&e.addClass("ogx_tags_hidden")}return this},this.destroy=function(){config.restrict&&OGX.Form.unrestrictField(container.find(".ogx_tags_input").first()[0])},this.tags=function(e){return void 0!==e?(e.hasOwnProperty("insert")||(e=new OGX.List(e)),config.tags=e,!0):config.tags},this.val=function(e,t){if(displayTags(!1),listenTagAdd(!1),void 0!==e){if(void 0!==t){var i=e,n=config.tags.find(i,t,1);n&&(e=[n])}return e.hasOwnProperty("insert")||(e=new OGX.List(e)),config.current_tags=e,config.max&&config.current_tags.length>=config.max&&container.find(".ogx_tags_input").first().css("display","none"),renderTags(config.current_tags)}return config.current_tags},this.wipe=function(){return config.max&&config.current_tags.length===config.max&&(container.find(".ogx_tags_input").first().css("display","block"),listenInput(!0)),config.current_tags=new OGX.List,container.find(".ogx_tags_tags").first().empty(),container.find("input[type=hidden]").first().val(""),this},this.clear=function(){return this.wipe()},this.render=function(e){return renderTags(trimTags(e))},this.add=function(e){return addTag(e)},this.remove=function(e){return removeTag(e)},init()},OGX.Tags.prototype.tagDataset=function(e,t,i){"use strict";void 0===i&&(i=!1);for(var n,a=[],o=0;o-1&&(i.includes(n.items[a][o])||i.push(n.items[a][o]));return e(n.items[a]),!0}}(e));}(e,t)},OGX.Tags.CHANGE="TagsChange",OGX.Tags.SELECT="TagsSelect",OGX.Tags.TAG_ADDED="TagsTagAdded",OGX.Tags.TAG_REMOVED="TagsTagRemoved",OGX.Tags.MODE_STRING="string",OGX.Tags.MODE_OBJECT="object",OGX.Tags.MODE_ASCII="ascii",OGX.Tags.BIND=OGX.Tags.CHANGE,OGX.Templater=function(){"use strict";var e;this.jmake=function(e,t){for(var i,n,a=JSON.stringify(e);m=/({{(\$|#)[a-z0-9_\.]*}})|("{{(\$)}}")/gi.exec(a);)m[0].match(/"{{(\$)}}"/)?(i="<-"+(i=JSON.stringify(t)).substring(1).slice(0,-1)+"->",a=(a=(a=a.replace(m[0],i)).replace(/<\-/,"{")).replace(/\->/,"}")):("object"==typeof(n=OGX.OSE.exec(m[0],t))&&(n=JSON.stringify(n),m[0]='"'+m[0]+'"'),a=a.replace(m[0],n));return JSON.parse(a)},this.make=function(t,i,n,a,o){var r,s;for(e={},void 0===o&&(o={}),OGX.Data.merge(e,o);r=/{{[^{]+(({[^{]+)+)?}}/gi.exec(t);)void 0===(s=OGX.OSE.exec(r[0],i,n,a,e))&&(s=""),t=t.replace(r[0],s);return t},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,a=this,o=e,r={anim:!1,display:!0,icon_size:50,timeout:30},s={template:!1,html:'{{$label}}'},l='
',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){a.el.trigger(OGX.Theater.HIDE);var t=app.find("Stage",e);t.wake(),t.resizeNodes();var n,r=list.el.find('.ogx_theater_stage[data-ogx-id="'+t.id+'"]').position();a.observe(!0,{childList:!0},(function(){a.observe(!1),(n=i.children(".ogx_theater_trans")).on("transitionend",(function(){n.off("transitionend"),a.hide(),n.remove(),t.url?(app.showStage(t.id,!1),app.router.addToHist(t.url)):app.goto(t.id+"/"+t.home)})),n.removeClass("ogx_theater_trans_hide"),setTimeout((function(){n.addClass("ogx_theater_trans_grow").css({opacity:1,width:"100%",height:"100%",transform:"translate3d(0px, 0px, 0px)"})}),o.timeout)}),null,i),i.append('
")}(t.id)}))):($(document).off("backbutton",u),$(window).off("popstate",u),list.el.off(OGX.DynamicList.SELECT))}function u(){a.hide()}function h(){t.prepend(l);for(var e,i=[],r=0;r .list").on(OGX.DynamicList.RENDER,(function(e){$(".ogx_theater > .list").off(OGX.DynamicList.RENDER),setTimeout((function(){l=$(".ogx_theater").detach()}),0)})),list=a.create("DynamicList",{el:".ogx_theater > .list",display:{html:o.display.html,css:"ogx_theater_stage"},key:"id",scroll:!0,mode:"hit",list:i,trigger:!0})}function f(){var e=app.gather(OGX.Stage.NAME);n=[];for(var t=0;t
"),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(o,r),o.display&&("object"!=typeof o.display&&(o.display={}),OGX.Data.merge(o.display,s),o.display.template&&(o.display.html=OGX.Templater.get(o.display.template))),(t=a.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,a){var o=new OGX.Touches[e](t),r=o.set(a);return!r.hasOwnProperty("id")&&(r.id=i++),o.id=r.id,"auto"===r.status&&!t.blured&&t.enabled&&o.enable(),n.insert(o),o},this.touch.remove=function(e){"object"==typeof e&&(e=e.id),n.findDelete("id",__id,1).disable()},this.touch.get=function(e){return n.get({id:{eq:e}},null,1)},this.touch.wipe=function(){for(var e=0;eo.x?1:-1,l=r.y>o.y?1:-1,c=Math.abs(r.x-o.x),d=Math.abs(r.y-o.y),u=Math.sqrt(Math.abs(Math.pow(r.x-o.x,2)-Math.pow(r.y-o.y,2)))}function O(){a.cb_swipe&&(a.x&&a.min_x&&c>=a.min_x||a.y&&a.min_y&&d>=a.min_y?y(0,!0):a.cb_swipe({pt0:o,pt1:r,dirX:s,dirY:l,distX:c,distY:d,dist:u}))}this.set=function(e){return a=e,OGX.Data.merge(a,n),t=i.selector,this.state=a.state,"auto"===a.state&&(i.enable,i.disable),a.target&&(t=a.target),a},this.enable=function(){!f&&a&&(f=!0,v(!0))},this.disable=function(){f&&(f=!1,v(!1),p(!1))}},OGX.Touches.Hold=function(e){"use strict";var t={cb_hold:!1,cb_up:!1,cb_move:!1,time:1e3,el:this.el,target:!1,capture:!1,state:"auto"},i=!1,n=!1,a=!1,o=!1,r=!1,s=!1,l=e,c={x:0,y:0},d={x:0,y:0},u={x:0,y:0},h={x:0,y:0},f=null;function g(e){var t=[];t=i.target?[l.touch.down,i.target,_]:[l.touch.down,_],e?l.el.on.apply(l.el,t):l.el.off.apply(l.el,t)}function _(e){e=l.event(e),f=e.currentTarget,o||(o=!0,n=(new Date).getTime(),h.x=c.x=e.pageX,h.y=c.y=e.pageY,a=setInterval(m,1))}function p(e){i.capture&&(e.preventDefault(),e.stopImmediatePropagation()),e=l.event(e),d.x=e.pageX,d.y=e.pageY,d.x5||Math.abs(c.y-d.y)>5)&&(clearInterval(a),a=!1)}function m(){o&&(new Date).getTime()-n>i.time&&(r||(r=!0,$("body").on(l.touch.move,p),i.cb_hold?i.cb_hold(f,c):l.el.trigger(OGX.Touch.HOLD_START)))}function v(t){t=e.event(t),o=!1,clearInterval(a),a=!1,r&&(r=!1,$("body").off(l.touch.move,p),i.cb_up?i.cb_up({x:t.pageX,y:t.pageY}):l.el.trigger(OGX.Touch.HOLD_END,{x:t.pageX,y:t.pageY}))}this.set=function(e){return i=e,OGX.Data.merge(i,t),l.selector,this.state=i.state,"auto"===i.state&&(l.enable,l.disable),i.target&&i.target,i},this.enable=function(){!s&&i&&(s=!0,g(!0),$("body").on(l.touch.up,v))},this.disable=function(){s&&(s=!1,(o||a)&&(r=!1,o=!1,clearInterval(a),a=!1),g(!1),$("body").off(l.touch.up,v),$("body").off(l.touch.move,p))}},OGX.Touches.Drag=function(e){"use strict";var t,i,n,a,o,r,s=!1,l={min:10,limit_x:null,limit_y:null,target:!1,cb_down:!1,cb_drag:!1,cb_up:!1,border:10,capture:!1,state:"auto"},c=e,d=!1,u=!1;function h(e){var t=[];t=s.target?[c.touch.down,s.target,f]:[c.touch.down,f],e?c.el.on.apply(c.el,t):c.el.off.apply(c.el,t)}function f(l){s.capture&&(l.preventDefault(),l.stopImmediatePropagation()),l=e.event(l),n=l.pageX,a=l.pageY;var d=c.el.position();t=d.left,i=d.top;var u=c.el.offset(),h=n-u.left,f=a-u.top;if(s.border){if(hc.el.width()-s.border)return;if(fc.el.height()-s.border)return}o=0,r=0,g(!0),_(!0),s.cb_down&&s.cb_down()}function g(e){e?d||(d=setInterval(v,10)):d&&(clearInterval(d),d=null)}function _(e){e?($("body").on(c.touch.move,m),$("body").on(c.touch.up,p)):($("body").off(c.touch.move,m),$("body").off(c.touch.up,p))}function p(t){g(!1),_(!1),t=e.event(t),s.x&&(o=t.pageX-n),s.y&&(r=t.pageY-a),s.cb_up&&s.cb_up({distX:o,distY:r})}function m(t){s.capture&&(t.preventDefault(),t.stopImmediatePropagation()),t=e.event(t);var i,l=!1;s.x&&(i=t.pageX-n,null!==s.limit_x?i>=s.limit_x.min&&i<=s.limit_x.max&&(s.min?Math.abs(i)>s.min&&(o=i,l=!0):(o=i,l=!0)):s.min?Math.abs(i)>s.min&&(o=i,l=!0):o=i),s.y&&(i=t.pageY-a,null!==s.limit_y?i>=s.limit_y.min&&i<=s.limit_y.max&&(s.min?Math.abs(i)>s.min&&(r=i,l=!0):(r=i,l=!0)):r=i),l&&s.cb_drag&&s.cb_drag({distX:o,distY:r,x:t.pageX,y:t.pageY})}function v(){c.el.css({transform:"translate3d("+(t+o)+"px, "+(i+r)+"px, 0px)"})}this.dragable=!0,this.set=function(e){return s=e,OGX.Data.merge(s,l),"auto"===s.state&&(c.enable,c.disable,this.enable()),this.state=s.state,s},this.enable=function(){!u&&s&&(u=!0,h(!0))},this.disable=function(){u&&(u=!1,h(!1),_(!1),g(!1))}},OGX.Touches.Move=function(e){"use strict";var t,i,n,a,o,r,s,l,c=!1,d={min:0,limit_x:null,limit_y:null,target:null,cb_down:null,cb_move:null,cb_up:null,cb_click:null,capture:!1,state:"auto"},u=e,h=!1;function f(e){var t=[];t=c.target?[u.touch.down,c.target,g]:[u.touch.down,g],e?u.el.on.apply(u.el,t):u.el.off.apply(u.el,t)}function g(d){c.capture&&(d.preventDefault(),d.stopImmediatePropagation()),d=e.event(d),t=d.pageX,i=d.pageY,n=0,a=0,o=0,r=0,s=0,l=0,_(!0),c.cb_down&&c.cb_down(d)}function _(e){e?($("body").on(u.touch.move,m),$("body").on(u.touch.up,p)):($("body").off(u.touch.move,m),$("body").off(u.touch.up,p))}function p(s){if(_(!1),s=e.event(s),c.x&&(n=s.pageX-t),c.y&&(a=s.pageY-i),c.cb_up&&c.cb_up({x:s.pageX,y:s.pageY,distX:n,distY:a,dirX:o,dirY:r}),c.cb_click){var l=!1;c.x&&Math.abs(n)<2&&(l=!0),c.y&&Math.abs(a)<2&&(l=!0),l&&c.cb_click(s)}}function m(d){c.capture&&(d.preventDefault(),d.stopImmediatePropagation()),d=e.event(d);var u,h=!1;c.x&&(o=0,sd.pageX&&(o=-1),s=d.pageX,u=d.pageX-t,null!==c.limit_x?u>=c.limit_x.min&&u<=c.limit_x.max&&(c.min?Math.abs(u)>c.min&&(n=u,h=!0):(n=u,h=!0)):c.min?Math.abs(u)>c.min&&(n=u,h=!0):(n=u,h=!0)),c.y&&(r=0,ld.pageY&&(r=-1),l=d.pageY,u=d.pageY-i,null!==c.limit_y?u>=c.limit_y.min&&u<=c.limit_y.max&&(c.min?Math.abs(u)>c.min&&(a=u,h=!0):(a=u,h=!0)):(a=u,h=!0)),h&&c.cb_move&&c.cb_move({distX:n,distY:a,dirX:o,dirY:r,x:d.pageX,y:d.pageY})}this.set=function(e){return c=e,OGX.Data.merge(c,d),"auto"===c.state&&(u.enable,u.disable,this.enable()),this.state=c.state,c},this.enable=function(){!h&&c&&(h=!0,f(!0))},this.disable=function(){h&&(h=!1,f(!1),_(!1))}},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,a,o,r,s,l,c,d=this,u='{{$label}}',h=e,f={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:u},icons:{open:"folder_open",close:"folder_closed",empty:null}},file:{mode:"file",display:{html:u},icon:"file"},folder:{mode:"folder",display:{html:u},icons:{open:"folder_open",close:"folder_closed",empty:null}}},data:{id:0,type:"root",state:"closed",data:{label:null,icon:null},items:[]},display:null},g="_id";function _(e,t){var i={_id:t._id,container_display:"",container_css:"",arrow_display:"",arrow_style:"ogx_tree_item_arrow_open",state:"open"};return OGX.Data.merge(i,e,!0),OGX.Templater.make('
',i)}function p(){var e=_({},{_id:"root",type:"root",label:h.root_label});t.html(e),h.data.element=t.children(".ogx_tree_item").first(),h.data.uxi=d,h.show_root||h.data.element.addClass("ogx_tree_root_hidden")}function m(){p(),v(h.data,d)}function v(e,t){if(e.parent=t,e.hasOwnProperty("items")){var i,n;!e.items.hasOwnProperty("insert")&&(e.items=new OGX.List(e.items)),h.sort.enabled&&e.items.order(h.sort.property,h.sort.way);for(var a=0;a .ogx_tree_item_content';if(i.display.hasOML()){var a=i.display.oml(n,e,!1);OGX.OML.render(t,a,e),e.uxi=t.nodes.last()}else{var o=i.display.html(e);o=OGX.Templater.make(o,e),$(n).html(o)}}function O(e){var t={};return OGX.Data.merge(t,e),delete t.element,delete t.parent,c||delete t[g],t}function b(e){"folder"===S(e).mode&&(e.items.length||(e.element.data("state","close"),e.element.children(".ogx_tree_item_arrow").addClass("ogx_tree_item_arrow_disabled")),"open"===e.element.data("state")?(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").css("display","block")):(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").css("display","none")))}function w(){if(s){var e=E(s);e&&(e.children(".ogx_tree_item_icon").removeClass("ogx_tree_selected_item"),s=null)}}function G(e){var t=E(e);t&&(s=e,t.children(".ogx_tree_item_icon").addClass("ogx_tree_selected_item"))}function X(e,t){return C((function(i){return i[g]===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",b(i),!0)}))}function T(e){return C((function(t,i){return t[g]===e&&t}))}function E(e){var t=T(e);return!!t&&t.element}function D(){l=1,C((function(e){return e[g]=l++,e.hasOwnProperty("type")||(e.hasOwnProperty("items")?e.type="folder":e.type="file"),!1}))}function C(e,t){var i;if(void 0===t&&(t=h.data),i=function t(n,a,o,r){if(i=e(n,a,o,r))return i;if(n.hasOwnProperty("items")&&n.items.length)for(var s=0;s .ogx_tree_item_content",(function(e){e.preventDefault(),L($(this).parent(0)),1!==$(this).parent(0).data("id")&&function(){o&&clearInterval(o);r=(new Date).getTime(),o=setInterval(k,50)}()})),$(document).on(d.touch.up,(function(){N(),n&&(I(!1),function(){var e=n.offset().left,o=n.offset().top,r=(l=e,c=o,C((function(e,t){return d=e.element.offset(),u=e.element.children(".ogx_tree_item_icon"),l>=d.left&&l<=d.left+u.width()&&c>=d.top&&c<=d.top+u.height()&&e}))),s=S(r);var l,c,d,u;!r||r&&(r[g]===i[g]||"folder"!==s.mode)?(a.css("opacity",1),n.remove(),n=null,i=null):(f=r,function(e){C((function(t,i,n,a){return t[g]===e&&(n.items.splice(a,1),n.items.length||(n.state="close"),b(n),!0)}))}((h=i)[g]),X(h,f[g]),f.element.children(".ogx_tree_item_container").empty(),f.state="open",v(f,f.element),b(f),a.remove(),n.remove(),n=null,t.trigger(OGX.Tree.DROP,i),i=null);var h,f}())}))):t.on("click",".ogx_tree_item > .ogx_tree_item_content",(function(e){L($(this).parent(0))})),t.on(d.touch.down,".ogx_tree_item_arrow",(function(e){e.preventDefault(),N();var i=$(this).parent(0),n=i.data("state"),a=T(i.data("id"));a.hasOwnProperty("items")&&a.items.length&&("open"===n?(i.data("state","close"),t.trigger(OGX.Tree.CLOSE,a)):(i.data("state","open"),t.trigger(OGX.Tree.OPEN,a)),b(a))}))):(h.editable?t.off(d.touch.down,".ogx_tree_item > .ogx_tree_item_content"):t.off("click",".ogx_tree_item > .ogx_tree_item_content"),t.off(d.touch.down,".ogx_tree_item_arrow"))}function k(){var e;(new Date).getTime()-r>=h.drag_after&&(s&&(i=T(s))&&(e=i.element,a=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),I(!0),t.trigger(OGX.Tree.DRAG,i)),N())}function I(e){e?$(document).on(d.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(d.touch.move)}function N(){o&&(clearInterval(o),o=null)}this.enable=function(){return M(!0),this},this.disable=function(){return M(!1),this},this.addItem=function(e,t){if(void 0===t&&(t=s),t){var i=T(t);if("folder"===S(i).mode){c||(e[g]=++l),X(e,t);var n=S(e);y(i.uxi,i.element.children(".ogx_tree_item_container").first(),e),x(e,i.parent);var a=i.uxi;return n.display.hasOML()&&(a=i.uxi.nodes.last()),v(e,a),i.element.data("state","open"),i.element.children(".ogx_tree_item_container").css("display","block"),i.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_disabled ogx_tree_item_arrow_close").addClass("ogx_tree_item_arrow_open"),!0}}return!1},this.getItem=function(e){var t=T(e);return!!t&&O(t)},this.selectItem=function(e){G(e)},this.selectItemByPropVal=function(e,t){var i=function(e,t){function i(i,n){return!(!i.data.hasOwnProperty(e)||i.data[e]!==t)&&n+"/"+i.label}return C(i)}(e,t);return!!i&&(w(),G(i[g]),!0)},this.selectItemByPath=function(e){var t=function(e){var t=function(e){function t(t,i){return e===i+"/"+t.label&&t}return C(t)}(e);if(t)return t.element;return!1}(e);return!!t&&(w(),t.addClass("ogx_tree_selected_item"),s=t.data("id"),!0)},this.updateItem=function(e,t){var i=T(e);if(i){if(i.uxi){var n=i.uxi.el;i.uxi.kill(),n.empty()}OGX.Data.merge(i,t,!0),x(i,i.parent),i.hasOwnProperty("items")&&i.items.length&&(v(i,i.parent),i.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_disabled ogx_tree_item_arrow_close").addClass("ogx_tree_item_arrow_open"),i.element.data("state","open"))}},this.replaceItem=function(e){var t=T(e[g]);t&&(t.uxi&&t.uxi.kill(),OGX.Data.merge(e,t,!1),x(t,t.parent),t.hasOwnProperty("items")&&t.items.length&&v(t,t.parent))},this.deleteItem=function(e){var t=T(e);if(t){var i=function(e){function t(t){return!(!t.hasOwnProperty("items")||!t.items.get({_id:{eq:e}},null,1))&&t}return C(t)}(e);t.uxi&&t.uxi.kill(),i.items.findDelete("_id",e,1),t.element.remove()}},this.deleteSelectedItem=function(){return function(){function e(e,t,i,n){if(e[g]===s)return e.element.remove(),i.items.splice(n,1),b(i),!0}if(s)return C(e);return!1}()},this.getSelectedItem=function(){return function(){if(s)return T(s);return!1}()},this.getTree=function(){var e=C(O,JSON.parse(JSON.stringify(h.data)));if(e)return e},this.setData=function(e){e.hasOwnProperty("types")&&this.setTypes(e.types),e.hasOwnProperty("tree")&&this.setTree(e.tree)},this.setTypes=function(e){h.types=e},this.setTree=function(e){this.clear(),h.data=e,h.data.hasOwnProperty("state")||(h.data.state="open"),c||D(),m()},this.newTree=function(){d.clear(),l=1,p()},this.filterTree=function(e){!function(e){var t=[];function i(n,a,o,r){if(-1!==(a+n.label).indexOf(e)&&t.push(a+"/"+n.label),n.hasOwnProperty("items")&&n.items.length)for(var s=0;s .ogx_scroller_inner',(i=$(e.el)).addClass(n).attr("data-ogx-id",this.id),t&&i.attr("id",this.id);var o=this;setTimeout((function(){o.scroller.resize()}),0)}else i.append(a),e.el='.ogx_uxi[data-ogx-id="'+this.id+'"]';this.el=$(e.el)}},OGX.Uxi.prototype.enable=function(){return this},OGX.Uxi.prototype.disable=function(){return this},OGX.Uxi.prototype.ux=function(){},OGX.Uxi.prototype.construct=function(){},OGX.Uxi.prototype.destroy=function(){},OGX.Uxi.prototype.resize=function(){return this},OGX.Uxi.prototype.show=function(){return this.el&&this.el.removeClass("ogx_uxi_hide"),this},OGX.Uxi.prototype.hide=function(){return this.el&&this.el.addClass("ogx_uxi_hide"),this},OGX.Uxi.prototype.empty=function(){return this.clear(),this},OGX.Uxi.prototype.observe=function(e,t,i,n,a){var o=this,r=this.el,s=null;if(void 0!==a&&(r=a),e){if(!this.observer)return void 0!==t&&t||(t={childList:!0,subtree:!0}),this.observer=new MutationObserver((function(e,t){e.forEach((function(e){s&&clearTimeout(s),s=setTimeout((()=>{void 0!==i?i(e,n):o.el.trigger(OGX.View.CHANGED,e)}),10)}))})),this.observer.observe(r[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){var a=this;this.observe(!0,e,(function(){a.observe(!1),void 0!==t&&t(i)}),null,n)},OGX.Uxi.prototype.sleep=function(){return this.sleeping||(this.blur(2),this.sleeping=!0,this.scroll?(this.__parent=this.el.parent(".ogx_scroller_outer").first().parent(0),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+'"]'),this.focus(2),delete this.__parent),this},OGX.Uxi.prototype.detach=function(){return this.sleep(),this.parent.nodes.findDelete("id",this.id,1),this},OGX.Uxi.prototype.attach=function(e,t){return this.parent=e,this.parent.nodes.insert(this),this.wake(t),setTimeout((()=>this.resizeNodes),0),this},OGX.Uxi.prototype.resizeNodes=function(){for(var e=this.gather(),t=0;t0&&"Carousel"===t[i]._NAME_&&"Container"===t[i-1]._NAME_||(t[i].floating?t[i].show(e):t[i].show(this._NAME_,this.id));return this}},OGX.Uxi.prototype.focus=function(e){if(void 0===e&&(e=1),this.blured)switch(this.blured=!1,this.enabled&&(this.ux(!0),this.enable()),e){case 1:this.focusNodes();break;case 2:this.focusTree()}return this},OGX.Uxi.prototype.focusTree=function(){for(var e=this.gather(),t=0;tt&&(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)},require("View","Uxi","Placeholder","Touch"),OGX.View=function(e){construct(this,"View");var t=this,i=!1,n=e;this.enable=function(){return n.observe&&this.observe(!0),this},this.disable=function(){return n.observe&&this.observe(!1),this},this.container=function(){return i},this.render=function(e){return void 0===e?n.hasOwnProperty("html")&&n.html&&i.html(n.html):i.html(e),i.trigger(OGX.View.RENDER),this},function(){i=t.el;var a=new OGX.Display(e);n.html=a.html(e.data),i.addClass("ogx_view ogx_hw"),t.render()}()},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:'
$INNER
{{$html}}
',win_inner:['','{{$title}}','$ICONS'],zindex:!1,close_on_click_out:!1,close_dist:100,parent:null},config=__config,pt={x:null,y:null},dir={x:0,y:0},showto=50,user_resized=!1,zd;function genIcons(){for(var e="",t=0;t";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:config.parent.topIndex();var t=getLimitedSize();container.css({width:t.width,height:t.height,"z-index":zd})}function getLimitedSize(){var e,t,i,n=config.parent.el.width(),a=config.parent.el.height();user_resized?(n=config.width,a=config.height):(e=OGX.Data.getBestSize(n,config.width),t=OGX.Data.getBestSize(a,config.height));var o={width:e,height:t};return(config.min_width||config.max_width)&&(-1!==config.width.indexOf("%")?(n=config.parent.el.width(),i=Number(config.width.split("%")[0])*n/100,config.min_width&&iconfig.max_width&&(o.width=config.max_width+"px")):(-1!==(i=config.width).indexOf("px")&&(i=Number(i.split("px")[0])),config.min_width&&iconfig.max_width&&(o.width=config.max_width+"px"))),(config.min_height||config.max_height)&&(-1!==config.height.indexOf("%")?(a=config.parent.el.height(),i=Number(config.height.split("%")[0])*a/100,config.min_height&&iconfig.max_height&&(o.height=config.max_height+"px")):(-1!==(i=config.height).indexOf("px")&&(i=Number(i.split("px")[0])),config.min_height&&iconfig.max_height&&(o.height=config.max_height+"px"))),o}function listenBody(e){e?that.parent.el.on(that.touch.down,".ogx_overlay",onBody):that.parent.el.off(that.touch.down,".ogx_overlay",onBody)}function onBody(e){that.status===OGX.Window.OPEN&&(that.hide(),that.parent.removeOverlay(OGX.Overlay.Fade))}function animWindow(e,t,i,n){void 0===t&&(t=config.anim);var a={opac:1,tX:0,tY:0},o=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?(a.tY=0,c.addClass("ogx_window_main_icon_top")):a.tY=-l-10;break;case OGX.Window.ANIM_BOTTOM:e?(a.tY=0,c.addClass("ogx_window_main_icon_bottom")):a.tY=r+10;break;case OGX.Window.ANIM_RIGHT:e?(a.tX=o-s,c.addClass("ogx_window_main_icon_right")):a.tX=o+10;break;case OGX.Window.ANIM_LEFT:e?(a.tX=0,c.addClass("ogx_window_main_icon_left")):a.tX=-s-10}var d=100;e?(pt.x=a.tX,pt.y=a.tY):d=0,setTimeout((function(){dir.x,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("+a.tX+"px, "+a.tY+"px, 0px)",opacity:a.opac,visibility:"visible"})}),d)}function placeWindow(e){var t=container.parent().width(),i=container.parent().height(),n=that.el.outerHeight(),a=that.el.outerWidth();that.el.removeClass("ogx_window_anim_in").removeClass("ogx_window_anim_out");var o={x:0,y:0};switch(config.anim){case OGX.Window.ANIM_TOP:o.y=e?-n:n,dir.y=-1;break;case OGX.Window.ANIM_BOTTOM:o.y=e?i:i-n,dir.y=1;break;case OGX.Window.ANIM_RIGHT:o.x=e?t:t-a,dir.x=1;break;case OGX.Window.ANIM_LEFT:e&&(o.x=-a),dir.x=-1}that.el.css({transform:"translate3d("+o.x+"px, "+o.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(/>,<"),i=i.replace("$INNER",n);var a="";return config.icons&&config.icons.length&&(a=genIcons()),i=i.replace("$ICONS",a),OGX.Templater.make(i,t)}function onResize(){user_resized=!0,that.resizeNodes()}function listenScroll(e){e?(that.el.on(OGX.Scroller.START,(function(){that.disable()})),that.el.on(OGX.Scroller.END,(function(){that.enable()}))):(that.el.off(OGX.Scroller.START),that.el.off(OGX.Scroller.END))}function initPlaceholders(){that.placeholders(config,['.ogx_window[data-ogx-id="'+that.id+'"] > .ogx_window_body'])}function initDefaults(){OGX.Data.merge(config,app.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(){if(initDefaults(),render(),initPlaceholders(),placeWindow(!0),config.drag){var e={},t={top:!1,bottom:!1,left:!1,right:!1,cb_resize:onResize};switch(t.min_width=config.min_width,t.min_height=config.min_width,t.max_width=config.max_width,t.max_height=config.max_height,e.cb_drag=onDrag,e.cb_up=onRelease,config.anim){case OGX.Window.ANIM_LEFT:e.x=!0,e.y=!1,e.limit_x={min:-300,max:0},t.right=!0;break;case OGX.Window.ANIM_RIGHT:e.x=!0,e.y=!1,e.limit_x={min:0,max:300},t.left=!0;break;case OGX.Window.ANIM_TOP:e.x=!1,e.y=!0,e.limit_y={min:-300,max:0},t.bottom=!0;break;case OGX.Window.ANIM_BOTTOM:e.x=!1,e.y=!0,e.limit_y={min:0,max:300},t.top=!0}that.touch.drag=that.touch.add("Drag",e)}config.resize&&that.setResize(t),config.show&&that.show(),listenScroll(!0)}this.id=config.id,this.dragable=null,this.resizeable=null,this.status=OGX.Window.CLOSED,this.enable=function(){return config.close_on_click_out&&listenBody(!0),config.head&&listenBackIcon(!0),config.icons&&listenIcons(!0),config.drag,config.resize&&this.enableResize(),this},this.disable=function(){return config.close_on_click_out&&listenBody(!1),config.head&&listenBackIcon(!1),config.icons&&listenIcons(!1),config.drag,config.resize&&this.disableResize(),this},this.show=function(e,t,i){return config.drag,config.resize&&this.enableResize(),listenScroll(!0),-1===[OGX.Window.OPEN,OGX.Window.OPENING].indexOf(this.status)&&(this.focus(1),this.front(),null==e&&(e=config.anim),setTimeout((function(){animWindow(!0,e,t,i)}),showto),showto&&(showto=0)),this},this.hide=function(e,t,i){return config.drag,config.resize&&this.disableResize(),listenScroll(!1),-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.resize=function(){var e=getLimitedSize();return container.css({width:e.width,height:e.height}),this.place(),this},this.destroy=function(){config.drag,listenScroll(!1)},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=config.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):config.drag&&(config.drag=this.dragable=!1)},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,String.prototype.hasOwnProperty("substr")||(String.prototype.substr=function(e,t){return e<0&&(e=this.length-e),this.slice(e,e+t)}); \ No newline at end of file