diff --git a/package.json b/package.json index 24ce1028..554ca0b7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@globules-io/ogx.js", - "version": "1.25.1", + "version": "1.25.2", "description": "Javascript framework for webviews", "dependencies": { "fs-extra": "^10.0.0", diff --git a/www/css/lib/globules/ogx.min.css b/www/css/lib/globules/ogx.min.css index 45200d52..a63e29e7 100644 --- a/www/css/lib/globules/ogx.min.css +++ b/www/css/lib/globules/ogx.min.css @@ -1,2 +1,2 @@ -/* globules.io OGX.CSS 1.0.0.189 */ +/* globules.io OGX.CSS 1.0.0.190 */ .ogx_calendar{display:flex;flex-direction:column;height:100%}.ogx_calendar .ogx_calendar_head{display:inline-block;width:100%}.ogx_calendar .ogx_calendar_head_date{display:block;width:100%}.ogx_calendar .ogx_calendar_head_date .ogx_calendar_display_date,.ogx_calendar .ogx_calendar_head_date .ogx_calendar_left,.ogx_calendar .ogx_calendar_head_date .ogx_calendar_right,.ogx_calendar .ogx_calendar_head_date .ogx_calendar_selected_date{display:inline-block;vertical-align:top}.ogx_calendar .ogx_calendar_head_labels{display:flex;flex-direction:row;width:100%}.ogx_calendar .ogx_calendar_head_labels>*{display:inline-block;flex-grow:1}.ogx_calendar .ogx_calendar_body{display:inline-block;width:100%;flex-grow:1}.ogx_calendar .ogx_grid_swiper_cell_content{display:flex;flex-wrap:wrap;align-content:flex-start}.ogx_calendar .ogx_calendar_layout_month_days{display:inline-flex;flex-direction:column;flex-basis:14%;flex-grow:1;flex-shrink:1;margin:0 5px 5px 0;max-width:calc(100%/7 - 5px);height:calc(100%/5 - 5px);max-height:calc(100%/5 - 5px);overflow:hidden;transform:translateZ(0);backface-visibility:hidden}.ogx_calendar .ogx_calendar_layout_century_decades{display:inline-block;flex-basis:20%;flex-grow:1;flex-shrink:1;height:calc(50% - 5px);max-width:calc(20% - 5px);margin:0 5px 5px 0;transform:translateZ(0)}.ogx_calendar .ogx_calendar_layout_century_years,.ogx_calendar .ogx_calendar_layout_decade_years{display:inline-block;flex-basis:10%;flex-grow:1;flex-shrink:1;max-width:calc(10% - 5px);margin-right:5px;transform:translateZ(0)}.ogx_calendar .ogx_calendar_layout_century_years{height:calc(10% - 5px);margin-bottom:5px}.ogx_calendar .ogx_calendar_layout_decade_years{height:calc(100% - 5px)}.ogx_calendar .ogx_calendar_layout_decade_months{display:inline-block;height:calc(100%/12 - 5px);width:calc(100%/10 - 5px);margin-right:5px;margin-bottom:5px;transform:translateZ(0)}.ogx_calendar .ogx_calendar_layout_year_days,.ogx_calendar .ogx_calendar_layout_year_months,.ogx_calendar .ogx_calendar_layout_year_weeks{display:inline-block;flex-basis:20%;flex-grow:1;flex-shrink:1;height:calc(33% - 5px);max-width:calc(25% - 5px);margin-right:5px;margin-bottom:5px;transform:translateZ(0)}.ogx_calendar .ogx_calendar_layout_year_days,.ogx_calendar .ogx_calendar_layout_year_weeks{flex-basis:7%;height:calc(25% - 5px);max-width:calc(100%/13 - 5px)}.ogx_calendar .ogx_calendar_layout_year_days{flex-basis:5%;height:calc(100%/23 - 5px);max-width:calc(100%/16 - 5px)}.ogx_calendar .ogx_calendar_layout_month_weeks{display:inline-block;height:calc(100% - 5px);width:calc(100%/5 - 5px);margin-right:5px;margin-bottom:5px;transform:translateZ(0)}.ogx_calendar .ogx_calendar_layout_days_hours,.ogx_calendar .ogx_calendar_layout_days_work_hours,.ogx_calendar .ogx_calendar_layout_week_days{display:inline-block;flex-basis:10%;flex-grow:1;flex-shrink:1;height:calc(100% - 5px);max-width:calc(100%/7 - 5px);margin-right:5px;margin-bottom:5px;transform:translateZ(0)}.ogx_calendar .ogx_calendar_layout_days_hours,.ogx_calendar .ogx_calendar_layout_days_work_hours{flex-basis:25%;height:calc(100%/6 - 5px);max-width:calc(100%/4 - 5px)}.ogx_calendar .ogx_calendar_layout_days_work_hours{flex-basis:20%;height:calc(100%/2 - 5px);max-width:calc(100%/5 - 5px)}.ogx_calendar .ogx_calendar_layout_month_days_label{max-width:calc(100%/7 - 5px);margin:0 5px 5px 0}.ogx_carousel,.ogx_carousel_views{display:block;height:100%;overflow:hidden}.ogx_carousel{width:100%}.ogx_carousel_views{position:relative;z-index:666}.ogx_carousel_view,.ogx_container{vertical-align:top;height:100%;overflow:hidden}.ogx_carousel_view{position:relative;display:inline-block!important}.ogx_container{display:inline-flex!important;flex-direction:column;width:100%}.ogx_container>.ogx_carousel,.ogx_container>.ogx_tabs{display:inline-block;width:100%}.ogx_container>.ogx_carousel{height:100%;flex-grow:1;margin-top:-5px}.ogx_container>.ogx_carousel_shink{height:calc(100% - 40px)}.ogx_container_flattened{width:100%!important}*{box-sizing:border-box;scrollbar-width:none}body{margin:0;padding:0;height:100vh;perspective:800px;overflow:hidden;touch-action:pan-y;-webkit-user-drag:none;-webkit-touch-callout:none;-webkit-text-size-adjust:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}.ogx_hw,.ogx_stage{backface-visibility:hidden}.ogx_hw{-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-webkit-perspective:1000;-moz-perspective:1000;perspective:1000}.ogx_stage{position:absolute;top:0;display:none;width:100vw;height:100vh;overflow:hidden;touch-action:pan-x;-webkit-user-drag:none}.ogx_stage_anim{transform-style:preserve-3d}.ogx_overlay{display:block;width:100%;height:100%;position:absolute;top:0;left:0;z-index:10500;opacity:0}.ogx_overlay_fade_in{opacity:1!important}.ogx_overlay_fade_out{opacity:0!important}.ogx_view{display:block;box-sizing:border-box;width:100%;height:100%;margin:0;overflow:hidden}.ogx_font_loader,.ogx_loading{display:block;position:absolute}.ogx_loading{z-index:99999;width:100%;height:100%}.ogx_font_loader{top:-1000px;opacity:0}.ogx_group_overlay{display:block;width:100%;height:100%;position:absolute}.ogx_dots{position:relative;display:block;width:100%;text-align:center;margin:auto}.ogx_dots_gfx,.ogx_dots_item{display:inline-block}.ogx_dynamic_list{position:relative;margin:0;padding:0;-webkit-overflow-scrolling:touch}.ogx_dynamic_list,.ogx_dynamic_list_item{display:block;overflow:hidden}.ogx_dynamic_list_reorder{z-index:600}.ogx_dynamic_list_drag{cursor:grabbing}.ogx_dynamic_list_item,.ogx_dynamic_list_swiper_back_item{position:relative;transform:translateZ(0)}.ogx_dynamic_list_swiper_back_item{display:inline-block;left:0;z-index:1;width:100%;font-size:14px;overflow:hidden}.ogx_dynamic_list_swiper_delete{position:relative;opacity:0;transform:translateZ(0)}.ogx_dynamic_list_swiper_work{z-index:10;position:absolute;width:100%}.ogx_ghost,.ogx_grid_swiper{display:block;width:100%;height:100%}.ogx_grid_swiper{position:relative;overflow:hidden}.ogx_grid_swiper_cell,.ogx_grid_swiper_container{display:block;position:absolute;width:calc(100%*3);height:calc(100%*3)}.ogx_grid_swiper_cell{width:calc(100%/3);height:calc(100%/3)}.ogx_grid_swiper_cell_content{display:block;width:100%;height:100%}.ogx_grouped_list,.ogx_grouped_list_group{display:block;width:100%}.ogx_grouped_list,.ogx_grouped_list_group,.ogx_grouped_list_item,.ogx_grouped_list_items{transform:translateZ(0);backface-visibility:hidden;perspective:1000}.ogx_grouped_list_items{margin:0;padding:0;list-style:none}.ogx_grouped_list_item{display:block}.ogx_iceberg,.ogx_iceberg_views{display:block;width:100%;height:100%}.ogx_iceberg_views{position:relative;z-index:666}.ogx_iceberg_views_flattened{display:flex;flex-direction:row}.ogx_iceberg_view{display:inline-block;position:absolute;vertical-align:top;overflow-x:hidden;height:100%;top:0}.ogx_iceberg_view_flattened{display:inline-block;position:relative}.ogx_iceberg_view_left{transform:translateX(-100%)}.ogx_iceberg_views_flattened .ogx_iceberg_view_left{transform:translateX(0)!important}.ogx_iceberg_view_top{width:100%;left:0;transform:translateY(-100%)}.ogx_iceberg_view_main{width:100%}.ogx_iceberg_views_flattened .ogx_iceberg_view_main{width:auto!important;flex-grow:1}.ogx_iceberg_view_right{left:100%}.ogx_iceberg_views_flattened .ogx_iceberg_view_right{left:unset!important}.ogx_iceberg_view_bottom{width:100%;left:0;top:100%}.ogx_iceberg .ogx_carousel{display:inline-flex!important;flex-direction:column;height:100%}.ogx_nest_list{display:block;width:100%;overflow:hidden;transform:translate3d(0,0,0)}.ogx_nest_list_prep{position:absolute;top:-10000;visibility:hidden;display:block}.ogx_nest_list_item{display:block;position:relative;width:100%;transform:translate3d(0,0,0)}.ogx_nest_list_item_head{display:flex;flex-direction:row;width:100%}.ogx_nest_list_item_hidden{display:none}.ogx_nest_list_item_noanim{transition:none!important}.ogx_nest_list_item_title{display:inline-block;flex-grow:1}.ogx_nest_list_item_icon{display:inline-block}.ogx_nest_list_item_body{position:absolute;display:block;width:100%}.ogx_nest_list_item_content{display:block}.ogx_nest_list_mask{display:block;position:relative;width:100%;height:100vh;transform:translate3d(0,0,0);transition:height 0s}.ogx_point{position:relative}.ogx_point>.ogx_uxi,.ogx_point_uxi{width:100%;height:100%}.ogx_popup{display:flex;flex-direction:column;position:absolute;z-index:12000;opacity:0;overflow:hidden;top:0;left:0}.ogx_popup_head{display:inline-block;width:100%;flex-shrink:0}.ogx_popup_icon,.ogx_popup_title{display:block;position:absolute}.ogx_popup_title{width:100%;text-align:center}.ogx_popup_icons{display:block;position:relative;text-align-last:right}.ogx_popup_icons_icon{display:inline-block}.ogx_popup_body{display:flex;flex-direction:column;flex-grow:1;position:relative}.ogx_popup_swiper_container{display:inline-block;flex-grow:1;position:relative}.ogx_popup_swiper{display:block;width:100%;height:100%;position:absolute}.ogx_popup_buttons{display:block}.ogx_popup_button{display:inline-block}.ogx_popup_fade_in{opacity:1!important}.ogx_popup_fade_out{opacity:0!important}.ogx_popup_group_overlay{display:block;width:100%;height:100%;position:absolute}.ogx_popup_notrans{transition:none!important}.ogx_quad_swiper{display:block;width:100%;height:100%;overflow:hidden}.ogx_quad_swiper_container{margin:0;display:inline-flex;flex-direction:row;flex-wrap:wrap;flex-grow:1;position:relative;width:300%;overflow:hidden}.ogx_quad_swiper_col{display:inline-flex;flex-direction:column;flex-basis:33%;flex-grow:1;height:100%}.ogx_quad_swiper_item_container{display:flex;flex-wrap:wrap;align-content:flex-start;height:100%;padding:5px 0 0 5px}.ogx_quad_swiper_item,.ogx_roulette{display:inline-block;overflow:hidden;width:100%}.ogx_quad_swiper_item{flex-grow:1}.ogx_roulette{position:relative;vertical-align:top}.ogx_roulette_container{display:inline-block;position:relative;height:100%}.ogx_roulette_stripe,.ogx_roulette_stripes{display:block;position:relative;width:100%}.ogx_roulette_stripe{position:absolute}.ogx_roulette_block{display:block;width:100%;text-align:center;user-select:none;-moz-user-select:none}.ogx_roulette_block_label,.ogx_tabs_tab_add span,.ogx_tabs_tab_close span{display:block;margin:auto}.ogx_roulette_icon{display:inline-block}.ogx_scroller_outer{display:block;width:100%;height:100%;padding:0;overflow-x:hidden;overflow-y:scroll!important;-webkit-overflow-scrolling:touch;position:relative}.ogx_scroller_inner{display:block;width:100%;min-height:100%;height:auto!important;position:absolute;overflow:hidden}.ogx_scroller_track{display:block;position:absolute;top:0;left:0;height:100%;z-index:9999999}.ogx_scroller_track_button{position:relative;top:0;display:block;opacity:0;z-index:9999999}.ogx_scroller_no_overflow>.ogx_scroller_inner{position:relative}.ogx_scroller_track_anim_fade_in{opacity:1}.ogx_scroller_track_anim_fade_out{opacity:0}.ogx_tabs_container::-webkit-scrollbar,::-webkit-scrollbar{display:none}.ogx_stacked_tree{overflow:hidden;display:flex;flex-direction:column;width:100%;height:100%;transform:translateZ(0)}.ogx_stacked_tree_container{display:flex;flex-direction:row;width:100%;height:100%}.ogx_stacked_tree_level{display:inline-flex;flex-direction:column;flex-grow:1;height:100%}.ogx_stacked_tree_level_list{display:inline-block;flex-grow:1}.ogx_switch{display:inline-flex;box-sizing:border-box;cursor:pointer}.ogx_switch_disabled{cursor:default!important}.ogx_switch_track{display:inline-block;vertical-align:text-top;position:relative;flex-grow:1}.ogx_switch_dot,.ogx_switch_track_bg{display:inline-block;position:absolute}.ogx_switch_track_bg{width:100%}.ogx_switch_dot{top:0}.ogx_switch_dot_left{left:0}.ogx_switch_label{display:inline-block;vertical-align:text-top}.ogx_switch_val{display:none}.ogx_tabs,.ogx_tabs_tab{position:relative;overflow:hidden}.ogx_tabs>.ogx_tabs_container{display:inline-flex;flex-direction:row;width:100%;overflow-x:scroll}.ogx_tabs_tab{display:inline-flex;flex-grow:1;min-height:35px}.ogx_tabs_float{position:absolute;z-index:300;top:0;left:0}.ogx_tabs_tab_icon,.ogx_tabs_tab_label{display:inline-block}.ogx_tabs_tab_label{flex-grow:1;padding:5px;vertical-align:top;white-space:pre;user-select:none}.ogx_tabs_tab_add,.ogx_tabs_tab_close{display:inline-block;position:absolute;right:0;height:100%}.ogx_tabs_tab_close{visibility:hidden}.ogx_tabs_tab_active .ogx_tabs_tab_close{visibility:visible}.ogx_tabs_tab_add{top:0;text-align:center}.ogx_tags{display:block}.ogx_tags input[type=text]{border:0;background-color:transparent;width:auto}.ogx_tags input[type=hidden]{display:none}.ogx_tags input[type=text]:focus{outline:0}.ogx_tags .ogx_tags_tag{display:inline-block}.ogx_tags .ogx_tags_tags_container_tag{cursor:pointer}.ogx_tags .ogx_tags_remove{display:inline-block;cursor:pointer;background-repeat:no-repeat}.ogx_tags .ogx_tags_hidden{display:none!important}.ogx_theater{position:absolute;z-index:0}.ogx_theater,.ogx_theater .list{display:block;width:100%;height:100%}.ogx_theater_trans{width:100%;height:100%;z-index:99999999;opacity:1}.ogx_theater_trans,.ogx_theater_trans>.icon{display:block;position:absolute}.ogx_theater_stage{display:inline-block;text-align:center;vertical-align:top}.ogx_theater_stage_icon,.ogx_theater_stage_label,.ogx_tree_item{display:block}.ogx_tree_item>.ogx_tree_item_container{position:relative}.ogx_tree_item>.ogx_tree_item_arrow{display:inline-block;box-sizing:border-box;vertical-align:top}.ogx_tree_item>.ogx_tree_item_arrow>span{display:block;box-sizing:border-box}.ogx_tree_item>.ogx_tree_item_container_hidden{display:none!important}.ogx_tree_item>.ogx_tree_item_content,.ogx_tree_item>.ogx_tree_item_content>.ogx_tree_item_icon,.ogx_tree_item>.ogx_tree_item_content>.ogx_tree_item_label{display:inline-block}.ogx_tree_item>.ogx_tree_item_arrow_hidden{opacity:.3}.ogx_tree_item_drag{display:block;position:absolute;z-index:9999}.ogx_tree_root_hidden>.ogx_tree_item_arrow,.ogx_tree_root_hidden>.ogx_tree_item_content{display:none!important}.ogx_tree_root_hidden>.ogx_tree_item_container{left:0!important}.ogx_treedlist{display:block}.ogx_window{position:absolute;top:0;display:flex;flex-direction:column;visibility:hidden}.ogx_window .ogx_view{display:inline-block;flex-grow:1}.ogx_window_head{display:inline-flex;flex-direction:row;width:100%;box-sizing:border-box}.ogx_window_head_none{display:none}.ogx_window_icon,.ogx_window_icons,.ogx_window_main_icon{display:inline-block}.ogx_window_body,.ogx_window_title{display:inline-block;flex-grow:1}.ogx_window_body{position:relative;overflow:hidden}.ogx_window>.ogx_overlay{z-index:1000!important} \ No newline at end of file diff --git a/www/js/lib/globules/ogx.dev.min.js b/www/js/lib/globules/ogx.dev.min.js index 9e4bba32..412cce61 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.25.1.3.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=o)){var u=!1;for(var l in s)-1!==l.indexOf(":OSE")?(s[i=l.split(":").shift()]=OGX.OSE.exec(s[l],t,a,n,d),delete s[l],u||(u=!0,r++),e(s[i])):-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 o={};return o[e+":"+t]=n,o},this.parse=function(e){return"string"==typeof e&&("{"!==e.substr(0,1)&&(e="{"+e+"}"),e=JSON.parse(e)),e},this.rename=function(e,t,n){function o(e,t,n){var o={};for(var i in e)o[i.replace(t,n)]=e[i];return o}void 0===n&&(n="default"),Array.isArray(n)||(n=[n],t=[t]);for(var i=0;i100)return}return e}i(e)},this.render=function(e,t,o,a,d){t=(t=f(e,{"node:OML":t}))["node:OML"],void 0===d&&(d=!1),n&&(i=!1,r&&clearTimeout(r),r=setTimeout(u,n)),function(e,t,o,r,a){var d=[],s=(new Date).getTime(),u=[];function m(e,t,s){if(i)debug(1,"OML RENDER EXCEEDED "+n+"MS");else if(void 0===s&&(s=!0),!t.enabled&&(s=!1),Array.isArray(e))for(var p=0;p0&&(b=b.substr(0,b.indexOf(".")-1)),X=e[_],e[_].hasOwnProperty("node:OML")&&(e[_]=f(e,e[_])),G=!0,y=!0,C=!1,N=!1,b){case"Function":return y=!1,X.parent=t,X.fnc=v,X=h(X,o,r),void OGX.Fonction(X,o,r);case"Uxi":return void e[_].attach(t,v);case"Fork":(L=O(v,e[_]))&&m(L,t,s),y=!1,G=!1;break;case"Html":X.el=v,X.html=e[_].html,(y=c(X))||(X.template=!1);break;case"Template":X.template=w.split(".")[1],X.el=v,y=c(X),w="Html";break;case"Ghost":X.el=v;break;case"Controller":X.id=v,N=!0;break;case"Scroller":k=$(v),X.el=v,X.content=k.html(),k.empty();break;default:-1!==[".","#"].indexOf(v.substr(0,1))?X.el=v:(X.id=v,X.el=t.el[0],X.parent=t)}G&&(X=h(X,o,r)),M=!1,P=!1,y?(a&&X.hasOwnProperty("id")&&(S=a.find("id",X.id.replace(/^#/gi,""),1))&&(P=!0),P?(S.wake(X.el),x=S):x=OGX.Object.create(w,X),t.add(x),M=x):C?(C.blur(),$(v).html(E),C.el=$(v),t.add(C),setTimeout((function(){!t.blured&&s&&C.focus()}),0)):(M=t,"Html"===w&&OGX.HtmlRender(X)),M&&e[_].hasOwnProperty("node:OML")&&!C&&!P&&m(e[_]["node:OML"],M,s),y&&(x.parent=t,"function"==typeof x.construct&&(P||(N?u.push({object:x,data:[r]}):x.construct.apply(x,[r])))),x&&!N&&(y||P)&&!t.blured&&s&&x.enabled&&(x.floating||x.focus()),void 0!==x&&x&&!N&&(d=d.concat(l(x,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 b(e){i.children(".ogx_calendar_head").children(".ogx_calendar_head_labels").html(e)}function w(e,t,i,n){if(t.y-1>=0&&t.y-1{t.off_dates=e})),this)},this.noSelection=function(e,t){return void 0===e?r.no_selection:(void 0===t&&(t=!0),r.no_selection=e,t&&v(),this)},void 0!==OGX.GridSwiper?"undefined"!=typeof moment?(debug(5,"calender init",r.id),OGX.Data.merge(r,s),r.callbacks.select||(r.callbacks.select=a.onSelect),r.callbacks.unselect||(r.callbacks.unselect=a.onUnselect),(i=a.el).addClass("ogx_calendar"),r.date&&(moment.isMoment(r.date)||(r.date=moment(r.date)),r.display_date=r.date.clone()),r.display_date?moment.isMoment(r.display_date)||(r.display_date=moment(r.display_date)):r.display_date=moment(),o=r.layout,d.y=o+1,i.html('
'),T(),G(),t=a.create("GridSwiper",{el:r.el+" .ogx_calendar_body",loop:!0,map:n,start:{x:1,y:o+1},chromeos:r.chromeos,enabled:r.swipe}),O(),b(l[o].labels(r.display_date)),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.off_dates=null,this.labels=function(e){return""},this.html=function(e,t,i,n){return""},this.value=function(){return{value:1,unit:"months"}},this.format=function(){return e.hasOwnProperty("format")?e.format:"YYYY-MM"}},OGX.CalendarLayout.MONTH_DAYS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM"),!e.hasOwnProperty("labels")&&(e.labels="ddd"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){var i="",n=Number(t.format("d")),o=t.clone();n&&o.subtract(n,"day");for(var a=0;a<7;a++)i+=''+o.format(e.labels)+"",o.add(1,"day");return i},this.html=function(e,t,i,n){var o,a=e.format("MM"),r=moment(e.format("YYYY-MM-")+"01").day(),s=moment(e.format("YYYY-MM-")+"01").subtract(r,"days"),l="";n&&(l=n.format("YYYY-MM-DD"));for(var d,c="",u=0;u<35;u++)d="",o=s.format("YYYY-MM-DD"),s.format("MM")!==a&&(d+="ogx_calendar_layout_month_days_offset "),o===moment().format("YYYY-MM-DD")&&(d+="ogx_calendar_layout_month_days_today "),n&&l===o&&(d+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(o)&&(d+="ogx_calendar_layout_off_date "),c+='
'+t(o,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 o,a,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++)a="",s+l===d+(o=10*h)&&(a="ogx_calendar_layout_century_decades_current "),c+u===d+o&&(a+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(d+o)&&(a+="ogx_calendar_layout_off_date "),f+='
'+t(d+o,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 o,a=moment(),r=100*Math.floor(Number(a.format("YYYY"))/100),s=Number(a.format("YYYY").substr(2)),l=100*Math.floor(Number(e.format("YYYY"))/100),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++)o="",l+f===r+s&&(o+="ogx_calendar_layout_century_years_current "),l+f===d+c&&(o+="ogx_calendar_selected_item"),this.off_dates&&this.off_dates.includes(l+f)&&(o+="ogx_calendar_layout_off_date "),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 o,a=10*Math.floor(Number(e.format("YYYY"))/10),r="",s=Number(moment().format("YYYY")),l="";n&&(l=Number(n.format("YYYY")));for(var d=0;d<10;d++)o="",a+d===s&&(o+="ogx_calendar_layout_decade_years_current "),a+d===l&&(o+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(a+d)&&(o+="ogx_calendar_layout_off_date "),r+='
'+t(a+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="",o=0;o<10;o++)n+='\''+i+"",i++;return n},this.html=function(e,t,i,n){var o,a,r,s,l=10*Math.floor(Number(e.format("YYYY"))/10),d="",c=moment().format("YYYY-MM");n&&(o=n.format("YYYY-MM"));for(var u=0;u<12;u++){s=u+1;for(var f=0;f<10;f++)a="",(r=l+f+"-"+(s<10?"0"+s:s))===c&&(a="ogx_calendar_layout_decade_months_current "),r===o&&(a+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(r)&&(a+="ogx_calendar_layout_off_date "),moment(r+"-01"),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 o,a,r=moment().format("YYYY-MM"),s=e.format("YYYY"),l="",d="";n&&(d=n.format("YYYY-MM"));for(var c=1;c<13;c++)o="",s+"-"+(a=c<10?"0"+c:c)===r&&(o+="ogx_calendar_layout_year_months_current "),s+"-"+a===d&&(o+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(s+"-"+a)&&(o+="ogx_calendar_layout_off_date "),l+='
'+t(s+"-"+a+"-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 o=moment().week(),a=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="",c=moment().year(a).week(f).format("YYYY-MM-DD"),o===f&&a===r&&(d="ogx_calendar_layout_year_weeks_current "),l===f&&a===s&&(d+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(c)&&(d+="ogx_calendar_layout_off_date "),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 o,a,r,s="",l=e.format("YYYY-MM-DD"),d=moment(e.format("YYYY")+"-01-01"),c="";n&&(c=n.format("YYYY-MM-DD")),a=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 o,a="",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")));a="";for(var f,h=moment(e.format("YYYY-MM-[01]")),g=0;g<5;g++)f="",o=Number(h.format("w")),d===c&&o===u&&(f+="ogx_calendar_selected_item "),d===s&&o===l&&(f+="ogx_calendar_layout_month_weeks_current"),this.off_dates&&this.off_dates.includes(o)&&(f+="ogx_calendar_layout_off_date "),a+='
'+t(h.format("YYYY-MM-DD"),i)+"
",h.add(7,"days");return a},this.value=function(){return{value:1,unit:"months"}}},OGX.CalendarLayout.WEEK_DAYS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM (wo [week])"),!e.hasOwnProperty("labels")&&(e.labels="ddd DD"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){var i="",n=Number(t.format("d")),o=t.clone();n&&o.subtract(n,"day");for(var a=0;a<7;a++)i+=''+o.format(e.labels)+"",o.add(1,"day");return i},this.html=function(e,t,i,n){var o,a,r="",s=e.weekday(),l=e.subtract(s,"days"),d=moment().format("YYYY-MM-DD"),c="";n&&(c=n.format("YYYY-MM-DD"));for(var u=0;u<7;u++)o="",(a=l.format("YYYY-MM-DD"))===d&&(o="ogx_calendar_layout_week_days_current "),a===c&&(o+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(a)&&(o+="ogx_calendar_layout_off_date "),r+='
'+t(a,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 o,a,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++)a="",f===s&&l===d&&(a="ogx_calendar_layout_days_hours_current "),f===c&&l===u&&(a+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(l+o+":00")&&(a+="ogx_calendar_layout_off_date "),r+='
'+t(l+o+":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 o,a,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+o+":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 o="",a=e.format("YYYY-MM-DD"),r=moment().format("YYYY-MM-DD");return n&&a===n.format("YYYY-MM-DD")&&(o+="ogx_calendar_selected_item "),a===r&&(o+="ogx_calendar_layout_day_current "),this.off_dates&&this.off_dates.includes(a)&&(o+="ogx_calendar_layout_off_date "),'
'+t(a,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,o,a,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},display:!1,displays:!1,as:"item",list:null},c={position:"bottom"},u=!1,f=0,h=0,g=new OGX.List,p="ogx_carousel",_=null,m=null;function v(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 y(e){if(void 0!==e&&g[e]&&g[e].instance){var t=s.find(g[e].instance._NAME_,g[e].instance.id);t&&s.enabled&&t.focus(1)}}function x(e){i.off("transitionend"),i.removeClass(p+"_anim")}function O(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 b(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(){T(),l.index&&this.showPanel(l.index,!1),l.dots&&a.bind("dots",s)},this.onFocus=function(){l.drag&&m.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),o&&this.showPanel(h-1,a);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(T,20),o&&(s.showPanel(h-1,a),r?r():t.trigger(OGX.Carousel.ADDED,h))})),OGX.OML.render(s,c,n)}),0)}return this},this.removeNode=function(e,t){void 0===t&&(t=e,e=null);for(var i=!1,n=0;n=0&&ee?i.children("."+p+"_view:eq("+(n-1)+")").after(o):i.children("."+p+"_view:eq("+n+")").before(o);var a=100/h*(-1*n);return i.removeClass(p+"_anim"),i.css({transform:"translate3d("+a+"%, 0, 0)"}),r=n,setTimeout(T,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),r=e,s.showPanel(e,!1,!0),t.trigger(OGX.Carousel.REMOVED,h),o}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=r=0,l["node:OML"]=[],this},this.render=function(e,t){return l["node:OML"]=e,h=l["node:OML"].length,E(),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;!function(){if(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)),_=new OGX.Display(l),r=l.index,t=s.el,n=Math.floor(t.innerWidth()),l.hasOwnProperty("node:OML")&&l["node:OML"].length)h=l["node:OML"].length;else if(l.list&&l.list.length){for(var e,i,o=[],a=0;a .ogx_carousel_views > .ogx_carousel_view[data-ogx-panel-id="'+a+'"]',l.list[a],l.as),o.push(e);else{i=_.html(l.list[a]);var u='{"default:Html":{"html":'+JSON.stringify(i)+"}}";e=JSON.parse(u),o.push(e)}l["node:OML"]=o,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&&(a=s.create("Dots",{el:"."+p+'[data-ogx-id="'+s.id+'"] > .carousel_dots',total:h})),E(),m=s.touch.add("Swipe",{x:!0,cb_down:x,cb_swipe:O,cb_up:b,capture:l.capture,state:"manual"}),l.drag?m.enable():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,o,a;arguments.length>1&&(e=e+", "+t+", "+i),"object"==typeof e&&(e=Array.isArray(e)?e.join(","):e.r+" "+e.g+" "+e.b);var r=/(\d+)[ ,]*(\d+)[ ,]*(\d+)/g,s=r.exec(e);return s&&(s.shift(),n=Number(s[0]),o=Number(s[1]),a=Number(s[2])),"#"+((1<<24)+(n<<16)+(o<<8)+a).toString(16).slice(1)},OGX.Color.rgbToHsl=function(e,t,i){"use strict";var n,o,a;arguments.length>1&&(e=e+", "+t+", "+i),"object"==typeof e&&(e=Array.isArray(e)?e.join(","):e.r+" "+e.g+" "+e.b);var r=/(\d+)[ ,]*(\d+)[ ,]*(\d+)/g,s=r.exec(e);if(s){s.shift(),n=s[0],o=s[1],a=s[2],n/=255,o/=255,a/=255;var l,d,c=Math.max(n,o,a),u=Math.min(n,o,a),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=(o-a)/h+(o1&&(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;a=l(c,d,e+1/3),r=l(c,d,e),s=l(c,d,e-1/3)}return[Math.round(255*a),Math.round(255*r),Math.round(255*s)]},OGX.Color.formatHex=function(e){return"#"===e.slice(0,1)&&(e=e.slice(1)),e.length>3||e.split("").map((function(e){return e+e})),"#"+e},require("Container","Uxi"),OGX.Container=function(e){construct(this,"Container");var t=this,i={tabs:!0,carousel:{enabled:!0},enabled:!0,reorder:!0,anim:!0,flatten:!1,chromeos:!1,index:0,dots:!1},n=e,o="normal",a=0;function r(e){e?(t.tabs.el.on(OGX.Tabs.SELECT,(function(e,i){var n=t.tabs.index();t.carousel.val(n),t.el.trigger(OGX.Container.CHANGE,n)})),t.tabs.el.on(OGX.Tabs.REMOVE,(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.REMOVE),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),"Popup"===t.parent._NAME_?app.ungroupPopup(t.parent,i.index,i.label,i.x,i.y):t.carousel.removeNode(t.carousel.nodes[i.index].id),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(arguments.length||this._show(),this.carousel&&"normal"===o){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"===o&&(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.onFocus=function(){return n.tabs&&this.carousel&&(this.tabs.onFocus(),r(!0)),debug(5,"container",n.id,"enabled"),this},this.onBlur=function(){return n.tabs&&this.carousel&&(this.tabs.onBlur(),r(!1)),debug(5,"container",n.id,"disabled"),this},this.resize=function(){var e,t,i;return n.flatten&&(this.carousel&&"flattened"!==o&&this.el.width()>=n.flatten?(o="flattened",n.tabs&&(this.tabs.blur(),this.tabs.hide()),this.carousel.blur(),a=(e=this.carousel.el.children(".ogx_carousel_views"),t=e[0].style.transform,i=/translate3d\(([0-9px%,\.\- ]+)\)/,t=(t=t.match(i))[1].split(","))[0],this.carousel.el.children(".ogx_carousel_views").addClass("ogx_container_flattened").css("transform","translate3d(0px, 0px, 0px)")):this.carousel&&"flattened"===o&&this.el.width()';t.html(i)}this.onFocus=function(){return n.clickable&&d(!0),debug(5,"dots",n.id,"enabled"),this},this.onBlur=function(){return n.clickable&&d(!1),debug(5,"dots",n.id,"disabled"),this},this.bind=function(e,t){return!(a.hasOwnProperty(e)||!t.hasOwnProperty("_NAME_"))&&function(e,t){switch(a[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!!a.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 a)r(e)}()},OGX.Data.merge(n,o),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,o,a=toDataId(i[t]),r=display.oml('.ogx_dynamic_list[data-ogx-id="'+that.id+'"] > .ogx_dynamic_list_item[data-ogx-id='+a+"]",i,config.as);$('.ogx_dynamic_list[data-ogx-id="'+that.id+'"] > .ogx_dynamic_list_item[data-ogx-id='+a+"]").find(".ogx_uxi").each((function(e,t){n=$(t).data("ogx-id"),(o=that.cfind(!1,n,1))&&that.find(o._NAME_,o.id,"remove")})),OGX.OML.render(that,r,i)}else{var s="";selection.length&&selection.find(t,i[t],1)&&(s="ogx_dynamic_list_selected_item "),e.attr("class","").addClass("ogx_dynamic_list_item "+s+display.css(i)),e.html(display.html(i))}}function render(){var e=getWorkList(),t=selection;isFiltered&&(selection.resetFilters(),selection.setFilters(config.list.getFilters()),(t=selection.filter()).length!==selection.length&&(t.length?container.trigger(OGX.DynamicList.SELECT_FILTERED,t):container.trigger(OGX.DynamicList.SELECT_UNFILTERED,selection)));for(var i,n,o,a="",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.onFocus=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.onBlur=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(){!0===config.scope&&listenScope(!1),this.clearBinds(),container.empty(),container.removeClass("ogx_dynamic_list")},this.val=function(e,t,i){if(void 0===e){if(!config.key){var n=JSON.parse(JSON.stringify(config.list));return clearIds(OGX.List(n))}return config.list}var o;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||(o=config.list.getFilters()),config.list=e,config.key&&key!==key_default||(key_id=1,key=key_default,e=JSON.parse(JSON.stringify(e)),forceIds()),!t&&Object.keys(o).length?(config.list.setFilters(o),setTimeout(this.filter,0)):i?setTimeout(render,0):render()},this.scope=function(e){return"undefined"!=typeof __script&&"string"==typeof config.scope?(config.scope=e,void this.render()):config.scope},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.onFocus(!0):e===OGX.DynamicList.STATIC&&this.onBlur(!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 o=new OGX.List(e);o.setFilters(config.list.getFilters()),0===o.filter().length?n=!1:filtered.push(e)}var a=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,o=new OGX.List,a=!1;function r(t,i){if(!a){var o,r=n.find("el",i,1);if(r&&r.config.change_cb){for(var s in r.fields)if(r.fields[s].intv)return;var 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(o=JSON.stringify(d),!r.diff||r.val!==o){var f;if(r.val=o,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(!a){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(!a){if(i.config.mask&&8===e.which||46===e.which){var n=t[0].selectionStart,o=t.val();return o=8===e.which?o.substr(0,n-1):o.substr(0,n),t.val(o),!1}if(8!==e.which&&13!==e.which&&1===e.key.length){var r=e.key;if(13!==e.which&&i.config.mask){if((o=t.val()).length>=i.config.mask.length)return e.preventDefault(),e.stopImmediatePropagation(),!1;for(var s=i.config.mask,d=0;d1)return t.config.autocomplete?void 0:(e.preventDefault(),e.stopImmediatePropagation(),!1);if(1===n.length&&-1!==t.keys.indexOf(e.which)&&-1===e.which.indexOf(i))return e.preventDefault(),e.stopImmediatePropagation(),!1;if(t.config.multiline&&13===e.keyCode)return!1;if(t.config.allowed&&!n.match(t.config.allowed))return e.preventDefault(),e.stopImmediatePropagation(),!1;if(t.config.forbidden&&n.match(t.config.forbidden))return e.preventDefault(),e.stopImmediatePropagation(),!1;if($(e.originalEvent.target)[t.content]().length>=t.config.max)return e.preventDefault(),e.stopImmediatePropagation(),!1}})),$(document).on("paste",t.el,(function(e){if(!t.config.paste)return e.preventDefault(),e.stopImmediatePropagation(),!1;var i=e.originalEvent.clipboardData.getData("Text");return t.config.forbidden&&i.match(t.config.forbidden)?(e.preventDefault(),e.stopImmediatePropagation(),!1):void 0})),o.insert(t)}(e),!0)},this.unrestrictField=function(e){if(!o.find("el",e,1))return!1;var t=o.find("el",e,1);return!!t&&($(document).off("textInput keydown",t.el),$(document).off("paste",t.el),o.findDelete("el",e,1),!0)},this.toObj=function(e){return c(e)},this.populate=function(e,t,i){var n,o,a;void 0===i&&(i=null),$(e).find("*[name]").each((function(e,r){n=r.getAttribute("name"),a=!1,"string"!=typeof(a=OGX.Data.eval(t,n))&&(a=JSON.stringify(a)),void 0!==a&&(i&&i.hasOwnProperty(n)&&"function"==typeof i[n]&&(a=i[n](a)),(o=$(r)).val(a),r.hasAttribute("type")&&"hidden"===o.attr("type")&&o.trigger("change"))})),setTimeout(d,0)},this.validate=function(e){var i,n=$(e),o=t.elem_types,a=[];return n.find(o.join(",")).each((function(e,t){"submit"!==(i=$(t)).attr("type")&&(t.checkValidity()||a.push(i))})),!a.length||a}},OGX.Form=new OGX.Form,OGX.Form.fromObject=function(e,t,i,n){var o={el:t.selector+" "+i,data:e,fullpath:!1};return OGX.Data.merge(o,n),t.create("FormInstance",o)},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,o,a){var r={html:"",oml:null},s=config.types[e],l="",d="",c="";void 0!==n&&n&&(l="required",d='pattern="'+o+'"'),void 0!==a&&a&&(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.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,o,a,r=OGX.Data.merge(e,{map:null,markers:[],icon:"",browser_loc:null});function s(e,i){for(var n,o={},a=0;a1&&(e.city===i[1]?e.vicinity=e.vicinity.replace(i[0],""):e.city?e.city.length>i[1].length&&(e.city=i[1],e.vicinity=e.vicinity.replace(i[0],"")):e.city=i[1]),t)for(var n in e)-1===t.indexOf(n)&&delete e[n];return e},"undefined"!=typeof google&&void 0!==google.maps||($(document).trigger(OGX.Geo.ERROR_GMAP),debug(2,"Geo not started, Google Maps not found"))},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,o,a,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=!1,w={x:0,y:0},G={x:0,y:0},X=(new Date).getTime()+Math.round(1e3*Math.random()),T=[];function E(e){e?t.on(h.touch.down,D):t.off(h.touch.down,D)}function D(e){_=!1,a=0,r=0,s=0,l=0,e=Y(e),m.x=e.pageX,m.y=e.pageY,x=!0,k(!0)}function C(e){e?$("body").on(h.touch.up,S):$("body").off(h.touch.up,S)}function S(e){x&&(x=!1,k(!1),!L()&&b&&(t.trigger(OGX.GridSwiper.SWIPE_END),O=!1,b=!1))}function L(e,t,a){var r,s;return void 0===e&&(e=0),void 0===t&&(t=0),void 0===a&&(a=!0),a&&A(!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)/o)*o*-1,i.css({transform:"translate3d("+r+"px, "+s+"px, 0px)"}),v.x-r||v.y-s}function k(e){e?(N(!0),t.on(h.touch.move,M)):(N(!1),t.off(h.touch.move,M))}function M(e){e=Y(e),g.capture&&(e.preventDefault(),e.stopImmediatePropagation()),a=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 N(e){e?f||(O=!1,f=setInterval(I,10)):f&&(clearInterval(f),f=null)}function I(){if((a||r)&&(O||(b=!0,t.trigger(OGX.GridSwiper.SWIPE_START)),O=!0),g.axis.x&&"x"===_&&a&&s&&a<=n){if(!g.loop&&(w.x+-1*s<0||w.x+-1*s>g.map[0].length-1))return;if((d=(w.x+-1*s)%g.map[0].length)<0&&(d=Math.abs(g.map[0].length+d)),!1===g.map[G.y][d])return;u=a*s,i.css({transform:"translate3d("+(-1*w.x*n+u)+"px, "+v.y+"px, 0px)"})}else if(g.axis.y&&"y"===_&&r&&l&&r<=o){if(!g.loop&&(w.y+-1*l<0||w.y+-1*l>g.map.length-1))return;if((c=(w.y+-1*l)%g.map.length)<0&&(c=Math.abs(g.map.length+c)),!1===g.map[c][G.x])return;u=r*l,i.css({transform:"translate3d("+v.x+"px, "+(-1*w.y*o+u)+"px, 0px)"})}}function A(e){e?(i.off("transitionend"),i.on("transitionend",(function(){O&&b&&(t.trigger(OGX.GridSwiper.SWIPE_END),O=!1,b=!1),i.off("transitionend"),i.removeClass("ogx_grid_swiper_anim"),v=P(i);var e={x:null,y:null};e.x=-1*Math.round(v.x/n),e.y=-1*Math.round(v.y/o),w.x!==e.x?(s=w.x>e.x?1:-1,w.x=e.x,G.x=R(w).x,-1===s?(i.children(y+"[data-y="+(w.y-1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-y="+(w.y+1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-x="+(w.x-2)+"][data-y="+w.y+"]").attr("data-x",w.x+1).css("left",(w.x+1)*n),h.onLeft({cell:G,point:w}),t.trigger(OGX.GridSwiper.SWIPE_LEFT,{cell:G,point:w}),W(T=[{x:w.x+1,y:w.y},{x:w.x,y:w.y-1},{x:w.x,y:w.y+1}]),F()):(i.children(y+"[data-y="+(w.y-1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-y="+(w.y+1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-x="+(w.x+2)+"][data-y="+w.y+"]").attr("data-x",w.x-1).css("left",(w.x-1)*n),h.onRight({cell:G,point:w}),t.trigger(OGX.GridSwiper.SWIPE_RIGHT,{cell:G,point:w}),W(T=[{x:w.x-1,y:w.y},{x:w.x,y:w.y-1},{x:w.x,y:w.y+1}]),F())):w.y!==e.y&&(l=w.y>e.y?1:-1,w.y=e.y,G.y=R(w).y,-1===l?(i.children(y+"[data-x="+(w.x-1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-x="+(w.x+1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-y="+(w.y-2)+"][data-x="+w.x+"]").attr("data-y",w.y+1).css("top",(w.y+1)*o),h.onUp({cell:G,point:w}),t.trigger(OGX.GridSwiper.SWIPE_UP,{cell:G,point:w}),W(T=[{x:w.x,y:w.y+1},{x:w.x-1,y:w.y},{x:w.x+1,y:w.y}]),F()):(i.children(y+"[data-x="+(w.x-1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-x="+(w.x+1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-y="+(w.y+2)+"][data-x="+w.x+"]").attr("data-y",w.y-1).css("top",(w.y-1)*o),h.onDown({cell:G,point:w}),t.trigger(OGX.GridSwiper.SWIPE_DOWN,{cell:G,point:w}),W(T=[{x:w.x,y:w.y-1},{x:w.x-1,y:w.y},{x:w.x+1,y:w.y}]),F())),_=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 Y(e){return e.hasOwnProperty("originalEvent")&&void 0!==e.originalEvent.changedTouches?e.originalEvent.changedTouches[0]:e}function R(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 W(e){for(var t,i={x:null,y:null},n=0;ng.map.length-1){if(!g.loop)return!1;i.y=R(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=R(e[n]).x}else i.x=e[n].x;t=g.map[i.y][i.x],H(e[n],t),h.onRender(i)}}function H(e,t){var n=!1;switch(typeof t){case"string":i.children(y+'[data-x="'+e.x+'"][data-y="'+e.y+'"]').children(y+"_content").first().html(t);break;case"function":(n=t(e,R(e),{x:e.x-w.x,y:e.y-w.y},i.children(y+'[data-x="'+e.x+'"][data-y="'+e.y+'"]').children(y+"_content").first()[0]))&&i.children(y+'[data-x="'+e.x+'"][data-y="'+e.y+'"]').children(y+"_content").first().html(n);break;case"object":var o='.ogx_grid_swiper[data-ogx-id="'+X+'"] > .ogx_grid_swiper_container > '+y+'[data-x="'+e.x+'"][data-y="'+e.y+'"] > '+y+"_content",a=R(e);for(var r in t){t[r].id="cell_"+a.x+"_"+a.y;break}t=OGX.OML.rename(t,o);var s=h.nodes.find("id","cell_"+a.x+"_"+a.y,1);s&&h.remove(s._NAME_,s.id),$(o).empty(),OGX.OML.render(h,t,{abs:e,rel:R(e)}),F()}}function F(){for(var e=0;e',d=-1*e,c=-1*a-o;g.axis.y&&(l+='
',l+='
'),l+='
',g.axis.x&&(l+='
',l+='
'),l+="
",t.html(l),i=t.children(".ogx_grid_swiper_container").first(),w.x=g.start.x,w.y=g.start.y,v.x=e,v.y=a,G.x=g.start.x,G.y=g.start.y}this.onFocus=function(){return debug(5,"gridwwiper",g.id,"enabled"),E(!0),C(!0),F(),this},this.onBlur=function(){return debug(5,"gridwwiper",g.id,"disabled"),E(!1),C(!1),N(!1),this},this.focus=function(){return this.blured&&(this.blured=!1,this.onFocus()),this},this.resize=function(){A(!1),i.removeClass("ogx_grid_swiper_anim"),n=t.width(),o=t.height();var e=w.x*-n,a=w.y*-o;i.children(y+"[data-y="+(w.y-1)+"]").css({top:(w.y-1)*o,left:w.x*n}),i.children(y+"[data-y="+w.y+"]").css({top:w.y*o,left:w.x*n}),i.children(y+"[data-y="+(w.y+1)+"]").css({top:(w.y+1)*o,left:w.x*n}),i.children(y+"[data-x="+(w.x-1)+"]").css({top:w.y*o,left:(w.x-1)*n}),i.children(y+"[data-x="+(w.x+1)+"]").css({top:w.y*o,left:(w.x+1)*n}),i.css("transform","translate3d("+e+"px, "+a+"px, 0px"),k(!1),setTimeout((function(){L(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),w={x:0,y:0},G={x:0,y:0},m={x:null,y:null},v={x:0,y:0},U(),B(),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"),a=!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"),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,o,a,r,s=this,l={left:0,right:0,top:0,bottom:0,min:50,drag:!0,flatten:!1,capture:!0,"node:OML":{},callbacks:{up:null,down:null,left:null,right:null,restore:null}},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?(o=OGX.Iceberg.SWIPE_DOWN,a="down"):(o=OGX.Iceberg.SWIPE_UP,a="up"):1===e.dirX?(o=OGX.Iceberg.SWIPE_RIGHT,a="right"):(o=OGX.Iceberg.SWIPE_LEFT,a="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[a](f),c.trigger(o,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.onBlur()):"flattened"===u&&this.el.width() .ogx_iceberg_views > .ogx_iceberg_view[data-ogx-panel-id="';for(var a in d["node:OML"])for(var r in d["node:OML"][a])0===r.indexOf("left")&&(i+='
',n.left=o+'left"]',h.left=!0),0===r.indexOf("top")&&(i+='
',n.top=o+'top"]',h.top=!0),0===r.indexOf("main")&&(i+='
',n.main=o+'main"]'),0===r.indexOf("right")&&(i+='
',n.right=o+'right"]',h.right=!0),0===r.indexOf("bottom")&&(i+='
',n.bottom=o+'bottom"]',h.bottom=!0);for(s.el.html(i),a=0;at.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:o,height:a}),s=(o-r.width)/2,l=(a-r.height)/2;n.css("left",s+"px"),n.css("top",l+"px"),n.prop("width",r.width),n.prop("height",r.height)}function o(e){var t,i=$(e);i&&(i.find(".ogx_video").each((function(e,i){t=$(i),function(e,t,i){var n=$(e),o=t/i,a=n.parent().innerWidth(),r=n.parent().innerHeight(),s=a,l=Math.ceil(s/o);la?d=(s-a)/2*-1:sr?c=(l-r)/2*-1:l0&&(r=0),n.parent().css("overflow","hidden"),n.prop("width",o),n.prop("height",a),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),o=t/i,a=n.parent().innerWidth(),r=a,s=Math.ceil(r/o),l=0;r>a?l=(r-a)/2*-1:rt&&(a=t);var r=Math.ceil(a/o);n.prop("width",a),n.prop("height",r)}(i,parseInt(t.data("width"),10),parseInt(t.data("height"),10))})))}function a(e){e?$(window).on("resize",r):$(window).off("resize",r)}function r(){for(var e in t)o(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")))})),o(e)}this.resize=function(e){void 0!==e?o(e):r()},this.bind=function(n,o){return!t.hasOwnProperty(n)&&(t[n]={observer:null,element:o},t[n].observer=(r=o,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=o,i++,e||(e=!0,a(!0)),s($(o)),!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,a(!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,o={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}},a={title:"",scope:[],open:!0},r={id:0,title:!1,scope:[],height:0,y:0,hidden:!1,open:!0,selector:!1},s=e,l=!1,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"),o=!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),o=!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 a=g.find("id",i,1);o?(!function(e){var t=v(e);if(t)return t.focus(),!0}(a),n.onOpen(a),t.trigger(OGX.NestList.OPEN,a)):(!function(e){var t=v(e);if(t)return t.blur(),!0}(a),n.onClose(a),t.trigger(OGX.NestList.CLOSE,a)),setTimeout(x,0)}function v(e){var t=$(e.selector).find(".ogx_uxi").first();if(t.length){var i=String(t.data("ogx-id")),o=n.nodes.find("id",i,1);if(o)return o}return!1}function y(e){if(e.hasOwnProperty("scope"))for(var t=0;t .ogx_nest_list_item[data-ogx-nest-id="'+o.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="'+o.id+'"]');return o.hidden&&f.addClass("ogx_nest_list_item_hidden"),f.removeClass("ogx_nest_list_prep"),o}function b(){var e=s.list;h&&(e=i),t.empty(),g.clear();var o;t.html('
'),s.hasOwnProperty("node:OML")||(s["node:OML"]=[]);for(var a=0;a .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,o(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 o in e)for(var a=0;aogx font init';$("body").append(a),o(e,i,n),function(e){setTimeout((function(){$('.ogx_font_loader[data-ogx-id="font-loader-'+e+'"]').remove()}),150)}(t),t++}a()}(l,i,r);break;case"pak":!function(e,t,i){function n(n){for(var a,r=//gi,s=[];a=r.exec(n);)s.push(a[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=convertKeywords(e,!1),t,i,n,o)+";";for(e=convertKeywords(e+="\r\n",!1);a=/[\S ]+(\r\n|\n)?/gi.exec(e);){if(l=replaceLoop(l=a[0].replace(/(\r\n|\n)/gi,"").trim(),t,i,n,o),charcode++,l=replaceVars(l,t,i,n,o),/^(app|OGX)\.\S+;?/g.test(l))return"return "+l+";";if(e=e.replace(a[0],""),u+=l+"\n",++c>100)return}return u="var __echo=[];\n"+u+'\nif(!__echo.length){return;}else{return __echo.join("");}'}function runJS(e,t,i,n,o,a){var r;try{r=new Function(oo,to,ro,lo,e)(t,i,n,o)}catch(e){return void debug(1,"Invalid script",a,"\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,o){var a,r,s,l;return(a=/loop (\S+) ?(as (\S+) ?(\S+ )?)?{/gi.exec(e))&&(r="__"+String.fromCharCode(charcode).toLowerCase()+"__",s=(s=a[0]).replace(a[0],"for(var "+r+" in JSON.parse(JSON.stringify("+a[1]+"))){"),a[2]&&(l=a[4]?"&"+a[3]+"="+r+"; &"+a[4]+"="+a[1]+"["+r+"]; ":"&"+a[3]+"="+a[1]+"["+r+"]; "),s+=l,e=e.replace(a[0],s)),e}function replaceVars(e,t,i,n,o){for(var a,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(a=r[0].replace(r[1],s),e=e.replace(r[0],a),++l>300)return debug(1,"OSE script exceeded safe pool at replaceVars"),e}for(;r=/([a-z_\-]+)\( *(\$|@|&|%) *\)/gi.exec(e);)s=getTrueVal(r[2]),a=r[1]+"("+s+")",e=e.replace(r[0],a);for(;/^(json|ose|template|oml|crumb|result) (\S+)/g.test(e);)if((r=/crumb (\S+)?/gi.exec(e))&&(a=n.hasOwnProperty(r[1])?"__route_object."+r[1]:"{}",e=e.replace(r[0],a)),(r=/json (\S+)(;)?/gi.exec(e))&&(r[1]=getTrueVal(r[1],t,i,n,o),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,o),r[1]||debug(1,"OSE Error",e),void 0===r[2]?r[2]="__object":r[2]=getTrueVal(r[2].trim(),t,i,n,o),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,o),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,o),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),a="__echo.push("+c+r[2]+c+");",e=e.replace(r[0],a),++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 o in t.values)if(convertValue(o)===n)return t.values[o];return!1},this.execScript=function(e,t,i,n){var o=this.get(e);return o&&this.exec(o,t,i,n),!1},this.exec=function(e,t,i,n,o){void 0===t&&(t={}),void 0===i&&(i={}),void 0===n&&(n={}),void 0===o&&(o={}),charcode=65;var a=runJS(convertToJS(e,t,i,n,o),t,i,n,o,e);if(void 0!==a)return a}},OGX.OSE=new OGX.OSE,OGX.OSE.SCRIPT_LOADED="OSE_SCRIPT_LOADED",OGX.OSE.SCRIPTS_LOADED="OSE_SCRIPTS_LOADED",void 0===OGX)var OGX={};if(OGX.Overlay=function(e){"use strict";var t=this,i=!1,n=!1,o={anim:OGX.Overlay.FADE,display:{css:"",html:" "},index:!1,close_on_click:!1},a=!1,r="mousedown";function s(e){i&&(e?i.on(r,l):i.off(r,l))}function l(){"function"==typeof a.close_on_click&&a.close_on_click.apply(null,t),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,o),e.display.hasOwnProperty("_NAME_")||(e.display=new OGX.Display(e.display)),a=e,!this.hasOverlay()){var t=this.el;a.hasOwnProperty("el")&&(t=$(a.el));var n="z-index:"+(a.zindex?a.zindex:this.topIndex(t))+";",r='
'+a.display.html()+"
";if(t.prepend(r),(i=t.children(".ogx_overlay").first()).off("transitionend"),a.anim)switch(a.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?a.anim&&(t=a.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.pholder&&this.pholder.length&&"default"!==this.pholder||(this.pholder=""),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 o in e)0===o.indexOf("default")&&(n=o.replace("default",t[i]),i++,e[n]=e[o],delete e[o])}if(void 0!==e&&void 0!==t){e.hasOwnProperty("node:OML")||(e["node:OML"]=[]);var o,a=e["node:OML"];a&&"string"==typeof a&&(0===a.indexOf("{{")?e["node:OML"]=OGX.OSE.exec(a):e["node:OML"]=OGX.Cache.read("oml",e["node:OML"]));for(var r=0;r=i.points[t].min&&a{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,o=r.height,a=0,s=0;return p||(i=OGX.Data.getBestSize(e,i),o=OGX.Data.getBestSize(t,o)),r.center?("string"==typeof i&&(i=-1!==i.indexOf("%")?Math.round(e*Number(i.substr(0,i.length-1))/100):Number(i)),"string"==typeof o&&(o=-1!==o.indexOf("%")?Math.round(t*Number(o.substr(0,o.length-1))/100):Number(o)),x=Math.round(e/2-i/2),y=Math.round(t/2-o/2),r.center&&_&&(r.center=!1)):(_?(x=n.x,y=n.y):r.x&&r.y?(-1!==String(r.x).indexOf("%")?(a=i/2,x=e*Number(r.x.slice(0,-1))/100-a):x=r.x,-1!==String(r.y).indexOf("%")?(s=o/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-o/2)),x>e&&(x=e-x),x<-i&&(x=0),y>t&&(y=t-o),y<0&&(y=0)),{x:x,y:y,w:i,h:o}}function N(e,t,i,o,a,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"),b=!0,e?n.resizeNodes():s.css({display:"none",visibility:"hidden"}),f&&s.removeClass(f),I(i,o,a)})),f&&s.addClass(f)):(s.removeClass(f),I(i,o,a))}else e?s.css({opacity:e,display:"flex",visibility:"visible"}):s.css({display:"none",visibility:"hidden"}),I(i,o,a)}function I(e,t,i){void 0!==e&&e&&e(t),void 0!==i&&i&&i(n.id)}function A(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 Y(){for(var e,t="",i=0;i0&&(e=r.buttons[i].enabled?"":c+"_button_disabled",t+=''+r.buttons[i].label+"");return t}function R(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.onFocus=function(){this.enableResize(),r.icons&&r.icons.length&&W(!0),r.buttons&&r.buttons.length&&r.buttons_enabled&&A(!0),debug(5,"popup",r.id,"enabled")},this.onBlur=function(){this.disableResize(),r.icons&&r.icons.length&&W(!1),r.buttons&&r.buttons.length&&r.buttons_enabled&&A(!1),this.enabled=!1,debug(5,"popup",r.id,"disabled")},this.show=function(e,t,i){if(!this.visible){if(this._show(),!r.anim||e||b||(e=!0),!e&&r.anim&&"scale"==r.anim){var o=u.join(" ").replace(/scale\([0-9,\. ]+\)/,"");n.el.css({transform:o}),u=o.split(" ")}N(1,e,t,i),this.focus(1)}return this},this.hide=function(e,t,i,n,o){return this.visible&&(this._hide(),N(0,e,t,i,n,o),this.blur(1)),this},this.resize=function(){return X(),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%",T(),this.move(0,0)),this},this.normalize=function(){return r.maximize&&v&&(v=!1,r.width=O.width,r.height=O.height,T(),this.move(O.x,O.y),O=null),this},this.width=function(e,t,i){return void 0===e?r.width:(void 0===i&&(i=!1),void 0===t&&(t=!1),t&&n.el.removeClass("ogx_popup_notrans"),r.width=e,G(["width"],i),T(),this)},this.height=function(e,t,i){return void 0===e?r.height:(void 0===i&&(i=!1),void 0===t&&(t=!1),t&&n.el.removeClass("ogx_popup_notrans"),r.height=e,G(["height"],i),T(),this)},this.destroy=function(){s.off("transitionend"),this.touch.wipe()},this.buttons=function(e){if(void 0===e)return r.buttons;R(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&&(o+='
"),r.title&&(o+='
'+r.title+"
"),o+='
',r.icons&&(o+=H()),o+="
");var a,d=1;if(u=["translate3d("+e.x+"px, "+e.y+"px, 0)"],r.anim)switch(r.anim){case OGX.Popup.FADE:d=0,a=c+"_fade";break;case OGX.Popup.SCALE:a=c+"_scale",u[1]="scale("+r.anim_param.scale+", "+r.anim_param.scale+")"}o+='
',r.html?o+=r.html:r.template&&(o+=OGX.Templater.make(OGX.Templater.get(r.template),r.data)),o+="
",r.buttons&&r.buttons.length&&(o+='
',o+=Y(),o+="
"),s.html(o),s.css({width:t,height:i,opacity:d,transform:u.join(" "),"z-index":n.z}),r.anim&&s.addClass(a),n.el=s,l=s.children("."+c+"_buttons").first()}(),r.drag){var e={x:!0,y:!0,cb_down:S,cb_up:L,cb_drag:k,target:"."+c+"_head"};r.group||"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:w,cb_down:D,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,o,a,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,o=u.pageY;var f=d.el.position();t=f.left,i=f.top;var h=d.el.offset(),g=n-h.left,p=o-h.top;v.w=d.el.width(),v.h=d.el.height(),a=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;a&&s&&(e+=a),r&&l&&(n+=r),a&&-1===s&&r&&1===l&&(n=i),d.el.css("transform","translate3d("+e+"px, "+n+"px, 0)")}s&&v.w+a*s>c.min_width&&(_?d.el.width(Math.round(100*(v.w+a*s)/d.el.parent().width()*100)/100+"%"):d.el.width(v.w+a*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)),(a||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),a=e.pageX-n,r=e.pageY-o}function T(e){b(!1),G(!1),e=E(e),a=e.pageX-n,r=e.pageY-o,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,o,a,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){o=e.y,X(!0)}function w(e){var t;e.dirY!==a?(t=0,o=e.pt1.y):(t=e.pt1.y-o,o=e.pt1.y),a=e.dirY,i.css({transition:"none",transform:"translate3D(0px, "+(C(i)+t)+"px, 0px)"})}function G(e){X(!1),trans=C(i);var t=Math.round(trans/n)*n,o=Math.round(t/n%d.list.length);if(o=o<=0?Math.abs(o):d.list.length-o,g!==o){switch(g=o,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,o;(e=Math.floor((i.position().top+n*a)/(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){o=i.position().top+$(t).position().top,(Math.ceil(o+n*d.list.length)<-n||o>n)&&$(t).remove()})),h=e)}function E(){X(!1),i.off("transitionend",E)}function D(){var e="",o='
';o+='
';for(var a=0;a<2;a++){o+='
';for(var r=0;r'+e+"
"}o+="
"}if(o+="
",d.icon&&(o+='
'),void 0===g&&(g=0),d.name){var l="";switch(d.required&&(l=" required"),f){case"string":o+='";break;case"object":o+='"}}t.html(o),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 C(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.onFocus=function(){return t.removeClass(_+"_disabled"),d.icon&&v(!0),p&&p.enable(),debug(5,"roulette",d.id,"enabled"),this},this.onBlur=function(){t.addClass(_+"_disabled"),d.icon&&v(!1),p&&p.disable(),X(!1),debug(5,"roulette",d.id,"disabled")},this.bindFilter=function(e,t,i){return d.list.removeFilter(e),d.list.addFilter(e,t,i),d.list.filter(),setTimeout(D,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 o=S(e).index;return o>-1&&(!function(e,t){void 0===t&&(t=!0);i.off("transitionend",E),X(!1),a=-1;var o=C(i),r=Math.round(o/n)*n,s=o-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=o+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}(o),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,o){var a=g,r=S(t).index;r>-1&&(g=r);var s=a-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, "+(C(i)+(s*n-d.list.length*n*e))+"px, 0px)"}),i.on("transitionend",E),d.name&&m(t,o),void 0!==o&&o&&(this.onSelect(val),this.el.trigger(OGX.Roulette.CHANGE,val)),this},this.next=function(e){var t,i=O(1);switch(a=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(D,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[data-ogx-id="'+l.id+'"] .ogx_roulette_container',capture:d.capture}),d.enabled&&p.enable()}),null),D(),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,o=this,a=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,o){e.stopImmediatePropagation();var a,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[o].roulette.setData(g(i),t),i.push(t)));setTimeout(d,0)}function g(e){for(var t=a.data,i=0;i-1?f(n):{};h(e)},a=OGX.Data.merge(a,r),(t=o.el).addClass("ogx_roulette_tree"),o.observeOnce({childList:!0},(function(){setTimeout((()=>{a.value?h(a.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=a.groups[d-1],e=[{label:i,value:"",head:!0}],l)e.push({label:u,value:u});c=o.create("Roulette",{el:'.ogx_roulette_tree[data-ogx-id="'+o.id+'"] .ogx_roulette_tree_roulette[data-ogx-roulette="'+d+'"]',list:e,icon:a.icon,value:null,name:i,enabled:!1,required:a.required}),s.push({roulette:c,group:i,id:c.id})}if(dt.time+i))}function doCache(e){var t=getStageDefault(app.getStage());if(t){t.uxi.detach();var i={url:e.url,uxi:t.uxi,time:Math.round((new Date).getTime()/1e3)};cache.insert(i),debug(4,"Router caching at",route.url)}}function unCache(e){var t=getCache(e);t&&(t.uxi.kill(),cache.findDelete("url",e.url,1))}function useCache(e){var t=getCache(e);if(t){var i=app.getStage();t.uxi.attach(i,$(i.pholder)),cache.delete("url",e.url,1),route=e}}function getCache(e){return cache.get({url:{eq:e.url}},null,1)}function findRoute(e){var t,i,n,o;debug(4,"Router route lookup",e);var a,r=[],s=OGX.Data.clone(config.routes);for(var l in s){for(r=[],a=s[l],n=l;i=/(?!\/)([a-z0-9_\-]+)\:([^\/]+)/gi.exec(n);)n=n.replace(i[0],i[2]),r.push(i[1]);if((t=e.match("^"+n+"$"))&&t.length){t.shift(),"string"==typeof a&&(debug(2,'Setting OML as string in route is deprecated, use {oml:"'+e+'"}'),a={oml:OGX.Data.clone(OGX.Cache.read("oml",a))}),"string"==typeof a.oml&&(a.oml=OGX.Data.clone(OGX.Cache.read("oml",a.oml))),o={};for(var d=0;d1e3*e&&that.goto(route.url,{reload:!0,history:!1})}function onBlur(){blured=!0,time=(new Date).getTime()}function handleVisibilityChange(){"visible"===document.visibilityState?onFocus():onBlur()}function init(){request={route:null,url:global_url,origin:global_url};var e=null;if(-1!==window.location.href.indexOf("#")){e=window.location.href.split("#").pop(),request.url=e;var t=findRoute(e);t?request.route=t:(debug(2,"404",e),config.errors[404]?(t=findRoute(config.errors[404]),request.route=t):$(document).trigger(OGX.Router.NOT_FOUND,{url:e}))}$(document).on("click touchstart mousedown","a",captureLink),config.options.idle&&$(document).on("visibilitychange",handleVisibilityChange)}this.url=function(){return url},this.start=function(){$(document).on("backbutton",onBackButton),$(window).on("popstate",onPopState)},this.stop=function(){$(document).off("backbutton",onBackButton),$(window).off("popstate",onPopState)},this.lock=function(){locked=!0},this.unlock=function(){locked=!1},this.gate=function(e){"function"==typeof e?gate=e:debug(1,"Router gate must be a function")},this.isLocked=function(){return locked},this.addToHist=function(e){var t={url:e};history.pushState(t,"title"+(new Date).getTime(),page+"#"+e)},this.request=function(){return request},this.expire=function(e){var t=getCache({url:e});t&&unCache(t)},this.goto=function(__url,__options){if(route?debug(3,"Router navigate from",global_url,"to",__url):debug(3,"Router navigate to",__url),!locked){void 0!==__options&&__options||(__options={}),OGX.Data.merge(__options,options_default);var r=findRoute(__url);if(request.url=__url,request.origin=global_url,r){request.route=r,r.route.hasOwnProperty("reload")&&(__options.reload=r.route.reload),r.route.hasOwnProperty("scope")||(r.route.scope="public");var access=!0;if(OGX.Scope.eval(r.route.scope)||(debug(2,"invalid scope for",__url),access=!1),config.options.eval){var fnc=eval(config.options.eval);if(!fnc)return debug(1,"route eval function not set!",config.options.eval),!1;if(fnc){var res=fnc(r);res||(access=!1)}}if(!access)return config.errors.hasOwnProperty("403")?setTimeout((function(){app.goto(config.errors[403],{history:!0})}),0):$(document).trigger(OGX.Router.FORBIDDEN,{url:__url,scope:r.route.scope}),!1;if(delete r.route.scope,r.route.hasOwnProperty("origin")){debug(5,"Router test origin",global_url,r.route.origin);for(var valid=!1,origins=r.route.origin.split(","),reg,i=0;i0}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,o,a,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,content:!1,overflow:!0},p=0,_="init",m=!1,v=!1,y=null;function x(e){e?i.on(f.touch.down,O):i.off(f.touch.down,O)}function O(e){e=f.event(e),S(!1),G(!0),b(!0),x(!1),L("in"),D(!0)}function b(e){e?(c=setInterval(E,10),i.on(f.touch.move,w)):(clearInterval(c),i.off(f.touch.move,w))}function w(e){e=f.event(e)}function G(e){e?$(document).on(f.touch.up,X):$(document).off(f.touch.up,X)}function X(){b(!1),G(!1),x(!0),D(!1),L("out")}function T(e){e?(window.addEventListener("resize",N),i.on("scroll",(function(e){e.stopImmediatePropagation(),E()})),i.on("wheel",(function(e){D(!0)})),void 0!==OGX.NestedList&&$(document).on(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED,(function(){f.update()}))):(window.removeEventListener("resize",N),i.off("scroll"),i.off("wheel"),void 0!==OGX.NestedList&&$(document).off(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED))}function E(){var e,o=(e=i.scrollTop())/s,r=Math.round(a.position().top);a.css("top",o+"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.ceil(o)&&f.el.trigger(OGX.Scroller.BOTTOM):0===e&&(r&&r!==Math.round(o)||!r)&&f.el.trigger(OGX.Scroller.TOP)),h.scroll_callback&&h.scroll_callback()}function D(e){e?(d&&D(!1),l=t.position().top,d=setInterval(C,h.check_delay-10)):(d&&(clearInterval(d),d=null),v=!1,f.el.trigger(OGX.Scroller.END))}function C(){var e=t.position().top;e!==l?(v||(v=!0,f.el.trigger(OGX.Scroller.START)),L("in")):L("out"),l=e}function S(e){e?u=setInterval(E,h.check_delay):clearInterval(u)}function L(e){a.hasClass("ogx_scroller_track_anim")||a.addClass("ogx_scroller_track_anim"),"in"===e?(clearTimeout(y),y=null,a.addClass("ogx_scroller_track_anim_fade_in").removeClass("ogx_scroller_track_anim_fade_out")):y||(y=setTimeout((function(){a.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(o=i.innerHeight(),n=t.height(),s=n/o,n>o){var e=Math.round(o/s);a.css("height",e+"px"),r.css("display","block")}else r.css("display","none");"init"===_&&(_=OGX.Scroller.READY,f.el.trigger(OGX.Scroller.READY))}this.onFocus=function(){return N(),T(!0),h.observe&&setTimeout((function(){k(!0)}),0),x(!0),debug(5,"scroller",h.id,"enabled"),this},this.onBlur=function(){return T(!1),h.observe&&k(!1),G(!1),b(!1),x(!1),D(!1),S(!1),a.removeClass("ogx_scroller_track_anim_fade_in"),a.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.overflow=function(e){if(void 0===e)return h.overflow;h.overflow!==e&&(h.overflow=e,e?(this.onFocus(),this.el.removeClass("ogx_scroller_no_overflow")):(this.onBlur(),this.el.addClass("ogx_scroller_no_overflow")))},this.top=function(){return n>o&&(i[0].scrollTop=0,N()),this},this.bottom=function(){return n>o&&(i.scrollTop(n),N()),this},this.max=function(){return t.height()-i.height()},this.scroll=function(e){return void 0===e?i[0].scrollTop:(i[0].scrollTop=e,N(),this)},this.mute=function(){return 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"),h.content&&t.append(h.content);var e='
';i.parent().append(e),r=i.parent().find(".ogx_scroller_track"),a=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,o,a=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(a.touch.down,".ogx_stacked_tree_level .ogx_stacked_tree_level_prev",g),t.on(a.touch.down,".ogx_stacked_tree_level_list .ogx_dynamic_list_item",(function(e){var t=$(this).data("ogx-id");t--,function(e,t){u=t;var i=l[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=o.css(u)).replace(f+"_door",""),d+='
'+o.html(u)+"
"),d+='
',i.append(d),i.children("."+f+"_level").css("flex-basis",Math.floor(100/(e+1)*100)/100+"%"),function(e,t,i){l[e]&&a.remove(l[e].id,"DynamicList");var n=a.create("DynamicList",{el:t,mode:"static",scroll:!0,display:s.display,displays:s.displays,list:i});l[e]=n}(e,"."+f+'[data-ogx-id="'+a.id+'"] > .'+f+"_container > ."+f+'_level[data-level="'+e+'"] > .'+f+"_level_list",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)+"%"),a.remove(l[e+1].id,"DynamicList"),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.onFocus=function(){h(!0),p(!0),debug(5,"stackedtree",s.id,"enabled")},this.onBlur=function(){h(!1),p(!1),debug(5,"stackedtree",s.id,"disabled")},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=(o=new OGX.Display(s)).val();if(e=function(e){if(e.display&&"object"==typeof e.display&&!e.display.hasOwnProperty("bind")&&(e.display=i(e.display)),e.displays)for(var t in e.displays)e.displays[t]=i(e.displays[t]);function i(e){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),o.val(e),s.display=e.display,s.displays=e.displays,(t=a.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.__proto__.onFocus=function(){return i.closeable&&n(!0),this},this.__proto__.onBlur=function(){return i.closeable&&n(!1),this},function(){i.hasOwnProperty("theater")&&(t.theater=i.theater),t.home=i.home;var e=new OGX.Display(i),n="block";i.hasOwnProperty("use")&&i.use||(n="none");var o="";i.closeable&&(o='
');var a=e.html();i.hasOwnProperty("data")&&(a=OGX.Templater.make(a,i.data)),o+=a,container=t.el,container.html(o),container.addClass("ogx_stage").css("display",n)}()},OGX.Stage.SWAP="swap",OGX.Stage.FLIP="flip",void 0===OGX)var OGX={};if(require("Switch","Uxi","Bind","Touch"),OGX.Switch=function(e){construct(this,"Switch");var t,i=this,n=e,o={el:"document",bind:!1,labels:!0,data:[{label:"OFF",value:!1},{label:"ON",value:!0}],value:!1,name:!1,callbacks:{change:null}},a="ogx_switch";function r(e){n.value===n.data[0].value?n.value=n.data[1].value:n.value=n.data[0].value,s(e)}function s(e){e=void 0!==e;var i=t.find("."+a+"_dot").first(),o=t.find("."+a+"_label").first(),r=t.find("."+a+"_label").last();n.value==n.data[0].value?(i.removeClass(a+"_dot_right").addClass(a+"_dot_left"),o.removeClass(a+"_label_off").addClass(a+"_label_on").addClass(a+"_selected"),r.removeClass(a+"_label_on").addClass(a+"_label_off").removeClass(a+"_selected")):(i.removeClass(a+"_dot_left").addClass(a+"_dot_right"),r.removeClass(a+"_label_off").addClass(a+"_label_on").addClass(a+"_selected"),o.removeClass(a+"_label_on").addClass(a+"_label_off").removeClass(a+"_selected")),n.name&&t.find('input[type="hidden"]').attr("value",n.value),e&&t.children("."+a+"_val").trigger("input")}function l(e){e?t.on(i.touch.down,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("."+a+"_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.onFocus=function(){return l(!0),t.removeClass(a+"_disabled"),debug(5,"switch",n.id,"enabled"),this},this.onBlur=function(){return l(!1),t.addClass(a+"_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("."+a+"_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,o),void 0!==e&&(n.value=e),(t=i.el).addClass(a+"_disabled");var r=t.parent();r[0].hasAttribute("data-value")&&(n.value=OGX.Data.stringToVal(r.data("value")),r.removeAttr("data-value"))}(),function(){var e="";n.labels&&(e+=''+n.data[0].label+"");var i="";n.value===n.data[1].value&&(i=a+"_dot_right"),e+='
',n.labels&&(e+=''+n.data[1].label+""),n.name&&(e+=''),t.html(e),t.addClass(a)}(),setTimeout(s,0)},OGX.Switch.CHANGE="SwitchChange",OGX.Switch.BIND=OGX.Switch.CHANGE,require("Tabs","Uxi","Touch"),OGX.Tabs=function(e){construct(this,"Tabs");var t=this,i=e;e.hasOwnProperty("editable")&&debug(2,"Tabs editable deprecated, use add/remove");var n,o={editable:!1,detach:!1,detach_min:-4,add:!0,remove:!0,reorder:!0,icons:!1,index:0,list:new OGX.List,display:{html:"",css:""},callbacks:{select:null,close:null,add:null,remove:null}},a=!1,r=0,s=!1,l=!1,d=!1,c=!1,u=!1,f={x:0,y:0},h="ogx_tabs";function g(){r>0?r--:r=0,t.index(r)}function p(){for(var e,t,o='
',s=0;s',i.icons&&(o+=''),e&&(o+=''+e+""),i.remove&&(o+=''),o+="
",t="";o+="",i.add&&(o+='
',n.addClass(h+"_editable")),n.html(o),a=n.children("."+h+"_container").children("."+h+"_tab:eq("+r+")")}function _(e){s||(u=!1,l=$(e),r=l.index(),d={from:r},n.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"),a=l,s.el.addClass(h+"_tab_active").addClass(h+"_float").css("transform","translate3d("+f.x+"px, "+s.y+"px, 0px)"),n.children("."+h+"_container").prepend(s.el),n.trigger(OGX.Tabs.SELECT,i.list[r]),c=setInterval(v,5))}function m(e){if(s)if(u=e,Math.abs(u.distX)>Math.abs(u.distY)){var o=s.x+u.distX;s.el.css("transform","translate3d("+o+"px, "+s.y+"px, 0px)")}else{var a=s.y+u.distY;s.el.css("transform","translate3d("+s.x+"px, "+a+"px, 0px)");var r=s.el.offset();if(u.distYMath.abs(u.distY)&&n.children("."+h+"_container").children("."+h+"_tab").each((function(n,o){(e=$(o)).hasClass(h+"_tab_active")||(t=e.position(),i=e.width(),idx!==n&&(s.x+u.distX>t.left+i/2&&s.x+u.distXt.left&&s.x+u.distXe&&t.css("transform","translateX("+-1*(i-e)+"px)")}),0),this},this.addAt=function(e,t){return i.icons&&(e.hasOwnProperty("icon")||(e.icon=i.icon_default)),i.list.insert(e,t),r=t,setTimeout(p,0),this},this.remove=function(e,t){void 0===t&&(t=e,e="label");var o=i.list.findIndex(e,t);i.list.findDelete(e,t,1)&&(n.children("."+h+"_container").first().children("."+h+"_tab:eq("+o.index+")").remove(),g())},this.removeCurrent=function(){return a&&this.removeAt(r),this},this.removeAt=function(e){return i.list.delete(e)&&(n.children("."+h+"_container").first().children("."+h+"_tab:eq("+e+")").remove(),g()),this},this.enableTab=function(e){return n.children("."+h+"_container").first().children("."+h+"_tab:eq("+e+")").removeClass(h+"_tab_disabled"),this},this.disableTab=function(e){return n.children("."+h+"_container").first().children("."+h+"_tab:eq("+e+")").addClass(h+"_tab_disabled"),this},this.index=function(e){return void 0!==e?(a&&(a.removeClass(h+"_tab_active"),a=null),(a=n.children("."+h+"_container").first().children("."+h+"_tab:eq("+e+")")).addClass(h+"_tab_active"),r=e,!0):a?r:-1},this.select=function(e){a&&a.removeClass(h+"_tab_active");var t=i.list.findIndex("label",e);return this.index(t.index),this},void 0!==OGX.List?(debug(5,"tabs",i.id,"init"),i||(i={}),OGX.Data.merge(i,o),i.list.hasOwnProperty("insert")||(i.list=new OGX.List(i.list)),i.display.hasOwnProperty("_NAME_")||(i.display=new OGX.Display(i.display)),i.callbacks.select||(i.callbacks.select=t.onSelect),i.callbacks.close||(i.callbacks.close=t.onClose),i.callbacks.add||(i.callbacks.add=t.onAdd),i.callbacks.remove||(i.callbacks.remove=t.onRemove),(n=t.el).addClass(h),i.editable&&n.addClass(h+"_editable"),r=i.index,setTimeout(p,0),i.reorder&&t.touch.add("Hold",{id:"tabs_hold",cb_hold:_,cb_move:m,cb_up:y,state:"manual",time:1e3,target:".ogx_tabs_tab",capture:!1})):debug(1,"OGX.List not found! ")},OGX.Tabs.SELECT="TabsSelect",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 o=''+e+""+n+"";container.find(".ogx_tags_tags").first().append(o),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,o=0;o";break;case OGX.Tags.MODE_OBJECT:i+=''+t[o].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.onFocus=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.onBlur=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,o=[],a=0;a-1&&(i.includes(n.items[o][a])||i.push(n.items[o][a]));return e(n.items[o]),!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(n)},void 0===OGX)var OGX={};if(OGX.Templater=function(){"use strict";var e;this.jmake=function(e,t){for(var i,n,o=JSON.stringify(e);m=/({{(\$|#)[a-z0-9_\.]*}})|("{{(\$)}}")/gi.exec(o);)m[0].match(/"{{(\$)}}"/)?(i="<-"+(i=JSON.stringify(t)).substring(1).slice(0,-1)+"->",o=(o=(o=o.replace(m[0],i)).replace(/<\-/,"{")).replace(/\->/,"}")):("object"==typeof(n=OGX.OSE.exec(m[0],t))&&(n=JSON.stringify(n),m[0]='"'+m[0]+'"'),o=o.replace(m[0],n));return JSON.parse(o)},this.make=function(t,i,n,o,a){var r,s;for(e={},void 0===a&&(a={}),OGX.Data.merge(e,a),debug(5,"Templatizing",t);r=/{{[^{]+(({[^{]+)+)?}}/gi.exec(t);)void 0===(s=OGX.OSE.exec(r[0],i,n,o,e))&&(s=""),t=t.replace(r[0],s);return debug(5,"Templatized",t),t},this.amake=function(e,t,i,n,o){for(var a="",r=0;r{{$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),o.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();o.observe(!0,{childList:!0},(function(){o.observe(!1),(n=i.children(".ogx_theater_trans")).on("transitionend",(function(){n.off("transitionend"),o.hide(),n.remove(),t.url?(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)"})}),a.timeout)}),null,i),i.append('
")}(t.id)}))):($(document).off("backbutton",u),$(window).off("popstate",u),list.el.off(OGX.DynamicList.SELECT))}function u(){o.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=o.create("DynamicList",{el:".ogx_theater > .list",display:{html:a.display.html,css:"ogx_theater_stage"},key:"id",scroll:!0,mode:"hit",list:i,trigger:!0})}function 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(a,r),a.display&&("object"!=typeof a.display&&(a.display={}),OGX.Data.merge(a.display,s),a.display.template&&(a.display.html=OGX.Templater.get(a.display.template))),(t=o.el).addClass("ogx_theater").css("visibility","hidden"),i=$("body"),"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,o){var a=new OGX.Touches[e](t),r=a.set(o);return!r.hasOwnProperty("id")&&(r.id=i++),a.id=r.id,"auto"===r.state&&!t.blured&&t.enabled&&a.enable(),n.insert(a),a},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;ea.x?1:-1,l=r.y>a.y?1:-1,d=Math.abs(r.x-a.x),c=Math.abs(r.y-a.y),u=Math.sqrt(Math.abs(Math.pow(r.x-a.x,2)-Math.pow(r.y-a.y,2)))}function b(){o.cb_swipe&&(o.x&&o.min_x&&d>=o.min_x||o.y&&o.min_y&&c>=o.min_y?x(0,!0):o.cb_swipe({pt0:a,pt1:r,dirX:s,dirY:l,distX:d,distY:c,dist:u}))}this.set=function(e){return o=e,OGX.Data.merge(o,n),t=i.selector,this.state=o.state,"auto"===o.state&&(i.enable,i.disable),o.target&&(t=o.target),o},this.enable=function(){!h&&o&&(h=!0,y(!0))},this.disable=function(){h&&(h=!1,y(!1),m(!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,parent:null,state:"auto"},i=!1,n=!1,o=!1,a=!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,g=$("body");function p(e){var t=[];e?i.parent?i.parent.on.apply(i.parent,[l.touch.down,_]):(t=i.target?[l.touch.down,i.target,_]:[l.touch.down,_],l.el.on.apply(l.el,t)):i.parent?i.parent.off.apply(i.parent,[l.touch.down,_]):(t=i.target?[l.touch.down,i.target,_]:[l.touch.down,_],l.el.off.apply(l.el,t))}function _(e){e=l.event(e),h=e.currentTarget,a||(a=!0,n=(new Date).getTime(),f.x=d.x=e.pageX,f.y=d.y=e.pageY,o=setInterval(v,1))}function m(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(o),o=!1)}function v(){a&&(new Date).getTime()-n>i.time&&(r||(r=!0,g.on(l.touch.move,m),i.cb_hold?i.cb_hold(h,d):l.el.trigger(OGX.Touch.HOLD_START)))}function y(t){t=e.event(t),a=!1,clearInterval(o),o=!1,r&&(r=!1,g.off(l.touch.move,m),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,p(!0),g.on(l.touch.up,y))},this.disable=function(){s&&(s=!1,(a||o)&&(r=!1,a=!1,clearInterval(o),o=!1),p(!1),g.off(l.touch.up,y),g.off(l.touch.move,m))}},OGX.Touches.Drag=function(e){"use strict";var t,i,n,o,a,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,parent:null,state:"auto"},d=e,c=!1,u=!1,f=$("body");function h(e){var t=[];e?s.parent?s.parent.on.apply(s.parent,[d.touch.down,g]):(t=s.target?[d.touch.down,s.target,g]:[d.touch.down,g],d.el.on.apply(d.el,t)):s.parent?s.parent.off.apply(s.parent,[d.touch.down,g]):(t=s.target?[d.touch.down,s.target,g]:[d.touch.down,g],d.el.off.apply(d.el,t))}function g(l){s.capture&&(l.preventDefault(),l.stopImmediatePropagation()),l=e.event(l),n=l.pageX,o=l.pageY;var c=d.el.position();t=c.left,i=c.top;var u=d.el.offset(),f=n-u.left,h=o-u.top;if(s.border){if(fd.el.width()-s.border)return;if(hd.el.height()-s.border)return}a=0,r=0,p(!0),_(!0),s.cb_down&&s.cb_down({x:n,y:o,target:l.target})}function p(e){e?c||(c=setInterval(y,10)):c&&(clearInterval(c),c=null)}function _(e){e?(f.on(d.touch.move,v),f.on(d.touch.up,m)):(f.off(d.touch.move,v),f.off(d.touch.up,m))}function m(t){p(!1),_(!1),t=e.event(t),s.x&&(a=t.pageX-n),s.y&&(r=t.pageY-o),s.cb_up&&s.cb_up({distX:a,distY:r})}function v(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&&(a=i,l=!0):(a=i,l=!0)):s.min?Math.abs(i)>s.min&&(a=i,l=!0):a=i),s.y&&(i=t.pageY-o,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:a,distY:r,x:t.pageX,y:t.pageY})}function y(){d.el.css({transform:"translate3d("+(t+a)+"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,h(!0))},this.disable=function(){u&&(u=!1,h(!1),_(!1),p(!1))}},OGX.Touches.Move=function(e){"use strict";var t,i,n,o,a,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,parent:null,state:"auto"},u=e,f=!1,h=$("body");function g(e){var t=[];e?d.parent?d.parent.on.apply(d.parent,[u.touch.down,p]):(t=d.target?[u.touch.down,d.target,p]:[u.touch.down,p],u.el.on.apply(u.el,t)):d.parent?d.parent.off.apply(d.parent,[u.touch.down,p]):(t=d.target?[u.touch.down,d.target,p]:[u.touch.down,p],u.el.off.apply(u.el,t))}function p(c){d.capture&&(c.preventDefault(),c.stopImmediatePropagation()),c=e.event(c),t=c.pageX,i=c.pageY,n=0,o=0,a=0,r=0,s=0,l=0,_(!0),d.cb_down&&d.cb_down({target:c.target,x:t,y:i})}function _(e){e?(h.on(u.touch.move,v),h.on(u.touch.up,m)):(h.off(u.touch.move,v),h.off(u.touch.up,m))}function m(s){if(_(!1),s=e.event(s),d.x&&(n=s.pageX-t),d.y&&(o=s.pageY-i),d.cb_up&&d.cb_up({x:s.pageX,y:s.pageY,distX:n,distY:o,dirX:a,dirY:r}),d.cb_click){var l=!1;d.x&&Math.abs(n)<2&&(l=!0),d.y&&Math.abs(o)<2&&(l=!0),l&&d.cb_click(s)}}function v(c){d.capture&&(c.preventDefault(),c.stopImmediatePropagation()),c=e.event(c);var u,f=!1;d.x&&(a=0,sc.pageX&&(a=-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&&(o=u,f=!0):(o=u,f=!0)):(o=u,f=!0)),f&&d.cb_move&&d.cb_move({distX:n,distY:o,dirX:a,dirY:r,x:c.pageX,y:c.pageY})}this.set=function(e){return d=e,OGX.Data.merge(d,c),"auto"===d.state&&(u.enable,u.disable,this.enable()),this.state=d.state,d},this.enable=function(){!f&&d&&(f=!0,g(!0))},this.disable=function(){f&&(f=!1,g(!1),_(!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,o,a,r,s,l,d=this,c='{{$label}}',u=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:c}},file:{mode:"file",display:{html:c}},folder:{mode:"folder",display:{html:c}}},data:{_id:0,type:"root",state:"closed",label:null,items:[]},display:null,callbacks:{select:null,unselect:null,open:null,close:null,move:null}},h="_id",g=0;function p(e,t,i,n,o){return e[h]===o[h]&&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[h]=t[h],OGX.Data.merge(i,e,!0),OGX.Templater.make('
',i)}function m(){var e=_({},u.data);t.html(e),u.data.element=t.children(".ogx_tree_item").first(),u.data.uxi=d,O(u.data,d),u.show_root||u.data.element.addClass("ogx_tree_root_hidden")}function v(){m(),y(u.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)),u.sort.enabled&&e.items.order(u.sort.property,u.sort.way);for(var o=0;o .ogx_tree_item_content';if(i.display.hasOML()){var o=i.display.oml(n,e,!1);OGX.OML.render(t,o,e),e.uxi=t.nodes.last()}else{var a=i.display.html(e);a=OGX.Templater.make(a,e),$(n).html(a)}}function b(e){return delete e.element,delete e.parent,delete e.uxi,delete e.state,l||delete e[h],!1}function w(e){"folder"===k(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(){return!!s&&D(s)}function T(e){var t=C(e);t&&(s=e,t.children(".ogx_tree_item_content").addClass("ogx_tree_selected_item"))}function E(e,t){return L((function(i){return i[h]===t&&(i.hasOwnProperty("items")||(i.items=new OGX.List),!i.items.hasOwnProperty("insert")&&(i.items=new OGX.List(i.items)),i.items.push(e),i.state="open",w(i),!0)}))}function D(e){if(!e||"root"===e)return u.data;return L((function(t,i){return t[h]===e&&t}))}function C(e){var t=D(e);return!!t&&t.element}function S(){g=1,L((function(e){return e[h]=g++,e.hasOwnProperty("type")||(e.hasOwnProperty("items")?e.type="folder":e.type="file"),!1}))}function L(e,t,i){var n;return void 0===t&&(t=null),void 0===i&&(i=u.data),(n=function i(o,a,r,s){if(n=e(o,a,r,s,t))return n;if(o.hasOwnProperty("items")&&o.items.length)for(var l=0;l .ogx_tree_item_content",(function(e){e.preventDefault(),M($(this).parent(0)),1!==$(this).parent(0).data("id")&&function(){a&&clearInterval(a);r=(new Date).getTime(),a=setInterval(I,50)}()})),$(document).on(d.touch.up,(function(){P(),n&&(A(!1),function(){var e=n.offset().left,a=n.offset().top,r=(l=e,c=a,L((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()&&c>=u.top&&c<=u.top+f.height()&&e}))),s=k(r);var l,c,u,f;!r||r&&(r[h]===i[h]||"folder"!==s.mode)?(o.css("opacity",1),n.remove(),n=null,i=null):(p=r,function(e){L((function(t,i,n,o){return t[h]===e&&(n.items.splice(o,1),n.items.length||(n.state="closed"),w(n),!0)}))}((g=i)[h]),E(g,p[h]),p.element.children(".ogx_tree_item_container").empty(),p.state="open",y(p,p.element),w(p),o.remove(),n.remove(),n=null,d.onMove(i),t.trigger(OGX.Tree.DROP,i),i=null);var g,p}())}))):t.on("click",".ogx_tree_item > .ogx_tree_item_content",(function(e){M($(this).parent(0))})),t.on(d.touch.down,".ogx_tree_item_arrow",(function(e){e.preventDefault(),P();var i=D($(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))}))):(u.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 I(){var e;(new Date).getTime()-r>=u.drag_after&&(s&&(i=D(s))&&(e=i.element,o=e,(n=e.clone()).children(".ogx_tree_item_arrow").css("display","none"),e.css("opacity",.3),n.addClass("ogx_tree_item_drag"),n.css({top:e.offset().top,left:e.offset().left}),t.prepend(n),A(!0),t.trigger(OGX.Tree.DRAG,i)),P())}function A(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(){a&&(clearInterval(a),a=null)}this.onFocus=function(){return N(!0),debug(5,"tree",u.id,"enabled"),this},this.onBlur=function(){return N(!1),debug(5,"tree",u.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=D(t);if("folder"===k(i).mode){l||(e[h]=++g),E(e,t);var n=k(e);x(i.element.children(".ogx_tree_item_container").first(),e),O(e,i.parent);var o=i.uxi;return n.display.hasOML()&&(o=i.uxi.nodes.last()),y(e,o),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,i,n=D(e);return!!n&&(t=n,i={},OGX.Data.merge(i,t),b(i),i)},this.selectItem=function(e){return T(e),X()},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 L(i)}(e,t);return!!i&&(G(),T(i[h]),X())},this.selectItemByPath=function(e){var t=function(e){var t=function(e){function t(t,i){return e===i+"/"+t.label&&t}return L(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"),X())},this.updateItem=function(e,t,i){void 0===i&&(i=!0);var n=D(e);if(n){if(n.uxi){var o=n.uxi.el;n.uxi.kill(),o.empty()}else i&&n.element.children(".ogx_tree_item_container").empty();OGX.Data.merge(n,t,!0),O(n,n.parent),i&&n.hasOwnProperty("items")&&n.items.length&&(y(n,n.parent),n.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_disabled ogx_tree_item_arrow_close").addClass("ogx_tree_item_arrow_open"),n.element.attr("state","open").attr("state",n.type+"-open"))}},this.replaceItem=function(e){var t=D(e[h]);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=D(e);if(t){var i=function(e){function t(t){return!(!t.hasOwnProperty("items")||!t.items.get({_id:{eq:e}},null,1))&&t}return L(t)}(e);return t.uxi&&t.uxi.kill(),i.items.findDelete("_id",e,1),t.element.remove(),i.items.length||(i.state="closed"),w(i),t}},this.deleteSelectedItem=function(){return function(){function e(e,t,i,n){if(e[h]===s)return e.element.remove(),i.items.splice(n,1),w(i),!0}if(s)return L(e);return!1}()},this.getSelectedItem=function(){return X()},this.getTree=function(){var e=L(b,null,OGX.Data.clone(u.data));return e||!1},this.setData=function(e){e.hasOwnProperty("types")&&this.setTypes(e.types),e.hasOwnProperty("tree")&&this.setTree(e.tree)},this.setTypes=function(e){u.types=e},this.setTree=function(e){this.scroll?this.clear([this.scroller.id]):this.clear(),u.data=e,u.data.hasOwnProperty("state")||(u.data.state="open"),l||S(),v()},this.newTree=function(){d.scroll?d.clear([d.scroller.id]):d.clear();g=0,m()},this.filterTree=function(e){!function(e){var t=[];function i(n,o,a,r){if(-1!==(o+n.label).indexOf(e)&&t.push(o+"/"+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 a=this;setTimeout((function(){a.scroller.resize()}),0)}else i.append(o),e.el='.ogx_uxi[data-ogx-id="'+this.id+'"]';this.el=$(e.el)}},OGX.Uxi.prototype.enable=function(e){return this.enabled||(this.enabled=!0,this.focus(e)),this},OGX.Uxi.prototype.disable=function(e){return this.enabled&&(this.enabled=!1,this.blur(e)),this},OGX.Uxi.prototype.ux=function(){},OGX.Uxi.prototype.onFocus=function(){},OGX.Uxi.prototype.onBlur=function(){},OGX.Uxi.onFocus=function(){},OGX.Uxi.onBlur=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._show()},OGX.Uxi.prototype.hide=function(){return this._hide()},OGX.Uxi.prototype._show=function(){return this.el&&(this.visible=!0,this.el.removeClass("ogx_uxi_hidden")),this},OGX.Uxi.prototype._hide=function(){return this.el&&(this.visible=!1,this.el.addClass("ogx_uxi_hidden")),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,o){var a=this,r=this.el,s=null;if(void 0!==o&&(r=o),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):a.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 o=this;this.observe(!0,e,(function(){o.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.ux(!0),this.__proto__.onFocus(),this.onFocus(),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)},OGX.Uxi.prototype.toJSON=function(){return{type:this._NAME_,id:this.id,selector:this.selector,data:this.data}},OGX.Uxi.prototype.toOML=function(){var e={},t=this.selector+":"+this._NAME_;if(e[t]={id:this.id,data:this.data,"node:OML":[]},this.nodes.length)for(var i=0;i$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,touch_drag;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(),o=config.parent.el.height();user_resized?(n=config.width,o=config.height):(e=OGX.Data.getBestSize(n,config.width),t=OGX.Data.getBestSize(o,config.height));var a={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&&(a.width=config.max_width+"px")):(-1!==(i=config.width).indexOf("px")&&(i=Number(i.split("px")[0])),config.min_width&&iconfig.max_width&&(a.width=config.max_width+"px"))),(config.min_height||config.max_height)&&(-1!==config.height.indexOf("%")?(o=config.parent.el.height(),i=Number(config.height.split("%")[0])*o/100,config.min_height&&iconfig.max_height&&(a.height=config.max_height+"px")):(-1!==(i=config.height).indexOf("px")&&(i=Number(i.split("px")[0])),config.min_height&&iconfig.max_height&&(a.height=config.max_height+"px"))),a}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&&!0!==t||(t=config.anim);var o={opac:1,tX:0,tY:0},a=container.parent().width(),r=container.parent().height(),s=that.el.outerWidth(),l=that.el.outerHeight(),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?(o.tY=0,d.addClass("ogx_window_main_icon_top")):o.tY=-l-10;break;case OGX.Window.ANIM_BOTTOM:e?(o.tY=0,d.addClass("ogx_window_main_icon_bottom")):o.tY=r+10;break;case OGX.Window.ANIM_RIGHT:e?(o.tX=a-s,d.addClass("ogx_window_main_icon_right")):o.tX=a+10;break;case OGX.Window.ANIM_LEFT:e?(o.tX=0,d.addClass("ogx_window_main_icon_left")):o.tX=-s-10}var c=100;e?(pt.x=o.tX,pt.y=o.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("+o.tX+"px, "+o.tY+"px, 0px)",opacity:o.opac,visibility:"visible"})}),c)}function placeWindow(e){var t=container.parent().width(),i=container.parent().height(),n=that.el.outerHeight(),o=that.el.outerWidth();that.el.removeClass("ogx_window_anim_in").removeClass("ogx_window_anim_out");var a={x:0,y:0};switch(config.anim){case OGX.Window.ANIM_TOP:a.y=e?-n:n,dir.y=-1;break;case OGX.Window.ANIM_BOTTOM:a.y=e?i:i-n,dir.y=1;break;case OGX.Window.ANIM_RIGHT:a.x=e?t:t-o,dir.x=1;break;case OGX.Window.ANIM_LEFT:e&&(a.x=-o),dir.x=-1}that.el.css({transform:"translate3d("+a.x+"px, "+a.y+"px, 0px)"})}function prepWindow(){var e=new OGX.Display(config),t={};t.head=config.head,t.title=config.title,t.icons=config.icons,t.html=e.html();var i=config.win_html,n="";switch(config.anim){case OGX.Window.ANIM_RIGHT:case OGX.Window.ANIM_TOP:case OGX.Window.ANIM_BOTTOM:n=config.win_inner,t.side="right";break;case OGX.Window.ANIM_LEFT:n=config.win_inner.reverse(),t.side="left"}n=n.toString().replace(/>,<"),i=i.replace("$INNER",n);var o="";return config.icons&&config.icons.length&&(o=genIcons()),i=i.replace("$ICONS",o),OGX.Templater.make(i,t)}function onResize(){user_resized=!0,that.resizeNodes()}function listenScroll(e){e?(that.el.on(OGX.Scroller.START,(function(){that.onBlur()})),that.el.on(OGX.Scroller.END,(function(){that.onFocus()}))):(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={state:"manual"},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}touch_drag=that.touch.add("Drag",e)}config.resize&&that.setResize(t),config.show&&that.show(),config.scroll&&listenScroll(!0),debug(5,"window",config.id,"init")}this.id=config.id,this.dragable=null,this.resizeable=null,this.status=OGX.Window.CLOSED,this.onFocus=function(){return config.close_on_click_out&&listenBody(!0),config.head&&listenBackIcon(!0),config.icons&&listenIcons(!0),config.drag&&touch_drag.enable(),config.resize&&this.enableResize(),debug(5,"window",config.id,"enabled"),this},this.onBlur=function(){return config.close_on_click_out&&listenBody(!1),config.head&&listenBackIcon(!1),config.icons&&listenIcons(!1),config.drag&&touch_drag.disable(),config.resize&&this.disableResize(),debug(5,"window",config.id,"disabled"),this},this.show=function(e,t,i){return this.visible||(this._show(),config.drag&&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 this.visible&&(this._hide(),config.drag&&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(){config.scroll&&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;function i(e,t,i,n){var o;if(void 0===t&&(t=null),void 0===i&&(i=!1),void 0===n&&(n=null),"string"==typeof e)o=new Worker(e);else{var a="";if(t){for(var r=0;r1&&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=o)){var u=!1;for(var l in s)-1!==l.indexOf(":OSE")?(s[i=l.split(":").shift()]=OGX.OSE.exec(s[l],t,a,n,d),delete s[l],u||(u=!0,r++),e(s[i])):-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 o={};return o[e+":"+t]=n,o},this.parse=function(e){return"string"==typeof e&&("{"!==e.substr(0,1)&&(e="{"+e+"}"),e=JSON.parse(e)),e},this.rename=function(e,t,n){function o(e,t,n){var o={};for(var i in e)o[i.replace(t,n)]=e[i];return o}void 0===n&&(n="default"),Array.isArray(n)||(n=[n],t=[t]);for(var i=0;i100)return}return e}i(e)},this.render=function(e,t,o,a,d){t=(t=f(e,{"node:OML":t}))["node:OML"],void 0===d&&(d=!1),n&&(i=!1,r&&clearTimeout(r),r=setTimeout(u,n)),function(e,t,o,r,a){var d=[],s=(new Date).getTime(),u=[];function m(e,t,s){if(i)debug(1,"OML RENDER EXCEEDED "+n+"MS");else if(void 0===s&&(s=!0),!t.enabled&&(s=!1),Array.isArray(e))for(var p=0;p0&&(b=b.substr(0,b.indexOf(".")-1)),X=e[_],e[_].hasOwnProperty("node:OML")&&(e[_]=f(e,e[_])),G=!0,y=!0,C=!1,N=!1,b){case"Function":return y=!1,X.parent=t,X.fnc=v,X=h(X,o,r),void OGX.Fonction(X,o,r);case"Uxi":return void e[_].attach(t,v);case"Fork":(L=O(v,e[_]))&&m(L,t,s),y=!1,G=!1;break;case"Html":X.el=v,X.html=e[_].html,(y=c(X))||(X.template=!1);break;case"Template":X.template=w.split(".")[1],X.el=v,y=c(X),w="Html";break;case"Ghost":X.el=v;break;case"Controller":X.id=v,N=!0;break;case"Scroller":k=$(v),X.el=v,X.content=k.html(),k.empty();break;default:-1!==[".","#"].indexOf(v.substr(0,1))?X.el=v:(X.id=v,X.el=t.el[0],X.parent=t)}G&&(X=h(X,o,r)),M=!1,P=!1,y?(a&&X.hasOwnProperty("id")&&(S=a.find("id",X.id.replace(/^#/gi,""),1))&&(P=!0),P?(S.wake(X.el),x=S):x=OGX.Object.create(w,X),t.add(x),M=x):C?(C.blur(),$(v).html(E),C.el=$(v),t.add(C),setTimeout((function(){!t.blured&&s&&C.focus()}),0)):(M=t,"Html"===w&&OGX.HtmlRender(X)),M&&e[_].hasOwnProperty("node:OML")&&!C&&!P&&m(e[_]["node:OML"],M,s),y&&(x.parent=t,"function"==typeof x.construct&&(P||(N?u.push({object:x,data:[r]}):x.construct.apply(x,[r])))),x&&!N&&(y||P)&&!t.blured&&s&&x.enabled&&(x.floating||x.focus()),void 0!==x&&x&&!N&&(d=d.concat(l(x,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 b(e){i.children(".ogx_calendar_head").children(".ogx_calendar_head_labels").html(e)}function w(e,t,i,n){if(t.y-1>=0&&t.y-1{t.off_dates=e})),this)},this.noSelection=function(e,t){return void 0===e?r.no_selection:(void 0===t&&(t=!0),r.no_selection=e,t&&v(),this)},void 0!==OGX.GridSwiper?"undefined"!=typeof moment?(debug(5,"calender init",r.id),OGX.Data.merge(r,s),r.callbacks.select||(r.callbacks.select=a.onSelect),r.callbacks.unselect||(r.callbacks.unselect=a.onUnselect),(i=a.el).addClass("ogx_calendar"),r.date&&(moment.isMoment(r.date)||(r.date=moment(r.date)),r.display_date=r.date.clone()),r.display_date?moment.isMoment(r.display_date)||(r.display_date=moment(r.display_date)):r.display_date=moment(),o=r.layout,d.y=o+1,i.html('
'),T(),G(),t=a.create("GridSwiper",{el:r.el+" .ogx_calendar_body",loop:!0,map:n,start:{x:1,y:o+1},chromeos:r.chromeos,enabled:r.swipe}),O(),b(l[o].labels(r.display_date)),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.off_dates=null,this.labels=function(e){return""},this.html=function(e,t,i,n){return""},this.value=function(){return{value:1,unit:"months"}},this.format=function(){return e.hasOwnProperty("format")?e.format:"YYYY-MM"}},OGX.CalendarLayout.MONTH_DAYS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM"),!e.hasOwnProperty("labels")&&(e.labels="ddd"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){var i="",n=Number(t.format("d")),o=t.clone();n&&o.subtract(n,"day");for(var a=0;a<7;a++)i+=''+o.format(e.labels)+"",o.add(1,"day");return i},this.html=function(e,t,i,n){var o,a=e.format("MM"),r=moment(e.format("YYYY-MM-")+"01").day(),s=moment(e.format("YYYY-MM-")+"01").subtract(r,"days"),l="";n&&(l=n.format("YYYY-MM-DD"));for(var d,c="",u=0;u<35;u++)d="",o=s.format("YYYY-MM-DD"),s.format("MM")!==a&&(d+="ogx_calendar_layout_month_days_offset "),o===moment().format("YYYY-MM-DD")&&(d+="ogx_calendar_layout_month_days_today "),n&&l===o&&(d+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(o)&&(d+="ogx_calendar_layout_off_date "),c+='
'+t(o,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 o,a,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++)a="",s+l===d+(o=10*h)&&(a="ogx_calendar_layout_century_decades_current "),c+u===d+o&&(a+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(d+o)&&(a+="ogx_calendar_layout_off_date "),f+='
'+t(d+o,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 o,a=moment(),r=100*Math.floor(Number(a.format("YYYY"))/100),s=Number(a.format("YYYY").substr(2)),l=100*Math.floor(Number(e.format("YYYY"))/100),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++)o="",l+f===r+s&&(o+="ogx_calendar_layout_century_years_current "),l+f===d+c&&(o+="ogx_calendar_selected_item"),this.off_dates&&this.off_dates.includes(l+f)&&(o+="ogx_calendar_layout_off_date "),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 o,a=10*Math.floor(Number(e.format("YYYY"))/10),r="",s=Number(moment().format("YYYY")),l="";n&&(l=Number(n.format("YYYY")));for(var d=0;d<10;d++)o="",a+d===s&&(o+="ogx_calendar_layout_decade_years_current "),a+d===l&&(o+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(a+d)&&(o+="ogx_calendar_layout_off_date "),r+='
'+t(a+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="",o=0;o<10;o++)n+='\''+i+"",i++;return n},this.html=function(e,t,i,n){var o,a,r,s,l=10*Math.floor(Number(e.format("YYYY"))/10),d="",c=moment().format("YYYY-MM");n&&(o=n.format("YYYY-MM"));for(var u=0;u<12;u++){s=u+1;for(var f=0;f<10;f++)a="",(r=l+f+"-"+(s<10?"0"+s:s))===c&&(a="ogx_calendar_layout_decade_months_current "),r===o&&(a+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(r)&&(a+="ogx_calendar_layout_off_date "),moment(r+"-01"),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 o,a,r=moment().format("YYYY-MM"),s=e.format("YYYY"),l="",d="";n&&(d=n.format("YYYY-MM"));for(var c=1;c<13;c++)o="",s+"-"+(a=c<10?"0"+c:c)===r&&(o+="ogx_calendar_layout_year_months_current "),s+"-"+a===d&&(o+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(s+"-"+a)&&(o+="ogx_calendar_layout_off_date "),l+='
'+t(s+"-"+a+"-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 o=moment().week(),a=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="",c=moment().year(a).week(f).format("YYYY-MM-DD"),o===f&&a===r&&(d="ogx_calendar_layout_year_weeks_current "),l===f&&a===s&&(d+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(c)&&(d+="ogx_calendar_layout_off_date "),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 o,a,r,s="",l=e.format("YYYY-MM-DD"),d=moment(e.format("YYYY")+"-01-01"),c="";n&&(c=n.format("YYYY-MM-DD")),a=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 o,a="",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")));a="";for(var f,h=moment(e.format("YYYY-MM-[01]")),g=0;g<5;g++)f="",o=Number(h.format("w")),d===c&&o===u&&(f+="ogx_calendar_selected_item "),d===s&&o===l&&(f+="ogx_calendar_layout_month_weeks_current"),this.off_dates&&this.off_dates.includes(o)&&(f+="ogx_calendar_layout_off_date "),a+='
'+t(h.format("YYYY-MM-DD"),i)+"
",h.add(7,"days");return a},this.value=function(){return{value:1,unit:"months"}}},OGX.CalendarLayout.WEEK_DAYS=function(e){"use strict";!e.hasOwnProperty("format")&&(e.format="YYYY-MM (wo [week])"),!e.hasOwnProperty("labels")&&(e.labels="ddd DD"),OGX.CalendarLayout.BASE_LAYOUT.call(this,e),this.labels=function(t){var i="",n=Number(t.format("d")),o=t.clone();n&&o.subtract(n,"day");for(var a=0;a<7;a++)i+=''+o.format(e.labels)+"",o.add(1,"day");return i},this.html=function(e,t,i,n){var o,a,r="",s=e.weekday(),l=e.subtract(s,"days"),d=moment().format("YYYY-MM-DD"),c="";n&&(c=n.format("YYYY-MM-DD"));for(var u=0;u<7;u++)o="",(a=l.format("YYYY-MM-DD"))===d&&(o="ogx_calendar_layout_week_days_current "),a===c&&(o+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(a)&&(o+="ogx_calendar_layout_off_date "),r+='
'+t(a,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 o,a,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++)a="",f===s&&l===d&&(a="ogx_calendar_layout_days_hours_current "),f===c&&l===u&&(a+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(l+o+":00")&&(a+="ogx_calendar_layout_off_date "),r+='
'+t(l+o+":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 o,a,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+o+":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 o="",a=e.format("YYYY-MM-DD"),r=moment().format("YYYY-MM-DD");return n&&a===n.format("YYYY-MM-DD")&&(o+="ogx_calendar_selected_item "),a===r&&(o+="ogx_calendar_layout_day_current "),this.off_dates&&this.off_dates.includes(a)&&(o+="ogx_calendar_layout_off_date "),'
'+t(a,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,o,a,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},display:!1,displays:!1,as:"item",list:null},c={position:"bottom"},u=!1,f=0,h=0,g=new OGX.List,p="ogx_carousel",_=null,m=null;function v(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 y(e){if(void 0!==e&&g[e]&&g[e].instance){var t=s.find(g[e].instance._NAME_,g[e].instance.id);t&&s.enabled&&t.focus(1)}}function x(e){i.off("transitionend"),i.removeClass(p+"_anim")}function O(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 b(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(){T(),l.index&&this.showPanel(l.index,!1),l.dots&&a.bind("dots",s)},this.onFocus=function(){l.drag&&m.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),o&&this.showPanel(h-1,a);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(T,20),o&&(s.showPanel(h-1,a),r?r():t.trigger(OGX.Carousel.ADDED,h))})),OGX.OML.render(s,c,n)}),0)}return this},this.removeNode=function(e,t){void 0===t&&(t=e,e=null);for(var i=!1,n=0;n=0&&ee?i.children("."+p+"_view:eq("+(n-1)+")").after(o):i.children("."+p+"_view:eq("+n+")").before(o);var a=100/h*(-1*n);return i.removeClass(p+"_anim"),i.css({transform:"translate3d("+a+"%, 0, 0)"}),r=n,setTimeout(T,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),r=e,s.showPanel(e,!1,!0),t.trigger(OGX.Carousel.REMOVED,h),o}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=r=0,l["node:OML"]=[],this},this.render=function(e,t){return l["node:OML"]=e,h=l["node:OML"].length,E(),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;!function(){if(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)),_=new OGX.Display(l),r=l.index,t=s.el,n=Math.floor(t.innerWidth()),l.hasOwnProperty("node:OML")&&l["node:OML"].length)h=l["node:OML"].length;else if(l.list&&l.list.length){for(var e,i,o=[],a=0;a .ogx_carousel_views > .ogx_carousel_view[data-ogx-panel-id="'+a+'"]',l.list[a],l.as),o.push(e);else{i=_.html(l.list[a]);var u='{"default:Html":{"html":'+JSON.stringify(i)+"}}";e=JSON.parse(u),o.push(e)}l["node:OML"]=o,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&&(a=s.create("Dots",{el:"."+p+'[data-ogx-id="'+s.id+'"] > .carousel_dots',total:h})),E(),m=s.touch.add("Swipe",{x:!0,cb_down:x,cb_swipe:O,cb_up:b,capture:l.capture,state:"manual"}),l.drag?m.enable():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,o,a;arguments.length>1&&(e=e+", "+t+", "+i),"object"==typeof e&&(e=Array.isArray(e)?e.join(","):e.r+" "+e.g+" "+e.b);var r=/(\d+)[ ,]*(\d+)[ ,]*(\d+)/g,s=r.exec(e);return s&&(s.shift(),n=Number(s[0]),o=Number(s[1]),a=Number(s[2])),"#"+((1<<24)+(n<<16)+(o<<8)+a).toString(16).slice(1)},OGX.Color.rgbToHsl=function(e,t,i){"use strict";var n,o,a;arguments.length>1&&(e=e+", "+t+", "+i),"object"==typeof e&&(e=Array.isArray(e)?e.join(","):e.r+" "+e.g+" "+e.b);var r=/(\d+)[ ,]*(\d+)[ ,]*(\d+)/g,s=r.exec(e);if(s){s.shift(),n=s[0],o=s[1],a=s[2],n/=255,o/=255,a/=255;var l,d,c=Math.max(n,o,a),u=Math.min(n,o,a),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=(o-a)/h+(o1&&(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;a=l(c,d,e+1/3),r=l(c,d,e),s=l(c,d,e-1/3)}return[Math.round(255*a),Math.round(255*r),Math.round(255*s)]},OGX.Color.formatHex=function(e){return"#"===e.slice(0,1)&&(e=e.slice(1)),e.length>3||e.split("").map((function(e){return e+e})),"#"+e},require("Container","Uxi"),OGX.Container=function(e){construct(this,"Container");var t=this,i={tabs:!0,carousel:{enabled:!0},enabled:!0,reorder:!0,anim:!0,flatten:!1,chromeos:!1,index:0,dots:!1},n=e,o="normal",a=0;function r(e){e?(t.tabs.el.on(OGX.Tabs.SELECT,(function(e,i){var n=t.tabs.index();t.carousel.val(n),t.el.trigger(OGX.Container.CHANGE,n)})),t.tabs.el.on(OGX.Tabs.REMOVE,(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.REMOVE),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),"Popup"===t.parent._NAME_?app.ungroupPopup(t.parent,i.index,i.label,i.x,i.y):t.carousel.removeNode(t.carousel.nodes[i.index].id),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(arguments.length||this._show(),this.carousel&&"normal"===o){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"===o&&(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.onFocus=function(){return n.tabs&&this.carousel&&(this.tabs.onFocus(),r(!0)),debug(5,"container",n.id,"enabled"),this},this.onBlur=function(){return n.tabs&&this.carousel&&(this.tabs.onBlur(),r(!1)),debug(5,"container",n.id,"disabled"),this},this.resize=function(){var e,t,i;return n.flatten&&(this.carousel&&"flattened"!==o&&this.el.width()>=n.flatten?(o="flattened",n.tabs&&(this.tabs.blur(),this.tabs.hide()),this.carousel.blur(),a=(e=this.carousel.el.children(".ogx_carousel_views"),t=e[0].style.transform,i=/translate3d\(([0-9px%,\.\- ]+)\)/,t=(t=t.match(i))[1].split(","))[0],this.carousel.el.children(".ogx_carousel_views").addClass("ogx_container_flattened").css("transform","translate3d(0px, 0px, 0px)")):this.carousel&&"flattened"===o&&this.el.width()';t.html(i)}this.onFocus=function(){return n.clickable&&d(!0),debug(5,"dots",n.id,"enabled"),this},this.onBlur=function(){return n.clickable&&d(!1),debug(5,"dots",n.id,"disabled"),this},this.bind=function(e,t){return!(a.hasOwnProperty(e)||!t.hasOwnProperty("_NAME_"))&&function(e,t){switch(a[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!!a.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 a)r(e)}()},OGX.Data.merge(n,o),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,o,a=toDataId(i[t]),r=display.oml('.ogx_dynamic_list[data-ogx-id="'+that.id+'"] > .ogx_dynamic_list_item[data-ogx-id='+a+"]",i,config.as);$('.ogx_dynamic_list[data-ogx-id="'+that.id+'"] > .ogx_dynamic_list_item[data-ogx-id='+a+"]").find(".ogx_uxi").each((function(e,t){n=$(t).data("ogx-id"),(o=that.cfind(!1,n,1))&&that.find(o._NAME_,o.id,"remove")})),OGX.OML.render(that,r,i)}else{var s="";selection.length&&selection.find(t,i[t],1)&&(s="ogx_dynamic_list_selected_item "),e.attr("class","").addClass("ogx_dynamic_list_item "+s+display.css(i)),e.html(display.html(i))}}function render(){var e=getWorkList(),t=selection;isFiltered&&(selection.resetFilters(),selection.setFilters(config.list.getFilters()),(t=selection.filter()).length!==selection.length&&(t.length?container.trigger(OGX.DynamicList.SELECT_FILTERED,t):container.trigger(OGX.DynamicList.SELECT_UNFILTERED,selection)));for(var i,n,o,a="",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.onFocus=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.onBlur=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(){!0===config.scope&&listenScope(!1),this.clearBinds(),container.empty(),container.removeClass("ogx_dynamic_list")},this.val=function(e,t,i){if(void 0===e){if(!config.key){var n=JSON.parse(JSON.stringify(config.list));return clearIds(OGX.List(n))}return config.list}var o;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||(o=config.list.getFilters()),config.list=e,config.key&&key!==key_default||(key_id=1,key=key_default,e=JSON.parse(JSON.stringify(e)),forceIds()),!t&&Object.keys(o).length?(config.list.setFilters(o),setTimeout(this.filter,0)):i?setTimeout(render,0):render()},this.scope=function(e){return"undefined"!=typeof __script&&"string"==typeof config.scope?(config.scope=e,void this.render()):config.scope},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.onFocus(!0):e===OGX.DynamicList.STATIC&&this.onBlur(!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 o=new OGX.List(e);o.setFilters(config.list.getFilters()),0===o.filter().length?n=!1:filtered.push(e)}var a=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,o=new OGX.List,a=!1;function r(t,i){if(!a){var o,r=n.find("el",i,1);if(r&&r.config.change_cb){for(var s in r.fields)if(r.fields[s].intv)return;var 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(o=JSON.stringify(d),!r.diff||r.val!==o){var f;if(r.val=o,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(!a){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(!a){if(i.config.mask&&8===e.which||46===e.which){var n=t[0].selectionStart,o=t.val();return o=8===e.which?o.substr(0,n-1):o.substr(0,n),t.val(o),!1}if(8!==e.which&&13!==e.which&&1===e.key.length){var r=e.key;if(13!==e.which&&i.config.mask){if((o=t.val()).length>=i.config.mask.length)return e.preventDefault(),e.stopImmediatePropagation(),!1;for(var s=i.config.mask,d=0;d1)return t.config.autocomplete?void 0:(e.preventDefault(),e.stopImmediatePropagation(),!1);if(1===n.length&&-1!==t.keys.indexOf(e.which)&&-1===e.which.indexOf(i))return e.preventDefault(),e.stopImmediatePropagation(),!1;if(t.config.multiline&&13===e.keyCode)return!1;if(t.config.allowed&&!n.match(t.config.allowed))return e.preventDefault(),e.stopImmediatePropagation(),!1;if(t.config.forbidden&&n.match(t.config.forbidden))return e.preventDefault(),e.stopImmediatePropagation(),!1;if($(e.originalEvent.target)[t.content]().length>=t.config.max)return e.preventDefault(),e.stopImmediatePropagation(),!1}})),$(document).on("paste",t.el,(function(e){if(!t.config.paste)return e.preventDefault(),e.stopImmediatePropagation(),!1;var i=e.originalEvent.clipboardData.getData("Text");return t.config.forbidden&&i.match(t.config.forbidden)?(e.preventDefault(),e.stopImmediatePropagation(),!1):void 0})),o.insert(t)}(e),!0)},this.unrestrictField=function(e){if(!o.find("el",e,1))return!1;var t=o.find("el",e,1);return!!t&&($(document).off("textInput keydown",t.el),$(document).off("paste",t.el),o.findDelete("el",e,1),!0)},this.toObj=function(e){return c(e)},this.populate=function(e,t,i){var n,o,a;void 0===i&&(i=null),$(e).find("*[name]").each((function(e,r){n=r.getAttribute("name"),a=!1,"string"!=typeof(a=OGX.Data.eval(t,n))&&(a=JSON.stringify(a)),void 0!==a&&(i&&i.hasOwnProperty(n)&&"function"==typeof i[n]&&(a=i[n](a)),(o=$(r)).val(a),r.hasAttribute("type")&&"hidden"===o.attr("type")&&o.trigger("change"))})),setTimeout(d,0)},this.validate=function(e){var i,n=$(e),o=t.elem_types,a=[];return n.find(o.join(",")).each((function(e,t){"submit"!==(i=$(t)).attr("type")&&(t.checkValidity()||a.push(i))})),!a.length||a}},OGX.Form=new OGX.Form,OGX.Form.fromObject=function(e,t,i,n){var o={el:t.selector+" "+i,data:e,fullpath:!1};return OGX.Data.merge(o,n),t.create("FormInstance",o)},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,o,a){var r={html:"",oml:null},s=config.types[e],l="",d="",c="";void 0!==n&&n&&(l="required",d='pattern="'+o+'"'),void 0!==a&&a&&(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.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,o,a,r=OGX.Data.merge(e,{map:null,markers:[],icon:"",browser_loc:null});function s(e,i){for(var n,o={},a=0;a1&&(e.city===i[1]?e.vicinity=e.vicinity.replace(i[0],""):e.city?e.city.length>i[1].length&&(e.city=i[1],e.vicinity=e.vicinity.replace(i[0],"")):e.city=i[1]),t)for(var n in e)-1===t.indexOf(n)&&delete e[n];return e},"undefined"!=typeof google&&void 0!==google.maps||($(document).trigger(OGX.Geo.ERROR_GMAP),debug(2,"Geo not started, Google Maps not found"))},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,o,a,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=!1,w={x:0,y:0},G={x:0,y:0},X=(new Date).getTime()+Math.round(1e3*Math.random()),T=[];function E(e){e?t.on(h.touch.down,D):t.off(h.touch.down,D)}function D(e){_=!1,a=0,r=0,s=0,l=0,e=Y(e),m.x=e.pageX,m.y=e.pageY,x=!0,k(!0)}function C(e){e?$("body").on(h.touch.up,S):$("body").off(h.touch.up,S)}function S(e){x&&(x=!1,k(!1),!L()&&b&&(t.trigger(OGX.GridSwiper.SWIPE_END),O=!1,b=!1))}function L(e,t,a){var r,s;return void 0===e&&(e=0),void 0===t&&(t=0),void 0===a&&(a=!0),a&&A(!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)/o)*o*-1,i.css({transform:"translate3d("+r+"px, "+s+"px, 0px)"}),v.x-r||v.y-s}function k(e){e?(N(!0),t.on(h.touch.move,M)):(N(!1),t.off(h.touch.move,M))}function M(e){e=Y(e),g.capture&&(e.preventDefault(),e.stopImmediatePropagation()),a=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 N(e){e?f||(O=!1,f=setInterval(I,10)):f&&(clearInterval(f),f=null)}function I(){if((a||r)&&(O||(b=!0,t.trigger(OGX.GridSwiper.SWIPE_START)),O=!0),g.axis.x&&"x"===_&&a&&s&&a<=n){if(!g.loop&&(w.x+-1*s<0||w.x+-1*s>g.map[0].length-1))return;if((d=(w.x+-1*s)%g.map[0].length)<0&&(d=Math.abs(g.map[0].length+d)),!1===g.map[G.y][d])return;u=a*s,i.css({transform:"translate3d("+(-1*w.x*n+u)+"px, "+v.y+"px, 0px)"})}else if(g.axis.y&&"y"===_&&r&&l&&r<=o){if(!g.loop&&(w.y+-1*l<0||w.y+-1*l>g.map.length-1))return;if((c=(w.y+-1*l)%g.map.length)<0&&(c=Math.abs(g.map.length+c)),!1===g.map[c][G.x])return;u=r*l,i.css({transform:"translate3d("+v.x+"px, "+(-1*w.y*o+u)+"px, 0px)"})}}function A(e){e?(i.off("transitionend"),i.on("transitionend",(function(){O&&b&&(t.trigger(OGX.GridSwiper.SWIPE_END),O=!1,b=!1),i.off("transitionend"),i.removeClass("ogx_grid_swiper_anim"),v=P(i);var e={x:null,y:null};e.x=-1*Math.round(v.x/n),e.y=-1*Math.round(v.y/o),w.x!==e.x?(s=w.x>e.x?1:-1,w.x=e.x,G.x=R(w).x,-1===s?(i.children(y+"[data-y="+(w.y-1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-y="+(w.y+1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-x="+(w.x-2)+"][data-y="+w.y+"]").attr("data-x",w.x+1).css("left",(w.x+1)*n),h.onLeft({cell:G,point:w}),t.trigger(OGX.GridSwiper.SWIPE_LEFT,{cell:G,point:w}),W(T=[{x:w.x+1,y:w.y},{x:w.x,y:w.y-1},{x:w.x,y:w.y+1}]),F()):(i.children(y+"[data-y="+(w.y-1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-y="+(w.y+1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-x="+(w.x+2)+"][data-y="+w.y+"]").attr("data-x",w.x-1).css("left",(w.x-1)*n),h.onRight({cell:G,point:w}),t.trigger(OGX.GridSwiper.SWIPE_RIGHT,{cell:G,point:w}),W(T=[{x:w.x-1,y:w.y},{x:w.x,y:w.y-1},{x:w.x,y:w.y+1}]),F())):w.y!==e.y&&(l=w.y>e.y?1:-1,w.y=e.y,G.y=R(w).y,-1===l?(i.children(y+"[data-x="+(w.x-1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-x="+(w.x+1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-y="+(w.y-2)+"][data-x="+w.x+"]").attr("data-y",w.y+1).css("top",(w.y+1)*o),h.onUp({cell:G,point:w}),t.trigger(OGX.GridSwiper.SWIPE_UP,{cell:G,point:w}),W(T=[{x:w.x,y:w.y+1},{x:w.x-1,y:w.y},{x:w.x+1,y:w.y}]),F()):(i.children(y+"[data-x="+(w.x-1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-x="+(w.x+1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-y="+(w.y+2)+"][data-x="+w.x+"]").attr("data-y",w.y-1).css("top",(w.y-1)*o),h.onDown({cell:G,point:w}),t.trigger(OGX.GridSwiper.SWIPE_DOWN,{cell:G,point:w}),W(T=[{x:w.x,y:w.y-1},{x:w.x-1,y:w.y},{x:w.x+1,y:w.y}]),F())),_=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 Y(e){return e.hasOwnProperty("originalEvent")&&void 0!==e.originalEvent.changedTouches?e.originalEvent.changedTouches[0]:e}function R(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 W(e){for(var t,i={x:null,y:null},n=0;ng.map.length-1){if(!g.loop)return!1;i.y=R(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=R(e[n]).x}else i.x=e[n].x;t=g.map[i.y][i.x],H(e[n],t),h.onRender(i)}}function H(e,t){var n=!1;switch(typeof t){case"string":i.children(y+'[data-x="'+e.x+'"][data-y="'+e.y+'"]').children(y+"_content").first().html(t);break;case"function":(n=t(e,R(e),{x:e.x-w.x,y:e.y-w.y},i.children(y+'[data-x="'+e.x+'"][data-y="'+e.y+'"]').children(y+"_content").first()[0]))&&i.children(y+'[data-x="'+e.x+'"][data-y="'+e.y+'"]').children(y+"_content").first().html(n);break;case"object":var o='.ogx_grid_swiper[data-ogx-id="'+X+'"] > .ogx_grid_swiper_container > '+y+'[data-x="'+e.x+'"][data-y="'+e.y+'"] > '+y+"_content",a=R(e);for(var r in t){t[r].id="cell_"+a.x+"_"+a.y;break}t=OGX.OML.rename(t,o);var s=h.nodes.find("id","cell_"+a.x+"_"+a.y,1);s&&h.remove(s._NAME_,s.id),$(o).empty(),OGX.OML.render(h,t,{abs:e,rel:R(e)}),F()}}function F(){for(var e=0;e',d=-1*e,c=-1*a-o;g.axis.y&&(l+='
',l+='
'),l+='
',g.axis.x&&(l+='
',l+='
'),l+="
",t.html(l),i=t.children(".ogx_grid_swiper_container").first(),w.x=g.start.x,w.y=g.start.y,v.x=e,v.y=a,G.x=g.start.x,G.y=g.start.y}this.onFocus=function(){return debug(5,"gridwwiper",g.id,"enabled"),E(!0),C(!0),F(),this},this.onBlur=function(){return debug(5,"gridwwiper",g.id,"disabled"),E(!1),C(!1),N(!1),this},this.focus=function(){return this.blured&&(this.blured=!1,this.onFocus()),this},this.resize=function(){A(!1),i.removeClass("ogx_grid_swiper_anim"),n=t.width(),o=t.height();var e=w.x*-n,a=w.y*-o;i.children(y+"[data-y="+(w.y-1)+"]").css({top:(w.y-1)*o,left:w.x*n}),i.children(y+"[data-y="+w.y+"]").css({top:w.y*o,left:w.x*n}),i.children(y+"[data-y="+(w.y+1)+"]").css({top:(w.y+1)*o,left:w.x*n}),i.children(y+"[data-x="+(w.x-1)+"]").css({top:w.y*o,left:(w.x-1)*n}),i.children(y+"[data-x="+(w.x+1)+"]").css({top:w.y*o,left:(w.x+1)*n}),i.css("transform","translate3d("+e+"px, "+a+"px, 0px"),k(!1),setTimeout((function(){L(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),w={x:0,y:0},G={x:0,y:0},m={x:null,y:null},v={x:0,y:0},U(),B(),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"),a=!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"),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,o,a,r,s=this,l={left:0,right:0,top:0,bottom:0,min:50,drag:!0,flatten:!1,capture:!0,"node:OML":{},callbacks:{up:null,down:null,left:null,right:null,restore:null}},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?(o=OGX.Iceberg.SWIPE_DOWN,a="down"):(o=OGX.Iceberg.SWIPE_UP,a="up"):1===e.dirX?(o=OGX.Iceberg.SWIPE_RIGHT,a="right"):(o=OGX.Iceberg.SWIPE_LEFT,a="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[a](f),c.trigger(o,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.onBlur()):"flattened"===u&&this.el.width() .ogx_iceberg_views > .ogx_iceberg_view[data-ogx-panel-id="';for(var a in d["node:OML"])for(var r in d["node:OML"][a])0===r.indexOf("left")&&(i+='
',n.left=o+'left"]',h.left=!0),0===r.indexOf("top")&&(i+='
',n.top=o+'top"]',h.top=!0),0===r.indexOf("main")&&(i+='
',n.main=o+'main"]'),0===r.indexOf("right")&&(i+='
',n.right=o+'right"]',h.right=!0),0===r.indexOf("bottom")&&(i+='
',n.bottom=o+'bottom"]',h.bottom=!0);for(s.el.html(i),a=0;at.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:o,height:a}),s=(o-r.width)/2,l=(a-r.height)/2;n.css("left",s+"px"),n.css("top",l+"px"),n.prop("width",r.width),n.prop("height",r.height)}function o(e){var t,i=$(e);i&&(i.find(".ogx_video").each((function(e,i){t=$(i),function(e,t,i){var n=$(e),o=t/i,a=n.parent().innerWidth(),r=n.parent().innerHeight(),s=a,l=Math.ceil(s/o);la?d=(s-a)/2*-1:sr?c=(l-r)/2*-1:l0&&(r=0),n.parent().css("overflow","hidden"),n.prop("width",o),n.prop("height",a),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),o=t/i,a=n.parent().innerWidth(),r=a,s=Math.ceil(r/o),l=0;r>a?l=(r-a)/2*-1:rt&&(a=t);var r=Math.ceil(a/o);n.prop("width",a),n.prop("height",r)}(i,parseInt(t.data("width"),10),parseInt(t.data("height"),10))})))}function a(e){e?$(window).on("resize",r):$(window).off("resize",r)}function r(){for(var e in t)o(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")))})),o(e)}this.resize=function(e){void 0!==e?o(e):r()},this.bind=function(n,o){return!t.hasOwnProperty(n)&&(t[n]={observer:null,element:o},t[n].observer=(r=o,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=o,i++,e||(e=!0,a(!0)),s($(o)),!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,a(!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,o={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}},a={title:"",scope:[],open:!0},r={id:0,title:!1,scope:[],height:0,y:0,hidden:!1,open:!0,selector:!1},s=e,l=!1,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"),o=!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),o=!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 a=g.find("id",i,1);o?(!function(e){var t=v(e);if(t)return t.focus(),!0}(a),n.onOpen(a),t.trigger(OGX.NestList.OPEN,a)):(!function(e){var t=v(e);if(t)return t.blur(),!0}(a),n.onClose(a),t.trigger(OGX.NestList.CLOSE,a)),setTimeout(x,0)}function v(e){var t=$(e.selector).find(".ogx_uxi").first();if(t.length){var i=String(t.data("ogx-id")),o=n.nodes.find("id",i,1);if(o)return o}return!1}function y(e){if(e.hasOwnProperty("scope"))for(var t=0;t .ogx_nest_list_item[data-ogx-nest-id="'+o.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="'+o.id+'"]');return o.hidden&&f.addClass("ogx_nest_list_item_hidden"),f.removeClass("ogx_nest_list_prep"),o}function b(){var e=s.list;h&&(e=i),t.empty(),g.clear();var o;t.html('
'),s.hasOwnProperty("node:OML")||(s["node:OML"]=[]);for(var a=0;a .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,o(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 o in e)for(var a=0;aogx font init';$("body").append(a),o(e,i,n),function(e){setTimeout((function(){$('.ogx_font_loader[data-ogx-id="font-loader-'+e+'"]').remove()}),150)}(t),t++}a()}(l,i,r);break;case"pak":!function(e,t,i){function n(n){for(var a,r=//gi,s=[];a=r.exec(n);)s.push(a[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=convertKeywords(e,!1),t,i,n,o)+";";for(e=convertKeywords(e+="\r\n",!1);a=/[\S ]+(\r\n|\n)?/gi.exec(e);){if(l=replaceLoop(l=a[0].replace(/(\r\n|\n)/gi,"").trim(),t,i,n,o),charcode++,l=replaceVars(l,t,i,n,o),/^(app|OGX)\.\S+;?/g.test(l))return"return "+l+";";if(e=e.replace(a[0],""),u+=l+"\n",++c>100)return}return u="var __echo=[];\n"+u+'\nif(!__echo.length){return;}else{return __echo.join("");}'}function runJS(e,t,i,n,o,a){var r;try{r=new Function(oo,to,ro,lo,e)(t,i,n,o)}catch(e){return void debug(1,"Invalid script",a,"\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,o){var a,r,s,l;return(a=/loop (\S+) ?(as (\S+) ?(\S+ )?)?{/gi.exec(e))&&(r="__"+String.fromCharCode(charcode).toLowerCase()+"__",s=(s=a[0]).replace(a[0],"for(var "+r+" in JSON.parse(JSON.stringify("+a[1]+"))){"),a[2]&&(l=a[4]?"&"+a[3]+"="+r+"; &"+a[4]+"="+a[1]+"["+r+"]; ":"&"+a[3]+"="+a[1]+"["+r+"]; "),s+=l,e=e.replace(a[0],s)),e}function replaceVars(e,t,i,n,o){for(var a,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(a=r[0].replace(r[1],s),e=e.replace(r[0],a),++l>300)return debug(1,"OSE script exceeded safe pool at replaceVars"),e}for(;r=/([a-z_\-]+)\( *(\$|@|&|%) *\)/gi.exec(e);)s=getTrueVal(r[2]),a=r[1]+"("+s+")",e=e.replace(r[0],a);for(;/^(json|ose|template|oml|crumb|result) (\S+)/g.test(e);)if((r=/crumb (\S+)?/gi.exec(e))&&(a=n.hasOwnProperty(r[1])?"__route_object."+r[1]:"{}",e=e.replace(r[0],a)),(r=/json (\S+)(;)?/gi.exec(e))&&(r[1]=getTrueVal(r[1],t,i,n,o),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,o),r[1]||debug(1,"OSE Error",e),void 0===r[2]?r[2]="__object":r[2]=getTrueVal(r[2].trim(),t,i,n,o),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,o),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,o),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),a="__echo.push("+c+r[2]+c+");",e=e.replace(r[0],a),++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 o in t.values)if(convertValue(o)===n)return t.values[o];return!1},this.execScript=function(e,t,i,n){var o=this.get(e);return o&&this.exec(o,t,i,n),!1},this.exec=function(e,t,i,n,o){void 0===t&&(t={}),void 0===i&&(i={}),void 0===n&&(n={}),void 0===o&&(o={}),charcode=65;var a=runJS(convertToJS(e,t,i,n,o),t,i,n,o,e);if(void 0!==a)return a}},OGX.OSE=new OGX.OSE,OGX.OSE.SCRIPT_LOADED="OSE_SCRIPT_LOADED",OGX.OSE.SCRIPTS_LOADED="OSE_SCRIPTS_LOADED",void 0===OGX)var OGX={};if(OGX.Overlay=function(e){"use strict";var t=this,i=!1,n=!1,o={anim:OGX.Overlay.FADE,display:{css:"",html:" "},index:!1,close_on_click:!1},a=!1,r="mousedown";function s(e){i&&(e?i.on(r,l):i.off(r,l))}function l(){"function"==typeof a.close_on_click&&a.close_on_click.apply(null,t),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,o),e.display.hasOwnProperty("_NAME_")||(e.display=new OGX.Display(e.display)),a=e,!this.hasOverlay()){var t=this.el;a.hasOwnProperty("el")&&(t=$(a.el));var n="z-index:"+(a.zindex?a.zindex:this.topIndex(t))+";",r='
'+a.display.html()+"
";if(t.prepend(r),(i=t.children(".ogx_overlay").first()).off("transitionend"),a.anim)switch(a.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?a.anim&&(t=a.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.pholder&&this.pholder.length&&"default"!==this.pholder||(this.pholder=""),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 o in e)0===o.indexOf("default")&&(n=o.replace("default",t[i]),i++,e[n]=e[o],delete e[o])}if(void 0!==e&&void 0!==t){e.hasOwnProperty("node:OML")||(e["node:OML"]=[]);var o,a=e["node:OML"];a&&"string"==typeof a&&(0===a.indexOf("{{")?e["node:OML"]=OGX.OSE.exec(a):e["node:OML"]=OGX.Cache.read("oml",e["node:OML"]));for(var r=0;r=i.points[t].min&&a{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,o=r.height,a=0,s=0;return p||(i=OGX.Data.getBestSize(e,i),o=OGX.Data.getBestSize(t,o)),r.center?("string"==typeof i&&(i=-1!==i.indexOf("%")?Math.round(e*Number(i.substr(0,i.length-1))/100):Number(i)),"string"==typeof o&&(o=-1!==o.indexOf("%")?Math.round(t*Number(o.substr(0,o.length-1))/100):Number(o)),x=Math.round(e/2-i/2),y=Math.round(t/2-o/2),r.center&&_&&(r.center=!1)):(_?(x=n.x,y=n.y):r.x&&r.y?(-1!==String(r.x).indexOf("%")?(a=i/2,x=e*Number(r.x.slice(0,-1))/100-a):x=r.x,-1!==String(r.y).indexOf("%")?(s=o/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-o/2)),x>e&&(x=e-x),x<-i&&(x=0),y>t&&(y=t-o),y<0&&(y=0)),{x:x,y:y,w:i,h:o}}function N(e,t,i,o,a,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"),b=!0,e?n.resizeNodes():s.css({display:"none",visibility:"hidden"}),f&&s.removeClass(f),I(i,o,a)})),f&&s.addClass(f)):(s.removeClass(f),I(i,o,a))}else e?s.css({opacity:e,display:"flex",visibility:"visible"}):s.css({display:"none",visibility:"hidden"}),I(i,o,a)}function I(e,t,i){void 0!==e&&e&&e(t),void 0!==i&&i&&i(n.id)}function A(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 Y(){for(var e,t="",i=0;i0&&(e=r.buttons[i].enabled?"":c+"_button_disabled",t+=''+r.buttons[i].label+"");return t}function R(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.onFocus=function(){this.enableResize(),r.icons&&r.icons.length&&W(!0),r.buttons&&r.buttons.length&&r.buttons_enabled&&A(!0),debug(5,"popup",r.id,"enabled")},this.onBlur=function(){this.disableResize(),r.icons&&r.icons.length&&W(!1),r.buttons&&r.buttons.length&&r.buttons_enabled&&A(!1),this.enabled=!1,debug(5,"popup",r.id,"disabled")},this.show=function(e,t,i){if(!this.visible){if(this._show(),!r.anim||e||b||(e=!0),!e&&r.anim&&"scale"==r.anim){var o=u.join(" ").replace(/scale\([0-9,\. ]+\)/,"");n.el.css({transform:o}),u=o.split(" ")}N(1,e,t,i),this.focus(1)}return this},this.hide=function(e,t,i,n,o){return this.visible&&(this._hide(),N(0,e,t,i,n,o),this.blur(1)),this},this.resize=function(){return X(),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%",T(),this.move(0,0)),this},this.normalize=function(){return r.maximize&&v&&(v=!1,r.width=O.width,r.height=O.height,T(),this.move(O.x,O.y),O=null),this},this.width=function(e,t,i){return void 0===e?r.width:(void 0===i&&(i=!1),void 0===t&&(t=!1),t&&n.el.removeClass("ogx_popup_notrans"),r.width=e,G(["width"],i),T(),this)},this.height=function(e,t,i){return void 0===e?r.height:(void 0===i&&(i=!1),void 0===t&&(t=!1),t&&n.el.removeClass("ogx_popup_notrans"),r.height=e,G(["height"],i),T(),this)},this.destroy=function(){s.off("transitionend"),this.touch.wipe()},this.buttons=function(e){if(void 0===e)return r.buttons;R(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&&(o+='
"),r.title&&(o+='
'+r.title+"
"),o+='
',r.icons&&(o+=H()),o+="
");var a,d=1;if(u=["translate3d("+e.x+"px, "+e.y+"px, 0)"],r.anim)switch(r.anim){case OGX.Popup.FADE:d=0,a=c+"_fade";break;case OGX.Popup.SCALE:a=c+"_scale",u[1]="scale("+r.anim_param.scale+", "+r.anim_param.scale+")"}o+='
',r.html?o+=r.html:r.template&&(o+=OGX.Templater.make(OGX.Templater.get(r.template),r.data)),o+="
",r.buttons&&r.buttons.length&&(o+='
',o+=Y(),o+="
"),s.html(o),s.css({width:t,height:i,opacity:d,transform:u.join(" "),"z-index":n.z}),r.anim&&s.addClass(a),n.el=s,l=s.children("."+c+"_buttons").first()}(),r.drag){var e={x:!0,y:!0,cb_down:S,cb_up:L,cb_drag:k,target:"."+c+"_head"};r.group||"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:w,cb_down:D,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,o,a,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,o=u.pageY;var f=d.el.position();t=f.left,i=f.top;var h=d.el.offset(),g=n-h.left,p=o-h.top;v.w=d.el.width(),v.h=d.el.height(),a=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;a&&s&&(e+=a),r&&l&&(n+=r),a&&-1===s&&r&&1===l&&(n=i),d.el.css("transform","translate3d("+e+"px, "+n+"px, 0)")}s&&v.w+a*s>c.min_width&&(_?d.el.width(Math.round(100*(v.w+a*s)/d.el.parent().width()*100)/100+"%"):d.el.width(v.w+a*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)),(a||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),a=e.pageX-n,r=e.pageY-o}function T(e){b(!1),G(!1),e=E(e),a=e.pageX-n,r=e.pageY-o,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,o,a,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){o=e.y,X(!0)}function w(e){var t;e.dirY!==a?(t=0,o=e.pt1.y):(t=e.pt1.y-o,o=e.pt1.y),a=e.dirY,i.css({transition:"none",transform:"translate3D(0px, "+(C(i)+t)+"px, 0px)"})}function G(e){X(!1),trans=C(i);var t=Math.round(trans/n)*n,o=Math.round(t/n%d.list.length);if(o=o<=0?Math.abs(o):d.list.length-o,g!==o){switch(g=o,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,o;(e=Math.floor((i.position().top+n*a)/(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){o=i.position().top+$(t).position().top,(Math.ceil(o+n*d.list.length)<-n||o>n)&&$(t).remove()})),h=e)}function E(){X(!1),i.off("transitionend",E)}function D(){var e="",o='
';o+='
';for(var a=0;a<2;a++){o+='
';for(var r=0;r'+e+"
"}o+="
"}if(o+="
",d.icon&&(o+='
'),void 0===g&&(g=0),d.name){var l="";switch(d.required&&(l=" required"),f){case"string":o+='";break;case"object":o+='"}}t.html(o),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 C(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.onFocus=function(){return t.removeClass(_+"_disabled"),d.icon&&v(!0),p&&p.enable(),debug(5,"roulette",d.id,"enabled"),this},this.onBlur=function(){t.addClass(_+"_disabled"),d.icon&&v(!1),p&&p.disable(),X(!1),debug(5,"roulette",d.id,"disabled")},this.bindFilter=function(e,t,i){return d.list.removeFilter(e),d.list.addFilter(e,t,i),d.list.filter(),setTimeout(D,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 o=S(e).index;return o>-1&&(!function(e,t){void 0===t&&(t=!0);i.off("transitionend",E),X(!1),a=-1;var o=C(i),r=Math.round(o/n)*n,s=o-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=o+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}(o),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,o){var a=g,r=S(t).index;r>-1&&(g=r);var s=a-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, "+(C(i)+(s*n-d.list.length*n*e))+"px, 0px)"}),i.on("transitionend",E),d.name&&m(t,o),void 0!==o&&o&&(this.onSelect(val),this.el.trigger(OGX.Roulette.CHANGE,val)),this},this.next=function(e){var t,i=O(1);switch(a=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(D,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[data-ogx-id="'+l.id+'"] .ogx_roulette_container',capture:d.capture}),d.enabled&&p.enable()}),null),D(),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,o=this,a=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,o){e.stopImmediatePropagation();var a,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[o].roulette.setData(g(i),t),i.push(t)));setTimeout(d,0)}function g(e){for(var t=a.data,i=0;i-1?f(n):{};h(e)},a=OGX.Data.merge(a,r),(t=o.el).addClass("ogx_roulette_tree"),o.observeOnce({childList:!0},(function(){setTimeout((()=>{a.value?h(a.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=a.groups[d-1],e=[{label:i,value:"",head:!0}],l)e.push({label:u,value:u});c=o.create("Roulette",{el:'.ogx_roulette_tree[data-ogx-id="'+o.id+'"] .ogx_roulette_tree_roulette[data-ogx-roulette="'+d+'"]',list:e,icon:a.icon,value:null,name:i,enabled:!1,required:a.required}),s.push({roulette:c,group:i,id:c.id})}if(dt.time+i))}function doCache(e){var t=getStageDefault(app.getStage());if(t){t.uxi.detach();var i={url:e.url,uxi:t.uxi,time:Math.round((new Date).getTime()/1e3)};cache.insert(i),debug(4,"Router caching at",route.url)}}function unCache(e){var t=getCache(e);t&&(t.uxi.kill(),cache.findDelete("url",e.url,1))}function useCache(e){var t=getCache(e);if(t){var i=app.getStage();t.uxi.attach(i,$(i.pholder)),cache.delete("url",e.url,1),route=e}}function getCache(e){return cache.get({url:{eq:e.url}},null,1)}function findRoute(e){var t,i,n,o;debug(4,"Router route lookup",e);var a,r=[],s=OGX.Data.clone(config.routes);for(var l in s){for(r=[],a=s[l],n=l;i=/(?!\/)([a-z0-9_\-]+)\:([^\/]+)/gi.exec(n);)n=n.replace(i[0],i[2]),r.push(i[1]);if((t=e.match("^"+n+"$"))&&t.length){t.shift(),"string"==typeof a&&(debug(2,'Setting OML as string in route is deprecated, use {oml:"'+e+'"}'),a={oml:OGX.Data.clone(OGX.Cache.read("oml",a))}),"string"==typeof a.oml&&(a.oml=OGX.Data.clone(OGX.Cache.read("oml",a.oml))),o={};for(var d=0;d1e3*e&&that.goto(route.url,{reload:!0,history:!1})}function onBlur(){blured=!0,time=(new Date).getTime()}function handleVisibilityChange(){"visible"===document.visibilityState?onFocus():onBlur()}function init(){request={route:null,url:global_url,origin:global_url};var e=null;if(-1!==window.location.href.indexOf("#")){e=window.location.href.split("#").pop(),request.url=e;var t=findRoute(e);t?request.route=t:(debug(2,"404",e),config.errors[404]?(t=findRoute(config.errors[404]),request.route=t):$(document).trigger(OGX.Router.NOT_FOUND,{url:e}))}$(document).on("click touchstart mousedown","a",captureLink),config.options.idle&&$(document).on("visibilitychange",handleVisibilityChange)}this.url=function(){return url},this.start=function(){$(document).on("backbutton",onBackButton),$(window).on("popstate",onPopState)},this.stop=function(){$(document).off("backbutton",onBackButton),$(window).off("popstate",onPopState)},this.lock=function(){locked=!0},this.unlock=function(){locked=!1},this.gate=function(e){"function"==typeof e?gate=e:debug(1,"Router gate must be a function")},this.isLocked=function(){return locked},this.addToHist=function(e){var t={url:e};history.pushState(t,"title"+(new Date).getTime(),page+"#"+e)},this.request=function(){return request},this.expire=function(e){var t=getCache({url:e});t&&unCache(t)},this.goto=function(__url,__options){if(route?debug(3,"Router navigate from",global_url,"to",__url):debug(3,"Router navigate to",__url),!locked){void 0!==__options&&__options||(__options={}),OGX.Data.merge(__options,options_default);var r=findRoute(__url);if(request.url=__url,request.origin=global_url,r){request.route=r,r.route.hasOwnProperty("reload")&&(__options.reload=r.route.reload),r.route.hasOwnProperty("scope")||(r.route.scope="public");var access=!0;if(OGX.Scope.eval(r.route.scope)||(debug(2,"invalid scope for",__url),access=!1),config.options.eval){var fnc=eval(config.options.eval);if(!fnc)return debug(1,"route eval function not set!",config.options.eval),!1;if(fnc){var res=fnc(r);res||(access=!1)}}if(!access)return config.errors.hasOwnProperty("403")?setTimeout((function(){app.goto(config.errors[403],{history:!0})}),0):$(document).trigger(OGX.Router.FORBIDDEN,{url:__url,scope:r.route.scope}),!1;if(delete r.route.scope,r.route.hasOwnProperty("origin")){debug(5,"Router test origin",global_url,r.route.origin);for(var valid=!1,origins=r.route.origin.split(","),reg,i=0;i0}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,o,a,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,content:!1,overflow:!0},p=0,_="init",m=!1,v=!1,y=null;function x(e){e?i.on(f.touch.down,O):i.off(f.touch.down,O)}function O(e){e=f.event(e),S(!1),G(!0),b(!0),x(!1),L("in"),D(!0)}function b(e){e?(c=setInterval(E,10),i.on(f.touch.move,w)):(clearInterval(c),i.off(f.touch.move,w))}function w(e){e=f.event(e)}function G(e){e?$(document).on(f.touch.up,X):$(document).off(f.touch.up,X)}function X(){b(!1),G(!1),x(!0),D(!1),L("out")}function T(e){e?(window.addEventListener("resize",N),i.on("scroll",(function(e){e.stopImmediatePropagation(),E()})),i.on("wheel",(function(e){D(!0)})),void 0!==OGX.NestedList&&$(document).on(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED,(function(){f.update()}))):(window.removeEventListener("resize",N),i.off("scroll"),i.off("wheel"),void 0!==OGX.NestedList&&$(document).off(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED))}function E(){var e,o=(e=i.scrollTop())/s,r=Math.round(a.position().top);a.css("top",o+"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.ceil(o)&&f.el.trigger(OGX.Scroller.BOTTOM):0===e&&(r&&r!==Math.round(o)||!r)&&f.el.trigger(OGX.Scroller.TOP)),h.scroll_callback&&h.scroll_callback()}function D(e){e?(d&&D(!1),l=t.position().top,d=setInterval(C,h.check_delay-10)):(d&&(clearInterval(d),d=null),v=!1,f.el.trigger(OGX.Scroller.END))}function C(){var e=t.position().top;e!==l?(v||(v=!0,f.el.trigger(OGX.Scroller.START)),L("in")):L("out"),l=e}function S(e){e?u=setInterval(E,h.check_delay):clearInterval(u)}function L(e){a.hasClass("ogx_scroller_track_anim")||a.addClass("ogx_scroller_track_anim"),"in"===e?(clearTimeout(y),y=null,a.addClass("ogx_scroller_track_anim_fade_in").removeClass("ogx_scroller_track_anim_fade_out")):y||(y=setTimeout((function(){a.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(o=i.innerHeight(),n=t.height(),s=n/o,n>o){var e=Math.round(o/s);a.css("height",e+"px"),r.css("display","block")}else r.css("display","none");"init"===_&&(_=OGX.Scroller.READY,f.el.trigger(OGX.Scroller.READY))}this.onFocus=function(){return N(),T(!0),h.observe&&setTimeout((function(){k(!0)}),0),x(!0),debug(5,"scroller",h.id,"enabled"),this},this.onBlur=function(){return T(!1),h.observe&&k(!1),G(!1),b(!1),x(!1),D(!1),S(!1),a.removeClass("ogx_scroller_track_anim_fade_in"),a.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.overflow=function(e){if(void 0===e)return h.overflow;h.overflow!==e&&(h.overflow=e,e?(this.onFocus(),this.el.removeClass("ogx_scroller_no_overflow")):(this.onBlur(),this.el.addClass("ogx_scroller_no_overflow")))},this.top=function(){return n>o&&(i[0].scrollTop=0,N()),this},this.bottom=function(){return n>o&&(i.scrollTop(n),N()),this},this.max=function(){return t.height()-i.height()},this.scroll=function(e){return void 0===e?i[0].scrollTop:(i[0].scrollTop=e,N(),this)},this.mute=function(){return 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"),h.content&&t.append(h.content);var e='
';i.parent().append(e),r=i.parent().find(".ogx_scroller_track"),a=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,o,a=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(a.touch.down,".ogx_stacked_tree_level .ogx_stacked_tree_level_prev",g),t.on(a.touch.down,".ogx_stacked_tree_level_list .ogx_dynamic_list_item",(function(e){var t=$(this).data("ogx-id");t--,function(e,t){u=t;var i=l[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=o.css(u)).replace(f+"_door",""),d+='
'+o.html(u)+"
"),d+='
',i.append(d),i.children("."+f+"_level").css("flex-basis",Math.floor(100/(e+1)*100)/100+"%"),function(e,t,i){l[e]&&a.remove(l[e].id,"DynamicList");var n=a.create("DynamicList",{el:t,mode:"static",scroll:!0,display:s.display,displays:s.displays,list:i});l[e]=n}(e,"."+f+'[data-ogx-id="'+a.id+'"] > .'+f+"_container > ."+f+'_level[data-level="'+e+'"] > .'+f+"_level_list",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)+"%"),a.remove(l[e+1].id,"DynamicList"),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.onFocus=function(){h(!0),p(!0),debug(5,"stackedtree",s.id,"enabled")},this.onBlur=function(){h(!1),p(!1),debug(5,"stackedtree",s.id,"disabled")},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=(o=new OGX.Display(s)).val();if(e=function(e){if(e.display&&"object"==typeof e.display&&!e.display.hasOwnProperty("bind")&&(e.display=i(e.display)),e.displays)for(var t in e.displays)e.displays[t]=i(e.displays[t]);function i(e){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),o.val(e),s.display=e.display,s.displays=e.displays,(t=a.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.__proto__.onFocus=function(){return i.closeable&&n(!0),this},this.__proto__.onBlur=function(){return i.closeable&&n(!1),this},function(){i.hasOwnProperty("theater")&&(t.theater=i.theater),t.home=i.home;var e=new OGX.Display(i),n="block";i.hasOwnProperty("use")&&i.use||(n="none");var o="";i.closeable&&(o='
');var a=e.html();i.hasOwnProperty("data")&&(a=OGX.Templater.make(a,i.data)),o+=a,container=t.el,container.html(o),container.addClass("ogx_stage").css("display",n)}()},OGX.Stage.SWAP="swap",OGX.Stage.FLIP="flip",void 0===OGX)var OGX={};if(require("Switch","Uxi","Bind","Touch"),OGX.Switch=function(e){construct(this,"Switch");var t,i=this,n=e,o={el:"document",bind:!1,labels:!0,data:[{label:"OFF",value:!1},{label:"ON",value:!0}],value:!1,name:!1,callbacks:{change:null}},a="ogx_switch";function r(e){n.value===n.data[0].value?n.value=n.data[1].value:n.value=n.data[0].value,s(e)}function s(e){e=void 0!==e;var i=t.find("."+a+"_dot").first(),o=t.find("."+a+"_label").first(),r=t.find("."+a+"_label").last();n.value==n.data[0].value?(i.removeClass(a+"_dot_right").addClass(a+"_dot_left"),o.removeClass(a+"_label_off").addClass(a+"_label_on").addClass(a+"_selected"),r.removeClass(a+"_label_on").addClass(a+"_label_off").removeClass(a+"_selected")):(i.removeClass(a+"_dot_left").addClass(a+"_dot_right"),r.removeClass(a+"_label_off").addClass(a+"_label_on").addClass(a+"_selected"),o.removeClass(a+"_label_on").addClass(a+"_label_off").removeClass(a+"_selected")),n.name&&t.find('input[type="hidden"]').attr("value",n.value),e&&t.children("."+a+"_val").trigger("input")}function l(e){e?t.on(i.touch.down,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("."+a+"_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.onFocus=function(){return l(!0),t.removeClass(a+"_disabled"),debug(5,"switch",n.id,"enabled"),this},this.onBlur=function(){return l(!1),t.addClass(a+"_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("."+a+"_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,o),void 0!==e&&(n.value=e),(t=i.el).addClass(a+"_disabled");var r=t.parent();r[0].hasAttribute("data-value")&&(n.value=OGX.Data.stringToVal(r.data("value")),r.removeAttr("data-value"))}(),function(){var e="";n.labels&&(e+=''+n.data[0].label+"");var i="";n.value===n.data[1].value&&(i=a+"_dot_right"),e+='
',n.labels&&(e+=''+n.data[1].label+""),n.name&&(e+=''),t.html(e),t.addClass(a)}(),setTimeout(s,0)},OGX.Switch.CHANGE="SwitchChange",OGX.Switch.BIND=OGX.Switch.CHANGE,require("Tabs","Uxi","Touch"),OGX.Tabs=function(e){construct(this,"Tabs");var t=this,i=e;e.hasOwnProperty("editable")&&debug(2,"Tabs editable deprecated, use add/remove");var n,o={editable:!1,detach:!1,detach_min:-4,add:!0,remove:!0,reorder:!0,icons:!1,index:0,list:new OGX.List,display:{html:"",css:""},callbacks:{select:null,close:null,add:null,remove:null}},a=!1,r=0,s=!1,l=!1,d=!1,c=!1,u=!1,f={x:0,y:0},h="ogx_tabs";function g(){r>0?r--:r=0,t.index(r)}function p(){for(var e,t,o='
',s=0;s',i.icons&&(o+=''),e&&(o+=''+e+""),i.remove&&(o+=''),o+="
",t="";o+="",i.add&&(o+='
',n.addClass(h+"_editable")),n.html(o),a=n.children("."+h+"_container").children("."+h+"_tab:eq("+r+")")}function _(e){s||(u=!1,l=$(e),r=l.index(),d={from:r},n.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"),a=l,s.el.addClass(h+"_tab_active").addClass(h+"_float").css("transform","translate3d("+f.x+"px, "+s.y+"px, 0px)"),n.children("."+h+"_container").prepend(s.el),n.trigger(OGX.Tabs.SELECT,i.list[r]),c=setInterval(v,5))}function m(e){if(s)if(u=e,Math.abs(u.distX)>Math.abs(u.distY)){var o=s.x+u.distX;s.el.css("transform","translate3d("+o+"px, "+s.y+"px, 0px)")}else{var a=s.y+u.distY;s.el.css("transform","translate3d("+s.x+"px, "+a+"px, 0px)");var r=s.el.offset();if(u.distYMath.abs(u.distY)&&n.children("."+h+"_container").children("."+h+"_tab").each((function(n,o){(e=$(o)).hasClass(h+"_tab_active")||(t=e.position(),i=e.width(),idx!==n&&(s.x+u.distX>t.left+i/2&&s.x+u.distXt.left&&s.x+u.distXe&&t.css("transform","translateX("+-1*(i-e)+"px)")}),0),this},this.addAt=function(e,t){return i.icons&&(e.hasOwnProperty("icon")||(e.icon=i.icon_default)),i.list.insert(e,t),r=t,setTimeout(p,0),this},this.remove=function(e,t){void 0===t&&(t=e,e="label");var o=i.list.findIndex(e,t);i.list.findDelete(e,t,1)&&(n.children("."+h+"_container").first().children("."+h+"_tab:eq("+o.index+")").remove(),g())},this.removeCurrent=function(){return a&&this.removeAt(r),this},this.removeAt=function(e){return i.list.delete(e)&&(n.children("."+h+"_container").first().children("."+h+"_tab:eq("+e+")").remove(),g()),this},this.enableTab=function(e){return n.children("."+h+"_container").first().children("."+h+"_tab:eq("+e+")").removeClass(h+"_tab_disabled"),this},this.disableTab=function(e){return n.children("."+h+"_container").first().children("."+h+"_tab:eq("+e+")").addClass(h+"_tab_disabled"),this},this.index=function(e){return void 0!==e?(a&&(a.removeClass(h+"_tab_active"),a=null),(a=n.children("."+h+"_container").first().children("."+h+"_tab:eq("+e+")")).addClass(h+"_tab_active"),r=e,!0):a?r:-1},this.select=function(e){a&&a.removeClass(h+"_tab_active");var t=i.list.findIndex("label",e);return this.index(t.index),this},void 0!==OGX.List?(debug(5,"tabs",i.id,"init"),i||(i={}),OGX.Data.merge(i,o),i.list.hasOwnProperty("insert")||(i.list=new OGX.List(i.list)),i.display.hasOwnProperty("_NAME_")||(i.display=new OGX.Display(i.display)),i.callbacks.select||(i.callbacks.select=t.onSelect),i.callbacks.close||(i.callbacks.close=t.onClose),i.callbacks.add||(i.callbacks.add=t.onAdd),i.callbacks.remove||(i.callbacks.remove=t.onRemove),(n=t.el).addClass(h),i.editable&&n.addClass(h+"_editable"),r=i.index,setTimeout(p,0),i.reorder&&t.touch.add("Hold",{id:"tabs_hold",cb_hold:_,cb_move:m,cb_up:y,state:"manual",time:1e3,target:".ogx_tabs_tab",capture:!1})):debug(1,"OGX.List not found! ")},OGX.Tabs.SELECT="TabsSelect",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 o=''+e+""+n+"";container.find(".ogx_tags_tags").first().append(o),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,o=0;o";break;case OGX.Tags.MODE_OBJECT:i+=''+t[o].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.onFocus=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.onBlur=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,o=[],a=0;a-1&&(i.includes(n.items[o][a])||i.push(n.items[o][a]));return e(n.items[o]),!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(n)},void 0===OGX)var OGX={};if(OGX.Templater=function(){"use strict";var e;this.jmake=function(e,t){for(var i,n,o=JSON.stringify(e);m=/({{(\$|#)[a-z0-9_\.]*}})|("{{(\$)}}")/gi.exec(o);)m[0].match(/"{{(\$)}}"/)?(i="<-"+(i=JSON.stringify(t)).substring(1).slice(0,-1)+"->",o=(o=(o=o.replace(m[0],i)).replace(/<\-/,"{")).replace(/\->/,"}")):("object"==typeof(n=OGX.OSE.exec(m[0],t))&&(n=JSON.stringify(n),m[0]='"'+m[0]+'"'),o=o.replace(m[0],n));return JSON.parse(o)},this.make=function(t,i,n,o,a){var r,s;for(e={},void 0===a&&(a={}),OGX.Data.merge(e,a),debug(5,"Templatizing",t);r=/{{[^{]+(({[^{]+)+)?}}/gi.exec(t);)void 0===(s=OGX.OSE.exec(r[0],i,n,o,e))&&(s=""),t=t.replace(r[0],s);return debug(5,"Templatized",t),t},this.amake=function(e,t,i,n,o){for(var a="",r=0;r{{$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),o.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();o.observe(!0,{childList:!0},(function(){o.observe(!1),(n=i.children(".ogx_theater_trans")).on("transitionend",(function(){n.off("transitionend"),o.hide(),n.remove(),t.url?(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)"})}),a.timeout)}),null,i),i.append('
")}(t.id)}))):($(document).off("backbutton",u),$(window).off("popstate",u),list.el.off(OGX.DynamicList.SELECT))}function u(){o.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=o.create("DynamicList",{el:".ogx_theater > .list",display:{html:a.display.html,css:"ogx_theater_stage"},key:"id",scroll:!0,mode:"hit",list:i,trigger:!0})}function 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(a,r),a.display&&("object"!=typeof a.display&&(a.display={}),OGX.Data.merge(a.display,s),a.display.template&&(a.display.html=OGX.Templater.get(a.display.template))),(t=o.el).addClass("ogx_theater").css("visibility","hidden"),i=$("body"),"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,o){var a=new OGX.Touches[e](t),r=a.set(o);return!r.hasOwnProperty("id")&&(r.id=i++),a.id=r.id,"auto"===r.state&&!t.blured&&t.enabled&&a.enable(),n.insert(a),a},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;ea.x?1:-1,l=r.y>a.y?1:-1,d=Math.abs(r.x-a.x),c=Math.abs(r.y-a.y),u=Math.sqrt(Math.abs(Math.pow(r.x-a.x,2)-Math.pow(r.y-a.y,2)))}function b(){o.cb_swipe&&(o.x&&o.min_x&&d>=o.min_x||o.y&&o.min_y&&c>=o.min_y?x(0,!0):o.cb_swipe({pt0:a,pt1:r,dirX:s,dirY:l,distX:d,distY:c,dist:u}))}this.set=function(e){return o=e,OGX.Data.merge(o,n),t=i.selector,this.state=o.state,"auto"===o.state&&(i.enable,i.disable),o.target&&(t=o.target),o},this.enable=function(){!h&&o&&(h=!0,y(!0))},this.disable=function(){h&&(h=!1,y(!1),m(!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,parent:null,state:"auto"},i=!1,n=!1,o=!1,a=!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,g=$("body");function p(e){var t=[];e?i.parent?i.parent.on.apply(i.parent,[l.touch.down,_]):(t=i.target?[l.touch.down,i.target,_]:[l.touch.down,_],l.el.on.apply(l.el,t)):i.parent?i.parent.off.apply(i.parent,[l.touch.down,_]):(t=i.target?[l.touch.down,i.target,_]:[l.touch.down,_],l.el.off.apply(l.el,t))}function _(e){e=l.event(e),h=e.currentTarget,a||(a=!0,n=(new Date).getTime(),f.x=d.x=e.pageX,f.y=d.y=e.pageY,o=setInterval(v,1))}function m(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(o),o=!1)}function v(){a&&(new Date).getTime()-n>i.time&&(r||(r=!0,g.on(l.touch.move,m),i.cb_hold?i.cb_hold(h,d):l.el.trigger(OGX.Touch.HOLD_START)))}function y(t){t=e.event(t),a=!1,clearInterval(o),o=!1,r&&(r=!1,g.off(l.touch.move,m),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,p(!0),g.on(l.touch.up,y))},this.disable=function(){s&&(s=!1,(a||o)&&(r=!1,a=!1,clearInterval(o),o=!1),p(!1),g.off(l.touch.up,y),g.off(l.touch.move,m))}},OGX.Touches.Drag=function(e){"use strict";var t,i,n,o,a,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,parent:null,state:"auto"},d=e,c=!1,u=!1,f=$("body");function h(e){var t=[];e?s.parent?s.parent.on.apply(s.parent,[d.touch.down,g]):(t=s.target?[d.touch.down,s.target,g]:[d.touch.down,g],d.el.on.apply(d.el,t)):s.parent?s.parent.off.apply(s.parent,[d.touch.down,g]):(t=s.target?[d.touch.down,s.target,g]:[d.touch.down,g],d.el.off.apply(d.el,t))}function g(l){s.capture&&(l.preventDefault(),l.stopImmediatePropagation()),l=e.event(l),n=l.pageX,o=l.pageY;var c=d.el.position();t=c.left,i=c.top;var u=d.el.offset(),f=n-u.left,h=o-u.top;if(s.border){if(fd.el.width()-s.border)return;if(hd.el.height()-s.border)return}a=0,r=0,p(!0),_(!0),s.cb_down&&s.cb_down({x:n,y:o,target:l.target})}function p(e){e?c||(c=setInterval(y,10)):c&&(clearInterval(c),c=null)}function _(e){e?(f.on(d.touch.move,v),f.on(d.touch.up,m)):(f.off(d.touch.move,v),f.off(d.touch.up,m))}function m(t){p(!1),_(!1),t=e.event(t),s.x&&(a=t.pageX-n),s.y&&(r=t.pageY-o),s.cb_up&&s.cb_up({distX:a,distY:r})}function v(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&&(a=i,l=!0):(a=i,l=!0)):s.min?Math.abs(i)>s.min&&(a=i,l=!0):a=i),s.y&&(i=t.pageY-o,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:a,distY:r,x:t.pageX,y:t.pageY})}function y(){d.el.css({transform:"translate3d("+(t+a)+"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,h(!0))},this.disable=function(){u&&(u=!1,h(!1),_(!1),p(!1))}},OGX.Touches.Move=function(e){"use strict";var t,i,n,o,a,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,parent:null,state:"auto"},u=e,f=!1,h=$("body");function g(e){var t=[];e?d.parent?d.parent.on.apply(d.parent,[u.touch.down,p]):(t=d.target?[u.touch.down,d.target,p]:[u.touch.down,p],u.el.on.apply(u.el,t)):d.parent?d.parent.off.apply(d.parent,[u.touch.down,p]):(t=d.target?[u.touch.down,d.target,p]:[u.touch.down,p],u.el.off.apply(u.el,t))}function p(c){d.capture&&(c.preventDefault(),c.stopImmediatePropagation()),c=e.event(c),t=c.pageX,i=c.pageY,n=0,o=0,a=0,r=0,s=0,l=0,_(!0),d.cb_down&&d.cb_down({target:c.target,x:t,y:i})}function _(e){e?(h.on(u.touch.move,v),h.on(u.touch.up,m)):(h.off(u.touch.move,v),h.off(u.touch.up,m))}function m(s){if(_(!1),s=e.event(s),d.x&&(n=s.pageX-t),d.y&&(o=s.pageY-i),d.cb_up&&d.cb_up({x:s.pageX,y:s.pageY,distX:n,distY:o,dirX:a,dirY:r}),d.cb_click){var l=!1;d.x&&Math.abs(n)<2&&(l=!0),d.y&&Math.abs(o)<2&&(l=!0),l&&d.cb_click(s)}}function v(c){d.capture&&(c.preventDefault(),c.stopImmediatePropagation()),c=e.event(c);var u,f=!1;d.x&&(a=0,sc.pageX&&(a=-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&&(o=u,f=!0):(o=u,f=!0)):(o=u,f=!0)),f&&d.cb_move&&d.cb_move({distX:n,distY:o,dirX:a,dirY:r,x:c.pageX,y:c.pageY})}this.set=function(e){return d=e,OGX.Data.merge(d,c),"auto"===d.state&&(u.enable,u.disable,this.enable()),this.state=d.state,d},this.enable=function(){!f&&d&&(f=!0,g(!0))},this.disable=function(){f&&(f=!1,g(!1),_(!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,o,a,r,s,l,d=this,c='{{$label}}',u=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:c}},file:{mode:"file",display:{html:c}},folder:{mode:"folder",display:{html:c}}},data:{_id:0,type:"root",state:"closed",label:null,items:[]},display:null,callbacks:{select:null,unselect:null,open:null,close:null,move:null}},h="_id",g=0;function p(e,t,i,n,o){return e[h]===o[h]&&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[h]=t[h],OGX.Data.merge(i,e,!0),OGX.Templater.make('
',i)}function m(){var e=_({},u.data);t.html(e),u.data.element=t.children(".ogx_tree_item").first(),u.data.uxi=d,O(u.data,d),u.show_root||u.data.element.addClass("ogx_tree_root_hidden")}function v(){m(),y(u.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)),u.sort.enabled&&e.items.order(u.sort.property,u.sort.way);for(var o=0;o .ogx_tree_item_content';if(i.display.hasOML()){var o=i.display.oml(n,e,!1);OGX.OML.render(t,o,e),e.uxi=t.nodes.last()}else{var a=i.display.html(e);a=OGX.Templater.make(a,e),$(n).html(a)}}function b(e){return delete e.element,delete e.parent,delete e.uxi,delete e.state,l||delete e[h],!1}function w(e){"folder"===k(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(){return!!s&&D(s)}function T(e){var t=C(e);t&&(s=e,t.children(".ogx_tree_item_content").addClass("ogx_tree_selected_item"))}function E(e,t){return L((function(i){return i[h]===t&&(i.hasOwnProperty("items")||(i.items=new OGX.List),!i.items.hasOwnProperty("insert")&&(i.items=new OGX.List(i.items)),i.items.push(e),i.state="open",w(i),!0)}))}function D(e){if(!e||"root"===e)return u.data;return L((function(t,i){return t[h]===e&&t}))}function C(e){var t=D(e);return!!t&&t.element}function S(){g=1,L((function(e){return e[h]=g++,e.hasOwnProperty("type")||(e.hasOwnProperty("items")?e.type="folder":e.type="file"),!1}))}function L(e,t,i){var n;return void 0===t&&(t=null),void 0===i&&(i=u.data),(n=function i(o,a,r,s){if(n=e(o,a,r,s,t))return n;if(o.hasOwnProperty("items")&&o.items.length)for(var l=0;l .ogx_tree_item_content",(function(e){e.preventDefault(),M($(this).parent(0)),1!==$(this).parent(0).data("id")&&function(){a&&clearInterval(a);r=(new Date).getTime(),a=setInterval(I,50)}()})),$(document).on(d.touch.up,(function(){P(),n&&(A(!1),function(){var e=n.offset().left,a=n.offset().top,r=(l=e,c=a,L((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()&&c>=u.top&&c<=u.top+f.height()&&e}))),s=k(r);var l,c,u,f;!r||r&&(r[h]===i[h]||"folder"!==s.mode)?(o.css("opacity",1),n.remove(),n=null,i=null):(p=r,function(e){L((function(t,i,n,o){return t[h]===e&&(n.items.splice(o,1),n.items.length||(n.state="closed"),w(n),!0)}))}((g=i)[h]),E(g,p[h]),p.element.children(".ogx_tree_item_container").empty(),p.state="open",y(p,p.element),w(p),o.remove(),n.remove(),n=null,d.onMove(i),t.trigger(OGX.Tree.DROP,i),i=null);var g,p}())}))):t.on("click",".ogx_tree_item > .ogx_tree_item_content",(function(e){M($(this).parent(0))})),t.on(d.touch.down,".ogx_tree_item_arrow",(function(e){e.preventDefault(),P();var i=D($(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))}))):(u.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 I(){var e;(new Date).getTime()-r>=u.drag_after&&(s&&(i=D(s))&&(e=i.element,o=e,(n=e.clone()).children(".ogx_tree_item_arrow").css("display","none"),e.css("opacity",.3),n.addClass("ogx_tree_item_drag"),n.css({top:e.offset().top,left:e.offset().left}),t.prepend(n),A(!0),t.trigger(OGX.Tree.DRAG,i)),P())}function A(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(){a&&(clearInterval(a),a=null)}this.onFocus=function(){return N(!0),debug(5,"tree",u.id,"enabled"),this},this.onBlur=function(){return N(!1),debug(5,"tree",u.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=D(t);if("folder"===k(i).mode){l||(e[h]=++g),E(e,t);var n=k(e);x(i.element.children(".ogx_tree_item_container").first(),e),O(e,i.parent);var o=i.uxi;return n.display.hasOML()&&(o=i.uxi.nodes.last()),y(e,o),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,i,n=D(e);return!!n&&(t=n,i={},OGX.Data.merge(i,t),b(i),i)},this.selectItem=function(e){return T(e),X()},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 L(i)}(e,t);return!!i&&(G(),T(i[h]),X())},this.selectItemByPath=function(e){var t=function(e){var t=function(e){function t(t,i){return e===i+"/"+t.label&&t}return L(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"),X())},this.updateItem=function(e,t,i){void 0===i&&(i=!0);var n=D(e);if(n){if(n.uxi){var o=n.uxi.el;n.uxi.kill(),o.empty()}else i&&n.element.children(".ogx_tree_item_container").empty();OGX.Data.merge(n,t,!0),O(n,n.parent),i&&n.hasOwnProperty("items")&&n.items.length&&(y(n,n.parent),n.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_disabled ogx_tree_item_arrow_close").addClass("ogx_tree_item_arrow_open"),n.element.attr("state","open").attr("state",n.type+"-open"))}},this.replaceItem=function(e){var t=D(e[h]);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=D(e);if(t){var i=function(e){function t(t){return!(!t.hasOwnProperty("items")||!t.items.get({_id:{eq:e}},null,1))&&t}return L(t)}(e);return t.uxi&&t.uxi.kill(),i.items.findDelete("_id",e,1),t.element.remove(),i.items.length||(i.state="closed"),w(i),t}},this.deleteSelectedItem=function(){return function(){function e(e,t,i,n){if(e[h]===s)return e.element.remove(),i.items.splice(n,1),w(i),!0}if(s)return L(e);return!1}()},this.getSelectedItem=function(){return X()},this.getTree=function(){var e=L(b,null,OGX.Data.clone(u.data));return e||!1},this.setData=function(e){e.hasOwnProperty("types")&&this.setTypes(e.types),e.hasOwnProperty("tree")&&this.setTree(e.tree)},this.setTypes=function(e){u.types=e},this.setTree=function(e){this.scroll?this.clear([this.scroller.id]):this.clear(),u.data=e,u.data.hasOwnProperty("state")||(u.data.state="open"),l||S(),v()},this.newTree=function(){d.scroll?d.clear([d.scroller.id]):d.clear();g=0,m()},this.filterTree=function(e){!function(e){var t=[];function i(n,o,a,r){if(-1!==(o+n.label).indexOf(e)&&t.push(o+"/"+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 a=this;setTimeout((function(){a.scroller.resize()}),0)}else i.append(o),e.el='.ogx_uxi[data-ogx-id="'+this.id+'"]';this.el=$(e.el)}},OGX.Uxi.prototype.enable=function(e){return this.enabled||(this.enabled=!0,this.focus(e)),this},OGX.Uxi.prototype.disable=function(e){return this.enabled&&(this.enabled=!1,this.blur(e)),this},OGX.Uxi.prototype.ux=function(){},OGX.Uxi.prototype.onFocus=function(){},OGX.Uxi.prototype.onBlur=function(){},OGX.Uxi.onFocus=function(){},OGX.Uxi.onBlur=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._show()},OGX.Uxi.prototype.hide=function(){return this._hide()},OGX.Uxi.prototype._show=function(){return this.el&&(this.visible=!0,this.el.removeClass("ogx_uxi_hidden")),this},OGX.Uxi.prototype._hide=function(){return this.el&&(this.visible=!1,this.el.addClass("ogx_uxi_hidden")),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,o){var a=this,r=this.el,s=null;if(void 0!==o&&(r=o),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):a.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 o=this;this.observe(!0,e,(function(){o.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.ux(!0),this.__proto__.onFocus(),this.onFocus(),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)},OGX.Uxi.prototype.toJSON=function(){return{type:this._NAME_,id:this.id,selector:this.selector,data:this.data}},OGX.Uxi.prototype.toOML=function(){var e={},t=this.selector+":"+this._NAME_;if(e[t]={id:this.id,data:this.data,"node:OML":[]},this.nodes.length)for(var i=0;i$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,touch_drag;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(),o=config.parent.el.height();user_resized?(n=config.width,o=config.height):(e=OGX.Data.getBestSize(n,config.width),t=OGX.Data.getBestSize(o,config.height));var a={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&&(a.width=config.max_width+"px")):(-1!==(i=config.width).indexOf("px")&&(i=Number(i.split("px")[0])),config.min_width&&iconfig.max_width&&(a.width=config.max_width+"px"))),(config.min_height||config.max_height)&&(-1!==config.height.indexOf("%")?(o=config.parent.el.height(),i=Number(config.height.split("%")[0])*o/100,config.min_height&&iconfig.max_height&&(a.height=config.max_height+"px")):(-1!==(i=config.height).indexOf("px")&&(i=Number(i.split("px")[0])),config.min_height&&iconfig.max_height&&(a.height=config.max_height+"px"))),a}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&&!0!==t||(t=config.anim);var o={opac:1,tX:0,tY:0},a=container.parent().width(),r=container.parent().height(),s=that.el.outerWidth(),l=that.el.outerHeight(),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?(o.tY=0,d.addClass("ogx_window_main_icon_top")):o.tY=-l-10;break;case OGX.Window.ANIM_BOTTOM:e?(o.tY=0,d.addClass("ogx_window_main_icon_bottom")):o.tY=r+10;break;case OGX.Window.ANIM_RIGHT:e?(o.tX=a-s,d.addClass("ogx_window_main_icon_right")):o.tX=a+10;break;case OGX.Window.ANIM_LEFT:e?(o.tX=0,d.addClass("ogx_window_main_icon_left")):o.tX=-s-10}var c=100;e?(pt.x=o.tX,pt.y=o.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("+o.tX+"px, "+o.tY+"px, 0px)",opacity:o.opac,visibility:"visible"})}),c)}function placeWindow(e){var t=container.parent().width(),i=container.parent().height(),n=that.el.outerHeight(),o=that.el.outerWidth();that.el.removeClass("ogx_window_anim_in").removeClass("ogx_window_anim_out");var a={x:0,y:0};switch(config.anim){case OGX.Window.ANIM_TOP:a.y=e?-n:n,dir.y=-1;break;case OGX.Window.ANIM_BOTTOM:a.y=e?i:i-n,dir.y=1;break;case OGX.Window.ANIM_RIGHT:a.x=e?t:t-o,dir.x=1;break;case OGX.Window.ANIM_LEFT:e&&(a.x=-o),dir.x=-1}that.el.css({transform:"translate3d("+a.x+"px, "+a.y+"px, 0px)"})}function prepWindow(){var e=new OGX.Display(config),t={};t.head=config.head,t.title=config.title,t.icons=config.icons,t.html=e.html();var i=config.win_html,n="";switch(config.anim){case OGX.Window.ANIM_RIGHT:case OGX.Window.ANIM_TOP:case OGX.Window.ANIM_BOTTOM:n=config.win_inner,t.side="right";break;case OGX.Window.ANIM_LEFT:n=config.win_inner.reverse(),t.side="left"}n=n.toString().replace(/>,<"),i=i.replace("$INNER",n);var o="";return config.icons&&config.icons.length&&(o=genIcons()),i=i.replace("$ICONS",o),OGX.Templater.make(i,t)}function onResize(){user_resized=!0,that.resizeNodes()}function listenScroll(e){e?(that.el.on(OGX.Scroller.START,(function(){that.onBlur()})),that.el.on(OGX.Scroller.END,(function(){that.onFocus()}))):(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={state:"manual"},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}touch_drag=that.touch.add("Drag",e)}config.resize&&that.setResize(t),config.show&&that.show(),config.scroll&&listenScroll(!0),debug(5,"window",config.id,"init")}this.id=config.id,this.dragable=null,this.resizeable=null,this.status=OGX.Window.CLOSED,this.onFocus=function(){return config.close_on_click_out&&listenBody(!0),config.head&&listenBackIcon(!0),config.icons&&listenIcons(!0),config.drag&&touch_drag.enable(),config.resize&&this.enableResize(),debug(5,"window",config.id,"enabled"),this},this.onBlur=function(){return config.close_on_click_out&&listenBody(!1),config.head&&listenBackIcon(!1),config.icons&&listenIcons(!1),config.drag&&touch_drag.disable(),config.resize&&this.disableResize(),debug(5,"window",config.id,"disabled"),this},this.show=function(e,t,i){return this.visible||(this._show(),config.drag&&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 this.visible&&(this._hide(),config.drag&&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(){config.scroll&&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;function i(e,t,i,n){var o;if(void 0===t&&(t=null),void 0===i&&(i=!1),void 0===n&&(n=null),"string"==typeof e)o=new Worker(e);else{var a="";if(t){for(var r=0;r1&&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&&(w=w.substr(0,w.indexOf(".")-1)),_=e[G],e[G].hasOwnProperty("node:OML")&&(e[G]=f(e,e[G])),x=!0,y=!0,A=!1,E=!1,w){case"Function":return y=!1,_.parent=t,_.fnc=m,_=g(_,n,i),void OGX.Fonction(_,n,i);case"Uxi":return void e[G].attach(t,m);case"Fork":(S=O(m,e[G]))&&d(S,t,l),y=!1,x=!1;break;case"Html":_.el=m,_.html=e[G].html,(y=p(_))||(_.template=!1);break;case"Template":_.template=v.split(".")[1],_.el=m,y=p(_),v="Html";break;case"Ghost":_.el=m;break;case"Controller":_.id=m,E=!0;break;case"Scroller":N=$(m),_.el=m,_.content=N.html(),N.empty();break;default:-1!==[".","#"].indexOf(m.substr(0,1))?_.el=m:(_.id=m,_.el=t.el[0],_.parent=t)}x&&(_=g(_,n,i)),X=!1,M=!1,y?(r&&_.hasOwnProperty("id")&&(P=r.find("id",_.id.replace(/^#/gi,""),1))&&(M=!0),M?(P.wake(_.el),b=P):b=OGX.Object.create(v,_),t.add(b),X=b):A?(A.blur(),$(m).html(C),A.el=$(m),t.add(A),setTimeout((function(){!t.blured&&l&&A.focus()}),0)):(X=t,"Html"===v&&OGX.HtmlRender(_)),X&&e[G].hasOwnProperty("node:OML")&&!A&&!M&&d(e[G]["node:OML"],X,l),y&&(b.parent=t,"function"==typeof b.construct&&(M||(E?s.push({object:b,data:[i]}):b.construct.apply(b,[i])))),b&&!E&&(y||M)&&!t.blured&&l&&b.enabled&&(b.floating||b.focus()),void 0!==b&&b&&!E&&(a=a.concat(u(b,e[G])))}}}d(t,e),a.length&&function(e){for(var t=0;t'+r.display_date.format(t)+""),r.date&&(e+=''+r.date.format(r.format)+""),r.browse&&(e+=''),i.children(".ogx_calendar_head").children(".ogx_calendar_head_date").html(e)}function b(t){i.children(".ogx_calendar_head").children(".ogx_calendar_head_labels").html(t)}function w(t,e,i,n){if(e.y-1>=0&&e.y-1{e.off_dates=t})),this)},this.noSelection=function(t,e){return void 0===t?r.no_selection:(void 0===e&&(e=!0),r.no_selection=t,e&&v(),this)},OGX.Data.merge(r,s),r.callbacks.select||(r.callbacks.select=a.onSelect),r.callbacks.unselect||(r.callbacks.unselect=a.onUnselect),(i=a.el).addClass("ogx_calendar"),r.date&&(moment.isMoment(r.date)||(r.date=moment(r.date)),r.display_date=r.date.clone()),r.display_date?moment.isMoment(r.display_date)||(r.display_date=moment(r.display_date)):r.display_date=moment(),o=r.layout,c.y=o+1,i.html('
'),T(),G(),e=a.create("GridSwiper",{el:r.el+" .ogx_calendar_body",loop:!0,map:n,start:{x:1,y:o+1},chromeos:r.chromeos,enabled:r.swipe}),O(),b(l[o].labels(r.display_date))},OGX.Calendar.SELECT="CalendarSelect",OGX.Calendar.UNSELECT="CalendarUnselect",OGX.Calendar.BIND=OGX.Calendar.SELECT+" "+OGX.Calendar.UNSELECT,OGX.Calendar.BROWSE="CalendarBrowse",OGX.CalendarLayout={},OGX.CalendarLayout.BASE_LAYOUT=function(t){"use strict";this.off_dates=null,this.labels=function(t){return""},this.html=function(t,e,i,n){return""},this.value=function(){return{value:1,unit:"months"}},this.format=function(){return t.hasOwnProperty("format")?t.format:"YYYY-MM"}},OGX.CalendarLayout.MONTH_DAYS=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="YYYY-MM"),!t.hasOwnProperty("labels")&&(t.labels="ddd"),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){var i="",n=Number(e.format("d")),o=e.clone();n&&o.subtract(n,"day");for(var a=0;a<7;a++)i+=''+o.format(t.labels)+"",o.add(1,"day");return i},this.html=function(t,e,i,n){var o,a=t.format("MM"),r=moment(t.format("YYYY-MM-")+"01").day(),s=moment(t.format("YYYY-MM-")+"01").subtract(r,"days"),l="";n&&(l=n.format("YYYY-MM-DD"));for(var c,d="",u=0;u<35;u++)c="",o=s.format("YYYY-MM-DD"),s.format("MM")!==a&&(c+="ogx_calendar_layout_month_days_offset "),o===moment().format("YYYY-MM-DD")&&(c+="ogx_calendar_layout_month_days_today "),n&&l===o&&(c+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(o)&&(c+="ogx_calendar_layout_off_date "),d+='
'+e(o,i)+"
",s.add(1,"days");return d},this.value=function(){return{value:1,unit:"months"}}},OGX.CalendarLayout.CENTURY_DECADES=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="YYYY"),!t.hasOwnProperty("labels")&&(t.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){return''+(t.labels?e.format(t.labels):100*Math.floor(Number(e.format("YYYY"))/100)+"'s")+""},this.html=function(t,e,i,n){var o,a,r=moment(),s=100*Math.floor(Number(r.format("YYYY"))/100),l=10*Math.floor(Number(r.format("YYYY").substr(2))/10),c=100*Math.floor(Number(t.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 f="",h=0;h<10;h++)a="",s+l===c+(o=10*h)&&(a="ogx_calendar_layout_century_decades_current "),d+u===c+o&&(a+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(c+o)&&(a+="ogx_calendar_layout_off_date "),f+='
'+e(c+o,i)+"
";return f},this.value=function(){return{value:100,unit:"years"}}},OGX.CalendarLayout.CENTURY_YEARS=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="Y"),!t.hasOwnProperty("labels")&&(t.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){return''+(t.labels?e.format(t.labels):100*Math.floor(Number(e.format("YYYY"))/100)+"'s")+""},this.html=function(t,e,i,n){var o,a=moment(),r=100*Math.floor(Number(a.format("YYYY"))/100),s=Number(a.format("YYYY").substr(2)),l=100*Math.floor(Number(t.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="",f=0;f<100;f++)o="",l+f===r+s&&(o+="ogx_calendar_layout_century_years_current "),l+f===c+d&&(o+="ogx_calendar_selected_item"),this.off_dates&&this.off_dates.includes(l+f)&&(o+="ogx_calendar_layout_off_date "),u+='
'+e(l+f+"-01-01",i)+"
";return u},this.value=function(){return{value:100,unit:"years"}}},OGX.CalendarLayout.DECADE_YEARS=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="Y"),!t.hasOwnProperty("labels")&&(t.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){return''+(t.labels?e.format(t.labels):10*Math.floor(Number(e.format("YYYY"))/10)+"'s")+""},this.html=function(t,e,i,n){var o,a=10*Math.floor(Number(t.format("YYYY"))/10),r="",s=Number(moment().format("YYYY")),l="";n&&(l=Number(n.format("YYYY")));for(var c=0;c<10;c++)o="",a+c===s&&(o+="ogx_calendar_layout_decade_years_current "),a+c===l&&(o+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(a+c)&&(o+="ogx_calendar_layout_off_date "),r+='
'+e(a+c+"-01-01",i)+"
";return r},this.value=function(){return{value:10,unit:"years"}}},OGX.CalendarLayout.DECADE_MONTHS=function(t){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(t){for(var e=10*Math.floor(Number(t.format("YYYY"))/10),i=Number(String(e).substr(2,2)),n="",o=0;o<10;o++)n+='\''+i+"",i++;return n},this.html=function(t,e,i,n){var o,a,r,s,l=10*Math.floor(Number(t.format("YYYY"))/10),c="",d=moment().format("YYYY-MM");n&&(o=n.format("YYYY-MM"));for(var u=0;u<12;u++){s=u+1;for(var f=0;f<10;f++)a="",(r=l+f+"-"+(s<10?"0"+s:s))===d&&(a="ogx_calendar_layout_decade_months_current "),r===o&&(a+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(r)&&(a+="ogx_calendar_layout_off_date "),moment(r+"-01"),c+='
'+e(r+"-01",i)+"
"}return c},this.value=function(){return{value:10,unit:"years"}},this.format=function(t){return"["+10*Math.floor(Number(t.format("YYYY"))/10)+"'s]"}},OGX.CalendarLayout.YEAR_MONTHS=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="Y"),!t.hasOwnProperty("labels")&&(t.labels="[Months]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){return''+e.format(t.labels)+""},this.html=function(t,e,i,n){var o,a,r=moment().format("YYYY-MM"),s=t.format("YYYY"),l="",c="";n&&(c=n.format("YYYY-MM"));for(var d=1;d<13;d++)o="",s+"-"+(a=d<10?"0"+d:d)===r&&(o+="ogx_calendar_layout_year_months_current "),s+"-"+a===c&&(o+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(s+"-"+a)&&(o+="ogx_calendar_layout_off_date "),l+='
'+e(s+"-"+a+"-01",i)+"
";return l},this.value=function(){return{value:1,unit:"years"}}},OGX.CalendarLayout.YEAR_WEEKS=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="Y"),!t.hasOwnProperty("labels")&&(t.labels="[Weeks]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){return''+e.format(t.labels)+""},this.html=function(t,e,i,n){var o=moment().week(),a=t.format("YYYY"),r=moment().format("YYYY"),s="",l="";n&&(l=n.week(),s=n.format("YYYY"));for(var c,d,u="",f=1;f<53;f++)c="",d=moment().year(a).week(f).format("YYYY-MM-DD"),o===f&&a===r&&(c="ogx_calendar_layout_year_weeks_current "),l===f&&a===s&&(c+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(d)&&(c+="ogx_calendar_layout_off_date "),u+='
'+e(d,i)+"
";return u},this.value=function(){return{value:1,unit:"years"}}},OGX.CalendarLayout.YEAR_DAYS=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="Y"),!t.hasOwnProperty("labels")&&(t.labels="[Nth Day]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){return''+e.format(t.labels)+""},this.html=function(t,e,i,n){var o,a,r,s="",l=t.format("YYYY-MM-DD"),c=moment(t.format("YYYY")+"-01-01"),d="";n&&(d=n.format("YYYY-MM-DD")),a=t.isLeapYear()?366:365;for(var u=0;u'+e(r,i)+"",c.add(1,"days");return s},this.value=function(){return{value:1,unit:"years"}}},OGX.CalendarLayout.MONTH_WEEKS=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="[(]YYYY-MM[)] W"),!t.hasOwnProperty("labels")&&(t.labels="[Nth Week]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){return''+e.format(t.labels)+""},this.html=function(t,e,i,n){var o,a="",r=moment(),s=Number(r.format("YYYY")),l=Number(r.format("w")),c=Number(t.format("YYYY")),d=0,u=0;n&&(d=Number(n.format("YYYY")),u=Number(n.format("w")));a="";for(var f,h=moment(t.format("YYYY-MM-[01]")),g=0;g<5;g++)f="",o=Number(h.format("w")),c===d&&o===u&&(f+="ogx_calendar_selected_item "),c===s&&o===l&&(f+="ogx_calendar_layout_month_weeks_current"),this.off_dates&&this.off_dates.includes(o)&&(f+="ogx_calendar_layout_off_date "),a+='
'+e(h.format("YYYY-MM-DD"),i)+"
",h.add(7,"days");return a},this.value=function(){return{value:1,unit:"months"}}},OGX.CalendarLayout.WEEK_DAYS=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="YYYY-MM (wo [week])"),!t.hasOwnProperty("labels")&&(t.labels="ddd DD"),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){var i="",n=Number(e.format("d")),o=e.clone();n&&o.subtract(n,"day");for(var a=0;a<7;a++)i+=''+o.format(t.labels)+"",o.add(1,"day");return i},this.html=function(t,e,i,n){var o,a,r="",s=t.weekday(),l=t.subtract(s,"days"),c=moment().format("YYYY-MM-DD"),d="";n&&(d=n.format("YYYY-MM-DD"));for(var u=0;u<7;u++)o="",(a=l.format("YYYY-MM-DD"))===c&&(o="ogx_calendar_layout_week_days_current "),a===d&&(o+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(a)&&(o+="ogx_calendar_layout_off_date "),r+='
'+e(a,i)+"
",l.add(1,"days");return r},this.value=function(){return{value:1,unit:"weeks"}}},OGX.CalendarLayout.DAY_HOURS=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="YYYY-MM-DD HH:[00]"),!t.hasOwnProperty("labels")&&(t.labels="[Hours]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){return''+e.format(t.labels)+""},this.html=function(t,e,i,n){var o,a,r="",s=Number(moment().format("HH")),l=t.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 f=0;f<24;f++)a="",f===s&&l===c&&(a="ogx_calendar_layout_days_hours_current "),f===d&&l===u&&(a+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(l+o+":00")&&(a+="ogx_calendar_layout_off_date "),r+='
'+e(l+o+":00",i)+"
";return r},this.value=function(){return{value:1,unit:"days"}}},OGX.CalendarLayout.DAY_WORK_HOURS=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="YYYY-MM-DD HH:[00]"),!t.hasOwnProperty("labels")&&(t.labels="[Work Hours]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){return''+e.format(t.labels)+""},this.html=function(t,e,i,n){i&&void 0!==i?i.hasOwnProperty("start")||(i.start=8,i.end=17):i={start:8,end:17};var o,a,r="",s=Number(moment().format("HH")),l=t.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 f=i.start;f'+e(l+o+":00",i)+"";return r},this.value=function(){return{value:1,unit:"days"}}},OGX.CalendarLayout.DAY=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="YYYY-MM-DD"),!t.hasOwnProperty("labels")&&(t.labels="dddd DD"),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){return''+e.format(t.labels)+""},this.html=function(t,e,i,n){var o="",a=t.format("YYYY-MM-DD"),r=moment().format("YYYY-MM-DD");return n&&a===n.format("YYYY-MM-DD")&&(o+="ogx_calendar_selected_item "),a===r&&(o+="ogx_calendar_layout_day_current "),this.off_dates&&this.off_dates.includes(a)&&(o+="ogx_calendar_layout_off_date "),'
'+e(a,i)+"
"},this.value=function(){return{value:1,unit:"days"}},this.select=function(t){}},OGX.CalendarEngine={},OGX.CalendarEngine.CELL_VALUE=function(t,e){var i=moment(t);return e.hasOwnProperty("css")||(e.css=""),'
'+i.format(e.format)+"
"},OGX.CalendarEngine.DAY_NUMBER=function(t,e){var i=moment(t);return OGX.CalendarEngine.CELL_VALUE(i,{format:"DD",css:"ogx_calendar_engine_day_number"})},OGX.CalendarEngine.WEEK_NUMBER=function(t,e){return'
'+moment(t).week()+"
"},OGX.CalendarEngine.MONTH_NUMBER=function(t,e){return OGX.CalendarEngine.CELL_VALUE(t,{format:"MM",css:"ogx_calendar_engine_month_number"})},OGX.CalendarEngine.YEAR_NUMBER=function(t,e){return OGX.CalendarEngine.CELL_VALUE(t,{format:"YY",css:"ogx_calendar_engine_year_number"})},OGX.CalendarEngine.DECADE_NUMBER=function(t){return'
'+String(t).substr(2)+"'s
"},require("Carousel","Uxi","Placeholder","Touch"),OGX.Carousel=function(t){construct(this,"Carousel");var e,i,n,o,a,r,s=this,l=t,c={min_x:100,anim:!0,drag:!0,drag_left:!0,drag_right:!0,dots:!1,css:!1,index:0,capture:!1,callbacks:{change:null},display:!1,displays:!1,as:"item",list:null},d={position:"bottom"},u=!1,f=0,h=0,g=new OGX.List,_="ogx_carousel",p=null,m=null;function v(t){if(void 0!==t&&g[t]&&g[t].instance){var e=s.find(g[t].instance._NAME_,g[t].instance.id);e&&e.blur(2)}}function y(t){if(void 0!==t&&g[t]&&g[t].instance){var e=s.find(g[t].instance._NAME_,g[t].instance.id);e&&s.enabled&&e.focus(1)}}function x(t){i.off("transitionend"),i.removeClass(_+"_anim")}function O(t){if(t.dirX){if(-1===t.dirX&&!l.drag_right)return;if(1===t.dirX&&!l.drag_left)return}if(t.distX>t.distY){var e=r*n*-1+t.distX*t.dirX;e<=0&&e>-1*(i.width()-s.el.width())&&i.css({transform:"translate3d("+e+"px, 0, 0)"})}}function b(t){if(t.distX>l.min_x){var i=r+-1*t.dirX;i>=0&&i'),t.push("."+_+'[data-ogx-id="'+s.id+'"] > .'+_+"_views > ."+_+'_view[data-ogx-panel-id="'+f+'"]'),f++;i.css("width",100*h+"%"),s.placeholders(l,t),e.trigger(OGX.Carousel.READY)}this.construct=function(){T(),l.index&&this.showPanel(l.index,!1),l.dots&&a.bind("dots",s)},this.onFocus=function(){l.drag&&m.enable(),setTimeout((function(){for(var t=0;t0&&this.showPanel(r-1),this},this.next=function(){return r+1'+t+""),i.css("width",Math.round(100*h)+"%"),i.children("."+_+"_view").css("width",100/h+"%"),++f-1}(),c="."+_+'[data-ogx-id="'+this.id+'"] > .'+_+"_views > ."+_+'_view[data-ogx-panel-id="'+l+'"]',d={},u=c;if(t.hasOwnProperty("_NAME_"))t.detach(),t.attach(this,c),o&&this.showPanel(h-1,a);else{for(var g in t){u+=":"+g.split(":")[1],d[u]=t[g];break}var p=null;setTimeout((function(){s.observe(!0,{childList:!0,subtree:!0},(function(){s.observe(!1),p&&clearTimeout(p),p=setTimeout(T,20),o&&(s.showPanel(h-1,a),r?r():e.trigger(OGX.Carousel.ADDED,h))})),OGX.OML.render(s,d,n)}),0)}return this},this.removeNode=function(t,e){void 0===e&&(e=t,t=null);for(var i=!1,n=0;n=0&&tt?i.children("."+_+"_view:eq("+(n-1)+")").after(o):i.children("."+_+"_view:eq("+n+")").before(o);var a=100/h*(-1*n);return i.removeClass(_+"_anim"),i.css({transform:"translate3d("+a+"%, 0, 0)"}),r=n,setTimeout(T,0),s.onChange(r),e.trigger(OGX.Carousel.CHANGE,r),this},this.removePanel=function(t,n){if(void 0===n&&(n=!0),t>=0&&t=r?t--:t=--r,t<0&&(t=0),r=t,s.showPanel(t,!1,!0),e.trigger(OGX.Carousel.REMOVED,h),o}return!1},this.empty=function(){return this.clear(),i.empty(),i.removeClass(_+"_anim").css("width","100%"),i.css({transform:"translate3d(0%, 0, 0)"}),h=0,g=new OGX.List,l.index=r=0,l["node:OML"]=[],this},this.render=function(t,e){return l["node:OML"]=t,h=l["node:OML"].length,C(),OGX.OML.render(this,l["node:OML"],e),this},this.destroy=function(){this.touch.wipe()},function(){if(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)),p=new OGX.Display(l),r=l.index,e=s.el,n=Math.floor(e.innerWidth()),l.hasOwnProperty("node:OML")&&l["node:OML"].length)h=l["node:OML"].length;else if(l.list&&l.list.length){for(var t,i,o=[],a=0;a .ogx_carousel_views > .ogx_carousel_view[data-ogx-panel-id="'+a+'"]',l.list[a],l.as),o.push(t);else{i=p.html(l.list[a]);var u='{"default:Html":{"html":'+JSON.stringify(i)+"}}";t=JSON.parse(u),o.push(t)}l["node:OML"]=o,h=l["node:OML"].length}}(),function(){e.addClass(_);var t="";l.dots&&"top"===l.dots.position&&(t+=''),t+='
',l.dots&&"bottom"===l.dots.position&&(t+=''),e.append(t),(i=e.find("."+_+"_views").first()).css({transform:"translate3d("+100/h*(-1*r)+"%, 0, 0)"})}(),l.dots&&(a=s.create("Dots",{el:"."+_+'[data-ogx-id="'+s.id+'"] > .carousel_dots',total:h})),C(),m=s.touch.add("Swipe",{x:!0,cb_down:x,cb_swipe:O,cb_up:b,capture:l.capture,state:"manual"}),l.drag?m.enable():s.drag(!1)},OGX.Carousel.READY="CarouselReady",OGX.Carousel.CHANGE="CarouselChange",OGX.Carousel.ADDED="CarouselAdded",OGX.Carousel.REMOVED="CarouselRemoved",OGX.Color={},OGX.Color.hexToRgb=function(t){"use strict";t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,i,n){return e+e+i+i+n+n}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]:null},OGX.Color.rgbToHex=function(t,e,i){"use strict";var n,o,a;arguments.length>1&&(t=t+", "+e+", "+i),"object"==typeof t&&(t=Array.isArray(t)?t.join(","):t.r+" "+t.g+" "+t.b);var r=/(\d+)[ ,]*(\d+)[ ,]*(\d+)/g,s=r.exec(t);return s&&(s.shift(),n=Number(s[0]),o=Number(s[1]),a=Number(s[2])),"#"+((1<<24)+(n<<16)+(o<<8)+a).toString(16).slice(1)},OGX.Color.rgbToHsl=function(t,e,i){"use strict";var n,o,a;arguments.length>1&&(t=t+", "+e+", "+i),"object"==typeof t&&(t=Array.isArray(t)?t.join(","):t.r+" "+t.g+" "+t.b);var r=/(\d+)[ ,]*(\d+)[ ,]*(\d+)/g,s=r.exec(t);if(s){s.shift(),n=s[0],o=s[1],a=s[2],n/=255,o/=255,a/=255;var l,c,d=Math.max(n,o,a),u=Math.min(n,o,a),f=(d+u)/2;if(d===u)l=c=0;else{var h=d-u;switch(c=f>.5?h/(2-d-u):h/(d+u),d){case n:l=(o-a)/h+(o1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t},c=i<.5?i*(1+e):i+e-i*e,d=2*i-c;a=l(d,c,t+1/3),r=l(d,c,t),s=l(d,c,t-1/3)}return[Math.round(255*a),Math.round(255*r),Math.round(255*s)]},OGX.Color.formatHex=function(t){return"#"===t.slice(0,1)&&(t=t.slice(1)),t.length>3||t.split("").map((function(t){return t+t})),"#"+t},require("Container","Uxi"),OGX.Container=function(t){construct(this,"Container");var e=this,i={tabs:!0,carousel:{enabled:!0},enabled:!0,reorder:!0,anim:!0,flatten:!1,chromeos:!1,index:0,dots:!1},n=t,o="normal",a=0;function r(t){t?(e.tabs.el.on(OGX.Tabs.SELECT,(function(t,i){var n=e.tabs.index();e.carousel.val(n),e.el.trigger(OGX.Container.CHANGE,n)})),e.tabs.el.on(OGX.Tabs.REMOVE,(function(){})),e.tabs.el.on(OGX.Tabs.REORDER,(function(t,i){e.carousel.swapPanels(i.from,i.to)})),e.tabs.el.on(OGX.Tabs.ADD,(function(){})),e.carousel.el.on(OGX.Carousel.CHANGE,(function(t,i){e.tabs.index(i),e.el.trigger(OGX.Container.CHANGE,i)}))):(e.tabs.el.off(OGX.Tabs.SELECT),e.tabs.el.off(OGX.Tabs.REMOVE),e.tabs.el.off(OGX.Tabs.REORDER),e.tabs.el.off(OGX.Tabs.ADD),e.carousel.el.off(OGX.Carousel.CHANGE)),s(t)}function s(t){t?e.tabs.el.on(OGX.Tabs.REMOVE,(function(t,i){s(!1),"Popup"===e.parent._NAME_?app.ungroupPopup(e.parent,i.index,i.label,i.x,i.y):e.carousel.removeNode(e.carousel.nodes[i.index].id),setTimeout((function(){s(!0)}),200)})):e.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(t,e){if(arguments.length||this._show(),this.carousel&&"normal"===o){var i=this.carousel.getNodeIndex(t,e);i&&(this.carousel.val(i.index),n.tabs&&this.tabs.index(i.index))}},this.index=function(t){return this.carousel&&"normal"===o&&(this.carousel.val(t),n.tabs&&this.tabs.index(t)),this},this.onFocus=function(){return n.tabs&&this.carousel&&(this.tabs.onFocus(),r(!0)),this},this.onBlur=function(){return n.tabs&&this.carousel&&(this.tabs.onBlur(),r(!1)),this},this.resize=function(){var t,e,i;return n.flatten&&(this.carousel&&"flattened"!==o&&this.el.width()>=n.flatten?(o="flattened",n.tabs&&(this.tabs.blur(),this.tabs.hide()),this.carousel.blur(),a=(t=this.carousel.el.children(".ogx_carousel_views"),e=t[0].style.transform,i=/translate3d\(([0-9px%,\.\- ]+)\)/,e=(e=e.match(i))[1].split(","))[0],this.carousel.el.children(".ogx_carousel_views").addClass("ogx_container_flattened").css("transform","translate3d(0px, 0px, 0px)")):this.carousel&&"flattened"===o&&this.el.width()';e.html(i)}this.onFocus=function(){return n.clickable&&c(!0),this},this.onBlur=function(){return n.clickable&&c(!1),this},this.bind=function(t,e){return!(a.hasOwnProperty(t)||!e.hasOwnProperty("_NAME_"))&&function(t,e){switch(a[t]=e,e._NAME_){case"Carousel":n.total=e.panels().length,n.current=e.val(),e.el.on(OGX.Carousel.CHANGE,s),e.el.on(OGX.Carousel.ADDED+" "+OGX.Carousel.REMOVED,l)}return!0}(t,e)},this.unbind=function(t){return!!a.hasOwnProperty(t)&&r(t)},this.select=function(t){e.find(".ogx_dots_selected").removeClass("ogx_dots_selected"),e.children(".ogx_dots_item:eq("+t+")").children(".ogx_dots_gfx").first().addClass("ogx_dots_selected"),n.current=t},this.onSelect=function(){},this.destroy=function(){!function(){for(var t in a)r(t)}()},OGX.Data.merge(n,o),n.callbacks.select||(n.callbacks.select=i.onSelect),(e=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(t,e,i){if(display.hasOML()){var n,o,a=toDataId(i[e]),r=display.oml('.ogx_dynamic_list[data-ogx-id="'+that.id+'"] > .ogx_dynamic_list_item[data-ogx-id='+a+"]",i,config.as);$('.ogx_dynamic_list[data-ogx-id="'+that.id+'"] > .ogx_dynamic_list_item[data-ogx-id='+a+"]").find(".ogx_uxi").each((function(t,e){n=$(e).data("ogx-id"),(o=that.cfind(!1,n,1))&&that.find(o._NAME_,o.id,"remove")})),OGX.OML.render(that,r,i)}else{var s="";selection.length&&selection.find(e,i[e],1)&&(s="ogx_dynamic_list_selected_item "),t.attr("class","").addClass("ogx_dynamic_list_item "+s+display.css(i)),t.html(display.html(i))}}function render(){var t=getWorkList(),e=selection;isFiltered&&(selection.resetFilters(),selection.setFilters(config.list.getFilters()),(e=selection.filter()).length!==selection.length&&(e.length?container.trigger(OGX.DynamicList.SELECT_FILTERED,e):container.trigger(OGX.DynamicList.SELECT_UNFILTERED,selection)));for(var i,n,o,a="",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.onFocus=function(t){return void 0===t&&(t=!1),(t||config.mode!==OGX.DynamicList.STATIC)&&(listenItems(!0),(config.reorder||config.swipe)&&(listenTouch(!0),config.swipe&&listenTrans(!0))),this},this.onBlur=function(t){return void 0===t&&(t=!1),(t||config.mode!==OGX.DynamicList.STATIC)&&(listenItems(!1),(config.reorder||config.swipe)&&(listenTouch(!1),config.swipe&&listenTrans(!1))),this},this.bindFilter=function(t,e,i){void 0!==i&&(config.list.removeFilter(t),config.list.addFilter(t,e,i)),config.list.getFilters()&&(filtered=config.list.filter(),isFiltered=!0),setTimeout(render,0)},this.unbindFilter=function(t){return config.list.removeFilter(t),filtered=config.list.filter(),isFiltered=!0,setTimeout(render,0),this},this.bindValue=function(){return this.getSelection()},this.destroy=function(){!0===config.scope&&listenScope(!1),this.clearBinds(),container.empty(),container.removeClass("ogx_dynamic_list")},this.val=function(t,e,i){if(void 0===t){if(!config.key){var n=JSON.parse(JSON.stringify(config.list));return clearIds(OGX.List(n))}return config.list}var o;void 0===e&&(e=!1),void 0===i&&(i=!0),t.hasOwnProperty("insert")||(t=new OGX.List(t)),this.resetSelection(),e||(o=config.list.getFilters()),config.list=t,config.key&&key!==key_default||(key_id=1,key=key_default,t=JSON.parse(JSON.stringify(t)),forceIds()),!e&&Object.keys(o).length?(config.list.setFilters(o),setTimeout(this.filter,0)):i?setTimeout(render,0):render()},this.scope=function(t){return"undefined"!=typeof __script&&"string"==typeof config.scope?(config.scope=t,void this.render()):config.scope},this.onSelect=function(t){},this.onUnselect=function(t){},this.getFilteredList=function(){if(isFiltered){if(!config.key){var t=JSON.parse(JSON.stringify(filtered));return clearIds(OGX.List(t))}return filtered}return!1},this.display=function(t){return void 0===t?config.display:display.val(t)},this.key=function(t){if(void 0===t)return t;config.key=t,config.key||(key=key_default)},this.mode=function(t){return void 0===t?config.mode:(config.mode!==t&&(config.mode===OGX.DynamicList.STATIC?this.onFocus(!0):t===OGX.DynamicList.STATIC&&this.onBlur(!0),config.mode=t),this)},this.noSelection=function(t,e){return 1===arguments.length?"object"==typeof t?void(config.no_selection=t):void(config.no_selection.enabled=t):2===arguments.length?(config.no_selection.enabled=!0,config.no_selection.prop=t,void(config.no_selection.val=e)):config.no_selection},this.order=function(t,e){return config.list.order(t,e),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(t,e,i){return config.list.addFilter(t,e,i)},this.removeFilter=function(t,e,i){return config.list.removeFilter(t,e,i)},this.resetFilters=function(){return config.list.resetFilters()},this.getFilters=function(){return config.list.getFilters()},this.insert=function(t,e){if(!Array.isArray(t)){config.key||(t[key]=key_id++);var i=!1,n=!0;if(isFiltered){var o=new OGX.List(t);o.setFilters(config.list.getFilters()),0===o.filter().length?n=!1:filtered.push(t)}var a=toDataId(t[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,o=new OGX.List,a=!1;function r(e,i){if(!a){var o,r=n.find("el",i,1);if(r&&r.config.change_cb){for(var s in r.fields)if(r.fields[s].intv)return;var 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(o=JSON.stringify(c),!r.diff||r.val!==o){var f;if(r.val=o,r.config.validate){f={obj:c,form:i,valid:!1};var h=t.validate(r.form);!0===h?f.valid=!0:(f.valid=!1,f.error=h)}else f=c;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(e){var i={el:e.el,config:e,field:$(e.el),intv:!1};i.name=i.field.attr("name"),i.val=i.field.val(),i.field.val(i.val),e.pattern&&i.field.attr("pattern",e.pattern),n.insert(i),$(document).on("input change",i.el,(function(t){if(!a){var e=$(this).val();if(!i.config.diff||i.config.diff&&e!==i.val){if(i.config.input_cb){var n={value:null,obj:{},el:null};e=l(i.config.type,e),n.el=i.field[0],n.value=e,n.property=i.name,n.obj[i.name]=e,i.config.input_cb(n,i.config.params)}i.intv&&clearTimeout(i.intv),i.intv=setTimeout((function(){!function(t){var e=$(t.el).val();if(t.val=e,t.config.change_cb){var i={value:null,obj:{},el:null};e=l(t.config.type,e),i.el=t.field[0],i.property=t.name,i.value=e,i.obj[i.property]=e,t.config.validate&&(i.valid=i.el.checkValidity()),t.config.change_cb(i,t.config.params)}}(i)}),i.config.wait)}}})),e.multiline||$(document).on("keydown",i.el,(function(t){var e=$(this);if(void 0!==t.which&&void 0!==t.key){if(!a){if(i.config.mask&&8===t.which||46===t.which){var n=e[0].selectionStart,o=e.val();return o=8===t.which?o.substr(0,n-1):o.substr(0,n),e.val(o),!1}if(8!==t.which&&13!==t.which&&1===t.key.length){var r=t.key;if(13!==t.which&&i.config.mask){if((o=e.val()).length>=i.config.mask.length)return t.preventDefault(),t.stopImmediatePropagation(),!1;for(var s=i.config.mask,c=0;c1)return e.config.autocomplete?void 0:(t.preventDefault(),t.stopImmediatePropagation(),!1);if(1===n.length&&-1!==e.keys.indexOf(t.which)&&-1===t.which.indexOf(i))return t.preventDefault(),t.stopImmediatePropagation(),!1;if(e.config.multiline&&13===t.keyCode)return!1;if(e.config.allowed&&!n.match(e.config.allowed))return t.preventDefault(),t.stopImmediatePropagation(),!1;if(e.config.forbidden&&n.match(e.config.forbidden))return t.preventDefault(),t.stopImmediatePropagation(),!1;if($(t.originalEvent.target)[e.content]().length>=e.config.max)return t.preventDefault(),t.stopImmediatePropagation(),!1}})),$(document).on("paste",e.el,(function(t){if(!e.config.paste)return t.preventDefault(),t.stopImmediatePropagation(),!1;var i=t.originalEvent.clipboardData.getData("Text");return e.config.forbidden&&i.match(e.config.forbidden)?(t.preventDefault(),t.stopImmediatePropagation(),!1):void 0})),o.insert(e)}(t),!0},this.unrestrictField=function(t){var e=o.find("el",t,1);return!!e&&($(document).off("textInput keydown",e.el),$(document).off("paste",e.el),o.findDelete("el",t,1),!0)},this.toObj=function(t){return d(t)},this.populate=function(t,e,i){var n,o,a;void 0===i&&(i=null),$(t).find("*[name]").each((function(t,r){n=r.getAttribute("name"),a=!1,"string"!=typeof(a=OGX.Data.eval(e,n))&&(a=JSON.stringify(a)),void 0!==a&&(i&&i.hasOwnProperty(n)&&"function"==typeof i[n]&&(a=i[n](a)),(o=$(r)).val(a),r.hasAttribute("type")&&"hidden"===o.attr("type")&&o.trigger("change"))})),setTimeout(c,0)},this.validate=function(t){var i,n=$(t),o=e.elem_types,a=[];return n.find(o.join(",")).each((function(t,e){"submit"!==(i=$(e)).attr("type")&&(e.checkValidity()||a.push(i))})),!a.length||a}},OGX.Form=new OGX.Form,OGX.Form.fromObject=function(t,e,i,n){var o={el:e.selector+" "+i,data:t,fullpath:!1};return OGX.Data.merge(o,n),e.create("FormInstance",o)},require("FormInstance","Uxi","Placeholder"),OGX.FormInstance=function(__config){construct(this,"FormInstance");var that=this,config_defaults={fullpath:!1},config=OGX.Data.merge(__config,OGX.Form.defaults,!1,!0);function render(){var html="",oml='{"default:Html":{"html": {{$html}}, "node:OML": {{$oml}} }}',render_oml=!1,row,nodes=[];function cycle(__o,__path){for(var a in __o){var t=typeof __o[a],p;switch(p=__path?__path+"."+a:a,t){case"object":if(Array.isArray(__o[a]))if(["string","number","boolean"].includes(typeof __o[a][0]))row=genRow("array",a,JSON.stringify(__o[a])),html+=row.html,row.oml&&(nodes.push(row.oml),render_oml=!0);else for(var i=0;i<__o[a].length;i++)cycle(__o[a][i],__path?__path+"."+a+"["+i+"]":a+"["+i+"]");else cycle(__o[a],__path?__path+"."+a:a);break;case"string":case"number":case"boolean":var pattern="",required=!1,readonly=!1,oo;if(config.hasOwnProperty("fields")){try{oo=eval("config.fields."+p)}catch(t){}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(t,e,i,n,o,a){var r={html:"",oml:null},s=config.types[t],l="",c="",d="";void 0!==n&&n&&(l="required",c='pattern="'+o+'"'),void 0!==a&&a&&(d="readonly");var u=e;return config.fullpath||(u=e.split(".").pop()),r.html=OGX.Templater.make(s.html,{name:u,prop:e,val:i,required:l,pattern:c,readonly:d}),r.html=OGX.Templater.make(OGX.Form.defaults.templates.row,{html:r.html,name:u,prop:e}),s.hasOwnProperty("oml")&&(r.oml=OGX.Templater.make(s.oml,{name:u,prop:e,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.destroy=function(){OGX.Form.unbindForm(that.selector)},this.onChange=function(t){},this.onSubmit=function(t){},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(t){"use strict";var e=this;void 0===t&&(t={});var i,n,o,a,r=OGX.Data.merge(t,{map:null,markers:[],icon:"",browser_loc:null});function s(t,i){for(var n,o={},a=0;a1&&(t.city===i[1]?t.vicinity=t.vicinity.replace(i[0],""):t.city?t.city.length>i[1].length&&(t.city=i[1],t.vicinity=t.vicinity.replace(i[0],"")):t.city=i[1]),e)for(var n in t)-1===e.indexOf(n)&&delete t[n];return t},"undefined"!=typeof google&&void 0!==google.maps||$(document).trigger(OGX.Geo.ERROR_GMAP)},OGX.Geo.ERROR="GEO_error",OGX.Geo.ERROR_GMAP="GEO_GMAP_ERROR",OGX.Geo.TRAVEL_MODE_CAR="DRIVING",OGX.Geo.TRAVEL_MODE_TRANSIT="TRANSIT",OGX.Geo.TRAVEL_MODE_WALK="WALKING",OGX.Geo.TRAVEL_MODE_BIKE="BICYCLING",OGX.Geo.BROWSER_LOC_SUCCESS="GEO_BROWSER_LOC_SUCCESS",OGX.Geo.BROWSER_LOC_ERROR="GEO_BROWSER_LOC_ERROR",OGX.Geo.MAP_LOADED="GEO_MAP_LOADED",require("Ghost","Uxi"),OGX.Ghost=function(t){construct(this,"Ghost"),this.el=$(t.el),css="ogx_ghost",this.el.addClass(css),delete css},require("GridSwiper","Uxi","Touch"),OGX.GridSwiper=function(t){construct(this,"GridSwiper");var e,i,n,o,a,r,s,l,c,d,u,f,h=this,g=t,_={map:[[!0,!0,!0],[!0,!0,!0],[!0,!0,!0]],axis:{x:!0,y:!0},loop:!0,start:!1,chromeos:!1,capture:!1,callbacks:{up:null,down:null,left:null,right:null}},p=!1,m={x:null,y:null},v={x:0,y:0},y=".ogx_grid_swiper_cell",x=!1,O=!1,b=!1,w={x:0,y:0},G={x:0,y:0},X=(new Date).getTime()+Math.round(1e3*Math.random()),T=[];function C(t){t?e.on(h.touch.down,D):e.off(h.touch.down,D)}function D(t){p=!1,a=0,r=0,s=0,l=0,t=Y(t),m.x=t.pageX,m.y=t.pageY,x=!0,k(!0)}function E(t){t?$("body").on(h.touch.up,S):$("body").off(h.touch.up,S)}function S(t){x&&(x=!1,k(!1),!L()&&b&&(e.trigger(OGX.GridSwiper.SWIPE_END),O=!1,b=!1))}function L(t,e,a){var r,s;return void 0===t&&(t=0),void 0===e&&(e=0),void 0===a&&(a=!0),a&&A(!0),i.addClass("ogx_grid_swiper_anim"),v=P(i),r=-1*Math.round((v.x+t)/n)*n*-1,s=-1*Math.round((v.y+e)/o)*o*-1,i.css({transform:"translate3d("+r+"px, "+s+"px, 0px)"}),v.x-r||v.y-s}function k(t){t?(N(!0),e.on(h.touch.move,M)):(N(!1),e.off(h.touch.move,M))}function M(t){t=Y(t),g.capture&&(t.preventDefault(),t.stopImmediatePropagation()),a=0,r=0,s=0,l=0,p||(g.axis.x&&Math.abs(t.pageX-m.x)>Math.abs(t.pageY-m.y)?p="x":g.axis.y&&Math.abs(t.pageX-m.x)0?1:-1):g.axis.y&&"y"===p&&(r=Math.abs(t.pageY-m.y),l=t.pageY-m.y>0?1:-1))}function N(t){t?f||(O=!1,f=setInterval(I,10)):f&&(clearInterval(f),f=null)}function I(){if((a||r)&&(O||(b=!0,e.trigger(OGX.GridSwiper.SWIPE_START)),O=!0),g.axis.x&&"x"===p&&a&&s&&a<=n){if(!g.loop&&(w.x+-1*s<0||w.x+-1*s>g.map[0].length-1))return;if((c=(w.x+-1*s)%g.map[0].length)<0&&(c=Math.abs(g.map[0].length+c)),!1===g.map[G.y][c])return;u=a*s,i.css({transform:"translate3d("+(-1*w.x*n+u)+"px, "+v.y+"px, 0px)"})}else if(g.axis.y&&"y"===p&&r&&l&&r<=o){if(!g.loop&&(w.y+-1*l<0||w.y+-1*l>g.map.length-1))return;if((d=(w.y+-1*l)%g.map.length)<0&&(d=Math.abs(g.map.length+d)),!1===g.map[d][G.x])return;u=r*l,i.css({transform:"translate3d("+v.x+"px, "+(-1*w.y*o+u)+"px, 0px)"})}}function A(t){t?(i.off("transitionend"),i.on("transitionend",(function(){O&&b&&(e.trigger(OGX.GridSwiper.SWIPE_END),O=!1,b=!1),i.off("transitionend"),i.removeClass("ogx_grid_swiper_anim"),v=P(i);var t={x:null,y:null};t.x=-1*Math.round(v.x/n),t.y=-1*Math.round(v.y/o),w.x!==t.x?(s=w.x>t.x?1:-1,w.x=t.x,G.x=R(w).x,-1===s?(i.children(y+"[data-y="+(w.y-1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-y="+(w.y+1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-x="+(w.x-2)+"][data-y="+w.y+"]").attr("data-x",w.x+1).css("left",(w.x+1)*n),h.onLeft({cell:G,point:w}),e.trigger(OGX.GridSwiper.SWIPE_LEFT,{cell:G,point:w}),W(T=[{x:w.x+1,y:w.y},{x:w.x,y:w.y-1},{x:w.x,y:w.y+1}]),F()):(i.children(y+"[data-y="+(w.y-1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-y="+(w.y+1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-x="+(w.x+2)+"][data-y="+w.y+"]").attr("data-x",w.x-1).css("left",(w.x-1)*n),h.onRight({cell:G,point:w}),e.trigger(OGX.GridSwiper.SWIPE_RIGHT,{cell:G,point:w}),W(T=[{x:w.x-1,y:w.y},{x:w.x,y:w.y-1},{x:w.x,y:w.y+1}]),F())):w.y!==t.y&&(l=w.y>t.y?1:-1,w.y=t.y,G.y=R(w).y,-1===l?(i.children(y+"[data-x="+(w.x-1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-x="+(w.x+1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-y="+(w.y-2)+"][data-x="+w.x+"]").attr("data-y",w.y+1).css("top",(w.y+1)*o),h.onUp({cell:G,point:w}),e.trigger(OGX.GridSwiper.SWIPE_UP,{cell:G,point:w}),W(T=[{x:w.x,y:w.y+1},{x:w.x-1,y:w.y},{x:w.x+1,y:w.y}]),F()):(i.children(y+"[data-x="+(w.x-1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-x="+(w.x+1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-y="+(w.y+2)+"][data-x="+w.x+"]").attr("data-y",w.y-1).css("top",(w.y-1)*o),h.onDown({cell:G,point:w}),e.trigger(OGX.GridSwiper.SWIPE_DOWN,{cell:G,point:w}),W(T=[{x:w.x,y:w.y-1},{x:w.x-1,y:w.y},{x:w.x+1,y:w.y}]),F())),p=0}))):i.off("transitionend")}function P(t,e){var i=t.css("transform");return"none"===i?0:(i=(i=(i=i.substr(7)).substr(0,i.length-1)).split(","),{x:Number(i[4]),y:Number(i[5])})}function Y(t){return t.hasOwnProperty("originalEvent")&&void 0!==t.originalEvent.changedTouches?t.originalEvent.changedTouches[0]:t}function R(t){var e={x:0,y:0};return e.x=t.x%g.map[0].length,e.x<0&&(e.x=Math.abs(g.map[0].length+e.x)),e.y=t.y%g.map.length,e.y<0&&(e.y=Math.abs(g.map.length+e.y)),e}function W(t){for(var e,i={x:null,y:null},n=0;ng.map.length-1){if(!g.loop)return!1;i.y=R(t[n]).y}else i.y=t[n].y;if(t[n].x<0||t[n].x>g.map[0].length-1){if(!g.loop)return!1;i.x=R(t[n]).x}else i.x=t[n].x;e=g.map[i.y][i.x],H(t[n],e),h.onRender(i)}}function H(t,e){var n=!1;switch(typeof e){case"string":i.children(y+'[data-x="'+t.x+'"][data-y="'+t.y+'"]').children(y+"_content").first().html(e);break;case"function":(n=e(t,R(t),{x:t.x-w.x,y:t.y-w.y},i.children(y+'[data-x="'+t.x+'"][data-y="'+t.y+'"]').children(y+"_content").first()[0]))&&i.children(y+'[data-x="'+t.x+'"][data-y="'+t.y+'"]').children(y+"_content").first().html(n);break;case"object":var o='.ogx_grid_swiper[data-ogx-id="'+X+'"] > .ogx_grid_swiper_container > '+y+'[data-x="'+t.x+'"][data-y="'+t.y+'"] > '+y+"_content",a=R(t);for(var r in e){e[r].id="cell_"+a.x+"_"+a.y;break}e=OGX.OML.rename(e,o);var s=h.nodes.find("id","cell_"+a.x+"_"+a.y,1);s&&h.remove(s._NAME_,s.id),$(o).empty(),OGX.OML.render(h,e,{abs:t,rel:R(t)}),F()}}function F(){for(var t=0;t',c=-1*t,d=-1*a-o;g.axis.y&&(l+='
',l+='
'),l+='
',g.axis.x&&(l+='
',l+='
'),l+="
",e.html(l),i=e.children(".ogx_grid_swiper_container").first(),w.x=g.start.x,w.y=g.start.y,v.x=t,v.y=a,G.x=g.start.x,G.y=g.start.y}this.onFocus=function(){return C(!0),E(!0),F(),this},this.onBlur=function(){return C(!1),E(!1),N(!1),this},this.focus=function(){return this.blured&&(this.blured=!1,this.onFocus()),this},this.resize=function(){A(!1),i.removeClass("ogx_grid_swiper_anim"),n=e.width(),o=e.height();var t=w.x*-n,a=w.y*-o;i.children(y+"[data-y="+(w.y-1)+"]").css({top:(w.y-1)*o,left:w.x*n}),i.children(y+"[data-y="+w.y+"]").css({top:w.y*o,left:w.x*n}),i.children(y+"[data-y="+(w.y+1)+"]").css({top:(w.y+1)*o,left:w.x*n}),i.children(y+"[data-x="+(w.x-1)+"]").css({top:w.y*o,left:(w.x-1)*n}),i.children(y+"[data-x="+(w.x+1)+"]").css({top:w.y*o,left:(w.x+1)*n}),i.css("transform","translate3d("+t+"px, "+a+"px, 0px"),k(!1),setTimeout((function(){L(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(t,e){return g.map=t,void 0!==e&&(g.start=e),w={x:0,y:0},G={x:0,y:0},m={x:null,y:null},v={x:0,y:0},U(),B(),z(),this},this.setMapCell=function(t,e){return g.map[t.y]||(g.map[t.y]=[]),g.map[t.y][t.x]=e,this},this.getMapCell=function(t){return t.y>0&&g.map.length0&&g.map[t.y].length0){var i=t.data("id");t.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"),a=!1,(e=r.el).addClass("ogx_grouped_list"),g()},OGX.GroupedList.SELECT="GroupedListSelect",OGX.GroupedList.BIND=OGX.GroupedList.SELECT,require("Html","Uxi","Placeholder"),OGX.Html=function(t){construct(this,"Html"),void 0!==t&&t&&(this.el=$(t.el),OGX.HtmlRender(t))},OGX.HtmlRender=function(t){var e=$(t.el),i=new OGX.Display(t);data=!1,t.data&&Object.keys(t.data).length&&(data=t.data),e.html(i.html(data)),t.css&&e.addClass(i.css(data)),t.hasOwnProperty("id")&&t.id&&"#"===t.id.substr(0,1)&&e.attr("id",t.id.substr(1))},require("Iceberg","Uxi","Touch"),OGX.Iceberg=function(t){construct(this,"Iceberg");var e,i,n,o,a,r,s=this,l={left:0,right:0,top:0,bottom:0,min:50,drag:!0,flatten:!1,capture:!0,"node:OML":{},callbacks:{up:null,down:null,left:null,right:null,restore:null}},c=t,d=!1,u="normal",f="main",h={left:null,main:null,right:null,top:null,bottom:null},g=[0,0,0],_=0,p=0,m=0,v=0;function y(t){for(var e in h)h[e]&&h[e].instance&&(t===e?h[e].instance.focus():h[e].instance.blur())}function x(){d.hasClass("ogx_iceberg_anim")||(d.off("transitionend"),g=G(d))}function O(t){var e=0;return t.dirY&&t.distY>t.distX&&(e=1),e}function b(t){c.drag&&t.dist&&(!(n=O(t))&&["main","left","right"].includes(f)?t.dirX&&t.distX&&(e=g[0]+t.distX*t.dirX)<=p&&e>=_&&d.css({transform:"translate3d("+e+"px, 0, 0)"}):["main","top","bottom"].includes(f)&&t.dirY&&t.distY&&(i=g[1]+t.distY*t.dirY)<=v&&i>=m&&d.css({transform:"translate3d(0, "+i+"px, 0)"}))}function w(t){if(e=0,i=0,n=O(t),t.swipe&&t.dist){var r;switch(t.swipe=!1,f){case"main":-1===t.dirX&&c.right&&!n?(e=-h.right.outerWidth(),r="right",t.swipe=!0):1===t.dirX&&c.left&&!n?(e=h.left.outerWidth(),r="left",t.swipe=!0):1===t.dirY&&c.top&&n?(i=h.top.outerHeight(),r="top",t.swipe=!0):-1===t.dirY&&c.bottom&&n&&(i=-h.bottom.outerHeight(),r="bottom",t.swipe=!0);break;case"left":-1!==t.dirX||n||(e=0,r="main",t.swipe=!0);break;case"right":1!==t.dirX||n||(e=0,r="main",t.swipe=!0);break;case"top":-1===t.dirY&&n&&(i=0,r="main",t.swipe=!0);break;case"bottom":1===t.dirY&&n&&(i=0,r="main",t.swipe=!0)}n?1===t.dirY?(o=OGX.Iceberg.SWIPE_DOWN,a="down"):(o=OGX.Iceberg.SWIPE_UP,a="up"):1===t.dirX?(o=OGX.Iceberg.SWIPE_RIGHT,a="right"):(o=OGX.Iceberg.SWIPE_LEFT,a="left"),t.swipe&&t.dist&&(d.addClass("ogx_iceberg_anim"),d.on("transitionend",(function(){d.off("transitionend"),d.removeClass("ogx_iceberg_anim"),g=G(d),y(f=r),c.callbacks[a](f),d.trigger(o,f)})),d.css({transform:"translate3d("+e+"px, "+i+"px, 0)"}))}else if(t.dist){switch(e=0,i=0,f){case"left":e=h.left.outerWidth();break;case"right":e=-h.right.outerWidth();break;case"top":i=h.top.outerHeight();break;case"bottom":i=-h.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(f),d.trigger(OGX.Iceberg.RESTORE,f)})),d.css({transform:"translate3d("+e+"px, "+i+"px, 0)"})}}function G(t){var e=t[0].style.transform;if(e=e.match(/translate3d\(([0-9px%,\.\- ]+)\)/)){e=e[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.onBlur()):"flattened"===u&&this.el.width() .ogx_iceberg_views > .ogx_iceberg_view[data-ogx-panel-id="';for(var a in c["node:OML"])for(var r in c["node:OML"][a])0===r.indexOf("left")&&(i+='
',n.left=o+'left"]',h.left=!0),0===r.indexOf("top")&&(i+='
',n.top=o+'top"]',h.top=!0),0===r.indexOf("main")&&(i+='
',n.main=o+'main"]'),0===r.indexOf("right")&&(i+='
',n.right=o+'right"]',h.right=!0),0===r.indexOf("bottom")&&(i+='
',n.bottom=o+'bottom"]',h.bottom=!0);for(s.el.html(i),a=0;ae.width/e.height?(i.width=e.width,i.height=Math.round(t.height*(e.width/t.width))):(i.width=Math.round(t.width*(e.height/t.height)),i.height=e.height),i}({width:e,height:i},{width:o,height:a}),s=(o-r.width)/2,l=(a-r.height)/2;n.css("left",s+"px"),n.css("top",l+"px"),n.prop("width",r.width),n.prop("height",r.height)}function o(t){var e,i=$(t);i&&(i.find(".ogx_video").each((function(t,i){e=$(i),function(t,e,i){var n=$(t),o=e/i,a=n.parent().innerWidth(),r=n.parent().innerHeight(),s=a,l=Math.ceil(s/o);la?c=(s-a)/2*-1:sr?d=(l-r)/2*-1:l0&&(r=0),n.parent().css("overflow","hidden"),n.prop("width",o),n.prop("height",a),n.css("top",r+"px")}(i,parseInt(e.data("width"),10),parseInt(e.data("height"),10))})),i.find(".ogx_image_fit").each((function(t,i){e=$(i),function(t,e,i){var n=$(t),o=e/i,a=n.parent().innerWidth(),r=a,s=Math.ceil(r/o),l=0;r>a?l=(r-a)/2*-1:re&&(a=e);var r=Math.ceil(a/o);n.prop("width",a),n.prop("height",r)}(i,parseInt(e.data("width"),10),parseInt(e.data("height"),10))})))}function a(t){t?$(window).on("resize",r):$(window).off("resize",r)}function r(){for(var t in e)o(e[t].selector)}function s(t){var e;t.find(".ogx_video, .ogx_video_resp, .ogx_video_poster").each((function(t,i){(e=$(i)).parent().css("overflow","hidden"),i.hasAttribute("data-width")||(e.attr("data-width",e.attr("width")),e.attr("data-height",e.attr("height")))})),t.find(".ogx_image_cover, .ogx_image_contain, .ogx_image_fit, .ogx_image_scale, .ogx_image_resp").each((function(t,i){(e=$(i)).css("position","relative"),i.hasAttribute("data-width")||(e.attr("data-width",e.attr("width")),e.attr("data-height",e.attr("height")))})),o(t)}this.resize=function(t){void 0!==t?o(t):r()},this.bind=function(n,o){return!e.hasOwnProperty(n)&&(e[n]={observer:null,element:o},e[n].observer=(r=o,l=null,(c=new(window.MutationObserver||window.WebKitMutationObserver)((function(t,e){t.forEach((function(t){l&&clearTimeout(l),l=setTimeout((()=>{s($(r))}),10)}))}))).observe(document.querySelector(r),{childList:!0,subtree:!0}),c),e[n].selector=o,i++,t||(t=!0,a(!0)),s($(o)),!0);var r,l,c},this.unbind=function(n){return!(!e.hasOwnProperty(n)||!e[n].observer)&&(e[n].observer.disconnect(),delete e[n],!--i&&t&&(t=!1,a(!1)),!0)}},OGX.Media=new OGX.Media,require("NestList","Uxi","Bind"),OGX.NestList=function(t){construct(this,"NestList");var e,i,n=this,o={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}},a={title:"",scope:[],open:!0},r={id:0,title:!1,scope:[],height:0,y:0,hidden:!1,open:!0,selector:!1},s=t,l=!1,c=0,d=0,u=1,f={y:0,h:0,way:1},h=!1,g=new OGX.List;function _(t){t?e.on("click",".ogx_nest_list_item_head",p):e.off("click",".ogx_nest_list_item_head",p)}function p(t){l||(l=!0,m($(this)))}function m(t){var i=t.parent(0).data("ogx-nest-id"),o=!1;t.hasClass("ogx_nest_list_item_head_closed")?(f.way=1,t.addClass("ogx_nest_list_item_head_open").removeClass("ogx_nest_list_item_head_closed"),g.findUpdate("id",i,{open:!0},!1,1),o=!0):(f.way=0,t.removeClass("ogx_nest_list_item_head_open").addClass("ogx_nest_list_item_head_closed"),g.findUpdate("id",i,{open:!1},!1,1));var a=g.find("id",i,1);o?(!function(t){var e=v(t);if(e)return e.focus(),!0}(a),n.onOpen(a),e.trigger(OGX.NestList.OPEN,a)):(!function(t){var e=v(t);if(e)return e.blur(),!0}(a),n.onClose(a),e.trigger(OGX.NestList.CLOSE,a)),setTimeout(x,0)}function v(t){var e=$(t.selector).find(".ogx_uxi").first();if(e.length){var i=String(e.data("ogx-id")),o=n.nodes.find("id",i,1);if(o)return o}return!1}function y(t){if(t.hasOwnProperty("scope"))for(var e=0;e .ogx_nest_list_item[data-ogx-nest-id="'+o.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="'+o.id+'"]');return o.hidden&&f.addClass("ogx_nest_list_item_hidden"),f.removeClass("ogx_nest_list_prep"),o}function b(){var t=s.list;h&&(t=i),e.empty(),g.clear();var o;e.html('
'),s.hasOwnProperty("node:OML")||(s["node:OML"]=[]);for(var a=0;a .ogx_nest_list_item[data-ogx-nest-id="'+g[e.index].id+'"]').remove(),g.splice(e.index,1),setTimeout(x,0))},this.updateNestHeight=function(t){var e=g.find(s.map.title,t,1);setTimeout((function(){var t,i;t=e,i=$(t.selector).outerHeight(!0),t.height=i,x()}),0)},this.updateNestsHeight=function(){for(var t,e=0;e{switch(t.type){case"text":return e.text();case"json":return e.json();default:return e.blob()}})).catch((t=>{$(document).trigger(OGX.Api.NETWORK_ERROR,t)})).then((i=>{t.data=i,n(t,e,o)}))}()}function a(t){switch(t){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(t,e,i){var n={loaded:0,total:0,files:new OGX.List};for(var o in t)for(var a=0;aogx font init';$("body").append(a),n(t,i,o),function(t){setTimeout((function(){$('.ogx_font_loader[data-ogx-id="font-loader-'+t+'"]').remove()}),150)}(e),e++}a()}(l,a,r);break;case"pak":!function(t,e,i){function a(o){for(var a,r=//gi,s=[];a=r.exec(o);)s.push(a[1]);r=//gi;var l,c,d,u=o.split(r);u.shift();for(var f=0;f=!+]+ ?\d+) ?\? ?([\S\s]+) ?\: ?([\S\s]+);?)/gi.exec(t))&&(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),t=t.replace(r[0],c())),(r=/(scope ([\S ]+) ?\? ?([\S ]+)\: ?([\S ]+);?)/gi.exec(t))&&(l=r[0],t="null"===(l=(s=OGX.Scope.eval(r[2]))?r[3]:r[4])?t.replace(r[0],""):t.replace(r[0],l)),(r=/(uxi *(?:#|\$|&|@|%)*([a-z0-9_\-]+)):(([a-z0-9]+))/gi.exec(t))&&(s='OGX.Object.get({_NAME_:{eq:"'+r[3]+'"}, id:{eq:"'+r[2]+'"}}, null, 1);')===(t=t.replace(r[0],s)))return"return "+t;if((r=/method *([a-zA-Z0-9_\-]+) ([a-zA-Z0-9_\-]+):([a-zA-Z0-9_\-]+)/gi.exec(t))&&(s='OGX.Object.get({_NAME_:{eq:"'+r[3]+'"}, id:{eq:"'+r[2]+'"}}, null, 1).'+r[1])===(t=t.replace(r[0],s)))return"return "+t;if((r=/mongogx ([a-z0-9_\-]+)\.([a-z0-9_\-]+)\.([a-z]+)\(([\S ]+)\)/gi.exec(t))&&(s="mongogx.setDatabase('"+r[1]+"');",s+="mongogx.setCollection('"+r[2]+"');",(s+="return mongogx."+r[3]+"("+r[4]+")[0];")===(t=t.replace(r[0],s))))return s;if(isSingleVar(t))return"return "+replaceVars(t=convertKeywords(t,!1),e,i,n,o)+";";for(t=convertKeywords(t+="\r\n",!1);a=/[\S ]+(\r\n|\n)?/gi.exec(t);){if(l=replaceLoop(l=a[0].replace(/(\r\n|\n)/gi,"").trim(),e,i,n,o),charcode++,l=replaceVars(l,e,i,n,o),/^(app|OGX)\.\S+;?/g.test(l))return"return "+l+";";if(t=t.replace(a[0],""),u+=l+"\n",++d>100)return}return u="var __echo=[];\n"+u+'\nif(!__echo.length){return;}else{return __echo.join("");}'}function runJS(t,e,i,n,o,a){var r;try{r=new Function(oo,to,ro,lo,t)(e,i,n,o)}catch(t){return}if(void 0!==r)return r}function isSingleVar(t){return/^[ ]*\S+( \S+)?[ ]*$/g.test(t)}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(t){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(t,e,i,n,o){var a,r,s,l;return(a=/loop (\S+) ?(as (\S+) ?(\S+ )?)?{/gi.exec(t))&&(r="__"+String.fromCharCode(charcode).toLowerCase()+"__",s=(s=a[0]).replace(a[0],"for(var "+r+" in JSON.parse(JSON.stringify("+a[1]+"))){"),a[2]&&(l=a[4]?"&"+a[3]+"="+r+"; &"+a[4]+"="+a[1]+"["+r+"]; ":"&"+a[3]+"="+a[1]+"["+r+"]; "),s+=l,t=t.replace(a[0],s)),t}function replaceVars(t,e,i,n,o){for(var a,r,s,l=0;r=/((&|#|@|\$|%)([a-zA-Z_]{1}[a-zA-Z0-9\-_]*))(\.[a-z0-9\-_\.\[\]\$]+|\.\$|\.)?(;)?/gi.exec(t);){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(a=r[0].replace(r[1],s),t=t.replace(r[0],a),++l>300)return t}for(;r=/([a-z_\-]+)\( *(\$|@|&|%) *\)/gi.exec(t);)s=getTrueVal(r[2]),a=r[1]+"("+s+")",t=t.replace(r[0],a);for(;/^(json|ose|template|oml|crumb|result) (\S+)/g.test(t);)if((r=/crumb (\S+)?/gi.exec(t))&&(a=n.hasOwnProperty(r[1])?"__route_object."+r[1]:"{}",t=t.replace(r[0],a)),(r=/json (\S+)(;)?/gi.exec(t))&&(r[1]=getTrueVal(r[1],e,i,n,o),t=t.replace(r[0],"app.getJSON("+r[1]+")")),(r=/^template (\S+)( \S+)?[ ;]?/gi.exec(t))&&(r[1]=getTrueVal(r[1],e,i,n,o),void 0===r[2]?r[2]="__object":r[2]=getTrueVal(r[2].trim(),e,i,n,o),t=t.replace(r[0],"OGX.Templater.make(OGX.Templater.get("+r[1]+"), "+r[2]+", "+to+","+ro+","+lo+")")),(r=/^ose (\S+)(;)?/gi.exec(t))&&(r[1]=getTrueVal(r[1],e,i,n,o),script=that.get(r[1]),script&&(t=exp.replace(r[0],script.replace(/({{|}})/g,"")))),(r=/^oml (\S+)(;)?/gi.exec(t))&&(r[1]=getTrueVal(r[1],e,i,n,o),t=t.replace(r[0],"app.getOML("+r[1]+")")),(r=/^result (\S+)(;)?$/gi.exec(t))&&(t=t.replace(r[0],'OGX.OML.result("'+r[1]+'")')),++l>300)return t;if(["$","@","%","&"].includes(t.trim())){switch(t.trim()){case"$":t=oo;break;case"@":t=lo;break;case"%":t=ro;break;case"&":t=to}return t}for(;r=/echo ('|")?(((?![;}\r\n]+|$)([\S\s]))*)(?:'|")?/gi.exec(t);){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),a="__echo.push("+d+r[2]+d+");",t=t.replace(r[0],a),++l>300)return t}return t}this.get=function(t){return OGX.Cache.read("ose",t)},this.fork=function(t,e){var i,n;if(i=t.split(":")[0],void 0===e.data&&(e.data={}),void 0!==(n=OGX.OSE.exec(i,e.data)))for(var o in e.values)if(convertValue(o)===n)return e.values[o];return!1},this.execScript=function(t,e,i,n){var o=this.get(t);return o&&this.exec(o,e,i,n),!1},this.exec=function(t,e,i,n,o){void 0===e&&(e={}),void 0===i&&(i={}),void 0===n&&(n={}),void 0===o&&(o={}),charcode=65;var a=runJS(convertToJS(t,e,i,n,o),e,i,n,o,t);if(void 0!==a)return a}},OGX.OSE=new OGX.OSE,OGX.OSE.SCRIPT_LOADED="OSE_SCRIPT_LOADED",OGX.OSE.SCRIPTS_LOADED="OSE_SCRIPTS_LOADED",OGX.Overlay=function(t){"use strict";var e=this,i=!1,n=!1,o={anim:OGX.Overlay.FADE,display:{css:"",html:" "},index:!1,close_on_click:!1},a=!1,r="mousedown";function s(t){i&&(t?i.on(r,l):i.off(r,l))}function l(){"function"==typeof a.close_on_click&&a.close_on_click.apply(null,e),s(!1),e.removeOverlay()}t.hasOwnProperty("overlay")&&t.overlay&&setTimeout((function(){e.addOverlay(t.overlay)}),0),this.hasOverlay=function(){return!!i},this.addOverlay=function(t){if("object"!=typeof t&&(t={}),OGX.Data.merge(t,o),t.display.hasOwnProperty("_NAME_")||(t.display=new OGX.Display(t.display)),a=t,!this.hasOverlay()){var e=this.el;a.hasOwnProperty("el")&&(e=$(a.el));var n="z-index:"+(a.zindex?a.zindex:this.topIndex(e))+";",r='
'+a.display.html()+"
";if(e.prepend(r),(i=e.children(".ogx_overlay").first()).off("transitionend"),a.anim)switch(a.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 t.close_on_click&&s(!0),this},this.removeOverlay=function(t){s(!1);var e=!1;if(void 0===t||!0===t?a.anim&&(e=a.anim):e=t,i){if(e){switch(e){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(t){"use strict";this.pholder=null,t.hasOwnProperty("placeholder")&&(this.pholder=t.placeholder),this.pholder&&this.pholder.length&&"default"!==this.pholder||(this.pholder=""),this.placeholder(t)},OGX.Placeholder.prototype.placeholder=function(t){var e;if("object"==typeof t["node:OML"]&&!Array.isArray(t["node:OML"])){var i=this.selector;for(var n in this.pholder&&(i+=" "+this.pholder),t["node:OML"])0===n.indexOf("default")&&(e=n.replace("default",i),t["node:OML"][e]=t["node:OML"][n],delete t["node:OML"][n])}},OGX.Placeholder.prototype.placeholders=function(t,e){var i=0;function n(t){var n;for(var o in t)0===o.indexOf("default")&&(n=o.replace("default",e[i]),i++,t[n]=t[o],delete t[o])}if(void 0!==t&&void 0!==e){t.hasOwnProperty("node:OML")||(t["node:OML"]=[]);var o,a=t["node:OML"];a&&"string"==typeof a&&(0===a.indexOf("{{")?t["node:OML"]=OGX.OSE.exec(a):t["node:OML"]=OGX.Cache.read("oml",t["node:OML"]));for(var r=0;r=i.points[e].min&&a{i=!1;for(var r=0;ri.left&&e.lefti.top&&e.topscreen.width&&(t=screen.width),e>screen.height&&(e=screen.height);var i=r.width,o=r.height,a=0,s=0;return _||(i=OGX.Data.getBestSize(t,i),o=OGX.Data.getBestSize(e,o)),r.center?("string"==typeof i&&(i=-1!==i.indexOf("%")?Math.round(t*Number(i.substr(0,i.length-1))/100):Number(i)),"string"==typeof o&&(o=-1!==o.indexOf("%")?Math.round(e*Number(o.substr(0,o.length-1))/100):Number(o)),x=Math.round(t/2-i/2),y=Math.round(e/2-o/2),r.center&&p&&(r.center=!1)):(p?(x=n.x,y=n.y):r.x&&r.y?(-1!==String(r.x).indexOf("%")?(a=i/2,x=t*Number(r.x.slice(0,-1))/100-a):x=r.x,-1!==String(r.y).indexOf("%")?(s=o/2,y=e*Number(r.y.slice(0,-1))/100-s):y=r.y):(x=Math.round(t/2-i/2),y=Math.round(e/2-o/2)),x>t&&(x=t-x),x<-i&&(x=0),y>e&&(y=e-o),y<0&&(y=0)),{x:x,y:y,w:i,h:o}}function N(t,e,i,o,a,l){var c=!1,f=null;if(void 0===l&&(l=!1),void 0!==e&&!0!==e||(e=r.anim),e&&(c=e),!e&&m&&(c=m),e?n.el.removeClass(d+"_notrans"):n.el.addClass(d+"_notrans"),t?(n.front(),l||n.el.trigger(OGX.Popup.SHOW,n)):l||n.el.trigger(OGX.Popup.HIDE,n),c){var h={};switch(f=d+"_"+c,c){case OGX.Popup.SCALE:u[1]=t?"scale(1,1)":"scale("+r.anim_param.scale+", "+r.anim_param.scale+")",h.transform=u.join(" ");break;case OGX.Popup.FADE:h.opacity=t?1:0}t&&(s.css("display","flex"),h.visibility="visible",h.display="flex"),e||t||(h.visibility="hidden",h.display="none"),setTimeout((function(){s.css(h)}),50),e?(m=c,s.on("transitionend",(function(){s.off("transitionend"),b=!0,t?n.resizeNodes():s.css({display:"none",visibility:"hidden"}),f&&s.removeClass(f),I(i,o,a)})),f&&s.addClass(f)):(s.removeClass(f),I(i,o,a))}else t?s.css({opacity:t,display:"flex",visibility:"visible"}):s.css({display:"none",visibility:"hidden"}),I(i,o,a)}function I(t,e,i){void 0!==t&&t&&t(e),void 0!==i&&i&&i(n.id)}function A(t){t?s.on(n.touch.down,"."+d+"_button",P):s.off(n.touch.down,"."+d+"_button",P)}function P(t){t.preventDefault(),t.stopImmediatePropagation();var e=$(this);if(!e.hasClass(d+"_button_disabled")){var i=e.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 Y(){for(var t,e="",i=0;i0&&(t=r.buttons[i].enabled?"":d+"_button_disabled",e+=''+r.buttons[i].label+"");return e}function R(t,e){void 0===e&&(e=!0),r.buttons=new OGX.List(t);for(var i=0;i";return e}this.anim=null,this.group=r.group,this.x=0,this.y=0,this.z=0,this.construct=function(){},this.onFocus=function(){this.enableResize(),r.icons&&r.icons.length&&W(!0),r.buttons&&r.buttons.length&&r.buttons_enabled&&A(!0)},this.onBlur=function(){this.disableResize(),r.icons&&r.icons.length&&W(!1),r.buttons&&r.buttons.length&&r.buttons_enabled&&A(!1),this.enabled=!1},this.show=function(t,e,i){if(!this.visible){if(this._show(),!r.anim||t||b||(t=!0),!t&&r.anim&&"scale"==r.anim){var o=u.join(" ").replace(/scale\([0-9,\. ]+\)/,"");n.el.css({transform:o}),u=o.split(" ")}N(1,t,e,i),this.focus(1)}return this},this.hide=function(t,e,i,n,o){return this.visible&&(this._hide(),N(0,t,e,i,n,o),this.blur(1)),this},this.resize=function(){return X(),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%",T(),this.move(0,0)),this},this.normalize=function(){return r.maximize&&v&&(v=!1,r.width=O.width,r.height=O.height,T(),this.move(O.x,O.y),O=null),this},this.width=function(t,e,i){return void 0===t?r.width:(void 0===i&&(i=!1),void 0===e&&(e=!1),e&&n.el.removeClass("ogx_popup_notrans"),r.width=t,G(["width"],i),T(),this)},this.height=function(t,e,i){return void 0===t?r.height:(void 0===i&&(i=!1),void 0===e&&(e=!1),e&&n.el.removeClass("ogx_popup_notrans"),r.height=t,G(["height"],i),T(),this)},this.destroy=function(){s.off("transitionend"),this.touch.wipe()},this.buttons=function(t){if(void 0===t)return r.buttons;R(t)},this.enableButton=function(t){return r.buttons[t].enabled=!0,l.children("."+d+"_button:eq("+t+")").removeClass(d+"_button_disabled"),r.buttons_enabled||(r.buttons_enabled=!0),this},this.disableButton=function(t){return r.buttons[t].enabled=!1,l.children("."+d+"_button:eq("+t+")").addClass(d+"_button_disabled"),this},this.enableButtons=function(){if(r.buttons.length)for(var t=0;t',r.icon&&(o+='
"),r.title&&(o+='
'+r.title+"
"),o+='
',r.icons&&(o+=H()),o+="
");var a,c=1;if(u=["translate3d("+t.x+"px, "+t.y+"px, 0)"],r.anim)switch(r.anim){case OGX.Popup.FADE:c=0,a=d+"_fade";break;case OGX.Popup.SCALE:a=d+"_scale",u[1]="scale("+r.anim_param.scale+", "+r.anim_param.scale+")"}o+='
',r.html?o+=r.html:r.template&&(o+=OGX.Templater.make(OGX.Templater.get(r.template),r.data)),o+="
",r.buttons&&r.buttons.length&&(o+='
',o+=Y(),o+="
"),s.html(o),s.css({width:e,height:i,opacity:c,transform:u.join(" "),"z-index":n.z}),r.anim&&s.addClass(a),n.el=s,l=s.children("."+d+"_buttons").first()}(),r.drag){var t={x:!0,y:!0,cb_down:S,cb_up:L,cb_drag:k,target:"."+d+"_head"};r.group||"function"==typeof r.drag&&(t.cb_drag=function(t){r.drag(n,t)}),n.touch.add("Drag",t),n.dragable=!0}if(r.resize&&n.setResize({top:!1,cb_resize:w,cb_down:D,cb_up:E}),r.hasOwnProperty("html")&&r.html)r["node:OML"]=[{"default:Html":{html:r.html}}];else if(r.hasOwnProperty("view")&&r.view){var e={};e["default:Views."+r.view.id]=r,r["node:OML"].push(e)}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(t){"use strict";var e,i,n,o,a,r,s,l,c=this,d=t,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",_="mousemove",p=(d=!1,!1),m=!1,v={w:0,h:0},y=null;function x(t){d&&(t?c.el.on(h,O):c.el.off(h,O))}function O(t){var u=C(t);n=u.pageX,o=u.pageY;var f=c.el.position();e=f.left,i=f.top;var h=c.el.offset(),g=n-h.left,_=o-h.top;v.w=c.el.width(),v.h=c.el.height(),a=0,r=0,s=0,l=0,d.top&&_c.el.height()-d.border&&(l=1),d.left&&gc.el.width()-d.border&&(s=1),p=-1!==window.getComputedStyle(c.el[0],"width"),m=-1!==window.getComputedStyle(c.el[0],"height"),(s||l)&&(t.preventDefault(),y&&y.disable(),b(!0),G(!0),d.cb_down&&d.cb_down())}function b(t){t?f||(f=setInterval(w,5)):f&&(clearInterval(f),f=!1)}function w(){if(-1===s||-1===l){var t=e,n=i;a&&s&&(t+=a),r&&l&&(n+=r),a&&-1===s&&r&&1===l&&(n=i),c.el.css("transform","translate3d("+t+"px, "+n+"px, 0)")}s&&v.w+a*s>d.min_width&&(p?c.el.width(Math.round(100*(v.w+a*s)/c.el.parent().width()*100)/100+"%"):c.el.width(v.w+a*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)),(a||r)&&(d.cb_resize?d.cb_resize():c.el.trigger(OGX.Resize.RESIZING))}function G(t){t?($("body").on(_,X),$("body").on(g,T)):($("body").off(_,X),$("body").off(g,T))}function X(t){t.preventDefault(),t.stopImmediatePropagation(),t=C(t),a=t.pageX-n,r=t.pageY-o}function T(t){b(!1),G(!1),t=C(t),a=t.pageX-n,r=t.pageY-o,d.cb_up&&d.cb_up(),y&&(x(!1),y.enable(),setTimeout((function(){x(!0)}),0))}function C(t){return t.hasOwnProperty("originalEvent")&&void 0!==t.originalEvent.changedTouches?t.originalEvent.changedTouches[0]:t}this.resizable=!0,this.setResize=function(t){OGX.Data.merge(t,u,!1),d=t},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||(h="touchstart",_="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(t){construct(this,"Roulette");var e,i,n,o,a,r,s,l=this,c=t,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},f="object",h=0,g=0,_=null,p="ogx_roulette";function m(t,e){void 0===e&&(e=!0),l.el.children('input[name="'+c.name+'"]').val(t),e&&l.el.children('input[name="'+c.name+'"]').trigger("change")}function v(t){t?e.on(l.touch.down,"."+p+"_icon",(function(t){t.preventDefault(),t.stopImmediatePropagation(),l.next(!0)})):e.off(l.touch.down,"."+p+"_icon")}function y(t){t?e.on("change","input[type=hidden]",x):e.off("change","input[type=hidden]",x)}function x(t){t.preventDefault(),t.stopImmediatePropagation(),l.loopval(0,OGX.Data.stringToVal(t.target.value),!1)}function O(t){return g+t>c.list.length-1?c.list[0]:g+t<0?c.list[c.list.length-1]:c.list[g+t]}function b(t){o=t.y,X(!0)}function w(t){var e;t.dirY!==a?(e=0,o=t.pt1.y):(e=t.pt1.y-o,o=t.pt1.y),a=t.dirY,i.css({transition:"none",transform:"translate3D(0px, "+(E(i)+e)+"px, 0px)"})}function G(t){X(!1),trans=E(i);var e=Math.round(trans/n)*n,o=Math.round(e/n%c.list.length);if(o=o<=0?Math.abs(o):c.list.length-o,g!==o){switch(g=o,f){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, "+e+"px, 0px)"})}function X(t){t?r=setInterval(T,10):clearInterval(r)}function T(){var t,e,o;(t=Math.floor((i.position().top+n*a)/(n*c.list.length)*-1))!==h&&(0===i.children("."+p+'_stripe[data-id="'+t+'"]').length&&((e=s.clone()).css("top",t*(n*c.list.length)+"px"),e.attr("data-id",t),i.append(e)),i.children("."+p+"_stripe").each((function(t,e){o=i.position().top+$(e).position().top,(Math.ceil(o+n*c.list.length)<-n||o>n)&&$(e).remove()})),h=t)}function C(){X(!1),i.off("transitionend",C)}function D(){var t="",o='
';o+='
';for(var a=0;a<2;a++){o+='
';for(var r=0;r'+t+"
"}o+="
"}if(o+="
",c.icon&&(o+='
'),void 0===g&&(g=0),c.name){var l="";switch(c.required&&(l=" required"),f){case"string":o+='";break;case"object":o+='"}}e.html(o),i=e.children("."+p+"_container").children("."+p+"_stripes").first(),s=(s=i.children("."+p+"_stripe:last")).detach();var d=g*n*-1;i.css({transition:"none",transform:"translate3D(0px, "+d+"px, 0px)"})}function E(t){var e=0;return"none"!==t.css("transform")&&(e=Number(t.css("transform").split(",")[5].split(")")[0])),e}function S(t){switch(f){case"string":return{index:c.list.indexOf(t)};case"object":return c.list.findIndex(c.key,t)}}function L(){c.list.length>0&&!c.list.hasOwnProperty("insert")&&(c.list=new OGX.List(c.list)),"string"==typeof c.list[0]&&(f="string"),1===c.list.length&&(c.list[1]=c.list[0])}this.construct=function(){c.name&&y(!0)},this.onFocus=function(){return e.removeClass(p+"_disabled"),c.icon&&v(!0),_&&_.enable(),this},this.onBlur=function(){e.addClass(p+"_disabled"),c.icon&&v(!1),_&&_.disable(),X(!1)},this.bindFilter=function(t,e,i){return c.list.removeFilter(t),c.list.addFilter(t,e,i),c.list.filter(),setTimeout(D,0),this},this.destroy=function(){c.name&&y(!1),this.touch.wipe()},this.bindRender=function(t,e){},this.onSelect=function(){},this.val=function(t,e){if(void 0!==t){var o=S(t).index;return o>-1&&(!function(t,e){void 0===e&&(e=!0);i.off("transitionend",C),X(!1),a=-1;var o=E(i),r=Math.round(o/n)*n,s=o-r,l=Math.round(r/n%c.list.length);l=l<=0?Math.abs(l):c.list.length-l;var d=l-t;c.mode===OGX.Roulette.MODE_CLOSEST&&d>c.list.length/2&&(d=-1*(c.list.length-l+t));var u=o+d*n-s,f=20*Math.round(Math.abs(d*n)*c.time_coef);X(!0),i.on("transitionend",C),i.css({transition:"all "+f+"ms ease-out",transform:"translate3D(0px, "+u+"px, 0px)"}),g=t}(o),c.name&&m(t,!1)),this}switch(f){case"string":return c.list[g];case"object":return c.list[g][c.key]}},this.item=function(){return c.list[g]},this.loopval=function(t,e,o){var a=g,r=S(e).index;r>-1&&(g=r);var s=a-r,l=c.time_coef*Math.abs(s+t*c.list.length);return X(!0),i.css({transition:"all "+l+"s ease-out",transform:"translate3D(0px, "+(E(i)+(s*n-c.list.length*n*t))+"px, 0px)"}),i.on("transitionend",C),c.name&&m(e,o),void 0!==o&&o&&(this.onSelect(val),this.el.trigger(OGX.Roulette.CHANGE,val)),this},this.next=function(t){var e,i=O(1);switch(a=1,f){case"string":e=i;break;case"object":e=i[c.key]}return this.val(e),void 0!==t&&t&&(this.onSelect(e),this.el.trigger(OGX.Roulette.CHANGE,e),c.name&&this.el.children('input[name="'+c.name+'"]').trigger("input")),this},this.prev=function(t){var e,i=O(-1);switch(f){case"string":e=i;break;case"object":e=i[c.key]}return this.val(e),void 0!==t&&t&&(this.onSelect(e),this.el.trigger(OGX.Roulette.CHANGE,e),c.name&&this.el.children('input[name="'+c.name+'"]').trigger("change")),this},this.setData=function(t,e){return c.value=e,c.list=t,L(),g=void 0===e?0:S(e).index,setTimeout(D,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),(e=l.el=$(c.el)).addClass(p),e.width(),n=e.height(),c.list.length){var t=e.parent();t[0].hasAttribute("data-value")&&(c.value=OGX.Data.stringToVal(t.data("value")),t.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(){_=l.touch.add("Swipe",{x:!1,y:!0,cb_down:b,cb_swipe:w,cb_up:G,state:"manual",target:'.ogx_roulette[data-ogx-id="'+l.id+'"] .ogx_roulette_container',capture:c.capture}),c.enabled&&_.enable()}),null),D()},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(t){construct(this,"RouletteTree");var e,n,o=this,a=t,r={groups:!1,data:!1,value:!1,required:!1},s=!1;function l(t){t?e.on(OGX.Roulette.CHANGE,d):e.off(OGX.Roulette.CHANGE,d)}function c(){for(var t,e=0;e0&&(t=s[e-1].roulette.val()),0===e||e-1>=0&&null!==t&&String(t).length>0?s[e].roulette.enable():e>0&&s[e].roulette.disable()}function d(t,o){t.stopImmediatePropagation();var a,r=$(t.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[o].roulette.setData(g(i),e),i.push(e)));setTimeout(c,0)}function g(t){for(var e=a.data,i=0;i-1?f(n):{};h(t)},a=OGX.Data.merge(a,r),(e=o.el).addClass("ogx_roulette_tree"),o.observeOnce({childList:!0},(function(){setTimeout((()=>{a.value?h(a.value):c()}),10)})),function(){s=new OGX.List;var t,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,e.append('
'),i=a.groups[c-1],t=[{label:i,value:"",head:!0}],l)t.push({label:u,value:u});d=o.create("Roulette",{el:'.ogx_roulette_tree[data-ogx-id="'+o.id+'"] .ogx_roulette_tree_roulette[data-ogx-roulette="'+c+'"]',list:t,icon:a.icon,value:null,name:i,enabled:!1,required:a.required}),s.push({roulette:d,group:i,id:d.id})}if(ce.time+i))}function doCache(t){var e=getStageDefault(app.getStage());if(e){e.uxi.detach();var i={url:t.url,uxi:e.uxi,time:Math.round((new Date).getTime()/1e3)};cache.insert(i)}}function unCache(t){var e=getCache(t);e&&(e.uxi.kill(),cache.findDelete("url",t.url,1))}function useCache(t){var e=getCache(t);if(e){var i=app.getStage();e.uxi.attach(i,$(i.pholder)),cache.delete("url",t.url,1),route=t}}function getCache(t){return cache.get({url:{eq:t.url}},null,1)}function findRoute(t){var e,i,n,o,a,r=[],s=OGX.Data.clone(config.routes);for(var l in s){for(r=[],a=s[l],n=l;i=/(?!\/)([a-z0-9_\-]+)\:([^\/]+)/gi.exec(n);)n=n.replace(i[0],i[2]),r.push(i[1]);if((e=t.match("^"+n+"$"))&&e.length){e.shift(),"string"==typeof a.oml&&(a.oml=OGX.Data.clone(OGX.Cache.read("oml",a.oml))),o={};for(var c=0;c1e3*t&&that.goto(route.url,{reload:!0,history:!1})}function onBlur(){blured=!0,time=(new Date).getTime()}function handleVisibilityChange(){"visible"===document.visibilityState?onFocus():onBlur()}function init(){request={route:null,url:global_url,origin:global_url};var t=null;if(-1!==window.location.href.indexOf("#")){t=window.location.href.split("#").pop(),request.url=t;var e=findRoute(t);e?request.route=e:config.errors[404]?(e=findRoute(config.errors[404]),request.route=e):$(document).trigger(OGX.Router.NOT_FOUND,{url:t})}$(document).on("click touchstart mousedown","a",captureLink),config.options.idle&&$(document).on("visibilitychange",handleVisibilityChange)}this.url=function(){return url},this.start=function(){$(document).on("backbutton",onBackButton),$(window).on("popstate",onPopState)},this.stop=function(){$(document).off("backbutton",onBackButton),$(window).off("popstate",onPopState)},this.lock=function(){locked=!0},this.unlock=function(){locked=!1},this.gate=function(t){gate=t},this.isLocked=function(){return locked},this.addToHist=function(t){var e={url:t};history.pushState(e,"title"+(new Date).getTime(),page+"#"+t)},this.request=function(){return request},this.expire=function(t){var e=getCache({url:t});e&&unCache(e)},this.goto=function(__url,__options){if(!locked){void 0!==__options&&__options||(__options={}),OGX.Data.merge(__options,options_default);var r=findRoute(__url);if(request.url=__url,request.origin=global_url,r){request.route=r,r.route.hasOwnProperty("reload")&&(__options.reload=r.route.reload),r.route.hasOwnProperty("scope")||(r.route.scope="public");var access=!0;if(OGX.Scope.eval(r.route.scope)||(access=!1),config.options.eval){var fnc=eval(config.options.eval);if(fnc){var res=fnc(r);res||(access=!1)}}if(!access)return config.errors.hasOwnProperty("403")?setTimeout((function(){app.goto(config.errors[403],{history:!0})}),0):$(document).trigger(OGX.Router.FORBIDDEN,{url:__url,scope:r.route.scope}),!1;if(delete r.route.scope,r.route.hasOwnProperty("origin")){for(var valid=!1,origins=r.route.origin.split(","),reg,i=0;i0}catch(t){}return!1},this.fork=function(t){for(var e in t)if(this.eval(e))return t[e];return!1}},require("Scroller","Uxi","Touch"),OGX.Scroller=function(t){construct(this,"Scroller");var e,i,n,o,a,r,s,l,c,d,u,f=this,h=t,g={check_delay:30,fade_delay:300,css:!1,zindex:9999,observe:!0,auto_scroll:!1,scroll_callback:!1,trigger:!0,content:!1,overflow:!0},_=0,p="init",m=!1,v=!1,y=null;function x(t){t?i.on(f.touch.down,O):i.off(f.touch.down,O)}function O(t){t=f.event(t),S(!1),G(!0),b(!0),x(!1),L("in"),D(!0)}function b(t){t?(d=setInterval(C,10),i.on(f.touch.move,w)):(clearInterval(d),i.off(f.touch.move,w))}function w(t){t=f.event(t)}function G(t){t?$(document).on(f.touch.up,X):$(document).off(f.touch.up,X)}function X(){b(!1),G(!1),x(!0),D(!1),L("out")}function T(t){t?(window.addEventListener("resize",N),i.on("scroll",(function(t){t.stopImmediatePropagation(),C()})),i.on("wheel",(function(t){D(!0)})),void 0!==OGX.NestedList&&$(document).on(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED,(function(){f.update()}))):(window.removeEventListener("resize",N),i.off("scroll"),i.off("wheel"),void 0!==OGX.NestedList&&$(document).off(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED))}function C(){var t,o=(t=i.scrollTop())/s,r=Math.round(a.position().top);a.css("top",o+"px"),h.trigger&&!m&&(f.el.trigger(OGX.Scroller.SCROLL,{top:t,percent:100*t/n}),-1*t==i.outerHeight(!0)-e.outerHeight(!0)?r!==Math.ceil(o)&&f.el.trigger(OGX.Scroller.BOTTOM):0===t&&(r&&r!==Math.round(o)||!r)&&f.el.trigger(OGX.Scroller.TOP)),h.scroll_callback&&h.scroll_callback()}function D(t){t?(c&&D(!1),l=e.position().top,c=setInterval(E,h.check_delay-10)):(c&&(clearInterval(c),c=null),v=!1,f.el.trigger(OGX.Scroller.END))}function E(){var t=e.position().top;t!==l?(v||(v=!0,f.el.trigger(OGX.Scroller.START)),L("in")):L("out"),l=t}function S(t){t?u=setInterval(C,h.check_delay):clearInterval(u)}function L(t){a.hasClass("ogx_scroller_track_anim")||a.addClass("ogx_scroller_track_anim"),"in"===t?(clearTimeout(y),y=null,a.addClass("ogx_scroller_track_anim_fade_in").removeClass("ogx_scroller_track_anim_fade_out")):y||(y=setTimeout((function(){a.addClass("ogx_scroller_track_anim_fade_out").removeClass("ogx_scroller_track_anim_fade_in")}),h.fade_delay))}function k(t){t?f.observe(!0,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","src","width","height"]},M):f.observe(!1)}function M(){_!==e.height()&&(_=e.height(),N(),h.auto_scroll&&f.bottom())}function N(){if(o=i.innerHeight(),n=e.height(),s=n/o,n>o){var t=Math.round(o/s);a.css("height",t+"px"),r.css("display","block")}else r.css("display","none");"init"===p&&(p=OGX.Scroller.READY,f.el.trigger(OGX.Scroller.READY))}this.onFocus=function(){return N(),T(!0),h.observe&&setTimeout((function(){k(!0)}),0),x(!0),this},this.onBlur=function(){return T(!1),h.observe&&k(!1),G(!1),b(!1),x(!1),D(!1),S(!1),a.removeClass("ogx_scroller_track_anim_fade_in"),a.removeClass("ogx_scroller_track_anim_fade_out"),this},this.resize=function(){return N(),this},this.destroy=function(){f.el.removeClass("ogx_scroller_outer"),e.remove(),r.remove()},this.overflow=function(t){if(void 0===t)return h.overflow;h.overflow!==t&&(h.overflow=t,t?(this.onFocus(),this.el.removeClass("ogx_scroller_no_overflow")):(this.onBlur(),this.el.addClass("ogx_scroller_no_overflow")))},this.top=function(){return n>o&&(i[0].scrollTop=0,N()),this},this.bottom=function(){return n>o&&(i.scrollTop(n),N()),this},this.max=function(){return e.height()-i.height()},this.scroll=function(t){return void 0===t?i[0].scrollTop:(i[0].scrollTop=t,N(),this)},this.mute=function(){return m=!0,this},this.vocal=function(){return m=!1,this},this.container=function(){return e},this.inner=function(){return e[0]},this.outer=function(){return i[0]},this.state=function(){return p},OGX.Data.merge(h,g),function(){f.el=$(h.el),f.el.addClass("ogx_scroller_outer ogx_hw"),(i=f.el).html('
'),e=i.children(".ogx_scroller_inner"),h.content&&e.append(h.content);var t='
';i.parent().append(t),r=i.parent().find(".ogx_scroller_track"),a=r.find(".ogx_scroller_track_button")}(),N()},OGX.Scroller.READY="ScrollerReady",OGX.Scroller.TOP="ScrollerTop",OGX.Scroller.BOTTOM="ScrollerBottom",OGX.Scroller.SCROLL="ScrollerScroll",OGX.Scroller.START="ScrollerStart",OGX.Scroller.END="ScrollerEnd",require("StackedTree","Uxi","Touch"),OGX.StackedTree=function(t){construct(this,"StackedTree");var e,i,n,o,a=this,r={scope:["public"],speed:200,list:[],display:{html:"{{$label}}"},displays:!1,chromeos:!1},s=t,l=[],c=[0],d=0,u=!1,f="ogx_stacked_tree";function h(t){t?(e.on(a.touch.down,".ogx_stacked_tree_level .ogx_stacked_tree_level_prev",g),e.on(a.touch.down,".ogx_stacked_tree_level_list .ogx_dynamic_list_item",(function(t){var e=$(this).data("ogx-id");e--,function(t,e){u=e;var i=l[d].findIndex("__id__",e.__id__);e.hasOwnProperty("items")&&e.items.length&&function(t){if(!t.hasOwnProperty("scope"))return!0;for(var e=0;e';t>0&&(r=(r=o.css(u)).replace(f+"_door",""),c+='
'+o.html(u)+"
"),c+='
',i.append(c),i.children("."+f+"_level").css("flex-basis",Math.floor(100/(t+1)*100)/100+"%"),function(t,e,i){l[t]&&a.remove(l[t].id,"DynamicList");var n=a.create("DynamicList",{el:e,mode:"static",scroll:!0,display:s.display,displays:s.displays,list:i});l[t]=n}(t,"."+f+'[data-ogx-id="'+a.id+'"] > .'+f+"_container > ."+f+'_level[data-level="'+t+'"] > .'+f+"_level_list",e)}function v(t,e){h(!1),i.addClass(f+"_anim"),void 0!==e&&e?i.on("transitionend",(function(){i.off("transitionend"),i.removeClass(f+"_anim").css("width",100*(t+1)+"%"),a.remove(l[t+1].id,"DynamicList"),l.splice(t+1,1),i.children("."+f+'_level[data-level="'+(t+1)+'"]').remove(),i.children("."+f+"_level").css("flex-basis",Math.floor(100/(t+1)*100)/100+"%"),n=i.width(),u=!1,d=t,h(!0)})):(d=t,h(!0)),n=i.width(),i.css("transform","translateX("+t*Math.round(n/c.length)*-1+"px)")}this.onFocus=function(){h(!0),_(!0)},this.onBlur=function(){h(!1),_(!1)},this.resize=function(){return p(),this},this.destroy=function(){},this.val=function(t){if(t.length){var e=t.slice();return s.list={items:e},!0}return!1},this.scope=function(t){return void 0!==t?(s.scope=t,c=[0],d=0,u=!1,!0):s.scope},function(){s=OGX.Data.merge(s,r,!1,!0);var t=(o=new OGX.Display(s)).val();if(t=function(t){if(t.display&&"object"==typeof t.display&&!t.display.hasOwnProperty("bind")&&(t.display=i(t.display)),t.displays)for(var e in t.displays)t.displays[e]=i(t.displays[e]);function i(t){var e=['{{return typeof($items) !== "undefined" && $items.length > 0}}',{add:"ogx_stacked_tree_door"}];if(t.hasOwnProperty("css"))if("object"==typeof t.css)t.css.hasOwnProperty("add")&&t.css.add?t.css.add+=" ogx_stacked_tree_item":t.css.add="ogx_stacked_tree_item",t.css.hasOwnProperty("conditions")?t.css.conditions.push(e):t.css.conditions=[e];else{var i="";t.css&&(i=t.css),i+=" ogx_stacked_tree_item",t.css={add:i,conditions:[e]}}else t.css={add:"ogx_stacked_tree_item",conditions:[e]};return t}return t}(t),o.val(t),s.display=t.display,s.displays=t.displays,(e=a.el).addClass(f),s.list.length){var i=s.list.slice();s.list={items:i}}}(),e.html('
'),i=e.children("."+f+"_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(t){construct(this,"Stage");var e=this,i=OGX.Data.merge({id:"stage",anim:null,group_watch:!1},t,!0,!0);function n(t){t?e.el.on(e.touch.down,".ogx_stage_exit",(function(){app.theater.show()})):e.el.off(e.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.__proto__.onFocus=function(){return i.closeable&&n(!0),this},this.__proto__.onBlur=function(){return i.closeable&&n(!1),this},function(){i.hasOwnProperty("theater")&&(e.theater=i.theater),e.home=i.home;var t=new OGX.Display(i),n="block";i.hasOwnProperty("use")&&i.use||(n="none");var o="";i.closeable&&(o='
');var a=t.html();i.hasOwnProperty("data")&&(a=OGX.Templater.make(a,i.data)),o+=a,container=e.el,container.html(o),container.addClass("ogx_stage").css("display",n)}()},OGX.Stage.SWAP="swap",OGX.Stage.FLIP="flip",require("Switch","Uxi","Bind","Touch"),OGX.Switch=function(t){construct(this,"Switch");var e,i=this,n=t,o={el:"document",bind:!1,labels:!0,data:[{label:"OFF",value:!1},{label:"ON",value:!0}],value:!1,name:!1,callbacks:{change:null}},a="ogx_switch";function r(t){n.value===n.data[0].value?n.value=n.data[1].value:n.value=n.data[0].value,s(t)}function s(t){t=void 0!==t;var i=e.find("."+a+"_dot").first(),o=e.find("."+a+"_label").first(),r=e.find("."+a+"_label").last();n.value==n.data[0].value?(i.removeClass(a+"_dot_right").addClass(a+"_dot_left"),o.removeClass(a+"_label_off").addClass(a+"_label_on").addClass(a+"_selected"),r.removeClass(a+"_label_on").addClass(a+"_label_off").removeClass(a+"_selected")):(i.removeClass(a+"_dot_left").addClass(a+"_dot_right"),r.removeClass(a+"_label_off").addClass(a+"_label_on").addClass(a+"_selected"),o.removeClass(a+"_label_on").addClass(a+"_label_off").removeClass(a+"_selected")),n.name&&e.find('input[type="hidden"]').attr("value",n.value),t&&e.children("."+a+"_val").trigger("input")}function l(t){t?e.on(i.touch.down,c):e.off(i.touch.down,c)}function c(t){t.preventDefault(),t.stopImmediatePropagation(),r(),d(!1),i.onChange(n.value),e.trigger(OGX.Switch.CHANGE,n.value),e.children("."+a+"_val").trigger("input"),d(!0)}function d(t){t?e.on("change","input[type=hidden]",u):e.off("change","input[type=hidden]",u)}function u(t){t.preventDefault(),t.stopImmediatePropagation(),n.value=OGX.Data.stringToVal(t.target.value),s()}this.construct=function(){n.name&&d(!0)},this.onFocus=function(){return l(!0),e.removeClass(a+"_disabled"),this},this.onBlur=function(){return l(!1),e.addClass(a+"_disabled"),this},this.destroy=function(){n.name&&d(!1)},this.bindRender=function(t,e){},this.val=function(t,i){return void 0===i&&(i=!0),void 0!==t&&n.value!==t&&(r(),i&&e.children("."+a+"_val").first().trigger("input")),n.value},this.onChange=function(){},this.toggle=function(t){return r(t=void 0===t),this},function(){var t;void 0===n&&(n={}),n.hasOwnProperty("data")&&!n.hasOwnProperty("value")&&(t=n.data[0].value),OGX.Data.merge(n,o),void 0!==t&&(n.value=t),(e=i.el).addClass(a+"_disabled");var r=e.parent();r[0].hasAttribute("data-value")&&(n.value=OGX.Data.stringToVal(r.data("value")),r.removeAttr("data-value"))}(),function(){var t="";n.labels&&(t+=''+n.data[0].label+"");var i="";n.value===n.data[1].value&&(i=a+"_dot_right"),t+='
',n.labels&&(t+=''+n.data[1].label+""),n.name&&(t+=''),e.html(t),e.addClass(a)}(),setTimeout(s,0)},OGX.Switch.CHANGE="SwitchChange",OGX.Switch.BIND=OGX.Switch.CHANGE,require("Tabs","Uxi","Touch"),OGX.Tabs=function(t){construct(this,"Tabs");var e,i=this,n=t,o={editable:!1,detach:!1,detach_min:-4,add:!0,remove:!0,reorder:!0,icons:!1,index:0,list:new OGX.List,display:{html:"",css:""},callbacks:{select:null,close:null,add:null,remove:null}},a=!1,r=0,s=!1,l=!1,c=!1,d=!1,u=!1,f={x:0,y:0},h="ogx_tabs";function g(){r>0?r--:r=0,i.index(r)}function _(){for(var t,i,o='
',s=0;s',n.icons&&(o+=''),t&&(o+=''+t+""),n.remove&&(o+=''),o+="
",i="";o+="",n.add&&(o+='
',e.addClass(h+"_editable")),e.html(o),a=e.children("."+h+"_container").children("."+h+"_tab:eq("+r+")")}function p(t){s||(u=!1,l=$(t),r=l.index(),c={from:r},e.children("."+h+"_container").children("."+h+"_tab_active").first().removeClass(h+"_tab_active"),f.x=l.position().left,f.y=l.position().top,(s={el:$(t).clone(),x:f.x,y:l.position().top}).w=l.width(),s.el.width(s.w),l.addClass(h+"_tab_active").addClass(h+"_frozen"),a=l,s.el.addClass(h+"_tab_active").addClass(h+"_float").css("transform","translate3d("+f.x+"px, "+s.y+"px, 0px)"),e.children("."+h+"_container").prepend(s.el),e.trigger(OGX.Tabs.SELECT,n.list[r]),d=setInterval(v,5))}function m(t){if(s)if(u=t,Math.abs(u.distX)>Math.abs(u.distY)){var o=s.x+u.distX;s.el.css("transform","translate3d("+o+"px, "+s.y+"px, 0px)")}else{var a=s.y+u.distY;s.el.css("transform","translate3d("+s.x+"px, "+a+"px, 0px)");var r=s.el.offset();if(u.distYMath.abs(u.distY)&&e.children("."+h+"_container").children("."+h+"_tab").each((function(e,o){(t=$(o)).hasClass(h+"_tab_active")||(i=t.position(),n=t.width(),idx!==e&&(s.x+u.distX>i.left+n/2&&s.x+u.distXi.left&&s.x+u.distXt&&i.css("transform","translateX("+-1*(n-t)+"px)")}),0),this},this.addAt=function(t,e){return n.icons&&(t.hasOwnProperty("icon")||(t.icon=n.icon_default)),n.list.insert(t,e),r=e,setTimeout(_,0),this},this.remove=function(t,i){void 0===i&&(i=t,t="label");var o=n.list.findIndex(t,i);n.list.findDelete(t,i,1)&&(e.children("."+h+"_container").first().children("."+h+"_tab:eq("+o.index+")").remove(),g())},this.removeCurrent=function(){return a&&this.removeAt(r),this},this.removeAt=function(t){return n.list.delete(t)&&(e.children("."+h+"_container").first().children("."+h+"_tab:eq("+t+")").remove(),g()),this},this.enableTab=function(t){return e.children("."+h+"_container").first().children("."+h+"_tab:eq("+t+")").removeClass(h+"_tab_disabled"),this},this.disableTab=function(t){return e.children("."+h+"_container").first().children("."+h+"_tab:eq("+t+")").addClass(h+"_tab_disabled"),this},this.index=function(t){return void 0!==t?(a&&(a.removeClass(h+"_tab_active"),a=null),(a=e.children("."+h+"_container").first().children("."+h+"_tab:eq("+t+")")).addClass(h+"_tab_active"),r=t,!0):a?r:-1},this.select=function(t){a&&a.removeClass(h+"_tab_active");var e=n.list.findIndex("label",t);return this.index(e.index),this},n||(n={}),OGX.Data.merge(n,o),n.list.hasOwnProperty("insert")||(n.list=new OGX.List(n.list)),n.display.hasOwnProperty("_NAME_")||(n.display=new OGX.Display(n.display)),n.callbacks.select||(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),(e=i.el).addClass(h),n.editable&&e.addClass(h+"_editable"),r=n.index,setTimeout(_,0),n.reorder&&i.touch.add("Hold",{id:"tabs_hold",cb_hold:p,cb_move:m,cb_up:y,state:"manual",time:1e3,target:".ogx_tabs_tab",capture:!1})},OGX.Tabs.SELECT="TabsSelect",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(t){var e;e=1===config.max&&config.current_tags.length?config.current_tags[0]:JSON.stringify(config.current_tags),container.find("input[type=hidden]").val(e),t&&container.find("input[type=hidden]").trigger("change")}function addTag(t){var e=!1;switch(config.mode){case OGX.Tags.MODE_STRING:case OGX.Tags.MODE_ASCII:-1===config.current_tags.indexOf(t)&&(config.current_tags.push(t),e=!0);break;case OGX.Tags.MODE_OBJECT:var i=config.current_tags.find("label",t,1);i||((i=config.tags.find("label",t,1))?config.current_tags.push(i):config.current_tags.push({label:t}),e=!0)}if(e){var n="";!0===config.remove&&(n='');var o=''+t+""+n+"";container.find(".ogx_tags_tags").first().append(o),listenHidden(!1),updateHidden(!0),listenHidden(!0),that.onAdd(t),container.trigger(OGX.Tags.TAG_ADDED,t),container.trigger(OGX.Tags.CHANGE,[config.current_tags])}container.find(".ogx_tags_input").trigger("focus")}function removeTag(t){var e=!1;switch(config.mode){case OGX.Tags.MODE_STRING:case OGX.Tags.MODE_ASCII:var i=config.current_tags.indexOf(t);i>-1&&(e=config.current_tags.splice(i,1));break;case OGX.Tags.MODE_OBJECT:e=config.current_tags.findDelete("label",t)}return e&&container.find(".ogx_tags_tags").first().find(".ogx_tags_tag").each((function(e,i){if($(i).find("span").first().text()===t)return $(i).remove(),listenHidden(!1),updateHidden(!0),void listenHidden(!0)})),e}function displayTags(t,e){if(t){container.find(".ogx_tags_container").length>0&&(displayTags(!1),listenTagAdd(!1));for(var i='
',n=!1,o=0;o";break;case OGX.Tags.MODE_OBJECT:i+=''+e[o].label+""}n&&(i+='+'+n+" "+config.more_word+""),i+="
",container.append(i),listenTagAdd(!0)}else container.find(".ogx_tags_container").remove(),listenTagAdd(!1)}function renderTags(t){for(var e="",i="",n=0;n':"",config.mode){case OGX.Tags.MODE_STRING:case OGX.Tags.MODE_ASCII:e+=''+t[n]+""+i+"";break;case OGX.Tags.MODE_OBJECT:e+=''+t[n].label+""+i+""}return config.current_tags=t,container.find(".ogx_tags_tags").first().html(e),updateHidden(!1),!0}function trimTags(t){return t=OGX.Data.clone(t),sliced={org:OGX.Data.clone(t),rem:[]},Array.isArray(t)&&config.display_max&&t.length>config.display_max&&(sliced.rem=t.slice(config.display_max),t=t.slice(0,config.display_max)),config.display_more&&sliced.rem.length&&t.push({__m__:sliced.rem.length}),new OGX.List(t)}function findTags(t){for(var e,i=[],n=0;n=3)if(!config.strict&&t.which===config.keycode&&config.add)addTag(e),input.val(""),displayTags(!1);else{var i;switch(config.mode){case OGX.Tags.MODE_STRING:i=findTags(e);break;case OGX.Tags.MODE_OBJECT:i=findTagsObj(e);break;case OGX.Tags.MODE_ASCII:i=findTagsAscii(e)}i.length>0?displayTags(!0,i):displayTags(!1)}else displayTags(!1)})):input.off("keyup")}function listenSelect(t){t?container.on(that.touch.down,".ogx_tags_tag",onSelect):container.off(that.touch.down,".ogx_tags_tag",onSelect)}function onSelect(t){var e=$(this).text();switch(config.mode){case OGX.Tags.MODE_OBJECT:e=config.current_tags.get({label:{eq:e}},null,1)}config.callbacks.select(e),that.el.trigger(OGX.Tags.SELECT,e)}function listenMore(t){t?container.on(that.touch.down,".ogx_tags_more",onMore):container.off(that.touch.down,".ogx_tags_more",onMore)}function onMore(t){t.preventDefault(),t.stopImmediatePropagation(),sliced.rem.length&&($(this).remove(),displayTags(!0,sliced.org))}function listenTagAdd(t){t?container.on(that.touch.down,".ogx_tags_container_tag",onAdd):container.off(that.touch.down,".ogx_tags_container_tag",onAdd)}function onAdd(t){addTag($(this).text()),input.val(""),displayTags(!1),config.max&&config.current_tags.length===config.max&&(listenInput(!1),input.css("display","none"))}function listenTagRemove(t){t?container.on(that.touch.down,".ogx_tags_remove",onRemove):container.off(that.touch.down,".ogx_tags_remove",onRemove)}function onRemove(t){t.preventDefault(),t.stopImmediatePropagation();var e=removeTag($(this).parent("span").first().find("span").first().text());that.onRemove(e),container.trigger(OGX.Tags.TAG_REMOVED,e),container.trigger(OGX.Tags.CHANGE,[config.current_tags]),config.max&&config.current_tags.length'),config.name){var e="";config.required&&(e="required"),t+='"}if(container.html(t),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.onFocus=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 t=container.find(".ogx_tags_input").first();t.prop("placeholder",config.placeholder),t.prop("disabled",!1),config.hide_input_on_disable&&t.removeClass("ogx_tags_hidden")}return this},this.onBlur=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 t=container.find(".ogx_tags_input").first();t.prop("placeholder",""),t.prop("disabled",!0),config.hide_input_on_disable&&t.addClass("ogx_tags_hidden")}return this},this.destroy=function(){config.restrict&&OGX.Form.unrestrictField(container.find(".ogx_tags_input").first()[0])},this.tags=function(t){return void 0!==t?(t.hasOwnProperty("insert")||(t=new OGX.List(t)),config.tags=t,!0):config.tags},this.val=function(t,e){if(displayTags(!1),listenTagAdd(!1),void 0!==t){if(void 0!==e){var i=t,n=config.tags.find(i,e,1);n&&(t=[n])}return t.hasOwnProperty("insert")||(t=new OGX.List(t)),config.current_tags=t,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(t){return renderTags(trimTags(t))},this.onSelect=function(){},this.onAdd=function(){},this.onRemove=function(){},this.add=function(t){return addTag(t)},this.remove=function(t){return removeTag(t)},init()},OGX.Tags.prototype.tagDataset=function(t,e,i){"use strict";void 0===i&&(i=!1);for(var n,o=[],a=0;a-1&&(i.includes(n.items[o][a])||i.push(n.items[o][a]));return t(n.items[o]),!0}}(t));}(t,e)},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(t){construct(this,"Template");var e=new OGX.Display(t),i=e.html(t.data),n=e.css(t.data);i&&this.el.html(i),n&&this.el.addClass(n)},OGX.Templater=function(){"use strict";var t;this.jmake=function(t,e){for(var i,n,o=JSON.stringify(t);m=/({{(\$|#)[a-z0-9_\.]*}})|("{{(\$)}}")/gi.exec(o);)m[0].match(/"{{(\$)}}"/)?(i="<-"+(i=JSON.stringify(e)).substring(1).slice(0,-1)+"->",o=(o=(o=o.replace(m[0],i)).replace(/<\-/,"{")).replace(/\->/,"}")):("object"==typeof(n=OGX.OSE.exec(m[0],e))&&(n=JSON.stringify(n),m[0]='"'+m[0]+'"'),o=o.replace(m[0],n));return JSON.parse(o)},this.make=function(e,i,n,o,a){var r,s;for(t={},void 0===a&&(a={}),OGX.Data.merge(t,a);r=/{{[^{]+(({[^{]+)+)?}}/gi.exec(e);)void 0===(s=OGX.OSE.exec(r[0],i,n,o,t))&&(s=""),e=e.replace(r[0],s);return e},this.amake=function(t,e,i,n,o){for(var a="",r=0;r{{$label}}'},l='
',c=!0;function d(t){t?($(document).on("backbutton",u),$(window).on("popstate",u),list.el.on(OGX.DynamicList.SELECT,(function(t,e){!function(t){o.el.trigger(OGX.Theater.HIDE);var e=app.find("Stage",t);e.wake(),e.resizeNodes();var n,r=list.el.find('.ogx_theater_stage[data-ogx-id="'+e.id+'"]').position();o.observe(!0,{childList:!0},(function(){o.observe(!1),(n=i.children(".ogx_theater_trans")).on("transitionend",(function(){n.off("transitionend"),o.hide(),n.remove(),e.url?(app.showStage(e.id,!1),app.router.addToHist(e.url)):app.goto(e.id+"/"+e.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)"})}),a.timeout)}),null,i),i.append('
")}(e.id)}))):($(document).off("backbutton",u),$(window).off("popstate",u),list.el.off(OGX.DynamicList.SELECT))}function u(){o.hide()}function f(){e.prepend(l);for(var t,i=[],r=0;r .list").on(OGX.DynamicList.RENDER,(function(t){$(".ogx_theater > .list").off(OGX.DynamicList.RENDER),setTimeout((function(){l=$(".ogx_theater").detach()}),0)})),list=o.create("DynamicList",{el:".ogx_theater > .list",display:{html:a.display.html,css:"ogx_theater_stage"},key:"id",scroll:!0,mode:"hit",list:i,trigger:!0})}function h(){var t=app.gather(OGX.Stage.NAME);n=[];for(var e=0;e
"),e.css("visibility","visible")}(),this.focusNodes(),d(!0),c=!1),this},this.hide=function(){return c||(this.blurNodes(),l=e.detach(),d(!1),c=!0),this},this.tile=function(t,e){void 0===e&&(e="x")},OGX.Data.merge(a,r),a.display&&("object"!=typeof a.display&&(a.display={}),OGX.Data.merge(a.display,s),a.display.template&&(a.display.html=OGX.Templater.get(a.display.template))),(e=o.el).addClass("ogx_theater").css("visibility","hidden"),i=$("body"),h(),$(document).on(OGX.App.READY,f)},OGX.Theater.ZOOM="TheaterZoom",OGX.Theater.SHOW="TheaterShow",OGX.Theater.HIDE="TheaterHide",OGX.Touch=function(t){"use strict";var e=this,i=0;this.touch=!1,this.touch||this.initTouch(t.chromeos);var n=new OGX.List;this.touch.add=function(t,o){var a=new OGX.Touches[t](e),r=a.set(o);return!r.hasOwnProperty("id")&&(r.id=i++),a.id=r.id,"auto"===r.state&&!e.blured&&e.enabled&&a.enable(),n.insert(a),a},this.touch.remove=function(t){"object"==typeof t&&(t=t.id),n.findDelete("id",__id,1).disable()},this.touch.get=function(t){return n.get({id:{eq:t}},null,1)},this.touch.wipe=function(){for(var t=0;ta.x?1:-1,l=r.y>a.y?1:-1,c=Math.abs(r.x-a.x),d=Math.abs(r.y-a.y),u=Math.sqrt(Math.abs(Math.pow(r.x-a.x,2)-Math.pow(r.y-a.y,2)))}function b(){o.cb_swipe&&(o.x&&o.min_x&&c>=o.min_x||o.y&&o.min_y&&d>=o.min_y?x(0,!0):o.cb_swipe({pt0:a,pt1:r,dirX:s,dirY:l,distX:c,distY:d,dist:u}))}this.set=function(t){return o=t,OGX.Data.merge(o,n),e=i.selector,this.state=o.state,"auto"===o.state&&(i.enable,i.disable),o.target&&(e=o.target),o},this.enable=function(){!h&&o&&(h=!0,y(!0))},this.disable=function(){h&&(h=!1,y(!1),m(!1))}},OGX.Touches.Hold=function(t){"use strict";var e={cb_hold:!1,cb_up:!1,cb_move:!1,time:1e3,el:this.el,target:!1,capture:!1,parent:null,state:"auto"},i=!1,n=!1,o=!1,a=!1,r=!1,s=!1,l=t,c={x:0,y:0},d={x:0,y:0},u={x:0,y:0},f={x:0,y:0},h=null,g=$("body");function _(t){var e=[];t?i.parent?i.parent.on.apply(i.parent,[l.touch.down,p]):(e=i.target?[l.touch.down,i.target,p]:[l.touch.down,p],l.el.on.apply(l.el,e)):i.parent?i.parent.off.apply(i.parent,[l.touch.down,p]):(e=i.target?[l.touch.down,i.target,p]:[l.touch.down,p],l.el.off.apply(l.el,e))}function p(t){t=l.event(t),h=t.currentTarget,a||(a=!0,n=(new Date).getTime(),f.x=c.x=t.pageX,f.y=c.y=t.pageY,o=setInterval(v,1))}function m(t){i.capture&&(t.preventDefault(),t.stopImmediatePropagation()),t=l.event(t),d.x=t.pageX,d.y=t.pageY,d.x5||Math.abs(c.y-d.y)>5)&&(clearInterval(o),o=!1)}function v(){a&&(new Date).getTime()-n>i.time&&(r||(r=!0,g.on(l.touch.move,m),i.cb_hold?i.cb_hold(h,c):l.el.trigger(OGX.Touch.HOLD_START)))}function y(e){e=t.event(e),a=!1,clearInterval(o),o=!1,r&&(r=!1,g.off(l.touch.move,m),i.cb_up?i.cb_up({x:e.pageX,y:e.pageY}):l.el.trigger(OGX.Touch.HOLD_END,{x:e.pageX,y:e.pageY}))}this.set=function(t){return i=t,OGX.Data.merge(i,e),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,_(!0),g.on(l.touch.up,y))},this.disable=function(){s&&(s=!1,(a||o)&&(r=!1,a=!1,clearInterval(o),o=!1),_(!1),g.off(l.touch.up,y),g.off(l.touch.move,m))}},OGX.Touches.Drag=function(t){"use strict";var e,i,n,o,a,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,parent:null,state:"auto"},c=t,d=!1,u=!1,f=$("body");function h(t){var e=[];t?s.parent?s.parent.on.apply(s.parent,[c.touch.down,g]):(e=s.target?[c.touch.down,s.target,g]:[c.touch.down,g],c.el.on.apply(c.el,e)):s.parent?s.parent.off.apply(s.parent,[c.touch.down,g]):(e=s.target?[c.touch.down,s.target,g]:[c.touch.down,g],c.el.off.apply(c.el,e))}function g(l){s.capture&&(l.preventDefault(),l.stopImmediatePropagation()),l=t.event(l),n=l.pageX,o=l.pageY;var d=c.el.position();e=d.left,i=d.top;var u=c.el.offset(),f=n-u.left,h=o-u.top;if(s.border){if(fc.el.width()-s.border)return;if(hc.el.height()-s.border)return}a=0,r=0,_(!0),p(!0),s.cb_down&&s.cb_down({x:n,y:o,target:l.target})}function _(t){t?d||(d=setInterval(y,10)):d&&(clearInterval(d),d=null)}function p(t){t?(f.on(c.touch.move,v),f.on(c.touch.up,m)):(f.off(c.touch.move,v),f.off(c.touch.up,m))}function m(e){_(!1),p(!1),e=t.event(e),s.x&&(a=e.pageX-n),s.y&&(r=e.pageY-o),s.cb_up&&s.cb_up({distX:a,distY:r})}function v(e){s.capture&&(e.preventDefault(),e.stopImmediatePropagation()),e=t.event(e);var i,l=!1;s.x&&(i=e.pageX-n,null!==s.limit_x?i>=s.limit_x.min&&i<=s.limit_x.max&&(s.min?Math.abs(i)>s.min&&(a=i,l=!0):(a=i,l=!0)):s.min?Math.abs(i)>s.min&&(a=i,l=!0):a=i),s.y&&(i=e.pageY-o,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:a,distY:r,x:e.pageX,y:e.pageY})}function y(){c.el.css({transform:"translate3d("+(e+a)+"px, "+(i+r)+"px, 0px)"})}this.dragable=!0,this.set=function(t){return s=t,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),_(!1))}},OGX.Touches.Move=function(t){"use strict";var e,i,n,o,a,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,parent:null,state:"auto"},u=t,f=!1,h=$("body");function g(t){var e=[];t?c.parent?c.parent.on.apply(c.parent,[u.touch.down,_]):(e=c.target?[u.touch.down,c.target,_]:[u.touch.down,_],u.el.on.apply(u.el,e)):c.parent?c.parent.off.apply(c.parent,[u.touch.down,_]):(e=c.target?[u.touch.down,c.target,_]:[u.touch.down,_],u.el.off.apply(u.el,e))}function _(d){c.capture&&(d.preventDefault(),d.stopImmediatePropagation()),d=t.event(d),e=d.pageX,i=d.pageY,n=0,o=0,a=0,r=0,s=0,l=0,p(!0),c.cb_down&&c.cb_down({target:d.target,x:e,y:i})}function p(t){t?(h.on(u.touch.move,v),h.on(u.touch.up,m)):(h.off(u.touch.move,v),h.off(u.touch.up,m))}function m(s){if(p(!1),s=t.event(s),c.x&&(n=s.pageX-e),c.y&&(o=s.pageY-i),c.cb_up&&c.cb_up({x:s.pageX,y:s.pageY,distX:n,distY:o,dirX:a,dirY:r}),c.cb_click){var l=!1;c.x&&Math.abs(n)<2&&(l=!0),c.y&&Math.abs(o)<2&&(l=!0),l&&c.cb_click(s)}}function v(d){c.capture&&(d.preventDefault(),d.stopImmediatePropagation()),d=t.event(d);var u,f=!1;c.x&&(a=0,sd.pageX&&(a=-1),s=d.pageX,u=d.pageX-e,null!==c.limit_x?u>=c.limit_x.min&&u<=c.limit_x.max&&(c.min?Math.abs(u)>c.min&&(n=u,f=!0):(n=u,f=!0)):c.min?Math.abs(u)>c.min&&(n=u,f=!0):(n=u,f=!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&&(o=u,f=!0):(o=u,f=!0)):(o=u,f=!0)),f&&c.cb_move&&c.cb_move({distX:n,distY:o,dirX:a,dirY:r,x:d.pageX,y:d.pageY})}this.set=function(t){return c=t,OGX.Data.merge(c,d),"auto"===c.state&&(u.enable,u.disable,this.enable()),this.state=c.state,c},this.enable=function(){!f&&c&&(f=!0,g(!0))},this.disable=function(){f&&(f=!1,g(!1),p(!1))}},OGX.Touch.HOLD_START="TouchHoldStart",OGX.Touch.HOLD_END="TouchHoldEnd",require("Tree","Uxi","Touch"),OGX.Tree=function(t){construct(this,"Tree");var e,i,n,o,a,r,s,l,c=this,d='{{$label}}',u=t,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:d}},file:{mode:"file",display:{html:d}},folder:{mode:"folder",display:{html:d}}},data:{_id:0,type:"root",state:"closed",label:null,items:[]},display:null,callbacks:{select:null,unselect:null,open:null,close:null,move:null}},h="_id",g=0;function _(t,e,i,n,o){return t[h]===o[h]&&e}function p(t,e){var i={container_display:"",container_css:"",arrow_display:"",arrow_style:"ogx_tree_item_arrow_open",state:"open",type:e.type};return i[h]=e[h],OGX.Data.merge(i,t,!0),OGX.Templater.make('
',i)}function m(){var t=p({},u.data);e.html(t),u.data.element=e.children(".ogx_tree_item").first(),u.data.uxi=c,O(u.data,c),u.show_root||u.data.element.addClass("ogx_tree_root_hidden")}function v(){m(),y(u.data,c)}function y(t,e){if(t.parent=e,t.hasOwnProperty("items")){var i,n;!t.items.hasOwnProperty("insert")&&(t.items=new OGX.List(t.items)),u.sort.enabled&&t.items.order(u.sort.property,u.sort.way);for(var o=0;o .ogx_tree_item_content';if(i.display.hasOML()){var o=i.display.oml(n,t,!1);OGX.OML.render(e,o,t),t.uxi=e.nodes.last()}else{var a=i.display.html(t);a=OGX.Templater.make(a,t),$(n).html(a)}}function b(t){return delete t.element,delete t.parent,delete t.uxi,delete t.state,l||delete t[h],!1}function w(t){"folder"===k(t).mode&&(t.items.length?t.element.attr("data-empty",!1):(t.element.attr("data-state","closed").attr("data-compound",t.type+"-closed").attr("data-empty",!0),t.element.children(".ogx_tree_item_arrow").addClass("ogx_tree_item_arrow_disabled")),"open"===t.state?(t.element.attr("data-state","open").attr("data-compound",t.type+"-open"),t.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_close").removeClass("ogx_tree_item_arrow_disabled").addClass("ogx_tree_item_arrow_open"),t.element.children(".ogx_tree_item_container").removeClass("ogx_tree_item_container_hidden")):(t.element.attr("data-state","open").attr("data-compound",t.type+"-closed"),t.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_open").addClass("ogx_tree_item_arrow_close"),t.element.children(".ogx_tree_item_container").addClass("ogx_tree_item_container_hidden")))}function G(){if(s){var t=E(s);t&&t.children(".ogx_tree_item_content").removeClass("ogx_tree_selected_item"),s=null}}function X(){return!!s&&D(s)}function T(t){var e=E(t);e&&(s=t,e.children(".ogx_tree_item_content").addClass("ogx_tree_selected_item"))}function C(t,e){return L((function(i){return i[h]===e&&(i.hasOwnProperty("items")||(i.items=new OGX.List),!i.items.hasOwnProperty("insert")&&(i.items=new OGX.List(i.items)),i.items.push(t),i.state="open",w(i),!0)}))}function D(t){if(!t||"root"===t)return u.data;return L((function(e,i){return e[h]===t&&e}))}function E(t){var e=D(t);return!!e&&e.element}function S(){g=1,L((function(t){return t[h]=g++,t.hasOwnProperty("type")||(t.hasOwnProperty("items")?t.type="folder":t.type="file"),!1}))}function L(t,e,i){var n;return void 0===e&&(e=null),void 0===i&&(i=u.data),(n=function i(o,a,r,s){if(n=t(o,a,r,s,e))return n;if(o.hasOwnProperty("items")&&o.items.length)for(var l=0;l .ogx_tree_item_content",(function(t){t.preventDefault(),M($(this).parent(0)),1!==$(this).parent(0).data("id")&&function(){a&&clearInterval(a);r=(new Date).getTime(),a=setInterval(I,50)}()})),$(document).on(c.touch.up,(function(){P(),n&&(A(!1),function(){var t=n.offset().left,a=n.offset().top,r=(l=t,d=a,L((function(t,e){return u=t.element.offset(),f=t.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()&&t}))),s=k(r);var l,d,u,f;!r||r&&(r[h]===i[h]||"folder"!==s.mode)?(o.css("opacity",1),n.remove(),n=null,i=null):(_=r,function(t){L((function(e,i,n,o){return e[h]===t&&(n.items.splice(o,1),n.items.length||(n.state="closed"),w(n),!0)}))}((g=i)[h]),C(g,_[h]),_.element.children(".ogx_tree_item_container").empty(),_.state="open",y(_,_.element),w(_),o.remove(),n.remove(),n=null,c.onMove(i),e.trigger(OGX.Tree.DROP,i),i=null);var g,_}())}))):e.on("click",".ogx_tree_item > .ogx_tree_item_content",(function(t){M($(this).parent(0))})),e.on(c.touch.down,".ogx_tree_item_arrow",(function(t){t.preventDefault(),P();var i=D($(this).parent(0).data("id"));i&&i.hasOwnProperty("items")&&i.items.length&&("open"===i.state?(c.onClose(i),e.trigger(OGX.Tree.CLOSE,i)):(c.onOpen(i),e.trigger(OGX.Tree.OPEN,i)),"open"===i.state?i.state="closed":i.state="open",w(i))}))):(u.editable?e.off(c.touch.down,".ogx_tree_item > .ogx_tree_item_content"):e.off("click",".ogx_tree_item > .ogx_tree_item_content"),e.off(c.touch.down,".ogx_tree_item_arrow"))}function I(){var t;(new Date).getTime()-r>=u.drag_after&&(s&&(i=D(s))&&(t=i.element,o=t,(n=t.clone()).children(".ogx_tree_item_arrow").css("display","none"),t.css("opacity",.3),n.addClass("ogx_tree_item_drag"),n.css({top:t.offset().top,left:t.offset().left}),e.prepend(n),A(!0),e.trigger(OGX.Tree.DRAG,i)),P())}function A(t){t?$(document).on(c.touch.move,(function(t){t=function(t){if(t.hasOwnProperty("originalEvent")&&void 0!==t.originalEvent.changedTouches)return t.originalEvent.changedTouches[0];return t}(t),n.css({top:t.pageY+"px",left:t.pageX+"px"})})):$(document).off(c.touch.move)}function P(){a&&(clearInterval(a),a=null)}this.onFocus=function(){return N(!0),this},this.onBlur=function(){return N(!1),this},this.onSelect=function(){},this.onUnselect=function(){},this.onOpen=function(){},this.onClose=function(){},this.onMove=function(){},this.addItem=function(t,e){if(void 0===e&&(e=s),e){var i=D(e);if("folder"===k(i).mode){l||(t[h]=++g),C(t,e);var n=k(t);x(i.element.children(".ogx_tree_item_container").first(),t),O(t,i.parent);var o=i.uxi;return n.display.hasOML()&&(o=i.uxi.nodes.last()),y(t,o),i.element.data("state","open"),i.element.data("compound",t.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(t){var e,i,n=D(t);return!!n&&(e=n,i={},OGX.Data.merge(i,e),b(i),i)},this.selectItem=function(t){return T(t),X()},this.selectItemByPropVal=function(t,e){var i=function(t,e){function i(i,n){return!(!i.data.hasOwnProperty(t)||i.data[t]!==e)&&n+"/"+i.label}return L(i)}(t,e);return!!i&&(G(),T(i[h]),X())},this.selectItemByPath=function(t){var e=function(t){var e=function(t){function e(e,i){return t===i+"/"+e.label&&e}return L(e)}(t);if(e)return e.element;return!1}(t);return!!e&&(G(),e.children(".ogx_tree_item_content").addClass("ogx_tree_selected_item"),s=e.data("id"),X())},this.updateItem=function(t,e,i){void 0===i&&(i=!0);var n=D(t);if(n){if(n.uxi){var o=n.uxi.el;n.uxi.kill(),o.empty()}else i&&n.element.children(".ogx_tree_item_container").empty();OGX.Data.merge(n,e,!0),O(n,n.parent),i&&n.hasOwnProperty("items")&&n.items.length&&(y(n,n.parent),n.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_disabled ogx_tree_item_arrow_close").addClass("ogx_tree_item_arrow_open"),n.element.attr("state","open").attr("state",n.type+"-open"))}},this.replaceItem=function(t){var e=D(t[h]);e&&(e.uxi&&e.uxi.kill(),OGX.Data.merge(t,e,!1),O(e,e.parent),e.hasOwnProperty("items")&&e.items.length&&y(e,e.parent))},this.deleteItem=function(t){var e=D(t);if(e){var i=function(t){function e(e){return!(!e.hasOwnProperty("items")||!e.items.get({_id:{eq:t}},null,1))&&e}return L(e)}(t);return e.uxi&&e.uxi.kill(),i.items.findDelete("_id",t,1),e.element.remove(),i.items.length||(i.state="closed"),w(i),e}},this.deleteSelectedItem=function(){return function(){function t(t,e,i,n){if(t[h]===s)return t.element.remove(),i.items.splice(n,1),w(i),!0}if(s)return L(t);return!1}()},this.getSelectedItem=function(){return X()},this.getTree=function(){var t=L(b,null,OGX.Data.clone(u.data));return t||!1},this.setData=function(t){t.hasOwnProperty("types")&&this.setTypes(t.types),t.hasOwnProperty("tree")&&this.setTree(t.tree)},this.setTypes=function(t){u.types=t},this.setTree=function(t){this.scroll?this.clear([this.scroller.id]):this.clear(),u.data=t,u.data.hasOwnProperty("state")||(u.data.state="open"),l||S(),v()},this.newTree=function(){c.scroll?c.clear([c.scroller.id]):c.clear();g=0,m()},this.filterTree=function(t){!function(t){var e=[];function i(n,o,a,r){if(-1!==(o+n.label).indexOf(t)&&e.push(o+"/"+n.label),n.hasOwnProperty("items")&&n.items.length)for(var s=0;s .ogx_scroller_inner',(i=$(t.el)).addClass(n).attr("data-ogx-id",this.id),e&&i.attr("id",this.id);var a=this;setTimeout((function(){a.scroller.resize()}),0)}else i.append(o),t.el='.ogx_uxi[data-ogx-id="'+this.id+'"]';this.el=$(t.el)}},OGX.Uxi.prototype.enable=function(t){return this.enabled||(this.enabled=!0,this.focus(t)),this},OGX.Uxi.prototype.disable=function(t){return this.enabled&&(this.enabled=!1,this.blur(t)),this},OGX.Uxi.prototype.ux=function(){},OGX.Uxi.prototype.onFocus=function(){},OGX.Uxi.prototype.onBlur=function(){},OGX.Uxi.onFocus=function(){},OGX.Uxi.onBlur=function(){},OGX.Uxi.prototype.construct=function(){},OGX.Uxi.prototype.destroy=function(){},OGX.Uxi.prototype.resize=function(t){return void 0===t&&(t=!1),t&&this.resizeNodes(),this},OGX.Uxi.prototype.show=function(){return this._show()},OGX.Uxi.prototype.hide=function(){return this._hide()},OGX.Uxi.prototype._show=function(){return this.el&&(this.visible=!0,this.el.removeClass("ogx_uxi_hidden")),this},OGX.Uxi.prototype._hide=function(){return this.el&&(this.visible=!1,this.el.addClass("ogx_uxi_hidden")),this},OGX.Uxi.prototype.empty=function(){return this.clear(),this},OGX.Uxi.prototype.observe=function(t,e,i,n,o){var a=this,r=this.el,s=null;if(void 0!==o&&(r=o),t){if(!this.observer)return void 0!==e&&e||(e={childList:!0,subtree:!0}),this.observer=new MutationObserver((function(t,e){t.forEach((function(t){s&&clearTimeout(s),s=setTimeout((()=>{void 0!==i?i(t,n):a.el.trigger(OGX.View.CHANGED,t)}),10)}))})),this.observer.observe(r[0],e),!0}else if(this.observer)return this.observer.disconnect(),this.observer=null,!0;return!1},OGX.Uxi.prototype.observeOnce=function(t,e,i,n){var o=this;this.observe(!0,t,(function(){o.observe(!1),void 0!==e&&e(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(t){return t=void 0===t?this.__parent:$(t),this.sleeping&&(this.sleeping=!1,t.prepend(this.el),this.el=t.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(t,e){return this.parent=t,this.parent.nodes.insert(this),this.selector=e,this.wake(e),setTimeout((()=>this.resize),0),this},OGX.Uxi.prototype.resizeNodes=function(){for(var t=this.gather(),e=0;e0&&"Carousel"===e[i]._NAME_&&"Container"===e[i-1]._NAME_||(e[i].floating?e[i].show(t):e[i].show(this._NAME_,this.id));return this}},OGX.Uxi.prototype.focus=function(t){if(void 0===t&&(t=1),this.blured)switch(this.blured=!1,this.ux(!0),this.__proto__.onFocus(),this.onFocus(),t){case 1:this.focusNodes();break;case 2:this.focusTree()}return this},OGX.Uxi.prototype.focusTree=function(){for(var t=this.gather(),e=0;ee&&(e=t)})),e+1},OGX.Uxi.prototype.stage=function(){return function t(e){if(e.parent)return"Stage"!==e.parent._NAME_?t(e.parent):e.parent}(this)},OGX.Uxi.prototype.on=function(){this.el&&this.el.on.apply(this.el,arguments)},OGX.Uxi.prototype.off=function(){this.el&&this.el.off.apply(this.el,arguments)},OGX.Uxi.prototype.toJSON=function(){return{type:this._NAME_,id:this.id,selector:this.selector,data:this.data}},OGX.Uxi.prototype.toOML=function(){var t={},e=this.selector+":"+this._NAME_;if(t[e]={id:this.id,data:this.data,"node:OML":[]},this.nodes.length)for(var i=0;i$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,touch_drag;function genIcons(){for(var t="",e=0;e";return t}function listenBackIcon(t){t?that.el.on(that.touch.down,".ogx_window_main_back",onBack):that.el.off(that.touch.down,".ogx_window_main_back",onBack)}function onBack(t){t.preventDefault(),t.stopImmediatePropagation(),that.el.trigger(OGX.Window.HIT_BACK,that),that.hide()}function listenIcons(t){t?that.el.on(that.touch.down,".ogx_window_icon",onIcon):that.el.off(that.touch.down,".ogx_window_icon",onIcon)}function onIcon(t){t.preventDefault(),t.stopImmediatePropagation();var e=$(this).index();if("string"==typeof config.icons[e])that.el.trigger(OGX.Window.HIT_ICON,{index:e,id:config.id});else{var i=e;config.icons[e].hasOwnProperty("callback")&&config.icons[e].callback&&(config.icons[e].hasOwnProperty("params")&&(i=config.icons[e].params),config.icons[e].callback.call(null,i))}}function onDrag(t){(t.distX*dir.x>config.close_dist||t.distY*dir.y>config.close_dist)&&that.hide()}function onRelease(t){t.distX*dir.x>config.close_dist||t.distY*dir.y>config.close_dist?that.hide():(t.distX||t.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 t=prepWindow();container.html(t),zd=config.zindex?config.zindex:config.parent.topIndex();var e=getLimitedSize();container.css({width:e.width,height:e.height,"z-index":zd})}function getLimitedSize(){var t,e,i,n=config.parent.el.width(),o=config.parent.el.height();user_resized?(n=config.width,o=config.height):(t=OGX.Data.getBestSize(n,config.width),e=OGX.Data.getBestSize(o,config.height));var a={width:t,height:e};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&&(a.width=config.max_width+"px")):(-1!==(i=config.width).indexOf("px")&&(i=Number(i.split("px")[0])),config.min_width&&iconfig.max_width&&(a.width=config.max_width+"px"))),(config.min_height||config.max_height)&&(-1!==config.height.indexOf("%")?(o=config.parent.el.height(),i=Number(config.height.split("%")[0])*o/100,config.min_height&&iconfig.max_height&&(a.height=config.max_height+"px")):(-1!==(i=config.height).indexOf("px")&&(i=Number(i.split("px")[0])),config.min_height&&iconfig.max_height&&(a.height=config.max_height+"px"))),a}function listenBody(t){t?that.parent.el.on(that.touch.down,".ogx_overlay",onBody):that.parent.el.off(that.touch.down,".ogx_overlay",onBody)}function onBody(t){that.status===OGX.Window.OPEN&&(that.hide(),that.parent.removeOverlay(OGX.Overlay.Fade))}function animWindow(t,e,i,n){void 0!==e&&!0!==e||(e=config.anim);var o={opac:1,tX:0,tY:0},a=container.parent().width(),r=container.parent().height(),s=that.el.outerWidth(),l=that.el.outerHeight(),c=that.el.find(".ogx_window_main_icon").first();switch(t&&(placeWindow(!0),c.removeClass("ogx_window_main_icon_left ogx_window_main_icon_right ogx_window_main_icon_top")),e){case OGX.Window.ANIM_NONE:break;case OGX.Window.ANIM_TOP:t?(o.tY=0,c.addClass("ogx_window_main_icon_top")):o.tY=-l-10;break;case OGX.Window.ANIM_BOTTOM:t?(o.tY=0,c.addClass("ogx_window_main_icon_bottom")):o.tY=r+10;break;case OGX.Window.ANIM_RIGHT:t?(o.tX=a-s,c.addClass("ogx_window_main_icon_right")):o.tX=a+10;break;case OGX.Window.ANIM_LEFT:t?(o.tX=0,c.addClass("ogx_window_main_icon_left")):o.tX=-s-10}var d=100;t?(pt.x=o.tX,pt.y=o.tY):d=0,setTimeout((function(){dir.x,that.el.on("transitionend",(function(){that.el.off("transitionend"),t?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),t?(that.status=OGX.Window.OPEN,that.el.trigger(OGX.Window.OPEN,that)):(that.status=OGX.Window.CLOSED,that.el.trigger(OGX.Window.CLOSED,that))})),t?(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&&(t?that.el.addClass("ogx_window_anim_in"):that.el.addClass("ogx_window_anim_out")),that.el.css({transform:"translate3d("+o.tX+"px, "+o.tY+"px, 0px)",opacity:o.opac,visibility:"visible"})}),d)}function placeWindow(t){var e=container.parent().width(),i=container.parent().height(),n=that.el.outerHeight(),o=that.el.outerWidth();that.el.removeClass("ogx_window_anim_in").removeClass("ogx_window_anim_out");var a={x:0,y:0};switch(config.anim){case OGX.Window.ANIM_TOP:a.y=t?-n:n,dir.y=-1;break;case OGX.Window.ANIM_BOTTOM:a.y=t?i:i-n,dir.y=1;break;case OGX.Window.ANIM_RIGHT:a.x=t?e:e-o,dir.x=1;break;case OGX.Window.ANIM_LEFT:t&&(a.x=-o),dir.x=-1}that.el.css({transform:"translate3d("+a.x+"px, "+a.y+"px, 0px)"})}function prepWindow(){var t=new OGX.Display(config),e={};e.head=config.head,e.title=config.title,e.icons=config.icons,e.html=t.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,e.side="right";break;case OGX.Window.ANIM_LEFT:n=config.win_inner.reverse(),e.side="left"}n=n.toString().replace(/>,<"),i=i.replace("$INNER",n);var o="";return config.icons&&config.icons.length&&(o=genIcons()),i=i.replace("$ICONS",o),OGX.Templater.make(i,e)}function onResize(){user_resized=!0,that.resizeNodes()}function listenScroll(t){t?(that.el.on(OGX.Scroller.START,(function(){that.onBlur()})),that.el.on(OGX.Scroller.END,(function(){that.onFocus()}))):(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 t={state:"manual"},e={top:!1,bottom:!1,left:!1,right:!1,cb_resize:onResize};switch(e.min_width=config.min_width,e.min_height=config.min_width,e.max_width=config.max_width,e.max_height=config.max_height,t.cb_drag=onDrag,t.cb_up=onRelease,config.anim){case OGX.Window.ANIM_LEFT:t.x=!0,t.y=!1,t.limit_x={min:-300,max:0},e.right=!0;break;case OGX.Window.ANIM_RIGHT:t.x=!0,t.y=!1,t.limit_x={min:0,max:300},e.left=!0;break;case OGX.Window.ANIM_TOP:t.x=!1,t.y=!0,t.limit_y={min:-300,max:0},e.bottom=!0;break;case OGX.Window.ANIM_BOTTOM:t.x=!1,t.y=!0,t.limit_y={min:0,max:300},e.top=!0}touch_drag=that.touch.add("Drag",t)}config.resize&&that.setResize(e),config.show&&that.show(),config.scroll&&listenScroll(!0)}this.id=config.id,this.dragable=null,this.resizeable=null,this.status=OGX.Window.CLOSED,this.onFocus=function(){return config.close_on_click_out&&listenBody(!0),config.head&&listenBackIcon(!0),config.icons&&listenIcons(!0),config.drag&&touch_drag.enable(),config.resize&&this.enableResize(),this},this.onBlur=function(){return config.close_on_click_out&&listenBody(!1),config.head&&listenBackIcon(!1),config.icons&&listenIcons(!1),config.drag&&touch_drag.disable(),config.resize&&this.disableResize(),this},this.show=function(t,e,i){return this.visible||(this._show(),config.drag&&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==t&&(t=config.anim),setTimeout((function(){animWindow(!0,t,e,i)}),showto),showto&&(showto=0))),this},this.hide=function(t,e,i){return this.visible&&(this._hide(),config.drag&&touch_drag.disable(),config.resize&&this.disableResize(),listenScroll(!1),-1===[OGX.Window.CLOSED,OGX.Window.CLOSING].indexOf(this.status)&&(this.blur(1),void 0!==t&&!0!==t||(t=config.anim),animWindow(!1,t,e,i))),this},this.resize=function(){var t=getLimitedSize();return container.css({width:t.width,height:t.height}),this.place(),this},this.destroy=function(){config.scroll&&listenScroll(!1),this.touch.wipe()},this.icons=function(t){if(void 0===t)return config.icons;config.icons&&config.icons.length&&listenIcons(!1),config.icons=t,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(t){t?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 t=0,e=new OGX.List;function i(t,e,i,n){var o;if(void 0===e&&(e=null),void 0===i&&(i=!1),void 0===n&&(n=null),"string"==typeof t)o=new Worker(t);else{var a="";if(e){for(var r=0;r1&&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&&(w=w.substr(0,w.indexOf(".")-1)),_=e[G],e[G].hasOwnProperty("node:OML")&&(e[G]=f(e,e[G])),x=!0,y=!0,A=!1,E=!1,w){case"Function":return y=!1,_.parent=t,_.fnc=m,_=g(_,n,i),void OGX.Fonction(_,n,i);case"Uxi":return void e[G].attach(t,m);case"Fork":(S=O(m,e[G]))&&d(S,t,l),y=!1,x=!1;break;case"Html":_.el=m,_.html=e[G].html,(y=p(_))||(_.template=!1);break;case"Template":_.template=v.split(".")[1],_.el=m,y=p(_),v="Html";break;case"Ghost":_.el=m;break;case"Controller":_.id=m,E=!0;break;case"Scroller":N=$(m),_.el=m,_.content=N.html(),N.empty();break;default:-1!==[".","#"].indexOf(m.substr(0,1))?_.el=m:(_.id=m,_.el=t.el[0],_.parent=t)}x&&(_=g(_,n,i)),X=!1,M=!1,y?(r&&_.hasOwnProperty("id")&&(P=r.find("id",_.id.replace(/^#/gi,""),1))&&(M=!0),M?(P.wake(_.el),b=P):b=OGX.Object.create(v,_),t.add(b),X=b):A?(A.blur(),$(m).html(C),A.el=$(m),t.add(A),setTimeout((function(){!t.blured&&l&&A.focus()}),0)):(X=t,"Html"===v&&OGX.HtmlRender(_)),X&&e[G].hasOwnProperty("node:OML")&&!A&&!M&&d(e[G]["node:OML"],X,l),y&&(b.parent=t,"function"==typeof b.construct&&(M||(E?s.push({object:b,data:[i]}):b.construct.apply(b,[i])))),b&&!E&&(y||M)&&!t.blured&&l&&b.enabled&&(b.floating||b.focus()),void 0!==b&&b&&!E&&(a=a.concat(u(b,e[G])))}}}d(t,e),a.length&&function(e){for(var t=0;t'+r.display_date.format(t)+""),r.date&&(e+=''+r.date.format(r.format)+""),r.browse&&(e+=''),i.children(".ogx_calendar_head").children(".ogx_calendar_head_date").html(e)}function b(t){i.children(".ogx_calendar_head").children(".ogx_calendar_head_labels").html(t)}function w(t,e,i,n){if(e.y-1>=0&&e.y-1{e.off_dates=t})),this)},this.noSelection=function(t,e){return void 0===t?r.no_selection:(void 0===e&&(e=!0),r.no_selection=t,e&&v(),this)},OGX.Data.merge(r,s),r.callbacks.select||(r.callbacks.select=a.onSelect),r.callbacks.unselect||(r.callbacks.unselect=a.onUnselect),(i=a.el).addClass("ogx_calendar"),r.date&&(moment.isMoment(r.date)||(r.date=moment(r.date)),r.display_date=r.date.clone()),r.display_date?moment.isMoment(r.display_date)||(r.display_date=moment(r.display_date)):r.display_date=moment(),o=r.layout,c.y=o+1,i.html('
'),T(),G(),e=a.create("GridSwiper",{el:r.el+" .ogx_calendar_body",loop:!0,map:n,start:{x:1,y:o+1},chromeos:r.chromeos,enabled:r.swipe}),O(),b(l[o].labels(r.display_date))},OGX.Calendar.SELECT="CalendarSelect",OGX.Calendar.UNSELECT="CalendarUnselect",OGX.Calendar.BIND=OGX.Calendar.SELECT+" "+OGX.Calendar.UNSELECT,OGX.Calendar.BROWSE="CalendarBrowse",OGX.CalendarLayout={},OGX.CalendarLayout.BASE_LAYOUT=function(t){"use strict";this.off_dates=null,this.labels=function(t){return""},this.html=function(t,e,i,n){return""},this.value=function(){return{value:1,unit:"months"}},this.format=function(){return t.hasOwnProperty("format")?t.format:"YYYY-MM"}},OGX.CalendarLayout.MONTH_DAYS=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="YYYY-MM"),!t.hasOwnProperty("labels")&&(t.labels="ddd"),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){var i="",n=Number(e.format("d")),o=e.clone();n&&o.subtract(n,"day");for(var a=0;a<7;a++)i+=''+o.format(t.labels)+"",o.add(1,"day");return i},this.html=function(t,e,i,n){var o,a=t.format("MM"),r=moment(t.format("YYYY-MM-")+"01").day(),s=moment(t.format("YYYY-MM-")+"01").subtract(r,"days"),l="";n&&(l=n.format("YYYY-MM-DD"));for(var c,d="",u=0;u<35;u++)c="",o=s.format("YYYY-MM-DD"),s.format("MM")!==a&&(c+="ogx_calendar_layout_month_days_offset "),o===moment().format("YYYY-MM-DD")&&(c+="ogx_calendar_layout_month_days_today "),n&&l===o&&(c+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(o)&&(c+="ogx_calendar_layout_off_date "),d+='
'+e(o,i)+"
",s.add(1,"days");return d},this.value=function(){return{value:1,unit:"months"}}},OGX.CalendarLayout.CENTURY_DECADES=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="YYYY"),!t.hasOwnProperty("labels")&&(t.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){return''+(t.labels?e.format(t.labels):100*Math.floor(Number(e.format("YYYY"))/100)+"'s")+""},this.html=function(t,e,i,n){var o,a,r=moment(),s=100*Math.floor(Number(r.format("YYYY"))/100),l=10*Math.floor(Number(r.format("YYYY").substr(2))/10),c=100*Math.floor(Number(t.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 f="",h=0;h<10;h++)a="",s+l===c+(o=10*h)&&(a="ogx_calendar_layout_century_decades_current "),d+u===c+o&&(a+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(c+o)&&(a+="ogx_calendar_layout_off_date "),f+='
'+e(c+o,i)+"
";return f},this.value=function(){return{value:100,unit:"years"}}},OGX.CalendarLayout.CENTURY_YEARS=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="Y"),!t.hasOwnProperty("labels")&&(t.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){return''+(t.labels?e.format(t.labels):100*Math.floor(Number(e.format("YYYY"))/100)+"'s")+""},this.html=function(t,e,i,n){var o,a=moment(),r=100*Math.floor(Number(a.format("YYYY"))/100),s=Number(a.format("YYYY").substr(2)),l=100*Math.floor(Number(t.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="",f=0;f<100;f++)o="",l+f===r+s&&(o+="ogx_calendar_layout_century_years_current "),l+f===c+d&&(o+="ogx_calendar_selected_item"),this.off_dates&&this.off_dates.includes(l+f)&&(o+="ogx_calendar_layout_off_date "),u+='
'+e(l+f+"-01-01",i)+"
";return u},this.value=function(){return{value:100,unit:"years"}}},OGX.CalendarLayout.DECADE_YEARS=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="Y"),!t.hasOwnProperty("labels")&&(t.labels=null),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){return''+(t.labels?e.format(t.labels):10*Math.floor(Number(e.format("YYYY"))/10)+"'s")+""},this.html=function(t,e,i,n){var o,a=10*Math.floor(Number(t.format("YYYY"))/10),r="",s=Number(moment().format("YYYY")),l="";n&&(l=Number(n.format("YYYY")));for(var c=0;c<10;c++)o="",a+c===s&&(o+="ogx_calendar_layout_decade_years_current "),a+c===l&&(o+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(a+c)&&(o+="ogx_calendar_layout_off_date "),r+='
'+e(a+c+"-01-01",i)+"
";return r},this.value=function(){return{value:10,unit:"years"}}},OGX.CalendarLayout.DECADE_MONTHS=function(t){"use strict";OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(t){for(var e=10*Math.floor(Number(t.format("YYYY"))/10),i=Number(String(e).substr(2,2)),n="",o=0;o<10;o++)n+='\''+i+"",i++;return n},this.html=function(t,e,i,n){var o,a,r,s,l=10*Math.floor(Number(t.format("YYYY"))/10),c="",d=moment().format("YYYY-MM");n&&(o=n.format("YYYY-MM"));for(var u=0;u<12;u++){s=u+1;for(var f=0;f<10;f++)a="",(r=l+f+"-"+(s<10?"0"+s:s))===d&&(a="ogx_calendar_layout_decade_months_current "),r===o&&(a+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(r)&&(a+="ogx_calendar_layout_off_date "),moment(r+"-01"),c+='
'+e(r+"-01",i)+"
"}return c},this.value=function(){return{value:10,unit:"years"}},this.format=function(t){return"["+10*Math.floor(Number(t.format("YYYY"))/10)+"'s]"}},OGX.CalendarLayout.YEAR_MONTHS=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="Y"),!t.hasOwnProperty("labels")&&(t.labels="[Months]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){return''+e.format(t.labels)+""},this.html=function(t,e,i,n){var o,a,r=moment().format("YYYY-MM"),s=t.format("YYYY"),l="",c="";n&&(c=n.format("YYYY-MM"));for(var d=1;d<13;d++)o="",s+"-"+(a=d<10?"0"+d:d)===r&&(o+="ogx_calendar_layout_year_months_current "),s+"-"+a===c&&(o+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(s+"-"+a)&&(o+="ogx_calendar_layout_off_date "),l+='
'+e(s+"-"+a+"-01",i)+"
";return l},this.value=function(){return{value:1,unit:"years"}}},OGX.CalendarLayout.YEAR_WEEKS=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="Y"),!t.hasOwnProperty("labels")&&(t.labels="[Weeks]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){return''+e.format(t.labels)+""},this.html=function(t,e,i,n){var o=moment().week(),a=t.format("YYYY"),r=moment().format("YYYY"),s="",l="";n&&(l=n.week(),s=n.format("YYYY"));for(var c,d,u="",f=1;f<53;f++)c="",d=moment().year(a).week(f).format("YYYY-MM-DD"),o===f&&a===r&&(c="ogx_calendar_layout_year_weeks_current "),l===f&&a===s&&(c+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(d)&&(c+="ogx_calendar_layout_off_date "),u+='
'+e(d,i)+"
";return u},this.value=function(){return{value:1,unit:"years"}}},OGX.CalendarLayout.YEAR_DAYS=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="Y"),!t.hasOwnProperty("labels")&&(t.labels="[Nth Day]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){return''+e.format(t.labels)+""},this.html=function(t,e,i,n){var o,a,r,s="",l=t.format("YYYY-MM-DD"),c=moment(t.format("YYYY")+"-01-01"),d="";n&&(d=n.format("YYYY-MM-DD")),a=t.isLeapYear()?366:365;for(var u=0;u'+e(r,i)+"",c.add(1,"days");return s},this.value=function(){return{value:1,unit:"years"}}},OGX.CalendarLayout.MONTH_WEEKS=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="[(]YYYY-MM[)] W"),!t.hasOwnProperty("labels")&&(t.labels="[Nth Week]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){return''+e.format(t.labels)+""},this.html=function(t,e,i,n){var o,a="",r=moment(),s=Number(r.format("YYYY")),l=Number(r.format("w")),c=Number(t.format("YYYY")),d=0,u=0;n&&(d=Number(n.format("YYYY")),u=Number(n.format("w")));a="";for(var f,h=moment(t.format("YYYY-MM-[01]")),g=0;g<5;g++)f="",o=Number(h.format("w")),c===d&&o===u&&(f+="ogx_calendar_selected_item "),c===s&&o===l&&(f+="ogx_calendar_layout_month_weeks_current"),this.off_dates&&this.off_dates.includes(o)&&(f+="ogx_calendar_layout_off_date "),a+='
'+e(h.format("YYYY-MM-DD"),i)+"
",h.add(7,"days");return a},this.value=function(){return{value:1,unit:"months"}}},OGX.CalendarLayout.WEEK_DAYS=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="YYYY-MM (wo [week])"),!t.hasOwnProperty("labels")&&(t.labels="ddd DD"),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){var i="",n=Number(e.format("d")),o=e.clone();n&&o.subtract(n,"day");for(var a=0;a<7;a++)i+=''+o.format(t.labels)+"",o.add(1,"day");return i},this.html=function(t,e,i,n){var o,a,r="",s=t.weekday(),l=t.subtract(s,"days"),c=moment().format("YYYY-MM-DD"),d="";n&&(d=n.format("YYYY-MM-DD"));for(var u=0;u<7;u++)o="",(a=l.format("YYYY-MM-DD"))===c&&(o="ogx_calendar_layout_week_days_current "),a===d&&(o+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(a)&&(o+="ogx_calendar_layout_off_date "),r+='
'+e(a,i)+"
",l.add(1,"days");return r},this.value=function(){return{value:1,unit:"weeks"}}},OGX.CalendarLayout.DAY_HOURS=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="YYYY-MM-DD HH:[00]"),!t.hasOwnProperty("labels")&&(t.labels="[Hours]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){return''+e.format(t.labels)+""},this.html=function(t,e,i,n){var o,a,r="",s=Number(moment().format("HH")),l=t.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 f=0;f<24;f++)a="",f===s&&l===c&&(a="ogx_calendar_layout_days_hours_current "),f===d&&l===u&&(a+="ogx_calendar_selected_item "),this.off_dates&&this.off_dates.includes(l+o+":00")&&(a+="ogx_calendar_layout_off_date "),r+='
'+e(l+o+":00",i)+"
";return r},this.value=function(){return{value:1,unit:"days"}}},OGX.CalendarLayout.DAY_WORK_HOURS=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="YYYY-MM-DD HH:[00]"),!t.hasOwnProperty("labels")&&(t.labels="[Work Hours]"),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){return''+e.format(t.labels)+""},this.html=function(t,e,i,n){i&&void 0!==i?i.hasOwnProperty("start")||(i.start=8,i.end=17):i={start:8,end:17};var o,a,r="",s=Number(moment().format("HH")),l=t.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 f=i.start;f'+e(l+o+":00",i)+"";return r},this.value=function(){return{value:1,unit:"days"}}},OGX.CalendarLayout.DAY=function(t){"use strict";!t.hasOwnProperty("format")&&(t.format="YYYY-MM-DD"),!t.hasOwnProperty("labels")&&(t.labels="dddd DD"),OGX.CalendarLayout.BASE_LAYOUT.call(this,t),this.labels=function(e){return''+e.format(t.labels)+""},this.html=function(t,e,i,n){var o="",a=t.format("YYYY-MM-DD"),r=moment().format("YYYY-MM-DD");return n&&a===n.format("YYYY-MM-DD")&&(o+="ogx_calendar_selected_item "),a===r&&(o+="ogx_calendar_layout_day_current "),this.off_dates&&this.off_dates.includes(a)&&(o+="ogx_calendar_layout_off_date "),'
'+e(a,i)+"
"},this.value=function(){return{value:1,unit:"days"}},this.select=function(t){}},OGX.CalendarEngine={},OGX.CalendarEngine.CELL_VALUE=function(t,e){var i=moment(t);return e.hasOwnProperty("css")||(e.css=""),'
'+i.format(e.format)+"
"},OGX.CalendarEngine.DAY_NUMBER=function(t,e){var i=moment(t);return OGX.CalendarEngine.CELL_VALUE(i,{format:"DD",css:"ogx_calendar_engine_day_number"})},OGX.CalendarEngine.WEEK_NUMBER=function(t,e){return'
'+moment(t).week()+"
"},OGX.CalendarEngine.MONTH_NUMBER=function(t,e){return OGX.CalendarEngine.CELL_VALUE(t,{format:"MM",css:"ogx_calendar_engine_month_number"})},OGX.CalendarEngine.YEAR_NUMBER=function(t,e){return OGX.CalendarEngine.CELL_VALUE(t,{format:"YY",css:"ogx_calendar_engine_year_number"})},OGX.CalendarEngine.DECADE_NUMBER=function(t){return'
'+String(t).substr(2)+"'s
"},require("Carousel","Uxi","Placeholder","Touch"),OGX.Carousel=function(t){construct(this,"Carousel");var e,i,n,o,a,r,s=this,l=t,c={min_x:100,anim:!0,drag:!0,drag_left:!0,drag_right:!0,dots:!1,css:!1,index:0,capture:!1,callbacks:{change:null},display:!1,displays:!1,as:"item",list:null},d={position:"bottom"},u=!1,f=0,h=0,g=new OGX.List,_="ogx_carousel",p=null,m=null;function v(t){if(void 0!==t&&g[t]&&g[t].instance){var e=s.find(g[t].instance._NAME_,g[t].instance.id);e&&e.blur(2)}}function y(t){if(void 0!==t&&g[t]&&g[t].instance){var e=s.find(g[t].instance._NAME_,g[t].instance.id);e&&s.enabled&&e.focus(1)}}function x(t){i.off("transitionend"),i.removeClass(_+"_anim")}function O(t){if(t.dirX){if(-1===t.dirX&&!l.drag_right)return;if(1===t.dirX&&!l.drag_left)return}if(t.distX>t.distY){var e=r*n*-1+t.distX*t.dirX;e<=0&&e>-1*(i.width()-s.el.width())&&i.css({transform:"translate3d("+e+"px, 0, 0)"})}}function b(t){if(t.distX>l.min_x){var i=r+-1*t.dirX;i>=0&&i'),t.push("."+_+'[data-ogx-id="'+s.id+'"] > .'+_+"_views > ."+_+'_view[data-ogx-panel-id="'+f+'"]'),f++;i.css("width",100*h+"%"),s.placeholders(l,t),e.trigger(OGX.Carousel.READY)}this.construct=function(){T(),l.index&&this.showPanel(l.index,!1),l.dots&&a.bind("dots",s)},this.onFocus=function(){l.drag&&m.enable(),setTimeout((function(){for(var t=0;t0&&this.showPanel(r-1),this},this.next=function(){return r+1'+t+""),i.css("width",Math.round(100*h)+"%"),i.children("."+_+"_view").css("width",100/h+"%"),++f-1}(),c="."+_+'[data-ogx-id="'+this.id+'"] > .'+_+"_views > ."+_+'_view[data-ogx-panel-id="'+l+'"]',d={},u=c;if(t.hasOwnProperty("_NAME_"))t.detach(),t.attach(this,c),o&&this.showPanel(h-1,a);else{for(var g in t){u+=":"+g.split(":")[1],d[u]=t[g];break}var p=null;setTimeout((function(){s.observe(!0,{childList:!0,subtree:!0},(function(){s.observe(!1),p&&clearTimeout(p),p=setTimeout(T,20),o&&(s.showPanel(h-1,a),r?r():e.trigger(OGX.Carousel.ADDED,h))})),OGX.OML.render(s,d,n)}),0)}return this},this.removeNode=function(t,e){void 0===e&&(e=t,t=null);for(var i=!1,n=0;n=0&&tt?i.children("."+_+"_view:eq("+(n-1)+")").after(o):i.children("."+_+"_view:eq("+n+")").before(o);var a=100/h*(-1*n);return i.removeClass(_+"_anim"),i.css({transform:"translate3d("+a+"%, 0, 0)"}),r=n,setTimeout(T,0),s.onChange(r),e.trigger(OGX.Carousel.CHANGE,r),this},this.removePanel=function(t,n){if(void 0===n&&(n=!0),t>=0&&t=r?t--:t=--r,t<0&&(t=0),r=t,s.showPanel(t,!1,!0),e.trigger(OGX.Carousel.REMOVED,h),o}return!1},this.empty=function(){return this.clear(),i.empty(),i.removeClass(_+"_anim").css("width","100%"),i.css({transform:"translate3d(0%, 0, 0)"}),h=0,g=new OGX.List,l.index=r=0,l["node:OML"]=[],this},this.render=function(t,e){return l["node:OML"]=t,h=l["node:OML"].length,C(),OGX.OML.render(this,l["node:OML"],e),this},this.destroy=function(){this.touch.wipe()},function(){if(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)),p=new OGX.Display(l),r=l.index,e=s.el,n=Math.floor(e.innerWidth()),l.hasOwnProperty("node:OML")&&l["node:OML"].length)h=l["node:OML"].length;else if(l.list&&l.list.length){for(var t,i,o=[],a=0;a .ogx_carousel_views > .ogx_carousel_view[data-ogx-panel-id="'+a+'"]',l.list[a],l.as),o.push(t);else{i=p.html(l.list[a]);var u='{"default:Html":{"html":'+JSON.stringify(i)+"}}";t=JSON.parse(u),o.push(t)}l["node:OML"]=o,h=l["node:OML"].length}}(),function(){e.addClass(_);var t="";l.dots&&"top"===l.dots.position&&(t+=''),t+='
',l.dots&&"bottom"===l.dots.position&&(t+=''),e.append(t),(i=e.find("."+_+"_views").first()).css({transform:"translate3d("+100/h*(-1*r)+"%, 0, 0)"})}(),l.dots&&(a=s.create("Dots",{el:"."+_+'[data-ogx-id="'+s.id+'"] > .carousel_dots',total:h})),C(),m=s.touch.add("Swipe",{x:!0,cb_down:x,cb_swipe:O,cb_up:b,capture:l.capture,state:"manual"}),l.drag?m.enable():s.drag(!1)},OGX.Carousel.READY="CarouselReady",OGX.Carousel.CHANGE="CarouselChange",OGX.Carousel.ADDED="CarouselAdded",OGX.Carousel.REMOVED="CarouselRemoved",OGX.Color={},OGX.Color.hexToRgb=function(t){"use strict";t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,i,n){return e+e+i+i+n+n}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]:null},OGX.Color.rgbToHex=function(t,e,i){"use strict";var n,o,a;arguments.length>1&&(t=t+", "+e+", "+i),"object"==typeof t&&(t=Array.isArray(t)?t.join(","):t.r+" "+t.g+" "+t.b);var r=/(\d+)[ ,]*(\d+)[ ,]*(\d+)/g,s=r.exec(t);return s&&(s.shift(),n=Number(s[0]),o=Number(s[1]),a=Number(s[2])),"#"+((1<<24)+(n<<16)+(o<<8)+a).toString(16).slice(1)},OGX.Color.rgbToHsl=function(t,e,i){"use strict";var n,o,a;arguments.length>1&&(t=t+", "+e+", "+i),"object"==typeof t&&(t=Array.isArray(t)?t.join(","):t.r+" "+t.g+" "+t.b);var r=/(\d+)[ ,]*(\d+)[ ,]*(\d+)/g,s=r.exec(t);if(s){s.shift(),n=s[0],o=s[1],a=s[2],n/=255,o/=255,a/=255;var l,c,d=Math.max(n,o,a),u=Math.min(n,o,a),f=(d+u)/2;if(d===u)l=c=0;else{var h=d-u;switch(c=f>.5?h/(2-d-u):h/(d+u),d){case n:l=(o-a)/h+(o1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t},c=i<.5?i*(1+e):i+e-i*e,d=2*i-c;a=l(d,c,t+1/3),r=l(d,c,t),s=l(d,c,t-1/3)}return[Math.round(255*a),Math.round(255*r),Math.round(255*s)]},OGX.Color.formatHex=function(t){return"#"===t.slice(0,1)&&(t=t.slice(1)),t.length>3||t.split("").map((function(t){return t+t})),"#"+t},require("Container","Uxi"),OGX.Container=function(t){construct(this,"Container");var e=this,i={tabs:!0,carousel:{enabled:!0},enabled:!0,reorder:!0,anim:!0,flatten:!1,chromeos:!1,index:0,dots:!1},n=t,o="normal",a=0;function r(t){t?(e.tabs.el.on(OGX.Tabs.SELECT,(function(t,i){var n=e.tabs.index();e.carousel.val(n),e.el.trigger(OGX.Container.CHANGE,n)})),e.tabs.el.on(OGX.Tabs.REMOVE,(function(){})),e.tabs.el.on(OGX.Tabs.REORDER,(function(t,i){e.carousel.swapPanels(i.from,i.to)})),e.tabs.el.on(OGX.Tabs.ADD,(function(){})),e.carousel.el.on(OGX.Carousel.CHANGE,(function(t,i){e.tabs.index(i),e.el.trigger(OGX.Container.CHANGE,i)}))):(e.tabs.el.off(OGX.Tabs.SELECT),e.tabs.el.off(OGX.Tabs.REMOVE),e.tabs.el.off(OGX.Tabs.REORDER),e.tabs.el.off(OGX.Tabs.ADD),e.carousel.el.off(OGX.Carousel.CHANGE)),s(t)}function s(t){t?e.tabs.el.on(OGX.Tabs.REMOVE,(function(t,i){s(!1),"Popup"===e.parent._NAME_?app.ungroupPopup(e.parent,i.index,i.label,i.x,i.y):e.carousel.removeNode(e.carousel.nodes[i.index].id),setTimeout((function(){s(!0)}),200)})):e.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(t,e){if(arguments.length||this._show(),this.carousel&&"normal"===o){var i=this.carousel.getNodeIndex(t,e);i&&(this.carousel.val(i.index),n.tabs&&this.tabs.index(i.index))}},this.index=function(t){return this.carousel&&"normal"===o&&(this.carousel.val(t),n.tabs&&this.tabs.index(t)),this},this.onFocus=function(){return n.tabs&&this.carousel&&(this.tabs.onFocus(),r(!0)),this},this.onBlur=function(){return n.tabs&&this.carousel&&(this.tabs.onBlur(),r(!1)),this},this.resize=function(){var t,e,i;return n.flatten&&(this.carousel&&"flattened"!==o&&this.el.width()>=n.flatten?(o="flattened",n.tabs&&(this.tabs.blur(),this.tabs.hide()),this.carousel.blur(),a=(t=this.carousel.el.children(".ogx_carousel_views"),e=t[0].style.transform,i=/translate3d\(([0-9px%,\.\- ]+)\)/,e=(e=e.match(i))[1].split(","))[0],this.carousel.el.children(".ogx_carousel_views").addClass("ogx_container_flattened").css("transform","translate3d(0px, 0px, 0px)")):this.carousel&&"flattened"===o&&this.el.width()';e.html(i)}this.onFocus=function(){return n.clickable&&c(!0),this},this.onBlur=function(){return n.clickable&&c(!1),this},this.bind=function(t,e){return!(a.hasOwnProperty(t)||!e.hasOwnProperty("_NAME_"))&&function(t,e){switch(a[t]=e,e._NAME_){case"Carousel":n.total=e.panels().length,n.current=e.val(),e.el.on(OGX.Carousel.CHANGE,s),e.el.on(OGX.Carousel.ADDED+" "+OGX.Carousel.REMOVED,l)}return!0}(t,e)},this.unbind=function(t){return!!a.hasOwnProperty(t)&&r(t)},this.select=function(t){e.find(".ogx_dots_selected").removeClass("ogx_dots_selected"),e.children(".ogx_dots_item:eq("+t+")").children(".ogx_dots_gfx").first().addClass("ogx_dots_selected"),n.current=t},this.onSelect=function(){},this.destroy=function(){!function(){for(var t in a)r(t)}()},OGX.Data.merge(n,o),n.callbacks.select||(n.callbacks.select=i.onSelect),(e=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(t,e,i){if(display.hasOML()){var n,o,a=toDataId(i[e]),r=display.oml('.ogx_dynamic_list[data-ogx-id="'+that.id+'"] > .ogx_dynamic_list_item[data-ogx-id='+a+"]",i,config.as);$('.ogx_dynamic_list[data-ogx-id="'+that.id+'"] > .ogx_dynamic_list_item[data-ogx-id='+a+"]").find(".ogx_uxi").each((function(t,e){n=$(e).data("ogx-id"),(o=that.cfind(!1,n,1))&&that.find(o._NAME_,o.id,"remove")})),OGX.OML.render(that,r,i)}else{var s="";selection.length&&selection.find(e,i[e],1)&&(s="ogx_dynamic_list_selected_item "),t.attr("class","").addClass("ogx_dynamic_list_item "+s+display.css(i)),t.html(display.html(i))}}function render(){var t=getWorkList(),e=selection;isFiltered&&(selection.resetFilters(),selection.setFilters(config.list.getFilters()),(e=selection.filter()).length!==selection.length&&(e.length?container.trigger(OGX.DynamicList.SELECT_FILTERED,e):container.trigger(OGX.DynamicList.SELECT_UNFILTERED,selection)));for(var i,n,o,a="",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.onFocus=function(t){return void 0===t&&(t=!1),(t||config.mode!==OGX.DynamicList.STATIC)&&(listenItems(!0),(config.reorder||config.swipe)&&(listenTouch(!0),config.swipe&&listenTrans(!0))),this},this.onBlur=function(t){return void 0===t&&(t=!1),(t||config.mode!==OGX.DynamicList.STATIC)&&(listenItems(!1),(config.reorder||config.swipe)&&(listenTouch(!1),config.swipe&&listenTrans(!1))),this},this.bindFilter=function(t,e,i){void 0!==i&&(config.list.removeFilter(t),config.list.addFilter(t,e,i)),config.list.getFilters()&&(filtered=config.list.filter(),isFiltered=!0),setTimeout(render,0)},this.unbindFilter=function(t){return config.list.removeFilter(t),filtered=config.list.filter(),isFiltered=!0,setTimeout(render,0),this},this.bindValue=function(){return this.getSelection()},this.destroy=function(){!0===config.scope&&listenScope(!1),this.clearBinds(),container.empty(),container.removeClass("ogx_dynamic_list")},this.val=function(t,e,i){if(void 0===t){if(!config.key){var n=JSON.parse(JSON.stringify(config.list));return clearIds(OGX.List(n))}return config.list}var o;void 0===e&&(e=!1),void 0===i&&(i=!0),t.hasOwnProperty("insert")||(t=new OGX.List(t)),this.resetSelection(),e||(o=config.list.getFilters()),config.list=t,config.key&&key!==key_default||(key_id=1,key=key_default,t=JSON.parse(JSON.stringify(t)),forceIds()),!e&&Object.keys(o).length?(config.list.setFilters(o),setTimeout(this.filter,0)):i?setTimeout(render,0):render()},this.scope=function(t){return"undefined"!=typeof __script&&"string"==typeof config.scope?(config.scope=t,void this.render()):config.scope},this.onSelect=function(t){},this.onUnselect=function(t){},this.getFilteredList=function(){if(isFiltered){if(!config.key){var t=JSON.parse(JSON.stringify(filtered));return clearIds(OGX.List(t))}return filtered}return!1},this.display=function(t){return void 0===t?config.display:display.val(t)},this.key=function(t){if(void 0===t)return t;config.key=t,config.key||(key=key_default)},this.mode=function(t){return void 0===t?config.mode:(config.mode!==t&&(config.mode===OGX.DynamicList.STATIC?this.onFocus(!0):t===OGX.DynamicList.STATIC&&this.onBlur(!0),config.mode=t),this)},this.noSelection=function(t,e){return 1===arguments.length?"object"==typeof t?void(config.no_selection=t):void(config.no_selection.enabled=t):2===arguments.length?(config.no_selection.enabled=!0,config.no_selection.prop=t,void(config.no_selection.val=e)):config.no_selection},this.order=function(t,e){return config.list.order(t,e),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(t,e,i){return config.list.addFilter(t,e,i)},this.removeFilter=function(t,e,i){return config.list.removeFilter(t,e,i)},this.resetFilters=function(){return config.list.resetFilters()},this.getFilters=function(){return config.list.getFilters()},this.insert=function(t,e){if(!Array.isArray(t)){config.key||(t[key]=key_id++);var i=!1,n=!0;if(isFiltered){var o=new OGX.List(t);o.setFilters(config.list.getFilters()),0===o.filter().length?n=!1:filtered.push(t)}var a=toDataId(t[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,o=new OGX.List,a=!1;function r(e,i){if(!a){var o,r=n.find("el",i,1);if(r&&r.config.change_cb){for(var s in r.fields)if(r.fields[s].intv)return;var 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(o=JSON.stringify(c),!r.diff||r.val!==o){var f;if(r.val=o,r.config.validate){f={obj:c,form:i,valid:!1};var h=t.validate(r.form);!0===h?f.valid=!0:(f.valid=!1,f.error=h)}else f=c;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(e){var i={el:e.el,config:e,field:$(e.el),intv:!1};i.name=i.field.attr("name"),i.val=i.field.val(),i.field.val(i.val),e.pattern&&i.field.attr("pattern",e.pattern),n.insert(i),$(document).on("input change",i.el,(function(t){if(!a){var e=$(this).val();if(!i.config.diff||i.config.diff&&e!==i.val){if(i.config.input_cb){var n={value:null,obj:{},el:null};e=l(i.config.type,e),n.el=i.field[0],n.value=e,n.property=i.name,n.obj[i.name]=e,i.config.input_cb(n,i.config.params)}i.intv&&clearTimeout(i.intv),i.intv=setTimeout((function(){!function(t){var e=$(t.el).val();if(t.val=e,t.config.change_cb){var i={value:null,obj:{},el:null};e=l(t.config.type,e),i.el=t.field[0],i.property=t.name,i.value=e,i.obj[i.property]=e,t.config.validate&&(i.valid=i.el.checkValidity()),t.config.change_cb(i,t.config.params)}}(i)}),i.config.wait)}}})),e.multiline||$(document).on("keydown",i.el,(function(t){var e=$(this);if(void 0!==t.which&&void 0!==t.key){if(!a){if(i.config.mask&&8===t.which||46===t.which){var n=e[0].selectionStart,o=e.val();return o=8===t.which?o.substr(0,n-1):o.substr(0,n),e.val(o),!1}if(8!==t.which&&13!==t.which&&1===t.key.length){var r=t.key;if(13!==t.which&&i.config.mask){if((o=e.val()).length>=i.config.mask.length)return t.preventDefault(),t.stopImmediatePropagation(),!1;for(var s=i.config.mask,c=0;c1)return e.config.autocomplete?void 0:(t.preventDefault(),t.stopImmediatePropagation(),!1);if(1===n.length&&-1!==e.keys.indexOf(t.which)&&-1===t.which.indexOf(i))return t.preventDefault(),t.stopImmediatePropagation(),!1;if(e.config.multiline&&13===t.keyCode)return!1;if(e.config.allowed&&!n.match(e.config.allowed))return t.preventDefault(),t.stopImmediatePropagation(),!1;if(e.config.forbidden&&n.match(e.config.forbidden))return t.preventDefault(),t.stopImmediatePropagation(),!1;if($(t.originalEvent.target)[e.content]().length>=e.config.max)return t.preventDefault(),t.stopImmediatePropagation(),!1}})),$(document).on("paste",e.el,(function(t){if(!e.config.paste)return t.preventDefault(),t.stopImmediatePropagation(),!1;var i=t.originalEvent.clipboardData.getData("Text");return e.config.forbidden&&i.match(e.config.forbidden)?(t.preventDefault(),t.stopImmediatePropagation(),!1):void 0})),o.insert(e)}(t),!0},this.unrestrictField=function(t){var e=o.find("el",t,1);return!!e&&($(document).off("textInput keydown",e.el),$(document).off("paste",e.el),o.findDelete("el",t,1),!0)},this.toObj=function(t){return d(t)},this.populate=function(t,e,i){var n,o,a;void 0===i&&(i=null),$(t).find("*[name]").each((function(t,r){n=r.getAttribute("name"),a=!1,"string"!=typeof(a=OGX.Data.eval(e,n))&&(a=JSON.stringify(a)),void 0!==a&&(i&&i.hasOwnProperty(n)&&"function"==typeof i[n]&&(a=i[n](a)),(o=$(r)).val(a),r.hasAttribute("type")&&"hidden"===o.attr("type")&&o.trigger("change"))})),setTimeout(c,0)},this.validate=function(t){var i,n=$(t),o=e.elem_types,a=[];return n.find(o.join(",")).each((function(t,e){"submit"!==(i=$(e)).attr("type")&&(e.checkValidity()||a.push(i))})),!a.length||a}},OGX.Form=new OGX.Form,OGX.Form.fromObject=function(t,e,i,n){var o={el:e.selector+" "+i,data:t,fullpath:!1};return OGX.Data.merge(o,n),e.create("FormInstance",o)},require("FormInstance","Uxi","Placeholder"),OGX.FormInstance=function(__config){construct(this,"FormInstance");var that=this,config_defaults={fullpath:!1},config=OGX.Data.merge(__config,OGX.Form.defaults,!1,!0);function render(){var html="",oml='{"default:Html":{"html": {{$html}}, "node:OML": {{$oml}} }}',render_oml=!1,row,nodes=[];function cycle(__o,__path){for(var a in __o){var t=typeof __o[a],p;switch(p=__path?__path+"."+a:a,t){case"object":if(Array.isArray(__o[a]))if(["string","number","boolean"].includes(typeof __o[a][0]))row=genRow("array",a,JSON.stringify(__o[a])),html+=row.html,row.oml&&(nodes.push(row.oml),render_oml=!0);else for(var i=0;i<__o[a].length;i++)cycle(__o[a][i],__path?__path+"."+a+"["+i+"]":a+"["+i+"]");else cycle(__o[a],__path?__path+"."+a:a);break;case"string":case"number":case"boolean":var pattern="",required=!1,readonly=!1,oo;if(config.hasOwnProperty("fields")){try{oo=eval("config.fields."+p)}catch(t){}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(t,e,i,n,o,a){var r={html:"",oml:null},s=config.types[t],l="",c="",d="";void 0!==n&&n&&(l="required",c='pattern="'+o+'"'),void 0!==a&&a&&(d="readonly");var u=e;return config.fullpath||(u=e.split(".").pop()),r.html=OGX.Templater.make(s.html,{name:u,prop:e,val:i,required:l,pattern:c,readonly:d}),r.html=OGX.Templater.make(OGX.Form.defaults.templates.row,{html:r.html,name:u,prop:e}),s.hasOwnProperty("oml")&&(r.oml=OGX.Templater.make(s.oml,{name:u,prop:e,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.destroy=function(){OGX.Form.unbindForm(that.selector)},this.onChange=function(t){},this.onSubmit=function(t){},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(t){"use strict";var e=this;void 0===t&&(t={});var i,n,o,a,r=OGX.Data.merge(t,{map:null,markers:[],icon:"",browser_loc:null});function s(t,i){for(var n,o={},a=0;a1&&(t.city===i[1]?t.vicinity=t.vicinity.replace(i[0],""):t.city?t.city.length>i[1].length&&(t.city=i[1],t.vicinity=t.vicinity.replace(i[0],"")):t.city=i[1]),e)for(var n in t)-1===e.indexOf(n)&&delete t[n];return t},"undefined"!=typeof google&&void 0!==google.maps||$(document).trigger(OGX.Geo.ERROR_GMAP)},OGX.Geo.ERROR="GEO_error",OGX.Geo.ERROR_GMAP="GEO_GMAP_ERROR",OGX.Geo.TRAVEL_MODE_CAR="DRIVING",OGX.Geo.TRAVEL_MODE_TRANSIT="TRANSIT",OGX.Geo.TRAVEL_MODE_WALK="WALKING",OGX.Geo.TRAVEL_MODE_BIKE="BICYCLING",OGX.Geo.BROWSER_LOC_SUCCESS="GEO_BROWSER_LOC_SUCCESS",OGX.Geo.BROWSER_LOC_ERROR="GEO_BROWSER_LOC_ERROR",OGX.Geo.MAP_LOADED="GEO_MAP_LOADED",require("Ghost","Uxi"),OGX.Ghost=function(t){construct(this,"Ghost"),this.el=$(t.el),css="ogx_ghost",this.el.addClass(css),delete css},require("GridSwiper","Uxi","Touch"),OGX.GridSwiper=function(t){construct(this,"GridSwiper");var e,i,n,o,a,r,s,l,c,d,u,f,h=this,g=t,_={map:[[!0,!0,!0],[!0,!0,!0],[!0,!0,!0]],axis:{x:!0,y:!0},loop:!0,start:!1,chromeos:!1,capture:!1,callbacks:{up:null,down:null,left:null,right:null}},p=!1,m={x:null,y:null},v={x:0,y:0},y=".ogx_grid_swiper_cell",x=!1,O=!1,b=!1,w={x:0,y:0},G={x:0,y:0},X=(new Date).getTime()+Math.round(1e3*Math.random()),T=[];function C(t){t?e.on(h.touch.down,D):e.off(h.touch.down,D)}function D(t){p=!1,a=0,r=0,s=0,l=0,t=Y(t),m.x=t.pageX,m.y=t.pageY,x=!0,k(!0)}function E(t){t?$("body").on(h.touch.up,S):$("body").off(h.touch.up,S)}function S(t){x&&(x=!1,k(!1),!L()&&b&&(e.trigger(OGX.GridSwiper.SWIPE_END),O=!1,b=!1))}function L(t,e,a){var r,s;return void 0===t&&(t=0),void 0===e&&(e=0),void 0===a&&(a=!0),a&&A(!0),i.addClass("ogx_grid_swiper_anim"),v=P(i),r=-1*Math.round((v.x+t)/n)*n*-1,s=-1*Math.round((v.y+e)/o)*o*-1,i.css({transform:"translate3d("+r+"px, "+s+"px, 0px)"}),v.x-r||v.y-s}function k(t){t?(N(!0),e.on(h.touch.move,M)):(N(!1),e.off(h.touch.move,M))}function M(t){t=Y(t),g.capture&&(t.preventDefault(),t.stopImmediatePropagation()),a=0,r=0,s=0,l=0,p||(g.axis.x&&Math.abs(t.pageX-m.x)>Math.abs(t.pageY-m.y)?p="x":g.axis.y&&Math.abs(t.pageX-m.x)0?1:-1):g.axis.y&&"y"===p&&(r=Math.abs(t.pageY-m.y),l=t.pageY-m.y>0?1:-1))}function N(t){t?f||(O=!1,f=setInterval(I,10)):f&&(clearInterval(f),f=null)}function I(){if((a||r)&&(O||(b=!0,e.trigger(OGX.GridSwiper.SWIPE_START)),O=!0),g.axis.x&&"x"===p&&a&&s&&a<=n){if(!g.loop&&(w.x+-1*s<0||w.x+-1*s>g.map[0].length-1))return;if((c=(w.x+-1*s)%g.map[0].length)<0&&(c=Math.abs(g.map[0].length+c)),!1===g.map[G.y][c])return;u=a*s,i.css({transform:"translate3d("+(-1*w.x*n+u)+"px, "+v.y+"px, 0px)"})}else if(g.axis.y&&"y"===p&&r&&l&&r<=o){if(!g.loop&&(w.y+-1*l<0||w.y+-1*l>g.map.length-1))return;if((d=(w.y+-1*l)%g.map.length)<0&&(d=Math.abs(g.map.length+d)),!1===g.map[d][G.x])return;u=r*l,i.css({transform:"translate3d("+v.x+"px, "+(-1*w.y*o+u)+"px, 0px)"})}}function A(t){t?(i.off("transitionend"),i.on("transitionend",(function(){O&&b&&(e.trigger(OGX.GridSwiper.SWIPE_END),O=!1,b=!1),i.off("transitionend"),i.removeClass("ogx_grid_swiper_anim"),v=P(i);var t={x:null,y:null};t.x=-1*Math.round(v.x/n),t.y=-1*Math.round(v.y/o),w.x!==t.x?(s=w.x>t.x?1:-1,w.x=t.x,G.x=R(w).x,-1===s?(i.children(y+"[data-y="+(w.y-1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-y="+(w.y+1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-x="+(w.x-2)+"][data-y="+w.y+"]").attr("data-x",w.x+1).css("left",(w.x+1)*n),h.onLeft({cell:G,point:w}),e.trigger(OGX.GridSwiper.SWIPE_LEFT,{cell:G,point:w}),W(T=[{x:w.x+1,y:w.y},{x:w.x,y:w.y-1},{x:w.x,y:w.y+1}]),F()):(i.children(y+"[data-y="+(w.y-1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-y="+(w.y+1)+"]").attr("data-x",w.x).css("left",w.x*n),i.children(y+"[data-x="+(w.x+2)+"][data-y="+w.y+"]").attr("data-x",w.x-1).css("left",(w.x-1)*n),h.onRight({cell:G,point:w}),e.trigger(OGX.GridSwiper.SWIPE_RIGHT,{cell:G,point:w}),W(T=[{x:w.x-1,y:w.y},{x:w.x,y:w.y-1},{x:w.x,y:w.y+1}]),F())):w.y!==t.y&&(l=w.y>t.y?1:-1,w.y=t.y,G.y=R(w).y,-1===l?(i.children(y+"[data-x="+(w.x-1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-x="+(w.x+1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-y="+(w.y-2)+"][data-x="+w.x+"]").attr("data-y",w.y+1).css("top",(w.y+1)*o),h.onUp({cell:G,point:w}),e.trigger(OGX.GridSwiper.SWIPE_UP,{cell:G,point:w}),W(T=[{x:w.x,y:w.y+1},{x:w.x-1,y:w.y},{x:w.x+1,y:w.y}]),F()):(i.children(y+"[data-x="+(w.x-1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-x="+(w.x+1)+"]").attr("data-y",w.y).css("top",w.y*o),i.children(y+"[data-y="+(w.y+2)+"][data-x="+w.x+"]").attr("data-y",w.y-1).css("top",(w.y-1)*o),h.onDown({cell:G,point:w}),e.trigger(OGX.GridSwiper.SWIPE_DOWN,{cell:G,point:w}),W(T=[{x:w.x,y:w.y-1},{x:w.x-1,y:w.y},{x:w.x+1,y:w.y}]),F())),p=0}))):i.off("transitionend")}function P(t,e){var i=t.css("transform");return"none"===i?0:(i=(i=(i=i.substr(7)).substr(0,i.length-1)).split(","),{x:Number(i[4]),y:Number(i[5])})}function Y(t){return t.hasOwnProperty("originalEvent")&&void 0!==t.originalEvent.changedTouches?t.originalEvent.changedTouches[0]:t}function R(t){var e={x:0,y:0};return e.x=t.x%g.map[0].length,e.x<0&&(e.x=Math.abs(g.map[0].length+e.x)),e.y=t.y%g.map.length,e.y<0&&(e.y=Math.abs(g.map.length+e.y)),e}function W(t){for(var e,i={x:null,y:null},n=0;ng.map.length-1){if(!g.loop)return!1;i.y=R(t[n]).y}else i.y=t[n].y;if(t[n].x<0||t[n].x>g.map[0].length-1){if(!g.loop)return!1;i.x=R(t[n]).x}else i.x=t[n].x;e=g.map[i.y][i.x],H(t[n],e),h.onRender(i)}}function H(t,e){var n=!1;switch(typeof e){case"string":i.children(y+'[data-x="'+t.x+'"][data-y="'+t.y+'"]').children(y+"_content").first().html(e);break;case"function":(n=e(t,R(t),{x:t.x-w.x,y:t.y-w.y},i.children(y+'[data-x="'+t.x+'"][data-y="'+t.y+'"]').children(y+"_content").first()[0]))&&i.children(y+'[data-x="'+t.x+'"][data-y="'+t.y+'"]').children(y+"_content").first().html(n);break;case"object":var o='.ogx_grid_swiper[data-ogx-id="'+X+'"] > .ogx_grid_swiper_container > '+y+'[data-x="'+t.x+'"][data-y="'+t.y+'"] > '+y+"_content",a=R(t);for(var r in e){e[r].id="cell_"+a.x+"_"+a.y;break}e=OGX.OML.rename(e,o);var s=h.nodes.find("id","cell_"+a.x+"_"+a.y,1);s&&h.remove(s._NAME_,s.id),$(o).empty(),OGX.OML.render(h,e,{abs:t,rel:R(t)}),F()}}function F(){for(var t=0;t',c=-1*t,d=-1*a-o;g.axis.y&&(l+='
',l+='
'),l+='
',g.axis.x&&(l+='
',l+='
'),l+="
",e.html(l),i=e.children(".ogx_grid_swiper_container").first(),w.x=g.start.x,w.y=g.start.y,v.x=t,v.y=a,G.x=g.start.x,G.y=g.start.y}this.onFocus=function(){return C(!0),E(!0),F(),this},this.onBlur=function(){return C(!1),E(!1),N(!1),this},this.focus=function(){return this.blured&&(this.blured=!1,this.onFocus()),this},this.resize=function(){A(!1),i.removeClass("ogx_grid_swiper_anim"),n=e.width(),o=e.height();var t=w.x*-n,a=w.y*-o;i.children(y+"[data-y="+(w.y-1)+"]").css({top:(w.y-1)*o,left:w.x*n}),i.children(y+"[data-y="+w.y+"]").css({top:w.y*o,left:w.x*n}),i.children(y+"[data-y="+(w.y+1)+"]").css({top:(w.y+1)*o,left:w.x*n}),i.children(y+"[data-x="+(w.x-1)+"]").css({top:w.y*o,left:(w.x-1)*n}),i.children(y+"[data-x="+(w.x+1)+"]").css({top:w.y*o,left:(w.x+1)*n}),i.css("transform","translate3d("+t+"px, "+a+"px, 0px"),k(!1),setTimeout((function(){L(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(t,e){return g.map=t,void 0!==e&&(g.start=e),w={x:0,y:0},G={x:0,y:0},m={x:null,y:null},v={x:0,y:0},U(),B(),z(),this},this.setMapCell=function(t,e){return g.map[t.y]||(g.map[t.y]=[]),g.map[t.y][t.x]=e,this},this.getMapCell=function(t){return t.y>0&&g.map.length0&&g.map[t.y].length0){var i=t.data("id");t.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"),a=!1,(e=r.el).addClass("ogx_grouped_list"),g()},OGX.GroupedList.SELECT="GroupedListSelect",OGX.GroupedList.BIND=OGX.GroupedList.SELECT,require("Html","Uxi","Placeholder"),OGX.Html=function(t){construct(this,"Html"),void 0!==t&&t&&(this.el=$(t.el),OGX.HtmlRender(t))},OGX.HtmlRender=function(t){var e=$(t.el),i=new OGX.Display(t);data=!1,t.data&&Object.keys(t.data).length&&(data=t.data),e.html(i.html(data)),t.css&&e.addClass(i.css(data)),t.hasOwnProperty("id")&&t.id&&"#"===t.id.substr(0,1)&&e.attr("id",t.id.substr(1))},require("Iceberg","Uxi","Touch"),OGX.Iceberg=function(t){construct(this,"Iceberg");var e,i,n,o,a,r,s=this,l={left:0,right:0,top:0,bottom:0,min:50,drag:!0,flatten:!1,capture:!0,"node:OML":{},callbacks:{up:null,down:null,left:null,right:null,restore:null}},c=t,d=!1,u="normal",f="main",h={left:null,main:null,right:null,top:null,bottom:null},g=[0,0,0],_=0,p=0,m=0,v=0;function y(t){for(var e in h)h[e]&&h[e].instance&&(t===e?h[e].instance.focus():h[e].instance.blur())}function x(){d.hasClass("ogx_iceberg_anim")||(d.off("transitionend"),g=G(d))}function O(t){var e=0;return t.dirY&&t.distY>t.distX&&(e=1),e}function b(t){c.drag&&t.dist&&(!(n=O(t))&&["main","left","right"].includes(f)?t.dirX&&t.distX&&(e=g[0]+t.distX*t.dirX)<=p&&e>=_&&d.css({transform:"translate3d("+e+"px, 0, 0)"}):["main","top","bottom"].includes(f)&&t.dirY&&t.distY&&(i=g[1]+t.distY*t.dirY)<=v&&i>=m&&d.css({transform:"translate3d(0, "+i+"px, 0)"}))}function w(t){if(e=0,i=0,n=O(t),t.swipe&&t.dist){var r;switch(t.swipe=!1,f){case"main":-1===t.dirX&&c.right&&!n?(e=-h.right.outerWidth(),r="right",t.swipe=!0):1===t.dirX&&c.left&&!n?(e=h.left.outerWidth(),r="left",t.swipe=!0):1===t.dirY&&c.top&&n?(i=h.top.outerHeight(),r="top",t.swipe=!0):-1===t.dirY&&c.bottom&&n&&(i=-h.bottom.outerHeight(),r="bottom",t.swipe=!0);break;case"left":-1!==t.dirX||n||(e=0,r="main",t.swipe=!0);break;case"right":1!==t.dirX||n||(e=0,r="main",t.swipe=!0);break;case"top":-1===t.dirY&&n&&(i=0,r="main",t.swipe=!0);break;case"bottom":1===t.dirY&&n&&(i=0,r="main",t.swipe=!0)}n?1===t.dirY?(o=OGX.Iceberg.SWIPE_DOWN,a="down"):(o=OGX.Iceberg.SWIPE_UP,a="up"):1===t.dirX?(o=OGX.Iceberg.SWIPE_RIGHT,a="right"):(o=OGX.Iceberg.SWIPE_LEFT,a="left"),t.swipe&&t.dist&&(d.addClass("ogx_iceberg_anim"),d.on("transitionend",(function(){d.off("transitionend"),d.removeClass("ogx_iceberg_anim"),g=G(d),y(f=r),c.callbacks[a](f),d.trigger(o,f)})),d.css({transform:"translate3d("+e+"px, "+i+"px, 0)"}))}else if(t.dist){switch(e=0,i=0,f){case"left":e=h.left.outerWidth();break;case"right":e=-h.right.outerWidth();break;case"top":i=h.top.outerHeight();break;case"bottom":i=-h.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(f),d.trigger(OGX.Iceberg.RESTORE,f)})),d.css({transform:"translate3d("+e+"px, "+i+"px, 0)"})}}function G(t){var e=t[0].style.transform;if(e=e.match(/translate3d\(([0-9px%,\.\- ]+)\)/)){e=e[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.onBlur()):"flattened"===u&&this.el.width() .ogx_iceberg_views > .ogx_iceberg_view[data-ogx-panel-id="';for(var a in c["node:OML"])for(var r in c["node:OML"][a])0===r.indexOf("left")&&(i+='
',n.left=o+'left"]',h.left=!0),0===r.indexOf("top")&&(i+='
',n.top=o+'top"]',h.top=!0),0===r.indexOf("main")&&(i+='
',n.main=o+'main"]'),0===r.indexOf("right")&&(i+='
',n.right=o+'right"]',h.right=!0),0===r.indexOf("bottom")&&(i+='
',n.bottom=o+'bottom"]',h.bottom=!0);for(s.el.html(i),a=0;ae.width/e.height?(i.width=e.width,i.height=Math.round(t.height*(e.width/t.width))):(i.width=Math.round(t.width*(e.height/t.height)),i.height=e.height),i}({width:e,height:i},{width:o,height:a}),s=(o-r.width)/2,l=(a-r.height)/2;n.css("left",s+"px"),n.css("top",l+"px"),n.prop("width",r.width),n.prop("height",r.height)}function o(t){var e,i=$(t);i&&(i.find(".ogx_video").each((function(t,i){e=$(i),function(t,e,i){var n=$(t),o=e/i,a=n.parent().innerWidth(),r=n.parent().innerHeight(),s=a,l=Math.ceil(s/o);la?c=(s-a)/2*-1:sr?d=(l-r)/2*-1:l0&&(r=0),n.parent().css("overflow","hidden"),n.prop("width",o),n.prop("height",a),n.css("top",r+"px")}(i,parseInt(e.data("width"),10),parseInt(e.data("height"),10))})),i.find(".ogx_image_fit").each((function(t,i){e=$(i),function(t,e,i){var n=$(t),o=e/i,a=n.parent().innerWidth(),r=a,s=Math.ceil(r/o),l=0;r>a?l=(r-a)/2*-1:re&&(a=e);var r=Math.ceil(a/o);n.prop("width",a),n.prop("height",r)}(i,parseInt(e.data("width"),10),parseInt(e.data("height"),10))})))}function a(t){t?$(window).on("resize",r):$(window).off("resize",r)}function r(){for(var t in e)o(e[t].selector)}function s(t){var e;t.find(".ogx_video, .ogx_video_resp, .ogx_video_poster").each((function(t,i){(e=$(i)).parent().css("overflow","hidden"),i.hasAttribute("data-width")||(e.attr("data-width",e.attr("width")),e.attr("data-height",e.attr("height")))})),t.find(".ogx_image_cover, .ogx_image_contain, .ogx_image_fit, .ogx_image_scale, .ogx_image_resp").each((function(t,i){(e=$(i)).css("position","relative"),i.hasAttribute("data-width")||(e.attr("data-width",e.attr("width")),e.attr("data-height",e.attr("height")))})),o(t)}this.resize=function(t){void 0!==t?o(t):r()},this.bind=function(n,o){return!e.hasOwnProperty(n)&&(e[n]={observer:null,element:o},e[n].observer=(r=o,l=null,(c=new(window.MutationObserver||window.WebKitMutationObserver)((function(t,e){t.forEach((function(t){l&&clearTimeout(l),l=setTimeout((()=>{s($(r))}),10)}))}))).observe(document.querySelector(r),{childList:!0,subtree:!0}),c),e[n].selector=o,i++,t||(t=!0,a(!0)),s($(o)),!0);var r,l,c},this.unbind=function(n){return!(!e.hasOwnProperty(n)||!e[n].observer)&&(e[n].observer.disconnect(),delete e[n],!--i&&t&&(t=!1,a(!1)),!0)}},OGX.Media=new OGX.Media,require("NestList","Uxi","Bind"),OGX.NestList=function(t){construct(this,"NestList");var e,i,n=this,o={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}},a={title:"",scope:[],open:!0},r={id:0,title:!1,scope:[],height:0,y:0,hidden:!1,open:!0,selector:!1},s=t,l=!1,c=0,d=0,u=1,f={y:0,h:0,way:1},h=!1,g=new OGX.List;function _(t){t?e.on("click",".ogx_nest_list_item_head",p):e.off("click",".ogx_nest_list_item_head",p)}function p(t){l||(l=!0,m($(this)))}function m(t){var i=t.parent(0).data("ogx-nest-id"),o=!1;t.hasClass("ogx_nest_list_item_head_closed")?(f.way=1,t.addClass("ogx_nest_list_item_head_open").removeClass("ogx_nest_list_item_head_closed"),g.findUpdate("id",i,{open:!0},!1,1),o=!0):(f.way=0,t.removeClass("ogx_nest_list_item_head_open").addClass("ogx_nest_list_item_head_closed"),g.findUpdate("id",i,{open:!1},!1,1));var a=g.find("id",i,1);o?(!function(t){var e=v(t);if(e)return e.focus(),!0}(a),n.onOpen(a),e.trigger(OGX.NestList.OPEN,a)):(!function(t){var e=v(t);if(e)return e.blur(),!0}(a),n.onClose(a),e.trigger(OGX.NestList.CLOSE,a)),setTimeout(x,0)}function v(t){var e=$(t.selector).find(".ogx_uxi").first();if(e.length){var i=String(e.data("ogx-id")),o=n.nodes.find("id",i,1);if(o)return o}return!1}function y(t){if(t.hasOwnProperty("scope"))for(var e=0;e .ogx_nest_list_item[data-ogx-nest-id="'+o.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="'+o.id+'"]');return o.hidden&&f.addClass("ogx_nest_list_item_hidden"),f.removeClass("ogx_nest_list_prep"),o}function b(){var t=s.list;h&&(t=i),e.empty(),g.clear();var o;e.html('
'),s.hasOwnProperty("node:OML")||(s["node:OML"]=[]);for(var a=0;a .ogx_nest_list_item[data-ogx-nest-id="'+g[e.index].id+'"]').remove(),g.splice(e.index,1),setTimeout(x,0))},this.updateNestHeight=function(t){var e=g.find(s.map.title,t,1);setTimeout((function(){var t,i;t=e,i=$(t.selector).outerHeight(!0),t.height=i,x()}),0)},this.updateNestsHeight=function(){for(var t,e=0;e{switch(t.type){case"text":return e.text();case"json":return e.json();default:return e.blob()}})).catch((t=>{$(document).trigger(OGX.Api.NETWORK_ERROR,t)})).then((i=>{t.data=i,n(t,e,o)}))}()}function a(t){switch(t){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(t,e,i){var n={loaded:0,total:0,files:new OGX.List};for(var o in t)for(var a=0;aogx font init';$("body").append(a),n(t,i,o),function(t){setTimeout((function(){$('.ogx_font_loader[data-ogx-id="font-loader-'+t+'"]').remove()}),150)}(e),e++}a()}(l,a,r);break;case"pak":!function(t,e,i){function a(o){for(var a,r=//gi,s=[];a=r.exec(o);)s.push(a[1]);r=//gi;var l,c,d,u=o.split(r);u.shift();for(var f=0;f=!+]+ ?\d+) ?\? ?([\S\s]+) ?\: ?([\S\s]+);?)/gi.exec(t))&&(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),t=t.replace(r[0],c())),(r=/(scope ([\S ]+) ?\? ?([\S ]+)\: ?([\S ]+);?)/gi.exec(t))&&(l=r[0],t="null"===(l=(s=OGX.Scope.eval(r[2]))?r[3]:r[4])?t.replace(r[0],""):t.replace(r[0],l)),(r=/(uxi *(?:#|\$|&|@|%)*([a-z0-9_\-]+)):(([a-z0-9]+))/gi.exec(t))&&(s='OGX.Object.get({_NAME_:{eq:"'+r[3]+'"}, id:{eq:"'+r[2]+'"}}, null, 1);')===(t=t.replace(r[0],s)))return"return "+t;if((r=/method *([a-zA-Z0-9_\-]+) ([a-zA-Z0-9_\-]+):([a-zA-Z0-9_\-]+)/gi.exec(t))&&(s='OGX.Object.get({_NAME_:{eq:"'+r[3]+'"}, id:{eq:"'+r[2]+'"}}, null, 1).'+r[1])===(t=t.replace(r[0],s)))return"return "+t;if((r=/mongogx ([a-z0-9_\-]+)\.([a-z0-9_\-]+)\.([a-z]+)\(([\S ]+)\)/gi.exec(t))&&(s="mongogx.setDatabase('"+r[1]+"');",s+="mongogx.setCollection('"+r[2]+"');",(s+="return mongogx."+r[3]+"("+r[4]+")[0];")===(t=t.replace(r[0],s))))return s;if(isSingleVar(t))return"return "+replaceVars(t=convertKeywords(t,!1),e,i,n,o)+";";for(t=convertKeywords(t+="\r\n",!1);a=/[\S ]+(\r\n|\n)?/gi.exec(t);){if(l=replaceLoop(l=a[0].replace(/(\r\n|\n)/gi,"").trim(),e,i,n,o),charcode++,l=replaceVars(l,e,i,n,o),/^(app|OGX)\.\S+;?/g.test(l))return"return "+l+";";if(t=t.replace(a[0],""),u+=l+"\n",++d>100)return}return u="var __echo=[];\n"+u+'\nif(!__echo.length){return;}else{return __echo.join("");}'}function runJS(t,e,i,n,o,a){var r;try{r=new Function(oo,to,ro,lo,t)(e,i,n,o)}catch(t){return}if(void 0!==r)return r}function isSingleVar(t){return/^[ ]*\S+( \S+)?[ ]*$/g.test(t)}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(t){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(t,e,i,n,o){var a,r,s,l;return(a=/loop (\S+) ?(as (\S+) ?(\S+ )?)?{/gi.exec(t))&&(r="__"+String.fromCharCode(charcode).toLowerCase()+"__",s=(s=a[0]).replace(a[0],"for(var "+r+" in JSON.parse(JSON.stringify("+a[1]+"))){"),a[2]&&(l=a[4]?"&"+a[3]+"="+r+"; &"+a[4]+"="+a[1]+"["+r+"]; ":"&"+a[3]+"="+a[1]+"["+r+"]; "),s+=l,t=t.replace(a[0],s)),t}function replaceVars(t,e,i,n,o){for(var a,r,s,l=0;r=/((&|#|@|\$|%)([a-zA-Z_]{1}[a-zA-Z0-9\-_]*))(\.[a-z0-9\-_\.\[\]\$]+|\.\$|\.)?(;)?/gi.exec(t);){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(a=r[0].replace(r[1],s),t=t.replace(r[0],a),++l>300)return t}for(;r=/([a-z_\-]+)\( *(\$|@|&|%) *\)/gi.exec(t);)s=getTrueVal(r[2]),a=r[1]+"("+s+")",t=t.replace(r[0],a);for(;/^(json|ose|template|oml|crumb|result) (\S+)/g.test(t);)if((r=/crumb (\S+)?/gi.exec(t))&&(a=n.hasOwnProperty(r[1])?"__route_object."+r[1]:"{}",t=t.replace(r[0],a)),(r=/json (\S+)(;)?/gi.exec(t))&&(r[1]=getTrueVal(r[1],e,i,n,o),t=t.replace(r[0],"app.getJSON("+r[1]+")")),(r=/^template (\S+)( \S+)?[ ;]?/gi.exec(t))&&(r[1]=getTrueVal(r[1],e,i,n,o),void 0===r[2]?r[2]="__object":r[2]=getTrueVal(r[2].trim(),e,i,n,o),t=t.replace(r[0],"OGX.Templater.make(OGX.Templater.get("+r[1]+"), "+r[2]+", "+to+","+ro+","+lo+")")),(r=/^ose (\S+)(;)?/gi.exec(t))&&(r[1]=getTrueVal(r[1],e,i,n,o),script=that.get(r[1]),script&&(t=exp.replace(r[0],script.replace(/({{|}})/g,"")))),(r=/^oml (\S+)(;)?/gi.exec(t))&&(r[1]=getTrueVal(r[1],e,i,n,o),t=t.replace(r[0],"app.getOML("+r[1]+")")),(r=/^result (\S+)(;)?$/gi.exec(t))&&(t=t.replace(r[0],'OGX.OML.result("'+r[1]+'")')),++l>300)return t;if(["$","@","%","&"].includes(t.trim())){switch(t.trim()){case"$":t=oo;break;case"@":t=lo;break;case"%":t=ro;break;case"&":t=to}return t}for(;r=/echo ('|")?(((?![;}\r\n]+|$)([\S\s]))*)(?:'|")?/gi.exec(t);){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),a="__echo.push("+d+r[2]+d+");",t=t.replace(r[0],a),++l>300)return t}return t}this.get=function(t){return OGX.Cache.read("ose",t)},this.fork=function(t,e){var i,n;if(i=t.split(":")[0],void 0===e.data&&(e.data={}),void 0!==(n=OGX.OSE.exec(i,e.data)))for(var o in e.values)if(convertValue(o)===n)return e.values[o];return!1},this.execScript=function(t,e,i,n){var o=this.get(t);return o&&this.exec(o,e,i,n),!1},this.exec=function(t,e,i,n,o){void 0===e&&(e={}),void 0===i&&(i={}),void 0===n&&(n={}),void 0===o&&(o={}),charcode=65;var a=runJS(convertToJS(t,e,i,n,o),e,i,n,o,t);if(void 0!==a)return a}},OGX.OSE=new OGX.OSE,OGX.OSE.SCRIPT_LOADED="OSE_SCRIPT_LOADED",OGX.OSE.SCRIPTS_LOADED="OSE_SCRIPTS_LOADED",OGX.Overlay=function(t){"use strict";var e=this,i=!1,n=!1,o={anim:OGX.Overlay.FADE,display:{css:"",html:" "},index:!1,close_on_click:!1},a=!1,r="mousedown";function s(t){i&&(t?i.on(r,l):i.off(r,l))}function l(){"function"==typeof a.close_on_click&&a.close_on_click.apply(null,e),s(!1),e.removeOverlay()}t.hasOwnProperty("overlay")&&t.overlay&&setTimeout((function(){e.addOverlay(t.overlay)}),0),this.hasOverlay=function(){return!!i},this.addOverlay=function(t){if("object"!=typeof t&&(t={}),OGX.Data.merge(t,o),t.display.hasOwnProperty("_NAME_")||(t.display=new OGX.Display(t.display)),a=t,!this.hasOverlay()){var e=this.el;a.hasOwnProperty("el")&&(e=$(a.el));var n="z-index:"+(a.zindex?a.zindex:this.topIndex(e))+";",r='
'+a.display.html()+"
";if(e.prepend(r),(i=e.children(".ogx_overlay").first()).off("transitionend"),a.anim)switch(a.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 t.close_on_click&&s(!0),this},this.removeOverlay=function(t){s(!1);var e=!1;if(void 0===t||!0===t?a.anim&&(e=a.anim):e=t,i){if(e){switch(e){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(t){"use strict";this.pholder=null,t.hasOwnProperty("placeholder")&&(this.pholder=t.placeholder),this.pholder&&this.pholder.length&&"default"!==this.pholder||(this.pholder=""),this.placeholder(t)},OGX.Placeholder.prototype.placeholder=function(t){var e;if("object"==typeof t["node:OML"]&&!Array.isArray(t["node:OML"])){var i=this.selector;for(var n in this.pholder&&(i+=" "+this.pholder),t["node:OML"])0===n.indexOf("default")&&(e=n.replace("default",i),t["node:OML"][e]=t["node:OML"][n],delete t["node:OML"][n])}},OGX.Placeholder.prototype.placeholders=function(t,e){var i=0;function n(t){var n;for(var o in t)0===o.indexOf("default")&&(n=o.replace("default",e[i]),i++,t[n]=t[o],delete t[o])}if(void 0!==t&&void 0!==e){t.hasOwnProperty("node:OML")||(t["node:OML"]=[]);var o,a=t["node:OML"];a&&"string"==typeof a&&(0===a.indexOf("{{")?t["node:OML"]=OGX.OSE.exec(a):t["node:OML"]=OGX.Cache.read("oml",t["node:OML"]));for(var r=0;r=i.points[e].min&&a{i=!1;for(var r=0;ri.left&&e.lefti.top&&e.topscreen.width&&(t=screen.width),e>screen.height&&(e=screen.height);var i=r.width,o=r.height,a=0,s=0;return _||(i=OGX.Data.getBestSize(t,i),o=OGX.Data.getBestSize(e,o)),r.center?("string"==typeof i&&(i=-1!==i.indexOf("%")?Math.round(t*Number(i.substr(0,i.length-1))/100):Number(i)),"string"==typeof o&&(o=-1!==o.indexOf("%")?Math.round(e*Number(o.substr(0,o.length-1))/100):Number(o)),x=Math.round(t/2-i/2),y=Math.round(e/2-o/2),r.center&&p&&(r.center=!1)):(p?(x=n.x,y=n.y):r.x&&r.y?(-1!==String(r.x).indexOf("%")?(a=i/2,x=t*Number(r.x.slice(0,-1))/100-a):x=r.x,-1!==String(r.y).indexOf("%")?(s=o/2,y=e*Number(r.y.slice(0,-1))/100-s):y=r.y):(x=Math.round(t/2-i/2),y=Math.round(e/2-o/2)),x>t&&(x=t-x),x<-i&&(x=0),y>e&&(y=e-o),y<0&&(y=0)),{x:x,y:y,w:i,h:o}}function N(t,e,i,o,a,l){var c=!1,f=null;if(void 0===l&&(l=!1),void 0!==e&&!0!==e||(e=r.anim),e&&(c=e),!e&&m&&(c=m),e?n.el.removeClass(d+"_notrans"):n.el.addClass(d+"_notrans"),t?(n.front(),l||n.el.trigger(OGX.Popup.SHOW,n)):l||n.el.trigger(OGX.Popup.HIDE,n),c){var h={};switch(f=d+"_"+c,c){case OGX.Popup.SCALE:u[1]=t?"scale(1,1)":"scale("+r.anim_param.scale+", "+r.anim_param.scale+")",h.transform=u.join(" ");break;case OGX.Popup.FADE:h.opacity=t?1:0}t&&(s.css("display","flex"),h.visibility="visible",h.display="flex"),e||t||(h.visibility="hidden",h.display="none"),setTimeout((function(){s.css(h)}),50),e?(m=c,s.on("transitionend",(function(){s.off("transitionend"),b=!0,t?n.resizeNodes():s.css({display:"none",visibility:"hidden"}),f&&s.removeClass(f),I(i,o,a)})),f&&s.addClass(f)):(s.removeClass(f),I(i,o,a))}else t?s.css({opacity:t,display:"flex",visibility:"visible"}):s.css({display:"none",visibility:"hidden"}),I(i,o,a)}function I(t,e,i){void 0!==t&&t&&t(e),void 0!==i&&i&&i(n.id)}function A(t){t?s.on(n.touch.down,"."+d+"_button",P):s.off(n.touch.down,"."+d+"_button",P)}function P(t){t.preventDefault(),t.stopImmediatePropagation();var e=$(this);if(!e.hasClass(d+"_button_disabled")){var i=e.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 Y(){for(var t,e="",i=0;i0&&(t=r.buttons[i].enabled?"":d+"_button_disabled",e+=''+r.buttons[i].label+"");return e}function R(t,e){void 0===e&&(e=!0),r.buttons=new OGX.List(t);for(var i=0;i";return e}this.anim=null,this.group=r.group,this.x=0,this.y=0,this.z=0,this.construct=function(){},this.onFocus=function(){this.enableResize(),r.icons&&r.icons.length&&W(!0),r.buttons&&r.buttons.length&&r.buttons_enabled&&A(!0)},this.onBlur=function(){this.disableResize(),r.icons&&r.icons.length&&W(!1),r.buttons&&r.buttons.length&&r.buttons_enabled&&A(!1),this.enabled=!1},this.show=function(t,e,i){if(!this.visible){if(this._show(),!r.anim||t||b||(t=!0),!t&&r.anim&&"scale"==r.anim){var o=u.join(" ").replace(/scale\([0-9,\. ]+\)/,"");n.el.css({transform:o}),u=o.split(" ")}N(1,t,e,i),this.focus(1)}return this},this.hide=function(t,e,i,n,o){return this.visible&&(this._hide(),N(0,t,e,i,n,o),this.blur(1)),this},this.resize=function(){return X(),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%",T(),this.move(0,0)),this},this.normalize=function(){return r.maximize&&v&&(v=!1,r.width=O.width,r.height=O.height,T(),this.move(O.x,O.y),O=null),this},this.width=function(t,e,i){return void 0===t?r.width:(void 0===i&&(i=!1),void 0===e&&(e=!1),e&&n.el.removeClass("ogx_popup_notrans"),r.width=t,G(["width"],i),T(),this)},this.height=function(t,e,i){return void 0===t?r.height:(void 0===i&&(i=!1),void 0===e&&(e=!1),e&&n.el.removeClass("ogx_popup_notrans"),r.height=t,G(["height"],i),T(),this)},this.destroy=function(){s.off("transitionend"),this.touch.wipe()},this.buttons=function(t){if(void 0===t)return r.buttons;R(t)},this.enableButton=function(t){return r.buttons[t].enabled=!0,l.children("."+d+"_button:eq("+t+")").removeClass(d+"_button_disabled"),r.buttons_enabled||(r.buttons_enabled=!0),this},this.disableButton=function(t){return r.buttons[t].enabled=!1,l.children("."+d+"_button:eq("+t+")").addClass(d+"_button_disabled"),this},this.enableButtons=function(){if(r.buttons.length)for(var t=0;t',r.icon&&(o+='
"),r.title&&(o+='
'+r.title+"
"),o+='
',r.icons&&(o+=H()),o+="
");var a,c=1;if(u=["translate3d("+t.x+"px, "+t.y+"px, 0)"],r.anim)switch(r.anim){case OGX.Popup.FADE:c=0,a=d+"_fade";break;case OGX.Popup.SCALE:a=d+"_scale",u[1]="scale("+r.anim_param.scale+", "+r.anim_param.scale+")"}o+='
',r.html?o+=r.html:r.template&&(o+=OGX.Templater.make(OGX.Templater.get(r.template),r.data)),o+="
",r.buttons&&r.buttons.length&&(o+='
',o+=Y(),o+="
"),s.html(o),s.css({width:e,height:i,opacity:c,transform:u.join(" "),"z-index":n.z}),r.anim&&s.addClass(a),n.el=s,l=s.children("."+d+"_buttons").first()}(),r.drag){var t={x:!0,y:!0,cb_down:S,cb_up:L,cb_drag:k,target:"."+d+"_head"};r.group||"function"==typeof r.drag&&(t.cb_drag=function(t){r.drag(n,t)}),n.touch.add("Drag",t),n.dragable=!0}if(r.resize&&n.setResize({top:!1,cb_resize:w,cb_down:D,cb_up:E}),r.hasOwnProperty("html")&&r.html)r["node:OML"]=[{"default:Html":{html:r.html}}];else if(r.hasOwnProperty("view")&&r.view){var e={};e["default:Views."+r.view.id]=r,r["node:OML"].push(e)}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(t){"use strict";var e,i,n,o,a,r,s,l,c=this,d=t,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",_="mousemove",p=(d=!1,!1),m=!1,v={w:0,h:0},y=null;function x(t){d&&(t?c.el.on(h,O):c.el.off(h,O))}function O(t){var u=C(t);n=u.pageX,o=u.pageY;var f=c.el.position();e=f.left,i=f.top;var h=c.el.offset(),g=n-h.left,_=o-h.top;v.w=c.el.width(),v.h=c.el.height(),a=0,r=0,s=0,l=0,d.top&&_c.el.height()-d.border&&(l=1),d.left&&gc.el.width()-d.border&&(s=1),p=-1!==window.getComputedStyle(c.el[0],"width"),m=-1!==window.getComputedStyle(c.el[0],"height"),(s||l)&&(t.preventDefault(),y&&y.disable(),b(!0),G(!0),d.cb_down&&d.cb_down())}function b(t){t?f||(f=setInterval(w,5)):f&&(clearInterval(f),f=!1)}function w(){if(-1===s||-1===l){var t=e,n=i;a&&s&&(t+=a),r&&l&&(n+=r),a&&-1===s&&r&&1===l&&(n=i),c.el.css("transform","translate3d("+t+"px, "+n+"px, 0)")}s&&v.w+a*s>d.min_width&&(p?c.el.width(Math.round(100*(v.w+a*s)/c.el.parent().width()*100)/100+"%"):c.el.width(v.w+a*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)),(a||r)&&(d.cb_resize?d.cb_resize():c.el.trigger(OGX.Resize.RESIZING))}function G(t){t?($("body").on(_,X),$("body").on(g,T)):($("body").off(_,X),$("body").off(g,T))}function X(t){t.preventDefault(),t.stopImmediatePropagation(),t=C(t),a=t.pageX-n,r=t.pageY-o}function T(t){b(!1),G(!1),t=C(t),a=t.pageX-n,r=t.pageY-o,d.cb_up&&d.cb_up(),y&&(x(!1),y.enable(),setTimeout((function(){x(!0)}),0))}function C(t){return t.hasOwnProperty("originalEvent")&&void 0!==t.originalEvent.changedTouches?t.originalEvent.changedTouches[0]:t}this.resizable=!0,this.setResize=function(t){OGX.Data.merge(t,u,!1),d=t},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||(h="touchstart",_="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(t){construct(this,"Roulette");var e,i,n,o,a,r,s,l=this,c=t,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},f="object",h=0,g=0,_=null,p="ogx_roulette";function m(t,e){void 0===e&&(e=!0),l.el.children('input[name="'+c.name+'"]').val(t),e&&l.el.children('input[name="'+c.name+'"]').trigger("change")}function v(t){t?e.on(l.touch.down,"."+p+"_icon",(function(t){t.preventDefault(),t.stopImmediatePropagation(),l.next(!0)})):e.off(l.touch.down,"."+p+"_icon")}function y(t){t?e.on("change","input[type=hidden]",x):e.off("change","input[type=hidden]",x)}function x(t){t.preventDefault(),t.stopImmediatePropagation(),l.loopval(0,OGX.Data.stringToVal(t.target.value),!1)}function O(t){return g+t>c.list.length-1?c.list[0]:g+t<0?c.list[c.list.length-1]:c.list[g+t]}function b(t){o=t.y,X(!0)}function w(t){var e;t.dirY!==a?(e=0,o=t.pt1.y):(e=t.pt1.y-o,o=t.pt1.y),a=t.dirY,i.css({transition:"none",transform:"translate3D(0px, "+(E(i)+e)+"px, 0px)"})}function G(t){X(!1),trans=E(i);var e=Math.round(trans/n)*n,o=Math.round(e/n%c.list.length);if(o=o<=0?Math.abs(o):c.list.length-o,g!==o){switch(g=o,f){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, "+e+"px, 0px)"})}function X(t){t?r=setInterval(T,10):clearInterval(r)}function T(){var t,e,o;(t=Math.floor((i.position().top+n*a)/(n*c.list.length)*-1))!==h&&(0===i.children("."+p+'_stripe[data-id="'+t+'"]').length&&((e=s.clone()).css("top",t*(n*c.list.length)+"px"),e.attr("data-id",t),i.append(e)),i.children("."+p+"_stripe").each((function(t,e){o=i.position().top+$(e).position().top,(Math.ceil(o+n*c.list.length)<-n||o>n)&&$(e).remove()})),h=t)}function C(){X(!1),i.off("transitionend",C)}function D(){var t="",o='
';o+='
';for(var a=0;a<2;a++){o+='
';for(var r=0;r'+t+"
"}o+="
"}if(o+="
",c.icon&&(o+='
'),void 0===g&&(g=0),c.name){var l="";switch(c.required&&(l=" required"),f){case"string":o+='";break;case"object":o+='"}}e.html(o),i=e.children("."+p+"_container").children("."+p+"_stripes").first(),s=(s=i.children("."+p+"_stripe:last")).detach();var d=g*n*-1;i.css({transition:"none",transform:"translate3D(0px, "+d+"px, 0px)"})}function E(t){var e=0;return"none"!==t.css("transform")&&(e=Number(t.css("transform").split(",")[5].split(")")[0])),e}function S(t){switch(f){case"string":return{index:c.list.indexOf(t)};case"object":return c.list.findIndex(c.key,t)}}function L(){c.list.length>0&&!c.list.hasOwnProperty("insert")&&(c.list=new OGX.List(c.list)),"string"==typeof c.list[0]&&(f="string"),1===c.list.length&&(c.list[1]=c.list[0])}this.construct=function(){c.name&&y(!0)},this.onFocus=function(){return e.removeClass(p+"_disabled"),c.icon&&v(!0),_&&_.enable(),this},this.onBlur=function(){e.addClass(p+"_disabled"),c.icon&&v(!1),_&&_.disable(),X(!1)},this.bindFilter=function(t,e,i){return c.list.removeFilter(t),c.list.addFilter(t,e,i),c.list.filter(),setTimeout(D,0),this},this.destroy=function(){c.name&&y(!1),this.touch.wipe()},this.bindRender=function(t,e){},this.onSelect=function(){},this.val=function(t,e){if(void 0!==t){var o=S(t).index;return o>-1&&(!function(t,e){void 0===e&&(e=!0);i.off("transitionend",C),X(!1),a=-1;var o=E(i),r=Math.round(o/n)*n,s=o-r,l=Math.round(r/n%c.list.length);l=l<=0?Math.abs(l):c.list.length-l;var d=l-t;c.mode===OGX.Roulette.MODE_CLOSEST&&d>c.list.length/2&&(d=-1*(c.list.length-l+t));var u=o+d*n-s,f=20*Math.round(Math.abs(d*n)*c.time_coef);X(!0),i.on("transitionend",C),i.css({transition:"all "+f+"ms ease-out",transform:"translate3D(0px, "+u+"px, 0px)"}),g=t}(o),c.name&&m(t,!1)),this}switch(f){case"string":return c.list[g];case"object":return c.list[g][c.key]}},this.item=function(){return c.list[g]},this.loopval=function(t,e,o){var a=g,r=S(e).index;r>-1&&(g=r);var s=a-r,l=c.time_coef*Math.abs(s+t*c.list.length);return X(!0),i.css({transition:"all "+l+"s ease-out",transform:"translate3D(0px, "+(E(i)+(s*n-c.list.length*n*t))+"px, 0px)"}),i.on("transitionend",C),c.name&&m(e,o),void 0!==o&&o&&(this.onSelect(val),this.el.trigger(OGX.Roulette.CHANGE,val)),this},this.next=function(t){var e,i=O(1);switch(a=1,f){case"string":e=i;break;case"object":e=i[c.key]}return this.val(e),void 0!==t&&t&&(this.onSelect(e),this.el.trigger(OGX.Roulette.CHANGE,e),c.name&&this.el.children('input[name="'+c.name+'"]').trigger("input")),this},this.prev=function(t){var e,i=O(-1);switch(f){case"string":e=i;break;case"object":e=i[c.key]}return this.val(e),void 0!==t&&t&&(this.onSelect(e),this.el.trigger(OGX.Roulette.CHANGE,e),c.name&&this.el.children('input[name="'+c.name+'"]').trigger("change")),this},this.setData=function(t,e){return c.value=e,c.list=t,L(),g=void 0===e?0:S(e).index,setTimeout(D,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),(e=l.el=$(c.el)).addClass(p),e.width(),n=e.height(),c.list.length){var t=e.parent();t[0].hasAttribute("data-value")&&(c.value=OGX.Data.stringToVal(t.data("value")),t.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(){_=l.touch.add("Swipe",{x:!1,y:!0,cb_down:b,cb_swipe:w,cb_up:G,state:"manual",target:'.ogx_roulette[data-ogx-id="'+l.id+'"] .ogx_roulette_container',capture:c.capture}),c.enabled&&_.enable()}),null),D()},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(t){construct(this,"RouletteTree");var e,n,o=this,a=t,r={groups:!1,data:!1,value:!1,required:!1},s=!1;function l(t){t?e.on(OGX.Roulette.CHANGE,d):e.off(OGX.Roulette.CHANGE,d)}function c(){for(var t,e=0;e0&&(t=s[e-1].roulette.val()),0===e||e-1>=0&&null!==t&&String(t).length>0?s[e].roulette.enable():e>0&&s[e].roulette.disable()}function d(t,o){t.stopImmediatePropagation();var a,r=$(t.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[o].roulette.setData(g(i),e),i.push(e)));setTimeout(c,0)}function g(t){for(var e=a.data,i=0;i-1?f(n):{};h(t)},a=OGX.Data.merge(a,r),(e=o.el).addClass("ogx_roulette_tree"),o.observeOnce({childList:!0},(function(){setTimeout((()=>{a.value?h(a.value):c()}),10)})),function(){s=new OGX.List;var t,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,e.append('
'),i=a.groups[c-1],t=[{label:i,value:"",head:!0}],l)t.push({label:u,value:u});d=o.create("Roulette",{el:'.ogx_roulette_tree[data-ogx-id="'+o.id+'"] .ogx_roulette_tree_roulette[data-ogx-roulette="'+c+'"]',list:t,icon:a.icon,value:null,name:i,enabled:!1,required:a.required}),s.push({roulette:d,group:i,id:d.id})}if(ce.time+i))}function doCache(t){var e=getStageDefault(app.getStage());if(e){e.uxi.detach();var i={url:t.url,uxi:e.uxi,time:Math.round((new Date).getTime()/1e3)};cache.insert(i)}}function unCache(t){var e=getCache(t);e&&(e.uxi.kill(),cache.findDelete("url",t.url,1))}function useCache(t){var e=getCache(t);if(e){var i=app.getStage();e.uxi.attach(i,$(i.pholder)),cache.delete("url",t.url,1),route=t}}function getCache(t){return cache.get({url:{eq:t.url}},null,1)}function findRoute(t){var e,i,n,o,a,r=[],s=OGX.Data.clone(config.routes);for(var l in s){for(r=[],a=s[l],n=l;i=/(?!\/)([a-z0-9_\-]+)\:([^\/]+)/gi.exec(n);)n=n.replace(i[0],i[2]),r.push(i[1]);if((e=t.match("^"+n+"$"))&&e.length){e.shift(),"string"==typeof a.oml&&(a.oml=OGX.Data.clone(OGX.Cache.read("oml",a.oml))),o={};for(var c=0;c1e3*t&&that.goto(route.url,{reload:!0,history:!1})}function onBlur(){blured=!0,time=(new Date).getTime()}function handleVisibilityChange(){"visible"===document.visibilityState?onFocus():onBlur()}function init(){request={route:null,url:global_url,origin:global_url};var t=null;if(-1!==window.location.href.indexOf("#")){t=window.location.href.split("#").pop(),request.url=t;var e=findRoute(t);e?request.route=e:config.errors[404]?(e=findRoute(config.errors[404]),request.route=e):$(document).trigger(OGX.Router.NOT_FOUND,{url:t})}$(document).on("click touchstart mousedown","a",captureLink),config.options.idle&&$(document).on("visibilitychange",handleVisibilityChange)}this.url=function(){return url},this.start=function(){$(document).on("backbutton",onBackButton),$(window).on("popstate",onPopState)},this.stop=function(){$(document).off("backbutton",onBackButton),$(window).off("popstate",onPopState)},this.lock=function(){locked=!0},this.unlock=function(){locked=!1},this.gate=function(t){gate=t},this.isLocked=function(){return locked},this.addToHist=function(t){var e={url:t};history.pushState(e,"title"+(new Date).getTime(),page+"#"+t)},this.request=function(){return request},this.expire=function(t){var e=getCache({url:t});e&&unCache(e)},this.goto=function(__url,__options){if(!locked){void 0!==__options&&__options||(__options={}),OGX.Data.merge(__options,options_default);var r=findRoute(__url);if(request.url=__url,request.origin=global_url,r){request.route=r,r.route.hasOwnProperty("reload")&&(__options.reload=r.route.reload),r.route.hasOwnProperty("scope")||(r.route.scope="public");var access=!0;if(OGX.Scope.eval(r.route.scope)||(access=!1),config.options.eval){var fnc=eval(config.options.eval);if(fnc){var res=fnc(r);res||(access=!1)}}if(!access)return config.errors.hasOwnProperty("403")?setTimeout((function(){app.goto(config.errors[403],{history:!0})}),0):$(document).trigger(OGX.Router.FORBIDDEN,{url:__url,scope:r.route.scope}),!1;if(delete r.route.scope,r.route.hasOwnProperty("origin")){for(var valid=!1,origins=r.route.origin.split(","),reg,i=0;i0}catch(t){}return!1},this.fork=function(t){for(var e in t)if(this.eval(e))return t[e];return!1}},require("Scroller","Uxi","Touch"),OGX.Scroller=function(t){construct(this,"Scroller");var e,i,n,o,a,r,s,l,c,d,u,f=this,h=t,g={check_delay:30,fade_delay:300,css:!1,zindex:9999,observe:!0,auto_scroll:!1,scroll_callback:!1,trigger:!0,content:!1,overflow:!0},_=0,p="init",m=!1,v=!1,y=null;function x(t){t?i.on(f.touch.down,O):i.off(f.touch.down,O)}function O(t){t=f.event(t),S(!1),G(!0),b(!0),x(!1),L("in"),D(!0)}function b(t){t?(d=setInterval(C,10),i.on(f.touch.move,w)):(clearInterval(d),i.off(f.touch.move,w))}function w(t){t=f.event(t)}function G(t){t?$(document).on(f.touch.up,X):$(document).off(f.touch.up,X)}function X(){b(!1),G(!1),x(!0),D(!1),L("out")}function T(t){t?(window.addEventListener("resize",N),i.on("scroll",(function(t){t.stopImmediatePropagation(),C()})),i.on("wheel",(function(t){D(!0)})),void 0!==OGX.NestedList&&$(document).on(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED,(function(){f.update()}))):(window.removeEventListener("resize",N),i.off("scroll"),i.off("wheel"),void 0!==OGX.NestedList&&$(document).off(OGX.NestedList.OPENED+" "+OGX.NestedList.CLOSED))}function C(){var t,o=(t=i.scrollTop())/s,r=Math.round(a.position().top);a.css("top",o+"px"),h.trigger&&!m&&(f.el.trigger(OGX.Scroller.SCROLL,{top:t,percent:100*t/n}),-1*t==i.outerHeight(!0)-e.outerHeight(!0)?r!==Math.ceil(o)&&f.el.trigger(OGX.Scroller.BOTTOM):0===t&&(r&&r!==Math.round(o)||!r)&&f.el.trigger(OGX.Scroller.TOP)),h.scroll_callback&&h.scroll_callback()}function D(t){t?(c&&D(!1),l=e.position().top,c=setInterval(E,h.check_delay-10)):(c&&(clearInterval(c),c=null),v=!1,f.el.trigger(OGX.Scroller.END))}function E(){var t=e.position().top;t!==l?(v||(v=!0,f.el.trigger(OGX.Scroller.START)),L("in")):L("out"),l=t}function S(t){t?u=setInterval(C,h.check_delay):clearInterval(u)}function L(t){a.hasClass("ogx_scroller_track_anim")||a.addClass("ogx_scroller_track_anim"),"in"===t?(clearTimeout(y),y=null,a.addClass("ogx_scroller_track_anim_fade_in").removeClass("ogx_scroller_track_anim_fade_out")):y||(y=setTimeout((function(){a.addClass("ogx_scroller_track_anim_fade_out").removeClass("ogx_scroller_track_anim_fade_in")}),h.fade_delay))}function k(t){t?f.observe(!0,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","src","width","height"]},M):f.observe(!1)}function M(){_!==e.height()&&(_=e.height(),N(),h.auto_scroll&&f.bottom())}function N(){if(o=i.innerHeight(),n=e.height(),s=n/o,n>o){var t=Math.round(o/s);a.css("height",t+"px"),r.css("display","block")}else r.css("display","none");"init"===p&&(p=OGX.Scroller.READY,f.el.trigger(OGX.Scroller.READY))}this.onFocus=function(){return N(),T(!0),h.observe&&setTimeout((function(){k(!0)}),0),x(!0),this},this.onBlur=function(){return T(!1),h.observe&&k(!1),G(!1),b(!1),x(!1),D(!1),S(!1),a.removeClass("ogx_scroller_track_anim_fade_in"),a.removeClass("ogx_scroller_track_anim_fade_out"),this},this.resize=function(){return N(),this},this.destroy=function(){f.el.removeClass("ogx_scroller_outer"),e.remove(),r.remove()},this.overflow=function(t){if(void 0===t)return h.overflow;h.overflow!==t&&(h.overflow=t,t?(this.onFocus(),this.el.removeClass("ogx_scroller_no_overflow")):(this.onBlur(),this.el.addClass("ogx_scroller_no_overflow")))},this.top=function(){return n>o&&(i[0].scrollTop=0,N()),this},this.bottom=function(){return n>o&&(i.scrollTop(n),N()),this},this.max=function(){return e.height()-i.height()},this.scroll=function(t){return void 0===t?i[0].scrollTop:(i[0].scrollTop=t,N(),this)},this.mute=function(){return m=!0,this},this.vocal=function(){return m=!1,this},this.container=function(){return e},this.inner=function(){return e[0]},this.outer=function(){return i[0]},this.state=function(){return p},OGX.Data.merge(h,g),function(){f.el=$(h.el),f.el.addClass("ogx_scroller_outer ogx_hw"),(i=f.el).html('
'),e=i.children(".ogx_scroller_inner"),h.content&&e.append(h.content);var t='
';i.parent().append(t),r=i.parent().find(".ogx_scroller_track"),a=r.find(".ogx_scroller_track_button")}(),N()},OGX.Scroller.READY="ScrollerReady",OGX.Scroller.TOP="ScrollerTop",OGX.Scroller.BOTTOM="ScrollerBottom",OGX.Scroller.SCROLL="ScrollerScroll",OGX.Scroller.START="ScrollerStart",OGX.Scroller.END="ScrollerEnd",require("StackedTree","Uxi","Touch"),OGX.StackedTree=function(t){construct(this,"StackedTree");var e,i,n,o,a=this,r={scope:["public"],speed:200,list:[],display:{html:"{{$label}}"},displays:!1,chromeos:!1},s=t,l=[],c=[0],d=0,u=!1,f="ogx_stacked_tree";function h(t){t?(e.on(a.touch.down,".ogx_stacked_tree_level .ogx_stacked_tree_level_prev",g),e.on(a.touch.down,".ogx_stacked_tree_level_list .ogx_dynamic_list_item",(function(t){var e=$(this).data("ogx-id");e--,function(t,e){u=e;var i=l[d].findIndex("__id__",e.__id__);e.hasOwnProperty("items")&&e.items.length&&function(t){if(!t.hasOwnProperty("scope"))return!0;for(var e=0;e';t>0&&(r=(r=o.css(u)).replace(f+"_door",""),c+='
'+o.html(u)+"
"),c+='
',i.append(c),i.children("."+f+"_level").css("flex-basis",Math.floor(100/(t+1)*100)/100+"%"),function(t,e,i){l[t]&&a.remove(l[t].id,"DynamicList");var n=a.create("DynamicList",{el:e,mode:"static",scroll:!0,display:s.display,displays:s.displays,list:i});l[t]=n}(t,"."+f+'[data-ogx-id="'+a.id+'"] > .'+f+"_container > ."+f+'_level[data-level="'+t+'"] > .'+f+"_level_list",e)}function v(t,e){h(!1),i.addClass(f+"_anim"),void 0!==e&&e?i.on("transitionend",(function(){i.off("transitionend"),i.removeClass(f+"_anim").css("width",100*(t+1)+"%"),a.remove(l[t+1].id,"DynamicList"),l.splice(t+1,1),i.children("."+f+'_level[data-level="'+(t+1)+'"]').remove(),i.children("."+f+"_level").css("flex-basis",Math.floor(100/(t+1)*100)/100+"%"),n=i.width(),u=!1,d=t,h(!0)})):(d=t,h(!0)),n=i.width(),i.css("transform","translateX("+t*Math.round(n/c.length)*-1+"px)")}this.onFocus=function(){h(!0),_(!0)},this.onBlur=function(){h(!1),_(!1)},this.resize=function(){return p(),this},this.destroy=function(){},this.val=function(t){if(t.length){var e=t.slice();return s.list={items:e},!0}return!1},this.scope=function(t){return void 0!==t?(s.scope=t,c=[0],d=0,u=!1,!0):s.scope},function(){s=OGX.Data.merge(s,r,!1,!0);var t=(o=new OGX.Display(s)).val();if(t=function(t){if(t.display&&"object"==typeof t.display&&!t.display.hasOwnProperty("bind")&&(t.display=i(t.display)),t.displays)for(var e in t.displays)t.displays[e]=i(t.displays[e]);function i(t){var e=['{{return typeof($items) !== "undefined" && $items.length > 0}}',{add:"ogx_stacked_tree_door"}];if(t.hasOwnProperty("css"))if("object"==typeof t.css)t.css.hasOwnProperty("add")&&t.css.add?t.css.add+=" ogx_stacked_tree_item":t.css.add="ogx_stacked_tree_item",t.css.hasOwnProperty("conditions")?t.css.conditions.push(e):t.css.conditions=[e];else{var i="";t.css&&(i=t.css),i+=" ogx_stacked_tree_item",t.css={add:i,conditions:[e]}}else t.css={add:"ogx_stacked_tree_item",conditions:[e]};return t}return t}(t),o.val(t),s.display=t.display,s.displays=t.displays,(e=a.el).addClass(f),s.list.length){var i=s.list.slice();s.list={items:i}}}(),e.html('
'),i=e.children("."+f+"_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(t){construct(this,"Stage");var e=this,i=OGX.Data.merge({id:"stage",anim:null,group_watch:!1},t,!0,!0);function n(t){t?e.el.on(e.touch.down,".ogx_stage_exit",(function(){app.theater.show()})):e.el.off(e.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.__proto__.onFocus=function(){return i.closeable&&n(!0),this},this.__proto__.onBlur=function(){return i.closeable&&n(!1),this},function(){i.hasOwnProperty("theater")&&(e.theater=i.theater),e.home=i.home;var t=new OGX.Display(i),n="block";i.hasOwnProperty("use")&&i.use||(n="none");var o="";i.closeable&&(o='
');var a=t.html();i.hasOwnProperty("data")&&(a=OGX.Templater.make(a,i.data)),o+=a,container=e.el,container.html(o),container.addClass("ogx_stage").css("display",n)}()},OGX.Stage.SWAP="swap",OGX.Stage.FLIP="flip",require("Switch","Uxi","Bind","Touch"),OGX.Switch=function(t){construct(this,"Switch");var e,i=this,n=t,o={el:"document",bind:!1,labels:!0,data:[{label:"OFF",value:!1},{label:"ON",value:!0}],value:!1,name:!1,callbacks:{change:null}},a="ogx_switch";function r(t){n.value===n.data[0].value?n.value=n.data[1].value:n.value=n.data[0].value,s(t)}function s(t){t=void 0!==t;var i=e.find("."+a+"_dot").first(),o=e.find("."+a+"_label").first(),r=e.find("."+a+"_label").last();n.value==n.data[0].value?(i.removeClass(a+"_dot_right").addClass(a+"_dot_left"),o.removeClass(a+"_label_off").addClass(a+"_label_on").addClass(a+"_selected"),r.removeClass(a+"_label_on").addClass(a+"_label_off").removeClass(a+"_selected")):(i.removeClass(a+"_dot_left").addClass(a+"_dot_right"),r.removeClass(a+"_label_off").addClass(a+"_label_on").addClass(a+"_selected"),o.removeClass(a+"_label_on").addClass(a+"_label_off").removeClass(a+"_selected")),n.name&&e.find('input[type="hidden"]').attr("value",n.value),t&&e.children("."+a+"_val").trigger("input")}function l(t){t?e.on(i.touch.down,c):e.off(i.touch.down,c)}function c(t){t.preventDefault(),t.stopImmediatePropagation(),r(),d(!1),i.onChange(n.value),e.trigger(OGX.Switch.CHANGE,n.value),e.children("."+a+"_val").trigger("input"),d(!0)}function d(t){t?e.on("change","input[type=hidden]",u):e.off("change","input[type=hidden]",u)}function u(t){t.preventDefault(),t.stopImmediatePropagation(),n.value=OGX.Data.stringToVal(t.target.value),s()}this.construct=function(){n.name&&d(!0)},this.onFocus=function(){return l(!0),e.removeClass(a+"_disabled"),this},this.onBlur=function(){return l(!1),e.addClass(a+"_disabled"),this},this.destroy=function(){n.name&&d(!1)},this.bindRender=function(t,e){},this.val=function(t,i){return void 0===i&&(i=!0),void 0!==t&&n.value!==t&&(r(),i&&e.children("."+a+"_val").first().trigger("input")),n.value},this.onChange=function(){},this.toggle=function(t){return r(t=void 0===t),this},function(){var t;void 0===n&&(n={}),n.hasOwnProperty("data")&&!n.hasOwnProperty("value")&&(t=n.data[0].value),OGX.Data.merge(n,o),void 0!==t&&(n.value=t),(e=i.el).addClass(a+"_disabled");var r=e.parent();r[0].hasAttribute("data-value")&&(n.value=OGX.Data.stringToVal(r.data("value")),r.removeAttr("data-value"))}(),function(){var t="";n.labels&&(t+=''+n.data[0].label+"");var i="";n.value===n.data[1].value&&(i=a+"_dot_right"),t+='
',n.labels&&(t+=''+n.data[1].label+""),n.name&&(t+=''),e.html(t),e.addClass(a)}(),setTimeout(s,0)},OGX.Switch.CHANGE="SwitchChange",OGX.Switch.BIND=OGX.Switch.CHANGE,require("Tabs","Uxi","Touch"),OGX.Tabs=function(t){construct(this,"Tabs");var e,i=this,n=t,o={editable:!1,detach:!1,detach_min:-4,add:!0,remove:!0,reorder:!0,icons:!1,index:0,list:new OGX.List,display:{html:"",css:""},callbacks:{select:null,close:null,add:null,remove:null}},a=!1,r=0,s=!1,l=!1,c=!1,d=!1,u=!1,f={x:0,y:0},h="ogx_tabs";function g(){r>0?r--:r=0,i.index(r)}function _(){for(var t,i,o='
',s=0;s',n.icons&&(o+=''),t&&(o+=''+t+""),n.remove&&(o+=''),o+="
",i="";o+="",n.add&&(o+='
',e.addClass(h+"_editable")),e.html(o),a=e.children("."+h+"_container").children("."+h+"_tab:eq("+r+")")}function p(t){s||(u=!1,l=$(t),r=l.index(),c={from:r},e.children("."+h+"_container").children("."+h+"_tab_active").first().removeClass(h+"_tab_active"),f.x=l.position().left,f.y=l.position().top,(s={el:$(t).clone(),x:f.x,y:l.position().top}).w=l.width(),s.el.width(s.w),l.addClass(h+"_tab_active").addClass(h+"_frozen"),a=l,s.el.addClass(h+"_tab_active").addClass(h+"_float").css("transform","translate3d("+f.x+"px, "+s.y+"px, 0px)"),e.children("."+h+"_container").prepend(s.el),e.trigger(OGX.Tabs.SELECT,n.list[r]),d=setInterval(v,5))}function m(t){if(s)if(u=t,Math.abs(u.distX)>Math.abs(u.distY)){var o=s.x+u.distX;s.el.css("transform","translate3d("+o+"px, "+s.y+"px, 0px)")}else{var a=s.y+u.distY;s.el.css("transform","translate3d("+s.x+"px, "+a+"px, 0px)");var r=s.el.offset();if(u.distYMath.abs(u.distY)&&e.children("."+h+"_container").children("."+h+"_tab").each((function(e,o){(t=$(o)).hasClass(h+"_tab_active")||(i=t.position(),n=t.width(),idx!==e&&(s.x+u.distX>i.left+n/2&&s.x+u.distXi.left&&s.x+u.distXt&&i.css("transform","translateX("+-1*(n-t)+"px)")}),0),this},this.addAt=function(t,e){return n.icons&&(t.hasOwnProperty("icon")||(t.icon=n.icon_default)),n.list.insert(t,e),r=e,setTimeout(_,0),this},this.remove=function(t,i){void 0===i&&(i=t,t="label");var o=n.list.findIndex(t,i);n.list.findDelete(t,i,1)&&(e.children("."+h+"_container").first().children("."+h+"_tab:eq("+o.index+")").remove(),g())},this.removeCurrent=function(){return a&&this.removeAt(r),this},this.removeAt=function(t){return n.list.delete(t)&&(e.children("."+h+"_container").first().children("."+h+"_tab:eq("+t+")").remove(),g()),this},this.enableTab=function(t){return e.children("."+h+"_container").first().children("."+h+"_tab:eq("+t+")").removeClass(h+"_tab_disabled"),this},this.disableTab=function(t){return e.children("."+h+"_container").first().children("."+h+"_tab:eq("+t+")").addClass(h+"_tab_disabled"),this},this.index=function(t){return void 0!==t?(a&&(a.removeClass(h+"_tab_active"),a=null),(a=e.children("."+h+"_container").first().children("."+h+"_tab:eq("+t+")")).addClass(h+"_tab_active"),r=t,!0):a?r:-1},this.select=function(t){a&&a.removeClass(h+"_tab_active");var e=n.list.findIndex("label",t);return this.index(e.index),this},n||(n={}),OGX.Data.merge(n,o),n.list.hasOwnProperty("insert")||(n.list=new OGX.List(n.list)),n.display.hasOwnProperty("_NAME_")||(n.display=new OGX.Display(n.display)),n.callbacks.select||(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),(e=i.el).addClass(h),n.editable&&e.addClass(h+"_editable"),r=n.index,setTimeout(_,0),n.reorder&&i.touch.add("Hold",{id:"tabs_hold",cb_hold:p,cb_move:m,cb_up:y,state:"manual",time:1e3,target:".ogx_tabs_tab",capture:!1})},OGX.Tabs.SELECT="TabsSelect",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(t){var e;e=1===config.max&&config.current_tags.length?config.current_tags[0]:JSON.stringify(config.current_tags),container.find("input[type=hidden]").val(e),t&&container.find("input[type=hidden]").trigger("change")}function addTag(t){var e=!1;switch(config.mode){case OGX.Tags.MODE_STRING:case OGX.Tags.MODE_ASCII:-1===config.current_tags.indexOf(t)&&(config.current_tags.push(t),e=!0);break;case OGX.Tags.MODE_OBJECT:var i=config.current_tags.find("label",t,1);i||((i=config.tags.find("label",t,1))?config.current_tags.push(i):config.current_tags.push({label:t}),e=!0)}if(e){var n="";!0===config.remove&&(n='');var o=''+t+""+n+"";container.find(".ogx_tags_tags").first().append(o),listenHidden(!1),updateHidden(!0),listenHidden(!0),that.onAdd(t),container.trigger(OGX.Tags.TAG_ADDED,t),container.trigger(OGX.Tags.CHANGE,[config.current_tags])}container.find(".ogx_tags_input").trigger("focus")}function removeTag(t){var e=!1;switch(config.mode){case OGX.Tags.MODE_STRING:case OGX.Tags.MODE_ASCII:var i=config.current_tags.indexOf(t);i>-1&&(e=config.current_tags.splice(i,1));break;case OGX.Tags.MODE_OBJECT:e=config.current_tags.findDelete("label",t)}return e&&container.find(".ogx_tags_tags").first().find(".ogx_tags_tag").each((function(e,i){if($(i).find("span").first().text()===t)return $(i).remove(),listenHidden(!1),updateHidden(!0),void listenHidden(!0)})),e}function displayTags(t,e){if(t){container.find(".ogx_tags_container").length>0&&(displayTags(!1),listenTagAdd(!1));for(var i='
',n=!1,o=0;o";break;case OGX.Tags.MODE_OBJECT:i+=''+e[o].label+""}n&&(i+='+'+n+" "+config.more_word+""),i+="
",container.append(i),listenTagAdd(!0)}else container.find(".ogx_tags_container").remove(),listenTagAdd(!1)}function renderTags(t){for(var e="",i="",n=0;n':"",config.mode){case OGX.Tags.MODE_STRING:case OGX.Tags.MODE_ASCII:e+=''+t[n]+""+i+"";break;case OGX.Tags.MODE_OBJECT:e+=''+t[n].label+""+i+""}return config.current_tags=t,container.find(".ogx_tags_tags").first().html(e),updateHidden(!1),!0}function trimTags(t){return t=OGX.Data.clone(t),sliced={org:OGX.Data.clone(t),rem:[]},Array.isArray(t)&&config.display_max&&t.length>config.display_max&&(sliced.rem=t.slice(config.display_max),t=t.slice(0,config.display_max)),config.display_more&&sliced.rem.length&&t.push({__m__:sliced.rem.length}),new OGX.List(t)}function findTags(t){for(var e,i=[],n=0;n=3)if(!config.strict&&t.which===config.keycode&&config.add)addTag(e),input.val(""),displayTags(!1);else{var i;switch(config.mode){case OGX.Tags.MODE_STRING:i=findTags(e);break;case OGX.Tags.MODE_OBJECT:i=findTagsObj(e);break;case OGX.Tags.MODE_ASCII:i=findTagsAscii(e)}i.length>0?displayTags(!0,i):displayTags(!1)}else displayTags(!1)})):input.off("keyup")}function listenSelect(t){t?container.on(that.touch.down,".ogx_tags_tag",onSelect):container.off(that.touch.down,".ogx_tags_tag",onSelect)}function onSelect(t){var e=$(this).text();switch(config.mode){case OGX.Tags.MODE_OBJECT:e=config.current_tags.get({label:{eq:e}},null,1)}config.callbacks.select(e),that.el.trigger(OGX.Tags.SELECT,e)}function listenMore(t){t?container.on(that.touch.down,".ogx_tags_more",onMore):container.off(that.touch.down,".ogx_tags_more",onMore)}function onMore(t){t.preventDefault(),t.stopImmediatePropagation(),sliced.rem.length&&($(this).remove(),displayTags(!0,sliced.org))}function listenTagAdd(t){t?container.on(that.touch.down,".ogx_tags_container_tag",onAdd):container.off(that.touch.down,".ogx_tags_container_tag",onAdd)}function onAdd(t){addTag($(this).text()),input.val(""),displayTags(!1),config.max&&config.current_tags.length===config.max&&(listenInput(!1),input.css("display","none"))}function listenTagRemove(t){t?container.on(that.touch.down,".ogx_tags_remove",onRemove):container.off(that.touch.down,".ogx_tags_remove",onRemove)}function onRemove(t){t.preventDefault(),t.stopImmediatePropagation();var e=removeTag($(this).parent("span").first().find("span").first().text());that.onRemove(e),container.trigger(OGX.Tags.TAG_REMOVED,e),container.trigger(OGX.Tags.CHANGE,[config.current_tags]),config.max&&config.current_tags.length'),config.name){var e="";config.required&&(e="required"),t+='"}if(container.html(t),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.onFocus=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 t=container.find(".ogx_tags_input").first();t.prop("placeholder",config.placeholder),t.prop("disabled",!1),config.hide_input_on_disable&&t.removeClass("ogx_tags_hidden")}return this},this.onBlur=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 t=container.find(".ogx_tags_input").first();t.prop("placeholder",""),t.prop("disabled",!0),config.hide_input_on_disable&&t.addClass("ogx_tags_hidden")}return this},this.destroy=function(){config.restrict&&OGX.Form.unrestrictField(container.find(".ogx_tags_input").first()[0])},this.tags=function(t){return void 0!==t?(t.hasOwnProperty("insert")||(t=new OGX.List(t)),config.tags=t,!0):config.tags},this.val=function(t,e){if(displayTags(!1),listenTagAdd(!1),void 0!==t){if(void 0!==e){var i=t,n=config.tags.find(i,e,1);n&&(t=[n])}return t.hasOwnProperty("insert")||(t=new OGX.List(t)),config.current_tags=t,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(t){return renderTags(trimTags(t))},this.onSelect=function(){},this.onAdd=function(){},this.onRemove=function(){},this.add=function(t){return addTag(t)},this.remove=function(t){return removeTag(t)},init()},OGX.Tags.prototype.tagDataset=function(t,e,i){"use strict";void 0===i&&(i=!1);for(var n,o=[],a=0;a-1&&(i.includes(n.items[o][a])||i.push(n.items[o][a]));return t(n.items[o]),!0}}(t));}(t,e)},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(t){construct(this,"Template");var e=new OGX.Display(t),i=e.html(t.data),n=e.css(t.data);i&&this.el.html(i),n&&this.el.addClass(n)},OGX.Templater=function(){"use strict";var t;this.jmake=function(t,e){for(var i,n,o=JSON.stringify(t);m=/({{(\$|#)[a-z0-9_\.]*}})|("{{(\$)}}")/gi.exec(o);)m[0].match(/"{{(\$)}}"/)?(i="<-"+(i=JSON.stringify(e)).substring(1).slice(0,-1)+"->",o=(o=(o=o.replace(m[0],i)).replace(/<\-/,"{")).replace(/\->/,"}")):("object"==typeof(n=OGX.OSE.exec(m[0],e))&&(n=JSON.stringify(n),m[0]='"'+m[0]+'"'),o=o.replace(m[0],n));return JSON.parse(o)},this.make=function(e,i,n,o,a){var r,s;for(t={},void 0===a&&(a={}),OGX.Data.merge(t,a);r=/{{[^{]+(({[^{]+)+)?}}/gi.exec(e);)void 0===(s=OGX.OSE.exec(r[0],i,n,o,t))&&(s=""),e=e.replace(r[0],s);return e},this.amake=function(t,e,i,n,o){for(var a="",r=0;r{{$label}}'},l='
',c=!0;function d(t){t?($(document).on("backbutton",u),$(window).on("popstate",u),list.el.on(OGX.DynamicList.SELECT,(function(t,e){!function(t){o.el.trigger(OGX.Theater.HIDE);var e=app.find("Stage",t);e.wake(),e.resizeNodes();var n,r=list.el.find('.ogx_theater_stage[data-ogx-id="'+e.id+'"]').position();o.observe(!0,{childList:!0},(function(){o.observe(!1),(n=i.children(".ogx_theater_trans")).on("transitionend",(function(){n.off("transitionend"),o.hide(),n.remove(),e.url?(app.showStage(e.id,!1),app.router.addToHist(e.url)):app.goto(e.id+"/"+e.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)"})}),a.timeout)}),null,i),i.append('
")}(e.id)}))):($(document).off("backbutton",u),$(window).off("popstate",u),list.el.off(OGX.DynamicList.SELECT))}function u(){o.hide()}function f(){e.prepend(l);for(var t,i=[],r=0;r .list").on(OGX.DynamicList.RENDER,(function(t){$(".ogx_theater > .list").off(OGX.DynamicList.RENDER),setTimeout((function(){l=$(".ogx_theater").detach()}),0)})),list=o.create("DynamicList",{el:".ogx_theater > .list",display:{html:a.display.html,css:"ogx_theater_stage"},key:"id",scroll:!0,mode:"hit",list:i,trigger:!0})}function h(){var t=app.gather(OGX.Stage.NAME);n=[];for(var e=0;e
"),e.css("visibility","visible")}(),this.focusNodes(),d(!0),c=!1),this},this.hide=function(){return c||(this.blurNodes(),l=e.detach(),d(!1),c=!0),this},this.tile=function(t,e){void 0===e&&(e="x")},OGX.Data.merge(a,r),a.display&&("object"!=typeof a.display&&(a.display={}),OGX.Data.merge(a.display,s),a.display.template&&(a.display.html=OGX.Templater.get(a.display.template))),(e=o.el).addClass("ogx_theater").css("visibility","hidden"),i=$("body"),h(),$(document).on(OGX.App.READY,f)},OGX.Theater.ZOOM="TheaterZoom",OGX.Theater.SHOW="TheaterShow",OGX.Theater.HIDE="TheaterHide",OGX.Touch=function(t){"use strict";var e=this,i=0;this.touch=!1,this.touch||this.initTouch(t.chromeos);var n=new OGX.List;this.touch.add=function(t,o){var a=new OGX.Touches[t](e),r=a.set(o);return!r.hasOwnProperty("id")&&(r.id=i++),a.id=r.id,"auto"===r.state&&!e.blured&&e.enabled&&a.enable(),n.insert(a),a},this.touch.remove=function(t){"object"==typeof t&&(t=t.id),n.findDelete("id",__id,1).disable()},this.touch.get=function(t){return n.get({id:{eq:t}},null,1)},this.touch.wipe=function(){for(var t=0;ta.x?1:-1,l=r.y>a.y?1:-1,c=Math.abs(r.x-a.x),d=Math.abs(r.y-a.y),u=Math.sqrt(Math.abs(Math.pow(r.x-a.x,2)-Math.pow(r.y-a.y,2)))}function b(){o.cb_swipe&&(o.x&&o.min_x&&c>=o.min_x||o.y&&o.min_y&&d>=o.min_y?x(0,!0):o.cb_swipe({pt0:a,pt1:r,dirX:s,dirY:l,distX:c,distY:d,dist:u}))}this.set=function(t){return o=t,OGX.Data.merge(o,n),e=i.selector,this.state=o.state,"auto"===o.state&&(i.enable,i.disable),o.target&&(e=o.target),o},this.enable=function(){!h&&o&&(h=!0,y(!0))},this.disable=function(){h&&(h=!1,y(!1),m(!1))}},OGX.Touches.Hold=function(t){"use strict";var e={cb_hold:!1,cb_up:!1,cb_move:!1,time:1e3,el:this.el,target:!1,capture:!1,parent:null,state:"auto"},i=!1,n=!1,o=!1,a=!1,r=!1,s=!1,l=t,c={x:0,y:0},d={x:0,y:0},u={x:0,y:0},f={x:0,y:0},h=null,g=$("body");function _(t){var e=[];t?i.parent?i.parent.on.apply(i.parent,[l.touch.down,p]):(e=i.target?[l.touch.down,i.target,p]:[l.touch.down,p],l.el.on.apply(l.el,e)):i.parent?i.parent.off.apply(i.parent,[l.touch.down,p]):(e=i.target?[l.touch.down,i.target,p]:[l.touch.down,p],l.el.off.apply(l.el,e))}function p(t){t=l.event(t),h=t.currentTarget,a||(a=!0,n=(new Date).getTime(),f.x=c.x=t.pageX,f.y=c.y=t.pageY,o=setInterval(v,1))}function m(t){i.capture&&(t.preventDefault(),t.stopImmediatePropagation()),t=l.event(t),d.x=t.pageX,d.y=t.pageY,d.x5||Math.abs(c.y-d.y)>5)&&(clearInterval(o),o=!1)}function v(){a&&(new Date).getTime()-n>i.time&&(r||(r=!0,g.on(l.touch.move,m),i.cb_hold?i.cb_hold(h,c):l.el.trigger(OGX.Touch.HOLD_START)))}function y(e){e=t.event(e),a=!1,clearInterval(o),o=!1,r&&(r=!1,g.off(l.touch.move,m),i.cb_up?i.cb_up({x:e.pageX,y:e.pageY}):l.el.trigger(OGX.Touch.HOLD_END,{x:e.pageX,y:e.pageY}))}this.set=function(t){return i=t,OGX.Data.merge(i,e),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,_(!0),g.on(l.touch.up,y))},this.disable=function(){s&&(s=!1,(a||o)&&(r=!1,a=!1,clearInterval(o),o=!1),_(!1),g.off(l.touch.up,y),g.off(l.touch.move,m))}},OGX.Touches.Drag=function(t){"use strict";var e,i,n,o,a,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,parent:null,state:"auto"},c=t,d=!1,u=!1,f=$("body");function h(t){var e=[];t?s.parent?s.parent.on.apply(s.parent,[c.touch.down,g]):(e=s.target?[c.touch.down,s.target,g]:[c.touch.down,g],c.el.on.apply(c.el,e)):s.parent?s.parent.off.apply(s.parent,[c.touch.down,g]):(e=s.target?[c.touch.down,s.target,g]:[c.touch.down,g],c.el.off.apply(c.el,e))}function g(l){s.capture&&(l.preventDefault(),l.stopImmediatePropagation()),l=t.event(l),n=l.pageX,o=l.pageY;var d=c.el.position();e=d.left,i=d.top;var u=c.el.offset(),f=n-u.left,h=o-u.top;if(s.border){if(fc.el.width()-s.border)return;if(hc.el.height()-s.border)return}a=0,r=0,_(!0),p(!0),s.cb_down&&s.cb_down({x:n,y:o,target:l.target})}function _(t){t?d||(d=setInterval(y,10)):d&&(clearInterval(d),d=null)}function p(t){t?(f.on(c.touch.move,v),f.on(c.touch.up,m)):(f.off(c.touch.move,v),f.off(c.touch.up,m))}function m(e){_(!1),p(!1),e=t.event(e),s.x&&(a=e.pageX-n),s.y&&(r=e.pageY-o),s.cb_up&&s.cb_up({distX:a,distY:r})}function v(e){s.capture&&(e.preventDefault(),e.stopImmediatePropagation()),e=t.event(e);var i,l=!1;s.x&&(i=e.pageX-n,null!==s.limit_x?i>=s.limit_x.min&&i<=s.limit_x.max&&(s.min?Math.abs(i)>s.min&&(a=i,l=!0):(a=i,l=!0)):s.min?Math.abs(i)>s.min&&(a=i,l=!0):a=i),s.y&&(i=e.pageY-o,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:a,distY:r,x:e.pageX,y:e.pageY})}function y(){c.el.css({transform:"translate3d("+(e+a)+"px, "+(i+r)+"px, 0px)"})}this.dragable=!0,this.set=function(t){return s=t,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),_(!1))}},OGX.Touches.Move=function(t){"use strict";var e,i,n,o,a,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,parent:null,state:"auto"},u=t,f=!1,h=$("body");function g(t){var e=[];t?c.parent?c.parent.on.apply(c.parent,[u.touch.down,_]):(e=c.target?[u.touch.down,c.target,_]:[u.touch.down,_],u.el.on.apply(u.el,e)):c.parent?c.parent.off.apply(c.parent,[u.touch.down,_]):(e=c.target?[u.touch.down,c.target,_]:[u.touch.down,_],u.el.off.apply(u.el,e))}function _(d){c.capture&&(d.preventDefault(),d.stopImmediatePropagation()),d=t.event(d),e=d.pageX,i=d.pageY,n=0,o=0,a=0,r=0,s=0,l=0,p(!0),c.cb_down&&c.cb_down({target:d.target,x:e,y:i})}function p(t){t?(h.on(u.touch.move,v),h.on(u.touch.up,m)):(h.off(u.touch.move,v),h.off(u.touch.up,m))}function m(s){if(p(!1),s=t.event(s),c.x&&(n=s.pageX-e),c.y&&(o=s.pageY-i),c.cb_up&&c.cb_up({x:s.pageX,y:s.pageY,distX:n,distY:o,dirX:a,dirY:r}),c.cb_click){var l=!1;c.x&&Math.abs(n)<2&&(l=!0),c.y&&Math.abs(o)<2&&(l=!0),l&&c.cb_click(s)}}function v(d){c.capture&&(d.preventDefault(),d.stopImmediatePropagation()),d=t.event(d);var u,f=!1;c.x&&(a=0,sd.pageX&&(a=-1),s=d.pageX,u=d.pageX-e,null!==c.limit_x?u>=c.limit_x.min&&u<=c.limit_x.max&&(c.min?Math.abs(u)>c.min&&(n=u,f=!0):(n=u,f=!0)):c.min?Math.abs(u)>c.min&&(n=u,f=!0):(n=u,f=!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&&(o=u,f=!0):(o=u,f=!0)):(o=u,f=!0)),f&&c.cb_move&&c.cb_move({distX:n,distY:o,dirX:a,dirY:r,x:d.pageX,y:d.pageY})}this.set=function(t){return c=t,OGX.Data.merge(c,d),"auto"===c.state&&(u.enable,u.disable,this.enable()),this.state=c.state,c},this.enable=function(){!f&&c&&(f=!0,g(!0))},this.disable=function(){f&&(f=!1,g(!1),p(!1))}},OGX.Touch.HOLD_START="TouchHoldStart",OGX.Touch.HOLD_END="TouchHoldEnd",require("Tree","Uxi","Touch"),OGX.Tree=function(t){construct(this,"Tree");var e,i,n,o,a,r,s,l,c=this,d='{{$label}}',u=t,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:d}},file:{mode:"file",display:{html:d}},folder:{mode:"folder",display:{html:d}}},data:{_id:0,type:"root",state:"closed",label:null,items:[]},display:null,callbacks:{select:null,unselect:null,open:null,close:null,move:null}},h="_id",g=0;function _(t,e,i,n,o){return t[h]===o[h]&&e}function p(t,e){var i={container_display:"",container_css:"",arrow_display:"",arrow_style:"ogx_tree_item_arrow_open",state:"open",type:e.type};return i[h]=e[h],OGX.Data.merge(i,t,!0),OGX.Templater.make('
',i)}function m(){var t=p({},u.data);e.html(t),u.data.element=e.children(".ogx_tree_item").first(),u.data.uxi=c,O(u.data,c),u.show_root||u.data.element.addClass("ogx_tree_root_hidden")}function v(){m(),y(u.data,c)}function y(t,e){if(t.parent=e,t.hasOwnProperty("items")){var i,n;!t.items.hasOwnProperty("insert")&&(t.items=new OGX.List(t.items)),u.sort.enabled&&t.items.order(u.sort.property,u.sort.way);for(var o=0;o .ogx_tree_item_content';if(i.display.hasOML()){var o=i.display.oml(n,t,!1);OGX.OML.render(e,o,t),t.uxi=e.nodes.last()}else{var a=i.display.html(t);a=OGX.Templater.make(a,t),$(n).html(a)}}function b(t){return delete t.element,delete t.parent,delete t.uxi,delete t.state,l||delete t[h],!1}function w(t){"folder"===k(t).mode&&(t.items.length?t.element.attr("data-empty",!1):(t.element.attr("data-state","closed").attr("data-compound",t.type+"-closed").attr("data-empty",!0),t.element.children(".ogx_tree_item_arrow").addClass("ogx_tree_item_arrow_disabled")),"open"===t.state?(t.element.attr("data-state","open").attr("data-compound",t.type+"-open"),t.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_close").removeClass("ogx_tree_item_arrow_disabled").addClass("ogx_tree_item_arrow_open"),t.element.children(".ogx_tree_item_container").removeClass("ogx_tree_item_container_hidden")):(t.element.attr("data-state","open").attr("data-compound",t.type+"-closed"),t.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_open").addClass("ogx_tree_item_arrow_close"),t.element.children(".ogx_tree_item_container").addClass("ogx_tree_item_container_hidden")))}function G(){if(s){var t=E(s);t&&t.children(".ogx_tree_item_content").removeClass("ogx_tree_selected_item"),s=null}}function X(){return!!s&&D(s)}function T(t){var e=E(t);e&&(s=t,e.children(".ogx_tree_item_content").addClass("ogx_tree_selected_item"))}function C(t,e){return L((function(i){return i[h]===e&&(i.hasOwnProperty("items")||(i.items=new OGX.List),!i.items.hasOwnProperty("insert")&&(i.items=new OGX.List(i.items)),i.items.push(t),i.state="open",w(i),!0)}))}function D(t){if(!t||"root"===t)return u.data;return L((function(e,i){return e[h]===t&&e}))}function E(t){var e=D(t);return!!e&&e.element}function S(){g=1,L((function(t){return t[h]=g++,t.hasOwnProperty("type")||(t.hasOwnProperty("items")?t.type="folder":t.type="file"),!1}))}function L(t,e,i){var n;return void 0===e&&(e=null),void 0===i&&(i=u.data),(n=function i(o,a,r,s){if(n=t(o,a,r,s,e))return n;if(o.hasOwnProperty("items")&&o.items.length)for(var l=0;l .ogx_tree_item_content",(function(t){t.preventDefault(),M($(this).parent(0)),1!==$(this).parent(0).data("id")&&function(){a&&clearInterval(a);r=(new Date).getTime(),a=setInterval(I,50)}()})),$(document).on(c.touch.up,(function(){P(),n&&(A(!1),function(){var t=n.offset().left,a=n.offset().top,r=(l=t,d=a,L((function(t,e){return u=t.element.offset(),f=t.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()&&t}))),s=k(r);var l,d,u,f;!r||r&&(r[h]===i[h]||"folder"!==s.mode)?(o.css("opacity",1),n.remove(),n=null,i=null):(_=r,function(t){L((function(e,i,n,o){return e[h]===t&&(n.items.splice(o,1),n.items.length||(n.state="closed"),w(n),!0)}))}((g=i)[h]),C(g,_[h]),_.element.children(".ogx_tree_item_container").empty(),_.state="open",y(_,_.element),w(_),o.remove(),n.remove(),n=null,c.onMove(i),e.trigger(OGX.Tree.DROP,i),i=null);var g,_}())}))):e.on("click",".ogx_tree_item > .ogx_tree_item_content",(function(t){M($(this).parent(0))})),e.on(c.touch.down,".ogx_tree_item_arrow",(function(t){t.preventDefault(),P();var i=D($(this).parent(0).data("id"));i&&i.hasOwnProperty("items")&&i.items.length&&("open"===i.state?(c.onClose(i),e.trigger(OGX.Tree.CLOSE,i)):(c.onOpen(i),e.trigger(OGX.Tree.OPEN,i)),"open"===i.state?i.state="closed":i.state="open",w(i))}))):(u.editable?e.off(c.touch.down,".ogx_tree_item > .ogx_tree_item_content"):e.off("click",".ogx_tree_item > .ogx_tree_item_content"),e.off(c.touch.down,".ogx_tree_item_arrow"))}function I(){var t;(new Date).getTime()-r>=u.drag_after&&(s&&(i=D(s))&&(t=i.element,o=t,(n=t.clone()).children(".ogx_tree_item_arrow").css("display","none"),t.css("opacity",.3),n.addClass("ogx_tree_item_drag"),n.css({top:t.offset().top,left:t.offset().left}),e.prepend(n),A(!0),e.trigger(OGX.Tree.DRAG,i)),P())}function A(t){t?$(document).on(c.touch.move,(function(t){t=function(t){if(t.hasOwnProperty("originalEvent")&&void 0!==t.originalEvent.changedTouches)return t.originalEvent.changedTouches[0];return t}(t),n.css({top:t.pageY+"px",left:t.pageX+"px"})})):$(document).off(c.touch.move)}function P(){a&&(clearInterval(a),a=null)}this.onFocus=function(){return N(!0),this},this.onBlur=function(){return N(!1),this},this.onSelect=function(){},this.onUnselect=function(){},this.onOpen=function(){},this.onClose=function(){},this.onMove=function(){},this.addItem=function(t,e){if(void 0===e&&(e=s),e){var i=D(e);if("folder"===k(i).mode){l||(t[h]=++g),C(t,e);var n=k(t);x(i.element.children(".ogx_tree_item_container").first(),t),O(t,i.parent);var o=i.uxi;return n.display.hasOML()&&(o=i.uxi.nodes.last()),y(t,o),i.element.data("state","open"),i.element.data("compound",t.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(t){var e,i,n=D(t);return!!n&&(e=n,i={},OGX.Data.merge(i,e),b(i),i)},this.selectItem=function(t){return T(t),X()},this.selectItemByPropVal=function(t,e){var i=function(t,e){function i(i,n){return!(!i.data.hasOwnProperty(t)||i.data[t]!==e)&&n+"/"+i.label}return L(i)}(t,e);return!!i&&(G(),T(i[h]),X())},this.selectItemByPath=function(t){var e=function(t){var e=function(t){function e(e,i){return t===i+"/"+e.label&&e}return L(e)}(t);if(e)return e.element;return!1}(t);return!!e&&(G(),e.children(".ogx_tree_item_content").addClass("ogx_tree_selected_item"),s=e.data("id"),X())},this.updateItem=function(t,e,i){void 0===i&&(i=!0);var n=D(t);if(n){if(n.uxi){var o=n.uxi.el;n.uxi.kill(),o.empty()}else i&&n.element.children(".ogx_tree_item_container").empty();OGX.Data.merge(n,e,!0),O(n,n.parent),i&&n.hasOwnProperty("items")&&n.items.length&&(y(n,n.parent),n.element.children(".ogx_tree_item_arrow").removeClass("ogx_tree_item_arrow_disabled ogx_tree_item_arrow_close").addClass("ogx_tree_item_arrow_open"),n.element.attr("state","open").attr("state",n.type+"-open"))}},this.replaceItem=function(t){var e=D(t[h]);e&&(e.uxi&&e.uxi.kill(),OGX.Data.merge(t,e,!1),O(e,e.parent),e.hasOwnProperty("items")&&e.items.length&&y(e,e.parent))},this.deleteItem=function(t){var e=D(t);if(e){var i=function(t){function e(e){return!(!e.hasOwnProperty("items")||!e.items.get({_id:{eq:t}},null,1))&&e}return L(e)}(t);return e.uxi&&e.uxi.kill(),i.items.findDelete("_id",t,1),e.element.remove(),i.items.length||(i.state="closed"),w(i),e}},this.deleteSelectedItem=function(){return function(){function t(t,e,i,n){if(t[h]===s)return t.element.remove(),i.items.splice(n,1),w(i),!0}if(s)return L(t);return!1}()},this.getSelectedItem=function(){return X()},this.getTree=function(){var t=L(b,null,OGX.Data.clone(u.data));return t||!1},this.setData=function(t){t.hasOwnProperty("types")&&this.setTypes(t.types),t.hasOwnProperty("tree")&&this.setTree(t.tree)},this.setTypes=function(t){u.types=t},this.setTree=function(t){this.scroll?this.clear([this.scroller.id]):this.clear(),u.data=t,u.data.hasOwnProperty("state")||(u.data.state="open"),l||S(),v()},this.newTree=function(){c.scroll?c.clear([c.scroller.id]):c.clear();g=0,m()},this.filterTree=function(t){!function(t){var e=[];function i(n,o,a,r){if(-1!==(o+n.label).indexOf(t)&&e.push(o+"/"+n.label),n.hasOwnProperty("items")&&n.items.length)for(var s=0;s .ogx_scroller_inner',(i=$(t.el)).addClass(n).attr("data-ogx-id",this.id),e&&i.attr("id",this.id);var a=this;setTimeout((function(){a.scroller.resize()}),0)}else i.append(o),t.el='.ogx_uxi[data-ogx-id="'+this.id+'"]';this.el=$(t.el)}},OGX.Uxi.prototype.enable=function(t){return this.enabled||(this.enabled=!0,this.focus(t)),this},OGX.Uxi.prototype.disable=function(t){return this.enabled&&(this.enabled=!1,this.blur(t)),this},OGX.Uxi.prototype.ux=function(){},OGX.Uxi.prototype.onFocus=function(){},OGX.Uxi.prototype.onBlur=function(){},OGX.Uxi.onFocus=function(){},OGX.Uxi.onBlur=function(){},OGX.Uxi.prototype.construct=function(){},OGX.Uxi.prototype.destroy=function(){},OGX.Uxi.prototype.resize=function(t){return void 0===t&&(t=!1),t&&this.resizeNodes(),this},OGX.Uxi.prototype.show=function(){return this._show()},OGX.Uxi.prototype.hide=function(){return this._hide()},OGX.Uxi.prototype._show=function(){return this.el&&(this.visible=!0,this.el.removeClass("ogx_uxi_hidden")),this},OGX.Uxi.prototype._hide=function(){return this.el&&(this.visible=!1,this.el.addClass("ogx_uxi_hidden")),this},OGX.Uxi.prototype.empty=function(){return this.clear(),this},OGX.Uxi.prototype.observe=function(t,e,i,n,o){var a=this,r=this.el,s=null;if(void 0!==o&&(r=o),t){if(!this.observer)return void 0!==e&&e||(e={childList:!0,subtree:!0}),this.observer=new MutationObserver((function(t,e){t.forEach((function(t){s&&clearTimeout(s),s=setTimeout((()=>{void 0!==i?i(t,n):a.el.trigger(OGX.View.CHANGED,t)}),10)}))})),this.observer.observe(r[0],e),!0}else if(this.observer)return this.observer.disconnect(),this.observer=null,!0;return!1},OGX.Uxi.prototype.observeOnce=function(t,e,i,n){var o=this;this.observe(!0,t,(function(){o.observe(!1),void 0!==e&&e(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(t){return t=void 0===t?this.__parent:$(t),this.sleeping&&(this.sleeping=!1,t.prepend(this.el),this.el=t.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(t,e){return this.parent=t,this.parent.nodes.insert(this),this.selector=e,this.wake(e),setTimeout((()=>this.resize),0),this},OGX.Uxi.prototype.resizeNodes=function(){for(var t=this.gather(),e=0;e0&&"Carousel"===e[i]._NAME_&&"Container"===e[i-1]._NAME_||(e[i].floating?e[i].show(t):e[i].show(this._NAME_,this.id));return this}},OGX.Uxi.prototype.focus=function(t){if(void 0===t&&(t=1),this.blured)switch(this.blured=!1,this.ux(!0),this.__proto__.onFocus(),this.onFocus(),t){case 1:this.focusNodes();break;case 2:this.focusTree()}return this},OGX.Uxi.prototype.focusTree=function(){for(var t=this.gather(),e=0;ee&&(e=t)})),e+1},OGX.Uxi.prototype.stage=function(){return function t(e){if(e.parent)return"Stage"!==e.parent._NAME_?t(e.parent):e.parent}(this)},OGX.Uxi.prototype.on=function(){this.el&&this.el.on.apply(this.el,arguments)},OGX.Uxi.prototype.off=function(){this.el&&this.el.off.apply(this.el,arguments)},OGX.Uxi.prototype.toJSON=function(){return{type:this._NAME_,id:this.id,selector:this.selector,data:this.data}},OGX.Uxi.prototype.toOML=function(){var t={},e=this.selector+":"+this._NAME_;if(t[e]={id:this.id,data:this.data,"node:OML":[]},this.nodes.length)for(var i=0;i$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,touch_drag;function genIcons(){for(var t="",e=0;e";return t}function listenBackIcon(t){t?that.el.on(that.touch.down,".ogx_window_main_back",onBack):that.el.off(that.touch.down,".ogx_window_main_back",onBack)}function onBack(t){t.preventDefault(),t.stopImmediatePropagation(),that.el.trigger(OGX.Window.HIT_BACK,that),that.hide()}function listenIcons(t){t?that.el.on(that.touch.down,".ogx_window_icon",onIcon):that.el.off(that.touch.down,".ogx_window_icon",onIcon)}function onIcon(t){t.preventDefault(),t.stopImmediatePropagation();var e=$(this).index();if("string"==typeof config.icons[e])that.el.trigger(OGX.Window.HIT_ICON,{index:e,id:config.id});else{var i=e;config.icons[e].hasOwnProperty("callback")&&config.icons[e].callback&&(config.icons[e].hasOwnProperty("params")&&(i=config.icons[e].params),config.icons[e].callback.call(null,i))}}function onDrag(t){(t.distX*dir.x>config.close_dist||t.distY*dir.y>config.close_dist)&&that.hide()}function onRelease(t){t.distX*dir.x>config.close_dist||t.distY*dir.y>config.close_dist?that.hide():(t.distX||t.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 t=prepWindow();container.html(t),zd=config.zindex?config.zindex:config.parent.topIndex();var e=getLimitedSize();container.css({width:e.width,height:e.height,"z-index":zd})}function getLimitedSize(){var t,e,i,n=config.parent.el.width(),o=config.parent.el.height();user_resized?(n=config.width,o=config.height):(t=OGX.Data.getBestSize(n,config.width),e=OGX.Data.getBestSize(o,config.height));var a={width:t,height:e};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&&(a.width=config.max_width+"px")):(-1!==(i=config.width).indexOf("px")&&(i=Number(i.split("px")[0])),config.min_width&&iconfig.max_width&&(a.width=config.max_width+"px"))),(config.min_height||config.max_height)&&(-1!==config.height.indexOf("%")?(o=config.parent.el.height(),i=Number(config.height.split("%")[0])*o/100,config.min_height&&iconfig.max_height&&(a.height=config.max_height+"px")):(-1!==(i=config.height).indexOf("px")&&(i=Number(i.split("px")[0])),config.min_height&&iconfig.max_height&&(a.height=config.max_height+"px"))),a}function listenBody(t){t?that.parent.el.on(that.touch.down,".ogx_overlay",onBody):that.parent.el.off(that.touch.down,".ogx_overlay",onBody)}function onBody(t){that.status===OGX.Window.OPEN&&(that.hide(),that.parent.removeOverlay(OGX.Overlay.Fade))}function animWindow(t,e,i,n){void 0!==e&&!0!==e||(e=config.anim);var o={opac:1,tX:0,tY:0},a=container.parent().width(),r=container.parent().height(),s=that.el.outerWidth(),l=that.el.outerHeight(),c=that.el.find(".ogx_window_main_icon").first();switch(t&&(placeWindow(!0),c.removeClass("ogx_window_main_icon_left ogx_window_main_icon_right ogx_window_main_icon_top")),e){case OGX.Window.ANIM_NONE:break;case OGX.Window.ANIM_TOP:t?(o.tY=0,c.addClass("ogx_window_main_icon_top")):o.tY=-l-10;break;case OGX.Window.ANIM_BOTTOM:t?(o.tY=0,c.addClass("ogx_window_main_icon_bottom")):o.tY=r+10;break;case OGX.Window.ANIM_RIGHT:t?(o.tX=a-s,c.addClass("ogx_window_main_icon_right")):o.tX=a+10;break;case OGX.Window.ANIM_LEFT:t?(o.tX=0,c.addClass("ogx_window_main_icon_left")):o.tX=-s-10}var d=100;t?(pt.x=o.tX,pt.y=o.tY):d=0,setTimeout((function(){dir.x,that.el.on("transitionend",(function(){that.el.off("transitionend"),t?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),t?(that.status=OGX.Window.OPEN,that.el.trigger(OGX.Window.OPEN,that)):(that.status=OGX.Window.CLOSED,that.el.trigger(OGX.Window.CLOSED,that))})),t?(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&&(t?that.el.addClass("ogx_window_anim_in"):that.el.addClass("ogx_window_anim_out")),that.el.css({transform:"translate3d("+o.tX+"px, "+o.tY+"px, 0px)",opacity:o.opac,visibility:"visible"})}),d)}function placeWindow(t){var e=container.parent().width(),i=container.parent().height(),n=that.el.outerHeight(),o=that.el.outerWidth();that.el.removeClass("ogx_window_anim_in").removeClass("ogx_window_anim_out");var a={x:0,y:0};switch(config.anim){case OGX.Window.ANIM_TOP:a.y=t?-n:n,dir.y=-1;break;case OGX.Window.ANIM_BOTTOM:a.y=t?i:i-n,dir.y=1;break;case OGX.Window.ANIM_RIGHT:a.x=t?e:e-o,dir.x=1;break;case OGX.Window.ANIM_LEFT:t&&(a.x=-o),dir.x=-1}that.el.css({transform:"translate3d("+a.x+"px, "+a.y+"px, 0px)"})}function prepWindow(){var t=new OGX.Display(config),e={};e.head=config.head,e.title=config.title,e.icons=config.icons,e.html=t.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,e.side="right";break;case OGX.Window.ANIM_LEFT:n=config.win_inner.reverse(),e.side="left"}n=n.toString().replace(/>,<"),i=i.replace("$INNER",n);var o="";return config.icons&&config.icons.length&&(o=genIcons()),i=i.replace("$ICONS",o),OGX.Templater.make(i,e)}function onResize(){user_resized=!0,that.resizeNodes()}function listenScroll(t){t?(that.el.on(OGX.Scroller.START,(function(){that.onBlur()})),that.el.on(OGX.Scroller.END,(function(){that.onFocus()}))):(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 t={state:"manual"},e={top:!1,bottom:!1,left:!1,right:!1,cb_resize:onResize};switch(e.min_width=config.min_width,e.min_height=config.min_width,e.max_width=config.max_width,e.max_height=config.max_height,t.cb_drag=onDrag,t.cb_up=onRelease,config.anim){case OGX.Window.ANIM_LEFT:t.x=!0,t.y=!1,t.limit_x={min:-300,max:0},e.right=!0;break;case OGX.Window.ANIM_RIGHT:t.x=!0,t.y=!1,t.limit_x={min:0,max:300},e.left=!0;break;case OGX.Window.ANIM_TOP:t.x=!1,t.y=!0,t.limit_y={min:-300,max:0},e.bottom=!0;break;case OGX.Window.ANIM_BOTTOM:t.x=!1,t.y=!0,t.limit_y={min:0,max:300},e.top=!0}touch_drag=that.touch.add("Drag",t)}config.resize&&that.setResize(e),config.show&&that.show(),config.scroll&&listenScroll(!0)}this.id=config.id,this.dragable=null,this.resizeable=null,this.status=OGX.Window.CLOSED,this.onFocus=function(){return config.close_on_click_out&&listenBody(!0),config.head&&listenBackIcon(!0),config.icons&&listenIcons(!0),config.drag&&touch_drag.enable(),config.resize&&this.enableResize(),this},this.onBlur=function(){return config.close_on_click_out&&listenBody(!1),config.head&&listenBackIcon(!1),config.icons&&listenIcons(!1),config.drag&&touch_drag.disable(),config.resize&&this.disableResize(),this},this.show=function(t,e,i){return this.visible||(this._show(),config.drag&&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==t&&(t=config.anim),setTimeout((function(){animWindow(!0,t,e,i)}),showto),showto&&(showto=0))),this},this.hide=function(t,e,i){return this.visible&&(this._hide(),config.drag&&touch_drag.disable(),config.resize&&this.disableResize(),listenScroll(!1),-1===[OGX.Window.CLOSED,OGX.Window.CLOSING].indexOf(this.status)&&(this.blur(1),void 0!==t&&!0!==t||(t=config.anim),animWindow(!1,t,e,i))),this},this.resize=function(){var t=getLimitedSize();return container.css({width:t.width,height:t.height}),this.place(),this},this.destroy=function(){config.scroll&&listenScroll(!1),this.touch.wipe()},this.icons=function(t){if(void 0===t)return config.icons;config.icons&&config.icons.length&&listenIcons(!1),config.icons=t,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(t){t?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 t=0,e=new OGX.List;function i(t,e,i,n){var o;if(void 0===e&&(e=null),void 0===i&&(i=!1),void 0===n&&(n=null),"string"==typeof t)o=new Worker(t);else{var a="";if(e){for(var r=0;r