New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@evs-chris/raui

Package Overview
Dependencies
Maintainers
1
Versions
175
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@evs-chris/raui - npm Package Compare versions

Comparing version

to
0.8.0

es/validate.d.ts

2

es/AppBar.js
import Ractive from 'ractive';
import globalRegister from './globalRegister';
export var AppBar = (function (Ractive) {
export var AppBar = /*@__PURE__*/(function (Ractive) {
function AppBar(opts) { Ractive.call(this, opts); }

@@ -6,0 +6,0 @@

@@ -44,3 +44,3 @@ import globalRegister from './globalRegister';

export var Chart = (function (Ractive) {
export var Chart = /*@__PURE__*/(function (Ractive) {
function Chart(opts) { Ractive.call(this, opts); }

@@ -47,0 +47,0 @@

@@ -24,3 +24,3 @@ import Ractive from 'ractive';

export var DatePicker = (function (Ractive) {
export var DatePicker = /*@__PURE__*/(function (Ractive) {
function DatePicker(opts) { Ractive.call(this, opts); }

@@ -27,0 +27,0 @@

@@ -37,3 +37,3 @@ import Ractive from 'ractive';

export var JSONEditor = (function (Ractive) {
export var JSONEditor = /*@__PURE__*/(function (Ractive) {
function JSONEditor(opts) { Ractive.call(this, opts); }

@@ -40,0 +40,0 @@

@@ -19,3 +19,3 @@ import Ractive from 'ractive';

export var Menu = (function (Ractive) {
export var Menu = /*@__PURE__*/(function (Ractive) {
function Menu(opt) {

@@ -86,4 +86,2 @@ Ractive.call(this, opts);

Menu.prototype.popAllIn = function popAllIn (path) {
var this$1 = this;
if (!path) { path = ''; }

@@ -93,3 +91,3 @@ var item = this.get(path);

for (var i = 0; i < item.items.length; i++) {
this$1.popAllIn(((path ? (path + ".") : '') + "items." + i));
this.popAllIn(((path ? (path + ".") : '') + "items." + i));
}

@@ -127,8 +125,6 @@ }

Menu.prototype.childActive = function childActive (path) {
var this$1 = this;
var item = this.get(path);
if (item && item.items) {
for (var i = 0; i < item.items.length; i++) {
if (this$1.get((path + ".items." + i + ".active")) === true || (typeof item.items[i].active === 'function' && item.items[i].active()) || (this$1.get((path + ".items." + i + ".activeRef")) && this$1.get(item.items[i].activeRef)) || this$1.childActive((path + ".items." + i))) { return true; }
if (this.get((path + ".items." + i + ".active")) === true || (typeof item.items[i].active === 'function' && item.items[i].active()) || (this.get((path + ".items." + i + ".activeRef")) && this.get(item.items[i].activeRef)) || this.childActive((path + ".items." + i))) { return true; }
}

@@ -135,0 +131,0 @@ }

@@ -1,1 +0,1 @@

import Ractive from"ractive";import expand from"./transition-expand";import clickout from"./event-clickout";import globalRegister from"./globalRegister";function findRef(items,ref){for(var i=0;i<items.length;i++){if(items[i].ref===ref){return[items[i]]}else if(items[i].items){var res=findRef(items[i].items,ref);if(res){res.unshift(items[i]);return res}}}}export var Menu=function(Ractive){function Menu(opt){Ractive.call(this,opts);this.refs={}}if(Ractive)Menu.__proto__=Ractive;Menu.prototype=Object.create(Ractive&&Ractive.prototype);Menu.prototype.constructor=Menu;Menu.prototype.addItem=function addItem(item,idx){if(typeof idx==="number"){this.splice("items",idx,0,item)}else{this.push("items",item)}return new Handle(this,null,item)};Menu.prototype.visibleItems=function visibleItems(items){var this$1=this;return items.filter(function(i){return i.condition!==false&&(typeof i.condition!=="string"||this$1.get(i.condition)!==false)}).length};Menu.prototype.getHandle=function getHandle(what){var this$1=this;var ctx;if(typeof what==="string"){if(this.refs[what]){ctx=this.refs[what].ctx}else{var el=this.find(what);if(el){ctx=this.getContext(el)}else{var path=findRef(this.get("items"),what);if(path){return path.reduce(function(a,c){return new Handle(this$1,a,c)},null)}}}}else if(what&&what.parentNode){ctx=this.getContext(what)}else if(what&&what.decorators){ctx=what}if(ctx){var path$1=[ctx.get()];var str="../../";while(ctx.resolve(str)!==""){path$1.unshift(ctx.get(str));str+="../../"}return path$1.reduce(function(a,c){return new Handle(this$1,a,c)},null)}};Menu.prototype.popAllIn=function popAllIn(path){var this$1=this;if(!path){path=""}var item=this.get(path);if(item&&item.items){for(var i=0;i<item.items.length;i++){this$1.popAllIn((path?path+".":"")+"items."+i)}}if(item.open&&item.popout){this.set((path?path+".":"")+"open",false)}};Menu.prototype.popSiblingsIn=function popSiblingsIn(ctx){var me=ctx.resolve();var items=ctx.get("../");if(items){for(var i=0;i<items.length;i++){if(me===ctx.resolve("../"+i)){continue}if(items[i].open&&items[i].popout){ctx.toggle("../"+i+".open")}}}};Menu.prototype._actioned=function _actioned(){this.fire("action");this.popAllIn()};Menu.prototype._itemRendered=function _itemRendered(ctx){var this$1=this;setTimeout(function(){return this$1.fire("item",ctx,this$1.getHandle(ctx))});return""};Menu.prototype.childActive=function childActive(path){var this$1=this;var item=this.get(path);if(item&&item.items){for(var i=0;i<item.items.length;i++){if(this$1.get(path+".items."+i+".active")===true||typeof item.items[i].active==="function"&&item.items[i].active()||this$1.get(path+".items."+i+".activeRef")&&this$1.get(item.items[i].activeRef)||this$1.childActive(path+".items."+i)){return true}}}};return Menu}(Ractive);Ractive.extendWith(Menu,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-wrapper",g:1},{t:16,r:"extra-attributes"},{n:"class-rmenu-vertical",t:13,f:[{t:2,x:{r:["~/horizontal"],s:"!_0"}}]},{n:"class-rmenu-horizontal",t:13,f:[{t:2,r:"~/horizontal"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-inner",g:1}],f:[{t:8,r:"items"}]}]}]}],e:{"!_0":function(_0){return!_0},"_0||_1":function(_0,_1){return _0||_1},'_0&&(_1||_2==="section")':function(_0,_1,_2){return _0&&(_1||_2==="section")},"_0?_3.active(_1.getHandle((_2))):_3.active()":function(_0,_1,_2,_3){return _0?_3.active(_1.getHandle(_2)):_3.active()},'typeof _0==="function"':function(_0){return typeof _0==="function"},'typeof _0==="boolean"':function(_0){return typeof _0==="boolean"},"_0.childActive(_1)":function(_0,_1){return _0.childActive(_1)},"_0!=null":function(_0){return _0!=null},"[_0.action(),_1._actioned()]":function(_0,_1){return[_0.action(),_1._actioned()]},"[_0._actioned()]":function(_0){return[_0._actioned()]},'[_0&&_1.popSiblingsIn((_2)),(_2).toggle(".open"),false]':function(_0,_1,_2){return[_0&&_1.popSiblingsIn(_2),_2.toggle(".open"),false]},"_0||(_1&&_2[_1])":function(_0,_1,_2){return _0||_1&&_2[_1]},'[{axis:"x"}]':function(){return[{axis:"x"}]},"_2&&_0&&_1.visibleItems(_2)":function(_0,_1,_2){return _2&&_0&&_1.visibleItems(_2)},"[_0.popAllIn(_1),false]":function(_0,_1){return[_0.popAllIn(_1),false]},'!_0||_0==="item"':function(_0){return!_0||_0==="item"},'_0==="section"':function(_0){return _0==="section"},'_0==="container"':function(_0){return _0==="container"},'(!_0||_0==="item")&&_1':function(_0,_1){return(!_0||_0==="item")&&_1},"[_0.popAllIn(_1)]":function(_0,_1){return[_0.popAllIn(_1)]},"[_0]":function(_0){return[_0]},'typeof _0==="string"':function(_0){return typeof _0==="string"},'_0||"item"':function(_0){return _0||"item"},"_0._itemRendered((_1))":function(_0,_1){return _0._itemRendered(_1)},'_1===undefined||(typeof _1==="boolean"&&_1)||(typeof _1==="string"&&_0[_1])||(typeof _1==="function"&&_2.condition())':function(_0,_1,_2){return _1===undefined||typeof _1==="boolean"&&_1||typeof _1==="string"&&_0[_1]||typeof _1==="function"&&_2.condition()}},p:{container:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-container-pad",g:1}],f:[{t:3,r:".content"}]}],n:50,r:".pad"},{t:4,f:[{t:3,r:".content"}],n:51,l:1}],n:50,r:".content"},{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-container-pad",g:1}],f:[{t:16,r:".contentPartial"}]}],n:50,r:".pad"},{t:4,f:[{t:16,r:".contentPartial"}],n:51,l:1}],n:50,r:".contentPartial",l:1}],section:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-main",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-title",g:1}],f:[{t:4,f:[{t:2,r:".title"}],n:50,r:".title"},{t:4,f:[{t:16,r:".titlePartial"}],n:50,r:".titlePartial",l:1}]}]}],n:50,x:{r:[".title",".titlePartial"],s:"_0||_1"}}," ",{t:8,r:"children"}],children:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-items",g:1},{t:4,f:[{n:"expand",t:72,v:"t0"}],n:50,x:{r:[".popout"],s:"!_0"}},{t:4,f:[{n:"pop",t:72,v:"t0"}],n:51,l:1},{n:"class-rmenu-shrink",t:13,f:[{t:2,r:".shrink"}]}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-popitems",g:1}],f:[{t:8,r:"items"}]}],n:50,r:".popout"},{t:4,f:[{t:8,r:"items"}],n:51,l:1}]}],n:50,x:{r:[".items.length",".open",".type"],s:'_0&&(_1||_2==="section")'}}],item:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-main",g:1},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,rx:{r:"~/",m:[{t:30,n:".activeRef"}]}}]}],n:50,r:".activeRef"},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,x:{r:[".active.length","@this","@context","."],s:"_0?_3.active(_1.getHandle((_2))):_3.active()"}}]}],n:50,x:{r:[".active"],s:'typeof _0==="function"'},l:1},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,r:".active"}]}],n:50,x:{r:[".active"],s:'typeof _0==="boolean"'},l:1},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,x:{r:["@this","@keypath"],s:"_0.childActive(_1)"}}]}],n:50,r:".popout",l:1},{t:4,f:[{n:"class-rmenu-disabled",t:13,f:[{t:2,r:".disabled"}]}],n:50,x:{r:[".disabled"],s:"_0!=null"}},{t:4,f:[{n:"class-rmenu-disabled",t:13,f:[{t:2,rx:{r:"~/",m:[{t:30,n:".disabledRef"}]}}]}],n:50,r:".disabledRef",l:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"menu-left",g:1}],f:[{t:3,r:".left"}]}],n:50,r:".left"},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-left",g:1}],f:[{t:16,r:".leftPartial"}]}],n:50,r:".leftPartial",l:1}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-title",g:1},{t:4,f:[{t:4,f:[{n:["click"],t:70,f:{r:[".","@this"],s:"[_0.action(),_1._actioned()]"}}],n:50,x:{r:[".action"],s:'typeof _0==="function"'}},{t:4,f:[{t:16,r:".actionPartial"},{n:["click"],t:70,f:{r:["@this"],s:"[_0._actioned()]"}}],n:50,r:".actionPartial",l:1},{t:4,f:[{n:["click"],t:70,f:{r:[".popout","@this","@context"],s:'[_0&&_1.popSiblingsIn((_2)),(_2).toggle(".open"),false]'}}],n:50,r:".items.length",l:1}],n:51,x:{r:[".disabled",".disabledRef","~/"],s:"_0||(_1&&_2[_1])"}}],f:[{t:4,f:[{t:3,r:".title"}],n:50,r:".title"},{t:4,f:[{t:16,r:".titlePartial"}],n:50,r:".titlePartial",l:1}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"menu-right",g:1}],f:[{t:3,r:".right"}]}],n:50,r:".right"},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-right",g:1}],f:[{t:16,r:".rightPartial"}]}],n:50,r:".rightPartial",l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-expand",g:1},{n:["click"],t:70,f:{r:[".popout","@this","@context"],s:'[_0&&_1.popSiblingsIn((_2)),(_2).toggle(".open"),false]'}},{n:"expand",t:72,f:{r:[],s:'[{axis:"x"}]'},v:"t0"}]}],n:50,x:{r:[".items.length","@this",".items"],s:"_2&&_0&&_1.visibleItems(_2)"}}]}," ",{t:8,r:"children"}],items:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-popout-close",g:1},{n:["click"],t:70,f:{r:["@this","@keypath"],s:"[_0.popAllIn(_1),false]"}}],f:["❌ Close"]}],n:50,r:".shrink"}," ",{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-entry",g:1},{t:4,f:[{n:"class-rmenu-item",t:13}],n:50,x:{r:[".type"],s:'!_0||_0==="item"'}},{t:4,f:[{n:"class-rmenu-section",t:13}],n:50,x:{r:[".type"],s:'_0==="section"'},l:1},{t:4,f:[{n:"class-rmenu-container",t:13}],n:50,x:{r:[".type"],s:'_0==="container"'},l:1},{n:"class-rmenu-expanded",t:13,f:[{t:2,r:".open"}]},{n:"class-rmenu-popout",t:13,f:[{t:2,x:{r:[".type",".popout"],s:'(!_0||_0==="item")&&_1'}}]},{t:4,f:[{n:"pop",t:72,v:"t0"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this","@keypath"],s:"[_0.popAllIn(_1)]"}}],n:50,r:".open"}," "],n:50,r:".popout"},{t:4,f:[{n:"expand",t:72,v:"t0"}],n:50,x:{r:["~/noExpand"],s:"!_0"},l:1},{t:4,f:[{t:8,r:".refPartial"}],n:50,r:".refPartial"},{t:4,f:[{n:"ref",t:71,f:{r:[".ref"],s:"[_0]"}}],n:50,x:{r:[".ref"],s:'typeof _0==="string"'},l:1},{t:4,f:[{t:16,r:".extra"}],n:50,r:".extra"}],f:[{t:8,x:{r:[".type"],s:'_0||"item"'}}," ",{t:4,f:[{t:2,x:{r:["@this","@context"],s:"_0._itemRendered((_1))"}}],n:50,x:{r:[".type"],s:'!_0||_0==="item"'}}]}],n:50,x:{r:["~/",".condition","."],s:'_1===undefined||(typeof _1==="boolean"&&_1)||(typeof _1==="string"&&_0[_1])||(typeof _1==="function"&&_2.condition())'}}],n:52,r:".items"}]}},css:function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.menu.primary"));primary.popout=Object.assign({},data("raui.menu.popout"),data("raui.menu.primary.popout"));var base="\n .rmenu-wrapper {\n position: relative;\n z-index: 1;\n }\n .rmenu-wrapper.rmenu-vertical {\n min-height: 100%;\n }\n .rmenu {\n "+(data("raui.menu.font")?"font-family: "+data("raui.menu.font")+";":"")+"\n color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.fg||"#222")+";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n }\n .rmenu-wrapper.alt > .rmenu {\n color: "+(primary.fga||"#222")+";\n background-color: "+(primary.bg||"#fff")+";\n }\n .rmenu-inner {\n width: 100%;\n height: 100%;\n overflow-y: auto;\n }\n .rmenu-item {\n border-top: 1px solid transparent;\n border-bottom: 1px solid transparent;\n transition: border 0.2s ease-in-out;\n }\n .rmenu-item:hover > .rmenu-main {\n background-color: "+(primary.fga||"#07e")+";\n color: "+(primary.bg||"#fff")+";\n }\n .rmenu-disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .rmenu-popout {\n border: none;\n }\n .rmenu-expanded {\n border-top: 0.0625em solid "+(primary.bc||"#ccc")+";\n border-bottom: 0.0625em solid "+(primary.bc||"#ccc")+";\n }\n .rmenu-popout.rmenu-expanded {\n border: none;\n }\n .rmenu-popout .rmenu-popout.rmenu-expanded {\n background-color: "+(primary.popout.bga||primary.bg||"#fff")+";\n color: "+(primary.popout.fg||primary.fg||"#222")+";\n }\n .rmenu-popitems {\n height: 100%;\n overflow-y: auto;\n }\n .rmenu-main {\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n user-select: none;\n transition: 0.3s ease-in-out;\n transition-property: color, background-color;\n display: flex;\n align-items: center;\n min-height: 1em;\n }\n .rmenu-main.rmenu-active, .rmenu-item:hover > .rmenu-main.rmenu-active {\n color: "+(primary.fga||"#07e")+";\n background-color: "+(primary.bg||"#fff")+";\n }\n .rmenu-popout .rmenu-entry .rmenu-main.rmenu-active, .rmenu-popout .rmenu-item:hover > .rmenu-main.rmenu-active {\n color: "+(primary.popout.bg||primary.bg||"#fff")+";\n background-color: "+(primary.popout.fga||primary.fga||"#07e")+";\n }\n .rmenu-wrapper.alt .rmenu-main.rmenu.active {\n color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.fg||"#222")+";\n }\n .rmenu-popout .rmenu-items .rmenu-item:hover > .rmenu-main {\n background-color: "+(primary.popout.bga||"#f4f4f4")+";\n color: "+(primary.popout.fg||"#222")+";\n }\n \n .rmenu-items {\n display: block;\n }\n .rmenu-right {\n padding-right: 0.4em; \n }\n .rmenu-left {\n padding-left: 0.4em;\n }\n .rmenu-expand {\n width: 1.5em;\n height: 1.5em;\n padding-left: 0.5em;\n cursor: pointer;\n position: relative;\n }\n .rmenu-expand:before {\n position: absolute;\n display: inline-block;\n top: 0.35em;\n content: ' ';\n transform: rotate(45deg);\n transition: transform 0.2s ease-in-out, top 0.2s ease-in-out, left 0.2s ease-in-out;\n box-sizing: border-box;\n border-width: 0.25em;\n border-style: solid;\n border-left-color: transparent;\n border-top-color: transparent;\n }\n .rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n transform: rotate(-135deg);\n top: 0.65em;\n }\n \n .rmenu-popout > .rmenu-items {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: "+(primary.popout.bg||primary.bg||"#fff")+";\n color: "+(primary.popout.fg||primary.fg||"#222")+";\n box-sizing: border-box;\n border-right: 1px solid "+(primary.popout.bc||primary.bc||"#ccc")+";\n z-index: -1;\n transition: box-shadow 0.2s ease-in-out;\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items {\n left: 100%;\n z-index: initial;\n box-shadow: 0.2em 0 0.2em rgba(0, 0, 0, 0.2);\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items .rmenu-popout.rmenu-expanded > .rmenu-items {\n left: calc(100% + 1px);\n }\n \n .rmenu-popout > .rmenu-items.rmenu-shrink {\n left: 100%;\n z-index: 1;\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items.rmenu-shrink,\n .rmenu-popout.rmenu-expanded > .rmenu-items .rmenu-popout.rmenu-expanded > .rmenu-items.rmenu-shrink {\n left: 0;\n }\n \n .rmenu-popout > .rmenu-main > .rmenu-expand:before {\n transform: rotate(-45deg);\n top: 0.4em;\n }\n \n .rmenu-popout.rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n transform: rotate(135deg);\n left: 0.75em;\n }\n \n .rmenu-popout > .rmenu-items .rmenu-popout > .rmenu-items {\n height: 100%;\n width: calc(100% + 1px);\n top: 0px;\n }\n .rmenu-popout > .rmenu-items .rmenu-popout > .rmenu-items.rmenu-shrink {\n height: 100%;\n }\n \n .rmenu-popout-close {\n color: "+(primary.popout.fga||primary.fga||"#07e")+";\n display: block;\n padding: 0.5em;\n cursor: pointer;\n }\n \n .rmenu-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n padding: 0.5em;\n flex-grow: 1;\n }\n .rmenu-disabled > .rmenu-title {\n cursor: not-allowed;\n }\n .rmenu-item h1, .rmenu-item h2, .rmenu-item h3, .rmenu-item h4 {\n margin: 0;\n }\n \n .rmenu-section {\n padding: 0 0 0.75em 0;\n }\n .rmenu-section > .rmenu-main {\n cursor: default;\n font-size: 0.75em;\n opacity: 0.7;\n margin-bottom: 0.25em;\n }\n .rmenu-section > .rmenu-main .rmenu-title {\n cursor: default;\n }\n .rmenu-popout .rmenu-section:first-child > .rmenu-main {\n padding-top: 0;\n }\n .rmenu-popout .rmenu-section > .rmenu-main > .rmenu-title {\n font-size: 1.5em;\n text-align: center;\n padding: 0.75em;\n opacity: 1;\n font-weight: bold;\n color: "+(primary.popout.fg||primary.fg||"#222")+";\n background-color: "+(primary.popout.bga||primary.bga||"#f4f4f4")+";\n border-bottom: 1px solid "+(primary.popout.bc||primary.bc||"#ccc")+";\n border-top: 1px solid "+(primary.popout.bc||primary.bc||"#ccc")+";\n }\n \n .rmenu-container {\n box-sizing: border-box;\n }\n \n .rmenu-container-pad {\n padding: 0.3em 0.3em 0.8em 0.3em;\n }\n ";return base}.call(this,data)].join(" ")},cssId:"menu",noCssTransform:true,noIntro:true,nestedTransitions:false,on:{construct:construct,config:function config(){if(this._items){this.set("items",(this.get("items")||[]).concat(this._items),{shuffle:true})}}},attributes:["noExpand"],use:[expand(),clickout()],decorators:{ref:function ref(node,name){var r=this;var nm=name;if(!r.refs){r.refs={}}var handle={update:function update(name){if(r.refs[nm]===handle){delete r.refs[nm]}nm=name;r.refs[nm]=handle},teardown:function teardown(){if(r.refs[nm]===handle){delete r.refs[nm]}}};handle.ctx=r.getContext(node);r.refs[nm]=handle;return handle}},transitions:{pop:function pop(t,params){var p=t.processParams(params,{duration:200,easing:"easeInOut"});var ctx=this.getContext(t.node);var shrink=ctx.get(".shrink");if(t.isIntro){var rect=t.node.getBoundingClientRect();function findParent(){var n=t.node.parentNode;while(n&&n.classList){if(n.classList.contains("rmenu")){return n}else if(n.parentNode.classList.contains("rmenu-popout")){return n}n=n.parentNode}}if(rect.left+rect.width>window.innerWidth){setTimeout(function(){return ctx.set(".shrink",true)});shrink=true;findParent().style.overflowX="hidden"}else if(shrink){setTimeout(function(){return ctx.set(".shrink",false)});findParent().style.overflowX="";shrink=false}else{findParent().style.overflowX=""}}else{setTimeout(function(){return ctx.set("shrink",false)})}if(t.isIntro){if(shrink){t.setStyle("left","100%");return t.animateStyle("left",0,p)}else{t.setStyle("left",0);t.setStyle("z-index",-1);return t.animateStyle("left","100%",p)}}else{if(shrink){t.setStyle("left",0);return t.animateStyle("left","100%",p)}else{t.setStyle("left","100%");t.setStyle("z-index",-1);return t.animateStyle("left",0,p)}}}}});var justSpace=/^\s*$/;function construct(){var cmp=this.component;if(!cmp){return}var tpl=cmp.template.f||[];var attrs=cmp.template.m?cmp.template.m.slice():[];var t=cmp.template;cmp.template={e:t.e,f:t.f,t:t.t,m:attrs};function item(el){if(el.e!=="item"&&el.e!=="section"&&el.e!=="container"){return}var res={};var as=[];var title;if(el.e!=="item"){res.type=el.e}el.m&&el.m.forEach(function(a){if(a.n==="title"){if(typeof a.f==="string"){res.title=a.f}else{res.titlePartial={t:a.f}}}else if(a.t===70&&a.n[0]==="action"){res.actionPartial={t:[{n:["click"],f:a.f,t:a.t}]}}else if(a.n==="guard"&&a.f&&a.f.length===1&&a.f[0].t===2){var cnd="_cnd"+attrs.length;res.condition=cnd;attrs.push({t:13,n:cnd,f:a.f})}else if(a.n==="ref"){if(typeof a.f==="string"){res.ref=a.f}else if(a.f&&a.f.length===1&&a.f[0].t===2){var cnd$1="_cnd"+attrs.length;attrs.push({t:13,n:cnd$1,f:a.f});res.refPartials={t:[{t:71,n:"ref",f:{r:cnd$1,s:"[_0]"}}]}}}else if(a.n==="active"){if(a.f&&a.f.length===1&&a.f[0].t===2){var cnd$2="_cnd"+attrs.length;res.activeRef=cnd$2;attrs.push({t:13,n:cnd$2,f:a.f})}}else if(a.n==="open"){res.open=true}else if(a.n==="popout"){res.popout=true}else if(el.e==="container"&&a.n==="pad"){res.pad=true}else if(a.n==="disabled"){if(a.f&&a.f.length===1&&a.f[0].t===2){var cnd$3="_cnd"+attrs.length;res.disabledRef=cnd$3;attrs.push({t:13,n:cnd$3,f:a.f})}else if(a.f===0){res.disabled=true}}else{as.push(a)}});if(as.length){res.extra={t:as}}if(el.e==="container"){res.contentPartial={t:el.f};res.extra=as;return res}el.f&&el.f.forEach(function(e){if(e.e==="title"){if(e.f.length===1&&typeof e.f[0]==="string"){res.title=e.f[0]}else{res.titlePartial={t:e.f}}}else if(e.e==="item"||e.e==="section"||e.e==="container"){var i=item(e);if(i){(res.items||(res.items=[])).push(i)}}else if(e.e==="left"){res.leftPartial={t:e.f}}else if(e.e==="right"){res.rightPartial={t:e.f}}else if(typeof e!=="string"||!justSpace.test(e)){if(!title){title=[]}title.push(e)}});if(!res.titlePartial&&title){res.titlePartial={t:title}}title=null;return res}var list=[];tpl.forEach(function(e){var i=item(e);if(i){list.push(i)}});this._items=list}var Handle=function Handle(menu,parent,item){this.menu=menu;this.parent=parent;this.item=item};var prototypeAccessors={keypath:{configurable:true},action:{configurable:true},active:{configurable:true},disabled:{configurable:true},items:{configurable:true},ref:{configurable:true}};prototypeAccessors.keypath.get=function(){if(this.removed){return}if(!this.parent){return"items."+this.menu.get("items").indexOf(this.item)}var path=this.parent.keypath+".items";var parent=this.menu.get(path);return path+"."+parent.indexOf(this.item)};prototypeAccessors.action.get=function(){if(this.removed){return}return this.item.action};prototypeAccessors.action.set=function(v){return this.set(".action",v)};prototypeAccessors.active.get=function(){if(this.removed){return}var item=this.item;if(item.activeRef){return this.menu.get(item.activeRef)}else if(typeof item.active==="function"){return item.active()}else{return item.active}};prototypeAccessors.active.set=function(v){if(this.removed){return}var item=this.item;if(item.activeRef){return this.menu.set(item.activeRef,v)}else{return this.set(".active",v)}};prototypeAccessors.disabled.get=function(){if(this.removed){return}return this.get(".disabled")};prototypeAccessors.disabled.set=function(v){if(this.removed){return}return this.set(".disabled",v)};prototypeAccessors.items.get=function(){var this$1=this;if(this.item.items){return this.item.items.map(function(item){return new Handle(this$1.menu,this$1,item)})}else{return[]}};prototypeAccessors.ref.get=function(){if(this.removed){return}return this.item.ref};prototypeAccessors.ref.set=function(v){return this.set(".ref",v)};Handle.prototype.addItem=function addItem(item,idx){if(this.removed){return false}var items=this.keypath+".items";if(typeof idx==="number"){this.menu.splice(items,idx,0,item)}else{this.menu.push(items,item)}return new Handle(this.menu,this,item)};Handle.prototype.open=function open(){if(this.removed){return false}this.menu.set(this.keypath+".open",true)};Handle.prototype.close=function close(){if(this.removed){return false}this.menu.set(this.keypath+".open",false)};Handle.prototype.remove=function remove(){if(this.removed){return false}var parentPath=(this.parent?this.parent.keypath+".":"")+"items";var parent=this.menu.get(parentPath);this.menu.splice(parentPath,parent.indexOf(this.item),1);this.removed=true;return true};Handle.prototype.get=function get(keypath){if(this.removed){return false}if(!keypath){return this.menu.get(this.keypath)}var key=keypath.replace(/^[\.\/]*/,"");return this.menu.get(this.keypath+"."+key)};Handle.prototype.set=function set(keypath,value){if(this.removed){return false}var key=keypath.replace(/^[\.\/]*/,"");return this.menu.set(this.keypath+"."+key,value)};Object.defineProperties(Handle.prototype,prototypeAccessors);function close(instance,path){var item=instance.get(path);if(item.open&&item.popout){instance.toggle(path+".open")}var items;if(items=instance.get(path+".items")){for(var i=0;i<items.length;i++){close(instance,path+".items."+i)}}}export function plugin(opts){if(opts===void 0)opts={};return function(ref){var instance=ref.instance;instance.components[opts.name||"menu"]=Menu}}globalRegister("RMMenu","components",Menu);export default plugin;
import Ractive from"ractive";import expand from"./transition-expand";import clickout from"./event-clickout";import globalRegister from"./globalRegister";function findRef(items,ref){for(var i=0;i<items.length;i++){if(items[i].ref===ref){return[items[i]]}else if(items[i].items){var res=findRef(items[i].items,ref);if(res){res.unshift(items[i]);return res}}}}export var Menu=function(Ractive){function Menu(opt){Ractive.call(this,opts);this.refs={}}if(Ractive)Menu.__proto__=Ractive;Menu.prototype=Object.create(Ractive&&Ractive.prototype);Menu.prototype.constructor=Menu;Menu.prototype.addItem=function addItem(item,idx){if(typeof idx==="number"){this.splice("items",idx,0,item)}else{this.push("items",item)}return new Handle(this,null,item)};Menu.prototype.visibleItems=function visibleItems(items){var this$1=this;return items.filter(function(i){return i.condition!==false&&(typeof i.condition!=="string"||this$1.get(i.condition)!==false)}).length};Menu.prototype.getHandle=function getHandle(what){var this$1=this;var ctx;if(typeof what==="string"){if(this.refs[what]){ctx=this.refs[what].ctx}else{var el=this.find(what);if(el){ctx=this.getContext(el)}else{var path=findRef(this.get("items"),what);if(path){return path.reduce(function(a,c){return new Handle(this$1,a,c)},null)}}}}else if(what&&what.parentNode){ctx=this.getContext(what)}else if(what&&what.decorators){ctx=what}if(ctx){var path$1=[ctx.get()];var str="../../";while(ctx.resolve(str)!==""){path$1.unshift(ctx.get(str));str+="../../"}return path$1.reduce(function(a,c){return new Handle(this$1,a,c)},null)}};Menu.prototype.popAllIn=function popAllIn(path){if(!path){path=""}var item=this.get(path);if(item&&item.items){for(var i=0;i<item.items.length;i++){this.popAllIn((path?path+".":"")+"items."+i)}}if(item.open&&item.popout){this.set((path?path+".":"")+"open",false)}};Menu.prototype.popSiblingsIn=function popSiblingsIn(ctx){var me=ctx.resolve();var items=ctx.get("../");if(items){for(var i=0;i<items.length;i++){if(me===ctx.resolve("../"+i)){continue}if(items[i].open&&items[i].popout){ctx.toggle("../"+i+".open")}}}};Menu.prototype._actioned=function _actioned(){this.fire("action");this.popAllIn()};Menu.prototype._itemRendered=function _itemRendered(ctx){var this$1=this;setTimeout(function(){return this$1.fire("item",ctx,this$1.getHandle(ctx))});return""};Menu.prototype.childActive=function childActive(path){var item=this.get(path);if(item&&item.items){for(var i=0;i<item.items.length;i++){if(this.get(path+".items."+i+".active")===true||typeof item.items[i].active==="function"&&item.items[i].active()||this.get(path+".items."+i+".activeRef")&&this.get(item.items[i].activeRef)||this.childActive(path+".items."+i)){return true}}}};return Menu}(Ractive);Ractive.extendWith(Menu,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-wrapper",g:1},{t:16,r:"extra-attributes"},{n:"class-rmenu-vertical",t:13,f:[{t:2,x:{r:["~/horizontal"],s:"!_0"}}]},{n:"class-rmenu-horizontal",t:13,f:[{t:2,r:"~/horizontal"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-inner",g:1}],f:[{t:8,r:"items"}]}]}]}],e:{"!_0":function(_0){return!_0},"_0||_1":function(_0,_1){return _0||_1},'_0&&(_1||_2==="section")':function(_0,_1,_2){return _0&&(_1||_2==="section")},"_0?_3.active(_1.getHandle((_2))):_3.active()":function(_0,_1,_2,_3){return _0?_3.active(_1.getHandle(_2)):_3.active()},'typeof _0==="function"':function(_0){return typeof _0==="function"},'typeof _0==="boolean"':function(_0){return typeof _0==="boolean"},"_0.childActive(_1)":function(_0,_1){return _0.childActive(_1)},"_0!=null":function(_0){return _0!=null},"[_0.action(),_1._actioned()]":function(_0,_1){return[_0.action(),_1._actioned()]},"[_0._actioned()]":function(_0){return[_0._actioned()]},'[_0&&_1.popSiblingsIn((_2)),(_2).toggle(".open"),false]':function(_0,_1,_2){return[_0&&_1.popSiblingsIn(_2),_2.toggle(".open"),false]},"_0||(_1&&_2[_1])":function(_0,_1,_2){return _0||_1&&_2[_1]},'[{axis:"x"}]':function(){return[{axis:"x"}]},"_2&&_0&&_1.visibleItems(_2)":function(_0,_1,_2){return _2&&_0&&_1.visibleItems(_2)},"[_0.popAllIn(_1),false]":function(_0,_1){return[_0.popAllIn(_1),false]},'!_0||_0==="item"':function(_0){return!_0||_0==="item"},'_0==="section"':function(_0){return _0==="section"},'_0==="container"':function(_0){return _0==="container"},'(!_0||_0==="item")&&_1':function(_0,_1){return(!_0||_0==="item")&&_1},"[_0.popAllIn(_1)]":function(_0,_1){return[_0.popAllIn(_1)]},"[_0]":function(_0){return[_0]},'typeof _0==="string"':function(_0){return typeof _0==="string"},'_0||"item"':function(_0){return _0||"item"},"_0._itemRendered((_1))":function(_0,_1){return _0._itemRendered(_1)},'_1===undefined||(typeof _1==="boolean"&&_1)||(typeof _1==="string"&&_0[_1])||(typeof _1==="function"&&_2.condition())':function(_0,_1,_2){return _1===undefined||typeof _1==="boolean"&&_1||typeof _1==="string"&&_0[_1]||typeof _1==="function"&&_2.condition()}},p:{container:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-container-pad",g:1}],f:[{t:3,r:".content"}]}],n:50,r:".pad"},{t:4,f:[{t:3,r:".content"}],n:51,l:1}],n:50,r:".content"},{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-container-pad",g:1}],f:[{t:16,r:".contentPartial"}]}],n:50,r:".pad"},{t:4,f:[{t:16,r:".contentPartial"}],n:51,l:1}],n:50,r:".contentPartial",l:1}],section:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-main",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-title",g:1}],f:[{t:4,f:[{t:2,r:".title"}],n:50,r:".title"},{t:4,f:[{t:16,r:".titlePartial"}],n:50,r:".titlePartial",l:1}]}]}],n:50,x:{r:[".title",".titlePartial"],s:"_0||_1"}}," ",{t:8,r:"children"}],children:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-items",g:1},{t:4,f:[{n:"expand",t:72,v:"t0"}],n:50,x:{r:[".popout"],s:"!_0"}},{t:4,f:[{n:"pop",t:72,v:"t0"}],n:51,l:1},{n:"class-rmenu-shrink",t:13,f:[{t:2,r:".shrink"}]}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-popitems",g:1}],f:[{t:8,r:"items"}]}],n:50,r:".popout"},{t:4,f:[{t:8,r:"items"}],n:51,l:1}]}],n:50,x:{r:[".items.length",".open",".type"],s:'_0&&(_1||_2==="section")'}}],item:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-main",g:1},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,rx:{r:"~/",m:[{t:30,n:".activeRef"}]}}]}],n:50,r:".activeRef"},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,x:{r:[".active.length","@this","@context","."],s:"_0?_3.active(_1.getHandle((_2))):_3.active()"}}]}],n:50,x:{r:[".active"],s:'typeof _0==="function"'},l:1},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,r:".active"}]}],n:50,x:{r:[".active"],s:'typeof _0==="boolean"'},l:1},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,x:{r:["@this","@keypath"],s:"_0.childActive(_1)"}}]}],n:50,r:".popout",l:1},{t:4,f:[{n:"class-rmenu-disabled",t:13,f:[{t:2,r:".disabled"}]}],n:50,x:{r:[".disabled"],s:"_0!=null"}},{t:4,f:[{n:"class-rmenu-disabled",t:13,f:[{t:2,rx:{r:"~/",m:[{t:30,n:".disabledRef"}]}}]}],n:50,r:".disabledRef",l:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"menu-left",g:1}],f:[{t:3,r:".left"}]}],n:50,r:".left"},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-left",g:1}],f:[{t:16,r:".leftPartial"}]}],n:50,r:".leftPartial",l:1}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-title",g:1},{t:4,f:[{t:4,f:[{n:["click"],t:70,f:{r:[".","@this"],s:"[_0.action(),_1._actioned()]"}}],n:50,x:{r:[".action"],s:'typeof _0==="function"'}},{t:4,f:[{t:16,r:".actionPartial"},{n:["click"],t:70,f:{r:["@this"],s:"[_0._actioned()]"}}],n:50,r:".actionPartial",l:1},{t:4,f:[{n:["click"],t:70,f:{r:[".popout","@this","@context"],s:'[_0&&_1.popSiblingsIn((_2)),(_2).toggle(".open"),false]'}}],n:50,r:".items.length",l:1}],n:51,x:{r:[".disabled",".disabledRef","~/"],s:"_0||(_1&&_2[_1])"}}],f:[{t:4,f:[{t:3,r:".title"}],n:50,r:".title"},{t:4,f:[{t:16,r:".titlePartial"}],n:50,r:".titlePartial",l:1}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"menu-right",g:1}],f:[{t:3,r:".right"}]}],n:50,r:".right"},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-right",g:1}],f:[{t:16,r:".rightPartial"}]}],n:50,r:".rightPartial",l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-expand",g:1},{n:["click"],t:70,f:{r:[".popout","@this","@context"],s:'[_0&&_1.popSiblingsIn((_2)),(_2).toggle(".open"),false]'}},{n:"expand",t:72,f:{r:[],s:'[{axis:"x"}]'},v:"t0"}]}],n:50,x:{r:[".items.length","@this",".items"],s:"_2&&_0&&_1.visibleItems(_2)"}}]}," ",{t:8,r:"children"}],items:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-popout-close",g:1},{n:["click"],t:70,f:{r:["@this","@keypath"],s:"[_0.popAllIn(_1),false]"}}],f:["❌ Close"]}],n:50,r:".shrink"}," ",{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-entry",g:1},{t:4,f:[{n:"class-rmenu-item",t:13}],n:50,x:{r:[".type"],s:'!_0||_0==="item"'}},{t:4,f:[{n:"class-rmenu-section",t:13}],n:50,x:{r:[".type"],s:'_0==="section"'},l:1},{t:4,f:[{n:"class-rmenu-container",t:13}],n:50,x:{r:[".type"],s:'_0==="container"'},l:1},{n:"class-rmenu-expanded",t:13,f:[{t:2,r:".open"}]},{n:"class-rmenu-popout",t:13,f:[{t:2,x:{r:[".type",".popout"],s:'(!_0||_0==="item")&&_1'}}]},{t:4,f:[{n:"pop",t:72,v:"t0"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this","@keypath"],s:"[_0.popAllIn(_1)]"}}],n:50,r:".open"}," "],n:50,r:".popout"},{t:4,f:[{n:"expand",t:72,v:"t0"}],n:50,x:{r:["~/noExpand"],s:"!_0"},l:1},{t:4,f:[{t:8,r:".refPartial"}],n:50,r:".refPartial"},{t:4,f:[{n:"ref",t:71,f:{r:[".ref"],s:"[_0]"}}],n:50,x:{r:[".ref"],s:'typeof _0==="string"'},l:1},{t:4,f:[{t:16,r:".extra"}],n:50,r:".extra"}],f:[{t:8,x:{r:[".type"],s:'_0||"item"'}}," ",{t:4,f:[{t:2,x:{r:["@this","@context"],s:"_0._itemRendered((_1))"}}],n:50,x:{r:[".type"],s:'!_0||_0==="item"'}}]}],n:50,x:{r:["~/",".condition","."],s:'_1===undefined||(typeof _1==="boolean"&&_1)||(typeof _1==="string"&&_0[_1])||(typeof _1==="function"&&_2.condition())'}}],n:52,r:".items"}]}},css:function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.menu.primary"));primary.popout=Object.assign({},data("raui.menu.popout"),data("raui.menu.primary.popout"));var base="\n .rmenu-wrapper {\n position: relative;\n z-index: 1;\n }\n .rmenu-wrapper.rmenu-vertical {\n min-height: 100%;\n }\n .rmenu {\n "+(data("raui.menu.font")?"font-family: "+data("raui.menu.font")+";":"")+"\n color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.fg||"#222")+";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n }\n .rmenu-wrapper.alt > .rmenu {\n color: "+(primary.fga||"#222")+";\n background-color: "+(primary.bg||"#fff")+";\n }\n .rmenu-inner {\n width: 100%;\n height: 100%;\n overflow-y: auto;\n }\n .rmenu-item {\n border-top: 1px solid transparent;\n border-bottom: 1px solid transparent;\n transition: border 0.2s ease-in-out;\n }\n .rmenu-item:hover > .rmenu-main {\n background-color: "+(primary.fga||"#07e")+";\n color: "+(primary.bg||"#fff")+";\n }\n .rmenu-disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .rmenu-popout {\n border: none;\n }\n .rmenu-expanded {\n border-top: 0.0625em solid "+(primary.bc||"#ccc")+";\n border-bottom: 0.0625em solid "+(primary.bc||"#ccc")+";\n }\n .rmenu-popout.rmenu-expanded {\n border: none;\n }\n .rmenu-popout .rmenu-popout.rmenu-expanded {\n background-color: "+(primary.popout.bga||primary.bg||"#fff")+";\n color: "+(primary.popout.fg||primary.fg||"#222")+";\n }\n .rmenu-popitems {\n height: 100%;\n overflow-y: auto;\n }\n .rmenu-main {\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n user-select: none;\n transition: 0.3s ease-in-out;\n transition-property: color, background-color;\n display: flex;\n align-items: center;\n min-height: 1em;\n }\n .rmenu-main.rmenu-active, .rmenu-item:hover > .rmenu-main.rmenu-active {\n color: "+(primary.fga||"#07e")+";\n background-color: "+(primary.bg||"#fff")+";\n }\n .rmenu-popout .rmenu-entry .rmenu-main.rmenu-active, .rmenu-popout .rmenu-item:hover > .rmenu-main.rmenu-active {\n color: "+(primary.popout.bg||primary.bg||"#fff")+";\n background-color: "+(primary.popout.fga||primary.fga||"#07e")+";\n }\n .rmenu-wrapper.alt .rmenu-main.rmenu.active {\n color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.fg||"#222")+";\n }\n .rmenu-popout .rmenu-items .rmenu-item:hover > .rmenu-main {\n background-color: "+(primary.popout.bga||"#f4f4f4")+";\n color: "+(primary.popout.fg||"#222")+";\n }\n \n .rmenu-items {\n display: block;\n }\n .rmenu-right {\n padding-right: 0.4em; \n }\n .rmenu-left {\n padding-left: 0.4em;\n }\n .rmenu-expand {\n width: 1.5em;\n height: 1.5em;\n padding-left: 0.5em;\n cursor: pointer;\n position: relative;\n }\n .rmenu-expand:before {\n position: absolute;\n display: inline-block;\n top: 0.35em;\n content: ' ';\n transform: rotate(45deg);\n transition: transform 0.2s ease-in-out, top 0.2s ease-in-out, left 0.2s ease-in-out;\n box-sizing: border-box;\n border-width: 0.25em;\n border-style: solid;\n border-left-color: transparent;\n border-top-color: transparent;\n }\n .rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n transform: rotate(-135deg);\n top: 0.65em;\n }\n \n .rmenu-popout > .rmenu-items {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: "+(primary.popout.bg||primary.bg||"#fff")+";\n color: "+(primary.popout.fg||primary.fg||"#222")+";\n box-sizing: border-box;\n border-right: 1px solid "+(primary.popout.bc||primary.bc||"#ccc")+";\n z-index: -1;\n transition: box-shadow 0.2s ease-in-out;\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items {\n left: 100%;\n z-index: initial;\n box-shadow: 0.2em 0 0.2em rgba(0, 0, 0, 0.2);\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items .rmenu-popout.rmenu-expanded > .rmenu-items {\n left: calc(100% + 1px);\n }\n \n .rmenu-popout > .rmenu-items.rmenu-shrink {\n left: 100%;\n z-index: 1;\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items.rmenu-shrink,\n .rmenu-popout.rmenu-expanded > .rmenu-items .rmenu-popout.rmenu-expanded > .rmenu-items.rmenu-shrink {\n left: 0;\n }\n \n .rmenu-popout > .rmenu-main > .rmenu-expand:before {\n transform: rotate(-45deg);\n top: 0.4em;\n }\n \n .rmenu-popout.rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n transform: rotate(135deg);\n left: 0.75em;\n }\n \n .rmenu-popout > .rmenu-items .rmenu-popout > .rmenu-items {\n height: 100%;\n width: calc(100% + 1px);\n top: 0px;\n }\n .rmenu-popout > .rmenu-items .rmenu-popout > .rmenu-items.rmenu-shrink {\n height: 100%;\n }\n \n .rmenu-popout-close {\n color: "+(primary.popout.fga||primary.fga||"#07e")+";\n display: block;\n padding: 0.5em;\n cursor: pointer;\n }\n \n .rmenu-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n padding: 0.5em;\n flex-grow: 1;\n }\n .rmenu-disabled > .rmenu-title {\n cursor: not-allowed;\n }\n .rmenu-item h1, .rmenu-item h2, .rmenu-item h3, .rmenu-item h4 {\n margin: 0;\n }\n \n .rmenu-section {\n padding: 0 0 0.75em 0;\n }\n .rmenu-section > .rmenu-main {\n cursor: default;\n font-size: 0.75em;\n opacity: 0.7;\n margin-bottom: 0.25em;\n }\n .rmenu-section > .rmenu-main .rmenu-title {\n cursor: default;\n }\n .rmenu-popout .rmenu-section:first-child > .rmenu-main {\n padding-top: 0;\n }\n .rmenu-popout .rmenu-section > .rmenu-main > .rmenu-title {\n font-size: 1.5em;\n text-align: center;\n padding: 0.75em;\n opacity: 1;\n font-weight: bold;\n color: "+(primary.popout.fg||primary.fg||"#222")+";\n background-color: "+(primary.popout.bga||primary.bga||"#f4f4f4")+";\n border-bottom: 1px solid "+(primary.popout.bc||primary.bc||"#ccc")+";\n border-top: 1px solid "+(primary.popout.bc||primary.bc||"#ccc")+";\n }\n \n .rmenu-container {\n box-sizing: border-box;\n }\n \n .rmenu-container-pad {\n padding: 0.3em 0.3em 0.8em 0.3em;\n }\n ";return base}.call(this,data)].join(" ")},cssId:"menu",noCssTransform:true,noIntro:true,nestedTransitions:false,on:{construct:construct,config:function config(){if(this._items){this.set("items",(this.get("items")||[]).concat(this._items),{shuffle:true})}}},attributes:["noExpand"],use:[expand(),clickout()],decorators:{ref:function ref(node,name){var r=this;var nm=name;if(!r.refs){r.refs={}}var handle={update:function update(name){if(r.refs[nm]===handle){delete r.refs[nm]}nm=name;r.refs[nm]=handle},teardown:function teardown(){if(r.refs[nm]===handle){delete r.refs[nm]}}};handle.ctx=r.getContext(node);r.refs[nm]=handle;return handle}},transitions:{pop:function pop(t,params){var p=t.processParams(params,{duration:200,easing:"easeInOut"});var ctx=this.getContext(t.node);var shrink=ctx.get(".shrink");if(t.isIntro){var rect=t.node.getBoundingClientRect();function findParent(){var n=t.node.parentNode;while(n&&n.classList){if(n.classList.contains("rmenu")){return n}else if(n.parentNode.classList.contains("rmenu-popout")){return n}n=n.parentNode}}if(rect.left+rect.width>window.innerWidth){setTimeout(function(){return ctx.set(".shrink",true)});shrink=true;findParent().style.overflowX="hidden"}else if(shrink){setTimeout(function(){return ctx.set(".shrink",false)});findParent().style.overflowX="";shrink=false}else{findParent().style.overflowX=""}}else{setTimeout(function(){return ctx.set("shrink",false)})}if(t.isIntro){if(shrink){t.setStyle("left","100%");return t.animateStyle("left",0,p)}else{t.setStyle("left",0);t.setStyle("z-index",-1);return t.animateStyle("left","100%",p)}}else{if(shrink){t.setStyle("left",0);return t.animateStyle("left","100%",p)}else{t.setStyle("left","100%");t.setStyle("z-index",-1);return t.animateStyle("left",0,p)}}}}});var justSpace=/^\s*$/;function construct(){var cmp=this.component;if(!cmp){return}var tpl=cmp.template.f||[];var attrs=cmp.template.m?cmp.template.m.slice():[];var t=cmp.template;cmp.template={e:t.e,f:t.f,t:t.t,m:attrs};function item(el){if(el.e!=="item"&&el.e!=="section"&&el.e!=="container"){return}var res={};var as=[];var title;if(el.e!=="item"){res.type=el.e}el.m&&el.m.forEach(function(a){if(a.n==="title"){if(typeof a.f==="string"){res.title=a.f}else{res.titlePartial={t:a.f}}}else if(a.t===70&&a.n[0]==="action"){res.actionPartial={t:[{n:["click"],f:a.f,t:a.t}]}}else if(a.n==="guard"&&a.f&&a.f.length===1&&a.f[0].t===2){var cnd="_cnd"+attrs.length;res.condition=cnd;attrs.push({t:13,n:cnd,f:a.f})}else if(a.n==="ref"){if(typeof a.f==="string"){res.ref=a.f}else if(a.f&&a.f.length===1&&a.f[0].t===2){var cnd$1="_cnd"+attrs.length;attrs.push({t:13,n:cnd$1,f:a.f});res.refPartials={t:[{t:71,n:"ref",f:{r:cnd$1,s:"[_0]"}}]}}}else if(a.n==="active"){if(a.f&&a.f.length===1&&a.f[0].t===2){var cnd$2="_cnd"+attrs.length;res.activeRef=cnd$2;attrs.push({t:13,n:cnd$2,f:a.f})}}else if(a.n==="open"){res.open=true}else if(a.n==="popout"){res.popout=true}else if(el.e==="container"&&a.n==="pad"){res.pad=true}else if(a.n==="disabled"){if(a.f&&a.f.length===1&&a.f[0].t===2){var cnd$3="_cnd"+attrs.length;res.disabledRef=cnd$3;attrs.push({t:13,n:cnd$3,f:a.f})}else if(a.f===0){res.disabled=true}}else{as.push(a)}});if(as.length){res.extra={t:as}}if(el.e==="container"){res.contentPartial={t:el.f};res.extra=as;return res}el.f&&el.f.forEach(function(e){if(e.e==="title"){if(e.f.length===1&&typeof e.f[0]==="string"){res.title=e.f[0]}else{res.titlePartial={t:e.f}}}else if(e.e==="item"||e.e==="section"||e.e==="container"){var i=item(e);if(i){(res.items||(res.items=[])).push(i)}}else if(e.e==="left"){res.leftPartial={t:e.f}}else if(e.e==="right"){res.rightPartial={t:e.f}}else if(typeof e!=="string"||!justSpace.test(e)){if(!title){title=[]}title.push(e)}});if(!res.titlePartial&&title){res.titlePartial={t:title}}title=null;return res}var list=[];tpl.forEach(function(e){var i=item(e);if(i){list.push(i)}});this._items=list}var Handle=function Handle(menu,parent,item){this.menu=menu;this.parent=parent;this.item=item};var prototypeAccessors={keypath:{configurable:true},action:{configurable:true},active:{configurable:true},disabled:{configurable:true},items:{configurable:true},ref:{configurable:true}};prototypeAccessors.keypath.get=function(){if(this.removed){return}if(!this.parent){return"items."+this.menu.get("items").indexOf(this.item)}var path=this.parent.keypath+".items";var parent=this.menu.get(path);return path+"."+parent.indexOf(this.item)};prototypeAccessors.action.get=function(){if(this.removed){return}return this.item.action};prototypeAccessors.action.set=function(v){return this.set(".action",v)};prototypeAccessors.active.get=function(){if(this.removed){return}var item=this.item;if(item.activeRef){return this.menu.get(item.activeRef)}else if(typeof item.active==="function"){return item.active()}else{return item.active}};prototypeAccessors.active.set=function(v){if(this.removed){return}var item=this.item;if(item.activeRef){return this.menu.set(item.activeRef,v)}else{return this.set(".active",v)}};prototypeAccessors.disabled.get=function(){if(this.removed){return}return this.get(".disabled")};prototypeAccessors.disabled.set=function(v){if(this.removed){return}return this.set(".disabled",v)};prototypeAccessors.items.get=function(){var this$1=this;if(this.item.items){return this.item.items.map(function(item){return new Handle(this$1.menu,this$1,item)})}else{return[]}};prototypeAccessors.ref.get=function(){if(this.removed){return}return this.item.ref};prototypeAccessors.ref.set=function(v){return this.set(".ref",v)};Handle.prototype.addItem=function addItem(item,idx){if(this.removed){return false}var items=this.keypath+".items";if(typeof idx==="number"){this.menu.splice(items,idx,0,item)}else{this.menu.push(items,item)}return new Handle(this.menu,this,item)};Handle.prototype.open=function open(){if(this.removed){return false}this.menu.set(this.keypath+".open",true)};Handle.prototype.close=function close(){if(this.removed){return false}this.menu.set(this.keypath+".open",false)};Handle.prototype.remove=function remove(){if(this.removed){return false}var parentPath=(this.parent?this.parent.keypath+".":"")+"items";var parent=this.menu.get(parentPath);this.menu.splice(parentPath,parent.indexOf(this.item),1);this.removed=true;return true};Handle.prototype.get=function get(keypath){if(this.removed){return false}if(!keypath){return this.menu.get(this.keypath)}var key=keypath.replace(/^[\.\/]*/,"");return this.menu.get(this.keypath+"."+key)};Handle.prototype.set=function set(keypath,value){if(this.removed){return false}var key=keypath.replace(/^[\.\/]*/,"");return this.menu.set(this.keypath+"."+key,value)};Object.defineProperties(Handle.prototype,prototypeAccessors);function close(instance,path){var item=instance.get(path);if(item.open&&item.popout){instance.toggle(path+".open")}var items;if(items=instance.get(path+".items")){for(var i=0;i<items.length;i++){close(instance,path+".items."+i)}}}export function plugin(opts){if(opts===void 0)opts={};return function(ref){var instance=ref.instance;instance.components[opts.name||"menu"]=Menu}}globalRegister("RMMenu","components",Menu);export default plugin;

@@ -11,3 +11,3 @@ import Ractive from 'ractive';

export var Popover = (function (Ractive) {
export var Popover = /*@__PURE__*/(function (Ractive) {
function Popover(opts) { Ractive.call(this, opts); }

@@ -358,3 +358,3 @@

var MobilePop = (function (Ractive) {
var MobilePop = /*@__PURE__*/(function (Ractive) {
function MobilePop(opts) { Ractive.call(this, opts); }

@@ -361,0 +361,0 @@

@@ -5,3 +5,3 @@ import Ractive from 'ractive';

export var Shell = (function (Ractive) {
export var Shell = /*@__PURE__*/(function (Ractive) {
function Shell(opts) { Ractive.call(this, opts); }

@@ -8,0 +8,0 @@

import Ractive from 'ractive';
import globalRegister from './globalRegister';
export var Split = (function (Ractive) {
export var Split = /*@__PURE__*/(function (Ractive) {
function Split(opts) { Ractive.call(this, opts); }

@@ -6,0 +6,0 @@

@@ -1,1 +0,1 @@

import Ractive from"ractive";import{grid,style as gridStyle}from"./grid";import click from"./event-click";import expand from"./transition-expand";import scrolled from"./scrolled";import{sized}from"./watch-size";import globalRegister from"./globalRegister";var sortRE=/^([-+])?([^\s]+)$/;function isString(v){return typeof v==="string"}function isNumber(v){return typeof v==="number"}function isObject(v){return typeof v==="object"}function isRegex(v){return typeof v==="object"&&Object.prototype.toString.call(v)==="RegExp"}export var Table=function(Ractive){function Table(opts){Ractive.call(this,opts)}if(Ractive)Table.__proto__=Ractive;Table.prototype=Object.create(Ractive&&Ractive.prototype);Table.prototype.constructor=Table;var prototypeAccessors={selections:{configurable:true},selected:{configurable:true}};Table.prototype._allSelected=function _allSelected(){var sel=this.get("selections");var visible=this.get("paginate")==="virtual"?this.get("rows"):this.get("visibleRows");for(var i=0;i<visible.length;i++){if(!~sel.indexOf(visible[i])){return false}}return visible.length&&true};Table.prototype._setSort=function _setSort(index,ev){var ref=[this.get("sort-handler"),this.get("@style.raui.table.sort-handler")];var localh=ref[0];var classh=ref[1];var fn=localh||classh;if(fn){fn(this,this.get("columns."+index),index,ev)}else{var sort=this.get("sort")||"";var col=this.get("columns."+index);var id=col.id;if(sort===id||sort.substr(1)===id){if(sort[0]==="-"){this.set("sort",id)}else{this.set("sort","-"+id)}}else{this.set("sort",id)}}};Table.prototype.nodeSet=function nodeSet(node,prop,value){node[prop]=value};Table.prototype._expand=function _expand(idx){var this$1=this;var which=this.get("visibleRows")[idx];var current=this.get("expanded");var expanded=this.find(".rtable-row-expand");if(expanded){this.transition("expand",expanded,{outro:true}).then(function(){if(current===which){this$1.set("expanded",null)}else{this$1.set("expanded",which);this$1.transition("expand",this$1.find(".rtable-row-expand"),{intro:true})}})}else{if(which===current){this.set("expanded",null)}else{this.set("expanded",which);this.transition("expand",this.find(".rtable-row-expand"),{intro:true})}}};Table.prototype._select=function _select(src,ev){var sels=this.get("selections");if(!sels){sels=[];this.set("selections",sels)}var i=sels.indexOf(src);if(~i){this.splice("selections",i,1)}else{this.push("selections",src)}if(i>=sels.length||sels.length===1){this.set("selected",sels[sels.length-1])}this.fire("selection",{},{item:sels[sels.length-1],items:sels});setTimeout(function(){return ev.target.checked=!~i});return false};Table.prototype.select=function select(){var selected=this.get("selected");if(selected){this.fire("selected",{},selected,this.get("rows").indexOf(selected),this.get("visibleRows").indexOf(selected))}};Table.prototype.deselect=function deselect(){this.set({selections:[],selected:undefined})};prototypeAccessors.selections.get=function(){return this.get("selections")||[]};prototypeAccessors.selections.set=function(v){var rows=this.get("rows");var sels=Array.isArray(v)?v.filter(function(i){return~rows.indexOf(i)}):[];this.set("selections",sels)};prototypeAccessors.selected.get=function(){return this.get("selected")};prototypeAccessors.selected.set=function(v){this.set({selected:v,selections:[v]})};Table.prototype.selectionOffset=function selectionOffset(offset){var selected=this.get("selected");var visible=this.get("visibleRows");if(!selected||!~visible.indexOf(selected)){var next=offset>0?visible[0]:visible[visible.length-1];this.set({selected:next,selections:[next]})}else{var idx=visible.indexOf(selected);if(offset>0?idx+offset>=visible.length:idx+offset<0){var move=offset<1?-1:1;if(move<0&&this.get("page")+move>=0||move>0&&this.get("page")+move<this.get("pagination.total")){this.add("page",move)}visible=this.get("visibleRows");var next$1=offset>0?visible[0]:visible[visible.length-1];this.set({selected:next$1,selections:[next$1]})}else{this.set({selected:visible[idx+offset],selections:[visible[idx+offset]]})}}this.fire("selection",{},{item:this.get("selected"),items:this.get("selections")})};Table.prototype.selectionDown=function selectionDown(){this.selectionOffset(1)};Table.prototype.selectionUp=function selectionUp(){this.selectionOffset(-1)};Table.prototype._selectGroup=function _selectGroup(idx){var this$1=this;var grp=idx;if(this.get("page")){grp+=this.get("page")*this.get("pagination.per")}var rows=this.get("rows");var groups=this.get("groups");var sels=this.get("selections");var x=rows[grp++];var xs=["selections"];var ss=[];var i;if(!~(i=sels.indexOf(x))){xs.push(x)}else{ss.push(i)}while(grp<rows.length&&!(grp in groups)){x=rows[grp++];if(!~(i=sels.indexOf(x))){xs.push(x)}else{ss.push(i)}}if(xs.length===1){i=ss.length;while(i--){this$1.splice("selections",ss[i],1)}}else{this.push.apply(this,xs)}return false};Table.prototype._groupSelected=function _groupSelected(idx){var grp=idx;if(this.get("page")){grp+=this.get("page")*this.get("pagination.per")}var rows=this.get("rows");var groups=this.get("groups");var sels=this.get("selections");if(!~sels.indexOf(rows[grp++])){return false}while(grp<rows.length&&!(grp in groups)){if(!~sels.indexOf(rows[grp++])){return false}}return true};Table.prototype._rows=function _rows(){var src=(this.get("items")||[]).slice();var filter=this.get("filter");var sort=this.get("sort");var ref=[this.get("data-handler"),this.get("@style.raui.table.data-handler")];var localh=ref[0];var classh=ref[1];var handler=localh||classh||defaultFilter;if(!filter&&!sort){this.set("isFiltered",false);return this.set("rows",src)}var res=handler(this,src,filter,sort,this.get("parameters",{virtual:true}));this.set("isFiltered",res.length!==src.length);this.set("rows",res)};Object.defineProperties(Table.prototype,prototypeAccessors);return Table}(Ractive);function scrollheader(node){var this$1=this;var scroll=function(ev){requestAnimationFrame(function(){return this$1.find(".rtable-header-wrapper").scrollLeft=ev.target.scrollLeft})};node.addEventListener("scroll",scroll,{passive:true});return{teardown:function teardown(){node.removeEventListener("scroll",scroll)}}}Table.settings={valign:"center",border:false,"fixed-header":true,"allow-select":true,"allow-select-all":true,"auto-titles":false,paginate:"virtual"};Ractive.extendWith(Table,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable",g:1},{n:"class-rtable-virtual",t:13,f:[{t:2,x:{r:["~/paginate"],s:'_0==="virtual"'}}]},{n:"class-rtable-auto",t:13,f:[{t:2,x:{r:["~/paginate"],s:'_0==="auto"'}}]},{n:"class-rtable-fixed",t:13,f:[{t:2,r:"~/fixed"}]},{n:"class-rtable-border",t:13,f:[{t:2,r:"~/border"}]},{n:"class-rtable-fixed-header",t:13,f:[{t:2,r:"~/fixedHeader"}]},{n:"class-rtable-scrolled-down",t:13,f:[{t:2,x:{r:["~/scroll"],s:'!~(_0||"").indexOf("top")'}}]},{n:"class-rtable-scrolled-up",t:13,f:[{t:2,x:{r:["~/scroll"],s:'!~(_0||"").indexOf("bottom")'}}]},{n:"class-rtable-with-select",t:13,f:[{t:2,r:"~/allowSelect"}]},{n:"class-rtable-valign-top",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="top"'}}]},{n:"class-rtable-valign-center",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="center"'}}]},{n:"class-rtable-valign-bottom",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="bottom"'}}]},{n:"class-rtable-nowrap",t:13,f:[{t:2,r:"~/noWrap"}]},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-fixed",g:1},{n:"grid",t:71,f:{r:["~/scrollOffset"],s:"[{offset:_0}]"}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-extra",g:1},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/tableWidth"},"px"],t:13}],n:50,r:"~/noWrap"},{n:"class-rtable-noheader",t:13,f:[{t:2,r:"~/noHeader"}]},{t:4,f:[{t:16,r:"meta.topAttrs"}],n:50,r:"meta.topAttrs"}],f:[{t:16,r:"meta.top",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}]}],n:50,r:"meta.top"}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-wrapper row-wrap",g:1}],f:[{t:8,r:"grid-head"}]}],n:51,r:"~/noHeader"}]}],n:50,x:{r:["~/noHeader","meta.top","~/fixedHeader"],s:"(!_0||_1)&&_2"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-top",g:1},{t:4,f:[{n:["scroll"],t:70,f:"scroll"},{n:"sized",t:71,f:{r:[],s:'[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]'}}],n:50,x:{r:["~/paginate"],s:'_0==="virtual"'}},{t:4,f:[{n:"scrolled",t:71,f:{r:[],s:'["~/scroll"]'}}],n:50,x:{r:["~/noHeader","~/fixedHeader","~/meta.bottom"],s:"(!_0&&_1)||_2"}},{t:4,f:[{n:"scrollheader",t:71}],n:50,x:{r:["~/fixedHeader","~/noWrap"],s:"_0&&_1"}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-extra",g:1},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/tableWidth"},"px"],t:13}],n:50,r:"~/noWrap"},{n:"class-rtable-noheader",t:13,f:[{t:2,r:"~/noHeader"}]},{t:4,f:[{t:16,r:"meta.topAttrs"}],n:50,r:"meta.topAttrs"}],f:[{t:16,r:"meta.top",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}]}],n:50,x:{r:["~/fixedHeader","meta.top"],s:"!_0&&_1"}}," ",{t:7,e:"div",m:[{n:"grid",t:71,f:{r:[],s:'[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]'}},{t:4,f:[{n:"style-margin-top",f:[{t:2,r:"~/virtual.above"},"px"],t:13},{n:"style-margin-bottom",f:[{t:2,r:"~/virtual.below"},"px"],t:13}],n:50,x:{r:["~/paginate"],s:'_0==="virtual"'}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-wrapper row-wrap",g:1}],f:[{t:8,r:"grid-head"}]}],n:50,x:{r:["~/noHeader","~/fixedHeader"],s:"!_0&&!_1"}}," ",{t:4,f:[{t:4,f:[{t:8,r:"grid-row"}],n:52,z:[{n:"source",x:{r:"~/items"}},{n:"shuffle",x:{x:{r:[],s:"true"}}}],r:"~/visibleRows"}],n:50,r:"~/shuffle"},{t:4,f:[{t:4,f:[{t:8,r:"grid-row"}],n:52,r:"~/visibleRows"}],n:51,l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-row row t1",g:1}],f:[{t:16,r:"empty",z:[{n:"message",x:{r:"~/empty"}}]}]}],n:50,x:{r:["~/rows.length"],s:"!_0"}}]}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-bottom",g:1},{t:4,f:[{t:16,r:"meta.bottomAttrs"}],n:50,r:"meta.bottomAttrs"}],f:[{t:4,f:[{t:16,r:"meta.bottom",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}],n:50,r:"~/meta.bottom"}," ",{t:4,f:[{t:8,r:"pagination"}],n:50,x:{r:["~/paginate"],s:'_0!=="virtual"'}}]}],n:50,x:{r:["~/paginate","~/meta.bottom"],s:'_0!=="virtual"||_1'}}]}],e:{'_0==="virtual"':function(_0){return _0==="virtual"},'_0==="auto"':function(_0){return _0==="auto"},'!~(_0||"").indexOf("top")':function(_0){return!~(_0||"").indexOf("top")},'!~(_0||"").indexOf("bottom")':function(_0){return!~(_0||"").indexOf("bottom")},'_0==="top"':function(_0){return _0==="top"},'_0==="center"':function(_0){return _0==="center"},'_0==="bottom"':function(_0){return _0==="bottom"},"[{offset:_0}]":function(_0){return[{offset:_0}]},"(!_0||_1)&&_2":function(_0,_1,_2){return(!_0||_1)&&_2},'[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]':function(){return[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]},'["~/scroll"]':function(){return["~/scroll"]},"(!_0&&_1)||_2":function(_0,_1,_2){return!_0&&_1||_2},"_0&&_1":function(_0,_1){return _0&&_1},"!_0&&_1":function(_0,_1){return!_0&&_1},'[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]':function(){return[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]},"!_0&&!_1":function(_0,_1){return!_0&&!_1},true:function(){return true},"!_0":function(_0){return!_0},'_0!=="virtual"':function(_0){return _0!=="virtual"},'_0!=="virtual"||_1':function(_0,_1){return _0!=="virtual"||_1},"(_0+_1)%2===1":function(_0,_1){return(_0+_1)%2===1},"[_0._setSort(_1,_2)]":function(_0,_1,_2){return[_0._setSort(_1,_2)]},"[_0._select(_1,_2),false]":function(_0,_1,_2){return[_0._select(_1,_2),false]},'[["select",_2,_0.indexOf(_2),_1.indexOf(_2)]]':function(_0,_1,_2){return[["select",_2,_0.indexOf(_2),_1.indexOf(_2)]]},"[_0._expand(_1)]":function(_0,_1){return[_0._expand(_1)]},"[_0.stopPropagation()]":function(_0){return[_0.stopPropagation()]},"_0.indexOf(_1)":function(_0,_1){return _0.indexOf(_1)},"_0===_1":function(_0,_1){return _0===_1},"_0>0":function(_0){return _0>0},"!_0&&_1>0":function(_0,_1){return!_0&&_1>0},'_0==="boolean"':function(_0){return _0==="boolean"},"_0._allSelected()":function(_0){return _0._allSelected()},'_0||"No data."':function(_0){return _0||"No data."},"_0*_1+1":function(_0,_1){return _0*_1+1},"_2+1===_0?_1:(_2+1)*_3":function(_0,_1,_2,_3){return _2+1===_0?_1:(_2+1)*_3},"_0===1":function(_0){return _0===1},"_0._allSelected()&&_1<_2":function(_0,_1,_2){return _0._allSelected()&&_1<_2},'[_0.set("page",_1-1)]':function(_0,_1){return[_0.set("page",_1-1)]},'[(/^\\d+$/.test(_1)&&+_1>0&&+_1<=_0&&_2.set("page",+_1-1))||_2.nodeSet(_3,"value",_4+1)]':function(_0,_1,_2,_3,_4){return[/^\d+$/.test(_1)&&+_1>0&&+_1<=_0&&_2.set("page",+_1-1)||_2.nodeSet(_3,"value",_4+1)]},"_0==_1+1":function(_0,_1){return _0==_1+1},'[_0.set("page",_2[_1-1])]':function(_0,_1,_2){return[_0.set("page",_2[_1-1])]},'_0==="..."':function(_0){return _0==="..."},'[_0.set("page",_1+1)]':function(_0,_1){return[_0.set("page",_1+1)]},"_0<_1-1":function(_0,_1){return _0<_1-1}},p:{"csp-dummy":[{t:7,e:"div",m:[{n:"class-rtable-odd",t:13,f:[{t:2,x:{r:["@index","~/virtual.offset"],s:"(_0+_1)%2===1"}}]},{n:"class-top",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="top"'}}]},{n:"class-bottom",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="bottom"'}}]},{n:"class-center",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="center"'}}]},{n:["click"],t:70,f:{r:["@this",".index","@event"],s:"[_0._setSort(_1,_2)]"}},{n:["click"],t:70,f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}},{n:["click"],t:70,f:{r:["~/rows","~/visibleRows","."],s:'[["select",_2,_0.indexOf(_2),_1.indexOf(_2)]]'}},{n:["click"],t:70,f:{r:["@this","@index"],s:"[_0._expand(_1)]"}},{n:["click"],t:70,f:{r:["@event"],s:"[_0.stopPropagation()]"}}]}," ",{t:4,f:["..."],n:50,x:{r:["~/selections","."],s:"_0.indexOf(_1)"}}," ",{t:4,f:["..."],n:50,x:{r:[".","~/expanded"],s:"_0===_1"}}," ",{t:4,f:["..."],n:50,x:{r:["~/virtual.offset"],s:"_0>0"}}," ",{t:4,f:["..."],n:50,x:{r:["~/fixedHeader","~/virtual.offset"],s:"!_0&&_1>0"}}," ",{t:4,f:["..."],n:50,x:{r:["~/columns.0.type"],s:'_0==="boolean"'}}," ",{t:4,f:["..."],n:50,x:{r:["@this"],s:"_0._allSelected()"}}],empty:[{t:7,e:"div",f:[{t:7,e:"div",f:[{t:2,x:{r:["message"],s:'_0||"No data."'}}]}]}],pagination:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-pagination",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-info",g:1}],f:[{t:4,f:[{t:2,x:{r:["~/page","~/pagination.per"],s:"_0*_1+1"}}," - ",{t:2,x:{r:["~/pagination.total","~/rows.length","~/page","~/pagination.per"],s:"_2+1===_0?_1:(_2+1)*_3"}}," of ",{t:2,r:"~/rows.length"},{t:4,f:[" (",{t:2,r:"~/items.length"}," total)"],n:50,r:"~/isFiltered"}],n:50,x:{r:["pagination","rows.length"],s:"_0&&_1"}}," ",{t:4,f:["​"],n:50,x:{r:["_paginate"],s:"_0===1"}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-select-all-all",g:1}],f:[{t:4,f:[{t:7,e:"strong",f:[{t:2,r:"selections.length"}]}," of ",{t:7,e:"strong",f:[{t:2,r:"rows.length"}]}," selected",{t:4,f:[" - ",{t:7,e:"a",m:[{n:"href",f:"#",t:13,g:1},{n:["click"],t:70,f:"selectAllAll"}],f:["Select All"]}],n:50,x:{r:["@this","selections.length","rows.length"],s:"_0._allSelected()&&_1<_2"}}],n:50,x:{r:["selections.length"],s:"_0>0"}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-pages",g:1}],f:[{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","~/page"],s:'[_0.set("page",_1-1)]'}}],f:["Previous"]}],n:50,x:{r:["~/page"],s:"_0>0"}}," ",{t:4,f:[{t:4,f:[{t:7,e:"input",m:[{n:["change"],t:70,f:{r:["~/pagination.total","@node.value","@this","@node","~/page"],s:'[(/^\\d+$/.test(_1)&&+_1>0&&+_1<=_0&&_2.set("page",+_1-1))||_2.nodeSet(_3,"value",_4+1)]'}},{n:"value",f:[{t:2,r:"."}],t:13},{t:73,v:"t",f:"false"}]}],n:50,x:{r:[".","~/page"],s:"_0==_1+1"}},{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","@index","../"],s:'[_0.set("page",_2[_1-1])]'}}],f:["..."]}," "],n:50,x:{r:["."],s:'_0==="..."'},l:1},{t:4,f:[" ",{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","."],s:'[_0.set("page",_1-1)]'}}],f:[{t:2,r:"."}]}],n:51,l:1}],n:52,r:"~/pagination.array"}," ",{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","~/page"],s:'[_0.set("page",_1+1)]'}}],f:["Next"]}],n:50,x:{r:["~/page","~/pagination.total"],s:"_0<_1-1"}}]}]}]}},css:function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.table.primary"));var active=Object.assign({},primary,data("raui.primary.active"),data("raui.table.primary.active"));var table=Object.assign({selected:{},header:{},footer:{}},data("raui.table"));return"\n .rtable {\n display: flex;\n flex-direction: column;\n overflow: auto;\n max-width: 100%;\n max-height: 100%;\n box-sizing: border-box;\n flex-grow: 2;\n }\n \n .rtable.rtable-border {\n border: 1px solid "+(table.divider||primary.bc||"#ccc")+";\n }\n \n .rtable-group > div > div,\n .rtable-header > div > div,\n .rtable-row > div > div {\n padding: "+(table.padding||"0.5em")+";\n overflow: inherit;\n text-overflow: inherit;\n line-height: 1em;\n }\n .rtable-row > .rtable-no-pad > div {\n padding: 0;\n }\n \n .rtable-auto .row > *,\n .rtable-fixed .row > *\n {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n \n .rtable-header > div > div, .rtable-column {\n overflow: hidden;\n }\n \n .rtable-number-column {\n text-align: right;\n }\n .rtable-date-column {\n text-align: right;\n }\n \n .rtable-sortable {\n cursor: pointer;\n user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n }\n \n .grid .row.rtable-row, .grid .rtable-header > .row {\n width: auto;\n min-width: min-content;\n flex-grow: 1;\n }\n \n .rtable-nowrap .grid .rtable-row, .rtable-nowrap .grid .rtable-header > .row {\n flex-wrap: nowrap;\n }\n .rtable-nowrap .rtable-row-wrap, .rtable-inner-row-wrap {\n flex-grow: 1;\n } \n \n .rtable-row-wrap {\n color: "+(primary.fg||"#222")+";\n border-style: solid;\n border-color: "+(table.divider||primary.bc||"#ccc")+";\n border-width: 0 0 1px 0;\n background-color: "+(table.even||primary.bga||"#f4f4f4")+";\n }\n .rtable-row-wrap.rtable-odd {\n background-color: "+(table.odd||primary.bg||"#fff")+";\n }\n .rtable-row-wrap:hover, .rtable-row-wrap.rtable-selected:hover, .rtable-row-wrap.rtable-odd.rtable-selected:hover {\n background-color: "+(table.over||active.bg||"#e6f0fa")+";\n position: relative;\n box-shadow: inset 1px 0 0 #dadce0,inset -1px 0 0 #dadce0, 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n z-index: 2;\n }\n .rtable-header.rtable-row-wrap:hover {\n box-shadow: none;\n }\n \n .rtable-row-wrap.rtable-selected {\n background-color: "+(table.selected.bg||"#cee5fd")+";\n color: "+(table.selected.fg||primary.fg||"#222")+";\n }\n .rtable-row-wrap.rtable-selected.rtable-odd {\n background-color: "+(table.selected.odd||"#c5dffb")+";\n }\n \n .rtable-row-wrap {\n display: flex;\n flex-grow: 1;\n align-items: center;\n z-index: 2;\n align-items: stretch;\n }\n \n .rtable-nowrap .rtable-row-wrap {\n display: inline-flex;\n min-width: 100%;\n box-sizing: border-box;\n }\n \n .rtable-nowrap > .rtable-top > .grid {\n line-height: 1em;\n }\n \n .rtable-border .rtable-row .rtable-column,\n .rtable-border .rtable-group .rtable-column {\n border-color: "+(table.divider||primary.bc||"#ccc")+";\n border-style: solid;\n border-width: 0 0 1px 1px;\n margin: 0 0 -1px -1px;\n }\n .rtable-border .rtable-header .rtable-column {\n margin-left: -1px;\n }\n .rtable-border .rtable-row .rtable-column:nth-child(1),\n .rtable-border .rtable-group .rtable-column:nth-child(1) {\n border-left-width: 0;\n }\n .rtable-border.rtable-with-select .rtable-row .rtable-column:nth-child(1),\n .rtable-border.rtable-with-select .rtable-group .rtable-column:nth-child(1) {\n border-left-width: 1px;\n }\n \n .rtable-border .rtable-row-wrap {\n border-bottom-width: 1px;\n }\n \n .rtable-border .rtable-row-expand, .rtable-border .rtable-row-extra {\n border-color: "+(table.divider||primary.bc||"#ccc")+";\n border-style: solid;\n border-width: 1px 0 0 0;\n margin-left: -1px;\n width: 100%;\n }\n .rtable-border.rtable-with-select .rtable-row-expand, .rtable-border.rtable-with-select .rtable-row-extra {\n border-left-width: 1px;\n }\n \n .rtable-row-expand, .rtable-row-extra {\n box-sizing: border-box;\n padding: "+(table.padding||"0.5em")+";\n }\n \n .rtable-group {\n border-bottom: 2px solid "+(table.divider||primary.bc||"#ccc")+";\n }\n \n .rtable-header.rtable-row-wrap, .rtable-header.rtable-row-wrap:hover {\n font-weight: bold;\n background-color: "+(table.header.bg||"#dedede")+";\n }\n .rtable-header-fixed {\n line-height: 1em;\n background-color: "+(table.header.bg||"#dedede")+";\n }\n \n .rtable-header.rtable-row-wrap, .rtable-header-extra.rtable-noheader {\n border-bottom: 2px solid "+(table.divider||primary.bc||"#ccc")+";\n }\n \n .rtable-header-extra {\n background-color: "+(table.header.bg||"#dedede")+";\n padding: "+(table.padding||"0.5em")+";\n line-height: 1em;\n z-index: 4;\n box-sizing: border-box;\n min-width: 100%;\n }\n .rtable-nowrap .rtable-header-extra {\n position: sticky;\n left: 0;\n }\n \n .rtable-top {\n flex-grow: 5;\n flex-shrink: 1;\n overflow-y: auto;\n position: relative;\n }\n .rtable-fixed-header .rtable-header {\n position: relative;\n z-index: 3;\n }\n .rtable-fixed-header.rtable-scrolled-down .rtable-header-fixed {\n box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15), 0 0.25em 0.5em rgba(0,0,0,0.25);\n z-index: 3;\n }\n .rtable-fixed-header .rtable-top {\n margin-top: 0;\n }\n .rtable-nowrap.rtable-fixed-header .rtable-header-wrapper {\n flex-shrink: 0;\n width: 100%;\n overflow-x: auto;\n scrollbar-width: none;\n }\n .rtable-nowrap.rtable-fixed-header .rtable-header-wrapper::-webkit-scrollbar {\n height: 0;\n }\n .rtable-fixed-header .rtable-header-fixed::-webkit-scrollbar {\n width: 0;\n height: 0;\n }\n \n .rtable-nowrap .rtable-fixed-column, .rtable-nowrap .rtable-row-extra, .rtable-nowrap .rtable-row-expand {\n position: -webkit-sticky;\n position: sticky;\n left: 0;\n }\n .rtable-border..rtable-nowrap .rtable-fixed-column, .rtable-border.rtable-nowrap .rtable-row-extra, .rtable-border.rtable-nowrap .rtable-row-expand {\n left: 1px;\n }\n .rtable-nowrap.rtable-with-select .rtable-fixed-column, .rtable-nowrap.rtable-with-select .rtable-row-extra, .rtable-nowrap.rtable-with-select .rtable-row-expand {\n left: "+(table.selectWidth||"2em")+";\n }\n .rtabe-border.rtable-nowrap.rtable-with-select .rtable-fixed-column, .rtabe-border.rtable-nowrap.rtable-with-select .rtable-row-extra, .rtabe-border.rtable-nowrap.rtable-with-select .rtable-row-expand {\n left: "+(table.selectWidth||"2em")+";\n }\n \n .rtable-nowrap .rtable-inner-row-wrap {\n background-color: inherit;\n }\n \n .rtable-nowrap .row,\n .rtable-nowrap .rtable-fixed-column,\n .rtable-nowrap .rtable-select-row,\n .rtable-nowrap .rtable-select-header {\n background-color: inherit;\n z-index: 1;\n }\n \n .rtable-nowrap .rtable-select-row,\n .rtable-nowrap .rtable-select-header {\n position: sticky;\n position: -webkit-sticky;\n left: 0;\n z-index: 1;\n }\n .rtable-nowrap .rtable-select-header {\n z-index: 2;\n }\n \n .rtable-nowrap.rtable-border .rtable-fixed-column {\n border-right-width: 1px;\n }\n \n .rtable-scrolled-up .rtable-bottom {\n box-shadow: 0 -1px 2px 0 rgba(60, 64, 67, 0.3), 0 -1px 3px 1px rgba(60, 64, 67, 0.15), 0 -0.25em 0.5em rgba(0,0,0,0.25);\n z-index: 3;\n }\n .rtable-bottom {\n padding: "+(table.padding||"0.5em")+";\n background-color: "+(table.footer.bg||table.header.bg||"#dedede")+";\n border-top: 2px solid "+(table.divider||primary.bc||"#ccc")+";\n }\n \n .rtable-pagination {\n display: flex;\n flex-wrap: wrap;\n flex-shrink: 0;\n justify-content: space-between;\n }\n \n .rtable-pages span {\n margin: 0.3em;\n cursor: pointer;\n }\n .rtable-pages span:first-of-type {\n margin-left: 0;\n }\n .rtable-pages input {\n text-align: center;\n width: 2.5em;\n font-size: 1em;\n background-color: transparent;\n border: none;\n padding: 0;\n font-weight: bold;\n text-decoration: underline;\n }\n \n /* checkboxes */\n .rtable-select {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n position: absolute;\n display: block;\n margin: 0;\n width: 2em;\n height: 2em;\n box-shadow: none;\n outline: none;\n opacity: 0;\n top: -4px;\n left: -1.5px;\n border-radius: 2em;\n transition: transform 0.2s, opacity 0.2s;\n background-color: "+(primary.bc||"#ccc")+";\n cursor: pointer;\n }\n \n .rtable-select-header > div, .rtable-select-row > div, .rtable-header > div.rtable-select-header > div {\n padding: 0;\n overflow: visible;\n width: 1.5em;\n position: relative;\n line-height: 1.8em;\n cursor: pointer;\n display: flex;\n justify-content: space-around;\n align-items: center;\n flex-grow: 0;\n }\n \n .rtable-select:checked {\n background-color: "+(primary.fga||"#07e")+';\n }\n \n .rtable-select-header:hover .rtable-select, .rtable-select-row:hover .rtable-select {\n opacity: 0.04;\n }\n \n .rtable-select:focus {\n opacity: 0.12;\n transform: scale(1);\n }\n \n .rtable-select-header:hover .rtable-select:focus, .rtable-select-row:hover .rtable.select:focus {\n opacity: 0.16;\n }\n \n .rtable-select:active {\n opacity: 0.4;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n \n .rtable-select-row > div:before, .rtable-select-header > div:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n border: solid 2px; /* Safari */\n border-color: '+(primary.fg||"#222")+';\n border-radius: 2px;\n width: 18px;\n height: 18px;\n vertical-align: middle;\n transition: border-color 0.2s, background-color 0.2s;\n }\n \n .rtable-select-row > div:after, .rtable-select-header > div:after {\n content: "";\n display: block;\n position: absolute;\n top: -5px;\n left: 0px;\n width: 10px;\n height: 5px;\n border: solid 2px transparent;\n border-right: none;\n border-top: none;\n transform: translate(0.35em, 0.55em) rotate(-45deg);\n opacity: 0;\n }\n \n .rtable-selected .rtable-select-row > div:before, .rtable-all-selected > div:before {\n border-color: '+(primary.fga||"#07e")+";\n background-color: "+(primary.fga||"#07e")+";\n }\n \n .rtable-selected .rtable-select-row > div:after, .rtable-all-selected > div:after {\n border-color: "+(primary.bg||"#fff")+";\n opacity: 1;\n }\n \n .rtable-row-wrap > .rtable-select-header,\n .rtable-row-wrap > .rtable-select-row {\n text-align: center;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: space-around;\n width: "+(table.selectWidth||"2em")+";\n }\n \n .rtable-column button, .rtable-column .btn {\n padding: 0 0.5em;\n margin: 0.2em 0.5em;\n min-height: 0;\n }\n \n .rtable-column.rtable-editing {\n padding: 0;\n }\n .rtable-column.rtable-editing input {\n width: 100%;\n box-sizing: border-box;\n height: 100%;\n margin: 0;\n border: none;\n background-color: transparent;\n padding: 0.25em 0.5em;\n }\n \n .rtable-valign-top .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-top > div {\n display: flex;\n height: 100%;\n align-items: flex-start;\n box-sizing: border-box;\n }\n .rtable-valign-bottom .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-bottom > div {\n display: flex;\n height: 100%;\n align-items: flex-end;\n box-sizing: border-box;\n }\n .rtable-valign-center .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-center > div {\n display: flex;\n height: 100%;\n align-items: center;\n box-sizing: border-box;\n }\n "+(data("table.includeGrid")?gridStyle(data):"")}.call(this,data)].join(" ")},cssId:"rtable",noCssTransform:true,attributes:["paginate","items","filter","data-handler","sort-handler","sort","helpers","fixed","allow-select","allow-select-all","border","fixed-header","valign","no-header","empty","shuffle","no-wrap","parameters"],components:{table:false,Table:false},syncComputedChildren:true,decorators:{grid:grid,sized:sized,scrollheader:scrollheader},events:{},use:[click({name:"clickd",count:1}),click({name:"dblclickd",count:2}),expand(),scrolled()],on:{construct:construct,config:function config(){this.set(this._init.sets);Object.assign(this.partials,this._init.partials)},render:function render(){if(this._autoObserver){this._autoObserver.fire()}},selectAll:function selectAll(){var sel,item;if(this._allSelected()){item=null;sel=[];this.set({selections:sel,selected:item})}else{sel=(this.get("paginate")==="virtual"?this.get("rows"):this.get("visibleRows")).slice();item=sel[0];this.set({selections:sel,selected:item})}this.fire("selection",{},{item:item,items:sel});return false},selectAllAll:function selectAllAll(){var item=null;var sel=this.get("rows").slice();this.set({selections:sel,selected:item});this.fire("selection",{},{item:item,items:sel});return false}},observe:{_rows:function _rows(){var this$1=this;if(this._rowbounce){clearTimeout(this._rowbounce)}setTimeout(function(){return this$1._rows()},this.get("@style.raui.table.debounce")||160)},paginate:{handler:function handler(v){var this$1=this;if(v==="auto"||v==="virtual"||v instanceof Ractive){if(this._autoObserver){this._autoObserver.cancel()}if(this._scrollListener){this._scrollListener.cancel()}var root=v==="auto"||v==="virtual"?this.root:v;var sized=false;var fn=function(){if(!this$1.rendered){return}var top=this$1.find(".rtable-top");if(!top){return}if(!this$1.get("items.length")){if(!this$1._autoLenObserver){this$1._autoLenObserver=this$1.observeOnce("items",function(){this$1._autoLenObserver=0;setTimeout(fn)})}return}var size=top.clientHeight+","+top.clientWidth;if(fn.last===size&&sized){return}{var ctx=this$1.getContext(top);if(ctx.decorators&&ctx.decorators.scrolled){ctx.decorators.scrolled.refresh()}}var header=this$1.find(".rtable-header")||{};var rows=Array.apply(null,this$1.findAll(".rtable-live")).map(function(r){return r.offsetHeight});if(rows.length<5){var auto=Math.floor(top.clientHeight/(header.offsetHeight||1));if(auto<5){auto=5}this$1.set("_paginate",auto);rows=Array.apply(null,this$1.findAll(".rtable-live")).map(function(r){return r.offsetHeight})}if(rows.length>0){sized=true}else{rows=[25]}var avg=Math.ceil(rows.reduce(function(a,c){return a+c},0)/rows.length);this$1._avgSize=avg;var fit=Math.floor((top.clientHeight-(header.offsetHeight||1))/avg);if(v==="virtual"){fit=fit+10;if(fit<30){fit=30}}this$1.set("_paginate",fit);fn.last=size};var tm;var fnd=function(){if(tm){clearTimeout(tm)}tm=setTimeout(function(){fn();tm=null;if(sized&&this$1._scrollListener){this$1._scrollListener.fn()}},50)};this._autoObserver=this.observe("~/tableHeight",fnd);this._autoObserver.fire=fnd;if(v==="virtual"){var lock=false;var node;var fn$1=function(){if(!this$1.rendered){node=null;return}if(!node){node=this$1.find(".rtable-top")}if(!sized){return fnd()}var top=node.scrollTop;var virtual=this$1.get("virtual")||{};var offset=virtual.offset;var visible=this$1.get("_paginate");var page=visible-10;var count=this$1.get("rows.length");if(visible>count){visible=count}var avg=this$1._avgSize;var pageSize=page*avg;var wnd=Math.floor(top/avg);var first=wnd-5;if(first<0){first=0}var hardFirst=first;if(first+visible>count){first=count-visible}if(offset===first&&!isNaN(virtual.top)){return lock=false}if(!isNumber(offset)||isNaN(offset)||isNaN(virtual.top)||top<virtual.top+pageSize||top>virtual.bottom-pageSize||offset>0&&top<avg*page){var amtAbove=hardFirst;var amtBelow=count-hardFirst-visible;if(amtAbove<0){amtBelow+=amtAbove*-1;amtAbove=0}else if(amtAbove>count-visible){amtAbove=count-visible}if(amtBelow<0){amtBelow=0}var above=amtAbove*avg;var below=amtBelow*avg;var vis,next;if(first<offset+visible&&first>offset-visible){if(first>offset){vis=this$1.findAll(".rtable-live")[first-offset]}else{vis=this$1.findAll(".rtable-live")[offset-first]}}if(vis&&first>0&&vis.offsetTop>node.scrollTop-pageSize-5&&vis.offsetTop<node.scrollTop+pageSize){next=vis.offsetTop}this$1.set({"virtual.above":above,"virtual.below":below,"virtual.offset":first});if(typeof next==="number"){if(next!==vis.offsetTop){this$1.set("virtual.above",above+(next-vis.offsetTop))}}this$1.set({"virtual.top":this$1.get("virtual.above"),"virtual.bottom":node.scrollHeight-below})}lock=false};var scroll=this._scrollListener=this.on("scroll",function(ref){var node=ref.node;if(!lock){lock=true;requestAnimationFrame(fn$1)}});scroll.fn=fn$1;scroll.observer=this.observe("rows.length",function(){this$1.set("virtual.offset",null);fn$1()},{init:false,strict:true,defer:true});var cancel=scroll.cancel;scroll.cancel=function(){cancel();scroll.observer.cancel()}}fnd()}else{if(this._autoObserver){this._autoObserver.cancel()}if(this._scrollListener){this._scrollListener.cancel()}}if(isNumber(v)){this.set("_paginate",v)}},defer:true},"scrollOffset tableHeight":{handler:function handler(){var this$1=this;requestAnimationFrame(function(){var top=this$1.find(".rtable-top");var ctx=top&&this$1.getContext(top);if(ctx&&ctx.decorators&&ctx.decorators.scrolled){ctx.decorators.scrolled.refresh()}})},init:false}},data:function data(){return Object.assign({page:0,selections:[],showGroups:true,allowGroupSelect:true,expanded:null,minPerPage:10,virtual:{offset:0},shuffle:false,rows:[]},Table.settings)},computed:{allowSelect:function allowSelect(){return this.get("allow-select")},allowSelectAll:function allowSelectAll(){return this.get("allow-select-all")},fixedHeader:function fixedHeader(){return this.get("fixed-header")},autoTitles:function autoTitles(){return this.get("auto-titles")},noHeader:function noHeader(){return this.get("no-header")},noWrap:function noWrap(){return this.get("no-wrap")},_rows:function _rows(){var src=(this.get("items")||[]).slice();var filter=this.get("filter");var sort=this.get("sort");var params=this.get("parameters");var ref=[this.get("data-handler"),this.get("@style.raui.table.data-handler")];var localh=ref[0];var classh=ref[1];var ref$1=[this.get("data-pre-handler"),this.get("@style.raui.table.data-pre-handler")];var localp=ref$1[0];var classp=ref$1[1];if(localp||classp){(localp||classp)(this,src,filter,sort,params)}return{}},visibleRows:function visibleRows(){var this$1=this;var rows=this.get("rows");var paginate=this.get("paginate");var per=paginate;var intPer=this.get("_paginate");var offset=this.get("page")||0;var virtual=this.get("virtual");if(!per){return rows}if(typeof per!=="number"&&isNaN(+per)){if(per==="auto"||per==="virtual"||per instanceof Ractive){per=intPer||1}else{per=30}}if(per<this.get("minPerPage")){per=this.get("minPerPage")}if(paginate==="virtual"){offset=virtual&&virtual.offset||0;return rows.slice(offset,offset+per)}else{if(offset*per>rows.length){setTimeout(function(){return this$1.set("page",0)},0)}return rows.slice(per*offset,per*offset+per)}},pagination:function pagination(){var items=this.get("items")||empty;var rows=this.get("rows");var paginate=this.get("paginate");var per=paginate;var offset=this.get("page")||0;if(typeof per!=="number"&&isNaN(per)){per=this.get("_paginate")}if(per<this.get("minPerPage")){per=this.get("minPerPage")}if(!per){return}var total=Math.ceil(rows.length/per);var info={max:Math.ceil(items.length/per),total:total,per:per};if(paginate==="virtual"){info.height=this._avg*rows.length}if(info.total>14){var arr=info.array=[];if(offset>5){arr.push(1,2,3,"...")}else{arr.push(1,2,3,4,5,6,7,8)}if(offset>5&&offset+6<total){arr.push(offset-1,offset,offset+1,offset+2,offset+3,"...",total-2,total-1,total)}else if(offset+6<total){arr.push("...",total-2,total-1,total)}else{arr.push(total-7,total-6,total-5,total-4,total-3,total-2,total-1,total)}}else{info.array=Array.apply(null,{length:info.total}).map(function(v,i){return i+1})}return info},groups:function groups(){var this$1=this;var rows=this.get("rows");var last,cur;var res={};for(var i=0;i<rows.length;i++){cur=rows[i][this$1._init.by];if(cur!=last){res[i]=1}last=cur}return res}}});var notNumbers=/^[^\d]*/;export function numberify(v){if(isNumber(v)){return v}if(!v){return+Infinity}v=(""+v).replace(notNumbers,"");if(!v){return+Infinity}return parseFloat(v)}function columnGetter(table,col,sort){if(typeof col.get==="function"){return col.get}var path=(sort?col.sort:0)||col.path||col.filter||col.id;if(typeof path==="string"){var arr=Ractive.splitKeypath(path);return function(row){var v=row;for(var i=0;i<arr.length;i++){v=v&&v[arr[i]]}return v}}}function defaultFilter(table,rows,filter,sort){var all=[].concat(table.viewmodel.value.columns,table.viewmodel.value.fields);var map=all.reduce(function(a,c){return((a[c.id]=columnGetter(table,c))||true)&&a},{});var cols=Object.values(map);var list=rows||[];var src=list;if((filter instanceof RegExp||isString(filter))&&filter){var nocase=filter===""+filter.toLowerCase()||filter===""+filter.toUpperCase();try{var re=isString(filter)?new RegExp(filter,nocase?"i":""):filter;list=list.filter(function(l){var i=cols.length;while(i--){var v=l&&cols[i](l);if(v&&re.test(v)){return true}}})}catch(e){}}if(isString(sort)||isObject(sort)&&!Array.isArray(sort)){sort=[sort]}if(Array.isArray(sort)){sort=sort.map(function(f){if(isString(f)){var id$1=f[0]==="-"||f[0]==="+"?f.substr(1):f;var col=all.find(function(c){return c.id===id$1});if(!col){return}var res={get:columnGetter(table,col,true),dir:f[0]==="-"?-1:1};if(col&&col.type==="number"){var get=res.get;res.get=function(v){return numberify(get.call(table,v))}}return res}else if(f&&typeof f==="object"){var col$1=all.find(function(c){return c.id===id});if(!col$1){return}var res$1={dir:isNumber(f.dir)?f.dir:f.dir==="desc"?-1:1,get:columnGetter(table,col$1,true)};if(f.type==="number"||col$1&&col$1.type==="number"){var get$1=res$1.get;res$1.get=function(v){return numberify(get$1.call(table,v))}}return res$1}}).filter(function(s){return s&&s.get});list.sort(function(a,b){var aa,bb,p;for(var i=0;i<sort.length;i++){aa=sort[i].get.call(table,a);bb=sort[i].get.call(table,b);p=sort[i].dir*(aa<bb?-1:aa>bb?1:0);if(p!==0){return p}}return p})}return list}var colAttrs=["label","type","filter","hidden","sort","no-pad","id","editable","fixed"];var cell=/^[a-z]{1,3}[0-9]+(?:-[0-9]+)?$/;var empty=[];function construct(){var cmp=this.component;if(!cmp){return}var expandEl,groupEl,wrapperEl,rowEl,topEl,bottomEl,mappings;var tpl=cmp.template.f||[];var attrs=cmp.template.m?cmp.template.m.slice():[];var t=cmp.template;cmp.template={e:t.e,f:t.f,t:t.t,m:attrs};var id=0;function map(attr,partial,plain){if(attr&&attr.f&&attr.f.length===1&&attr.f[0].t===2){var n="_a"+id++;attrs.push({t:13,n:n,f:attr.f});if(plain){return n}return partial?{t:[{t:2,r:"~/"+n}]}:{t:2,r:"~/"+n}}return attr&&attr.f}function grabColumns(tpl){var columns=[];var fields=[];tpl.forEach(function(e){if(e.e==="column"||e.e==="col"){var col={};var attrs=e.m||empty;var attr;col.index=columns.length;columns.push(col);col.content=(e.f||[]).filter(function(e){return e.e!=="edit"});attr=attrs.find(function(a){return a.n==="id"});if(attr&&isString(attr.f)){col.id=attr.f}col.label=attrs.find(function(a){return a.n==="label"});if(col.label&&col.label.f){col.label=map(col.label)}if(!col.label){col.label=""}if(!col.id){col.id=col.label}if(!Array.isArray(col.label)){col.label=[col.label]}col.type=attrs.find(function(a){return a.n==="type"});if(col.type&&col.type.f){col.type=col.type.f}if(!col.type){col.type="string"}col.filter=attrs.find(function(a){return a.n==="filter"});if(col.filter&&col.filter.f){col.filter=map(col.filter);if(col.filter.r){col.filter=col.filter.r}}col.sort=attrs.find(function(a){return a.n==="sort"});if(col.sort&&col.sort.f){col.sort=map(col.sort);if(col.sort.r){col.sort=col.sort.r}}col.dir=attrs.find(function(a){return a.n==="dir"});if(col.dir&&col.dir.f){col.dir=map(col.dir);if(col.dir.r){col.dir=col.dir.r}}col.hidden=attrs.find(function(a){return a.n==="hidden"});if(col.hidden&&col.hidden.f===0){col.hidden=true}else if(col.hidden&&isObject(col.hidden.f)){col.hidden=map(col.hidden)}else{col.hidden=false}if(isString(col.hidden)){col.hidden=false}col.noPad=attrs.find(function(a){return a.n==="no-pad"});if(col.noPad&&col.noPad.f===0){col.noPad=0}else if(col.noPad&&isObject(col.noPad.f)){col.noPad=map(col.noPad)}else{delete col.noPad}col.editable=attrs.find(function(a){return a.n==="editable"});if(col.editable&&col.editable.f===0){col.editable=true}else if(col.editable&&isObject(col.editable.f)){col.editable=map(col.editable)}else{col.editable=false}col.valign=attrs.find(function(a){return a.n==="valign"});if(col.valign&&isObject(col.valign.f)){col.valign=map(col.valign)}else if(col.valign&&typeof col.valign.f==="string"){col.valign=col.valign.f}col.fixed=attrs.find(function(a){return a.n==="fixed"});if(col.fixed&&isObject(col.fixed.f)){col.fixed={path:map(col.fixed,false,true)}}else if(col.fixed&&typeof col.fixed.f==="string"){col.fixed=col.fixed.f}attr=attrs.find(function(a){return a.n==="get"});if(attr&&attr.f){var name=map(attr,false,true);field.get=function(val){var fn=this.get(name);return typeof fn==="function"?fn.call(this,val):undefined}}col.attrs=attrs.filter(function(a){return!~colAttrs.indexOf(a.n)});col.attrs.forEach(function(a,i){if(cell.test(a.n)){col.attrs[i]={t:13,n:"class-"+a.n}}})}else if(e.e==="field"){var field$1={};var attrs$1=e.m||empty;var a;a=attrs$1.find(function(a){return a.n==="path"});if(isString(a)){field$1.path=a}else if(a&&a.f){field$1.path=map(a)}a=attrs$1.find(function(a){return a.n==="value"});if(a&&a.f){field$1.value=map(a)}a=attrs$1.find(function(a){return a.n==="type"});if(isString(a)){field$1.type=a}else if(a&&a.f){field$1.type=map(a)}a=attrs$1.find(function(a){return a.n==="id"});if(isString(a.f)){field$1.id=a.f}a=attrs$1.find(function(a){return a.n==="dir"});if(isString(a)){field$1.dir=a}else if(a&&isString(a.f)){field$1.dir=a.f}a=attrs$1.find(function(a){return a.n==="label"});if(isString(a)){field$1.label=a}else if(a&&a.f){field$1.label=map(a)}a=attrs$1.find(function(a){return a.n==="get"});if(a&&a.f){var name$1=map(a,false,true);field$1.get=function(val){var fn=this.get(name$1);return typeof fn==="function"?fn.call(this,val):undefined}}if(!field$1.id){field$1.id=field$1.label}if(!field$1.path){field$1.path=field$1.id}fields.push(field$1)}});return{fields:fields,columns:columns}}expandEl=tpl.find(function(e){return e.e==="expand"});groupEl=tpl.find(function(e){return e.e==="group"});wrapperEl=tpl.find(function(e){return e.e==="wrapper"});rowEl=tpl.find(function(e){return e.e==="row"});topEl=tpl.find(function(e){return e.e==="top"});bottomEl=tpl.find(function(e){return e.e==="bottom"});this._init={sets:grabColumns(tpl),partials:{}};var columns=this._init.sets.columns;this._init.sets["meta.expand"]=expandEl&&expandEl.f&&expandEl.f.length&&expandEl.f;this._init.sets["meta.extra"]=rowEl&&rowEl.f&&rowEl.f.length&&rowEl.f;this._init.sets["meta.top"]=topEl&&topEl.f&&topEl.f.length&&topEl.f;this._init.sets["meta.topAttrs"]=topEl&&topEl.m;this._init.sets["meta.bottom"]=bottomEl&&bottomEl.f&&bottomEl.f.length&&bottomEl.f;this._init.sets["meta.bottomAttrs"]=bottomEl&&bottomEl.m;var sortKey="[_0._setSort(_1,_2)]";var z=[{n:"gridValue",x:{r:"~/gridValue"}},{n:"gridName",x:{r:"~/gridName"}},{n:"gridSize",x:{r:"~/tableWidth"}},{n:"gridMax",x:{r:"~/gridMax"}},{n:"table",x:{r:"@this"}}];var header=[{t:7,e:"div",m:[{t:13,n:"class-rtable-row-wrap"},{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-header"},{t:4,f:[{n:"style-opacity",f:"0",t:13}],n:50,x:{r:["~/fixedHeader","~/virtual.offset"],s:"!_0&&_1>0"}},{t:4,n:50,r:"~/fixedHeader",f:[{t:13,n:"style-padding-right",f:[{t:2,r:"~/scrollOffset"},"px"]}]}],f:[{t:7,e:"div",f:columns.filter(function(c){return c.hidden!==true}).map(function(c,cidx){c.attrsHP=c.attrs.filter(function(a){return a.n!=="title"});var div={t:7,e:"div",f:[{t:7,e:"div",f:c.label}],m:[{t:4,n:53,r:"~/columns."+cidx,f:[{t:70,n:["click"],f:{r:["@this",".index","@event"],s:sortKey}}]},{t:13,n:"title",f:c.label},{t:16,r:"~/columns."+cidx+".attrsHP",z:z}]};if(c.type){div.m.push({t:13,n:"class-rtable-"+c.type+"-column"})}if(c.filter||c.sort){div.m.push({t:13,n:"class-rtable-sortable"})}div.m.push({t:13,n:"class-rtable-column"});if(c.fixed){var path=c.fixed.path||"~/columns."+cidx+".fixed";div.m.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:path}]});div.m.push({t:4,n:50,x:{r:["~/noWrap",path],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:path}]}]})}var res=div;if(c.hidden&&c.hidden.r){res={t:4,n:51,r:c.hidden.r,f:[div]}}return res}),m:[{t:13,n:"class-row"}]}]}];header[0].f.unshift({t:4,n:50,r:"~/allowSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-header"},{t:13,n:"class-rtable-column"},{t:13,n:"title",f:[{t:2,r:"selections.length"}," items selected"]},{t:13,n:"class-rtable-all-selected",f:[{t:2,x:{r:["@this"],s:"_0._allSelected()"}}]}],f:[{t:7,e:"div",f:[{t:4,n:50,r:"~/allowSelectAll",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["@this"],s:"_0._allSelected()"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:"selectAll"}]}]}],m:[{t:70,n:["clickd"],f:"selectAll"}]}]}]});var row=[{t:7,e:"div",m:[{t:13,n:"class-rtable-row-wrap"},{t:13,n:"class-rtable-odd",f:[{t:2,x:{r:["@index","~/virtual.offset"],s:"(_0+_1)%2===1"}}]},{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-live"},{t:13,n:"class-rtable-selected",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-inner-row-wrap"}],f:[{t:7,e:"div",f:columns.filter(function(c){return c.hidden!==true}).map(function(c,cidx){var content=[{t:7,e:"div",f:[{t:16,r:"~/columns."+cidx+".content",c:{r:"."},z:z}]}];if(c.attrs.length){c.attrsP=c.attrs;c.attrs=[{t:16,r:"~/columns."+cidx+".attrsP",c:{r:"."},z:z}]}else{c.attrs=[]}var attrs=c.attrs;if(c.fixed){var path=c.fixed.path||"~/columns."+cidx+".fixed";attrs.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:path}]});attrs.push({t:4,n:50,x:{r:["~/noWrap",path],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:path}]}]})}if(c.editable&&c.filter){var noclicky={t:70,n:["click","mousedown","pointerdown","MSPointerDown","touchstart"],f:{r:["@event"],s:"[_0.stopPropagation()]"}};var editor=[{t:4,n:50,x:{r:["~/columns."+cidx+".type"],s:"_0==='boolean'"},f:[{t:7,e:"input",m:[{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,r:c.filter}]},noclicky]}]},{t:4,n:51,l:1,f:[{t:7,e:"input",m:[{t:13,n:"value",f:[{t:2,r:c.filter}]},noclicky]}]}];if(typeof c.editable==="object"){attrs.push({t:13,n:"class-rtable-editing",f:c.editable});content=[Object.assign({},c.editable,{t:4,n:50,f:editor}),{t:4,n:51,l:1,f:content}]}else{attrs.push({t:13,n:"class-rtable-editing"});content=editor}}if(c.valign){attrs.push({t:13,n:"class-rtable-valign-col-top",f:[{t:2,x:{r:["~/columns."+cidx+".valign"],s:"_0==='top'"}}]},{t:13,n:"class-rtable-valign-col-bottom",f:[{t:2,x:{r:["~/columns."+cidx+".valign"],s:"_0==='bottom'"}}]},{t:13,n:"class-rtable-valign-col-center",f:[{t:2,x:{r:["~/columns."+cidx+".valign"],s:"_0==='center'"}}]})}var div={t:7,e:"div",f:content,m:attrs};if(c.type){attrs.unshift({t:13,n:"class-rtable-"+c.type+"-column"})}attrs.push({t:13,n:"class-rtable-column"});var title=c.attrsP&&c.attrsP.find(function(a){return a.n==="title"});if(!title){attrs.unshift({t:4,n:50,r:"~/autoTitles",f:[{t:13,n:"title",f:c.content.find(function(e){return e.e})?c.label:c.content}]})}else if(!title.f){attrs.unshift({t:13,n:"title",f:c.content.find(function(e){return e.e})?c.label:c.content});c.attrsP.splice(attrs.indexOf(title),1)}if(c.noPad===0){attrs.push({t:13,n:"class-rtable-no-pad"})}else if(c.noPad){attrs.push({t:13,n:"class-rtable-no-pad",f:c.noPad})}var res=div;if(c.hidden&&c.hidden.r){res={t:4,n:51,r:c.hidden.r,f:[div]}}return res}),m:[{t:13,n:"class-row"},{t:13,n:"class-rtable-row"},{t:70,n:expandEl&&expandEl.f?["dblclickd"]:["click","dblclick"],f:{r:["~/rows","~/visibleRows","."],s:"[['selected',_2,_0.indexOf(_2),_1.indexOf(_2)]]"}}]}]}]}];if(rowEl&&rowEl.m&&rowEl.m.length){this._init.sets.rowAttrs=rowEl.m.slice();row[0].f[0].f[0].m.push({t:16,r:"~/rowAttrs",c:{r:"."},z:z})}if(wrapperEl&&wrapperEl.m&&wrapperEl.m.length){this._init.sets.wrapperAttrs=wrapperEl.m.slice();row[0].m.push({t:16,r:"~/wrapperAttrs",c:{r:"."},z:z})}if(rowEl&&rowEl.f&&rowEl.f.length){row[0].f[0].f.push({t:7,e:"div",m:[{t:13,n:"class-rtable-row-extra"},{t:4,n:50,r:"~/noWrap",f:[{t:13,n:"style-width",f:[{t:2,x:{r:["~/tableWidth","~/allowSelect","@style.raui.table.selectWidth"],s:"_1?'calc('+_0+'px - '+(_2||'2em')+')':_0+'px'"}}]}]}],f:[{t:16,r:"~/meta.extra",c:{r:"."},z:z}]})}if(expandEl&&expandEl.f&&expandEl.f.length){row[0].f[0].f.push({t:4,n:50,x:{r:[".","~/expanded"],s:"_0===_1"},f:[{t:7,e:"div",f:[{t:7,e:"div",f:[{t:16,r:"~/meta.expand",c:{r:"."},z:z}]}],m:[{t:13,n:"class-rtable-row-expand"},{t:4,n:50,r:"~/noWrap",f:[{t:13,n:"style-width",f:[{t:2,x:{r:["~/tableWidth","~/allowSelect","@style.raui.table.selectWidth"],s:"_1?'calc('+_0+'px - '+(_2||'2em')+')':_0+'px'"}}]}]}]}]});row[0].f[0].f[0].m.push({t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._expand(_1)]"}});row[0].f[0].m.push({t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._expand(_1)]"}})}row[0].f.unshift({t:4,n:50,r:"~/allowSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-row"},{t:13,n:"class-rtable-column"},{t:70,n:["clickd"],f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}}],f:[{t:7,e:"div",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}}]}]}]}]});var by;if(groupEl&&groupEl.m&&(by=groupEl.m.find(function(a){return a.n==="by"}))&&(isString(by.f)||by.length===1&&by[0].t===2)){var group={t:4,n:50,f:[{t:7,e:"div",m:[{t:13,n:"class-row"},{t:13,n:"class-rtable-group"},{t:13,n:"class-rtable-selected",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]},{t:70,n:expandEl&&expandEl.f?["dblclickd"]:["click","dblclick"],f:{r:["~/rows","~/visibleRows","."],s:"[['selected',_2,_0.indexOf(_2),_1.indexOf(_2)]]"}}].concat(groupEl.m.filter(function(a){return a.n!=="by"&&a.n!=="select"}))}],x:{s:"_0&&_1[(_1&&(_2*_3+_4))||_4]",r:["~/showGroups","~/groups","~/page","~/pagination.per","@index"]}};row.unshift(group);this._init.by=by.f;var parts=grabColumns(groupEl.f).columns.filter(function(c){return c.hidden!==true}).map(function(c){var div={t:7,e:"div",f:[{t:7,e:"div",f:c.content}],m:c.attrs};if(c.type){div.m.unshift({t:13,n:"class-rtable-"+c.type+"-column"})}div.m.push({t:13,n:"class-rtable-column"});if(!div.m.find(function(a){return a.n==="title"})){div.m.unshift({t:13,n:"title",f:c.content})}var res=div;if(c.hidden&&c.hidden.r){res={t:4,n:51,r:c.hidden.r,f:[div]}}return res});parts.unshift({t:4,n:50,r:"~/allowGroupSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-row"},{t:13,n:"class-rtable-column"},{t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._selectGroup(_1),false]"}},{t:13,n:"class-rtable-all-selected",f:[{t:2,x:{r:["@this","@index"],s:"_0._groupSelected(_1)"}}]}],f:[{t:7,e:"div",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["@this","@index"],s:"_0._groupSelected(_1)"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:{r:["@this","@index"],s:"[_0._selectGroup(_1),false]"}}]}]}]}]});var attr;if(attr=groupEl.m.find(function(a){return a.n==="select"})){(mappings||(mappings=[])).push(Object.assign({},attr,{n:"allowGroupSelect"}))}if(attr=groupEl.m.find(function(a){return a.n==="show"})){(mappings||(mappings=[])).push(Object.assign({},attr,{n:"showGroups"}))}group.f[0].f=parts}this._init.partials["grid-row"]=row;this._init.partials["grid-head"]=header;if(mappings&&this.component){this.component.mappings=mappings}}export function plugin(opts){if(opts===void 0)opts={};return function(ref){var Ractive=ref.Ractive;var instance=ref.instance;if("includeGrid"in opts){Ractive.styleSet("table.includeGrid",opts.includeGrid)}instance.components[opts.name||"data-table"]=Table}}globalRegister("RMTable","components",Table);export default plugin;
import Ractive from"ractive";import{grid,style as gridStyle}from"./grid";import click from"./event-click";import expand from"./transition-expand";import scrolled from"./scrolled";import{sized}from"./watch-size";import globalRegister from"./globalRegister";var sortRE=/^([-+])?([^\s]+)$/;function isString(v){return typeof v==="string"}function isNumber(v){return typeof v==="number"}function isObject(v){return typeof v==="object"}function isRegex(v){return typeof v==="object"&&Object.prototype.toString.call(v)==="RegExp"}export var Table=function(Ractive){function Table(opts){Ractive.call(this,opts)}if(Ractive)Table.__proto__=Ractive;Table.prototype=Object.create(Ractive&&Ractive.prototype);Table.prototype.constructor=Table;var prototypeAccessors={selections:{configurable:true},selected:{configurable:true}};Table.prototype._allSelected=function _allSelected(){var sel=this.get("selections");var visible=this.get("paginate")==="virtual"?this.get("rows"):this.get("visibleRows");for(var i=0;i<visible.length;i++){if(!~sel.indexOf(visible[i])){return false}}return visible.length&&true};Table.prototype._setSort=function _setSort(index,ev){var ref=[this.get("sort-handler"),this.get("@style.raui.table.sort-handler")];var localh=ref[0];var classh=ref[1];var fn=localh||classh;if(fn){fn(this,this.get("columns."+index),index,ev)}else{var sort=this.get("sort")||"";var col=this.get("columns."+index);var id=col.id;if(sort===id||sort.substr(1)===id){if(sort[0]==="-"){this.set("sort",id)}else{this.set("sort","-"+id)}}else{this.set("sort",id)}}};Table.prototype.nodeSet=function nodeSet(node,prop,value){node[prop]=value};Table.prototype._expand=function _expand(idx){var this$1=this;var which=this.get("visibleRows")[idx];var current=this.get("expanded");var expanded=this.find(".rtable-row-expand");if(expanded){this.transition("expand",expanded,{outro:true}).then(function(){if(current===which){this$1.set("expanded",null)}else{this$1.set("expanded",which);this$1.transition("expand",this$1.find(".rtable-row-expand"),{intro:true})}})}else{if(which===current){this.set("expanded",null)}else{this.set("expanded",which);this.transition("expand",this.find(".rtable-row-expand"),{intro:true})}}};Table.prototype._select=function _select(src,ev){var sels=this.get("selections");if(!sels){sels=[];this.set("selections",sels)}var i=sels.indexOf(src);if(~i){this.splice("selections",i,1)}else{this.push("selections",src)}if(i>=sels.length||sels.length===1){this.set("selected",sels[sels.length-1])}this.fire("selection",{},{item:sels[sels.length-1],items:sels});setTimeout(function(){return ev.target.checked=!~i});return false};Table.prototype.select=function select(){var selected=this.get("selected");if(selected){this.fire("selected",{},selected,this.get("rows").indexOf(selected),this.get("visibleRows").indexOf(selected))}};Table.prototype.deselect=function deselect(){this.set({selections:[],selected:undefined})};prototypeAccessors.selections.get=function(){return this.get("selections")||[]};prototypeAccessors.selections.set=function(v){var rows=this.get("rows");var sels=Array.isArray(v)?v.filter(function(i){return~rows.indexOf(i)}):[];this.set("selections",sels)};prototypeAccessors.selected.get=function(){return this.get("selected")};prototypeAccessors.selected.set=function(v){this.set({selected:v,selections:[v]})};Table.prototype.selectionOffset=function selectionOffset(offset){var selected=this.get("selected");var visible=this.get("visibleRows");if(!selected||!~visible.indexOf(selected)){var next=offset>0?visible[0]:visible[visible.length-1];this.set({selected:next,selections:[next]})}else{var idx=visible.indexOf(selected);if(offset>0?idx+offset>=visible.length:idx+offset<0){var move=offset<1?-1:1;if(move<0&&this.get("page")+move>=0||move>0&&this.get("page")+move<this.get("pagination.total")){this.add("page",move)}visible=this.get("visibleRows");var next$1=offset>0?visible[0]:visible[visible.length-1];this.set({selected:next$1,selections:[next$1]})}else{this.set({selected:visible[idx+offset],selections:[visible[idx+offset]]})}}this.fire("selection",{},{item:this.get("selected"),items:this.get("selections")})};Table.prototype.selectionDown=function selectionDown(){this.selectionOffset(1)};Table.prototype.selectionUp=function selectionUp(){this.selectionOffset(-1)};Table.prototype._selectGroup=function _selectGroup(idx){var grp=idx;if(this.get("page")){grp+=this.get("page")*this.get("pagination.per")}var rows=this.get("rows");var groups=this.get("groups");var sels=this.get("selections");var x=rows[grp++];var xs=["selections"];var ss=[];var i;if(!~(i=sels.indexOf(x))){xs.push(x)}else{ss.push(i)}while(grp<rows.length&&!(grp in groups)){x=rows[grp++];if(!~(i=sels.indexOf(x))){xs.push(x)}else{ss.push(i)}}if(xs.length===1){i=ss.length;while(i--){this.splice("selections",ss[i],1)}}else{this.push.apply(this,xs)}return false};Table.prototype._groupSelected=function _groupSelected(idx){var grp=idx;if(this.get("page")){grp+=this.get("page")*this.get("pagination.per")}var rows=this.get("rows");var groups=this.get("groups");var sels=this.get("selections");if(!~sels.indexOf(rows[grp++])){return false}while(grp<rows.length&&!(grp in groups)){if(!~sels.indexOf(rows[grp++])){return false}}return true};Table.prototype._rows=function _rows(){var src=(this.get("items")||[]).slice();var filter=this.get("filter");var sort=this.get("sort");var ref=[this.get("data-handler"),this.get("@style.raui.table.data-handler")];var localh=ref[0];var classh=ref[1];var handler=localh||classh||defaultFilter;if(!filter&&!sort){this.set("isFiltered",false);return this.set("rows",src)}var res=handler(this,src,filter,sort,this.get("parameters",{virtual:true}));this.set("isFiltered",res.length!==src.length);this.set("rows",res)};Object.defineProperties(Table.prototype,prototypeAccessors);return Table}(Ractive);function scrollheader(node){var this$1=this;var scroll=function(ev){requestAnimationFrame(function(){return this$1.find(".rtable-header-wrapper").scrollLeft=ev.target.scrollLeft})};node.addEventListener("scroll",scroll,{passive:true});return{teardown:function teardown(){node.removeEventListener("scroll",scroll)}}}Table.settings={valign:"center",border:false,"fixed-header":true,"allow-select":true,"allow-select-all":true,"auto-titles":false,paginate:"virtual"};Ractive.extendWith(Table,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable",g:1},{n:"class-rtable-virtual",t:13,f:[{t:2,x:{r:["~/paginate"],s:'_0==="virtual"'}}]},{n:"class-rtable-auto",t:13,f:[{t:2,x:{r:["~/paginate"],s:'_0==="auto"'}}]},{n:"class-rtable-fixed",t:13,f:[{t:2,r:"~/fixed"}]},{n:"class-rtable-border",t:13,f:[{t:2,r:"~/border"}]},{n:"class-rtable-fixed-header",t:13,f:[{t:2,r:"~/fixedHeader"}]},{n:"class-rtable-scrolled-down",t:13,f:[{t:2,x:{r:["~/scroll"],s:'!~(_0||"").indexOf("top")'}}]},{n:"class-rtable-scrolled-up",t:13,f:[{t:2,x:{r:["~/scroll"],s:'!~(_0||"").indexOf("bottom")'}}]},{n:"class-rtable-with-select",t:13,f:[{t:2,r:"~/allowSelect"}]},{n:"class-rtable-valign-top",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="top"'}}]},{n:"class-rtable-valign-center",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="center"'}}]},{n:"class-rtable-valign-bottom",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="bottom"'}}]},{n:"class-rtable-nowrap",t:13,f:[{t:2,r:"~/noWrap"}]},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-fixed",g:1},{n:"grid",t:71,f:{r:["~/scrollOffset"],s:"[{offset:_0}]"}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-extra",g:1},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/tableWidth"},"px"],t:13}],n:50,r:"~/noWrap"},{n:"class-rtable-noheader",t:13,f:[{t:2,r:"~/noHeader"}]},{t:4,f:[{t:16,r:"meta.topAttrs"}],n:50,r:"meta.topAttrs"}],f:[{t:16,r:"meta.top",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}]}],n:50,r:"meta.top"}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-wrapper row-wrap",g:1}],f:[{t:8,r:"grid-head"}]}],n:51,r:"~/noHeader"}]}],n:50,x:{r:["~/noHeader","meta.top","~/fixedHeader"],s:"(!_0||_1)&&_2"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-top",g:1},{t:4,f:[{n:["scroll"],t:70,f:"scroll"},{n:"sized",t:71,f:{r:[],s:'[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]'}}],n:50,x:{r:["~/paginate"],s:'_0==="virtual"'}},{t:4,f:[{n:"scrolled",t:71,f:{r:[],s:'["~/scroll"]'}}],n:50,x:{r:["~/noHeader","~/fixedHeader","~/meta.bottom"],s:"(!_0&&_1)||_2"}},{t:4,f:[{n:"scrollheader",t:71}],n:50,x:{r:["~/fixedHeader","~/noWrap"],s:"_0&&_1"}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-extra",g:1},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/tableWidth"},"px"],t:13}],n:50,r:"~/noWrap"},{n:"class-rtable-noheader",t:13,f:[{t:2,r:"~/noHeader"}]},{t:4,f:[{t:16,r:"meta.topAttrs"}],n:50,r:"meta.topAttrs"}],f:[{t:16,r:"meta.top",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}]}],n:50,x:{r:["~/fixedHeader","meta.top"],s:"!_0&&_1"}}," ",{t:7,e:"div",m:[{n:"grid",t:71,f:{r:[],s:'[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]'}},{t:4,f:[{n:"style-margin-top",f:[{t:2,r:"~/virtual.above"},"px"],t:13},{n:"style-margin-bottom",f:[{t:2,r:"~/virtual.below"},"px"],t:13}],n:50,x:{r:["~/paginate"],s:'_0==="virtual"'}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-wrapper row-wrap",g:1}],f:[{t:8,r:"grid-head"}]}],n:50,x:{r:["~/noHeader","~/fixedHeader"],s:"!_0&&!_1"}}," ",{t:4,f:[{t:4,f:[{t:8,r:"grid-row"}],n:52,z:[{n:"source",x:{r:"~/items"}},{n:"shuffle",x:{x:{r:[],s:"true"}}}],r:"~/visibleRows"}],n:50,r:"~/shuffle"},{t:4,f:[{t:4,f:[{t:8,r:"grid-row"}],n:52,r:"~/visibleRows"}],n:51,l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-row row t1",g:1}],f:[{t:16,r:"empty",z:[{n:"message",x:{r:"~/empty"}}]}]}],n:50,x:{r:["~/rows.length"],s:"!_0"}}]}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-bottom",g:1},{t:4,f:[{t:16,r:"meta.bottomAttrs"}],n:50,r:"meta.bottomAttrs"}],f:[{t:4,f:[{t:16,r:"meta.bottom",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}],n:50,r:"~/meta.bottom"}," ",{t:4,f:[{t:8,r:"pagination"}],n:50,x:{r:["~/paginate"],s:'_0!=="virtual"'}}]}],n:50,x:{r:["~/paginate","~/meta.bottom"],s:'_0!=="virtual"||_1'}}]}],e:{'_0==="virtual"':function(_0){return _0==="virtual"},'_0==="auto"':function(_0){return _0==="auto"},'!~(_0||"").indexOf("top")':function(_0){return!~(_0||"").indexOf("top")},'!~(_0||"").indexOf("bottom")':function(_0){return!~(_0||"").indexOf("bottom")},'_0==="top"':function(_0){return _0==="top"},'_0==="center"':function(_0){return _0==="center"},'_0==="bottom"':function(_0){return _0==="bottom"},"[{offset:_0}]":function(_0){return[{offset:_0}]},"(!_0||_1)&&_2":function(_0,_1,_2){return(!_0||_1)&&_2},'[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]':function(){return[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]},'["~/scroll"]':function(){return["~/scroll"]},"(!_0&&_1)||_2":function(_0,_1,_2){return!_0&&_1||_2},"_0&&_1":function(_0,_1){return _0&&_1},"!_0&&_1":function(_0,_1){return!_0&&_1},'[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]':function(){return[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]},"!_0&&!_1":function(_0,_1){return!_0&&!_1},true:function(){return true},"!_0":function(_0){return!_0},'_0!=="virtual"':function(_0){return _0!=="virtual"},'_0!=="virtual"||_1':function(_0,_1){return _0!=="virtual"||_1},"(_0+_1)%2===1":function(_0,_1){return(_0+_1)%2===1},"[_0._setSort(_1,_2)]":function(_0,_1,_2){return[_0._setSort(_1,_2)]},"[_0._select(_1,_2),false]":function(_0,_1,_2){return[_0._select(_1,_2),false]},'[["select",_2,_0.indexOf(_2),_1.indexOf(_2)]]':function(_0,_1,_2){return[["select",_2,_0.indexOf(_2),_1.indexOf(_2)]]},"[_0._expand(_1)]":function(_0,_1){return[_0._expand(_1)]},"[_0.stopPropagation()]":function(_0){return[_0.stopPropagation()]},"_0.indexOf(_1)":function(_0,_1){return _0.indexOf(_1)},"_0===_1":function(_0,_1){return _0===_1},"_0>0":function(_0){return _0>0},"!_0&&_1>0":function(_0,_1){return!_0&&_1>0},'_0==="boolean"':function(_0){return _0==="boolean"},"_0._allSelected()":function(_0){return _0._allSelected()},'_0||"No data."':function(_0){return _0||"No data."},"_0*_1+1":function(_0,_1){return _0*_1+1},"_2+1===_0?_1:(_2+1)*_3":function(_0,_1,_2,_3){return _2+1===_0?_1:(_2+1)*_3},"_0===1":function(_0){return _0===1},"_0._allSelected()&&_1<_2":function(_0,_1,_2){return _0._allSelected()&&_1<_2},'[_0.set("page",_1-1)]':function(_0,_1){return[_0.set("page",_1-1)]},'[(/^\\d+$/.test(_1)&&+_1>0&&+_1<=_0&&_2.set("page",+_1-1))||_2.nodeSet(_3,"value",_4+1)]':function(_0,_1,_2,_3,_4){return[/^\d+$/.test(_1)&&+_1>0&&+_1<=_0&&_2.set("page",+_1-1)||_2.nodeSet(_3,"value",_4+1)]},"_0==_1+1":function(_0,_1){return _0==_1+1},'[_0.set("page",_2[_1-1])]':function(_0,_1,_2){return[_0.set("page",_2[_1-1])]},'_0==="..."':function(_0){return _0==="..."},'[_0.set("page",_1+1)]':function(_0,_1){return[_0.set("page",_1+1)]},"_0<_1-1":function(_0,_1){return _0<_1-1}},p:{"csp-dummy":[{t:7,e:"div",m:[{n:"class-rtable-odd",t:13,f:[{t:2,x:{r:["@index","~/virtual.offset"],s:"(_0+_1)%2===1"}}]},{n:"class-top",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="top"'}}]},{n:"class-bottom",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="bottom"'}}]},{n:"class-center",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="center"'}}]},{n:["click"],t:70,f:{r:["@this",".index","@event"],s:"[_0._setSort(_1,_2)]"}},{n:["click"],t:70,f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}},{n:["click"],t:70,f:{r:["~/rows","~/visibleRows","."],s:'[["select",_2,_0.indexOf(_2),_1.indexOf(_2)]]'}},{n:["click"],t:70,f:{r:["@this","@index"],s:"[_0._expand(_1)]"}},{n:["click"],t:70,f:{r:["@event"],s:"[_0.stopPropagation()]"}}]}," ",{t:4,f:["..."],n:50,x:{r:["~/selections","."],s:"_0.indexOf(_1)"}}," ",{t:4,f:["..."],n:50,x:{r:[".","~/expanded"],s:"_0===_1"}}," ",{t:4,f:["..."],n:50,x:{r:["~/virtual.offset"],s:"_0>0"}}," ",{t:4,f:["..."],n:50,x:{r:["~/fixedHeader","~/virtual.offset"],s:"!_0&&_1>0"}}," ",{t:4,f:["..."],n:50,x:{r:["~/columns.0.type"],s:'_0==="boolean"'}}," ",{t:4,f:["..."],n:50,x:{r:["@this"],s:"_0._allSelected()"}}],empty:[{t:7,e:"div",f:[{t:7,e:"div",f:[{t:2,x:{r:["message"],s:'_0||"No data."'}}]}]}],pagination:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-pagination",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-info",g:1}],f:[{t:4,f:[{t:2,x:{r:["~/page","~/pagination.per"],s:"_0*_1+1"}}," - ",{t:2,x:{r:["~/pagination.total","~/rows.length","~/page","~/pagination.per"],s:"_2+1===_0?_1:(_2+1)*_3"}}," of ",{t:2,r:"~/rows.length"},{t:4,f:[" (",{t:2,r:"~/items.length"}," total)"],n:50,r:"~/isFiltered"}],n:50,x:{r:["pagination","rows.length"],s:"_0&&_1"}}," ",{t:4,f:["​"],n:50,x:{r:["_paginate"],s:"_0===1"}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-select-all-all",g:1}],f:[{t:4,f:[{t:7,e:"strong",f:[{t:2,r:"selections.length"}]}," of ",{t:7,e:"strong",f:[{t:2,r:"rows.length"}]}," selected",{t:4,f:[" - ",{t:7,e:"a",m:[{n:"href",f:"#",t:13,g:1},{n:["click"],t:70,f:"selectAllAll"}],f:["Select All"]}],n:50,x:{r:["@this","selections.length","rows.length"],s:"_0._allSelected()&&_1<_2"}}],n:50,x:{r:["selections.length"],s:"_0>0"}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-pages",g:1}],f:[{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","~/page"],s:'[_0.set("page",_1-1)]'}}],f:["Previous"]}],n:50,x:{r:["~/page"],s:"_0>0"}}," ",{t:4,f:[{t:4,f:[{t:7,e:"input",m:[{n:["change"],t:70,f:{r:["~/pagination.total","@node.value","@this","@node","~/page"],s:'[(/^\\d+$/.test(_1)&&+_1>0&&+_1<=_0&&_2.set("page",+_1-1))||_2.nodeSet(_3,"value",_4+1)]'}},{n:"value",f:[{t:2,r:"."}],t:13},{t:73,v:"t",f:"false"}]}],n:50,x:{r:[".","~/page"],s:"_0==_1+1"}},{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","@index","../"],s:'[_0.set("page",_2[_1-1])]'}}],f:["..."]}," "],n:50,x:{r:["."],s:'_0==="..."'},l:1},{t:4,f:[" ",{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","."],s:'[_0.set("page",_1-1)]'}}],f:[{t:2,r:"."}]}],n:51,l:1}],n:52,r:"~/pagination.array"}," ",{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","~/page"],s:'[_0.set("page",_1+1)]'}}],f:["Next"]}],n:50,x:{r:["~/page","~/pagination.total"],s:"_0<_1-1"}}]}]}]}},css:function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.table.primary"));var active=Object.assign({},primary,data("raui.primary.active"),data("raui.table.primary.active"));var table=Object.assign({selected:{},header:{},footer:{}},data("raui.table"));return"\n .rtable {\n display: flex;\n flex-direction: column;\n overflow: auto;\n max-width: 100%;\n max-height: 100%;\n box-sizing: border-box;\n flex-grow: 2;\n }\n \n .rtable.rtable-border {\n border: 1px solid "+(table.divider||primary.bc||"#ccc")+";\n }\n \n .rtable-group > div > div,\n .rtable-header > div > div,\n .rtable-row > div > div {\n padding: "+(table.padding||"0.5em")+";\n overflow: inherit;\n text-overflow: inherit;\n line-height: 1em;\n }\n .rtable-row > .rtable-no-pad > div {\n padding: 0;\n }\n \n .rtable-auto .row > *,\n .rtable-fixed .row > *\n {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n \n .rtable-header > div > div, .rtable-column {\n overflow: hidden;\n }\n \n .rtable-number-column {\n text-align: right;\n }\n .rtable-date-column {\n text-align: right;\n }\n \n .rtable-sortable {\n cursor: pointer;\n user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n }\n \n .grid .row.rtable-row, .grid .rtable-header > .row {\n width: auto;\n min-width: min-content;\n flex-grow: 1;\n }\n \n .rtable-nowrap .grid .rtable-row, .rtable-nowrap .grid .rtable-header > .row {\n flex-wrap: nowrap;\n }\n .rtable-nowrap .rtable-row-wrap, .rtable-inner-row-wrap {\n flex-grow: 1;\n } \n \n .rtable-row-wrap {\n color: "+(primary.fg||"#222")+";\n border-style: solid;\n border-color: "+(table.divider||primary.bc||"#ccc")+";\n border-width: 0 0 1px 0;\n background-color: "+(table.even||primary.bga||"#f4f4f4")+";\n }\n .rtable-row-wrap.rtable-odd {\n background-color: "+(table.odd||primary.bg||"#fff")+";\n }\n .rtable-row-wrap:hover, .rtable-row-wrap.rtable-selected:hover, .rtable-row-wrap.rtable-odd.rtable-selected:hover {\n background-color: "+(table.over||active.bg||"#e6f0fa")+";\n position: relative;\n box-shadow: inset 1px 0 0 #dadce0,inset -1px 0 0 #dadce0, 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n z-index: 2;\n }\n .rtable-header.rtable-row-wrap:hover {\n box-shadow: none;\n }\n \n .rtable-row-wrap.rtable-selected {\n background-color: "+(table.selected.bg||"#cee5fd")+";\n color: "+(table.selected.fg||primary.fg||"#222")+";\n }\n .rtable-row-wrap.rtable-selected.rtable-odd {\n background-color: "+(table.selected.odd||"#c5dffb")+";\n }\n \n .rtable-row-wrap {\n display: flex;\n flex-grow: 1;\n align-items: center;\n z-index: 2;\n align-items: stretch;\n }\n \n .rtable-nowrap .rtable-row-wrap {\n display: inline-flex;\n min-width: 100%;\n box-sizing: border-box;\n }\n \n .rtable-nowrap > .rtable-top > .grid {\n line-height: 1em;\n }\n \n .rtable-border .rtable-row .rtable-column,\n .rtable-border .rtable-group .rtable-column {\n border-color: "+(table.divider||primary.bc||"#ccc")+";\n border-style: solid;\n border-width: 0 0 1px 1px;\n margin: 0 0 -1px -1px;\n }\n .rtable-border .rtable-header .rtable-column {\n margin-left: -1px;\n }\n .rtable-border .rtable-row .rtable-column:nth-child(1),\n .rtable-border .rtable-group .rtable-column:nth-child(1) {\n border-left-width: 0;\n }\n .rtable-border.rtable-with-select .rtable-row .rtable-column:nth-child(1),\n .rtable-border.rtable-with-select .rtable-group .rtable-column:nth-child(1) {\n border-left-width: 1px;\n }\n \n .rtable-border .rtable-row-wrap {\n border-bottom-width: 1px;\n }\n \n .rtable-border .rtable-row-expand, .rtable-border .rtable-row-extra {\n border-color: "+(table.divider||primary.bc||"#ccc")+";\n border-style: solid;\n border-width: 1px 0 0 0;\n margin-left: -1px;\n width: 100%;\n }\n .rtable-border.rtable-with-select .rtable-row-expand, .rtable-border.rtable-with-select .rtable-row-extra {\n border-left-width: 1px;\n }\n \n .rtable-row-expand, .rtable-row-extra {\n box-sizing: border-box;\n padding: "+(table.padding||"0.5em")+";\n }\n \n .rtable-group {\n border-bottom: 2px solid "+(table.divider||primary.bc||"#ccc")+";\n }\n \n .rtable-header.rtable-row-wrap, .rtable-header.rtable-row-wrap:hover {\n font-weight: bold;\n background-color: "+(table.header.bg||"#dedede")+";\n }\n .rtable-header-fixed {\n line-height: 1em;\n background-color: "+(table.header.bg||"#dedede")+";\n }\n \n .rtable-header.rtable-row-wrap, .rtable-header-extra.rtable-noheader {\n border-bottom: 2px solid "+(table.divider||primary.bc||"#ccc")+";\n }\n \n .rtable-header-extra {\n background-color: "+(table.header.bg||"#dedede")+";\n padding: "+(table.padding||"0.5em")+";\n line-height: 1em;\n z-index: 4;\n box-sizing: border-box;\n min-width: 100%;\n }\n .rtable-nowrap .rtable-header-extra {\n position: sticky;\n left: 0;\n }\n \n .rtable-top {\n flex-grow: 5;\n flex-shrink: 1;\n overflow-y: auto;\n position: relative;\n }\n .rtable-fixed-header .rtable-header {\n position: relative;\n z-index: 3;\n }\n .rtable-fixed-header.rtable-scrolled-down .rtable-header-fixed {\n box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15), 0 0.25em 0.5em rgba(0,0,0,0.25);\n z-index: 3;\n }\n .rtable-fixed-header .rtable-top {\n margin-top: 0;\n }\n .rtable-nowrap.rtable-fixed-header .rtable-header-wrapper {\n flex-shrink: 0;\n width: 100%;\n overflow-x: auto;\n scrollbar-width: none;\n }\n .rtable-nowrap.rtable-fixed-header .rtable-header-wrapper::-webkit-scrollbar {\n height: 0;\n }\n .rtable-fixed-header .rtable-header-fixed::-webkit-scrollbar {\n width: 0;\n height: 0;\n }\n \n .rtable-nowrap .rtable-fixed-column, .rtable-nowrap .rtable-row-extra, .rtable-nowrap .rtable-row-expand {\n position: -webkit-sticky;\n position: sticky;\n left: 0;\n }\n .rtable-border..rtable-nowrap .rtable-fixed-column, .rtable-border.rtable-nowrap .rtable-row-extra, .rtable-border.rtable-nowrap .rtable-row-expand {\n left: 1px;\n }\n .rtable-nowrap.rtable-with-select .rtable-fixed-column, .rtable-nowrap.rtable-with-select .rtable-row-extra, .rtable-nowrap.rtable-with-select .rtable-row-expand {\n left: "+(table.selectWidth||"2em")+";\n }\n .rtabe-border.rtable-nowrap.rtable-with-select .rtable-fixed-column, .rtabe-border.rtable-nowrap.rtable-with-select .rtable-row-extra, .rtabe-border.rtable-nowrap.rtable-with-select .rtable-row-expand {\n left: "+(table.selectWidth||"2em")+";\n }\n \n .rtable-nowrap .rtable-inner-row-wrap {\n background-color: inherit;\n }\n \n .rtable-nowrap .row,\n .rtable-nowrap .rtable-fixed-column,\n .rtable-nowrap .rtable-select-row,\n .rtable-nowrap .rtable-select-header {\n background-color: inherit;\n z-index: 1;\n }\n \n .rtable-nowrap .rtable-select-row,\n .rtable-nowrap .rtable-select-header {\n position: sticky;\n position: -webkit-sticky;\n left: 0;\n z-index: 1;\n }\n .rtable-nowrap .rtable-select-header {\n z-index: 2;\n }\n \n .rtable-nowrap.rtable-border .rtable-fixed-column {\n border-right-width: 1px;\n }\n \n .rtable-scrolled-up .rtable-bottom {\n box-shadow: 0 -1px 2px 0 rgba(60, 64, 67, 0.3), 0 -1px 3px 1px rgba(60, 64, 67, 0.15), 0 -0.25em 0.5em rgba(0,0,0,0.25);\n z-index: 3;\n }\n .rtable-bottom {\n padding: "+(table.padding||"0.5em")+";\n background-color: "+(table.footer.bg||table.header.bg||"#dedede")+";\n border-top: 2px solid "+(table.divider||primary.bc||"#ccc")+";\n }\n \n .rtable-pagination {\n display: flex;\n flex-wrap: wrap;\n flex-shrink: 0;\n justify-content: space-between;\n }\n \n .rtable-pages span {\n margin: 0.3em;\n cursor: pointer;\n }\n .rtable-pages span:first-of-type {\n margin-left: 0;\n }\n .rtable-pages input {\n text-align: center;\n width: 2.5em;\n font-size: 1em;\n background-color: transparent;\n border: none;\n padding: 0;\n font-weight: bold;\n text-decoration: underline;\n }\n \n /* checkboxes */\n .rtable-select {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n position: absolute;\n display: block;\n margin: 0;\n width: 2em;\n height: 2em;\n box-shadow: none;\n outline: none;\n opacity: 0;\n top: -4px;\n left: -1.5px;\n border-radius: 2em;\n transition: transform 0.2s, opacity 0.2s;\n background-color: "+(primary.bc||"#ccc")+";\n cursor: pointer;\n }\n \n .rtable-select-header > div, .rtable-select-row > div, .rtable-header > div.rtable-select-header > div {\n padding: 0;\n overflow: visible;\n width: 1.5em;\n position: relative;\n line-height: 1.8em;\n cursor: pointer;\n display: flex;\n justify-content: space-around;\n align-items: center;\n flex-grow: 0;\n }\n \n .rtable-select:checked {\n background-color: "+(primary.fga||"#07e")+';\n }\n \n .rtable-select-header:hover .rtable-select, .rtable-select-row:hover .rtable-select {\n opacity: 0.04;\n }\n \n .rtable-select:focus {\n opacity: 0.12;\n transform: scale(1);\n }\n \n .rtable-select-header:hover .rtable-select:focus, .rtable-select-row:hover .rtable.select:focus {\n opacity: 0.16;\n }\n \n .rtable-select:active {\n opacity: 0.4;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n \n .rtable-select-row > div:before, .rtable-select-header > div:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n border: solid 2px; /* Safari */\n border-color: '+(primary.fg||"#222")+';\n border-radius: 2px;\n width: 18px;\n height: 18px;\n vertical-align: middle;\n transition: border-color 0.2s, background-color 0.2s;\n }\n \n .rtable-select-row > div:after, .rtable-select-header > div:after {\n content: "";\n display: block;\n position: absolute;\n top: -5px;\n left: 0px;\n width: 10px;\n height: 5px;\n border: solid 2px transparent;\n border-right: none;\n border-top: none;\n transform: translate(0.35em, 0.55em) rotate(-45deg);\n opacity: 0;\n }\n \n .rtable-selected .rtable-select-row > div:before, .rtable-all-selected > div:before {\n border-color: '+(primary.fga||"#07e")+";\n background-color: "+(primary.fga||"#07e")+";\n }\n \n .rtable-selected .rtable-select-row > div:after, .rtable-all-selected > div:after {\n border-color: "+(primary.bg||"#fff")+";\n opacity: 1;\n }\n \n .rtable-row-wrap > .rtable-select-header,\n .rtable-row-wrap > .rtable-select-row {\n text-align: center;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: space-around;\n width: "+(table.selectWidth||"2em")+";\n }\n \n .rtable-column button, .rtable-column .btn {\n padding: 0 0.5em;\n margin: 0.2em 0.5em;\n min-height: 0;\n }\n \n .rtable-column.rtable-editing, .rtable-column.rtable-editing > .rtable-edit {\n padding: 0;\n }\n .rtable-column.rtable-editing input {\n width: 100%;\n box-sizing: border-box;\n height: 100%;\n margin: 0;\n border: none;\n background-color: transparent;\n padding: 0.25em 0.5em;\n }\n \n .rtable-valign-top .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-top > div {\n display: flex;\n height: 100%;\n align-items: flex-start;\n box-sizing: border-box;\n }\n .rtable-valign-bottom .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-bottom > div {\n display: flex;\n height: 100%;\n align-items: flex-end;\n box-sizing: border-box;\n }\n .rtable-valign-center .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-center > div {\n display: flex;\n height: 100%;\n align-items: center;\n box-sizing: border-box;\n }\n "+(data("table.includeGrid")?gridStyle(data):"")}.call(this,data)].join(" ")},cssId:"rtable",noCssTransform:true,attributes:["paginate","items","filter","data-handler","sort-handler","sort","helpers","fixed","allow-select","allow-select-all","border","fixed-header","valign","no-header","empty","shuffle","no-wrap","parameters"],components:{table:false,Table:false},syncComputedChildren:true,decorators:{grid:grid,sized:sized,scrollheader:scrollheader},events:{},use:[click({name:"clickd",count:1}),click({name:"dblclickd",count:2}),expand(),scrolled()],on:{construct:construct,config:function config(){this.set(this._init.sets);Object.assign(this.partials,this._init.partials)},render:function render(){if(this._autoObserver){this._autoObserver.fire()}},selectAll:function selectAll(){var sel,item;if(this._allSelected()){item=null;sel=[];this.set({selections:sel,selected:item})}else{sel=(this.get("paginate")==="virtual"?this.get("rows"):this.get("visibleRows")).slice();item=sel[0];this.set({selections:sel,selected:item})}this.fire("selection",{},{item:item,items:sel});return false},selectAllAll:function selectAllAll(){var item=null;var sel=this.get("rows").slice();this.set({selections:sel,selected:item});this.fire("selection",{},{item:item,items:sel});return false}},observe:{_rows:function _rows(){var this$1=this;if(this._rowbounce){clearTimeout(this._rowbounce)}setTimeout(function(){return this$1._rows()},this.get("@style.raui.table.debounce")||160)},paginate:{handler:function handler(v){var this$1=this;if(v==="auto"||v==="virtual"||v instanceof Ractive){if(this._autoObserver){this._autoObserver.cancel()}if(this._scrollListener){this._scrollListener.cancel()}var root=v==="auto"||v==="virtual"?this.root:v;var sized=false;var fn=function(){if(!this$1.rendered){return}var top=this$1.find(".rtable-top");if(!top){return}if(!this$1.get("items.length")){if(!this$1._autoLenObserver){this$1._autoLenObserver=this$1.observeOnce("items",function(){this$1._autoLenObserver=0;setTimeout(fn)})}return}var size=top.clientHeight+","+top.clientWidth;if(fn.last===size&&sized){return}{var ctx=this$1.getContext(top);if(ctx.decorators&&ctx.decorators.scrolled){ctx.decorators.scrolled.refresh()}}var header=this$1.find(".rtable-header")||{};var rows=Array.apply(null,this$1.findAll(".rtable-live")).map(function(r){return r.offsetHeight});if(rows.length<5){var auto=Math.floor(top.clientHeight/(header.offsetHeight||1));if(auto<5){auto=5}this$1.set("_paginate",auto);rows=Array.apply(null,this$1.findAll(".rtable-live")).map(function(r){return r.offsetHeight})}if(rows.length>0){sized=true}else{rows=[25]}var avg=Math.ceil(rows.reduce(function(a,c){return a+c},0)/rows.length);this$1._avgSize=avg;var fit=Math.floor((top.clientHeight-(header.offsetHeight||1))/avg);if(v==="virtual"){fit=fit+10;if(fit<30){fit=30}}this$1.set("_paginate",fit);fn.last=size};var tm;var fnd=function(){if(tm){clearTimeout(tm)}tm=setTimeout(function(){fn();tm=null;if(sized&&this$1._scrollListener){this$1._scrollListener.fn()}},50)};this._autoObserver=this.observe("~/tableHeight",fnd);this._autoObserver.fire=fnd;if(v==="virtual"){var lock=false;var node;var fn$1=function(){if(!this$1.rendered){node=null;return}if(!node){node=this$1.find(".rtable-top")}if(!sized){return fnd()}var top=node.scrollTop;var virtual=this$1.get("virtual")||{};var offset=virtual.offset;var visible=this$1.get("_paginate");var page=visible-10;var count=this$1.get("rows.length");if(visible>count){visible=count}var avg=this$1._avgSize;var pageSize=page*avg;var wnd=Math.floor(top/avg);var first=wnd-5;if(first<0){first=0}var hardFirst=first;if(first+visible>count){first=count-visible}if(offset===first&&!isNaN(virtual.top)){return lock=false}if(!isNumber(offset)||isNaN(offset)||isNaN(virtual.top)||top<virtual.top+pageSize||top>virtual.bottom-pageSize||offset>0&&top<avg*page){var amtAbove=hardFirst;var amtBelow=count-hardFirst-visible;if(amtAbove<0){amtBelow+=amtAbove*-1;amtAbove=0}else if(amtAbove>count-visible){amtAbove=count-visible}if(amtBelow<0){amtBelow=0}var above=amtAbove*avg;var below=amtBelow*avg;var vis,next;if(first<offset+visible&&first>offset-visible){if(first>offset){vis=this$1.findAll(".rtable-live")[first-offset]}else{vis=this$1.findAll(".rtable-live")[offset-first]}}if(vis&&first>0&&vis.offsetTop>node.scrollTop-pageSize-5&&vis.offsetTop<node.scrollTop+pageSize){next=vis.offsetTop}this$1.set({"virtual.above":above,"virtual.below":below,"virtual.offset":first});if(typeof next==="number"){if(next!==vis.offsetTop){this$1.set("virtual.above",above+(next-vis.offsetTop))}}this$1.set({"virtual.top":this$1.get("virtual.above"),"virtual.bottom":node.scrollHeight-below})}lock=false};var scroll=this._scrollListener=this.on("scroll",function(ref){var node=ref.node;if(!lock){lock=true;requestAnimationFrame(fn$1)}});scroll.fn=fn$1;scroll.observer=this.observe("rows.length",function(){this$1.set("virtual.offset",null);fn$1()},{init:false,strict:true,defer:true});var cancel=scroll.cancel;scroll.cancel=function(){cancel();scroll.observer.cancel()}}fnd()}else{if(this._autoObserver){this._autoObserver.cancel()}if(this._scrollListener){this._scrollListener.cancel()}}if(isNumber(v)){this.set("_paginate",v)}},defer:true},"scrollOffset tableHeight":{handler:function handler(){var this$1=this;requestAnimationFrame(function(){var top=this$1.find(".rtable-top");var ctx=top&&this$1.getContext(top);if(ctx&&ctx.decorators&&ctx.decorators.scrolled){ctx.decorators.scrolled.refresh()}})},init:false}},data:function data(){return Object.assign({page:0,selections:[],showGroups:true,allowGroupSelect:true,expanded:null,minPerPage:10,virtual:{offset:0},shuffle:false,rows:[]},Table.settings)},computed:{allowSelect:function allowSelect(){return this.get("allow-select")},allowSelectAll:function allowSelectAll(){return this.get("allow-select-all")},fixedHeader:function fixedHeader(){return this.get("fixed-header")},autoTitles:function autoTitles(){return this.get("auto-titles")},noHeader:function noHeader(){return this.get("no-header")},noWrap:function noWrap(){return this.get("no-wrap")},_rows:function _rows(){var src=(this.get("items")||[]).slice();var filter=this.get("filter");var sort=this.get("sort");var params=this.get("parameters");var ref=[this.get("data-handler"),this.get("@style.raui.table.data-handler")];var localh=ref[0];var classh=ref[1];var ref$1=[this.get("data-pre-handler"),this.get("@style.raui.table.data-pre-handler")];var localp=ref$1[0];var classp=ref$1[1];if(localp||classp){(localp||classp)(this,src,filter,sort,params)}return{}},visibleRows:function visibleRows(){var this$1=this;var rows=this.get("rows");var paginate=this.get("paginate");var per=paginate;var intPer=this.get("_paginate");var offset=this.get("page")||0;var virtual=this.get("virtual");if(!per){return rows}if(typeof per!=="number"&&isNaN(+per)){if(per==="auto"||per==="virtual"||per instanceof Ractive){per=intPer||1}else{per=30}}if(per<this.get("minPerPage")){per=this.get("minPerPage")}if(paginate==="virtual"){offset=virtual&&virtual.offset||0;return rows.slice(offset,offset+per)}else{if(offset*per>rows.length){setTimeout(function(){return this$1.set("page",0)},0)}return rows.slice(per*offset,per*offset+per)}},pagination:function pagination(){var items=this.get("items")||empty;var rows=this.get("rows");var paginate=this.get("paginate");var per=paginate;var offset=this.get("page")||0;if(typeof per!=="number"&&isNaN(per)){per=this.get("_paginate")}if(per<this.get("minPerPage")){per=this.get("minPerPage")}if(!per){return}var total=Math.ceil(rows.length/per);var info={max:Math.ceil(items.length/per),total:total,per:per};if(paginate==="virtual"){info.height=this._avg*rows.length}if(info.total>14){var arr=info.array=[];if(offset>5){arr.push(1,2,3,"...")}else{arr.push(1,2,3,4,5,6,7,8)}if(offset>5&&offset+6<total){arr.push(offset-1,offset,offset+1,offset+2,offset+3,"...",total-2,total-1,total)}else if(offset+6<total){arr.push("...",total-2,total-1,total)}else{arr.push(total-7,total-6,total-5,total-4,total-3,total-2,total-1,total)}}else{info.array=Array.apply(null,{length:info.total}).map(function(v,i){return i+1})}return info},groups:function groups(){var rows=this.get("rows");var last,cur;var res={};for(var i=0;i<rows.length;i++){cur=rows[i][this._init.by];if(cur!=last){res[i]=1}last=cur}return res}}});var notNumbers=/^[^\d]*/;export function numberify(v){if(isNumber(v)){return v}if(!v){return+Infinity}v=(""+v).replace(notNumbers,"");if(!v){return+Infinity}return parseFloat(v)}function columnGetter(table,col,sort){if(typeof col.get==="function"){return col.get}var path=(sort?col.sort:0)||col.path||col.filter||col.id;if(typeof path==="string"){var arr=Ractive.splitKeypath(path);return function(row){var v=row;for(var i=0;i<arr.length;i++){v=v&&v[arr[i]]}return v}}}function defaultFilter(table,rows,filter,sort){var all=[].concat(table.viewmodel.value.columns,table.viewmodel.value.fields);var map=all.reduce(function(a,c){return((a[c.id]=columnGetter(table,c))||true)&&a},{});var cols=Object.values(map);var list=rows||[];var src=list;if((filter instanceof RegExp||isString(filter))&&filter){var nocase=filter===""+filter.toLowerCase()||filter===""+filter.toUpperCase();try{var re=isString(filter)?new RegExp(filter,nocase?"i":""):filter;list=list.filter(function(l){var i=cols.length;while(i--){var v=l&&cols[i](l);if(v&&re.test(v)){return true}}})}catch(e){}}if(isString(sort)||isObject(sort)&&!Array.isArray(sort)){sort=[sort]}if(Array.isArray(sort)){sort=sort.map(function(f){if(isString(f)){var id$1=f[0]==="-"||f[0]==="+"?f.substr(1):f;var col=all.find(function(c){return c.id===id$1});if(!col){return}var res={get:columnGetter(table,col,true),dir:f[0]==="-"?-1:1};if(col&&col.type==="number"){var get=res.get;res.get=function(v){return numberify(get.call(table,v))}}return res}else if(f&&typeof f==="object"){var col$1=all.find(function(c){return c.id===id});if(!col$1){return}var res$1={dir:isNumber(f.dir)?f.dir:f.dir==="desc"?-1:1,get:columnGetter(table,col$1,true)};if(f.type==="number"||col$1&&col$1.type==="number"){var get$1=res$1.get;res$1.get=function(v){return numberify(get$1.call(table,v))}}return res$1}}).filter(function(s){return s&&s.get});list.sort(function(a,b){var aa,bb,p;for(var i=0;i<sort.length;i++){aa=sort[i].get.call(table,a);bb=sort[i].get.call(table,b);p=sort[i].dir*(aa<bb?-1:aa>bb?1:0);if(p!==0){return p}}return p})}return list}var colAttrs=["label","type","filter","hidden","sort","no-pad","id","editable","fixed"];var cell=/^[a-z]{1,3}[0-9]+(?:-[0-9]+)?$/;var empty=[];function construct(){var cmp=this.component;if(!cmp){return}var expandEl,groupEl,wrapperEl,rowEl,topEl,bottomEl,mappings;var tpl=cmp.template.f||[];var attrs=cmp.template.m?cmp.template.m.slice():[];var t=cmp.template;cmp.template={e:t.e,f:t.f,t:t.t,m:attrs};var id=0;function map(attr,partial,plain){if(attr&&attr.f&&attr.f.length===1&&attr.f[0].t===2){var n="_a"+id++;attrs.push({t:13,n:n,f:attr.f});if(plain){return n}return partial?{t:[{t:2,r:"~/"+n}]}:{t:2,r:"~/"+n}}return attr&&attr.f}function grabColumns(tpl){var columns=[];var fields=[];tpl.forEach(function(e){if(e.e==="column"||e.e==="col"){var col={};var attrs=e.m||empty;var attr;col.index=columns.length;columns.push(col);col.content=(e.f||[]).filter(function(e){return e.e!=="edit"});col.editP=(e.f||[]).find(function(e){return e.e==="edit"});if(col.editP){col.editP=col.editP.f}attr=attrs.find(function(a){return a.n==="id"});if(attr&&isString(attr.f)){col.id=attr.f}col.label=attrs.find(function(a){return a.n==="label"});if(col.label&&col.label.f){col.label=map(col.label)}if(!col.label){col.label=""}if(!col.id){col.id=col.label}if(!Array.isArray(col.label)){col.label=[col.label]}col.type=attrs.find(function(a){return a.n==="type"});if(col.type&&col.type.f){col.type=col.type.f}if(!col.type){col.type="string"}col.filter=attrs.find(function(a){return a.n==="filter"});if(col.filter&&col.filter.f){col.filter=map(col.filter);if(col.filter.r){col.filter=col.filter.r}}col.sort=attrs.find(function(a){return a.n==="sort"});if(col.sort&&col.sort.f){col.sort=map(col.sort);if(col.sort.r){col.sort=col.sort.r}}col.dir=attrs.find(function(a){return a.n==="dir"});if(col.dir&&col.dir.f){col.dir=map(col.dir);if(col.dir.r){col.dir=col.dir.r}}col.hidden=attrs.find(function(a){return a.n==="hidden"});if(col.hidden&&col.hidden.f===0){col.hidden=true}else if(col.hidden&&isObject(col.hidden.f)){col.hidden=map(col.hidden)}else{col.hidden=false}if(isString(col.hidden)){col.hidden=false}col.noPad=attrs.find(function(a){return a.n==="no-pad"});if(col.noPad&&col.noPad.f===0){col.noPad=0}else if(col.noPad&&isObject(col.noPad.f)){col.noPad=map(col.noPad)}else{delete col.noPad}col.editable=attrs.find(function(a){return a.n==="editable"});if(col.editable&&col.editable.f===0){col.editable=true}else if(col.editable&&isObject(col.editable.f)){col.editable=map(col.editable)}else{col.editable=false}col.valign=attrs.find(function(a){return a.n==="valign"});if(col.valign&&isObject(col.valign.f)){col.valign=map(col.valign)}else if(col.valign&&typeof col.valign.f==="string"){col.valign=col.valign.f}col.fixed=attrs.find(function(a){return a.n==="fixed"});if(col.fixed&&isObject(col.fixed.f)){col.fixed={path:map(col.fixed,false,true)}}else if(col.fixed&&typeof col.fixed.f==="string"){col.fixed=col.fixed.f}attr=attrs.find(function(a){return a.n==="get"});if(attr&&attr.f){var name=map(attr,false,true);field.get=function(val){var fn=this.get(name);return typeof fn==="function"?fn.call(this,val):undefined}}col.attrs=attrs.filter(function(a){return!~colAttrs.indexOf(a.n)});col.attrs.forEach(function(a,i){if(cell.test(a.n)){col.attrs[i]={t:13,n:"class-"+a.n}}})}else if(e.e==="field"){var field$1={};var attrs$1=e.m||empty;var a;a=attrs$1.find(function(a){return a.n==="path"});if(isString(a)){field$1.path=a}else if(a&&a.f){field$1.path=map(a)}a=attrs$1.find(function(a){return a.n==="value"});if(a&&a.f){field$1.value=map(a)}a=attrs$1.find(function(a){return a.n==="type"});if(isString(a)){field$1.type=a}else if(a&&a.f){field$1.type=map(a)}a=attrs$1.find(function(a){return a.n==="id"});if(isString(a.f)){field$1.id=a.f}a=attrs$1.find(function(a){return a.n==="dir"});if(isString(a)){field$1.dir=a}else if(a&&isString(a.f)){field$1.dir=a.f}a=attrs$1.find(function(a){return a.n==="label"});if(isString(a)){field$1.label=a}else if(a&&a.f){field$1.label=map(a)}a=attrs$1.find(function(a){return a.n==="get"});if(a&&a.f){var name$1=map(a,false,true);field$1.get=function(val){var fn=this.get(name$1);return typeof fn==="function"?fn.call(this,val):undefined}}if(!field$1.id){field$1.id=field$1.label}if(!field$1.path){field$1.path=field$1.id}fields.push(field$1)}});return{fields:fields,columns:columns}}expandEl=tpl.find(function(e){return e.e==="expand"});groupEl=tpl.find(function(e){return e.e==="group"});wrapperEl=tpl.find(function(e){return e.e==="wrapper"});rowEl=tpl.find(function(e){return e.e==="row"});topEl=tpl.find(function(e){return e.e==="top"});bottomEl=tpl.find(function(e){return e.e==="bottom"});this._init={sets:grabColumns(tpl),partials:{}};var columns=this._init.sets.columns;this._init.sets["meta.expand"]=expandEl&&expandEl.f&&expandEl.f.length&&expandEl.f;this._init.sets["meta.extra"]=rowEl&&rowEl.f&&rowEl.f.length&&rowEl.f;this._init.sets["meta.top"]=topEl&&topEl.f&&topEl.f.length&&topEl.f;this._init.sets["meta.topAttrs"]=topEl&&topEl.m;this._init.sets["meta.bottom"]=bottomEl&&bottomEl.f&&bottomEl.f.length&&bottomEl.f;this._init.sets["meta.bottomAttrs"]=bottomEl&&bottomEl.m;var sortKey="[_0._setSort(_1,_2)]";var z=[{n:"gridValue",x:{r:"~/gridValue"}},{n:"gridName",x:{r:"~/gridName"}},{n:"gridSize",x:{r:"~/tableWidth"}},{n:"gridMax",x:{r:"~/gridMax"}},{n:"table",x:{r:"@this"}}];var header=[{t:7,e:"div",m:[{t:13,n:"class-rtable-row-wrap"},{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-header"},{t:4,f:[{n:"style-opacity",f:"0",t:13}],n:50,x:{r:["~/fixedHeader","~/virtual.offset"],s:"!_0&&_1>0"}},{t:4,n:50,r:"~/fixedHeader",f:[{t:13,n:"style-padding-right",f:[{t:2,r:"~/scrollOffset"},"px"]}]}],f:[{t:7,e:"div",f:columns.filter(function(c){return c.hidden!==true}).map(function(c,cidx){c.attrsHP=c.attrs.filter(function(a){return a.n!=="title"});var div={t:7,e:"div",f:[{t:7,e:"div",f:c.label}],m:[{t:4,n:53,r:"~/columns."+cidx,f:[{t:70,n:["click"],f:{r:["@this",".index","@event"],s:sortKey}}]},{t:13,n:"title",f:c.label},{t:16,r:"~/columns."+cidx+".attrsHP",z:z}]};if(c.type){div.m.push({t:13,n:"class-rtable-"+c.type+"-column"})}if(c.filter||c.sort){div.m.push({t:13,n:"class-rtable-sortable"})}div.m.push({t:13,n:"class-rtable-column"});if(c.fixed){var path=c.fixed.path||"~/columns."+cidx+".fixed";div.m.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:path}]});div.m.push({t:4,n:50,x:{r:["~/noWrap",path],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:path}]}]})}var res=div;if(c.hidden&&c.hidden.r){res={t:4,n:51,r:c.hidden.r,f:[div]}}return res}),m:[{t:13,n:"class-row"}]}]}];header[0].f.unshift({t:4,n:50,r:"~/allowSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-header"},{t:13,n:"class-rtable-column"},{t:13,n:"title",f:[{t:2,r:"selections.length"}," items selected"]},{t:13,n:"class-rtable-all-selected",f:[{t:2,x:{r:["@this"],s:"_0._allSelected()"}}]}],f:[{t:7,e:"div",f:[{t:4,n:50,r:"~/allowSelectAll",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["@this"],s:"_0._allSelected()"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:"selectAll"}]}]}],m:[{t:70,n:["clickd"],f:"selectAll"}]}]}]});var row=[{t:7,e:"div",m:[{t:13,n:"class-rtable-row-wrap"},{t:13,n:"class-rtable-odd",f:[{t:2,x:{r:["@index","~/virtual.offset"],s:"(_0+_1)%2===1"}}]},{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-live"},{t:13,n:"class-rtable-selected",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-inner-row-wrap"}],f:[{t:7,e:"div",f:columns.filter(function(c){return c.hidden!==true}).map(function(c,cidx){var content=[{t:7,e:"div",f:[{t:16,r:"~/columns."+cidx+".content",c:{r:"."},z:z}]}];if(c.attrs.length){c.attrsP=c.attrs;c.attrs=[{t:16,r:"~/columns."+cidx+".attrsP",c:{r:"."},z:z}]}else{c.attrs=[]}var attrs=c.attrs;if(c.fixed){var path=c.fixed.path||"~/columns."+cidx+".fixed";attrs.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:path}]});attrs.push({t:4,n:50,x:{r:["~/noWrap",path],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:path}]}]})}if(c.editable&&(c.filter||c.editP)){var noclicky={t:70,n:["click","mousedown","pointerdown","MSPointerDown","touchstart"],f:{r:["@event"],s:"[_0.stopPropagation()]"}};var editor=[{t:4,n:50,x:{r:["~/columns."+cidx+".editP"],s:"Array.isArray(_0)"},f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-edit"},noclicky],f:[{t:16,r:"~/columns."+cidx+".editP"}]}]},{t:4,n:50,l:1,x:{r:["~/columns."+cidx+".type"],s:"_0==='boolean'"},f:[{t:7,e:"input",m:[{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,r:c.filter}]},noclicky]}]},{t:4,n:51,l:1,f:[{t:7,e:"input",m:[{t:13,n:"value",f:[{t:2,r:c.filter}]},noclicky]}]}];if(typeof c.editable==="object"){attrs.push({t:13,n:"class-rtable-editing",f:c.editable});content=[Object.assign({},c.editable,{t:4,n:50,f:editor}),{t:4,n:51,l:1,f:content}]}else{attrs.push({t:13,n:"class-rtable-editing"});content=editor}}if(c.valign){attrs.push({t:13,n:"class-rtable-valign-col-top",f:[{t:2,x:{r:["~/columns."+cidx+".valign"],s:"_0==='top'"}}]},{t:13,n:"class-rtable-valign-col-bottom",f:[{t:2,x:{r:["~/columns."+cidx+".valign"],s:"_0==='bottom'"}}]},{t:13,n:"class-rtable-valign-col-center",f:[{t:2,x:{r:["~/columns."+cidx+".valign"],s:"_0==='center'"}}]})}var div={t:7,e:"div",f:content,m:attrs};if(c.type){attrs.unshift({t:13,n:"class-rtable-"+c.type+"-column"})}attrs.push({t:13,n:"class-rtable-column"});var title=c.attrsP&&c.attrsP.find(function(a){return a.n==="title"});if(!title){attrs.unshift({t:4,n:50,r:"~/autoTitles",f:[{t:13,n:"title",f:c.content.find(function(e){return e.e})?c.label:c.content}]})}else if(!title.f){attrs.unshift({t:13,n:"title",f:c.content.find(function(e){return e.e})?c.label:c.content});c.attrsP.splice(attrs.indexOf(title),1)}if(c.noPad===0){attrs.push({t:13,n:"class-rtable-no-pad"})}else if(c.noPad){attrs.push({t:13,n:"class-rtable-no-pad",f:c.noPad})}var res=div;if(c.hidden&&c.hidden.r){res={t:4,n:51,r:c.hidden.r,f:[div]}}return res}),m:[{t:13,n:"class-row"},{t:13,n:"class-rtable-row"},{t:70,n:expandEl&&expandEl.f?["dblclickd"]:["click","dblclick"],f:{r:["~/rows","~/visibleRows","."],s:"[['selected',_2,_0.indexOf(_2),_1.indexOf(_2)]]"}}]}]}]}];if(rowEl&&rowEl.m&&rowEl.m.length){this._init.sets.rowAttrs=rowEl.m.slice();row[0].f[0].f[0].m.push({t:16,r:"~/rowAttrs",c:{r:"."},z:z})}if(wrapperEl&&wrapperEl.m&&wrapperEl.m.length){this._init.sets.wrapperAttrs=wrapperEl.m.slice();row[0].m.push({t:16,r:"~/wrapperAttrs",c:{r:"."},z:z})}if(rowEl&&rowEl.f&&rowEl.f.length){row[0].f[0].f.push({t:7,e:"div",m:[{t:13,n:"class-rtable-row-extra"},{t:4,n:50,r:"~/noWrap",f:[{t:13,n:"style-width",f:[{t:2,x:{r:["~/tableWidth","~/allowSelect","@style.raui.table.selectWidth"],s:"_1?'calc('+_0+'px - '+(_2||'2em')+')':_0+'px'"}}]}]}],f:[{t:16,r:"~/meta.extra",c:{r:"."},z:z}]})}if(expandEl&&expandEl.f&&expandEl.f.length){row[0].f[0].f.push({t:4,n:50,x:{r:[".","~/expanded"],s:"_0===_1"},f:[{t:7,e:"div",f:[{t:7,e:"div",f:[{t:16,r:"~/meta.expand",c:{r:"."},z:z}]}],m:[{t:13,n:"class-rtable-row-expand"},{t:4,n:50,r:"~/noWrap",f:[{t:13,n:"style-width",f:[{t:2,x:{r:["~/tableWidth","~/allowSelect","@style.raui.table.selectWidth"],s:"_1?'calc('+_0+'px - '+(_2||'2em')+')':_0+'px'"}}]}]}]}]});row[0].f[0].f[0].m.push({t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._expand(_1)]"}});row[0].f[0].m.push({t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._expand(_1)]"}})}row[0].f.unshift({t:4,n:50,r:"~/allowSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-row"},{t:13,n:"class-rtable-column"},{t:70,n:["clickd"],f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}}],f:[{t:7,e:"div",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}}]}]}]}]});var by;if(groupEl&&groupEl.m&&(by=groupEl.m.find(function(a){return a.n==="by"}))&&(isString(by.f)||by.length===1&&by[0].t===2)){var group={t:4,n:50,f:[{t:7,e:"div",m:[{t:13,n:"class-row"},{t:13,n:"class-rtable-group"},{t:13,n:"class-rtable-selected",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]},{t:70,n:expandEl&&expandEl.f?["dblclickd"]:["click","dblclick"],f:{r:["~/rows","~/visibleRows","."],s:"[['selected',_2,_0.indexOf(_2),_1.indexOf(_2)]]"}}].concat(groupEl.m.filter(function(a){return a.n!=="by"&&a.n!=="select"}))}],x:{s:"_0&&_1[(_1&&(_2*_3+_4))||_4]",r:["~/showGroups","~/groups","~/page","~/pagination.per","@index"]}};row.unshift(group);this._init.by=by.f;var parts=grabColumns(groupEl.f).columns.filter(function(c){return c.hidden!==true}).map(function(c){var div={t:7,e:"div",f:[{t:7,e:"div",f:c.content}],m:c.attrs};if(c.type){div.m.unshift({t:13,n:"class-rtable-"+c.type+"-column"})}div.m.push({t:13,n:"class-rtable-column"});if(!div.m.find(function(a){return a.n==="title"})){div.m.unshift({t:13,n:"title",f:c.content})}var res=div;if(c.hidden&&c.hidden.r){res={t:4,n:51,r:c.hidden.r,f:[div]}}return res});parts.unshift({t:4,n:50,r:"~/allowGroupSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-row"},{t:13,n:"class-rtable-column"},{t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._selectGroup(_1),false]"}},{t:13,n:"class-rtable-all-selected",f:[{t:2,x:{r:["@this","@index"],s:"_0._groupSelected(_1)"}}]}],f:[{t:7,e:"div",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["@this","@index"],s:"_0._groupSelected(_1)"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:{r:["@this","@index"],s:"[_0._selectGroup(_1),false]"}}]}]}]}]});var attr;if(attr=groupEl.m.find(function(a){return a.n==="select"})){(mappings||(mappings=[])).push(Object.assign({},attr,{n:"allowGroupSelect"}))}if(attr=groupEl.m.find(function(a){return a.n==="show"})){(mappings||(mappings=[])).push(Object.assign({},attr,{n:"showGroups"}))}group.f[0].f=parts}this._init.partials["grid-row"]=row;this._init.partials["grid-head"]=header;if(mappings&&this.component){this.component.mappings=mappings}}export function plugin(opts){if(opts===void 0)opts={};return function(ref){var Ractive=ref.Ractive;var instance=ref.instance;if("includeGrid"in opts){Ractive.styleSet("table.includeGrid",opts.includeGrid)}instance.components[opts.name||"data-table"]=Table}}globalRegister("RMTable","components",Table);export default plugin;

@@ -6,3 +6,3 @@ import Ractive from 'ractive';

export var Tabs = (function (Ractive) {
export var Tabs = /*@__PURE__*/(function (Ractive) {
function Tabs(opts) {

@@ -121,3 +121,3 @@ Ractive.call(this, opts);

return "\n .rtabs {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n \n .rtabs-tab-window {\n overflow-y: hidden;\n overflow-x: auto;\n " + (!boxy ? ("box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),\n 0 1px 5px 0 rgba(0, 0, 0, 0.12),\n 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bg || '#fff') + ";") :
("border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n border-width: 1px 1px 0 1px;\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bga || '#f4f4f4') + ";\n ")) + "\n position: relative;\n flex-shrink: 0;\n }\n .alt > div > .rtabs-tab-window {\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fga || '#07e') + ";\n }" + (boxy ? ("\n .alt > div > .rtabs-tab-window .rtabs-tab {\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fga || '#07e') + ";\n }") : '') + "\n \n .rtabs-tab-window-wrapper {\n position: relative;\n }\n .rtabs-tab-window-wrapper:before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 10px;\n opacity: 0;\n transition: opacity 0.3s ease-in-out;\n background: linear-gradient(to right, " + (primary.indicator.color || primary.fga || '#07e') + ", transparent);\n z-index: 999;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-left:before {\n opacity: 1;\n }\n \n .rtabs-tab-window-wrapper:after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n height: 100%;\n width: 10px;\n opacity: 0;\n background: linear-gradient(to left, " + (primary.indicator.color || primary.fga || '#07e') + ", transparent);\n transition: opacity 0.3s ease-in-out;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-right:after {\n opacity: 1;\n }\n \n .rtabs-flat > div > .rtabs-tab-window {\n box-shadow: none;\n border-width: 0;\n }\n " + (!boxy ? (".rtabs-flat > div > .rtabs-tab-window:after {\n content: '';\n height: 0.15em;\n position: absolute;\n bottom: 0px;\n width: 100%;\n display: block;\n background-color: " + (primary.bga || '#f4f4f4') + ";\n }\n .rtabs-flat.alt > div > .rtabs-tab-window:after {\n background-color: " + (primary.fga || '#07e') + ";\n }") : ("\n .rtabs-flat > div > .rtabs-tab-window {\n background-color: " + (primary.bg || '#fff') + ";\n }\n .alt.rtabs-flat > div > .rtabs-tab-window {\n background-color: " + (primary.fga || '#07e') + ";\n }\n .rtabs-flat > div > .rtabs-tab-window .rtabs-tab {\n border-top-width: 1px;\n }")) + "\n \n .rtabs-center.rtabs-left {\n text-align: center;\n }" + (boxy ? "\n .rtabs-center > .rtabs-tab:first-child {\n border-left-width: 1px;\n }" : '') + "\n \n .rtabs-pad {\n padding: 1em;\n }\n \n .rtabs-fill {\n flex-grow: 1;\n height: 100%;\n }\n \n .rtabs-tabs {\n display: table;\n position: relative;\n min-width: 100%;\n white-space: nowrap;" + (boxy ? ("\n border-style: solid;\n border-width: 0 0 1px 0;\n border-color: " + (primary.bc || '#ccc') + ";\n line-height: 1.5em;") : '') + "\n }\n \n .rtabs-tab {\n display: inline-block;\n box-sizing: border-box;\n padding: 0.5em 1em;\n height: 2.5em;\n transition: opacity 0.2s ease-in-out;\n user-select: none;\n cursor: pointer;" + (!boxy ? "\n opacity: 0.9;" : ("\n border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n border-width: 0 1px 1px 0;\n margin-bottom: -1px;\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bga || '#f4f4f4') + ";\n ")) + "\n }\n .rtabs-tab:hover {\n opacity: 1;\n }\n \n .rtabs-selected" + (boxy ? ",\n .alt > div > .rtabs-tab-window .rtabs-selected" : '') + " {\n opacity: 1;" + (boxy ? ("\n font-weight: bold;\n border-bottom-color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.selected.bg || primary.bg || '#fff') + ";\n color: " + (primary.selected.fg || primary.fg || '#222') + ";") : '') + "\n }\n \n .rtabs-disabled {\n opacity: 0.4;\n }\n \n .rtabs-right {\n text-align: right;\n display: table-cell;\n }\n \n .rtabs-left {\n text-align: left;\n display: table-cell;\n }\n \n .rtabs-close {\n display: inline-block;\n margin-right: -0.5em;\n font-weight: 700;\n opacity: 0.3;\n transition: opacity: 0.2s ease-in-out;\n }\n \n .rtabs-close:hover {\n opacity: 1;\n }\n \n .rtabs-indicator {\n position: absolute;\n bottom: 0;\n height: 0.15em;\n background-color: " + (primary.indicator.color || primary.fga || '#07e') + ";\n z-index: 2;\n }\n \n .alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: " + (primary.bg || '#fff') + ";\n }\n \n .rtabs-going-left .rtabs-indicator {\n transition: left 0.2s ease-in-out, right 0.2s ease-in-out 0.1s;\n }\n .rtabs-going-right .rtabs-indicator {\n transition: left 0.2s ease-in-out 0.1s, right 0.2s ease-in-out;\n }\n \n .rtabs-content-wrapper {\n width: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex-grow: 2;\n overflow: hidden;\n }\n \n .rtabs-content-window {\n width: 100%;\n display: flex;\n flex-grow: 1;\n overflow-y: auto;\n overflow-x: hidden\n }\n \n .rtabs {\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bg || '#fff') + ";\n }\n \n .rtabs-contents {\n list-style: none;\n padding: 0;\n margin: 0;\n position: relative;\n left: 0;\n display: block;\n flex-wrap: nowrap;\n white-space: nowrap;\n width: 100%;\n }\n .rtabs-trans-slide > .rtabs-contents {\n transition: left 0.2s ease-in-out;\n }\n .rtabs-trans-fade > .rtabs-contents {\n transition: opacity 0.15s ease;\n opacity: 1;\n white-space: nowrap;\n }\n \n .rtabs-fill > div > div > .rtabs-contents {\n display: flex;\n }\n \n .rtabs-tab-content {\n display: inline-block;\n position: relative;\n width: 100%;\n overflow: auto;\n vertical-align: top;\n white-space: initial;\n transition: opacity 0.1s ease-in-out;\n flex-shrink: 0;\n white-space: initial;\n display: inline-block;\n flex-direction: column;\n flex-grow: 1;\n }\n \n .rtabs-placeholder {\n display: inline-block;\n width: 100%;\n height: 1px;\n flex-shrink: 0;\n }\n .rtabs-dyna.rtabs-not-selected {\n height: 1px;\n opacity: 0;\n overflow: hidden;\n }\n .rtabs-pad > .rtabs-tab-content {\n padding: 1em;\n box-sizing: border-box;\n }\n .rtabs-pad > .rtabs-tab-content.rtabs-no-pad {\n padding: 0;\n }\n .rtabs > .rtabs-tab-content.rtabs-pad {\n padding: 1em;\n box-sizing: border-box;\n }\n " + themes.map(function (t) {
("border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n border-width: 1px 1px 0 1px;\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bga || '#f4f4f4') + ";\n ")) + "\n position: relative;\n flex-shrink: 0;\n }\n .alt > div > .rtabs-tab-window {\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fga || '#07e') + ";\n }" + (boxy ? ("\n .alt > div > .rtabs-tab-window .rtabs-tab {\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fga || '#07e') + ";\n }") : '') + "\n \n .rtabs-tab-window-wrapper {\n position: relative;\n z-index: 10;\n }\n .rtabs-tab-window-wrapper:before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 10px;\n opacity: 0;\n transition: opacity 0.3s ease-in-out;\n background: linear-gradient(to right, " + (primary.indicator.color || primary.fga || '#07e') + ", transparent);\n z-index: 999;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-left:before {\n opacity: 1;\n }\n \n .rtabs-tab-window-wrapper:after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n height: 100%;\n width: 10px;\n opacity: 0;\n background: linear-gradient(to left, " + (primary.indicator.color || primary.fga || '#07e') + ", transparent);\n transition: opacity 0.3s ease-in-out;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-right:after {\n opacity: 1;\n }\n \n .rtabs-flat > div > .rtabs-tab-window {\n box-shadow: none;\n border-width: 0;\n }\n " + (!boxy ? (".rtabs-flat > div > .rtabs-tab-window:after {\n content: '';\n height: 0.15em;\n position: absolute;\n bottom: 0px;\n width: 100%;\n display: block;\n background-color: " + (primary.bga || '#f4f4f4') + ";\n }\n .rtabs-flat.alt > div > .rtabs-tab-window:after {\n background-color: " + (primary.fga || '#07e') + ";\n }") : ("\n .rtabs-flat > div > .rtabs-tab-window {\n background-color: " + (primary.bg || '#fff') + ";\n }\n .alt.rtabs-flat > div > .rtabs-tab-window {\n background-color: " + (primary.fga || '#07e') + ";\n }\n .rtabs-flat > div > .rtabs-tab-window .rtabs-tab {\n border-top-width: 1px;\n }")) + "\n \n .rtabs-center.rtabs-left {\n text-align: center;\n }" + (boxy ? "\n .rtabs-center > .rtabs-tab:first-child {\n border-left-width: 1px;\n }" : '') + "\n \n .rtabs-pad {\n padding: 1em;\n }\n \n .rtabs-fill {\n flex-grow: 1;\n height: 100%;\n }\n \n .rtabs-tabs {\n display: table;\n position: relative;\n min-width: 100%;\n white-space: nowrap;" + (boxy ? ("\n border-style: solid;\n border-width: 0 0 1px 0;\n border-color: " + (primary.bc || '#ccc') + ";\n line-height: 1.5em;") : '') + "\n }\n \n .rtabs-tab {\n display: inline-block;\n box-sizing: border-box;\n padding: 0.5em 1em;\n height: 2.5em;\n transition: opacity 0.2s ease-in-out;\n user-select: none;\n cursor: pointer;" + (!boxy ? "\n opacity: 0.9;" : ("\n border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n border-width: 0 1px 1px 0;\n margin-bottom: -1px;\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bga || '#f4f4f4') + ";\n ")) + "\n }\n .rtabs-tab:hover {\n opacity: 1;\n }\n \n .rtabs-selected" + (boxy ? ",\n .alt > div > .rtabs-tab-window .rtabs-selected" : '') + " {\n opacity: 1;" + (boxy ? ("\n font-weight: bold;\n border-bottom-color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.selected.bg || primary.bg || '#fff') + ";\n color: " + (primary.selected.fg || primary.fg || '#222') + ";") : '') + "\n }\n \n .rtabs-disabled {\n opacity: 0.4;\n }\n \n .rtabs-right {\n text-align: right;\n display: table-cell;\n }\n \n .rtabs-left {\n text-align: left;\n display: table-cell;\n }\n \n .rtabs-close {\n display: inline-block;\n margin-right: -0.5em;\n font-weight: 700;\n opacity: 0.3;\n transition: opacity: 0.2s ease-in-out;\n }\n \n .rtabs-close:hover {\n opacity: 1;\n }\n \n .rtabs-indicator {\n position: absolute;\n bottom: 0;\n height: 0.15em;\n background-color: " + (primary.indicator.color || primary.fga || '#07e') + ";\n z-index: 2;\n }\n \n .alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: " + (primary.bg || '#fff') + ";\n }\n \n .rtabs-going-left .rtabs-indicator {\n transition: left 0.2s ease-in-out, right 0.2s ease-in-out 0.1s;\n }\n .rtabs-going-right .rtabs-indicator {\n transition: left 0.2s ease-in-out 0.1s, right 0.2s ease-in-out;\n }\n \n .rtabs-content-wrapper {\n width: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex-grow: 2;\n overflow: hidden;\n }\n \n .rtabs-content-window {\n width: 100%;\n display: flex;\n flex-grow: 1;\n overflow-y: auto;\n overflow-x: hidden\n }\n \n .rtabs {\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bg || '#fff') + ";\n }\n \n .rtabs-contents {\n list-style: none;\n padding: 0;\n margin: 0;\n position: relative;\n left: 0;\n display: block;\n flex-wrap: nowrap;\n white-space: nowrap;\n width: 100%;\n }\n .rtabs-trans-slide > .rtabs-contents {\n transition: left 0.2s ease-in-out;\n }\n .rtabs-trans-fade > .rtabs-contents {\n transition: opacity 0.15s ease;\n opacity: 1;\n white-space: nowrap;\n }\n \n .rtabs-fill > div > div > .rtabs-contents {\n display: flex;\n }\n \n .rtabs-tab-content {\n display: inline-block;\n position: relative;\n width: 100%;\n overflow: auto;\n vertical-align: top;\n white-space: initial;\n transition: opacity 0.1s ease-in-out;\n flex-shrink: 0;\n white-space: initial;\n display: inline-block;\n flex-direction: column;\n flex-grow: 1;\n }\n \n .rtabs-placeholder {\n display: inline-block;\n width: 100%;\n height: 1px;\n flex-shrink: 0;\n }\n .rtabs-dyna.rtabs-not-selected {\n height: 1px;\n opacity: 0;\n overflow: hidden;\n }\n .rtabs-pad > .rtabs-tab-content {\n padding: 1em;\n box-sizing: border-box;\n }\n .rtabs-pad > .rtabs-tab-content.rtabs-no-pad {\n padding: 0;\n }\n .rtabs > .rtabs-tab-content.rtabs-pad {\n padding: 1em;\n box-sizing: border-box;\n }\n " + themes.map(function (t) {
var theme = Object.assign({}, data('raui.primary'), data('raui.tabs.primary'), data(("raui." + t)), data(("raui.tabs." + t)));

@@ -124,0 +124,0 @@ theme.selected = Object.assign({}, data('raui.tabs.selected'), data('raui.tabs.primary.selected'), data(("raui.tabs." + t + ".selected")));

@@ -1,1 +0,1 @@

import Ractive from"ractive";import{scrolled}from"./scrolled";import{sized}from"./watch-size";import globalRegister from"./globalRegister";export var Tabs=function(Ractive){function Tabs(opts){Ractive.call(this,opts)}if(Ractive)Tabs.__proto__=Ractive;Tabs.prototype=Object.create(Ractive&&Ractive.prototype);Tabs.prototype.constructor=Tabs;Tabs.prototype.addTab=function addTab(tab,idx){if(!tab.template){tab.template=[]}if(typeof idx==="number"){this.splice("tabs",idx,0,tab)}else{this.push("tabs",tab)}var res=new Handle(this,tab);if(tab.select){this.select(res.index)}return res};Tabs.prototype.getTab=function getTab(id){var tabs=this.get("tabs");var tab=tabs.find(function(t){return t.id===id});if(tab){return new Handle(this,tab)}else if(id in tabs&&typeof tabs[id]==="object"){return new Handle(this,tabs[id])}};Tabs.prototype.updateIndicator=function updateIndicator(){if(!this.rendered){return}var ctx=this.getContext(this.find(".rtabs-tab-window"));if(ctx.decorators.scrolled){ctx.decorators.scrolled.refresh()}if(this.get("@style.raui.tabs.boxy")){return}var node=this._tabs[this.get("selected")];if(!node||!node.offsetParent){return}if(node){var start=this.get("selectedLeft");if(start===undefined){this.set({selectedLeft:node.offsetLeft,selectedRight:node.offsetParent.clientWidth-(node.offsetLeft+node.offsetWidth)})}else{var max=node.offsetParent.clientWidth;var left=node.offsetLeft,width=node.clientWidth,right=max-left-width;this.set({direction:left<start?"left":"right",selectedLeft:left,selectedRight:right})}}else{this.set({selectedLeft:0,selectedRight:this.find(".tabs").offsetWidth})}};Tabs.prototype.checkSelection=function checkSelection(ctx,idx){if(this.get("selected")!==idx){select.call(this,ctx,idx)}};Tabs.prototype.select=function select(idx){this.fire("select",{},idx)};Tabs.prototype._hidden=function _hidden(idx){var hidden=this.get("tabs."+idx+".hidden");if(typeof hidden==="string"){return this.get(hidden)}else{return hidden}};Tabs.prototype.stopHorizontalScroll=function stopHorizontalScroll(node){if(node.scrollLeft){node.scrollLeft=0}};Tabs.prototype._scrollsRight=function _scrollsRight(){var scroll=this.get("scrollStatus")||"";if(/hscroll.*(hmiddle|left)/.test(scroll)&&!/right/.test(scroll)){return true}};Tabs.prototype._scrollsLeft=function _scrollsLeft(){var scroll=this.get("scrollStatus")||"";if(/hscroll.*(hmiddle|right)/.test(scroll)&&!/left/.test(scroll)){return true}};return Tabs}(Ractive);var tabAttrs=["closable","disabled","title","right","button","no-pad","hidden","id","load"];Ractive.extendWith(Tabs,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs",g:1},{t:16,r:"extra-attributes"},{n:"class-rtabs-flat",t:13,f:[{t:2,r:"~/flat"}]},{n:"class-rtabs-margin",t:13,f:[{t:2,r:"~/margin"}]},{n:"class-rtabs-fill",t:13,f:[{t:2,r:"~/fill"}]},{n:"sized",t:71,f:{r:[],s:'[{clientWidth:"~/clientWidth"}]'}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-window-wrapper",g:1},{n:"class-rtabs-scroll-right",t:13,f:[{t:2,x:{r:["@this"],s:"_0._scrollsRight()"}}]},{n:"class-rtabs-scroll-left",t:13,f:[{t:2,x:{r:["@this"],s:"_0._scrollsLeft()"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-window",g:1},{t:4,f:[{n:"class-rtabs-going-left",t:13}],n:50,x:{r:[".direction"],s:'_0==="left"'}},{t:4,f:[{n:"class-rtabs-going-right",t:13}],n:51,l:1},{n:"scrolled",t:71,f:{r:[],s:'["~/scrollStatus"]'}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tabs",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-left",g:1},{n:"class-rtabs-center",t:13,f:[{t:2,r:"~/center"}]}],f:[{t:4,f:[{t:4,f:[{t:8,r:"tab"}],n:50,x:{r:[".right","@this","@index"],s:"!_0&&!_1._hidden(_2)"}}],n:52,r:".tabs"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-right",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:"tab"}],n:50,x:{r:[".right","@this","@index"],s:"_0&&!_1._hidden(_2)"}}],n:52,r:".tabs"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-indicator",g:1},{n:"style-left",f:[{t:2,r:".selectedLeft"},"px"],t:13},{t:4,f:[{n:"style-right",f:[{t:2,r:".selectedRight"},"px"],t:13}],n:50,x:{r:[".selectedRight"],s:"_0!==undefined"}}]}],n:51,r:"@style.raui.tabs.boxy"}]}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-content-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-content-window",g:1},{t:4,f:[{n:"class-rtabs-trans-fade",t:13}],n:50,x:{r:[".transition"],s:'_0==="fade"'}},{t:4,f:[{n:"class-rtabs-trans-slide",t:13}],n:50,x:{r:[".transition"],s:'_0==="slide"'},l:1},{n:["scroll"],t:70,f:{r:["@this","@node"],s:"[_0.stopHorizontalScroll(_1)]"}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-contents",g:1},{n:"style-opacity",f:[{t:2,r:"~/opacity"}],t:13},{n:"style-left",f:[{t:2,x:{r:[".selectedContent"],s:"_0*-100"}},"%"],t:13},{n:"class-rtabs-pad",t:13,f:[{t:2,r:"~/pad"}]}],f:[{t:4,f:[{t:8,r:"tab-content"}],n:52,r:".tabs"}]}]}]}]}],e:{'[{clientWidth:"~/clientWidth"}]':function(){return[{clientWidth:"~/clientWidth"}]},"_0._scrollsRight()":function(_0){return _0._scrollsRight()},"_0._scrollsLeft()":function(_0){return _0._scrollsLeft()},'_0==="left"':function(_0){return _0==="left"},'["~/scrollStatus"]':function(){return["~/scrollStatus"]},"!_0&&!_1._hidden(_2)":function(_0,_1,_2){return!_0&&!_1._hidden(_2)},"_0&&!_1._hidden(_2)":function(_0,_1,_2){return _0&&!_1._hidden(_2)},"_0!==undefined":function(_0){return _0!==undefined},'_0==="fade"':function(_0){return _0==="fade"},'_0==="slide"':function(_0){return _0==="slide"},"[_0.stopHorizontalScroll(_1)]":function(_0,_1){return[_0.stopHorizontalScroll(_1)]},"_0*-100":function(_0){return _0*-100},"_0===_1":function(_0,_1){return _0===_1},'_0==="dynamic"':function(_0){return _0==="dynamic"},"_0!==_1":function(_0,_1){return _0!==_1},"_0===false":function(_0){return _0===false},"[_0.checkSelection((_1),_2)]":function(_0,_1,_2){return[_0.checkSelection(_1,_2)]},'(_3==="always"&&_0===_1)||(_3&&_2)||!_3':function(_0,_1,_2,_3){return _3==="always"&&_0===_1||_3&&_2||!_3},"!_0":function(_0){return!_0},"_0===_1&&!_2":function(_0,_1,_2){return _0===_1&&!_2},'typeof _1==="string"?_0[_1]:_1':function(_0,_1){return typeof _1==="string"?_0[_1]:_1},'[["select",_0]]':function(_0){return[["select",_0]]},"[_0.button()]":function(_0){return[_0.button()]},'typeof _0==="function"':function(_0){return typeof _0==="function"},"[_0]":function(_0){return[_0]},'typeof _0==="string"':function(_0){return typeof _0==="string"},'[["close",_0]]':function(_0){return[["close",_0]]},"_0&&!_1":function(_0,_1){return _0&&!_1}},p:{"tab-content":[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-content",g:1},{n:"class-rtabs-selected-content",t:13,f:[{t:2,x:{r:["~/selectedContent","@index"],s:"_0===_1"}}]},{n:"class-rtabs-dyna",t:13,f:[{t:2,x:{r:["~/height"],s:'_0==="dynamic"'}}]},{n:"class-rtabs-not-selected",t:13,f:[{t:2,x:{r:["~/selectedContent","@index"],s:"_0!==_1"}}]},{t:4,f:[{t:16,r:".extra"}],n:50,r:".extra"},{t:4,f:[{n:"class-rtabs-no-pad",t:13}],n:50,x:{r:[".pad"],s:"_0===false"}},{t:4,f:[{n:"class-rtabs-no-pad",t:13,f:[{t:2,rx:{r:"~/",m:[{t:30,n:".padRef"}]}}]}],n:50,r:".padRef",l:1},{n:["focus"],t:70,f:{r:["@this","@context","@index"],s:"[_0.checkSelection((_1),_2)]"}}],f:[{t:4,f:[{t:16,r:".template"}],n:50,x:{r:["~/selectedContent","@index",".load","~/defer"],s:'(_3==="always"&&_0===_1)||(_3&&_2)||!_3'}}]}],n:50,x:{r:[".button"],s:"!_0"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-placeholder",g:1}]}],n:51,l:1}],tab:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab",g:1},{n:"class-rtabs-selected",t:13,f:[{t:2,x:{r:["~/selected","@index",".button"],s:"_0===_1&&!_2"}}]},{t:4,f:[{n:"class-rtabs-disabled",t:13}],n:50,x:{r:["~/",".disabled"],s:'typeof _1==="string"?_0[_1]:_1'}},{t:4,f:[{n:["click"],t:70,f:{r:["@index"],s:'[["select",_0]]'}}],n:50,x:{r:[".button"],s:"!_0"},l:1},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.button()]"}}],n:50,x:{r:[".button"],s:'typeof _0==="function"'},l:1},{n:"registered",t:71,f:{r:["@index"],s:"[_0]"}},{t:4,f:[{t:16,r:".extraTab"}],n:50,r:".extraTab"},{n:"data-tab-index",f:[{t:2,r:"@index"}],t:13}],f:[{t:4,f:[{t:2,r:"title"}],n:50,x:{r:[".title"],s:'typeof _0==="string"'}},{t:4,f:[{t:16,r:".title"}],n:50,r:".title",l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-close",g:1},{n:["click"],t:70,f:{r:["@index"],s:'[["close",_0]]'}}],f:["×"]}],n:50,x:{r:[".closable",".button"],s:"_0&&!_1"}}]}]}},cssId:"rtab",noCssTransform:true,css:function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.tabs.primary"));primary.selected=Object.assign({},data("raui.tabs.selected"),data("raui.tabs.primary.selected"));primary.indicator=Object.assign({},data("raui.tabs.indicator"),data("raui.tabs.primary.indicator"));var themes=(data("raui.themes")||[]).slice();(data("raui.tabs.themes")||[]).forEach(function(t){if(!~themes.indexOf(t)){themes.push(t)}});var boxy=data("raui.tabs.boxy")||data("raui.tabs.primary.boxy");return"\n .rtabs {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n \n .rtabs-tab-window {\n overflow-y: hidden;\n overflow-x: auto;\n "+(!boxy?"box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),\n 0 1px 5px 0 rgba(0, 0, 0, 0.12),\n 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n color: "+(primary.fg||"#222")+";\n background-color: "+(primary.bg||"#fff")+";":"border-color: "+(primary.bc||"#ccc")+";\n border-style: solid;\n border-width: 1px 1px 0 1px;\n color: "+(primary.fg||"#222")+";\n background-color: "+(primary.bga||"#f4f4f4")+";\n ")+"\n position: relative;\n flex-shrink: 0;\n }\n .alt > div > .rtabs-tab-window {\n color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.fga||"#07e")+";\n }"+(boxy?"\n .alt > div > .rtabs-tab-window .rtabs-tab {\n color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.fga||"#07e")+";\n }":"")+"\n \n .rtabs-tab-window-wrapper {\n position: relative;\n }\n .rtabs-tab-window-wrapper:before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 10px;\n opacity: 0;\n transition: opacity 0.3s ease-in-out;\n background: linear-gradient(to right, "+(primary.indicator.color||primary.fga||"#07e")+", transparent);\n z-index: 999;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-left:before {\n opacity: 1;\n }\n \n .rtabs-tab-window-wrapper:after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n height: 100%;\n width: 10px;\n opacity: 0;\n background: linear-gradient(to left, "+(primary.indicator.color||primary.fga||"#07e")+", transparent);\n transition: opacity 0.3s ease-in-out;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-right:after {\n opacity: 1;\n }\n \n .rtabs-flat > div > .rtabs-tab-window {\n box-shadow: none;\n border-width: 0;\n }\n "+(!boxy?".rtabs-flat > div > .rtabs-tab-window:after {\n content: '';\n height: 0.15em;\n position: absolute;\n bottom: 0px;\n width: 100%;\n display: block;\n background-color: "+(primary.bga||"#f4f4f4")+";\n }\n .rtabs-flat.alt > div > .rtabs-tab-window:after {\n background-color: "+(primary.fga||"#07e")+";\n }":"\n .rtabs-flat > div > .rtabs-tab-window {\n background-color: "+(primary.bg||"#fff")+";\n }\n .alt.rtabs-flat > div > .rtabs-tab-window {\n background-color: "+(primary.fga||"#07e")+";\n }\n .rtabs-flat > div > .rtabs-tab-window .rtabs-tab {\n border-top-width: 1px;\n }")+"\n \n .rtabs-center.rtabs-left {\n text-align: center;\n }"+(boxy?"\n .rtabs-center > .rtabs-tab:first-child {\n border-left-width: 1px;\n }":"")+"\n \n .rtabs-pad {\n padding: 1em;\n }\n \n .rtabs-fill {\n flex-grow: 1;\n height: 100%;\n }\n \n .rtabs-tabs {\n display: table;\n position: relative;\n min-width: 100%;\n white-space: nowrap;"+(boxy?"\n border-style: solid;\n border-width: 0 0 1px 0;\n border-color: "+(primary.bc||"#ccc")+";\n line-height: 1.5em;":"")+"\n }\n \n .rtabs-tab {\n display: inline-block;\n box-sizing: border-box;\n padding: 0.5em 1em;\n height: 2.5em;\n transition: opacity 0.2s ease-in-out;\n user-select: none;\n cursor: pointer;"+(!boxy?"\n opacity: 0.9;":"\n border-color: "+(primary.bc||"#ccc")+";\n border-style: solid;\n border-width: 0 1px 1px 0;\n margin-bottom: -1px;\n color: "+(primary.fg||"#222")+";\n background-color: "+(primary.bga||"#f4f4f4")+";\n ")+"\n }\n .rtabs-tab:hover {\n opacity: 1;\n }\n \n .rtabs-selected"+(boxy?",\n .alt > div > .rtabs-tab-window .rtabs-selected":"")+" {\n opacity: 1;"+(boxy?"\n font-weight: bold;\n border-bottom-color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.selected.bg||primary.bg||"#fff")+";\n color: "+(primary.selected.fg||primary.fg||"#222")+";":"")+"\n }\n \n .rtabs-disabled {\n opacity: 0.4;\n }\n \n .rtabs-right {\n text-align: right;\n display: table-cell;\n }\n \n .rtabs-left {\n text-align: left;\n display: table-cell;\n }\n \n .rtabs-close {\n display: inline-block;\n margin-right: -0.5em;\n font-weight: 700;\n opacity: 0.3;\n transition: opacity: 0.2s ease-in-out;\n }\n \n .rtabs-close:hover {\n opacity: 1;\n }\n \n .rtabs-indicator {\n position: absolute;\n bottom: 0;\n height: 0.15em;\n background-color: "+(primary.indicator.color||primary.fga||"#07e")+";\n z-index: 2;\n }\n \n .alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(primary.bg||"#fff")+";\n }\n \n .rtabs-going-left .rtabs-indicator {\n transition: left 0.2s ease-in-out, right 0.2s ease-in-out 0.1s;\n }\n .rtabs-going-right .rtabs-indicator {\n transition: left 0.2s ease-in-out 0.1s, right 0.2s ease-in-out;\n }\n \n .rtabs-content-wrapper {\n width: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex-grow: 2;\n overflow: hidden;\n }\n \n .rtabs-content-window {\n width: 100%;\n display: flex;\n flex-grow: 1;\n overflow-y: auto;\n overflow-x: hidden\n }\n \n .rtabs {\n color: "+(primary.fg||"#222")+";\n background-color: "+(primary.bg||"#fff")+";\n }\n \n .rtabs-contents {\n list-style: none;\n padding: 0;\n margin: 0;\n position: relative;\n left: 0;\n display: block;\n flex-wrap: nowrap;\n white-space: nowrap;\n width: 100%;\n }\n .rtabs-trans-slide > .rtabs-contents {\n transition: left 0.2s ease-in-out;\n }\n .rtabs-trans-fade > .rtabs-contents {\n transition: opacity 0.15s ease;\n opacity: 1;\n white-space: nowrap;\n }\n \n .rtabs-fill > div > div > .rtabs-contents {\n display: flex;\n }\n \n .rtabs-tab-content {\n display: inline-block;\n position: relative;\n width: 100%;\n overflow: auto;\n vertical-align: top;\n white-space: initial;\n transition: opacity 0.1s ease-in-out;\n flex-shrink: 0;\n white-space: initial;\n display: inline-block;\n flex-direction: column;\n flex-grow: 1;\n }\n \n .rtabs-placeholder {\n display: inline-block;\n width: 100%;\n height: 1px;\n flex-shrink: 0;\n }\n .rtabs-dyna.rtabs-not-selected {\n height: 1px;\n opacity: 0;\n overflow: hidden;\n }\n .rtabs-pad > .rtabs-tab-content {\n padding: 1em;\n box-sizing: border-box;\n }\n .rtabs-pad > .rtabs-tab-content.rtabs-no-pad {\n padding: 0;\n }\n .rtabs > .rtabs-tab-content.rtabs-pad {\n padding: 1em;\n box-sizing: border-box;\n }\n "+themes.map(function(t){var theme=Object.assign({},data("raui.primary"),data("raui.tabs.primary"),data("raui."+t),data("raui.tabs."+t));theme.selected=Object.assign({},data("raui.tabs.selected"),data("raui.tabs.primary.selected"),data("raui.tabs."+t+".selected"));theme.indicator=Object.assign({},data("raui.tabs.indicator"),data("raui.tabs.primary.indicator"),data("raui.tabs."+t+".indicator"));var boxy="boxy"in theme?theme.boxy:data("raui.tabs.boxy");return".rtabs."+t+" > div > .rtabs-tab-window {\n "+(!boxy?"box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),\n 0 1px 5px 0 rgba(0, 0, 0, 0.12),\n 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n color: "+(theme.fg||"#222")+";\n background-color: "+(theme.bg||"#fff")+";":"border-color: "+(theme.bc||"#ccc")+";\n color: "+(theme.fg||"#222")+";\n background-color: "+(theme.bga||"#f4f4f4")+";\n ")+"\n }\n .rtabs."+t+" > .rtabs-tab-window-wrapper:before {\n background: linear-gradient(to right, "+(theme.indicator.color||theme.fga||"#07e")+", transparent);\n }\n .rtabs."+t+" > .rtabs-tab-window-wrapper:after {\n background: linear-gradient(to left, "+(theme.indicator.color||theme.fga||"#07e")+", transparent);\n }\n .rtabs."+t+".alt > div > .rtabs-tab-window {\n color: "+(theme.bg||"#fff")+";\n background-color: "+(theme.fga||"#07e")+";\n }"+(boxy?"\n .rtabs."+t+".alt > div > .rtabs-tab-window .rtabs-tab {\n color: "+(theme.bg||"#fff")+";\n background-color: "+(theme.fga||"#07e")+";\n }":"")+"\n \n "+(!boxy?".rtabs-flat."+t+" > div > .rtabs-tab-window:after {\n background-color: "+(theme.bga||"#f4f4f4")+";\n }\n .rtabs-flat.alt."+t+" > div > .rtabs-tab-window:after {\n background-color: "+(theme.fga||"#07e")+";\n }":"\n .rtabs-flat."+t+" > div > .rtabs-tab-window {\n background-color: "+(theme.bg||"#fff")+";\n }\n .alt.rtabs-flat."+t+" > div > .rtabs-tab-window {\n background-color: "+(theme.fga||"#07e")+";\n }")+"\n \n "+(boxy?".rtabs."+t+" > div > .rtabs-tab-window .rtabs-tabs {\n border-color: "+(theme.bc||"#ccc")+";\n }":"")+"\n \n .rtabs."+t+" > div > .rtabs-tab-window > .rtabs-tab {\n cursor: pointer;"+(!boxy?"":"\n border-color: "+(theme.bc||"#ccc")+";\n color: "+(theme.fg||"#222")+";\n background-color: "+(theme.bga||"#f4f4f4")+";\n ")+"\n }\n \n .rtabs."+t+" > div > .rtabs-tab-window .rtabs-selected"+(boxy?",\n .rtabs."+t+".alt > div > .rtabs-tab-window .rtabs-selected":"")+" {"+(boxy?"\n border-bottom-color: "+(them.bg||"#fff")+";\n background-color: "+(theme.selected.bg||theme.bg||"#fff")+";"+(theme.indicator?"\n background-image: linear-gradient(to bottom, "+(theme.indicator.color||theme.fga||"#07e")+", "+(theme.bg||"#fff")+" 3px);":"")+"\n color: "+(theme.selected.fg||theme.fg||"#222")+";":"")+"\n }\n \n .rtabs."+t+" > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(theme.indicator.color||theme.fga||"#07e")+";\n }\n \n .rtabs."+t+".alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(theme.bg||"#fff")+";\n }\n \n .rtabs."+t+" {\n color: "+(theme.fg||"#222")+";\n background-color: "+(theme.bg||"#fff")+";\n }\n "}).join("\n")}.call(this,data)].join(" ")},attributes:["transition","flat","pad","center","height","fill","defer"],data:function data(){return{tabs:[],rightTabs:[],selected:-1,selectedContent:-1,opacity:1,scrollStatus:""}},on:{construct:construct,config:function config(){var this$1=this;if(this._tabs){this.set("tabs",(this.get("tabs")||[]).concat(this._tabs),{shuffle:true})}var tabs=this.get("tabs");var xs=this.indicatorObservers=[];tabs.forEach(function(t){if(typeof t.hidden==="string"){xs.push(this$1.observe(t.hidden,function(){return setTimeout(function(){return this$1.updateIndicator()})},{init:false,defer:true}))}});xs.push(this.observe("tabs.*.hidden",function(){return setTimeout(function(){return this$1.updateIndicator()})},{init:false,defer:true}));this.once("render",function(){if(this$1.get("selected")===-1){this$1.select(0)}})},select:select,close:close,teardown:function teardown(){this.indicatorObservers.forEach(function(o){return o.cancel()})}},observe:{selected:{handler:function handler(v){var this$1=this;var hidden=this._hidden(v);var tabs=this.get("tabs");if(hidden){setTimeout(function(){var trans=this$1.get("transition");this$1.set("transition","");this$1.select(v+1>=tabs.length?0:v+1);this$1.set("transition",trans)})}},init:false},clientWidth:function clientWidth(){this.updateIndicator()}},decorators:{registered:function registered(node,idx){var me=this;if(!this._tabs){this._tabs=[]}this._tabs[idx]=node;this.updateIndicator();return{teardown:function teardown(){},invalidate:function invalidate(){me.updateIndicator()},update:function update(idx){me._tabs[idx]=node;setTimeout(function(){return me.updateIndicator()})}}},scrolled:scrolled,sized:sized}});function construct(){var cmp=this.component;if(!cmp){return}var tpl=cmp.template.f||[];var attrs=cmp.template.m?cmp.template.m.slice():[];var t=cmp.template;cmp.template={e:t.e,f:t.f,t:t.t,m:attrs};var tabs=tpl.filter(function(n){return n.e==="tab"}).map(function(t){var tab={template:{t:t.f.filter(function(n){return n.e!=="title"})}};var extra=[];var extraTab=[];t.m&&t.m.forEach(function(a){if(a.t===13&&~tabAttrs.indexOf(a.n)){if(a.n==="disabled"&&a.f&&a.f.length===1&&a.f[0].t===2){var cnd="_cnd"+attrs.length;tab.disabled=cnd;attrs.push({t:13,n:cnd,f:a.f})}else if(a.n==="no-pad"){if(!a.f){tab.pad=false}else if(a.f.length===1&&a.f[0].t===2){var cnd$1="_cnd"+attrs.length;tab.padRef=cnd$1;attrs.push({t:13,n:cnd$1,f:a.f})}}else if(a.n==="hidden"&&a.f&&a.f.length===1&&a.f[0].t===2){var cnd$2="_cnd"+attrs.length;tab.hidden=cnd$2;attrs.push({t:13,n:cnd$2,f:a.f})}else{tab[a.n]=a.f===0?true:typeof a.f==="string"?a.f:{t:a.f}}}else if(a.t===70){extraTab.push(a)}else{extra.push(a)}});var tmp;tmp=t.f.find(function(n){return n.e==="title"});if(tmp){tab.title=tmp.f;if(tmp.m){extraTab.push.apply(extraTab,tmp.m)}}if(extra.length){tab.extra={t:extra}}if(extraTab.length){tab.extraTab={t:extraTab}}return tab});this._tabs=tabs}function select(ctx,idx){var this$1=this;var obj;var current=this.get("selected");var prs=[];var trans=this.get("transition");if(current!==idx){var cur=this.getContext(this.find(".rtabs-selected"));var window=this.find(".rtabs-content-window");if(~current){this.set("scroll."+cur.get("@index"),window.scrollTop)}if(cur.hasListener("leave")){cur.raise("leave")}if(trans==="fade"){this.set({opacity:0,selected:idx});this.updateIndicator();var ctx$1=this.getContext(this.find(".rtabs-selected"));setTimeout(function(){var obj;this$1.set((obj={selectedContent:idx},obj["tabs."+idx+".load"]=true,obj.opacity=1,obj));if(ctx$1.hasListener("enter")){ctx$1.raise("enter")}if(window&&~current){window.scrollTop=this$1.get("scroll."+idx)||0}},150)}else if(trans==="slide"){this.set("selected",idx);this.set("tabs."+idx+".load",true);this.set("selectedContent",idx);this.updateIndicator();var ctx$2=this.getContext(this.find(".rtabs-selected"));if(ctx$2.hasListener("enter")){ctx$2.raise("enter")}if(window&&~current){window.scrollTop=this.get("scroll."+idx)||0}}else{this.set((obj={selected:idx},obj["tabs."+idx+".load"]=true,obj.selectedContent=idx,obj));this.updateIndicator();var ctx$3=this.getContext(this.find(".rtabs-selected"));if(ctx$3.hasListener("enter")){ctx$3.raise("enter")}if(window){window.scrollTop=this.get("scroll."+idx)||0}}if(~current&&window&&window.scrollLeft){window.scrollLeft=0}}}function close(ctx,idx){var tab=this.getContext(this._tabs[idx]);var ok=true;if(typeof tab.onclose==="function"){ok=tab.onclose.call(undefined)!==false}if(ok&&tab.element.events.find(function(e){return e.events.find(function(e){return e.name==="close"})})){ok=tab.raise("close")!==false}if(ok){this.splice("tabs",idx,1)}return false}export var Handle=function Handle(tabs,item){this.tabs=tabs;this.item=item};var prototypeAccessors={keypath:{configurable:true},id:{configurable:true},index:{configurable:true},title:{configurable:true},template:{configurable:true},hidden:{configurable:true},right:{configurable:true},pad:{configurable:true},disabled:{configurable:true},button:{configurable:true},closable:{configurable:true},load:{configurable:true}};prototypeAccessors.keypath.get=function(){if(this.removed){return}return"tabs."+this.index};prototypeAccessors.id.get=function(){return this.get("id")};prototypeAccessors.id.set=function(v){this.set("id",v)};prototypeAccessors.index.get=function(){return this.tabs.get("tabs").indexOf(this.item)};prototypeAccessors.title.get=function(){return this.get("title")};prototypeAccessors.title.set=function(v){this.set("title",v)};prototypeAccessors.template.get=function(){return this.get("template")};prototypeAccessors.template.set=function(v){return this.set("template",v)};prototypeAccessors.hidden.get=function(){return this.get("hidden")};prototypeAccessors.hidden.set=function(v){return this.set("hidden",v)};prototypeAccessors.right.get=function(){return this.get("right")};prototypeAccessors.right.set=function(v){return this.set("right",v)};prototypeAccessors.pad.get=function(){return this.get("pad")};prototypeAccessors.pad.set=function(v){return this.set("pad",v)};prototypeAccessors.disabled.get=function(){return this.get("disabled")};prototypeAccessors.disabled.set=function(v){return this.set("disabled",v)};prototypeAccessors.button.get=function(){return this.get("button")};prototypeAccessors.button.set=function(v){return this.set("button",v)};prototypeAccessors.closable.get=function(){return this.get("closable")};prototypeAccessors.closable.set=function(v){return this.set("closable",v)};prototypeAccessors.load.get=function(){return this.get("load")};prototypeAccessors.load.set=function(v){return this.set("load",v)};Handle.prototype.select=function select(){if(this.removed){return}this.tabs.select(this.index)};Handle.prototype.remove=function remove(){if(this.removed){return false}this.tabs.splice("tabs",this.index,1);this.removed=true;return true};Handle.prototype.get=function get(keypath){if(this.removed){return false}if(!keypath){return this.tabs.get(this.keypath)}var key=keypath.replace(/^[\.\/]*/,"");return this.tabs.get(this.keypath+"."+key)};Handle.prototype.set=function set(keypath,value){if(this.removed){return false}var key=keypath.replace(/^[\.\/]*/,"");return this.tabs.set(this.keypath+"."+key,value)};Object.defineProperties(Handle.prototype,prototypeAccessors);export function plugin(opts){if(opts===void 0)opts={};return function(ref){var instance=ref.instance;instance.components[opts.name||"tabs"]=Tabs}}globalRegister("RMTabs","components",Tabs);export default plugin;
import Ractive from"ractive";import{scrolled}from"./scrolled";import{sized}from"./watch-size";import globalRegister from"./globalRegister";export var Tabs=function(Ractive){function Tabs(opts){Ractive.call(this,opts)}if(Ractive)Tabs.__proto__=Ractive;Tabs.prototype=Object.create(Ractive&&Ractive.prototype);Tabs.prototype.constructor=Tabs;Tabs.prototype.addTab=function addTab(tab,idx){if(!tab.template){tab.template=[]}if(typeof idx==="number"){this.splice("tabs",idx,0,tab)}else{this.push("tabs",tab)}var res=new Handle(this,tab);if(tab.select){this.select(res.index)}return res};Tabs.prototype.getTab=function getTab(id){var tabs=this.get("tabs");var tab=tabs.find(function(t){return t.id===id});if(tab){return new Handle(this,tab)}else if(id in tabs&&typeof tabs[id]==="object"){return new Handle(this,tabs[id])}};Tabs.prototype.updateIndicator=function updateIndicator(){if(!this.rendered){return}var ctx=this.getContext(this.find(".rtabs-tab-window"));if(ctx.decorators.scrolled){ctx.decorators.scrolled.refresh()}if(this.get("@style.raui.tabs.boxy")){return}var node=this._tabs[this.get("selected")];if(!node||!node.offsetParent){return}if(node){var start=this.get("selectedLeft");if(start===undefined){this.set({selectedLeft:node.offsetLeft,selectedRight:node.offsetParent.clientWidth-(node.offsetLeft+node.offsetWidth)})}else{var max=node.offsetParent.clientWidth;var left=node.offsetLeft,width=node.clientWidth,right=max-left-width;this.set({direction:left<start?"left":"right",selectedLeft:left,selectedRight:right})}}else{this.set({selectedLeft:0,selectedRight:this.find(".tabs").offsetWidth})}};Tabs.prototype.checkSelection=function checkSelection(ctx,idx){if(this.get("selected")!==idx){select.call(this,ctx,idx)}};Tabs.prototype.select=function select(idx){this.fire("select",{},idx)};Tabs.prototype._hidden=function _hidden(idx){var hidden=this.get("tabs."+idx+".hidden");if(typeof hidden==="string"){return this.get(hidden)}else{return hidden}};Tabs.prototype.stopHorizontalScroll=function stopHorizontalScroll(node){if(node.scrollLeft){node.scrollLeft=0}};Tabs.prototype._scrollsRight=function _scrollsRight(){var scroll=this.get("scrollStatus")||"";if(/hscroll.*(hmiddle|left)/.test(scroll)&&!/right/.test(scroll)){return true}};Tabs.prototype._scrollsLeft=function _scrollsLeft(){var scroll=this.get("scrollStatus")||"";if(/hscroll.*(hmiddle|right)/.test(scroll)&&!/left/.test(scroll)){return true}};return Tabs}(Ractive);var tabAttrs=["closable","disabled","title","right","button","no-pad","hidden","id","load"];Ractive.extendWith(Tabs,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs",g:1},{t:16,r:"extra-attributes"},{n:"class-rtabs-flat",t:13,f:[{t:2,r:"~/flat"}]},{n:"class-rtabs-margin",t:13,f:[{t:2,r:"~/margin"}]},{n:"class-rtabs-fill",t:13,f:[{t:2,r:"~/fill"}]},{n:"sized",t:71,f:{r:[],s:'[{clientWidth:"~/clientWidth"}]'}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-window-wrapper",g:1},{n:"class-rtabs-scroll-right",t:13,f:[{t:2,x:{r:["@this"],s:"_0._scrollsRight()"}}]},{n:"class-rtabs-scroll-left",t:13,f:[{t:2,x:{r:["@this"],s:"_0._scrollsLeft()"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-window",g:1},{t:4,f:[{n:"class-rtabs-going-left",t:13}],n:50,x:{r:[".direction"],s:'_0==="left"'}},{t:4,f:[{n:"class-rtabs-going-right",t:13}],n:51,l:1},{n:"scrolled",t:71,f:{r:[],s:'["~/scrollStatus"]'}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tabs",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-left",g:1},{n:"class-rtabs-center",t:13,f:[{t:2,r:"~/center"}]}],f:[{t:4,f:[{t:4,f:[{t:8,r:"tab"}],n:50,x:{r:[".right","@this","@index"],s:"!_0&&!_1._hidden(_2)"}}],n:52,r:".tabs"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-right",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:"tab"}],n:50,x:{r:[".right","@this","@index"],s:"_0&&!_1._hidden(_2)"}}],n:52,r:".tabs"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-indicator",g:1},{n:"style-left",f:[{t:2,r:".selectedLeft"},"px"],t:13},{t:4,f:[{n:"style-right",f:[{t:2,r:".selectedRight"},"px"],t:13}],n:50,x:{r:[".selectedRight"],s:"_0!==undefined"}}]}],n:51,r:"@style.raui.tabs.boxy"}]}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-content-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-content-window",g:1},{t:4,f:[{n:"class-rtabs-trans-fade",t:13}],n:50,x:{r:[".transition"],s:'_0==="fade"'}},{t:4,f:[{n:"class-rtabs-trans-slide",t:13}],n:50,x:{r:[".transition"],s:'_0==="slide"'},l:1},{n:["scroll"],t:70,f:{r:["@this","@node"],s:"[_0.stopHorizontalScroll(_1)]"}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-contents",g:1},{n:"style-opacity",f:[{t:2,r:"~/opacity"}],t:13},{n:"style-left",f:[{t:2,x:{r:[".selectedContent"],s:"_0*-100"}},"%"],t:13},{n:"class-rtabs-pad",t:13,f:[{t:2,r:"~/pad"}]}],f:[{t:4,f:[{t:8,r:"tab-content"}],n:52,r:".tabs"}]}]}]}]}],e:{'[{clientWidth:"~/clientWidth"}]':function(){return[{clientWidth:"~/clientWidth"}]},"_0._scrollsRight()":function(_0){return _0._scrollsRight()},"_0._scrollsLeft()":function(_0){return _0._scrollsLeft()},'_0==="left"':function(_0){return _0==="left"},'["~/scrollStatus"]':function(){return["~/scrollStatus"]},"!_0&&!_1._hidden(_2)":function(_0,_1,_2){return!_0&&!_1._hidden(_2)},"_0&&!_1._hidden(_2)":function(_0,_1,_2){return _0&&!_1._hidden(_2)},"_0!==undefined":function(_0){return _0!==undefined},'_0==="fade"':function(_0){return _0==="fade"},'_0==="slide"':function(_0){return _0==="slide"},"[_0.stopHorizontalScroll(_1)]":function(_0,_1){return[_0.stopHorizontalScroll(_1)]},"_0*-100":function(_0){return _0*-100},"_0===_1":function(_0,_1){return _0===_1},'_0==="dynamic"':function(_0){return _0==="dynamic"},"_0!==_1":function(_0,_1){return _0!==_1},"_0===false":function(_0){return _0===false},"[_0.checkSelection((_1),_2)]":function(_0,_1,_2){return[_0.checkSelection(_1,_2)]},'(_3==="always"&&_0===_1)||(_3&&_2)||!_3':function(_0,_1,_2,_3){return _3==="always"&&_0===_1||_3&&_2||!_3},"!_0":function(_0){return!_0},"_0===_1&&!_2":function(_0,_1,_2){return _0===_1&&!_2},'typeof _1==="string"?_0[_1]:_1':function(_0,_1){return typeof _1==="string"?_0[_1]:_1},'[["select",_0]]':function(_0){return[["select",_0]]},"[_0.button()]":function(_0){return[_0.button()]},'typeof _0==="function"':function(_0){return typeof _0==="function"},"[_0]":function(_0){return[_0]},'typeof _0==="string"':function(_0){return typeof _0==="string"},'[["close",_0]]':function(_0){return[["close",_0]]},"_0&&!_1":function(_0,_1){return _0&&!_1}},p:{"tab-content":[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-content",g:1},{n:"class-rtabs-selected-content",t:13,f:[{t:2,x:{r:["~/selectedContent","@index"],s:"_0===_1"}}]},{n:"class-rtabs-dyna",t:13,f:[{t:2,x:{r:["~/height"],s:'_0==="dynamic"'}}]},{n:"class-rtabs-not-selected",t:13,f:[{t:2,x:{r:["~/selectedContent","@index"],s:"_0!==_1"}}]},{t:4,f:[{t:16,r:".extra"}],n:50,r:".extra"},{t:4,f:[{n:"class-rtabs-no-pad",t:13}],n:50,x:{r:[".pad"],s:"_0===false"}},{t:4,f:[{n:"class-rtabs-no-pad",t:13,f:[{t:2,rx:{r:"~/",m:[{t:30,n:".padRef"}]}}]}],n:50,r:".padRef",l:1},{n:["focus"],t:70,f:{r:["@this","@context","@index"],s:"[_0.checkSelection((_1),_2)]"}}],f:[{t:4,f:[{t:16,r:".template"}],n:50,x:{r:["~/selectedContent","@index",".load","~/defer"],s:'(_3==="always"&&_0===_1)||(_3&&_2)||!_3'}}]}],n:50,x:{r:[".button"],s:"!_0"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-placeholder",g:1}]}],n:51,l:1}],tab:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab",g:1},{n:"class-rtabs-selected",t:13,f:[{t:2,x:{r:["~/selected","@index",".button"],s:"_0===_1&&!_2"}}]},{t:4,f:[{n:"class-rtabs-disabled",t:13}],n:50,x:{r:["~/",".disabled"],s:'typeof _1==="string"?_0[_1]:_1'}},{t:4,f:[{n:["click"],t:70,f:{r:["@index"],s:'[["select",_0]]'}}],n:50,x:{r:[".button"],s:"!_0"},l:1},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.button()]"}}],n:50,x:{r:[".button"],s:'typeof _0==="function"'},l:1},{n:"registered",t:71,f:{r:["@index"],s:"[_0]"}},{t:4,f:[{t:16,r:".extraTab"}],n:50,r:".extraTab"},{n:"data-tab-index",f:[{t:2,r:"@index"}],t:13}],f:[{t:4,f:[{t:2,r:"title"}],n:50,x:{r:[".title"],s:'typeof _0==="string"'}},{t:4,f:[{t:16,r:".title"}],n:50,r:".title",l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-close",g:1},{n:["click"],t:70,f:{r:["@index"],s:'[["close",_0]]'}}],f:["×"]}],n:50,x:{r:[".closable",".button"],s:"_0&&!_1"}}]}]}},cssId:"rtab",noCssTransform:true,css:function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.tabs.primary"));primary.selected=Object.assign({},data("raui.tabs.selected"),data("raui.tabs.primary.selected"));primary.indicator=Object.assign({},data("raui.tabs.indicator"),data("raui.tabs.primary.indicator"));var themes=(data("raui.themes")||[]).slice();(data("raui.tabs.themes")||[]).forEach(function(t){if(!~themes.indexOf(t)){themes.push(t)}});var boxy=data("raui.tabs.boxy")||data("raui.tabs.primary.boxy");return"\n .rtabs {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n \n .rtabs-tab-window {\n overflow-y: hidden;\n overflow-x: auto;\n "+(!boxy?"box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),\n 0 1px 5px 0 rgba(0, 0, 0, 0.12),\n 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n color: "+(primary.fg||"#222")+";\n background-color: "+(primary.bg||"#fff")+";":"border-color: "+(primary.bc||"#ccc")+";\n border-style: solid;\n border-width: 1px 1px 0 1px;\n color: "+(primary.fg||"#222")+";\n background-color: "+(primary.bga||"#f4f4f4")+";\n ")+"\n position: relative;\n flex-shrink: 0;\n }\n .alt > div > .rtabs-tab-window {\n color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.fga||"#07e")+";\n }"+(boxy?"\n .alt > div > .rtabs-tab-window .rtabs-tab {\n color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.fga||"#07e")+";\n }":"")+"\n \n .rtabs-tab-window-wrapper {\n position: relative;\n z-index: 10;\n }\n .rtabs-tab-window-wrapper:before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 10px;\n opacity: 0;\n transition: opacity 0.3s ease-in-out;\n background: linear-gradient(to right, "+(primary.indicator.color||primary.fga||"#07e")+", transparent);\n z-index: 999;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-left:before {\n opacity: 1;\n }\n \n .rtabs-tab-window-wrapper:after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n height: 100%;\n width: 10px;\n opacity: 0;\n background: linear-gradient(to left, "+(primary.indicator.color||primary.fga||"#07e")+", transparent);\n transition: opacity 0.3s ease-in-out;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-right:after {\n opacity: 1;\n }\n \n .rtabs-flat > div > .rtabs-tab-window {\n box-shadow: none;\n border-width: 0;\n }\n "+(!boxy?".rtabs-flat > div > .rtabs-tab-window:after {\n content: '';\n height: 0.15em;\n position: absolute;\n bottom: 0px;\n width: 100%;\n display: block;\n background-color: "+(primary.bga||"#f4f4f4")+";\n }\n .rtabs-flat.alt > div > .rtabs-tab-window:after {\n background-color: "+(primary.fga||"#07e")+";\n }":"\n .rtabs-flat > div > .rtabs-tab-window {\n background-color: "+(primary.bg||"#fff")+";\n }\n .alt.rtabs-flat > div > .rtabs-tab-window {\n background-color: "+(primary.fga||"#07e")+";\n }\n .rtabs-flat > div > .rtabs-tab-window .rtabs-tab {\n border-top-width: 1px;\n }")+"\n \n .rtabs-center.rtabs-left {\n text-align: center;\n }"+(boxy?"\n .rtabs-center > .rtabs-tab:first-child {\n border-left-width: 1px;\n }":"")+"\n \n .rtabs-pad {\n padding: 1em;\n }\n \n .rtabs-fill {\n flex-grow: 1;\n height: 100%;\n }\n \n .rtabs-tabs {\n display: table;\n position: relative;\n min-width: 100%;\n white-space: nowrap;"+(boxy?"\n border-style: solid;\n border-width: 0 0 1px 0;\n border-color: "+(primary.bc||"#ccc")+";\n line-height: 1.5em;":"")+"\n }\n \n .rtabs-tab {\n display: inline-block;\n box-sizing: border-box;\n padding: 0.5em 1em;\n height: 2.5em;\n transition: opacity 0.2s ease-in-out;\n user-select: none;\n cursor: pointer;"+(!boxy?"\n opacity: 0.9;":"\n border-color: "+(primary.bc||"#ccc")+";\n border-style: solid;\n border-width: 0 1px 1px 0;\n margin-bottom: -1px;\n color: "+(primary.fg||"#222")+";\n background-color: "+(primary.bga||"#f4f4f4")+";\n ")+"\n }\n .rtabs-tab:hover {\n opacity: 1;\n }\n \n .rtabs-selected"+(boxy?",\n .alt > div > .rtabs-tab-window .rtabs-selected":"")+" {\n opacity: 1;"+(boxy?"\n font-weight: bold;\n border-bottom-color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.selected.bg||primary.bg||"#fff")+";\n color: "+(primary.selected.fg||primary.fg||"#222")+";":"")+"\n }\n \n .rtabs-disabled {\n opacity: 0.4;\n }\n \n .rtabs-right {\n text-align: right;\n display: table-cell;\n }\n \n .rtabs-left {\n text-align: left;\n display: table-cell;\n }\n \n .rtabs-close {\n display: inline-block;\n margin-right: -0.5em;\n font-weight: 700;\n opacity: 0.3;\n transition: opacity: 0.2s ease-in-out;\n }\n \n .rtabs-close:hover {\n opacity: 1;\n }\n \n .rtabs-indicator {\n position: absolute;\n bottom: 0;\n height: 0.15em;\n background-color: "+(primary.indicator.color||primary.fga||"#07e")+";\n z-index: 2;\n }\n \n .alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(primary.bg||"#fff")+";\n }\n \n .rtabs-going-left .rtabs-indicator {\n transition: left 0.2s ease-in-out, right 0.2s ease-in-out 0.1s;\n }\n .rtabs-going-right .rtabs-indicator {\n transition: left 0.2s ease-in-out 0.1s, right 0.2s ease-in-out;\n }\n \n .rtabs-content-wrapper {\n width: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex-grow: 2;\n overflow: hidden;\n }\n \n .rtabs-content-window {\n width: 100%;\n display: flex;\n flex-grow: 1;\n overflow-y: auto;\n overflow-x: hidden\n }\n \n .rtabs {\n color: "+(primary.fg||"#222")+";\n background-color: "+(primary.bg||"#fff")+";\n }\n \n .rtabs-contents {\n list-style: none;\n padding: 0;\n margin: 0;\n position: relative;\n left: 0;\n display: block;\n flex-wrap: nowrap;\n white-space: nowrap;\n width: 100%;\n }\n .rtabs-trans-slide > .rtabs-contents {\n transition: left 0.2s ease-in-out;\n }\n .rtabs-trans-fade > .rtabs-contents {\n transition: opacity 0.15s ease;\n opacity: 1;\n white-space: nowrap;\n }\n \n .rtabs-fill > div > div > .rtabs-contents {\n display: flex;\n }\n \n .rtabs-tab-content {\n display: inline-block;\n position: relative;\n width: 100%;\n overflow: auto;\n vertical-align: top;\n white-space: initial;\n transition: opacity 0.1s ease-in-out;\n flex-shrink: 0;\n white-space: initial;\n display: inline-block;\n flex-direction: column;\n flex-grow: 1;\n }\n \n .rtabs-placeholder {\n display: inline-block;\n width: 100%;\n height: 1px;\n flex-shrink: 0;\n }\n .rtabs-dyna.rtabs-not-selected {\n height: 1px;\n opacity: 0;\n overflow: hidden;\n }\n .rtabs-pad > .rtabs-tab-content {\n padding: 1em;\n box-sizing: border-box;\n }\n .rtabs-pad > .rtabs-tab-content.rtabs-no-pad {\n padding: 0;\n }\n .rtabs > .rtabs-tab-content.rtabs-pad {\n padding: 1em;\n box-sizing: border-box;\n }\n "+themes.map(function(t){var theme=Object.assign({},data("raui.primary"),data("raui.tabs.primary"),data("raui."+t),data("raui.tabs."+t));theme.selected=Object.assign({},data("raui.tabs.selected"),data("raui.tabs.primary.selected"),data("raui.tabs."+t+".selected"));theme.indicator=Object.assign({},data("raui.tabs.indicator"),data("raui.tabs.primary.indicator"),data("raui.tabs."+t+".indicator"));var boxy="boxy"in theme?theme.boxy:data("raui.tabs.boxy");return".rtabs."+t+" > div > .rtabs-tab-window {\n "+(!boxy?"box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),\n 0 1px 5px 0 rgba(0, 0, 0, 0.12),\n 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n color: "+(theme.fg||"#222")+";\n background-color: "+(theme.bg||"#fff")+";":"border-color: "+(theme.bc||"#ccc")+";\n color: "+(theme.fg||"#222")+";\n background-color: "+(theme.bga||"#f4f4f4")+";\n ")+"\n }\n .rtabs."+t+" > .rtabs-tab-window-wrapper:before {\n background: linear-gradient(to right, "+(theme.indicator.color||theme.fga||"#07e")+", transparent);\n }\n .rtabs."+t+" > .rtabs-tab-window-wrapper:after {\n background: linear-gradient(to left, "+(theme.indicator.color||theme.fga||"#07e")+", transparent);\n }\n .rtabs."+t+".alt > div > .rtabs-tab-window {\n color: "+(theme.bg||"#fff")+";\n background-color: "+(theme.fga||"#07e")+";\n }"+(boxy?"\n .rtabs."+t+".alt > div > .rtabs-tab-window .rtabs-tab {\n color: "+(theme.bg||"#fff")+";\n background-color: "+(theme.fga||"#07e")+";\n }":"")+"\n \n "+(!boxy?".rtabs-flat."+t+" > div > .rtabs-tab-window:after {\n background-color: "+(theme.bga||"#f4f4f4")+";\n }\n .rtabs-flat.alt."+t+" > div > .rtabs-tab-window:after {\n background-color: "+(theme.fga||"#07e")+";\n }":"\n .rtabs-flat."+t+" > div > .rtabs-tab-window {\n background-color: "+(theme.bg||"#fff")+";\n }\n .alt.rtabs-flat."+t+" > div > .rtabs-tab-window {\n background-color: "+(theme.fga||"#07e")+";\n }")+"\n \n "+(boxy?".rtabs."+t+" > div > .rtabs-tab-window .rtabs-tabs {\n border-color: "+(theme.bc||"#ccc")+";\n }":"")+"\n \n .rtabs."+t+" > div > .rtabs-tab-window > .rtabs-tab {\n cursor: pointer;"+(!boxy?"":"\n border-color: "+(theme.bc||"#ccc")+";\n color: "+(theme.fg||"#222")+";\n background-color: "+(theme.bga||"#f4f4f4")+";\n ")+"\n }\n \n .rtabs."+t+" > div > .rtabs-tab-window .rtabs-selected"+(boxy?",\n .rtabs."+t+".alt > div > .rtabs-tab-window .rtabs-selected":"")+" {"+(boxy?"\n border-bottom-color: "+(them.bg||"#fff")+";\n background-color: "+(theme.selected.bg||theme.bg||"#fff")+";"+(theme.indicator?"\n background-image: linear-gradient(to bottom, "+(theme.indicator.color||theme.fga||"#07e")+", "+(theme.bg||"#fff")+" 3px);":"")+"\n color: "+(theme.selected.fg||theme.fg||"#222")+";":"")+"\n }\n \n .rtabs."+t+" > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(theme.indicator.color||theme.fga||"#07e")+";\n }\n \n .rtabs."+t+".alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(theme.bg||"#fff")+";\n }\n \n .rtabs."+t+" {\n color: "+(theme.fg||"#222")+";\n background-color: "+(theme.bg||"#fff")+";\n }\n "}).join("\n")}.call(this,data)].join(" ")},attributes:["transition","flat","pad","center","height","fill","defer"],data:function data(){return{tabs:[],rightTabs:[],selected:-1,selectedContent:-1,opacity:1,scrollStatus:""}},on:{construct:construct,config:function config(){var this$1=this;if(this._tabs){this.set("tabs",(this.get("tabs")||[]).concat(this._tabs),{shuffle:true})}var tabs=this.get("tabs");var xs=this.indicatorObservers=[];tabs.forEach(function(t){if(typeof t.hidden==="string"){xs.push(this$1.observe(t.hidden,function(){return setTimeout(function(){return this$1.updateIndicator()})},{init:false,defer:true}))}});xs.push(this.observe("tabs.*.hidden",function(){return setTimeout(function(){return this$1.updateIndicator()})},{init:false,defer:true}));this.once("render",function(){if(this$1.get("selected")===-1){this$1.select(0)}})},select:select,close:close,teardown:function teardown(){this.indicatorObservers.forEach(function(o){return o.cancel()})}},observe:{selected:{handler:function handler(v){var this$1=this;var hidden=this._hidden(v);var tabs=this.get("tabs");if(hidden){setTimeout(function(){var trans=this$1.get("transition");this$1.set("transition","");this$1.select(v+1>=tabs.length?0:v+1);this$1.set("transition",trans)})}},init:false},clientWidth:function clientWidth(){this.updateIndicator()}},decorators:{registered:function registered(node,idx){var me=this;if(!this._tabs){this._tabs=[]}this._tabs[idx]=node;this.updateIndicator();return{teardown:function teardown(){},invalidate:function invalidate(){me.updateIndicator()},update:function update(idx){me._tabs[idx]=node;setTimeout(function(){return me.updateIndicator()})}}},scrolled:scrolled,sized:sized}});function construct(){var cmp=this.component;if(!cmp){return}var tpl=cmp.template.f||[];var attrs=cmp.template.m?cmp.template.m.slice():[];var t=cmp.template;cmp.template={e:t.e,f:t.f,t:t.t,m:attrs};var tabs=tpl.filter(function(n){return n.e==="tab"}).map(function(t){var tab={template:{t:t.f.filter(function(n){return n.e!=="title"})}};var extra=[];var extraTab=[];t.m&&t.m.forEach(function(a){if(a.t===13&&~tabAttrs.indexOf(a.n)){if(a.n==="disabled"&&a.f&&a.f.length===1&&a.f[0].t===2){var cnd="_cnd"+attrs.length;tab.disabled=cnd;attrs.push({t:13,n:cnd,f:a.f})}else if(a.n==="no-pad"){if(!a.f){tab.pad=false}else if(a.f.length===1&&a.f[0].t===2){var cnd$1="_cnd"+attrs.length;tab.padRef=cnd$1;attrs.push({t:13,n:cnd$1,f:a.f})}}else if(a.n==="hidden"&&a.f&&a.f.length===1&&a.f[0].t===2){var cnd$2="_cnd"+attrs.length;tab.hidden=cnd$2;attrs.push({t:13,n:cnd$2,f:a.f})}else{tab[a.n]=a.f===0?true:typeof a.f==="string"?a.f:{t:a.f}}}else if(a.t===70){extraTab.push(a)}else{extra.push(a)}});var tmp;tmp=t.f.find(function(n){return n.e==="title"});if(tmp){tab.title=tmp.f;if(tmp.m){extraTab.push.apply(extraTab,tmp.m)}}if(extra.length){tab.extra={t:extra}}if(extraTab.length){tab.extraTab={t:extraTab}}return tab});this._tabs=tabs}function select(ctx,idx){var this$1=this;var obj;var current=this.get("selected");var prs=[];var trans=this.get("transition");if(current!==idx){var cur=this.getContext(this.find(".rtabs-selected"));var window=this.find(".rtabs-content-window");if(~current){this.set("scroll."+cur.get("@index"),window.scrollTop)}if(cur.hasListener("leave")){cur.raise("leave")}if(trans==="fade"){this.set({opacity:0,selected:idx});this.updateIndicator();var ctx$1=this.getContext(this.find(".rtabs-selected"));setTimeout(function(){var obj;this$1.set((obj={selectedContent:idx},obj["tabs."+idx+".load"]=true,obj.opacity=1,obj));if(ctx$1.hasListener("enter")){ctx$1.raise("enter")}if(window&&~current){window.scrollTop=this$1.get("scroll."+idx)||0}},150)}else if(trans==="slide"){this.set("selected",idx);this.set("tabs."+idx+".load",true);this.set("selectedContent",idx);this.updateIndicator();var ctx$2=this.getContext(this.find(".rtabs-selected"));if(ctx$2.hasListener("enter")){ctx$2.raise("enter")}if(window&&~current){window.scrollTop=this.get("scroll."+idx)||0}}else{this.set((obj={selected:idx},obj["tabs."+idx+".load"]=true,obj.selectedContent=idx,obj));this.updateIndicator();var ctx$3=this.getContext(this.find(".rtabs-selected"));if(ctx$3.hasListener("enter")){ctx$3.raise("enter")}if(window){window.scrollTop=this.get("scroll."+idx)||0}}if(~current&&window&&window.scrollLeft){window.scrollLeft=0}}}function close(ctx,idx){var tab=this.getContext(this._tabs[idx]);var ok=true;if(typeof tab.onclose==="function"){ok=tab.onclose.call(undefined)!==false}if(ok&&tab.element.events.find(function(e){return e.events.find(function(e){return e.name==="close"})})){ok=tab.raise("close")!==false}if(ok){this.splice("tabs",idx,1)}return false}export var Handle=function Handle(tabs,item){this.tabs=tabs;this.item=item};var prototypeAccessors={keypath:{configurable:true},id:{configurable:true},index:{configurable:true},title:{configurable:true},template:{configurable:true},hidden:{configurable:true},right:{configurable:true},pad:{configurable:true},disabled:{configurable:true},button:{configurable:true},closable:{configurable:true},load:{configurable:true}};prototypeAccessors.keypath.get=function(){if(this.removed){return}return"tabs."+this.index};prototypeAccessors.id.get=function(){return this.get("id")};prototypeAccessors.id.set=function(v){this.set("id",v)};prototypeAccessors.index.get=function(){return this.tabs.get("tabs").indexOf(this.item)};prototypeAccessors.title.get=function(){return this.get("title")};prototypeAccessors.title.set=function(v){this.set("title",v)};prototypeAccessors.template.get=function(){return this.get("template")};prototypeAccessors.template.set=function(v){return this.set("template",v)};prototypeAccessors.hidden.get=function(){return this.get("hidden")};prototypeAccessors.hidden.set=function(v){return this.set("hidden",v)};prototypeAccessors.right.get=function(){return this.get("right")};prototypeAccessors.right.set=function(v){return this.set("right",v)};prototypeAccessors.pad.get=function(){return this.get("pad")};prototypeAccessors.pad.set=function(v){return this.set("pad",v)};prototypeAccessors.disabled.get=function(){return this.get("disabled")};prototypeAccessors.disabled.set=function(v){return this.set("disabled",v)};prototypeAccessors.button.get=function(){return this.get("button")};prototypeAccessors.button.set=function(v){return this.set("button",v)};prototypeAccessors.closable.get=function(){return this.get("closable")};prototypeAccessors.closable.set=function(v){return this.set("closable",v)};prototypeAccessors.load.get=function(){return this.get("load")};prototypeAccessors.load.set=function(v){return this.set("load",v)};Handle.prototype.select=function select(){if(this.removed){return}this.tabs.select(this.index)};Handle.prototype.remove=function remove(){if(this.removed){return false}this.tabs.splice("tabs",this.index,1);this.removed=true;return true};Handle.prototype.get=function get(keypath){if(this.removed){return false}if(!keypath){return this.tabs.get(this.keypath)}var key=keypath.replace(/^[\.\/]*/,"");return this.tabs.get(this.keypath+"."+key)};Handle.prototype.set=function set(keypath,value){if(this.removed){return false}var key=keypath.replace(/^[\.\/]*/,"");return this.tabs.set(this.keypath+"."+key,value)};Object.defineProperties(Handle.prototype,prototypeAccessors);export function plugin(opts){if(opts===void 0)opts={};return function(ref){var instance=ref.instance;instance.components[opts.name||"tabs"]=Tabs}}globalRegister("RMTabs","components",Tabs);export default plugin;

@@ -196,7 +196,5 @@ import { Ractive } from 'ractive';

Handle.prototype.set = function set (key, value) {
var this$1 = this;
if (typeof key === 'object') {
for (var k in key) {
this$1.data[k] = key[k];
this.data[k] = key[k];
}

@@ -203,0 +201,0 @@ if (this.data === this.holder.active) { return this.data.instance.update('_toast'); }

@@ -1,1 +0,1 @@

import{Ractive}from"ractive";var DEFAULTS={timeout:6e3,top:true};export default function plugin(opts){if(opts===void 0)opts={};var style=function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.toast.primary"));return"\n .rtoast {\n position: absolute;\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n left: 1em;\n right: 1em;\n top: 1em;\n bottom: auto;\n z-index: 5;\n pointer-events: none;\n overflow: hidden;\n }\n .rtoast-message {\n flex-grow: 2;\n display: flex;\n align-items: center;\n }\n .rtoast-string {\n white-space: pre-wrap;\n line-height: 1.3em;\n padding-top: 0.3em;\n }\n .rtoast-upper .rtoast-string {\n \n }\n .rtoast-expand .rtoast-string {\n padding-top: 0.5em;\n }\n .rtoast-buttons {\n display: flex;\n padding-left: 0.5em;\n flex-shrink: 1;\n align-items: center;\n max-height: max-content;\n margin-left: auto;\n }\n .rtoast-buttons button {\n cursor: pointer;\n }\n .rtoast-button {\n background-color: transparent;\n border: none;\n color: inherit;\n padding: 0.5em 0.75em;\n margin: 0 0 0 0.5em;\n line-height: 1em;\n box-shadow: none;\n }\n .rtoast-more {\n cursor: pointer;\n width: 2em;\n position: relative;\n flex-shrink: 2;\n background-color: transparent;\n border: none;\n color: inherit;\n margin: 0 0 0 0.5em;\n height: 2em;\n }\n .rtoast-more:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n height: 0.6em;\n top: calc(50% - 0.55em);\n left: calc(50% - 0.3em);\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n transition: transform 0.2s ease-in-out, top 0.2s ease-in-out;\n pointer-events: none;\n }\n .rtoast-expanded .rtoast-more:after {\n transform: rotate(225deg);\n top: calc(50% - 0.1em);\n }\n .rtoast-bottom {\n bottom: 1em;\n top: auto;\n }\n .rtoast-left {\n justify-content: flex-start;\n }\n .rtoast-right {\n justify-content: flex-end;\n }\n .rtoast-body {\n border-radius: 0.2em;\n padding: 0.5em 1em;\n color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.fg||"#222")+";\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n opacity: 0.95;\n pointer-events: all;\n transition: color 0.5s ease-in-out, background 0.5s ease-in-out;\n }\n .rtoast-upper {\n display: flex;\n flex-shrink: 2;\n flex-wrap: wrap;\n justify-content: space-between;\n }\n \n .rtoast-success {\n color: "+(data("raui.toast.success.fg")||"#f9f9f9")+";\n background-color: "+(data("raui.toast.success.bg")||"#4caf50")+";\n }\n .rtoast-info {\n color: "+(data("raui.toast.info.fg")||"#f9f9f9")+";\n background-color: "+(data("raui.toast.info.bg")||"#07e")+";\n }\n .rtoast-warn {\n color: "+(data("raui.toast.warn.fg")||"#222")+";\n background-color: "+(data("raui.warn.success.bg")||"#ffc107")+";\n }\n .rtoast-error {\n color: "+(data("raui.toast.error.fg")||"#f9f9f9")+";\n background-color: "+(data("raui.toast.error.bg")||"#ff5252")+";\n }\n "}.call(this,data)].join(" ")};var template={v:4,t:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast",g:1},{n:"class-rtoast-expanded",t:13,f:[{t:2,r:".showMore"}]},{n:"class-rtoast-bottom",t:13,f:[{t:2,r:".bottom"}]},{n:"class-rtoast-left",t:13,f:[{t:2,r:".left"}]},{n:"class-rtoast-right",t:13,f:[{t:2,r:".right"}]}],f:[{t:7,e:"div",m:[{n:"toast",t:72,v:"t0"},{n:"class",f:["rtoast-body",{t:4,f:[" rtoast-",{t:2,r:".type"}],n:50,r:".type"},{t:4,f:[{t:2,r:".class"}],n:50,r:".class"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.close()]"}}],n:50,x:{r:[".dismissable"],s:"_0!==false"}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-upper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-message",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".message",c:{r:".context"}}],n:50,x:{r:[".context"],s:"!!_0"}},{t:4,f:[{t:8,r:".message"}],n:51,l:1}],n:50,x:{r:[".message"],s:"Array.isArray(_0)"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-string",g:1}],f:[{t:2,r:".message"}]}],n:51,l:1}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-buttons",g:1}],f:[{t:4,f:[{t:7,e:"button",m:[{n:"class",f:["rtoast-button",{t:4,f:[" ",{t:2,r:".class"}],n:50,r:".class"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.action()]"}}],n:50,x:{r:[".action"],s:'typeof _0==="function"'}}],f:[{t:2,r:".label"}]}],n:52,r:".buttons"},{t:4,f:[{t:7,e:"button",m:[{t:13,n:"class",f:"rtoast-button",g:1}],f:["Close"]}],n:50,x:{r:[".dismissable",".closeButton"],s:"_0!==false&&_1!==false"},l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-more",g:1},{n:"title",f:"Toggle more",t:13,g:1},{n:["click"],t:70,f:{r:[".","@context"],s:'[_0.expand(),(_1).toggle(".showMore"),false]'}}]}],n:50,r:".more"}]}],n:50,x:{r:[".dismissable",".closeButton",".buttons.length",".more"],s:"(_0!==false&&_1!==false)||_2||_3"}}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-expand",g:1},{n:"toast-expand",t:72,v:"t0"},{n:["click"],t:70,f:{r:[],s:"[false,false]"}}],f:[{t:4,f:[{t:4,f:[{t:8,r:".more",c:{r:".context"}}],n:50,x:{r:[".context"],s:"!!_0"}},{t:4,f:[{t:8,r:".more"}],n:51,l:1}],n:50,x:{r:[".more"],s:"Array.isArray(_0)"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-string",g:1}],f:[{t:2,r:".more"}]}],n:51,l:1}]}],n:50,x:{r:[".more",".showMore"],s:"_0&&_1"}}]}]}],n:54,r:"~/_toast"}],n:50,r:"~/_toast"}],e:{"[_0.close()]":function(_0){return[_0.close()]},"_0!==false":function(_0){return _0!==false},"!!_0":function(_0){return!!_0},"Array.isArray(_0)":function(_0){return Array.isArray(_0)},"[_0.action()]":function(_0){return[_0.action()]},'typeof _0==="function"':function(_0){return typeof _0==="function"},"_0!==false&&_1!==false":function(_0,_1){return _0!==false&&_1!==false},'[_0.expand(),(_1).toggle(".showMore"),false]':function(_0,_1){return[_0.expand(),_1.toggle(".showMore"),false]},"(_0!==false&&_1!==false)||_2||_3":function(_0,_1,_2,_3){return _0!==false&&_1!==false||_2||_3},"[false,false]":function(){return[false,false]},"_0&&_1":function(_0,_1){return _0&&_1}}};return function(ref){var Ractive=ref.Ractive;var instance=ref.instance;var proto=ref.proto;instance.partials[opts.name||"toast"]=template;var defaults=Object.assign({},DEFAULTS,opts);var toasts=[];var holder={toasts:toasts};var active;Object.defineProperty(proto,"toastDefaults",{value:defaults,writable:false,configurable:true});proto.toast=function toast(message,options){var opts=Object.assign({message:message,instance:this},defaults,this.toastDefaults,options);opts.close=function(){return closeToast(opts)};opts.expand=function(){if(holder.active!==opts){return}if(holder.tm){clearTimeout(holder.tm);holder.tm=null}if(opts.showMore){if(opts.timeout){holder.tm=setTimeout(function(){opts.close();holder.tm=null},opts.timeout)}}};toasts.push(opts);if(!active){showToast()}return new Handle(holder,opts)};function closeToast(which){if(active!==which){toasts.splice(toasts.indexOf(opts),1);if(typeof which.onclose==="function"){which.onclose()}}else{if(holder.tm){clearTimeout(holder.tm);holder.tm=null}active.instance.set("_toast",null).then(function(){holder.active=active=null;if(typeof which.onclose==="function"){which.onclose()}if(toasts.length){showToast()}})}}function showToast(){holder.active=active=toasts.shift();active.instance.set("_toast",active).then(function(){if(active.timeout){if(holder.tm){clearTimeout(holder.tm)}holder.tm=setTimeout(function(){active.close();holder.tm=null},active.timeout)}})}proto.on=proto.on||{};instance.transitions.toast=function(t,ps){var params=t.processParams({duration:200},ps);var opacity=t.getStyle("opacity");if(t.isIntro){t.setStyle({opacity:0,transform:"translateY("+(active.bottom?"":"-")+"1em)"});return t.animateStyle({opacity:opacity,transform:"none"},params)}else{t.setStyle({opacity:opacity,transform:"none"});return t.animateStyle({opacity:0,transform:"translateY("+(active.bottom?"":"-")+"1em)"},params)}};instance.transitions["toast-expand"]=function(t,ps){var params=t.processParams({duration:200,nested:false},ps);if(t.isIntro){var h=t.getStyle("height");var w=t.getStyle("width");t.setStyle("height",0);t.setStyle("width",0);return t.animateStyle("width",w,params).then(function(){return t.animateStyle("height",h,params)}).then(function(){t.setStyle("height","");t.setStyle("width","")})}else{var h$1=t.getStyle("height");t.setStyle("height",h$1);t.setStyle("width",t.getStyle("width"));return t.animateStyle("height",0,params).then(function(){return t.animateStyle("width",0,params)}).then(function(){t.setStyle("height","");t.setStyle("width","")})}};proto.on["close-toast"]=function(){if(active){active.close()}};if(instance===Ractive||Ractive.isInstance(instance)){if(!Ractive.hasCSS("toast-css")){Ractive.addCSS("toast",style)}}else{var pcss=instance.css;instance.css=function(data){var css="";if(typeof pcss==="string"){css+=pcss}else if(typeof pcss==="function"){css+=pcss(data)}return style(data)+css}}return proto}}export var Handle=function Handle(holder,data){this.holder=holder;this.data=data};var prototypeAccessors={message:{configurable:true},more:{configurable:true},showMore:{configurable:true},left:{configurable:true},right:{configurable:true},top:{configurable:true},bottom:{configurable:true},center:{configurable:true},context:{configurable:true},type:{configurable:true},class:{configurable:true},dismissable:{configurable:true},closeButton:{configurable:true},buttons:{configurable:true},live:{configurable:true},closed:{configurable:true}};Handle.prototype.close=function close(timeout){var this$1=this;this.data.timeout=timeout;if(this.data===this.holder.active){if(this.holder.tm){clearTimeout(this.holder.tm)}if(timeout){this.holder.tm=setTimeout(function(){this$1.data.close();this$1.holder.tm=null},timeout)}else{this.data.close()}}else{if(timeout){this.data.timeout=timeout}else{this.data.close()}}return this.closed};Handle.prototype.cancelClose=function cancelClose(){if(this.data===this.holder.active){clearTimeout(this.holder.tm);this.holder.tm=null}else{this.data.timeout=0}};Handle.prototype.updateButtons=function updateButtons(){this.data===this.holder.active&&this.data.instance.update("_toast.buttons")};Handle.prototype.set=function set(key,value){var this$1=this;if(typeof key==="object"){for(var k in key){this$1.data[k]=key[k]}if(this.data===this.holder.active){return this.data.instance.update("_toast")}else{return Promise.resolve()}}else{this.data[key]=value;if(this.data===this.holder.active){return this.data.instance.update("_toast."+Ractive.escapeKey(key))}else{return Promise.resolve()}}};prototypeAccessors.message.get=function(){return this.data.message};prototypeAccessors.message.set=function(v){this.data.message=v;this.data===this.holder.active&&this.data.instance.update("_toast.message")};prototypeAccessors.more.get=function(){return this.data.more};prototypeAccessors.more.set=function(v){this.data.more=v;this.data===this.holder.active&&this.data.instance.update("_toast.more")};prototypeAccessors.showMore.get=function(){return this.data.showMore};prototypeAccessors.showMore.set=function(v){this.data.showMore=v;this.data===this.holder.active&&this.data.instance.update("_toast.showMore")};prototypeAccessors.left.get=function(){return this.data.left};prototypeAccessors.left.set=function(v){this.data.left=v;this.data.right=false;this.data===this.holder.active&&this.data.instance.update("_toast.left")&&this.data.instance.update("_toast.right")};prototypeAccessors.right.get=function(){return this.data.right};prototypeAccessors.right.set=function(v){this.data.right=v;this.data.left=false;this.data===this.holder.active&&this.data.instance.update("_toast.right")&&this.data.instance.update("_toast.left")};prototypeAccessors.top.get=function(){return!this.data.bottom};prototypeAccessors.top.set=function(v){this.data.bottom=!v;this.data===this.holder.active&&this.data.instance.update("_toast.bottom")};prototypeAccessors.bottom.get=function(){return this.data.bottom};prototypeAccessors.bottom.set=function(v){this.data.bottom=v;this.data===this.holder.active&&this.data.instance.update("_toast.bottom")};prototypeAccessors.center.get=function(){return!this.data.left&&!this.data.right};prototypeAccessors.center.set=function(v){this.data.left=false;this.data.right=false;this.data===this.holder.active&&this.data.instance.update("_toast.right");this.data.instance.update("_toast.left")};prototypeAccessors.context.get=function(){return this.data.context};prototypeAccessors.context.set=function(v){this.data.context=v;this.data===this.holder.active&&this.data.instance.update("_toast.context")};prototypeAccessors.type.get=function(){return this.data.type};prototypeAccessors.type.set=function(v){this.data.type=v;this.data===this.holder.active&&this.data.instance.update("_toast.type")};prototypeAccessors.class.get=function(){return this.data.class};prototypeAccessors.class.set=function(v){this.data.class=v;this.data===this.holder.active&&this.data.instance.update("_toast.class")};prototypeAccessors.dismissable.get=function(){return this.data.dismissable};prototypeAccessors.dismissable.set=function(v){this.data.dismissable=v;this.data===this.holder.active&&this.data.instance.update("_toast.dismissable")};prototypeAccessors.closeButton.get=function(){return this.data.closeButton};prototypeAccessors.closeButton.set=function(v){this.data.closeButton=v;this.data===this.holder.active&&this.data.instance.update("_toast.closeButton")};prototypeAccessors.buttons.get=function(){return this.data.buttons};prototypeAccessors.buttons.set=function(v){this.data.buttons=v;this.data===this.holder.active&&this.data.instance.update("_toast.buttons")};prototypeAccessors.live.get=function(){return this.data===this.holder.active||~this.holder.toasts.indexOf(this.data)};prototypeAccessors.closed.get=function(){var this$1=this;if(!this._promise){this._promise=new Promise(function(ok){this$1.data.onclose=ok})}return this._promise};Object.defineProperties(Handle.prototype,prototypeAccessors);
import{Ractive}from"ractive";var DEFAULTS={timeout:6e3,top:true};export default function plugin(opts){if(opts===void 0)opts={};var style=function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.toast.primary"));return"\n .rtoast {\n position: absolute;\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n left: 1em;\n right: 1em;\n top: 1em;\n bottom: auto;\n z-index: 5;\n pointer-events: none;\n overflow: hidden;\n }\n .rtoast-message {\n flex-grow: 2;\n display: flex;\n align-items: center;\n }\n .rtoast-string {\n white-space: pre-wrap;\n line-height: 1.3em;\n padding-top: 0.3em;\n }\n .rtoast-upper .rtoast-string {\n \n }\n .rtoast-expand .rtoast-string {\n padding-top: 0.5em;\n }\n .rtoast-buttons {\n display: flex;\n padding-left: 0.5em;\n flex-shrink: 1;\n align-items: center;\n max-height: max-content;\n margin-left: auto;\n }\n .rtoast-buttons button {\n cursor: pointer;\n }\n .rtoast-button {\n background-color: transparent;\n border: none;\n color: inherit;\n padding: 0.5em 0.75em;\n margin: 0 0 0 0.5em;\n line-height: 1em;\n box-shadow: none;\n }\n .rtoast-more {\n cursor: pointer;\n width: 2em;\n position: relative;\n flex-shrink: 2;\n background-color: transparent;\n border: none;\n color: inherit;\n margin: 0 0 0 0.5em;\n height: 2em;\n }\n .rtoast-more:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n height: 0.6em;\n top: calc(50% - 0.55em);\n left: calc(50% - 0.3em);\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n transition: transform 0.2s ease-in-out, top 0.2s ease-in-out;\n pointer-events: none;\n }\n .rtoast-expanded .rtoast-more:after {\n transform: rotate(225deg);\n top: calc(50% - 0.1em);\n }\n .rtoast-bottom {\n bottom: 1em;\n top: auto;\n }\n .rtoast-left {\n justify-content: flex-start;\n }\n .rtoast-right {\n justify-content: flex-end;\n }\n .rtoast-body {\n border-radius: 0.2em;\n padding: 0.5em 1em;\n color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.fg||"#222")+";\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n opacity: 0.95;\n pointer-events: all;\n transition: color 0.5s ease-in-out, background 0.5s ease-in-out;\n }\n .rtoast-upper {\n display: flex;\n flex-shrink: 2;\n flex-wrap: wrap;\n justify-content: space-between;\n }\n \n .rtoast-success {\n color: "+(data("raui.toast.success.fg")||"#f9f9f9")+";\n background-color: "+(data("raui.toast.success.bg")||"#4caf50")+";\n }\n .rtoast-info {\n color: "+(data("raui.toast.info.fg")||"#f9f9f9")+";\n background-color: "+(data("raui.toast.info.bg")||"#07e")+";\n }\n .rtoast-warn {\n color: "+(data("raui.toast.warn.fg")||"#222")+";\n background-color: "+(data("raui.warn.success.bg")||"#ffc107")+";\n }\n .rtoast-error {\n color: "+(data("raui.toast.error.fg")||"#f9f9f9")+";\n background-color: "+(data("raui.toast.error.bg")||"#ff5252")+";\n }\n "}.call(this,data)].join(" ")};var template={v:4,t:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast",g:1},{n:"class-rtoast-expanded",t:13,f:[{t:2,r:".showMore"}]},{n:"class-rtoast-bottom",t:13,f:[{t:2,r:".bottom"}]},{n:"class-rtoast-left",t:13,f:[{t:2,r:".left"}]},{n:"class-rtoast-right",t:13,f:[{t:2,r:".right"}]}],f:[{t:7,e:"div",m:[{n:"toast",t:72,v:"t0"},{n:"class",f:["rtoast-body",{t:4,f:[" rtoast-",{t:2,r:".type"}],n:50,r:".type"},{t:4,f:[{t:2,r:".class"}],n:50,r:".class"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.close()]"}}],n:50,x:{r:[".dismissable"],s:"_0!==false"}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-upper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-message",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".message",c:{r:".context"}}],n:50,x:{r:[".context"],s:"!!_0"}},{t:4,f:[{t:8,r:".message"}],n:51,l:1}],n:50,x:{r:[".message"],s:"Array.isArray(_0)"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-string",g:1}],f:[{t:2,r:".message"}]}],n:51,l:1}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-buttons",g:1}],f:[{t:4,f:[{t:7,e:"button",m:[{n:"class",f:["rtoast-button",{t:4,f:[" ",{t:2,r:".class"}],n:50,r:".class"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.action()]"}}],n:50,x:{r:[".action"],s:'typeof _0==="function"'}}],f:[{t:2,r:".label"}]}],n:52,r:".buttons"},{t:4,f:[{t:7,e:"button",m:[{t:13,n:"class",f:"rtoast-button",g:1}],f:["Close"]}],n:50,x:{r:[".dismissable",".closeButton"],s:"_0!==false&&_1!==false"},l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-more",g:1},{n:"title",f:"Toggle more",t:13,g:1},{n:["click"],t:70,f:{r:[".","@context"],s:'[_0.expand(),(_1).toggle(".showMore"),false]'}}]}],n:50,r:".more"}]}],n:50,x:{r:[".dismissable",".closeButton",".buttons.length",".more"],s:"(_0!==false&&_1!==false)||_2||_3"}}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-expand",g:1},{n:"toast-expand",t:72,v:"t0"},{n:["click"],t:70,f:{r:[],s:"[false,false]"}}],f:[{t:4,f:[{t:4,f:[{t:8,r:".more",c:{r:".context"}}],n:50,x:{r:[".context"],s:"!!_0"}},{t:4,f:[{t:8,r:".more"}],n:51,l:1}],n:50,x:{r:[".more"],s:"Array.isArray(_0)"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-string",g:1}],f:[{t:2,r:".more"}]}],n:51,l:1}]}],n:50,x:{r:[".more",".showMore"],s:"_0&&_1"}}]}]}],n:54,r:"~/_toast"}],n:50,r:"~/_toast"}],e:{"[_0.close()]":function(_0){return[_0.close()]},"_0!==false":function(_0){return _0!==false},"!!_0":function(_0){return!!_0},"Array.isArray(_0)":function(_0){return Array.isArray(_0)},"[_0.action()]":function(_0){return[_0.action()]},'typeof _0==="function"':function(_0){return typeof _0==="function"},"_0!==false&&_1!==false":function(_0,_1){return _0!==false&&_1!==false},'[_0.expand(),(_1).toggle(".showMore"),false]':function(_0,_1){return[_0.expand(),_1.toggle(".showMore"),false]},"(_0!==false&&_1!==false)||_2||_3":function(_0,_1,_2,_3){return _0!==false&&_1!==false||_2||_3},"[false,false]":function(){return[false,false]},"_0&&_1":function(_0,_1){return _0&&_1}}};return function(ref){var Ractive=ref.Ractive;var instance=ref.instance;var proto=ref.proto;instance.partials[opts.name||"toast"]=template;var defaults=Object.assign({},DEFAULTS,opts);var toasts=[];var holder={toasts:toasts};var active;Object.defineProperty(proto,"toastDefaults",{value:defaults,writable:false,configurable:true});proto.toast=function toast(message,options){var opts=Object.assign({message:message,instance:this},defaults,this.toastDefaults,options);opts.close=function(){return closeToast(opts)};opts.expand=function(){if(holder.active!==opts){return}if(holder.tm){clearTimeout(holder.tm);holder.tm=null}if(opts.showMore){if(opts.timeout){holder.tm=setTimeout(function(){opts.close();holder.tm=null},opts.timeout)}}};toasts.push(opts);if(!active){showToast()}return new Handle(holder,opts)};function closeToast(which){if(active!==which){toasts.splice(toasts.indexOf(opts),1);if(typeof which.onclose==="function"){which.onclose()}}else{if(holder.tm){clearTimeout(holder.tm);holder.tm=null}active.instance.set("_toast",null).then(function(){holder.active=active=null;if(typeof which.onclose==="function"){which.onclose()}if(toasts.length){showToast()}})}}function showToast(){holder.active=active=toasts.shift();active.instance.set("_toast",active).then(function(){if(active.timeout){if(holder.tm){clearTimeout(holder.tm)}holder.tm=setTimeout(function(){active.close();holder.tm=null},active.timeout)}})}proto.on=proto.on||{};instance.transitions.toast=function(t,ps){var params=t.processParams({duration:200},ps);var opacity=t.getStyle("opacity");if(t.isIntro){t.setStyle({opacity:0,transform:"translateY("+(active.bottom?"":"-")+"1em)"});return t.animateStyle({opacity:opacity,transform:"none"},params)}else{t.setStyle({opacity:opacity,transform:"none"});return t.animateStyle({opacity:0,transform:"translateY("+(active.bottom?"":"-")+"1em)"},params)}};instance.transitions["toast-expand"]=function(t,ps){var params=t.processParams({duration:200,nested:false},ps);if(t.isIntro){var h=t.getStyle("height");var w=t.getStyle("width");t.setStyle("height",0);t.setStyle("width",0);return t.animateStyle("width",w,params).then(function(){return t.animateStyle("height",h,params)}).then(function(){t.setStyle("height","");t.setStyle("width","")})}else{var h$1=t.getStyle("height");t.setStyle("height",h$1);t.setStyle("width",t.getStyle("width"));return t.animateStyle("height",0,params).then(function(){return t.animateStyle("width",0,params)}).then(function(){t.setStyle("height","");t.setStyle("width","")})}};proto.on["close-toast"]=function(){if(active){active.close()}};if(instance===Ractive||Ractive.isInstance(instance)){if(!Ractive.hasCSS("toast-css")){Ractive.addCSS("toast",style)}}else{var pcss=instance.css;instance.css=function(data){var css="";if(typeof pcss==="string"){css+=pcss}else if(typeof pcss==="function"){css+=pcss(data)}return style(data)+css}}return proto}}export var Handle=function Handle(holder,data){this.holder=holder;this.data=data};var prototypeAccessors={message:{configurable:true},more:{configurable:true},showMore:{configurable:true},left:{configurable:true},right:{configurable:true},top:{configurable:true},bottom:{configurable:true},center:{configurable:true},context:{configurable:true},type:{configurable:true},class:{configurable:true},dismissable:{configurable:true},closeButton:{configurable:true},buttons:{configurable:true},live:{configurable:true},closed:{configurable:true}};Handle.prototype.close=function close(timeout){var this$1=this;this.data.timeout=timeout;if(this.data===this.holder.active){if(this.holder.tm){clearTimeout(this.holder.tm)}if(timeout){this.holder.tm=setTimeout(function(){this$1.data.close();this$1.holder.tm=null},timeout)}else{this.data.close()}}else{if(timeout){this.data.timeout=timeout}else{this.data.close()}}return this.closed};Handle.prototype.cancelClose=function cancelClose(){if(this.data===this.holder.active){clearTimeout(this.holder.tm);this.holder.tm=null}else{this.data.timeout=0}};Handle.prototype.updateButtons=function updateButtons(){this.data===this.holder.active&&this.data.instance.update("_toast.buttons")};Handle.prototype.set=function set(key,value){if(typeof key==="object"){for(var k in key){this.data[k]=key[k]}if(this.data===this.holder.active){return this.data.instance.update("_toast")}else{return Promise.resolve()}}else{this.data[key]=value;if(this.data===this.holder.active){return this.data.instance.update("_toast."+Ractive.escapeKey(key))}else{return Promise.resolve()}}};prototypeAccessors.message.get=function(){return this.data.message};prototypeAccessors.message.set=function(v){this.data.message=v;this.data===this.holder.active&&this.data.instance.update("_toast.message")};prototypeAccessors.more.get=function(){return this.data.more};prototypeAccessors.more.set=function(v){this.data.more=v;this.data===this.holder.active&&this.data.instance.update("_toast.more")};prototypeAccessors.showMore.get=function(){return this.data.showMore};prototypeAccessors.showMore.set=function(v){this.data.showMore=v;this.data===this.holder.active&&this.data.instance.update("_toast.showMore")};prototypeAccessors.left.get=function(){return this.data.left};prototypeAccessors.left.set=function(v){this.data.left=v;this.data.right=false;this.data===this.holder.active&&this.data.instance.update("_toast.left")&&this.data.instance.update("_toast.right")};prototypeAccessors.right.get=function(){return this.data.right};prototypeAccessors.right.set=function(v){this.data.right=v;this.data.left=false;this.data===this.holder.active&&this.data.instance.update("_toast.right")&&this.data.instance.update("_toast.left")};prototypeAccessors.top.get=function(){return!this.data.bottom};prototypeAccessors.top.set=function(v){this.data.bottom=!v;this.data===this.holder.active&&this.data.instance.update("_toast.bottom")};prototypeAccessors.bottom.get=function(){return this.data.bottom};prototypeAccessors.bottom.set=function(v){this.data.bottom=v;this.data===this.holder.active&&this.data.instance.update("_toast.bottom")};prototypeAccessors.center.get=function(){return!this.data.left&&!this.data.right};prototypeAccessors.center.set=function(v){this.data.left=false;this.data.right=false;this.data===this.holder.active&&this.data.instance.update("_toast.right");this.data.instance.update("_toast.left")};prototypeAccessors.context.get=function(){return this.data.context};prototypeAccessors.context.set=function(v){this.data.context=v;this.data===this.holder.active&&this.data.instance.update("_toast.context")};prototypeAccessors.type.get=function(){return this.data.type};prototypeAccessors.type.set=function(v){this.data.type=v;this.data===this.holder.active&&this.data.instance.update("_toast.type")};prototypeAccessors.class.get=function(){return this.data.class};prototypeAccessors.class.set=function(v){this.data.class=v;this.data===this.holder.active&&this.data.instance.update("_toast.class")};prototypeAccessors.dismissable.get=function(){return this.data.dismissable};prototypeAccessors.dismissable.set=function(v){this.data.dismissable=v;this.data===this.holder.active&&this.data.instance.update("_toast.dismissable")};prototypeAccessors.closeButton.get=function(){return this.data.closeButton};prototypeAccessors.closeButton.set=function(v){this.data.closeButton=v;this.data===this.holder.active&&this.data.instance.update("_toast.closeButton")};prototypeAccessors.buttons.get=function(){return this.data.buttons};prototypeAccessors.buttons.set=function(v){this.data.buttons=v;this.data===this.holder.active&&this.data.instance.update("_toast.buttons")};prototypeAccessors.live.get=function(){return this.data===this.holder.active||~this.holder.toasts.indexOf(this.data)};prototypeAccessors.closed.get=function(){var this$1=this;if(!this._promise){this._promise=new Promise(function(ok){this$1.data.onclose=ok})}return this._promise};Object.defineProperties(Handle.prototype,prototypeAccessors);

@@ -9,3 +9,3 @@ import Ractive from 'ractive';

export var Base = (function (Ractive) {
export var Base = /*@__PURE__*/(function (Ractive) {
function Base(opts) { Ractive.call(this, opts); }

@@ -26,3 +26,3 @@

primary.title = Object.assign({ inactive: {} }, data('raui.window.title'), data('raui.window.primary.title'));
return ("\n .rwhost {\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n \n .rwhost-sizer {\n position: absolute;\n }\n \n .rwhost-pane {\n display: flex;\n position: relative;\n width: 100%;\n box-sizing: border-box;\n flex-grow: 2;\n overflow: auto;\n background-color: " + (primary.host.bg || primary.bg || '#fff') + ";\n z-index: 1;\n }\n .rwhost-pane.blocked {\n overflow: hidden;\n }\n \n .rwhost-pane-content {\n flex-grow: 1;\n }\n \n .rwhost-modal {\n position: absolute;\n position: --webkit-sticky;\n position: sticky;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: -1;\n opacity: 0;\n transition: opacity 0.2s ease-in-out, z-index 0s linear 0.2s;\n background-color: #000;\n }\n .rwhost-modal-active {\n opacity: 0.5;\n z-index: 1;\n transition: opacity 0.2s ease-in-out, z-index 0s linear;\n }\n \n .rwindow-wrapper {\n display: inline-block;\n box-sizing: border-box;\n position: absolute;\n }\n .rwindow-wrapper.rwindow-resizing {\n transition: none;\n }\n \n .rwindow-wrapper.rwindow-resizable {\n padding: " + (primary.handleSize || 7) + "px;\n }\n \n .rwindow-topmost > .rwindow {\n box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 3px 5px -1px rgba(0, 0, 0, 0.3);\n opacity: 1;\n }\n \n .rwindow-modal {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: rgba(0, 0, 0, 0.5);\n opacity: 0;\n z-index: -1;\n transition: opacity 0.4s ease-in-out, z-index 0s linear 0.4s;\n }\n .rwindow-modal.rwindow-blocked {\n opacity: 1;\n z-index: 10;\n transition: opacity 0.4s ease-in-out, z-index 0s linear;\n }\n \n .rwindow {\n position: relative;\n box-sizing: border-box;\n background-color: " + (primary.bg || '#fff') + ";\n color: " + (primary.fg || '#222') + ";\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n overflow: hidden;\n width: 100%;\n height: 100%;\n min-width: " + (primary.minWidth || '6em') + ";\n min-height: " + (primary.minHeight || '6em') + ";\n transition: box-shadow 0.4s ease-in-out, opacity 0.4s ease-in-out;\n }\n .rwindow-max > .rwindow {\n border-radius: 0;\n box-shadow: none;\n }\n \n .rwindow-pane-top,\n .rwindow-max-top {\n background-color: " + (primary.title.inactive.bg || primary.fg || '#222') + ";\n color: " + (primary.title.inactive.fg || primary.bg || '#fff') + ";\n flex-shrink: 0;\n }\n \n .rwindow-max-top {\n flex-shrink: 2;\n }\n \n .rwindow-pane-top {\n display: flex;\n align-items: center;\n }\n \n .rwindow-topmost .rwindow-pane-top {\n background-color: " + (primary.title.bg || primary.fga || '#07e') + ";\n color: " + (primary.title.fg || primary.bg || '#fff') + ";\n }\n \n .rwindow-pane {\n display: flex;\n flex-direction: column;\n table-layout: fixed;\n width: 100%;\n height: 100%;\n }\n .rwindow-autosizing {\n display: block;\n box-sizing: border-box;\n }\n .rwindow-content {\n overflow: auto;\n flex-grow: 2;\n position: relative;\n box-sizing: border-box;\n }\n .rwindow-content.rwindow-pad {\n padding: 1em;\n }\n .rwindow-content.rwindow-flex {\n display: flex;\n flex-direction: column;\n }\n \n .rwindow-buttons {\n display: flex;\n flex-shrink: 0;\n padding: 0.5em;\n border-top: 1px solid " + (primary.action.bc || primary.bc || '#ccc') + ";\n background-color: " + (primary.action.bg || primary.bg || '#fff') + ";\n color: " + (primary.action.fg || primary.fg || '#222') + ";\n }\n .rwindow-buttons.no-buttons {\n display: none;\n }\n .rwindow-left-buttons {\n text-align: left;\n flex-grow: 2;\n }\n .rwindow-left-buttons button {\n margin-right: 0.5em;\n }\n .rwindow-center-buttons {\n text-align: center;\n flex-shrink: 2;\n }\n .rwindow-center-buttons button {\n margin: 0 0.25em;\n }\n .rwindow-right-buttons {\n text-align: right;\n flex-grow: 2;\n }\n .rwindow-right-buttons button {\n margin-left: 0.5em;\n }\n \n .rwindow-title {\n overflow: hidden;\n text-overflow: ellipsis;\n padding: 0.5em;\n white-space: nowrap;\n box-sizing: border-box;\n flex-grow: 1;\n }\n \n .rwindow-controls {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n flex-grow: 1;\n }\n .rwindow-controls > div {\n margin: 0 1em 0 0;\n width: 0.7em;\n height: 0.7em;\n cursor: pointer;\n }\n .rwindow-minimize {\n border-bottom: 2px solid;\n }\n .rwindow-maximize {\n border: 2px solid;\n }\n .rwindow-controls > .rwindow-close {\n width: 0.5em;\n height: 1em;\n border-right: 2px solid;\n transform: rotate(45deg);\n transform-origin: center right;\n position: relative;\n margin-right: 1.5em;\n }\n .rwindow-close:before {\n cursor: pointer;\n height: 1.2em;\n width: 1.2em;\n top: 0.3em;\n left: 0.1em;\n content: ' ';\n transform: rotate(-45deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-close:after {\n cursor: pointer;\n height: 100%;\n width: 100%;\n top: 1px;\n left: calc(100% + 1px);\n content: ' ';\n border-left: 2px solid;\n transform: rotate(-90deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-max-top .rwindow-controls > .rwindow-close {\n margin-right: 0.5em;\n }\n " + (typeof data('raui.window.extra') === 'function' ? data('raui.window.extra').call(this, data) : '') + "\n ");
return ("\n .rwhost {\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n \n .rwhost-sizer {\n position: absolute;\n }\n \n .rwhost-pane {\n display: flex;\n position: relative;\n width: 100%;\n box-sizing: border-box;\n flex-grow: 2;\n overflow: auto;\n background-color: " + (primary.host.bg || primary.bg || '#fff') + ";\n z-index: 1;\n }\n .rwhost-pane.blocked {\n overflow: hidden;\n }\n \n .rwhost-pane-content {\n flex-grow: 1;\n }\n \n .rwhost-modal {\n position: absolute;\n position: --webkit-sticky;\n position: sticky;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: -1;\n opacity: 0;\n transition: opacity 0.2s ease-in-out, z-index 0s linear 0.2s;\n background-color: #000;\n }\n .rwhost-modal-active {\n opacity: 0.5;\n z-index: 1;\n transition: opacity 0.2s ease-in-out, z-index 0s linear;\n }\n \n .rwindow-wrapper {\n display: inline-block;\n box-sizing: border-box;\n position: absolute;\n }\n .rwindow-wrapper.rwindow-resizing {\n transition: none;\n }\n \n .rwindow-wrapper.rwindow-resizable {\n padding: " + (primary.handleSize || 7) + "px;\n }\n \n .rwindow-topmost > .rwindow {\n box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 3px 5px -1px rgba(0, 0, 0, 0.3);\n opacity: 1;\n }\n \n .rwindow-modal {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: rgba(0, 0, 0, 0.5);\n opacity: 0;\n z-index: -1;\n transition: opacity 0.4s ease-in-out, z-index 0s linear 0.4s;\n }\n .rwindow-modal.rwindow-blocked {\n opacity: 1;\n z-index: 50;\n transition: opacity 0.4s ease-in-out, z-index 0s linear;\n }\n \n .rwindow {\n position: relative;\n box-sizing: border-box;\n background-color: " + (primary.bg || '#fff') + ";\n color: " + (primary.fg || '#222') + ";\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n overflow: hidden;\n width: 100%;\n height: 100%;\n min-width: " + (primary.minWidth || '6em') + ";\n min-height: " + (primary.minHeight || '6em') + ";\n transition: box-shadow 0.4s ease-in-out, opacity 0.4s ease-in-out;\n }\n .rwindow-max > .rwindow {\n border-radius: 0;\n box-shadow: none;\n }\n \n .rwindow-pane-top,\n .rwindow-max-top {\n background-color: " + (primary.title.inactive.bg || primary.fg || '#222') + ";\n color: " + (primary.title.inactive.fg || primary.bg || '#fff') + ";\n flex-shrink: 0;\n }\n \n .rwindow-max-top {\n flex-shrink: 2;\n }\n \n .rwindow-pane-top {\n display: flex;\n align-items: center;\n }\n \n .rwindow-topmost .rwindow-pane-top {\n background-color: " + (primary.title.bg || primary.fga || '#07e') + ";\n color: " + (primary.title.fg || primary.bg || '#fff') + ";\n }\n \n .rwindow-pane {\n display: flex;\n flex-direction: column;\n table-layout: fixed;\n width: 100%;\n height: 100%;\n }\n .rwindow-autosizing {\n display: block;\n box-sizing: border-box;\n }\n .rwindow-content {\n overflow: auto;\n flex-grow: 2;\n position: relative;\n box-sizing: border-box;\n }\n .rwindow-content.rwindow-pad {\n padding: 1em;\n }\n .rwindow-content.rwindow-flex {\n display: flex;\n flex-direction: column;\n }\n \n .rwindow-buttons {\n display: flex;\n flex-shrink: 0;\n padding: 0.5em;\n border-top: 1px solid " + (primary.action.bc || primary.bc || '#ccc') + ";\n background-color: " + (primary.action.bg || primary.bg || '#fff') + ";\n color: " + (primary.action.fg || primary.fg || '#222') + ";\n }\n .rwindow-buttons.no-buttons {\n display: none;\n }\n .rwindow-left-buttons {\n text-align: left;\n flex-grow: 2;\n }\n .rwindow-left-buttons button {\n margin-right: 0.5em;\n }\n .rwindow-center-buttons {\n text-align: center;\n flex-shrink: 2;\n }\n .rwindow-center-buttons button {\n margin: 0 0.25em;\n }\n .rwindow-right-buttons {\n text-align: right;\n flex-grow: 2;\n }\n .rwindow-right-buttons button {\n margin-left: 0.5em;\n }\n \n .rwindow-title {\n overflow: hidden;\n text-overflow: ellipsis;\n padding: 0.5em;\n white-space: nowrap;\n box-sizing: border-box;\n flex-grow: 1;\n }\n \n .rwindow-controls {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n flex-grow: 1;\n }\n .rwindow-controls > div {\n margin: 0 1em 0 0;\n width: 0.7em;\n height: 0.7em;\n cursor: pointer;\n }\n .rwindow-minimize {\n border-bottom: 2px solid;\n }\n .rwindow-maximize {\n border: 2px solid;\n }\n .rwindow-controls > .rwindow-close {\n width: 0.5em;\n height: 1em;\n border-right: 2px solid;\n transform: rotate(45deg);\n transform-origin: center right;\n position: relative;\n margin-right: 1.5em;\n }\n .rwindow-close:before {\n cursor: pointer;\n height: 1.2em;\n width: 1.2em;\n top: 0.3em;\n left: 0.1em;\n content: ' ';\n transform: rotate(-45deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-close:after {\n cursor: pointer;\n height: 100%;\n width: 100%;\n top: 1px;\n left: calc(100% + 1px);\n content: ' ';\n border-left: 2px solid;\n transform: rotate(-90deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-max-top .rwindow-controls > .rwindow-close {\n margin-right: 0.5em;\n }\n " + (typeof data('raui.window.extra') === 'function' ? data('raui.window.extra').call(this, data) : '') + "\n ");
}).call(this, data)].join(' '); },

@@ -86,3 +86,3 @@ cssId: 'rwindow',

var id = 0;
export var Host = (function (Base) {
export var Host = /*@__PURE__*/(function (Base) {
function Host(opts) { Base.call(this, opts); this.defaults = {}; }

@@ -110,7 +110,5 @@

prototypeAccessors.topmost.get = function () {
var this$1 = this;
var windows = this.get('windows');
for (var k in windows) {
if (windows[k].topmost) { return this$1.getWindow(windows[k].id); }
if (windows[k].topmost) { return this.getWindow(windows[k].id); }
}

@@ -514,3 +512,3 @@ };

content.splice(i, 1);
this$1.set({
this.set({
_maxP: { t: e.f },

@@ -520,3 +518,3 @@ hideTitleMax: true

if (e.m) {
this$1.set({
this.set({
_maxAttrsP: { t: e.m }

@@ -624,3 +622,3 @@ });

export var Window = (function (Base) {
export var Window = /*@__PURE__*/(function (Base) {
function Window(opts) { Base.call(this, opts); }

@@ -627,0 +625,0 @@

@@ -1,1 +0,1 @@

import Ractive from"ractive";import expand from"./transition-expand";import toast from"./Toast";import globalRegister from"./globalRegister";var escape=Ractive.escapeKey;var windowTrans;export var Base=function(Ractive){function Base(opts){Ractive.call(this,opts)}if(Ractive)Base.__proto__=Ractive;Base.prototype=Object.create(Ractive&&Ractive.prototype);Base.prototype.constructor=Base;return Base}(Ractive);Ractive.extendWith(Base,{css:function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.window.primary"));primary.action=Object.assign({},data("raui.window.action"),data("raui.window.primary.action"));primary.host=Object.assign({},data("raui.window.host"),data("raui.window.primary.host"));primary.title=Object.assign({inactive:{}},data("raui.window.title"),data("raui.window.primary.title"));return"\n .rwhost {\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n \n .rwhost-sizer {\n position: absolute;\n }\n \n .rwhost-pane {\n display: flex;\n position: relative;\n width: 100%;\n box-sizing: border-box;\n flex-grow: 2;\n overflow: auto;\n background-color: "+(primary.host.bg||primary.bg||"#fff")+";\n z-index: 1;\n }\n .rwhost-pane.blocked {\n overflow: hidden;\n }\n \n .rwhost-pane-content {\n flex-grow: 1;\n }\n \n .rwhost-modal {\n position: absolute;\n position: --webkit-sticky;\n position: sticky;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: -1;\n opacity: 0;\n transition: opacity 0.2s ease-in-out, z-index 0s linear 0.2s;\n background-color: #000;\n }\n .rwhost-modal-active {\n opacity: 0.5;\n z-index: 1;\n transition: opacity 0.2s ease-in-out, z-index 0s linear;\n }\n \n .rwindow-wrapper {\n display: inline-block;\n box-sizing: border-box;\n position: absolute;\n }\n .rwindow-wrapper.rwindow-resizing {\n transition: none;\n }\n \n .rwindow-wrapper.rwindow-resizable {\n padding: "+(primary.handleSize||7)+"px;\n }\n \n .rwindow-topmost > .rwindow {\n box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 3px 5px -1px rgba(0, 0, 0, 0.3);\n opacity: 1;\n }\n \n .rwindow-modal {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: rgba(0, 0, 0, 0.5);\n opacity: 0;\n z-index: -1;\n transition: opacity 0.4s ease-in-out, z-index 0s linear 0.4s;\n }\n .rwindow-modal.rwindow-blocked {\n opacity: 1;\n z-index: 10;\n transition: opacity 0.4s ease-in-out, z-index 0s linear;\n }\n \n .rwindow {\n position: relative;\n box-sizing: border-box;\n background-color: "+(primary.bg||"#fff")+";\n color: "+(primary.fg||"#222")+";\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n overflow: hidden;\n width: 100%;\n height: 100%;\n min-width: "+(primary.minWidth||"6em")+";\n min-height: "+(primary.minHeight||"6em")+";\n transition: box-shadow 0.4s ease-in-out, opacity 0.4s ease-in-out;\n }\n .rwindow-max > .rwindow {\n border-radius: 0;\n box-shadow: none;\n }\n \n .rwindow-pane-top,\n .rwindow-max-top {\n background-color: "+(primary.title.inactive.bg||primary.fg||"#222")+";\n color: "+(primary.title.inactive.fg||primary.bg||"#fff")+";\n flex-shrink: 0;\n }\n \n .rwindow-max-top {\n flex-shrink: 2;\n }\n \n .rwindow-pane-top {\n display: flex;\n align-items: center;\n }\n \n .rwindow-topmost .rwindow-pane-top {\n background-color: "+(primary.title.bg||primary.fga||"#07e")+";\n color: "+(primary.title.fg||primary.bg||"#fff")+";\n }\n \n .rwindow-pane {\n display: flex;\n flex-direction: column;\n table-layout: fixed;\n width: 100%;\n height: 100%;\n }\n .rwindow-autosizing {\n display: block;\n box-sizing: border-box;\n }\n .rwindow-content {\n overflow: auto;\n flex-grow: 2;\n position: relative;\n box-sizing: border-box;\n }\n .rwindow-content.rwindow-pad {\n padding: 1em;\n }\n .rwindow-content.rwindow-flex {\n display: flex;\n flex-direction: column;\n }\n \n .rwindow-buttons {\n display: flex;\n flex-shrink: 0;\n padding: 0.5em;\n border-top: 1px solid "+(primary.action.bc||primary.bc||"#ccc")+";\n background-color: "+(primary.action.bg||primary.bg||"#fff")+";\n color: "+(primary.action.fg||primary.fg||"#222")+";\n }\n .rwindow-buttons.no-buttons {\n display: none;\n }\n .rwindow-left-buttons {\n text-align: left;\n flex-grow: 2;\n }\n .rwindow-left-buttons button {\n margin-right: 0.5em;\n }\n .rwindow-center-buttons {\n text-align: center;\n flex-shrink: 2;\n }\n .rwindow-center-buttons button {\n margin: 0 0.25em;\n }\n .rwindow-right-buttons {\n text-align: right;\n flex-grow: 2;\n }\n .rwindow-right-buttons button {\n margin-left: 0.5em;\n }\n \n .rwindow-title {\n overflow: hidden;\n text-overflow: ellipsis;\n padding: 0.5em;\n white-space: nowrap;\n box-sizing: border-box;\n flex-grow: 1;\n }\n \n .rwindow-controls {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n flex-grow: 1;\n }\n .rwindow-controls > div {\n margin: 0 1em 0 0;\n width: 0.7em;\n height: 0.7em;\n cursor: pointer;\n }\n .rwindow-minimize {\n border-bottom: 2px solid;\n }\n .rwindow-maximize {\n border: 2px solid;\n }\n .rwindow-controls > .rwindow-close {\n width: 0.5em;\n height: 1em;\n border-right: 2px solid;\n transform: rotate(45deg);\n transform-origin: center right;\n position: relative;\n margin-right: 1.5em;\n }\n .rwindow-close:before {\n cursor: pointer;\n height: 1.2em;\n width: 1.2em;\n top: 0.3em;\n left: 0.1em;\n content: ' ';\n transform: rotate(-45deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-close:after {\n cursor: pointer;\n height: 100%;\n width: 100%;\n top: 1px;\n left: calc(100% + 1px);\n content: ' ';\n border-left: 2px solid;\n transform: rotate(-90deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-max-top .rwindow-controls > .rwindow-close {\n margin-right: 0.5em;\n }\n "+(typeof data("raui.window.extra")==="function"?data("raui.window.extra").call(this,data):"")+"\n "}.call(this,data)].join(" ")},cssId:"rwindow",noCssTransform:true,delegate:false,decorators:{tracked:function tracked(node,id){this[id]=node;return{teardown:function teardown(){if(this[id]===node){this[id]=null}}}}},transitions:{window:function window(t,params){if(windowTrans){return t.complete()}windowTrans=t;var p=t.processParams(params,{duration:400,easing:"easeInOut"});var parent=t.node.parentNode;var overflow=parent.style?parent.style.overflow:"";if(parent.style){parent.style.overflow="hidden"}if(t.isIntro||p.intro){t.setStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0});setTimeout(function(){t.animateStyle({transform:"none",opacity:1},p).then(function(){t.setStyle("opacity",1);windowTrans=false;t.complete();if(parent.style){parent.style.overflow=overflow}})})}else{t.setStyle({transform:"none",opacity:1});t.animateStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0},p).then(function(){windowTrans=false;t.complete();if(parent.style){parent.style.overflow=overflow}})}}}});var id=0;export var Host=function(Base){function Host(opts){Base.call(this,opts);this.defaults={}}if(Base)Host.__proto__=Base;Host.prototype=Object.create(Base&&Base.prototype);Host.prototype.constructor=Host;var prototypeAccessors={current:{configurable:true},currentId:{configurable:true},placement:{configurable:true},topmost:{configurable:true},windows:{configurable:true}};prototypeAccessors.current.get=function(){var top=this.get("topLevel");return this.getWindow(this.get("windows")[top].id)};prototypeAccessors.currentId.get=function(){var top=this.get("topLevel");return this.get("windows."+escape(top)+".id")};prototypeAccessors.placement.get=function(){return this.get("placement")};prototypeAccessors.placement.set=function(v){return this.set("placement",v)};prototypeAccessors.topmost.get=function(){var this$1=this;var windows=this.get("windows");for(var k in windows){if(windows[k].topmost){return this$1.getWindow(windows[k].id)}}};prototypeAccessors.windows.get=function(){return Object.keys(this.get("windows"))};Host.prototype.addWindow=function addWindow(window,opts){var this$1=this;var options=Object.assign({},this.defaults,window.constructor.prototype.options,window.options,window.get("options"),opts);if(!(window instanceof Window)){throw new Error("Windows must be instances of Window")}if(!window.id){window.set("@.id",options.id||"window"+id++)}if(!this.get("windows."+escape(window.id))){this.set("windows."+escape(window.id),Object.assign({show:options.show!==false,autosize:true,id:window.id,blockers:[],close:true,minimize:true,maximize:true},options,{id:window.id}))}window.host=this;var promise=this.attachChild(window,{target:"window"});var parent;if(options.block){parent=options.block.id||options.block;if(typeof parent==="string"&&parent in this.get("windows")){this.push("windows."+escape(parent)+".blockers",window.id);window.set("control.blocking",parent)}else{parent=false}}if(options.size==="fill"&&(parent||options.block)){var wnd;if(options.block===true){wnd=this.find(".rwhost-pane")}else if(wnd=this.getWindow(parent)){wnd=wnd.find(".rwindow")}if(wnd){window.size(wnd.clientWidth-(options.fillPad||20),wnd.clientHeight-(options.fillPad||20));if(options.block&&!(options.top||options.left)){options.top=options.left=Math.floor((options.fillPad||20)/2)}}}else if(options.width&&options.height){window.size(options.width,options.height)}else{window.size("auto")}if(options.top&&options.left){window.move(options.top,options.left)}else{this.place(window)}this.raise(window,{show:options.show!==false,parent:options.stickToParent});window.on("close",function(){var blocking=window.get("control.blocking");if(blocking){var blockers=this$1.windowGet(blocking,"blockers");this$1.splice("windows."+escape(blocking)+".blockers",blockers.indexOf(window.id),1)}this$1.detachChild(window).then(function(){return window.teardown()});this$1.set("windows."+escape(window.id)+".block",false);this$1.set("windows."+escape(window.id)+".index",-1);this$1.raise();this$1.set("windows."+escape(window.id),undefined);delete this$1.get("windows")[window.id]});this.update("windows."+escape(window.id)+".id",{force:true});return promise.then(function(){return window})};Host.prototype.getWindow=function getWindow(id){return this.children.byName.window&&this.children.byName.window.filter(function(w){return w.instance.id===id}).map(function(w){return w.instance})[0]};Host.prototype.windowGet=function windowGet(id,path){return this.get("windows."+escape(id)+"."+path)};Host.prototype.windowSet=function windowSet(id,path,val){return this.set("windows."+escape(id)+"."+path,val)};Host.prototype.raise=function raise(window,opts){var this$1=this;if(opts===void 0)opts={};var wnd=window instanceof Window?window:this.children.byName.window.filter(function(a){return a.instance.id===window}).map(function(a){return a.instance})[0];var object=this.get("windows");var host=this;var wnds=Object.keys(object).map(function(k){return object[k]});var top=wnds.length+1;var last=this.get("topLevel");var wasBlocked=this.get("blocked");function blocks(id){var bs=host.get("windows."+escape(id)+".blockers");if(!bs){return}bs.forEach(function(b){host.add("windows."+escape(b)+".index",top++);blocks(b)})}if(wnd){if(opts.parent!==false&&wnd.get("control.blocking")){var blocking=wnd.get("control.blocking");top=this.get("windows."+blocking+".index")||0+(this.get("windows."+blocking+".blockers.length")||0);wnds.forEach(function(w){if(w.index>top){w.index++}});top++}wnd.set("control.index",opts.show===false?-1:top++);if(opts.show!==false&&!wnd.visible){wnd.show()}blocks(wnd.id)}wnds.filter(function(w){return w.show!==false&&w.block===true}).forEach(function(w){this$1.set("windows."+escape(w.id)+".index",(w.index||0)+top);blocks(w.id)});var ordered=wnds.sort(function(l,r){return!l.show?-1:!r.show?1:l.index<r.index?-1:1});var visible=ordered.filter(function(w){return w.show});top=ordered.indexOf(visible[visible.length-1]);var sets={};var modalIdx=null;ordered.forEach(function(w,i){var key=escape(w.id);if(w.block===true&&modalIdx===null){modalIdx=i}sets["windows."+key+".index"]=modalIdx!==null?i+2:i;sets["windows."+key+".topmost"]=i===top;sets["windows."+key+".stack"]=ordered.length-i});if(modalIdx!==null){sets.blocked=modalIdx+1}else{sets.blocked=0}if(~top&&ordered.length){sets.topLevel=ordered[top].id}else{sets.topLevel=null}this.set(sets);top=sets.topLevel;if(top&&top!==last&&this.get("currentMax")&&this.rendered){var leaving=this.get("windows."+escape(last));wnd=this.getWindow(top);var transition=this.get("transition");if(transition!==false&&(!leaving||!leaving.dialog||leaving.blocking&&leaving.blocking!==top)){wnd.transition(transition||"window",wnd.find("div"),{intro:true})}}};Host.prototype.place=function place(wnd){var this$1=this;if(!wnd.get("control.show")){return Promise.resolve()}return new Promise(function(ok){requestAnimationFrame(function(){var local=wnd.get("control");if(local.width===undefined){wnd.size("auto")}var left=0;var top=0;if(!(this$1.fragment&&this$1.fragment.rendered)){return}var host=this$1.find(".rwhost");var maxw=host.clientWidth;var maxh=host.clientHeight;var blocking=local.blocking;if(blocking){var key="windows."+escape(blocking);var blocked=this$1.get(key);var max=local.max||!local.dialog&&(this$1.get("max")||this$1.get("userMax"));var bmax=blocked.max||this$1.get("userMax")||this$1.get("max");var bw=bmax?this$1.host.clientWidth:this$1.sizeInPx(blocked.width+"em");var bh=bmax?this$1.host.clientHeight:this$1.sizeInPx(blocked.height+"em");var bl=bmax?0:blocked.left;var bt=bmax?0:blocked.top;left=(max?maxw:bw/2)+(max?0:bl)-this$1.sizeInPx(local.width+"em")/2;top=(max?maxh:bh/2)+(max?0:bt)-this$1.sizeInPx(local.height+"em")/2}else{var place=this$1.get("placement");var pos;if(typeof place==="function"){try{pos=place(this$1,host,local)}catch(e){pos=placeGrid(this$1,host,local)}}else if(typeof place==="string"){switch(place){case"smart":pos=placeSmart(this$1,host,local);break;default:pos=placeGrid(this$1,host,local);break}}else{pos=placeGrid(this$1,host,local)}top=pos.top;left=pos.left}if(isNaN(left)||left<0){left=10}if(isNaN(top)||top<0){top=10}wnd.set({"control.top":top,"control.left":left});ok()})})};Host.prototype.sizeInPx=function sizeInPx(size){if(!this.sizer){return parseFloat(size)*16}this.sizer.style.width=typeof size==="number"?size+"px":size;return this.sizer.clientWidth};Host.prototype.sizeInEm=function sizeInEm(size){var px=this.sizeInPx(size);return px/this.sizeInPx("1em")};Object.defineProperties(Host.prototype,prototypeAccessors);return Host}(Base);function placeGrid(host,target,node){var maxw=target.clientWidth;var maxh=target.clientHeight;var top=0,left=0;var grid1=host._grid1===undefined?host._grid1=0:host._grid1>7?host._grid1=0:++host._grid1;var width=Math.floor(maxw/3);var height=Math.floor(maxh/3);var localWidth=host.sizeInPx(node.width+"em");var localHeight=host.sizeInPx(node.height+"em");switch(grid1){case 5:case 7:case 8:top=maxh-localHeight-10;break;case 2:case 4:case 6:top=height+Math.floor((height-localHeight)/2);break;case 0:case 1:case 3:top=10;break}switch(grid1){case 3:case 6:case 8:left=maxw-localWidth-10;break;case 1:case 4:case 7:left=width+Math.floor((width-localWidth)/2);break;case 0:case 2:case 5:left=10;break}if(left+localWidth>maxw){left=maxw-localWidth-10}if(top+localHeight>maxh){top=maxh-localHeight-10}return{top:top,left:left}}function placeSmart(host,target,node){var maxw=target.clientWidth-10;var maxh=target.clientHeight-10;var i,j;var cell=16;var mh=Math.floor(maxh/cell),mw=Math.floor(maxw/cell);var grid=new Array(mh*mw);var dest=new Array(mh*mw);for(i=0;i<grid.length;i++){grid[i]=0}var win,t,l,w,h,wins=0;var windows=host.get("windows");for(var k in windows){wins++;win=windows[k];t=Math.floor(win.top/cell);l=Math.floor(win.left/cell);h=Math.ceil(host.sizeInPx(win.height+"em")/cell);w=Math.ceil(host.sizeInPx(win.width+"em")/cell);for(i=t;i<t+h&&i<mh;i++){for(j=l;j<l+w&&j<mw;j++){grid[i*mw+j]++}}}var c,ii,jj;w=Math.ceil(host.sizeInPx(node.width+"em")/cell);h=Math.ceil(host.sizeInPx(node.height+"em")/cell);for(i=0;i<mh;i++){for(j=0;j<mw;j++){if(i+h>mh||j+w>mw){c=wins*w*h}else{c=0;for(ii=0;ii<h;ii++){for(jj=0;jj<w;jj++){c+=grid[(i+ii)*mw+j+jj]}}}if(c===0){return{top:i*cell+5,left:j*cell+5}}dest[i*mw+j]=c}}c=wins*w*h;ii=0;for(i=0;i<dest.length;i++){if(dest[i]<c){c=dest[i];ii=i}}return{top:Math.floor(ii/mw)*cell+5,left:ii%mw*cell+5}}Base.extendWith(Host,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost",g:1},{n:"tracked",t:71,f:{r:[],s:'["host"]'}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-sizer",g:1},{n:"tracked",t:71,f:{r:[],s:'["sizer"]'}}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-max-top",g:1},{t:4,f:[{t:16,r:"~/_maxAttrsP"}],n:50,r:"~/_maxAttrsP"}],f:[{t:16,r:"~/_maxP",z:[{n:"window",x:{r:"~/current"}},{n:"windowControls",x:{x:{r:["@this.partials.windowControls"],s:"{t:_0}"}}},{n:"host",x:{r:"@this"}}]}]}],n:50,x:{r:["~/currentMax","~/_maxP"],s:"_0&&_1"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane",g:1},{n:"class-rwhost-blocked",t:13,f:[{t:2,r:"~/blocked"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane-content",g:1}],f:[{t:16}]}," ",{t:4,f:[{t:11,n:"window",m:[{n:"control",f:[{t:2,rx:{r:"~/windows",m:[{t:30,n:".instance.id"}]}}],t:13},{n:"root",t:13,f:[{t:2,r:"~/"}]}]}],n:52,r:"@this.children.byName.window"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-modal",g:1},{n:"tracked",t:71,f:{r:[],s:'["modalPane"]'}},{t:4,f:[{n:"class-rwhost-modal-active",t:13},{n:"style-z-index",f:[{t:2,r:"~/blocked"}],t:13}],n:50,r:"~/blocked"}]}]}," ",{t:8,r:"toast"}]}],e:{'["host"]':function(){return["host"]},'["sizer"]':function(){return["sizer"]},"{t:_0}":function(_0){return{t:_0}},"_0&&_1":function(_0,_1){return _0&&_1},'["modalPane"]':function(){return["modalPane"]},"[_0.getWindow(_1).hide()]":function(_0,_1){return[_0.getWindow(_1).hide()]},"[_0.getWindow(_1).maximize()]":function(_0,_1){return[_0.getWindow(_1).maximize()]},"!_0&&_1&&_2":function(_0,_1,_2){return!_0&&_1&&_2},"[_0.getWindow(_1).close()]":function(_0,_1){return[_0.getWindow(_1).close()]},'["top"]':function(){return["top"]},"[_0.hide()]":function(_0){return[_0.hide()]},"!_0&&_1":function(_0,_1){return!_0&&_1},"[_0.maximize()]":function(_0){return[_0.maximize()]},"[_0.close()]":function(_0){return[_0.close()]},"(_0||_1||_2)&&_3&&!_4":function(_0,_1,_2,_3,_4){return(_0||_1||_2)&&_3&&!_4},'["content"]':function(){return["content"]},"!_0":function(_0){return!_0},"[_0.call(_1)]":function(_0,_1){return[_0.call(_1)]},'["wrapper"]':function(){return["wrapper"]},"_0!==false":function(_0){return _0!==false},"_0||_1":function(_0,_1){return _0||_1},"(_0||_1||_2)&&!_3":function(_0,_1,_2,_3){return(_0||_1||_2)&&!_3},"[_0._startResize(_1)]":function(_0,_1){return[_0._startResize(_1)]},"[_0._sizeHandle(_1)]":function(_0,_1){return[_0._sizeHandle(_1)]},"[_0._startMove(_1)]":function(_0,_1){return[_0._startMove(_1)]},"!(_0===false||_1||_2||_3)&&!_4":function(_0,_1,_2,_3,_4){return!(_0===false||_1||_2||_3)&&!_4},"[_0.raise()]":function(_0){return[_0.raise()]},'["pane"]':function(){return["pane"]}},p:{title:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}],windowControls:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).hide()]"}}]}],n:50,r:"window.minimize"}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).maximize()]"}}]}],n:50,x:{r:["~/window.dialog","window.maximize","host.data.userMax"],s:"!_0&&_1&&_2"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).close()]"}}]}],n:50,r:"window.close"}]}],pane:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:51,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog"],s:"(_0||_1||_2)&&_3&&!_4"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}],window:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"(_0||_1||_2)&&!_3"}},{t:4,f:[{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/control.movable","~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"!(_0===false||_1||_2||_3)&&!_4"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]}},use:[toast(),expand()],cssId:"window-host",noIntro:true,observe:{"@style.raui.window.maxFrom":function _style_raui_window_maxFrom(){initMediaListener(this)},topLevel:function topLevel(v){if(v){this.link("windows."+escape(v),"current")}else{this.unlink("current")}},currentMax:{handler:function handler(v){(this.children.byName.window||[]).forEach(function(w){return w.instance.fire("resize")})},defer:true}},computed:{currentMax:function currentMax(){var top=this.get("topLevel");var max=this.get("windows."+escape(top)+".max");var user=this.get("userMax");return user||this.get("max")||max}},on:{config:function config(){var this$1=this;var content=this.partials.content;if(content&&Array.isArray(content)){content=this.partials.content=content.slice();var i=content.length;while(i--){var e=content[i];if(e.e==="max-top"){content.splice(i,1);this$1.set({_maxP:{t:e.f},hideTitleMax:true});if(e.m){this$1.set({_maxAttrsP:{t:e.m}})}}}}if(typeof window!=="undefined"){var tm;this._resizeListener=function(){if(tm){return}tm=setTimeout(function(){tm=null;this$1.fire("resize")},300)};window.addEventListener("resize",this._resizeListener)}},teardown:function teardown(){if(this._resizeListener){window.removeEventListener("resize",this._resizeListener)}}}});function initMediaListener(r){if(r._media){r._media.fn()}else{r._media={};r._media.fn=function(){if(!r.host){return}var max=r.sizeInPx(r.get("@style.raui.window.maxFrom"));var trans=r.transitionsEnabled;r.transitionsEnabled=false;r.set("max",r.host.clientWidth<=max);r.set("dimensions",{clientWidth:r.host.clientWidth,clientHeight:r.host.clientHeight});r.transitionsEnabled=trans};r._media.handle=r.root.on("*.resize",r._media.fn);setTimeout(r._media.fn)}}function findEvent(instance){var i=instance;while(i){if(i.event&&i.event){return i.event.event}i=i.parent}}function getEventCoords(event){var node=event.target;if(!node){return{x:0,y:0}}var rect=node.getBoundingClientRect();return{x:Math.round(rect.left+(rect.right-rect.left)/2),y:Math.round(rect.top+(rect.bottom-rect.top)/2)}}Ractive.transitions.modal=function(t,parms){var params=t.processParams(parms,{duration:400,easing:"easeOut",x:0,y:-50,event:true});var event=null;var current={x:t.node.offsetLeft,y:t.node.offsetTop};var styles;var overflow=t.node.parentNode.style?t.node.parentNode.style.overflow:"hidden";if(!event&&!t.node._modalSrc){if(t.isIntro){styles={transform:"translate(0, 0) scale(1, 1)",opacity:1};t.setStyle({transform:"translate("+params.x+"px, "+params.y+"px) scale(0.5, 0.5)",opacity:0})}else{styles={transform:"translate("+params.x+"px, "+params.y+"px) scale(0.5, 0.5)",opacity:0}}}else{var click=t.node._modalSrc||(event?getEventCoords(event):{x:current.x+params.x,y:current.y+params.y});var target={x:click.x-Math.round(t.node.clientWidth/2)-current.x,y:click.y-Math.round(t.node.clientHeight/2)-current.y};if(t.node.parentNode.style){t.node.parentNode.style.overflow="hidden"}if(t.isIntro){t.node._modalSrc=click;styles={transform:"translate(0, 0) scale(1, 1)",opacity:1};t.setStyle({transform:"translate("+target.x+"px, "+target.y+"px) scale(0.5, 0.5)",opacity:0})}else{styles={transform:"translate("+target.x+"px, "+target.y+"px) scale(0.5, 0.5)",opacity:0}}}t.animateStyle(styles,params).then(function(){if(t.node.parentNode.style){t.node.parentNode.style.overflow=overflow}t.complete()})};var moveEvents=["mousemove","mouseup","touchmove","touchend"];var handleSize=7;export var Window=function(Base){function Window(opts){Base.call(this,opts)}if(Base)Window.__proto__=Base;Window.prototype=Object.create(Base&&Base.prototype);Window.prototype.constructor=Window;var prototypeAccessors$1={resizable:{configurable:true},title:{configurable:true},visible:{configurable:true},pad:{configurable:true},buttons:{configurable:true},blocked:{configurable:true},result:{configurable:true}};prototypeAccessors$1.resizable.get=function(){return this.get("control.resizable")};prototypeAccessors$1.resizable.set=function(v){return this.set("control.resizable",v)};prototypeAccessors$1.title.get=function(){return this.get("control.title")};prototypeAccessors$1.title.set=function(v){return this.set("control.title",v)};prototypeAccessors$1.visible.get=function(){return this.get("control.show")};prototypeAccessors$1.visible.set=function(v){if(v){this.show()}else{this.set("control.show",v,{keep:true})}this.host.raise(this,{show:v})};prototypeAccessors$1.pad.get=function(){return this.get("pad")};prototypeAccessors$1.pad.set=function(v){this.set("pad",v)};prototypeAccessors$1.buttons.get=function(){return this.get("buttons")};prototypeAccessors$1.buttons.set=function(v){return this.set("buttons",v)};prototypeAccessors$1.blocked.get=function(){return this.get("control.blocked")};prototypeAccessors$1.blocked.set=function(v){return this.set("control.blocked",v)};prototypeAccessors$1.result.get=function(){var this$1=this;if(!this._result){this._result={};this._result.promise=new Promise(function(ok){this$1._result.ok=ok})}return this._result.promise};Window.prototype.setResult=function setResult(v){this.result;this._result.value=v};Window.prototype.close=function close(force,result){if(force!==true){if(!this.parent){return false}if(this.get("control.blockers.length")){return false}if(typeof this.beforeClose==="function"&&this.beforeClose()===false){return false}if(this.fire("beforeClose")===false){return false}}this.fire("close");if(this._result){this._result.ok(this._result.value||result)}return true};Window.prototype.maximize=function maximize(){this.toggle("root.userMax")};Window.prototype.hide=function hide(){this.visible=false};Window.prototype.raise=function raise(show){this.host.raise(this,{show:show})};Window.prototype.show=function show(){this.set("control.show",true);if(this.get("control.top")===undefined){this.host.place(this)}};Window.prototype.size=function size(w,h){var this$1=this;return new Promise(function(ok){requestAnimationFrame(function(){if(!this$1.visible){if(typeof w==="number"&&typeof h==="number"){this$1.set({"control.width":this$1.host.sizeInEm(w),"control.height":this$1.host.sizeInEm(h),"control.naturalWidth":this$1.host.sizeInEm(w),"control.naturalHeight":this$1.host.sizeInEm(h),"control.autosize":false})}return}var el=this$1.wrapper;if(!el){return}if(w==="auto"){this$1.set("control.autosize",true);var nw=this$1.host.sizeInEm(el.clientWidth+16);var nh=this$1.host.sizeInEm(el.clientHeight);this$1.set({"control.width":nw,"control.height":nh,"control.naturalWidth":nw,"control.naturalHeight":nh,"control.autosize":false})}else if(typeof w==="number"&&typeof h==="number"){this$1.set({"control.width":this$1.host.sizeInEm(w),"control.height":this$1.host.sizeInEm(h),"control.naturalWidth":this$1.host.sizeInEm(w),"control.naturalHeight":this$1.host.sizeInEm(h),"control.autosize":false})}else if(typeof w==="string"&&typeof h==="string"){var ow=el.style.width;var oh=el.style.height;el.style.width=w;el.style.height=h;var nw$1=el.clientWidth;var nh$1=el.clientHeight;el.style.width=ow;el.style.height=oh;this$1.set({"control.width":this$1.host.sizeInEm(nw$1),"control.height":this$1.host.sizeInEm(nh$1),"control.naturalWidth":this$1.host.sizeInEm(nw$1),"control.naturalHeight":this$1.host.sizeInEm(nh$1),"control.autosize":false})}this$1.fire("resize");ok()})})};Window.prototype.move=function move(top,left){var this$1=this;return new Promise(function(ok){requestAnimationFrame(function(){if(top==="center"){top=this$1.host.modalPane.clientHeight/2-this$1.wrapper.clientHeight/2}else if(typeof top==="string"){top=this$1.host.sizeInEm(top)}if(left==="center"){left=this$1.host.modalPane.clientWidth/2-this$1.wrapper.clientWidth/2}if(typeof left==="string"){left=this$1.host.sizeInEm(left)}var set={};if(typeof top==="number"){set["control.top"]=top}if(typeof left==="number"){set["control.left"]=left}this$1.set(set);ok()})})};Window.prototype._startMove=function _startMove(event){var this$1=this;if(event.type==="mousedown"&&event.button!==0){return}if(!this.get("control.topmost")){this.raise()}if(~event.type.indexOf("mouse")){if(!event.ctrlKey&&event.target!==this.content&&event.target!==this.top&&!this.top.contains(event.target)){return}}else{if(event.targetTouches&&event.targetTouches.length===1&&event.target!==this.content&&event.target!==this.top&&!this.top.contains(event.target)){return}}var wnd=this.pane;var cursor=wnd.style.cursor;wnd.style.cursor="move";wnd.style.userSelect="none";var sx=event.x||event.clientX||event.targetTouches&&event.targetTouches[0].clientX||0;var sy=event.y||event.clientY||event.targetTouches&&event.targetTouches[0].clientY||0;var ox=this.get("control.left")||0;var oy=this.get("control.top")||0;var ow=wnd.clientWidth;var oh=wnd.clientHeight;var _move=function(ev){var x=ev.x||ev.clientX||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientX||ev.changedTouches&&ev.changedTouches[0].clientX||0;var y=ev.y||ev.clientY||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientY||ev.changedTouches&&ev.changedTouches[0].clientY||0;var nx=ox+(x-sx);var ny=oy+(y-sy);if(nx<(ow<30?0:30-ow)){nx=ow<30?0:30-ow}if(ny<(oh<30?0:30-oh)){ny=oh<30?0:30-oh}if(nx<0){nx=0}if(ny<0){ny=0}this$1.set({"control.top":ny,"control.left":nx});if(ev.type==="touchend"||ev.type==="mouseup"){moveEvents.forEach(function(e){return document.removeEventListener(e,_move,{passive:false})});wnd.style.cursor=cursor;wnd.style.userSelect=""}else{ev.preventDefault()}};moveEvents.forEach(function(e){return document.addEventListener(e,_move,{passive:false})});if(event.type.indexOf("mouse")===0){return false}};Window.prototype._startResize=function _startResize(event){var this$1=this;if(event.target!==this.wrapper){return}if(event.type==="mousedown"&&event.button!==0){return}if(this.get("control.autosize")){this.size("auto")}if(!this.get("control.topmost")){this.raise()}this.set("control.resizing",true);var el=this.wrapper;var ix=event.offsetX||event.targetTouches&&event.targetTouches[0].pageX-el.getBoundingClientRect().left;var iy=event.offsetY||event.targetTouches&&event.targetTouches[0].pageY-el.getBoundingClientRect().top;var size=this.get("@style.window.handleSize")||handleSize;var right=el.clientWidth-size*2,bottom=el.clientHeight-size*2;var min=2*size;var l=ix<=min||ix>=right;var t=iy<=min||iy>=bottom;var sx=event.x||event.clientX||event.targetTouches&&event.targetTouches[0].clientX||0;var sy=event.y||event.clientY||event.targetTouches&&event.targetTouches[0].clientY||0;var ox=this.get("control.left")||0;var oy=this.get("control.top")||0;var ow=this.host.sizeInPx(this.get("control.width")+"em");var oh=this.host.sizeInPx(this.get("control.height")+"em");var nh=this.host.sizeInPx(this.get("control.naturalHeight")+"em");var nw=this.host.sizeInPx(this.get("control.naturalWidth")+"em");var tm;var _resize=function(ev){ev.preventDefault();var x=ev.x||ev.clientX||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientX||ev.changedTouches&&ev.changedTouches[0].clientX||0;var y=ev.y||ev.clientY||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientY||ev.changedTouches&&ev.changedTouches[0].clientY||0;var dx=l?x-sx:0;var dy=t?y-sy:0;var set={};if(iy<=size){set["control.top"]=oy+dy;set["control.height"]=oh-dy}else{set["control.height"]=oh+dy}if(ix<=size){set["control.left"]=ox+dx;set["control.width"]=ow-dx}else{set["control.width"]=ow+dx}if(set["control.width"]<nw){delete set["control.width"];delete set["control.left"]}if(set["control.height"]<nh){delete set["control.height"];delete set["control.top"]}if(set["control.left"]<0){set["control.left"]=0}if(set["control.top"]<0){set["control.top"]=0}if(set["control.width"]){set["control.width"]=this$1.host.sizeInEm(set["control.width"])}if(set["control.height"]){set["control.height"]=this$1.host.sizeInEm(set["control.height"])}this$1.set(set);if(ev.type==="touchend"||ev.type==="mouseup"){moveEvents.forEach(function(e){return document.removeEventListener(e,_resize,{passive:false})});this$1.set("control.resizing",false);if(ow!==this$1.get("control.width")||oh!==this$1.get("control.height")){if(tm){clearTimeout(tm)}tm=null;this$1.fire("resize")}}else{if(!tm){tm=setTimeout(function(){this$1.fire("resize");tm=null},200)}}};moveEvents.forEach(function(e){return document.addEventListener(e,_resize,{passive:false})});return false};Window.prototype._sizeHandle=function _sizeHandle(event){if(event.target!==this.wrapper){return}var el=this.wrapper;if(event.type==="mouseout"){return el.style.cursor="auto"}var x=event.offsetX,y=event.offsetY;var size=this.get("@style.window.handleSize")||handleSize;var right=el.clientWidth-size,bottom=el.clientHeight-size;var style=el.style;if(x<=size+size&&y<=size+size||x>=right-size&&y>=bottom-size){style.cursor="nwse-resize"}else if(x>=right-size&&y<=size+size||x<=size+size&&y>=bottom-size){style.cursor="nesw-resize"}else if((x<=size||x>=right)&&(y<bottom||y>size)){style.cursor="ew-resize"}else if((y<=size||y>=bottom)&&(x<right||x>size)){style.cursor="ns-resize"}else{style.cursor="auto"}};Object.defineProperties(Window.prototype,prototypeAccessors$1);return Window}(Base);var buttonAttrs=["left","right","center","condition"];Base.extendWith(Window,{template:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"(_0||_1||_2)&&!_3"}},{t:4,f:[{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/control.movable","~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"!(_0===false||_1||_2||_3)&&!_4"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]},cssId:"window",partials:{pane:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:51,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog"],s:"(_0||_1||_2)&&_3&&!_4"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}]}.t,title:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}]}.t,contents:{v:4,t:""}.t,status:{v:4,t:""}.t},data:function data(){return{buttons:[],visibleButtons:0}},computed:{leftButtons:function leftButtons(){return(this.get("buttons")||[]).filter(function(b){return b.where==="left"})},centerButtons:function centerButtons(){return(this.get("buttons")||[]).filter(function(b){return b.where==="center"})},rightButtons:function rightButtons(){return(this.get("buttons")||[]).filter(function(b){return!b.where||b.where==="right"})}},decorators:{button:function button(node){var ctx=this.getContext(node);ctx.add("visibleButtons");return{update:function update(){},teardown:function teardown(){ctx.subtract("visibleButtons")}}}},on:{config:function config(){var parent=Window.prototype.template;var child=this.template;if(typeof parent!=="string"&&!Array.isArray(parent)&&parent.t){parent=parent.t}if(typeof child!=="string"&&!Array.isArray(child)&&child.t){child=child.t}if(parent!==child){if(!this.partials.hasOwnProperty("contents")){this.partials.contents=child}this.template=parent}},construct:function construct(){var wnd=this.constructor;if(!wnd._constructed){wnd._constructed=1;var tpl=wnd.prototype.template.t.slice();var btns=tpl.find(function(e){return e.e==="buttons"});wnd.prototype.template.t=tpl.filter(function(e){return e.e!=="buttons"});function mapButton(b){var attrs=b.m||[];var res={partial:{t:[{t:b.t,e:b.e,f:b.f,m:attrs.filter(function(a){return!~buttonAttrs.indexOf(a.n)})}]},where:attrs.find(function(a){return a.n==="left"})?"left":attrs.find(function(a){return a.n==="center"})?"center":"right"};res.partial.t[0].m.push({t:71,n:"button"});return res}if(btns){wnd._btns=btns.f.filter(function(e){return e.e==="button"||e.t===4&&(e.n===50||e.n===51)&&e.f.find(function(e){return e.e==="button"})}).map(function(n){if(n.t===4){return n.f.filter(function(e){return e.e==="button"}).map(function(bb){var b=mapButton(bb);var f={t:n.t,n:n.n,f:[b.partial.t[0]]};if(n.r){f.r=n.r}if(n.rx){f.rx=n.rx}if(n.x){f.x=n.x}b.partial={t:[f]};return b})}else{var b=mapButton(n);return[b]}}).reduce(function(a,c){return a.concat(c)},[])}}},init:function init(){var wnd=this.constructor;if(wnd._btns&&!this.get("buttons.length")){this.set("buttons",wnd._btns)}}},observe:{"control.max root.max root.userMax control.width control.height root.dimensions.clientHeight root.dimensions.clientWidth":{handler:function handler(v,o,k){if(!this.get("control.id")){return}var max=this.get("control.max")||this.get("root.userMax")||this.get("root.max");var actual=this.get("control.actual")||{};if(max){if(!actual.max){var root=this.wrapper;if(this.wrapper){this.set("control.actual",{width:this.host.sizeInEm(this.wrapper.clientWidth),height:this.host.sizeInEm(this.wrapper.clientHeight),max:max})}}else if(~k.indexOf("client")&&typeof v==="number"){if(~k.indexOf("Width")){this.set("control.actual.width",this.host.sizeInEm(v))}else if(~k.indexOf("Height")){this.set("control.actual.height",this.host.sizeInEm(v))}}}else{if(typeof v==="number"){if(~k.indexOf("width")){this.set("control.actual.width",v)}else if(~k.indexOf("height")){this.set("control.actual.height",v)}}if(actual.max){this.set("control.actual",{width:this.get("control.width"),height:this.get("control.width"),max:max})}this.set("control.actual.max",false)}},init:false,defer:true}}});export function plugin(opts){if(opts===void 0)opts={};return function(ref){var instance=ref.instance;instance.components[opts.name||"host"]=Host}}globalRegister("RMWindowHost","components",Host);globalRegister("RMWindow","components",Window);Host.prototype.Window=Window;export default plugin;
import Ractive from"ractive";import expand from"./transition-expand";import toast from"./Toast";import globalRegister from"./globalRegister";var escape=Ractive.escapeKey;var windowTrans;export var Base=function(Ractive){function Base(opts){Ractive.call(this,opts)}if(Ractive)Base.__proto__=Ractive;Base.prototype=Object.create(Ractive&&Ractive.prototype);Base.prototype.constructor=Base;return Base}(Ractive);Ractive.extendWith(Base,{css:function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.window.primary"));primary.action=Object.assign({},data("raui.window.action"),data("raui.window.primary.action"));primary.host=Object.assign({},data("raui.window.host"),data("raui.window.primary.host"));primary.title=Object.assign({inactive:{}},data("raui.window.title"),data("raui.window.primary.title"));return"\n .rwhost {\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n \n .rwhost-sizer {\n position: absolute;\n }\n \n .rwhost-pane {\n display: flex;\n position: relative;\n width: 100%;\n box-sizing: border-box;\n flex-grow: 2;\n overflow: auto;\n background-color: "+(primary.host.bg||primary.bg||"#fff")+";\n z-index: 1;\n }\n .rwhost-pane.blocked {\n overflow: hidden;\n }\n \n .rwhost-pane-content {\n flex-grow: 1;\n }\n \n .rwhost-modal {\n position: absolute;\n position: --webkit-sticky;\n position: sticky;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: -1;\n opacity: 0;\n transition: opacity 0.2s ease-in-out, z-index 0s linear 0.2s;\n background-color: #000;\n }\n .rwhost-modal-active {\n opacity: 0.5;\n z-index: 1;\n transition: opacity 0.2s ease-in-out, z-index 0s linear;\n }\n \n .rwindow-wrapper {\n display: inline-block;\n box-sizing: border-box;\n position: absolute;\n }\n .rwindow-wrapper.rwindow-resizing {\n transition: none;\n }\n \n .rwindow-wrapper.rwindow-resizable {\n padding: "+(primary.handleSize||7)+"px;\n }\n \n .rwindow-topmost > .rwindow {\n box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 3px 5px -1px rgba(0, 0, 0, 0.3);\n opacity: 1;\n }\n \n .rwindow-modal {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: rgba(0, 0, 0, 0.5);\n opacity: 0;\n z-index: -1;\n transition: opacity 0.4s ease-in-out, z-index 0s linear 0.4s;\n }\n .rwindow-modal.rwindow-blocked {\n opacity: 1;\n z-index: 50;\n transition: opacity 0.4s ease-in-out, z-index 0s linear;\n }\n \n .rwindow {\n position: relative;\n box-sizing: border-box;\n background-color: "+(primary.bg||"#fff")+";\n color: "+(primary.fg||"#222")+";\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n overflow: hidden;\n width: 100%;\n height: 100%;\n min-width: "+(primary.minWidth||"6em")+";\n min-height: "+(primary.minHeight||"6em")+";\n transition: box-shadow 0.4s ease-in-out, opacity 0.4s ease-in-out;\n }\n .rwindow-max > .rwindow {\n border-radius: 0;\n box-shadow: none;\n }\n \n .rwindow-pane-top,\n .rwindow-max-top {\n background-color: "+(primary.title.inactive.bg||primary.fg||"#222")+";\n color: "+(primary.title.inactive.fg||primary.bg||"#fff")+";\n flex-shrink: 0;\n }\n \n .rwindow-max-top {\n flex-shrink: 2;\n }\n \n .rwindow-pane-top {\n display: flex;\n align-items: center;\n }\n \n .rwindow-topmost .rwindow-pane-top {\n background-color: "+(primary.title.bg||primary.fga||"#07e")+";\n color: "+(primary.title.fg||primary.bg||"#fff")+";\n }\n \n .rwindow-pane {\n display: flex;\n flex-direction: column;\n table-layout: fixed;\n width: 100%;\n height: 100%;\n }\n .rwindow-autosizing {\n display: block;\n box-sizing: border-box;\n }\n .rwindow-content {\n overflow: auto;\n flex-grow: 2;\n position: relative;\n box-sizing: border-box;\n }\n .rwindow-content.rwindow-pad {\n padding: 1em;\n }\n .rwindow-content.rwindow-flex {\n display: flex;\n flex-direction: column;\n }\n \n .rwindow-buttons {\n display: flex;\n flex-shrink: 0;\n padding: 0.5em;\n border-top: 1px solid "+(primary.action.bc||primary.bc||"#ccc")+";\n background-color: "+(primary.action.bg||primary.bg||"#fff")+";\n color: "+(primary.action.fg||primary.fg||"#222")+";\n }\n .rwindow-buttons.no-buttons {\n display: none;\n }\n .rwindow-left-buttons {\n text-align: left;\n flex-grow: 2;\n }\n .rwindow-left-buttons button {\n margin-right: 0.5em;\n }\n .rwindow-center-buttons {\n text-align: center;\n flex-shrink: 2;\n }\n .rwindow-center-buttons button {\n margin: 0 0.25em;\n }\n .rwindow-right-buttons {\n text-align: right;\n flex-grow: 2;\n }\n .rwindow-right-buttons button {\n margin-left: 0.5em;\n }\n \n .rwindow-title {\n overflow: hidden;\n text-overflow: ellipsis;\n padding: 0.5em;\n white-space: nowrap;\n box-sizing: border-box;\n flex-grow: 1;\n }\n \n .rwindow-controls {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n flex-grow: 1;\n }\n .rwindow-controls > div {\n margin: 0 1em 0 0;\n width: 0.7em;\n height: 0.7em;\n cursor: pointer;\n }\n .rwindow-minimize {\n border-bottom: 2px solid;\n }\n .rwindow-maximize {\n border: 2px solid;\n }\n .rwindow-controls > .rwindow-close {\n width: 0.5em;\n height: 1em;\n border-right: 2px solid;\n transform: rotate(45deg);\n transform-origin: center right;\n position: relative;\n margin-right: 1.5em;\n }\n .rwindow-close:before {\n cursor: pointer;\n height: 1.2em;\n width: 1.2em;\n top: 0.3em;\n left: 0.1em;\n content: ' ';\n transform: rotate(-45deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-close:after {\n cursor: pointer;\n height: 100%;\n width: 100%;\n top: 1px;\n left: calc(100% + 1px);\n content: ' ';\n border-left: 2px solid;\n transform: rotate(-90deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-max-top .rwindow-controls > .rwindow-close {\n margin-right: 0.5em;\n }\n "+(typeof data("raui.window.extra")==="function"?data("raui.window.extra").call(this,data):"")+"\n "}.call(this,data)].join(" ")},cssId:"rwindow",noCssTransform:true,delegate:false,decorators:{tracked:function tracked(node,id){this[id]=node;return{teardown:function teardown(){if(this[id]===node){this[id]=null}}}}},transitions:{window:function window(t,params){if(windowTrans){return t.complete()}windowTrans=t;var p=t.processParams(params,{duration:400,easing:"easeInOut"});var parent=t.node.parentNode;var overflow=parent.style?parent.style.overflow:"";if(parent.style){parent.style.overflow="hidden"}if(t.isIntro||p.intro){t.setStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0});setTimeout(function(){t.animateStyle({transform:"none",opacity:1},p).then(function(){t.setStyle("opacity",1);windowTrans=false;t.complete();if(parent.style){parent.style.overflow=overflow}})})}else{t.setStyle({transform:"none",opacity:1});t.animateStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0},p).then(function(){windowTrans=false;t.complete();if(parent.style){parent.style.overflow=overflow}})}}}});var id=0;export var Host=function(Base){function Host(opts){Base.call(this,opts);this.defaults={}}if(Base)Host.__proto__=Base;Host.prototype=Object.create(Base&&Base.prototype);Host.prototype.constructor=Host;var prototypeAccessors={current:{configurable:true},currentId:{configurable:true},placement:{configurable:true},topmost:{configurable:true},windows:{configurable:true}};prototypeAccessors.current.get=function(){var top=this.get("topLevel");return this.getWindow(this.get("windows")[top].id)};prototypeAccessors.currentId.get=function(){var top=this.get("topLevel");return this.get("windows."+escape(top)+".id")};prototypeAccessors.placement.get=function(){return this.get("placement")};prototypeAccessors.placement.set=function(v){return this.set("placement",v)};prototypeAccessors.topmost.get=function(){var windows=this.get("windows");for(var k in windows){if(windows[k].topmost){return this.getWindow(windows[k].id)}}};prototypeAccessors.windows.get=function(){return Object.keys(this.get("windows"))};Host.prototype.addWindow=function addWindow(window,opts){var this$1=this;var options=Object.assign({},this.defaults,window.constructor.prototype.options,window.options,window.get("options"),opts);if(!(window instanceof Window)){throw new Error("Windows must be instances of Window")}if(!window.id){window.set("@.id",options.id||"window"+id++)}if(!this.get("windows."+escape(window.id))){this.set("windows."+escape(window.id),Object.assign({show:options.show!==false,autosize:true,id:window.id,blockers:[],close:true,minimize:true,maximize:true},options,{id:window.id}))}window.host=this;var promise=this.attachChild(window,{target:"window"});var parent;if(options.block){parent=options.block.id||options.block;if(typeof parent==="string"&&parent in this.get("windows")){this.push("windows."+escape(parent)+".blockers",window.id);window.set("control.blocking",parent)}else{parent=false}}if(options.size==="fill"&&(parent||options.block)){var wnd;if(options.block===true){wnd=this.find(".rwhost-pane")}else if(wnd=this.getWindow(parent)){wnd=wnd.find(".rwindow")}if(wnd){window.size(wnd.clientWidth-(options.fillPad||20),wnd.clientHeight-(options.fillPad||20));if(options.block&&!(options.top||options.left)){options.top=options.left=Math.floor((options.fillPad||20)/2)}}}else if(options.width&&options.height){window.size(options.width,options.height)}else{window.size("auto")}if(options.top&&options.left){window.move(options.top,options.left)}else{this.place(window)}this.raise(window,{show:options.show!==false,parent:options.stickToParent});window.on("close",function(){var blocking=window.get("control.blocking");if(blocking){var blockers=this$1.windowGet(blocking,"blockers");this$1.splice("windows."+escape(blocking)+".blockers",blockers.indexOf(window.id),1)}this$1.detachChild(window).then(function(){return window.teardown()});this$1.set("windows."+escape(window.id)+".block",false);this$1.set("windows."+escape(window.id)+".index",-1);this$1.raise();this$1.set("windows."+escape(window.id),undefined);delete this$1.get("windows")[window.id]});this.update("windows."+escape(window.id)+".id",{force:true});return promise.then(function(){return window})};Host.prototype.getWindow=function getWindow(id){return this.children.byName.window&&this.children.byName.window.filter(function(w){return w.instance.id===id}).map(function(w){return w.instance})[0]};Host.prototype.windowGet=function windowGet(id,path){return this.get("windows."+escape(id)+"."+path)};Host.prototype.windowSet=function windowSet(id,path,val){return this.set("windows."+escape(id)+"."+path,val)};Host.prototype.raise=function raise(window,opts){var this$1=this;if(opts===void 0)opts={};var wnd=window instanceof Window?window:this.children.byName.window.filter(function(a){return a.instance.id===window}).map(function(a){return a.instance})[0];var object=this.get("windows");var host=this;var wnds=Object.keys(object).map(function(k){return object[k]});var top=wnds.length+1;var last=this.get("topLevel");var wasBlocked=this.get("blocked");function blocks(id){var bs=host.get("windows."+escape(id)+".blockers");if(!bs){return}bs.forEach(function(b){host.add("windows."+escape(b)+".index",top++);blocks(b)})}if(wnd){if(opts.parent!==false&&wnd.get("control.blocking")){var blocking=wnd.get("control.blocking");top=this.get("windows."+blocking+".index")||0+(this.get("windows."+blocking+".blockers.length")||0);wnds.forEach(function(w){if(w.index>top){w.index++}});top++}wnd.set("control.index",opts.show===false?-1:top++);if(opts.show!==false&&!wnd.visible){wnd.show()}blocks(wnd.id)}wnds.filter(function(w){return w.show!==false&&w.block===true}).forEach(function(w){this$1.set("windows."+escape(w.id)+".index",(w.index||0)+top);blocks(w.id)});var ordered=wnds.sort(function(l,r){return!l.show?-1:!r.show?1:l.index<r.index?-1:1});var visible=ordered.filter(function(w){return w.show});top=ordered.indexOf(visible[visible.length-1]);var sets={};var modalIdx=null;ordered.forEach(function(w,i){var key=escape(w.id);if(w.block===true&&modalIdx===null){modalIdx=i}sets["windows."+key+".index"]=modalIdx!==null?i+2:i;sets["windows."+key+".topmost"]=i===top;sets["windows."+key+".stack"]=ordered.length-i});if(modalIdx!==null){sets.blocked=modalIdx+1}else{sets.blocked=0}if(~top&&ordered.length){sets.topLevel=ordered[top].id}else{sets.topLevel=null}this.set(sets);top=sets.topLevel;if(top&&top!==last&&this.get("currentMax")&&this.rendered){var leaving=this.get("windows."+escape(last));wnd=this.getWindow(top);var transition=this.get("transition");if(transition!==false&&(!leaving||!leaving.dialog||leaving.blocking&&leaving.blocking!==top)){wnd.transition(transition||"window",wnd.find("div"),{intro:true})}}};Host.prototype.place=function place(wnd){var this$1=this;if(!wnd.get("control.show")){return Promise.resolve()}return new Promise(function(ok){requestAnimationFrame(function(){var local=wnd.get("control");if(local.width===undefined){wnd.size("auto")}var left=0;var top=0;if(!(this$1.fragment&&this$1.fragment.rendered)){return}var host=this$1.find(".rwhost");var maxw=host.clientWidth;var maxh=host.clientHeight;var blocking=local.blocking;if(blocking){var key="windows."+escape(blocking);var blocked=this$1.get(key);var max=local.max||!local.dialog&&(this$1.get("max")||this$1.get("userMax"));var bmax=blocked.max||this$1.get("userMax")||this$1.get("max");var bw=bmax?this$1.host.clientWidth:this$1.sizeInPx(blocked.width+"em");var bh=bmax?this$1.host.clientHeight:this$1.sizeInPx(blocked.height+"em");var bl=bmax?0:blocked.left;var bt=bmax?0:blocked.top;left=(max?maxw:bw/2)+(max?0:bl)-this$1.sizeInPx(local.width+"em")/2;top=(max?maxh:bh/2)+(max?0:bt)-this$1.sizeInPx(local.height+"em")/2}else{var place=this$1.get("placement");var pos;if(typeof place==="function"){try{pos=place(this$1,host,local)}catch(e){pos=placeGrid(this$1,host,local)}}else if(typeof place==="string"){switch(place){case"smart":pos=placeSmart(this$1,host,local);break;default:pos=placeGrid(this$1,host,local);break}}else{pos=placeGrid(this$1,host,local)}top=pos.top;left=pos.left}if(isNaN(left)||left<0){left=10}if(isNaN(top)||top<0){top=10}wnd.set({"control.top":top,"control.left":left});ok()})})};Host.prototype.sizeInPx=function sizeInPx(size){if(!this.sizer){return parseFloat(size)*16}this.sizer.style.width=typeof size==="number"?size+"px":size;return this.sizer.clientWidth};Host.prototype.sizeInEm=function sizeInEm(size){var px=this.sizeInPx(size);return px/this.sizeInPx("1em")};Object.defineProperties(Host.prototype,prototypeAccessors);return Host}(Base);function placeGrid(host,target,node){var maxw=target.clientWidth;var maxh=target.clientHeight;var top=0,left=0;var grid1=host._grid1===undefined?host._grid1=0:host._grid1>7?host._grid1=0:++host._grid1;var width=Math.floor(maxw/3);var height=Math.floor(maxh/3);var localWidth=host.sizeInPx(node.width+"em");var localHeight=host.sizeInPx(node.height+"em");switch(grid1){case 5:case 7:case 8:top=maxh-localHeight-10;break;case 2:case 4:case 6:top=height+Math.floor((height-localHeight)/2);break;case 0:case 1:case 3:top=10;break}switch(grid1){case 3:case 6:case 8:left=maxw-localWidth-10;break;case 1:case 4:case 7:left=width+Math.floor((width-localWidth)/2);break;case 0:case 2:case 5:left=10;break}if(left+localWidth>maxw){left=maxw-localWidth-10}if(top+localHeight>maxh){top=maxh-localHeight-10}return{top:top,left:left}}function placeSmart(host,target,node){var maxw=target.clientWidth-10;var maxh=target.clientHeight-10;var i,j;var cell=16;var mh=Math.floor(maxh/cell),mw=Math.floor(maxw/cell);var grid=new Array(mh*mw);var dest=new Array(mh*mw);for(i=0;i<grid.length;i++){grid[i]=0}var win,t,l,w,h,wins=0;var windows=host.get("windows");for(var k in windows){wins++;win=windows[k];t=Math.floor(win.top/cell);l=Math.floor(win.left/cell);h=Math.ceil(host.sizeInPx(win.height+"em")/cell);w=Math.ceil(host.sizeInPx(win.width+"em")/cell);for(i=t;i<t+h&&i<mh;i++){for(j=l;j<l+w&&j<mw;j++){grid[i*mw+j]++}}}var c,ii,jj;w=Math.ceil(host.sizeInPx(node.width+"em")/cell);h=Math.ceil(host.sizeInPx(node.height+"em")/cell);for(i=0;i<mh;i++){for(j=0;j<mw;j++){if(i+h>mh||j+w>mw){c=wins*w*h}else{c=0;for(ii=0;ii<h;ii++){for(jj=0;jj<w;jj++){c+=grid[(i+ii)*mw+j+jj]}}}if(c===0){return{top:i*cell+5,left:j*cell+5}}dest[i*mw+j]=c}}c=wins*w*h;ii=0;for(i=0;i<dest.length;i++){if(dest[i]<c){c=dest[i];ii=i}}return{top:Math.floor(ii/mw)*cell+5,left:ii%mw*cell+5}}Base.extendWith(Host,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost",g:1},{n:"tracked",t:71,f:{r:[],s:'["host"]'}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-sizer",g:1},{n:"tracked",t:71,f:{r:[],s:'["sizer"]'}}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-max-top",g:1},{t:4,f:[{t:16,r:"~/_maxAttrsP"}],n:50,r:"~/_maxAttrsP"}],f:[{t:16,r:"~/_maxP",z:[{n:"window",x:{r:"~/current"}},{n:"windowControls",x:{x:{r:["@this.partials.windowControls"],s:"{t:_0}"}}},{n:"host",x:{r:"@this"}}]}]}],n:50,x:{r:["~/currentMax","~/_maxP"],s:"_0&&_1"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane",g:1},{n:"class-rwhost-blocked",t:13,f:[{t:2,r:"~/blocked"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane-content",g:1}],f:[{t:16}]}," ",{t:4,f:[{t:11,n:"window",m:[{n:"control",f:[{t:2,rx:{r:"~/windows",m:[{t:30,n:".instance.id"}]}}],t:13},{n:"root",t:13,f:[{t:2,r:"~/"}]}]}],n:52,r:"@this.children.byName.window"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-modal",g:1},{n:"tracked",t:71,f:{r:[],s:'["modalPane"]'}},{t:4,f:[{n:"class-rwhost-modal-active",t:13},{n:"style-z-index",f:[{t:2,r:"~/blocked"}],t:13}],n:50,r:"~/blocked"}]}]}," ",{t:8,r:"toast"}]}],e:{'["host"]':function(){return["host"]},'["sizer"]':function(){return["sizer"]},"{t:_0}":function(_0){return{t:_0}},"_0&&_1":function(_0,_1){return _0&&_1},'["modalPane"]':function(){return["modalPane"]},"[_0.getWindow(_1).hide()]":function(_0,_1){return[_0.getWindow(_1).hide()]},"[_0.getWindow(_1).maximize()]":function(_0,_1){return[_0.getWindow(_1).maximize()]},"!_0&&_1&&_2":function(_0,_1,_2){return!_0&&_1&&_2},"[_0.getWindow(_1).close()]":function(_0,_1){return[_0.getWindow(_1).close()]},'["top"]':function(){return["top"]},"[_0.hide()]":function(_0){return[_0.hide()]},"!_0&&_1":function(_0,_1){return!_0&&_1},"[_0.maximize()]":function(_0){return[_0.maximize()]},"[_0.close()]":function(_0){return[_0.close()]},"(_0||_1||_2)&&_3&&!_4":function(_0,_1,_2,_3,_4){return(_0||_1||_2)&&_3&&!_4},'["content"]':function(){return["content"]},"!_0":function(_0){return!_0},"[_0.call(_1)]":function(_0,_1){return[_0.call(_1)]},'["wrapper"]':function(){return["wrapper"]},"_0!==false":function(_0){return _0!==false},"_0||_1":function(_0,_1){return _0||_1},"(_0||_1||_2)&&!_3":function(_0,_1,_2,_3){return(_0||_1||_2)&&!_3},"[_0._startResize(_1)]":function(_0,_1){return[_0._startResize(_1)]},"[_0._sizeHandle(_1)]":function(_0,_1){return[_0._sizeHandle(_1)]},"[_0._startMove(_1)]":function(_0,_1){return[_0._startMove(_1)]},"!(_0===false||_1||_2||_3)&&!_4":function(_0,_1,_2,_3,_4){return!(_0===false||_1||_2||_3)&&!_4},"[_0.raise()]":function(_0){return[_0.raise()]},'["pane"]':function(){return["pane"]}},p:{title:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}],windowControls:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).hide()]"}}]}],n:50,r:"window.minimize"}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).maximize()]"}}]}],n:50,x:{r:["~/window.dialog","window.maximize","host.data.userMax"],s:"!_0&&_1&&_2"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).close()]"}}]}],n:50,r:"window.close"}]}],pane:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:51,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog"],s:"(_0||_1||_2)&&_3&&!_4"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}],window:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"(_0||_1||_2)&&!_3"}},{t:4,f:[{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/control.movable","~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"!(_0===false||_1||_2||_3)&&!_4"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]}},use:[toast(),expand()],cssId:"window-host",noIntro:true,observe:{"@style.raui.window.maxFrom":function _style_raui_window_maxFrom(){initMediaListener(this)},topLevel:function topLevel(v){if(v){this.link("windows."+escape(v),"current")}else{this.unlink("current")}},currentMax:{handler:function handler(v){(this.children.byName.window||[]).forEach(function(w){return w.instance.fire("resize")})},defer:true}},computed:{currentMax:function currentMax(){var top=this.get("topLevel");var max=this.get("windows."+escape(top)+".max");var user=this.get("userMax");return user||this.get("max")||max}},on:{config:function config(){var this$1=this;var content=this.partials.content;if(content&&Array.isArray(content)){content=this.partials.content=content.slice();var i=content.length;while(i--){var e=content[i];if(e.e==="max-top"){content.splice(i,1);this.set({_maxP:{t:e.f},hideTitleMax:true});if(e.m){this.set({_maxAttrsP:{t:e.m}})}}}}if(typeof window!=="undefined"){var tm;this._resizeListener=function(){if(tm){return}tm=setTimeout(function(){tm=null;this$1.fire("resize")},300)};window.addEventListener("resize",this._resizeListener)}},teardown:function teardown(){if(this._resizeListener){window.removeEventListener("resize",this._resizeListener)}}}});function initMediaListener(r){if(r._media){r._media.fn()}else{r._media={};r._media.fn=function(){if(!r.host){return}var max=r.sizeInPx(r.get("@style.raui.window.maxFrom"));var trans=r.transitionsEnabled;r.transitionsEnabled=false;r.set("max",r.host.clientWidth<=max);r.set("dimensions",{clientWidth:r.host.clientWidth,clientHeight:r.host.clientHeight});r.transitionsEnabled=trans};r._media.handle=r.root.on("*.resize",r._media.fn);setTimeout(r._media.fn)}}function findEvent(instance){var i=instance;while(i){if(i.event&&i.event){return i.event.event}i=i.parent}}function getEventCoords(event){var node=event.target;if(!node){return{x:0,y:0}}var rect=node.getBoundingClientRect();return{x:Math.round(rect.left+(rect.right-rect.left)/2),y:Math.round(rect.top+(rect.bottom-rect.top)/2)}}Ractive.transitions.modal=function(t,parms){var params=t.processParams(parms,{duration:400,easing:"easeOut",x:0,y:-50,event:true});var event=null;var current={x:t.node.offsetLeft,y:t.node.offsetTop};var styles;var overflow=t.node.parentNode.style?t.node.parentNode.style.overflow:"hidden";if(!event&&!t.node._modalSrc){if(t.isIntro){styles={transform:"translate(0, 0) scale(1, 1)",opacity:1};t.setStyle({transform:"translate("+params.x+"px, "+params.y+"px) scale(0.5, 0.5)",opacity:0})}else{styles={transform:"translate("+params.x+"px, "+params.y+"px) scale(0.5, 0.5)",opacity:0}}}else{var click=t.node._modalSrc||(event?getEventCoords(event):{x:current.x+params.x,y:current.y+params.y});var target={x:click.x-Math.round(t.node.clientWidth/2)-current.x,y:click.y-Math.round(t.node.clientHeight/2)-current.y};if(t.node.parentNode.style){t.node.parentNode.style.overflow="hidden"}if(t.isIntro){t.node._modalSrc=click;styles={transform:"translate(0, 0) scale(1, 1)",opacity:1};t.setStyle({transform:"translate("+target.x+"px, "+target.y+"px) scale(0.5, 0.5)",opacity:0})}else{styles={transform:"translate("+target.x+"px, "+target.y+"px) scale(0.5, 0.5)",opacity:0}}}t.animateStyle(styles,params).then(function(){if(t.node.parentNode.style){t.node.parentNode.style.overflow=overflow}t.complete()})};var moveEvents=["mousemove","mouseup","touchmove","touchend"];var handleSize=7;export var Window=function(Base){function Window(opts){Base.call(this,opts)}if(Base)Window.__proto__=Base;Window.prototype=Object.create(Base&&Base.prototype);Window.prototype.constructor=Window;var prototypeAccessors$1={resizable:{configurable:true},title:{configurable:true},visible:{configurable:true},pad:{configurable:true},buttons:{configurable:true},blocked:{configurable:true},result:{configurable:true}};prototypeAccessors$1.resizable.get=function(){return this.get("control.resizable")};prototypeAccessors$1.resizable.set=function(v){return this.set("control.resizable",v)};prototypeAccessors$1.title.get=function(){return this.get("control.title")};prototypeAccessors$1.title.set=function(v){return this.set("control.title",v)};prototypeAccessors$1.visible.get=function(){return this.get("control.show")};prototypeAccessors$1.visible.set=function(v){if(v){this.show()}else{this.set("control.show",v,{keep:true})}this.host.raise(this,{show:v})};prototypeAccessors$1.pad.get=function(){return this.get("pad")};prototypeAccessors$1.pad.set=function(v){this.set("pad",v)};prototypeAccessors$1.buttons.get=function(){return this.get("buttons")};prototypeAccessors$1.buttons.set=function(v){return this.set("buttons",v)};prototypeAccessors$1.blocked.get=function(){return this.get("control.blocked")};prototypeAccessors$1.blocked.set=function(v){return this.set("control.blocked",v)};prototypeAccessors$1.result.get=function(){var this$1=this;if(!this._result){this._result={};this._result.promise=new Promise(function(ok){this$1._result.ok=ok})}return this._result.promise};Window.prototype.setResult=function setResult(v){this.result;this._result.value=v};Window.prototype.close=function close(force,result){if(force!==true){if(!this.parent){return false}if(this.get("control.blockers.length")){return false}if(typeof this.beforeClose==="function"&&this.beforeClose()===false){return false}if(this.fire("beforeClose")===false){return false}}this.fire("close");if(this._result){this._result.ok(this._result.value||result)}return true};Window.prototype.maximize=function maximize(){this.toggle("root.userMax")};Window.prototype.hide=function hide(){this.visible=false};Window.prototype.raise=function raise(show){this.host.raise(this,{show:show})};Window.prototype.show=function show(){this.set("control.show",true);if(this.get("control.top")===undefined){this.host.place(this)}};Window.prototype.size=function size(w,h){var this$1=this;return new Promise(function(ok){requestAnimationFrame(function(){if(!this$1.visible){if(typeof w==="number"&&typeof h==="number"){this$1.set({"control.width":this$1.host.sizeInEm(w),"control.height":this$1.host.sizeInEm(h),"control.naturalWidth":this$1.host.sizeInEm(w),"control.naturalHeight":this$1.host.sizeInEm(h),"control.autosize":false})}return}var el=this$1.wrapper;if(!el){return}if(w==="auto"){this$1.set("control.autosize",true);var nw=this$1.host.sizeInEm(el.clientWidth+16);var nh=this$1.host.sizeInEm(el.clientHeight);this$1.set({"control.width":nw,"control.height":nh,"control.naturalWidth":nw,"control.naturalHeight":nh,"control.autosize":false})}else if(typeof w==="number"&&typeof h==="number"){this$1.set({"control.width":this$1.host.sizeInEm(w),"control.height":this$1.host.sizeInEm(h),"control.naturalWidth":this$1.host.sizeInEm(w),"control.naturalHeight":this$1.host.sizeInEm(h),"control.autosize":false})}else if(typeof w==="string"&&typeof h==="string"){var ow=el.style.width;var oh=el.style.height;el.style.width=w;el.style.height=h;var nw$1=el.clientWidth;var nh$1=el.clientHeight;el.style.width=ow;el.style.height=oh;this$1.set({"control.width":this$1.host.sizeInEm(nw$1),"control.height":this$1.host.sizeInEm(nh$1),"control.naturalWidth":this$1.host.sizeInEm(nw$1),"control.naturalHeight":this$1.host.sizeInEm(nh$1),"control.autosize":false})}this$1.fire("resize");ok()})})};Window.prototype.move=function move(top,left){var this$1=this;return new Promise(function(ok){requestAnimationFrame(function(){if(top==="center"){top=this$1.host.modalPane.clientHeight/2-this$1.wrapper.clientHeight/2}else if(typeof top==="string"){top=this$1.host.sizeInEm(top)}if(left==="center"){left=this$1.host.modalPane.clientWidth/2-this$1.wrapper.clientWidth/2}if(typeof left==="string"){left=this$1.host.sizeInEm(left)}var set={};if(typeof top==="number"){set["control.top"]=top}if(typeof left==="number"){set["control.left"]=left}this$1.set(set);ok()})})};Window.prototype._startMove=function _startMove(event){var this$1=this;if(event.type==="mousedown"&&event.button!==0){return}if(!this.get("control.topmost")){this.raise()}if(~event.type.indexOf("mouse")){if(!event.ctrlKey&&event.target!==this.content&&event.target!==this.top&&!this.top.contains(event.target)){return}}else{if(event.targetTouches&&event.targetTouches.length===1&&event.target!==this.content&&event.target!==this.top&&!this.top.contains(event.target)){return}}var wnd=this.pane;var cursor=wnd.style.cursor;wnd.style.cursor="move";wnd.style.userSelect="none";var sx=event.x||event.clientX||event.targetTouches&&event.targetTouches[0].clientX||0;var sy=event.y||event.clientY||event.targetTouches&&event.targetTouches[0].clientY||0;var ox=this.get("control.left")||0;var oy=this.get("control.top")||0;var ow=wnd.clientWidth;var oh=wnd.clientHeight;var _move=function(ev){var x=ev.x||ev.clientX||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientX||ev.changedTouches&&ev.changedTouches[0].clientX||0;var y=ev.y||ev.clientY||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientY||ev.changedTouches&&ev.changedTouches[0].clientY||0;var nx=ox+(x-sx);var ny=oy+(y-sy);if(nx<(ow<30?0:30-ow)){nx=ow<30?0:30-ow}if(ny<(oh<30?0:30-oh)){ny=oh<30?0:30-oh}if(nx<0){nx=0}if(ny<0){ny=0}this$1.set({"control.top":ny,"control.left":nx});if(ev.type==="touchend"||ev.type==="mouseup"){moveEvents.forEach(function(e){return document.removeEventListener(e,_move,{passive:false})});wnd.style.cursor=cursor;wnd.style.userSelect=""}else{ev.preventDefault()}};moveEvents.forEach(function(e){return document.addEventListener(e,_move,{passive:false})});if(event.type.indexOf("mouse")===0){return false}};Window.prototype._startResize=function _startResize(event){var this$1=this;if(event.target!==this.wrapper){return}if(event.type==="mousedown"&&event.button!==0){return}if(this.get("control.autosize")){this.size("auto")}if(!this.get("control.topmost")){this.raise()}this.set("control.resizing",true);var el=this.wrapper;var ix=event.offsetX||event.targetTouches&&event.targetTouches[0].pageX-el.getBoundingClientRect().left;var iy=event.offsetY||event.targetTouches&&event.targetTouches[0].pageY-el.getBoundingClientRect().top;var size=this.get("@style.window.handleSize")||handleSize;var right=el.clientWidth-size*2,bottom=el.clientHeight-size*2;var min=2*size;var l=ix<=min||ix>=right;var t=iy<=min||iy>=bottom;var sx=event.x||event.clientX||event.targetTouches&&event.targetTouches[0].clientX||0;var sy=event.y||event.clientY||event.targetTouches&&event.targetTouches[0].clientY||0;var ox=this.get("control.left")||0;var oy=this.get("control.top")||0;var ow=this.host.sizeInPx(this.get("control.width")+"em");var oh=this.host.sizeInPx(this.get("control.height")+"em");var nh=this.host.sizeInPx(this.get("control.naturalHeight")+"em");var nw=this.host.sizeInPx(this.get("control.naturalWidth")+"em");var tm;var _resize=function(ev){ev.preventDefault();var x=ev.x||ev.clientX||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientX||ev.changedTouches&&ev.changedTouches[0].clientX||0;var y=ev.y||ev.clientY||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientY||ev.changedTouches&&ev.changedTouches[0].clientY||0;var dx=l?x-sx:0;var dy=t?y-sy:0;var set={};if(iy<=size){set["control.top"]=oy+dy;set["control.height"]=oh-dy}else{set["control.height"]=oh+dy}if(ix<=size){set["control.left"]=ox+dx;set["control.width"]=ow-dx}else{set["control.width"]=ow+dx}if(set["control.width"]<nw){delete set["control.width"];delete set["control.left"]}if(set["control.height"]<nh){delete set["control.height"];delete set["control.top"]}if(set["control.left"]<0){set["control.left"]=0}if(set["control.top"]<0){set["control.top"]=0}if(set["control.width"]){set["control.width"]=this$1.host.sizeInEm(set["control.width"])}if(set["control.height"]){set["control.height"]=this$1.host.sizeInEm(set["control.height"])}this$1.set(set);if(ev.type==="touchend"||ev.type==="mouseup"){moveEvents.forEach(function(e){return document.removeEventListener(e,_resize,{passive:false})});this$1.set("control.resizing",false);if(ow!==this$1.get("control.width")||oh!==this$1.get("control.height")){if(tm){clearTimeout(tm)}tm=null;this$1.fire("resize")}}else{if(!tm){tm=setTimeout(function(){this$1.fire("resize");tm=null},200)}}};moveEvents.forEach(function(e){return document.addEventListener(e,_resize,{passive:false})});return false};Window.prototype._sizeHandle=function _sizeHandle(event){if(event.target!==this.wrapper){return}var el=this.wrapper;if(event.type==="mouseout"){return el.style.cursor="auto"}var x=event.offsetX,y=event.offsetY;var size=this.get("@style.window.handleSize")||handleSize;var right=el.clientWidth-size,bottom=el.clientHeight-size;var style=el.style;if(x<=size+size&&y<=size+size||x>=right-size&&y>=bottom-size){style.cursor="nwse-resize"}else if(x>=right-size&&y<=size+size||x<=size+size&&y>=bottom-size){style.cursor="nesw-resize"}else if((x<=size||x>=right)&&(y<bottom||y>size)){style.cursor="ew-resize"}else if((y<=size||y>=bottom)&&(x<right||x>size)){style.cursor="ns-resize"}else{style.cursor="auto"}};Object.defineProperties(Window.prototype,prototypeAccessors$1);return Window}(Base);var buttonAttrs=["left","right","center","condition"];Base.extendWith(Window,{template:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"(_0||_1||_2)&&!_3"}},{t:4,f:[{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/control.movable","~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"!(_0===false||_1||_2||_3)&&!_4"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]},cssId:"window",partials:{pane:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:51,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog"],s:"(_0||_1||_2)&&_3&&!_4"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}]}.t,title:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}]}.t,contents:{v:4,t:""}.t,status:{v:4,t:""}.t},data:function data(){return{buttons:[],visibleButtons:0}},computed:{leftButtons:function leftButtons(){return(this.get("buttons")||[]).filter(function(b){return b.where==="left"})},centerButtons:function centerButtons(){return(this.get("buttons")||[]).filter(function(b){return b.where==="center"})},rightButtons:function rightButtons(){return(this.get("buttons")||[]).filter(function(b){return!b.where||b.where==="right"})}},decorators:{button:function button(node){var ctx=this.getContext(node);ctx.add("visibleButtons");return{update:function update(){},teardown:function teardown(){ctx.subtract("visibleButtons")}}}},on:{config:function config(){var parent=Window.prototype.template;var child=this.template;if(typeof parent!=="string"&&!Array.isArray(parent)&&parent.t){parent=parent.t}if(typeof child!=="string"&&!Array.isArray(child)&&child.t){child=child.t}if(parent!==child){if(!this.partials.hasOwnProperty("contents")){this.partials.contents=child}this.template=parent}},construct:function construct(){var wnd=this.constructor;if(!wnd._constructed){wnd._constructed=1;var tpl=wnd.prototype.template.t.slice();var btns=tpl.find(function(e){return e.e==="buttons"});wnd.prototype.template.t=tpl.filter(function(e){return e.e!=="buttons"});function mapButton(b){var attrs=b.m||[];var res={partial:{t:[{t:b.t,e:b.e,f:b.f,m:attrs.filter(function(a){return!~buttonAttrs.indexOf(a.n)})}]},where:attrs.find(function(a){return a.n==="left"})?"left":attrs.find(function(a){return a.n==="center"})?"center":"right"};res.partial.t[0].m.push({t:71,n:"button"});return res}if(btns){wnd._btns=btns.f.filter(function(e){return e.e==="button"||e.t===4&&(e.n===50||e.n===51)&&e.f.find(function(e){return e.e==="button"})}).map(function(n){if(n.t===4){return n.f.filter(function(e){return e.e==="button"}).map(function(bb){var b=mapButton(bb);var f={t:n.t,n:n.n,f:[b.partial.t[0]]};if(n.r){f.r=n.r}if(n.rx){f.rx=n.rx}if(n.x){f.x=n.x}b.partial={t:[f]};return b})}else{var b=mapButton(n);return[b]}}).reduce(function(a,c){return a.concat(c)},[])}}},init:function init(){var wnd=this.constructor;if(wnd._btns&&!this.get("buttons.length")){this.set("buttons",wnd._btns)}}},observe:{"control.max root.max root.userMax control.width control.height root.dimensions.clientHeight root.dimensions.clientWidth":{handler:function handler(v,o,k){if(!this.get("control.id")){return}var max=this.get("control.max")||this.get("root.userMax")||this.get("root.max");var actual=this.get("control.actual")||{};if(max){if(!actual.max){var root=this.wrapper;if(this.wrapper){this.set("control.actual",{width:this.host.sizeInEm(this.wrapper.clientWidth),height:this.host.sizeInEm(this.wrapper.clientHeight),max:max})}}else if(~k.indexOf("client")&&typeof v==="number"){if(~k.indexOf("Width")){this.set("control.actual.width",this.host.sizeInEm(v))}else if(~k.indexOf("Height")){this.set("control.actual.height",this.host.sizeInEm(v))}}}else{if(typeof v==="number"){if(~k.indexOf("width")){this.set("control.actual.width",v)}else if(~k.indexOf("height")){this.set("control.actual.height",v)}}if(actual.max){this.set("control.actual",{width:this.get("control.width"),height:this.get("control.width"),max:max})}this.set("control.actual.max",false)}},init:false,defer:true}}});export function plugin(opts){if(opts===void 0)opts={};return function(ref){var instance=ref.instance;instance.components[opts.name||"host"]=Host}}globalRegister("RMWindowHost","components",Host);globalRegister("RMWindow","components",Window);Host.prototype.Window=Window;export default plugin;
{
"name": "@evs-chris/raui",
"version": "0.7.5",
"version": "0.8.0",
"description": "Components, decorators, and helpers for Ractive apps that are generally Material-ish",

@@ -21,2 +21,3 @@ "homepage": "https://github.com/evs-chris/raui",

"rollup-plugin-buble": "^0.19",
"buble": "^0.19.8",
"rollup-plugin-import-resolver": "^1",

@@ -23,0 +24,0 @@ "rollup-plugin-ractive-bin": "^1.0.0",

@@ -37,3 +37,3 @@ (function (global, factory) {

var AppBar = (function (Ractive) {
var AppBar = /*@__PURE__*/(function (Ractive) {
function AppBar(opts) { Ractive.call(this, opts); }

@@ -40,0 +40,0 @@

@@ -147,3 +147,3 @@ (function (global, factory) {

var Popover = (function (Ractive) {
var Popover = /*@__PURE__*/(function (Ractive) {
function Popover(opts) { Ractive.call(this, opts); }

@@ -426,3 +426,3 @@

var MobilePop = (function (Ractive) {
var MobilePop = /*@__PURE__*/(function (Ractive) {
function MobilePop(opts) { Ractive.call(this, opts); }

@@ -429,0 +429,0 @@

@@ -77,3 +77,3 @@ (function (global, factory) {

var Chart = (function (Ractive) {
var Chart = /*@__PURE__*/(function (Ractive) {
function Chart(opts) { Ractive.call(this, opts); }

@@ -80,0 +80,0 @@

@@ -28,3 +28,3 @@ (function (global, factory) {

var DatePicker = (function (Ractive) {
var DatePicker = /*@__PURE__*/(function (Ractive) {
function DatePicker(opts) { Ractive.call(this, opts); }

@@ -366,3 +366,3 @@

var Popover = (function (Ractive) {
var Popover = /*@__PURE__*/(function (Ractive) {
function Popover(opts) { Ractive.call(this, opts); }

@@ -713,3 +713,3 @@

var MobilePop = (function (Ractive) {
var MobilePop = /*@__PURE__*/(function (Ractive) {
function MobilePop(opts) { Ractive.call(this, opts); }

@@ -716,0 +716,0 @@

@@ -28,3 +28,3 @@ (function (global, factory) {

var DatePicker = (function (Ractive$$1) {
var DatePicker = /*@__PURE__*/(function (Ractive$$1) {
function DatePicker(opts) { Ractive$$1.call(this, opts); }

@@ -31,0 +31,0 @@

@@ -70,3 +70,3 @@ (function (global, factory) {

var JSONEditor = (function (Ractive) {
var JSONEditor = /*@__PURE__*/(function (Ractive) {
function JSONEditor(opts) { Ractive.call(this, opts); }

@@ -73,0 +73,0 @@

@@ -132,3 +132,3 @@ (function (global, factory) {

var Menu = (function (Ractive) {
var Menu = /*@__PURE__*/(function (Ractive) {
function Menu(opt) {

@@ -199,4 +199,2 @@ Ractive.call(this, opts);

Menu.prototype.popAllIn = function popAllIn (path) {
var this$1 = this;
if (!path) { path = ''; }

@@ -206,3 +204,3 @@ var item = this.get(path);

for (var i = 0; i < item.items.length; i++) {
this$1.popAllIn(((path ? (path + ".") : '') + "items." + i));
this.popAllIn(((path ? (path + ".") : '') + "items." + i));
}

@@ -240,8 +238,6 @@ }

Menu.prototype.childActive = function childActive (path) {
var this$1 = this;
var item = this.get(path);
if (item && item.items) {
for (var i = 0; i < item.items.length; i++) {
if (this$1.get((path + ".items." + i + ".active")) === true || (typeof item.items[i].active === 'function' && item.items[i].active()) || (this$1.get((path + ".items." + i + ".activeRef")) && this$1.get(item.items[i].activeRef)) || this$1.childActive((path + ".items." + i))) { return true; }
if (this.get((path + ".items." + i + ".active")) === true || (typeof item.items[i].active === 'function' && item.items[i].active()) || (this.get((path + ".items." + i + ".activeRef")) && this.get(item.items[i].activeRef)) || this.childActive((path + ".items." + i))) { return true; }
}

@@ -248,0 +244,0 @@ }

@@ -149,3 +149,3 @@ (function (global, factory) {

var Popover = (function (Ractive) {
var Popover = /*@__PURE__*/(function (Ractive) {
function Popover(opts) { Ractive.call(this, opts); }

@@ -496,3 +496,3 @@

var MobilePop = (function (Ractive) {
var MobilePop = /*@__PURE__*/(function (Ractive) {
function MobilePop(opts) { Ractive.call(this, opts); }

@@ -499,0 +499,0 @@

@@ -353,3 +353,3 @@ (function (global, factory) {

var Shell = (function (Ractive) {
var Shell = /*@__PURE__*/(function (Ractive) {
function Shell(opts) { Ractive.call(this, opts); }

@@ -356,0 +356,0 @@

@@ -37,3 +37,3 @@ (function (global, factory) {

var Split = (function (Ractive) {
var Split = /*@__PURE__*/(function (Ractive) {
function Split(opts) { Ractive.call(this, opts); }

@@ -40,0 +40,0 @@

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],t):t(e.RMTable={},e.Ractive)}(this,function(e,t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var n,r="undefined"!=typeof window?window:null;function i(e,t,n){if(r&&r.Ractive&&"object"==typeof r.Ractive[t]){var i=document.currentScript;if(i||(i=(i=document.querySelectorAll("script"))[i.length-1]),i){var o=i.getAttribute("data-alias");o&&(o=(o=o.split("&")).reduce(function(e,t){var n=t.split("="),r=n[0],i=n[1];return e[r]=i,e},{})),Ractive[t][o&&o[e]||e]=n}}}function o(e,t){var n=t.context||this.getContext(e),r={position:e.style.position,overflowY:e.style.overflowY};""!==e.style.position&&"static"!==e.style.position||(e.style.position="relative");var i=document.createElement("object");i.setAttribute("style","display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"),i.type="text/html";var o=function(){t.offsetWidth&&n.set(t.offsetWidth,e.offsetWidth),t.offsetHeight&&n.set(t.offsetHeight,e.offsetHeight),t.clientWidth&&n.set(t.clientWidth,e.clientWidth),t.clientHeight&&n.set(t.clientHeight,e.clientHeight),t.diffWidth&&n.set(t.diffWidth,e.offsetWidth-e.clientWidth),t.diffHeight&&n.set(t.diffHeight,e.offsetHeight-e.clientHeight)};return i.onload=function(){i.contentDocument.defaultView.addEventListener("resize",o),o()},/Trident/.test(navigator.userAgent)?(e.appendChild(i),i.data="about:blank"):(i.data="about:blank",e.appendChild(i)),{refresh:o,teardown:function(){e.removeChild(i),e.style.position=r.position,e.style.overflowY=r.overflowY}}}var a={tiny:{units:[2,3,4,5,6,8],max:"0",value:0},xsmall:{units:[2,3,4,5,6,8,10,12],max:"20em",prefix:"xs",value:10},small:{units:[2,3,4,5,6,8,10,12],max:"36em",value:20},medium:{units:[2,3,4,5,6,8,10,12],max:"48em",value:30},large:{units:[2,3,4,5,6,8,10,12,16,20],max:"64em",value:40},xlarge:{units:[2,3,4,5,6,8,10,12,16,20],max:"100em",value:50},ginormous:{units:[2,3,4,5,6,8,10,12,16,20],max:"150em",value:60}},l={"grid grid-root":/\bgrid grid-root\b/g},s=/\s+/g;function d(e,t){var r,i,d=this.getContext(e),c=this,f=t||{};function u(t){if("number"==typeof f.offset&&(t-=f.offset),!f.type||"class"===f.type){var n,o=e.className,a=-1;for(var c in r)l[c].lastIndex=-1,r[c]<=t?(l[c].test(o)||(o+=" "+c),r[c]>a&&(a=r[c],n=c)):o=o.replace(l[c],"").trim();if(e.className=o.replace(s," "),!n)return;f.value&&d.set(f.value,i[n].value),f.name&&d.set(f.name,n),f.size&&d.set(f.size,t),f.max&&d.set(f.max,a)}}function h(){var t=(n||(n=document.createElement("div"),document.body.appendChild(n)),n);for(var o in i=c.get("@style.break")||a,r={},i)t.style.width=i[o].max,r[o]=t.clientWidth,l[o]||(l[o]=new RegExp("\\b"+o+"\\b","g"));t.style.width=0,u(e.clientWidth)}var p=this.observe("@style.break",h,{init:!1}),b=d.observe("@local.width",u,{init:!1}),g=o.call(this,e,{clientWidth:"@local.width"});return e.className+=" grid grid-root",f.immediate?h():requestAnimationFrame(h),{update:function(t){f=t||{},requestAnimationFrame(function(){return u(e.clientWidth)})},teardown:function(){e.className=e.className.replace(l["grid grid-root"],"").trim(),b.cancel(),p.cancel(),g.teardown()}}}function c(e,t){var n=e("raui.grid.break")||t||a,r=(e("raui.grid.wrappers")||[".row-wrap > ",".row-wrap > .row-wrap > "]).slice();r.unshift("");var i=".row > * { position: relative; width: 100%; transition-duration: 0.2s; transition-timing-function: ease-in-out; transition-property: padding, margin; box-sizing: border-box; }\n.grid { display: block; }\n.grid .row { display: flex !important; flex-wrap: wrap; min-height: fit-content; width: 100%; align-content: flex-start; }\n.grid .row.row-pad > * { padding: "+(e("raui.grid.padding")||"0.5em")+"; }\n.grid .row > .pad { display: flex; flex-direction: column; padding: "+(e("raui.grid.padding")||"0.5em")+"; box-sizing: border-box; }",o=Object.keys(n).map(function(e){return(n[e].key=e)&&n[e]});return o.sort(function(e,t){return e.value>t.value?1:e.value<t.value?-1:0}),o.forEach(function(t){var n=t.prefix||t.key[0],o={};t.units.forEach(function(e){for(var t=1;t<e;t++){var n=""+t/e*100;n=n.substr(0,n.indexOf(".")+3),o[n]||(o[n]=[]),o[n].push(t+"-"+e)}});var a=t.key;i+="\n"+[r.map(function(e){return"."+a+" > "+e+"."+n+"1, ."+a+" > "+e+".row > ."+n+"1"}).join(", "),"."+a+" ."+n+"-n1, ."+a+" .row-"+n+"-n1 > *"].filter(function(e){return e}).join(", ")+" { display: "+(e("raui.grid.display")||"inline-block")+"; width: 100%; flex-grow: 0; flex-shrink: 0; }\n"+[r.map(function(e){return"."+a+" > "+e+"."+n+"0, ."+a+" > "+e+".row > ."+n+"0"}).join(", "),"."+a+" ."+n+"-n0, ."+a+" .row-"+n+"-n0 > *"].filter(function(e){return e}).join(", ")+" { display: none; flex-grow: 0; flex-shrink: 0: }\n"+Object.keys(o).map(function(t){return o[t].map(function(e){return""+[r.map(function(t){return"."+a+" > "+t+".row-"+n+e+" > *, ."+a+" > "+t+"."+n+e+", ."+a+" > "+t+".row > ."+n+e}).join(", "),"."+a+" .row-"+n+"-n"+e+" > * .row > ."+n+"-n"+e+", ."+a+" ."+n+"-n"+e+", ."+a+" .row-"+n+"-n"+e+" > *"].filter(function(e){return e}).join(", ")}).join(", ")+" { display: "+(e("raui.grid.display")||"inline-block")+"; width: "+t+"%; flex-grow: 0; flex-shrink: 0; }"}).join("\n")+"\n"+[r.map(function(e){return"."+a+" > "+e+".row > "+n+"-fill, ."+a+" >"+e+".row > ."+n+"-auto"}).join(", "),"."+a+" ."+n+"-nfill, ."+a+" ."+n+"-nauto"].filter(function(e){return e}).join(", ")+" { display: "+(e("raui.grid.display")||"inline-block")+"; width: auto; flex-grow: 1; flex-shrink: 1; }"}),i}d.style=c,i("grid","decorators",d);var f=250;function u(e){return void 0===e&&(e={}),function(t){var n=t.Ractive;t.instance.events[e.name||(e.count||"")+"clicks"]=function(t,r,i){var o,a=Object.assign({},e,i);return(o=t.__r_clicks__)?o.subscribe(a.count||1,!!a.hold,r):(o=new h(n.getContext(t),a.delay||f,a.bubble||!1),t.__r_clicks__=o,o.subscribe(a.count||1,!!a.hold,r)),{teardown:function(){o.unsubscribe(a.count||1,!!a.hold,r)}}}}}u({name:"click",count:1}),u({name:"dblclick",count:2}),u({name:"trpclick",count:3});var h=function(e,t,n){this.context=e,this.node=e.node,this.delay=t,this.fires={},this.refs=0,this.bubble=n,this.bind()};function p(e){return this.__r_clicks__.mousedown(e)}function b(e){return this.__r_clicks__.touchdown(e)}function g(){this.addEventListener("keydown",m,!1),this.addEventListener("blur",v,!1)}function v(){this.removeEventListener("keydown",m,!1),this.removeEventListener("blur",v,!1)}function m(e){if(32===e.which||10===e.which||13===e.which)return this.__r_clicks__.fire()}function x(e,t){var n=e.processParams(t,{duration:200,easing:"easeInOut"});return new Promise(function(t){requestAnimationFrame(function(){e.setStyle("overflow","hidden");var r="x"===n.axis?"width":"height";if(e.isIntro||n.intro){var i=e.getStyle(r);e.setStyle(r,0),e.setStyle("opacity",0),t(e.animateStyle(r,i,n).then(function(){return e.animateStyle("opacity",1,n)}).then(function(){e.setStyle(r,""),e.setStyle("overflow","")}))}else e.setStyle(r,e.getStyle(r)),e.setStyle("opacity",1),t(e.animateStyle("opacity",0,n).then(function(){return e.animateStyle(r,0,n)}))})})}function w(e,t){void 0===t&&(t={});var n="string"==typeof t?t:t.bind;if("string"!=typeof n)return{teardown:function(){}};var r=t.allow||2,i=this.getContext(e);function o(){var t="";e.scrollHeight>e.clientHeight&&(t+="vscroll"),e.scrollWidth>e.clientWidth&&(t+=(t?" ":"")+"hscroll"),e.scrollTop<=r&&(t+=" top"),e.scrollTop>=e.scrollHeight-e.clientHeight-r&&(t+=" bottom"),~t.indexOf("top")||~t.indexOf("bottom")||(t+=" vmiddle"),e.scrollLeft<=r&&(t+=" left"),e.scrollLeft>=e.scrollWidth-e.clientWidth-r?t+=" right":~t.indexOf("left")||~t.indexOf("right")||(t+=" hmiddle"),i.set(n,t)}return e.addEventListener("scroll",o,{passive:!0}),requestAnimationFrame(o),{refresh:o,teardown:function(){e.removeEventListener("scroll",o)}}}function _(e){return"string"==typeof e}function y(e){return"number"==typeof e}function k(e){return"object"==typeof e}h.prototype.subscribe=function(e,t,n){(this.fires[e+","+t]||(this.fires[e+","+t]=[])).push(n),this.refs++},h.prototype.unsubscribe=function(e,t,n){var r=this.fires[e+","+t]||[];r.splice(r.indexOf(n),1),this.refs--,this.refs||this.teardown()},h.prototype.bind=function(){window.PointerEvent||window.navigator.pointerEnabled?this.context.listen("pointerdown",p):window.navigator.msPointerEnabled?this.context.listen("MSPointerDown",p):(this.context.listen("mousedown",p),this.context.listen("touchstart",b)),"A"!==this.node.tagName&&"BUTTON"!==this.node.tagName&&"button"!==this.node.type&&"submit"!==this.node.type&&"checkbox"!==this.node.type&&"radio"!==this.node.type||this.context.listen("focus",g)},h.prototype.fire=function(e,t,n,r){var i=this;this.tm?(this.tmCount++,clearTimeout(this.tm)):this.tmCount=1;var o=function(){i.tm=null,(i.fires[i.tmCount+","+!!r]||[]).forEach(function(o){o({node:i.node,original:e,x:t,y:n,hold:!!r})})};return r?o():this.tm=setTimeout(o,this.delay),this.bubble},h.prototype.mousedown=function(e){var t=this;if(!this.preventMousedownEvents&&(void 0===e.which||1===e.which)){var n,r=e.clientX,i=e.clientY,o=e.pointerId,a=function(e){e.pointerId==o&&(t.fire(e,r,i),s())},l=function(e){e.pointerId==o&&(Math.abs(e.clientX-r)>=5||Math.abs(e.clientY-i)>=5)&&s()},s=function(){n&&clearTimeout(n),t.node.removeEventListener("MSPointerUp",a,!1),document.removeEventListener("MSPointerMove",l,!1),document.removeEventListener("MSPointerCancel",s,!1),t.node.removeEventListener("pointerup",a,!1),document.removeEventListener("pointermove",l,!1),document.removeEventListener("pointercancel",s,!1),t.node.removeEventListener("click",a,!1),document.removeEventListener("mousemove",l,!1)};return window.PointerEvent||window.navigator.pointerEnabled?(this.node.addEventListener("pointerup",a,!1),document.addEventListener("pointermove",l,!1),document.addEventListener("pointercancel",s,!1)):window.navigator.msPointerEnabled?(this.node.addEventListener("MSPointerUp",a,!1),document.addEventListener("MSPointerMove",l,!1),document.addEventListener("MSPointerCancel",s,!1)):(this.node.addEventListener("click",a,!1),document.addEventListener("mousemove",l,!1)),n=setTimeout(function(){s(),t.fire(e,r,i,!0)},400),this.bubble||e.stopPropagation(),this.bubble}},h.prototype.touchdown=function(e){var t,n=this,r=e.touches[0],i=r.clientX,o=r.clientY,a=r.identifier,l=function(e){e.changedTouches[0].identifier===a?(e.preventDefault(),n.preventMousedownEvents=!0,clearTimeout(n.preventMousedownTimeout),n.preventMousedownTimeout=setTimeout(function(){n.preventMousedownEvents=!1},400),n.fire(e,i,o),d()):d()},s=function(e){1===e.touches.length&&e.touches[0].identifier===a||d();var t=e.touches[0];(Math.abs(t.clientX-i)>=5||Math.abs(t.clientY-o)>=5)&&d()},d=function(){t&&clearTimeout(t),n.node.removeEventListener("touchend",l,!1),window.removeEventListener("touchmove",s,!1),window.removeEventListener("touchcancel",d,!1)};return this.node.addEventListener("touchend",l,!1),window.addEventListener("touchmove",s,!1),window.addEventListener("touchcancel",d,!1),t=setTimeout(function(){d(),n.fire(e,i,o,!0)},400),this.bubble||e.stopPropagation(),this.bubble},h.prototype.teardown=function(){var e=this.context;e.unlisten("pointerdown",p),e.unlisten("MSPointerDown",p),e.unlisten("mousedown",p),e.unlisten("touchstart",b),e.unlisten("focus",g),delete this.node.__r_clicks__},i("expand","transitions",x);var O,S,P=function(e){function t(t){e.call(this,t)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={selections:{configurable:!0},selected:{configurable:!0}};return t.prototype._allSelected=function(){for(var e=this.get("selections"),t="virtual"===this.get("paginate")?this.get("rows"):this.get("visibleRows"),n=0;n<t.length;n++)if(!~e.indexOf(t[n]))return!1;return t.length&&!0},t.prototype._setSort=function(e,t){var n=[this.get("sort-handler"),this.get("@style.raui.table.sort-handler")],r=n[0]||n[1];if(r)r(this,this.get("columns."+e),e,t);else{var i=this.get("sort")||"",o=this.get("columns."+e).id;i===o||i.substr(1)===o?"-"===i[0]?this.set("sort",o):this.set("sort","-"+o):this.set("sort",o)}},t.prototype.nodeSet=function(e,t,n){e[t]=n},t.prototype._expand=function(e){var t=this,n=this.get("visibleRows")[e],r=this.get("expanded"),i=this.find(".rtable-row-expand");i?this.transition("expand",i,{outro:!0}).then(function(){r===n?t.set("expanded",null):(t.set("expanded",n),t.transition("expand",t.find(".rtable-row-expand"),{intro:!0}))}):n===r?this.set("expanded",null):(this.set("expanded",n),this.transition("expand",this.find(".rtable-row-expand"),{intro:!0}))},t.prototype._select=function(e,t){var n=this.get("selections");n||(n=[],this.set("selections",n));var r=n.indexOf(e);return~r?this.splice("selections",r,1):this.push("selections",e),(r>=n.length||1===n.length)&&this.set("selected",n[n.length-1]),this.fire("selection",{},{item:n[n.length-1],items:n}),setTimeout(function(){return t.target.checked=!~r}),!1},t.prototype.select=function(){var e=this.get("selected");e&&this.fire("selected",{},e,this.get("rows").indexOf(e),this.get("visibleRows").indexOf(e))},t.prototype.deselect=function(){this.set({selections:[],selected:void 0})},n.selections.get=function(){return this.get("selections")||[]},n.selections.set=function(e){var t=this.get("rows"),n=Array.isArray(e)?e.filter(function(e){return~t.indexOf(e)}):[];this.set("selections",n)},n.selected.get=function(){return this.get("selected")},n.selected.set=function(e){this.set({selected:e,selections:[e]})},t.prototype.selectionOffset=function(e){var t=this.get("selected"),n=this.get("visibleRows");if(t&&~n.indexOf(t)){var r=n.indexOf(t);if(e>0?r+e>=n.length:r+e<0){var i=e<1?-1:1;(i<0&&this.get("page")+i>=0||i>0&&this.get("page")+i<this.get("pagination.total"))&&this.add("page",i),n=this.get("visibleRows");var o=e>0?n[0]:n[n.length-1];this.set({selected:o,selections:[o]})}else this.set({selected:n[r+e],selections:[n[r+e]]})}else{var a=e>0?n[0]:n[n.length-1];this.set({selected:a,selections:[a]})}this.fire("selection",{},{item:this.get("selected"),items:this.get("selections")})},t.prototype.selectionDown=function(){this.selectionOffset(1)},t.prototype.selectionUp=function(){this.selectionOffset(-1)},t.prototype._selectGroup=function(e){var t=e;this.get("page")&&(t+=this.get("page")*this.get("pagination.per"));var n,r=this.get("rows"),i=this.get("groups"),o=this.get("selections"),a=r[t++],l=["selections"],s=[];for(~(n=o.indexOf(a))?s.push(n):l.push(a);t<r.length&&!(t in i);)a=r[t++],~(n=o.indexOf(a))?s.push(n):l.push(a);if(1===l.length)for(n=s.length;n--;)this.splice("selections",s[n],1);else this.push.apply(this,l);return!1},t.prototype._groupSelected=function(e){var t=e;this.get("page")&&(t+=this.get("page")*this.get("pagination.per"));var n=this.get("rows"),r=this.get("groups"),i=this.get("selections");if(!~i.indexOf(n[t++]))return!1;for(;t<n.length&&!(t in r);)if(!~i.indexOf(n[t++]))return!1;return!0},t.prototype._rows=function(){var e=(this.get("items")||[]).slice(),t=this.get("filter"),n=this.get("sort"),r=[this.get("data-handler"),this.get("@style.raui.table.data-handler")],i=r[0]||r[1]||z;if(!t&&!n)return this.set("isFiltered",!1),this.set("rows",e);var o=i(this,e,t,n,this.get("parameters",{virtual:!0}));this.set("isFiltered",o.length!==e.length),this.set("rows",o)},Object.defineProperties(t.prototype,n),t}(t);P.settings={valign:"center",border:!1,"fixed-header":!0,"allow-select":!0,"allow-select-all":!0,"auto-titles":!1,paginate:"virtual"},t.extendWith(P,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable",g:1},{n:"class-rtable-virtual",t:13,f:[{t:2,x:{r:["~/paginate"],s:'_0==="virtual"'}}]},{n:"class-rtable-auto",t:13,f:[{t:2,x:{r:["~/paginate"],s:'_0==="auto"'}}]},{n:"class-rtable-fixed",t:13,f:[{t:2,r:"~/fixed"}]},{n:"class-rtable-border",t:13,f:[{t:2,r:"~/border"}]},{n:"class-rtable-fixed-header",t:13,f:[{t:2,r:"~/fixedHeader"}]},{n:"class-rtable-scrolled-down",t:13,f:[{t:2,x:{r:["~/scroll"],s:'!~(_0||"").indexOf("top")'}}]},{n:"class-rtable-scrolled-up",t:13,f:[{t:2,x:{r:["~/scroll"],s:'!~(_0||"").indexOf("bottom")'}}]},{n:"class-rtable-with-select",t:13,f:[{t:2,r:"~/allowSelect"}]},{n:"class-rtable-valign-top",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="top"'}}]},{n:"class-rtable-valign-center",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="center"'}}]},{n:"class-rtable-valign-bottom",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="bottom"'}}]},{n:"class-rtable-nowrap",t:13,f:[{t:2,r:"~/noWrap"}]},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-fixed",g:1},{n:"grid",t:71,f:{r:["~/scrollOffset"],s:"[{offset:_0}]"}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-extra",g:1},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/tableWidth"},"px"],t:13}],n:50,r:"~/noWrap"},{n:"class-rtable-noheader",t:13,f:[{t:2,r:"~/noHeader"}]},{t:4,f:[{t:16,r:"meta.topAttrs"}],n:50,r:"meta.topAttrs"}],f:[{t:16,r:"meta.top",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}]}],n:50,r:"meta.top"}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-wrapper row-wrap",g:1}],f:[{t:8,r:"grid-head"}]}],n:51,r:"~/noHeader"}]}],n:50,x:{r:["~/noHeader","meta.top","~/fixedHeader"],s:"(!_0||_1)&&_2"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-top",g:1},{t:4,f:[{n:["scroll"],t:70,f:"scroll"},{n:"sized",t:71,f:{r:[],s:'[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]'}}],n:50,x:{r:["~/paginate"],s:'_0==="virtual"'}},{t:4,f:[{n:"scrolled",t:71,f:{r:[],s:'["~/scroll"]'}}],n:50,x:{r:["~/noHeader","~/fixedHeader","~/meta.bottom"],s:"(!_0&&_1)||_2"}},{t:4,f:[{n:"scrollheader",t:71}],n:50,x:{r:["~/fixedHeader","~/noWrap"],s:"_0&&_1"}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-extra",g:1},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/tableWidth"},"px"],t:13}],n:50,r:"~/noWrap"},{n:"class-rtable-noheader",t:13,f:[{t:2,r:"~/noHeader"}]},{t:4,f:[{t:16,r:"meta.topAttrs"}],n:50,r:"meta.topAttrs"}],f:[{t:16,r:"meta.top",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}]}],n:50,x:{r:["~/fixedHeader","meta.top"],s:"!_0&&_1"}}," ",{t:7,e:"div",m:[{n:"grid",t:71,f:{r:[],s:'[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]'}},{t:4,f:[{n:"style-margin-top",f:[{t:2,r:"~/virtual.above"},"px"],t:13},{n:"style-margin-bottom",f:[{t:2,r:"~/virtual.below"},"px"],t:13}],n:50,x:{r:["~/paginate"],s:'_0==="virtual"'}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-wrapper row-wrap",g:1}],f:[{t:8,r:"grid-head"}]}],n:50,x:{r:["~/noHeader","~/fixedHeader"],s:"!_0&&!_1"}}," ",{t:4,f:[{t:4,f:[{t:8,r:"grid-row"}],n:52,z:[{n:"source",x:{r:"~/items"}},{n:"shuffle",x:{x:{r:[],s:"true"}}}],r:"~/visibleRows"}],n:50,r:"~/shuffle"},{t:4,f:[{t:4,f:[{t:8,r:"grid-row"}],n:52,r:"~/visibleRows"}],n:51,l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-row row t1",g:1}],f:[{t:16,r:"empty",z:[{n:"message",x:{r:"~/empty"}}]}]}],n:50,x:{r:["~/rows.length"],s:"!_0"}}]}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-bottom",g:1},{t:4,f:[{t:16,r:"meta.bottomAttrs"}],n:50,r:"meta.bottomAttrs"}],f:[{t:4,f:[{t:16,r:"meta.bottom",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}],n:50,r:"~/meta.bottom"}," ",{t:4,f:[{t:8,r:"pagination"}],n:50,x:{r:["~/paginate"],s:'_0!=="virtual"'}}]}],n:50,x:{r:["~/paginate","~/meta.bottom"],s:'_0!=="virtual"||_1'}}]}],e:{'_0==="virtual"':function(e){return"virtual"===e},'_0==="auto"':function(e){return"auto"===e},'!~(_0||"").indexOf("top")':function(e){return!~(e||"").indexOf("top")},'!~(_0||"").indexOf("bottom")':function(e){return!~(e||"").indexOf("bottom")},'_0==="top"':function(e){return"top"===e},'_0==="center"':function(e){return"center"===e},'_0==="bottom"':function(e){return"bottom"===e},"[{offset:_0}]":function(e){return[{offset:e}]},"(!_0||_1)&&_2":function(e,t,n){return(!e||t)&&n},'[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]':function(){return[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]},'["~/scroll"]':function(){return["~/scroll"]},"(!_0&&_1)||_2":function(e,t,n){return!e&&t||n},"_0&&_1":function(e,t){return e&&t},"!_0&&_1":function(e,t){return!e&&t},'[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]':function(){return[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]},"!_0&&!_1":function(e,t){return!e&&!t},true:function(){return!0},"!_0":function(e){return!e},'_0!=="virtual"':function(e){return"virtual"!==e},'_0!=="virtual"||_1':function(e,t){return"virtual"!==e||t},"(_0+_1)%2===1":function(e,t){return(e+t)%2==1},"[_0._setSort(_1,_2)]":function(e,t,n){return[e._setSort(t,n)]},"[_0._select(_1,_2),false]":function(e,t,n){return[e._select(t,n),!1]},'[["select",_2,_0.indexOf(_2),_1.indexOf(_2)]]':function(e,t,n){return[["select",n,e.indexOf(n),t.indexOf(n)]]},"[_0._expand(_1)]":function(e,t){return[e._expand(t)]},"[_0.stopPropagation()]":function(e){return[e.stopPropagation()]},"_0.indexOf(_1)":function(e,t){return e.indexOf(t)},"_0===_1":function(e,t){return e===t},"_0>0":function(e){return e>0},"!_0&&_1>0":function(e,t){return!e&&t>0},'_0==="boolean"':function(e){return"boolean"===e},"_0._allSelected()":function(e){return e._allSelected()},'_0||"No data."':function(e){return e||"No data."},"_0*_1+1":function(e,t){return e*t+1},"_2+1===_0?_1:(_2+1)*_3":function(e,t,n,r){return n+1===e?t:(n+1)*r},"_0===1":function(e){return 1===e},"_0._allSelected()&&_1<_2":function(e,t,n){return e._allSelected()&&t<n},'[_0.set("page",_1-1)]':function(e,t){return[e.set("page",t-1)]},'[(/^\\d+$/.test(_1)&&+_1>0&&+_1<=_0&&_2.set("page",+_1-1))||_2.nodeSet(_3,"value",_4+1)]':function(e,t,n,r,i){return[/^\d+$/.test(t)&&+t>0&&+t<=e&&n.set("page",+t-1)||n.nodeSet(r,"value",i+1)]},"_0==_1+1":function(e,t){return e==t+1},'[_0.set("page",_2[_1-1])]':function(e,t,n){return[e.set("page",n[t-1])]},'_0==="..."':function(e){return"..."===e},'[_0.set("page",_1+1)]':function(e,t){return[e.set("page",t+1)]},"_0<_1-1":function(e,t){return e<t-1}},p:{"csp-dummy":[{t:7,e:"div",m:[{n:"class-rtable-odd",t:13,f:[{t:2,x:{r:["@index","~/virtual.offset"],s:"(_0+_1)%2===1"}}]},{n:"class-top",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="top"'}}]},{n:"class-bottom",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="bottom"'}}]},{n:"class-center",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="center"'}}]},{n:["click"],t:70,f:{r:["@this",".index","@event"],s:"[_0._setSort(_1,_2)]"}},{n:["click"],t:70,f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}},{n:["click"],t:70,f:{r:["~/rows","~/visibleRows","."],s:'[["select",_2,_0.indexOf(_2),_1.indexOf(_2)]]'}},{n:["click"],t:70,f:{r:["@this","@index"],s:"[_0._expand(_1)]"}},{n:["click"],t:70,f:{r:["@event"],s:"[_0.stopPropagation()]"}}]}," ",{t:4,f:["..."],n:50,x:{r:["~/selections","."],s:"_0.indexOf(_1)"}}," ",{t:4,f:["..."],n:50,x:{r:[".","~/expanded"],s:"_0===_1"}}," ",{t:4,f:["..."],n:50,x:{r:["~/virtual.offset"],s:"_0>0"}}," ",{t:4,f:["..."],n:50,x:{r:["~/fixedHeader","~/virtual.offset"],s:"!_0&&_1>0"}}," ",{t:4,f:["..."],n:50,x:{r:["~/columns.0.type"],s:'_0==="boolean"'}}," ",{t:4,f:["..."],n:50,x:{r:["@this"],s:"_0._allSelected()"}}],empty:[{t:7,e:"div",f:[{t:7,e:"div",f:[{t:2,x:{r:["message"],s:'_0||"No data."'}}]}]}],pagination:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-pagination",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-info",g:1}],f:[{t:4,f:[{t:2,x:{r:["~/page","~/pagination.per"],s:"_0*_1+1"}}," - ",{t:2,x:{r:["~/pagination.total","~/rows.length","~/page","~/pagination.per"],s:"_2+1===_0?_1:(_2+1)*_3"}}," of ",{t:2,r:"~/rows.length"},{t:4,f:[" (",{t:2,r:"~/items.length"}," total)"],n:50,r:"~/isFiltered"}],n:50,x:{r:["pagination","rows.length"],s:"_0&&_1"}}," ",{t:4,f:["​"],n:50,x:{r:["_paginate"],s:"_0===1"}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-select-all-all",g:1}],f:[{t:4,f:[{t:7,e:"strong",f:[{t:2,r:"selections.length"}]}," of ",{t:7,e:"strong",f:[{t:2,r:"rows.length"}]}," selected",{t:4,f:[" - ",{t:7,e:"a",m:[{n:"href",f:"#",t:13,g:1},{n:["click"],t:70,f:"selectAllAll"}],f:["Select All"]}],n:50,x:{r:["@this","selections.length","rows.length"],s:"_0._allSelected()&&_1<_2"}}],n:50,x:{r:["selections.length"],s:"_0>0"}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-pages",g:1}],f:[{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","~/page"],s:'[_0.set("page",_1-1)]'}}],f:["Previous"]}],n:50,x:{r:["~/page"],s:"_0>0"}}," ",{t:4,f:[{t:4,f:[{t:7,e:"input",m:[{n:["change"],t:70,f:{r:["~/pagination.total","@node.value","@this","@node","~/page"],s:'[(/^\\d+$/.test(_1)&&+_1>0&&+_1<=_0&&_2.set("page",+_1-1))||_2.nodeSet(_3,"value",_4+1)]'}},{n:"value",f:[{t:2,r:"."}],t:13},{t:73,v:"t",f:"false"}]}],n:50,x:{r:[".","~/page"],s:"_0==_1+1"}},{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","@index","../"],s:'[_0.set("page",_2[_1-1])]'}}],f:["..."]}," "],n:50,x:{r:["."],s:'_0==="..."'},l:1},{t:4,f:[" ",{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","."],s:'[_0.set("page",_1-1)]'}}],f:[{t:2,r:"."}]}],n:51,l:1}],n:52,r:"~/pagination.array"}," ",{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","~/page"],s:'[_0.set("page",_1+1)]'}}],f:["Next"]}],n:50,x:{r:["~/page","~/pagination.total"],s:"_0<_1-1"}}]}]}]}},css:function(e){return[function(e){var t=Object.assign({},e("raui.primary"),e("raui.table.primary")),n=Object.assign({},t,e("raui.primary.active"),e("raui.table.primary.active")),r=Object.assign({selected:{},header:{},footer:{}},e("raui.table"));return"\n .rtable {\n display: flex;\n flex-direction: column;\n overflow: auto;\n max-width: 100%;\n max-height: 100%;\n box-sizing: border-box;\n flex-grow: 2;\n }\n \n .rtable.rtable-border {\n border: 1px solid "+(r.divider||t.bc||"#ccc")+";\n }\n \n .rtable-group > div > div,\n .rtable-header > div > div,\n .rtable-row > div > div {\n padding: "+(r.padding||"0.5em")+";\n overflow: inherit;\n text-overflow: inherit;\n line-height: 1em;\n }\n .rtable-row > .rtable-no-pad > div {\n padding: 0;\n }\n \n .rtable-auto .row > *,\n .rtable-fixed .row > *\n {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n \n .rtable-header > div > div, .rtable-column {\n overflow: hidden;\n }\n \n .rtable-number-column {\n text-align: right;\n }\n .rtable-date-column {\n text-align: right;\n }\n \n .rtable-sortable {\n cursor: pointer;\n user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n }\n \n .grid .row.rtable-row, .grid .rtable-header > .row {\n width: auto;\n min-width: min-content;\n flex-grow: 1;\n }\n \n .rtable-nowrap .grid .rtable-row, .rtable-nowrap .grid .rtable-header > .row {\n flex-wrap: nowrap;\n }\n .rtable-nowrap .rtable-row-wrap, .rtable-inner-row-wrap {\n flex-grow: 1;\n } \n \n .rtable-row-wrap {\n color: "+(t.fg||"#222")+";\n border-style: solid;\n border-color: "+(r.divider||t.bc||"#ccc")+";\n border-width: 0 0 1px 0;\n background-color: "+(r.even||t.bga||"#f4f4f4")+";\n }\n .rtable-row-wrap.rtable-odd {\n background-color: "+(r.odd||t.bg||"#fff")+";\n }\n .rtable-row-wrap:hover, .rtable-row-wrap.rtable-selected:hover, .rtable-row-wrap.rtable-odd.rtable-selected:hover {\n background-color: "+(r.over||n.bg||"#e6f0fa")+";\n position: relative;\n box-shadow: inset 1px 0 0 #dadce0,inset -1px 0 0 #dadce0, 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n z-index: 2;\n }\n .rtable-header.rtable-row-wrap:hover {\n box-shadow: none;\n }\n \n .rtable-row-wrap.rtable-selected {\n background-color: "+(r.selected.bg||"#cee5fd")+";\n color: "+(r.selected.fg||t.fg||"#222")+";\n }\n .rtable-row-wrap.rtable-selected.rtable-odd {\n background-color: "+(r.selected.odd||"#c5dffb")+";\n }\n \n .rtable-row-wrap {\n display: flex;\n flex-grow: 1;\n align-items: center;\n z-index: 2;\n align-items: stretch;\n }\n \n .rtable-nowrap .rtable-row-wrap {\n display: inline-flex;\n min-width: 100%;\n box-sizing: border-box;\n }\n \n .rtable-nowrap > .rtable-top > .grid {\n line-height: 1em;\n }\n \n .rtable-border .rtable-row .rtable-column,\n .rtable-border .rtable-group .rtable-column {\n border-color: "+(r.divider||t.bc||"#ccc")+";\n border-style: solid;\n border-width: 0 0 1px 1px;\n margin: 0 0 -1px -1px;\n }\n .rtable-border .rtable-header .rtable-column {\n margin-left: -1px;\n }\n .rtable-border .rtable-row .rtable-column:nth-child(1),\n .rtable-border .rtable-group .rtable-column:nth-child(1) {\n border-left-width: 0;\n }\n .rtable-border.rtable-with-select .rtable-row .rtable-column:nth-child(1),\n .rtable-border.rtable-with-select .rtable-group .rtable-column:nth-child(1) {\n border-left-width: 1px;\n }\n \n .rtable-border .rtable-row-wrap {\n border-bottom-width: 1px;\n }\n \n .rtable-border .rtable-row-expand, .rtable-border .rtable-row-extra {\n border-color: "+(r.divider||t.bc||"#ccc")+";\n border-style: solid;\n border-width: 1px 0 0 0;\n margin-left: -1px;\n width: 100%;\n }\n .rtable-border.rtable-with-select .rtable-row-expand, .rtable-border.rtable-with-select .rtable-row-extra {\n border-left-width: 1px;\n }\n \n .rtable-row-expand, .rtable-row-extra {\n box-sizing: border-box;\n padding: "+(r.padding||"0.5em")+";\n }\n \n .rtable-group {\n border-bottom: 2px solid "+(r.divider||t.bc||"#ccc")+";\n }\n \n .rtable-header.rtable-row-wrap, .rtable-header.rtable-row-wrap:hover {\n font-weight: bold;\n background-color: "+(r.header.bg||"#dedede")+";\n }\n .rtable-header-fixed {\n line-height: 1em;\n background-color: "+(r.header.bg||"#dedede")+";\n }\n \n .rtable-header.rtable-row-wrap, .rtable-header-extra.rtable-noheader {\n border-bottom: 2px solid "+(r.divider||t.bc||"#ccc")+";\n }\n \n .rtable-header-extra {\n background-color: "+(r.header.bg||"#dedede")+";\n padding: "+(r.padding||"0.5em")+";\n line-height: 1em;\n z-index: 4;\n box-sizing: border-box;\n min-width: 100%;\n }\n .rtable-nowrap .rtable-header-extra {\n position: sticky;\n left: 0;\n }\n \n .rtable-top {\n flex-grow: 5;\n flex-shrink: 1;\n overflow-y: auto;\n position: relative;\n }\n .rtable-fixed-header .rtable-header {\n position: relative;\n z-index: 3;\n }\n .rtable-fixed-header.rtable-scrolled-down .rtable-header-fixed {\n box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15), 0 0.25em 0.5em rgba(0,0,0,0.25);\n z-index: 3;\n }\n .rtable-fixed-header .rtable-top {\n margin-top: 0;\n }\n .rtable-nowrap.rtable-fixed-header .rtable-header-wrapper {\n flex-shrink: 0;\n width: 100%;\n overflow-x: auto;\n scrollbar-width: none;\n }\n .rtable-nowrap.rtable-fixed-header .rtable-header-wrapper::-webkit-scrollbar {\n height: 0;\n }\n .rtable-fixed-header .rtable-header-fixed::-webkit-scrollbar {\n width: 0;\n height: 0;\n }\n \n .rtable-nowrap .rtable-fixed-column, .rtable-nowrap .rtable-row-extra, .rtable-nowrap .rtable-row-expand {\n position: -webkit-sticky;\n position: sticky;\n left: 0;\n }\n .rtable-border..rtable-nowrap .rtable-fixed-column, .rtable-border.rtable-nowrap .rtable-row-extra, .rtable-border.rtable-nowrap .rtable-row-expand {\n left: 1px;\n }\n .rtable-nowrap.rtable-with-select .rtable-fixed-column, .rtable-nowrap.rtable-with-select .rtable-row-extra, .rtable-nowrap.rtable-with-select .rtable-row-expand {\n left: "+(r.selectWidth||"2em")+";\n }\n .rtabe-border.rtable-nowrap.rtable-with-select .rtable-fixed-column, .rtabe-border.rtable-nowrap.rtable-with-select .rtable-row-extra, .rtabe-border.rtable-nowrap.rtable-with-select .rtable-row-expand {\n left: "+(r.selectWidth||"2em")+";\n }\n \n .rtable-nowrap .rtable-inner-row-wrap {\n background-color: inherit;\n }\n \n .rtable-nowrap .row,\n .rtable-nowrap .rtable-fixed-column,\n .rtable-nowrap .rtable-select-row,\n .rtable-nowrap .rtable-select-header {\n background-color: inherit;\n z-index: 1;\n }\n \n .rtable-nowrap .rtable-select-row,\n .rtable-nowrap .rtable-select-header {\n position: sticky;\n position: -webkit-sticky;\n left: 0;\n z-index: 1;\n }\n .rtable-nowrap .rtable-select-header {\n z-index: 2;\n }\n \n .rtable-nowrap.rtable-border .rtable-fixed-column {\n border-right-width: 1px;\n }\n \n .rtable-scrolled-up .rtable-bottom {\n box-shadow: 0 -1px 2px 0 rgba(60, 64, 67, 0.3), 0 -1px 3px 1px rgba(60, 64, 67, 0.15), 0 -0.25em 0.5em rgba(0,0,0,0.25);\n z-index: 3;\n }\n .rtable-bottom {\n padding: "+(r.padding||"0.5em")+";\n background-color: "+(r.footer.bg||r.header.bg||"#dedede")+";\n border-top: 2px solid "+(r.divider||t.bc||"#ccc")+";\n }\n \n .rtable-pagination {\n display: flex;\n flex-wrap: wrap;\n flex-shrink: 0;\n justify-content: space-between;\n }\n \n .rtable-pages span {\n margin: 0.3em;\n cursor: pointer;\n }\n .rtable-pages span:first-of-type {\n margin-left: 0;\n }\n .rtable-pages input {\n text-align: center;\n width: 2.5em;\n font-size: 1em;\n background-color: transparent;\n border: none;\n padding: 0;\n font-weight: bold;\n text-decoration: underline;\n }\n \n /* checkboxes */\n .rtable-select {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n position: absolute;\n display: block;\n margin: 0;\n width: 2em;\n height: 2em;\n box-shadow: none;\n outline: none;\n opacity: 0;\n top: -4px;\n left: -1.5px;\n border-radius: 2em;\n transition: transform 0.2s, opacity 0.2s;\n background-color: "+(t.bc||"#ccc")+";\n cursor: pointer;\n }\n \n .rtable-select-header > div, .rtable-select-row > div, .rtable-header > div.rtable-select-header > div {\n padding: 0;\n overflow: visible;\n width: 1.5em;\n position: relative;\n line-height: 1.8em;\n cursor: pointer;\n display: flex;\n justify-content: space-around;\n align-items: center;\n flex-grow: 0;\n }\n \n .rtable-select:checked {\n background-color: "+(t.fga||"#07e")+';\n }\n \n .rtable-select-header:hover .rtable-select, .rtable-select-row:hover .rtable-select {\n opacity: 0.04;\n }\n \n .rtable-select:focus {\n opacity: 0.12;\n transform: scale(1);\n }\n \n .rtable-select-header:hover .rtable-select:focus, .rtable-select-row:hover .rtable.select:focus {\n opacity: 0.16;\n }\n \n .rtable-select:active {\n opacity: 0.4;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n \n .rtable-select-row > div:before, .rtable-select-header > div:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n border: solid 2px; /* Safari */\n border-color: '+(t.fg||"#222")+';\n border-radius: 2px;\n width: 18px;\n height: 18px;\n vertical-align: middle;\n transition: border-color 0.2s, background-color 0.2s;\n }\n \n .rtable-select-row > div:after, .rtable-select-header > div:after {\n content: "";\n display: block;\n position: absolute;\n top: -5px;\n left: 0px;\n width: 10px;\n height: 5px;\n border: solid 2px transparent;\n border-right: none;\n border-top: none;\n transform: translate(0.35em, 0.55em) rotate(-45deg);\n opacity: 0;\n }\n \n .rtable-selected .rtable-select-row > div:before, .rtable-all-selected > div:before {\n border-color: '+(t.fga||"#07e")+";\n background-color: "+(t.fga||"#07e")+";\n }\n \n .rtable-selected .rtable-select-row > div:after, .rtable-all-selected > div:after {\n border-color: "+(t.bg||"#fff")+";\n opacity: 1;\n }\n \n .rtable-row-wrap > .rtable-select-header,\n .rtable-row-wrap > .rtable-select-row {\n text-align: center;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: space-around;\n width: "+(r.selectWidth||"2em")+";\n }\n \n .rtable-column button, .rtable-column .btn {\n padding: 0 0.5em;\n margin: 0.2em 0.5em;\n min-height: 0;\n }\n \n .rtable-column.rtable-editing {\n padding: 0;\n }\n .rtable-column.rtable-editing input {\n width: 100%;\n box-sizing: border-box;\n height: 100%;\n margin: 0;\n border: none;\n background-color: transparent;\n padding: 0.25em 0.5em;\n }\n \n .rtable-valign-top .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-top > div {\n display: flex;\n height: 100%;\n align-items: flex-start;\n box-sizing: border-box;\n }\n .rtable-valign-bottom .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-bottom > div {\n display: flex;\n height: 100%;\n align-items: flex-end;\n box-sizing: border-box;\n }\n .rtable-valign-center .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-center > div {\n display: flex;\n height: 100%;\n align-items: center;\n box-sizing: border-box;\n }\n "+(e("table.includeGrid")?c(e):"")}.call(this,e)].join(" ")},cssId:"rtable",noCssTransform:!0,attributes:["paginate","items","filter","data-handler","sort-handler","sort","helpers","fixed","allow-select","allow-select-all","border","fixed-header","valign","no-header","empty","shuffle","no-wrap","parameters"],components:{table:!1,Table:!1},syncComputedChildren:!0,decorators:{grid:d,sized:o,scrollheader:function(e){var t=this,n=function(e){requestAnimationFrame(function(){return t.find(".rtable-header-wrapper").scrollLeft=e.target.scrollLeft})};return e.addEventListener("scroll",n,{passive:!0}),{teardown:function(){e.removeEventListener("scroll",n)}}}},events:{},use:[u({name:"clickd",count:1}),u({name:"dblclickd",count:2}),(void 0===S&&(S={}),function(e){e.instance.transitions[S.name||"expand"]=x}),(void 0===O&&(O={}),function(e){e.instance.decorators[O.name||"scrolled"]=w})],on:{construct:function(){var e,t,n,r,i,o,a,l=this.component;if(!l)return;var s=l.template.f||[],d=l.template.m?l.template.m.slice():[],c=l.template;l.template={e:c.e,f:c.f,t:c.t,m:d};var f=0;function u(e,t,n){if(e&&e.f&&1===e.f.length&&2===e.f[0].t){var r="_a"+f++;return d.push({t:13,n:r,f:e.f}),n?r:t?{t:[{t:2,r:"~/"+r}]}:{t:2,r:"~/"+r}}return e&&e.f}function h(e){var t=[],n=[];return e.forEach(function(e){if("column"===e.e||"col"===e.e){var r,i={},o=e.m||T;if(i.index=t.length,t.push(i),i.content=(e.f||[]).filter(function(e){return"edit"!==e.e}),(r=o.find(function(e){return"id"===e.n}))&&_(r.f)&&(i.id=r.f),i.label=o.find(function(e){return"label"===e.n}),i.label&&i.label.f&&(i.label=u(i.label)),i.label||(i.label=""),i.id||(i.id=i.label),Array.isArray(i.label)||(i.label=[i.label]),i.type=o.find(function(e){return"type"===e.n}),i.type&&i.type.f&&(i.type=i.type.f),i.type||(i.type="string"),i.filter=o.find(function(e){return"filter"===e.n}),i.filter&&i.filter.f&&(i.filter=u(i.filter),i.filter.r&&(i.filter=i.filter.r)),i.sort=o.find(function(e){return"sort"===e.n}),i.sort&&i.sort.f&&(i.sort=u(i.sort),i.sort.r&&(i.sort=i.sort.r)),i.dir=o.find(function(e){return"dir"===e.n}),i.dir&&i.dir.f&&(i.dir=u(i.dir),i.dir.r&&(i.dir=i.dir.r)),i.hidden=o.find(function(e){return"hidden"===e.n}),i.hidden&&0===i.hidden.f?i.hidden=!0:i.hidden&&k(i.hidden.f)?i.hidden=u(i.hidden):i.hidden=!1,_(i.hidden)&&(i.hidden=!1),i.noPad=o.find(function(e){return"no-pad"===e.n}),i.noPad&&0===i.noPad.f?i.noPad=0:i.noPad&&k(i.noPad.f)?i.noPad=u(i.noPad):delete i.noPad,i.editable=o.find(function(e){return"editable"===e.n}),i.editable&&0===i.editable.f?i.editable=!0:i.editable&&k(i.editable.f)?i.editable=u(i.editable):i.editable=!1,i.valign=o.find(function(e){return"valign"===e.n}),i.valign&&k(i.valign.f)?i.valign=u(i.valign):i.valign&&"string"==typeof i.valign.f&&(i.valign=i.valign.f),i.fixed=o.find(function(e){return"fixed"===e.n}),i.fixed&&k(i.fixed.f)?i.fixed={path:u(i.fixed,!1,!0)}:i.fixed&&"string"==typeof i.fixed.f&&(i.fixed=i.fixed.f),(r=o.find(function(e){return"get"===e.n}))&&r.f){var a=u(r,!1,!0);field.get=function(e){var t=this.get(a);return"function"==typeof t?t.call(this,e):void 0}}i.attrs=o.filter(function(e){return!~L.indexOf(e.n)}),i.attrs.forEach(function(e,t){W.test(e.n)&&(i.attrs[t]={t:13,n:"class-"+e.n})})}else if("field"===e.e){var l,s={},d=e.m||T;if(_(l=d.find(function(e){return"path"===e.n}))?s.path=l:l&&l.f&&(s.path=u(l)),(l=d.find(function(e){return"value"===e.n}))&&l.f&&(s.value=u(l)),_(l=d.find(function(e){return"type"===e.n}))?s.type=l:l&&l.f&&(s.type=u(l)),_((l=d.find(function(e){return"id"===e.n})).f)&&(s.id=l.f),_(l=d.find(function(e){return"dir"===e.n}))?s.dir=l:l&&_(l.f)&&(s.dir=l.f),_(l=d.find(function(e){return"label"===e.n}))?s.label=l:l&&l.f&&(s.label=u(l)),(l=d.find(function(e){return"get"===e.n}))&&l.f){var c=u(l,!1,!0);s.get=function(e){var t=this.get(c);return"function"==typeof t?t.call(this,e):void 0}}s.id||(s.id=s.label),s.path||(s.path=s.id),n.push(s)}}),{fields:n,columns:t}}e=s.find(function(e){return"expand"===e.e}),t=s.find(function(e){return"group"===e.e}),n=s.find(function(e){return"wrapper"===e.e}),r=s.find(function(e){return"row"===e.e}),i=s.find(function(e){return"top"===e.e}),o=s.find(function(e){return"bottom"===e.e}),this._init={sets:h(s),partials:{}};var p=this._init.sets.columns;this._init.sets["meta.expand"]=e&&e.f&&e.f.length&&e.f,this._init.sets["meta.extra"]=r&&r.f&&r.f.length&&r.f,this._init.sets["meta.top"]=i&&i.f&&i.f.length&&i.f,this._init.sets["meta.topAttrs"]=i&&i.m,this._init.sets["meta.bottom"]=o&&o.f&&o.f.length&&o.f,this._init.sets["meta.bottomAttrs"]=o&&o.m;var b=[{n:"gridValue",x:{r:"~/gridValue"}},{n:"gridName",x:{r:"~/gridName"}},{n:"gridSize",x:{r:"~/tableWidth"}},{n:"gridMax",x:{r:"~/gridMax"}},{n:"table",x:{r:"@this"}}],g=[{t:7,e:"div",m:[{t:13,n:"class-rtable-row-wrap"},{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-header"},{t:4,f:[{n:"style-opacity",f:"0",t:13}],n:50,x:{r:["~/fixedHeader","~/virtual.offset"],s:"!_0&&_1>0"}},{t:4,n:50,r:"~/fixedHeader",f:[{t:13,n:"style-padding-right",f:[{t:2,r:"~/scrollOffset"},"px"]}]}],f:[{t:7,e:"div",f:p.filter(function(e){return!0!==e.hidden}).map(function(e,t){e.attrsHP=e.attrs.filter(function(e){return"title"!==e.n});var n={t:7,e:"div",f:[{t:7,e:"div",f:e.label}],m:[{t:4,n:53,r:"~/columns."+t,f:[{t:70,n:["click"],f:{r:["@this",".index","@event"],s:"[_0._setSort(_1,_2)]"}}]},{t:13,n:"title",f:e.label},{t:16,r:"~/columns."+t+".attrsHP",z:b}]};if(e.type&&n.m.push({t:13,n:"class-rtable-"+e.type+"-column"}),(e.filter||e.sort)&&n.m.push({t:13,n:"class-rtable-sortable"}),n.m.push({t:13,n:"class-rtable-column"}),e.fixed){var r=e.fixed.path||"~/columns."+t+".fixed";n.m.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:r}]}),n.m.push({t:4,n:50,x:{r:["~/noWrap",r],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:r}]}]})}var i=n;return e.hidden&&e.hidden.r&&(i={t:4,n:51,r:e.hidden.r,f:[n]}),i}),m:[{t:13,n:"class-row"}]}]}];g[0].f.unshift({t:4,n:50,r:"~/allowSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-header"},{t:13,n:"class-rtable-column"},{t:13,n:"title",f:[{t:2,r:"selections.length"}," items selected"]},{t:13,n:"class-rtable-all-selected",f:[{t:2,x:{r:["@this"],s:"_0._allSelected()"}}]}],f:[{t:7,e:"div",f:[{t:4,n:50,r:"~/allowSelectAll",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["@this"],s:"_0._allSelected()"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:"selectAll"}]}]}],m:[{t:70,n:["clickd"],f:"selectAll"}]}]}]});var v,m=[{t:7,e:"div",m:[{t:13,n:"class-rtable-row-wrap"},{t:13,n:"class-rtable-odd",f:[{t:2,x:{r:["@index","~/virtual.offset"],s:"(_0+_1)%2===1"}}]},{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-live"},{t:13,n:"class-rtable-selected",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-inner-row-wrap"}],f:[{t:7,e:"div",f:p.filter(function(e){return!0!==e.hidden}).map(function(e,t){var n=[{t:7,e:"div",f:[{t:16,r:"~/columns."+t+".content",c:{r:"."},z:b}]}];e.attrs.length?(e.attrsP=e.attrs,e.attrs=[{t:16,r:"~/columns."+t+".attrsP",c:{r:"."},z:b}]):e.attrs=[];var r=e.attrs;if(e.fixed){var i=e.fixed.path||"~/columns."+t+".fixed";r.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:i}]}),r.push({t:4,n:50,x:{r:["~/noWrap",i],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:i}]}]})}if(e.editable&&e.filter){var o={t:70,n:["click","mousedown","pointerdown","MSPointerDown","touchstart"],f:{r:["@event"],s:"[_0.stopPropagation()]"}},a=[{t:4,n:50,x:{r:["~/columns."+t+".type"],s:"_0==='boolean'"},f:[{t:7,e:"input",m:[{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,r:e.filter}]},o]}]},{t:4,n:51,l:1,f:[{t:7,e:"input",m:[{t:13,n:"value",f:[{t:2,r:e.filter}]},o]}]}];"object"==typeof e.editable?(r.push({t:13,n:"class-rtable-editing",f:e.editable}),n=[Object.assign({},e.editable,{t:4,n:50,f:a}),{t:4,n:51,l:1,f:n}]):(r.push({t:13,n:"class-rtable-editing"}),n=a)}e.valign&&r.push({t:13,n:"class-rtable-valign-col-top",f:[{t:2,x:{r:["~/columns."+t+".valign"],s:"_0==='top'"}}]},{t:13,n:"class-rtable-valign-col-bottom",f:[{t:2,x:{r:["~/columns."+t+".valign"],s:"_0==='bottom'"}}]},{t:13,n:"class-rtable-valign-col-center",f:[{t:2,x:{r:["~/columns."+t+".valign"],s:"_0==='center'"}}]});var l={t:7,e:"div",f:n,m:r};e.type&&r.unshift({t:13,n:"class-rtable-"+e.type+"-column"}),r.push({t:13,n:"class-rtable-column"});var s=e.attrsP&&e.attrsP.find(function(e){return"title"===e.n});s?s.f||(r.unshift({t:13,n:"title",f:e.content.find(function(e){return e.e})?e.label:e.content}),e.attrsP.splice(r.indexOf(s),1)):r.unshift({t:4,n:50,r:"~/autoTitles",f:[{t:13,n:"title",f:e.content.find(function(e){return e.e})?e.label:e.content}]}),0===e.noPad?r.push({t:13,n:"class-rtable-no-pad"}):e.noPad&&r.push({t:13,n:"class-rtable-no-pad",f:e.noPad});var d=l;return e.hidden&&e.hidden.r&&(d={t:4,n:51,r:e.hidden.r,f:[l]}),d}),m:[{t:13,n:"class-row"},{t:13,n:"class-rtable-row"},{t:70,n:e&&e.f?["dblclickd"]:["click","dblclick"],f:{r:["~/rows","~/visibleRows","."],s:"[['selected',_2,_0.indexOf(_2),_1.indexOf(_2)]]"}}]}]}]}];r&&r.m&&r.m.length&&(this._init.sets.rowAttrs=r.m.slice(),m[0].f[0].f[0].m.push({t:16,r:"~/rowAttrs",c:{r:"."},z:b}));n&&n.m&&n.m.length&&(this._init.sets.wrapperAttrs=n.m.slice(),m[0].m.push({t:16,r:"~/wrapperAttrs",c:{r:"."},z:b}));r&&r.f&&r.f.length&&m[0].f[0].f.push({t:7,e:"div",m:[{t:13,n:"class-rtable-row-extra"},{t:4,n:50,r:"~/noWrap",f:[{t:13,n:"style-width",f:[{t:2,x:{r:["~/tableWidth","~/allowSelect","@style.raui.table.selectWidth"],s:"_1?'calc('+_0+'px - '+(_2||'2em')+')':_0+'px'"}}]}]}],f:[{t:16,r:"~/meta.extra",c:{r:"."},z:b}]});e&&e.f&&e.f.length&&(m[0].f[0].f.push({t:4,n:50,x:{r:[".","~/expanded"],s:"_0===_1"},f:[{t:7,e:"div",f:[{t:7,e:"div",f:[{t:16,r:"~/meta.expand",c:{r:"."},z:b}]}],m:[{t:13,n:"class-rtable-row-expand"},{t:4,n:50,r:"~/noWrap",f:[{t:13,n:"style-width",f:[{t:2,x:{r:["~/tableWidth","~/allowSelect","@style.raui.table.selectWidth"],s:"_1?'calc('+_0+'px - '+(_2||'2em')+')':_0+'px'"}}]}]}]}]}),m[0].f[0].f[0].m.push({t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._expand(_1)]"}}),m[0].f[0].m.push({t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._expand(_1)]"}}));if(m[0].f.unshift({t:4,n:50,r:"~/allowSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-row"},{t:13,n:"class-rtable-column"},{t:70,n:["clickd"],f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}}],f:[{t:7,e:"div",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}}]}]}]}]}),t&&t.m&&(v=t.m.find(function(e){return"by"===e.n}))&&(_(v.f)||1===v.length&&2===v[0].t)){var x={t:4,n:50,f:[{t:7,e:"div",m:[{t:13,n:"class-row"},{t:13,n:"class-rtable-group"},{t:13,n:"class-rtable-selected",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]},{t:70,n:e&&e.f?["dblclickd"]:["click","dblclick"],f:{r:["~/rows","~/visibleRows","."],s:"[['selected',_2,_0.indexOf(_2),_1.indexOf(_2)]]"}}].concat(t.m.filter(function(e){return"by"!==e.n&&"select"!==e.n}))}],x:{s:"_0&&_1[(_1&&(_2*_3+_4))||_4]",r:["~/showGroups","~/groups","~/page","~/pagination.per","@index"]}};m.unshift(x),this._init.by=v.f;var w,y=h(t.f).columns.filter(function(e){return!0!==e.hidden}).map(function(e){var t={t:7,e:"div",f:[{t:7,e:"div",f:e.content}],m:e.attrs};e.type&&t.m.unshift({t:13,n:"class-rtable-"+e.type+"-column"}),t.m.push({t:13,n:"class-rtable-column"}),t.m.find(function(e){return"title"===e.n})||t.m.unshift({t:13,n:"title",f:e.content});var n=t;return e.hidden&&e.hidden.r&&(n={t:4,n:51,r:e.hidden.r,f:[t]}),n});y.unshift({t:4,n:50,r:"~/allowGroupSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-row"},{t:13,n:"class-rtable-column"},{t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._selectGroup(_1),false]"}},{t:13,n:"class-rtable-all-selected",f:[{t:2,x:{r:["@this","@index"],s:"_0._groupSelected(_1)"}}]}],f:[{t:7,e:"div",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["@this","@index"],s:"_0._groupSelected(_1)"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:{r:["@this","@index"],s:"[_0._selectGroup(_1),false]"}}]}]}]}]}),(w=t.m.find(function(e){return"select"===e.n}))&&(a||(a=[])).push(Object.assign({},w,{n:"allowGroupSelect"})),(w=t.m.find(function(e){return"show"===e.n}))&&(a||(a=[])).push(Object.assign({},w,{n:"showGroups"})),x.f[0].f=y}this._init.partials["grid-row"]=m,this._init.partials["grid-head"]=g,a&&this.component&&(this.component.mappings=a)},config:function(){this.set(this._init.sets),Object.assign(this.partials,this._init.partials)},render:function(){this._autoObserver&&this._autoObserver.fire()},selectAll:function(){var e,t;return this._allSelected()?(t=null,e=[],this.set({selections:e,selected:t})):(t=(e=("virtual"===this.get("paginate")?this.get("rows"):this.get("visibleRows")).slice())[0],this.set({selections:e,selected:t})),this.fire("selection",{},{item:t,items:e}),!1},selectAllAll:function(){var e=this.get("rows").slice();return this.set({selections:e,selected:null}),this.fire("selection",{},{item:null,items:e}),!1}},observe:{_rows:function(){var e=this;this._rowbounce&&clearTimeout(this._rowbounce),setTimeout(function(){return e._rows()},this.get("@style.raui.table.debounce")||160)},paginate:{handler:function(e){var n=this;if("auto"===e||"virtual"===e||e instanceof t){this._autoObserver&&this._autoObserver.cancel(),this._scrollListener&&this._scrollListener.cancel();("auto"===e||"virtual"===e)&&this.root;var r,i=!1,o=function(){if(n.rendered){var t=n.find(".rtable-top");if(t)if(n.get("items.length")){var r=t.clientHeight+","+t.clientWidth;if(o.last!==r||!i){var a=n.getContext(t);a.decorators&&a.decorators.scrolled&&a.decorators.scrolled.refresh();var l=n.find(".rtable-header")||{},s=Array.apply(null,n.findAll(".rtable-live")).map(function(e){return e.offsetHeight});if(s.length<5){var d=Math.floor(t.clientHeight/(l.offsetHeight||1));d<5&&(d=5),n.set("_paginate",d),s=Array.apply(null,n.findAll(".rtable-live")).map(function(e){return e.offsetHeight})}s.length>0?i=!0:s=[25];var c=Math.ceil(s.reduce(function(e,t){return e+t},0)/s.length);n._avgSize=c;var f=Math.floor((t.clientHeight-(l.offsetHeight||1))/c);"virtual"===e&&(f+=10)<30&&(f=30),n.set("_paginate",f),o.last=r}}else n._autoLenObserver||(n._autoLenObserver=n.observeOnce("items",function(){n._autoLenObserver=0,setTimeout(o)}))}},a=function(){r&&clearTimeout(r),r=setTimeout(function(){o(),r=null,i&&n._scrollListener&&n._scrollListener.fn()},50)};if(this._autoObserver=this.observe("~/tableHeight",a),this._autoObserver.fire=a,"virtual"===e){var l,s=!1,d=function(){if(n.rendered){if(l||(l=n.find(".rtable-top")),!i)return a();var e=l.scrollTop,t=n.get("virtual")||{},r=t.offset,o=n.get("_paginate"),d=o-10,c=n.get("rows.length");o>c&&(o=c);var f=n._avgSize,u=d*f,h=Math.floor(e/f)-5;h<0&&(h=0);var p=h;if(h+o>c&&(h=c-o),r===h&&!isNaN(t.top))return s=!1;if(!y(r)||isNaN(r)||isNaN(t.top)||e<t.top+u||e>t.bottom-u||r>0&&e<f*d){var b=p,g=c-p-o;b<0?(g+=-1*b,b=0):b>c-o&&(b=c-o),g<0&&(g=0);var v,m,x=b*f,w=g*f;h<r+o&&h>r-o&&(v=h>r?n.findAll(".rtable-live")[h-r]:n.findAll(".rtable-live")[r-h]),v&&h>0&&v.offsetTop>l.scrollTop-u-5&&v.offsetTop<l.scrollTop+u&&(m=v.offsetTop),n.set({"virtual.above":x,"virtual.below":w,"virtual.offset":h}),"number"==typeof m&&m!==v.offsetTop&&n.set("virtual.above",x+(m-v.offsetTop)),n.set({"virtual.top":n.get("virtual.above"),"virtual.bottom":l.scrollHeight-w})}s=!1}else l=null},c=this._scrollListener=this.on("scroll",function(e){e.node;s||(s=!0,requestAnimationFrame(d))});c.fn=d,c.observer=this.observe("rows.length",function(){n.set("virtual.offset",null),d()},{init:!1,strict:!0,defer:!0});var f=c.cancel;c.cancel=function(){f(),c.observer.cancel()}}a()}else this._autoObserver&&this._autoObserver.cancel(),this._scrollListener&&this._scrollListener.cancel();y(e)&&this.set("_paginate",e)},defer:!0},"scrollOffset tableHeight":{handler:function(){var e=this;requestAnimationFrame(function(){var t=e.find(".rtable-top"),n=t&&e.getContext(t);n&&n.decorators&&n.decorators.scrolled&&n.decorators.scrolled.refresh()})},init:!1}},data:function(){return Object.assign({page:0,selections:[],showGroups:!0,allowGroupSelect:!0,expanded:null,minPerPage:10,virtual:{offset:0},shuffle:!1,rows:[]},P.settings)},computed:{allowSelect:function(){return this.get("allow-select")},allowSelectAll:function(){return this.get("allow-select-all")},fixedHeader:function(){return this.get("fixed-header")},autoTitles:function(){return this.get("auto-titles")},noHeader:function(){return this.get("no-header")},noWrap:function(){return this.get("no-wrap")},_rows:function(){var e=(this.get("items")||[]).slice(),t=this.get("filter"),n=this.get("sort"),r=this.get("parameters"),i=(this.get("data-handler"),this.get("@style.raui.table.data-handler"),[this.get("data-pre-handler"),this.get("@style.raui.table.data-pre-handler")]),o=i[0],a=i[1];return(o||a)&&(o||a)(this,e,t,n,r),{}},visibleRows:function(){var e=this,n=this.get("rows"),r=this.get("paginate"),i=r,o=this.get("_paginate"),a=this.get("page")||0,l=this.get("virtual");return i?("number"!=typeof i&&isNaN(+i)&&(i="auto"===i||"virtual"===i||i instanceof t?o||1:30),i<this.get("minPerPage")&&(i=this.get("minPerPage")),"virtual"===r?(a=l&&l.offset||0,n.slice(a,a+i)):(a*i>n.length&&setTimeout(function(){return e.set("page",0)},0),n.slice(i*a,i*a+i))):n},pagination:function(){var e=this.get("items")||T,t=this.get("rows"),n=this.get("paginate"),r=n,i=this.get("page")||0;if("number"!=typeof r&&isNaN(r)&&(r=this.get("_paginate")),r<this.get("minPerPage")&&(r=this.get("minPerPage")),r){var o=Math.ceil(t.length/r),a={max:Math.ceil(e.length/r),total:o,per:r};if("virtual"===n&&(a.height=this._avg*t.length),a.total>14){var l=a.array=[];i>5?l.push(1,2,3,"..."):l.push(1,2,3,4,5,6,7,8),i>5&&i+6<o?l.push(i-1,i,i+1,i+2,i+3,"...",o-2,o-1,o):i+6<o?l.push("...",o-2,o-1,o):l.push(o-7,o-6,o-5,o-4,o-3,o-2,o-1,o)}else a.array=Array.apply(null,{length:a.total}).map(function(e,t){return t+1});return a}},groups:function(){for(var e,t,n=this.get("rows"),r={},i=0;i<n.length;i++)(t=n[i][this._init.by])!=e&&(r[i]=1),e=t;return r}}});var E=/^[^\d]*/;function A(e){return y(e)?e:e&&(e=(""+e).replace(E,""))?parseFloat(e):1/0}function H(e,n,r){if("function"==typeof n.get)return n.get;var i=(r?n.sort:0)||n.path||n.filter||n.id;if("string"==typeof i){var o=t.splitKeypath(i);return function(e){for(var t=e,n=0;n<o.length;n++)t=t&&t[o[n]];return t}}}function z(e,t,n,r){var i=[].concat(e.viewmodel.value.columns,e.viewmodel.value.fields),o=i.reduce(function(e,t){return e[t.id]=H(0,t),e},{}),a=Object.values(o),l=t||[];if((n instanceof RegExp||_(n))&&n){var s=n===""+n.toLowerCase()||n===""+n.toUpperCase();try{var d=_(n)?new RegExp(n,s?"i":""):n;l=l.filter(function(e){for(var t=a.length;t--;){var n=e&&a[t](e);if(n&&d.test(n))return!0}})}catch(e){}}return(_(r)||k(r)&&!Array.isArray(r))&&(r=[r]),Array.isArray(r)&&(r=r.map(function(t){if(_(t)){var n="-"===t[0]||"+"===t[0]?t.substr(1):t,r=i.find(function(e){return e.id===n});if(!r)return;var o={get:H(0,r,!0),dir:"-"===t[0]?-1:1};if(r&&"number"===r.type){var a=o.get;o.get=function(t){return A(a.call(e,t))}}return o}if(t&&"object"==typeof t){var l=i.find(function(e){return e.id===id});if(!l)return;var s={dir:y(t.dir)?t.dir:"desc"===t.dir?-1:1,get:H(0,l,!0)};if("number"===t.type||l&&"number"===l.type){var d=s.get;s.get=function(t){return A(d.call(e,t))}}return s}}).filter(function(e){return e&&e.get}),l.sort(function(t,n){for(var i,o,a,l=0;l<r.length;l++)if(i=r[l].get.call(e,t),o=r[l].get.call(e,n),0!==(a=r[l].dir*(i<o?-1:i>o?1:0)))return a;return a})),l}var L=["label","type","filter","hidden","sort","no-pad","id","editable","fixed"],W=/^[a-z]{1,3}[0-9]+(?:-[0-9]+)?$/,T=[];function j(e){return void 0===e&&(e={}),function(t){var n=t.Ractive,r=t.instance;"includeGrid"in e&&n.styleSet("table.includeGrid",e.includeGrid),r.components[e.name||"data-table"]=P}}i("RMTable","components",P),e.Table=P,e.numberify=A,e.plugin=j,e.default=j,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],t):t(e.RMTable={},e.Ractive)}(this,function(e,t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var n,r="undefined"!=typeof window?window:null;function i(e,t,n){if(r&&r.Ractive&&"object"==typeof r.Ractive[t]){var i=document.currentScript;if(i||(i=(i=document.querySelectorAll("script"))[i.length-1]),i){var o=i.getAttribute("data-alias");o&&(o=(o=o.split("&")).reduce(function(e,t){var n=t.split("="),r=n[0],i=n[1];return e[r]=i,e},{})),Ractive[t][o&&o[e]||e]=n}}}function o(e,t){var n=t.context||this.getContext(e),r={position:e.style.position,overflowY:e.style.overflowY};""!==e.style.position&&"static"!==e.style.position||(e.style.position="relative");var i=document.createElement("object");i.setAttribute("style","display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"),i.type="text/html";var o=function(){t.offsetWidth&&n.set(t.offsetWidth,e.offsetWidth),t.offsetHeight&&n.set(t.offsetHeight,e.offsetHeight),t.clientWidth&&n.set(t.clientWidth,e.clientWidth),t.clientHeight&&n.set(t.clientHeight,e.clientHeight),t.diffWidth&&n.set(t.diffWidth,e.offsetWidth-e.clientWidth),t.diffHeight&&n.set(t.diffHeight,e.offsetHeight-e.clientHeight)};return i.onload=function(){i.contentDocument.defaultView.addEventListener("resize",o),o()},/Trident/.test(navigator.userAgent)?(e.appendChild(i),i.data="about:blank"):(i.data="about:blank",e.appendChild(i)),{refresh:o,teardown:function(){e.removeChild(i),e.style.position=r.position,e.style.overflowY=r.overflowY}}}var a={tiny:{units:[2,3,4,5,6,8],max:"0",value:0},xsmall:{units:[2,3,4,5,6,8,10,12],max:"20em",prefix:"xs",value:10},small:{units:[2,3,4,5,6,8,10,12],max:"36em",value:20},medium:{units:[2,3,4,5,6,8,10,12],max:"48em",value:30},large:{units:[2,3,4,5,6,8,10,12,16,20],max:"64em",value:40},xlarge:{units:[2,3,4,5,6,8,10,12,16,20],max:"100em",value:50},ginormous:{units:[2,3,4,5,6,8,10,12,16,20],max:"150em",value:60}},l={"grid grid-root":/\bgrid grid-root\b/g},s=/\s+/g;function d(e,t){var r,i,d=this.getContext(e),c=this,f=t||{};function u(t){if("number"==typeof f.offset&&(t-=f.offset),!f.type||"class"===f.type){var n,o=e.className,a=-1;for(var c in r)l[c].lastIndex=-1,r[c]<=t?(l[c].test(o)||(o+=" "+c),r[c]>a&&(a=r[c],n=c)):o=o.replace(l[c],"").trim();if(e.className=o.replace(s," "),!n)return;f.value&&d.set(f.value,i[n].value),f.name&&d.set(f.name,n),f.size&&d.set(f.size,t),f.max&&d.set(f.max,a)}}function h(){var t=(n||(n=document.createElement("div"),document.body.appendChild(n)),n);for(var o in i=c.get("@style.break")||a,r={},i)t.style.width=i[o].max,r[o]=t.clientWidth,l[o]||(l[o]=new RegExp("\\b"+o+"\\b","g"));t.style.width=0,u(e.clientWidth)}var p=this.observe("@style.break",h,{init:!1}),b=d.observe("@local.width",u,{init:!1}),g=o.call(this,e,{clientWidth:"@local.width"});return e.className+=" grid grid-root",f.immediate?h():requestAnimationFrame(h),{update:function(t){f=t||{},requestAnimationFrame(function(){return u(e.clientWidth)})},teardown:function(){e.className=e.className.replace(l["grid grid-root"],"").trim(),b.cancel(),p.cancel(),g.teardown()}}}function c(e,t){var n=e("raui.grid.break")||t||a,r=(e("raui.grid.wrappers")||[".row-wrap > ",".row-wrap > .row-wrap > "]).slice();r.unshift("");var i=".row > * { position: relative; width: 100%; transition-duration: 0.2s; transition-timing-function: ease-in-out; transition-property: padding, margin; box-sizing: border-box; }\n.grid { display: block; }\n.grid .row { display: flex !important; flex-wrap: wrap; min-height: fit-content; width: 100%; align-content: flex-start; }\n.grid .row.row-pad > * { padding: "+(e("raui.grid.padding")||"0.5em")+"; }\n.grid .row > .pad { display: flex; flex-direction: column; padding: "+(e("raui.grid.padding")||"0.5em")+"; box-sizing: border-box; }",o=Object.keys(n).map(function(e){return(n[e].key=e)&&n[e]});return o.sort(function(e,t){return e.value>t.value?1:e.value<t.value?-1:0}),o.forEach(function(t){var n=t.prefix||t.key[0],o={};t.units.forEach(function(e){for(var t=1;t<e;t++){var n=""+t/e*100;n=n.substr(0,n.indexOf(".")+3),o[n]||(o[n]=[]),o[n].push(t+"-"+e)}});var a=t.key;i+="\n"+[r.map(function(e){return"."+a+" > "+e+"."+n+"1, ."+a+" > "+e+".row > ."+n+"1"}).join(", "),"."+a+" ."+n+"-n1, ."+a+" .row-"+n+"-n1 > *"].filter(function(e){return e}).join(", ")+" { display: "+(e("raui.grid.display")||"inline-block")+"; width: 100%; flex-grow: 0; flex-shrink: 0; }\n"+[r.map(function(e){return"."+a+" > "+e+"."+n+"0, ."+a+" > "+e+".row > ."+n+"0"}).join(", "),"."+a+" ."+n+"-n0, ."+a+" .row-"+n+"-n0 > *"].filter(function(e){return e}).join(", ")+" { display: none; flex-grow: 0; flex-shrink: 0: }\n"+Object.keys(o).map(function(t){return o[t].map(function(e){return""+[r.map(function(t){return"."+a+" > "+t+".row-"+n+e+" > *, ."+a+" > "+t+"."+n+e+", ."+a+" > "+t+".row > ."+n+e}).join(", "),"."+a+" .row-"+n+"-n"+e+" > * .row > ."+n+"-n"+e+", ."+a+" ."+n+"-n"+e+", ."+a+" .row-"+n+"-n"+e+" > *"].filter(function(e){return e}).join(", ")}).join(", ")+" { display: "+(e("raui.grid.display")||"inline-block")+"; width: "+t+"%; flex-grow: 0; flex-shrink: 0; }"}).join("\n")+"\n"+[r.map(function(e){return"."+a+" > "+e+".row > "+n+"-fill, ."+a+" >"+e+".row > ."+n+"-auto"}).join(", "),"."+a+" ."+n+"-nfill, ."+a+" ."+n+"-nauto"].filter(function(e){return e}).join(", ")+" { display: "+(e("raui.grid.display")||"inline-block")+"; width: auto; flex-grow: 1; flex-shrink: 1; }"}),i}d.style=c,i("grid","decorators",d);var f=250;function u(e){return void 0===e&&(e={}),function(t){var n=t.Ractive;t.instance.events[e.name||(e.count||"")+"clicks"]=function(t,r,i){var o,a=Object.assign({},e,i);return(o=t.__r_clicks__)?o.subscribe(a.count||1,!!a.hold,r):(o=new h(n.getContext(t),a.delay||f,a.bubble||!1),t.__r_clicks__=o,o.subscribe(a.count||1,!!a.hold,r)),{teardown:function(){o.unsubscribe(a.count||1,!!a.hold,r)}}}}}u({name:"click",count:1}),u({name:"dblclick",count:2}),u({name:"trpclick",count:3});var h=function(e,t,n){this.context=e,this.node=e.node,this.delay=t,this.fires={},this.refs=0,this.bubble=n,this.bind()};function p(e){return this.__r_clicks__.mousedown(e)}function b(e){return this.__r_clicks__.touchdown(e)}function g(){this.addEventListener("keydown",m,!1),this.addEventListener("blur",v,!1)}function v(){this.removeEventListener("keydown",m,!1),this.removeEventListener("blur",v,!1)}function m(e){if(32===e.which||10===e.which||13===e.which)return this.__r_clicks__.fire()}function x(e,t){var n=e.processParams(t,{duration:200,easing:"easeInOut"});return new Promise(function(t){requestAnimationFrame(function(){e.setStyle("overflow","hidden");var r="x"===n.axis?"width":"height";if(e.isIntro||n.intro){var i=e.getStyle(r);e.setStyle(r,0),e.setStyle("opacity",0),t(e.animateStyle(r,i,n).then(function(){return e.animateStyle("opacity",1,n)}).then(function(){e.setStyle(r,""),e.setStyle("overflow","")}))}else e.setStyle(r,e.getStyle(r)),e.setStyle("opacity",1),t(e.animateStyle("opacity",0,n).then(function(){return e.animateStyle(r,0,n)}))})})}function w(e,t){void 0===t&&(t={});var n="string"==typeof t?t:t.bind;if("string"!=typeof n)return{teardown:function(){}};var r=t.allow||2,i=this.getContext(e);function o(){var t="";e.scrollHeight>e.clientHeight&&(t+="vscroll"),e.scrollWidth>e.clientWidth&&(t+=(t?" ":"")+"hscroll"),e.scrollTop<=r&&(t+=" top"),e.scrollTop>=e.scrollHeight-e.clientHeight-r&&(t+=" bottom"),~t.indexOf("top")||~t.indexOf("bottom")||(t+=" vmiddle"),e.scrollLeft<=r&&(t+=" left"),e.scrollLeft>=e.scrollWidth-e.clientWidth-r?t+=" right":~t.indexOf("left")||~t.indexOf("right")||(t+=" hmiddle"),i.set(n,t)}return e.addEventListener("scroll",o,{passive:!0}),requestAnimationFrame(o),{refresh:o,teardown:function(){e.removeEventListener("scroll",o)}}}function _(e){return"string"==typeof e}function y(e){return"number"==typeof e}function k(e){return"object"==typeof e}h.prototype.subscribe=function(e,t,n){(this.fires[e+","+t]||(this.fires[e+","+t]=[])).push(n),this.refs++},h.prototype.unsubscribe=function(e,t,n){var r=this.fires[e+","+t]||[];r.splice(r.indexOf(n),1),this.refs--,this.refs||this.teardown()},h.prototype.bind=function(){window.PointerEvent||window.navigator.pointerEnabled?this.context.listen("pointerdown",p):window.navigator.msPointerEnabled?this.context.listen("MSPointerDown",p):(this.context.listen("mousedown",p),this.context.listen("touchstart",b)),"A"!==this.node.tagName&&"BUTTON"!==this.node.tagName&&"button"!==this.node.type&&"submit"!==this.node.type&&"checkbox"!==this.node.type&&"radio"!==this.node.type||this.context.listen("focus",g)},h.prototype.fire=function(e,t,n,r){var i=this;this.tm?(this.tmCount++,clearTimeout(this.tm)):this.tmCount=1;var o=function(){i.tm=null,(i.fires[i.tmCount+","+!!r]||[]).forEach(function(o){o({node:i.node,original:e,x:t,y:n,hold:!!r})})};return r?o():this.tm=setTimeout(o,this.delay),this.bubble},h.prototype.mousedown=function(e){var t=this;if(!this.preventMousedownEvents&&(void 0===e.which||1===e.which)){var n,r=e.clientX,i=e.clientY,o=e.pointerId,a=function(e){e.pointerId==o&&(t.fire(e,r,i),s())},l=function(e){e.pointerId==o&&(Math.abs(e.clientX-r)>=5||Math.abs(e.clientY-i)>=5)&&s()},s=function(){n&&clearTimeout(n),t.node.removeEventListener("MSPointerUp",a,!1),document.removeEventListener("MSPointerMove",l,!1),document.removeEventListener("MSPointerCancel",s,!1),t.node.removeEventListener("pointerup",a,!1),document.removeEventListener("pointermove",l,!1),document.removeEventListener("pointercancel",s,!1),t.node.removeEventListener("click",a,!1),document.removeEventListener("mousemove",l,!1)};return window.PointerEvent||window.navigator.pointerEnabled?(this.node.addEventListener("pointerup",a,!1),document.addEventListener("pointermove",l,!1),document.addEventListener("pointercancel",s,!1)):window.navigator.msPointerEnabled?(this.node.addEventListener("MSPointerUp",a,!1),document.addEventListener("MSPointerMove",l,!1),document.addEventListener("MSPointerCancel",s,!1)):(this.node.addEventListener("click",a,!1),document.addEventListener("mousemove",l,!1)),n=setTimeout(function(){s(),t.fire(e,r,i,!0)},400),this.bubble||e.stopPropagation(),this.bubble}},h.prototype.touchdown=function(e){var t,n=this,r=e.touches[0],i=r.clientX,o=r.clientY,a=r.identifier,l=function(e){e.changedTouches[0].identifier===a?(e.preventDefault(),n.preventMousedownEvents=!0,clearTimeout(n.preventMousedownTimeout),n.preventMousedownTimeout=setTimeout(function(){n.preventMousedownEvents=!1},400),n.fire(e,i,o),d()):d()},s=function(e){1===e.touches.length&&e.touches[0].identifier===a||d();var t=e.touches[0];(Math.abs(t.clientX-i)>=5||Math.abs(t.clientY-o)>=5)&&d()},d=function(){t&&clearTimeout(t),n.node.removeEventListener("touchend",l,!1),window.removeEventListener("touchmove",s,!1),window.removeEventListener("touchcancel",d,!1)};return this.node.addEventListener("touchend",l,!1),window.addEventListener("touchmove",s,!1),window.addEventListener("touchcancel",d,!1),t=setTimeout(function(){d(),n.fire(e,i,o,!0)},400),this.bubble||e.stopPropagation(),this.bubble},h.prototype.teardown=function(){var e=this.context;e.unlisten("pointerdown",p),e.unlisten("MSPointerDown",p),e.unlisten("mousedown",p),e.unlisten("touchstart",b),e.unlisten("focus",g),delete this.node.__r_clicks__},i("expand","transitions",x);var O,S,P=function(e){function t(t){e.call(this,t)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={selections:{configurable:!0},selected:{configurable:!0}};return t.prototype._allSelected=function(){for(var e=this.get("selections"),t="virtual"===this.get("paginate")?this.get("rows"):this.get("visibleRows"),n=0;n<t.length;n++)if(!~e.indexOf(t[n]))return!1;return t.length&&!0},t.prototype._setSort=function(e,t){var n=[this.get("sort-handler"),this.get("@style.raui.table.sort-handler")],r=n[0]||n[1];if(r)r(this,this.get("columns."+e),e,t);else{var i=this.get("sort")||"",o=this.get("columns."+e).id;i===o||i.substr(1)===o?"-"===i[0]?this.set("sort",o):this.set("sort","-"+o):this.set("sort",o)}},t.prototype.nodeSet=function(e,t,n){e[t]=n},t.prototype._expand=function(e){var t=this,n=this.get("visibleRows")[e],r=this.get("expanded"),i=this.find(".rtable-row-expand");i?this.transition("expand",i,{outro:!0}).then(function(){r===n?t.set("expanded",null):(t.set("expanded",n),t.transition("expand",t.find(".rtable-row-expand"),{intro:!0}))}):n===r?this.set("expanded",null):(this.set("expanded",n),this.transition("expand",this.find(".rtable-row-expand"),{intro:!0}))},t.prototype._select=function(e,t){var n=this.get("selections");n||(n=[],this.set("selections",n));var r=n.indexOf(e);return~r?this.splice("selections",r,1):this.push("selections",e),(r>=n.length||1===n.length)&&this.set("selected",n[n.length-1]),this.fire("selection",{},{item:n[n.length-1],items:n}),setTimeout(function(){return t.target.checked=!~r}),!1},t.prototype.select=function(){var e=this.get("selected");e&&this.fire("selected",{},e,this.get("rows").indexOf(e),this.get("visibleRows").indexOf(e))},t.prototype.deselect=function(){this.set({selections:[],selected:void 0})},n.selections.get=function(){return this.get("selections")||[]},n.selections.set=function(e){var t=this.get("rows"),n=Array.isArray(e)?e.filter(function(e){return~t.indexOf(e)}):[];this.set("selections",n)},n.selected.get=function(){return this.get("selected")},n.selected.set=function(e){this.set({selected:e,selections:[e]})},t.prototype.selectionOffset=function(e){var t=this.get("selected"),n=this.get("visibleRows");if(t&&~n.indexOf(t)){var r=n.indexOf(t);if(e>0?r+e>=n.length:r+e<0){var i=e<1?-1:1;(i<0&&this.get("page")+i>=0||i>0&&this.get("page")+i<this.get("pagination.total"))&&this.add("page",i),n=this.get("visibleRows");var o=e>0?n[0]:n[n.length-1];this.set({selected:o,selections:[o]})}else this.set({selected:n[r+e],selections:[n[r+e]]})}else{var a=e>0?n[0]:n[n.length-1];this.set({selected:a,selections:[a]})}this.fire("selection",{},{item:this.get("selected"),items:this.get("selections")})},t.prototype.selectionDown=function(){this.selectionOffset(1)},t.prototype.selectionUp=function(){this.selectionOffset(-1)},t.prototype._selectGroup=function(e){var t=e;this.get("page")&&(t+=this.get("page")*this.get("pagination.per"));var n,r=this.get("rows"),i=this.get("groups"),o=this.get("selections"),a=r[t++],l=["selections"],s=[];for(~(n=o.indexOf(a))?s.push(n):l.push(a);t<r.length&&!(t in i);)a=r[t++],~(n=o.indexOf(a))?s.push(n):l.push(a);if(1===l.length)for(n=s.length;n--;)this.splice("selections",s[n],1);else this.push.apply(this,l);return!1},t.prototype._groupSelected=function(e){var t=e;this.get("page")&&(t+=this.get("page")*this.get("pagination.per"));var n=this.get("rows"),r=this.get("groups"),i=this.get("selections");if(!~i.indexOf(n[t++]))return!1;for(;t<n.length&&!(t in r);)if(!~i.indexOf(n[t++]))return!1;return!0},t.prototype._rows=function(){var e=(this.get("items")||[]).slice(),t=this.get("filter"),n=this.get("sort"),r=[this.get("data-handler"),this.get("@style.raui.table.data-handler")],i=r[0]||r[1]||z;if(!t&&!n)return this.set("isFiltered",!1),this.set("rows",e);var o=i(this,e,t,n,this.get("parameters",{virtual:!0}));this.set("isFiltered",o.length!==e.length),this.set("rows",o)},Object.defineProperties(t.prototype,n),t}(t);P.settings={valign:"center",border:!1,"fixed-header":!0,"allow-select":!0,"allow-select-all":!0,"auto-titles":!1,paginate:"virtual"},t.extendWith(P,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable",g:1},{n:"class-rtable-virtual",t:13,f:[{t:2,x:{r:["~/paginate"],s:'_0==="virtual"'}}]},{n:"class-rtable-auto",t:13,f:[{t:2,x:{r:["~/paginate"],s:'_0==="auto"'}}]},{n:"class-rtable-fixed",t:13,f:[{t:2,r:"~/fixed"}]},{n:"class-rtable-border",t:13,f:[{t:2,r:"~/border"}]},{n:"class-rtable-fixed-header",t:13,f:[{t:2,r:"~/fixedHeader"}]},{n:"class-rtable-scrolled-down",t:13,f:[{t:2,x:{r:["~/scroll"],s:'!~(_0||"").indexOf("top")'}}]},{n:"class-rtable-scrolled-up",t:13,f:[{t:2,x:{r:["~/scroll"],s:'!~(_0||"").indexOf("bottom")'}}]},{n:"class-rtable-with-select",t:13,f:[{t:2,r:"~/allowSelect"}]},{n:"class-rtable-valign-top",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="top"'}}]},{n:"class-rtable-valign-center",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="center"'}}]},{n:"class-rtable-valign-bottom",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="bottom"'}}]},{n:"class-rtable-nowrap",t:13,f:[{t:2,r:"~/noWrap"}]},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-fixed",g:1},{n:"grid",t:71,f:{r:["~/scrollOffset"],s:"[{offset:_0}]"}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-extra",g:1},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/tableWidth"},"px"],t:13}],n:50,r:"~/noWrap"},{n:"class-rtable-noheader",t:13,f:[{t:2,r:"~/noHeader"}]},{t:4,f:[{t:16,r:"meta.topAttrs"}],n:50,r:"meta.topAttrs"}],f:[{t:16,r:"meta.top",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}]}],n:50,r:"meta.top"}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-wrapper row-wrap",g:1}],f:[{t:8,r:"grid-head"}]}],n:51,r:"~/noHeader"}]}],n:50,x:{r:["~/noHeader","meta.top","~/fixedHeader"],s:"(!_0||_1)&&_2"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-top",g:1},{t:4,f:[{n:["scroll"],t:70,f:"scroll"},{n:"sized",t:71,f:{r:[],s:'[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]'}}],n:50,x:{r:["~/paginate"],s:'_0==="virtual"'}},{t:4,f:[{n:"scrolled",t:71,f:{r:[],s:'["~/scroll"]'}}],n:50,x:{r:["~/noHeader","~/fixedHeader","~/meta.bottom"],s:"(!_0&&_1)||_2"}},{t:4,f:[{n:"scrollheader",t:71}],n:50,x:{r:["~/fixedHeader","~/noWrap"],s:"_0&&_1"}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-extra",g:1},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/tableWidth"},"px"],t:13}],n:50,r:"~/noWrap"},{n:"class-rtable-noheader",t:13,f:[{t:2,r:"~/noHeader"}]},{t:4,f:[{t:16,r:"meta.topAttrs"}],n:50,r:"meta.topAttrs"}],f:[{t:16,r:"meta.top",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}]}],n:50,x:{r:["~/fixedHeader","meta.top"],s:"!_0&&_1"}}," ",{t:7,e:"div",m:[{n:"grid",t:71,f:{r:[],s:'[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]'}},{t:4,f:[{n:"style-margin-top",f:[{t:2,r:"~/virtual.above"},"px"],t:13},{n:"style-margin-bottom",f:[{t:2,r:"~/virtual.below"},"px"],t:13}],n:50,x:{r:["~/paginate"],s:'_0==="virtual"'}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-wrapper row-wrap",g:1}],f:[{t:8,r:"grid-head"}]}],n:50,x:{r:["~/noHeader","~/fixedHeader"],s:"!_0&&!_1"}}," ",{t:4,f:[{t:4,f:[{t:8,r:"grid-row"}],n:52,z:[{n:"source",x:{r:"~/items"}},{n:"shuffle",x:{x:{r:[],s:"true"}}}],r:"~/visibleRows"}],n:50,r:"~/shuffle"},{t:4,f:[{t:4,f:[{t:8,r:"grid-row"}],n:52,r:"~/visibleRows"}],n:51,l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-row row t1",g:1}],f:[{t:16,r:"empty",z:[{n:"message",x:{r:"~/empty"}}]}]}],n:50,x:{r:["~/rows.length"],s:"!_0"}}]}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-bottom",g:1},{t:4,f:[{t:16,r:"meta.bottomAttrs"}],n:50,r:"meta.bottomAttrs"}],f:[{t:4,f:[{t:16,r:"meta.bottom",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}],n:50,r:"~/meta.bottom"}," ",{t:4,f:[{t:8,r:"pagination"}],n:50,x:{r:["~/paginate"],s:'_0!=="virtual"'}}]}],n:50,x:{r:["~/paginate","~/meta.bottom"],s:'_0!=="virtual"||_1'}}]}],e:{'_0==="virtual"':function(e){return"virtual"===e},'_0==="auto"':function(e){return"auto"===e},'!~(_0||"").indexOf("top")':function(e){return!~(e||"").indexOf("top")},'!~(_0||"").indexOf("bottom")':function(e){return!~(e||"").indexOf("bottom")},'_0==="top"':function(e){return"top"===e},'_0==="center"':function(e){return"center"===e},'_0==="bottom"':function(e){return"bottom"===e},"[{offset:_0}]":function(e){return[{offset:e}]},"(!_0||_1)&&_2":function(e,t,n){return(!e||t)&&n},'[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]':function(){return[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]},'["~/scroll"]':function(){return["~/scroll"]},"(!_0&&_1)||_2":function(e,t,n){return!e&&t||n},"_0&&_1":function(e,t){return e&&t},"!_0&&_1":function(e,t){return!e&&t},'[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]':function(){return[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]},"!_0&&!_1":function(e,t){return!e&&!t},true:function(){return!0},"!_0":function(e){return!e},'_0!=="virtual"':function(e){return"virtual"!==e},'_0!=="virtual"||_1':function(e,t){return"virtual"!==e||t},"(_0+_1)%2===1":function(e,t){return(e+t)%2==1},"[_0._setSort(_1,_2)]":function(e,t,n){return[e._setSort(t,n)]},"[_0._select(_1,_2),false]":function(e,t,n){return[e._select(t,n),!1]},'[["select",_2,_0.indexOf(_2),_1.indexOf(_2)]]':function(e,t,n){return[["select",n,e.indexOf(n),t.indexOf(n)]]},"[_0._expand(_1)]":function(e,t){return[e._expand(t)]},"[_0.stopPropagation()]":function(e){return[e.stopPropagation()]},"_0.indexOf(_1)":function(e,t){return e.indexOf(t)},"_0===_1":function(e,t){return e===t},"_0>0":function(e){return e>0},"!_0&&_1>0":function(e,t){return!e&&t>0},'_0==="boolean"':function(e){return"boolean"===e},"_0._allSelected()":function(e){return e._allSelected()},'_0||"No data."':function(e){return e||"No data."},"_0*_1+1":function(e,t){return e*t+1},"_2+1===_0?_1:(_2+1)*_3":function(e,t,n,r){return n+1===e?t:(n+1)*r},"_0===1":function(e){return 1===e},"_0._allSelected()&&_1<_2":function(e,t,n){return e._allSelected()&&t<n},'[_0.set("page",_1-1)]':function(e,t){return[e.set("page",t-1)]},'[(/^\\d+$/.test(_1)&&+_1>0&&+_1<=_0&&_2.set("page",+_1-1))||_2.nodeSet(_3,"value",_4+1)]':function(e,t,n,r,i){return[/^\d+$/.test(t)&&+t>0&&+t<=e&&n.set("page",+t-1)||n.nodeSet(r,"value",i+1)]},"_0==_1+1":function(e,t){return e==t+1},'[_0.set("page",_2[_1-1])]':function(e,t,n){return[e.set("page",n[t-1])]},'_0==="..."':function(e){return"..."===e},'[_0.set("page",_1+1)]':function(e,t){return[e.set("page",t+1)]},"_0<_1-1":function(e,t){return e<t-1}},p:{"csp-dummy":[{t:7,e:"div",m:[{n:"class-rtable-odd",t:13,f:[{t:2,x:{r:["@index","~/virtual.offset"],s:"(_0+_1)%2===1"}}]},{n:"class-top",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="top"'}}]},{n:"class-bottom",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="bottom"'}}]},{n:"class-center",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="center"'}}]},{n:["click"],t:70,f:{r:["@this",".index","@event"],s:"[_0._setSort(_1,_2)]"}},{n:["click"],t:70,f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}},{n:["click"],t:70,f:{r:["~/rows","~/visibleRows","."],s:'[["select",_2,_0.indexOf(_2),_1.indexOf(_2)]]'}},{n:["click"],t:70,f:{r:["@this","@index"],s:"[_0._expand(_1)]"}},{n:["click"],t:70,f:{r:["@event"],s:"[_0.stopPropagation()]"}}]}," ",{t:4,f:["..."],n:50,x:{r:["~/selections","."],s:"_0.indexOf(_1)"}}," ",{t:4,f:["..."],n:50,x:{r:[".","~/expanded"],s:"_0===_1"}}," ",{t:4,f:["..."],n:50,x:{r:["~/virtual.offset"],s:"_0>0"}}," ",{t:4,f:["..."],n:50,x:{r:["~/fixedHeader","~/virtual.offset"],s:"!_0&&_1>0"}}," ",{t:4,f:["..."],n:50,x:{r:["~/columns.0.type"],s:'_0==="boolean"'}}," ",{t:4,f:["..."],n:50,x:{r:["@this"],s:"_0._allSelected()"}}],empty:[{t:7,e:"div",f:[{t:7,e:"div",f:[{t:2,x:{r:["message"],s:'_0||"No data."'}}]}]}],pagination:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-pagination",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-info",g:1}],f:[{t:4,f:[{t:2,x:{r:["~/page","~/pagination.per"],s:"_0*_1+1"}}," - ",{t:2,x:{r:["~/pagination.total","~/rows.length","~/page","~/pagination.per"],s:"_2+1===_0?_1:(_2+1)*_3"}}," of ",{t:2,r:"~/rows.length"},{t:4,f:[" (",{t:2,r:"~/items.length"}," total)"],n:50,r:"~/isFiltered"}],n:50,x:{r:["pagination","rows.length"],s:"_0&&_1"}}," ",{t:4,f:["​"],n:50,x:{r:["_paginate"],s:"_0===1"}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-select-all-all",g:1}],f:[{t:4,f:[{t:7,e:"strong",f:[{t:2,r:"selections.length"}]}," of ",{t:7,e:"strong",f:[{t:2,r:"rows.length"}]}," selected",{t:4,f:[" - ",{t:7,e:"a",m:[{n:"href",f:"#",t:13,g:1},{n:["click"],t:70,f:"selectAllAll"}],f:["Select All"]}],n:50,x:{r:["@this","selections.length","rows.length"],s:"_0._allSelected()&&_1<_2"}}],n:50,x:{r:["selections.length"],s:"_0>0"}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-pages",g:1}],f:[{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","~/page"],s:'[_0.set("page",_1-1)]'}}],f:["Previous"]}],n:50,x:{r:["~/page"],s:"_0>0"}}," ",{t:4,f:[{t:4,f:[{t:7,e:"input",m:[{n:["change"],t:70,f:{r:["~/pagination.total","@node.value","@this","@node","~/page"],s:'[(/^\\d+$/.test(_1)&&+_1>0&&+_1<=_0&&_2.set("page",+_1-1))||_2.nodeSet(_3,"value",_4+1)]'}},{n:"value",f:[{t:2,r:"."}],t:13},{t:73,v:"t",f:"false"}]}],n:50,x:{r:[".","~/page"],s:"_0==_1+1"}},{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","@index","../"],s:'[_0.set("page",_2[_1-1])]'}}],f:["..."]}," "],n:50,x:{r:["."],s:'_0==="..."'},l:1},{t:4,f:[" ",{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","."],s:'[_0.set("page",_1-1)]'}}],f:[{t:2,r:"."}]}],n:51,l:1}],n:52,r:"~/pagination.array"}," ",{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","~/page"],s:'[_0.set("page",_1+1)]'}}],f:["Next"]}],n:50,x:{r:["~/page","~/pagination.total"],s:"_0<_1-1"}}]}]}]}},css:function(e){return[function(e){var t=Object.assign({},e("raui.primary"),e("raui.table.primary")),n=Object.assign({},t,e("raui.primary.active"),e("raui.table.primary.active")),r=Object.assign({selected:{},header:{},footer:{}},e("raui.table"));return"\n .rtable {\n display: flex;\n flex-direction: column;\n overflow: auto;\n max-width: 100%;\n max-height: 100%;\n box-sizing: border-box;\n flex-grow: 2;\n }\n \n .rtable.rtable-border {\n border: 1px solid "+(r.divider||t.bc||"#ccc")+";\n }\n \n .rtable-group > div > div,\n .rtable-header > div > div,\n .rtable-row > div > div {\n padding: "+(r.padding||"0.5em")+";\n overflow: inherit;\n text-overflow: inherit;\n line-height: 1em;\n }\n .rtable-row > .rtable-no-pad > div {\n padding: 0;\n }\n \n .rtable-auto .row > *,\n .rtable-fixed .row > *\n {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n \n .rtable-header > div > div, .rtable-column {\n overflow: hidden;\n }\n \n .rtable-number-column {\n text-align: right;\n }\n .rtable-date-column {\n text-align: right;\n }\n \n .rtable-sortable {\n cursor: pointer;\n user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n }\n \n .grid .row.rtable-row, .grid .rtable-header > .row {\n width: auto;\n min-width: min-content;\n flex-grow: 1;\n }\n \n .rtable-nowrap .grid .rtable-row, .rtable-nowrap .grid .rtable-header > .row {\n flex-wrap: nowrap;\n }\n .rtable-nowrap .rtable-row-wrap, .rtable-inner-row-wrap {\n flex-grow: 1;\n } \n \n .rtable-row-wrap {\n color: "+(t.fg||"#222")+";\n border-style: solid;\n border-color: "+(r.divider||t.bc||"#ccc")+";\n border-width: 0 0 1px 0;\n background-color: "+(r.even||t.bga||"#f4f4f4")+";\n }\n .rtable-row-wrap.rtable-odd {\n background-color: "+(r.odd||t.bg||"#fff")+";\n }\n .rtable-row-wrap:hover, .rtable-row-wrap.rtable-selected:hover, .rtable-row-wrap.rtable-odd.rtable-selected:hover {\n background-color: "+(r.over||n.bg||"#e6f0fa")+";\n position: relative;\n box-shadow: inset 1px 0 0 #dadce0,inset -1px 0 0 #dadce0, 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n z-index: 2;\n }\n .rtable-header.rtable-row-wrap:hover {\n box-shadow: none;\n }\n \n .rtable-row-wrap.rtable-selected {\n background-color: "+(r.selected.bg||"#cee5fd")+";\n color: "+(r.selected.fg||t.fg||"#222")+";\n }\n .rtable-row-wrap.rtable-selected.rtable-odd {\n background-color: "+(r.selected.odd||"#c5dffb")+";\n }\n \n .rtable-row-wrap {\n display: flex;\n flex-grow: 1;\n align-items: center;\n z-index: 2;\n align-items: stretch;\n }\n \n .rtable-nowrap .rtable-row-wrap {\n display: inline-flex;\n min-width: 100%;\n box-sizing: border-box;\n }\n \n .rtable-nowrap > .rtable-top > .grid {\n line-height: 1em;\n }\n \n .rtable-border .rtable-row .rtable-column,\n .rtable-border .rtable-group .rtable-column {\n border-color: "+(r.divider||t.bc||"#ccc")+";\n border-style: solid;\n border-width: 0 0 1px 1px;\n margin: 0 0 -1px -1px;\n }\n .rtable-border .rtable-header .rtable-column {\n margin-left: -1px;\n }\n .rtable-border .rtable-row .rtable-column:nth-child(1),\n .rtable-border .rtable-group .rtable-column:nth-child(1) {\n border-left-width: 0;\n }\n .rtable-border.rtable-with-select .rtable-row .rtable-column:nth-child(1),\n .rtable-border.rtable-with-select .rtable-group .rtable-column:nth-child(1) {\n border-left-width: 1px;\n }\n \n .rtable-border .rtable-row-wrap {\n border-bottom-width: 1px;\n }\n \n .rtable-border .rtable-row-expand, .rtable-border .rtable-row-extra {\n border-color: "+(r.divider||t.bc||"#ccc")+";\n border-style: solid;\n border-width: 1px 0 0 0;\n margin-left: -1px;\n width: 100%;\n }\n .rtable-border.rtable-with-select .rtable-row-expand, .rtable-border.rtable-with-select .rtable-row-extra {\n border-left-width: 1px;\n }\n \n .rtable-row-expand, .rtable-row-extra {\n box-sizing: border-box;\n padding: "+(r.padding||"0.5em")+";\n }\n \n .rtable-group {\n border-bottom: 2px solid "+(r.divider||t.bc||"#ccc")+";\n }\n \n .rtable-header.rtable-row-wrap, .rtable-header.rtable-row-wrap:hover {\n font-weight: bold;\n background-color: "+(r.header.bg||"#dedede")+";\n }\n .rtable-header-fixed {\n line-height: 1em;\n background-color: "+(r.header.bg||"#dedede")+";\n }\n \n .rtable-header.rtable-row-wrap, .rtable-header-extra.rtable-noheader {\n border-bottom: 2px solid "+(r.divider||t.bc||"#ccc")+";\n }\n \n .rtable-header-extra {\n background-color: "+(r.header.bg||"#dedede")+";\n padding: "+(r.padding||"0.5em")+";\n line-height: 1em;\n z-index: 4;\n box-sizing: border-box;\n min-width: 100%;\n }\n .rtable-nowrap .rtable-header-extra {\n position: sticky;\n left: 0;\n }\n \n .rtable-top {\n flex-grow: 5;\n flex-shrink: 1;\n overflow-y: auto;\n position: relative;\n }\n .rtable-fixed-header .rtable-header {\n position: relative;\n z-index: 3;\n }\n .rtable-fixed-header.rtable-scrolled-down .rtable-header-fixed {\n box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15), 0 0.25em 0.5em rgba(0,0,0,0.25);\n z-index: 3;\n }\n .rtable-fixed-header .rtable-top {\n margin-top: 0;\n }\n .rtable-nowrap.rtable-fixed-header .rtable-header-wrapper {\n flex-shrink: 0;\n width: 100%;\n overflow-x: auto;\n scrollbar-width: none;\n }\n .rtable-nowrap.rtable-fixed-header .rtable-header-wrapper::-webkit-scrollbar {\n height: 0;\n }\n .rtable-fixed-header .rtable-header-fixed::-webkit-scrollbar {\n width: 0;\n height: 0;\n }\n \n .rtable-nowrap .rtable-fixed-column, .rtable-nowrap .rtable-row-extra, .rtable-nowrap .rtable-row-expand {\n position: -webkit-sticky;\n position: sticky;\n left: 0;\n }\n .rtable-border..rtable-nowrap .rtable-fixed-column, .rtable-border.rtable-nowrap .rtable-row-extra, .rtable-border.rtable-nowrap .rtable-row-expand {\n left: 1px;\n }\n .rtable-nowrap.rtable-with-select .rtable-fixed-column, .rtable-nowrap.rtable-with-select .rtable-row-extra, .rtable-nowrap.rtable-with-select .rtable-row-expand {\n left: "+(r.selectWidth||"2em")+";\n }\n .rtabe-border.rtable-nowrap.rtable-with-select .rtable-fixed-column, .rtabe-border.rtable-nowrap.rtable-with-select .rtable-row-extra, .rtabe-border.rtable-nowrap.rtable-with-select .rtable-row-expand {\n left: "+(r.selectWidth||"2em")+";\n }\n \n .rtable-nowrap .rtable-inner-row-wrap {\n background-color: inherit;\n }\n \n .rtable-nowrap .row,\n .rtable-nowrap .rtable-fixed-column,\n .rtable-nowrap .rtable-select-row,\n .rtable-nowrap .rtable-select-header {\n background-color: inherit;\n z-index: 1;\n }\n \n .rtable-nowrap .rtable-select-row,\n .rtable-nowrap .rtable-select-header {\n position: sticky;\n position: -webkit-sticky;\n left: 0;\n z-index: 1;\n }\n .rtable-nowrap .rtable-select-header {\n z-index: 2;\n }\n \n .rtable-nowrap.rtable-border .rtable-fixed-column {\n border-right-width: 1px;\n }\n \n .rtable-scrolled-up .rtable-bottom {\n box-shadow: 0 -1px 2px 0 rgba(60, 64, 67, 0.3), 0 -1px 3px 1px rgba(60, 64, 67, 0.15), 0 -0.25em 0.5em rgba(0,0,0,0.25);\n z-index: 3;\n }\n .rtable-bottom {\n padding: "+(r.padding||"0.5em")+";\n background-color: "+(r.footer.bg||r.header.bg||"#dedede")+";\n border-top: 2px solid "+(r.divider||t.bc||"#ccc")+";\n }\n \n .rtable-pagination {\n display: flex;\n flex-wrap: wrap;\n flex-shrink: 0;\n justify-content: space-between;\n }\n \n .rtable-pages span {\n margin: 0.3em;\n cursor: pointer;\n }\n .rtable-pages span:first-of-type {\n margin-left: 0;\n }\n .rtable-pages input {\n text-align: center;\n width: 2.5em;\n font-size: 1em;\n background-color: transparent;\n border: none;\n padding: 0;\n font-weight: bold;\n text-decoration: underline;\n }\n \n /* checkboxes */\n .rtable-select {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n position: absolute;\n display: block;\n margin: 0;\n width: 2em;\n height: 2em;\n box-shadow: none;\n outline: none;\n opacity: 0;\n top: -4px;\n left: -1.5px;\n border-radius: 2em;\n transition: transform 0.2s, opacity 0.2s;\n background-color: "+(t.bc||"#ccc")+";\n cursor: pointer;\n }\n \n .rtable-select-header > div, .rtable-select-row > div, .rtable-header > div.rtable-select-header > div {\n padding: 0;\n overflow: visible;\n width: 1.5em;\n position: relative;\n line-height: 1.8em;\n cursor: pointer;\n display: flex;\n justify-content: space-around;\n align-items: center;\n flex-grow: 0;\n }\n \n .rtable-select:checked {\n background-color: "+(t.fga||"#07e")+';\n }\n \n .rtable-select-header:hover .rtable-select, .rtable-select-row:hover .rtable-select {\n opacity: 0.04;\n }\n \n .rtable-select:focus {\n opacity: 0.12;\n transform: scale(1);\n }\n \n .rtable-select-header:hover .rtable-select:focus, .rtable-select-row:hover .rtable.select:focus {\n opacity: 0.16;\n }\n \n .rtable-select:active {\n opacity: 0.4;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n \n .rtable-select-row > div:before, .rtable-select-header > div:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n border: solid 2px; /* Safari */\n border-color: '+(t.fg||"#222")+';\n border-radius: 2px;\n width: 18px;\n height: 18px;\n vertical-align: middle;\n transition: border-color 0.2s, background-color 0.2s;\n }\n \n .rtable-select-row > div:after, .rtable-select-header > div:after {\n content: "";\n display: block;\n position: absolute;\n top: -5px;\n left: 0px;\n width: 10px;\n height: 5px;\n border: solid 2px transparent;\n border-right: none;\n border-top: none;\n transform: translate(0.35em, 0.55em) rotate(-45deg);\n opacity: 0;\n }\n \n .rtable-selected .rtable-select-row > div:before, .rtable-all-selected > div:before {\n border-color: '+(t.fga||"#07e")+";\n background-color: "+(t.fga||"#07e")+";\n }\n \n .rtable-selected .rtable-select-row > div:after, .rtable-all-selected > div:after {\n border-color: "+(t.bg||"#fff")+";\n opacity: 1;\n }\n \n .rtable-row-wrap > .rtable-select-header,\n .rtable-row-wrap > .rtable-select-row {\n text-align: center;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: space-around;\n width: "+(r.selectWidth||"2em")+";\n }\n \n .rtable-column button, .rtable-column .btn {\n padding: 0 0.5em;\n margin: 0.2em 0.5em;\n min-height: 0;\n }\n \n .rtable-column.rtable-editing, .rtable-column.rtable-editing > .rtable-edit {\n padding: 0;\n }\n .rtable-column.rtable-editing input {\n width: 100%;\n box-sizing: border-box;\n height: 100%;\n margin: 0;\n border: none;\n background-color: transparent;\n padding: 0.25em 0.5em;\n }\n \n .rtable-valign-top .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-top > div {\n display: flex;\n height: 100%;\n align-items: flex-start;\n box-sizing: border-box;\n }\n .rtable-valign-bottom .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-bottom > div {\n display: flex;\n height: 100%;\n align-items: flex-end;\n box-sizing: border-box;\n }\n .rtable-valign-center .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-center > div {\n display: flex;\n height: 100%;\n align-items: center;\n box-sizing: border-box;\n }\n "+(e("table.includeGrid")?c(e):"")}.call(this,e)].join(" ")},cssId:"rtable",noCssTransform:!0,attributes:["paginate","items","filter","data-handler","sort-handler","sort","helpers","fixed","allow-select","allow-select-all","border","fixed-header","valign","no-header","empty","shuffle","no-wrap","parameters"],components:{table:!1,Table:!1},syncComputedChildren:!0,decorators:{grid:d,sized:o,scrollheader:function(e){var t=this,n=function(e){requestAnimationFrame(function(){return t.find(".rtable-header-wrapper").scrollLeft=e.target.scrollLeft})};return e.addEventListener("scroll",n,{passive:!0}),{teardown:function(){e.removeEventListener("scroll",n)}}}},events:{},use:[u({name:"clickd",count:1}),u({name:"dblclickd",count:2}),(void 0===S&&(S={}),function(e){e.instance.transitions[S.name||"expand"]=x}),(void 0===O&&(O={}),function(e){e.instance.decorators[O.name||"scrolled"]=w})],on:{construct:function(){var e,t,n,r,i,o,a,l=this.component;if(!l)return;var s=l.template.f||[],d=l.template.m?l.template.m.slice():[],c=l.template;l.template={e:c.e,f:c.f,t:c.t,m:d};var f=0;function u(e,t,n){if(e&&e.f&&1===e.f.length&&2===e.f[0].t){var r="_a"+f++;return d.push({t:13,n:r,f:e.f}),n?r:t?{t:[{t:2,r:"~/"+r}]}:{t:2,r:"~/"+r}}return e&&e.f}function h(e){var t=[],n=[];return e.forEach(function(e){if("column"===e.e||"col"===e.e){var r,i={},o=e.m||T;if(i.index=t.length,t.push(i),i.content=(e.f||[]).filter(function(e){return"edit"!==e.e}),i.editP=(e.f||[]).find(function(e){return"edit"===e.e}),i.editP&&(i.editP=i.editP.f),(r=o.find(function(e){return"id"===e.n}))&&_(r.f)&&(i.id=r.f),i.label=o.find(function(e){return"label"===e.n}),i.label&&i.label.f&&(i.label=u(i.label)),i.label||(i.label=""),i.id||(i.id=i.label),Array.isArray(i.label)||(i.label=[i.label]),i.type=o.find(function(e){return"type"===e.n}),i.type&&i.type.f&&(i.type=i.type.f),i.type||(i.type="string"),i.filter=o.find(function(e){return"filter"===e.n}),i.filter&&i.filter.f&&(i.filter=u(i.filter),i.filter.r&&(i.filter=i.filter.r)),i.sort=o.find(function(e){return"sort"===e.n}),i.sort&&i.sort.f&&(i.sort=u(i.sort),i.sort.r&&(i.sort=i.sort.r)),i.dir=o.find(function(e){return"dir"===e.n}),i.dir&&i.dir.f&&(i.dir=u(i.dir),i.dir.r&&(i.dir=i.dir.r)),i.hidden=o.find(function(e){return"hidden"===e.n}),i.hidden&&0===i.hidden.f?i.hidden=!0:i.hidden&&k(i.hidden.f)?i.hidden=u(i.hidden):i.hidden=!1,_(i.hidden)&&(i.hidden=!1),i.noPad=o.find(function(e){return"no-pad"===e.n}),i.noPad&&0===i.noPad.f?i.noPad=0:i.noPad&&k(i.noPad.f)?i.noPad=u(i.noPad):delete i.noPad,i.editable=o.find(function(e){return"editable"===e.n}),i.editable&&0===i.editable.f?i.editable=!0:i.editable&&k(i.editable.f)?i.editable=u(i.editable):i.editable=!1,i.valign=o.find(function(e){return"valign"===e.n}),i.valign&&k(i.valign.f)?i.valign=u(i.valign):i.valign&&"string"==typeof i.valign.f&&(i.valign=i.valign.f),i.fixed=o.find(function(e){return"fixed"===e.n}),i.fixed&&k(i.fixed.f)?i.fixed={path:u(i.fixed,!1,!0)}:i.fixed&&"string"==typeof i.fixed.f&&(i.fixed=i.fixed.f),(r=o.find(function(e){return"get"===e.n}))&&r.f){var a=u(r,!1,!0);field.get=function(e){var t=this.get(a);return"function"==typeof t?t.call(this,e):void 0}}i.attrs=o.filter(function(e){return!~L.indexOf(e.n)}),i.attrs.forEach(function(e,t){W.test(e.n)&&(i.attrs[t]={t:13,n:"class-"+e.n})})}else if("field"===e.e){var l,s={},d=e.m||T;if(_(l=d.find(function(e){return"path"===e.n}))?s.path=l:l&&l.f&&(s.path=u(l)),(l=d.find(function(e){return"value"===e.n}))&&l.f&&(s.value=u(l)),_(l=d.find(function(e){return"type"===e.n}))?s.type=l:l&&l.f&&(s.type=u(l)),_((l=d.find(function(e){return"id"===e.n})).f)&&(s.id=l.f),_(l=d.find(function(e){return"dir"===e.n}))?s.dir=l:l&&_(l.f)&&(s.dir=l.f),_(l=d.find(function(e){return"label"===e.n}))?s.label=l:l&&l.f&&(s.label=u(l)),(l=d.find(function(e){return"get"===e.n}))&&l.f){var c=u(l,!1,!0);s.get=function(e){var t=this.get(c);return"function"==typeof t?t.call(this,e):void 0}}s.id||(s.id=s.label),s.path||(s.path=s.id),n.push(s)}}),{fields:n,columns:t}}e=s.find(function(e){return"expand"===e.e}),t=s.find(function(e){return"group"===e.e}),n=s.find(function(e){return"wrapper"===e.e}),r=s.find(function(e){return"row"===e.e}),i=s.find(function(e){return"top"===e.e}),o=s.find(function(e){return"bottom"===e.e}),this._init={sets:h(s),partials:{}};var p=this._init.sets.columns;this._init.sets["meta.expand"]=e&&e.f&&e.f.length&&e.f,this._init.sets["meta.extra"]=r&&r.f&&r.f.length&&r.f,this._init.sets["meta.top"]=i&&i.f&&i.f.length&&i.f,this._init.sets["meta.topAttrs"]=i&&i.m,this._init.sets["meta.bottom"]=o&&o.f&&o.f.length&&o.f,this._init.sets["meta.bottomAttrs"]=o&&o.m;var b=[{n:"gridValue",x:{r:"~/gridValue"}},{n:"gridName",x:{r:"~/gridName"}},{n:"gridSize",x:{r:"~/tableWidth"}},{n:"gridMax",x:{r:"~/gridMax"}},{n:"table",x:{r:"@this"}}],g=[{t:7,e:"div",m:[{t:13,n:"class-rtable-row-wrap"},{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-header"},{t:4,f:[{n:"style-opacity",f:"0",t:13}],n:50,x:{r:["~/fixedHeader","~/virtual.offset"],s:"!_0&&_1>0"}},{t:4,n:50,r:"~/fixedHeader",f:[{t:13,n:"style-padding-right",f:[{t:2,r:"~/scrollOffset"},"px"]}]}],f:[{t:7,e:"div",f:p.filter(function(e){return!0!==e.hidden}).map(function(e,t){e.attrsHP=e.attrs.filter(function(e){return"title"!==e.n});var n={t:7,e:"div",f:[{t:7,e:"div",f:e.label}],m:[{t:4,n:53,r:"~/columns."+t,f:[{t:70,n:["click"],f:{r:["@this",".index","@event"],s:"[_0._setSort(_1,_2)]"}}]},{t:13,n:"title",f:e.label},{t:16,r:"~/columns."+t+".attrsHP",z:b}]};if(e.type&&n.m.push({t:13,n:"class-rtable-"+e.type+"-column"}),(e.filter||e.sort)&&n.m.push({t:13,n:"class-rtable-sortable"}),n.m.push({t:13,n:"class-rtable-column"}),e.fixed){var r=e.fixed.path||"~/columns."+t+".fixed";n.m.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:r}]}),n.m.push({t:4,n:50,x:{r:["~/noWrap",r],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:r}]}]})}var i=n;return e.hidden&&e.hidden.r&&(i={t:4,n:51,r:e.hidden.r,f:[n]}),i}),m:[{t:13,n:"class-row"}]}]}];g[0].f.unshift({t:4,n:50,r:"~/allowSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-header"},{t:13,n:"class-rtable-column"},{t:13,n:"title",f:[{t:2,r:"selections.length"}," items selected"]},{t:13,n:"class-rtable-all-selected",f:[{t:2,x:{r:["@this"],s:"_0._allSelected()"}}]}],f:[{t:7,e:"div",f:[{t:4,n:50,r:"~/allowSelectAll",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["@this"],s:"_0._allSelected()"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:"selectAll"}]}]}],m:[{t:70,n:["clickd"],f:"selectAll"}]}]}]});var v,m=[{t:7,e:"div",m:[{t:13,n:"class-rtable-row-wrap"},{t:13,n:"class-rtable-odd",f:[{t:2,x:{r:["@index","~/virtual.offset"],s:"(_0+_1)%2===1"}}]},{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-live"},{t:13,n:"class-rtable-selected",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-inner-row-wrap"}],f:[{t:7,e:"div",f:p.filter(function(e){return!0!==e.hidden}).map(function(e,t){var n=[{t:7,e:"div",f:[{t:16,r:"~/columns."+t+".content",c:{r:"."},z:b}]}];e.attrs.length?(e.attrsP=e.attrs,e.attrs=[{t:16,r:"~/columns."+t+".attrsP",c:{r:"."},z:b}]):e.attrs=[];var r=e.attrs;if(e.fixed){var i=e.fixed.path||"~/columns."+t+".fixed";r.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:i}]}),r.push({t:4,n:50,x:{r:["~/noWrap",i],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:i}]}]})}if(e.editable&&(e.filter||e.editP)){var o={t:70,n:["click","mousedown","pointerdown","MSPointerDown","touchstart"],f:{r:["@event"],s:"[_0.stopPropagation()]"}},a=[{t:4,n:50,x:{r:["~/columns."+t+".editP"],s:"Array.isArray(_0)"},f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-edit"},o],f:[{t:16,r:"~/columns."+t+".editP"}]}]},{t:4,n:50,l:1,x:{r:["~/columns."+t+".type"],s:"_0==='boolean'"},f:[{t:7,e:"input",m:[{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,r:e.filter}]},o]}]},{t:4,n:51,l:1,f:[{t:7,e:"input",m:[{t:13,n:"value",f:[{t:2,r:e.filter}]},o]}]}];"object"==typeof e.editable?(r.push({t:13,n:"class-rtable-editing",f:e.editable}),n=[Object.assign({},e.editable,{t:4,n:50,f:a}),{t:4,n:51,l:1,f:n}]):(r.push({t:13,n:"class-rtable-editing"}),n=a)}e.valign&&r.push({t:13,n:"class-rtable-valign-col-top",f:[{t:2,x:{r:["~/columns."+t+".valign"],s:"_0==='top'"}}]},{t:13,n:"class-rtable-valign-col-bottom",f:[{t:2,x:{r:["~/columns."+t+".valign"],s:"_0==='bottom'"}}]},{t:13,n:"class-rtable-valign-col-center",f:[{t:2,x:{r:["~/columns."+t+".valign"],s:"_0==='center'"}}]});var l={t:7,e:"div",f:n,m:r};e.type&&r.unshift({t:13,n:"class-rtable-"+e.type+"-column"}),r.push({t:13,n:"class-rtable-column"});var s=e.attrsP&&e.attrsP.find(function(e){return"title"===e.n});s?s.f||(r.unshift({t:13,n:"title",f:e.content.find(function(e){return e.e})?e.label:e.content}),e.attrsP.splice(r.indexOf(s),1)):r.unshift({t:4,n:50,r:"~/autoTitles",f:[{t:13,n:"title",f:e.content.find(function(e){return e.e})?e.label:e.content}]}),0===e.noPad?r.push({t:13,n:"class-rtable-no-pad"}):e.noPad&&r.push({t:13,n:"class-rtable-no-pad",f:e.noPad});var d=l;return e.hidden&&e.hidden.r&&(d={t:4,n:51,r:e.hidden.r,f:[l]}),d}),m:[{t:13,n:"class-row"},{t:13,n:"class-rtable-row"},{t:70,n:e&&e.f?["dblclickd"]:["click","dblclick"],f:{r:["~/rows","~/visibleRows","."],s:"[['selected',_2,_0.indexOf(_2),_1.indexOf(_2)]]"}}]}]}]}];r&&r.m&&r.m.length&&(this._init.sets.rowAttrs=r.m.slice(),m[0].f[0].f[0].m.push({t:16,r:"~/rowAttrs",c:{r:"."},z:b}));n&&n.m&&n.m.length&&(this._init.sets.wrapperAttrs=n.m.slice(),m[0].m.push({t:16,r:"~/wrapperAttrs",c:{r:"."},z:b}));r&&r.f&&r.f.length&&m[0].f[0].f.push({t:7,e:"div",m:[{t:13,n:"class-rtable-row-extra"},{t:4,n:50,r:"~/noWrap",f:[{t:13,n:"style-width",f:[{t:2,x:{r:["~/tableWidth","~/allowSelect","@style.raui.table.selectWidth"],s:"_1?'calc('+_0+'px - '+(_2||'2em')+')':_0+'px'"}}]}]}],f:[{t:16,r:"~/meta.extra",c:{r:"."},z:b}]});e&&e.f&&e.f.length&&(m[0].f[0].f.push({t:4,n:50,x:{r:[".","~/expanded"],s:"_0===_1"},f:[{t:7,e:"div",f:[{t:7,e:"div",f:[{t:16,r:"~/meta.expand",c:{r:"."},z:b}]}],m:[{t:13,n:"class-rtable-row-expand"},{t:4,n:50,r:"~/noWrap",f:[{t:13,n:"style-width",f:[{t:2,x:{r:["~/tableWidth","~/allowSelect","@style.raui.table.selectWidth"],s:"_1?'calc('+_0+'px - '+(_2||'2em')+')':_0+'px'"}}]}]}]}]}),m[0].f[0].f[0].m.push({t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._expand(_1)]"}}),m[0].f[0].m.push({t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._expand(_1)]"}}));if(m[0].f.unshift({t:4,n:50,r:"~/allowSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-row"},{t:13,n:"class-rtable-column"},{t:70,n:["clickd"],f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}}],f:[{t:7,e:"div",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}}]}]}]}]}),t&&t.m&&(v=t.m.find(function(e){return"by"===e.n}))&&(_(v.f)||1===v.length&&2===v[0].t)){var x={t:4,n:50,f:[{t:7,e:"div",m:[{t:13,n:"class-row"},{t:13,n:"class-rtable-group"},{t:13,n:"class-rtable-selected",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]},{t:70,n:e&&e.f?["dblclickd"]:["click","dblclick"],f:{r:["~/rows","~/visibleRows","."],s:"[['selected',_2,_0.indexOf(_2),_1.indexOf(_2)]]"}}].concat(t.m.filter(function(e){return"by"!==e.n&&"select"!==e.n}))}],x:{s:"_0&&_1[(_1&&(_2*_3+_4))||_4]",r:["~/showGroups","~/groups","~/page","~/pagination.per","@index"]}};m.unshift(x),this._init.by=v.f;var w,y=h(t.f).columns.filter(function(e){return!0!==e.hidden}).map(function(e){var t={t:7,e:"div",f:[{t:7,e:"div",f:e.content}],m:e.attrs};e.type&&t.m.unshift({t:13,n:"class-rtable-"+e.type+"-column"}),t.m.push({t:13,n:"class-rtable-column"}),t.m.find(function(e){return"title"===e.n})||t.m.unshift({t:13,n:"title",f:e.content});var n=t;return e.hidden&&e.hidden.r&&(n={t:4,n:51,r:e.hidden.r,f:[t]}),n});y.unshift({t:4,n:50,r:"~/allowGroupSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-row"},{t:13,n:"class-rtable-column"},{t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._selectGroup(_1),false]"}},{t:13,n:"class-rtable-all-selected",f:[{t:2,x:{r:["@this","@index"],s:"_0._groupSelected(_1)"}}]}],f:[{t:7,e:"div",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["@this","@index"],s:"_0._groupSelected(_1)"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:{r:["@this","@index"],s:"[_0._selectGroup(_1),false]"}}]}]}]}]}),(w=t.m.find(function(e){return"select"===e.n}))&&(a||(a=[])).push(Object.assign({},w,{n:"allowGroupSelect"})),(w=t.m.find(function(e){return"show"===e.n}))&&(a||(a=[])).push(Object.assign({},w,{n:"showGroups"})),x.f[0].f=y}this._init.partials["grid-row"]=m,this._init.partials["grid-head"]=g,a&&this.component&&(this.component.mappings=a)},config:function(){this.set(this._init.sets),Object.assign(this.partials,this._init.partials)},render:function(){this._autoObserver&&this._autoObserver.fire()},selectAll:function(){var e,t;return this._allSelected()?(t=null,e=[],this.set({selections:e,selected:t})):(t=(e=("virtual"===this.get("paginate")?this.get("rows"):this.get("visibleRows")).slice())[0],this.set({selections:e,selected:t})),this.fire("selection",{},{item:t,items:e}),!1},selectAllAll:function(){var e=this.get("rows").slice();return this.set({selections:e,selected:null}),this.fire("selection",{},{item:null,items:e}),!1}},observe:{_rows:function(){var e=this;this._rowbounce&&clearTimeout(this._rowbounce),setTimeout(function(){return e._rows()},this.get("@style.raui.table.debounce")||160)},paginate:{handler:function(e){var n=this;if("auto"===e||"virtual"===e||e instanceof t){this._autoObserver&&this._autoObserver.cancel(),this._scrollListener&&this._scrollListener.cancel();("auto"===e||"virtual"===e)&&this.root;var r,i=!1,o=function(){if(n.rendered){var t=n.find(".rtable-top");if(t)if(n.get("items.length")){var r=t.clientHeight+","+t.clientWidth;if(o.last!==r||!i){var a=n.getContext(t);a.decorators&&a.decorators.scrolled&&a.decorators.scrolled.refresh();var l=n.find(".rtable-header")||{},s=Array.apply(null,n.findAll(".rtable-live")).map(function(e){return e.offsetHeight});if(s.length<5){var d=Math.floor(t.clientHeight/(l.offsetHeight||1));d<5&&(d=5),n.set("_paginate",d),s=Array.apply(null,n.findAll(".rtable-live")).map(function(e){return e.offsetHeight})}s.length>0?i=!0:s=[25];var c=Math.ceil(s.reduce(function(e,t){return e+t},0)/s.length);n._avgSize=c;var f=Math.floor((t.clientHeight-(l.offsetHeight||1))/c);"virtual"===e&&(f+=10)<30&&(f=30),n.set("_paginate",f),o.last=r}}else n._autoLenObserver||(n._autoLenObserver=n.observeOnce("items",function(){n._autoLenObserver=0,setTimeout(o)}))}},a=function(){r&&clearTimeout(r),r=setTimeout(function(){o(),r=null,i&&n._scrollListener&&n._scrollListener.fn()},50)};if(this._autoObserver=this.observe("~/tableHeight",a),this._autoObserver.fire=a,"virtual"===e){var l,s=!1,d=function(){if(n.rendered){if(l||(l=n.find(".rtable-top")),!i)return a();var e=l.scrollTop,t=n.get("virtual")||{},r=t.offset,o=n.get("_paginate"),d=o-10,c=n.get("rows.length");o>c&&(o=c);var f=n._avgSize,u=d*f,h=Math.floor(e/f)-5;h<0&&(h=0);var p=h;if(h+o>c&&(h=c-o),r===h&&!isNaN(t.top))return s=!1;if(!y(r)||isNaN(r)||isNaN(t.top)||e<t.top+u||e>t.bottom-u||r>0&&e<f*d){var b=p,g=c-p-o;b<0?(g+=-1*b,b=0):b>c-o&&(b=c-o),g<0&&(g=0);var v,m,x=b*f,w=g*f;h<r+o&&h>r-o&&(v=h>r?n.findAll(".rtable-live")[h-r]:n.findAll(".rtable-live")[r-h]),v&&h>0&&v.offsetTop>l.scrollTop-u-5&&v.offsetTop<l.scrollTop+u&&(m=v.offsetTop),n.set({"virtual.above":x,"virtual.below":w,"virtual.offset":h}),"number"==typeof m&&m!==v.offsetTop&&n.set("virtual.above",x+(m-v.offsetTop)),n.set({"virtual.top":n.get("virtual.above"),"virtual.bottom":l.scrollHeight-w})}s=!1}else l=null},c=this._scrollListener=this.on("scroll",function(e){e.node;s||(s=!0,requestAnimationFrame(d))});c.fn=d,c.observer=this.observe("rows.length",function(){n.set("virtual.offset",null),d()},{init:!1,strict:!0,defer:!0});var f=c.cancel;c.cancel=function(){f(),c.observer.cancel()}}a()}else this._autoObserver&&this._autoObserver.cancel(),this._scrollListener&&this._scrollListener.cancel();y(e)&&this.set("_paginate",e)},defer:!0},"scrollOffset tableHeight":{handler:function(){var e=this;requestAnimationFrame(function(){var t=e.find(".rtable-top"),n=t&&e.getContext(t);n&&n.decorators&&n.decorators.scrolled&&n.decorators.scrolled.refresh()})},init:!1}},data:function(){return Object.assign({page:0,selections:[],showGroups:!0,allowGroupSelect:!0,expanded:null,minPerPage:10,virtual:{offset:0},shuffle:!1,rows:[]},P.settings)},computed:{allowSelect:function(){return this.get("allow-select")},allowSelectAll:function(){return this.get("allow-select-all")},fixedHeader:function(){return this.get("fixed-header")},autoTitles:function(){return this.get("auto-titles")},noHeader:function(){return this.get("no-header")},noWrap:function(){return this.get("no-wrap")},_rows:function(){var e=(this.get("items")||[]).slice(),t=this.get("filter"),n=this.get("sort"),r=this.get("parameters"),i=(this.get("data-handler"),this.get("@style.raui.table.data-handler"),[this.get("data-pre-handler"),this.get("@style.raui.table.data-pre-handler")]),o=i[0],a=i[1];return(o||a)&&(o||a)(this,e,t,n,r),{}},visibleRows:function(){var e=this,n=this.get("rows"),r=this.get("paginate"),i=r,o=this.get("_paginate"),a=this.get("page")||0,l=this.get("virtual");return i?("number"!=typeof i&&isNaN(+i)&&(i="auto"===i||"virtual"===i||i instanceof t?o||1:30),i<this.get("minPerPage")&&(i=this.get("minPerPage")),"virtual"===r?(a=l&&l.offset||0,n.slice(a,a+i)):(a*i>n.length&&setTimeout(function(){return e.set("page",0)},0),n.slice(i*a,i*a+i))):n},pagination:function(){var e=this.get("items")||T,t=this.get("rows"),n=this.get("paginate"),r=n,i=this.get("page")||0;if("number"!=typeof r&&isNaN(r)&&(r=this.get("_paginate")),r<this.get("minPerPage")&&(r=this.get("minPerPage")),r){var o=Math.ceil(t.length/r),a={max:Math.ceil(e.length/r),total:o,per:r};if("virtual"===n&&(a.height=this._avg*t.length),a.total>14){var l=a.array=[];i>5?l.push(1,2,3,"..."):l.push(1,2,3,4,5,6,7,8),i>5&&i+6<o?l.push(i-1,i,i+1,i+2,i+3,"...",o-2,o-1,o):i+6<o?l.push("...",o-2,o-1,o):l.push(o-7,o-6,o-5,o-4,o-3,o-2,o-1,o)}else a.array=Array.apply(null,{length:a.total}).map(function(e,t){return t+1});return a}},groups:function(){for(var e,t,n=this.get("rows"),r={},i=0;i<n.length;i++)(t=n[i][this._init.by])!=e&&(r[i]=1),e=t;return r}}});var A=/^[^\d]*/;function E(e){return y(e)?e:e&&(e=(""+e).replace(A,""))?parseFloat(e):1/0}function H(e,n,r){if("function"==typeof n.get)return n.get;var i=(r?n.sort:0)||n.path||n.filter||n.id;if("string"==typeof i){var o=t.splitKeypath(i);return function(e){for(var t=e,n=0;n<o.length;n++)t=t&&t[o[n]];return t}}}function z(e,t,n,r){var i=[].concat(e.viewmodel.value.columns,e.viewmodel.value.fields),o=i.reduce(function(e,t){return e[t.id]=H(0,t),e},{}),a=Object.values(o),l=t||[];if((n instanceof RegExp||_(n))&&n){var s=n===""+n.toLowerCase()||n===""+n.toUpperCase();try{var d=_(n)?new RegExp(n,s?"i":""):n;l=l.filter(function(e){for(var t=a.length;t--;){var n=e&&a[t](e);if(n&&d.test(n))return!0}})}catch(e){}}return(_(r)||k(r)&&!Array.isArray(r))&&(r=[r]),Array.isArray(r)&&(r=r.map(function(t){if(_(t)){var n="-"===t[0]||"+"===t[0]?t.substr(1):t,r=i.find(function(e){return e.id===n});if(!r)return;var o={get:H(0,r,!0),dir:"-"===t[0]?-1:1};if(r&&"number"===r.type){var a=o.get;o.get=function(t){return E(a.call(e,t))}}return o}if(t&&"object"==typeof t){var l=i.find(function(e){return e.id===id});if(!l)return;var s={dir:y(t.dir)?t.dir:"desc"===t.dir?-1:1,get:H(0,l,!0)};if("number"===t.type||l&&"number"===l.type){var d=s.get;s.get=function(t){return E(d.call(e,t))}}return s}}).filter(function(e){return e&&e.get}),l.sort(function(t,n){for(var i,o,a,l=0;l<r.length;l++)if(i=r[l].get.call(e,t),o=r[l].get.call(e,n),0!==(a=r[l].dir*(i<o?-1:i>o?1:0)))return a;return a})),l}var L=["label","type","filter","hidden","sort","no-pad","id","editable","fixed"],W=/^[a-z]{1,3}[0-9]+(?:-[0-9]+)?$/,T=[];function j(e){return void 0===e&&(e={}),function(t){var n=t.Ractive,r=t.instance;"includeGrid"in e&&n.styleSet("table.includeGrid",e.includeGrid),r.components[e.name||"data-table"]=P}}i("RMTable","components",P),e.Table=P,e.numberify=E,e.plugin=j,e.default=j,Object.defineProperty(e,"__esModule",{value:!0})});

@@ -121,3 +121,3 @@ (function (global, factory) {

var Tabs = (function (Ractive) {
var Tabs = /*@__PURE__*/(function (Ractive) {
function Tabs(opts) {

@@ -236,3 +236,3 @@ Ractive.call(this, opts);

return "\n .rtabs {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n \n .rtabs-tab-window {\n overflow-y: hidden;\n overflow-x: auto;\n " + (!boxy ? ("box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),\n 0 1px 5px 0 rgba(0, 0, 0, 0.12),\n 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bg || '#fff') + ";") :
("border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n border-width: 1px 1px 0 1px;\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bga || '#f4f4f4') + ";\n ")) + "\n position: relative;\n flex-shrink: 0;\n }\n .alt > div > .rtabs-tab-window {\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fga || '#07e') + ";\n }" + (boxy ? ("\n .alt > div > .rtabs-tab-window .rtabs-tab {\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fga || '#07e') + ";\n }") : '') + "\n \n .rtabs-tab-window-wrapper {\n position: relative;\n }\n .rtabs-tab-window-wrapper:before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 10px;\n opacity: 0;\n transition: opacity 0.3s ease-in-out;\n background: linear-gradient(to right, " + (primary.indicator.color || primary.fga || '#07e') + ", transparent);\n z-index: 999;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-left:before {\n opacity: 1;\n }\n \n .rtabs-tab-window-wrapper:after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n height: 100%;\n width: 10px;\n opacity: 0;\n background: linear-gradient(to left, " + (primary.indicator.color || primary.fga || '#07e') + ", transparent);\n transition: opacity 0.3s ease-in-out;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-right:after {\n opacity: 1;\n }\n \n .rtabs-flat > div > .rtabs-tab-window {\n box-shadow: none;\n border-width: 0;\n }\n " + (!boxy ? (".rtabs-flat > div > .rtabs-tab-window:after {\n content: '';\n height: 0.15em;\n position: absolute;\n bottom: 0px;\n width: 100%;\n display: block;\n background-color: " + (primary.bga || '#f4f4f4') + ";\n }\n .rtabs-flat.alt > div > .rtabs-tab-window:after {\n background-color: " + (primary.fga || '#07e') + ";\n }") : ("\n .rtabs-flat > div > .rtabs-tab-window {\n background-color: " + (primary.bg || '#fff') + ";\n }\n .alt.rtabs-flat > div > .rtabs-tab-window {\n background-color: " + (primary.fga || '#07e') + ";\n }\n .rtabs-flat > div > .rtabs-tab-window .rtabs-tab {\n border-top-width: 1px;\n }")) + "\n \n .rtabs-center.rtabs-left {\n text-align: center;\n }" + (boxy ? "\n .rtabs-center > .rtabs-tab:first-child {\n border-left-width: 1px;\n }" : '') + "\n \n .rtabs-pad {\n padding: 1em;\n }\n \n .rtabs-fill {\n flex-grow: 1;\n height: 100%;\n }\n \n .rtabs-tabs {\n display: table;\n position: relative;\n min-width: 100%;\n white-space: nowrap;" + (boxy ? ("\n border-style: solid;\n border-width: 0 0 1px 0;\n border-color: " + (primary.bc || '#ccc') + ";\n line-height: 1.5em;") : '') + "\n }\n \n .rtabs-tab {\n display: inline-block;\n box-sizing: border-box;\n padding: 0.5em 1em;\n height: 2.5em;\n transition: opacity 0.2s ease-in-out;\n user-select: none;\n cursor: pointer;" + (!boxy ? "\n opacity: 0.9;" : ("\n border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n border-width: 0 1px 1px 0;\n margin-bottom: -1px;\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bga || '#f4f4f4') + ";\n ")) + "\n }\n .rtabs-tab:hover {\n opacity: 1;\n }\n \n .rtabs-selected" + (boxy ? ",\n .alt > div > .rtabs-tab-window .rtabs-selected" : '') + " {\n opacity: 1;" + (boxy ? ("\n font-weight: bold;\n border-bottom-color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.selected.bg || primary.bg || '#fff') + ";\n color: " + (primary.selected.fg || primary.fg || '#222') + ";") : '') + "\n }\n \n .rtabs-disabled {\n opacity: 0.4;\n }\n \n .rtabs-right {\n text-align: right;\n display: table-cell;\n }\n \n .rtabs-left {\n text-align: left;\n display: table-cell;\n }\n \n .rtabs-close {\n display: inline-block;\n margin-right: -0.5em;\n font-weight: 700;\n opacity: 0.3;\n transition: opacity: 0.2s ease-in-out;\n }\n \n .rtabs-close:hover {\n opacity: 1;\n }\n \n .rtabs-indicator {\n position: absolute;\n bottom: 0;\n height: 0.15em;\n background-color: " + (primary.indicator.color || primary.fga || '#07e') + ";\n z-index: 2;\n }\n \n .alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: " + (primary.bg || '#fff') + ";\n }\n \n .rtabs-going-left .rtabs-indicator {\n transition: left 0.2s ease-in-out, right 0.2s ease-in-out 0.1s;\n }\n .rtabs-going-right .rtabs-indicator {\n transition: left 0.2s ease-in-out 0.1s, right 0.2s ease-in-out;\n }\n \n .rtabs-content-wrapper {\n width: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex-grow: 2;\n overflow: hidden;\n }\n \n .rtabs-content-window {\n width: 100%;\n display: flex;\n flex-grow: 1;\n overflow-y: auto;\n overflow-x: hidden\n }\n \n .rtabs {\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bg || '#fff') + ";\n }\n \n .rtabs-contents {\n list-style: none;\n padding: 0;\n margin: 0;\n position: relative;\n left: 0;\n display: block;\n flex-wrap: nowrap;\n white-space: nowrap;\n width: 100%;\n }\n .rtabs-trans-slide > .rtabs-contents {\n transition: left 0.2s ease-in-out;\n }\n .rtabs-trans-fade > .rtabs-contents {\n transition: opacity 0.15s ease;\n opacity: 1;\n white-space: nowrap;\n }\n \n .rtabs-fill > div > div > .rtabs-contents {\n display: flex;\n }\n \n .rtabs-tab-content {\n display: inline-block;\n position: relative;\n width: 100%;\n overflow: auto;\n vertical-align: top;\n white-space: initial;\n transition: opacity 0.1s ease-in-out;\n flex-shrink: 0;\n white-space: initial;\n display: inline-block;\n flex-direction: column;\n flex-grow: 1;\n }\n \n .rtabs-placeholder {\n display: inline-block;\n width: 100%;\n height: 1px;\n flex-shrink: 0;\n }\n .rtabs-dyna.rtabs-not-selected {\n height: 1px;\n opacity: 0;\n overflow: hidden;\n }\n .rtabs-pad > .rtabs-tab-content {\n padding: 1em;\n box-sizing: border-box;\n }\n .rtabs-pad > .rtabs-tab-content.rtabs-no-pad {\n padding: 0;\n }\n .rtabs > .rtabs-tab-content.rtabs-pad {\n padding: 1em;\n box-sizing: border-box;\n }\n " + themes.map(function (t) {
("border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n border-width: 1px 1px 0 1px;\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bga || '#f4f4f4') + ";\n ")) + "\n position: relative;\n flex-shrink: 0;\n }\n .alt > div > .rtabs-tab-window {\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fga || '#07e') + ";\n }" + (boxy ? ("\n .alt > div > .rtabs-tab-window .rtabs-tab {\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fga || '#07e') + ";\n }") : '') + "\n \n .rtabs-tab-window-wrapper {\n position: relative;\n z-index: 10;\n }\n .rtabs-tab-window-wrapper:before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 10px;\n opacity: 0;\n transition: opacity 0.3s ease-in-out;\n background: linear-gradient(to right, " + (primary.indicator.color || primary.fga || '#07e') + ", transparent);\n z-index: 999;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-left:before {\n opacity: 1;\n }\n \n .rtabs-tab-window-wrapper:after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n height: 100%;\n width: 10px;\n opacity: 0;\n background: linear-gradient(to left, " + (primary.indicator.color || primary.fga || '#07e') + ", transparent);\n transition: opacity 0.3s ease-in-out;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-right:after {\n opacity: 1;\n }\n \n .rtabs-flat > div > .rtabs-tab-window {\n box-shadow: none;\n border-width: 0;\n }\n " + (!boxy ? (".rtabs-flat > div > .rtabs-tab-window:after {\n content: '';\n height: 0.15em;\n position: absolute;\n bottom: 0px;\n width: 100%;\n display: block;\n background-color: " + (primary.bga || '#f4f4f4') + ";\n }\n .rtabs-flat.alt > div > .rtabs-tab-window:after {\n background-color: " + (primary.fga || '#07e') + ";\n }") : ("\n .rtabs-flat > div > .rtabs-tab-window {\n background-color: " + (primary.bg || '#fff') + ";\n }\n .alt.rtabs-flat > div > .rtabs-tab-window {\n background-color: " + (primary.fga || '#07e') + ";\n }\n .rtabs-flat > div > .rtabs-tab-window .rtabs-tab {\n border-top-width: 1px;\n }")) + "\n \n .rtabs-center.rtabs-left {\n text-align: center;\n }" + (boxy ? "\n .rtabs-center > .rtabs-tab:first-child {\n border-left-width: 1px;\n }" : '') + "\n \n .rtabs-pad {\n padding: 1em;\n }\n \n .rtabs-fill {\n flex-grow: 1;\n height: 100%;\n }\n \n .rtabs-tabs {\n display: table;\n position: relative;\n min-width: 100%;\n white-space: nowrap;" + (boxy ? ("\n border-style: solid;\n border-width: 0 0 1px 0;\n border-color: " + (primary.bc || '#ccc') + ";\n line-height: 1.5em;") : '') + "\n }\n \n .rtabs-tab {\n display: inline-block;\n box-sizing: border-box;\n padding: 0.5em 1em;\n height: 2.5em;\n transition: opacity 0.2s ease-in-out;\n user-select: none;\n cursor: pointer;" + (!boxy ? "\n opacity: 0.9;" : ("\n border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n border-width: 0 1px 1px 0;\n margin-bottom: -1px;\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bga || '#f4f4f4') + ";\n ")) + "\n }\n .rtabs-tab:hover {\n opacity: 1;\n }\n \n .rtabs-selected" + (boxy ? ",\n .alt > div > .rtabs-tab-window .rtabs-selected" : '') + " {\n opacity: 1;" + (boxy ? ("\n font-weight: bold;\n border-bottom-color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.selected.bg || primary.bg || '#fff') + ";\n color: " + (primary.selected.fg || primary.fg || '#222') + ";") : '') + "\n }\n \n .rtabs-disabled {\n opacity: 0.4;\n }\n \n .rtabs-right {\n text-align: right;\n display: table-cell;\n }\n \n .rtabs-left {\n text-align: left;\n display: table-cell;\n }\n \n .rtabs-close {\n display: inline-block;\n margin-right: -0.5em;\n font-weight: 700;\n opacity: 0.3;\n transition: opacity: 0.2s ease-in-out;\n }\n \n .rtabs-close:hover {\n opacity: 1;\n }\n \n .rtabs-indicator {\n position: absolute;\n bottom: 0;\n height: 0.15em;\n background-color: " + (primary.indicator.color || primary.fga || '#07e') + ";\n z-index: 2;\n }\n \n .alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: " + (primary.bg || '#fff') + ";\n }\n \n .rtabs-going-left .rtabs-indicator {\n transition: left 0.2s ease-in-out, right 0.2s ease-in-out 0.1s;\n }\n .rtabs-going-right .rtabs-indicator {\n transition: left 0.2s ease-in-out 0.1s, right 0.2s ease-in-out;\n }\n \n .rtabs-content-wrapper {\n width: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex-grow: 2;\n overflow: hidden;\n }\n \n .rtabs-content-window {\n width: 100%;\n display: flex;\n flex-grow: 1;\n overflow-y: auto;\n overflow-x: hidden\n }\n \n .rtabs {\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bg || '#fff') + ";\n }\n \n .rtabs-contents {\n list-style: none;\n padding: 0;\n margin: 0;\n position: relative;\n left: 0;\n display: block;\n flex-wrap: nowrap;\n white-space: nowrap;\n width: 100%;\n }\n .rtabs-trans-slide > .rtabs-contents {\n transition: left 0.2s ease-in-out;\n }\n .rtabs-trans-fade > .rtabs-contents {\n transition: opacity 0.15s ease;\n opacity: 1;\n white-space: nowrap;\n }\n \n .rtabs-fill > div > div > .rtabs-contents {\n display: flex;\n }\n \n .rtabs-tab-content {\n display: inline-block;\n position: relative;\n width: 100%;\n overflow: auto;\n vertical-align: top;\n white-space: initial;\n transition: opacity 0.1s ease-in-out;\n flex-shrink: 0;\n white-space: initial;\n display: inline-block;\n flex-direction: column;\n flex-grow: 1;\n }\n \n .rtabs-placeholder {\n display: inline-block;\n width: 100%;\n height: 1px;\n flex-shrink: 0;\n }\n .rtabs-dyna.rtabs-not-selected {\n height: 1px;\n opacity: 0;\n overflow: hidden;\n }\n .rtabs-pad > .rtabs-tab-content {\n padding: 1em;\n box-sizing: border-box;\n }\n .rtabs-pad > .rtabs-tab-content.rtabs-no-pad {\n padding: 0;\n }\n .rtabs > .rtabs-tab-content.rtabs-pad {\n padding: 1em;\n box-sizing: border-box;\n }\n " + themes.map(function (t) {
var theme = Object.assign({}, data('raui.primary'), data('raui.tabs.primary'), data(("raui." + t)), data(("raui.tabs." + t)));

@@ -239,0 +239,0 @@ theme.selected = Object.assign({}, data('raui.tabs.selected'), data('raui.tabs.primary.selected'), data(("raui.tabs." + t + ".selected")));

@@ -1,1 +0,1 @@

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],n):n(t.RMTabs={},t.Ractive)}(this,function(t,n){"use strict";n=n&&n.hasOwnProperty("default")?n.default:n;var e="undefined"!=typeof window?window:null;var i=function(t){function n(n){t.call(this,n)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.addTab=function(t,n){t.template||(t.template=[]),"number"==typeof n?this.splice("tabs",n,0,t):this.push("tabs",t);var e=new o(this,t);return t.select&&this.select(e.index),e},n.prototype.getTab=function(t){var n=this.get("tabs"),e=n.find(function(n){return n.id===t});return e?new o(this,e):t in n&&"object"==typeof n[t]?new o(this,n[t]):void 0},n.prototype.updateIndicator=function(){if(this.rendered){var t=this.getContext(this.find(".rtabs-tab-window"));if(t.decorators.scrolled&&t.decorators.scrolled.refresh(),!this.get("@style.raui.tabs.boxy")){var n=this._tabs[this.get("selected")];if(n&&n.offsetParent)if(n){var e=this.get("selectedLeft");if(void 0===e)this.set({selectedLeft:n.offsetLeft,selectedRight:n.offsetParent.clientWidth-(n.offsetLeft+n.offsetWidth)});else{var i=n.offsetParent.clientWidth,r=n.offsetLeft,s=i-r-n.clientWidth;this.set({direction:r<e?"left":"right",selectedLeft:r,selectedRight:s})}}else this.set({selectedLeft:0,selectedRight:this.find(".tabs").offsetWidth})}}},n.prototype.checkSelection=function(t,n){this.get("selected")!==n&&s.call(this,t,n)},n.prototype.select=function(t){this.fire("select",{},t)},n.prototype._hidden=function(t){var n=this.get("tabs."+t+".hidden");return"string"==typeof n?this.get(n):n},n.prototype.stopHorizontalScroll=function(t){t.scrollLeft&&(t.scrollLeft=0)},n.prototype._scrollsRight=function(){var t=this.get("scrollStatus")||"";if(/hscroll.*(hmiddle|left)/.test(t)&&!/right/.test(t))return!0},n.prototype._scrollsLeft=function(){var t=this.get("scrollStatus")||"";if(/hscroll.*(hmiddle|right)/.test(t)&&!/left/.test(t))return!0},n}(n),r=["closable","disabled","title","right","button","no-pad","hidden","id","load"];function s(t,n){var e,i=this,r=this.get("selected"),s=this.get("transition");if(r!==n){var o=this.getContext(this.find(".rtabs-selected")),a=this.find(".rtabs-content-window");if(~r&&this.set("scroll."+o.get("@index"),a.scrollTop),o.hasListener("leave")&&o.raise("leave"),"fade"===s){this.set({opacity:0,selected:n}),this.updateIndicator();var l=this.getContext(this.find(".rtabs-selected"));setTimeout(function(){var t;i.set(((t={selectedContent:n})["tabs."+n+".load"]=!0,t.opacity=1,t)),l.hasListener("enter")&&l.raise("enter"),a&&~r&&(a.scrollTop=i.get("scroll."+n)||0)},150)}else if("slide"===s){this.set("selected",n),this.set("tabs."+n+".load",!0),this.set("selectedContent",n),this.updateIndicator();var c=this.getContext(this.find(".rtabs-selected"));c.hasListener("enter")&&c.raise("enter"),a&&~r&&(a.scrollTop=this.get("scroll."+n)||0)}else{this.set(((e={selected:n})["tabs."+n+".load"]=!0,e.selectedContent=n,e)),this.updateIndicator();var d=this.getContext(this.find(".rtabs-selected"));d.hasListener("enter")&&d.raise("enter"),a&&(a.scrollTop=this.get("scroll."+n)||0)}~r&&a&&a.scrollLeft&&(a.scrollLeft=0)}}n.extendWith(i,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs",g:1},{t:16,r:"extra-attributes"},{n:"class-rtabs-flat",t:13,f:[{t:2,r:"~/flat"}]},{n:"class-rtabs-margin",t:13,f:[{t:2,r:"~/margin"}]},{n:"class-rtabs-fill",t:13,f:[{t:2,r:"~/fill"}]},{n:"sized",t:71,f:{r:[],s:'[{clientWidth:"~/clientWidth"}]'}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-window-wrapper",g:1},{n:"class-rtabs-scroll-right",t:13,f:[{t:2,x:{r:["@this"],s:"_0._scrollsRight()"}}]},{n:"class-rtabs-scroll-left",t:13,f:[{t:2,x:{r:["@this"],s:"_0._scrollsLeft()"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-window",g:1},{t:4,f:[{n:"class-rtabs-going-left",t:13}],n:50,x:{r:[".direction"],s:'_0==="left"'}},{t:4,f:[{n:"class-rtabs-going-right",t:13}],n:51,l:1},{n:"scrolled",t:71,f:{r:[],s:'["~/scrollStatus"]'}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tabs",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-left",g:1},{n:"class-rtabs-center",t:13,f:[{t:2,r:"~/center"}]}],f:[{t:4,f:[{t:4,f:[{t:8,r:"tab"}],n:50,x:{r:[".right","@this","@index"],s:"!_0&&!_1._hidden(_2)"}}],n:52,r:".tabs"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-right",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:"tab"}],n:50,x:{r:[".right","@this","@index"],s:"_0&&!_1._hidden(_2)"}}],n:52,r:".tabs"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-indicator",g:1},{n:"style-left",f:[{t:2,r:".selectedLeft"},"px"],t:13},{t:4,f:[{n:"style-right",f:[{t:2,r:".selectedRight"},"px"],t:13}],n:50,x:{r:[".selectedRight"],s:"_0!==undefined"}}]}],n:51,r:"@style.raui.tabs.boxy"}]}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-content-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-content-window",g:1},{t:4,f:[{n:"class-rtabs-trans-fade",t:13}],n:50,x:{r:[".transition"],s:'_0==="fade"'}},{t:4,f:[{n:"class-rtabs-trans-slide",t:13}],n:50,x:{r:[".transition"],s:'_0==="slide"'},l:1},{n:["scroll"],t:70,f:{r:["@this","@node"],s:"[_0.stopHorizontalScroll(_1)]"}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-contents",g:1},{n:"style-opacity",f:[{t:2,r:"~/opacity"}],t:13},{n:"style-left",f:[{t:2,x:{r:[".selectedContent"],s:"_0*-100"}},"%"],t:13},{n:"class-rtabs-pad",t:13,f:[{t:2,r:"~/pad"}]}],f:[{t:4,f:[{t:8,r:"tab-content"}],n:52,r:".tabs"}]}]}]}]}],e:{'[{clientWidth:"~/clientWidth"}]':function(){return[{clientWidth:"~/clientWidth"}]},"_0._scrollsRight()":function(t){return t._scrollsRight()},"_0._scrollsLeft()":function(t){return t._scrollsLeft()},'_0==="left"':function(t){return"left"===t},'["~/scrollStatus"]':function(){return["~/scrollStatus"]},"!_0&&!_1._hidden(_2)":function(t,n,e){return!t&&!n._hidden(e)},"_0&&!_1._hidden(_2)":function(t,n,e){return t&&!n._hidden(e)},"_0!==undefined":function(t){return void 0!==t},'_0==="fade"':function(t){return"fade"===t},'_0==="slide"':function(t){return"slide"===t},"[_0.stopHorizontalScroll(_1)]":function(t,n){return[t.stopHorizontalScroll(n)]},"_0*-100":function(t){return-100*t},"_0===_1":function(t,n){return t===n},'_0==="dynamic"':function(t){return"dynamic"===t},"_0!==_1":function(t,n){return t!==n},"_0===false":function(t){return!1===t},"[_0.checkSelection((_1),_2)]":function(t,n,e){return[t.checkSelection(n,e)]},'(_3==="always"&&_0===_1)||(_3&&_2)||!_3':function(t,n,e,i){return"always"===i&&t===n||i&&e||!i},"!_0":function(t){return!t},"_0===_1&&!_2":function(t,n,e){return t===n&&!e},'typeof _1==="string"?_0[_1]:_1':function(t,n){return"string"==typeof n?t[n]:n},'[["select",_0]]':function(t){return[["select",t]]},"[_0.button()]":function(t){return[t.button()]},'typeof _0==="function"':function(t){return"function"==typeof t},"[_0]":function(t){return[t]},'typeof _0==="string"':function(t){return"string"==typeof t},'[["close",_0]]':function(t){return[["close",t]]},"_0&&!_1":function(t,n){return t&&!n}},p:{"tab-content":[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-content",g:1},{n:"class-rtabs-selected-content",t:13,f:[{t:2,x:{r:["~/selectedContent","@index"],s:"_0===_1"}}]},{n:"class-rtabs-dyna",t:13,f:[{t:2,x:{r:["~/height"],s:'_0==="dynamic"'}}]},{n:"class-rtabs-not-selected",t:13,f:[{t:2,x:{r:["~/selectedContent","@index"],s:"_0!==_1"}}]},{t:4,f:[{t:16,r:".extra"}],n:50,r:".extra"},{t:4,f:[{n:"class-rtabs-no-pad",t:13}],n:50,x:{r:[".pad"],s:"_0===false"}},{t:4,f:[{n:"class-rtabs-no-pad",t:13,f:[{t:2,rx:{r:"~/",m:[{t:30,n:".padRef"}]}}]}],n:50,r:".padRef",l:1},{n:["focus"],t:70,f:{r:["@this","@context","@index"],s:"[_0.checkSelection((_1),_2)]"}}],f:[{t:4,f:[{t:16,r:".template"}],n:50,x:{r:["~/selectedContent","@index",".load","~/defer"],s:'(_3==="always"&&_0===_1)||(_3&&_2)||!_3'}}]}],n:50,x:{r:[".button"],s:"!_0"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-placeholder",g:1}]}],n:51,l:1}],tab:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab",g:1},{n:"class-rtabs-selected",t:13,f:[{t:2,x:{r:["~/selected","@index",".button"],s:"_0===_1&&!_2"}}]},{t:4,f:[{n:"class-rtabs-disabled",t:13}],n:50,x:{r:["~/",".disabled"],s:'typeof _1==="string"?_0[_1]:_1'}},{t:4,f:[{n:["click"],t:70,f:{r:["@index"],s:'[["select",_0]]'}}],n:50,x:{r:[".button"],s:"!_0"},l:1},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.button()]"}}],n:50,x:{r:[".button"],s:'typeof _0==="function"'},l:1},{n:"registered",t:71,f:{r:["@index"],s:"[_0]"}},{t:4,f:[{t:16,r:".extraTab"}],n:50,r:".extraTab"},{n:"data-tab-index",f:[{t:2,r:"@index"}],t:13}],f:[{t:4,f:[{t:2,r:"title"}],n:50,x:{r:[".title"],s:'typeof _0==="string"'}},{t:4,f:[{t:16,r:".title"}],n:50,r:".title",l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-close",g:1},{n:["click"],t:70,f:{r:["@index"],s:'[["close",_0]]'}}],f:["×"]}],n:50,x:{r:[".closable",".button"],s:"_0&&!_1"}}]}]}},cssId:"rtab",noCssTransform:!0,css:function(t){return[function(t){var n=Object.assign({},t("raui.primary"),t("raui.tabs.primary"));n.selected=Object.assign({},t("raui.tabs.selected"),t("raui.tabs.primary.selected")),n.indicator=Object.assign({},t("raui.tabs.indicator"),t("raui.tabs.primary.indicator"));var e=(t("raui.themes")||[]).slice();(t("raui.tabs.themes")||[]).forEach(function(t){~e.indexOf(t)||e.push(t)});var i=t("raui.tabs.boxy")||t("raui.tabs.primary.boxy");return"\n .rtabs {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n \n .rtabs-tab-window {\n overflow-y: hidden;\n overflow-x: auto;\n "+(i?"border-color: "+(n.bc||"#ccc")+";\n border-style: solid;\n border-width: 1px 1px 0 1px;\n color: "+(n.fg||"#222")+";\n background-color: "+(n.bga||"#f4f4f4")+";\n ":"box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),\n 0 1px 5px 0 rgba(0, 0, 0, 0.12),\n 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n color: "+(n.fg||"#222")+";\n background-color: "+(n.bg||"#fff")+";")+"\n position: relative;\n flex-shrink: 0;\n }\n .alt > div > .rtabs-tab-window {\n color: "+(n.bg||"#fff")+";\n background-color: "+(n.fga||"#07e")+";\n }"+(i?"\n .alt > div > .rtabs-tab-window .rtabs-tab {\n color: "+(n.bg||"#fff")+";\n background-color: "+(n.fga||"#07e")+";\n }":"")+"\n \n .rtabs-tab-window-wrapper {\n position: relative;\n }\n .rtabs-tab-window-wrapper:before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 10px;\n opacity: 0;\n transition: opacity 0.3s ease-in-out;\n background: linear-gradient(to right, "+(n.indicator.color||n.fga||"#07e")+", transparent);\n z-index: 999;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-left:before {\n opacity: 1;\n }\n \n .rtabs-tab-window-wrapper:after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n height: 100%;\n width: 10px;\n opacity: 0;\n background: linear-gradient(to left, "+(n.indicator.color||n.fga||"#07e")+", transparent);\n transition: opacity 0.3s ease-in-out;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-right:after {\n opacity: 1;\n }\n \n .rtabs-flat > div > .rtabs-tab-window {\n box-shadow: none;\n border-width: 0;\n }\n "+(i?"\n .rtabs-flat > div > .rtabs-tab-window {\n background-color: "+(n.bg||"#fff")+";\n }\n .alt.rtabs-flat > div > .rtabs-tab-window {\n background-color: "+(n.fga||"#07e")+";\n }\n .rtabs-flat > div > .rtabs-tab-window .rtabs-tab {\n border-top-width: 1px;\n }":".rtabs-flat > div > .rtabs-tab-window:after {\n content: '';\n height: 0.15em;\n position: absolute;\n bottom: 0px;\n width: 100%;\n display: block;\n background-color: "+(n.bga||"#f4f4f4")+";\n }\n .rtabs-flat.alt > div > .rtabs-tab-window:after {\n background-color: "+(n.fga||"#07e")+";\n }")+"\n \n .rtabs-center.rtabs-left {\n text-align: center;\n }"+(i?"\n .rtabs-center > .rtabs-tab:first-child {\n border-left-width: 1px;\n }":"")+"\n \n .rtabs-pad {\n padding: 1em;\n }\n \n .rtabs-fill {\n flex-grow: 1;\n height: 100%;\n }\n \n .rtabs-tabs {\n display: table;\n position: relative;\n min-width: 100%;\n white-space: nowrap;"+(i?"\n border-style: solid;\n border-width: 0 0 1px 0;\n border-color: "+(n.bc||"#ccc")+";\n line-height: 1.5em;":"")+"\n }\n \n .rtabs-tab {\n display: inline-block;\n box-sizing: border-box;\n padding: 0.5em 1em;\n height: 2.5em;\n transition: opacity 0.2s ease-in-out;\n user-select: none;\n cursor: pointer;"+(i?"\n border-color: "+(n.bc||"#ccc")+";\n border-style: solid;\n border-width: 0 1px 1px 0;\n margin-bottom: -1px;\n color: "+(n.fg||"#222")+";\n background-color: "+(n.bga||"#f4f4f4")+";\n ":"\n opacity: 0.9;")+"\n }\n .rtabs-tab:hover {\n opacity: 1;\n }\n \n .rtabs-selected"+(i?",\n .alt > div > .rtabs-tab-window .rtabs-selected":"")+" {\n opacity: 1;"+(i?"\n font-weight: bold;\n border-bottom-color: "+(n.bg||"#fff")+";\n background-color: "+(n.selected.bg||n.bg||"#fff")+";\n color: "+(n.selected.fg||n.fg||"#222")+";":"")+"\n }\n \n .rtabs-disabled {\n opacity: 0.4;\n }\n \n .rtabs-right {\n text-align: right;\n display: table-cell;\n }\n \n .rtabs-left {\n text-align: left;\n display: table-cell;\n }\n \n .rtabs-close {\n display: inline-block;\n margin-right: -0.5em;\n font-weight: 700;\n opacity: 0.3;\n transition: opacity: 0.2s ease-in-out;\n }\n \n .rtabs-close:hover {\n opacity: 1;\n }\n \n .rtabs-indicator {\n position: absolute;\n bottom: 0;\n height: 0.15em;\n background-color: "+(n.indicator.color||n.fga||"#07e")+";\n z-index: 2;\n }\n \n .alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(n.bg||"#fff")+";\n }\n \n .rtabs-going-left .rtabs-indicator {\n transition: left 0.2s ease-in-out, right 0.2s ease-in-out 0.1s;\n }\n .rtabs-going-right .rtabs-indicator {\n transition: left 0.2s ease-in-out 0.1s, right 0.2s ease-in-out;\n }\n \n .rtabs-content-wrapper {\n width: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex-grow: 2;\n overflow: hidden;\n }\n \n .rtabs-content-window {\n width: 100%;\n display: flex;\n flex-grow: 1;\n overflow-y: auto;\n overflow-x: hidden\n }\n \n .rtabs {\n color: "+(n.fg||"#222")+";\n background-color: "+(n.bg||"#fff")+";\n }\n \n .rtabs-contents {\n list-style: none;\n padding: 0;\n margin: 0;\n position: relative;\n left: 0;\n display: block;\n flex-wrap: nowrap;\n white-space: nowrap;\n width: 100%;\n }\n .rtabs-trans-slide > .rtabs-contents {\n transition: left 0.2s ease-in-out;\n }\n .rtabs-trans-fade > .rtabs-contents {\n transition: opacity 0.15s ease;\n opacity: 1;\n white-space: nowrap;\n }\n \n .rtabs-fill > div > div > .rtabs-contents {\n display: flex;\n }\n \n .rtabs-tab-content {\n display: inline-block;\n position: relative;\n width: 100%;\n overflow: auto;\n vertical-align: top;\n white-space: initial;\n transition: opacity 0.1s ease-in-out;\n flex-shrink: 0;\n white-space: initial;\n display: inline-block;\n flex-direction: column;\n flex-grow: 1;\n }\n \n .rtabs-placeholder {\n display: inline-block;\n width: 100%;\n height: 1px;\n flex-shrink: 0;\n }\n .rtabs-dyna.rtabs-not-selected {\n height: 1px;\n opacity: 0;\n overflow: hidden;\n }\n .rtabs-pad > .rtabs-tab-content {\n padding: 1em;\n box-sizing: border-box;\n }\n .rtabs-pad > .rtabs-tab-content.rtabs-no-pad {\n padding: 0;\n }\n .rtabs > .rtabs-tab-content.rtabs-pad {\n padding: 1em;\n box-sizing: border-box;\n }\n "+e.map(function(n){var e=Object.assign({},t("raui.primary"),t("raui.tabs.primary"),t("raui."+n),t("raui.tabs."+n));e.selected=Object.assign({},t("raui.tabs.selected"),t("raui.tabs.primary.selected"),t("raui.tabs."+n+".selected")),e.indicator=Object.assign({},t("raui.tabs.indicator"),t("raui.tabs.primary.indicator"),t("raui.tabs."+n+".indicator"));var i="boxy"in e?e.boxy:t("raui.tabs.boxy");return".rtabs."+n+" > div > .rtabs-tab-window {\n "+(i?"border-color: "+(e.bc||"#ccc")+";\n color: "+(e.fg||"#222")+";\n background-color: "+(e.bga||"#f4f4f4")+";\n ":"box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),\n 0 1px 5px 0 rgba(0, 0, 0, 0.12),\n 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n color: "+(e.fg||"#222")+";\n background-color: "+(e.bg||"#fff")+";")+"\n }\n .rtabs."+n+" > .rtabs-tab-window-wrapper:before {\n background: linear-gradient(to right, "+(e.indicator.color||e.fga||"#07e")+", transparent);\n }\n .rtabs."+n+" > .rtabs-tab-window-wrapper:after {\n background: linear-gradient(to left, "+(e.indicator.color||e.fga||"#07e")+", transparent);\n }\n .rtabs."+n+".alt > div > .rtabs-tab-window {\n color: "+(e.bg||"#fff")+";\n background-color: "+(e.fga||"#07e")+";\n }"+(i?"\n .rtabs."+n+".alt > div > .rtabs-tab-window .rtabs-tab {\n color: "+(e.bg||"#fff")+";\n background-color: "+(e.fga||"#07e")+";\n }":"")+"\n \n "+(i?"\n .rtabs-flat."+n+" > div > .rtabs-tab-window {\n background-color: "+(e.bg||"#fff")+";\n }\n .alt.rtabs-flat."+n+" > div > .rtabs-tab-window {\n background-color: "+(e.fga||"#07e")+";\n }":".rtabs-flat."+n+" > div > .rtabs-tab-window:after {\n background-color: "+(e.bga||"#f4f4f4")+";\n }\n .rtabs-flat.alt."+n+" > div > .rtabs-tab-window:after {\n background-color: "+(e.fga||"#07e")+";\n }")+"\n \n "+(i?".rtabs."+n+" > div > .rtabs-tab-window .rtabs-tabs {\n border-color: "+(e.bc||"#ccc")+";\n }":"")+"\n \n .rtabs."+n+" > div > .rtabs-tab-window > .rtabs-tab {\n cursor: pointer;"+(i?"\n border-color: "+(e.bc||"#ccc")+";\n color: "+(e.fg||"#222")+";\n background-color: "+(e.bga||"#f4f4f4")+";\n ":"")+"\n }\n \n .rtabs."+n+" > div > .rtabs-tab-window .rtabs-selected"+(i?",\n .rtabs."+n+".alt > div > .rtabs-tab-window .rtabs-selected":"")+" {"+(i?"\n border-bottom-color: "+(them.bg||"#fff")+";\n background-color: "+(e.selected.bg||e.bg||"#fff")+";"+(e.indicator?"\n background-image: linear-gradient(to bottom, "+(e.indicator.color||e.fga||"#07e")+", "+(e.bg||"#fff")+" 3px);":"")+"\n color: "+(e.selected.fg||e.fg||"#222")+";":"")+"\n }\n \n .rtabs."+n+" > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(e.indicator.color||e.fga||"#07e")+";\n }\n \n .rtabs."+n+".alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(e.bg||"#fff")+";\n }\n \n .rtabs."+n+" {\n color: "+(e.fg||"#222")+";\n background-color: "+(e.bg||"#fff")+";\n }\n "}).join("\n")}.call(this,t)].join(" ")},attributes:["transition","flat","pad","center","height","fill","defer"],data:function(){return{tabs:[],rightTabs:[],selected:-1,selectedContent:-1,opacity:1,scrollStatus:""}},on:{construct:function(){var t=this.component;if(!t)return;var n=t.template.f||[],e=t.template.m?t.template.m.slice():[],i=t.template;t.template={e:i.e,f:i.f,t:i.t,m:e};var s=n.filter(function(t){return"tab"===t.e}).map(function(t){var n,i={template:{t:t.f.filter(function(t){return"title"!==t.e})}},s=[],o=[];return t.m&&t.m.forEach(function(t){if(13===t.t&&~r.indexOf(t.n))if("disabled"===t.n&&t.f&&1===t.f.length&&2===t.f[0].t){var n="_cnd"+e.length;i.disabled=n,e.push({t:13,n:n,f:t.f})}else if("no-pad"===t.n)if(t.f){if(1===t.f.length&&2===t.f[0].t){var a="_cnd"+e.length;i.padRef=a,e.push({t:13,n:a,f:t.f})}}else i.pad=!1;else if("hidden"===t.n&&t.f&&1===t.f.length&&2===t.f[0].t){var l="_cnd"+e.length;i.hidden=l,e.push({t:13,n:l,f:t.f})}else i[t.n]=0===t.f||("string"==typeof t.f?t.f:{t:t.f});else 70===t.t?o.push(t):s.push(t)}),(n=t.f.find(function(t){return"title"===t.e}))&&(i.title=n.f,n.m&&o.push.apply(o,n.m)),s.length&&(i.extra={t:s}),o.length&&(i.extraTab={t:o}),i});this._tabs=s},config:function(){var t=this;this._tabs&&this.set("tabs",(this.get("tabs")||[]).concat(this._tabs),{shuffle:!0});var n=this.get("tabs"),e=this.indicatorObservers=[];n.forEach(function(n){"string"==typeof n.hidden&&e.push(t.observe(n.hidden,function(){return setTimeout(function(){return t.updateIndicator()})},{init:!1,defer:!0}))}),e.push(this.observe("tabs.*.hidden",function(){return setTimeout(function(){return t.updateIndicator()})},{init:!1,defer:!0})),this.once("render",function(){-1===t.get("selected")&&t.select(0)})},select:s,close:function(t,n){var e=this.getContext(this._tabs[n]),i=!0;"function"==typeof e.onclose&&(i=!1!==e.onclose.call(void 0));i&&e.element.events.find(function(t){return t.events.find(function(t){return"close"===t.name})})&&(i=!1!==e.raise("close"));i&&this.splice("tabs",n,1);return!1},teardown:function(){this.indicatorObservers.forEach(function(t){return t.cancel()})}},observe:{selected:{handler:function(t){var n=this,e=this._hidden(t),i=this.get("tabs");e&&setTimeout(function(){var e=n.get("transition");n.set("transition",""),n.select(t+1>=i.length?0:t+1),n.set("transition",e)})},init:!1},clientWidth:function(){this.updateIndicator()}},decorators:{registered:function(t,n){var e=this;return this._tabs||(this._tabs=[]),this._tabs[n]=t,this.updateIndicator(),{teardown:function(){},invalidate:function(){e.updateIndicator()},update:function(n){e._tabs[n]=t,setTimeout(function(){return e.updateIndicator()})}}},scrolled:function(t,n){void 0===n&&(n={});var e="string"==typeof n?n:n.bind;if("string"!=typeof e)return{teardown:function(){}};var i=n.allow||2,r=this.getContext(t);function s(){var n="";t.scrollHeight>t.clientHeight&&(n+="vscroll"),t.scrollWidth>t.clientWidth&&(n+=(n?" ":"")+"hscroll"),t.scrollTop<=i&&(n+=" top"),t.scrollTop>=t.scrollHeight-t.clientHeight-i&&(n+=" bottom"),~n.indexOf("top")||~n.indexOf("bottom")||(n+=" vmiddle"),t.scrollLeft<=i&&(n+=" left"),t.scrollLeft>=t.scrollWidth-t.clientWidth-i?n+=" right":~n.indexOf("left")||~n.indexOf("right")||(n+=" hmiddle"),r.set(e,n)}return t.addEventListener("scroll",s,{passive:!0}),requestAnimationFrame(s),{refresh:s,teardown:function(){t.removeEventListener("scroll",s)}}},sized:function(t,n){var e=n.context||this.getContext(t),i={position:t.style.position,overflowY:t.style.overflowY};""!==t.style.position&&"static"!==t.style.position||(t.style.position="relative");var r=document.createElement("object");r.setAttribute("style","display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"),r.type="text/html";var s=function(){n.offsetWidth&&e.set(n.offsetWidth,t.offsetWidth),n.offsetHeight&&e.set(n.offsetHeight,t.offsetHeight),n.clientWidth&&e.set(n.clientWidth,t.clientWidth),n.clientHeight&&e.set(n.clientHeight,t.clientHeight),n.diffWidth&&e.set(n.diffWidth,t.offsetWidth-t.clientWidth),n.diffHeight&&e.set(n.diffHeight,t.offsetHeight-t.clientHeight)};return r.onload=function(){r.contentDocument.defaultView.addEventListener("resize",s),s()},/Trident/.test(navigator.userAgent)?(t.appendChild(r),r.data="about:blank"):(r.data="about:blank",t.appendChild(r)),{refresh:s,teardown:function(){t.removeChild(r),t.style.position=i.position,t.style.overflowY=i.overflowY}}}}});var o=function(t,n){this.tabs=t,this.item=n},a={keypath:{configurable:!0},id:{configurable:!0},index:{configurable:!0},title:{configurable:!0},template:{configurable:!0},hidden:{configurable:!0},right:{configurable:!0},pad:{configurable:!0},disabled:{configurable:!0},button:{configurable:!0},closable:{configurable:!0},load:{configurable:!0}};function l(t){return void 0===t&&(t={}),function(n){n.instance.components[t.name||"tabs"]=i}}a.keypath.get=function(){if(!this.removed)return"tabs."+this.index},a.id.get=function(){return this.get("id")},a.id.set=function(t){this.set("id",t)},a.index.get=function(){return this.tabs.get("tabs").indexOf(this.item)},a.title.get=function(){return this.get("title")},a.title.set=function(t){this.set("title",t)},a.template.get=function(){return this.get("template")},a.template.set=function(t){return this.set("template",t)},a.hidden.get=function(){return this.get("hidden")},a.hidden.set=function(t){return this.set("hidden",t)},a.right.get=function(){return this.get("right")},a.right.set=function(t){return this.set("right",t)},a.pad.get=function(){return this.get("pad")},a.pad.set=function(t){return this.set("pad",t)},a.disabled.get=function(){return this.get("disabled")},a.disabled.set=function(t){return this.set("disabled",t)},a.button.get=function(){return this.get("button")},a.button.set=function(t){return this.set("button",t)},a.closable.get=function(){return this.get("closable")},a.closable.set=function(t){return this.set("closable",t)},a.load.get=function(){return this.get("load")},a.load.set=function(t){return this.set("load",t)},o.prototype.select=function(){this.removed||this.tabs.select(this.index)},o.prototype.remove=function(){return!this.removed&&(this.tabs.splice("tabs",this.index,1),this.removed=!0,!0)},o.prototype.get=function(t){if(this.removed)return!1;if(!t)return this.tabs.get(this.keypath);var n=t.replace(/^[\.\/]*/,"");return this.tabs.get(this.keypath+"."+n)},o.prototype.set=function(t,n){if(this.removed)return!1;var e=t.replace(/^[\.\/]*/,"");return this.tabs.set(this.keypath+"."+e,n)},Object.defineProperties(o.prototype,a),function(t,n,i){if(e&&e.Ractive&&"object"==typeof e.Ractive[n]){var r=document.currentScript;if(r||(r=(r=document.querySelectorAll("script"))[r.length-1]),r){var s=r.getAttribute("data-alias");s&&(s=(s=s.split("&")).reduce(function(t,n){var e=n.split("="),i=e[0],r=e[1];return t[i]=r,t},{})),Ractive[n][s&&s[t]||t]=i}}}("RMTabs","components",i),t.Tabs=i,t.Handle=o,t.plugin=l,t.default=l,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],n):n(t.RMTabs={},t.Ractive)}(this,function(t,n){"use strict";n=n&&n.hasOwnProperty("default")?n.default:n;var e="undefined"!=typeof window?window:null;var i=function(t){function n(n){t.call(this,n)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.addTab=function(t,n){t.template||(t.template=[]),"number"==typeof n?this.splice("tabs",n,0,t):this.push("tabs",t);var e=new o(this,t);return t.select&&this.select(e.index),e},n.prototype.getTab=function(t){var n=this.get("tabs"),e=n.find(function(n){return n.id===t});return e?new o(this,e):t in n&&"object"==typeof n[t]?new o(this,n[t]):void 0},n.prototype.updateIndicator=function(){if(this.rendered){var t=this.getContext(this.find(".rtabs-tab-window"));if(t.decorators.scrolled&&t.decorators.scrolled.refresh(),!this.get("@style.raui.tabs.boxy")){var n=this._tabs[this.get("selected")];if(n&&n.offsetParent)if(n){var e=this.get("selectedLeft");if(void 0===e)this.set({selectedLeft:n.offsetLeft,selectedRight:n.offsetParent.clientWidth-(n.offsetLeft+n.offsetWidth)});else{var i=n.offsetParent.clientWidth,r=n.offsetLeft,s=i-r-n.clientWidth;this.set({direction:r<e?"left":"right",selectedLeft:r,selectedRight:s})}}else this.set({selectedLeft:0,selectedRight:this.find(".tabs").offsetWidth})}}},n.prototype.checkSelection=function(t,n){this.get("selected")!==n&&s.call(this,t,n)},n.prototype.select=function(t){this.fire("select",{},t)},n.prototype._hidden=function(t){var n=this.get("tabs."+t+".hidden");return"string"==typeof n?this.get(n):n},n.prototype.stopHorizontalScroll=function(t){t.scrollLeft&&(t.scrollLeft=0)},n.prototype._scrollsRight=function(){var t=this.get("scrollStatus")||"";if(/hscroll.*(hmiddle|left)/.test(t)&&!/right/.test(t))return!0},n.prototype._scrollsLeft=function(){var t=this.get("scrollStatus")||"";if(/hscroll.*(hmiddle|right)/.test(t)&&!/left/.test(t))return!0},n}(n),r=["closable","disabled","title","right","button","no-pad","hidden","id","load"];function s(t,n){var e,i=this,r=this.get("selected"),s=this.get("transition");if(r!==n){var o=this.getContext(this.find(".rtabs-selected")),a=this.find(".rtabs-content-window");if(~r&&this.set("scroll."+o.get("@index"),a.scrollTop),o.hasListener("leave")&&o.raise("leave"),"fade"===s){this.set({opacity:0,selected:n}),this.updateIndicator();var l=this.getContext(this.find(".rtabs-selected"));setTimeout(function(){var t;i.set(((t={selectedContent:n})["tabs."+n+".load"]=!0,t.opacity=1,t)),l.hasListener("enter")&&l.raise("enter"),a&&~r&&(a.scrollTop=i.get("scroll."+n)||0)},150)}else if("slide"===s){this.set("selected",n),this.set("tabs."+n+".load",!0),this.set("selectedContent",n),this.updateIndicator();var c=this.getContext(this.find(".rtabs-selected"));c.hasListener("enter")&&c.raise("enter"),a&&~r&&(a.scrollTop=this.get("scroll."+n)||0)}else{this.set(((e={selected:n})["tabs."+n+".load"]=!0,e.selectedContent=n,e)),this.updateIndicator();var d=this.getContext(this.find(".rtabs-selected"));d.hasListener("enter")&&d.raise("enter"),a&&(a.scrollTop=this.get("scroll."+n)||0)}~r&&a&&a.scrollLeft&&(a.scrollLeft=0)}}n.extendWith(i,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs",g:1},{t:16,r:"extra-attributes"},{n:"class-rtabs-flat",t:13,f:[{t:2,r:"~/flat"}]},{n:"class-rtabs-margin",t:13,f:[{t:2,r:"~/margin"}]},{n:"class-rtabs-fill",t:13,f:[{t:2,r:"~/fill"}]},{n:"sized",t:71,f:{r:[],s:'[{clientWidth:"~/clientWidth"}]'}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-window-wrapper",g:1},{n:"class-rtabs-scroll-right",t:13,f:[{t:2,x:{r:["@this"],s:"_0._scrollsRight()"}}]},{n:"class-rtabs-scroll-left",t:13,f:[{t:2,x:{r:["@this"],s:"_0._scrollsLeft()"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-window",g:1},{t:4,f:[{n:"class-rtabs-going-left",t:13}],n:50,x:{r:[".direction"],s:'_0==="left"'}},{t:4,f:[{n:"class-rtabs-going-right",t:13}],n:51,l:1},{n:"scrolled",t:71,f:{r:[],s:'["~/scrollStatus"]'}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tabs",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-left",g:1},{n:"class-rtabs-center",t:13,f:[{t:2,r:"~/center"}]}],f:[{t:4,f:[{t:4,f:[{t:8,r:"tab"}],n:50,x:{r:[".right","@this","@index"],s:"!_0&&!_1._hidden(_2)"}}],n:52,r:".tabs"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-right",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:"tab"}],n:50,x:{r:[".right","@this","@index"],s:"_0&&!_1._hidden(_2)"}}],n:52,r:".tabs"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-indicator",g:1},{n:"style-left",f:[{t:2,r:".selectedLeft"},"px"],t:13},{t:4,f:[{n:"style-right",f:[{t:2,r:".selectedRight"},"px"],t:13}],n:50,x:{r:[".selectedRight"],s:"_0!==undefined"}}]}],n:51,r:"@style.raui.tabs.boxy"}]}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-content-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-content-window",g:1},{t:4,f:[{n:"class-rtabs-trans-fade",t:13}],n:50,x:{r:[".transition"],s:'_0==="fade"'}},{t:4,f:[{n:"class-rtabs-trans-slide",t:13}],n:50,x:{r:[".transition"],s:'_0==="slide"'},l:1},{n:["scroll"],t:70,f:{r:["@this","@node"],s:"[_0.stopHorizontalScroll(_1)]"}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-contents",g:1},{n:"style-opacity",f:[{t:2,r:"~/opacity"}],t:13},{n:"style-left",f:[{t:2,x:{r:[".selectedContent"],s:"_0*-100"}},"%"],t:13},{n:"class-rtabs-pad",t:13,f:[{t:2,r:"~/pad"}]}],f:[{t:4,f:[{t:8,r:"tab-content"}],n:52,r:".tabs"}]}]}]}]}],e:{'[{clientWidth:"~/clientWidth"}]':function(){return[{clientWidth:"~/clientWidth"}]},"_0._scrollsRight()":function(t){return t._scrollsRight()},"_0._scrollsLeft()":function(t){return t._scrollsLeft()},'_0==="left"':function(t){return"left"===t},'["~/scrollStatus"]':function(){return["~/scrollStatus"]},"!_0&&!_1._hidden(_2)":function(t,n,e){return!t&&!n._hidden(e)},"_0&&!_1._hidden(_2)":function(t,n,e){return t&&!n._hidden(e)},"_0!==undefined":function(t){return void 0!==t},'_0==="fade"':function(t){return"fade"===t},'_0==="slide"':function(t){return"slide"===t},"[_0.stopHorizontalScroll(_1)]":function(t,n){return[t.stopHorizontalScroll(n)]},"_0*-100":function(t){return-100*t},"_0===_1":function(t,n){return t===n},'_0==="dynamic"':function(t){return"dynamic"===t},"_0!==_1":function(t,n){return t!==n},"_0===false":function(t){return!1===t},"[_0.checkSelection((_1),_2)]":function(t,n,e){return[t.checkSelection(n,e)]},'(_3==="always"&&_0===_1)||(_3&&_2)||!_3':function(t,n,e,i){return"always"===i&&t===n||i&&e||!i},"!_0":function(t){return!t},"_0===_1&&!_2":function(t,n,e){return t===n&&!e},'typeof _1==="string"?_0[_1]:_1':function(t,n){return"string"==typeof n?t[n]:n},'[["select",_0]]':function(t){return[["select",t]]},"[_0.button()]":function(t){return[t.button()]},'typeof _0==="function"':function(t){return"function"==typeof t},"[_0]":function(t){return[t]},'typeof _0==="string"':function(t){return"string"==typeof t},'[["close",_0]]':function(t){return[["close",t]]},"_0&&!_1":function(t,n){return t&&!n}},p:{"tab-content":[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-content",g:1},{n:"class-rtabs-selected-content",t:13,f:[{t:2,x:{r:["~/selectedContent","@index"],s:"_0===_1"}}]},{n:"class-rtabs-dyna",t:13,f:[{t:2,x:{r:["~/height"],s:'_0==="dynamic"'}}]},{n:"class-rtabs-not-selected",t:13,f:[{t:2,x:{r:["~/selectedContent","@index"],s:"_0!==_1"}}]},{t:4,f:[{t:16,r:".extra"}],n:50,r:".extra"},{t:4,f:[{n:"class-rtabs-no-pad",t:13}],n:50,x:{r:[".pad"],s:"_0===false"}},{t:4,f:[{n:"class-rtabs-no-pad",t:13,f:[{t:2,rx:{r:"~/",m:[{t:30,n:".padRef"}]}}]}],n:50,r:".padRef",l:1},{n:["focus"],t:70,f:{r:["@this","@context","@index"],s:"[_0.checkSelection((_1),_2)]"}}],f:[{t:4,f:[{t:16,r:".template"}],n:50,x:{r:["~/selectedContent","@index",".load","~/defer"],s:'(_3==="always"&&_0===_1)||(_3&&_2)||!_3'}}]}],n:50,x:{r:[".button"],s:"!_0"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-placeholder",g:1}]}],n:51,l:1}],tab:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab",g:1},{n:"class-rtabs-selected",t:13,f:[{t:2,x:{r:["~/selected","@index",".button"],s:"_0===_1&&!_2"}}]},{t:4,f:[{n:"class-rtabs-disabled",t:13}],n:50,x:{r:["~/",".disabled"],s:'typeof _1==="string"?_0[_1]:_1'}},{t:4,f:[{n:["click"],t:70,f:{r:["@index"],s:'[["select",_0]]'}}],n:50,x:{r:[".button"],s:"!_0"},l:1},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.button()]"}}],n:50,x:{r:[".button"],s:'typeof _0==="function"'},l:1},{n:"registered",t:71,f:{r:["@index"],s:"[_0]"}},{t:4,f:[{t:16,r:".extraTab"}],n:50,r:".extraTab"},{n:"data-tab-index",f:[{t:2,r:"@index"}],t:13}],f:[{t:4,f:[{t:2,r:"title"}],n:50,x:{r:[".title"],s:'typeof _0==="string"'}},{t:4,f:[{t:16,r:".title"}],n:50,r:".title",l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-close",g:1},{n:["click"],t:70,f:{r:["@index"],s:'[["close",_0]]'}}],f:["×"]}],n:50,x:{r:[".closable",".button"],s:"_0&&!_1"}}]}]}},cssId:"rtab",noCssTransform:!0,css:function(t){return[function(t){var n=Object.assign({},t("raui.primary"),t("raui.tabs.primary"));n.selected=Object.assign({},t("raui.tabs.selected"),t("raui.tabs.primary.selected")),n.indicator=Object.assign({},t("raui.tabs.indicator"),t("raui.tabs.primary.indicator"));var e=(t("raui.themes")||[]).slice();(t("raui.tabs.themes")||[]).forEach(function(t){~e.indexOf(t)||e.push(t)});var i=t("raui.tabs.boxy")||t("raui.tabs.primary.boxy");return"\n .rtabs {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n \n .rtabs-tab-window {\n overflow-y: hidden;\n overflow-x: auto;\n "+(i?"border-color: "+(n.bc||"#ccc")+";\n border-style: solid;\n border-width: 1px 1px 0 1px;\n color: "+(n.fg||"#222")+";\n background-color: "+(n.bga||"#f4f4f4")+";\n ":"box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),\n 0 1px 5px 0 rgba(0, 0, 0, 0.12),\n 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n color: "+(n.fg||"#222")+";\n background-color: "+(n.bg||"#fff")+";")+"\n position: relative;\n flex-shrink: 0;\n }\n .alt > div > .rtabs-tab-window {\n color: "+(n.bg||"#fff")+";\n background-color: "+(n.fga||"#07e")+";\n }"+(i?"\n .alt > div > .rtabs-tab-window .rtabs-tab {\n color: "+(n.bg||"#fff")+";\n background-color: "+(n.fga||"#07e")+";\n }":"")+"\n \n .rtabs-tab-window-wrapper {\n position: relative;\n z-index: 10;\n }\n .rtabs-tab-window-wrapper:before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 10px;\n opacity: 0;\n transition: opacity 0.3s ease-in-out;\n background: linear-gradient(to right, "+(n.indicator.color||n.fga||"#07e")+", transparent);\n z-index: 999;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-left:before {\n opacity: 1;\n }\n \n .rtabs-tab-window-wrapper:after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n height: 100%;\n width: 10px;\n opacity: 0;\n background: linear-gradient(to left, "+(n.indicator.color||n.fga||"#07e")+", transparent);\n transition: opacity 0.3s ease-in-out;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-right:after {\n opacity: 1;\n }\n \n .rtabs-flat > div > .rtabs-tab-window {\n box-shadow: none;\n border-width: 0;\n }\n "+(i?"\n .rtabs-flat > div > .rtabs-tab-window {\n background-color: "+(n.bg||"#fff")+";\n }\n .alt.rtabs-flat > div > .rtabs-tab-window {\n background-color: "+(n.fga||"#07e")+";\n }\n .rtabs-flat > div > .rtabs-tab-window .rtabs-tab {\n border-top-width: 1px;\n }":".rtabs-flat > div > .rtabs-tab-window:after {\n content: '';\n height: 0.15em;\n position: absolute;\n bottom: 0px;\n width: 100%;\n display: block;\n background-color: "+(n.bga||"#f4f4f4")+";\n }\n .rtabs-flat.alt > div > .rtabs-tab-window:after {\n background-color: "+(n.fga||"#07e")+";\n }")+"\n \n .rtabs-center.rtabs-left {\n text-align: center;\n }"+(i?"\n .rtabs-center > .rtabs-tab:first-child {\n border-left-width: 1px;\n }":"")+"\n \n .rtabs-pad {\n padding: 1em;\n }\n \n .rtabs-fill {\n flex-grow: 1;\n height: 100%;\n }\n \n .rtabs-tabs {\n display: table;\n position: relative;\n min-width: 100%;\n white-space: nowrap;"+(i?"\n border-style: solid;\n border-width: 0 0 1px 0;\n border-color: "+(n.bc||"#ccc")+";\n line-height: 1.5em;":"")+"\n }\n \n .rtabs-tab {\n display: inline-block;\n box-sizing: border-box;\n padding: 0.5em 1em;\n height: 2.5em;\n transition: opacity 0.2s ease-in-out;\n user-select: none;\n cursor: pointer;"+(i?"\n border-color: "+(n.bc||"#ccc")+";\n border-style: solid;\n border-width: 0 1px 1px 0;\n margin-bottom: -1px;\n color: "+(n.fg||"#222")+";\n background-color: "+(n.bga||"#f4f4f4")+";\n ":"\n opacity: 0.9;")+"\n }\n .rtabs-tab:hover {\n opacity: 1;\n }\n \n .rtabs-selected"+(i?",\n .alt > div > .rtabs-tab-window .rtabs-selected":"")+" {\n opacity: 1;"+(i?"\n font-weight: bold;\n border-bottom-color: "+(n.bg||"#fff")+";\n background-color: "+(n.selected.bg||n.bg||"#fff")+";\n color: "+(n.selected.fg||n.fg||"#222")+";":"")+"\n }\n \n .rtabs-disabled {\n opacity: 0.4;\n }\n \n .rtabs-right {\n text-align: right;\n display: table-cell;\n }\n \n .rtabs-left {\n text-align: left;\n display: table-cell;\n }\n \n .rtabs-close {\n display: inline-block;\n margin-right: -0.5em;\n font-weight: 700;\n opacity: 0.3;\n transition: opacity: 0.2s ease-in-out;\n }\n \n .rtabs-close:hover {\n opacity: 1;\n }\n \n .rtabs-indicator {\n position: absolute;\n bottom: 0;\n height: 0.15em;\n background-color: "+(n.indicator.color||n.fga||"#07e")+";\n z-index: 2;\n }\n \n .alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(n.bg||"#fff")+";\n }\n \n .rtabs-going-left .rtabs-indicator {\n transition: left 0.2s ease-in-out, right 0.2s ease-in-out 0.1s;\n }\n .rtabs-going-right .rtabs-indicator {\n transition: left 0.2s ease-in-out 0.1s, right 0.2s ease-in-out;\n }\n \n .rtabs-content-wrapper {\n width: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex-grow: 2;\n overflow: hidden;\n }\n \n .rtabs-content-window {\n width: 100%;\n display: flex;\n flex-grow: 1;\n overflow-y: auto;\n overflow-x: hidden\n }\n \n .rtabs {\n color: "+(n.fg||"#222")+";\n background-color: "+(n.bg||"#fff")+";\n }\n \n .rtabs-contents {\n list-style: none;\n padding: 0;\n margin: 0;\n position: relative;\n left: 0;\n display: block;\n flex-wrap: nowrap;\n white-space: nowrap;\n width: 100%;\n }\n .rtabs-trans-slide > .rtabs-contents {\n transition: left 0.2s ease-in-out;\n }\n .rtabs-trans-fade > .rtabs-contents {\n transition: opacity 0.15s ease;\n opacity: 1;\n white-space: nowrap;\n }\n \n .rtabs-fill > div > div > .rtabs-contents {\n display: flex;\n }\n \n .rtabs-tab-content {\n display: inline-block;\n position: relative;\n width: 100%;\n overflow: auto;\n vertical-align: top;\n white-space: initial;\n transition: opacity 0.1s ease-in-out;\n flex-shrink: 0;\n white-space: initial;\n display: inline-block;\n flex-direction: column;\n flex-grow: 1;\n }\n \n .rtabs-placeholder {\n display: inline-block;\n width: 100%;\n height: 1px;\n flex-shrink: 0;\n }\n .rtabs-dyna.rtabs-not-selected {\n height: 1px;\n opacity: 0;\n overflow: hidden;\n }\n .rtabs-pad > .rtabs-tab-content {\n padding: 1em;\n box-sizing: border-box;\n }\n .rtabs-pad > .rtabs-tab-content.rtabs-no-pad {\n padding: 0;\n }\n .rtabs > .rtabs-tab-content.rtabs-pad {\n padding: 1em;\n box-sizing: border-box;\n }\n "+e.map(function(n){var e=Object.assign({},t("raui.primary"),t("raui.tabs.primary"),t("raui."+n),t("raui.tabs."+n));e.selected=Object.assign({},t("raui.tabs.selected"),t("raui.tabs.primary.selected"),t("raui.tabs."+n+".selected")),e.indicator=Object.assign({},t("raui.tabs.indicator"),t("raui.tabs.primary.indicator"),t("raui.tabs."+n+".indicator"));var i="boxy"in e?e.boxy:t("raui.tabs.boxy");return".rtabs."+n+" > div > .rtabs-tab-window {\n "+(i?"border-color: "+(e.bc||"#ccc")+";\n color: "+(e.fg||"#222")+";\n background-color: "+(e.bga||"#f4f4f4")+";\n ":"box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),\n 0 1px 5px 0 rgba(0, 0, 0, 0.12),\n 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n color: "+(e.fg||"#222")+";\n background-color: "+(e.bg||"#fff")+";")+"\n }\n .rtabs."+n+" > .rtabs-tab-window-wrapper:before {\n background: linear-gradient(to right, "+(e.indicator.color||e.fga||"#07e")+", transparent);\n }\n .rtabs."+n+" > .rtabs-tab-window-wrapper:after {\n background: linear-gradient(to left, "+(e.indicator.color||e.fga||"#07e")+", transparent);\n }\n .rtabs."+n+".alt > div > .rtabs-tab-window {\n color: "+(e.bg||"#fff")+";\n background-color: "+(e.fga||"#07e")+";\n }"+(i?"\n .rtabs."+n+".alt > div > .rtabs-tab-window .rtabs-tab {\n color: "+(e.bg||"#fff")+";\n background-color: "+(e.fga||"#07e")+";\n }":"")+"\n \n "+(i?"\n .rtabs-flat."+n+" > div > .rtabs-tab-window {\n background-color: "+(e.bg||"#fff")+";\n }\n .alt.rtabs-flat."+n+" > div > .rtabs-tab-window {\n background-color: "+(e.fga||"#07e")+";\n }":".rtabs-flat."+n+" > div > .rtabs-tab-window:after {\n background-color: "+(e.bga||"#f4f4f4")+";\n }\n .rtabs-flat.alt."+n+" > div > .rtabs-tab-window:after {\n background-color: "+(e.fga||"#07e")+";\n }")+"\n \n "+(i?".rtabs."+n+" > div > .rtabs-tab-window .rtabs-tabs {\n border-color: "+(e.bc||"#ccc")+";\n }":"")+"\n \n .rtabs."+n+" > div > .rtabs-tab-window > .rtabs-tab {\n cursor: pointer;"+(i?"\n border-color: "+(e.bc||"#ccc")+";\n color: "+(e.fg||"#222")+";\n background-color: "+(e.bga||"#f4f4f4")+";\n ":"")+"\n }\n \n .rtabs."+n+" > div > .rtabs-tab-window .rtabs-selected"+(i?",\n .rtabs."+n+".alt > div > .rtabs-tab-window .rtabs-selected":"")+" {"+(i?"\n border-bottom-color: "+(them.bg||"#fff")+";\n background-color: "+(e.selected.bg||e.bg||"#fff")+";"+(e.indicator?"\n background-image: linear-gradient(to bottom, "+(e.indicator.color||e.fga||"#07e")+", "+(e.bg||"#fff")+" 3px);":"")+"\n color: "+(e.selected.fg||e.fg||"#222")+";":"")+"\n }\n \n .rtabs."+n+" > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(e.indicator.color||e.fga||"#07e")+";\n }\n \n .rtabs."+n+".alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(e.bg||"#fff")+";\n }\n \n .rtabs."+n+" {\n color: "+(e.fg||"#222")+";\n background-color: "+(e.bg||"#fff")+";\n }\n "}).join("\n")}.call(this,t)].join(" ")},attributes:["transition","flat","pad","center","height","fill","defer"],data:function(){return{tabs:[],rightTabs:[],selected:-1,selectedContent:-1,opacity:1,scrollStatus:""}},on:{construct:function(){var t=this.component;if(!t)return;var n=t.template.f||[],e=t.template.m?t.template.m.slice():[],i=t.template;t.template={e:i.e,f:i.f,t:i.t,m:e};var s=n.filter(function(t){return"tab"===t.e}).map(function(t){var n,i={template:{t:t.f.filter(function(t){return"title"!==t.e})}},s=[],o=[];return t.m&&t.m.forEach(function(t){if(13===t.t&&~r.indexOf(t.n))if("disabled"===t.n&&t.f&&1===t.f.length&&2===t.f[0].t){var n="_cnd"+e.length;i.disabled=n,e.push({t:13,n:n,f:t.f})}else if("no-pad"===t.n)if(t.f){if(1===t.f.length&&2===t.f[0].t){var a="_cnd"+e.length;i.padRef=a,e.push({t:13,n:a,f:t.f})}}else i.pad=!1;else if("hidden"===t.n&&t.f&&1===t.f.length&&2===t.f[0].t){var l="_cnd"+e.length;i.hidden=l,e.push({t:13,n:l,f:t.f})}else i[t.n]=0===t.f||("string"==typeof t.f?t.f:{t:t.f});else 70===t.t?o.push(t):s.push(t)}),(n=t.f.find(function(t){return"title"===t.e}))&&(i.title=n.f,n.m&&o.push.apply(o,n.m)),s.length&&(i.extra={t:s}),o.length&&(i.extraTab={t:o}),i});this._tabs=s},config:function(){var t=this;this._tabs&&this.set("tabs",(this.get("tabs")||[]).concat(this._tabs),{shuffle:!0});var n=this.get("tabs"),e=this.indicatorObservers=[];n.forEach(function(n){"string"==typeof n.hidden&&e.push(t.observe(n.hidden,function(){return setTimeout(function(){return t.updateIndicator()})},{init:!1,defer:!0}))}),e.push(this.observe("tabs.*.hidden",function(){return setTimeout(function(){return t.updateIndicator()})},{init:!1,defer:!0})),this.once("render",function(){-1===t.get("selected")&&t.select(0)})},select:s,close:function(t,n){var e=this.getContext(this._tabs[n]),i=!0;"function"==typeof e.onclose&&(i=!1!==e.onclose.call(void 0));i&&e.element.events.find(function(t){return t.events.find(function(t){return"close"===t.name})})&&(i=!1!==e.raise("close"));i&&this.splice("tabs",n,1);return!1},teardown:function(){this.indicatorObservers.forEach(function(t){return t.cancel()})}},observe:{selected:{handler:function(t){var n=this,e=this._hidden(t),i=this.get("tabs");e&&setTimeout(function(){var e=n.get("transition");n.set("transition",""),n.select(t+1>=i.length?0:t+1),n.set("transition",e)})},init:!1},clientWidth:function(){this.updateIndicator()}},decorators:{registered:function(t,n){var e=this;return this._tabs||(this._tabs=[]),this._tabs[n]=t,this.updateIndicator(),{teardown:function(){},invalidate:function(){e.updateIndicator()},update:function(n){e._tabs[n]=t,setTimeout(function(){return e.updateIndicator()})}}},scrolled:function(t,n){void 0===n&&(n={});var e="string"==typeof n?n:n.bind;if("string"!=typeof e)return{teardown:function(){}};var i=n.allow||2,r=this.getContext(t);function s(){var n="";t.scrollHeight>t.clientHeight&&(n+="vscroll"),t.scrollWidth>t.clientWidth&&(n+=(n?" ":"")+"hscroll"),t.scrollTop<=i&&(n+=" top"),t.scrollTop>=t.scrollHeight-t.clientHeight-i&&(n+=" bottom"),~n.indexOf("top")||~n.indexOf("bottom")||(n+=" vmiddle"),t.scrollLeft<=i&&(n+=" left"),t.scrollLeft>=t.scrollWidth-t.clientWidth-i?n+=" right":~n.indexOf("left")||~n.indexOf("right")||(n+=" hmiddle"),r.set(e,n)}return t.addEventListener("scroll",s,{passive:!0}),requestAnimationFrame(s),{refresh:s,teardown:function(){t.removeEventListener("scroll",s)}}},sized:function(t,n){var e=n.context||this.getContext(t),i={position:t.style.position,overflowY:t.style.overflowY};""!==t.style.position&&"static"!==t.style.position||(t.style.position="relative");var r=document.createElement("object");r.setAttribute("style","display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"),r.type="text/html";var s=function(){n.offsetWidth&&e.set(n.offsetWidth,t.offsetWidth),n.offsetHeight&&e.set(n.offsetHeight,t.offsetHeight),n.clientWidth&&e.set(n.clientWidth,t.clientWidth),n.clientHeight&&e.set(n.clientHeight,t.clientHeight),n.diffWidth&&e.set(n.diffWidth,t.offsetWidth-t.clientWidth),n.diffHeight&&e.set(n.diffHeight,t.offsetHeight-t.clientHeight)};return r.onload=function(){r.contentDocument.defaultView.addEventListener("resize",s),s()},/Trident/.test(navigator.userAgent)?(t.appendChild(r),r.data="about:blank"):(r.data="about:blank",t.appendChild(r)),{refresh:s,teardown:function(){t.removeChild(r),t.style.position=i.position,t.style.overflowY=i.overflowY}}}}});var o=function(t,n){this.tabs=t,this.item=n},a={keypath:{configurable:!0},id:{configurable:!0},index:{configurable:!0},title:{configurable:!0},template:{configurable:!0},hidden:{configurable:!0},right:{configurable:!0},pad:{configurable:!0},disabled:{configurable:!0},button:{configurable:!0},closable:{configurable:!0},load:{configurable:!0}};function l(t){return void 0===t&&(t={}),function(n){n.instance.components[t.name||"tabs"]=i}}a.keypath.get=function(){if(!this.removed)return"tabs."+this.index},a.id.get=function(){return this.get("id")},a.id.set=function(t){this.set("id",t)},a.index.get=function(){return this.tabs.get("tabs").indexOf(this.item)},a.title.get=function(){return this.get("title")},a.title.set=function(t){this.set("title",t)},a.template.get=function(){return this.get("template")},a.template.set=function(t){return this.set("template",t)},a.hidden.get=function(){return this.get("hidden")},a.hidden.set=function(t){return this.set("hidden",t)},a.right.get=function(){return this.get("right")},a.right.set=function(t){return this.set("right",t)},a.pad.get=function(){return this.get("pad")},a.pad.set=function(t){return this.set("pad",t)},a.disabled.get=function(){return this.get("disabled")},a.disabled.set=function(t){return this.set("disabled",t)},a.button.get=function(){return this.get("button")},a.button.set=function(t){return this.set("button",t)},a.closable.get=function(){return this.get("closable")},a.closable.set=function(t){return this.set("closable",t)},a.load.get=function(){return this.get("load")},a.load.set=function(t){return this.set("load",t)},o.prototype.select=function(){this.removed||this.tabs.select(this.index)},o.prototype.remove=function(){return!this.removed&&(this.tabs.splice("tabs",this.index,1),this.removed=!0,!0)},o.prototype.get=function(t){if(this.removed)return!1;if(!t)return this.tabs.get(this.keypath);var n=t.replace(/^[\.\/]*/,"");return this.tabs.get(this.keypath+"."+n)},o.prototype.set=function(t,n){if(this.removed)return!1;var e=t.replace(/^[\.\/]*/,"");return this.tabs.set(this.keypath+"."+e,n)},Object.defineProperties(o.prototype,a),function(t,n,i){if(e&&e.Ractive&&"object"==typeof e.Ractive[n]){var r=document.currentScript;if(r||(r=(r=document.querySelectorAll("script"))[r.length-1]),r){var s=r.getAttribute("data-alias");s&&(s=(s=s.split("&")).reduce(function(t,n){var e=n.split("="),i=e[0],r=e[1];return t[i]=r,t},{})),Ractive[n][s&&s[t]||t]=i}}}("RMTabs","components",i),t.Tabs=i,t.Handle=o,t.plugin=l,t.default=l,Object.defineProperty(t,"__esModule",{value:!0})});

@@ -199,7 +199,5 @@ (function (global, factory) {

Handle.prototype.set = function set (key, value) {
var this$1 = this;
if (typeof key === 'object') {
for (var k in key) {
this$1.data[k] = key[k];
this.data[k] = key[k];
}

@@ -206,0 +204,0 @@ if (this.data === this.holder.active) { return this.data.instance.update('_toast'); }

@@ -1,1 +0,1 @@

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],n):n(t.RMWindow={},t.Ractive)}(this,function(t,n){"use strict";var e="default"in n?n.default:n,o="undefined"!=typeof window?window:null;function i(t,n,e){if(o&&o.Ractive&&"object"==typeof o.Ractive[n]){var i=document.currentScript;if(i||(i=(i=document.querySelectorAll("script"))[i.length-1]),i){var r=i.getAttribute("data-alias");r&&(r=(r=r.split("&")).reduce(function(t,n){var e=n.split("="),o=e[0],i=e[1];return t[o]=i,t},{})),Ractive[n][r&&r[t]||t]=e}}}function r(t,n){var e=t.processParams(n,{duration:200,easing:"easeInOut"});return new Promise(function(n){requestAnimationFrame(function(){t.setStyle("overflow","hidden");var o="x"===e.axis?"width":"height";if(t.isIntro||e.intro){var i=t.getStyle(o);t.setStyle(o,0),t.setStyle("opacity",0),n(t.animateStyle(o,i,e).then(function(){return t.animateStyle("opacity",1,e)}).then(function(){t.setStyle(o,""),t.setStyle("overflow","")}))}else t.setStyle(o,t.getStyle(o)),t.setStyle("opacity",1),n(t.animateStyle("opacity",0,e).then(function(){return t.animateStyle(o,0,e)}))})})}i("expand","transitions",r);var s={timeout:6e3,top:!0};var a=function(t,n){this.holder=t,this.data=n},c={message:{configurable:!0},more:{configurable:!0},showMore:{configurable:!0},left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0},center:{configurable:!0},context:{configurable:!0},type:{configurable:!0},class:{configurable:!0},dismissable:{configurable:!0},closeButton:{configurable:!0},buttons:{configurable:!0},live:{configurable:!0},closed:{configurable:!0}};a.prototype.close=function(t){var n=this;return this.data.timeout=t,this.data===this.holder.active?(this.holder.tm&&clearTimeout(this.holder.tm),t?this.holder.tm=setTimeout(function(){n.data.close(),n.holder.tm=null},t):this.data.close()):t?this.data.timeout=t:this.data.close(),this.closed},a.prototype.cancelClose=function(){this.data===this.holder.active?(clearTimeout(this.holder.tm),this.holder.tm=null):this.data.timeout=0},a.prototype.updateButtons=function(){this.data===this.holder.active&&this.data.instance.update("_toast.buttons")},a.prototype.set=function(t,e){if("object"==typeof t){for(var o in t)this.data[o]=t[o];return this.data===this.holder.active?this.data.instance.update("_toast"):Promise.resolve()}return this.data[t]=e,this.data===this.holder.active?this.data.instance.update("_toast."+n.Ractive.escapeKey(t)):Promise.resolve()},c.message.get=function(){return this.data.message},c.message.set=function(t){this.data.message=t,this.data===this.holder.active&&this.data.instance.update("_toast.message")},c.more.get=function(){return this.data.more},c.more.set=function(t){this.data.more=t,this.data===this.holder.active&&this.data.instance.update("_toast.more")},c.showMore.get=function(){return this.data.showMore},c.showMore.set=function(t){this.data.showMore=t,this.data===this.holder.active&&this.data.instance.update("_toast.showMore")},c.left.get=function(){return this.data.left},c.left.set=function(t){this.data.left=t,this.data.right=!1,this.data===this.holder.active&&this.data.instance.update("_toast.left")&&this.data.instance.update("_toast.right")},c.right.get=function(){return this.data.right},c.right.set=function(t){this.data.right=t,this.data.left=!1,this.data===this.holder.active&&this.data.instance.update("_toast.right")&&this.data.instance.update("_toast.left")},c.top.get=function(){return!this.data.bottom},c.top.set=function(t){this.data.bottom=!t,this.data===this.holder.active&&this.data.instance.update("_toast.bottom")},c.bottom.get=function(){return this.data.bottom},c.bottom.set=function(t){this.data.bottom=t,this.data===this.holder.active&&this.data.instance.update("_toast.bottom")},c.center.get=function(){return!this.data.left&&!this.data.right},c.center.set=function(t){this.data.left=!1,this.data.right=!1,this.data===this.holder.active&&this.data.instance.update("_toast.right"),this.data.instance.update("_toast.left")},c.context.get=function(){return this.data.context},c.context.set=function(t){this.data.context=t,this.data===this.holder.active&&this.data.instance.update("_toast.context")},c.type.get=function(){return this.data.type},c.type.set=function(t){this.data.type=t,this.data===this.holder.active&&this.data.instance.update("_toast.type")},c.class.get=function(){return this.data.class},c.class.set=function(t){this.data.class=t,this.data===this.holder.active&&this.data.instance.update("_toast.class")},c.dismissable.get=function(){return this.data.dismissable},c.dismissable.set=function(t){this.data.dismissable=t,this.data===this.holder.active&&this.data.instance.update("_toast.dismissable")},c.closeButton.get=function(){return this.data.closeButton},c.closeButton.set=function(t){this.data.closeButton=t,this.data===this.holder.active&&this.data.instance.update("_toast.closeButton")},c.buttons.get=function(){return this.data.buttons},c.buttons.set=function(t){this.data.buttons=t,this.data===this.holder.active&&this.data.instance.update("_toast.buttons")},c.live.get=function(){return this.data===this.holder.active||~this.holder.toasts.indexOf(this.data)},c.closed.get=function(){var t=this;return this._promise||(this._promise=new Promise(function(n){t.data.onclose=n})),this._promise},Object.defineProperties(a.prototype,c);var l,f=e.escapeKey,d=function(t){function n(n){t.call(this,n)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n}(e);e.extendWith(d,{css:function(t){return[function(t){var n=Object.assign({},t("raui.primary"),t("raui.window.primary"));return n.action=Object.assign({},t("raui.window.action"),t("raui.window.primary.action")),n.host=Object.assign({},t("raui.window.host"),t("raui.window.primary.host")),n.title=Object.assign({inactive:{}},t("raui.window.title"),t("raui.window.primary.title")),"\n .rwhost {\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n \n .rwhost-sizer {\n position: absolute;\n }\n \n .rwhost-pane {\n display: flex;\n position: relative;\n width: 100%;\n box-sizing: border-box;\n flex-grow: 2;\n overflow: auto;\n background-color: "+(n.host.bg||n.bg||"#fff")+";\n z-index: 1;\n }\n .rwhost-pane.blocked {\n overflow: hidden;\n }\n \n .rwhost-pane-content {\n flex-grow: 1;\n }\n \n .rwhost-modal {\n position: absolute;\n position: --webkit-sticky;\n position: sticky;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: -1;\n opacity: 0;\n transition: opacity 0.2s ease-in-out, z-index 0s linear 0.2s;\n background-color: #000;\n }\n .rwhost-modal-active {\n opacity: 0.5;\n z-index: 1;\n transition: opacity 0.2s ease-in-out, z-index 0s linear;\n }\n \n .rwindow-wrapper {\n display: inline-block;\n box-sizing: border-box;\n position: absolute;\n }\n .rwindow-wrapper.rwindow-resizing {\n transition: none;\n }\n \n .rwindow-wrapper.rwindow-resizable {\n padding: "+(n.handleSize||7)+"px;\n }\n \n .rwindow-topmost > .rwindow {\n box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 3px 5px -1px rgba(0, 0, 0, 0.3);\n opacity: 1;\n }\n \n .rwindow-modal {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: rgba(0, 0, 0, 0.5);\n opacity: 0;\n z-index: -1;\n transition: opacity 0.4s ease-in-out, z-index 0s linear 0.4s;\n }\n .rwindow-modal.rwindow-blocked {\n opacity: 1;\n z-index: 10;\n transition: opacity 0.4s ease-in-out, z-index 0s linear;\n }\n \n .rwindow {\n position: relative;\n box-sizing: border-box;\n background-color: "+(n.bg||"#fff")+";\n color: "+(n.fg||"#222")+";\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n overflow: hidden;\n width: 100%;\n height: 100%;\n min-width: "+(n.minWidth||"6em")+";\n min-height: "+(n.minHeight||"6em")+";\n transition: box-shadow 0.4s ease-in-out, opacity 0.4s ease-in-out;\n }\n .rwindow-max > .rwindow {\n border-radius: 0;\n box-shadow: none;\n }\n \n .rwindow-pane-top,\n .rwindow-max-top {\n background-color: "+(n.title.inactive.bg||n.fg||"#222")+";\n color: "+(n.title.inactive.fg||n.bg||"#fff")+";\n flex-shrink: 0;\n }\n \n .rwindow-max-top {\n flex-shrink: 2;\n }\n \n .rwindow-pane-top {\n display: flex;\n align-items: center;\n }\n \n .rwindow-topmost .rwindow-pane-top {\n background-color: "+(n.title.bg||n.fga||"#07e")+";\n color: "+(n.title.fg||n.bg||"#fff")+";\n }\n \n .rwindow-pane {\n display: flex;\n flex-direction: column;\n table-layout: fixed;\n width: 100%;\n height: 100%;\n }\n .rwindow-autosizing {\n display: block;\n box-sizing: border-box;\n }\n .rwindow-content {\n overflow: auto;\n flex-grow: 2;\n position: relative;\n box-sizing: border-box;\n }\n .rwindow-content.rwindow-pad {\n padding: 1em;\n }\n .rwindow-content.rwindow-flex {\n display: flex;\n flex-direction: column;\n }\n \n .rwindow-buttons {\n display: flex;\n flex-shrink: 0;\n padding: 0.5em;\n border-top: 1px solid "+(n.action.bc||n.bc||"#ccc")+";\n background-color: "+(n.action.bg||n.bg||"#fff")+";\n color: "+(n.action.fg||n.fg||"#222")+";\n }\n .rwindow-buttons.no-buttons {\n display: none;\n }\n .rwindow-left-buttons {\n text-align: left;\n flex-grow: 2;\n }\n .rwindow-left-buttons button {\n margin-right: 0.5em;\n }\n .rwindow-center-buttons {\n text-align: center;\n flex-shrink: 2;\n }\n .rwindow-center-buttons button {\n margin: 0 0.25em;\n }\n .rwindow-right-buttons {\n text-align: right;\n flex-grow: 2;\n }\n .rwindow-right-buttons button {\n margin-left: 0.5em;\n }\n \n .rwindow-title {\n overflow: hidden;\n text-overflow: ellipsis;\n padding: 0.5em;\n white-space: nowrap;\n box-sizing: border-box;\n flex-grow: 1;\n }\n \n .rwindow-controls {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n flex-grow: 1;\n }\n .rwindow-controls > div {\n margin: 0 1em 0 0;\n width: 0.7em;\n height: 0.7em;\n cursor: pointer;\n }\n .rwindow-minimize {\n border-bottom: 2px solid;\n }\n .rwindow-maximize {\n border: 2px solid;\n }\n .rwindow-controls > .rwindow-close {\n width: 0.5em;\n height: 1em;\n border-right: 2px solid;\n transform: rotate(45deg);\n transform-origin: center right;\n position: relative;\n margin-right: 1.5em;\n }\n .rwindow-close:before {\n cursor: pointer;\n height: 1.2em;\n width: 1.2em;\n top: 0.3em;\n left: 0.1em;\n content: ' ';\n transform: rotate(-45deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-close:after {\n cursor: pointer;\n height: 100%;\n width: 100%;\n top: 1px;\n left: calc(100% + 1px);\n content: ' ';\n border-left: 2px solid;\n transform: rotate(-90deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-max-top .rwindow-controls > .rwindow-close {\n margin-right: 0.5em;\n }\n "+("function"==typeof t("raui.window.extra")?t("raui.window.extra").call(this,t):"")+"\n "}.call(this,t)].join(" ")},cssId:"rwindow",noCssTransform:!0,delegate:!1,decorators:{tracked:function(t,n){return this[n]=t,{teardown:function(){this[n]===t&&(this[n]=null)}}}},transitions:{window:function(t,n){if(l)return t.complete();l=t;var e=t.processParams(n,{duration:400,easing:"easeInOut"}),o=t.node.parentNode,i=o.style?o.style.overflow:"";o.style&&(o.style.overflow="hidden"),t.isIntro||e.intro?(t.setStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0}),setTimeout(function(){t.animateStyle({transform:"none",opacity:1},e).then(function(){t.setStyle("opacity",1),l=!1,t.complete(),o.style&&(o.style.overflow=i)})})):(t.setStyle({transform:"none",opacity:1}),t.animateStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0},e).then(function(){l=!1,t.complete(),o.style&&(o.style.overflow=i)}))}}});var u,h=0,w=function(t){function n(n){t.call(this,n),this.defaults={}}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var e={current:{configurable:!0},currentId:{configurable:!0},placement:{configurable:!0},topmost:{configurable:!0},windows:{configurable:!0}};return e.current.get=function(){var t=this.get("topLevel");return this.getWindow(this.get("windows")[t].id)},e.currentId.get=function(){var t=this.get("topLevel");return this.get("windows."+f(t)+".id")},e.placement.get=function(){return this.get("placement")},e.placement.set=function(t){return this.set("placement",t)},e.topmost.get=function(){var t=this.get("windows");for(var n in t)if(t[n].topmost)return this.getWindow(t[n].id)},e.windows.get=function(){return Object.keys(this.get("windows"))},n.prototype.addWindow=function(t,n){var e=this,o=Object.assign({},this.defaults,t.constructor.prototype.options,t.options,t.get("options"),n);if(!(t instanceof m))throw new Error("Windows must be instances of Window");t.id||t.set("@.id",o.id||"window"+h++),this.get("windows."+f(t.id))||this.set("windows."+f(t.id),Object.assign({show:!1!==o.show,autosize:!0,id:t.id,blockers:[],close:!0,minimize:!0,maximize:!0},o,{id:t.id})),t.host=this;var i,r,s=this.attachChild(t,{target:"window"});(o.block&&("string"==typeof(i=o.block.id||o.block)&&i in this.get("windows")?(this.push("windows."+f(i)+".blockers",t.id),t.set("control.blocking",i)):i=!1),"fill"===o.size&&(i||o.block))?(!0===o.block?r=this.find(".rwhost-pane"):(r=this.getWindow(i))&&(r=r.find(".rwindow")),r&&(t.size(r.clientWidth-(o.fillPad||20),r.clientHeight-(o.fillPad||20)),!o.block||o.top||o.left||(o.top=o.left=Math.floor((o.fillPad||20)/2)))):o.width&&o.height?t.size(o.width,o.height):t.size("auto");return o.top&&o.left?t.move(o.top,o.left):this.place(t),this.raise(t,{show:!1!==o.show,parent:o.stickToParent}),t.on("close",function(){var n=t.get("control.blocking");if(n){var o=e.windowGet(n,"blockers");e.splice("windows."+f(n)+".blockers",o.indexOf(t.id),1)}e.detachChild(t).then(function(){return t.teardown()}),e.set("windows."+f(t.id)+".block",!1),e.set("windows."+f(t.id)+".index",-1),e.raise(),e.set("windows."+f(t.id),void 0),delete e.get("windows")[t.id]}),this.update("windows."+f(t.id)+".id",{force:!0}),s.then(function(){return t})},n.prototype.getWindow=function(t){return this.children.byName.window&&this.children.byName.window.filter(function(n){return n.instance.id===t}).map(function(t){return t.instance})[0]},n.prototype.windowGet=function(t,n){return this.get("windows."+f(t)+"."+n)},n.prototype.windowSet=function(t,n,e){return this.set("windows."+f(t)+"."+n,e)},n.prototype.raise=function(t,n){var e=this;void 0===n&&(n={});var o=t instanceof m?t:this.children.byName.window.filter(function(n){return n.instance.id===t}).map(function(t){return t.instance})[0],i=this.get("windows"),r=this,s=Object.keys(i).map(function(t){return i[t]}),a=s.length+1,c=this.get("topLevel");this.get("blocked");function l(t){var n=r.get("windows."+f(t)+".blockers");n&&n.forEach(function(t){r.add("windows."+f(t)+".index",a++),l(t)})}if(o){if(!1!==n.parent&&o.get("control.blocking")){var d=o.get("control.blocking");a=this.get("windows."+d+".index")||0+(this.get("windows."+d+".blockers.length")||0),s.forEach(function(t){t.index>a&&t.index++}),a++}o.set("control.index",!1===n.show?-1:a++),!1===n.show||o.visible||o.show(),l(o.id)}s.filter(function(t){return!1!==t.show&&!0===t.block}).forEach(function(t){e.set("windows."+f(t.id)+".index",(t.index||0)+a),l(t.id)});var u=s.sort(function(t,n){return t.show?n.show&&t.index<n.index?-1:1:-1}),h=u.filter(function(t){return t.show});a=u.indexOf(h[h.length-1]);var w={},p=null;if(u.forEach(function(t,n){var e=f(t.id);!0===t.block&&null===p&&(p=n),w["windows."+e+".index"]=null!==p?n+2:n,w["windows."+e+".topmost"]=n===a,w["windows."+e+".stack"]=u.length-n}),w.blocked=null!==p?p+1:0,~a&&u.length?w.topLevel=u[a].id:w.topLevel=null,this.set(w),(a=w.topLevel)&&a!==c&&this.get("currentMax")&&this.rendered){var g=this.get("windows."+f(c));o=this.getWindow(a);var b=this.get("transition");!1===b||g&&g.dialog&&(!g.blocking||g.blocking===a)||o.transition(b||"window",o.find("div"),{intro:!0})}},n.prototype.place=function(t){var n=this;return t.get("control.show")?new Promise(function(e){requestAnimationFrame(function(){var o=t.get("control");void 0===o.width&&t.size("auto");var i=0,r=0;if(n.fragment&&n.fragment.rendered){var s=n.find(".rwhost"),a=s.clientWidth,c=s.clientHeight,l=o.blocking;if(l){var d="windows."+f(l),u=n.get(d),h=o.max||!o.dialog&&(n.get("max")||n.get("userMax")),w=u.max||n.get("userMax")||n.get("max"),g=w?n.host.clientWidth:n.sizeInPx(u.width+"em"),m=w?n.host.clientHeight:n.sizeInPx(u.height+"em"),b=w?0:u.left,x=w?0:u.top;i=(h?a:g/2)+(h?0:b)-n.sizeInPx(o.width+"em")/2,r=(h?c:m/2)+(h?0:x)-n.sizeInPx(o.height+"em")/2}else{var y,v=n.get("placement");if("function"==typeof v)try{y=v(n,s,o)}catch(t){y=p(n,s,o)}else if("string"==typeof v)switch(v){case"smart":y=function(t,n,e){var o,i,r=n.clientWidth-10,s=n.clientHeight-10,a=Math.floor(s/16),c=Math.floor(r/16),l=new Array(a*c),f=new Array(a*c);for(o=0;o<l.length;o++)l[o]=0;var d,u,h,w,p,g,m,b,x=0,y=t.get("windows");for(var v in y)for(x++,d=y[v],u=Math.floor(d.top/16),h=Math.floor(d.left/16),p=Math.ceil(t.sizeInPx(d.height+"em")/16),w=Math.ceil(t.sizeInPx(d.width+"em")/16),o=u;o<u+p&&o<a;o++)for(i=h;i<h+w&&i<c;i++)l[o*c+i]++;for(w=Math.ceil(t.sizeInPx(e.width+"em")/16),p=Math.ceil(t.sizeInPx(e.height+"em")/16),o=0;o<a;o++)for(i=0;i<c;i++){if(o+p>a||i+w>c)g=x*w*p;else for(g=0,m=0;m<p;m++)for(b=0;b<w;b++)g+=l[(o+m)*c+i+b];if(0===g)return{top:16*o+5,left:16*i+5};f[o*c+i]=g}for(g=x*w*p,m=0,o=0;o<f.length;o++)f[o]<g&&(g=f[o],m=o);return{top:16*Math.floor(m/c)+5,left:m%c*16+5}}(n,s,o);break;default:y=p(n,s,o)}else y=p(n,s,o);r=y.top,i=y.left}(isNaN(i)||i<0)&&(i=10),(isNaN(r)||r<0)&&(r=10),t.set({"control.top":r,"control.left":i}),e()}})}):Promise.resolve()},n.prototype.sizeInPx=function(t){return this.sizer?(this.sizer.style.width="number"==typeof t?t+"px":t,this.sizer.clientWidth):16*parseFloat(t)},n.prototype.sizeInEm=function(t){return this.sizeInPx(t)/this.sizeInPx("1em")},Object.defineProperties(n.prototype,e),n}(d);function p(t,n,e){var o=n.clientWidth,i=n.clientHeight,r=0,s=0,a=void 0===t._grid1?t._grid1=0:t._grid1>7?t._grid1=0:++t._grid1,c=Math.floor(o/3),l=Math.floor(i/3),f=t.sizeInPx(e.width+"em"),d=t.sizeInPx(e.height+"em");switch(a){case 5:case 7:case 8:r=i-d-10;break;case 2:case 4:case 6:r=l+Math.floor((l-d)/2);break;case 0:case 1:case 3:r=10}switch(a){case 3:case 6:case 8:s=o-f-10;break;case 1:case 4:case 7:s=c+Math.floor((c-f)/2);break;case 0:case 2:case 5:s=10}return s+f>o&&(s=o-f-10),r+d>i&&(r=i-d-10),{top:r,left:s}}d.extendWith(w,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost",g:1},{n:"tracked",t:71,f:{r:[],s:'["host"]'}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-sizer",g:1},{n:"tracked",t:71,f:{r:[],s:'["sizer"]'}}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-max-top",g:1},{t:4,f:[{t:16,r:"~/_maxAttrsP"}],n:50,r:"~/_maxAttrsP"}],f:[{t:16,r:"~/_maxP",z:[{n:"window",x:{r:"~/current"}},{n:"windowControls",x:{x:{r:["@this.partials.windowControls"],s:"{t:_0}"}}},{n:"host",x:{r:"@this"}}]}]}],n:50,x:{r:["~/currentMax","~/_maxP"],s:"_0&&_1"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane",g:1},{n:"class-rwhost-blocked",t:13,f:[{t:2,r:"~/blocked"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane-content",g:1}],f:[{t:16}]}," ",{t:4,f:[{t:11,n:"window",m:[{n:"control",f:[{t:2,rx:{r:"~/windows",m:[{t:30,n:".instance.id"}]}}],t:13},{n:"root",t:13,f:[{t:2,r:"~/"}]}]}],n:52,r:"@this.children.byName.window"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-modal",g:1},{n:"tracked",t:71,f:{r:[],s:'["modalPane"]'}},{t:4,f:[{n:"class-rwhost-modal-active",t:13},{n:"style-z-index",f:[{t:2,r:"~/blocked"}],t:13}],n:50,r:"~/blocked"}]}]}," ",{t:8,r:"toast"}]}],e:{'["host"]':function(){return["host"]},'["sizer"]':function(){return["sizer"]},"{t:_0}":function(t){return{t:t}},"_0&&_1":function(t,n){return t&&n},'["modalPane"]':function(){return["modalPane"]},"[_0.getWindow(_1).hide()]":function(t,n){return[t.getWindow(n).hide()]},"[_0.getWindow(_1).maximize()]":function(t,n){return[t.getWindow(n).maximize()]},"!_0&&_1&&_2":function(t,n,e){return!t&&n&&e},"[_0.getWindow(_1).close()]":function(t,n){return[t.getWindow(n).close()]},'["top"]':function(){return["top"]},"[_0.hide()]":function(t){return[t.hide()]},"!_0&&_1":function(t,n){return!t&&n},"[_0.maximize()]":function(t){return[t.maximize()]},"[_0.close()]":function(t){return[t.close()]},"(_0||_1||_2)&&_3&&!_4":function(t,n,e,o,i){return(t||n||e)&&o&&!i},'["content"]':function(){return["content"]},"!_0":function(t){return!t},"[_0.call(_1)]":function(t,n){return[t.call(n)]},'["wrapper"]':function(){return["wrapper"]},"_0!==false":function(t){return!1!==t},"_0||_1":function(t,n){return t||n},"(_0||_1||_2)&&!_3":function(t,n,e,o){return(t||n||e)&&!o},"[_0._startResize(_1)]":function(t,n){return[t._startResize(n)]},"[_0._sizeHandle(_1)]":function(t,n){return[t._sizeHandle(n)]},"[_0._startMove(_1)]":function(t,n){return[t._startMove(n)]},"!(_0===false||_1||_2||_3)&&!_4":function(t,n,e,o,i){return!(!1===t||n||e||o||i)},"[_0.raise()]":function(t){return[t.raise()]},'["pane"]':function(){return["pane"]}},p:{title:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}],windowControls:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).hide()]"}}]}],n:50,r:"window.minimize"}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).maximize()]"}}]}],n:50,x:{r:["~/window.dialog","window.maximize","host.data.userMax"],s:"!_0&&_1&&_2"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).close()]"}}]}],n:50,r:"window.close"}]}],pane:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:51,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog"],s:"(_0||_1||_2)&&_3&&!_4"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}],window:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"(_0||_1||_2)&&!_3"}},{t:4,f:[{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/control.movable","~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"!(_0===false||_1||_2||_3)&&!_4"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]}},use:[function(t){void 0===t&&(t={});var n=function(t){return[function(t){var n=Object.assign({},t("raui.primary"),t("raui.toast.primary"));return"\n .rtoast {\n position: absolute;\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n left: 1em;\n right: 1em;\n top: 1em;\n bottom: auto;\n z-index: 5;\n pointer-events: none;\n overflow: hidden;\n }\n .rtoast-message {\n flex-grow: 2;\n display: flex;\n align-items: center;\n }\n .rtoast-string {\n white-space: pre-wrap;\n line-height: 1.3em;\n padding-top: 0.3em;\n }\n .rtoast-upper .rtoast-string {\n \n }\n .rtoast-expand .rtoast-string {\n padding-top: 0.5em;\n }\n .rtoast-buttons {\n display: flex;\n padding-left: 0.5em;\n flex-shrink: 1;\n align-items: center;\n max-height: max-content;\n margin-left: auto;\n }\n .rtoast-buttons button {\n cursor: pointer;\n }\n .rtoast-button {\n background-color: transparent;\n border: none;\n color: inherit;\n padding: 0.5em 0.75em;\n margin: 0 0 0 0.5em;\n line-height: 1em;\n box-shadow: none;\n }\n .rtoast-more {\n cursor: pointer;\n width: 2em;\n position: relative;\n flex-shrink: 2;\n background-color: transparent;\n border: none;\n color: inherit;\n margin: 0 0 0 0.5em;\n height: 2em;\n }\n .rtoast-more:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n height: 0.6em;\n top: calc(50% - 0.55em);\n left: calc(50% - 0.3em);\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n transition: transform 0.2s ease-in-out, top 0.2s ease-in-out;\n pointer-events: none;\n }\n .rtoast-expanded .rtoast-more:after {\n transform: rotate(225deg);\n top: calc(50% - 0.1em);\n }\n .rtoast-bottom {\n bottom: 1em;\n top: auto;\n }\n .rtoast-left {\n justify-content: flex-start;\n }\n .rtoast-right {\n justify-content: flex-end;\n }\n .rtoast-body {\n border-radius: 0.2em;\n padding: 0.5em 1em;\n color: "+(n.bg||"#fff")+";\n background-color: "+(n.fg||"#222")+";\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n opacity: 0.95;\n pointer-events: all;\n transition: color 0.5s ease-in-out, background 0.5s ease-in-out;\n }\n .rtoast-upper {\n display: flex;\n flex-shrink: 2;\n flex-wrap: wrap;\n justify-content: space-between;\n }\n \n .rtoast-success {\n color: "+(t("raui.toast.success.fg")||"#f9f9f9")+";\n background-color: "+(t("raui.toast.success.bg")||"#4caf50")+";\n }\n .rtoast-info {\n color: "+(t("raui.toast.info.fg")||"#f9f9f9")+";\n background-color: "+(t("raui.toast.info.bg")||"#07e")+";\n }\n .rtoast-warn {\n color: "+(t("raui.toast.warn.fg")||"#222")+";\n background-color: "+(t("raui.warn.success.bg")||"#ffc107")+";\n }\n .rtoast-error {\n color: "+(t("raui.toast.error.fg")||"#f9f9f9")+";\n background-color: "+(t("raui.toast.error.bg")||"#ff5252")+";\n }\n "}.call(this,t)].join(" ")},e={v:4,t:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast",g:1},{n:"class-rtoast-expanded",t:13,f:[{t:2,r:".showMore"}]},{n:"class-rtoast-bottom",t:13,f:[{t:2,r:".bottom"}]},{n:"class-rtoast-left",t:13,f:[{t:2,r:".left"}]},{n:"class-rtoast-right",t:13,f:[{t:2,r:".right"}]}],f:[{t:7,e:"div",m:[{n:"toast",t:72,v:"t0"},{n:"class",f:["rtoast-body",{t:4,f:[" rtoast-",{t:2,r:".type"}],n:50,r:".type"},{t:4,f:[{t:2,r:".class"}],n:50,r:".class"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.close()]"}}],n:50,x:{r:[".dismissable"],s:"_0!==false"}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-upper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-message",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".message",c:{r:".context"}}],n:50,x:{r:[".context"],s:"!!_0"}},{t:4,f:[{t:8,r:".message"}],n:51,l:1}],n:50,x:{r:[".message"],s:"Array.isArray(_0)"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-string",g:1}],f:[{t:2,r:".message"}]}],n:51,l:1}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-buttons",g:1}],f:[{t:4,f:[{t:7,e:"button",m:[{n:"class",f:["rtoast-button",{t:4,f:[" ",{t:2,r:".class"}],n:50,r:".class"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.action()]"}}],n:50,x:{r:[".action"],s:'typeof _0==="function"'}}],f:[{t:2,r:".label"}]}],n:52,r:".buttons"},{t:4,f:[{t:7,e:"button",m:[{t:13,n:"class",f:"rtoast-button",g:1}],f:["Close"]}],n:50,x:{r:[".dismissable",".closeButton"],s:"_0!==false&&_1!==false"},l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-more",g:1},{n:"title",f:"Toggle more",t:13,g:1},{n:["click"],t:70,f:{r:[".","@context"],s:'[_0.expand(),(_1).toggle(".showMore"),false]'}}]}],n:50,r:".more"}]}],n:50,x:{r:[".dismissable",".closeButton",".buttons.length",".more"],s:"(_0!==false&&_1!==false)||_2||_3"}}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-expand",g:1},{n:"toast-expand",t:72,v:"t0"},{n:["click"],t:70,f:{r:[],s:"[false,false]"}}],f:[{t:4,f:[{t:4,f:[{t:8,r:".more",c:{r:".context"}}],n:50,x:{r:[".context"],s:"!!_0"}},{t:4,f:[{t:8,r:".more"}],n:51,l:1}],n:50,x:{r:[".more"],s:"Array.isArray(_0)"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-string",g:1}],f:[{t:2,r:".more"}]}],n:51,l:1}]}],n:50,x:{r:[".more",".showMore"],s:"_0&&_1"}}]}]}],n:54,r:"~/_toast"}],n:50,r:"~/_toast"}],e:{"[_0.close()]":function(t){return[t.close()]},"_0!==false":function(t){return!1!==t},"!!_0":function(t){return!!t},"Array.isArray(_0)":function(t){return Array.isArray(t)},"[_0.action()]":function(t){return[t.action()]},'typeof _0==="function"':function(t){return"function"==typeof t},"_0!==false&&_1!==false":function(t,n){return!1!==t&&!1!==n},'[_0.expand(),(_1).toggle(".showMore"),false]':function(t,n){return[t.expand(),n.toggle(".showMore"),!1]},"(_0!==false&&_1!==false)||_2||_3":function(t,n,e,o){return!1!==t&&!1!==n||e||o},"[false,false]":function(){return[!1,!1]},"_0&&_1":function(t,n){return t&&n}}};return function(o){var i=o.Ractive,r=o.instance,c=o.proto;r.partials[t.name||"toast"]=e;var l,f=Object.assign({},s,t),d=[],u={toasts:d};function h(n){l!==n?(d.splice(d.indexOf(t),1),"function"==typeof n.onclose&&n.onclose()):(u.tm&&(clearTimeout(u.tm),u.tm=null),l.instance.set("_toast",null).then(function(){u.active=l=null,"function"==typeof n.onclose&&n.onclose(),d.length&&w()}))}function w(){u.active=l=d.shift(),l.instance.set("_toast",l).then(function(){l.timeout&&(u.tm&&clearTimeout(u.tm),u.tm=setTimeout(function(){l.close(),u.tm=null},l.timeout))})}if(Object.defineProperty(c,"toastDefaults",{value:f,writable:!1,configurable:!0}),c.toast=function(t,n){var e=Object.assign({message:t,instance:this},f,this.toastDefaults,n);return e.close=function(){return h(e)},e.expand=function(){u.active===e&&(u.tm&&(clearTimeout(u.tm),u.tm=null),e.showMore&&e.timeout&&(u.tm=setTimeout(function(){e.close(),u.tm=null},e.timeout)))},d.push(e),l||w(),new a(u,e)},c.on=c.on||{},r.transitions.toast=function(t,n){var e=t.processParams({duration:200},n),o=t.getStyle("opacity");return t.isIntro?(t.setStyle({opacity:0,transform:"translateY("+(l.bottom?"":"-")+"1em)"}),t.animateStyle({opacity:o,transform:"none"},e)):(t.setStyle({opacity:o,transform:"none"}),t.animateStyle({opacity:0,transform:"translateY("+(l.bottom?"":"-")+"1em)"},e))},r.transitions["toast-expand"]=function(t,n){var e=t.processParams({duration:200,nested:!1},n);if(t.isIntro){var o=t.getStyle("height"),i=t.getStyle("width");return t.setStyle("height",0),t.setStyle("width",0),t.animateStyle("width",i,e).then(function(){return t.animateStyle("height",o,e)}).then(function(){t.setStyle("height",""),t.setStyle("width","")})}var r=t.getStyle("height");return t.setStyle("height",r),t.setStyle("width",t.getStyle("width")),t.animateStyle("height",0,e).then(function(){return t.animateStyle("width",0,e)}).then(function(){t.setStyle("height",""),t.setStyle("width","")})},c.on["close-toast"]=function(){l&&l.close()},r===i||i.isInstance(r))i.hasCSS("toast-css")||i.addCSS("toast",n);else{var p=r.css;r.css=function(t){var e="";return"string"==typeof p?e+=p:"function"==typeof p&&(e+=p(t)),n(t)+e}}return c}}(),(void 0===u&&(u={}),function(t){t.instance.transitions[u.name||"expand"]=r})],cssId:"window-host",noIntro:!0,observe:{"@style.raui.window.maxFrom":function(){var t;(t=this)._media?t._media.fn():(t._media={},t._media.fn=function(){if(t.host){var n=t.sizeInPx(t.get("@style.raui.window.maxFrom")),e=t.transitionsEnabled;t.transitionsEnabled=!1,t.set("max",t.host.clientWidth<=n),t.set("dimensions",{clientWidth:t.host.clientWidth,clientHeight:t.host.clientHeight}),t.transitionsEnabled=e}},t._media.handle=t.root.on("*.resize",t._media.fn),setTimeout(t._media.fn))},topLevel:function(t){t?this.link("windows."+f(t),"current"):this.unlink("current")},currentMax:{handler:function(t){(this.children.byName.window||[]).forEach(function(t){return t.instance.fire("resize")})},defer:!0}},computed:{currentMax:function(){var t=this.get("topLevel"),n=this.get("windows."+f(t)+".max");return this.get("userMax")||this.get("max")||n}},on:{config:function(){var t,n=this,e=this.partials.content;if(e&&Array.isArray(e))for(var o=(e=this.partials.content=e.slice()).length;o--;){var i=e[o];"max-top"===i.e&&(e.splice(o,1),n.set({_maxP:{t:i.f},hideTitleMax:!0}),i.m&&n.set({_maxAttrsP:{t:i.m}}))}"undefined"!=typeof window&&(this._resizeListener=function(){t||(t=setTimeout(function(){t=null,n.fire("resize")},300))},window.addEventListener("resize",this._resizeListener))},teardown:function(){this._resizeListener&&window.removeEventListener("resize",this._resizeListener)}}}),e.transitions.modal=function(t,n){var e,o=t.processParams(n,{duration:400,easing:"easeOut",x:0,y:-50,event:!0}),i=t.node.offsetLeft,r=t.node.offsetTop,s=t.node.parentNode.style?t.node.parentNode.style.overflow:"hidden";if(t.node._modalSrc){var a=t.node._modalSrc||{x:i+o.x,y:r+o.y},c={x:a.x-Math.round(t.node.clientWidth/2)-i,y:a.y-Math.round(t.node.clientHeight/2)-r};t.node.parentNode.style&&(t.node.parentNode.style.overflow="hidden"),t.isIntro?(t.node._modalSrc=a,e={transform:"translate(0, 0) scale(1, 1)",opacity:1},t.setStyle({transform:"translate("+c.x+"px, "+c.y+"px) scale(0.5, 0.5)",opacity:0})):e={transform:"translate("+c.x+"px, "+c.y+"px) scale(0.5, 0.5)",opacity:0}}else t.isIntro?(e={transform:"translate(0, 0) scale(1, 1)",opacity:1},t.setStyle({transform:"translate("+o.x+"px, "+o.y+"px) scale(0.5, 0.5)",opacity:0})):e={transform:"translate("+o.x+"px, "+o.y+"px) scale(0.5, 0.5)",opacity:0};t.animateStyle(e,o).then(function(){t.node.parentNode.style&&(t.node.parentNode.style.overflow=s),t.complete()})};var g=["mousemove","mouseup","touchmove","touchend"],m=function(t){function n(n){t.call(this,n)}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var e={resizable:{configurable:!0},title:{configurable:!0},visible:{configurable:!0},pad:{configurable:!0},buttons:{configurable:!0},blocked:{configurable:!0},result:{configurable:!0}};return e.resizable.get=function(){return this.get("control.resizable")},e.resizable.set=function(t){return this.set("control.resizable",t)},e.title.get=function(){return this.get("control.title")},e.title.set=function(t){return this.set("control.title",t)},e.visible.get=function(){return this.get("control.show")},e.visible.set=function(t){t?this.show():this.set("control.show",t,{keep:!0}),this.host.raise(this,{show:t})},e.pad.get=function(){return this.get("pad")},e.pad.set=function(t){this.set("pad",t)},e.buttons.get=function(){return this.get("buttons")},e.buttons.set=function(t){return this.set("buttons",t)},e.blocked.get=function(){return this.get("control.blocked")},e.blocked.set=function(t){return this.set("control.blocked",t)},e.result.get=function(){var t=this;return this._result||(this._result={},this._result.promise=new Promise(function(n){t._result.ok=n})),this._result.promise},n.prototype.setResult=function(t){this.result,this._result.value=t},n.prototype.close=function(t,n){if(!0!==t){if(!this.parent)return!1;if(this.get("control.blockers.length"))return!1;if("function"==typeof this.beforeClose&&!1===this.beforeClose())return!1;if(!1===this.fire("beforeClose"))return!1}return this.fire("close"),this._result&&this._result.ok(this._result.value||n),!0},n.prototype.maximize=function(){this.toggle("root.userMax")},n.prototype.hide=function(){this.visible=!1},n.prototype.raise=function(t){this.host.raise(this,{show:t})},n.prototype.show=function(){this.set("control.show",!0),void 0===this.get("control.top")&&this.host.place(this)},n.prototype.size=function(t,n){var e=this;return new Promise(function(o){requestAnimationFrame(function(){if(e.visible){var i=e.wrapper;if(i){if("auto"===t){e.set("control.autosize",!0);var r=e.host.sizeInEm(i.clientWidth+16),s=e.host.sizeInEm(i.clientHeight);e.set({"control.width":r,"control.height":s,"control.naturalWidth":r,"control.naturalHeight":s,"control.autosize":!1})}else if("number"==typeof t&&"number"==typeof n)e.set({"control.width":e.host.sizeInEm(t),"control.height":e.host.sizeInEm(n),"control.naturalWidth":e.host.sizeInEm(t),"control.naturalHeight":e.host.sizeInEm(n),"control.autosize":!1});else if("string"==typeof t&&"string"==typeof n){var a=i.style.width,c=i.style.height;i.style.width=t,i.style.height=n;var l=i.clientWidth,f=i.clientHeight;i.style.width=a,i.style.height=c,e.set({"control.width":e.host.sizeInEm(l),"control.height":e.host.sizeInEm(f),"control.naturalWidth":e.host.sizeInEm(l),"control.naturalHeight":e.host.sizeInEm(f),"control.autosize":!1})}e.fire("resize"),o()}}else"number"==typeof t&&"number"==typeof n&&e.set({"control.width":e.host.sizeInEm(t),"control.height":e.host.sizeInEm(n),"control.naturalWidth":e.host.sizeInEm(t),"control.naturalHeight":e.host.sizeInEm(n),"control.autosize":!1})})})},n.prototype.move=function(t,n){var e=this;return new Promise(function(o){requestAnimationFrame(function(){"center"===t?t=e.host.modalPane.clientHeight/2-e.wrapper.clientHeight/2:"string"==typeof t&&(t=e.host.sizeInEm(t)),"center"===n&&(n=e.host.modalPane.clientWidth/2-e.wrapper.clientWidth/2),"string"==typeof n&&(n=e.host.sizeInEm(n));var i={};"number"==typeof t&&(i["control.top"]=t),"number"==typeof n&&(i["control.left"]=n),e.set(i),o()})})},n.prototype._startMove=function(t){var n=this;if("mousedown"!==t.type||0===t.button){if(this.get("control.topmost")||this.raise(),~t.type.indexOf("mouse")){if(!t.ctrlKey&&t.target!==this.content&&t.target!==this.top&&!this.top.contains(t.target))return}else if(t.targetTouches&&1===t.targetTouches.length&&t.target!==this.content&&t.target!==this.top&&!this.top.contains(t.target))return;var e=this.pane,o=e.style.cursor;e.style.cursor="move",e.style.userSelect="none";var i=t.x||t.clientX||t.targetTouches&&t.targetTouches[0].clientX||0,r=t.y||t.clientY||t.targetTouches&&t.targetTouches[0].clientY||0,s=this.get("control.left")||0,a=this.get("control.top")||0,c=e.clientWidth,l=e.clientHeight,f=function(t){var d=t.x||t.clientX||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientX||t.changedTouches&&t.changedTouches[0].clientX||0,u=t.y||t.clientY||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientY||t.changedTouches&&t.changedTouches[0].clientY||0,h=s+(d-i),w=a+(u-r);h<(c<30?0:30-c)&&(h=c<30?0:30-c),w<(l<30?0:30-l)&&(w=l<30?0:30-l),h<0&&(h=0),w<0&&(w=0),n.set({"control.top":w,"control.left":h}),"touchend"===t.type||"mouseup"===t.type?(g.forEach(function(t){return document.removeEventListener(t,f,{passive:!1})}),e.style.cursor=o,e.style.userSelect=""):t.preventDefault()};return g.forEach(function(t){return document.addEventListener(t,f,{passive:!1})}),0!==t.type.indexOf("mouse")&&void 0}},n.prototype._startResize=function(t){var n=this;if(t.target===this.wrapper&&("mousedown"!==t.type||0===t.button)){this.get("control.autosize")&&this.size("auto"),this.get("control.topmost")||this.raise(),this.set("control.resizing",!0);var e,o=this.wrapper,i=t.offsetX||t.targetTouches&&t.targetTouches[0].pageX-o.getBoundingClientRect().left,r=t.offsetY||t.targetTouches&&t.targetTouches[0].pageY-o.getBoundingClientRect().top,s=this.get("@style.window.handleSize")||7,a=o.clientWidth-2*s,c=o.clientHeight-2*s,l=2*s,f=i<=l||i>=a,d=r<=l||r>=c,u=t.x||t.clientX||t.targetTouches&&t.targetTouches[0].clientX||0,h=t.y||t.clientY||t.targetTouches&&t.targetTouches[0].clientY||0,w=this.get("control.left")||0,p=this.get("control.top")||0,m=this.host.sizeInPx(this.get("control.width")+"em"),b=this.host.sizeInPx(this.get("control.height")+"em"),x=this.host.sizeInPx(this.get("control.naturalHeight")+"em"),y=this.host.sizeInPx(this.get("control.naturalWidth")+"em"),v=function(t){t.preventDefault();var o=t.x||t.clientX||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientX||t.changedTouches&&t.changedTouches[0].clientX||0,a=t.y||t.clientY||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientY||t.changedTouches&&t.changedTouches[0].clientY||0,c=f?o-u:0,l=d?a-h:0,_={};r<=s?(_["control.top"]=p+l,_["control.height"]=b-l):_["control.height"]=b+l,i<=s?(_["control.left"]=w+c,_["control.width"]=m-c):_["control.width"]=m+c,_["control.width"]<y&&(delete _["control.width"],delete _["control.left"]),_["control.height"]<x&&(delete _["control.height"],delete _["control.top"]),_["control.left"]<0&&(_["control.left"]=0),_["control.top"]<0&&(_["control.top"]=0),_["control.width"]&&(_["control.width"]=n.host.sizeInEm(_["control.width"])),_["control.height"]&&(_["control.height"]=n.host.sizeInEm(_["control.height"])),n.set(_),"touchend"===t.type||"mouseup"===t.type?(g.forEach(function(t){return document.removeEventListener(t,v,{passive:!1})}),n.set("control.resizing",!1),m===n.get("control.width")&&b===n.get("control.height")||(e&&clearTimeout(e),e=null,n.fire("resize"))):e||(e=setTimeout(function(){n.fire("resize"),e=null},200))};return g.forEach(function(t){return document.addEventListener(t,v,{passive:!1})}),!1}},n.prototype._sizeHandle=function(t){if(t.target===this.wrapper){var n=this.wrapper;if("mouseout"===t.type)return n.style.cursor="auto";var e=t.offsetX,o=t.offsetY,i=this.get("@style.window.handleSize")||7,r=n.clientWidth-i,s=n.clientHeight-i,a=n.style;a.cursor=e<=i+i&&o<=i+i||e>=r-i&&o>=s-i?"nwse-resize":e>=r-i&&o<=i+i||e<=i+i&&o>=s-i?"nesw-resize":(e<=i||e>=r)&&(o<s||o>i)?"ew-resize":(o<=i||o>=s)&&(e<r||e>i)?"ns-resize":"auto"}},Object.defineProperties(n.prototype,e),n}(d),b=["left","right","center","condition"];function x(t){return void 0===t&&(t={}),function(n){n.instance.components[t.name||"host"]=w}}d.extendWith(m,{template:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"(_0||_1||_2)&&!_3"}},{t:4,f:[{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/control.movable","~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"!(_0===false||_1||_2||_3)&&!_4"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]},cssId:"window",partials:{pane:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:51,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog"],s:"(_0||_1||_2)&&_3&&!_4"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}],title:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}],contents:"",status:""},data:function(){return{buttons:[],visibleButtons:0}},computed:{leftButtons:function(){return(this.get("buttons")||[]).filter(function(t){return"left"===t.where})},centerButtons:function(){return(this.get("buttons")||[]).filter(function(t){return"center"===t.where})},rightButtons:function(){return(this.get("buttons")||[]).filter(function(t){return!t.where||"right"===t.where})}},decorators:{button:function(t){var n=this.getContext(t);return n.add("visibleButtons"),{update:function(){},teardown:function(){n.subtract("visibleButtons")}}}},on:{config:function(){var t=m.prototype.template,n=this.template;"string"!=typeof t&&!Array.isArray(t)&&t.t&&(t=t.t),"string"!=typeof n&&!Array.isArray(n)&&n.t&&(n=n.t),t!==n&&(this.partials.hasOwnProperty("contents")||(this.partials.contents=n),this.template=t)},construct:function(){var t=this.constructor;if(!t._constructed){t._constructed=1;var n=t.prototype.template.t.slice(),e=n.find(function(t){return"buttons"===t.e});function o(t){var n=t.m||[],e={partial:{t:[{t:t.t,e:t.e,f:t.f,m:n.filter(function(t){return!~b.indexOf(t.n)})}]},where:n.find(function(t){return"left"===t.n})?"left":n.find(function(t){return"center"===t.n})?"center":"right"};return e.partial.t[0].m.push({t:71,n:"button"}),e}t.prototype.template.t=n.filter(function(t){return"buttons"!==t.e}),e&&(t._btns=e.f.filter(function(t){return"button"===t.e||4===t.t&&(50===t.n||51===t.n)&&t.f.find(function(t){return"button"===t.e})}).map(function(t){return 4===t.t?t.f.filter(function(t){return"button"===t.e}).map(function(n){var e=o(n),i={t:t.t,n:t.n,f:[e.partial.t[0]]};return t.r&&(i.r=t.r),t.rx&&(i.rx=t.rx),t.x&&(i.x=t.x),e.partial={t:[i]},e}):[o(t)]}).reduce(function(t,n){return t.concat(n)},[]))}},init:function(){var t=this.constructor;t._btns&&!this.get("buttons.length")&&this.set("buttons",t._btns)}},observe:{"control.max root.max root.userMax control.width control.height root.dimensions.clientHeight root.dimensions.clientWidth":{handler:function(t,n,e){if(this.get("control.id")){var o=this.get("control.max")||this.get("root.userMax")||this.get("root.max"),i=this.get("control.actual")||{};if(o)if(i.max)~e.indexOf("client")&&"number"==typeof t&&(~e.indexOf("Width")?this.set("control.actual.width",this.host.sizeInEm(t)):~e.indexOf("Height")&&this.set("control.actual.height",this.host.sizeInEm(t)));else{this.wrapper;this.wrapper&&this.set("control.actual",{width:this.host.sizeInEm(this.wrapper.clientWidth),height:this.host.sizeInEm(this.wrapper.clientHeight),max:o})}else"number"==typeof t&&(~e.indexOf("width")?this.set("control.actual.width",t):~e.indexOf("height")&&this.set("control.actual.height",t)),i.max&&this.set("control.actual",{width:this.get("control.width"),height:this.get("control.width"),max:o}),this.set("control.actual.max",!1)}},init:!1,defer:!0}}}),i("RMWindowHost","components",w),i("RMWindow","components",m),w.prototype.Window=m,t.Base=d,t.Host=w,t.Window=m,t.plugin=x,t.default=x,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],n):n(t.RMWindow={},t.Ractive)}(this,function(t,n){"use strict";var e="default"in n?n.default:n,o="undefined"!=typeof window?window:null;function i(t,n,e){if(o&&o.Ractive&&"object"==typeof o.Ractive[n]){var i=document.currentScript;if(i||(i=(i=document.querySelectorAll("script"))[i.length-1]),i){var r=i.getAttribute("data-alias");r&&(r=(r=r.split("&")).reduce(function(t,n){var e=n.split("="),o=e[0],i=e[1];return t[o]=i,t},{})),Ractive[n][r&&r[t]||t]=e}}}function r(t,n){var e=t.processParams(n,{duration:200,easing:"easeInOut"});return new Promise(function(n){requestAnimationFrame(function(){t.setStyle("overflow","hidden");var o="x"===e.axis?"width":"height";if(t.isIntro||e.intro){var i=t.getStyle(o);t.setStyle(o,0),t.setStyle("opacity",0),n(t.animateStyle(o,i,e).then(function(){return t.animateStyle("opacity",1,e)}).then(function(){t.setStyle(o,""),t.setStyle("overflow","")}))}else t.setStyle(o,t.getStyle(o)),t.setStyle("opacity",1),n(t.animateStyle("opacity",0,e).then(function(){return t.animateStyle(o,0,e)}))})})}i("expand","transitions",r);var s={timeout:6e3,top:!0};var a=function(t,n){this.holder=t,this.data=n},c={message:{configurable:!0},more:{configurable:!0},showMore:{configurable:!0},left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0},center:{configurable:!0},context:{configurable:!0},type:{configurable:!0},class:{configurable:!0},dismissable:{configurable:!0},closeButton:{configurable:!0},buttons:{configurable:!0},live:{configurable:!0},closed:{configurable:!0}};a.prototype.close=function(t){var n=this;return this.data.timeout=t,this.data===this.holder.active?(this.holder.tm&&clearTimeout(this.holder.tm),t?this.holder.tm=setTimeout(function(){n.data.close(),n.holder.tm=null},t):this.data.close()):t?this.data.timeout=t:this.data.close(),this.closed},a.prototype.cancelClose=function(){this.data===this.holder.active?(clearTimeout(this.holder.tm),this.holder.tm=null):this.data.timeout=0},a.prototype.updateButtons=function(){this.data===this.holder.active&&this.data.instance.update("_toast.buttons")},a.prototype.set=function(t,e){if("object"==typeof t){for(var o in t)this.data[o]=t[o];return this.data===this.holder.active?this.data.instance.update("_toast"):Promise.resolve()}return this.data[t]=e,this.data===this.holder.active?this.data.instance.update("_toast."+n.Ractive.escapeKey(t)):Promise.resolve()},c.message.get=function(){return this.data.message},c.message.set=function(t){this.data.message=t,this.data===this.holder.active&&this.data.instance.update("_toast.message")},c.more.get=function(){return this.data.more},c.more.set=function(t){this.data.more=t,this.data===this.holder.active&&this.data.instance.update("_toast.more")},c.showMore.get=function(){return this.data.showMore},c.showMore.set=function(t){this.data.showMore=t,this.data===this.holder.active&&this.data.instance.update("_toast.showMore")},c.left.get=function(){return this.data.left},c.left.set=function(t){this.data.left=t,this.data.right=!1,this.data===this.holder.active&&this.data.instance.update("_toast.left")&&this.data.instance.update("_toast.right")},c.right.get=function(){return this.data.right},c.right.set=function(t){this.data.right=t,this.data.left=!1,this.data===this.holder.active&&this.data.instance.update("_toast.right")&&this.data.instance.update("_toast.left")},c.top.get=function(){return!this.data.bottom},c.top.set=function(t){this.data.bottom=!t,this.data===this.holder.active&&this.data.instance.update("_toast.bottom")},c.bottom.get=function(){return this.data.bottom},c.bottom.set=function(t){this.data.bottom=t,this.data===this.holder.active&&this.data.instance.update("_toast.bottom")},c.center.get=function(){return!this.data.left&&!this.data.right},c.center.set=function(t){this.data.left=!1,this.data.right=!1,this.data===this.holder.active&&this.data.instance.update("_toast.right"),this.data.instance.update("_toast.left")},c.context.get=function(){return this.data.context},c.context.set=function(t){this.data.context=t,this.data===this.holder.active&&this.data.instance.update("_toast.context")},c.type.get=function(){return this.data.type},c.type.set=function(t){this.data.type=t,this.data===this.holder.active&&this.data.instance.update("_toast.type")},c.class.get=function(){return this.data.class},c.class.set=function(t){this.data.class=t,this.data===this.holder.active&&this.data.instance.update("_toast.class")},c.dismissable.get=function(){return this.data.dismissable},c.dismissable.set=function(t){this.data.dismissable=t,this.data===this.holder.active&&this.data.instance.update("_toast.dismissable")},c.closeButton.get=function(){return this.data.closeButton},c.closeButton.set=function(t){this.data.closeButton=t,this.data===this.holder.active&&this.data.instance.update("_toast.closeButton")},c.buttons.get=function(){return this.data.buttons},c.buttons.set=function(t){this.data.buttons=t,this.data===this.holder.active&&this.data.instance.update("_toast.buttons")},c.live.get=function(){return this.data===this.holder.active||~this.holder.toasts.indexOf(this.data)},c.closed.get=function(){var t=this;return this._promise||(this._promise=new Promise(function(n){t.data.onclose=n})),this._promise},Object.defineProperties(a.prototype,c);var l,f=e.escapeKey,d=function(t){function n(n){t.call(this,n)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n}(e);e.extendWith(d,{css:function(t){return[function(t){var n=Object.assign({},t("raui.primary"),t("raui.window.primary"));return n.action=Object.assign({},t("raui.window.action"),t("raui.window.primary.action")),n.host=Object.assign({},t("raui.window.host"),t("raui.window.primary.host")),n.title=Object.assign({inactive:{}},t("raui.window.title"),t("raui.window.primary.title")),"\n .rwhost {\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n \n .rwhost-sizer {\n position: absolute;\n }\n \n .rwhost-pane {\n display: flex;\n position: relative;\n width: 100%;\n box-sizing: border-box;\n flex-grow: 2;\n overflow: auto;\n background-color: "+(n.host.bg||n.bg||"#fff")+";\n z-index: 1;\n }\n .rwhost-pane.blocked {\n overflow: hidden;\n }\n \n .rwhost-pane-content {\n flex-grow: 1;\n }\n \n .rwhost-modal {\n position: absolute;\n position: --webkit-sticky;\n position: sticky;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: -1;\n opacity: 0;\n transition: opacity 0.2s ease-in-out, z-index 0s linear 0.2s;\n background-color: #000;\n }\n .rwhost-modal-active {\n opacity: 0.5;\n z-index: 1;\n transition: opacity 0.2s ease-in-out, z-index 0s linear;\n }\n \n .rwindow-wrapper {\n display: inline-block;\n box-sizing: border-box;\n position: absolute;\n }\n .rwindow-wrapper.rwindow-resizing {\n transition: none;\n }\n \n .rwindow-wrapper.rwindow-resizable {\n padding: "+(n.handleSize||7)+"px;\n }\n \n .rwindow-topmost > .rwindow {\n box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 3px 5px -1px rgba(0, 0, 0, 0.3);\n opacity: 1;\n }\n \n .rwindow-modal {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: rgba(0, 0, 0, 0.5);\n opacity: 0;\n z-index: -1;\n transition: opacity 0.4s ease-in-out, z-index 0s linear 0.4s;\n }\n .rwindow-modal.rwindow-blocked {\n opacity: 1;\n z-index: 50;\n transition: opacity 0.4s ease-in-out, z-index 0s linear;\n }\n \n .rwindow {\n position: relative;\n box-sizing: border-box;\n background-color: "+(n.bg||"#fff")+";\n color: "+(n.fg||"#222")+";\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n overflow: hidden;\n width: 100%;\n height: 100%;\n min-width: "+(n.minWidth||"6em")+";\n min-height: "+(n.minHeight||"6em")+";\n transition: box-shadow 0.4s ease-in-out, opacity 0.4s ease-in-out;\n }\n .rwindow-max > .rwindow {\n border-radius: 0;\n box-shadow: none;\n }\n \n .rwindow-pane-top,\n .rwindow-max-top {\n background-color: "+(n.title.inactive.bg||n.fg||"#222")+";\n color: "+(n.title.inactive.fg||n.bg||"#fff")+";\n flex-shrink: 0;\n }\n \n .rwindow-max-top {\n flex-shrink: 2;\n }\n \n .rwindow-pane-top {\n display: flex;\n align-items: center;\n }\n \n .rwindow-topmost .rwindow-pane-top {\n background-color: "+(n.title.bg||n.fga||"#07e")+";\n color: "+(n.title.fg||n.bg||"#fff")+";\n }\n \n .rwindow-pane {\n display: flex;\n flex-direction: column;\n table-layout: fixed;\n width: 100%;\n height: 100%;\n }\n .rwindow-autosizing {\n display: block;\n box-sizing: border-box;\n }\n .rwindow-content {\n overflow: auto;\n flex-grow: 2;\n position: relative;\n box-sizing: border-box;\n }\n .rwindow-content.rwindow-pad {\n padding: 1em;\n }\n .rwindow-content.rwindow-flex {\n display: flex;\n flex-direction: column;\n }\n \n .rwindow-buttons {\n display: flex;\n flex-shrink: 0;\n padding: 0.5em;\n border-top: 1px solid "+(n.action.bc||n.bc||"#ccc")+";\n background-color: "+(n.action.bg||n.bg||"#fff")+";\n color: "+(n.action.fg||n.fg||"#222")+";\n }\n .rwindow-buttons.no-buttons {\n display: none;\n }\n .rwindow-left-buttons {\n text-align: left;\n flex-grow: 2;\n }\n .rwindow-left-buttons button {\n margin-right: 0.5em;\n }\n .rwindow-center-buttons {\n text-align: center;\n flex-shrink: 2;\n }\n .rwindow-center-buttons button {\n margin: 0 0.25em;\n }\n .rwindow-right-buttons {\n text-align: right;\n flex-grow: 2;\n }\n .rwindow-right-buttons button {\n margin-left: 0.5em;\n }\n \n .rwindow-title {\n overflow: hidden;\n text-overflow: ellipsis;\n padding: 0.5em;\n white-space: nowrap;\n box-sizing: border-box;\n flex-grow: 1;\n }\n \n .rwindow-controls {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n flex-grow: 1;\n }\n .rwindow-controls > div {\n margin: 0 1em 0 0;\n width: 0.7em;\n height: 0.7em;\n cursor: pointer;\n }\n .rwindow-minimize {\n border-bottom: 2px solid;\n }\n .rwindow-maximize {\n border: 2px solid;\n }\n .rwindow-controls > .rwindow-close {\n width: 0.5em;\n height: 1em;\n border-right: 2px solid;\n transform: rotate(45deg);\n transform-origin: center right;\n position: relative;\n margin-right: 1.5em;\n }\n .rwindow-close:before {\n cursor: pointer;\n height: 1.2em;\n width: 1.2em;\n top: 0.3em;\n left: 0.1em;\n content: ' ';\n transform: rotate(-45deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-close:after {\n cursor: pointer;\n height: 100%;\n width: 100%;\n top: 1px;\n left: calc(100% + 1px);\n content: ' ';\n border-left: 2px solid;\n transform: rotate(-90deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-max-top .rwindow-controls > .rwindow-close {\n margin-right: 0.5em;\n }\n "+("function"==typeof t("raui.window.extra")?t("raui.window.extra").call(this,t):"")+"\n "}.call(this,t)].join(" ")},cssId:"rwindow",noCssTransform:!0,delegate:!1,decorators:{tracked:function(t,n){return this[n]=t,{teardown:function(){this[n]===t&&(this[n]=null)}}}},transitions:{window:function(t,n){if(l)return t.complete();l=t;var e=t.processParams(n,{duration:400,easing:"easeInOut"}),o=t.node.parentNode,i=o.style?o.style.overflow:"";o.style&&(o.style.overflow="hidden"),t.isIntro||e.intro?(t.setStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0}),setTimeout(function(){t.animateStyle({transform:"none",opacity:1},e).then(function(){t.setStyle("opacity",1),l=!1,t.complete(),o.style&&(o.style.overflow=i)})})):(t.setStyle({transform:"none",opacity:1}),t.animateStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0},e).then(function(){l=!1,t.complete(),o.style&&(o.style.overflow=i)}))}}});var u,h=0,w=function(t){function n(n){t.call(this,n),this.defaults={}}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var e={current:{configurable:!0},currentId:{configurable:!0},placement:{configurable:!0},topmost:{configurable:!0},windows:{configurable:!0}};return e.current.get=function(){var t=this.get("topLevel");return this.getWindow(this.get("windows")[t].id)},e.currentId.get=function(){var t=this.get("topLevel");return this.get("windows."+f(t)+".id")},e.placement.get=function(){return this.get("placement")},e.placement.set=function(t){return this.set("placement",t)},e.topmost.get=function(){var t=this.get("windows");for(var n in t)if(t[n].topmost)return this.getWindow(t[n].id)},e.windows.get=function(){return Object.keys(this.get("windows"))},n.prototype.addWindow=function(t,n){var e=this,o=Object.assign({},this.defaults,t.constructor.prototype.options,t.options,t.get("options"),n);if(!(t instanceof m))throw new Error("Windows must be instances of Window");t.id||t.set("@.id",o.id||"window"+h++),this.get("windows."+f(t.id))||this.set("windows."+f(t.id),Object.assign({show:!1!==o.show,autosize:!0,id:t.id,blockers:[],close:!0,minimize:!0,maximize:!0},o,{id:t.id})),t.host=this;var i,r,s=this.attachChild(t,{target:"window"});(o.block&&("string"==typeof(i=o.block.id||o.block)&&i in this.get("windows")?(this.push("windows."+f(i)+".blockers",t.id),t.set("control.blocking",i)):i=!1),"fill"===o.size&&(i||o.block))?(!0===o.block?r=this.find(".rwhost-pane"):(r=this.getWindow(i))&&(r=r.find(".rwindow")),r&&(t.size(r.clientWidth-(o.fillPad||20),r.clientHeight-(o.fillPad||20)),!o.block||o.top||o.left||(o.top=o.left=Math.floor((o.fillPad||20)/2)))):o.width&&o.height?t.size(o.width,o.height):t.size("auto");return o.top&&o.left?t.move(o.top,o.left):this.place(t),this.raise(t,{show:!1!==o.show,parent:o.stickToParent}),t.on("close",function(){var n=t.get("control.blocking");if(n){var o=e.windowGet(n,"blockers");e.splice("windows."+f(n)+".blockers",o.indexOf(t.id),1)}e.detachChild(t).then(function(){return t.teardown()}),e.set("windows."+f(t.id)+".block",!1),e.set("windows."+f(t.id)+".index",-1),e.raise(),e.set("windows."+f(t.id),void 0),delete e.get("windows")[t.id]}),this.update("windows."+f(t.id)+".id",{force:!0}),s.then(function(){return t})},n.prototype.getWindow=function(t){return this.children.byName.window&&this.children.byName.window.filter(function(n){return n.instance.id===t}).map(function(t){return t.instance})[0]},n.prototype.windowGet=function(t,n){return this.get("windows."+f(t)+"."+n)},n.prototype.windowSet=function(t,n,e){return this.set("windows."+f(t)+"."+n,e)},n.prototype.raise=function(t,n){var e=this;void 0===n&&(n={});var o=t instanceof m?t:this.children.byName.window.filter(function(n){return n.instance.id===t}).map(function(t){return t.instance})[0],i=this.get("windows"),r=this,s=Object.keys(i).map(function(t){return i[t]}),a=s.length+1,c=this.get("topLevel");this.get("blocked");function l(t){var n=r.get("windows."+f(t)+".blockers");n&&n.forEach(function(t){r.add("windows."+f(t)+".index",a++),l(t)})}if(o){if(!1!==n.parent&&o.get("control.blocking")){var d=o.get("control.blocking");a=this.get("windows."+d+".index")||0+(this.get("windows."+d+".blockers.length")||0),s.forEach(function(t){t.index>a&&t.index++}),a++}o.set("control.index",!1===n.show?-1:a++),!1===n.show||o.visible||o.show(),l(o.id)}s.filter(function(t){return!1!==t.show&&!0===t.block}).forEach(function(t){e.set("windows."+f(t.id)+".index",(t.index||0)+a),l(t.id)});var u=s.sort(function(t,n){return t.show?n.show&&t.index<n.index?-1:1:-1}),h=u.filter(function(t){return t.show});a=u.indexOf(h[h.length-1]);var w={},p=null;if(u.forEach(function(t,n){var e=f(t.id);!0===t.block&&null===p&&(p=n),w["windows."+e+".index"]=null!==p?n+2:n,w["windows."+e+".topmost"]=n===a,w["windows."+e+".stack"]=u.length-n}),w.blocked=null!==p?p+1:0,~a&&u.length?w.topLevel=u[a].id:w.topLevel=null,this.set(w),(a=w.topLevel)&&a!==c&&this.get("currentMax")&&this.rendered){var g=this.get("windows."+f(c));o=this.getWindow(a);var b=this.get("transition");!1===b||g&&g.dialog&&(!g.blocking||g.blocking===a)||o.transition(b||"window",o.find("div"),{intro:!0})}},n.prototype.place=function(t){var n=this;return t.get("control.show")?new Promise(function(e){requestAnimationFrame(function(){var o=t.get("control");void 0===o.width&&t.size("auto");var i=0,r=0;if(n.fragment&&n.fragment.rendered){var s=n.find(".rwhost"),a=s.clientWidth,c=s.clientHeight,l=o.blocking;if(l){var d="windows."+f(l),u=n.get(d),h=o.max||!o.dialog&&(n.get("max")||n.get("userMax")),w=u.max||n.get("userMax")||n.get("max"),g=w?n.host.clientWidth:n.sizeInPx(u.width+"em"),m=w?n.host.clientHeight:n.sizeInPx(u.height+"em"),b=w?0:u.left,x=w?0:u.top;i=(h?a:g/2)+(h?0:b)-n.sizeInPx(o.width+"em")/2,r=(h?c:m/2)+(h?0:x)-n.sizeInPx(o.height+"em")/2}else{var y,v=n.get("placement");if("function"==typeof v)try{y=v(n,s,o)}catch(t){y=p(n,s,o)}else if("string"==typeof v)switch(v){case"smart":y=function(t,n,e){var o,i,r=n.clientWidth-10,s=n.clientHeight-10,a=Math.floor(s/16),c=Math.floor(r/16),l=new Array(a*c),f=new Array(a*c);for(o=0;o<l.length;o++)l[o]=0;var d,u,h,w,p,g,m,b,x=0,y=t.get("windows");for(var v in y)for(x++,d=y[v],u=Math.floor(d.top/16),h=Math.floor(d.left/16),p=Math.ceil(t.sizeInPx(d.height+"em")/16),w=Math.ceil(t.sizeInPx(d.width+"em")/16),o=u;o<u+p&&o<a;o++)for(i=h;i<h+w&&i<c;i++)l[o*c+i]++;for(w=Math.ceil(t.sizeInPx(e.width+"em")/16),p=Math.ceil(t.sizeInPx(e.height+"em")/16),o=0;o<a;o++)for(i=0;i<c;i++){if(o+p>a||i+w>c)g=x*w*p;else for(g=0,m=0;m<p;m++)for(b=0;b<w;b++)g+=l[(o+m)*c+i+b];if(0===g)return{top:16*o+5,left:16*i+5};f[o*c+i]=g}for(g=x*w*p,m=0,o=0;o<f.length;o++)f[o]<g&&(g=f[o],m=o);return{top:16*Math.floor(m/c)+5,left:m%c*16+5}}(n,s,o);break;default:y=p(n,s,o)}else y=p(n,s,o);r=y.top,i=y.left}(isNaN(i)||i<0)&&(i=10),(isNaN(r)||r<0)&&(r=10),t.set({"control.top":r,"control.left":i}),e()}})}):Promise.resolve()},n.prototype.sizeInPx=function(t){return this.sizer?(this.sizer.style.width="number"==typeof t?t+"px":t,this.sizer.clientWidth):16*parseFloat(t)},n.prototype.sizeInEm=function(t){return this.sizeInPx(t)/this.sizeInPx("1em")},Object.defineProperties(n.prototype,e),n}(d);function p(t,n,e){var o=n.clientWidth,i=n.clientHeight,r=0,s=0,a=void 0===t._grid1?t._grid1=0:t._grid1>7?t._grid1=0:++t._grid1,c=Math.floor(o/3),l=Math.floor(i/3),f=t.sizeInPx(e.width+"em"),d=t.sizeInPx(e.height+"em");switch(a){case 5:case 7:case 8:r=i-d-10;break;case 2:case 4:case 6:r=l+Math.floor((l-d)/2);break;case 0:case 1:case 3:r=10}switch(a){case 3:case 6:case 8:s=o-f-10;break;case 1:case 4:case 7:s=c+Math.floor((c-f)/2);break;case 0:case 2:case 5:s=10}return s+f>o&&(s=o-f-10),r+d>i&&(r=i-d-10),{top:r,left:s}}d.extendWith(w,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost",g:1},{n:"tracked",t:71,f:{r:[],s:'["host"]'}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-sizer",g:1},{n:"tracked",t:71,f:{r:[],s:'["sizer"]'}}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-max-top",g:1},{t:4,f:[{t:16,r:"~/_maxAttrsP"}],n:50,r:"~/_maxAttrsP"}],f:[{t:16,r:"~/_maxP",z:[{n:"window",x:{r:"~/current"}},{n:"windowControls",x:{x:{r:["@this.partials.windowControls"],s:"{t:_0}"}}},{n:"host",x:{r:"@this"}}]}]}],n:50,x:{r:["~/currentMax","~/_maxP"],s:"_0&&_1"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane",g:1},{n:"class-rwhost-blocked",t:13,f:[{t:2,r:"~/blocked"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane-content",g:1}],f:[{t:16}]}," ",{t:4,f:[{t:11,n:"window",m:[{n:"control",f:[{t:2,rx:{r:"~/windows",m:[{t:30,n:".instance.id"}]}}],t:13},{n:"root",t:13,f:[{t:2,r:"~/"}]}]}],n:52,r:"@this.children.byName.window"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-modal",g:1},{n:"tracked",t:71,f:{r:[],s:'["modalPane"]'}},{t:4,f:[{n:"class-rwhost-modal-active",t:13},{n:"style-z-index",f:[{t:2,r:"~/blocked"}],t:13}],n:50,r:"~/blocked"}]}]}," ",{t:8,r:"toast"}]}],e:{'["host"]':function(){return["host"]},'["sizer"]':function(){return["sizer"]},"{t:_0}":function(t){return{t:t}},"_0&&_1":function(t,n){return t&&n},'["modalPane"]':function(){return["modalPane"]},"[_0.getWindow(_1).hide()]":function(t,n){return[t.getWindow(n).hide()]},"[_0.getWindow(_1).maximize()]":function(t,n){return[t.getWindow(n).maximize()]},"!_0&&_1&&_2":function(t,n,e){return!t&&n&&e},"[_0.getWindow(_1).close()]":function(t,n){return[t.getWindow(n).close()]},'["top"]':function(){return["top"]},"[_0.hide()]":function(t){return[t.hide()]},"!_0&&_1":function(t,n){return!t&&n},"[_0.maximize()]":function(t){return[t.maximize()]},"[_0.close()]":function(t){return[t.close()]},"(_0||_1||_2)&&_3&&!_4":function(t,n,e,o,i){return(t||n||e)&&o&&!i},'["content"]':function(){return["content"]},"!_0":function(t){return!t},"[_0.call(_1)]":function(t,n){return[t.call(n)]},'["wrapper"]':function(){return["wrapper"]},"_0!==false":function(t){return!1!==t},"_0||_1":function(t,n){return t||n},"(_0||_1||_2)&&!_3":function(t,n,e,o){return(t||n||e)&&!o},"[_0._startResize(_1)]":function(t,n){return[t._startResize(n)]},"[_0._sizeHandle(_1)]":function(t,n){return[t._sizeHandle(n)]},"[_0._startMove(_1)]":function(t,n){return[t._startMove(n)]},"!(_0===false||_1||_2||_3)&&!_4":function(t,n,e,o,i){return!(!1===t||n||e||o||i)},"[_0.raise()]":function(t){return[t.raise()]},'["pane"]':function(){return["pane"]}},p:{title:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}],windowControls:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).hide()]"}}]}],n:50,r:"window.minimize"}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).maximize()]"}}]}],n:50,x:{r:["~/window.dialog","window.maximize","host.data.userMax"],s:"!_0&&_1&&_2"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).close()]"}}]}],n:50,r:"window.close"}]}],pane:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:51,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog"],s:"(_0||_1||_2)&&_3&&!_4"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}],window:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"(_0||_1||_2)&&!_3"}},{t:4,f:[{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/control.movable","~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"!(_0===false||_1||_2||_3)&&!_4"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]}},use:[function(t){void 0===t&&(t={});var n=function(t){return[function(t){var n=Object.assign({},t("raui.primary"),t("raui.toast.primary"));return"\n .rtoast {\n position: absolute;\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n left: 1em;\n right: 1em;\n top: 1em;\n bottom: auto;\n z-index: 5;\n pointer-events: none;\n overflow: hidden;\n }\n .rtoast-message {\n flex-grow: 2;\n display: flex;\n align-items: center;\n }\n .rtoast-string {\n white-space: pre-wrap;\n line-height: 1.3em;\n padding-top: 0.3em;\n }\n .rtoast-upper .rtoast-string {\n \n }\n .rtoast-expand .rtoast-string {\n padding-top: 0.5em;\n }\n .rtoast-buttons {\n display: flex;\n padding-left: 0.5em;\n flex-shrink: 1;\n align-items: center;\n max-height: max-content;\n margin-left: auto;\n }\n .rtoast-buttons button {\n cursor: pointer;\n }\n .rtoast-button {\n background-color: transparent;\n border: none;\n color: inherit;\n padding: 0.5em 0.75em;\n margin: 0 0 0 0.5em;\n line-height: 1em;\n box-shadow: none;\n }\n .rtoast-more {\n cursor: pointer;\n width: 2em;\n position: relative;\n flex-shrink: 2;\n background-color: transparent;\n border: none;\n color: inherit;\n margin: 0 0 0 0.5em;\n height: 2em;\n }\n .rtoast-more:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n height: 0.6em;\n top: calc(50% - 0.55em);\n left: calc(50% - 0.3em);\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n transition: transform 0.2s ease-in-out, top 0.2s ease-in-out;\n pointer-events: none;\n }\n .rtoast-expanded .rtoast-more:after {\n transform: rotate(225deg);\n top: calc(50% - 0.1em);\n }\n .rtoast-bottom {\n bottom: 1em;\n top: auto;\n }\n .rtoast-left {\n justify-content: flex-start;\n }\n .rtoast-right {\n justify-content: flex-end;\n }\n .rtoast-body {\n border-radius: 0.2em;\n padding: 0.5em 1em;\n color: "+(n.bg||"#fff")+";\n background-color: "+(n.fg||"#222")+";\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n opacity: 0.95;\n pointer-events: all;\n transition: color 0.5s ease-in-out, background 0.5s ease-in-out;\n }\n .rtoast-upper {\n display: flex;\n flex-shrink: 2;\n flex-wrap: wrap;\n justify-content: space-between;\n }\n \n .rtoast-success {\n color: "+(t("raui.toast.success.fg")||"#f9f9f9")+";\n background-color: "+(t("raui.toast.success.bg")||"#4caf50")+";\n }\n .rtoast-info {\n color: "+(t("raui.toast.info.fg")||"#f9f9f9")+";\n background-color: "+(t("raui.toast.info.bg")||"#07e")+";\n }\n .rtoast-warn {\n color: "+(t("raui.toast.warn.fg")||"#222")+";\n background-color: "+(t("raui.warn.success.bg")||"#ffc107")+";\n }\n .rtoast-error {\n color: "+(t("raui.toast.error.fg")||"#f9f9f9")+";\n background-color: "+(t("raui.toast.error.bg")||"#ff5252")+";\n }\n "}.call(this,t)].join(" ")},e={v:4,t:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast",g:1},{n:"class-rtoast-expanded",t:13,f:[{t:2,r:".showMore"}]},{n:"class-rtoast-bottom",t:13,f:[{t:2,r:".bottom"}]},{n:"class-rtoast-left",t:13,f:[{t:2,r:".left"}]},{n:"class-rtoast-right",t:13,f:[{t:2,r:".right"}]}],f:[{t:7,e:"div",m:[{n:"toast",t:72,v:"t0"},{n:"class",f:["rtoast-body",{t:4,f:[" rtoast-",{t:2,r:".type"}],n:50,r:".type"},{t:4,f:[{t:2,r:".class"}],n:50,r:".class"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.close()]"}}],n:50,x:{r:[".dismissable"],s:"_0!==false"}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-upper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-message",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".message",c:{r:".context"}}],n:50,x:{r:[".context"],s:"!!_0"}},{t:4,f:[{t:8,r:".message"}],n:51,l:1}],n:50,x:{r:[".message"],s:"Array.isArray(_0)"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-string",g:1}],f:[{t:2,r:".message"}]}],n:51,l:1}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-buttons",g:1}],f:[{t:4,f:[{t:7,e:"button",m:[{n:"class",f:["rtoast-button",{t:4,f:[" ",{t:2,r:".class"}],n:50,r:".class"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.action()]"}}],n:50,x:{r:[".action"],s:'typeof _0==="function"'}}],f:[{t:2,r:".label"}]}],n:52,r:".buttons"},{t:4,f:[{t:7,e:"button",m:[{t:13,n:"class",f:"rtoast-button",g:1}],f:["Close"]}],n:50,x:{r:[".dismissable",".closeButton"],s:"_0!==false&&_1!==false"},l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-more",g:1},{n:"title",f:"Toggle more",t:13,g:1},{n:["click"],t:70,f:{r:[".","@context"],s:'[_0.expand(),(_1).toggle(".showMore"),false]'}}]}],n:50,r:".more"}]}],n:50,x:{r:[".dismissable",".closeButton",".buttons.length",".more"],s:"(_0!==false&&_1!==false)||_2||_3"}}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-expand",g:1},{n:"toast-expand",t:72,v:"t0"},{n:["click"],t:70,f:{r:[],s:"[false,false]"}}],f:[{t:4,f:[{t:4,f:[{t:8,r:".more",c:{r:".context"}}],n:50,x:{r:[".context"],s:"!!_0"}},{t:4,f:[{t:8,r:".more"}],n:51,l:1}],n:50,x:{r:[".more"],s:"Array.isArray(_0)"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-string",g:1}],f:[{t:2,r:".more"}]}],n:51,l:1}]}],n:50,x:{r:[".more",".showMore"],s:"_0&&_1"}}]}]}],n:54,r:"~/_toast"}],n:50,r:"~/_toast"}],e:{"[_0.close()]":function(t){return[t.close()]},"_0!==false":function(t){return!1!==t},"!!_0":function(t){return!!t},"Array.isArray(_0)":function(t){return Array.isArray(t)},"[_0.action()]":function(t){return[t.action()]},'typeof _0==="function"':function(t){return"function"==typeof t},"_0!==false&&_1!==false":function(t,n){return!1!==t&&!1!==n},'[_0.expand(),(_1).toggle(".showMore"),false]':function(t,n){return[t.expand(),n.toggle(".showMore"),!1]},"(_0!==false&&_1!==false)||_2||_3":function(t,n,e,o){return!1!==t&&!1!==n||e||o},"[false,false]":function(){return[!1,!1]},"_0&&_1":function(t,n){return t&&n}}};return function(o){var i=o.Ractive,r=o.instance,c=o.proto;r.partials[t.name||"toast"]=e;var l,f=Object.assign({},s,t),d=[],u={toasts:d};function h(n){l!==n?(d.splice(d.indexOf(t),1),"function"==typeof n.onclose&&n.onclose()):(u.tm&&(clearTimeout(u.tm),u.tm=null),l.instance.set("_toast",null).then(function(){u.active=l=null,"function"==typeof n.onclose&&n.onclose(),d.length&&w()}))}function w(){u.active=l=d.shift(),l.instance.set("_toast",l).then(function(){l.timeout&&(u.tm&&clearTimeout(u.tm),u.tm=setTimeout(function(){l.close(),u.tm=null},l.timeout))})}if(Object.defineProperty(c,"toastDefaults",{value:f,writable:!1,configurable:!0}),c.toast=function(t,n){var e=Object.assign({message:t,instance:this},f,this.toastDefaults,n);return e.close=function(){return h(e)},e.expand=function(){u.active===e&&(u.tm&&(clearTimeout(u.tm),u.tm=null),e.showMore&&e.timeout&&(u.tm=setTimeout(function(){e.close(),u.tm=null},e.timeout)))},d.push(e),l||w(),new a(u,e)},c.on=c.on||{},r.transitions.toast=function(t,n){var e=t.processParams({duration:200},n),o=t.getStyle("opacity");return t.isIntro?(t.setStyle({opacity:0,transform:"translateY("+(l.bottom?"":"-")+"1em)"}),t.animateStyle({opacity:o,transform:"none"},e)):(t.setStyle({opacity:o,transform:"none"}),t.animateStyle({opacity:0,transform:"translateY("+(l.bottom?"":"-")+"1em)"},e))},r.transitions["toast-expand"]=function(t,n){var e=t.processParams({duration:200,nested:!1},n);if(t.isIntro){var o=t.getStyle("height"),i=t.getStyle("width");return t.setStyle("height",0),t.setStyle("width",0),t.animateStyle("width",i,e).then(function(){return t.animateStyle("height",o,e)}).then(function(){t.setStyle("height",""),t.setStyle("width","")})}var r=t.getStyle("height");return t.setStyle("height",r),t.setStyle("width",t.getStyle("width")),t.animateStyle("height",0,e).then(function(){return t.animateStyle("width",0,e)}).then(function(){t.setStyle("height",""),t.setStyle("width","")})},c.on["close-toast"]=function(){l&&l.close()},r===i||i.isInstance(r))i.hasCSS("toast-css")||i.addCSS("toast",n);else{var p=r.css;r.css=function(t){var e="";return"string"==typeof p?e+=p:"function"==typeof p&&(e+=p(t)),n(t)+e}}return c}}(),(void 0===u&&(u={}),function(t){t.instance.transitions[u.name||"expand"]=r})],cssId:"window-host",noIntro:!0,observe:{"@style.raui.window.maxFrom":function(){var t;(t=this)._media?t._media.fn():(t._media={},t._media.fn=function(){if(t.host){var n=t.sizeInPx(t.get("@style.raui.window.maxFrom")),e=t.transitionsEnabled;t.transitionsEnabled=!1,t.set("max",t.host.clientWidth<=n),t.set("dimensions",{clientWidth:t.host.clientWidth,clientHeight:t.host.clientHeight}),t.transitionsEnabled=e}},t._media.handle=t.root.on("*.resize",t._media.fn),setTimeout(t._media.fn))},topLevel:function(t){t?this.link("windows."+f(t),"current"):this.unlink("current")},currentMax:{handler:function(t){(this.children.byName.window||[]).forEach(function(t){return t.instance.fire("resize")})},defer:!0}},computed:{currentMax:function(){var t=this.get("topLevel"),n=this.get("windows."+f(t)+".max");return this.get("userMax")||this.get("max")||n}},on:{config:function(){var t,n=this,e=this.partials.content;if(e&&Array.isArray(e))for(var o=(e=this.partials.content=e.slice()).length;o--;){var i=e[o];"max-top"===i.e&&(e.splice(o,1),this.set({_maxP:{t:i.f},hideTitleMax:!0}),i.m&&this.set({_maxAttrsP:{t:i.m}}))}"undefined"!=typeof window&&(this._resizeListener=function(){t||(t=setTimeout(function(){t=null,n.fire("resize")},300))},window.addEventListener("resize",this._resizeListener))},teardown:function(){this._resizeListener&&window.removeEventListener("resize",this._resizeListener)}}}),e.transitions.modal=function(t,n){var e,o=t.processParams(n,{duration:400,easing:"easeOut",x:0,y:-50,event:!0}),i=t.node.offsetLeft,r=t.node.offsetTop,s=t.node.parentNode.style?t.node.parentNode.style.overflow:"hidden";if(t.node._modalSrc){var a=t.node._modalSrc||{x:i+o.x,y:r+o.y},c={x:a.x-Math.round(t.node.clientWidth/2)-i,y:a.y-Math.round(t.node.clientHeight/2)-r};t.node.parentNode.style&&(t.node.parentNode.style.overflow="hidden"),t.isIntro?(t.node._modalSrc=a,e={transform:"translate(0, 0) scale(1, 1)",opacity:1},t.setStyle({transform:"translate("+c.x+"px, "+c.y+"px) scale(0.5, 0.5)",opacity:0})):e={transform:"translate("+c.x+"px, "+c.y+"px) scale(0.5, 0.5)",opacity:0}}else t.isIntro?(e={transform:"translate(0, 0) scale(1, 1)",opacity:1},t.setStyle({transform:"translate("+o.x+"px, "+o.y+"px) scale(0.5, 0.5)",opacity:0})):e={transform:"translate("+o.x+"px, "+o.y+"px) scale(0.5, 0.5)",opacity:0};t.animateStyle(e,o).then(function(){t.node.parentNode.style&&(t.node.parentNode.style.overflow=s),t.complete()})};var g=["mousemove","mouseup","touchmove","touchend"],m=function(t){function n(n){t.call(this,n)}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var e={resizable:{configurable:!0},title:{configurable:!0},visible:{configurable:!0},pad:{configurable:!0},buttons:{configurable:!0},blocked:{configurable:!0},result:{configurable:!0}};return e.resizable.get=function(){return this.get("control.resizable")},e.resizable.set=function(t){return this.set("control.resizable",t)},e.title.get=function(){return this.get("control.title")},e.title.set=function(t){return this.set("control.title",t)},e.visible.get=function(){return this.get("control.show")},e.visible.set=function(t){t?this.show():this.set("control.show",t,{keep:!0}),this.host.raise(this,{show:t})},e.pad.get=function(){return this.get("pad")},e.pad.set=function(t){this.set("pad",t)},e.buttons.get=function(){return this.get("buttons")},e.buttons.set=function(t){return this.set("buttons",t)},e.blocked.get=function(){return this.get("control.blocked")},e.blocked.set=function(t){return this.set("control.blocked",t)},e.result.get=function(){var t=this;return this._result||(this._result={},this._result.promise=new Promise(function(n){t._result.ok=n})),this._result.promise},n.prototype.setResult=function(t){this.result,this._result.value=t},n.prototype.close=function(t,n){if(!0!==t){if(!this.parent)return!1;if(this.get("control.blockers.length"))return!1;if("function"==typeof this.beforeClose&&!1===this.beforeClose())return!1;if(!1===this.fire("beforeClose"))return!1}return this.fire("close"),this._result&&this._result.ok(this._result.value||n),!0},n.prototype.maximize=function(){this.toggle("root.userMax")},n.prototype.hide=function(){this.visible=!1},n.prototype.raise=function(t){this.host.raise(this,{show:t})},n.prototype.show=function(){this.set("control.show",!0),void 0===this.get("control.top")&&this.host.place(this)},n.prototype.size=function(t,n){var e=this;return new Promise(function(o){requestAnimationFrame(function(){if(e.visible){var i=e.wrapper;if(i){if("auto"===t){e.set("control.autosize",!0);var r=e.host.sizeInEm(i.clientWidth+16),s=e.host.sizeInEm(i.clientHeight);e.set({"control.width":r,"control.height":s,"control.naturalWidth":r,"control.naturalHeight":s,"control.autosize":!1})}else if("number"==typeof t&&"number"==typeof n)e.set({"control.width":e.host.sizeInEm(t),"control.height":e.host.sizeInEm(n),"control.naturalWidth":e.host.sizeInEm(t),"control.naturalHeight":e.host.sizeInEm(n),"control.autosize":!1});else if("string"==typeof t&&"string"==typeof n){var a=i.style.width,c=i.style.height;i.style.width=t,i.style.height=n;var l=i.clientWidth,f=i.clientHeight;i.style.width=a,i.style.height=c,e.set({"control.width":e.host.sizeInEm(l),"control.height":e.host.sizeInEm(f),"control.naturalWidth":e.host.sizeInEm(l),"control.naturalHeight":e.host.sizeInEm(f),"control.autosize":!1})}e.fire("resize"),o()}}else"number"==typeof t&&"number"==typeof n&&e.set({"control.width":e.host.sizeInEm(t),"control.height":e.host.sizeInEm(n),"control.naturalWidth":e.host.sizeInEm(t),"control.naturalHeight":e.host.sizeInEm(n),"control.autosize":!1})})})},n.prototype.move=function(t,n){var e=this;return new Promise(function(o){requestAnimationFrame(function(){"center"===t?t=e.host.modalPane.clientHeight/2-e.wrapper.clientHeight/2:"string"==typeof t&&(t=e.host.sizeInEm(t)),"center"===n&&(n=e.host.modalPane.clientWidth/2-e.wrapper.clientWidth/2),"string"==typeof n&&(n=e.host.sizeInEm(n));var i={};"number"==typeof t&&(i["control.top"]=t),"number"==typeof n&&(i["control.left"]=n),e.set(i),o()})})},n.prototype._startMove=function(t){var n=this;if("mousedown"!==t.type||0===t.button){if(this.get("control.topmost")||this.raise(),~t.type.indexOf("mouse")){if(!t.ctrlKey&&t.target!==this.content&&t.target!==this.top&&!this.top.contains(t.target))return}else if(t.targetTouches&&1===t.targetTouches.length&&t.target!==this.content&&t.target!==this.top&&!this.top.contains(t.target))return;var e=this.pane,o=e.style.cursor;e.style.cursor="move",e.style.userSelect="none";var i=t.x||t.clientX||t.targetTouches&&t.targetTouches[0].clientX||0,r=t.y||t.clientY||t.targetTouches&&t.targetTouches[0].clientY||0,s=this.get("control.left")||0,a=this.get("control.top")||0,c=e.clientWidth,l=e.clientHeight,f=function(t){var d=t.x||t.clientX||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientX||t.changedTouches&&t.changedTouches[0].clientX||0,u=t.y||t.clientY||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientY||t.changedTouches&&t.changedTouches[0].clientY||0,h=s+(d-i),w=a+(u-r);h<(c<30?0:30-c)&&(h=c<30?0:30-c),w<(l<30?0:30-l)&&(w=l<30?0:30-l),h<0&&(h=0),w<0&&(w=0),n.set({"control.top":w,"control.left":h}),"touchend"===t.type||"mouseup"===t.type?(g.forEach(function(t){return document.removeEventListener(t,f,{passive:!1})}),e.style.cursor=o,e.style.userSelect=""):t.preventDefault()};return g.forEach(function(t){return document.addEventListener(t,f,{passive:!1})}),0!==t.type.indexOf("mouse")&&void 0}},n.prototype._startResize=function(t){var n=this;if(t.target===this.wrapper&&("mousedown"!==t.type||0===t.button)){this.get("control.autosize")&&this.size("auto"),this.get("control.topmost")||this.raise(),this.set("control.resizing",!0);var e,o=this.wrapper,i=t.offsetX||t.targetTouches&&t.targetTouches[0].pageX-o.getBoundingClientRect().left,r=t.offsetY||t.targetTouches&&t.targetTouches[0].pageY-o.getBoundingClientRect().top,s=this.get("@style.window.handleSize")||7,a=o.clientWidth-2*s,c=o.clientHeight-2*s,l=2*s,f=i<=l||i>=a,d=r<=l||r>=c,u=t.x||t.clientX||t.targetTouches&&t.targetTouches[0].clientX||0,h=t.y||t.clientY||t.targetTouches&&t.targetTouches[0].clientY||0,w=this.get("control.left")||0,p=this.get("control.top")||0,m=this.host.sizeInPx(this.get("control.width")+"em"),b=this.host.sizeInPx(this.get("control.height")+"em"),x=this.host.sizeInPx(this.get("control.naturalHeight")+"em"),y=this.host.sizeInPx(this.get("control.naturalWidth")+"em"),v=function(t){t.preventDefault();var o=t.x||t.clientX||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientX||t.changedTouches&&t.changedTouches[0].clientX||0,a=t.y||t.clientY||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientY||t.changedTouches&&t.changedTouches[0].clientY||0,c=f?o-u:0,l=d?a-h:0,_={};r<=s?(_["control.top"]=p+l,_["control.height"]=b-l):_["control.height"]=b+l,i<=s?(_["control.left"]=w+c,_["control.width"]=m-c):_["control.width"]=m+c,_["control.width"]<y&&(delete _["control.width"],delete _["control.left"]),_["control.height"]<x&&(delete _["control.height"],delete _["control.top"]),_["control.left"]<0&&(_["control.left"]=0),_["control.top"]<0&&(_["control.top"]=0),_["control.width"]&&(_["control.width"]=n.host.sizeInEm(_["control.width"])),_["control.height"]&&(_["control.height"]=n.host.sizeInEm(_["control.height"])),n.set(_),"touchend"===t.type||"mouseup"===t.type?(g.forEach(function(t){return document.removeEventListener(t,v,{passive:!1})}),n.set("control.resizing",!1),m===n.get("control.width")&&b===n.get("control.height")||(e&&clearTimeout(e),e=null,n.fire("resize"))):e||(e=setTimeout(function(){n.fire("resize"),e=null},200))};return g.forEach(function(t){return document.addEventListener(t,v,{passive:!1})}),!1}},n.prototype._sizeHandle=function(t){if(t.target===this.wrapper){var n=this.wrapper;if("mouseout"===t.type)return n.style.cursor="auto";var e=t.offsetX,o=t.offsetY,i=this.get("@style.window.handleSize")||7,r=n.clientWidth-i,s=n.clientHeight-i,a=n.style;a.cursor=e<=i+i&&o<=i+i||e>=r-i&&o>=s-i?"nwse-resize":e>=r-i&&o<=i+i||e<=i+i&&o>=s-i?"nesw-resize":(e<=i||e>=r)&&(o<s||o>i)?"ew-resize":(o<=i||o>=s)&&(e<r||e>i)?"ns-resize":"auto"}},Object.defineProperties(n.prototype,e),n}(d),b=["left","right","center","condition"];function x(t){return void 0===t&&(t={}),function(n){n.instance.components[t.name||"host"]=w}}d.extendWith(m,{template:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"(_0||_1||_2)&&!_3"}},{t:4,f:[{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/control.movable","~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"!(_0===false||_1||_2||_3)&&!_4"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]},cssId:"window",partials:{pane:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:51,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog"],s:"(_0||_1||_2)&&_3&&!_4"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}],title:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}],contents:"",status:""},data:function(){return{buttons:[],visibleButtons:0}},computed:{leftButtons:function(){return(this.get("buttons")||[]).filter(function(t){return"left"===t.where})},centerButtons:function(){return(this.get("buttons")||[]).filter(function(t){return"center"===t.where})},rightButtons:function(){return(this.get("buttons")||[]).filter(function(t){return!t.where||"right"===t.where})}},decorators:{button:function(t){var n=this.getContext(t);return n.add("visibleButtons"),{update:function(){},teardown:function(){n.subtract("visibleButtons")}}}},on:{config:function(){var t=m.prototype.template,n=this.template;"string"!=typeof t&&!Array.isArray(t)&&t.t&&(t=t.t),"string"!=typeof n&&!Array.isArray(n)&&n.t&&(n=n.t),t!==n&&(this.partials.hasOwnProperty("contents")||(this.partials.contents=n),this.template=t)},construct:function(){var t=this.constructor;if(!t._constructed){t._constructed=1;var n=t.prototype.template.t.slice(),e=n.find(function(t){return"buttons"===t.e});function o(t){var n=t.m||[],e={partial:{t:[{t:t.t,e:t.e,f:t.f,m:n.filter(function(t){return!~b.indexOf(t.n)})}]},where:n.find(function(t){return"left"===t.n})?"left":n.find(function(t){return"center"===t.n})?"center":"right"};return e.partial.t[0].m.push({t:71,n:"button"}),e}t.prototype.template.t=n.filter(function(t){return"buttons"!==t.e}),e&&(t._btns=e.f.filter(function(t){return"button"===t.e||4===t.t&&(50===t.n||51===t.n)&&t.f.find(function(t){return"button"===t.e})}).map(function(t){return 4===t.t?t.f.filter(function(t){return"button"===t.e}).map(function(n){var e=o(n),i={t:t.t,n:t.n,f:[e.partial.t[0]]};return t.r&&(i.r=t.r),t.rx&&(i.rx=t.rx),t.x&&(i.x=t.x),e.partial={t:[i]},e}):[o(t)]}).reduce(function(t,n){return t.concat(n)},[]))}},init:function(){var t=this.constructor;t._btns&&!this.get("buttons.length")&&this.set("buttons",t._btns)}},observe:{"control.max root.max root.userMax control.width control.height root.dimensions.clientHeight root.dimensions.clientWidth":{handler:function(t,n,e){if(this.get("control.id")){var o=this.get("control.max")||this.get("root.userMax")||this.get("root.max"),i=this.get("control.actual")||{};if(o)if(i.max)~e.indexOf("client")&&"number"==typeof t&&(~e.indexOf("Width")?this.set("control.actual.width",this.host.sizeInEm(t)):~e.indexOf("Height")&&this.set("control.actual.height",this.host.sizeInEm(t)));else{this.wrapper;this.wrapper&&this.set("control.actual",{width:this.host.sizeInEm(this.wrapper.clientWidth),height:this.host.sizeInEm(this.wrapper.clientHeight),max:o})}else"number"==typeof t&&(~e.indexOf("width")?this.set("control.actual.width",t):~e.indexOf("height")&&this.set("control.actual.height",t)),i.max&&this.set("control.actual",{width:this.get("control.width"),height:this.get("control.width"),max:o}),this.set("control.actual.max",!1)}},init:!1,defer:!0}}}),i("RMWindowHost","components",w),i("RMWindow","components",m),w.prototype.Window=m,t.Base=d,t.Host=w,t.Window=m,t.plugin=x,t.default=x,Object.defineProperty(t,"__esModule",{value:!0})});

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display