From c4ec87d363537be69d961a4d1872ebac31dcfccf Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 21 Nov 2022 10:46:11 -0500 Subject: [PATCH] 1.22.3-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 dea2ab14..742ff238 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.22.3.1.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(__prop,__as_object,__new_props){void 0===__as_object&&(__as_object=!0),void 0===__new_props?__new_props=[__prop]:Array.isArray(__new_props)||(__new_props=[__new_props]);var q={};q[__prop]={regex:/(.){1,}/};for(var l=this.get(),ar=[],final=new OGX.List,o,ev,i=0;i=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 m(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=p,X=g(X,i,r),void OGX.Fonction(X,i,r);case"Uxi":return void e[_].attach(t,p);case"Fork":(L=O(p,e[_]))&&m(L,t),b=!1,G=!1;break;case"Html":X.el=p,X.html=e[_].html,(b=c(X))||(X.template=!1);break;case"Template":X.template=v.split(".")[1],X.el=p,v="Html",b=c(X);break;case"Ghost":X.el=p;break;case"Controller":X.id=p,C=!0;break;default:-1!==[".","#"].indexOf(p.substr(0,1))?X.el=p:(X.id=p,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(v,X),t.add(y),x=y):S?(S.blur(),$(p).html(E),S.el=$(p),t.add(S),setTimeout((function(){t.blured||S.focus()}),0)):(x=t,"Html"===v&&OGX.HtmlRender(X)),x&&e[_].hasOwnProperty("node:OML")&&!S&&!M&&(e[_]=f(e,e[_]),m(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[_])))}}}m(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 w(e){i.children(".ogx_calendar_head").children(".ogx_calendar_head_labels").html(e)}function G(e,t,i,n){if(t.y-1>=0&&t.y-1
'),E(),X(),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}),b(),w(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(e){"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 e.hasOwnProperty("format")?e.format:"YYYY-MM"}},OGX.CalendarLayout.MONTH_DAYS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM"),!e.hasOwnProperty("labels")&&(e.labels="ddd"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){var i="",n=Number(t.format("d")),a=t.clone();n&&a.subtract(n,"day");for(var o=0;o<7;o++)i+=''+a.format(e.labels)+"",a.add(1,"day");return i},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<35;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"}}},OGX.CalendarLayout.CENTURY_DECADES=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY"),!e.hasOwnProperty("labels")&&(e.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+(e.labels?t.format(e.labels):100*Math.floor(Number(t.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="",h=0;h<10;h++)o="",s+l===d+(a=10*h)&&(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"}}},OGX.CalendarLayout.CENTURY_YEARS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+(e.labels?t.format(e.labels):100*Math.floor(Number(t.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"}}},OGX.CalendarLayout.DECADE_YEARS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+(e.labels?t.format(e.labels):10*Math.floor(Number(t.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"}}},OGX.CalendarLayout.DECADE_MONTHS=function(e){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(e){for(var t=10*Math.floor(Number(e.format("YYYY"))/10),i=Number(String(t).substr(2,2)),n="",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(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels="[Months]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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"}}},OGX.CalendarLayout.YEAR_WEEKS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels="[Weeks]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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"}}},OGX.CalendarLayout.YEAR_DAYS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels="[Nth Day]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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"}}},OGX.CalendarLayout.MONTH_WEEKS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="[(]YYYY-MM[)] W"),!e.hasOwnProperty("labels")&&(e.labels="[Nth Week]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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,h=moment(e.format("YYYY-MM-[01]")),g=0;g<5;g++)f="",a=Number(h.format("w")),d===c&&a===u&&(f+="ogx_calendar_selected_item "),d===s&&a===l&&(f+="ogx_calendar_layout_month_weeks_current"),o+='
'+t(h.format("YYYY-MM-DD"),i)+"
",h.add(7,"days");return o},this.value=function(){return{value:1,unit:"months"}}},OGX.CalendarLayout.WEEK_DAYS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM (wo [week])"),!e.hasOwnProperty("labels")&&(e.labels="ddd DD"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){var i="",n=Number(t.format("d")),a=t.clone();n&&a.subtract(n,"day");for(var o=0;o<7;o++)i+=''+a.format(e.labels)+"",a.add(1,"day");return i},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"}}},OGX.CalendarLayout.DAY_HOURS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM-DD HH:[00]"),!e.hasOwnProperty("labels")&&(e.labels="[Hours]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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"}}},OGX.CalendarLayout.DAY_WORK_HOURS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM-DD HH:[00]"),!e.hasOwnProperty("labels")&&(e.labels="[Work Hours]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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"}}},OGX.CalendarLayout.DAY=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM-DD"),!e.hasOwnProperty("labels")&&(e.labels="dddd DD"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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.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,callbacks:{change:null}},c={position:"bottom"},u=!1,f=0,h=0,g=new OGX.List,p="ogx_carousel";function _(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(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*h+"%"),s.placeholders(l,e),t.trigger(OGX.Carousel.READY)}this.construct=function(){G(),l.index&&this.showPanel(l.index,!1),l.dots&&o.bind("dots",s)},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*h)+"%"),i.children("."+p+"_view").css("width",100/h+"%"),++f-1}(),d="."+p+'[data-ogx-id="'+this.id+'"] > .'+p+"_views > ."+p+'_view[data-ogx-panel-id="'+l+'"]',c={},u=d;if(e.hasOwnProperty("_NAME_"))e.detach(),e.attach(this,d),a&&this.showPanel(h-1,o);else{for(var g in e){u+=":"+g.split(":")[1],c[u]=e[g];break}var _=null;setTimeout((function(){s.observe(!0,{childList:!0,subtree:!0},(function(){s.observe(!1),_&&clearTimeout(_),_=setTimeout(G,20),a&&(s.showPanel(h-1,o),r?r():t.trigger(OGX.Carousel.ADDED,h))})),OGX.OML.render(s,c,n)}),0)}return 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/h*(-1*n);return i.removeClass(p+"_anim"),i.css({transform:"translate3d("+o+"%, 0, 0)"}),r=n,setTimeout(G,0),s.onChange(r),t.trigger(OGX.Carousel.CHANGE,r),this},this.removePanel=function(e,n){if(void 0===n&&(n=!0),e>=0&&e=r?e--:e=r,e<0&&(e=0),s.showPanel(e,!1,!0),t.trigger(OGX.Carousel.REMOVED,h),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)"}),h=0,g=new OGX.List,l.index=0,l["node:OML"]=[],this},this.render=function(e,t){return l["node:OML"]=e,h=l["node:OML"].length,X(),OGX.OML.render(this,l["node:OML"],t),this},this.destroy=function(){this.touch.wipe()},function(){if(void 0===OGX.Data)return debug(1,"OGX.Data not found!"),!1;OGX.Data.merge(l,d,!1),l.callbacks.change||(l.callbacks.change=s.onChange),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")&&(h=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/h*(-1*r)+"%, 0, 0)"})}(),l.dots&&(o=s.create("Dots",{el:"."+p+'[data-ogx-id="'+s.id+'"] > .carousel_dots',total:h})),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.CHANGE="CarouselChange",OGX.Carousel.ADDED="CarouselAdded",OGX.Carousel.REMOVED="CarouselRemoved",void 0===OGX)var OGX={};if(OGX.Color={},OGX.Color.hexToRgb=function(e){"use strict";e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,i,n){return t+t+i+i+n+n}));var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:null},OGX.Color.rgbToHex=function(e,t,i){"use strict";var n,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);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 h=c-u;switch(d=f>.5?h/(2-c-u):h/(c+u),c){case n:l=(a-o)/h+(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,i.x,i.y),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)}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.onSelect=function(){},this.destroy=function(){!function(){for(var e in o)r(e)}()},OGX.Data.merge(n,a),n.callbacks.select||(n.callbacks.select=i.onSelect),(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},callbacks:{select:null,unselect:null},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)),config.callbacks.select||(config.callbacks.select=that.onSelect),config.callbacks.unselect||(config.callbacks.unselect=that.onUnselect),(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!==key_default||(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.onSelect=function(e){},this.onUnselect=function(e){},this.getFilteredList=function(){if(isFiltered){if(!config.key){var e=JSON.parse(JSON.stringify(filtered));return clearIds(OGX.List(e))}return filtered}return!1},this.display=function(e){return void 0===e?config.display:display.val(e)},this.key=function(e){if(void 0===e)return e;config.key=e,config.key||(key=key_default)},this.mode=function(e){return void 0===e?config.mode:(config.mode!==e&&(config.mode===OGX.DynamicList.STATIC?this.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 h=e.validate(r.form);!0===h?f.valid=!0:(f.valid=!1,f.error=h)}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,OGX.Form.fromObject=function(e,t,i,n){var a={el:t.selector+" "+i,data:e,fullpath:!1};return OGX.Data.merge(a,n,!1),t.create("FormInstance",a)},void 0===OGX)var OGX={};if(require("FormInstance","Uxi","Placeholder"),OGX.FormInstance=function(__config){construct(this,"FormInstance");var that=this,config_defaults={fullpath:!1},config=OGX.Data.merge(__config,OGX.Form.defaults,!1,!0);function render(){var html="",oml='{"default:Html":{"html": {{$html}}, "node:OML": {{$oml}} }}',render_oml=!1,row,nodes=[];function cycle(__o,__path){for(var a in __o){var t=typeof __o[a],p;switch(p=__path?__path+"."+a:a,t){case"object":if(Array.isArray(__o[a]))if(["string","number","boolean"].includes(typeof __o[a][0]))row=genRow("array",a,JSON.stringify(__o[a])),html+=row.html,row.oml&&(nodes.push(row.oml),render_oml=!0);else for(var i=0;i<__o[a].length;i++)cycle(__o[a][i],__path?__path+"."+a+"["+i+"]":a+"["+i+"]");else cycle(__o[a],__path?__path+"."+a:a);break;case"string":case"number":case"boolean":var pattern="",required=!1,readonly=!1,oo;if(config.hasOwnProperty("fields")){try{oo=eval("config.fields."+p)}catch(e){}void 0!==oo&&(oo.hasOwnProperty("pattern")&&(pattern=oo.pattern),oo.hasOwnProperty("required")&&(required=oo.required),oo.hasOwnProperty("readonly")&&(readonly=oo.readonly))}row=genRow(t,p,__o[a],required,pattern,readonly),html+=row.html,row.oml&&(nodes.push(row.oml),render_oml=!0)}}}cycle(config.data,null),html=OGX.Templater.make(OGX.Form.defaults.templates.form,{rows:html}),oml=render_oml?nodes.join(","):null,oml=JSON.parse(oml),oml=OGX.OML.rename(oml,that.selector),that.el.html(html),oml&&OGX.OML.render(that,oml)}function genRow(e,t,i,n,a,o){var r={html:"",oml:null},s=config.types[e],l="",d="",c="";void 0!==n&&n&&(l="required",d='pattern="'+a+'"'),void 0!==o&&o&&(c="readonly");var u=t;return config.fullpath||(u=t.split(".").pop()),r.html=OGX.Templater.make(s.html,{name:u,prop:t,val:i,required:l,pattern:d,readonly:c}),r.html=OGX.Templater.make(OGX.Form.defaults.templates.row,{html:r.html,name:u,prop:t}),s.hasOwnProperty("oml")&&(r.oml=OGX.Templater.make(s.oml,{name:u,prop:t,val:i,required:l,pattern:d,readonly:c})),r}function init(){that.el.addClass("ogx_form"),render(),setTimeout((function(){OGX.Form.bindForm({el:that.selector+">form",change_cb:that.onChange,submit_cb:that.onSubmit})}),300)}OGX.Data.merge(config,config_defaults,!1),this.construct=function(){},this.enable=function(){},this.disable=function(){},this.ux=function(e){},this.destroy=function(){OGX.Form.unbindForm(that.selector)},this.onChange=function(e){},this.onSubmit=function(e){},init()},OGX.Form.defaults={templates:{form:"
{{$rows}}
",row:'{{$name}}{{$html}}'},types:{boolean:{html:'',oml:'{"default .{{$name}}:Switch":{"name" : "{{$prop}}", "val":{{$val}}, "editable" : {{!$readonly}} } }'},string:{html:''},number:{html:''},array:{html:'',oml:'{"default .{{$name}}:Tags":{"name" : "{{$prop}}", "editable" : {{!$readonly}}, "current_tags":{{$val}} } }'}}},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,h=this,g=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,callbacks:{up:null,down:null,left:null,right:null}},_=!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(h.touch.down,E):t.off(h.touch.down,E)}function E(e){_=!1,o=0,r=0,s=0,l=0,e=A(e),m.x=e.pageX,m.y=e.pageY,x=!0,L(!0)}function C(e){e?$("body").on(h.touch.up,D):$("body").off(h.touch.up,D)}function D(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=P(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(h.touch.move,k)):(M(!1),t.off(h.touch.move,k))}function k(e){e=A(e),g.capture&&(e.preventDefault(),e.stopImmediatePropagation()),o=0,r=0,s=0,l=0,_||(g.axis.x&&Math.abs(e.pageX-m.x)>Math.abs(e.pageY-m.y)?_="x":g.axis.y&&Math.abs(e.pageX-m.x)0?1:-1):g.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),g.axis.x&&"x"===_&&o&&s&&o<=n){if(!g.loop&&(b.x+-1*s<0||b.x+-1*s>g.map[0].length-1))return;if((d=(b.x+-1*s)%g.map[0].length)<0&&(d=Math.abs(g.map[0].length+d)),!1===g.map[w.y][d])return;u=o*s,i.css({transform:"translate3d("+(-1*b.x*n+u)+"px, "+v.y+"px, 0px)"})}else if(g.axis.y&&"y"===_&&r&&l&&r<=a){if(!g.loop&&(b.y+-1*l<0||b.y+-1*l>g.map.length-1))return;if((c=(b.y+-1*l)%g.map.length)<0&&(c=Math.abs(g.map.length+c)),!1===g.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=P(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=Y(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),h.onLeft({cell:w,point:b}),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}]),H()):(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),h.onRight({cell:w,point:b}),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}]),H())):b.y!==e.y&&(l=b.y>e.y?1:-1,b.y=e.y,w.y=Y(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),h.onUp({cell:w,point:b}),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}]),H()):(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),h.onDown({cell:w,point:b}),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}]),H())),_=0}))):i.off("transitionend")}function P(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 A(e){return e.hasOwnProperty("originalEvent")&&void 0!==e.originalEvent.changedTouches?e.originalEvent.changedTouches[0]:e}function Y(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=Y(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=Y(e[n]).x}else i.x=e[n].x;t=g.map[i.y][i.x],W(e[n],t),h.onRender(i)}}function W(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,Y(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=Y(e);for(var r in t){t[r].id="cell_"+o.x+"_"+o.y;break}t=OGX.OML.rename(t,a);var s=h.nodes.find("id","cell_"+o.x+"_"+o.y,1);s&&h.remove(s._NAME_,s.id),$(a).empty(),OGX.OML.render(h,t,{abs:e,rel:Y(e)}),H()}}function H(){for(var e=0;e',d=-1*e,c=-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 debug(5,"gridwwiper",g.id,"enabled"),T(!0),C(!0),H(),this},this.disable=function(){return debug(5,"gridwwiper",g.id,"disabled"),T(!1),C(!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.onUp=function(){},this.onDown=function(){},this.onLeft=function(){},this.onRight=function(){},this.onRender=function(){},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},U(),F(),z(),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},"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"),g(),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,r,s=this,l={left:0,right:0,top:0,bottom:0,min:50,drag:!0,flatten:!1,capture:!0,"node:OML":{},callbacks:{up:null,down:null,left:null,right:null,restore:null}},d=e,c=!1,u="normal",f="main",h={left:null,main:null,right:null,top:null,bottom:null},g=[0,0,0],p=0,_=0,m=0,v=0;function y(e){for(var t in h)h[t]&&h[t].instance&&(e===t?h[t].instance.focus():h[t].instance.blur())}function x(){c.hasClass("ogx_iceberg_anim")||(c.off("transitionend"),g=G(c))}function O(e){var t=0;return e.dirY&&e.distY>e.distX&&(t=1),t}function b(e){d.drag&&e.dist&&(!(n=O(e))&&["main","left","right"].includes(f)?e.dirX&&e.distX&&(t=g[0]+e.distX*e.dirX)<=_&&t>=p&&c.css({transform:"translate3d("+t+"px, 0, 0)"}):["main","top","bottom"].includes(f)&&e.dirY&&e.distY&&(i=g[1]+e.distY*e.dirY)<=v&&i>=m&&c.css({transform:"translate3d(0, "+i+"px, 0)"}))}function w(e){if(t=0,i=0,n=O(e),e.swipe&&e.dist){var r;switch(e.swipe=!1,f){case"main":-1===e.dirX&&d.right&&!n?(t=-h.right.outerWidth(),r="right",e.swipe=!0):1===e.dirX&&d.left&&!n?(t=h.left.outerWidth(),r="left",e.swipe=!0):1===e.dirY&&d.top&&n?(i=h.top.outerHeight(),r="top",e.swipe=!0):-1===e.dirY&&d.bottom&&n&&(i=-h.bottom.outerHeight(),r="bottom",e.swipe=!0);break;case"left":-1!==e.dirX||n||(t=0,r="main",e.swipe=!0);break;case"right":1!==e.dirX||n||(t=0,r="main",e.swipe=!0);break;case"top":-1===e.dirY&&n&&(i=0,r="main",e.swipe=!0);break;case"bottom":1===e.dirY&&n&&(i=0,r="main",e.swipe=!0)}n?1===e.dirY?(a=OGX.Iceberg.SWIPE_DOWN,o="down"):(a=OGX.Iceberg.SWIPE_UP,o="up"):1===e.dirX?(a=OGX.Iceberg.SWIPE_RIGHT,o="right"):(a=OGX.Iceberg.SWIPE_LEFT,o="left"),e.swipe&&e.dist&&(c.addClass("ogx_iceberg_anim"),c.on("transitionend",(function(){c.off("transitionend"),c.removeClass("ogx_iceberg_anim"),g=G(c),y(f=r),d.callbacks[o](f),c.trigger(a,f)})),c.css({transform:"translate3d("+t+"px, "+i+"px, 0)"}))}else if(e.dist){switch(t=0,i=0,f){case"left":t=h.left.outerWidth();break;case"right":t=-h.right.outerWidth();break;case"top":i=h.top.outerHeight();break;case"bottom":i=-h.bottom.outerHeight()}c.addClass("ogx_iceberg_anim"),c.on("transitionend",(function(){c.off("transitionend"),c.removeClass("ogx_iceberg_anim"),g=G(c),d.callbacks.onRestore(f),c.trigger(OGX.Iceberg.RESTORE,f)})),c.css({transform:"translate3d("+t+"px, "+i+"px, 0)"})}}function G(e){var t=e[0].style.transform;if(t=t.match(/translate3d\(([0-9px%,\.\- ]+)\)/)){t=t[1].split(",");for(var i=0;i=d.flatten?(u="flattened",g=G(c),c.addClass("ogx_iceberg_views_flattened").css("transform","translate3d(0px, 0px, 0px)"),c.children(".ogx_iceberg_view").addClass("ogx_iceberg_view_flattened"),this.disable()):"flattened"===u&&this.el.width() .ogx_iceberg_views > .ogx_iceberg_view[data-ogx-panel-id="';for(var o in d["node:OML"])for(var r in d["node:OML"][o])0===r.indexOf("left")&&(i+='
',n.left=a+'left"]',h.left=!0),0===r.indexOf("top")&&(i+='
',n.top=a+'top"]',h.top=!0),0===r.indexOf("main")&&(i+='
',n.main=a+'main"]'),0===r.indexOf("right")&&(i+='
',n.right=a+'right"]',h.right=!0),0===r.indexOf("bottom")&&(i+='
',n.bottom=a+'bottom"]',h.bottom=!0);for(s.el.html(i),o=0;ot.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,callbacks:{open:null,close:null}},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},h=!1,g=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"),a=!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"),g.findUpdate("id",i,{open:!0},!1,1),a=!0):(f.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 o=g.find("id",i,1);a?(!function(e){var t=v(e);if(t)return t.focus(),!0}(o),n.onOpen(o),t.trigger(OGX.NestList.OPEN,o)):(!function(e){var t=v(e);if(t)return t.blur(),!0}(o),n.onClose(o),t.trigger(OGX.NestList.CLOSE,o)),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;h&&(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((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=/method *([a-zA-Z0-9_\-]+) ([a-zA-Z0-9_\-]+):([a-zA-Z0-9_\-]+)/gi.exec(e))&&(s='OGX.Object.get({_NAME_:{eq:"'+r[3]+'"}, id:{eq:"'+r[2]+'"}}, null, 1).'+r[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=convertKeywords(e+="\r\n",!1);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){var i=0;function n(e){var n;for(var a in e)0===a.indexOf("default")&&(n=a.replace("default",t[i]),i++,e[n]=e[a],delete e[a])}if(void 0!==e&&void 0!==t){e.hasOwnProperty("node:OML")||(e["node:OML"]=[]);var a,o=e["node:OML"];o&&"string"==typeof o&&(0===o.indexOf("{{")?e["node:OML"]=OGX.OSE.exec(o):e["node:OML"]=OGX.Cache.read("oml",e["node:OML"]));for(var r=0;r=i.points[t].min&&o{i=!1;for(var r=0;ri.left&&t.lefti.top&&t.topscreen.width&&(e=screen.width),t>screen.height&&(t=screen.height);var i=r.width,a=r.height,o=0,s=0;return p||(i=OGX.Data.getBestSize(e,i),a=OGX.Data.getBestSize(t,a)),r.center?("string"==typeof i&&(i=-1!==i.indexOf("%")?Math.round(e*Number(i.substr(0,i.length-1))/100):Number(i)),"string"==typeof a&&(a=-1!==a.indexOf("%")?Math.round(t*Number(a.substr(0,a.length-1))/100):Number(a)),x=Math.round(e/2-i/2),y=Math.round(t/2-a/2),r.center&&_&&(r.center=!1)):(_?(x=n.x,y=n.y):r.x&&r.y?(-1!==String(r.x).indexOf("%")?(o=i/2,x=e*Number(r.x.slice(0,-1))/100-o):x=r.x,-1!==String(r.y).indexOf("%")?(s=a/2,y=t*Number(r.y.slice(0,-1))/100-s):y=r.y):(x=Math.round(e/2-i/2),y=Math.round(t/2-a/2)),x>e&&(x=e-x),x<-i&&(x=0),y>t&&(y=t-a),y<0&&(y=0)),{x:x,y:y,w:i,h:a}}function M(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&&m&&(d=m),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 h={};switch(f=c+"_"+d,d){case OGX.Popup.SCALE:u[1]=e?"scale(1,1)":"scale("+r.anim_param.scale+", "+r.anim_param.scale+")",h.transform=u.join(" ");break;case OGX.Popup.FADE:h.opacity=e?1:0}e&&(s.css("display","flex"),h.visibility="visible",h.display="flex"),t||e||(h.visibility="hidden",h.display="none"),setTimeout((function(){s.css(h)}),50),t?(m=d,s.on("transitionend",(function(){s.off("transitionend"),e?n.resizeNodes():s.css({display:"none",visibility:"hidden"}),f&&s.removeClass(f),N(i,a,o)})),f&&s.addClass(f)):(s.removeClass(f),N(i,a,o))}else e?s.css({opacity:e,display:"flex",visibility:"visible"}):s.css({display:"none",visibility:"hidden"}),N(i,a,o)}function N(e,t,i){void 0!==e&&e&&e(t),void 0!==i&&i&&i(n.id)}function I(e){e?s.on(n.touch.down,"."+c+"_button",P):s.off(n.touch.down,"."+c+"_button",P)}function P(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 A(){for(var e,t="",i=0;i0&&(e=r.buttons[i].enabled?"":c+"_button_disabled",t+=''+r.buttons[i].label+"");return t}function Y(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&&R(!0),r.buttons&&r.buttons.length&&r.buttons_enabled&&I(!0),debug(5,"popup",r.id,"enabled"),this},this.disable=function(){return this.disableResize(),r.icons&&r.icons.length&&R(!1),r.buttons&&r.buttons.length&&r.buttons_enabled&&I(!1),debug(5,"popup",r.id,"disabled"),this},this.show=function(e,t,i){return M(1,e,t,i),this.focus(1),this},this.hide=function(e,t,i,n,a){return M(0,e,t,i,n,a),this.blur(1),this},this.resize=function(){return G(),this},this.maximize=function(){return r.maximize&&!v&&(v=!0,O={width:r.width,height:r.height,x:this.x,y:this.y},r.width=r.height="100%",G(!1),this.x=this.y=0,this.move(this.x,this.y)),this},this.normalize=function(){return r.maximize&&v&&(v=!1,r.width=O.width,r.height=O.height,G(!1),this.x=O.x,this.y=O.y,O=null,this.move(this.x,this.y)),this},this.width=function(e,t,i){if(void 0===e)return r.width;void 0===i&&(i=!1),void 0===t&&(t=!1),t&&n.el.removeClass("ogx_popup_notrans"),r.width=e,w(["width"],i),X()},this.height=function(e,t,i){if(void 0===e)return r.height;void 0===i&&(i=!1),void 0===t&&(t=!1),t&&n.el.removeClass("ogx_popup_notrans"),r.height=e,w(["height"],i),X()},this.destroy=function(){s.off("transitionend"),this.touch.wipe()},this.buttons=function(e){if(void 0===e)return r.buttons;Y(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+=W()),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+=A(),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:D,cb_up:S,target:"."+c+"_head"};r.group?e.cb_drag=L:"function"==typeof r.drag&&(e.cb_drag=function(e){r.drag(n,e)}),n.touch.add("Drag",e),n.dragable=!0}if(r.resize&&n.setResize({top:!1,cb_resize:b,cb_down:E,cb_up:C}),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,h="mousedown",g="mouseup",p="mousemove",_=(c=!1,!1),m=!1,v={w:0,h:0},y=null;function x(e){c&&(e?d.el.on(h,O):d.el.off(h,O))}function O(e){var u=E(e);n=u.pageX,a=u.pageY;var f=d.el.position();t=f.left,i=f.top;var h=d.el.offset(),g=n-h.left,p=a-h.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&&gd.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(),y&&y.disable(),b(!0),G(!0),c.cb_down&&c.cb_down())}function b(e){e?f||(f=setInterval(w,5)):f&&(clearInterval(f),f=!1)}function w(){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 G(e){e?($("body").on(p,X),$("body").on(g,T)):($("body").off(p,X),$("body").off(g,T))}function X(e){e.preventDefault(),e.stopImmediatePropagation(),e=E(e),o=e.pageX-n,r=e.pageY-a}function T(e){b(!1),G(!1),e=E(e),o=e.pageX-n,r=e.pageY-a,c.cb_up&&c.cb_up(),y&&(x(!1),y.enable(),setTimeout((function(){x(!0)}),0))}function E(e){return e.hasOwnProperty("originalEvent")&&void 0!==e.originalEvent.changedTouches?e.originalEvent.changedTouches[0]:e}this.resizable=!0,this.setResize=function(e){OGX.Data.merge(e,u,!1),c=e},this.enableResize=function(){return x(!0),this},this.disableResize=function(){return x(!1),this},this.destroy=function(){this.touch.wipe()},OGX.Data.merge(c,u,!1),void 0===window.ontouchstart||c.chromeos||(h="touchstart",p="touchmove",g="touchend"),d.hasOwnProperty("dragable")&&d.dragable&&(y=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,callbacks:{change:null}},u={template:!1,html:'{{$label}}',css:!1},f="object",h=0,g=0,p=null,_="ogx_roulette";function m(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 v(e){e?t.on(l.touch.down,"."+_+"_icon",(function(e){e.preventDefault(),e.stopImmediatePropagation(),l.next(!0)})):t.off(l.touch.down,"."+_+"_icon")}function y(e){e?t.on("change","input[type=hidden]",x):t.off("change","input[type=hidden]",x)}function x(e){e.preventDefault(),e.stopImmediatePropagation(),l.loopval(0,OGX.Data.stringToVal(e.target.value),!1)}function O(e){return g+e>d.list.length-1?d.list[0]:g+e<0?d.list[d.list.length-1]:d.list[g+e]}function b(e){a=e.y,X(!0)}function w(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 G(e){X(!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,g!==a){switch(g=a,f){case"string":d.value=d.list[g];break;case"object":d.value=d.list[g][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 X(e){e?r=setInterval(T,10):clearInterval(r)}function T(){var e,t,a;(e=Math.floor((i.position().top+n*o)/(n*d.list.length)*-1))!==h&&(0===i.children("."+_+'_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("."+_+"_stripe").each((function(e,t){a=i.position().top+$(t).position().top,(Math.ceil(a+n*d.list.length)<-n||a>n)&&$(t).remove()})),h=e)}function E(){X(!1),i.off("transitionend",E)}function C(){var e="",a='
';a+='
';for(var o=0;o<2;o++){a+='
';for(var r=0;r'+e+"
"}a+="
"}if(a+="
",d.icon&&(a+='
'),void 0===g&&(g=0),d.name){var l="";switch(d.required&&(l=" required"),f){case"string":a+='";break;case"object":a+='"}}t.html(a),i=t.children("."+_+"_container").children("."+_+"_stripes").first(),s=(s=i.children("."+_+"_stripe:last")).detach();var c=g*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 S(e){switch(f){case"string":return{index:d.list.indexOf(e)};case"object":return d.list.findIndex(d.key,e)}}function L(){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(_+"_disabled"),d.icon&&v(!0),d.name&&y(!0),p&&p.enable(),debug(5,"roulette",d.id,"enabled"),this},this.disable=function(){return t.addClass(_+"_disabled"),d.icon&&v(!1),d.name&&y(!1),p&&p.disable(),X(!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(C,0),this},this.destroy=function(){this.touch.wipe()},this.bindRender=function(e,t){},this.onSelect=function(){},this.val=function(e,t){if(void 0!==e){var a=S(e).index;return a>-1&&(!function(e,t){void 0===t&&(t=!0);i.off("transitionend",E),X(!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);X(!0),i.on("transitionend",E),i.css({transition:"all "+f+"ms ease-out",transform:"translate3D(0px, "+u+"px, 0px)"}),g=e}(a),d.name&&m(e,!1)),this}switch(f){case"string":return d.list[g];case"object":return d.list[g][d.key]}},this.item=function(){return d.list[g]},this.loopval=function(e,t,a){var o=g,r=S(t).index;r>-1&&(g=r);var s=o-r,l=d.time_coef*Math.abs(s+e*d.list.length);return X(!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",E),d.name&&m(t,a),void 0!==a&&a&&(this.onSelect(val),this.el.trigger(OGX.Roulette.CHANGE,val)),this},this.next=function(e){var t,i=O(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.onSelect(t),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=O(-1);switch(f){case"string":t=i;break;case"object":t=i[d.key]}return this.val(t),void 0!==e&&e&&(this.onSelect(t),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,L(),g=void 0===t?0:S(t).index,setTimeout(C,0),this},debug(5,"roulette init",d.id),function(){if(OGX.Data.merge(d,c),d.callbacks.change||(d.callbacks.change=l.onChange),L(),d.display?d.display=new OGX.Display(d.display):d.display=new OGX.Display(u),(t=l.el=$(d.el)).addClass(_),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)),g=S(d.value).index}}(),l.observeOnce({childList:!0},(function(){p=l.touch.add("Swipe",{x:!1,y:!0,cb_down:b,cb_swipe:w,cb_up:G,state:"manual",target:".ogx_roulette_container",capture:d.capture}),d.enabled&&p.enable()}),null),C(),debug(5,"roulette",d.id,"init")},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.enable():t>0&&s[t].roulette.disable()}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(g(i),t),i.push(t)));setTimeout(d,0)}function g(e){for(var t=o.data,i=0;i-1?f(n):{};h(e)},o=OGX.Data.merge(o,r),(t=a.el).addClass("ogx_roulette_tree"),a.observeOnce({childList:!0},(function(){setTimeout((()=>{o.value?h(o.value):d()}),10)})),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,enabled:!1,required:o.required}),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,h=e,g={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"),C(!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),C(!1),L("out")}function T(e){e?(window.addEventListener("resize",N),i.on("scroll",(function(e){e.stopImmediatePropagation(),E()})),i.on("wheel",(function(e){C(!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"),h.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)),h.scroll_callback&&h.scroll_callback()}function C(e){e?(d&&C(!1),l=t.position().top,d=setInterval(D,h.check_delay-10)):(d&&(clearInterval(d),d=null),v=!1,f.el.trigger(OGX.Scroller.END))}function D(){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,h.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")}),h.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(),h.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),h.observe&&setTimeout((function(){k(!0)}),0),x(!0),debug(5,"scroller",h.id,"enabled"),this},this.disable=function(){return T(!1),h.observe&&k(!1),G(!1),b(!1),x(!1),C(!1),S(!1),o.removeClass("ogx_scroller_track_anim_fade_in"),o.removeClass("ogx_scroller_track_anim_fade_out"),debug(5,"scroller",h.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(h,g),function(){f.el=$(h.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",h.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 h(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[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){h(!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,h(!0)})):(c=e,h(!0)),n=i.width(),i.css("transform","translateX("+e*Math.round(n/d.length)*-1+"px)")}this.enable=function(){return h(!0),p(!0),debug(5,"stackedtree",s.id,"enabled"),this},this.disable=function(){return h(!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,callbacks:{change:null}},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),i.onChange(n.value),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.construct=function(){n.name&&c(!0)},this.enable=function(){return l(!0),t.removeClass(o+"_disabled"),debug(5,"switch",n.id,"enabled"),this},this.disable=function(){return l(!1),t.addClass(o+"_disabled"),debug(5,"switch",n.id,"disabled"),this},this.destroy=function(){n.name&&c(!1)},this.bindRender=function(e,t){},this.val=function(e,i){return void 0===i&&(i=!0),void 0!==e&&n.value!==e&&(r(),i&&t.children("."+o+"_val").first().trigger("input")),n.value},this.onChange=function(){},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:-4,reorder:!0,icons:!1,index:0,list:new OGX.List,display:{html:"",css:""},callbacks:{select:null,close:null,add:null,remove:null}},o=!1,r=0,s=!1,l=!1,d=!1,c=!1,u=!1,f={x:0,y:0},h="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(h+"_editable")),t.html(a),o=t.children("."+h+"_container").children("."+h+"_tab:eq("+r+")")}function p(e){s||(u=!1,l=$(e),d={from:l.index()},t.children("."+h+"_container").children("."+h+"_tab_active").first().removeClass(h+"_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(h+"_tab_active").addClass(h+"_frozen"),o=l,s.el.addClass(h+"_tab_active").addClass(h+"_float").css("transform","translate3d("+f.x+"px, "+s.y+"px, 0px)"),t.children("."+h+"_container").prepend(s.el),c=setInterval(m,5))}function _(e){if(s)if(u=e,Math.abs(u.distX)>Math.abs(u.distY)){var a=s.x+u.distX;s.el.css("transform","translate3d("+a+"px, "+s.y+"px, 0px)")}else{var o=s.y+u.distY;s.el.css("transform","translate3d("+s.x+"px, "+o+"px, 0px)");var r=s.el.offset();if(u.distYMath.abs(u.distY)&&t.children("."+h+"_container").children("."+h+"_tab").each((function(t,a){(e=$(a)).hasClass(h+"_tab_active")||(i=e.position(),n=e.width(),idx!==t&&(s.x+u.distX>i.left+n/2&&s.x+u.distXi.left&&s.x+u.distXe&&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("."+h+"_container").first().children("."+h+"_tab:eq("+e+")").remove(),o=null,function(){r>0?r--:r=0;i.index(r)}()),this},this.enableTab=function(e){return t.children("."+h+"_container").first().children("."+h+"_tab:eq("+e+")").removeClass(h+"_tab_disabled"),this},this.disableTab=function(e){return t.children("."+h+"_container").first().children("."+h+"_tab:eq("+e+")").addClass(h+"_tab_disabled"),this},this.index=function(e){return void 0!==e?(o&&(o.removeClass(h+"_tab_active"),o=null),(o=t.children("."+h+"_container").first().children("."+h+"_tab:eq("+e+")")).addClass(h+"_tab_active"),r=e,!0):o?r:-1},this.select=function(e){o&&o.removeClass(h+"_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)),n.callbacks.select||(n.callbacks.select=i.onSelect),n.callbacks.close||(n.callbacks.close=i.onClose),n.callbacks.add||(n.callbacks.add=i.onAdd),n.callbacks.remove||(n.callbacks.remove=i.onRemove),(t=i.el).addClass(h),n.editable&&t.addClass(h+"_editable"),r=n.index,setTimeout(g,0),n.reorder&&i.touch.add("Hold",{id:"tabs_hold",cb_hold:p,cb_move:_,cb_up:v,state:"manual",time:1e3,target:".ogx_tabs_tab",capture:!1})):debug(1,"OGX.List not found! ")},OGX.Tabs.SELECT="TabsSelect",OGX.Tabs.CLOSE="TabsClose",OGX.Tabs.REORDER="TabsReorder",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_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",callbacks:{select:null,add:null,remove:null}},container,input,sliced={org:[],rem:[]},config=OGX.Data.merge(__config,config_default,!1);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),that.onAdd(e),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)}config.callbacks.select(t),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());that.onRemove(t),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(){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))),config.callbacks.select||(config.callbacks.select=that.onSelect),config.callbacks.add||(config.callbacks.add=that.onAdd),config.callbacks.remove||(config.callbacks.remove=that.onRemove),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.onSelect=function(){},this.onAdd=function(){},this.onRemove=function(){},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,require("Template"),OGX.Template=function(e){construct(this,"Template");var t=new OGX.Display(e),i=t.html(e.data),n=t.css(e.data);i&&this.el.html(i),n&&this.el.addClass("css")},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 h(){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?(h(),$(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(){!h&&a&&(h=!0,v(!0))},this.disable=function(){h&&(h=!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},h=null;function g(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),h=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(h,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,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,_))}},OGX.Touches.Drag=function(e){"use strict";var t,i,n,a,o,r,s=!1,l={min:10,x:!0,y:!0,limit_x:null,limit_y:null,target:!1,cb_down:!1,cb_drag:!1,cb_up:!1,border:10,capture:!1,state:"auto"},d=e,c=!1,u=!1;function f(e){var t=[];t=s.target?[d.touch.down,s.target,h]:[d.touch.down,h],e?d.el.on.apply(d.el,t):d.el.off.apply(d.el,t)}function h(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,h=a-u.top;if(s.border){if(fd.el.width()-s.border)return;if(hd.el.height()-s.border)return}o=0,r=0,g(!0),p(!0),s.cb_down&&s.cb_down()}function g(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){g(!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),g(!1))}},OGX.Touches.Move=function(e){"use strict";var t,i,n,a,o,r,s,l,d=!1,c={min:0,x:!0,y:!0,limit_x:null,limit_y:null,target:null,cb_down:null,cb_move:null,cb_up:null,cb_click:null,capture:!1,state:"auto"},u=e,f=!1;function h(e){var t=[];t=d.target?[u.touch.down,d.target,g]:[u.touch.down,g],e?u.el.on.apply(u.el,t):u.el.off.apply(u.el,t)}function g(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,h(!0))},this.disable=function(){f&&(f=!1,h(!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,h={show_root:!0,root_label:"root",editable:!1,sort:{enabled:!0,property:"label",way:1},type:"type",toggle:!0,drag_after:1e3,key:null,scope:["public"],chromeos:!1,types:{root:{mode:"folder",display:{html:u}},file:{mode:"file",display:{html:u}},folder:{mode:"folder",display:{html:u}}},data:{id:0,type:"root",state:"closed",label:null,items:[]},display:null,callbacks:{select:null,unselect:null,open:null,close:null,move:null}},g="_id";function p(e,t,i,n,a){return e[g]===a[g]&&t}function _(e,t){var i={container_display:"",container_css:"",arrow_display:"",arrow_style:"ogx_tree_item_arrow_open",state:"open",type:t.type};return i[g]=t[g],OGX.Data.merge(i,e,!0),OGX.Templater.make('
',i)}function m(){f.data&&"root"===f.data.type&&f.data.hasOwnProperty("label")&&(f.root_label=f.data.label);var e={type:"root",label:f.root_label};e[g]="root";var i=_({},e);t.html(i),f.data.element=t.children(".ogx_tree_item").first(),f.data.uxi=c,O(e,c),f.show_root||f.data.element.addClass("ogx_tree_root_hidden")}function v(){m(),y(f.data,c)}function y(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 b(e){var t={};return OGX.Data.merge(t,e),delete t.element,delete t.parent,d||delete t[g],t}function w(e){"folder"===L(e).mode&&(e.items.length?e.element.attr("data-empty",!1):(e.element.attr("data-state","closed").attr("data-compound",e.type+"-closed").attr("data-empty",!0),e.element.children(".ogx_tree_item_arrow").addClass("ogx_tree_item_arrow_disabled")),"open"===e.state?(e.element.attr("data-state","open").attr("data-compound",e.type+"-open"),e.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_close").removeClass("ogx_tree_item_arrow_disabled").addClass("ogx_tree_item_arrow_open"),e.element.children(".ogx_tree_item_container").removeClass("ogx_tree_item_container_hidden")):(e.element.attr("data-state","open").attr("data-compound",e.type+"-closed"),e.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_open").addClass("ogx_tree_item_arrow_close"),e.element.children(".ogx_tree_item_container").addClass("ogx_tree_item_container_hidden")))}function G(){if(s){var e=C(s);e&&e.children(".ogx_tree_item_content").removeClass("ogx_tree_selected_item"),s=null}}function X(e){var t=C(e);t&&(s=e,t.children(".ogx_tree_item_content").addClass("ogx_tree_selected_item"))}function T(e,t){return S((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",w(i),!0)}))}function E(e){if("root"===e)return f.data;return S((function(t,i){return t[g]===e&&t}))}function C(e){var t=E(e);return!!t&&t.element}function D(){l=1,S((function(e){return e[g]=l++,e.hasOwnProperty("type")||(e.hasOwnProperty("items")?e.type="folder":e.type="file"),!1}))}function S(e,t,i){var n;if(void 0===t&&(t=null),void 0===i&&(i=f.data),n=function i(a,o,r,s){if(n=e(a,o,r,s,t))return n;if(a.hasOwnProperty("items")&&a.items.length)for(var l=0;l .ogx_tree_item_content",(function(e){e.preventDefault(),k($(this).parent(0)),1!==$(this).parent(0).data("id")&&function(){o&&clearInterval(o);r=(new Date).getTime(),o=setInterval(N,50)}()})),$(document).on(c.touch.up,(function(){P(),n&&(I(!1),function(){var e=n.offset().left,o=n.offset().top,r=(l=e,d=o,S((function(e,t){return u=e.element.offset(),f=e.element.children(".ogx_tree_item_content").children(".ogx_tree_item_icon"),l>=u.left&&l<=u.left+f.width()&&d>=u.top&&d<=u.top+f.height()&&e}))),s=L(r);var l,d,u,f;!r||r&&(r[g]===i[g]||"folder"!==s.mode)?(a.css("opacity",1),n.remove(),n=null,i=null):(p=r,function(e){S((function(t,i,n,a){return t[g]===e&&(n.items.splice(a,1),n.items.length||(n.state="closed"),w(n),!0)}))}((h=i)[g]),T(h,p[g]),p.element.children(".ogx_tree_item_container").empty(),p.state="open",y(p,p.element),w(p),a.remove(),n.remove(),n=null,c.onMove(i),t.trigger(OGX.Tree.DROP,i),i=null);var h,p}())}))):t.on("click",".ogx_tree_item > .ogx_tree_item_content",(function(e){k($(this).parent(0))})),t.on(c.touch.down,".ogx_tree_item_arrow",(function(e){e.preventDefault(),P();var i=E($(this).parent(0).data("id"));i&&i.hasOwnProperty("items")&&i.items.length&&("open"===i.state?(c.onClose(i),t.trigger(OGX.Tree.CLOSE,i)):(c.onOpen(i),t.trigger(OGX.Tree.OPEN,i)),"open"===i.state?i.state="closed":i.state="open",w(i))}))):(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 N(){var e;(new Date).getTime()-r>=f.drag_after&&(s&&(i=E(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)),P())}function I(e){e?$(document).on(c.touch.move,(function(e){e=function(e){if(e.hasOwnProperty("originalEvent")&&void 0!==e.originalEvent.changedTouches)return e.originalEvent.changedTouches[0];return e}(e),n.css({top:e.pageY+"px",left:e.pageX+"px"})})):$(document).off(c.touch.move)}function P(){o&&(clearInterval(o),o=null)}this.enable=function(){return M(!0),debug(5,"tree",f.id,"enabled"),this},this.disable=function(){return M(!1),debug(5,"tree",f.id,"disabled"),this},this.onSelect=function(){},this.onUnselect=function(){},this.onOpen=function(){},this.onClose=function(){},this.onMove=function(){},this.addItem=function(e,t){if(void 0===t&&(t=s),t){var i=E(t);if("folder"===L(i).mode){d||(e[g]=++l),T(e,t);var n=L(e);x(i.uxi,i.element.children(".ogx_tree_item_container").first(),e),O(e,i.parent);var a=i.uxi;return n.display.hasOML()&&(a=i.uxi.nodes.last()),y(e,a),i.element.data("state","open"),i.element.data("compound",e.type+"-close"),i.element.children(".ogx_tree_item_container").removeClass("ogx_tree_item_container_hidden"),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=E(e);return!!t&&b(t)},this.selectItem=function(e){X(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 S(i)}(e,t);return!!i&&(G(),X(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 S(t)}(e);if(t)return t.element;return!1}(e);return!!t&&(G(),t.children(".ogx_tree_item_content").addClass("ogx_tree_selected_item"),s=t.data("id"),!0)},this.updateItem=function(e,t){var i=E(e);if(i){if(i.uxi){var n=i.uxi.el;i.uxi.kill(),n.empty()}OGX.Data.merge(i,t,!0),O(i,i.parent),i.hasOwnProperty("items")&&i.items.length&&(y(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.attr("state","open").attr("state",i.type+"-open"))}},this.replaceItem=function(e){var t=E(e[g]);t&&(t.uxi&&t.uxi.kill(),OGX.Data.merge(e,t,!1),O(t,t.parent),t.hasOwnProperty("items")&&t.items.length&&y(t,t.parent))},this.deleteItem=function(e){var t=E(e);if(t){var i=function(e){function t(t){return!(!t.hasOwnProperty("items")||!t.items.get({_id:{eq:e}},null,1))&&t}return S(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),w(i),!0}if(s)return S(e);return!1}()},this.getSelectedItem=function(){return function(){if(s)return E(s);return!1}()},this.getTree=function(){var e=S(b,null,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.scroll?this.clear([this.scroller.id]):this.clear(),f.data=e,f.data.hasOwnProperty("state")||(f.data.state="open"),d||D(),v()},this.newTree=function(){c.scroll?c.clear([c.scroller.id]):c.clear();l=1,m()},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(e){return void 0===e&&(e=!1),e&&this.resizeNodes(),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.parents(".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+'"]').first(),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.selector=t,this.wake(t),setTimeout((()=>this.resize),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","Template","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},(i=t.el).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&&this.touch.drag.enable(),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&&this.touch.drag.disable(),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(){listenScroll(!1),this.touch.wipe()},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,void 0===OGX)var OGX={};OGX.Workers=function(){"use strict";var e=0,t=new OGX.List;this.add=function(i,n,a){void 0===n&&(n=++e);var o=function(e,t){var i;if(void 0===t&&(t=!1),"string"==typeof e)i=new Worker(e);else{var n="";if(t){for(var a=0;a1&&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(__prop,__as_object,__new_props){void 0===__as_object&&(__as_object=!0),void 0===__new_props?__new_props=[__prop]:Array.isArray(__new_props)||(__new_props=[__new_props]);var q={};q[__prop]={regex:/(.){1,}/};for(var l=this.get(),ar=[],final=new OGX.List,o,ev,i=0;i=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 m(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=p,X=g(X,i,r),void OGX.Fonction(X,i,r);case"Uxi":return void e[_].attach(t,p);case"Fork":(L=O(p,e[_]))&&m(L,t),b=!1,G=!1;break;case"Html":X.el=p,X.html=e[_].html,(b=c(X))||(X.template=!1);break;case"Template":X.template=v.split(".")[1],X.el=p,v="Html",b=c(X);break;case"Ghost":X.el=p;break;case"Controller":X.id=p,C=!0;break;default:-1!==[".","#"].indexOf(p.substr(0,1))?X.el=p:(X.id=p,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(v,X),t.add(y),x=y):S?(S.blur(),$(p).html(E),S.el=$(p),t.add(S),setTimeout((function(){t.blured||S.focus()}),0)):(x=t,"Html"===v&&OGX.HtmlRender(X)),x&&e[_].hasOwnProperty("node:OML")&&!S&&!M&&(e[_]=f(e,e[_]),m(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[_])))}}}m(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 w(e){i.children(".ogx_calendar_head").children(".ogx_calendar_head_labels").html(e)}function G(e,t,i,n){if(t.y-1>=0&&t.y-1
'),E(),X(),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}),b(),w(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(e){"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 e.hasOwnProperty("format")?e.format:"YYYY-MM"}},OGX.CalendarLayout.MONTH_DAYS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM"),!e.hasOwnProperty("labels")&&(e.labels="ddd"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){var i="",n=Number(t.format("d")),a=t.clone();n&&a.subtract(n,"day");for(var o=0;o<7;o++)i+=''+a.format(e.labels)+"",a.add(1,"day");return i},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<35;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"}}},OGX.CalendarLayout.CENTURY_DECADES=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY"),!e.hasOwnProperty("labels")&&(e.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+(e.labels?t.format(e.labels):100*Math.floor(Number(t.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="",h=0;h<10;h++)o="",s+l===d+(a=10*h)&&(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"}}},OGX.CalendarLayout.CENTURY_YEARS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+(e.labels?t.format(e.labels):100*Math.floor(Number(t.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"}}},OGX.CalendarLayout.DECADE_YEARS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+(e.labels?t.format(e.labels):10*Math.floor(Number(t.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"}}},OGX.CalendarLayout.DECADE_MONTHS=function(e){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(e){for(var t=10*Math.floor(Number(e.format("YYYY"))/10),i=Number(String(t).substr(2,2)),n="",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(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels="[Months]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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"}}},OGX.CalendarLayout.YEAR_WEEKS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels="[Weeks]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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"}}},OGX.CalendarLayout.YEAR_DAYS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels="[Nth Day]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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"}}},OGX.CalendarLayout.MONTH_WEEKS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="[(]YYYY-MM[)] W"),!e.hasOwnProperty("labels")&&(e.labels="[Nth Week]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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,h=moment(e.format("YYYY-MM-[01]")),g=0;g<5;g++)f="",a=Number(h.format("w")),d===c&&a===u&&(f+="ogx_calendar_selected_item "),d===s&&a===l&&(f+="ogx_calendar_layout_month_weeks_current"),o+='
'+t(h.format("YYYY-MM-DD"),i)+"
",h.add(7,"days");return o},this.value=function(){return{value:1,unit:"months"}}},OGX.CalendarLayout.WEEK_DAYS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM (wo [week])"),!e.hasOwnProperty("labels")&&(e.labels="ddd DD"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){var i="",n=Number(t.format("d")),a=t.clone();n&&a.subtract(n,"day");for(var o=0;o<7;o++)i+=''+a.format(e.labels)+"",a.add(1,"day");return i},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"}}},OGX.CalendarLayout.DAY_HOURS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM-DD HH:[00]"),!e.hasOwnProperty("labels")&&(e.labels="[Hours]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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"}}},OGX.CalendarLayout.DAY_WORK_HOURS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM-DD HH:[00]"),!e.hasOwnProperty("labels")&&(e.labels="[Work Hours]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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"}}},OGX.CalendarLayout.DAY=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM-DD"),!e.hasOwnProperty("labels")&&(e.labels="dddd DD"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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.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,callbacks:{change:null}},c={position:"bottom"},u=!1,f=0,h=0,g=new OGX.List,p="ogx_carousel";function _(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(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*h+"%"),s.placeholders(l,e),t.trigger(OGX.Carousel.READY)}this.construct=function(){G(),l.index&&this.showPanel(l.index,!1),l.dots&&o.bind("dots",s)},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*h)+"%"),i.children("."+p+"_view").css("width",100/h+"%"),++f-1}(),d="."+p+'[data-ogx-id="'+this.id+'"] > .'+p+"_views > ."+p+'_view[data-ogx-panel-id="'+l+'"]',c={},u=d;if(e.hasOwnProperty("_NAME_"))e.detach(),e.attach(this,d),a&&this.showPanel(h-1,o);else{for(var g in e){u+=":"+g.split(":")[1],c[u]=e[g];break}var _=null;setTimeout((function(){s.observe(!0,{childList:!0,subtree:!0},(function(){s.observe(!1),_&&clearTimeout(_),_=setTimeout(G,20),a&&(s.showPanel(h-1,o),r?r():t.trigger(OGX.Carousel.ADDED,h))})),OGX.OML.render(s,c,n)}),0)}return 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/h*(-1*n);return i.removeClass(p+"_anim"),i.css({transform:"translate3d("+o+"%, 0, 0)"}),r=n,setTimeout(G,0),s.onChange(r),t.trigger(OGX.Carousel.CHANGE,r),this},this.removePanel=function(e,n){if(void 0===n&&(n=!0),e>=0&&e=r?e--:e=r,e<0&&(e=0),s.showPanel(e,!1,!0),t.trigger(OGX.Carousel.REMOVED,h),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)"}),h=0,g=new OGX.List,l.index=0,l["node:OML"]=[],this},this.render=function(e,t){return l["node:OML"]=e,h=l["node:OML"].length,X(),OGX.OML.render(this,l["node:OML"],t),this},this.destroy=function(){this.touch.wipe()},function(){if(void 0===OGX.Data)return debug(1,"OGX.Data not found!"),!1;OGX.Data.merge(l,d,!1),l.callbacks.change||(l.callbacks.change=s.onChange),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")&&(h=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/h*(-1*r)+"%, 0, 0)"})}(),l.dots&&(o=s.create("Dots",{el:"."+p+'[data-ogx-id="'+s.id+'"] > .carousel_dots',total:h})),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.CHANGE="CarouselChange",OGX.Carousel.ADDED="CarouselAdded",OGX.Carousel.REMOVED="CarouselRemoved",void 0===OGX)var OGX={};if(OGX.Color={},OGX.Color.hexToRgb=function(e){"use strict";e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,i,n){return t+t+i+i+n+n}));var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:null},OGX.Color.rgbToHex=function(e,t,i){"use strict";var n,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);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 h=c-u;switch(d=f>.5?h/(2-c-u):h/(c+u),c){case n:l=(a-o)/h+(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,i.x,i.y),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)}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.onSelect=function(){},this.destroy=function(){!function(){for(var e in o)r(e)}()},OGX.Data.merge(n,a),n.callbacks.select||(n.callbacks.select=i.onSelect),(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},callbacks:{select:null,unselect:null},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)),config.callbacks.select||(config.callbacks.select=that.onSelect),config.callbacks.unselect||(config.callbacks.unselect=that.onUnselect),(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!==key_default||(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.onSelect=function(e){},this.onUnselect=function(e){},this.getFilteredList=function(){if(isFiltered){if(!config.key){var e=JSON.parse(JSON.stringify(filtered));return clearIds(OGX.List(e))}return filtered}return!1},this.display=function(e){return void 0===e?config.display:display.val(e)},this.key=function(e){if(void 0===e)return e;config.key=e,config.key||(key=key_default)},this.mode=function(e){return void 0===e?config.mode:(config.mode!==e&&(config.mode===OGX.DynamicList.STATIC?this.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 h=e.validate(r.form);!0===h?f.valid=!0:(f.valid=!1,f.error=h)}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,OGX.Form.fromObject=function(e,t,i,n){var a={el:t.selector+" "+i,data:e,fullpath:!1};return OGX.Data.merge(a,n,!1),t.create("FormInstance",a)},void 0===OGX)var OGX={};if(require("FormInstance","Uxi","Placeholder"),OGX.FormInstance=function(__config){construct(this,"FormInstance");var that=this,config_defaults={fullpath:!1},config=OGX.Data.merge(__config,OGX.Form.defaults,!1,!0);function render(){var html="",oml='{"default:Html":{"html": {{$html}}, "node:OML": {{$oml}} }}',render_oml=!1,row,nodes=[];function cycle(__o,__path){for(var a in __o){var t=typeof __o[a],p;switch(p=__path?__path+"."+a:a,t){case"object":if(Array.isArray(__o[a]))if(["string","number","boolean"].includes(typeof __o[a][0]))row=genRow("array",a,JSON.stringify(__o[a])),html+=row.html,row.oml&&(nodes.push(row.oml),render_oml=!0);else for(var i=0;i<__o[a].length;i++)cycle(__o[a][i],__path?__path+"."+a+"["+i+"]":a+"["+i+"]");else cycle(__o[a],__path?__path+"."+a:a);break;case"string":case"number":case"boolean":var pattern="",required=!1,readonly=!1,oo;if(config.hasOwnProperty("fields")){try{oo=eval("config.fields."+p)}catch(e){}void 0!==oo&&(oo.hasOwnProperty("pattern")&&(pattern=oo.pattern),oo.hasOwnProperty("required")&&(required=oo.required),oo.hasOwnProperty("readonly")&&(readonly=oo.readonly))}row=genRow(t,p,__o[a],required,pattern,readonly),html+=row.html,row.oml&&(nodes.push(row.oml),render_oml=!0)}}}cycle(config.data,null),html=OGX.Templater.make(OGX.Form.defaults.templates.form,{rows:html}),oml=render_oml?nodes.join(","):null,oml=JSON.parse(oml),oml=OGX.OML.rename(oml,that.selector),that.el.html(html),oml&&OGX.OML.render(that,oml)}function genRow(e,t,i,n,a,o){var r={html:"",oml:null},s=config.types[e],l="",d="",c="";void 0!==n&&n&&(l="required",d='pattern="'+a+'"'),void 0!==o&&o&&(c="readonly");var u=t;return config.fullpath||(u=t.split(".").pop()),r.html=OGX.Templater.make(s.html,{name:u,prop:t,val:i,required:l,pattern:d,readonly:c}),r.html=OGX.Templater.make(OGX.Form.defaults.templates.row,{html:r.html,name:u,prop:t}),s.hasOwnProperty("oml")&&(r.oml=OGX.Templater.make(s.oml,{name:u,prop:t,val:i,required:l,pattern:d,readonly:c})),r}function init(){that.el.addClass("ogx_form"),render(),setTimeout((function(){OGX.Form.bindForm({el:that.selector+">form",change_cb:that.onChange,submit_cb:that.onSubmit})}),300)}OGX.Data.merge(config,config_defaults,!1),this.construct=function(){},this.enable=function(){},this.disable=function(){},this.ux=function(e){},this.destroy=function(){OGX.Form.unbindForm(that.selector)},this.onChange=function(e){},this.onSubmit=function(e){},init()},OGX.Form.defaults={templates:{form:"
{{$rows}}
",row:'{{$name}}{{$html}}'},types:{boolean:{html:'',oml:'{"default .{{$name}}:Switch":{"name" : "{{$prop}}", "val":{{$val}}, "editable" : {{!$readonly}} } }'},string:{html:''},number:{html:''},array:{html:'',oml:'{"default .{{$name}}:Tags":{"name" : "{{$prop}}", "editable" : {{!$readonly}}, "current_tags":{{$val}} } }'}}},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,h=this,g=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,callbacks:{up:null,down:null,left:null,right:null}},_=!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(h.touch.down,E):t.off(h.touch.down,E)}function E(e){_=!1,o=0,r=0,s=0,l=0,e=A(e),m.x=e.pageX,m.y=e.pageY,x=!0,L(!0)}function C(e){e?$("body").on(h.touch.up,D):$("body").off(h.touch.up,D)}function D(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=P(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(h.touch.move,k)):(M(!1),t.off(h.touch.move,k))}function k(e){e=A(e),g.capture&&(e.preventDefault(),e.stopImmediatePropagation()),o=0,r=0,s=0,l=0,_||(g.axis.x&&Math.abs(e.pageX-m.x)>Math.abs(e.pageY-m.y)?_="x":g.axis.y&&Math.abs(e.pageX-m.x)0?1:-1):g.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),g.axis.x&&"x"===_&&o&&s&&o<=n){if(!g.loop&&(b.x+-1*s<0||b.x+-1*s>g.map[0].length-1))return;if((d=(b.x+-1*s)%g.map[0].length)<0&&(d=Math.abs(g.map[0].length+d)),!1===g.map[w.y][d])return;u=o*s,i.css({transform:"translate3d("+(-1*b.x*n+u)+"px, "+v.y+"px, 0px)"})}else if(g.axis.y&&"y"===_&&r&&l&&r<=a){if(!g.loop&&(b.y+-1*l<0||b.y+-1*l>g.map.length-1))return;if((c=(b.y+-1*l)%g.map.length)<0&&(c=Math.abs(g.map.length+c)),!1===g.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=P(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=Y(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),h.onLeft({cell:w,point:b}),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}]),H()):(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),h.onRight({cell:w,point:b}),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}]),H())):b.y!==e.y&&(l=b.y>e.y?1:-1,b.y=e.y,w.y=Y(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),h.onUp({cell:w,point:b}),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}]),H()):(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),h.onDown({cell:w,point:b}),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}]),H())),_=0}))):i.off("transitionend")}function P(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 A(e){return e.hasOwnProperty("originalEvent")&&void 0!==e.originalEvent.changedTouches?e.originalEvent.changedTouches[0]:e}function Y(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=Y(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=Y(e[n]).x}else i.x=e[n].x;t=g.map[i.y][i.x],W(e[n],t),h.onRender(i)}}function W(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,Y(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=Y(e);for(var r in t){t[r].id="cell_"+o.x+"_"+o.y;break}t=OGX.OML.rename(t,a);var s=h.nodes.find("id","cell_"+o.x+"_"+o.y,1);s&&h.remove(s._NAME_,s.id),$(a).empty(),OGX.OML.render(h,t,{abs:e,rel:Y(e)}),H()}}function H(){for(var e=0;e',d=-1*e,c=-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 debug(5,"gridwwiper",g.id,"enabled"),T(!0),C(!0),H(),this},this.disable=function(){return debug(5,"gridwwiper",g.id,"disabled"),T(!1),C(!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.onUp=function(){},this.onDown=function(){},this.onLeft=function(){},this.onRight=function(){},this.onRender=function(){},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},U(),F(),z(),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},"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"),g(),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,r,s=this,l={left:0,right:0,top:0,bottom:0,min:50,drag:!0,flatten:!1,capture:!0,"node:OML":{},callbacks:{up:null,down:null,left:null,right:null,restore:null}},d=e,c=!1,u="normal",f="main",h={left:null,main:null,right:null,top:null,bottom:null},g=[0,0,0],p=0,_=0,m=0,v=0;function y(e){for(var t in h)h[t]&&h[t].instance&&(e===t?h[t].instance.focus():h[t].instance.blur())}function x(){c.hasClass("ogx_iceberg_anim")||(c.off("transitionend"),g=G(c))}function O(e){var t=0;return e.dirY&&e.distY>e.distX&&(t=1),t}function b(e){d.drag&&e.dist&&(!(n=O(e))&&["main","left","right"].includes(f)?e.dirX&&e.distX&&(t=g[0]+e.distX*e.dirX)<=_&&t>=p&&c.css({transform:"translate3d("+t+"px, 0, 0)"}):["main","top","bottom"].includes(f)&&e.dirY&&e.distY&&(i=g[1]+e.distY*e.dirY)<=v&&i>=m&&c.css({transform:"translate3d(0, "+i+"px, 0)"}))}function w(e){if(t=0,i=0,n=O(e),e.swipe&&e.dist){var r;switch(e.swipe=!1,f){case"main":-1===e.dirX&&d.right&&!n?(t=-h.right.outerWidth(),r="right",e.swipe=!0):1===e.dirX&&d.left&&!n?(t=h.left.outerWidth(),r="left",e.swipe=!0):1===e.dirY&&d.top&&n?(i=h.top.outerHeight(),r="top",e.swipe=!0):-1===e.dirY&&d.bottom&&n&&(i=-h.bottom.outerHeight(),r="bottom",e.swipe=!0);break;case"left":-1!==e.dirX||n||(t=0,r="main",e.swipe=!0);break;case"right":1!==e.dirX||n||(t=0,r="main",e.swipe=!0);break;case"top":-1===e.dirY&&n&&(i=0,r="main",e.swipe=!0);break;case"bottom":1===e.dirY&&n&&(i=0,r="main",e.swipe=!0)}n?1===e.dirY?(a=OGX.Iceberg.SWIPE_DOWN,o="down"):(a=OGX.Iceberg.SWIPE_UP,o="up"):1===e.dirX?(a=OGX.Iceberg.SWIPE_RIGHT,o="right"):(a=OGX.Iceberg.SWIPE_LEFT,o="left"),e.swipe&&e.dist&&(c.addClass("ogx_iceberg_anim"),c.on("transitionend",(function(){c.off("transitionend"),c.removeClass("ogx_iceberg_anim"),g=G(c),y(f=r),d.callbacks[o](f),c.trigger(a,f)})),c.css({transform:"translate3d("+t+"px, "+i+"px, 0)"}))}else if(e.dist){switch(t=0,i=0,f){case"left":t=h.left.outerWidth();break;case"right":t=-h.right.outerWidth();break;case"top":i=h.top.outerHeight();break;case"bottom":i=-h.bottom.outerHeight()}c.addClass("ogx_iceberg_anim"),c.on("transitionend",(function(){c.off("transitionend"),c.removeClass("ogx_iceberg_anim"),g=G(c),d.callbacks.onRestore(f),c.trigger(OGX.Iceberg.RESTORE,f)})),c.css({transform:"translate3d("+t+"px, "+i+"px, 0)"})}}function G(e){var t=e[0].style.transform;if(t=t.match(/translate3d\(([0-9px%,\.\- ]+)\)/)){t=t[1].split(",");for(var i=0;i=d.flatten?(u="flattened",g=G(c),c.addClass("ogx_iceberg_views_flattened").css("transform","translate3d(0px, 0px, 0px)"),c.children(".ogx_iceberg_view").addClass("ogx_iceberg_view_flattened"),this.disable()):"flattened"===u&&this.el.width() .ogx_iceberg_views > .ogx_iceberg_view[data-ogx-panel-id="';for(var o in d["node:OML"])for(var r in d["node:OML"][o])0===r.indexOf("left")&&(i+='
',n.left=a+'left"]',h.left=!0),0===r.indexOf("top")&&(i+='
',n.top=a+'top"]',h.top=!0),0===r.indexOf("main")&&(i+='
',n.main=a+'main"]'),0===r.indexOf("right")&&(i+='
',n.right=a+'right"]',h.right=!0),0===r.indexOf("bottom")&&(i+='
',n.bottom=a+'bottom"]',h.bottom=!0);for(s.el.html(i),o=0;ot.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,callbacks:{open:null,close:null}},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},h=!1,g=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"),a=!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"),g.findUpdate("id",i,{open:!0},!1,1),a=!0):(f.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 o=g.find("id",i,1);a?(!function(e){var t=v(e);if(t)return t.focus(),!0}(o),n.onOpen(o),t.trigger(OGX.NestList.OPEN,o)):(!function(e){var t=v(e);if(t)return t.blur(),!0}(o),n.onClose(o),t.trigger(OGX.NestList.CLOSE,o)),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;h&&(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((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=/method *([a-zA-Z0-9_\-]+) ([a-zA-Z0-9_\-]+):([a-zA-Z0-9_\-]+)/gi.exec(e))&&(s='OGX.Object.get({_NAME_:{eq:"'+r[3]+'"}, id:{eq:"'+r[2]+'"}}, null, 1).'+r[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=convertKeywords(e+="\r\n",!1);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){var i=0;function n(e){var n;for(var a in e)0===a.indexOf("default")&&(n=a.replace("default",t[i]),i++,e[n]=e[a],delete e[a])}if(void 0!==e&&void 0!==t){e.hasOwnProperty("node:OML")||(e["node:OML"]=[]);var a,o=e["node:OML"];o&&"string"==typeof o&&(0===o.indexOf("{{")?e["node:OML"]=OGX.OSE.exec(o):e["node:OML"]=OGX.Cache.read("oml",e["node:OML"]));for(var r=0;r=i.points[t].min&&o{i=!1;for(var r=0;ri.left&&t.lefti.top&&t.topscreen.width&&(e=screen.width),t>screen.height&&(t=screen.height);var i=r.width,a=r.height,o=0,s=0;return p||(i=OGX.Data.getBestSize(e,i),a=OGX.Data.getBestSize(t,a)),r.center?("string"==typeof i&&(i=-1!==i.indexOf("%")?Math.round(e*Number(i.substr(0,i.length-1))/100):Number(i)),"string"==typeof a&&(a=-1!==a.indexOf("%")?Math.round(t*Number(a.substr(0,a.length-1))/100):Number(a)),x=Math.round(e/2-i/2),y=Math.round(t/2-a/2),r.center&&_&&(r.center=!1)):(_?(x=n.x,y=n.y):r.x&&r.y?(-1!==String(r.x).indexOf("%")?(o=i/2,x=e*Number(r.x.slice(0,-1))/100-o):x=r.x,-1!==String(r.y).indexOf("%")?(s=a/2,y=t*Number(r.y.slice(0,-1))/100-s):y=r.y):(x=Math.round(e/2-i/2),y=Math.round(t/2-a/2)),x>e&&(x=e-x),x<-i&&(x=0),y>t&&(y=t-a),y<0&&(y=0)),{x:x,y:y,w:i,h:a}}function M(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&&m&&(d=m),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 h={};switch(f=c+"_"+d,d){case OGX.Popup.SCALE:u[1]=e?"scale(1,1)":"scale("+r.anim_param.scale+", "+r.anim_param.scale+")",h.transform=u.join(" ");break;case OGX.Popup.FADE:h.opacity=e?1:0}e&&(s.css("display","flex"),h.visibility="visible",h.display="flex"),t||e||(h.visibility="hidden",h.display="none"),setTimeout((function(){s.css(h)}),50),t?(m=d,s.on("transitionend",(function(){s.off("transitionend"),e?n.resizeNodes():s.css({display:"none",visibility:"hidden"}),f&&s.removeClass(f),N(i,a,o)})),f&&s.addClass(f)):(s.removeClass(f),N(i,a,o))}else e?s.css({opacity:e,display:"flex",visibility:"visible"}):s.css({display:"none",visibility:"hidden"}),N(i,a,o)}function N(e,t,i){void 0!==e&&e&&e(t),void 0!==i&&i&&i(n.id)}function I(e){e?s.on(n.touch.down,"."+c+"_button",P):s.off(n.touch.down,"."+c+"_button",P)}function P(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 A(){for(var e,t="",i=0;i0&&(e=r.buttons[i].enabled?"":c+"_button_disabled",t+=''+r.buttons[i].label+"");return t}function Y(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&&R(!0),r.buttons&&r.buttons.length&&r.buttons_enabled&&I(!0),debug(5,"popup",r.id,"enabled"),this},this.disable=function(){return this.disableResize(),r.icons&&r.icons.length&&R(!1),r.buttons&&r.buttons.length&&r.buttons_enabled&&I(!1),debug(5,"popup",r.id,"disabled"),this},this.show=function(e,t,i){return M(1,e,t,i),this.focus(1),this},this.hide=function(e,t,i,n,a){return M(0,e,t,i,n,a),this.blur(1),this},this.resize=function(){return G(),this},this.maximize=function(){return r.maximize&&!v&&(v=!0,O={width:r.width,height:r.height,x:this.x,y:this.y},r.width=r.height="100%",G(!1),this.x=this.y=0,this.move(this.x,this.y)),this},this.normalize=function(){return r.maximize&&v&&(v=!1,r.width=O.width,r.height=O.height,G(!1),this.x=O.x,this.y=O.y,O=null,this.move(this.x,this.y)),this},this.width=function(e,t,i){if(void 0===e)return r.width;void 0===i&&(i=!1),void 0===t&&(t=!1),t&&n.el.removeClass("ogx_popup_notrans"),r.width=e,w(["width"],i),X()},this.height=function(e,t,i){if(void 0===e)return r.height;void 0===i&&(i=!1),void 0===t&&(t=!1),t&&n.el.removeClass("ogx_popup_notrans"),r.height=e,w(["height"],i),X()},this.destroy=function(){s.off("transitionend"),this.touch.wipe()},this.buttons=function(e){if(void 0===e)return r.buttons;Y(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+=W()),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+=A(),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:D,cb_up:S,target:"."+c+"_head"};r.group?e.cb_drag=L:"function"==typeof r.drag&&(e.cb_drag=function(e){r.drag(n,e)}),n.touch.add("Drag",e),n.dragable=!0}if(r.resize&&n.setResize({top:!1,cb_resize:b,cb_down:E,cb_up:C}),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,h="mousedown",g="mouseup",p="mousemove",_=(c=!1,!1),m=!1,v={w:0,h:0},y=null;function x(e){c&&(e?d.el.on(h,O):d.el.off(h,O))}function O(e){var u=E(e);n=u.pageX,a=u.pageY;var f=d.el.position();t=f.left,i=f.top;var h=d.el.offset(),g=n-h.left,p=a-h.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&&gd.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(),y&&y.disable(),b(!0),G(!0),c.cb_down&&c.cb_down())}function b(e){e?f||(f=setInterval(w,5)):f&&(clearInterval(f),f=!1)}function w(){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 G(e){e?($("body").on(p,X),$("body").on(g,T)):($("body").off(p,X),$("body").off(g,T))}function X(e){e.preventDefault(),e.stopImmediatePropagation(),e=E(e),o=e.pageX-n,r=e.pageY-a}function T(e){b(!1),G(!1),e=E(e),o=e.pageX-n,r=e.pageY-a,c.cb_up&&c.cb_up(),y&&(x(!1),y.enable(),setTimeout((function(){x(!0)}),0))}function E(e){return e.hasOwnProperty("originalEvent")&&void 0!==e.originalEvent.changedTouches?e.originalEvent.changedTouches[0]:e}this.resizable=!0,this.setResize=function(e){OGX.Data.merge(e,u,!1),c=e},this.enableResize=function(){return x(!0),this},this.disableResize=function(){return x(!1),this},this.destroy=function(){this.touch.wipe()},OGX.Data.merge(c,u,!1),void 0===window.ontouchstart||c.chromeos||(h="touchstart",p="touchmove",g="touchend"),d.hasOwnProperty("dragable")&&d.dragable&&(y=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,callbacks:{change:null}},u={template:!1,html:'{{$label}}',css:!1},f="object",h=0,g=0,p=null,_="ogx_roulette";function m(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 v(e){e?t.on(l.touch.down,"."+_+"_icon",(function(e){e.preventDefault(),e.stopImmediatePropagation(),l.next(!0)})):t.off(l.touch.down,"."+_+"_icon")}function y(e){e?t.on("change","input[type=hidden]",x):t.off("change","input[type=hidden]",x)}function x(e){e.preventDefault(),e.stopImmediatePropagation(),l.loopval(0,OGX.Data.stringToVal(e.target.value),!1)}function O(e){return g+e>d.list.length-1?d.list[0]:g+e<0?d.list[d.list.length-1]:d.list[g+e]}function b(e){a=e.y,X(!0)}function w(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 G(e){X(!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,g!==a){switch(g=a,f){case"string":d.value=d.list[g];break;case"object":d.value=d.list[g][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 X(e){e?r=setInterval(T,10):clearInterval(r)}function T(){var e,t,a;(e=Math.floor((i.position().top+n*o)/(n*d.list.length)*-1))!==h&&(0===i.children("."+_+'_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("."+_+"_stripe").each((function(e,t){a=i.position().top+$(t).position().top,(Math.ceil(a+n*d.list.length)<-n||a>n)&&$(t).remove()})),h=e)}function E(){X(!1),i.off("transitionend",E)}function C(){var e="",a='
';a+='
';for(var o=0;o<2;o++){a+='
';for(var r=0;r'+e+"
"}a+="
"}if(a+="
",d.icon&&(a+='
'),void 0===g&&(g=0),d.name){var l="";switch(d.required&&(l=" required"),f){case"string":a+='";break;case"object":a+='"}}t.html(a),i=t.children("."+_+"_container").children("."+_+"_stripes").first(),s=(s=i.children("."+_+"_stripe:last")).detach();var c=g*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 S(e){switch(f){case"string":return{index:d.list.indexOf(e)};case"object":return d.list.findIndex(d.key,e)}}function L(){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.construct=function(){d.name&&y(!0)},this.enable=function(){return t.removeClass(_+"_disabled"),d.icon&&v(!0),p&&p.enable(),debug(5,"roulette",d.id,"enabled"),this},this.disable=function(){return t.addClass(_+"_disabled"),d.icon&&v(!1),p&&p.disable(),X(!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(C,0),this},this.destroy=function(){d.name&&y(!1),this.touch.wipe()},this.bindRender=function(e,t){},this.onSelect=function(){},this.val=function(e,t){if(void 0!==e){var a=S(e).index;return a>-1&&(!function(e,t){void 0===t&&(t=!0);i.off("transitionend",E),X(!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);X(!0),i.on("transitionend",E),i.css({transition:"all "+f+"ms ease-out",transform:"translate3D(0px, "+u+"px, 0px)"}),g=e}(a),d.name&&m(e,!1)),this}switch(f){case"string":return d.list[g];case"object":return d.list[g][d.key]}},this.item=function(){return d.list[g]},this.loopval=function(e,t,a){var o=g,r=S(t).index;r>-1&&(g=r);var s=o-r,l=d.time_coef*Math.abs(s+e*d.list.length);return X(!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",E),d.name&&m(t,a),void 0!==a&&a&&(this.onSelect(val),this.el.trigger(OGX.Roulette.CHANGE,val)),this},this.next=function(e){var t,i=O(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.onSelect(t),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=O(-1);switch(f){case"string":t=i;break;case"object":t=i[d.key]}return this.val(t),void 0!==e&&e&&(this.onSelect(t),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,L(),g=void 0===t?0:S(t).index,setTimeout(C,0),this},debug(5,"roulette init",d.id),function(){if(OGX.Data.merge(d,c),d.callbacks.change||(d.callbacks.change=l.onChange),L(),d.display?d.display=new OGX.Display(d.display):d.display=new OGX.Display(u),(t=l.el=$(d.el)).addClass(_),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)),g=S(d.value).index}}(),l.observeOnce({childList:!0},(function(){p=l.touch.add("Swipe",{x:!1,y:!0,cb_down:b,cb_swipe:w,cb_up:G,state:"manual",target:".ogx_roulette_container",capture:d.capture}),d.enabled&&p.enable()}),null),C(),debug(5,"roulette",d.id,"init")},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.enable():t>0&&s[t].roulette.disable()}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(g(i),t),i.push(t)));setTimeout(d,0)}function g(e){for(var t=o.data,i=0;i-1?f(n):{};h(e)},o=OGX.Data.merge(o,r),(t=a.el).addClass("ogx_roulette_tree"),a.observeOnce({childList:!0},(function(){setTimeout((()=>{o.value?h(o.value):d()}),10)})),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,enabled:!1,required:o.required}),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,h=e,g={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"),C(!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),C(!1),L("out")}function T(e){e?(window.addEventListener("resize",N),i.on("scroll",(function(e){e.stopImmediatePropagation(),E()})),i.on("wheel",(function(e){C(!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"),h.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)),h.scroll_callback&&h.scroll_callback()}function C(e){e?(d&&C(!1),l=t.position().top,d=setInterval(D,h.check_delay-10)):(d&&(clearInterval(d),d=null),v=!1,f.el.trigger(OGX.Scroller.END))}function D(){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,h.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")}),h.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(),h.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),h.observe&&setTimeout((function(){k(!0)}),0),x(!0),debug(5,"scroller",h.id,"enabled"),this},this.disable=function(){return T(!1),h.observe&&k(!1),G(!1),b(!1),x(!1),C(!1),S(!1),o.removeClass("ogx_scroller_track_anim_fade_in"),o.removeClass("ogx_scroller_track_anim_fade_out"),debug(5,"scroller",h.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(h,g),function(){f.el=$(h.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",h.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 h(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[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){h(!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,h(!0)})):(c=e,h(!0)),n=i.width(),i.css("transform","translateX("+e*Math.round(n/d.length)*-1+"px)")}this.enable=function(){return h(!0),p(!0),debug(5,"stackedtree",s.id,"enabled"),this},this.disable=function(){return h(!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,callbacks:{change:null}},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),i.onChange(n.value),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.construct=function(){n.name&&c(!0)},this.enable=function(){return l(!0),t.removeClass(o+"_disabled"),debug(5,"switch",n.id,"enabled"),this},this.disable=function(){return l(!1),t.addClass(o+"_disabled"),debug(5,"switch",n.id,"disabled"),this},this.destroy=function(){n.name&&c(!1)},this.bindRender=function(e,t){},this.val=function(e,i){return void 0===i&&(i=!0),void 0!==e&&n.value!==e&&(r(),i&&t.children("."+o+"_val").first().trigger("input")),n.value},this.onChange=function(){},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:-4,reorder:!0,icons:!1,index:0,list:new OGX.List,display:{html:"",css:""},callbacks:{select:null,close:null,add:null,remove:null}},o=!1,r=0,s=!1,l=!1,d=!1,c=!1,u=!1,f={x:0,y:0},h="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(h+"_editable")),t.html(a),o=t.children("."+h+"_container").children("."+h+"_tab:eq("+r+")")}function p(e){s||(u=!1,l=$(e),d={from:l.index()},t.children("."+h+"_container").children("."+h+"_tab_active").first().removeClass(h+"_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(h+"_tab_active").addClass(h+"_frozen"),o=l,s.el.addClass(h+"_tab_active").addClass(h+"_float").css("transform","translate3d("+f.x+"px, "+s.y+"px, 0px)"),t.children("."+h+"_container").prepend(s.el),c=setInterval(m,5))}function _(e){if(s)if(u=e,Math.abs(u.distX)>Math.abs(u.distY)){var a=s.x+u.distX;s.el.css("transform","translate3d("+a+"px, "+s.y+"px, 0px)")}else{var o=s.y+u.distY;s.el.css("transform","translate3d("+s.x+"px, "+o+"px, 0px)");var r=s.el.offset();if(u.distYMath.abs(u.distY)&&t.children("."+h+"_container").children("."+h+"_tab").each((function(t,a){(e=$(a)).hasClass(h+"_tab_active")||(i=e.position(),n=e.width(),idx!==t&&(s.x+u.distX>i.left+n/2&&s.x+u.distXi.left&&s.x+u.distXe&&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("."+h+"_container").first().children("."+h+"_tab:eq("+e+")").remove(),o=null,function(){r>0?r--:r=0;i.index(r)}()),this},this.enableTab=function(e){return t.children("."+h+"_container").first().children("."+h+"_tab:eq("+e+")").removeClass(h+"_tab_disabled"),this},this.disableTab=function(e){return t.children("."+h+"_container").first().children("."+h+"_tab:eq("+e+")").addClass(h+"_tab_disabled"),this},this.index=function(e){return void 0!==e?(o&&(o.removeClass(h+"_tab_active"),o=null),(o=t.children("."+h+"_container").first().children("."+h+"_tab:eq("+e+")")).addClass(h+"_tab_active"),r=e,!0):o?r:-1},this.select=function(e){o&&o.removeClass(h+"_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)),n.callbacks.select||(n.callbacks.select=i.onSelect),n.callbacks.close||(n.callbacks.close=i.onClose),n.callbacks.add||(n.callbacks.add=i.onAdd),n.callbacks.remove||(n.callbacks.remove=i.onRemove),(t=i.el).addClass(h),n.editable&&t.addClass(h+"_editable"),r=n.index,setTimeout(g,0),n.reorder&&i.touch.add("Hold",{id:"tabs_hold",cb_hold:p,cb_move:_,cb_up:v,state:"manual",time:1e3,target:".ogx_tabs_tab",capture:!1})):debug(1,"OGX.List not found! ")},OGX.Tabs.SELECT="TabsSelect",OGX.Tabs.CLOSE="TabsClose",OGX.Tabs.REORDER="TabsReorder",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_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",callbacks:{select:null,add:null,remove:null}},container,input,sliced={org:[],rem:[]},config=OGX.Data.merge(__config,config_default,!1);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),that.onAdd(e),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)}config.callbacks.select(t),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());that.onRemove(t),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(){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))),config.callbacks.select||(config.callbacks.select=that.onSelect),config.callbacks.add||(config.callbacks.add=that.onAdd),config.callbacks.remove||(config.callbacks.remove=that.onRemove),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.onSelect=function(){},this.onAdd=function(){},this.onRemove=function(){},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,require("Template"),OGX.Template=function(e){construct(this,"Template");var t=new OGX.Display(e),i=t.html(e.data),n=t.css(e.data);i&&this.el.html(i),n&&this.el.addClass("css")},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 h(){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?(h(),$(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(){!h&&a&&(h=!0,v(!0))},this.disable=function(){h&&(h=!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},h=null;function g(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),h=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(h,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,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,_))}},OGX.Touches.Drag=function(e){"use strict";var t,i,n,a,o,r,s=!1,l={min:10,x:!0,y:!0,limit_x:null,limit_y:null,target:!1,cb_down:!1,cb_drag:!1,cb_up:!1,border:10,capture:!1,state:"auto"},d=e,c=!1,u=!1;function f(e){var t=[];t=s.target?[d.touch.down,s.target,h]:[d.touch.down,h],e?d.el.on.apply(d.el,t):d.el.off.apply(d.el,t)}function h(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,h=a-u.top;if(s.border){if(fd.el.width()-s.border)return;if(hd.el.height()-s.border)return}o=0,r=0,g(!0),p(!0),s.cb_down&&s.cb_down()}function g(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){g(!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),g(!1))}},OGX.Touches.Move=function(e){"use strict";var t,i,n,a,o,r,s,l,d=!1,c={min:0,x:!0,y:!0,limit_x:null,limit_y:null,target:null,cb_down:null,cb_move:null,cb_up:null,cb_click:null,capture:!1,state:"auto"},u=e,f=!1;function h(e){var t=[];t=d.target?[u.touch.down,d.target,g]:[u.touch.down,g],e?u.el.on.apply(u.el,t):u.el.off.apply(u.el,t)}function g(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,h(!0))},this.disable=function(){f&&(f=!1,h(!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,h={show_root:!0,root_label:"root",editable:!1,sort:{enabled:!0,property:"label",way:1},type:"type",toggle:!0,drag_after:1e3,key:null,scope:["public"],chromeos:!1,types:{root:{mode:"folder",display:{html:u}},file:{mode:"file",display:{html:u}},folder:{mode:"folder",display:{html:u}}},data:{id:0,type:"root",state:"closed",label:null,items:[]},display:null,callbacks:{select:null,unselect:null,open:null,close:null,move:null}},g="_id";function p(e,t,i,n,a){return e[g]===a[g]&&t}function _(e,t){var i={container_display:"",container_css:"",arrow_display:"",arrow_style:"ogx_tree_item_arrow_open",state:"open",type:t.type};return i[g]=t[g],OGX.Data.merge(i,e,!0),OGX.Templater.make('
',i)}function m(){f.data&&"root"===f.data.type&&f.data.hasOwnProperty("label")&&(f.root_label=f.data.label);var e={type:"root",label:f.root_label};e[g]="root";var i=_({},e);t.html(i),f.data.element=t.children(".ogx_tree_item").first(),f.data.uxi=c,O(e,c),f.show_root||f.data.element.addClass("ogx_tree_root_hidden")}function v(){m(),y(f.data,c)}function y(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 b(e){var t={};return OGX.Data.merge(t,e),delete t.element,delete t.parent,d||delete t[g],t}function w(e){"folder"===L(e).mode&&(e.items.length?e.element.attr("data-empty",!1):(e.element.attr("data-state","closed").attr("data-compound",e.type+"-closed").attr("data-empty",!0),e.element.children(".ogx_tree_item_arrow").addClass("ogx_tree_item_arrow_disabled")),"open"===e.state?(e.element.attr("data-state","open").attr("data-compound",e.type+"-open"),e.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_close").removeClass("ogx_tree_item_arrow_disabled").addClass("ogx_tree_item_arrow_open"),e.element.children(".ogx_tree_item_container").removeClass("ogx_tree_item_container_hidden")):(e.element.attr("data-state","open").attr("data-compound",e.type+"-closed"),e.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_open").addClass("ogx_tree_item_arrow_close"),e.element.children(".ogx_tree_item_container").addClass("ogx_tree_item_container_hidden")))}function G(){if(s){var e=C(s);e&&e.children(".ogx_tree_item_content").removeClass("ogx_tree_selected_item"),s=null}}function X(e){var t=C(e);t&&(s=e,t.children(".ogx_tree_item_content").addClass("ogx_tree_selected_item"))}function T(e,t){return S((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",w(i),!0)}))}function E(e){if("root"===e)return f.data;return S((function(t,i){return t[g]===e&&t}))}function C(e){var t=E(e);return!!t&&t.element}function D(){l=1,S((function(e){return e[g]=l++,e.hasOwnProperty("type")||(e.hasOwnProperty("items")?e.type="folder":e.type="file"),!1}))}function S(e,t,i){var n;if(void 0===t&&(t=null),void 0===i&&(i=f.data),n=function i(a,o,r,s){if(n=e(a,o,r,s,t))return n;if(a.hasOwnProperty("items")&&a.items.length)for(var l=0;l .ogx_tree_item_content",(function(e){e.preventDefault(),k($(this).parent(0)),1!==$(this).parent(0).data("id")&&function(){o&&clearInterval(o);r=(new Date).getTime(),o=setInterval(N,50)}()})),$(document).on(c.touch.up,(function(){P(),n&&(I(!1),function(){var e=n.offset().left,o=n.offset().top,r=(l=e,d=o,S((function(e,t){return u=e.element.offset(),f=e.element.children(".ogx_tree_item_content").children(".ogx_tree_item_icon"),l>=u.left&&l<=u.left+f.width()&&d>=u.top&&d<=u.top+f.height()&&e}))),s=L(r);var l,d,u,f;!r||r&&(r[g]===i[g]||"folder"!==s.mode)?(a.css("opacity",1),n.remove(),n=null,i=null):(p=r,function(e){S((function(t,i,n,a){return t[g]===e&&(n.items.splice(a,1),n.items.length||(n.state="closed"),w(n),!0)}))}((h=i)[g]),T(h,p[g]),p.element.children(".ogx_tree_item_container").empty(),p.state="open",y(p,p.element),w(p),a.remove(),n.remove(),n=null,c.onMove(i),t.trigger(OGX.Tree.DROP,i),i=null);var h,p}())}))):t.on("click",".ogx_tree_item > .ogx_tree_item_content",(function(e){k($(this).parent(0))})),t.on(c.touch.down,".ogx_tree_item_arrow",(function(e){e.preventDefault(),P();var i=E($(this).parent(0).data("id"));i&&i.hasOwnProperty("items")&&i.items.length&&("open"===i.state?(c.onClose(i),t.trigger(OGX.Tree.CLOSE,i)):(c.onOpen(i),t.trigger(OGX.Tree.OPEN,i)),"open"===i.state?i.state="closed":i.state="open",w(i))}))):(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 N(){var e;(new Date).getTime()-r>=f.drag_after&&(s&&(i=E(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)),P())}function I(e){e?$(document).on(c.touch.move,(function(e){e=function(e){if(e.hasOwnProperty("originalEvent")&&void 0!==e.originalEvent.changedTouches)return e.originalEvent.changedTouches[0];return e}(e),n.css({top:e.pageY+"px",left:e.pageX+"px"})})):$(document).off(c.touch.move)}function P(){o&&(clearInterval(o),o=null)}this.enable=function(){return M(!0),debug(5,"tree",f.id,"enabled"),this},this.disable=function(){return M(!1),debug(5,"tree",f.id,"disabled"),this},this.onSelect=function(){},this.onUnselect=function(){},this.onOpen=function(){},this.onClose=function(){},this.onMove=function(){},this.addItem=function(e,t){if(void 0===t&&(t=s),t){var i=E(t);if("folder"===L(i).mode){d||(e[g]=++l),T(e,t);var n=L(e);x(i.uxi,i.element.children(".ogx_tree_item_container").first(),e),O(e,i.parent);var a=i.uxi;return n.display.hasOML()&&(a=i.uxi.nodes.last()),y(e,a),i.element.data("state","open"),i.element.data("compound",e.type+"-close"),i.element.children(".ogx_tree_item_container").removeClass("ogx_tree_item_container_hidden"),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=E(e);return!!t&&b(t)},this.selectItem=function(e){X(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 S(i)}(e,t);return!!i&&(G(),X(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 S(t)}(e);if(t)return t.element;return!1}(e);return!!t&&(G(),t.children(".ogx_tree_item_content").addClass("ogx_tree_selected_item"),s=t.data("id"),!0)},this.updateItem=function(e,t){var i=E(e);if(i){if(i.uxi){var n=i.uxi.el;i.uxi.kill(),n.empty()}OGX.Data.merge(i,t,!0),O(i,i.parent),i.hasOwnProperty("items")&&i.items.length&&(y(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.attr("state","open").attr("state",i.type+"-open"))}},this.replaceItem=function(e){var t=E(e[g]);t&&(t.uxi&&t.uxi.kill(),OGX.Data.merge(e,t,!1),O(t,t.parent),t.hasOwnProperty("items")&&t.items.length&&y(t,t.parent))},this.deleteItem=function(e){var t=E(e);if(t){var i=function(e){function t(t){return!(!t.hasOwnProperty("items")||!t.items.get({_id:{eq:e}},null,1))&&t}return S(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),w(i),!0}if(s)return S(e);return!1}()},this.getSelectedItem=function(){return function(){if(s)return E(s);return!1}()},this.getTree=function(){var e=S(b,null,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.scroll?this.clear([this.scroller.id]):this.clear(),f.data=e,f.data.hasOwnProperty("state")||(f.data.state="open"),d||D(),v()},this.newTree=function(){c.scroll?c.clear([c.scroller.id]):c.clear();l=1,m()},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(e){return void 0===e&&(e=!1),e&&this.resizeNodes(),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.parents(".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+'"]').first(),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.selector=t,this.wake(t),setTimeout((()=>this.resize),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","Template","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},(i=t.el).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&&this.touch.drag.enable(),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&&this.touch.drag.disable(),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(){listenScroll(!1),this.touch.wipe()},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,void 0===OGX)var OGX={};OGX.Workers=function(){"use strict";var e=0,t=new OGX.List;this.add=function(i,n,a){void 0===n&&(n=++e);var o=function(e,t){var i;if(void 0===t&&(t=!1),"string"==typeof e)i=new Worker(e);else{var n="";if(t){for(var a=0;a1&&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(__prop,__as_object,__new_props){void 0===__as_object&&(__as_object=!0),void 0===__new_props?__new_props=[__prop]:Array.isArray(__new_props)||(__new_props=[__new_props]);var q={};q[__prop]={regex:/(.){1,}/};for(var l=this.get(),ar=[],final=new OGX.List,o,ev,i=0;i=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,k=!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":(P=O(c,e[G]))&&d(P,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,k=!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||(k?s.push({object:x,data:[n,i]}):x.construct.apply(x,[n,i])))),x&&!k&&(w||X)&&(t.blured||x.floating||x.focus()),void 0!==x&&x&&!k&&(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 w(e){i.children(".ogx_calendar_head").children(".ogx_calendar_head_labels").html(e)}function G(e,t,i,n){if(t.y-1>=0&&t.y-1
'),C(),X(),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}),b(),w(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(e){"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 e.hasOwnProperty("format")?e.format:"YYYY-MM"}},OGX.CalendarLayout.MONTH_DAYS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM"),!e.hasOwnProperty("labels")&&(e.labels="ddd"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){var i="",n=Number(t.format("d")),a=t.clone();n&&a.subtract(n,"day");for(var o=0;o<7;o++)i+=''+a.format(e.labels)+"",a.add(1,"day");return i},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<35;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"}}},OGX.CalendarLayout.CENTURY_DECADES=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY"),!e.hasOwnProperty("labels")&&(e.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+(e.labels?t.format(e.labels):100*Math.floor(Number(t.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"}}},OGX.CalendarLayout.CENTURY_YEARS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+(e.labels?t.format(e.labels):100*Math.floor(Number(t.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"}}},OGX.CalendarLayout.DECADE_YEARS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+(e.labels?t.format(e.labels):10*Math.floor(Number(t.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"}}},OGX.CalendarLayout.DECADE_MONTHS=function(e){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(e){for(var t=10*Math.floor(Number(e.format("YYYY"))/10),i=Number(String(t).substr(2,2)),n="",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(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels="[Months]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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"}}},OGX.CalendarLayout.YEAR_WEEKS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels="[Weeks]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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"}}},OGX.CalendarLayout.YEAR_DAYS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels="[Nth Day]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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"}}},OGX.CalendarLayout.MONTH_WEEKS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="[(]YYYY-MM[)] W"),!e.hasOwnProperty("labels")&&(e.labels="[Nth Week]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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"}}},OGX.CalendarLayout.WEEK_DAYS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM (wo [week])"),!e.hasOwnProperty("labels")&&(e.labels="ddd DD"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){var i="",n=Number(t.format("d")),a=t.clone();n&&a.subtract(n,"day");for(var o=0;o<7;o++)i+=''+a.format(e.labels)+"",a.add(1,"day");return i},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"}}},OGX.CalendarLayout.DAY_HOURS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM-DD HH:[00]"),!e.hasOwnProperty("labels")&&(e.labels="[Hours]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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"}}},OGX.CalendarLayout.DAY_WORK_HOURS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM-DD HH:[00]"),!e.hasOwnProperty("labels")&&(e.labels="[Work Hours]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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"}}},OGX.CalendarLayout.DAY=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM-DD"),!e.hasOwnProperty("labels")&&(e.labels="dddd DD"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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.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,callbacks:{change:null}},d={position:"bottom"},u=!1,h=0,f=0,g=new OGX.List,p="ogx_carousel";function _(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(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="'+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),l.dots&&o.bind("dots",s)},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("."+p+"_view").css("width",100/f+"%"),++h-1}(),c="."+p+'[data-ogx-id="'+this.id+'"] > .'+p+"_views > ."+p+'_view[data-ogx-panel-id="'+l+'"]',d={},u=c;if(e.hasOwnProperty("_NAME_"))e.detach(),e.attach(this,c),a&&this.showPanel(f-1,o);else{for(var g in e){u+=":"+g.split(":")[1],d[u]=e[g];break}var _=null;setTimeout((function(){s.observe(!0,{childList:!0,subtree:!0},(function(){s.observe(!1),_&&clearTimeout(_),_=setTimeout(G,20),a&&(s.showPanel(f-1,o),r?r():t.trigger(OGX.Carousel.ADDED,f))})),OGX.OML.render(s,d,n)}),0)}return 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/f*(-1*n);return i.removeClass(p+"_anim"),i.css({transform:"translate3d("+o+"%, 0, 0)"}),r=n,setTimeout(G,0),s.onChange(r),t.trigger(OGX.Carousel.CHANGE,r),this},this.removePanel=function(e,n){if(void 0===n&&(n=!0),e>=0&&e=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(p+"_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},this.destroy=function(){this.touch.wipe()},OGX.Data.merge(l,c,!1),l.callbacks.change||(l.callbacks.change=s.onChange),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(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/f*(-1*r)+"%, 0, 0)"})}(),l.dots&&(o=s.create("Dots",{el:"."+p+'[data-ogx-id="'+s.id+'"] > .carousel_dots',total:f})),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.CHANGE="CarouselChange",OGX.Carousel.ADDED="CarouselAdded",OGX.Carousel.REMOVED="CarouselRemoved",OGX.Color={},OGX.Color.hexToRgb=function(e){"use strict";e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,i,n){return t+t+i+i+n+n}));var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:null},OGX.Color.rgbToHex=function(e,t,i){"use strict";var n,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);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,i.x,i.y),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)}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.onSelect=function(){},this.destroy=function(){!function(){for(var e in o)r(e)}()},OGX.Data.merge(n,a),n.callbacks.select||(n.callbacks.select=i.onSelect),(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},callbacks:{select:null,unselect:null},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)),config.callbacks.select||(config.callbacks.select=that.onSelect),config.callbacks.unselect||(config.callbacks.unselect=that.onUnselect),(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!==key_default||(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.onSelect=function(e){},this.onUnselect=function(e){},this.getFilteredList=function(){if(isFiltered){if(!config.key){var e=JSON.parse(JSON.stringify(filtered));return clearIds(OGX.List(e))}return filtered}return!1},this.display=function(e){return void 0===e?config.display:display.val(e)},this.key=function(e){if(void 0===e)return e;config.key=e,config.key||(key=key_default)},this.mode=function(e){return void 0===e?config.mode:(config.mode!==e&&(config.mode===OGX.DynamicList.STATIC?this.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.Form.fromObject=function(e,t,i,n){var a={el:t.selector+" "+i,data:e,fullpath:!1};return OGX.Data.merge(a,n,!1),t.create("FormInstance",a)},require("FormInstance","Uxi","Placeholder"),OGX.FormInstance=function(__config){construct(this,"FormInstance");var that=this,config_defaults={fullpath:!1},config=OGX.Data.merge(__config,OGX.Form.defaults,!1,!0);function render(){var html="",oml='{"default:Html":{"html": {{$html}}, "node:OML": {{$oml}} }}',render_oml=!1,row,nodes=[];function cycle(__o,__path){for(var a in __o){var t=typeof __o[a],p;switch(p=__path?__path+"."+a:a,t){case"object":if(Array.isArray(__o[a]))if(["string","number","boolean"].includes(typeof __o[a][0]))row=genRow("array",a,JSON.stringify(__o[a])),html+=row.html,row.oml&&(nodes.push(row.oml),render_oml=!0);else for(var i=0;i<__o[a].length;i++)cycle(__o[a][i],__path?__path+"."+a+"["+i+"]":a+"["+i+"]");else cycle(__o[a],__path?__path+"."+a:a);break;case"string":case"number":case"boolean":var pattern="",required=!1,readonly=!1,oo;if(config.hasOwnProperty("fields")){try{oo=eval("config.fields."+p)}catch(e){}void 0!==oo&&(oo.hasOwnProperty("pattern")&&(pattern=oo.pattern),oo.hasOwnProperty("required")&&(required=oo.required),oo.hasOwnProperty("readonly")&&(readonly=oo.readonly))}row=genRow(t,p,__o[a],required,pattern,readonly),html+=row.html,row.oml&&(nodes.push(row.oml),render_oml=!0)}}}cycle(config.data,null),html=OGX.Templater.make(OGX.Form.defaults.templates.form,{rows:html}),oml=render_oml?nodes.join(","):null,oml=JSON.parse(oml),oml=OGX.OML.rename(oml,that.selector),that.el.html(html),oml&&OGX.OML.render(that,oml)}function genRow(e,t,i,n,a,o){var r={html:"",oml:null},s=config.types[e],l="",c="",d="";void 0!==n&&n&&(l="required",c='pattern="'+a+'"'),void 0!==o&&o&&(d="readonly");var u=t;return config.fullpath||(u=t.split(".").pop()),r.html=OGX.Templater.make(s.html,{name:u,prop:t,val:i,required:l,pattern:c,readonly:d}),r.html=OGX.Templater.make(OGX.Form.defaults.templates.row,{html:r.html,name:u,prop:t}),s.hasOwnProperty("oml")&&(r.oml=OGX.Templater.make(s.oml,{name:u,prop:t,val:i,required:l,pattern:c,readonly:d})),r}function init(){that.el.addClass("ogx_form"),render(),setTimeout((function(){OGX.Form.bindForm({el:that.selector+">form",change_cb:that.onChange,submit_cb:that.onSubmit})}),300)}OGX.Data.merge(config,config_defaults,!1),this.construct=function(){},this.enable=function(){},this.disable=function(){},this.ux=function(e){},this.destroy=function(){OGX.Form.unbindForm(that.selector)},this.onChange=function(e){},this.onSubmit=function(e){},init()},OGX.Form.defaults={templates:{form:"
{{$rows}}
",row:'{{$name}}{{$html}}'},types:{boolean:{html:'',oml:'{"default .{{$name}}:Switch":{"name" : "{{$prop}}", "val":{{$val}}, "editable" : {{!$readonly}} } }'},string:{html:''},number:{html:''},array:{html:'',oml:'{"default .{{$name}}:Tags":{"name" : "{{$prop}}", "editable" : {{!$readonly}}, "current_tags":{{$val}} } }'}}},OGX.Geo=function(e){"use strict";var t=this;void 0===e&&(e={});var i,n,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,p={map:[[!0,!0,!0],[!0,!0,!0],[!0,!0,!0]],axis:{x:!0,y:!0},loop:!0,start:!1,chromeos:!1,capture:!1,callbacks:{up:null,down:null,left:null,right:null}},_=!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,C):t.off(f.touch.down,C)}function C(e){_=!1,o=0,r=0,s=0,l=0,e=A(e),m.x=e.pageX,m.y=e.pageY,x=!0,L(!0)}function E(e){e?$("body").on(f.touch.up,D):$("body").off(f.touch.up,D)}function D(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=P(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(f.touch.move,k)):(M(!1),t.off(f.touch.move,k))}function k(e){e=A(e),g.capture&&(e.preventDefault(),e.stopImmediatePropagation()),o=0,r=0,s=0,l=0,_||(g.axis.x&&Math.abs(e.pageX-m.x)>Math.abs(e.pageY-m.y)?_="x":g.axis.y&&Math.abs(e.pageX-m.x)0?1:-1):g.axis.y&&"y"===_&&(r=Math.abs(e.pageY-m.y),l=e.pageY-m.y>0?1:-1))}function M(e){e?h||(O=!1,h=setInterval(N,10)):h&&(clearInterval(h),h=null)}function N(){if((o||r)&&(O||t.trigger(OGX.GridSwiper.SWIPE_START),O=!0),g.axis.x&&"x"===_&&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"===_&&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 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=P(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=Y(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),f.onLeft({cell:w,point:b}),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}]),H()):(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),f.onRight({cell:w,point:b}),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}]),H())):b.y!==e.y&&(l=b.y>e.y?1:-1,b.y=e.y,w.y=Y(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),f.onUp({cell:w,point:b}),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}]),H()):(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),f.onDown({cell:w,point:b}),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}]),H())),_=0}))):i.off("transitionend")}function P(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 A(e){return e.hasOwnProperty("originalEvent")&&void 0!==e.originalEvent.changedTouches?e.originalEvent.changedTouches[0]:e}function Y(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=Y(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=Y(e[n]).x}else i.x=e[n].x;t=g.map[i.y][i.x],W(e[n],t),f.onRender(i)}}function W(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,Y(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=Y(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:Y(e)}),H()}}function H(){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),E(!0),H(),this},this.disable=function(){return T(!1),E(!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.onUp=function(){},this.onDown=function(){},this.onLeft=function(){},this.onRight=function(){},this.onRender=function(){},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},U(),F(),z(),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,r,s=this,l={left:0,right:0,top:0,bottom:0,min:50,drag:!0,flatten:!1,capture:!0,"node:OML":{},callbacks:{up:null,down:null,left:null,right:null,restore:null}},c=e,d=!1,u="normal",h="main",f={left:null,main:null,right:null,top:null,bottom:null},g=[0,0,0],p=0,_=0,m=0,v=0;function y(e){for(var t in f)f[t]&&f[t].instance&&(e===t?f[t].instance.focus():f[t].instance.blur())}function x(){d.hasClass("ogx_iceberg_anim")||(d.off("transitionend"),g=G(d))}function O(e){var t=0;return e.dirY&&e.distY>e.distX&&(t=1),t}function b(e){c.drag&&e.dist&&(!(n=O(e))&&["main","left","right"].includes(h)?e.dirX&&e.distX&&(t=g[0]+e.distX*e.dirX)<=_&&t>=p&&d.css({transform:"translate3d("+t+"px, 0, 0)"}):["main","top","bottom"].includes(h)&&e.dirY&&e.distY&&(i=g[1]+e.distY*e.dirY)<=v&&i>=m&&d.css({transform:"translate3d(0, "+i+"px, 0)"}))}function w(e){if(t=0,i=0,n=O(e),e.swipe&&e.dist){var r;switch(e.swipe=!1,h){case"main":-1===e.dirX&&c.right&&!n?(t=-f.right.outerWidth(),r="right",e.swipe=!0):1===e.dirX&&c.left&&!n?(t=f.left.outerWidth(),r="left",e.swipe=!0):1===e.dirY&&c.top&&n?(i=f.top.outerHeight(),r="top",e.swipe=!0):-1===e.dirY&&c.bottom&&n&&(i=-f.bottom.outerHeight(),r="bottom",e.swipe=!0);break;case"left":-1!==e.dirX||n||(t=0,r="main",e.swipe=!0);break;case"right":1!==e.dirX||n||(t=0,r="main",e.swipe=!0);break;case"top":-1===e.dirY&&n&&(i=0,r="main",e.swipe=!0);break;case"bottom":1===e.dirY&&n&&(i=0,r="main",e.swipe=!0)}n?1===e.dirY?(a=OGX.Iceberg.SWIPE_DOWN,o="down"):(a=OGX.Iceberg.SWIPE_UP,o="up"):1===e.dirX?(a=OGX.Iceberg.SWIPE_RIGHT,o="right"):(a=OGX.Iceberg.SWIPE_LEFT,o="left"),e.swipe&&e.dist&&(d.addClass("ogx_iceberg_anim"),d.on("transitionend",(function(){d.off("transitionend"),d.removeClass("ogx_iceberg_anim"),g=G(d),y(h=r),c.callbacks[o](h),d.trigger(a,h)})),d.css({transform:"translate3d("+t+"px, "+i+"px, 0)"}))}else if(e.dist){switch(t=0,i=0,h){case"left":t=f.left.outerWidth();break;case"right":t=-f.right.outerWidth();break;case"top":i=f.top.outerHeight();break;case"bottom":i=-f.bottom.outerHeight()}d.addClass("ogx_iceberg_anim"),d.on("transitionend",(function(){d.off("transitionend"),d.removeClass("ogx_iceberg_anim"),g=G(d),c.callbacks.onRestore(h),d.trigger(OGX.Iceberg.RESTORE,h)})),d.css({transform:"translate3d("+t+"px, "+i+"px, 0)"})}}function G(e){var t=e[0].style.transform;if(t=t.match(/translate3d\(([0-9px%,\.\- ]+)\)/)){t=t[1].split(",");for(var i=0;i=c.flatten?(u="flattened",g=G(d),d.addClass("ogx_iceberg_views_flattened").css("transform","translate3d(0px, 0px, 0px)"),d.children(".ogx_iceberg_view").addClass("ogx_iceberg_view_flattened"),this.disable()):"flattened"===u&&this.el.width() .ogx_iceberg_views > .ogx_iceberg_view[data-ogx-panel-id="';for(var o in c["node:OML"])for(var r in c["node:OML"][o])0===r.indexOf("left")&&(i+='
',n.left=a+'left"]',f.left=!0),0===r.indexOf("top")&&(i+='
',n.top=a+'top"]',f.top=!0),0===r.indexOf("main")&&(i+='
',n.main=a+'main"]'),0===r.indexOf("right")&&(i+='
',n.right=a+'right"]',f.right=!0),0===r.indexOf("bottom")&&(i+='
',n.bottom=a+'bottom"]',f.bottom=!0);for(s.el.html(i),o=0;ot.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,callbacks:{open:null,close:null}},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 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"),a=!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),a=!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 o=g.find("id",i,1);a?(!function(e){var t=v(e);if(t)return t.focus(),!0}(o),n.onOpen(o),t.trigger(OGX.NestList.OPEN,o)):(!function(e){var t=v(e);if(t)return t.blur(),!0}(o),n.onClose(o),t.trigger(OGX.NestList.CLOSE,o)),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=/method *([a-zA-Z0-9_\-]+) ([a-zA-Z0-9_\-]+):([a-zA-Z0-9_\-]+)/gi.exec(e))&&(s='OGX.Object.get({_NAME_:{eq:"'+r[3]+'"}, id:{eq:"'+r[2]+'"}}, null, 1).'+r[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=convertKeywords(e+="\r\n",!1);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){var i=0;function n(e){var n;for(var a in e)0===a.indexOf("default")&&(n=a.replace("default",t[i]),i++,e[n]=e[a],delete e[a])}if(void 0!==e&&void 0!==t){e.hasOwnProperty("node:OML")||(e["node:OML"]=[]);var a,o=e["node:OML"];o&&"string"==typeof o&&(0===o.indexOf("{{")?e["node:OML"]=OGX.OSE.exec(o):e["node:OML"]=OGX.Cache.read("oml",e["node:OML"]));for(var r=0;r=i.points[t].min&&o{i=!1;for(var r=0;ri.left&&t.lefti.top&&t.topscreen.width&&(e=screen.width),t>screen.height&&(t=screen.height);var i=r.width,a=r.height,o=0,s=0;return p||(i=OGX.Data.getBestSize(e,i),a=OGX.Data.getBestSize(t,a)),r.center?("string"==typeof i&&(i=-1!==i.indexOf("%")?Math.round(e*Number(i.substr(0,i.length-1))/100):Number(i)),"string"==typeof a&&(a=-1!==a.indexOf("%")?Math.round(t*Number(a.substr(0,a.length-1))/100):Number(a)),x=Math.round(e/2-i/2),y=Math.round(t/2-a/2),r.center&&_&&(r.center=!1)):(_?(x=n.x,y=n.y):r.x&&r.y?(-1!==String(r.x).indexOf("%")?(o=i/2,x=e*Number(r.x.slice(0,-1))/100-o):x=r.x,-1!==String(r.y).indexOf("%")?(s=a/2,y=t*Number(r.y.slice(0,-1))/100-s):y=r.y):(x=Math.round(e/2-i/2),y=Math.round(t/2-a/2)),x>e&&(x=e-x),x<-i&&(x=0),y>t&&(y=t-a),y<0&&(y=0)),{x:x,y:y,w:i,h:a}}function M(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&&m&&(c=m),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?(m=c,s.on("transitionend",(function(){s.off("transitionend"),e?n.resizeNodes():s.css({display:"none",visibility:"hidden"}),h&&s.removeClass(h),N(i,a,o)})),h&&s.addClass(h)):(s.removeClass(h),N(i,a,o))}else e?s.css({opacity:e,display:"flex",visibility:"visible"}):s.css({display:"none",visibility:"hidden"}),N(i,a,o)}function N(e,t,i){void 0!==e&&e&&e(t),void 0!==i&&i&&i(n.id)}function I(e){e?s.on(n.touch.down,"."+d+"_button",P):s.off(n.touch.down,"."+d+"_button",P)}function P(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 A(){for(var e,t="",i=0;i0&&(e=r.buttons[i].enabled?"":d+"_button_disabled",t+=''+r.buttons[i].label+"");return t}function Y(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&&R(!0),r.buttons&&r.buttons.length&&r.buttons_enabled&&I(!0),this},this.disable=function(){return this.disableResize(),r.icons&&r.icons.length&&R(!1),r.buttons&&r.buttons.length&&r.buttons_enabled&&I(!1),this},this.show=function(e,t,i){return M(1,e,t,i),this.focus(1),this},this.hide=function(e,t,i,n,a){return M(0,e,t,i,n,a),this.blur(1),this},this.resize=function(){return G(),this},this.maximize=function(){return r.maximize&&!v&&(v=!0,O={width:r.width,height:r.height,x:this.x,y:this.y},r.width=r.height="100%",G(!1),this.x=this.y=0,this.move(this.x,this.y)),this},this.normalize=function(){return r.maximize&&v&&(v=!1,r.width=O.width,r.height=O.height,G(!1),this.x=O.x,this.y=O.y,O=null,this.move(this.x,this.y)),this},this.width=function(e,t,i){if(void 0===e)return r.width;void 0===i&&(i=!1),void 0===t&&(t=!1),t&&n.el.removeClass("ogx_popup_notrans"),r.width=e,w(["width"],i),X()},this.height=function(e,t,i){if(void 0===e)return r.height;void 0===i&&(i=!1),void 0===t&&(t=!1),t&&n.el.removeClass("ogx_popup_notrans"),r.height=e,w(["height"],i),X()},this.destroy=function(){s.off("transitionend"),this.touch.wipe()},this.buttons=function(e){if(void 0===e)return r.buttons;Y(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+=W()),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+=A(),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:D,cb_up:S,target:"."+d+"_head"};r.group?e.cb_drag=L:"function"==typeof r.drag&&(e.cb_drag=function(e){r.drag(n,e)}),n.touch.add("Drag",e),n.dragable=!0}if(r.resize&&n.setResize({top:!1,cb_resize:b,cb_down:C,cb_up:E}),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",p="mousemove",_=(d=!1,!1),m=!1,v={w:0,h:0},y=null;function x(e){d&&(e?c.el.on(f,O):c.el.off(f,O))}function O(e){var u=C(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,p=a-f.top;v.w=c.el.width(),v.h=c.el.height(),o=0,r=0,s=0,l=0,d.top&&pc.el.height()-d.border&&(l=1),d.left&&gc.el.width()-d.border&&(s=1),_=-1!==window.getComputedStyle(c.el[0],"width"),m=-1!==window.getComputedStyle(c.el[0],"height"),(s||l)&&(e.preventDefault(),y&&y.disable(),b(!0),G(!0),d.cb_down&&d.cb_down())}function b(e){e?h||(h=setInterval(w,5)):h&&(clearInterval(h),h=!1)}function w(){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&&(_?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 G(e){e?($("body").on(p,X),$("body").on(g,T)):($("body").off(p,X),$("body").off(g,T))}function X(e){e.preventDefault(),e.stopImmediatePropagation(),e=C(e),o=e.pageX-n,r=e.pageY-a}function T(e){b(!1),G(!1),e=C(e),o=e.pageX-n,r=e.pageY-a,d.cb_up&&d.cb_up(),y&&(x(!1),y.enable(),setTimeout((function(){x(!0)}),0))}function C(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 x(!0),this},this.disableResize=function(){return x(!1),this},this.destroy=function(){this.touch.wipe()},OGX.Data.merge(d,u,!1),void 0===window.ontouchstart||d.chromeos||(f="touchstart",p="touchmove",g="touchend"),c.hasOwnProperty("dragable")&&c.dragable&&(y=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,callbacks:{change:null}},u={template:!1,html:'{{$label}}',css:!1},h="object",f=0,g=0,p=null,_="ogx_roulette";function m(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 v(e){e?t.on(l.touch.down,"."+_+"_icon",(function(e){e.preventDefault(),e.stopImmediatePropagation(),l.next(!0)})):t.off(l.touch.down,"."+_+"_icon")}function y(e){e?t.on("change","input[type=hidden]",x):t.off("change","input[type=hidden]",x)}function x(e){e.preventDefault(),e.stopImmediatePropagation(),l.loopval(0,OGX.Data.stringToVal(e.target.value),!1)}function O(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 b(e){a=e.y,X(!0)}function w(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 G(e){X(!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 X(e){e?r=setInterval(T,10):clearInterval(r)}function T(){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 C(){X(!1),i.off("transitionend",C)}function E(){var e="",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("."+_+"_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 S(e){switch(h){case"string":return{index:c.list.indexOf(e)};case"object":return c.list.findIndex(c.key,e)}}function L(){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&&v(!0),c.name&&y(!0),p&&p.enable(),this},this.disable=function(){return t.addClass(_+"_disabled"),c.icon&&v(!1),c.name&&y(!1),p&&p.disable(),X(!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.onSelect=function(){},this.val=function(e,t){if(void 0!==e){var a=S(e).index;return a>-1&&(!function(e,t){void 0===t&&(t=!0);i.off("transitionend",C),X(!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);X(!0),i.on("transitionend",C),i.css({transition:"all "+h+"ms ease-out",transform:"translate3D(0px, "+u+"px, 0px)"}),g=e}(a),c.name&&m(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=S(t).index;r>-1&&(g=r);var s=o-r,l=c.time_coef*Math.abs(s+e*c.list.length);return X(!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",C),c.name&&m(t,a),void 0!==a&&a&&(this.onSelect(val),this.el.trigger(OGX.Roulette.CHANGE,val)),this},this.next=function(e){var t,i=O(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.onSelect(t),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=O(-1);switch(h){case"string":t=i;break;case"object":t=i[c.key]}return this.val(t),void 0!==e&&e&&(this.onSelect(t),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,L(),g=void 0===t?0:S(t).index,setTimeout(E,0),this},function(){if(OGX.Data.merge(c,d),c.callbacks.change||(c.callbacks.change=l.onChange),L(),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=S(c.value).index}}(),l.observeOnce({childList:!0},(function(){p=l.touch.add("Swipe",{x:!1,y:!0,cb_down:b,cb_swipe:w,cb_up:G,state:"manual",target:".ogx_roulette_container",capture:c.capture}),c.enabled&&p.enable()}),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.enable():t>0&&s[t].roulette.disable()}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"),a.observeOnce({childList:!0},(function(){setTimeout((()=>{o.value?f(o.value):c()}),10)})),function(){s=new OGX.List;var e,i,n=0;!function r(l,c){var d;if(!Array.isArray(l)&&"object"==typeof l){if(c>n){for(var u in n=c,t.append('
'),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,enabled:!1,required:o.required}),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},p=0,_="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"),E(!0)}function b(e){e?(d=setInterval(C,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),E(!1),L("out")}function T(e){e?(window.addEventListener("resize",N),i.on("scroll",(function(e){e.stopImmediatePropagation(),C()})),i.on("wheel",(function(e){E(!0)})),void 0!==OGX.NestedList&&$(document).on(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED,(function(){h.update()}))):(window.removeEventListener("resize",N),i.off("scroll"),i.off("wheel"),void 0!==OGX.NestedList&&$(document).off(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED))}function C(){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 E(e){e?(c&&E(!1),l=t.position().top,c=setInterval(D,f.check_delay-10)):(c&&(clearInterval(c),c=null),v=!1,h.el.trigger(OGX.Scroller.END))}function D(){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(C,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 k(e){e?h.observe(!0,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","src","width","height"]},M):h.observe(!1)}function M(){p!==t.height()&&(p=t.height(),N(),f.auto_scroll&&h.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,h.el.trigger(OGX.Scroller.READY))}this.enable=function(){return N(),T(!0),f.observe&&setTimeout((function(){k(!0)}),0),x(!0),this},this.disable=function(){return T(!1),f.observe&&k(!1),G(!1),b(!1),x(!1),E(!1),S(!1),o.removeClass("ogx_scroller_track_anim_fade_in"),o.removeClass("ogx_scroller_track_anim_fade_out"),this},this.resize=function(){return N(),this},this.destroy=function(){h.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(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")}(),N()},OGX.Scroller.READY="ScrollerReady",OGX.Scroller.TOP="ScrollerTop",OGX.Scroller.BOTTOM="ScrollerBottom",OGX.Scroller.SCROLL="ScrollerScroll",OGX.Scroller.START="ScrollerStart",OGX.Scroller.END="ScrollerEnd",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),p(!0),this},this.disable=function(){return f(!1),p(!1),this},this.resize=function(){return _(),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,callbacks:{change:null}},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),i.onChange(n.value),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.construct=function(){n.name&&d(!0)},this.enable=function(){return l(!0),t.removeClass(o+"_disabled"),this},this.disable=function(){return l(!1),t.addClass(o+"_disabled"),this},this.destroy=function(){n.name&&d(!1)},this.bindRender=function(e,t){},this.val=function(e,i){return void 0===i&&(i=!0),void 0!==e&&n.value!==e&&(r(),i&&t.children("."+o+"_val").first().trigger("input")),n.value},this.onChange=function(){},this.toggle=function(e){return r(e=void 0===e),this},function(){var e;void 0===n&&(n={}),n.hasOwnProperty("data")&&!n.hasOwnProperty("value")&&(e=n.data[0].value),OGX.Data.merge(n,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:-4,reorder:!0,icons:!1,index:0,list:new OGX.List,display:{html:"",css:""},callbacks:{select:null,close:null,add:null,remove:null}},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 p(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 _(e){if(s)if(u=e,Math.abs(u.distX)>Math.abs(u.distY)){var a=s.x+u.distX;s.el.css("transform","translate3d("+a+"px, "+s.y+"px, 0px)")}else{var o=s.y+u.distY;s.el.css("transform","translate3d("+s.x+"px, "+o+"px, 0px)");var r=s.el.offset();if(u.distYMath.abs(u.distY)&&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.distX>i.left+n/2&&s.x+u.distXi.left&&s.x+u.distXe&&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)),n.callbacks.select||(n.callbacks.select=i.onSelect),n.callbacks.close||(n.callbacks.close=i.onClose),n.callbacks.add||(n.callbacks.add=i.onAdd),n.callbacks.remove||(n.callbacks.remove=i.onRemove),(t=i.el).addClass(f),n.editable&&t.addClass(f+"_editable"),r=n.index,setTimeout(g,0),n.reorder&&i.touch.add("Hold",{id:"tabs_hold",cb_hold:p,cb_move:_,cb_up:v,state:"manual",time:1e3,target:".ogx_tabs_tab",capture:!1})},OGX.Tabs.SELECT="TabsSelect",OGX.Tabs.CLOSE="TabsClose",OGX.Tabs.REORDER="TabsReorder",OGX.Tabs.ADD="TabsAdded",OGX.Tabs.REMOVE="TabsRemoved",require("Tags","Uxi","Touch"),OGX.Tags=function(__config){construct(this,"Tags");var that=this,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",callbacks:{select:null,add:null,remove:null}},container,input,sliced={org:[],rem:[]},config=OGX.Data.merge(__config,config_default,!1);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),that.onAdd(e),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)}config.callbacks.select(t),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());that.onRemove(t),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(){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))),config.callbacks.select||(config.callbacks.select=that.onSelect),config.callbacks.add||(config.callbacks.add=that.onAdd),config.callbacks.remove||(config.callbacks.remove=that.onRemove),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.render=function(e){return renderTags(trimTags(e))},this.onSelect=function(){},this.onAdd=function(){},this.onRemove=function(){},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,require("Template"),OGX.Template=function(e){construct(this,"Template");var t=new OGX.Display(e),i=t.html(e.data),n=t.css(e.data);i&&this.el.html(i),n&&this.el.addClass("css")},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),_(!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,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),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 _(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,_),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,_),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,_))}},OGX.Touches.Drag=function(e){"use strict";var t,i,n,a,o,r,s=!1,l={min:10,x:!0,y:!0,limit_x:null,limit_y:null,target:!1,cb_down:!1,cb_drag:!1,cb_up:!1,border:10,capture:!1,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),p(!0),s.cb_down&&s.cb_down()}function g(e){e?d||(d=setInterval(v,10)):d&&(clearInterval(d),d=null)}function p(e){e?($("body").on(c.touch.move,m),$("body").on(c.touch.up,_)):($("body").off(c.touch.move,m),$("body").off(c.touch.up,_))}function _(t){g(!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(){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),p(!1),g(!1))}},OGX.Touches.Move=function(e){"use strict";var t,i,n,a,o,r,s,l,c=!1,d={min:0,x:!0,y:!0,limit_x:null,limit_y:null,target:null,cb_down:null,cb_move:null,cb_up:null,cb_click:null,capture:!1,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,p(!0),c.cb_down&&c.cb_down(d)}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),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),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,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}},file:{mode:"file",display:{html:u}},folder:{mode:"folder",display:{html:u}}},data:{id:0,type:"root",state:"closed",label:null,items:[]},display:null,callbacks:{select:null,unselect:null,open:null,close:null,move:null}},g="_id";function p(e,t,i,n,a){return e[g]===a[g]&&t}function _(e,t){var i={container_display:"",container_css:"",arrow_display:"",arrow_style:"ogx_tree_item_arrow_open",state:"open",type:t.type};return i[g]=t[g],OGX.Data.merge(i,e,!0),OGX.Templater.make('
',i)}function m(){h.data&&"root"===h.data.type&&h.data.hasOwnProperty("label")&&(h.root_label=h.data.label);var e={type:"root",label:h.root_label};e[g]="root";var i=_({},e);t.html(i),h.data.element=t.children(".ogx_tree_item").first(),h.data.uxi=d,O(e,d),h.show_root||h.data.element.addClass("ogx_tree_root_hidden")}function v(){m(),y(h.data,d)}function y(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 b(e){var t={};return OGX.Data.merge(t,e),delete t.element,delete t.parent,c||delete t[g],t}function w(e){"folder"===L(e).mode&&(e.items.length?e.element.attr("data-empty",!1):(e.element.attr("data-state","closed").attr("data-compound",e.type+"-closed").attr("data-empty",!0),e.element.children(".ogx_tree_item_arrow").addClass("ogx_tree_item_arrow_disabled")),"open"===e.state?(e.element.attr("data-state","open").attr("data-compound",e.type+"-open"),e.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_close").removeClass("ogx_tree_item_arrow_disabled").addClass("ogx_tree_item_arrow_open"),e.element.children(".ogx_tree_item_container").removeClass("ogx_tree_item_container_hidden")):(e.element.attr("data-state","open").attr("data-compound",e.type+"-closed"),e.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_open").addClass("ogx_tree_item_arrow_close"),e.element.children(".ogx_tree_item_container").addClass("ogx_tree_item_container_hidden")))}function G(){if(s){var e=E(s);e&&e.children(".ogx_tree_item_content").removeClass("ogx_tree_selected_item"),s=null}}function X(e){var t=E(e);t&&(s=e,t.children(".ogx_tree_item_content").addClass("ogx_tree_selected_item"))}function T(e,t){return S((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",w(i),!0)}))}function C(e){if("root"===e)return h.data;return S((function(t,i){return t[g]===e&&t}))}function E(e){var t=C(e);return!!t&&t.element}function D(){l=1,S((function(e){return e[g]=l++,e.hasOwnProperty("type")||(e.hasOwnProperty("items")?e.type="folder":e.type="file"),!1}))}function S(e,t,i){var n;if(void 0===t&&(t=null),void 0===i&&(i=h.data),n=function i(a,o,r,s){if(n=e(a,o,r,s,t))return n;if(a.hasOwnProperty("items")&&a.items.length)for(var l=0;l .ogx_tree_item_content",(function(e){e.preventDefault(),k($(this).parent(0)),1!==$(this).parent(0).data("id")&&function(){o&&clearInterval(o);r=(new Date).getTime(),o=setInterval(N,50)}()})),$(document).on(d.touch.up,(function(){P(),n&&(I(!1),function(){var e=n.offset().left,o=n.offset().top,r=(l=e,c=o,S((function(e,t){return u=e.element.offset(),h=e.element.children(".ogx_tree_item_content").children(".ogx_tree_item_icon"),l>=u.left&&l<=u.left+h.width()&&c>=u.top&&c<=u.top+h.height()&&e}))),s=L(r);var l,c,u,h;!r||r&&(r[g]===i[g]||"folder"!==s.mode)?(a.css("opacity",1),n.remove(),n=null,i=null):(p=r,function(e){S((function(t,i,n,a){return t[g]===e&&(n.items.splice(a,1),n.items.length||(n.state="closed"),w(n),!0)}))}((f=i)[g]),T(f,p[g]),p.element.children(".ogx_tree_item_container").empty(),p.state="open",y(p,p.element),w(p),a.remove(),n.remove(),n=null,d.onMove(i),t.trigger(OGX.Tree.DROP,i),i=null);var f,p}())}))):t.on("click",".ogx_tree_item > .ogx_tree_item_content",(function(e){k($(this).parent(0))})),t.on(d.touch.down,".ogx_tree_item_arrow",(function(e){e.preventDefault(),P();var i=C($(this).parent(0).data("id"));i&&i.hasOwnProperty("items")&&i.items.length&&("open"===i.state?(d.onClose(i),t.trigger(OGX.Tree.CLOSE,i)):(d.onOpen(i),t.trigger(OGX.Tree.OPEN,i)),"open"===i.state?i.state="closed":i.state="open",w(i))}))):(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 N(){var e;(new Date).getTime()-r>=h.drag_after&&(s&&(i=C(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)),P())}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 P(){o&&(clearInterval(o),o=null)}this.enable=function(){return M(!0),this},this.disable=function(){return M(!1),this},this.onSelect=function(){},this.onUnselect=function(){},this.onOpen=function(){},this.onClose=function(){},this.onMove=function(){},this.addItem=function(e,t){if(void 0===t&&(t=s),t){var i=C(t);if("folder"===L(i).mode){c||(e[g]=++l),T(e,t);var n=L(e);x(i.uxi,i.element.children(".ogx_tree_item_container").first(),e),O(e,i.parent);var a=i.uxi;return n.display.hasOML()&&(a=i.uxi.nodes.last()),y(e,a),i.element.data("state","open"),i.element.data("compound",e.type+"-close"),i.element.children(".ogx_tree_item_container").removeClass("ogx_tree_item_container_hidden"),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=C(e);return!!t&&b(t)},this.selectItem=function(e){X(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 S(i)}(e,t);return!!i&&(G(),X(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 S(t)}(e);if(t)return t.element;return!1}(e);return!!t&&(G(),t.children(".ogx_tree_item_content").addClass("ogx_tree_selected_item"),s=t.data("id"),!0)},this.updateItem=function(e,t){var i=C(e);if(i){if(i.uxi){var n=i.uxi.el;i.uxi.kill(),n.empty()}OGX.Data.merge(i,t,!0),O(i,i.parent),i.hasOwnProperty("items")&&i.items.length&&(y(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.attr("state","open").attr("state",i.type+"-open"))}},this.replaceItem=function(e){var t=C(e[g]);t&&(t.uxi&&t.uxi.kill(),OGX.Data.merge(e,t,!1),O(t,t.parent),t.hasOwnProperty("items")&&t.items.length&&y(t,t.parent))},this.deleteItem=function(e){var t=C(e);if(t){var i=function(e){function t(t){return!(!t.hasOwnProperty("items")||!t.items.get({_id:{eq:e}},null,1))&&t}return S(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),w(i),!0}if(s)return S(e);return!1}()},this.getSelectedItem=function(){return function(){if(s)return C(s);return!1}()},this.getTree=function(){var e=S(b,null,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.scroll?this.clear([this.scroller.id]):this.clear(),h.data=e,h.data.hasOwnProperty("state")||(h.data.state="open"),c||D(),v()},this.newTree=function(){d.scroll?d.clear([d.scroller.id]):d.clear();l=1,m()},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(e){return void 0===e&&(e=!1),e&&this.resizeNodes(),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.parents(".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+'"]').first(),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.selector=t,this.wake(t),setTimeout((()=>this.resize),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","Template","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},(i=t.el).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&&this.touch.drag.enable(),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&&this.touch.drag.disable(),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(){listenScroll(!1),this.touch.wipe()},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,OGX.Workers=function(){"use strict";var e=0,t=new OGX.List;this.add=function(i,n,a){void 0===n&&(n=++e);var o=function(e,t){var i;if(void 0===t&&(t=!1),"string"==typeof e)i=new Worker(e);else{var n="";if(t){for(var a=0;a1&&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(__prop,__as_object,__new_props){void 0===__as_object&&(__as_object=!0),void 0===__new_props?__new_props=[__prop]:Array.isArray(__new_props)||(__new_props=[__new_props]);var q={};q[__prop]={regex:/(.){1,}/};for(var l=this.get(),ar=[],final=new OGX.List,o,ev,i=0;i=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,k=!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":(P=O(c,e[G]))&&d(P,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,k=!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||(k?s.push({object:x,data:[n,i]}):x.construct.apply(x,[n,i])))),x&&!k&&(w||X)&&(t.blured||x.floating||x.focus()),void 0!==x&&x&&!k&&(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 w(e){i.children(".ogx_calendar_head").children(".ogx_calendar_head_labels").html(e)}function G(e,t,i,n){if(t.y-1>=0&&t.y-1
'),C(),X(),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}),b(),w(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(e){"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 e.hasOwnProperty("format")?e.format:"YYYY-MM"}},OGX.CalendarLayout.MONTH_DAYS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM"),!e.hasOwnProperty("labels")&&(e.labels="ddd"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){var i="",n=Number(t.format("d")),a=t.clone();n&&a.subtract(n,"day");for(var o=0;o<7;o++)i+=''+a.format(e.labels)+"",a.add(1,"day");return i},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<35;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"}}},OGX.CalendarLayout.CENTURY_DECADES=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY"),!e.hasOwnProperty("labels")&&(e.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+(e.labels?t.format(e.labels):100*Math.floor(Number(t.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"}}},OGX.CalendarLayout.CENTURY_YEARS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+(e.labels?t.format(e.labels):100*Math.floor(Number(t.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"}}},OGX.CalendarLayout.DECADE_YEARS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+(e.labels?t.format(e.labels):10*Math.floor(Number(t.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"}}},OGX.CalendarLayout.DECADE_MONTHS=function(e){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(e){for(var t=10*Math.floor(Number(e.format("YYYY"))/10),i=Number(String(t).substr(2,2)),n="",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(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels="[Months]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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"}}},OGX.CalendarLayout.YEAR_WEEKS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels="[Weeks]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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"}}},OGX.CalendarLayout.YEAR_DAYS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="Y"),!e.hasOwnProperty("labels")&&(e.labels="[Nth Day]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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"}}},OGX.CalendarLayout.MONTH_WEEKS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="[(]YYYY-MM[)] W"),!e.hasOwnProperty("labels")&&(e.labels="[Nth Week]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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"}}},OGX.CalendarLayout.WEEK_DAYS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM (wo [week])"),!e.hasOwnProperty("labels")&&(e.labels="ddd DD"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){var i="",n=Number(t.format("d")),a=t.clone();n&&a.subtract(n,"day");for(var o=0;o<7;o++)i+=''+a.format(e.labels)+"",a.add(1,"day");return i},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"}}},OGX.CalendarLayout.DAY_HOURS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM-DD HH:[00]"),!e.hasOwnProperty("labels")&&(e.labels="[Hours]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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"}}},OGX.CalendarLayout.DAY_WORK_HOURS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM-DD HH:[00]"),!e.hasOwnProperty("labels")&&(e.labels="[Work Hours]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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"}}},OGX.CalendarLayout.DAY=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM-DD"),!e.hasOwnProperty("labels")&&(e.labels="dddd DD"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){return''+t.format(e.labels)+""},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.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,callbacks:{change:null}},d={position:"bottom"},u=!1,h=0,f=0,g=new OGX.List,p="ogx_carousel";function _(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(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="'+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),l.dots&&o.bind("dots",s)},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("."+p+"_view").css("width",100/f+"%"),++h-1}(),c="."+p+'[data-ogx-id="'+this.id+'"] > .'+p+"_views > ."+p+'_view[data-ogx-panel-id="'+l+'"]',d={},u=c;if(e.hasOwnProperty("_NAME_"))e.detach(),e.attach(this,c),a&&this.showPanel(f-1,o);else{for(var g in e){u+=":"+g.split(":")[1],d[u]=e[g];break}var _=null;setTimeout((function(){s.observe(!0,{childList:!0,subtree:!0},(function(){s.observe(!1),_&&clearTimeout(_),_=setTimeout(G,20),a&&(s.showPanel(f-1,o),r?r():t.trigger(OGX.Carousel.ADDED,f))})),OGX.OML.render(s,d,n)}),0)}return 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/f*(-1*n);return i.removeClass(p+"_anim"),i.css({transform:"translate3d("+o+"%, 0, 0)"}),r=n,setTimeout(G,0),s.onChange(r),t.trigger(OGX.Carousel.CHANGE,r),this},this.removePanel=function(e,n){if(void 0===n&&(n=!0),e>=0&&e=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(p+"_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},this.destroy=function(){this.touch.wipe()},OGX.Data.merge(l,c,!1),l.callbacks.change||(l.callbacks.change=s.onChange),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(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/f*(-1*r)+"%, 0, 0)"})}(),l.dots&&(o=s.create("Dots",{el:"."+p+'[data-ogx-id="'+s.id+'"] > .carousel_dots',total:f})),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.CHANGE="CarouselChange",OGX.Carousel.ADDED="CarouselAdded",OGX.Carousel.REMOVED="CarouselRemoved",OGX.Color={},OGX.Color.hexToRgb=function(e){"use strict";e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,i,n){return t+t+i+i+n+n}));var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:null},OGX.Color.rgbToHex=function(e,t,i){"use strict";var n,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);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,i.x,i.y),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)}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.onSelect=function(){},this.destroy=function(){!function(){for(var e in o)r(e)}()},OGX.Data.merge(n,a),n.callbacks.select||(n.callbacks.select=i.onSelect),(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},callbacks:{select:null,unselect:null},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)),config.callbacks.select||(config.callbacks.select=that.onSelect),config.callbacks.unselect||(config.callbacks.unselect=that.onUnselect),(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!==key_default||(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.onSelect=function(e){},this.onUnselect=function(e){},this.getFilteredList=function(){if(isFiltered){if(!config.key){var e=JSON.parse(JSON.stringify(filtered));return clearIds(OGX.List(e))}return filtered}return!1},this.display=function(e){return void 0===e?config.display:display.val(e)},this.key=function(e){if(void 0===e)return e;config.key=e,config.key||(key=key_default)},this.mode=function(e){return void 0===e?config.mode:(config.mode!==e&&(config.mode===OGX.DynamicList.STATIC?this.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.Form.fromObject=function(e,t,i,n){var a={el:t.selector+" "+i,data:e,fullpath:!1};return OGX.Data.merge(a,n,!1),t.create("FormInstance",a)},require("FormInstance","Uxi","Placeholder"),OGX.FormInstance=function(__config){construct(this,"FormInstance");var that=this,config_defaults={fullpath:!1},config=OGX.Data.merge(__config,OGX.Form.defaults,!1,!0);function render(){var html="",oml='{"default:Html":{"html": {{$html}}, "node:OML": {{$oml}} }}',render_oml=!1,row,nodes=[];function cycle(__o,__path){for(var a in __o){var t=typeof __o[a],p;switch(p=__path?__path+"."+a:a,t){case"object":if(Array.isArray(__o[a]))if(["string","number","boolean"].includes(typeof __o[a][0]))row=genRow("array",a,JSON.stringify(__o[a])),html+=row.html,row.oml&&(nodes.push(row.oml),render_oml=!0);else for(var i=0;i<__o[a].length;i++)cycle(__o[a][i],__path?__path+"."+a+"["+i+"]":a+"["+i+"]");else cycle(__o[a],__path?__path+"."+a:a);break;case"string":case"number":case"boolean":var pattern="",required=!1,readonly=!1,oo;if(config.hasOwnProperty("fields")){try{oo=eval("config.fields."+p)}catch(e){}void 0!==oo&&(oo.hasOwnProperty("pattern")&&(pattern=oo.pattern),oo.hasOwnProperty("required")&&(required=oo.required),oo.hasOwnProperty("readonly")&&(readonly=oo.readonly))}row=genRow(t,p,__o[a],required,pattern,readonly),html+=row.html,row.oml&&(nodes.push(row.oml),render_oml=!0)}}}cycle(config.data,null),html=OGX.Templater.make(OGX.Form.defaults.templates.form,{rows:html}),oml=render_oml?nodes.join(","):null,oml=JSON.parse(oml),oml=OGX.OML.rename(oml,that.selector),that.el.html(html),oml&&OGX.OML.render(that,oml)}function genRow(e,t,i,n,a,o){var r={html:"",oml:null},s=config.types[e],l="",c="",d="";void 0!==n&&n&&(l="required",c='pattern="'+a+'"'),void 0!==o&&o&&(d="readonly");var u=t;return config.fullpath||(u=t.split(".").pop()),r.html=OGX.Templater.make(s.html,{name:u,prop:t,val:i,required:l,pattern:c,readonly:d}),r.html=OGX.Templater.make(OGX.Form.defaults.templates.row,{html:r.html,name:u,prop:t}),s.hasOwnProperty("oml")&&(r.oml=OGX.Templater.make(s.oml,{name:u,prop:t,val:i,required:l,pattern:c,readonly:d})),r}function init(){that.el.addClass("ogx_form"),render(),setTimeout((function(){OGX.Form.bindForm({el:that.selector+">form",change_cb:that.onChange,submit_cb:that.onSubmit})}),300)}OGX.Data.merge(config,config_defaults,!1),this.construct=function(){},this.enable=function(){},this.disable=function(){},this.ux=function(e){},this.destroy=function(){OGX.Form.unbindForm(that.selector)},this.onChange=function(e){},this.onSubmit=function(e){},init()},OGX.Form.defaults={templates:{form:"
{{$rows}}
",row:'{{$name}}{{$html}}'},types:{boolean:{html:'',oml:'{"default .{{$name}}:Switch":{"name" : "{{$prop}}", "val":{{$val}}, "editable" : {{!$readonly}} } }'},string:{html:''},number:{html:''},array:{html:'',oml:'{"default .{{$name}}:Tags":{"name" : "{{$prop}}", "editable" : {{!$readonly}}, "current_tags":{{$val}} } }'}}},OGX.Geo=function(e){"use strict";var t=this;void 0===e&&(e={});var i,n,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,p={map:[[!0,!0,!0],[!0,!0,!0],[!0,!0,!0]],axis:{x:!0,y:!0},loop:!0,start:!1,chromeos:!1,capture:!1,callbacks:{up:null,down:null,left:null,right:null}},_=!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,C):t.off(f.touch.down,C)}function C(e){_=!1,o=0,r=0,s=0,l=0,e=A(e),m.x=e.pageX,m.y=e.pageY,x=!0,L(!0)}function E(e){e?$("body").on(f.touch.up,D):$("body").off(f.touch.up,D)}function D(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=P(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(f.touch.move,k)):(M(!1),t.off(f.touch.move,k))}function k(e){e=A(e),g.capture&&(e.preventDefault(),e.stopImmediatePropagation()),o=0,r=0,s=0,l=0,_||(g.axis.x&&Math.abs(e.pageX-m.x)>Math.abs(e.pageY-m.y)?_="x":g.axis.y&&Math.abs(e.pageX-m.x)0?1:-1):g.axis.y&&"y"===_&&(r=Math.abs(e.pageY-m.y),l=e.pageY-m.y>0?1:-1))}function M(e){e?h||(O=!1,h=setInterval(N,10)):h&&(clearInterval(h),h=null)}function N(){if((o||r)&&(O||t.trigger(OGX.GridSwiper.SWIPE_START),O=!0),g.axis.x&&"x"===_&&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"===_&&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 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=P(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=Y(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),f.onLeft({cell:w,point:b}),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}]),H()):(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),f.onRight({cell:w,point:b}),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}]),H())):b.y!==e.y&&(l=b.y>e.y?1:-1,b.y=e.y,w.y=Y(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),f.onUp({cell:w,point:b}),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}]),H()):(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),f.onDown({cell:w,point:b}),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}]),H())),_=0}))):i.off("transitionend")}function P(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 A(e){return e.hasOwnProperty("originalEvent")&&void 0!==e.originalEvent.changedTouches?e.originalEvent.changedTouches[0]:e}function Y(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=Y(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=Y(e[n]).x}else i.x=e[n].x;t=g.map[i.y][i.x],W(e[n],t),f.onRender(i)}}function W(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,Y(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=Y(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:Y(e)}),H()}}function H(){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),E(!0),H(),this},this.disable=function(){return T(!1),E(!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.onUp=function(){},this.onDown=function(){},this.onLeft=function(){},this.onRight=function(){},this.onRender=function(){},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},U(),F(),z(),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,r,s=this,l={left:0,right:0,top:0,bottom:0,min:50,drag:!0,flatten:!1,capture:!0,"node:OML":{},callbacks:{up:null,down:null,left:null,right:null,restore:null}},c=e,d=!1,u="normal",h="main",f={left:null,main:null,right:null,top:null,bottom:null},g=[0,0,0],p=0,_=0,m=0,v=0;function y(e){for(var t in f)f[t]&&f[t].instance&&(e===t?f[t].instance.focus():f[t].instance.blur())}function x(){d.hasClass("ogx_iceberg_anim")||(d.off("transitionend"),g=G(d))}function O(e){var t=0;return e.dirY&&e.distY>e.distX&&(t=1),t}function b(e){c.drag&&e.dist&&(!(n=O(e))&&["main","left","right"].includes(h)?e.dirX&&e.distX&&(t=g[0]+e.distX*e.dirX)<=_&&t>=p&&d.css({transform:"translate3d("+t+"px, 0, 0)"}):["main","top","bottom"].includes(h)&&e.dirY&&e.distY&&(i=g[1]+e.distY*e.dirY)<=v&&i>=m&&d.css({transform:"translate3d(0, "+i+"px, 0)"}))}function w(e){if(t=0,i=0,n=O(e),e.swipe&&e.dist){var r;switch(e.swipe=!1,h){case"main":-1===e.dirX&&c.right&&!n?(t=-f.right.outerWidth(),r="right",e.swipe=!0):1===e.dirX&&c.left&&!n?(t=f.left.outerWidth(),r="left",e.swipe=!0):1===e.dirY&&c.top&&n?(i=f.top.outerHeight(),r="top",e.swipe=!0):-1===e.dirY&&c.bottom&&n&&(i=-f.bottom.outerHeight(),r="bottom",e.swipe=!0);break;case"left":-1!==e.dirX||n||(t=0,r="main",e.swipe=!0);break;case"right":1!==e.dirX||n||(t=0,r="main",e.swipe=!0);break;case"top":-1===e.dirY&&n&&(i=0,r="main",e.swipe=!0);break;case"bottom":1===e.dirY&&n&&(i=0,r="main",e.swipe=!0)}n?1===e.dirY?(a=OGX.Iceberg.SWIPE_DOWN,o="down"):(a=OGX.Iceberg.SWIPE_UP,o="up"):1===e.dirX?(a=OGX.Iceberg.SWIPE_RIGHT,o="right"):(a=OGX.Iceberg.SWIPE_LEFT,o="left"),e.swipe&&e.dist&&(d.addClass("ogx_iceberg_anim"),d.on("transitionend",(function(){d.off("transitionend"),d.removeClass("ogx_iceberg_anim"),g=G(d),y(h=r),c.callbacks[o](h),d.trigger(a,h)})),d.css({transform:"translate3d("+t+"px, "+i+"px, 0)"}))}else if(e.dist){switch(t=0,i=0,h){case"left":t=f.left.outerWidth();break;case"right":t=-f.right.outerWidth();break;case"top":i=f.top.outerHeight();break;case"bottom":i=-f.bottom.outerHeight()}d.addClass("ogx_iceberg_anim"),d.on("transitionend",(function(){d.off("transitionend"),d.removeClass("ogx_iceberg_anim"),g=G(d),c.callbacks.onRestore(h),d.trigger(OGX.Iceberg.RESTORE,h)})),d.css({transform:"translate3d("+t+"px, "+i+"px, 0)"})}}function G(e){var t=e[0].style.transform;if(t=t.match(/translate3d\(([0-9px%,\.\- ]+)\)/)){t=t[1].split(",");for(var i=0;i=c.flatten?(u="flattened",g=G(d),d.addClass("ogx_iceberg_views_flattened").css("transform","translate3d(0px, 0px, 0px)"),d.children(".ogx_iceberg_view").addClass("ogx_iceberg_view_flattened"),this.disable()):"flattened"===u&&this.el.width() .ogx_iceberg_views > .ogx_iceberg_view[data-ogx-panel-id="';for(var o in c["node:OML"])for(var r in c["node:OML"][o])0===r.indexOf("left")&&(i+='
',n.left=a+'left"]',f.left=!0),0===r.indexOf("top")&&(i+='
',n.top=a+'top"]',f.top=!0),0===r.indexOf("main")&&(i+='
',n.main=a+'main"]'),0===r.indexOf("right")&&(i+='
',n.right=a+'right"]',f.right=!0),0===r.indexOf("bottom")&&(i+='
',n.bottom=a+'bottom"]',f.bottom=!0);for(s.el.html(i),o=0;ot.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,callbacks:{open:null,close:null}},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 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"),a=!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),a=!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 o=g.find("id",i,1);a?(!function(e){var t=v(e);if(t)return t.focus(),!0}(o),n.onOpen(o),t.trigger(OGX.NestList.OPEN,o)):(!function(e){var t=v(e);if(t)return t.blur(),!0}(o),n.onClose(o),t.trigger(OGX.NestList.CLOSE,o)),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=/method *([a-zA-Z0-9_\-]+) ([a-zA-Z0-9_\-]+):([a-zA-Z0-9_\-]+)/gi.exec(e))&&(s='OGX.Object.get({_NAME_:{eq:"'+r[3]+'"}, id:{eq:"'+r[2]+'"}}, null, 1).'+r[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=convertKeywords(e+="\r\n",!1);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){var i=0;function n(e){var n;for(var a in e)0===a.indexOf("default")&&(n=a.replace("default",t[i]),i++,e[n]=e[a],delete e[a])}if(void 0!==e&&void 0!==t){e.hasOwnProperty("node:OML")||(e["node:OML"]=[]);var a,o=e["node:OML"];o&&"string"==typeof o&&(0===o.indexOf("{{")?e["node:OML"]=OGX.OSE.exec(o):e["node:OML"]=OGX.Cache.read("oml",e["node:OML"]));for(var r=0;r=i.points[t].min&&o{i=!1;for(var r=0;ri.left&&t.lefti.top&&t.topscreen.width&&(e=screen.width),t>screen.height&&(t=screen.height);var i=r.width,a=r.height,o=0,s=0;return p||(i=OGX.Data.getBestSize(e,i),a=OGX.Data.getBestSize(t,a)),r.center?("string"==typeof i&&(i=-1!==i.indexOf("%")?Math.round(e*Number(i.substr(0,i.length-1))/100):Number(i)),"string"==typeof a&&(a=-1!==a.indexOf("%")?Math.round(t*Number(a.substr(0,a.length-1))/100):Number(a)),x=Math.round(e/2-i/2),y=Math.round(t/2-a/2),r.center&&_&&(r.center=!1)):(_?(x=n.x,y=n.y):r.x&&r.y?(-1!==String(r.x).indexOf("%")?(o=i/2,x=e*Number(r.x.slice(0,-1))/100-o):x=r.x,-1!==String(r.y).indexOf("%")?(s=a/2,y=t*Number(r.y.slice(0,-1))/100-s):y=r.y):(x=Math.round(e/2-i/2),y=Math.round(t/2-a/2)),x>e&&(x=e-x),x<-i&&(x=0),y>t&&(y=t-a),y<0&&(y=0)),{x:x,y:y,w:i,h:a}}function M(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&&m&&(c=m),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?(m=c,s.on("transitionend",(function(){s.off("transitionend"),e?n.resizeNodes():s.css({display:"none",visibility:"hidden"}),h&&s.removeClass(h),N(i,a,o)})),h&&s.addClass(h)):(s.removeClass(h),N(i,a,o))}else e?s.css({opacity:e,display:"flex",visibility:"visible"}):s.css({display:"none",visibility:"hidden"}),N(i,a,o)}function N(e,t,i){void 0!==e&&e&&e(t),void 0!==i&&i&&i(n.id)}function I(e){e?s.on(n.touch.down,"."+d+"_button",P):s.off(n.touch.down,"."+d+"_button",P)}function P(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 A(){for(var e,t="",i=0;i0&&(e=r.buttons[i].enabled?"":d+"_button_disabled",t+=''+r.buttons[i].label+"");return t}function Y(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&&R(!0),r.buttons&&r.buttons.length&&r.buttons_enabled&&I(!0),this},this.disable=function(){return this.disableResize(),r.icons&&r.icons.length&&R(!1),r.buttons&&r.buttons.length&&r.buttons_enabled&&I(!1),this},this.show=function(e,t,i){return M(1,e,t,i),this.focus(1),this},this.hide=function(e,t,i,n,a){return M(0,e,t,i,n,a),this.blur(1),this},this.resize=function(){return G(),this},this.maximize=function(){return r.maximize&&!v&&(v=!0,O={width:r.width,height:r.height,x:this.x,y:this.y},r.width=r.height="100%",G(!1),this.x=this.y=0,this.move(this.x,this.y)),this},this.normalize=function(){return r.maximize&&v&&(v=!1,r.width=O.width,r.height=O.height,G(!1),this.x=O.x,this.y=O.y,O=null,this.move(this.x,this.y)),this},this.width=function(e,t,i){if(void 0===e)return r.width;void 0===i&&(i=!1),void 0===t&&(t=!1),t&&n.el.removeClass("ogx_popup_notrans"),r.width=e,w(["width"],i),X()},this.height=function(e,t,i){if(void 0===e)return r.height;void 0===i&&(i=!1),void 0===t&&(t=!1),t&&n.el.removeClass("ogx_popup_notrans"),r.height=e,w(["height"],i),X()},this.destroy=function(){s.off("transitionend"),this.touch.wipe()},this.buttons=function(e){if(void 0===e)return r.buttons;Y(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+=W()),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+=A(),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:D,cb_up:S,target:"."+d+"_head"};r.group?e.cb_drag=L:"function"==typeof r.drag&&(e.cb_drag=function(e){r.drag(n,e)}),n.touch.add("Drag",e),n.dragable=!0}if(r.resize&&n.setResize({top:!1,cb_resize:b,cb_down:C,cb_up:E}),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",p="mousemove",_=(d=!1,!1),m=!1,v={w:0,h:0},y=null;function x(e){d&&(e?c.el.on(f,O):c.el.off(f,O))}function O(e){var u=C(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,p=a-f.top;v.w=c.el.width(),v.h=c.el.height(),o=0,r=0,s=0,l=0,d.top&&pc.el.height()-d.border&&(l=1),d.left&&gc.el.width()-d.border&&(s=1),_=-1!==window.getComputedStyle(c.el[0],"width"),m=-1!==window.getComputedStyle(c.el[0],"height"),(s||l)&&(e.preventDefault(),y&&y.disable(),b(!0),G(!0),d.cb_down&&d.cb_down())}function b(e){e?h||(h=setInterval(w,5)):h&&(clearInterval(h),h=!1)}function w(){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&&(_?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 G(e){e?($("body").on(p,X),$("body").on(g,T)):($("body").off(p,X),$("body").off(g,T))}function X(e){e.preventDefault(),e.stopImmediatePropagation(),e=C(e),o=e.pageX-n,r=e.pageY-a}function T(e){b(!1),G(!1),e=C(e),o=e.pageX-n,r=e.pageY-a,d.cb_up&&d.cb_up(),y&&(x(!1),y.enable(),setTimeout((function(){x(!0)}),0))}function C(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 x(!0),this},this.disableResize=function(){return x(!1),this},this.destroy=function(){this.touch.wipe()},OGX.Data.merge(d,u,!1),void 0===window.ontouchstart||d.chromeos||(f="touchstart",p="touchmove",g="touchend"),c.hasOwnProperty("dragable")&&c.dragable&&(y=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,callbacks:{change:null}},u={template:!1,html:'{{$label}}',css:!1},h="object",f=0,g=0,p=null,_="ogx_roulette";function m(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 v(e){e?t.on(l.touch.down,"."+_+"_icon",(function(e){e.preventDefault(),e.stopImmediatePropagation(),l.next(!0)})):t.off(l.touch.down,"."+_+"_icon")}function y(e){e?t.on("change","input[type=hidden]",x):t.off("change","input[type=hidden]",x)}function x(e){e.preventDefault(),e.stopImmediatePropagation(),l.loopval(0,OGX.Data.stringToVal(e.target.value),!1)}function O(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 b(e){a=e.y,X(!0)}function w(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 G(e){X(!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 X(e){e?r=setInterval(T,10):clearInterval(r)}function T(){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 C(){X(!1),i.off("transitionend",C)}function E(){var e="",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("."+_+"_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 S(e){switch(h){case"string":return{index:c.list.indexOf(e)};case"object":return c.list.findIndex(c.key,e)}}function L(){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.construct=function(){c.name&&y(!0)},this.enable=function(){return t.removeClass(_+"_disabled"),c.icon&&v(!0),p&&p.enable(),this},this.disable=function(){return t.addClass(_+"_disabled"),c.icon&&v(!1),p&&p.disable(),X(!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(){c.name&&y(!1),this.touch.wipe()},this.bindRender=function(e,t){},this.onSelect=function(){},this.val=function(e,t){if(void 0!==e){var a=S(e).index;return a>-1&&(!function(e,t){void 0===t&&(t=!0);i.off("transitionend",C),X(!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);X(!0),i.on("transitionend",C),i.css({transition:"all "+h+"ms ease-out",transform:"translate3D(0px, "+u+"px, 0px)"}),g=e}(a),c.name&&m(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=S(t).index;r>-1&&(g=r);var s=o-r,l=c.time_coef*Math.abs(s+e*c.list.length);return X(!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",C),c.name&&m(t,a),void 0!==a&&a&&(this.onSelect(val),this.el.trigger(OGX.Roulette.CHANGE,val)),this},this.next=function(e){var t,i=O(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.onSelect(t),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=O(-1);switch(h){case"string":t=i;break;case"object":t=i[c.key]}return this.val(t),void 0!==e&&e&&(this.onSelect(t),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,L(),g=void 0===t?0:S(t).index,setTimeout(E,0),this},function(){if(OGX.Data.merge(c,d),c.callbacks.change||(c.callbacks.change=l.onChange),L(),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=S(c.value).index}}(),l.observeOnce({childList:!0},(function(){p=l.touch.add("Swipe",{x:!1,y:!0,cb_down:b,cb_swipe:w,cb_up:G,state:"manual",target:".ogx_roulette_container",capture:c.capture}),c.enabled&&p.enable()}),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.enable():t>0&&s[t].roulette.disable()}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"),a.observeOnce({childList:!0},(function(){setTimeout((()=>{o.value?f(o.value):c()}),10)})),function(){s=new OGX.List;var e,i,n=0;!function r(l,c){var d;if(!Array.isArray(l)&&"object"==typeof l){if(c>n){for(var u in n=c,t.append('
'),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,enabled:!1,required:o.required}),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},p=0,_="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"),E(!0)}function b(e){e?(d=setInterval(C,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),E(!1),L("out")}function T(e){e?(window.addEventListener("resize",N),i.on("scroll",(function(e){e.stopImmediatePropagation(),C()})),i.on("wheel",(function(e){E(!0)})),void 0!==OGX.NestedList&&$(document).on(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED,(function(){h.update()}))):(window.removeEventListener("resize",N),i.off("scroll"),i.off("wheel"),void 0!==OGX.NestedList&&$(document).off(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED))}function C(){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 E(e){e?(c&&E(!1),l=t.position().top,c=setInterval(D,f.check_delay-10)):(c&&(clearInterval(c),c=null),v=!1,h.el.trigger(OGX.Scroller.END))}function D(){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(C,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 k(e){e?h.observe(!0,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","src","width","height"]},M):h.observe(!1)}function M(){p!==t.height()&&(p=t.height(),N(),f.auto_scroll&&h.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,h.el.trigger(OGX.Scroller.READY))}this.enable=function(){return N(),T(!0),f.observe&&setTimeout((function(){k(!0)}),0),x(!0),this},this.disable=function(){return T(!1),f.observe&&k(!1),G(!1),b(!1),x(!1),E(!1),S(!1),o.removeClass("ogx_scroller_track_anim_fade_in"),o.removeClass("ogx_scroller_track_anim_fade_out"),this},this.resize=function(){return N(),this},this.destroy=function(){h.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(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")}(),N()},OGX.Scroller.READY="ScrollerReady",OGX.Scroller.TOP="ScrollerTop",OGX.Scroller.BOTTOM="ScrollerBottom",OGX.Scroller.SCROLL="ScrollerScroll",OGX.Scroller.START="ScrollerStart",OGX.Scroller.END="ScrollerEnd",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),p(!0),this},this.disable=function(){return f(!1),p(!1),this},this.resize=function(){return _(),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,callbacks:{change:null}},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),i.onChange(n.value),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.construct=function(){n.name&&d(!0)},this.enable=function(){return l(!0),t.removeClass(o+"_disabled"),this},this.disable=function(){return l(!1),t.addClass(o+"_disabled"),this},this.destroy=function(){n.name&&d(!1)},this.bindRender=function(e,t){},this.val=function(e,i){return void 0===i&&(i=!0),void 0!==e&&n.value!==e&&(r(),i&&t.children("."+o+"_val").first().trigger("input")),n.value},this.onChange=function(){},this.toggle=function(e){return r(e=void 0===e),this},function(){var e;void 0===n&&(n={}),n.hasOwnProperty("data")&&!n.hasOwnProperty("value")&&(e=n.data[0].value),OGX.Data.merge(n,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:-4,reorder:!0,icons:!1,index:0,list:new OGX.List,display:{html:"",css:""},callbacks:{select:null,close:null,add:null,remove:null}},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 p(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 _(e){if(s)if(u=e,Math.abs(u.distX)>Math.abs(u.distY)){var a=s.x+u.distX;s.el.css("transform","translate3d("+a+"px, "+s.y+"px, 0px)")}else{var o=s.y+u.distY;s.el.css("transform","translate3d("+s.x+"px, "+o+"px, 0px)");var r=s.el.offset();if(u.distYMath.abs(u.distY)&&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.distX>i.left+n/2&&s.x+u.distXi.left&&s.x+u.distXe&&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)),n.callbacks.select||(n.callbacks.select=i.onSelect),n.callbacks.close||(n.callbacks.close=i.onClose),n.callbacks.add||(n.callbacks.add=i.onAdd),n.callbacks.remove||(n.callbacks.remove=i.onRemove),(t=i.el).addClass(f),n.editable&&t.addClass(f+"_editable"),r=n.index,setTimeout(g,0),n.reorder&&i.touch.add("Hold",{id:"tabs_hold",cb_hold:p,cb_move:_,cb_up:v,state:"manual",time:1e3,target:".ogx_tabs_tab",capture:!1})},OGX.Tabs.SELECT="TabsSelect",OGX.Tabs.CLOSE="TabsClose",OGX.Tabs.REORDER="TabsReorder",OGX.Tabs.ADD="TabsAdded",OGX.Tabs.REMOVE="TabsRemoved",require("Tags","Uxi","Touch"),OGX.Tags=function(__config){construct(this,"Tags");var that=this,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",callbacks:{select:null,add:null,remove:null}},container,input,sliced={org:[],rem:[]},config=OGX.Data.merge(__config,config_default,!1);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),that.onAdd(e),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)}config.callbacks.select(t),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());that.onRemove(t),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(){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))),config.callbacks.select||(config.callbacks.select=that.onSelect),config.callbacks.add||(config.callbacks.add=that.onAdd),config.callbacks.remove||(config.callbacks.remove=that.onRemove),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.render=function(e){return renderTags(trimTags(e))},this.onSelect=function(){},this.onAdd=function(){},this.onRemove=function(){},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,require("Template"),OGX.Template=function(e){construct(this,"Template");var t=new OGX.Display(e),i=t.html(e.data),n=t.css(e.data);i&&this.el.html(i),n&&this.el.addClass("css")},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),_(!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,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),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 _(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,_),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,_),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,_))}},OGX.Touches.Drag=function(e){"use strict";var t,i,n,a,o,r,s=!1,l={min:10,x:!0,y:!0,limit_x:null,limit_y:null,target:!1,cb_down:!1,cb_drag:!1,cb_up:!1,border:10,capture:!1,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),p(!0),s.cb_down&&s.cb_down()}function g(e){e?d||(d=setInterval(v,10)):d&&(clearInterval(d),d=null)}function p(e){e?($("body").on(c.touch.move,m),$("body").on(c.touch.up,_)):($("body").off(c.touch.move,m),$("body").off(c.touch.up,_))}function _(t){g(!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(){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),p(!1),g(!1))}},OGX.Touches.Move=function(e){"use strict";var t,i,n,a,o,r,s,l,c=!1,d={min:0,x:!0,y:!0,limit_x:null,limit_y:null,target:null,cb_down:null,cb_move:null,cb_up:null,cb_click:null,capture:!1,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,p(!0),c.cb_down&&c.cb_down(d)}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),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),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,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}},file:{mode:"file",display:{html:u}},folder:{mode:"folder",display:{html:u}}},data:{id:0,type:"root",state:"closed",label:null,items:[]},display:null,callbacks:{select:null,unselect:null,open:null,close:null,move:null}},g="_id";function p(e,t,i,n,a){return e[g]===a[g]&&t}function _(e,t){var i={container_display:"",container_css:"",arrow_display:"",arrow_style:"ogx_tree_item_arrow_open",state:"open",type:t.type};return i[g]=t[g],OGX.Data.merge(i,e,!0),OGX.Templater.make('
',i)}function m(){h.data&&"root"===h.data.type&&h.data.hasOwnProperty("label")&&(h.root_label=h.data.label);var e={type:"root",label:h.root_label};e[g]="root";var i=_({},e);t.html(i),h.data.element=t.children(".ogx_tree_item").first(),h.data.uxi=d,O(e,d),h.show_root||h.data.element.addClass("ogx_tree_root_hidden")}function v(){m(),y(h.data,d)}function y(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 b(e){var t={};return OGX.Data.merge(t,e),delete t.element,delete t.parent,c||delete t[g],t}function w(e){"folder"===L(e).mode&&(e.items.length?e.element.attr("data-empty",!1):(e.element.attr("data-state","closed").attr("data-compound",e.type+"-closed").attr("data-empty",!0),e.element.children(".ogx_tree_item_arrow").addClass("ogx_tree_item_arrow_disabled")),"open"===e.state?(e.element.attr("data-state","open").attr("data-compound",e.type+"-open"),e.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_close").removeClass("ogx_tree_item_arrow_disabled").addClass("ogx_tree_item_arrow_open"),e.element.children(".ogx_tree_item_container").removeClass("ogx_tree_item_container_hidden")):(e.element.attr("data-state","open").attr("data-compound",e.type+"-closed"),e.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_open").addClass("ogx_tree_item_arrow_close"),e.element.children(".ogx_tree_item_container").addClass("ogx_tree_item_container_hidden")))}function G(){if(s){var e=E(s);e&&e.children(".ogx_tree_item_content").removeClass("ogx_tree_selected_item"),s=null}}function X(e){var t=E(e);t&&(s=e,t.children(".ogx_tree_item_content").addClass("ogx_tree_selected_item"))}function T(e,t){return S((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",w(i),!0)}))}function C(e){if("root"===e)return h.data;return S((function(t,i){return t[g]===e&&t}))}function E(e){var t=C(e);return!!t&&t.element}function D(){l=1,S((function(e){return e[g]=l++,e.hasOwnProperty("type")||(e.hasOwnProperty("items")?e.type="folder":e.type="file"),!1}))}function S(e,t,i){var n;if(void 0===t&&(t=null),void 0===i&&(i=h.data),n=function i(a,o,r,s){if(n=e(a,o,r,s,t))return n;if(a.hasOwnProperty("items")&&a.items.length)for(var l=0;l .ogx_tree_item_content",(function(e){e.preventDefault(),k($(this).parent(0)),1!==$(this).parent(0).data("id")&&function(){o&&clearInterval(o);r=(new Date).getTime(),o=setInterval(N,50)}()})),$(document).on(d.touch.up,(function(){P(),n&&(I(!1),function(){var e=n.offset().left,o=n.offset().top,r=(l=e,c=o,S((function(e,t){return u=e.element.offset(),h=e.element.children(".ogx_tree_item_content").children(".ogx_tree_item_icon"),l>=u.left&&l<=u.left+h.width()&&c>=u.top&&c<=u.top+h.height()&&e}))),s=L(r);var l,c,u,h;!r||r&&(r[g]===i[g]||"folder"!==s.mode)?(a.css("opacity",1),n.remove(),n=null,i=null):(p=r,function(e){S((function(t,i,n,a){return t[g]===e&&(n.items.splice(a,1),n.items.length||(n.state="closed"),w(n),!0)}))}((f=i)[g]),T(f,p[g]),p.element.children(".ogx_tree_item_container").empty(),p.state="open",y(p,p.element),w(p),a.remove(),n.remove(),n=null,d.onMove(i),t.trigger(OGX.Tree.DROP,i),i=null);var f,p}())}))):t.on("click",".ogx_tree_item > .ogx_tree_item_content",(function(e){k($(this).parent(0))})),t.on(d.touch.down,".ogx_tree_item_arrow",(function(e){e.preventDefault(),P();var i=C($(this).parent(0).data("id"));i&&i.hasOwnProperty("items")&&i.items.length&&("open"===i.state?(d.onClose(i),t.trigger(OGX.Tree.CLOSE,i)):(d.onOpen(i),t.trigger(OGX.Tree.OPEN,i)),"open"===i.state?i.state="closed":i.state="open",w(i))}))):(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 N(){var e;(new Date).getTime()-r>=h.drag_after&&(s&&(i=C(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)),P())}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 P(){o&&(clearInterval(o),o=null)}this.enable=function(){return M(!0),this},this.disable=function(){return M(!1),this},this.onSelect=function(){},this.onUnselect=function(){},this.onOpen=function(){},this.onClose=function(){},this.onMove=function(){},this.addItem=function(e,t){if(void 0===t&&(t=s),t){var i=C(t);if("folder"===L(i).mode){c||(e[g]=++l),T(e,t);var n=L(e);x(i.uxi,i.element.children(".ogx_tree_item_container").first(),e),O(e,i.parent);var a=i.uxi;return n.display.hasOML()&&(a=i.uxi.nodes.last()),y(e,a),i.element.data("state","open"),i.element.data("compound",e.type+"-close"),i.element.children(".ogx_tree_item_container").removeClass("ogx_tree_item_container_hidden"),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=C(e);return!!t&&b(t)},this.selectItem=function(e){X(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 S(i)}(e,t);return!!i&&(G(),X(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 S(t)}(e);if(t)return t.element;return!1}(e);return!!t&&(G(),t.children(".ogx_tree_item_content").addClass("ogx_tree_selected_item"),s=t.data("id"),!0)},this.updateItem=function(e,t){var i=C(e);if(i){if(i.uxi){var n=i.uxi.el;i.uxi.kill(),n.empty()}OGX.Data.merge(i,t,!0),O(i,i.parent),i.hasOwnProperty("items")&&i.items.length&&(y(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.attr("state","open").attr("state",i.type+"-open"))}},this.replaceItem=function(e){var t=C(e[g]);t&&(t.uxi&&t.uxi.kill(),OGX.Data.merge(e,t,!1),O(t,t.parent),t.hasOwnProperty("items")&&t.items.length&&y(t,t.parent))},this.deleteItem=function(e){var t=C(e);if(t){var i=function(e){function t(t){return!(!t.hasOwnProperty("items")||!t.items.get({_id:{eq:e}},null,1))&&t}return S(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),w(i),!0}if(s)return S(e);return!1}()},this.getSelectedItem=function(){return function(){if(s)return C(s);return!1}()},this.getTree=function(){var e=S(b,null,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.scroll?this.clear([this.scroller.id]):this.clear(),h.data=e,h.data.hasOwnProperty("state")||(h.data.state="open"),c||D(),v()},this.newTree=function(){d.scroll?d.clear([d.scroller.id]):d.clear();l=1,m()},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(e){return void 0===e&&(e=!1),e&&this.resizeNodes(),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.parents(".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+'"]').first(),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.selector=t,this.wake(t),setTimeout((()=>this.resize),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","Template","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},(i=t.el).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&&this.touch.drag.enable(),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&&this.touch.drag.disable(),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(){listenScroll(!1),this.touch.wipe()},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,OGX.Workers=function(){"use strict";var e=0,t=new OGX.List;this.add=function(i,n,a){void 0===n&&(n=++e);var o=function(e,t){var i;if(void 0===t&&(t=!1),"string"==typeof e)i=new Worker(e);else{var n="";if(t){for(var a=0;a