@evs-chris/raui
Advanced tools
Comparing version
@@ -156,4 +156,7 @@ // TODO: support for non-numeric formats? | ||
var g = groupForPos(groups, node.selectionStart); | ||
if (updateValues(groups, g, node.selectionStart, true)) { updateDisplay(groups, node); } | ||
var idx = groups.indexOf(g); | ||
if (updateValues(groups, g, node.selectionStart, true)) { | ||
updateDisplay(groups, node); | ||
applyValues(groups, sendValue, ev.shiftKey && idx > 0 || !ev.shiftKey && idx + 1 < groups.length); | ||
} | ||
if (ev.shiftKey && idx > 0) { | ||
@@ -160,0 +163,0 @@ node.setSelectionRange(groups[idx - 1].start, groups[idx - 1].end); |
@@ -1,1 +0,1 @@ | ||
var nonDigits=/[^\d]+/;var nonDisplay=/[^\d_]+/;var blankChar="_";var map={y:0,M:1,d:2,H:3,m:4,s:5,S:6};export function padl(str,total,char){if(char===void 0)char="0";var v=str==null?"":""+str;for(var i=v.length;i<total;i++){v=char+v}return v}export function padr(str,total,char){if(char===void 0)char="0";var v=str==null?"":""+str;for(var i=v.length;i<total;i++){v+=char}return v}export var defaults={mask:"yyyy-MM-dd",time:"00:00:00.000",date:function date(){var now=new Date;return new Date(now.getFullYear()+"-"+padl(now.getMonth()+1,2)+"-"+padl(now.getDate(),2)+"T"+defaults.time)}};export default function plugin(options){if(options===void 0)options={};var defaultMask=options.mask||defaults.mask;var defaultTime=options.time||defaults.time;var defaultDate=options.date||defaults.date;if(typeof defaultDate!=="function"){var dt=defaultDate;defaultDate=function(){return dt}}return function(ref){var instance=ref.instance;instance.decorators[options.name||"date"]=function(node,optsin,other){if(optsin===void 0)optsin={};var opts=Object.assign({},options,typeof optsin==="string"?{value:optsin}:0,typeof other==="string"?{mask:other}:0,typeof optsin==="object"?optsin:0);var ctx=this.getContext(node);var mask=opts.mask||defaultMask;var handles={observers:[],listeners:[]};if(node.tagName!=="INPUT"){console.warn("Attempted to add a date decorator a "+node.tagName);return noop}if(!mask){return noop}var groups=[];var match,last=0;while(match=dateRE.exec(mask)){var group={mask:match[0],type:match[0][0],length:match[0].length,start:match.index,end:match.index+match[0].length,chunk:groups.length,prefix:mask.substring(last,match.index),groups:groups,value:null,display:padr("",match[0].length,blankChar)};last=group.end;groups.push(group)}groups.suffix=mask.substring(groups[groups.length-1].end);groups.last=null;if(groups.slice(1).find(function(g){return!g.prefix})){console.warn("Attempted to add a date decorator missing interstitial between fields '"+mask+"'");return noop}if(typeof opts.value==="string"){handles.observers.push(ctx.observe(opts.value,function(v){if(!v&&opts.null===false){v=defaultDate()}groups.value=v;receiveValue(groups,v);groups.last=v;updateDisplay(groups,node)},{defer:true}))}else{if(opts.date||opts.null===false){groups.value=getDateValue(opts.date||defaultDate())}updateDisplay(groups,node)}function sendValue(focused){if(groups.value===null&&groups.last===null||+groups.value===+groups.last){return 1}if(focused&&opts.lazy!==false){return}if(opts.null===false&&groups.value===null){return receiveValue(groups,groups.last)&&1||1}groups.last=groups.value;if(typeof opts.value==="string"){handles.observers.forEach(function(h){return h.silence()});ctx.set(opts.value,groups.value);handles.observers.forEach(function(h){return h.resume()})}}handles.listeners.push(ctx.listen("input",function(){var pos=node.selectionStart;var start=node.value;readInput(groups,node,mask);var active=groupForPos(groups,pos);var accepted=updateValues(groups,active,pos);applyValues(groups,sendValue,true);updateDisplay(groups,node);if(active&&(start.length>=mask.length&&pos===active.end||accepted)&&active!==groups[groups.length-1]){var next=groups[groups.indexOf(active)+1];node.setSelectionRange(next.start,next.end)}else{node.setSelectionRange(pos,pos)}}));handles.listeners.push(ctx.listen("blur",function(){if(sendValue(false)){receiveValue(groups,groups.value)}updateDisplay(groups,node)}));var selectGroup=function(){var group=groupForPos(groups,node.selectionStart);document.activeElement===node&&node.setSelectionRange(group.start,group.end)};handles.listeners.push(ctx.listen("click",selectGroup));handles.listeners.push(ctx.listen("focus",selectGroup));handles.listeners.push(ctx.listen("keydown",function(ev){switch(ev.key){case"Enter":case"Tab":{var g=groupForPos(groups,node.selectionStart);if(updateValues(groups,g,node.selectionStart,true)){updateDisplay(groups,node)}var idx=groups.indexOf(g);if(ev.shiftKey&&idx>0){node.setSelectionRange(groups[idx-1].start,groups[idx-1].end);ev.preventDefault();ev.stopPropagation()}else if(!ev.shiftKey&&idx+1<groups.length){node.setSelectionRange(groups[idx+1].start,groups[idx+1].end);ev.preventDefault();ev.stopPropagation()}break}case"ArrowUp":case"ArrowDown":{var ref=[node.selectionStart,node.selectionEnd];var s=ref[0];var e=ref[1];var g$1=groupForPos(groups,s);if(g$1.value===null){g$1.value=1}bumpValue(g$1,ev.key==="ArrowDown");g$1.input=g$1.display=displayForGroup(g$1);applyValues(groups,sendValue,true);updateDisplay(groups,node);ev.preventDefault();ev.stopPropagation();node.setSelectionRange(s,e);break}}}));return{teardown:function teardown(){handles.observers.forEach(function(o){return o.cancel()});handles.listeners.forEach(function(o){return o.cancel()})}}}}}function readInput(groups,node,mask){var val=node.value;var pos=node.selectionStart;var active=groupForPos(groups,pos);var gidx=0;var group=groups[gidx];var next=groups[gidx+1];groups.forEach(function(g){return g.input=""});for(var i=0;i<val.length;i++){if(next&&val[i]===next.prefix[0]&&(active!==group||group.input.length>=group.length||val.length-i<mask.length-group.end+(group.length-group.input.length))){if(next.prefix.length>1){i+=next.prefix.length-1}if(val[i+1]===next.prefix[0]){i+=next.prefix.length}group=groups[++gidx];next=groups[gidx+1]}else{group.input+=val[i]}}}function updateValues(groups,target,pos,leave){if(pos===void 0)pos=0;if(leave===void 0)leave=false;var accepted=false;for(var i=0;i<groups.length;i++){var g=groups[i];var v=g.input.replace(nonDigits,"");var hasSep=groups[i+1]&&groups[i+1].prefix&&nonDisplay.test(g.input);if(v.length>g.length&&g===target){var drop=v.length-target.length;v=v.substr(0,pos-target.start)+v.substr(pos-target.start+drop)}else{v=v.substr(0,g.length)}g.input=v;if(v===""){g.value=null;g.display=displayForGroup(g)}else if(g!==target){g.value=+v;if(g.type==="M"){g.value--}g.display=displayForGroup(g)}else{if(g.type==="M"&&+v>1||g.type==="d"&&+v>3||g.type==="H"&&+v>2||(g.type==="m"||g.type==="s")&&+v>6){g.value=+v;if(g.type==="M"){g.value--}g.display=padl(v,g.length);accepted=true}else if(g.type==="y"&&v.length===2&&(hasSep||leave)){var n=(new Date).getFullYear();var cen=Math.floor(n/100)*100;var val=Math.abs(n-(cen+ +v))<20?cen+ +v:cen-100+ +v;g.value=val;g.input=g.display=padl(val,g.length);accepted=true}else{g.display=padr(v,g.length,blankChar);g.value=+v}}}return accepted}function receiveValue(groups,v){v=groups.value=v&&getDateValue(v);var parts=v?[v.getFullYear(),v.getMonth(),v.getDate(),v.getHours(),v.getMinutes(),v.getSeconds(),v.getMilliseconds()]:[null,null,null,null,null,null,null];groups.forEach(function(g){g.value=parts[map[g.type]];g.input=g.display=displayForGroup(g)})}function applyValues(groups,send,focused){var v=groups.value||origin;var parts=[v.getFullYear(),v.getMonth(),v.getDate(),v.getHours(),v.getMinutes(),v.getSeconds(),v.getMilliseconds()];groups.forEach(function(g){var vv=g.value;if(vv!==null&&g.type==="M"){if(vv<0){vv=0}else if(vv>11){vv=11}}else if(vv!==null&&(g.type==="m"||g.type==="s")){if(vv<0){vv=0}else if(vv>59){vv=59}}else if(vv!==null&&g.type==="H"){if(vv<0){vv=0}else if(vv>23){vv=23}}else if(vv!==null&&g.type==="h"){if(vv<1){vv=1}else if(vv>12){vv=12}}if(vv!==g.value){g.value=vv;g.display=displayForGroup(g)}parts[map[g.type]]=g.value});if(parts[0]!==null&&parts[1]!==null&&parts[2]!==null){var d=groups.find(function(g){return g.type==="d"});if(d){if(parts[2]<1){d.value=parts[2]=1;d.display=displayForGroup(d)}else{var last=lastDay(new Date(parts[0],parts[1],1));if(parts[2]>last){d.value=parts[2]=last;d.display=displayForGroup(d)}}}}if(groups.find(function(g){return g.value===null})||parts[0]===0||parts[1]>11||parts[1]<0||parts[2]===0){groups.value=null}else{parts.unshift(null);groups.value=new(Date.bind.apply(Date,parts))}send(focused)}function updateDisplay(groups,node){node.value=groups.reduce(function(a,c){return a+c.prefix+c.display},"")+groups.suffix}function groupForPos(groups,pos){return groups.find(function(g){return pos>=g.start&&pos<=g.end})}function displayForGroup(group){if(group.value===null){return padl("",group.length,blankChar)}switch(group.type){case"y":if(!group.value){return padl("",group.length,blankChar)}return group.length<=2?(""+group.value).substr(2,2):""+padl(group.value,group.length);case"M":if(!~group.value){return padl("",group.length,blankChar)}if(group.length===1){return""+(group.value+1)}else if(group.length===2){return(group.value<9?"0":"")+(group.value+1)}else if(group.length===3){return months[group.value].substr(0,3)}else{return months[group.value]}case"d":if(!group.value){return padl("",group.length,blankChar)}if(group.length===1){return""+group.value}else if(group.length===2){return(group.value<=9?"0":"")+group.value}else if(group.length===3){return days[group.groups.value.getDay()].substr(0,3)}else{return days[group.groups.value.getDay()]}case"H":case"h":case"m":case"s":if(group.length===1){return""+group.value}else{return padl(group.value,group.length)}case"S":if(group.length===1){return""+group.value}else{return padl(group.value,3)}}}var dateRE=/y+|M+|d+|E+|H+|m+|s+|S+|k+|a+/g;var months=["January","February","March","April","May","June","July","August","September","October","November","December"];var days=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var noop={teardown:function teardown(){}};function bumpValue(group,down){switch(group.type){case"y":group.value=group.value+(down?-1:1);break;case"M":group.value=down?group.value<1?11:group.value-1:group.value>10?0:group.value+1;break;case"d":{var groups=group.groups;var last=lastDay(new Date((groups.find(function(g){return g.type==="y"})||{value:1}).value,(groups.find(function(g){return g.type==="M"})||{value:1}).value),1);if(down){group.value=group.value<2?last:group.value-1}else{group.value=group.value+1>last?1:group.value+1}break}case"H":group.value=down?group.value<1?23:group.value-1:group.value>22?0:group.value+1;break;case"h":group.value=down?group.value<1?12:group.value-1:group.value>11?1:group.value+1;break;case"m":case"s":group.value=down?group.value<1?59:group.value-1:group.value>58?0:group.value+1;break;case"S":group.value=down?group.value<1?999:group.value-1:group.value>998?0:group.value+1;break}}function lastDay(date){return new Date(new Date(date.getFullYear(),date.getMonth()+1,1)-864e5).getDate()}var origin=new Date("0000-01-01T00:00:00");function getDateValue(thing){var v=thing;if(typeof v==="function"){v=thing()}if(typeof v==="string"){try{v=new Date(v)}catch(e){return defaultDate()}}if(v instanceof Date){return v}else{return origin}} | ||
var nonDigits=/[^\d]+/;var nonDisplay=/[^\d_]+/;var blankChar="_";var map={y:0,M:1,d:2,H:3,m:4,s:5,S:6};export function padl(str,total,char){if(char===void 0)char="0";var v=str==null?"":""+str;for(var i=v.length;i<total;i++){v=char+v}return v}export function padr(str,total,char){if(char===void 0)char="0";var v=str==null?"":""+str;for(var i=v.length;i<total;i++){v+=char}return v}export var defaults={mask:"yyyy-MM-dd",time:"00:00:00.000",date:function date(){var now=new Date;return new Date(now.getFullYear()+"-"+padl(now.getMonth()+1,2)+"-"+padl(now.getDate(),2)+"T"+defaults.time)}};export default function plugin(options){if(options===void 0)options={};var defaultMask=options.mask||defaults.mask;var defaultTime=options.time||defaults.time;var defaultDate=options.date||defaults.date;if(typeof defaultDate!=="function"){var dt=defaultDate;defaultDate=function(){return dt}}return function(ref){var instance=ref.instance;instance.decorators[options.name||"date"]=function(node,optsin,other){if(optsin===void 0)optsin={};var opts=Object.assign({},options,typeof optsin==="string"?{value:optsin}:0,typeof other==="string"?{mask:other}:0,typeof optsin==="object"?optsin:0);var ctx=this.getContext(node);var mask=opts.mask||defaultMask;var handles={observers:[],listeners:[]};if(node.tagName!=="INPUT"){console.warn("Attempted to add a date decorator a "+node.tagName);return noop}if(!mask){return noop}var groups=[];var match,last=0;while(match=dateRE.exec(mask)){var group={mask:match[0],type:match[0][0],length:match[0].length,start:match.index,end:match.index+match[0].length,chunk:groups.length,prefix:mask.substring(last,match.index),groups:groups,value:null,display:padr("",match[0].length,blankChar)};last=group.end;groups.push(group)}groups.suffix=mask.substring(groups[groups.length-1].end);groups.last=null;if(groups.slice(1).find(function(g){return!g.prefix})){console.warn("Attempted to add a date decorator missing interstitial between fields '"+mask+"'");return noop}if(typeof opts.value==="string"){handles.observers.push(ctx.observe(opts.value,function(v){if(!v&&opts.null===false){v=defaultDate()}groups.value=v;receiveValue(groups,v);groups.last=v;updateDisplay(groups,node)},{defer:true}))}else{if(opts.date||opts.null===false){groups.value=getDateValue(opts.date||defaultDate())}updateDisplay(groups,node)}function sendValue(focused){if(groups.value===null&&groups.last===null||+groups.value===+groups.last){return 1}if(focused&&opts.lazy!==false){return}if(opts.null===false&&groups.value===null){return receiveValue(groups,groups.last)&&1||1}groups.last=groups.value;if(typeof opts.value==="string"){handles.observers.forEach(function(h){return h.silence()});ctx.set(opts.value,groups.value);handles.observers.forEach(function(h){return h.resume()})}}handles.listeners.push(ctx.listen("input",function(){var pos=node.selectionStart;var start=node.value;readInput(groups,node,mask);var active=groupForPos(groups,pos);var accepted=updateValues(groups,active,pos);applyValues(groups,sendValue,true);updateDisplay(groups,node);if(active&&(start.length>=mask.length&&pos===active.end||accepted)&&active!==groups[groups.length-1]){var next=groups[groups.indexOf(active)+1];node.setSelectionRange(next.start,next.end)}else{node.setSelectionRange(pos,pos)}}));handles.listeners.push(ctx.listen("blur",function(){if(sendValue(false)){receiveValue(groups,groups.value)}updateDisplay(groups,node)}));var selectGroup=function(){var group=groupForPos(groups,node.selectionStart);document.activeElement===node&&node.setSelectionRange(group.start,group.end)};handles.listeners.push(ctx.listen("click",selectGroup));handles.listeners.push(ctx.listen("focus",selectGroup));handles.listeners.push(ctx.listen("keydown",function(ev){switch(ev.key){case"Enter":case"Tab":{var g=groupForPos(groups,node.selectionStart);var idx=groups.indexOf(g);if(updateValues(groups,g,node.selectionStart,true)){updateDisplay(groups,node);applyValues(groups,sendValue,ev.shiftKey&&idx>0||!ev.shiftKey&&idx+1<groups.length)}if(ev.shiftKey&&idx>0){node.setSelectionRange(groups[idx-1].start,groups[idx-1].end);ev.preventDefault();ev.stopPropagation()}else if(!ev.shiftKey&&idx+1<groups.length){node.setSelectionRange(groups[idx+1].start,groups[idx+1].end);ev.preventDefault();ev.stopPropagation()}break}case"ArrowUp":case"ArrowDown":{var ref=[node.selectionStart,node.selectionEnd];var s=ref[0];var e=ref[1];var g$1=groupForPos(groups,s);if(g$1.value===null){g$1.value=1}bumpValue(g$1,ev.key==="ArrowDown");g$1.input=g$1.display=displayForGroup(g$1);applyValues(groups,sendValue,true);updateDisplay(groups,node);ev.preventDefault();ev.stopPropagation();node.setSelectionRange(s,e);break}}}));return{teardown:function teardown(){handles.observers.forEach(function(o){return o.cancel()});handles.listeners.forEach(function(o){return o.cancel()})}}}}}function readInput(groups,node,mask){var val=node.value;var pos=node.selectionStart;var active=groupForPos(groups,pos);var gidx=0;var group=groups[gidx];var next=groups[gidx+1];groups.forEach(function(g){return g.input=""});for(var i=0;i<val.length;i++){if(next&&val[i]===next.prefix[0]&&(active!==group||group.input.length>=group.length||val.length-i<mask.length-group.end+(group.length-group.input.length))){if(next.prefix.length>1){i+=next.prefix.length-1}if(val[i+1]===next.prefix[0]){i+=next.prefix.length}group=groups[++gidx];next=groups[gidx+1]}else{group.input+=val[i]}}}function updateValues(groups,target,pos,leave){if(pos===void 0)pos=0;if(leave===void 0)leave=false;var accepted=false;for(var i=0;i<groups.length;i++){var g=groups[i];var v=g.input.replace(nonDigits,"");var hasSep=groups[i+1]&&groups[i+1].prefix&&nonDisplay.test(g.input);if(v.length>g.length&&g===target){var drop=v.length-target.length;v=v.substr(0,pos-target.start)+v.substr(pos-target.start+drop)}else{v=v.substr(0,g.length)}g.input=v;if(v===""){g.value=null;g.display=displayForGroup(g)}else if(g!==target){g.value=+v;if(g.type==="M"){g.value--}g.display=displayForGroup(g)}else{if(g.type==="M"&&+v>1||g.type==="d"&&+v>3||g.type==="H"&&+v>2||(g.type==="m"||g.type==="s")&&+v>6){g.value=+v;if(g.type==="M"){g.value--}g.display=padl(v,g.length);accepted=true}else if(g.type==="y"&&v.length===2&&(hasSep||leave)){var n=(new Date).getFullYear();var cen=Math.floor(n/100)*100;var val=Math.abs(n-(cen+ +v))<20?cen+ +v:cen-100+ +v;g.value=val;g.input=g.display=padl(val,g.length);accepted=true}else{g.display=padr(v,g.length,blankChar);g.value=+v}}}return accepted}function receiveValue(groups,v){v=groups.value=v&&getDateValue(v);var parts=v?[v.getFullYear(),v.getMonth(),v.getDate(),v.getHours(),v.getMinutes(),v.getSeconds(),v.getMilliseconds()]:[null,null,null,null,null,null,null];groups.forEach(function(g){g.value=parts[map[g.type]];g.input=g.display=displayForGroup(g)})}function applyValues(groups,send,focused){var v=groups.value||origin;var parts=[v.getFullYear(),v.getMonth(),v.getDate(),v.getHours(),v.getMinutes(),v.getSeconds(),v.getMilliseconds()];groups.forEach(function(g){var vv=g.value;if(vv!==null&&g.type==="M"){if(vv<0){vv=0}else if(vv>11){vv=11}}else if(vv!==null&&(g.type==="m"||g.type==="s")){if(vv<0){vv=0}else if(vv>59){vv=59}}else if(vv!==null&&g.type==="H"){if(vv<0){vv=0}else if(vv>23){vv=23}}else if(vv!==null&&g.type==="h"){if(vv<1){vv=1}else if(vv>12){vv=12}}if(vv!==g.value){g.value=vv;g.display=displayForGroup(g)}parts[map[g.type]]=g.value});if(parts[0]!==null&&parts[1]!==null&&parts[2]!==null){var d=groups.find(function(g){return g.type==="d"});if(d){if(parts[2]<1){d.value=parts[2]=1;d.display=displayForGroup(d)}else{var last=lastDay(new Date(parts[0],parts[1],1));if(parts[2]>last){d.value=parts[2]=last;d.display=displayForGroup(d)}}}}if(groups.find(function(g){return g.value===null})||parts[0]===0||parts[1]>11||parts[1]<0||parts[2]===0){groups.value=null}else{parts.unshift(null);groups.value=new(Date.bind.apply(Date,parts))}send(focused)}function updateDisplay(groups,node){node.value=groups.reduce(function(a,c){return a+c.prefix+c.display},"")+groups.suffix}function groupForPos(groups,pos){return groups.find(function(g){return pos>=g.start&&pos<=g.end})}function displayForGroup(group){if(group.value===null){return padl("",group.length,blankChar)}switch(group.type){case"y":if(!group.value){return padl("",group.length,blankChar)}return group.length<=2?(""+group.value).substr(2,2):""+padl(group.value,group.length);case"M":if(!~group.value){return padl("",group.length,blankChar)}if(group.length===1){return""+(group.value+1)}else if(group.length===2){return(group.value<9?"0":"")+(group.value+1)}else if(group.length===3){return months[group.value].substr(0,3)}else{return months[group.value]}case"d":if(!group.value){return padl("",group.length,blankChar)}if(group.length===1){return""+group.value}else if(group.length===2){return(group.value<=9?"0":"")+group.value}else if(group.length===3){return days[group.groups.value.getDay()].substr(0,3)}else{return days[group.groups.value.getDay()]}case"H":case"h":case"m":case"s":if(group.length===1){return""+group.value}else{return padl(group.value,group.length)}case"S":if(group.length===1){return""+group.value}else{return padl(group.value,3)}}}var dateRE=/y+|M+|d+|E+|H+|m+|s+|S+|k+|a+/g;var months=["January","February","March","April","May","June","July","August","September","October","November","December"];var days=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var noop={teardown:function teardown(){}};function bumpValue(group,down){switch(group.type){case"y":group.value=group.value+(down?-1:1);break;case"M":group.value=down?group.value<1?11:group.value-1:group.value>10?0:group.value+1;break;case"d":{var groups=group.groups;var last=lastDay(new Date((groups.find(function(g){return g.type==="y"})||{value:1}).value,(groups.find(function(g){return g.type==="M"})||{value:1}).value),1);if(down){group.value=group.value<2?last:group.value-1}else{group.value=group.value+1>last?1:group.value+1}break}case"H":group.value=down?group.value<1?23:group.value-1:group.value>22?0:group.value+1;break;case"h":group.value=down?group.value<1?12:group.value-1:group.value>11?1:group.value+1;break;case"m":case"s":group.value=down?group.value<1?59:group.value-1:group.value>58?0:group.value+1;break;case"S":group.value=down?group.value<1?999:group.value-1:group.value>998?0:group.value+1;break}}function lastDay(date){return new Date(new Date(date.getFullYear(),date.getMonth()+1,1)-864e5).getDate()}var origin=new Date("0000-01-01T00:00:00");function getDateValue(thing){var v=thing;if(typeof v==="function"){v=thing()}if(typeof v==="string"){try{v=new Date(v)}catch(e){return defaultDate()}}if(v instanceof Date){return v}else{return origin}} |
@@ -36,2 +36,3 @@ import Ractive from 'ractive'; | ||
if (!(dt instanceof Date)) { return {}; } | ||
if (isNaN(dt)) { dt = new Date(); } | ||
@@ -38,0 +39,0 @@ if (offset) { dt = new Date(dt.getFullYear(), dt.getMonth() + offset, dt.getDate()); } |
@@ -1,1 +0,1 @@ | ||
import Ractive from"ractive";var template={v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal",g:1}],f:[{t:4,f:[{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"left",x:{x:{r:["@index"],s:"_0===0"}}},{n:"right",x:{x:{r:["@last","@index"],s:"_0===_1"}}}]}],n:52,z:[{n:"offset",x:{r:"."}}],r:"~/padding"}],n:50,r:"~/padding"},{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"offset",x:{x:{r:[],s:"0"}}},{n:"left",x:{x:{r:[],s:"true"}}},{n:"right",x:{x:{r:[],s:"true"}}}]}],n:51,l:1}]}],e:{0:function(){return 0},"_0===0":function(_0){return _0===0},"_0===_1":function(_0,_1){return _0===_1},true:function(){return true},"[_0.prev(),false]":function(_0){return[_0.prev(),false]},'[_0.set("mode","month"),false]':function(_0){return[_0.set("mode","month"),false]},"[_0.next(),false]":function(_0){return[_0.next(),false]},"_1>_0||_1<_2":function(_0,_1,_2){return _1>_0||_1<_2},"_0.isCurrent(_1)":function(_0,_1){return _0.isCurrent(_1)},"[_0.select(_1),false]":function(_0,_1){return[_0.select(_1),false]},"_0.decade(_1,_2)":function(_0,_1,_2){return _0.decade(_1,_2)},'[_0.set("mode","year"),false]':function(_0){return[_0.set("mode","year"),false]},"_0.shortMonthName(_1)":function(_0,_1){return _0.shortMonthName(_1)},"_0.year(_1,_2)":function(_0,_1,_2){return _0.year(_1,_2)},'[_0.set("mode","months"),false]':function(_0){return[_0.set("mode","months"),false]},"_0.monthName(_1)":function(_0,_1){return _0.monthName(_1)},"_0!==_1":function(_0,_1){return _0!==_1},"[_0.select(_1)]":function(_0,_1){return[_0.select(_1)]},"_0.month(_1,_2)":function(_0,_1,_2){return _0.month(_1,_2)}},p:{year:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","month"),false]'}}],f:[{t:2,r:".start"}," - ",{t:2,r:".end"}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-decade",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:["year.end",".y","year.start"],s:"_1>_0||_1<_2"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1),false]"}}],f:[{t:2,r:".y"}]}],n:52,r:"."}]}],n:52,r:".years"}]}],n:54,z:[{n:"year",x:{r:"."}}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.decade(_1,_2)"}}],months:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","year"),false]'}}],f:[{t:2,r:".year"}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-year",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1),false]"}}],f:[{t:2,x:{r:["@this",".m"],s:"_0.shortMonthName(_1)"}}]}],n:52,r:"."}]}],n:52,r:".months"}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.year(_1,_2)"}}],month:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1},{n:"class-rcal-pad",t:13,f:[{t:2,r:"~/pad"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","months"),false]'}}],f:[{t:2,x:{r:["@this",".month"],s:"_0.monthName(_1)"}},{t:4,f:[", ",{t:2,r:".year"}],n:50,x:{r:[".currentYear",".year"],s:"_0!==_1"}}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-month",g:1}],f:[{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week rcal-week-header",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day rcal-day-header",g:1}],f:[{t:2,r:"."}]}],n:52,r:".days"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:[".m","month.month"],s:"_0!==_1"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1)]"}}],f:[{t:2,r:".d"}]}],n:52,r:"."}]}],n:52,r:".weeks"}],n:54,z:[{n:"month",x:{r:"."}}]}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.month(_1,_2)"}}]}};var ref=function(){try{var lang=navigator.language||navigator.browserLanguage||navigator.languages[0]||"en";return[[0,1,2,3,4,5,6,7,8,9,10,11].map(function(m){return new Date(2006,m,1).toLocaleString(lang,{month:"long"})}),[1,2,3,4,5,6,7].map(function(d){return new Date(2006,0,d).toLocaleString(lang,{weekday:"long"})})]}catch(e){return[["January","February","March","April","May","June","July","August","September","October","November","December"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]]}}();var months=ref[0];var weekdays=ref[1];var _days=weekdays.map(function(d){return d[0]}).concat(weekdays.map(function(d){return d[0].toUpperCase()}));var shortMonths=months.map(function(m){return m.substr(0,3)});export var DatePicker=function(Ractive){function DatePicker(opts){Ractive.call(this,opts)}if(Ractive)DatePicker.__proto__=Ractive;DatePicker.prototype=Object.create(Ractive&&Ractive.prototype);DatePicker.prototype.constructor=DatePicker;DatePicker.prototype.month=function month(date,offset){if(offset===void 0)offset=0;var dt=date||new Date;if(!(dt instanceof Date)){return{}}if(offset){dt=new Date(dt.getFullYear(),dt.getMonth()+offset,dt.getDate())}var first;try{first=+this.get("firstDay")}catch(e){}if(typeof first!=="number"||isNaN(first)){first=0}if(first>6){first=0}var prev=new Date(dt.getFullYear(),dt.getMonth(),0);var last=new Date(dt.getFullYear(),dt.getMonth()+1,0).getDate();var next=new Date(dt.getFullYear(),dt.getMonth()+1,1);var start=new Date(dt.getFullYear(),dt.getMonth(),1).getDay();var res=[];var st=res[0]=[];for(var i=0;i<7;i++){res[0].unshift({y:prev.getFullYear(),m:prev.getMonth(),d:prev.getDate()-i});res[0].push({y:dt.getFullYear(),m:dt.getMonth(),d:i+1})}if(first<=start){res[0]=res[0].slice(7-(start-first),14-(start-first))}else{res[0]=res[0].slice(first-start,7+first-start)}if(res[0][0].d===1){res.unshift(st.slice(0,7))}var d=res[res.length-1][res[res.length-1].length-1].d;for(var i$1=res.length;i$1<5;i$1++){res[i$1]=[];for(var j=0;j<7&&d+1<=last;j++){res[i$1].push({y:dt.getFullYear(),m:dt.getMonth(),d:++d})}if(res[i$1].length<7){var offset$1=7-res[i$1].length;for(var j$1=1;j$1<=offset$1;j$1++){res[i$1].push({y:next.getFullYear(),m:next.getMonth(),d:j$1})}res[i$1+1]=[];for(var j$2=0,k=offset$1+1;j$2<7;j$2++,k++){res[i$1+1].push({y:next.getFullYear(),m:next.getMonth(),d:k})}}}if(!res[5]){res[5]=[];while(d<last){res[5].push({y:dt.getFullYear(),m:dt.getMonth(),d:++d})}for(var i$2=1;i$2<8;i$2++){res[5].push({y:next.getFullYear(),m:next.getMonth(),d:i$2})}res[5]=res[5].slice(0,7)}var obj={days:_days.slice(first,first+7),weeks:res,year:dt.getFullYear(),month:dt.getMonth(),currentYear:(new Date).getFullYear()};return obj};DatePicker.prototype.year=function year(date,offset){if(offset===void 0)offset=0;var dt=date||new Date;if(!(dt instanceof Date)){return{}}if(offset){dt=new Date(dt.getFullYear()+offset,dt.getMonth(),dt.getDate())}var res=[];for(var i=0;i<4;i++){res.push([]);for(var j=0;j<3;j++){res[i].push({m:i*3+j,y:dt.getFullYear()})}}return{year:dt.getFullYear(),months:res}};DatePicker.prototype.decade=function decade(date,offset){if(offset===void 0)offset=0;var dt=date||new Date;if(!(dt instanceof Date)){return{}}if(offset){dt=new Date(dt.getFullYear()+offset*10,dt.getMonth(),dt.getDate())}var start=Math.floor(dt.getFullYear()/10)*10;var first=start-1;var res=[];for(var i=0;i<4;i++){res.push([]);for(var j=0;j<3;j++){res[i].push({y:first+i*3+j})}}return{start:start,end:start+9,years:res}};DatePicker.prototype.monthName=function monthName(num){return months[num]};DatePicker.prototype.shortMonthName=function shortMonthName(num){return shortMonths[num]};DatePicker.prototype.dayName=function dayName(num){return weekdays[num]};DatePicker.prototype.select=function select(dt){if(dt&&dt instanceof Date){this.set("current",dt)}else{var current=this.get("safeCurrent");if(dt){this.set("current",new Date(dt.y||current.getFullYear(),typeof dt.m==="number"?dt.m:current.getMonth(),dt.d||current.getDate()))}var mode=this.get("mode");if(mode==="year"){this.set("mode","months")}else if(mode==="months"){this.set("mode","month")}this.set("target",this.get("current"))}};DatePicker.prototype.isCurrent=function isCurrent(dt){var current=this.get("safeCurrent");if(!current){return false}return dt&&dt.y===current.getFullYear()&&(dt.m==null||dt.m===current.getMonth())&&(dt.d==null||dt.d===current.getDate())};DatePicker.prototype.next=function next(){var target=this.get("safeTarget");var mode=this.get("mode");if(mode==="month"){this.set("target",new Date(target.getFullYear(),target.getMonth()+1,1))}if(mode==="months"){this.set("target",new Date(target.getFullYear()+1,target.getMonth(),1))}if(mode==="year"){this.set("target",new Date(target.getFullYear()+10,target.getMonth(),1))}};DatePicker.prototype.prev=function prev(){var target=this.get("safeTarget");var mode=this.get("mode");if(mode==="month"){this.set("target",new Date(target.getFullYear(),target.getMonth()-1,1))}if(mode==="months"){this.set("target",new Date(target.getFullYear()-1,target.getMonth(),1))}if(mode==="year"){this.set("target",new Date(target.getFullYear()-10,target.getMonth(),1))}};DatePicker.prototype.today=function today(){this.set("current",new Date);this.set("target",this.get("current"))};return DatePicker}(Ractive);Ractive.extendWith(DatePicker,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal",g:1}],f:[{t:4,f:[{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"left",x:{x:{r:["@index"],s:"_0===0"}}},{n:"right",x:{x:{r:["@last","@index"],s:"_0===_1"}}}]}],n:52,z:[{n:"offset",x:{r:"."}}],r:"~/padding"}],n:50,r:"~/padding"},{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"offset",x:{x:{r:[],s:"0"}}},{n:"left",x:{x:{r:[],s:"true"}}},{n:"right",x:{x:{r:[],s:"true"}}}]}],n:51,l:1}]}],e:{0:function(){return 0},"_0===0":function(_0){return _0===0},"_0===_1":function(_0,_1){return _0===_1},true:function(){return true},"[_0.prev(),false]":function(_0){return[_0.prev(),false]},'[_0.set("mode","month"),false]':function(_0){return[_0.set("mode","month"),false]},"[_0.next(),false]":function(_0){return[_0.next(),false]},"_1>_0||_1<_2":function(_0,_1,_2){return _1>_0||_1<_2},"_0.isCurrent(_1)":function(_0,_1){return _0.isCurrent(_1)},"[_0.select(_1),false]":function(_0,_1){return[_0.select(_1),false]},"_0.decade(_1,_2)":function(_0,_1,_2){return _0.decade(_1,_2)},'[_0.set("mode","year"),false]':function(_0){return[_0.set("mode","year"),false]},"_0.shortMonthName(_1)":function(_0,_1){return _0.shortMonthName(_1)},"_0.year(_1,_2)":function(_0,_1,_2){return _0.year(_1,_2)},'[_0.set("mode","months"),false]':function(_0){return[_0.set("mode","months"),false]},"_0.monthName(_1)":function(_0,_1){return _0.monthName(_1)},"_0!==_1":function(_0,_1){return _0!==_1},"[_0.select(_1)]":function(_0,_1){return[_0.select(_1)]},"_0.month(_1,_2)":function(_0,_1,_2){return _0.month(_1,_2)}},p:{year:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","month"),false]'}}],f:[{t:2,r:".start"}," - ",{t:2,r:".end"}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-decade",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:["year.end",".y","year.start"],s:"_1>_0||_1<_2"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1),false]"}}],f:[{t:2,r:".y"}]}],n:52,r:"."}]}],n:52,r:".years"}]}],n:54,z:[{n:"year",x:{r:"."}}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.decade(_1,_2)"}}],months:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","year"),false]'}}],f:[{t:2,r:".year"}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-year",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1),false]"}}],f:[{t:2,x:{r:["@this",".m"],s:"_0.shortMonthName(_1)"}}]}],n:52,r:"."}]}],n:52,r:".months"}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.year(_1,_2)"}}],month:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1},{n:"class-rcal-pad",t:13,f:[{t:2,r:"~/pad"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","months"),false]'}}],f:[{t:2,x:{r:["@this",".month"],s:"_0.monthName(_1)"}},{t:4,f:[", ",{t:2,r:".year"}],n:50,x:{r:[".currentYear",".year"],s:"_0!==_1"}}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-month",g:1}],f:[{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week rcal-week-header",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day rcal-day-header",g:1}],f:[{t:2,r:"."}]}],n:52,r:".days"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:[".m","month.month"],s:"_0!==_1"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1)]"}}],f:[{t:2,r:".d"}]}],n:52,r:"."}]}],n:52,r:".weeks"}],n:54,z:[{n:"month",x:{r:"."}}]}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.month(_1,_2)"}}]}},css:function(data){return[function(data){return".rcal-wrapper {\n display: inline-block;\n }\n \n .rcal-pad {\n padding: 0.5em;\n }\n \n .rcal-block-outer {\n border: 1px solid "+(data("raui.datePicker.primary.bga")||data("raui.primary.bga")||"#f4f4f4")+";\n }\n \n .rcal-block-header {\n text-align: center;\n background-color: "+(data("raui.datePicker.primary.fga")||data("raui.primary.fga")||"#07e")+";\n color: "+(data("raui.datePicker.primary.bg")||data("raui.primary.bg")||"#fff")+";\n cursor: default;\n display: flex;\n justify-content: space-between;\n padding: 0 0.5em;\n line-height: 1em;\n height: 1.5em;\n align-items: center;\n }\n \n .rcal-click {\n cursor: pointer;\n }\n \n .rcal-left, .rcal-right {\n height: 0.8em;\n display: inline-block;\n box-sizing: border-box;\n border: 0.4em solid transparent;\n cursor: pointer;\n }\n .rcal-left {\n border-right-color: "+(data("raui.datePicker.primary.bg")||data("raui.primary.bg")||"#fff")+";\n }\n .rcal-right {\n border-left-color: "+(data("raui.datePicker.primary.bg")||data("raui.primary.bg")||"#fff")+";\n }\n \n .rcal-month, .rcal-year, .rcal-decade {\n display: flex;\n flex-direction: column;\n background-color: "+(data("raui.datePicker.primary.bga")||data("raui.primary.bga")||"#f4f4f4")+";\n width: calc(10.5em + 6px);\n height: calc(10.5em + 6px);\n justify-content: space-between;\n }\n .rcal-year, .rcal-decade {\n justify-content: space-around;\n }\n \n .rcal-week {\n height: 1.5em;\n display: flex;\n justify-content: space-between;\n width: calc(10.5em + 6px);\n }\n \n .rcal-inner-row {\n height: 2em;\n display: flex;\n justify-content: space-around;\n width: calc(10.5em + 6px);\n }\n \n .rcal-inner-pick {\n background-color: "+(data("raui.datePicker.primary.bg")||data("raui.primary.bg")||"#fff")+";\n width: 3em;\n height: 2em;\n line-height: 2em;\n text-align: center;\n cursor: pointer;\n }\n \n .rcal-week-header {\n background-color: "+(data("raui.datePicker.primary.fga")||data("raui.primary.fga")||"#07e")+";\n }\n \n .rcal-day {\n background-color: "+(data("raui.datePicker.primary.bg")||data("raui.primary.bg")||"#fff")+";\n width: 1.5em;\n height: 1.5em;\n text-align: center;\n line-height: 1.5em;\n cursor: pointer;\n }\n \n .rcal-day-header {\n color: "+(data("raui.datePicker.primary.bg")||data("raui.primary.bg")||"#fff")+";\n background-color: "+(data("raui.datePicker.primary.fga")||data("raui.primary.fga")||"#07e")+";\n cursor: default;\n }\n \n .rcal-off-day {\n background-color: "+(data("raui.datePicker.primary.bc")||data("raui.primary.bc")||"#ccc")+";\n }\n \n .rcal-current {\n color: "+(data("raui.datePicker.primary.bg")||data("raui.primary.bg")||"#fff")+";\n background-color: "+(data("raui.datePicker.primary.fg")||data("raui.primary.fg")||"#222")+";\n }\n "}.call(this,data)].join(" ")},noCssTransform:true,data:function data(){return{mode:"month",target:new Date}},computed:{safeCurrent:function safeCurrent(){var current=this.get("current");if(typeof current==="string"){try{current=new Date(current)}catch(e){}}if(!(current instanceof Date)){current=new Date}return current},safeTarget:function safeTarget(){var target=this.get("target");if(!target){target=this.get("current")}if(typeof target==="string"){try{target=new Date(target)}catch(e){}}if(!(target instanceof Date)){return new Date}return target}}});export default function plugin(opts){if(opts===void 0)opts={};return function(ref){var instance=ref.instance;instance.components[opts.name||"date-picker"]=DatePicker}} | ||
import Ractive from"ractive";var template={v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal",g:1}],f:[{t:4,f:[{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"left",x:{x:{r:["@index"],s:"_0===0"}}},{n:"right",x:{x:{r:["@last","@index"],s:"_0===_1"}}}]}],n:52,z:[{n:"offset",x:{r:"."}}],r:"~/padding"}],n:50,r:"~/padding"},{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"offset",x:{x:{r:[],s:"0"}}},{n:"left",x:{x:{r:[],s:"true"}}},{n:"right",x:{x:{r:[],s:"true"}}}]}],n:51,l:1}]}],e:{0:function(){return 0},"_0===0":function(_0){return _0===0},"_0===_1":function(_0,_1){return _0===_1},true:function(){return true},"[_0.prev(),false]":function(_0){return[_0.prev(),false]},'[_0.set("mode","month"),false]':function(_0){return[_0.set("mode","month"),false]},"[_0.next(),false]":function(_0){return[_0.next(),false]},"_1>_0||_1<_2":function(_0,_1,_2){return _1>_0||_1<_2},"_0.isCurrent(_1)":function(_0,_1){return _0.isCurrent(_1)},"[_0.select(_1),false]":function(_0,_1){return[_0.select(_1),false]},"_0.decade(_1,_2)":function(_0,_1,_2){return _0.decade(_1,_2)},'[_0.set("mode","year"),false]':function(_0){return[_0.set("mode","year"),false]},"_0.shortMonthName(_1)":function(_0,_1){return _0.shortMonthName(_1)},"_0.year(_1,_2)":function(_0,_1,_2){return _0.year(_1,_2)},'[_0.set("mode","months"),false]':function(_0){return[_0.set("mode","months"),false]},"_0.monthName(_1)":function(_0,_1){return _0.monthName(_1)},"_0!==_1":function(_0,_1){return _0!==_1},"[_0.select(_1)]":function(_0,_1){return[_0.select(_1)]},"_0.month(_1,_2)":function(_0,_1,_2){return _0.month(_1,_2)}},p:{year:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","month"),false]'}}],f:[{t:2,r:".start"}," - ",{t:2,r:".end"}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-decade",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:["year.end",".y","year.start"],s:"_1>_0||_1<_2"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1),false]"}}],f:[{t:2,r:".y"}]}],n:52,r:"."}]}],n:52,r:".years"}]}],n:54,z:[{n:"year",x:{r:"."}}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.decade(_1,_2)"}}],months:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","year"),false]'}}],f:[{t:2,r:".year"}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-year",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1),false]"}}],f:[{t:2,x:{r:["@this",".m"],s:"_0.shortMonthName(_1)"}}]}],n:52,r:"."}]}],n:52,r:".months"}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.year(_1,_2)"}}],month:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1},{n:"class-rcal-pad",t:13,f:[{t:2,r:"~/pad"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","months"),false]'}}],f:[{t:2,x:{r:["@this",".month"],s:"_0.monthName(_1)"}},{t:4,f:[", ",{t:2,r:".year"}],n:50,x:{r:[".currentYear",".year"],s:"_0!==_1"}}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-month",g:1}],f:[{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week rcal-week-header",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day rcal-day-header",g:1}],f:[{t:2,r:"."}]}],n:52,r:".days"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:[".m","month.month"],s:"_0!==_1"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1)]"}}],f:[{t:2,r:".d"}]}],n:52,r:"."}]}],n:52,r:".weeks"}],n:54,z:[{n:"month",x:{r:"."}}]}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.month(_1,_2)"}}]}};var ref=function(){try{var lang=navigator.language||navigator.browserLanguage||navigator.languages[0]||"en";return[[0,1,2,3,4,5,6,7,8,9,10,11].map(function(m){return new Date(2006,m,1).toLocaleString(lang,{month:"long"})}),[1,2,3,4,5,6,7].map(function(d){return new Date(2006,0,d).toLocaleString(lang,{weekday:"long"})})]}catch(e){return[["January","February","March","April","May","June","July","August","September","October","November","December"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]]}}();var months=ref[0];var weekdays=ref[1];var _days=weekdays.map(function(d){return d[0]}).concat(weekdays.map(function(d){return d[0].toUpperCase()}));var shortMonths=months.map(function(m){return m.substr(0,3)});export var DatePicker=function(Ractive){function DatePicker(opts){Ractive.call(this,opts)}if(Ractive)DatePicker.__proto__=Ractive;DatePicker.prototype=Object.create(Ractive&&Ractive.prototype);DatePicker.prototype.constructor=DatePicker;DatePicker.prototype.month=function month(date,offset){if(offset===void 0)offset=0;var dt=date||new Date;if(!(dt instanceof Date)){return{}}if(isNaN(dt)){dt=new Date}if(offset){dt=new Date(dt.getFullYear(),dt.getMonth()+offset,dt.getDate())}var first;try{first=+this.get("firstDay")}catch(e){}if(typeof first!=="number"||isNaN(first)){first=0}if(first>6){first=0}var prev=new Date(dt.getFullYear(),dt.getMonth(),0);var last=new Date(dt.getFullYear(),dt.getMonth()+1,0).getDate();var next=new Date(dt.getFullYear(),dt.getMonth()+1,1);var start=new Date(dt.getFullYear(),dt.getMonth(),1).getDay();var res=[];var st=res[0]=[];for(var i=0;i<7;i++){res[0].unshift({y:prev.getFullYear(),m:prev.getMonth(),d:prev.getDate()-i});res[0].push({y:dt.getFullYear(),m:dt.getMonth(),d:i+1})}if(first<=start){res[0]=res[0].slice(7-(start-first),14-(start-first))}else{res[0]=res[0].slice(first-start,7+first-start)}if(res[0][0].d===1){res.unshift(st.slice(0,7))}var d=res[res.length-1][res[res.length-1].length-1].d;for(var i$1=res.length;i$1<5;i$1++){res[i$1]=[];for(var j=0;j<7&&d+1<=last;j++){res[i$1].push({y:dt.getFullYear(),m:dt.getMonth(),d:++d})}if(res[i$1].length<7){var offset$1=7-res[i$1].length;for(var j$1=1;j$1<=offset$1;j$1++){res[i$1].push({y:next.getFullYear(),m:next.getMonth(),d:j$1})}res[i$1+1]=[];for(var j$2=0,k=offset$1+1;j$2<7;j$2++,k++){res[i$1+1].push({y:next.getFullYear(),m:next.getMonth(),d:k})}}}if(!res[5]){res[5]=[];while(d<last){res[5].push({y:dt.getFullYear(),m:dt.getMonth(),d:++d})}for(var i$2=1;i$2<8;i$2++){res[5].push({y:next.getFullYear(),m:next.getMonth(),d:i$2})}res[5]=res[5].slice(0,7)}var obj={days:_days.slice(first,first+7),weeks:res,year:dt.getFullYear(),month:dt.getMonth(),currentYear:(new Date).getFullYear()};return obj};DatePicker.prototype.year=function year(date,offset){if(offset===void 0)offset=0;var dt=date||new Date;if(!(dt instanceof Date)){return{}}if(offset){dt=new Date(dt.getFullYear()+offset,dt.getMonth(),dt.getDate())}var res=[];for(var i=0;i<4;i++){res.push([]);for(var j=0;j<3;j++){res[i].push({m:i*3+j,y:dt.getFullYear()})}}return{year:dt.getFullYear(),months:res}};DatePicker.prototype.decade=function decade(date,offset){if(offset===void 0)offset=0;var dt=date||new Date;if(!(dt instanceof Date)){return{}}if(offset){dt=new Date(dt.getFullYear()+offset*10,dt.getMonth(),dt.getDate())}var start=Math.floor(dt.getFullYear()/10)*10;var first=start-1;var res=[];for(var i=0;i<4;i++){res.push([]);for(var j=0;j<3;j++){res[i].push({y:first+i*3+j})}}return{start:start,end:start+9,years:res}};DatePicker.prototype.monthName=function monthName(num){return months[num]};DatePicker.prototype.shortMonthName=function shortMonthName(num){return shortMonths[num]};DatePicker.prototype.dayName=function dayName(num){return weekdays[num]};DatePicker.prototype.select=function select(dt){if(dt&&dt instanceof Date){this.set("current",dt)}else{var current=this.get("safeCurrent");if(dt){this.set("current",new Date(dt.y||current.getFullYear(),typeof dt.m==="number"?dt.m:current.getMonth(),dt.d||current.getDate()))}var mode=this.get("mode");if(mode==="year"){this.set("mode","months")}else if(mode==="months"){this.set("mode","month")}this.set("target",this.get("current"))}};DatePicker.prototype.isCurrent=function isCurrent(dt){var current=this.get("safeCurrent");if(!current){return false}return dt&&dt.y===current.getFullYear()&&(dt.m==null||dt.m===current.getMonth())&&(dt.d==null||dt.d===current.getDate())};DatePicker.prototype.next=function next(){var target=this.get("safeTarget");var mode=this.get("mode");if(mode==="month"){this.set("target",new Date(target.getFullYear(),target.getMonth()+1,1))}if(mode==="months"){this.set("target",new Date(target.getFullYear()+1,target.getMonth(),1))}if(mode==="year"){this.set("target",new Date(target.getFullYear()+10,target.getMonth(),1))}};DatePicker.prototype.prev=function prev(){var target=this.get("safeTarget");var mode=this.get("mode");if(mode==="month"){this.set("target",new Date(target.getFullYear(),target.getMonth()-1,1))}if(mode==="months"){this.set("target",new Date(target.getFullYear()-1,target.getMonth(),1))}if(mode==="year"){this.set("target",new Date(target.getFullYear()-10,target.getMonth(),1))}};DatePicker.prototype.today=function today(){this.set("current",new Date);this.set("target",this.get("current"))};return DatePicker}(Ractive);Ractive.extendWith(DatePicker,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal",g:1}],f:[{t:4,f:[{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"left",x:{x:{r:["@index"],s:"_0===0"}}},{n:"right",x:{x:{r:["@last","@index"],s:"_0===_1"}}}]}],n:52,z:[{n:"offset",x:{r:"."}}],r:"~/padding"}],n:50,r:"~/padding"},{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"offset",x:{x:{r:[],s:"0"}}},{n:"left",x:{x:{r:[],s:"true"}}},{n:"right",x:{x:{r:[],s:"true"}}}]}],n:51,l:1}]}],e:{0:function(){return 0},"_0===0":function(_0){return _0===0},"_0===_1":function(_0,_1){return _0===_1},true:function(){return true},"[_0.prev(),false]":function(_0){return[_0.prev(),false]},'[_0.set("mode","month"),false]':function(_0){return[_0.set("mode","month"),false]},"[_0.next(),false]":function(_0){return[_0.next(),false]},"_1>_0||_1<_2":function(_0,_1,_2){return _1>_0||_1<_2},"_0.isCurrent(_1)":function(_0,_1){return _0.isCurrent(_1)},"[_0.select(_1),false]":function(_0,_1){return[_0.select(_1),false]},"_0.decade(_1,_2)":function(_0,_1,_2){return _0.decade(_1,_2)},'[_0.set("mode","year"),false]':function(_0){return[_0.set("mode","year"),false]},"_0.shortMonthName(_1)":function(_0,_1){return _0.shortMonthName(_1)},"_0.year(_1,_2)":function(_0,_1,_2){return _0.year(_1,_2)},'[_0.set("mode","months"),false]':function(_0){return[_0.set("mode","months"),false]},"_0.monthName(_1)":function(_0,_1){return _0.monthName(_1)},"_0!==_1":function(_0,_1){return _0!==_1},"[_0.select(_1)]":function(_0,_1){return[_0.select(_1)]},"_0.month(_1,_2)":function(_0,_1,_2){return _0.month(_1,_2)}},p:{year:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","month"),false]'}}],f:[{t:2,r:".start"}," - ",{t:2,r:".end"}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-decade",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:["year.end",".y","year.start"],s:"_1>_0||_1<_2"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1),false]"}}],f:[{t:2,r:".y"}]}],n:52,r:"."}]}],n:52,r:".years"}]}],n:54,z:[{n:"year",x:{r:"."}}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.decade(_1,_2)"}}],months:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","year"),false]'}}],f:[{t:2,r:".year"}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-year",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1),false]"}}],f:[{t:2,x:{r:["@this",".m"],s:"_0.shortMonthName(_1)"}}]}],n:52,r:"."}]}],n:52,r:".months"}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.year(_1,_2)"}}],month:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1},{n:"class-rcal-pad",t:13,f:[{t:2,r:"~/pad"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","months"),false]'}}],f:[{t:2,x:{r:["@this",".month"],s:"_0.monthName(_1)"}},{t:4,f:[", ",{t:2,r:".year"}],n:50,x:{r:[".currentYear",".year"],s:"_0!==_1"}}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-month",g:1}],f:[{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week rcal-week-header",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day rcal-day-header",g:1}],f:[{t:2,r:"."}]}],n:52,r:".days"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:[".m","month.month"],s:"_0!==_1"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1)]"}}],f:[{t:2,r:".d"}]}],n:52,r:"."}]}],n:52,r:".weeks"}],n:54,z:[{n:"month",x:{r:"."}}]}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.month(_1,_2)"}}]}},css:function(data){return[function(data){return".rcal-wrapper {\n display: inline-block;\n }\n \n .rcal-pad {\n padding: 0.5em;\n }\n \n .rcal-block-outer {\n border: 1px solid "+(data("raui.datePicker.primary.bga")||data("raui.primary.bga")||"#f4f4f4")+";\n }\n \n .rcal-block-header {\n text-align: center;\n background-color: "+(data("raui.datePicker.primary.fga")||data("raui.primary.fga")||"#07e")+";\n color: "+(data("raui.datePicker.primary.bg")||data("raui.primary.bg")||"#fff")+";\n cursor: default;\n display: flex;\n justify-content: space-between;\n padding: 0 0.5em;\n line-height: 1em;\n height: 1.5em;\n align-items: center;\n }\n \n .rcal-click {\n cursor: pointer;\n }\n \n .rcal-left, .rcal-right {\n height: 0.8em;\n display: inline-block;\n box-sizing: border-box;\n border: 0.4em solid transparent;\n cursor: pointer;\n }\n .rcal-left {\n border-right-color: "+(data("raui.datePicker.primary.bg")||data("raui.primary.bg")||"#fff")+";\n }\n .rcal-right {\n border-left-color: "+(data("raui.datePicker.primary.bg")||data("raui.primary.bg")||"#fff")+";\n }\n \n .rcal-month, .rcal-year, .rcal-decade {\n display: flex;\n flex-direction: column;\n background-color: "+(data("raui.datePicker.primary.bga")||data("raui.primary.bga")||"#f4f4f4")+";\n width: calc(10.5em + 6px);\n height: calc(10.5em + 6px);\n justify-content: space-between;\n }\n .rcal-year, .rcal-decade {\n justify-content: space-around;\n }\n \n .rcal-week {\n height: 1.5em;\n display: flex;\n justify-content: space-between;\n width: calc(10.5em + 6px);\n }\n \n .rcal-inner-row {\n height: 2em;\n display: flex;\n justify-content: space-around;\n width: calc(10.5em + 6px);\n }\n \n .rcal-inner-pick {\n background-color: "+(data("raui.datePicker.primary.bg")||data("raui.primary.bg")||"#fff")+";\n width: 3em;\n height: 2em;\n line-height: 2em;\n text-align: center;\n cursor: pointer;\n }\n \n .rcal-week-header {\n background-color: "+(data("raui.datePicker.primary.fga")||data("raui.primary.fga")||"#07e")+";\n }\n \n .rcal-day {\n background-color: "+(data("raui.datePicker.primary.bg")||data("raui.primary.bg")||"#fff")+";\n width: 1.5em;\n height: 1.5em;\n text-align: center;\n line-height: 1.5em;\n cursor: pointer;\n }\n \n .rcal-day-header {\n color: "+(data("raui.datePicker.primary.bg")||data("raui.primary.bg")||"#fff")+";\n background-color: "+(data("raui.datePicker.primary.fga")||data("raui.primary.fga")||"#07e")+";\n cursor: default;\n }\n \n .rcal-off-day {\n background-color: "+(data("raui.datePicker.primary.bc")||data("raui.primary.bc")||"#ccc")+";\n }\n \n .rcal-current {\n color: "+(data("raui.datePicker.primary.bg")||data("raui.primary.bg")||"#fff")+";\n background-color: "+(data("raui.datePicker.primary.fg")||data("raui.primary.fg")||"#222")+";\n }\n "}.call(this,data)].join(" ")},noCssTransform:true,data:function data(){return{mode:"month",target:new Date}},computed:{safeCurrent:function safeCurrent(){var current=this.get("current");if(typeof current==="string"){try{current=new Date(current)}catch(e){}}if(!(current instanceof Date)){current=new Date}return current},safeTarget:function safeTarget(){var target=this.get("target");if(!target){target=this.get("current")}if(typeof target==="string"){try{target=new Date(target)}catch(e){}}if(!(target instanceof Date)){return new Date}return target}}});export default function plugin(opts){if(opts===void 0)opts={};return function(ref){var instance=ref.instance;instance.components[opts.name||"date-picker"]=DatePicker}} |
@@ -9,3 +9,3 @@ import globalRegister from './globalRegister'; | ||
return ("\n label.field {\n display: inline-block;\n font-size: 0.9em;\n font-weight: 500;\n color: " + (primary.fg || '#222') + ";\n transition: 0.2s ease-in-out;\n transition-property: color;\n vertical-align: top;\n box-sizing: border-box;\n padding: 0.25em 0.5em;\n line-height: 1.5em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: inherit;\n }\n\n label.field.textarea {\n display: block;\n border: 0.0625em solid " + (primary.bc || '#ccc') + ";\n padding: 0.5em 0.8em 0.8em 0.8em;\n border-radius: " + (primary.radius || '0.2em') + ";\n box-shadow: none;\n transition-property: color, border-color, box-shadow;\n margin: 0.8em 0.2em;\n min-height: auto;\n background-color: " + (boxy ? primary.bg || '#fff' : 'transparent') + ";\n }\n\n label.field.focus {\n color: " + (active.fg || primary.fga || '#07e') + ";\n }\n\n label.field.textarea.focus {\n border-color: " + (active.fg || primary.fga || '#07e') + ";\n " + (!boxy ? ("box-shadow: 0.0625em 0.0625em " + (active.fg || primary.fga || '#07e') + ",\n -0.0625em 0.0625em " + (active.fg || primary.fga || '#07e') + ",\n 0.0625em -0.0625em " + (active.fg || primary.fga || '#07e') + ",\n -0.0625em -0.0625em " + (active.fg || primary.fga || '#07e') + ";") : '') + "\n }\n\n label.field input,\n label.field select,\n label.field textarea\n {\n display: block;\n border-width: " + (boxy ? '0.0625em' : '0 0 0.0625em 0') + ";\n border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n box-sizing: border-box;\n background-color: " + (boxy ? primary.bg || '#fff' : 'transparent') + ";\n transition: 0.2s ease-in-out;\n transition-property: box-shadow, color;\n outline: none;\n box-shadow: none;\n width: 100%;\n margin-bottom: 0.8em;\n font-size: 1.1em;" + (boxy ? ("\n border-radius: " + (primary.radius || '0.2em') + ";") : '') + "\n font-weight: 400;\n font-family: inherit;\n }\n\n label.field input" + (boxy ? '' : ':disabled') + ",\n label.field select" + (boxy ? '' : ':disabled') + " {\n padding: 0 0.75em;\n }\n label.field select" + (boxy ? '' : ':disabled') + " {\n padding-right: 2em;\n }\n\n label.field input:disabled,\n label.field select:disabled,\n label.field textarea:disabled {\n background: #f4f4f4;\n }\n\n label.field textarea {\n line-height: 1.2em;\n }\n label.field .field-wrapper {\n display: block;\n }\n label.field > select, label.field > input,\n label.field > .field-wrapper > input, label.field > .field-wrapper > select {\n height: 2.5em;\n }\n\n " + (!boxy ? ("label.field:hover > input,\n label.field:hover select,\n label.field.file:hover:after {\n box-shadow: 0 0.0625em 0 0 " + (primary.bc || '#ccc') + ";\n }\n\n label.field.textarea:hover {\n box-shadow: 0.0625em 0.0625em " + (primary.bc || '#ccc') + ",\n -0.0625em 0.0625em " + (primary.bc || '#ccc') + ",\n 0.0625em -0.0625em " + (primary.bc || '#ccc') + ",\n -0.0625em -0.0625em " + (primary.bc || '#ccc') + ";\n }\n\n label.field.textarea.focus:hover {\n box-shadow: 0.0625em 0.0625em " + (active.fg || primary.fga || '#07e') + ",\n -0.0625em 0.0625em " + (active.fg || primary.fga || '#07e') + ",\n 0.0625em -0.0625em " + (active.fg || primary.fga || '#07e') + ",\n -0.0625em -0.0625em " + (active.fg || primary.fga || '#07e') + ";\n }") : '') + "\n\n /**** CHECK BOXES ****/\n\n label.field.check {\n position:relative;\n z-index: 0;\n overflow: visible;\n cursor: pointer;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.check.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: -3px;\n top: 23px;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n background-color: " + (primary.bc || '#ccc') + ";\n box-shadow: none;\n outline: none;\n opacity: 0;\n transform: scale(1);\n pointer-events: none;\n transition: opacity 0.3s, transform 0.2s;\n }\n label.field.inline.check input {\n top: 3px;\n left: -3px;\n }\n\n label.field.check input:checked {\n background-color: " + (primary.fga || '#07e') + ";\n }\n\n label.field.check:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before {\n content: \"\";\n display: inline-block;\n box-sizing: border-box;\n margin: 3px 11px 3px 1px;\n border: solid 2px; /* Safari */\n border-color: " + (primary.fg || '#222') + ";\n border-radius: 2px;\n width: 18px;\n height: 18px;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after {\n content: \"\";\n display: block;\n position: absolute;\n top: 0px;\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.8em, 2.65em) rotate(-45deg);\n }\n\n label.field.check.inline:after {\n transform: translate(0.8em, 1.2em) rotate(-45deg);\n }\n\n label.field.check.checked:before {\n border-color: " + (primary.fga || '#07e') + ";\n background-color: " + (primary.fga || '#07e') + ";\n }\n label.field.check.focus:before {\n border-color: " + (primary.fga || '#07e') + ";\n }\n\n label.field.check.checked:after {\n border-color: " + (primary.bg || '#fff') + ";\n }\n\n label.field.check input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled {\n color: " + (primary.bc || '#ccc') + ";\n cursor: initial;\n }\n\n label.field.check.disabled:before {\n border-color: " + (primary.bc || '#ccc') + ";\n }\n\n label.field.check.checked.disabled:before {\n border-color: transparent;\n background-color: " + (primary.bc || '#ccc') + ";\n }\n\n\n /**** RADIO BUTTONS ****/\n \n label.field.radio {\n z-index: 0;\n position: relative;\n display: inline-block;\n overflow: visible;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.radio.inline {\n padding-top: 0.8em;\n }\n\n label.field.radio input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: 0;\n top: 0;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 41px;\n height: 40px;\n background-color: " + (primary.bc || '#ccc') + ";\n outline: none;\n opacity: 0;\n pointer-events: none;\n transform: translate(-0.2em, 24px) scale(1);\n transition: opacity 0.3s, transform 0.3s;\n }\n label.field.inline.radio input {\n transform: translate(-0.2em, 3px) scale(1);\n }\n\n label.field.radio {\n cursor: pointer;\n position: relative;\n }\n\n label.field.radio:before {\n content: \"\";\n display: inline-block;\n box-sizing: border-box;\n margin: 2px 10px 2px 0;\n border: solid 2px; /* Safari */\n border-color: " + (primary.fg || '#222') + ";\n border-radius: 50%;\n width: 20px;\n height: 20px;\n vertical-align: middle;\n transition: border-color 0.2s;\n }\n\n label.field.radio:after {\n content: \"\";\n display: block;\n position: absolute;\n border-radius: 50%;\n width: 10px;\n height: 10px;\n background-color: " + (primary.fga || '#07e') + ";\n transform: translate(5px, -17px) scale(0);\n transition: transform 0.2s;\n }\n\n label.field.radio input:checked {\n background-color: " + (primary.fga || '#07e') + ";\n }\n\n label.field.radio.checked:before {\n border-color: " + (primary.fga || '#07e') + ";\n }\n\n label.field.radio.checked:after {\n transform: translate(5px, -17px) scale(1);\n }\n\n label.field.radio:hover input {\n opacity: 0.04;\n }\n\n label.field.radio input:focus {\n opacity: 0.12;\n transform: translate(-0.2em, 24px) scale(1);\n transition: transform 0.2s, opacity 0.2s;\n }\n label.field.inline.radio input:focus {\n transform: translate(-0.2em, 3px) scale(1);\n }\n\n label.field.radio:hover input:focus {\n opacity: 0.16;\n }\n\n label.field.radio input:active {\n opacity: 1;\n transform: translate(-0.2em, 24px) scale(0);\n transition: transform 0s, opacity 0s;\n }\n label.field.inline.radio input:active {\n transform: translate(-0.2em, 3px) scale(0);\n }\n\n label.field.radio.checked:before {\n border-color: " + (primary.fga || '#07e') + ";\n }\n\n label.field.radio.focus:before {\n border-color: " + (primary.fga || '#07e') + ";\n }\n\n label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.radio.disabled {\n color: " + (primary.bc || '#ccc') + ";\n cursor: initial;\n }\n\n label.field.radio.disabled:before {\n border-color: " + (primary.bc || '#ccc') + ";\n }\n\n label.field.radio.disabled:after {\n background-color: " + (primary.bc || '#ccc') + ";\n }\n\n\n\n label.field select {\n padding-right: 2em;\n }\n\n label.field.select {\n cursor: pointer;\n position: relative;\n }\n\n label.field.select:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n right: 19px;\n height: 0.6em;\n top: 2.6em;\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n pointer-events: none;\n color: " + (primary.bc || '#ccc') + ";\n }\n\n label.field textarea {\n border: none;" + (boxy ? "\n padding: 0;" : '') + "\n }\n\n label.field > select {\n -moz-appearance: none;\n -webkit-appearance: none;\n }\n\n label.field input:focus,\n label.field select:focus,\n label.field.file.focus:after\n {\n border-color: " + (active.fg || primary.fga || '#07e') + ";\n " + (!boxy ? ("box-shadow: 0 0.0625em 0 0 " + (active.fg || primary.fga || '#07e') + ";") : '') + "\n }\n\n label.field input[type=checkbox]:focus,\n label.field input[type=radio]:focus {\n box-shadow: none;\n }\n\n label.field.file.focus:after {\n color: " + (active.fg || primary.fga || '#07e') + ";\n }\n label.field.file [type=file] {\n position: absolute;\n width: 0;\n height: 0;\n opacity: 0;\n z-index: -1;\n }\n label.field.file {\n position: relative;\n min-width: 9em;\n height: 5em;\n }\n label.field.file:after {\n position: absolute;\n content: 'Choose a file';\n box-sizing: border-box;\n width: calc(100% - 0.3em);\n height: 2.5em;\n font-size: 1.1em;\n line-height: 1.5em;\n color: " + (primary.fg || '#222') + ";\n text-align: " + (boxy ? 'center' : 'left') + ";\n padding: 0.5em " + (boxy ? '0.5em' : '0') + ";\n cursor: pointer;\n font-style: oblique;\n left: 0.25em;\n top: 1.6em;\n transition: 0.2s ease-in-out;\n transition-property: color, border-bolor, box-shadow;" + (boxy ? ("\n border-radius: " + (primary.radius || '0.2em') + ";\n border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n border-width: 0.0625em;") : ("\n border-bottom-color: " + (primary.bc || '#ccc') + ";\n border-bottom-width: 0.0625em;\n border-bottom-style: solid;\n ")) + "\n }\n label.field.file.inline:after {\n top: 0.2em;\n }\n\n label.field.button {\n vertical-align: top;\n padding-top: " + (boxy ? '1.7' : '1.958') + "em;\n }\n label.field .with-buttons button, label.field.button button {\n font-size: 1.1em;\n margin-top: " + (boxy ? '0.15em' : '0') + ";\n }\n\n label.field .field-wrapper.with-buttons {\n display: flex;\n }\n label.field .with-buttons button {\n flex-shrink: 0;\n padding-left: 0.5em;\n padding-right: 0.5em;\n margin-top: 0;\n margin-right: 0;\n " + (boxy ? ("height: 2.5em;\n box-shadow: none;\n border-radius: 0;\n border-left: 1px solid " + (primary.bg || '#fff') + ";\n margin-left: 0;") : | ||
"height: 2.25em;") + "\n }" + (boxy ? ("\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 " + (primary.radius || '0.2em') + " " + (primary.radius || '0.2em') + " 0;\n }\n label.field .with-buttons input {\n border-radius: " + (primary.radius || '0.2em') + " 0 0 " + (primary.radius || '0.2em') + ";\n min-width: 0;\n }\n ") : '') + "\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1." + (boxy ? '15' : '1') + "em;\n }\n\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: " + (primary.fga || '#07e') + ";\n color: " + (primary.bg || '#fff;') + ";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1.2em;\n text-align: center;\n margin-top: -0.2em;\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n "); | ||
"height: 2.25em;") + "\n }" + (boxy ? ("\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 " + (primary.radius || '0.2em') + " " + (primary.radius || '0.2em') + " 0;\n }\n label.field .with-buttons input {\n border-radius: " + (primary.radius || '0.2em') + " 0 0 " + (primary.radius || '0.2em') + ";\n min-width: 0;\n }\n ") : '') + "\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n font-weight: normal;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1." + (boxy ? '15' : '1') + "em;\n }\n\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: " + (primary.fga || '#07e') + ";\n color: " + (primary.bg || '#fff;') + ";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1.2em;\n text-align: center;\n margin-top: -0.2em;\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n "); | ||
// TODO: other themes | ||
@@ -301,1 +301,2 @@ } | ||
export default plugin; | ||
@@ -1,1 +0,1 @@ | ||
import globalRegister from"./globalRegister";import Ractive from"ractive";export function style(data){var primary=Object.assign({},data("raui.primary"),data("raui.form.primary"));var active=Object.assign({},data("raui.primary.active"),data("raui.form.primary.active"));var boxy=data("raui.form.boxy");return"\n label.field {\n display: inline-block;\n font-size: 0.9em;\n font-weight: 500;\n color: "+(primary.fg||"#222")+";\n transition: 0.2s ease-in-out;\n transition-property: color;\n vertical-align: top;\n box-sizing: border-box;\n padding: 0.25em 0.5em;\n line-height: 1.5em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: inherit;\n }\n\n label.field.textarea {\n display: block;\n border: 0.0625em solid "+(primary.bc||"#ccc")+";\n padding: 0.5em 0.8em 0.8em 0.8em;\n border-radius: "+(primary.radius||"0.2em")+";\n box-shadow: none;\n transition-property: color, border-color, box-shadow;\n margin: 0.8em 0.2em;\n min-height: auto;\n background-color: "+(boxy?primary.bg||"#fff":"transparent")+";\n }\n\n label.field.focus {\n color: "+(active.fg||primary.fga||"#07e")+";\n }\n\n label.field.textarea.focus {\n border-color: "+(active.fg||primary.fga||"#07e")+";\n "+(!boxy?"box-shadow: 0.0625em 0.0625em "+(active.fg||primary.fga||"#07e")+",\n -0.0625em 0.0625em "+(active.fg||primary.fga||"#07e")+",\n 0.0625em -0.0625em "+(active.fg||primary.fga||"#07e")+",\n -0.0625em -0.0625em "+(active.fg||primary.fga||"#07e")+";":"")+"\n }\n\n label.field input,\n label.field select,\n label.field textarea\n {\n display: block;\n border-width: "+(boxy?"0.0625em":"0 0 0.0625em 0")+";\n border-color: "+(primary.bc||"#ccc")+";\n border-style: solid;\n box-sizing: border-box;\n background-color: "+(boxy?primary.bg||"#fff":"transparent")+";\n transition: 0.2s ease-in-out;\n transition-property: box-shadow, color;\n outline: none;\n box-shadow: none;\n width: 100%;\n margin-bottom: 0.8em;\n font-size: 1.1em;"+(boxy?"\n border-radius: "+(primary.radius||"0.2em")+";":"")+"\n font-weight: 400;\n font-family: inherit;\n }\n\n label.field input"+(boxy?"":":disabled")+",\n label.field select"+(boxy?"":":disabled")+" {\n padding: 0 0.75em;\n }\n label.field select"+(boxy?"":":disabled")+" {\n padding-right: 2em;\n }\n\n label.field input:disabled,\n label.field select:disabled,\n label.field textarea:disabled {\n background: #f4f4f4;\n }\n\n label.field textarea {\n line-height: 1.2em;\n }\n label.field .field-wrapper {\n display: block;\n }\n label.field > select, label.field > input,\n label.field > .field-wrapper > input, label.field > .field-wrapper > select {\n height: 2.5em;\n }\n\n "+(!boxy?"label.field:hover > input,\n label.field:hover select,\n label.field.file:hover:after {\n box-shadow: 0 0.0625em 0 0 "+(primary.bc||"#ccc")+";\n }\n\n label.field.textarea:hover {\n box-shadow: 0.0625em 0.0625em "+(primary.bc||"#ccc")+",\n -0.0625em 0.0625em "+(primary.bc||"#ccc")+",\n 0.0625em -0.0625em "+(primary.bc||"#ccc")+",\n -0.0625em -0.0625em "+(primary.bc||"#ccc")+";\n }\n\n label.field.textarea.focus:hover {\n box-shadow: 0.0625em 0.0625em "+(active.fg||primary.fga||"#07e")+",\n -0.0625em 0.0625em "+(active.fg||primary.fga||"#07e")+",\n 0.0625em -0.0625em "+(active.fg||primary.fga||"#07e")+",\n -0.0625em -0.0625em "+(active.fg||primary.fga||"#07e")+";\n }":"")+"\n\n /**** CHECK BOXES ****/\n\n label.field.check {\n position:relative;\n z-index: 0;\n overflow: visible;\n cursor: pointer;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.check.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: -3px;\n top: 23px;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n background-color: "+(primary.bc||"#ccc")+";\n box-shadow: none;\n outline: none;\n opacity: 0;\n transform: scale(1);\n pointer-events: none;\n transition: opacity 0.3s, transform 0.2s;\n }\n label.field.inline.check input {\n top: 3px;\n left: -3px;\n }\n\n label.field.check input:checked {\n background-color: "+(primary.fga||"#07e")+';\n }\n\n label.field.check:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n margin: 3px 11px 3px 1px;\n border: solid 2px; /* Safari */\n border-color: '+(primary.fg||"#222")+';\n border-radius: 2px;\n width: 18px;\n height: 18px;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after {\n content: "";\n display: block;\n position: absolute;\n top: 0px;\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.8em, 2.65em) rotate(-45deg);\n }\n\n label.field.check.inline:after {\n transform: translate(0.8em, 1.2em) rotate(-45deg);\n }\n\n label.field.check.checked:before {\n border-color: '+(primary.fga||"#07e")+";\n background-color: "+(primary.fga||"#07e")+";\n }\n label.field.check.focus:before {\n border-color: "+(primary.fga||"#07e")+";\n }\n\n label.field.check.checked:after {\n border-color: "+(primary.bg||"#fff")+";\n }\n\n label.field.check input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled {\n color: "+(primary.bc||"#ccc")+";\n cursor: initial;\n }\n\n label.field.check.disabled:before {\n border-color: "+(primary.bc||"#ccc")+";\n }\n\n label.field.check.checked.disabled:before {\n border-color: transparent;\n background-color: "+(primary.bc||"#ccc")+";\n }\n\n\n /**** RADIO BUTTONS ****/\n \n label.field.radio {\n z-index: 0;\n position: relative;\n display: inline-block;\n overflow: visible;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.radio.inline {\n padding-top: 0.8em;\n }\n\n label.field.radio input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: 0;\n top: 0;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 41px;\n height: 40px;\n background-color: "+(primary.bc||"#ccc")+';\n outline: none;\n opacity: 0;\n pointer-events: none;\n transform: translate(-0.2em, 24px) scale(1);\n transition: opacity 0.3s, transform 0.3s;\n }\n label.field.inline.radio input {\n transform: translate(-0.2em, 3px) scale(1);\n }\n\n label.field.radio {\n cursor: pointer;\n position: relative;\n }\n\n label.field.radio:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n margin: 2px 10px 2px 0;\n border: solid 2px; /* Safari */\n border-color: '+(primary.fg||"#222")+';\n border-radius: 50%;\n width: 20px;\n height: 20px;\n vertical-align: middle;\n transition: border-color 0.2s;\n }\n\n label.field.radio:after {\n content: "";\n display: block;\n position: absolute;\n border-radius: 50%;\n width: 10px;\n height: 10px;\n background-color: '+(primary.fga||"#07e")+";\n transform: translate(5px, -17px) scale(0);\n transition: transform 0.2s;\n }\n\n label.field.radio input:checked {\n background-color: "+(primary.fga||"#07e")+";\n }\n\n label.field.radio.checked:before {\n border-color: "+(primary.fga||"#07e")+";\n }\n\n label.field.radio.checked:after {\n transform: translate(5px, -17px) scale(1);\n }\n\n label.field.radio:hover input {\n opacity: 0.04;\n }\n\n label.field.radio input:focus {\n opacity: 0.12;\n transform: translate(-0.2em, 24px) scale(1);\n transition: transform 0.2s, opacity 0.2s;\n }\n label.field.inline.radio input:focus {\n transform: translate(-0.2em, 3px) scale(1);\n }\n\n label.field.radio:hover input:focus {\n opacity: 0.16;\n }\n\n label.field.radio input:active {\n opacity: 1;\n transform: translate(-0.2em, 24px) scale(0);\n transition: transform 0s, opacity 0s;\n }\n label.field.inline.radio input:active {\n transform: translate(-0.2em, 3px) scale(0);\n }\n\n label.field.radio.checked:before {\n border-color: "+(primary.fga||"#07e")+";\n }\n\n label.field.radio.focus:before {\n border-color: "+(primary.fga||"#07e")+";\n }\n\n label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.radio.disabled {\n color: "+(primary.bc||"#ccc")+";\n cursor: initial;\n }\n\n label.field.radio.disabled:before {\n border-color: "+(primary.bc||"#ccc")+";\n }\n\n label.field.radio.disabled:after {\n background-color: "+(primary.bc||"#ccc")+";\n }\n\n\n\n label.field select {\n padding-right: 2em;\n }\n\n label.field.select {\n cursor: pointer;\n position: relative;\n }\n\n label.field.select:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n right: 19px;\n height: 0.6em;\n top: 2.6em;\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n pointer-events: none;\n color: "+(primary.bc||"#ccc")+";\n }\n\n label.field textarea {\n border: none;"+(boxy?"\n padding: 0;":"")+"\n }\n\n label.field > select {\n -moz-appearance: none;\n -webkit-appearance: none;\n }\n\n label.field input:focus,\n label.field select:focus,\n label.field.file.focus:after\n {\n border-color: "+(active.fg||primary.fga||"#07e")+";\n "+(!boxy?"box-shadow: 0 0.0625em 0 0 "+(active.fg||primary.fga||"#07e")+";":"")+"\n }\n\n label.field input[type=checkbox]:focus,\n label.field input[type=radio]:focus {\n box-shadow: none;\n }\n\n label.field.file.focus:after {\n color: "+(active.fg||primary.fga||"#07e")+";\n }\n label.field.file [type=file] {\n position: absolute;\n width: 0;\n height: 0;\n opacity: 0;\n z-index: -1;\n }\n label.field.file {\n position: relative;\n min-width: 9em;\n height: 5em;\n }\n label.field.file:after {\n position: absolute;\n content: 'Choose a file';\n box-sizing: border-box;\n width: calc(100% - 0.3em);\n height: 2.5em;\n font-size: 1.1em;\n line-height: 1.5em;\n color: "+(primary.fg||"#222")+";\n text-align: "+(boxy?"center":"left")+";\n padding: 0.5em "+(boxy?"0.5em":"0")+";\n cursor: pointer;\n font-style: oblique;\n left: 0.25em;\n top: 1.6em;\n transition: 0.2s ease-in-out;\n transition-property: color, border-bolor, box-shadow;"+(boxy?"\n border-radius: "+(primary.radius||"0.2em")+";\n border-color: "+(primary.bc||"#ccc")+";\n border-style: solid;\n border-width: 0.0625em;":"\n border-bottom-color: "+(primary.bc||"#ccc")+";\n border-bottom-width: 0.0625em;\n border-bottom-style: solid;\n ")+"\n }\n label.field.file.inline:after {\n top: 0.2em;\n }\n\n label.field.button {\n vertical-align: top;\n padding-top: "+(boxy?"1.7":"1.958")+"em;\n }\n label.field .with-buttons button, label.field.button button {\n font-size: 1.1em;\n margin-top: "+(boxy?"0.15em":"0")+";\n }\n\n label.field .field-wrapper.with-buttons {\n display: flex;\n }\n label.field .with-buttons button {\n flex-shrink: 0;\n padding-left: 0.5em;\n padding-right: 0.5em;\n margin-top: 0;\n margin-right: 0;\n "+(boxy?"height: 2.5em;\n box-shadow: none;\n border-radius: 0;\n border-left: 1px solid "+(primary.bg||"#fff")+";\n margin-left: 0;":"height: 2.25em;")+"\n }"+(boxy?"\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 "+(primary.radius||"0.2em")+" "+(primary.radius||"0.2em")+" 0;\n }\n label.field .with-buttons input {\n border-radius: "+(primary.radius||"0.2em")+" 0 0 "+(primary.radius||"0.2em")+";\n min-width: 0;\n }\n ":"")+"\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1."+(boxy?"15":"1")+"em;\n }\n\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: "+(primary.fga||"#07e")+";\n color: "+(primary.bg||"#fff;")+";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1.2em;\n text-align: center;\n margin-top: -0.2em;\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n "}function noop(){}function focused(ev){if(!~this.className.indexOf("focus")){this.className+=" focus"}}function blurred(ev){this.className=this.className.replace(/\bfocus\b/g,"").trim()}export function field(node){var ctx=this.getContext(node);var isField,isCheck,isRadio,isArea,isSelect,isFile,isButton,isPlain,isInput;var change,attrs,desc,last;function invalidate(){var val=setup().split(/\s+/).filter(function(c){return!!c});isField=!!~val.indexOf("field");if(!isField){val.push("field");isField=true}isCheck=node.querySelector("input[type=checkbox]");if(isCheck&&!~val.indexOf("check")){val.push("check")}isRadio=node.querySelector("input[type=radio]");if(isRadio&&!~val.indexOf("radio")){val.push("radio")}var checkable=isCheck||isRadio;if(checkable&&checkable.checked&&!~val.indexOf("checked")){val.push("checked")}if(checkable&&checkable.disabled&&!~val.indexOf("disabled")){val.push("disabled")}if(!checkable&&change){change.cancel();change=0;if(attrs){attrs.disconnect();attrs=0}delete checkable._form_callback;if(last){delete last.checked;desc=last=undefined}}else if(checkable){checkable._form_callback=function(ev,init){if(init===void 0)init=true;if(init&&checkable.type==="radio"&&checkable.name){var list=[];list.push.apply(list,document.querySelectorAll("input[type=radio][name="+checkable.name+"]"));list=list.filter(function(i){return i!==checkable});list.forEach(function(l){return l._form_callback&&l._form_callback(ev,false)})}var checked=checkable.checked;if(checked&&!~node.className.indexOf("checked")){node.className+=" checked"}else if(!checked&&~node.className.indexOf("checked")){node.className=node.className.replace(/\bchecked\b/g,"").replace(/ +/g," ").trim()}};if(MutationObserver){attrs=new MutationObserver(function(){var val;val=checkable.disabled;if(val&&!~node.className.indexOf("disabled")){node.className+=" disabled"}else if(!val&&~node.className.indexOf("disabled")){node.className=node.className.replace(/\bdisabled\b/g,"").replace(/ +/g," ").trim()}});attrs.observe(checkable,{attributes:true})}change=this.getContext(checkable).listen("change",checkable._form_callback);desc=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(checkable),"checked");if(desc&&desc.configurable){last=checkable;Object.defineProperty(checkable,"checked",{get:desc.get,set:function set(v){desc.set.call(last,v);checkable._form_callback()},enumerable:true,configurable:true})}}isArea=!!node.querySelector("textarea");if(isArea&&!~val.indexOf("textarea")){val.push("textarea")}isSelect=!!node.querySelector("select");if(isSelect&&!~val.indexOf("select")){val.push("select")}isFile=!!node.querySelector("input[type=file]");if(isFile&&!~val.indexOf("file")){val.push("file")}isButton=node.querySelector("button");isButton=!!isButton&&isButton.parentNode===node;if(isButton&&!~val.indexOf("button")){val.push("button")}isPlain=!!node.querySelector("div");if(isPlain&&!~val.indexOf("plain")){val.push("plain")}isInput=!isCheck&&!isRadio&&!isFile&&!!node.querySelector("input");if(isInput&&!~val.indexOf("input")){val.push("input")}node.className=val.join(" ")}function setup(){var cls=node.className;if(!isField){cls=cls.replace(/\bfield\b/g,"").trim()}if(!isCheck){cls=cls.replace(/\bcheck(ed)?\b/g,"").trim()}if(!isRadio){cls=cls.replace(/\bradio\b/g,"").trim()}if(!isArea){cls=cls.replace(/\btextarea\b/g,"").trim()}if(!isSelect){cls=cls.replace(/\bselect\b/g,"").trim()}if(!isFile){cls=cls.replace(/\bfile\b/g,"").trim()}if(!isButton){cls=cls.replace(/\bbutton\b/g,"").trim()}if(!isPlain){cls=cls.replace(/\bplain\b/g,"").trim()}if(!isInput){cls=cls.replace(/\binput\b/g,"").trim()}cls=cls.replace(/ +/g," ");return cls}var focus=ctx.listen("focusin",focused);var blur=ctx.listen("focusout",blurred);invalidate.call(this);return{update:noop,invalidate:invalidate.bind(this),teardown:function teardown(){var cls=setup();cls=cls.replace(/\bfocus\b/g,"").trim();focus.cancel();blur.cancel();change&&change.cancel();if(attrs){attrs.disconnect()}if(last){delete last.checked;desc=last=undefined}node.className=cls}}}field.style=style;function findDeep(els,el){if(!els){return false}for(var i=0;i<els.length;i++){if(els[i].e===el){return true}if(els[i].f&&findDeep(els[i].f,el)){return true}}return false}export var macro=Ractive.macro(function(handle){var body=[];var attrs=(handle.template.m||[]).slice();var content=handle.template.f||[];var value=attrs.find(function(a){return a.n==="value"});var type=attrs.find(function(a){return a.n==="type"});var tip=attrs.find(function(a){return a.n==="tip"});if(tip){attrs.splice(attrs.indexOf(tip),1)}if(type&&typeof macro.types[type.f]==="function"){body.push.apply(body,macro.types[type.f](attrs,content,handle))}else if(value){var el={t:7,e:"input",m:[value]};if(findDeep(content,"option")){el.e="select";el.f=content}if(type){el.m.push(type);if(type.f==="checkbox"||type.f==="radio"){var target=attrs.find(function(a){return a.n==="target"});if(target){el.m.push(Object.assign({},target,{n:"name"}))}else{el.m.splice(el.m.indexOf(value),1,Object.assign({},value,{n:"checked"}))}}}el.m=el.m.concat(attrs.filter(function(a){return a.t===73||a.t===73||a.n==="placeholder"}));body.push(el);var btns=content.filter(function(e){return e.e==="button"||findDeep(e.f,"button")});if(btns.length){body.push.apply(body,btns);body=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:body}]}}else{var els=content.filter(function(e){return e.e});if(els.find(function(e){return e.e==="button"})&&els.length>1){body=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:content}]}else{body.push.apply(body,content)}}var label=attrs.find(function(a){return a.n==="label"});if(tip){body.unshift({t:7,e:"span",m:[{t:13,n:"class",f:"field-tip"+(!label?" field-solo-tip":""),g:1},{t:13,n:"title",f:tip.f},{t:70,n:["click"],f:{r:[],s:"[false]"}}],f:"?"})}if(label){body.unshift(label.f)}else{body.unshift(" ")}var outer={t:7,e:"label",m:[{t:71,n:"field"}].concat(attrs.filter(function(a){return a.t!==13&&a.t!==73||a.n!=="value"&&a.n!=="type"&&a.n!=="inline"&&a.n!=="label"&&a.n!=="placeholder"&&a.n!=="target"})),f:body};if(attrs.find(function(a){return a.n==="inline"})){outer.m.push({t:13,n:"class",f:"inline"})}handle.setTemplate([outer])});macro.types={};export function autofocus(node){if(typeof node.focus==="function"){node.focus()}return{teardown:noop}}export function plugin(opts){if(opts===void 0)opts={};return function(ref){var Ractive=ref.Ractive;var instance=ref.instance;if(!Ractive.isInstance(instance)){if(opts.includeStyle){if(instance===Ractive){Ractive.addCSS("form-decorator",style)}else{var css=instance.css;instance.css=function(data){var res=typeof css!=="function"?css||"":css(data);return res+style(data)}}}}instance.partials[opts.name||"field"]=macro;instance.decorators[opts.name||"field"]=field;instance.decorators[opts.autofocusName||"autofocus"]=autofocus}}globalRegister("field","decorators",field);globalRegister("field","partials",macro);globalRegister("autofocus","decorators",autofocus);export default plugin; | ||
import globalRegister from"./globalRegister";import Ractive from"ractive";export function style(data){var primary=Object.assign({},data("raui.primary"),data("raui.form.primary"));var active=Object.assign({},data("raui.primary.active"),data("raui.form.primary.active"));var boxy=data("raui.form.boxy");return"\n label.field {\n display: inline-block;\n font-size: 0.9em;\n font-weight: 500;\n color: "+(primary.fg||"#222")+";\n transition: 0.2s ease-in-out;\n transition-property: color;\n vertical-align: top;\n box-sizing: border-box;\n padding: 0.25em 0.5em;\n line-height: 1.5em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: inherit;\n }\n\n label.field.textarea {\n display: block;\n border: 0.0625em solid "+(primary.bc||"#ccc")+";\n padding: 0.5em 0.8em 0.8em 0.8em;\n border-radius: "+(primary.radius||"0.2em")+";\n box-shadow: none;\n transition-property: color, border-color, box-shadow;\n margin: 0.8em 0.2em;\n min-height: auto;\n background-color: "+(boxy?primary.bg||"#fff":"transparent")+";\n }\n\n label.field.focus {\n color: "+(active.fg||primary.fga||"#07e")+";\n }\n\n label.field.textarea.focus {\n border-color: "+(active.fg||primary.fga||"#07e")+";\n "+(!boxy?"box-shadow: 0.0625em 0.0625em "+(active.fg||primary.fga||"#07e")+",\n -0.0625em 0.0625em "+(active.fg||primary.fga||"#07e")+",\n 0.0625em -0.0625em "+(active.fg||primary.fga||"#07e")+",\n -0.0625em -0.0625em "+(active.fg||primary.fga||"#07e")+";":"")+"\n }\n\n label.field input,\n label.field select,\n label.field textarea\n {\n display: block;\n border-width: "+(boxy?"0.0625em":"0 0 0.0625em 0")+";\n border-color: "+(primary.bc||"#ccc")+";\n border-style: solid;\n box-sizing: border-box;\n background-color: "+(boxy?primary.bg||"#fff":"transparent")+";\n transition: 0.2s ease-in-out;\n transition-property: box-shadow, color;\n outline: none;\n box-shadow: none;\n width: 100%;\n margin-bottom: 0.8em;\n font-size: 1.1em;"+(boxy?"\n border-radius: "+(primary.radius||"0.2em")+";":"")+"\n font-weight: 400;\n font-family: inherit;\n }\n\n label.field input"+(boxy?"":":disabled")+",\n label.field select"+(boxy?"":":disabled")+" {\n padding: 0 0.75em;\n }\n label.field select"+(boxy?"":":disabled")+" {\n padding-right: 2em;\n }\n\n label.field input:disabled,\n label.field select:disabled,\n label.field textarea:disabled {\n background: #f4f4f4;\n }\n\n label.field textarea {\n line-height: 1.2em;\n }\n label.field .field-wrapper {\n display: block;\n }\n label.field > select, label.field > input,\n label.field > .field-wrapper > input, label.field > .field-wrapper > select {\n height: 2.5em;\n }\n\n "+(!boxy?"label.field:hover > input,\n label.field:hover select,\n label.field.file:hover:after {\n box-shadow: 0 0.0625em 0 0 "+(primary.bc||"#ccc")+";\n }\n\n label.field.textarea:hover {\n box-shadow: 0.0625em 0.0625em "+(primary.bc||"#ccc")+",\n -0.0625em 0.0625em "+(primary.bc||"#ccc")+",\n 0.0625em -0.0625em "+(primary.bc||"#ccc")+",\n -0.0625em -0.0625em "+(primary.bc||"#ccc")+";\n }\n\n label.field.textarea.focus:hover {\n box-shadow: 0.0625em 0.0625em "+(active.fg||primary.fga||"#07e")+",\n -0.0625em 0.0625em "+(active.fg||primary.fga||"#07e")+",\n 0.0625em -0.0625em "+(active.fg||primary.fga||"#07e")+",\n -0.0625em -0.0625em "+(active.fg||primary.fga||"#07e")+";\n }":"")+"\n\n /**** CHECK BOXES ****/\n\n label.field.check {\n position:relative;\n z-index: 0;\n overflow: visible;\n cursor: pointer;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.check.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: -3px;\n top: 23px;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n background-color: "+(primary.bc||"#ccc")+";\n box-shadow: none;\n outline: none;\n opacity: 0;\n transform: scale(1);\n pointer-events: none;\n transition: opacity 0.3s, transform 0.2s;\n }\n label.field.inline.check input {\n top: 3px;\n left: -3px;\n }\n\n label.field.check input:checked {\n background-color: "+(primary.fga||"#07e")+';\n }\n\n label.field.check:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n margin: 3px 11px 3px 1px;\n border: solid 2px; /* Safari */\n border-color: '+(primary.fg||"#222")+';\n border-radius: 2px;\n width: 18px;\n height: 18px;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after {\n content: "";\n display: block;\n position: absolute;\n top: 0px;\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.8em, 2.65em) rotate(-45deg);\n }\n\n label.field.check.inline:after {\n transform: translate(0.8em, 1.2em) rotate(-45deg);\n }\n\n label.field.check.checked:before {\n border-color: '+(primary.fga||"#07e")+";\n background-color: "+(primary.fga||"#07e")+";\n }\n label.field.check.focus:before {\n border-color: "+(primary.fga||"#07e")+";\n }\n\n label.field.check.checked:after {\n border-color: "+(primary.bg||"#fff")+";\n }\n\n label.field.check input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled {\n color: "+(primary.bc||"#ccc")+";\n cursor: initial;\n }\n\n label.field.check.disabled:before {\n border-color: "+(primary.bc||"#ccc")+";\n }\n\n label.field.check.checked.disabled:before {\n border-color: transparent;\n background-color: "+(primary.bc||"#ccc")+";\n }\n\n\n /**** RADIO BUTTONS ****/\n \n label.field.radio {\n z-index: 0;\n position: relative;\n display: inline-block;\n overflow: visible;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.radio.inline {\n padding-top: 0.8em;\n }\n\n label.field.radio input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: 0;\n top: 0;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 41px;\n height: 40px;\n background-color: "+(primary.bc||"#ccc")+';\n outline: none;\n opacity: 0;\n pointer-events: none;\n transform: translate(-0.2em, 24px) scale(1);\n transition: opacity 0.3s, transform 0.3s;\n }\n label.field.inline.radio input {\n transform: translate(-0.2em, 3px) scale(1);\n }\n\n label.field.radio {\n cursor: pointer;\n position: relative;\n }\n\n label.field.radio:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n margin: 2px 10px 2px 0;\n border: solid 2px; /* Safari */\n border-color: '+(primary.fg||"#222")+';\n border-radius: 50%;\n width: 20px;\n height: 20px;\n vertical-align: middle;\n transition: border-color 0.2s;\n }\n\n label.field.radio:after {\n content: "";\n display: block;\n position: absolute;\n border-radius: 50%;\n width: 10px;\n height: 10px;\n background-color: '+(primary.fga||"#07e")+";\n transform: translate(5px, -17px) scale(0);\n transition: transform 0.2s;\n }\n\n label.field.radio input:checked {\n background-color: "+(primary.fga||"#07e")+";\n }\n\n label.field.radio.checked:before {\n border-color: "+(primary.fga||"#07e")+";\n }\n\n label.field.radio.checked:after {\n transform: translate(5px, -17px) scale(1);\n }\n\n label.field.radio:hover input {\n opacity: 0.04;\n }\n\n label.field.radio input:focus {\n opacity: 0.12;\n transform: translate(-0.2em, 24px) scale(1);\n transition: transform 0.2s, opacity 0.2s;\n }\n label.field.inline.radio input:focus {\n transform: translate(-0.2em, 3px) scale(1);\n }\n\n label.field.radio:hover input:focus {\n opacity: 0.16;\n }\n\n label.field.radio input:active {\n opacity: 1;\n transform: translate(-0.2em, 24px) scale(0);\n transition: transform 0s, opacity 0s;\n }\n label.field.inline.radio input:active {\n transform: translate(-0.2em, 3px) scale(0);\n }\n\n label.field.radio.checked:before {\n border-color: "+(primary.fga||"#07e")+";\n }\n\n label.field.radio.focus:before {\n border-color: "+(primary.fga||"#07e")+";\n }\n\n label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.radio.disabled {\n color: "+(primary.bc||"#ccc")+";\n cursor: initial;\n }\n\n label.field.radio.disabled:before {\n border-color: "+(primary.bc||"#ccc")+";\n }\n\n label.field.radio.disabled:after {\n background-color: "+(primary.bc||"#ccc")+";\n }\n\n\n\n label.field select {\n padding-right: 2em;\n }\n\n label.field.select {\n cursor: pointer;\n position: relative;\n }\n\n label.field.select:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n right: 19px;\n height: 0.6em;\n top: 2.6em;\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n pointer-events: none;\n color: "+(primary.bc||"#ccc")+";\n }\n\n label.field textarea {\n border: none;"+(boxy?"\n padding: 0;":"")+"\n }\n\n label.field > select {\n -moz-appearance: none;\n -webkit-appearance: none;\n }\n\n label.field input:focus,\n label.field select:focus,\n label.field.file.focus:after\n {\n border-color: "+(active.fg||primary.fga||"#07e")+";\n "+(!boxy?"box-shadow: 0 0.0625em 0 0 "+(active.fg||primary.fga||"#07e")+";":"")+"\n }\n\n label.field input[type=checkbox]:focus,\n label.field input[type=radio]:focus {\n box-shadow: none;\n }\n\n label.field.file.focus:after {\n color: "+(active.fg||primary.fga||"#07e")+";\n }\n label.field.file [type=file] {\n position: absolute;\n width: 0;\n height: 0;\n opacity: 0;\n z-index: -1;\n }\n label.field.file {\n position: relative;\n min-width: 9em;\n height: 5em;\n }\n label.field.file:after {\n position: absolute;\n content: 'Choose a file';\n box-sizing: border-box;\n width: calc(100% - 0.3em);\n height: 2.5em;\n font-size: 1.1em;\n line-height: 1.5em;\n color: "+(primary.fg||"#222")+";\n text-align: "+(boxy?"center":"left")+";\n padding: 0.5em "+(boxy?"0.5em":"0")+";\n cursor: pointer;\n font-style: oblique;\n left: 0.25em;\n top: 1.6em;\n transition: 0.2s ease-in-out;\n transition-property: color, border-bolor, box-shadow;"+(boxy?"\n border-radius: "+(primary.radius||"0.2em")+";\n border-color: "+(primary.bc||"#ccc")+";\n border-style: solid;\n border-width: 0.0625em;":"\n border-bottom-color: "+(primary.bc||"#ccc")+";\n border-bottom-width: 0.0625em;\n border-bottom-style: solid;\n ")+"\n }\n label.field.file.inline:after {\n top: 0.2em;\n }\n\n label.field.button {\n vertical-align: top;\n padding-top: "+(boxy?"1.7":"1.958")+"em;\n }\n label.field .with-buttons button, label.field.button button {\n font-size: 1.1em;\n margin-top: "+(boxy?"0.15em":"0")+";\n }\n\n label.field .field-wrapper.with-buttons {\n display: flex;\n }\n label.field .with-buttons button {\n flex-shrink: 0;\n padding-left: 0.5em;\n padding-right: 0.5em;\n margin-top: 0;\n margin-right: 0;\n "+(boxy?"height: 2.5em;\n box-shadow: none;\n border-radius: 0;\n border-left: 1px solid "+(primary.bg||"#fff")+";\n margin-left: 0;":"height: 2.25em;")+"\n }"+(boxy?"\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 "+(primary.radius||"0.2em")+" "+(primary.radius||"0.2em")+" 0;\n }\n label.field .with-buttons input {\n border-radius: "+(primary.radius||"0.2em")+" 0 0 "+(primary.radius||"0.2em")+";\n min-width: 0;\n }\n ":"")+"\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n font-weight: normal;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1."+(boxy?"15":"1")+"em;\n }\n\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: "+(primary.fga||"#07e")+";\n color: "+(primary.bg||"#fff;")+";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1.2em;\n text-align: center;\n margin-top: -0.2em;\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n "}function noop(){}function focused(ev){if(!~this.className.indexOf("focus")){this.className+=" focus"}}function blurred(ev){this.className=this.className.replace(/\bfocus\b/g,"").trim()}export function field(node){var ctx=this.getContext(node);var isField,isCheck,isRadio,isArea,isSelect,isFile,isButton,isPlain,isInput;var change,attrs,desc,last;function invalidate(){var val=setup().split(/\s+/).filter(function(c){return!!c});isField=!!~val.indexOf("field");if(!isField){val.push("field");isField=true}isCheck=node.querySelector("input[type=checkbox]");if(isCheck&&!~val.indexOf("check")){val.push("check")}isRadio=node.querySelector("input[type=radio]");if(isRadio&&!~val.indexOf("radio")){val.push("radio")}var checkable=isCheck||isRadio;if(checkable&&checkable.checked&&!~val.indexOf("checked")){val.push("checked")}if(checkable&&checkable.disabled&&!~val.indexOf("disabled")){val.push("disabled")}if(!checkable&&change){change.cancel();change=0;if(attrs){attrs.disconnect();attrs=0}delete checkable._form_callback;if(last){delete last.checked;desc=last=undefined}}else if(checkable){checkable._form_callback=function(ev,init){if(init===void 0)init=true;if(init&&checkable.type==="radio"&&checkable.name){var list=[];list.push.apply(list,document.querySelectorAll("input[type=radio][name="+checkable.name+"]"));list=list.filter(function(i){return i!==checkable});list.forEach(function(l){return l._form_callback&&l._form_callback(ev,false)})}var checked=checkable.checked;if(checked&&!~node.className.indexOf("checked")){node.className+=" checked"}else if(!checked&&~node.className.indexOf("checked")){node.className=node.className.replace(/\bchecked\b/g,"").replace(/ +/g," ").trim()}};if(MutationObserver){attrs=new MutationObserver(function(){var val;val=checkable.disabled;if(val&&!~node.className.indexOf("disabled")){node.className+=" disabled"}else if(!val&&~node.className.indexOf("disabled")){node.className=node.className.replace(/\bdisabled\b/g,"").replace(/ +/g," ").trim()}});attrs.observe(checkable,{attributes:true})}change=this.getContext(checkable).listen("change",checkable._form_callback);desc=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(checkable),"checked");if(desc&&desc.configurable){last=checkable;Object.defineProperty(checkable,"checked",{get:desc.get,set:function set(v){desc.set.call(last,v);checkable._form_callback()},enumerable:true,configurable:true})}}isArea=!!node.querySelector("textarea");if(isArea&&!~val.indexOf("textarea")){val.push("textarea")}isSelect=!!node.querySelector("select");if(isSelect&&!~val.indexOf("select")){val.push("select")}isFile=!!node.querySelector("input[type=file]");if(isFile&&!~val.indexOf("file")){val.push("file")}isButton=node.querySelector("button");isButton=!!isButton&&isButton.parentNode===node;if(isButton&&!~val.indexOf("button")){val.push("button")}isPlain=!!node.querySelector("div");if(isPlain&&!~val.indexOf("plain")){val.push("plain")}isInput=!isCheck&&!isRadio&&!isFile&&!!node.querySelector("input");if(isInput&&!~val.indexOf("input")){val.push("input")}node.className=val.join(" ")}function setup(){var cls=node.className;if(!isField){cls=cls.replace(/\bfield\b/g,"").trim()}if(!isCheck){cls=cls.replace(/\bcheck(ed)?\b/g,"").trim()}if(!isRadio){cls=cls.replace(/\bradio\b/g,"").trim()}if(!isArea){cls=cls.replace(/\btextarea\b/g,"").trim()}if(!isSelect){cls=cls.replace(/\bselect\b/g,"").trim()}if(!isFile){cls=cls.replace(/\bfile\b/g,"").trim()}if(!isButton){cls=cls.replace(/\bbutton\b/g,"").trim()}if(!isPlain){cls=cls.replace(/\bplain\b/g,"").trim()}if(!isInput){cls=cls.replace(/\binput\b/g,"").trim()}cls=cls.replace(/ +/g," ");return cls}var focus=ctx.listen("focusin",focused);var blur=ctx.listen("focusout",blurred);invalidate.call(this);return{update:noop,invalidate:invalidate.bind(this),teardown:function teardown(){var cls=setup();cls=cls.replace(/\bfocus\b/g,"").trim();focus.cancel();blur.cancel();change&&change.cancel();if(attrs){attrs.disconnect()}if(last){delete last.checked;desc=last=undefined}node.className=cls}}}field.style=style;function findDeep(els,el){if(!els){return false}for(var i=0;i<els.length;i++){if(els[i].e===el){return true}if(els[i].f&&findDeep(els[i].f,el)){return true}}return false}export var macro=Ractive.macro(function(handle){var body=[];var attrs=(handle.template.m||[]).slice();var content=handle.template.f||[];var value=attrs.find(function(a){return a.n==="value"});var type=attrs.find(function(a){return a.n==="type"});var tip=attrs.find(function(a){return a.n==="tip"});if(tip){attrs.splice(attrs.indexOf(tip),1)}if(type&&typeof macro.types[type.f]==="function"){body.push.apply(body,macro.types[type.f](attrs,content,handle))}else if(value){var el={t:7,e:"input",m:[value]};if(findDeep(content,"option")){el.e="select";el.f=content}if(type){el.m.push(type);if(type.f==="checkbox"||type.f==="radio"){var target=attrs.find(function(a){return a.n==="target"});if(target){el.m.push(Object.assign({},target,{n:"name"}))}else{el.m.splice(el.m.indexOf(value),1,Object.assign({},value,{n:"checked"}))}}}el.m=el.m.concat(attrs.filter(function(a){return a.t===73||a.t===73||a.n==="placeholder"}));body.push(el);var btns=content.filter(function(e){return e.e==="button"||findDeep(e.f,"button")});if(btns.length){body.push.apply(body,btns);body=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:body}]}}else{var els=content.filter(function(e){return e.e});if(els.find(function(e){return e.e==="button"})&&els.length>1){body=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:content}]}else{body.push.apply(body,content)}}var label=attrs.find(function(a){return a.n==="label"});if(tip){body.unshift({t:7,e:"span",m:[{t:13,n:"class",f:"field-tip"+(!label?" field-solo-tip":""),g:1},{t:13,n:"title",f:tip.f},{t:70,n:["click"],f:{r:[],s:"[false]"}}],f:"?"})}if(label){body.unshift(label.f)}else{body.unshift(" ")}var outer={t:7,e:"label",m:[{t:71,n:"field"}].concat(attrs.filter(function(a){return a.t!==13&&a.t!==73||a.n!=="value"&&a.n!=="type"&&a.n!=="inline"&&a.n!=="label"&&a.n!=="placeholder"&&a.n!=="target"})),f:body};if(attrs.find(function(a){return a.n==="inline"})){outer.m.push({t:13,n:"class",f:"inline"})}handle.setTemplate([outer])});macro.types={};export function autofocus(node){if(typeof node.focus==="function"){node.focus()}return{teardown:noop}}export function plugin(opts){if(opts===void 0)opts={};return function(ref){var Ractive=ref.Ractive;var instance=ref.instance;if(!Ractive.isInstance(instance)){if(opts.includeStyle){if(instance===Ractive){Ractive.addCSS("form-decorator",style)}else{var css=instance.css;instance.css=function(data){var res=typeof css!=="function"?css||"":css(data);return res+style(data)}}}}instance.partials[opts.name||"field"]=macro;instance.decorators[opts.name||"field"]=field;instance.decorators[opts.autofocusName||"autofocus"]=autofocus}}globalRegister("field","decorators",field);globalRegister("field","partials",macro);globalRegister("autofocus","decorators",autofocus);export default plugin; |
@@ -17,8 +17,8 @@ export function scrolled(node, opts) { | ||
if (node.scrollTop <= allow) { str += ' top'; } | ||
else if (node.scrollTop >= node.scrollHeight - node.clientHeight - allow) { str += ' bottom'; } | ||
else { str += ' vmiddle'; } | ||
if (node.scrollTop >= node.scrollHeight - node.clientHeight - allow) { str += ' bottom'; } | ||
if (!~str.indexOf('top') && !~str.indexOf('bottom')) { str += ' vmiddle'; } | ||
if (node.scrollLeft <= allow) { str += ' left'; } | ||
else if (node.scrollLeft >= node.scrollWidth - node.clientWidth - allow) { str += ' right'; } | ||
else { str += ' hmiddle'; } | ||
if (node.scrollLeft >= node.scrollWidth - node.clientWidth - allow) { str += ' right'; } | ||
else if (!~str.indexOf('left') && !~str.indexOf('right')) { str += ' hmiddle'; } | ||
@@ -25,0 +25,0 @@ ctx.set(bind, str); |
@@ -1,1 +0,1 @@ | ||
export function scrolled(node,opts){if(opts===void 0)opts={};var bind=typeof opts==="string"?opts:opts.bind;if(typeof bind!=="string"){return{teardown:function teardown(){}}}var allow=opts.allow||2;var ctx=this.getContext(node);function watch(){var str="";if(node.scrollHeight>node.clientHeight){str+="vscroll"}if(node.scrollWidth>node.clientWidth){str+=(str?" ":"")+"hscroll"}if(node.scrollTop<=allow){str+=" top"}else if(node.scrollTop>=node.scrollHeight-node.clientHeight-allow){str+=" bottom"}else{str+=" vmiddle"}if(node.scrollLeft<=allow){str+=" left"}else if(node.scrollLeft>=node.scrollWidth-node.clientWidth-allow){str+=" right"}else{str+=" hmiddle"}ctx.set(bind,str)}node.addEventListener("scroll",watch,{passive:true});requestAnimationFrame(watch);return{refresh:watch,teardown:function teardown(){node.removeEventListener("scroll",watch)}}}export function plugin(options){if(options===void 0)options={};return function(ref){var instance=ref.instance;instance.decorators[options.name||"scrolled"]=scrolled}}export default plugin; | ||
export function scrolled(node,opts){if(opts===void 0)opts={};var bind=typeof opts==="string"?opts:opts.bind;if(typeof bind!=="string"){return{teardown:function teardown(){}}}var allow=opts.allow||2;var ctx=this.getContext(node);function watch(){var str="";if(node.scrollHeight>node.clientHeight){str+="vscroll"}if(node.scrollWidth>node.clientWidth){str+=(str?" ":"")+"hscroll"}if(node.scrollTop<=allow){str+=" top"}if(node.scrollTop>=node.scrollHeight-node.clientHeight-allow){str+=" bottom"}if(!~str.indexOf("top")&&!~str.indexOf("bottom")){str+=" vmiddle"}if(node.scrollLeft<=allow){str+=" left"}if(node.scrollLeft>=node.scrollWidth-node.clientWidth-allow){str+=" right"}else if(!~str.indexOf("left")&&!~str.indexOf("right")){str+=" hmiddle"}ctx.set(bind,str)}node.addEventListener("scroll",watch,{passive:true});requestAnimationFrame(watch);return{refresh:watch,teardown:function teardown(){node.removeEventListener("scroll",watch)}}}export function plugin(options){if(options===void 0)options={};return function(ref){var instance=ref.instance;instance.decorators[options.name||"scrolled"]=scrolled}}export default plugin; |
@@ -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}};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.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._setSort=function _setSort(idx,ev){var col=this.get("columns."+idx);if(!col||!(col.sort||col.filter)){return}var cs=col.sort||col.filter;var sort=cs;if(isString(sort)&&sort[0]==="~"){sort=this.get(sort)}var multi=ev.ctrlKey;var sorts=this.get("sort");if(!Array.isArray(sort)){sort=[sort]}if(!sorts){sorts=[]}else if(!Array.isArray(sorts)){sorts=[sorts]}if(!sorts.length){this.set("sort",sort.map(function(s){return""+(s===cs?col.dir||"+":"+")+s}))}else{var cur=sorts.map(function(s){return sortRE.exec(s).slice(1)});var overlap=sort.reduce(function(a,c){return a&&!!cur.find(function(s){return s[1]===c})},true);if(overlap&&sorts.length!==sort.length&&!multi){this.set("sort",sort.map(function(s){return"+"+sort}))}else if(!multi){if(overlap){this.set("sort",cur.map(function(s){return""+(s[0]==="+"?"-":"+")+s[1]}))}else{this.set("sort",sort.map(function(s){return""+(s===cs?col.dir||"+":"+")+s}))}}else{if(overlap){this.set("sort",cur.map(function(s){return~sort.indexOf(s[1])?""+(s[0]==="+"?"-":"+")+s[1]:s[0]+s[1]}))}else{this.set("sort",sorts.concat(sort.map(function(s){return""+(s===cs?col.dir||"+":"+")+s})))}}}};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))}};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)};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};Object.defineProperties(Table.prototype,prototypeAccessors);return Table}(Ractive);function columnGetter(table,col){if(!table||!col){return}if(typeof col.get==="function"){return col.get}var getters=table._getters||(table._getters={});var v=col.filter;if(isString(v)&&v.indexOf("~/")===0){v=table.get(v)}var k=Array.isArray(v)?v.join("."):isString(v)?v:false;if(!k){return}if(!getters[k]){if(isString(v)&&~v.indexOf("*")){var parts=Ractive.splitKeypath(v);getters[k]=function(obj){var res=applyPathReduce(obj,parts);return res.v||res.l}}else{if(isString(v)){v=Ractive.splitKeypath(v)}getters[k]=function(obj){return applyPath(obj,v)}}}return getters[k]}function fieldGetter(table,field){if(!table||!field){return}if(typeof field.get==="function"){return field.get}var getters=table._getters||(table._getters={});var v=field.path;if(isString(v)&&v.indexOf("~/")===0){v=table.get(v)}var k=Array.isArray(v)?v.join("."):isString(v)?v:false;if(k){if(!getters[k]){if(isString(v)&&~v.indexOf("*")){var parts=Ractive.splitKeypath(v);getters[k]=function(obj){var res=applyPathReduce(obj,parts);return res.v||res.l}}else{if(isString(v)){v=Ractive.splitKeypath(v)}getters[k]=function(obj){return applyPath(obj,v)}}}return getters[k]}else{v=field.value;if(isString(v)&&v.indexOf("~/")===0){v=table.get(v)}if(typeof v==="function"){return v}}}function scrollheader(node){var this$1=this;var scroll=function(ev){requestAnimationFrame(function(){return this$1.find(".rtable-header-fixed").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",t:13,f:[{t:2,x:{r:["~/scroll"],s:'!~(_0||"").indexOf("top")'}}]},{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:8,r:"grid-head"}]}],n:50,x:{r:["~/noHeader","~/fixedHeader"],s:"!_0&&_1"}}," ",{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"],s:"!_0&&_1"}},{t:4,f:[{n:"scrollheader",t:71}],n:50,x:{r:["~/fixedHeader","~/noWrap"],s:"_0&&_1"}}],f:[{t:7,e:"div",m:[{n:"grid",t:71,f:{r:[],s:'[{size:"~/tableWidth"}]'}},{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: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:{r:"~/shuffle"}}],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:8,r:"pagination"}],n:50,x:{r:["~/paginate"],s:'_0!=="virtual"'}}]}],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==="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":function(_0,_1){return!_0&&_1},'[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]':function(){return[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]},'["~/scroll"]':function(){return["~/scroll"]},"_0&&_1":function(_0,_1){return _0&&_1},'[{size:"~/tableWidth"}]':function(){return[{size:"~/tableWidth"}]},"!_0&&!_1":function(_0,_1){return!_0&&!_1},"!_0":function(_0){return!_0},'_0!=="virtual"':function(_0){return _0!=="virtual"},"(_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-bottom",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:{}},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-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 .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 \n .rtable-border .rtable-row-wrap {\n border-width: 0 1px 1px 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 1px;\n margin-left: -1px;\n width: 100%;\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||"#dedede")+";\n }\n .rtable-header-fixed {\n line-height: 1em;\n }\n \n .rtable-header.rtable-row-wrap {\n border-bottom: 2px solid "+(table.divider||primary.bc||"#ccc")+";\n }\n \n .rtable-top {\n flex-grow: 5;\n flex-shrink: 1;\n overflow-y: auto;\n margin: 0.5em 0;\n position: relative;\n }\n .rtable-fixed-header .rtable-header {\n margin-top: 0.5em;\n position: relative;\n z-index: 2;\n }\n .rtable-fixed-header.rtable-scrolled .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);\n z-index: 3;\n }\n .rtable-fixed-header .rtable-top {\n margin-top: 0;\n }\n .rtable-nowrap.rtable-fixed-header .rtable-top {\n margin-top: -3px;\n }\n .rtable-with-select.rtable-nowrap.rtable-fixed-header .rtable-top {\n margin-top: 0px;\n }\n .rtable-nowrap.rtable-fixed-header .rtable-header-fixed {\n flex-shrink: 0;\n width: 100%;\n overflow-x: auto;\n scrollbar-width: none;\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: 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: 2.1em;\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: calc(2.1em + 1px);\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 left: 0.1em;\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-bottom {\n display: flex;\n flex-wrap: wrap;\n flex-shrink: 0;\n padding: 0 0.5em 0.5em 0.5em;\n justify-content: space-between;\n user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n }\n \n .rtable-bottom > * {\n padding: 0.5em;\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: 0;\n left: 0;\n border-radius: 2em;\n transform: translate(-0.1em, 0) scale(1);\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: 1;\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: translate(0.2em, -0.3em) 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: translate(0.2em, -0.3em) 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: 4px;\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: 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","sort","helpers","fixed","allow-select","allow-select-all","border","fixed-header","valign","no-header","empty","shuffle","no-wrap"],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:{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 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)}});this._scrollListener.fn=fn$1;scroll.observer=this.observe("rows.length",function(){this$1.set("virtual.offset",null);fn$1()},{init:false,strict: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}},data:function data(){return Object.assign({page:0,selections:[],showGroups:true,allowGroupSelect:true,expanded:null,minPerPage:10,virtual:{offset:0},shuffle:true},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:{get:function get(){var this$1=this;var columns=this.viewmodel.value.columns;var fields=this.viewmodel.value.fields;var cols=columns.filter(function(c){return c.filter}).map(function(c){return columnGetter(this$1,c)}).filter(function(c){return c});var list=this.get("items")||[];var src=list;var filter=this.get("filter");var sort=this.get("sort");if(isObject(filter)&&!Array.isArray(filter)){filter=[filter]}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&&isString(v)&&re.test(v)){return true}}})}catch(e){}}else if(Array.isArray(filter)){var flts=buildFilter(this,filter,columns,fields);var recache={};try{list=list.filter(function(l){return flts.reduce(function(ok,flt){return ok&&applyFilter.call(this$1,flt,l,recache)},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=f[0]==="-"||f[0]==="+"?f.substr(1):f;var col=columns.find(function(c){return c.id===id});var fl=fields.find(function(c){return c.id===id});var res={dir:f[0]==="-"?-1:1,get:col&&columnGetter(this$1,col)||fl&&fieldGetter(this$1,fl)||columnGetter(this$1,{filter:id})};if(col&&col.type==="number"||fl&&fl.type==="number"){var get=res.get;res.get=function(v){return numberify(get.call(this,v))}}return res}else if(f&&typeof f==="object"){var col$1=columns.find(function(c){return c.id===f.id});var fl$1=fields.find(function(c){return c.id===f.id});var res$1={dir:isNumber(f.dir)?f.dir:f.dir==="desc"?-1:1,get:typeof f.get==="function"&&f.get||col$1&&columnGetter(this$1,col$1)||fl$1&&fieldGetter(this$1,fl$1)||f.path&&fieldGetter(this$1,{filter:f.path,value:f.value})};if(f.type==="number"||col$1&&col$1.type==="number"||fl$1&&fl$1.type==="number"){var get$1=res$1.get;res$1.get=function(v){return numberify(get$1.call(this,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(this$1,a);bb=sort[i].get.call(this$1,b);p=sort[i].dir*compare(aa,bb);if(p!==0){return p}}return p})}this.set("isFiltered",src.length!==list.length);return list}},visibleRows:{get:function get(){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:{get:function get(){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:{get:function get(){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}}}});function applyPath(src,path){if(path.length&&!src&&typeof src!=="object"){return}var res=src;for(var i=0;i<path.length;i++){res=res[path[i]];if(typeof res!=="object"||!res){return i+1<path.length?undefined:res}}return res}function applyPathReduce(src,path){if(!path.length){return{v:src}}if(path.length&&typeof src!=="object"){return{n:1}}var key=path[0];if(key==="*"&&Array.isArray(src)){var next=path.slice(1);return{l:src.reduce(function(a,c){var v=applyPathReduce(c,next);if(isObject(v)){if(v.v){a.push(v.v)}else if(v.l){a.push.apply(a,v.l)}else if(!v.n){a.push(v)}}else{a.push(v)}return a},[])}}else{return applyPathReduce(src[key],path.slice(1))}}function compare(a,b){return a<b?-1:a>b?1:a==b?0:!a&&b?-1:a&&!b?1:0}function buildFilter(grid,filter,columns,fields){return filter.map(function(f){var flt={op:f.op||"=",value:f.value||""};if(f.id){var field=columns.find(function(c){return c.id===f.id||c.filter===f.id});if(field){flt.get=columnGetter(grid,field);if(flt.get){flt.type=field.type||"string"}else{field=0}}if(!field){field=fields.find(function(c){return c.id===f.id});if(field){flt.get=fieldGetter(grid,field);flt.type=field.type||"string"}}}else{flt.op="skip"}if(f.op==="and"||f.op==="or"||f.op==="&&"||f.op==="||"){flt.op=f.op;if(Array.isArray(f.value)){flt.value=buildFilter(grid,f.value,columns,fields)}}return flt}).filter(function(f){return f.op!=="skip"})}function applyFilter(flt,item,recache){var this$1=this;if(!item||!flt.get&&flt.op!=="and"&&flt.op!=="or"&&flt.op!=="&&"&&flt.op!=="||"){return false}var v=flt.get&&flt.get.call(this,item);if(typeof flt.op==="function"){return flt.op.call(undefined,item)}var val=flt.value;if(flt.op==="="||flt.op==="=="||flt.op==="is"||flt.op==="eq"){if(flt.type==="number"||flt.type==="date"){return+v==+val}return v==val}else if(flt.op==="!="||flt.op==="<>"||flt.op==="ne"||flt.op==="is not"){if(flt.type==="number"||flt.type==="date"){return+v!=+val}return v!=val}else if(flt.op==="not"){return!v}else if(flt.op===">"||flt.op==="gt"){return numberify(v)>numberify(val)}else if(flt.op===">="||flt.op==="gte"){return numberify(v)>=numberify(val)}else if(flt.op==="<"||flt.op==="lt"){return numberify(v)<numberify(val)}else if(flt.op==="<="||flt.op==="lte"){return numberify(v)<=numberify(val)}else if(flt.op==="like"||flt.op==="notlike"||flt.op==="~"||flt.op==="!~"){var res=flt.op==="like"||flt.op==="~"?true:false;if(isString(val)){if(!val){return true}var re=recache[val]||(recache[val]=new RegExp(".*"+val.replace(/%/g,".*")+".*","gi"));res=re.test(v)}else if(isRegex(val)){res=val.test(v)}return flt.op==="like"||flt.op==="~"?res:!res}else if(flt.op==="contains"||flt.op==="@"){if(Array.isArray(v)){return!!~v.indexOf(val)}}else if(flt.op==="containslike"||flt.op==="@~"||flt.op==="containsnotlike"||flt.op==="@!~"){if(Array.isArray(v)){var re$1=isRegex(val)?val:isString(val)?recache[val]||(recache[val]=new RegExp(".*"+val.replace(/%/g,".*")+".*","gi")):null;if(!re$1){return false}var match=v.findIndex(function(x){return re$1.test((x||"").toString())});return flt.op==="containslike"||flt.op==="@~"?match>=0:match<0}}else if((flt.op==="not in"||flt.op==="in")&&Array.isArray(val)){return flt.op==="not in"?!~val.indexOf(v):!!~val.indexOf(v)}else if((flt.op==="or"||flt.op==="||")&&Array.isArray(val)){return val.reduce(function(a,c){return a||applyFilter.call(this$1,c,item,recache)},false)}else if((flt.op==="and"||flt.op==="&&")&&Array.isArray(val)){return val.reduce(function(a,c){return a&&applyFilter.call(this$1,c,item,recache)},true)}return true}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)}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,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=map(col.fixed)}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"});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;var sortKey="[_0._setSort(_1,_2)]";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"}]};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){div.m.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:"~/columns."+cidx+".fixed"}]});div.m.push({t:4,n:50,x:{r:["~/noWrap","~/columns."+cidx+".fixed"],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:"~/columns."+cidx+".fixed"}]}]})}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:"."}}]}];if(c.attrs.length){c.attrsP=c.attrs;c.attrs=[{t:16,r:"~/columns."+cidx+".attrsP",c:{r:"."}}]}else{c.attrs=[]}var attrs=c.attrs;if(c.fixed){attrs.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:"~/columns."+cidx+".fixed"}]});attrs.push({t:4,n:50,x:{r:["~/noWrap","~/columns."+cidx+".fixed"],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:"~/columns."+cidx+".fixed"}]}]})}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:"."}})}if(wrapperEl&&wrapperEl.m&&wrapperEl.m.length){this._init.sets.wrapperAttrs=wrapperEl.m.slice();row[0].m.push({t:16,r:"~/wrapperAttrs",c:{r:"."}})}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"],s:"_1?'calc('+(_0-3)+'px - 2em)':(_0-3)+'px'"}}]}]}],f:[{t:16,r:"~/meta.extra",c:{r:"."}}]})}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:"."}}]}],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"],s:"_1?'calc('+(_0-3)+'px - 2em)':(_0-3)+'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.inclideGrid",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}};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.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._setSort=function _setSort(idx,ev){var col=this.get("columns."+idx);if(!col||!(col.sort||col.filter)){return}var cs=col.sort||col.filter;var sort=cs;if(isString(sort)&&sort[0]==="~"){sort=this.get(sort)}var multi=ev.ctrlKey;var sorts=this.get("sort");if(!Array.isArray(sort)){sort=[sort]}if(!sorts){sorts=[]}else if(!Array.isArray(sorts)){sorts=[sorts]}if(!sorts.length){this.set("sort",sort.map(function(s){return""+(s===cs?col.dir||"+":"+")+s}))}else{var cur=sorts.map(function(s){return sortRE.exec(s).slice(1)});var overlap=sort.reduce(function(a,c){return a&&!!cur.find(function(s){return s[1]===c})},true);if(overlap&&sorts.length!==sort.length&&!multi){this.set("sort",sort.map(function(s){return"+"+sort}))}else if(!multi){if(overlap){this.set("sort",cur.map(function(s){return""+(s[0]==="+"?"-":"+")+s[1]}))}else{this.set("sort",sort.map(function(s){return""+(s===cs?col.dir||"+":"+")+s}))}}else{if(overlap){this.set("sort",cur.map(function(s){return~sort.indexOf(s[1])?""+(s[0]==="+"?"-":"+")+s[1]:s[0]+s[1]}))}else{this.set("sort",sorts.concat(sort.map(function(s){return""+(s===cs?col.dir||"+":"+")+s})))}}}};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)};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};Object.defineProperties(Table.prototype,prototypeAccessors);return Table}(Ractive);function columnGetter(table,col){if(!table||!col){return}if(typeof col.get==="function"){return col.get}var getters=table._getters||(table._getters={});var v=col.filter;if(isString(v)&&v.indexOf("~/")===0){v=table.get(v)}var k=Array.isArray(v)?v.join("."):isString(v)?v:false;if(!k){return}if(!getters[k]){if(isString(v)&&~v.indexOf("*")){var parts=Ractive.splitKeypath(v);getters[k]=function(obj){var res=applyPathReduce(obj,parts);return res.v||res.l}}else{if(isString(v)){v=Ractive.splitKeypath(v)}getters[k]=function(obj){return applyPath(obj,v)}}}return getters[k]}function fieldGetter(table,field){if(!table||!field){return}if(typeof field.get==="function"){return field.get}var getters=table._getters||(table._getters={});var v=field.path;if(isString(v)&&v.indexOf("~/")===0){v=table.get(v)}var k=Array.isArray(v)?v.join("."):isString(v)?v:false;if(k){if(!getters[k]){if(isString(v)&&~v.indexOf("*")){var parts=Ractive.splitKeypath(v);getters[k]=function(obj){var res=applyPathReduce(obj,parts);return res.v||res.l}}else{if(isString(v)){v=Ractive.splitKeypath(v)}getters[k]=function(obj){return applyPath(obj,v)}}}return getters[k]}else{v=field.value;if(isString(v)&&v.indexOf("~/")===0){v=table.get(v)}if(typeof v==="function"){return v}}}function scrollheader(node){var this$1=this;var scroll=function(ev){requestAnimationFrame(function(){return this$1.find(".rtable-header-fixed").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},{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: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},{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"}]'}},{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: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:{r:"~/shuffle"}}],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:"selcted"}},{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"}]':function(){return[{size:"~/tableWidth"}]},"!_0&&!_1":function(_0,_1){return!_0&&!_1},"!_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-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 .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 \n .rtable-border .rtable-row-wrap {\n border-width: 0 1px 1px 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 1px;\n margin-left: -1px;\n width: 100%;\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 }\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: 3;\n }\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-top {\n margin-top: -3px;\n }\n .rtable-nowrap.rtable-fixed-header .rtable-header-fixed {\n flex-shrink: 0;\n width: 100%;\n overflow-x: auto;\n scrollbar-width: none;\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: 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: 2.1em;\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: calc(2.1em + 1px);\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 left: 0.1em;\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: 0;\n left: 0;\n border-radius: 2em;\n transform: translate(-0.1em, 0) scale(1);\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: 1;\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: translate(0.2em, -0.3em) 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: translate(0.2em, -0.3em) 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: 4px;\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: 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","sort","helpers","fixed","allow-select","allow-select-all","border","fixed-header","valign","no-header","empty","shuffle","no-wrap"],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:{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 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)}});this._scrollListener.fn=fn$1;scroll.observer=this.observe("rows.length",function(){this$1.set("virtual.offset",null);fn$1()},{init:false,strict: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:true},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:{get:function get(){var this$1=this;var columns=this.viewmodel.value.columns;var fields=this.viewmodel.value.fields;var cols=columns.filter(function(c){return c.filter}).map(function(c){return columnGetter(this$1,c)}).filter(function(c){return c});var list=this.get("items")||[];var src=list;var filter=this.get("filter");var sort=this.get("sort");if(isObject(filter)&&!Array.isArray(filter)){filter=[filter]}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&&isString(v)&&re.test(v)){return true}}})}catch(e){}}else if(Array.isArray(filter)){var flts=buildFilter(this,filter,columns,fields);var recache={};try{list=list.filter(function(l){return flts.reduce(function(ok,flt){return ok&&applyFilter.call(this$1,flt,l,recache)},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=f[0]==="-"||f[0]==="+"?f.substr(1):f;var col=columns.find(function(c){return c.id===id});var fl=fields.find(function(c){return c.id===id});var res={dir:f[0]==="-"?-1:1,get:col&&columnGetter(this$1,col)||fl&&fieldGetter(this$1,fl)||columnGetter(this$1,{filter:id})};if(col&&col.type==="number"||fl&&fl.type==="number"){var get=res.get;res.get=function(v){return numberify(get.call(this,v))}}return res}else if(f&&typeof f==="object"){var col$1=columns.find(function(c){return c.id===f.id});var fl$1=fields.find(function(c){return c.id===f.id});var res$1={dir:isNumber(f.dir)?f.dir:f.dir==="desc"?-1:1,get:typeof f.get==="function"&&f.get||col$1&&columnGetter(this$1,col$1)||fl$1&&fieldGetter(this$1,fl$1)||f.path&&fieldGetter(this$1,{filter:f.path,value:f.value})};if(f.type==="number"||col$1&&col$1.type==="number"||fl$1&&fl$1.type==="number"){var get$1=res$1.get;res$1.get=function(v){return numberify(get$1.call(this,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(this$1,a);bb=sort[i].get.call(this$1,b);p=sort[i].dir*compare(aa,bb);if(p!==0){return p}}return p})}this.set("isFiltered",src.length!==list.length);return list}},visibleRows:{get:function get(){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:{get:function get(){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:{get:function get(){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}}}});function applyPath(src,path){if(path.length&&!src&&typeof src!=="object"){return}var res=src;for(var i=0;i<path.length;i++){res=res[path[i]];if(typeof res!=="object"||!res){return i+1<path.length?undefined:res}}return res}function applyPathReduce(src,path){if(!path.length){return{v:src}}if(path.length&&typeof src!=="object"){return{n:1}}var key=path[0];if(key==="*"&&Array.isArray(src)){var next=path.slice(1);return{l:src.reduce(function(a,c){var v=applyPathReduce(c,next);if(isObject(v)){if(v.v){a.push(v.v)}else if(v.l){a.push.apply(a,v.l)}else if(!v.n){a.push(v)}}else{a.push(v)}return a},[])}}else{return applyPathReduce(src[key],path.slice(1))}}function compare(a,b){return a<b?-1:a>b?1:a==b?0:!a&&b?-1:a&&!b?1:0}function buildFilter(grid,filter,columns,fields){return filter.map(function(f){var flt={op:f.op||"=",value:f.value||""};if(f.id){var field=columns.find(function(c){return c.id===f.id||c.filter===f.id});if(field){flt.get=columnGetter(grid,field);if(flt.get){flt.type=field.type||"string"}else{field=0}}if(!field){field=fields.find(function(c){return c.id===f.id});if(field){flt.get=fieldGetter(grid,field);flt.type=field.type||"string"}}}else{flt.op="skip"}if(f.op==="and"||f.op==="or"||f.op==="&&"||f.op==="||"){flt.op=f.op;if(Array.isArray(f.value)){flt.value=buildFilter(grid,f.value,columns,fields)}}return flt}).filter(function(f){return f.op!=="skip"})}function applyFilter(flt,item,recache){var this$1=this;if(!item||!flt.get&&flt.op!=="and"&&flt.op!=="or"&&flt.op!=="&&"&&flt.op!=="||"){return false}var v=flt.get&&flt.get.call(this,item);if(typeof flt.op==="function"){return flt.op.call(undefined,item)}var val=flt.value;if(flt.op==="="||flt.op==="=="||flt.op==="is"||flt.op==="eq"){if(flt.type==="number"||flt.type==="date"){return+v==+val}return v==val}else if(flt.op==="!="||flt.op==="<>"||flt.op==="ne"||flt.op==="is not"){if(flt.type==="number"||flt.type==="date"){return+v!=+val}return v!=val}else if(flt.op==="not"){return!v}else if(flt.op===">"||flt.op==="gt"){return numberify(v)>numberify(val)}else if(flt.op===">="||flt.op==="gte"){return numberify(v)>=numberify(val)}else if(flt.op==="<"||flt.op==="lt"){return numberify(v)<numberify(val)}else if(flt.op==="<="||flt.op==="lte"){return numberify(v)<=numberify(val)}else if(flt.op==="like"||flt.op==="notlike"||flt.op==="~"||flt.op==="!~"){var res=flt.op==="like"||flt.op==="~"?true:false;if(isString(val)){if(!val){return true}var re=recache[val]||(recache[val]=new RegExp(".*"+val.replace(/%/g,".*")+".*","gi"));res=re.test(v)}else if(isRegex(val)){res=val.test(v)}return flt.op==="like"||flt.op==="~"?res:!res}else if(flt.op==="contains"||flt.op==="@"){if(Array.isArray(v)){return!!~v.indexOf(val)}}else if(flt.op==="containslike"||flt.op==="@~"||flt.op==="containsnotlike"||flt.op==="@!~"){if(Array.isArray(v)){var re$1=isRegex(val)?val:isString(val)?recache[val]||(recache[val]=new RegExp(".*"+val.replace(/%/g,".*")+".*","gi")):null;if(!re$1){return false}var match=v.findIndex(function(x){return re$1.test((x||"").toString())});return flt.op==="containslike"||flt.op==="@~"?match>=0:match<0}}else if((flt.op==="not in"||flt.op==="in")&&Array.isArray(val)){return flt.op==="not in"?!~val.indexOf(v):!!~val.indexOf(v)}else if((flt.op==="or"||flt.op==="||")&&Array.isArray(val)){return val.reduce(function(a,c){return a||applyFilter.call(this$1,c,item,recache)},false)}else if((flt.op==="and"||flt.op==="&&")&&Array.isArray(val)){return val.reduce(function(a,c){return a&&applyFilter.call(this$1,c,item,recache)},true)}return true}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)}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=map(col.fixed)}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 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"}]};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){div.m.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:"~/columns."+cidx+".fixed"}]});div.m.push({t:4,n:50,x:{r:["~/noWrap","~/columns."+cidx+".fixed"],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:"~/columns."+cidx+".fixed"}]}]})}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:"."}}]}];if(c.attrs.length){c.attrsP=c.attrs;c.attrs=[{t:16,r:"~/columns."+cidx+".attrsP",c:{r:"."}}]}else{c.attrs=[]}var attrs=c.attrs;if(c.fixed){attrs.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:"~/columns."+cidx+".fixed"}]});attrs.push({t:4,n:50,x:{r:["~/noWrap","~/columns."+cidx+".fixed"],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:"~/columns."+cidx+".fixed"}]}]})}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:"."}})}if(wrapperEl&&wrapperEl.m&&wrapperEl.m.length){this._init.sets.wrapperAttrs=wrapperEl.m.slice();row[0].m.push({t:16,r:"~/wrapperAttrs",c:{r:"."}})}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"],s:"_1?'calc('+(_0-3)+'px - 2em)':(_0-3)+'px'"}}]}]}],f:[{t:16,r:"~/meta.extra",c:{r:"."}}]})}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:"."}}]}],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"],s:"_1?'calc('+(_0-3)+'px - 2em)':(_0-3)+'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; |
{ | ||
"name": "@evs-chris/raui", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Components, decorators, and helpers for Ractive apps that are generally Material-ish", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/evs-chris/raui", |
@@ -146,4 +146,7 @@ // TODO: support for non-numeric formats? | ||
const g = groupForPos(groups, node.selectionStart); | ||
if (updateValues(groups, g, node.selectionStart, true)) updateDisplay(groups, node); | ||
const idx = groups.indexOf(g); | ||
if (updateValues(groups, g, node.selectionStart, true)) { | ||
updateDisplay(groups, node); | ||
applyValues(groups, sendValue, ev.shiftKey && idx > 0 || !ev.shiftKey && idx + 1 < groups.length); | ||
} | ||
if (ev.shiftKey && idx > 0) { | ||
@@ -150,0 +153,0 @@ node.setSelectionRange(groups[idx - 1].start, groups[idx - 1].end); |
@@ -509,2 +509,3 @@ import globalRegister from './globalRegister'; | ||
top: 2.4em; | ||
font-weight: normal; | ||
} | ||
@@ -831,2 +832,2 @@ | ||
export default plugin; | ||
export default plugin; |
@@ -15,8 +15,8 @@ export function scrolled(node, opts = {}) { | ||
if (node.scrollTop <= allow) str += ' top'; | ||
else if (node.scrollTop >= node.scrollHeight - node.clientHeight - allow) str += ' bottom'; | ||
else str += ' vmiddle'; | ||
if (node.scrollTop >= node.scrollHeight - node.clientHeight - allow) str += ' bottom'; | ||
if (!~str.indexOf('top') && !~str.indexOf('bottom')) str += ' vmiddle'; | ||
if (node.scrollLeft <= allow) str += ' left'; | ||
else if (node.scrollLeft >= node.scrollWidth - node.clientWidth - allow) str += ' right'; | ||
else str += ' hmiddle'; | ||
if (node.scrollLeft >= node.scrollWidth - node.clientWidth - allow) str += ' right'; | ||
else if (!~str.indexOf('left') && !~str.indexOf('right')) str += ' hmiddle'; | ||
@@ -23,0 +23,0 @@ ctx.set(bind, str); |
@@ -448,3 +448,3 @@ (function (global, factory) { | ||
return ("\n label.field {\n display: inline-block;\n font-size: 0.9em;\n font-weight: 500;\n color: " + (primary.fg || '#222') + ";\n transition: 0.2s ease-in-out;\n transition-property: color;\n vertical-align: top;\n box-sizing: border-box;\n padding: 0.25em 0.5em;\n line-height: 1.5em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: inherit;\n }\n\n label.field.textarea {\n display: block;\n border: 0.0625em solid " + (primary.bc || '#ccc') + ";\n padding: 0.5em 0.8em 0.8em 0.8em;\n border-radius: " + (primary.radius || '0.2em') + ";\n box-shadow: none;\n transition-property: color, border-color, box-shadow;\n margin: 0.8em 0.2em;\n min-height: auto;\n background-color: " + (boxy ? primary.bg || '#fff' : 'transparent') + ";\n }\n\n label.field.focus {\n color: " + (active.fg || primary.fga || '#07e') + ";\n }\n\n label.field.textarea.focus {\n border-color: " + (active.fg || primary.fga || '#07e') + ";\n " + (!boxy ? ("box-shadow: 0.0625em 0.0625em " + (active.fg || primary.fga || '#07e') + ",\n -0.0625em 0.0625em " + (active.fg || primary.fga || '#07e') + ",\n 0.0625em -0.0625em " + (active.fg || primary.fga || '#07e') + ",\n -0.0625em -0.0625em " + (active.fg || primary.fga || '#07e') + ";") : '') + "\n }\n\n label.field input,\n label.field select,\n label.field textarea\n {\n display: block;\n border-width: " + (boxy ? '0.0625em' : '0 0 0.0625em 0') + ";\n border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n box-sizing: border-box;\n background-color: " + (boxy ? primary.bg || '#fff' : 'transparent') + ";\n transition: 0.2s ease-in-out;\n transition-property: box-shadow, color;\n outline: none;\n box-shadow: none;\n width: 100%;\n margin-bottom: 0.8em;\n font-size: 1.1em;" + (boxy ? ("\n border-radius: " + (primary.radius || '0.2em') + ";") : '') + "\n font-weight: 400;\n font-family: inherit;\n }\n\n label.field input" + (boxy ? '' : ':disabled') + ",\n label.field select" + (boxy ? '' : ':disabled') + " {\n padding: 0 0.75em;\n }\n label.field select" + (boxy ? '' : ':disabled') + " {\n padding-right: 2em;\n }\n\n label.field input:disabled,\n label.field select:disabled,\n label.field textarea:disabled {\n background: #f4f4f4;\n }\n\n label.field textarea {\n line-height: 1.2em;\n }\n label.field .field-wrapper {\n display: block;\n }\n label.field > select, label.field > input,\n label.field > .field-wrapper > input, label.field > .field-wrapper > select {\n height: 2.5em;\n }\n\n " + (!boxy ? ("label.field:hover > input,\n label.field:hover select,\n label.field.file:hover:after {\n box-shadow: 0 0.0625em 0 0 " + (primary.bc || '#ccc') + ";\n }\n\n label.field.textarea:hover {\n box-shadow: 0.0625em 0.0625em " + (primary.bc || '#ccc') + ",\n -0.0625em 0.0625em " + (primary.bc || '#ccc') + ",\n 0.0625em -0.0625em " + (primary.bc || '#ccc') + ",\n -0.0625em -0.0625em " + (primary.bc || '#ccc') + ";\n }\n\n label.field.textarea.focus:hover {\n box-shadow: 0.0625em 0.0625em " + (active.fg || primary.fga || '#07e') + ",\n -0.0625em 0.0625em " + (active.fg || primary.fga || '#07e') + ",\n 0.0625em -0.0625em " + (active.fg || primary.fga || '#07e') + ",\n -0.0625em -0.0625em " + (active.fg || primary.fga || '#07e') + ";\n }") : '') + "\n\n /**** CHECK BOXES ****/\n\n label.field.check {\n position:relative;\n z-index: 0;\n overflow: visible;\n cursor: pointer;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.check.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: -3px;\n top: 23px;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n background-color: " + (primary.bc || '#ccc') + ";\n box-shadow: none;\n outline: none;\n opacity: 0;\n transform: scale(1);\n pointer-events: none;\n transition: opacity 0.3s, transform 0.2s;\n }\n label.field.inline.check input {\n top: 3px;\n left: -3px;\n }\n\n label.field.check input:checked {\n background-color: " + (primary.fga || '#07e') + ";\n }\n\n label.field.check:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before {\n content: \"\";\n display: inline-block;\n box-sizing: border-box;\n margin: 3px 11px 3px 1px;\n border: solid 2px; /* Safari */\n border-color: " + (primary.fg || '#222') + ";\n border-radius: 2px;\n width: 18px;\n height: 18px;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after {\n content: \"\";\n display: block;\n position: absolute;\n top: 0px;\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.8em, 2.65em) rotate(-45deg);\n }\n\n label.field.check.inline:after {\n transform: translate(0.8em, 1.2em) rotate(-45deg);\n }\n\n label.field.check.checked:before {\n border-color: " + (primary.fga || '#07e') + ";\n background-color: " + (primary.fga || '#07e') + ";\n }\n label.field.check.focus:before {\n border-color: " + (primary.fga || '#07e') + ";\n }\n\n label.field.check.checked:after {\n border-color: " + (primary.bg || '#fff') + ";\n }\n\n label.field.check input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled {\n color: " + (primary.bc || '#ccc') + ";\n cursor: initial;\n }\n\n label.field.check.disabled:before {\n border-color: " + (primary.bc || '#ccc') + ";\n }\n\n label.field.check.checked.disabled:before {\n border-color: transparent;\n background-color: " + (primary.bc || '#ccc') + ";\n }\n\n\n /**** RADIO BUTTONS ****/\n \n label.field.radio {\n z-index: 0;\n position: relative;\n display: inline-block;\n overflow: visible;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.radio.inline {\n padding-top: 0.8em;\n }\n\n label.field.radio input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: 0;\n top: 0;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 41px;\n height: 40px;\n background-color: " + (primary.bc || '#ccc') + ";\n outline: none;\n opacity: 0;\n pointer-events: none;\n transform: translate(-0.2em, 24px) scale(1);\n transition: opacity 0.3s, transform 0.3s;\n }\n label.field.inline.radio input {\n transform: translate(-0.2em, 3px) scale(1);\n }\n\n label.field.radio {\n cursor: pointer;\n position: relative;\n }\n\n label.field.radio:before {\n content: \"\";\n display: inline-block;\n box-sizing: border-box;\n margin: 2px 10px 2px 0;\n border: solid 2px; /* Safari */\n border-color: " + (primary.fg || '#222') + ";\n border-radius: 50%;\n width: 20px;\n height: 20px;\n vertical-align: middle;\n transition: border-color 0.2s;\n }\n\n label.field.radio:after {\n content: \"\";\n display: block;\n position: absolute;\n border-radius: 50%;\n width: 10px;\n height: 10px;\n background-color: " + (primary.fga || '#07e') + ";\n transform: translate(5px, -17px) scale(0);\n transition: transform 0.2s;\n }\n\n label.field.radio input:checked {\n background-color: " + (primary.fga || '#07e') + ";\n }\n\n label.field.radio.checked:before {\n border-color: " + (primary.fga || '#07e') + ";\n }\n\n label.field.radio.checked:after {\n transform: translate(5px, -17px) scale(1);\n }\n\n label.field.radio:hover input {\n opacity: 0.04;\n }\n\n label.field.radio input:focus {\n opacity: 0.12;\n transform: translate(-0.2em, 24px) scale(1);\n transition: transform 0.2s, opacity 0.2s;\n }\n label.field.inline.radio input:focus {\n transform: translate(-0.2em, 3px) scale(1);\n }\n\n label.field.radio:hover input:focus {\n opacity: 0.16;\n }\n\n label.field.radio input:active {\n opacity: 1;\n transform: translate(-0.2em, 24px) scale(0);\n transition: transform 0s, opacity 0s;\n }\n label.field.inline.radio input:active {\n transform: translate(-0.2em, 3px) scale(0);\n }\n\n label.field.radio.checked:before {\n border-color: " + (primary.fga || '#07e') + ";\n }\n\n label.field.radio.focus:before {\n border-color: " + (primary.fga || '#07e') + ";\n }\n\n label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.radio.disabled {\n color: " + (primary.bc || '#ccc') + ";\n cursor: initial;\n }\n\n label.field.radio.disabled:before {\n border-color: " + (primary.bc || '#ccc') + ";\n }\n\n label.field.radio.disabled:after {\n background-color: " + (primary.bc || '#ccc') + ";\n }\n\n\n\n label.field select {\n padding-right: 2em;\n }\n\n label.field.select {\n cursor: pointer;\n position: relative;\n }\n\n label.field.select:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n right: 19px;\n height: 0.6em;\n top: 2.6em;\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n pointer-events: none;\n color: " + (primary.bc || '#ccc') + ";\n }\n\n label.field textarea {\n border: none;" + (boxy ? "\n padding: 0;" : '') + "\n }\n\n label.field > select {\n -moz-appearance: none;\n -webkit-appearance: none;\n }\n\n label.field input:focus,\n label.field select:focus,\n label.field.file.focus:after\n {\n border-color: " + (active.fg || primary.fga || '#07e') + ";\n " + (!boxy ? ("box-shadow: 0 0.0625em 0 0 " + (active.fg || primary.fga || '#07e') + ";") : '') + "\n }\n\n label.field input[type=checkbox]:focus,\n label.field input[type=radio]:focus {\n box-shadow: none;\n }\n\n label.field.file.focus:after {\n color: " + (active.fg || primary.fga || '#07e') + ";\n }\n label.field.file [type=file] {\n position: absolute;\n width: 0;\n height: 0;\n opacity: 0;\n z-index: -1;\n }\n label.field.file {\n position: relative;\n min-width: 9em;\n height: 5em;\n }\n label.field.file:after {\n position: absolute;\n content: 'Choose a file';\n box-sizing: border-box;\n width: calc(100% - 0.3em);\n height: 2.5em;\n font-size: 1.1em;\n line-height: 1.5em;\n color: " + (primary.fg || '#222') + ";\n text-align: " + (boxy ? 'center' : 'left') + ";\n padding: 0.5em " + (boxy ? '0.5em' : '0') + ";\n cursor: pointer;\n font-style: oblique;\n left: 0.25em;\n top: 1.6em;\n transition: 0.2s ease-in-out;\n transition-property: color, border-bolor, box-shadow;" + (boxy ? ("\n border-radius: " + (primary.radius || '0.2em') + ";\n border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n border-width: 0.0625em;") : ("\n border-bottom-color: " + (primary.bc || '#ccc') + ";\n border-bottom-width: 0.0625em;\n border-bottom-style: solid;\n ")) + "\n }\n label.field.file.inline:after {\n top: 0.2em;\n }\n\n label.field.button {\n vertical-align: top;\n padding-top: " + (boxy ? '1.7' : '1.958') + "em;\n }\n label.field .with-buttons button, label.field.button button {\n font-size: 1.1em;\n margin-top: " + (boxy ? '0.15em' : '0') + ";\n }\n\n label.field .field-wrapper.with-buttons {\n display: flex;\n }\n label.field .with-buttons button {\n flex-shrink: 0;\n padding-left: 0.5em;\n padding-right: 0.5em;\n margin-top: 0;\n margin-right: 0;\n " + (boxy ? ("height: 2.5em;\n box-shadow: none;\n border-radius: 0;\n border-left: 1px solid " + (primary.bg || '#fff') + ";\n margin-left: 0;") : | ||
"height: 2.25em;") + "\n }" + (boxy ? ("\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 " + (primary.radius || '0.2em') + " " + (primary.radius || '0.2em') + " 0;\n }\n label.field .with-buttons input {\n border-radius: " + (primary.radius || '0.2em') + " 0 0 " + (primary.radius || '0.2em') + ";\n min-width: 0;\n }\n ") : '') + "\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1." + (boxy ? '15' : '1') + "em;\n }\n\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: " + (primary.fga || '#07e') + ";\n color: " + (primary.bg || '#fff;') + ";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1.2em;\n text-align: center;\n margin-top: -0.2em;\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n "); | ||
"height: 2.25em;") + "\n }" + (boxy ? ("\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 " + (primary.radius || '0.2em') + " " + (primary.radius || '0.2em') + " 0;\n }\n label.field .with-buttons input {\n border-radius: " + (primary.radius || '0.2em') + " 0 0 " + (primary.radius || '0.2em') + ";\n min-width: 0;\n }\n ") : '') + "\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n font-weight: normal;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1." + (boxy ? '15' : '1') + "em;\n }\n\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: " + (primary.fga || '#07e') + ";\n color: " + (primary.bg || '#fff;') + ";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1.2em;\n text-align: center;\n margin-top: -0.2em;\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n "); | ||
// TODO: other themes | ||
@@ -451,0 +451,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.RMAutocomplete={},e.Ractive)}(this,function(e,t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var n="undefined"!=typeof window?window:null;function i(e,t,i){if(n&&n.Ractive&&"object"==typeof n.Ractive[t]){var o=document.currentScript;if(o||(o=(o=document.querySelectorAll("script"))[o.length-1]),o){var r=o.getAttribute("data-alias");r&&(r=(r=r.split("&")).reduce(function(e,t){var n=t.split("="),i=n[0],o=n[1];return e[i]=o,e},{})),Ractive[t][r&&r[e]||e]=i}}}function o(e,t){void 0===t&&(t={});var n=e.processParams(t,{duration:400,easing:"easeInOut"});t.dir=t.dir||!1;var i=t.distance||"20px",o=t.scale||"0.9",r="above"===t.dir?"translateY("+i+")":"left"===t.dir?"translateX("+i+")":"right"===t.dir?"translateX(-"+i+")":"translateY(-"+i+")";return e.isIntro||n.intro?(e.setStyle("opacity",0),e.setStyle("transform","scale("+o+") "+r),e.animateStyle({opacity:1,transform:"none"},n)):(e.setStyle("opacity",1),e.setStyle("transform","none"),e.animateStyle({opacity:0,transform:"scale("+o+") "+r},n))}function r(e){return void 0===e&&(e={}),function(t){t.instance.transitions[e.name||"pop"]=o}}function a(e,t){var n=!1,i=!1;function o(n){for(var i=n.target;i;){if(i===e)return;if(!i.parentNode&&i!==document)return;i=i.parentNode}t(n)}return setTimeout(function(){n=!0,i||(document.body.addEventListener("click",o),document.body.addEventListener("touchstop",o))}),{teardown:function(){i=!0,n&&(document.body.removeEventListener("click",o),document.body.removeEventListener("touchstop",o))}}}function l(e,t){var n=e.processParams(t,{duration:200,easing:"easeInOut"});return e.isIntro||n.intro?(e.setStyle("opacity",0),e.animateStyle("opacity",1,n)):(e.setStyle("opacity",1),e.animateStyle("opacity",0,n))}function c(e){return void 0===e&&(e={}),function(t){t.instance.transitions[e.name||"fade"]=l}}i("pop","transitions",o),i("fade","transitions",l);var s,p,f,d={v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-wrapper",g:1},{n:"class-rpop-with-tail",t:13,f:[{t:2,r:"position.tail"}]},{n:"class",f:["rpop-",{t:2,x:{r:["where"],s:'_0||"below"'}}," rpop-align-",{t:2,x:{r:["align"],s:'_0||"middle"'}}],t:13},{t:4,f:[{n:"style-top",f:[{t:2,r:"position.popTop"},"px"],t:13},{n:"style-left",f:[{t:2,r:"position.popLeft"},"px"],t:13}],n:50,r:"position"},{t:4,f:[{t:4,f:[{n:"style-top",f:[{t:2,r:"top"}],t:13}],n:50,r:"top"},{t:4,f:[{n:"style-left",f:[{t:2,r:"left"}],t:13}],n:50,r:"left"}],n:51,l:1},{n:"pop",t:72,f:{r:["where"],s:'[{dir:_0||"below"}]'},v:"t2"},{n:"cleanup",t:71},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:50,r:"clickClose"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:51,r:"noClickout"},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailRight"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail-outer",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailRight"}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content"}]}]}],n:50,r:"__popped"}],e:{'_0||"below"':function(e){return e||"below"},'_0||"middle"':function(e){return e||"middle"},'[{dir:_0||"below"}]':function(e){return[{dir:e||"below"}]},'[_0.set("popped",false)]':function(e){return[e.set("popped",!1)]},"_0+(_1?1:0)":function(e,t){return e+(t?1:0)},"_0+(_1?0:1)":function(e,t){return e+(t?0:1)},"_0-2":function(e){return e-2},"[{delay:200}]":function(){return[{delay:200}]},"[_0===_1&&_2.done(),true]":function(e,t,n){return[e===t&&n.done(),!0]},"[_0.done()]":function(e){return[e.done()]},true:function(){return!0}},p:{modal:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-modal",g:1},{n:"fade",t:72,v:"t1"},{n:"fade",t:72,f:{r:[],s:"[{delay:200}]"},v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["@node","@event.target","."],s:"[_0===_1&&_2.done(),true]"}}],n:51,r:".noClickout"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1},{n:"pop",t:72,f:{r:[],s:"[{delay:200}]"},v:"t1"},{n:"pop",t:72,v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.done()]"}}],n:50,r:".clickClose"},{t:8,r:".attrs",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}],f:[{t:8,r:".content",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}]}]}],n:54,r:"contents.0"}],n:50,r:"contents.length"}]}},u=function(e){function t(t){e.call(this,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.position=function(e){var t=e||this.source,n=this.get("popped");if(t&&n){var i=this.find("div");if(t&&i&&i.offsetParent){var o=i.offsetParent,r=o.getBoundingClientRect(),a=i.getBoundingClientRect(),l=t.getBoundingClientRect(),c=this.get("where")||"below",s=this.get("align")||"middle",p=this.get("tail"),f="above"===c||"below"===c,d=this.get("fit"),u=this.get("gap"),b="above"===c||"below"===c?0:"left"===c?-a.width-u:l.width+u,m="left"===c||"right"===c?-l.height:"above"===c?-l.height-a.height-u:u;"middle"===s?"below"===c||"above"===c?b-=(a.width-l.width)/2:"left"!==c&&"right"!==c||(m-=(a.height-l.height)/2):"end"===s&&("below"===c||"above"===c?b+=l.width-a.width:"left"!==c&&"right"!==c||(m+=l.height-a.height));var h={popTop:l.bottom-r.top+m,popLeft:l.left-r.left+b,tail:p,vert:"above"===c||"below"===c};if(o.scrollTop&&(h.popTop+=o.scrollTop),o.scrollLeft&&(h.popLeft+=o.scrollLeft),p){"above"===c?h.tailBottom=-10:"below"===c?h.tailTop=-10:"left"===c?h.tailRight=-10:"right"===c&&(h.tailLeft=-10);var g=this.tailSource?this.tailSource.getBoundingClientRect():l;"start"===s?f?h.tailLeft=Math.floor(g.width/2)-10:h.tailTop=Math.floor(g.height/2)-10:"end"===s?f?h.tailRight=Math.floor(g.width/2)-10:h.tailBottom=Math.floor(g.height/2)-10:"middle"===s&&(f?h.tailLeft=Math.floor(g.width/2)-10:h.tailTop=Math.floor(g.height/2)-10),g!==l?f?(h.tailLeft&&(h.tailLeft+=g.left-l.left),h.tailRight&&(h.tailRight+=l.right-g.right)):(h.tailTop&&(h.tailTop+=g.top-l.top),h.tailBottom&&(h.tailBottom+=l.bottom-g.bottom)):"middle"===s&&(f?(h.tailLeft&&(h.tailLeft+=g.left-(h.popLeft+r.left)),h.tailRight&&(h.tailRight+=h.popLeft+r.left+a.width-g.right)):(h.tailTop&&(h.tailTop+=g.top-(h.popTop+r.top)),h.tailBottom&&(h.tailBottom+=h.popTop+r.top+a.height-g.bottom)))}if(d){var v=o;if(this.get("offsets"))for(var y=this.get("offsets");y--;)v=v.offsetParent;var x=o.scrollWidth,w=o.scrollHeight;if(h.popLeft+a.width>x){var _=h.popLeft-(x-a.width);h.popLeft-=_,f&&h.tailLeft&&(h.tailLeft+=_),f&&h.tailRight&&(h.tailRight-=_),p&&!f&&(h.tail=!1)}if(h.popLeft<0){var k=-1*h.popLeft;h.popLeft+=k,f&&h.tailLeft&&(h.tailLeft-=k),f&&h.tailRight&&(h.tailRight+=k),p&&!f&&(h.tail=!1)}if(h.popTop+a.height>w){var O=h.popTop-(w-a.height);h.popTop-=O,!f&&h.tailTop&&(h.tailTop+=O),!f&&h.tailBottom&&(h.tailBottom-=O),p&&f&&(h.tail=!1)}if(h.popTop<0){var T=-1*h.popTop;h.popTop+=T,!f&&h.tailTop&&(h.tailTop-=T),!f&&h.tailBottom&&(h.tailBottom+=T),p&&f&&(h.tail=!1)}}this.set("position",h)}else this.set("position",null)}},t.prototype.show=function(e){this.source=e,this.set("popped",!0)},t.prototype.hide=function(){this.set("popped",!1)},t}(t);t.extendWith(u,{attributes:["popped","tail","where","align","top","left","fit","clickClose","noClickout","gap","offsets"],use:[r(),(void 0===f&&(f={}),function(e){e.instance.events[f.name||"clickout"]=a}),c()],template:d,css:function(e){return[function(e){var t=Object.assign({},e("raui.primary"),e("raui.pop.primary")),n=(e("raui.themes")||[]).slice();return(e("raui.pop.themes")||[]).forEach(function(e){~n.indexOf(e)||n.push(e)}),"\n .rpop-wrapper {\n position: absolute;\n display: inline-block;\n z-index: 11;\n transition-property: top, left, padding;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-with-tail.rpop-above {\n padding-bottom: 10px;\n }\n .rpop-with-tail.rpop-below {\n padding-top: 10px;\n }\n .rpop-with-tail.rpop-left {\n padding-right: 10px;\n }\n .rpop-with-tail.rpop-right {\n padding-left: 10px;\n }\n \n .rpop {\n position: relative;\n box-shadow: 0 1px 4px 0 rgba(0,0,0,0.24);\n border: 1px solid #ccc;\n border-radius: 0.2em;\n background-color: "+(t.bg||"#fff")+";\n color: "+(t.fg||"#222")+";\n padding: 0.5em;\n z-index: 2;\n }\n \n .rpop-modal {\n position: fixed;\n display: flex;\n z-index: 10;\n background-color: rgba(0, 0, 0, 0.2);\n align-items: center;\n justify-content: center;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 1em;\n overflow: auto;\n }\n \n .rpop-tail, .rpop-tail-outer {\n z-index: 3;\n width: 0;\n height: 0;\n position: absolute;\n border-style: solid;\n border-width: 10px;\n border-color: transparent;\n transition-property: top, left, bottom, right, border-color;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-tail-outer {\n z-index: 1;\n border-width: 12px;\n border-color: transparent;\n }\n \n .rpop-below .rpop-tail {\n border-bottom-color: "+(t.bg||"#fff")+";\n }\n .rpop-below .rpop-tail-outer {\n border-bottom-color: "+(t.bc||"#ccc")+";\n }\n \n .rpop-above .rpop-tail {\n border-top-color: "+(t.bg||"#fff")+";\n }\n .rpop-above .rpop-tail-outer {\n border-top-color: "+(t.bc||"#ccc")+";\n }\n \n .rpop-left .rpop-tail {\n border-left-color: "+(t.bg||"#fff")+";\n }\n .rpop-left .rpop-tail-outer {\n border-left-color: "+(t.bc||"#ccc")+";\n }\n \n .rpop-right .rpop-tail {\n border-right-color: "+(t.bg||"#fff")+";\n }\n .rpop-right .rpop-tail-outer {\n border-right-color: "+(t.bc||"#ccc")+";\n }\n "+n.map(function(t){var n=Object.assign({},e("raui.primary"),e("raui.pop.primary"),e("raui."+t),e("raui.pop."+t));return"\n ."+t+" .rpop {\n background-color: "+(n.bg||"#fff")+";\n color: "+(n.fg||"#222")+";\n }\n \n ."+t+".rpop-below .rpop-tail {\n border-bottom-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-below .rpop-tail-outer {\n border-bottom-color: "+(n.bc||"#ccc")+";\n }\n \n ."+t+".rpop-above .rpop-tail {\n border-top-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-above .rpop-tail-outer {\n border-top-color: "+(n.bc||"#ccc")+";\n }\n \n ."+t+".rpop-left .rpop-tail {\n border-left-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-left .rpop-tail-outer {\n border-left-color: "+(n.bc||"#ccc")+";\n }\n \n ."+t+".rpop-right .rpop-tail {\n border-right-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-right .rpop-tail-outer {\n border-right-color: "+(n.bc||"#ccc")+";\n }\n "})}.call(this,e)].join(" ")},cssId:"rpop",noCssTransform:!0,observe:{popped:function(e){var t=this;setTimeout(function(){t.get("popped")===e&&t.set("_popped",e)},100)},_popped:{handler:function(e){var t=this;if(e){var n=this.get("@style.raui.pop.mobile");if(n&&window.matchMedia("(max-width: "+n+")").matches){p||(p=new b({target:document.body,append:!0})).observe("contents",function(e){s=(e||[]).length>0});var i=this.getContext().getParent(!0);i.isContext=1,p.unshift("contents",{content:this.partials.content,context:i,attrs:this.partials["extra-attributes"]||[],clickClose:this.get("clickClose"),noClickout:this.get("noClickout"),done:function(){t.set("popped",!1)}})}else this.set("__popped",!0)}else s?p.shift("contents"):this.set("__popped",!1)},defer:!0},__popped:{handler:function(e){if(e){var t=this.find("div"),n=t,i=n.offsetHeight+n.offsetTop,o=n.offsetWidth+n.offsetLeft,r=n.offsetParent;if(!this.overflows)for(var a=this.overflows={e:[],v:[]};t&&t.style;){if(t===r){if(t.offsetWidth>=o&&t.offsetHeight>=i)break;o+=t.offsetLeft,i+=t.offsetTop,r=t.offsetParent}var l=getComputedStyle(t);if("auto"===l.overflow)break;"hidden"===l.overflow&&(a.e.push(t),a.v.push(t.style.overflow),t.style.overflow="visible"),t=t.parentNode}this.position(),this.transition("pop",n,{intro:!0,dir:this.get("where")||"below"})}else this.source=null,this.tailSource=null},defer:!0},"align where tail fit":{handler:function(){this.position()},defer:!0}},decorators:{cleanup:function(e){var t=this;return{teardown:function(){var e=t.overflows;if(e){t.overflows=null;for(var n=0;n<e.e.length;n++)e.e[n].style.overflow=e.v[n]}}}}},data:function(){return{gap:4}}});var b=function(e){function t(t){e.call(this,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(t);function m(){}function h(e){~this.className.indexOf("focus")||(this.className+=" focus")}function g(e){this.className=this.className.replace(/\bfocus\b/g,"").trim()}function v(e){var t,n,i,o,r,a,l,c,s,p,f,d,u,b=this.getContext(e);function v(){var b=y().split(/\s+/).filter(function(e){return!!e});(t=!!~b.indexOf("field"))||(b.push("field"),t=!0),(n=e.querySelector("input[type=checkbox]"))&&!~b.indexOf("check")&&b.push("check"),(i=e.querySelector("input[type=radio]"))&&!~b.indexOf("radio")&&b.push("radio");var m=n||i;m&&m.checked&&!~b.indexOf("checked")&&b.push("checked"),m&&m.disabled&&!~b.indexOf("disabled")&&b.push("disabled"),!m&&p?(p.cancel(),p=0,f&&(f.disconnect(),f=0),delete m._form_callback,u&&(delete u.checked,d=u=void 0)):m&&(m._form_callback=function(t,n){if(void 0===n&&(n=!0),n&&"radio"===m.type&&m.name){var i=[];i.push.apply(i,document.querySelectorAll("input[type=radio][name="+m.name+"]")),(i=i.filter(function(e){return e!==m})).forEach(function(e){return e._form_callback&&e._form_callback(t,!1)})}var o=m.checked;o&&!~e.className.indexOf("checked")?e.className+=" checked":!o&&~e.className.indexOf("checked")&&(e.className=e.className.replace(/\bchecked\b/g,"").replace(/ +/g," ").trim())},MutationObserver&&(f=new MutationObserver(function(){var t;(t=m.disabled)&&!~e.className.indexOf("disabled")?e.className+=" disabled":!t&&~e.className.indexOf("disabled")&&(e.className=e.className.replace(/\bdisabled\b/g,"").replace(/ +/g," ").trim())})).observe(m,{attributes:!0}),p=this.getContext(m).listen("change",m._form_callback),(d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(m),"checked"))&&d.configurable&&(u=m,Object.defineProperty(m,"checked",{get:d.get,set:function(e){d.set.call(u,e),m._form_callback()},enumerable:!0,configurable:!0}))),(o=!!e.querySelector("textarea"))&&!~b.indexOf("textarea")&&b.push("textarea"),(r=!!e.querySelector("select"))&&!~b.indexOf("select")&&b.push("select"),(a=!!e.querySelector("input[type=file]"))&&!~b.indexOf("file")&&b.push("file"),(l=!!(l=e.querySelector("button"))&&l.parentNode===e)&&!~b.indexOf("button")&&b.push("button"),(c=!!e.querySelector("div"))&&!~b.indexOf("plain")&&b.push("plain"),(s=!(n||i||a||!e.querySelector("input")))&&!~b.indexOf("input")&&b.push("input"),e.className=b.join(" ")}function y(){var p=e.className;return t||(p=p.replace(/\bfield\b/g,"").trim()),n||(p=p.replace(/\bcheck(ed)?\b/g,"").trim()),i||(p=p.replace(/\bradio\b/g,"").trim()),o||(p=p.replace(/\btextarea\b/g,"").trim()),r||(p=p.replace(/\bselect\b/g,"").trim()),a||(p=p.replace(/\bfile\b/g,"").trim()),l||(p=p.replace(/\bbutton\b/g,"").trim()),c||(p=p.replace(/\bplain\b/g,"").trim()),s||(p=p.replace(/\binput\b/g,"").trim()),p=p.replace(/ +/g," ")}var x=b.listen("focusin",h),w=b.listen("focusout",g);return v.call(this),{update:m,invalidate:v.bind(this),teardown:function(){var t=y();t=t.replace(/\bfocus\b/g,"").trim(),x.cancel(),w.cancel(),p&&p.cancel(),f&&f.disconnect(),u&&(delete u.checked,d=u=void 0),e.className=t}}}function y(e,t){if(!e)return!1;for(var n=0;n<e.length;n++){if(e[n].e===t)return!0;if(e[n].f&&y(e[n].f,t))return!0}return!1}t.extendWith(b,{template:{v:d.v,t:d.p.modal},data:function(){return{contents:[]}},use:[r(),c()]}),v.style=function(e){var t=Object.assign({},e("raui.primary"),e("raui.form.primary")),n=Object.assign({},e("raui.primary.active"),e("raui.form.primary.active")),i=e("raui.form.boxy");return"\n label.field {\n display: inline-block;\n font-size: 0.9em;\n font-weight: 500;\n color: "+(t.fg||"#222")+";\n transition: 0.2s ease-in-out;\n transition-property: color;\n vertical-align: top;\n box-sizing: border-box;\n padding: 0.25em 0.5em;\n line-height: 1.5em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: inherit;\n }\n\n label.field.textarea {\n display: block;\n border: 0.0625em solid "+(t.bc||"#ccc")+";\n padding: 0.5em 0.8em 0.8em 0.8em;\n border-radius: "+(t.radius||"0.2em")+";\n box-shadow: none;\n transition-property: color, border-color, box-shadow;\n margin: 0.8em 0.2em;\n min-height: auto;\n background-color: "+(i?t.bg||"#fff":"transparent")+";\n }\n\n label.field.focus {\n color: "+(n.fg||t.fga||"#07e")+";\n }\n\n label.field.textarea.focus {\n border-color: "+(n.fg||t.fga||"#07e")+";\n "+(i?"":"box-shadow: 0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n 0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+";")+"\n }\n\n label.field input,\n label.field select,\n label.field textarea\n {\n display: block;\n border-width: "+(i?"0.0625em":"0 0 0.0625em 0")+";\n border-color: "+(t.bc||"#ccc")+";\n border-style: solid;\n box-sizing: border-box;\n background-color: "+(i?t.bg||"#fff":"transparent")+";\n transition: 0.2s ease-in-out;\n transition-property: box-shadow, color;\n outline: none;\n box-shadow: none;\n width: 100%;\n margin-bottom: 0.8em;\n font-size: 1.1em;"+(i?"\n border-radius: "+(t.radius||"0.2em")+";":"")+"\n font-weight: 400;\n font-family: inherit;\n }\n\n label.field input"+(i?"":":disabled")+",\n label.field select"+(i?"":":disabled")+" {\n padding: 0 0.75em;\n }\n label.field select"+(i?"":":disabled")+" {\n padding-right: 2em;\n }\n\n label.field input:disabled,\n label.field select:disabled,\n label.field textarea:disabled {\n background: #f4f4f4;\n }\n\n label.field textarea {\n line-height: 1.2em;\n }\n label.field .field-wrapper {\n display: block;\n }\n label.field > select, label.field > input,\n label.field > .field-wrapper > input, label.field > .field-wrapper > select {\n height: 2.5em;\n }\n\n "+(i?"":"label.field:hover > input,\n label.field:hover select,\n label.field.file:hover:after {\n box-shadow: 0 0.0625em 0 0 "+(t.bc||"#ccc")+";\n }\n\n label.field.textarea:hover {\n box-shadow: 0.0625em 0.0625em "+(t.bc||"#ccc")+",\n -0.0625em 0.0625em "+(t.bc||"#ccc")+",\n 0.0625em -0.0625em "+(t.bc||"#ccc")+",\n -0.0625em -0.0625em "+(t.bc||"#ccc")+";\n }\n\n label.field.textarea.focus:hover {\n box-shadow: 0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n 0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+";\n }")+"\n\n /**** CHECK BOXES ****/\n\n label.field.check {\n position:relative;\n z-index: 0;\n overflow: visible;\n cursor: pointer;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.check.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: -3px;\n top: 23px;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n background-color: "+(t.bc||"#ccc")+";\n box-shadow: none;\n outline: none;\n opacity: 0;\n transform: scale(1);\n pointer-events: none;\n transition: opacity 0.3s, transform 0.2s;\n }\n label.field.inline.check input {\n top: 3px;\n left: -3px;\n }\n\n label.field.check input:checked {\n background-color: "+(t.fga||"#07e")+';\n }\n\n label.field.check:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n margin: 3px 11px 3px 1px;\n border: solid 2px; /* Safari */\n border-color: '+(t.fg||"#222")+';\n border-radius: 2px;\n width: 18px;\n height: 18px;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after {\n content: "";\n display: block;\n position: absolute;\n top: 0px;\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.8em, 2.65em) rotate(-45deg);\n }\n\n label.field.check.inline:after {\n transform: translate(0.8em, 1.2em) rotate(-45deg);\n }\n\n label.field.check.checked:before {\n border-color: '+(t.fga||"#07e")+";\n background-color: "+(t.fga||"#07e")+";\n }\n label.field.check.focus:before {\n border-color: "+(t.fga||"#07e")+";\n }\n\n label.field.check.checked:after {\n border-color: "+(t.bg||"#fff")+";\n }\n\n label.field.check input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled {\n color: "+(t.bc||"#ccc")+";\n cursor: initial;\n }\n\n label.field.check.disabled:before {\n border-color: "+(t.bc||"#ccc")+";\n }\n\n label.field.check.checked.disabled:before {\n border-color: transparent;\n background-color: "+(t.bc||"#ccc")+";\n }\n\n\n /**** RADIO BUTTONS ****/\n \n label.field.radio {\n z-index: 0;\n position: relative;\n display: inline-block;\n overflow: visible;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.radio.inline {\n padding-top: 0.8em;\n }\n\n label.field.radio input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: 0;\n top: 0;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 41px;\n height: 40px;\n background-color: "+(t.bc||"#ccc")+';\n outline: none;\n opacity: 0;\n pointer-events: none;\n transform: translate(-0.2em, 24px) scale(1);\n transition: opacity 0.3s, transform 0.3s;\n }\n label.field.inline.radio input {\n transform: translate(-0.2em, 3px) scale(1);\n }\n\n label.field.radio {\n cursor: pointer;\n position: relative;\n }\n\n label.field.radio:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n margin: 2px 10px 2px 0;\n border: solid 2px; /* Safari */\n border-color: '+(t.fg||"#222")+';\n border-radius: 50%;\n width: 20px;\n height: 20px;\n vertical-align: middle;\n transition: border-color 0.2s;\n }\n\n label.field.radio:after {\n content: "";\n display: block;\n position: absolute;\n border-radius: 50%;\n width: 10px;\n height: 10px;\n background-color: '+(t.fga||"#07e")+";\n transform: translate(5px, -17px) scale(0);\n transition: transform 0.2s;\n }\n\n label.field.radio input:checked {\n background-color: "+(t.fga||"#07e")+";\n }\n\n label.field.radio.checked:before {\n border-color: "+(t.fga||"#07e")+";\n }\n\n label.field.radio.checked:after {\n transform: translate(5px, -17px) scale(1);\n }\n\n label.field.radio:hover input {\n opacity: 0.04;\n }\n\n label.field.radio input:focus {\n opacity: 0.12;\n transform: translate(-0.2em, 24px) scale(1);\n transition: transform 0.2s, opacity 0.2s;\n }\n label.field.inline.radio input:focus {\n transform: translate(-0.2em, 3px) scale(1);\n }\n\n label.field.radio:hover input:focus {\n opacity: 0.16;\n }\n\n label.field.radio input:active {\n opacity: 1;\n transform: translate(-0.2em, 24px) scale(0);\n transition: transform 0s, opacity 0s;\n }\n label.field.inline.radio input:active {\n transform: translate(-0.2em, 3px) scale(0);\n }\n\n label.field.radio.checked:before {\n border-color: "+(t.fga||"#07e")+";\n }\n\n label.field.radio.focus:before {\n border-color: "+(t.fga||"#07e")+";\n }\n\n label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.radio.disabled {\n color: "+(t.bc||"#ccc")+";\n cursor: initial;\n }\n\n label.field.radio.disabled:before {\n border-color: "+(t.bc||"#ccc")+";\n }\n\n label.field.radio.disabled:after {\n background-color: "+(t.bc||"#ccc")+";\n }\n\n\n\n label.field select {\n padding-right: 2em;\n }\n\n label.field.select {\n cursor: pointer;\n position: relative;\n }\n\n label.field.select:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n right: 19px;\n height: 0.6em;\n top: 2.6em;\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n pointer-events: none;\n color: "+(t.bc||"#ccc")+";\n }\n\n label.field textarea {\n border: none;"+(i?"\n padding: 0;":"")+"\n }\n\n label.field > select {\n -moz-appearance: none;\n -webkit-appearance: none;\n }\n\n label.field input:focus,\n label.field select:focus,\n label.field.file.focus:after\n {\n border-color: "+(n.fg||t.fga||"#07e")+";\n "+(i?"":"box-shadow: 0 0.0625em 0 0 "+(n.fg||t.fga||"#07e")+";")+"\n }\n\n label.field input[type=checkbox]:focus,\n label.field input[type=radio]:focus {\n box-shadow: none;\n }\n\n label.field.file.focus:after {\n color: "+(n.fg||t.fga||"#07e")+";\n }\n label.field.file [type=file] {\n position: absolute;\n width: 0;\n height: 0;\n opacity: 0;\n z-index: -1;\n }\n label.field.file {\n position: relative;\n min-width: 9em;\n height: 5em;\n }\n label.field.file:after {\n position: absolute;\n content: 'Choose a file';\n box-sizing: border-box;\n width: calc(100% - 0.3em);\n height: 2.5em;\n font-size: 1.1em;\n line-height: 1.5em;\n color: "+(t.fg||"#222")+";\n text-align: "+(i?"center":"left")+";\n padding: 0.5em "+(i?"0.5em":"0")+";\n cursor: pointer;\n font-style: oblique;\n left: 0.25em;\n top: 1.6em;\n transition: 0.2s ease-in-out;\n transition-property: color, border-bolor, box-shadow;"+(i?"\n border-radius: "+(t.radius||"0.2em")+";\n border-color: "+(t.bc||"#ccc")+";\n border-style: solid;\n border-width: 0.0625em;":"\n border-bottom-color: "+(t.bc||"#ccc")+";\n border-bottom-width: 0.0625em;\n border-bottom-style: solid;\n ")+"\n }\n label.field.file.inline:after {\n top: 0.2em;\n }\n\n label.field.button {\n vertical-align: top;\n padding-top: "+(i?"1.7":"1.958")+"em;\n }\n label.field .with-buttons button, label.field.button button {\n font-size: 1.1em;\n margin-top: "+(i?"0.15em":"0")+";\n }\n\n label.field .field-wrapper.with-buttons {\n display: flex;\n }\n label.field .with-buttons button {\n flex-shrink: 0;\n padding-left: 0.5em;\n padding-right: 0.5em;\n margin-top: 0;\n margin-right: 0;\n "+(i?"height: 2.5em;\n box-shadow: none;\n border-radius: 0;\n border-left: 1px solid "+(t.bg||"#fff")+";\n margin-left: 0;":"height: 2.25em;")+"\n }"+(i?"\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 "+(t.radius||"0.2em")+" "+(t.radius||"0.2em")+" 0;\n }\n label.field .with-buttons input {\n border-radius: "+(t.radius||"0.2em")+" 0 0 "+(t.radius||"0.2em")+";\n min-width: 0;\n }\n ":"")+"\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1."+(i?"15":"1")+"em;\n }\n\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: "+(t.fga||"#07e")+";\n color: "+(t.bg||"#fff;")+";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1.2em;\n text-align: center;\n margin-top: -0.2em;\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n "};var x=t.macro(function(e){var t=[],n=(e.template.m||[]).slice(),i=e.template.f||[],o=n.find(function(e){return"value"===e.n}),r=n.find(function(e){return"type"===e.n}),a=n.find(function(e){return"tip"===e.n});if(a&&n.splice(n.indexOf(a),1),r&&"function"==typeof x.types[r.f])t.push.apply(t,x.types[r.f](n,i,e));else if(o){var l={t:7,e:"input",m:[o]};if(y(i,"option")&&(l.e="select",l.f=i),r&&(l.m.push(r),"checkbox"===r.f||"radio"===r.f)){var c=n.find(function(e){return"target"===e.n});c?l.m.push(Object.assign({},c,{n:"name"})):l.m.splice(l.m.indexOf(o),1,Object.assign({},o,{n:"checked"}))}l.m=l.m.concat(n.filter(function(e){return 73===e.t||73===e.t||"placeholder"===e.n})),t.push(l);var s=i.filter(function(e){return"button"===e.e||y(e.f,"button")});s.length&&(t.push.apply(t,s),t=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:t}])}else{var p=i.filter(function(e){return e.e});p.find(function(e){return"button"===e.e})&&p.length>1?t=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:i}]:t.push.apply(t,i)}var f=n.find(function(e){return"label"===e.n});a&&t.unshift({t:7,e:"span",m:[{t:13,n:"class",f:"field-tip"+(f?"":" field-solo-tip"),g:1},{t:13,n:"title",f:a.f},{t:70,n:["click"],f:{r:[],s:"[false]"}}],f:"?"}),f?t.unshift(f.f):t.unshift(" ");var d={t:7,e:"label",m:[{t:71,n:"field"}].concat(n.filter(function(e){return 13!==e.t&&73!==e.t||"value"!==e.n&&"type"!==e.n&&"inline"!==e.n&&"label"!==e.n&&"placeholder"!==e.n&&"target"!==e.n})),f:t};n.find(function(e){return"inline"===e.n})&&d.m.push({t:13,n:"class",f:"inline"}),e.setTemplate([d])});function w(e){return"function"==typeof e.focus&&e.focus(),{teardown:m}}x.types={},i("field","decorators",v),i("field","partials",x),i("autofocus","decorators",w);var _={v:4,t:[{t:7,e:"span",m:[{t:13,n:"class",f:"rautocomplete field-wrapper",g:1},{n:["pop"],t:70,f:{r:["@context","$1"],s:'[(_0).set("rac.pop",_1)]'}}],f:[{t:7,e:"input",m:[{t:8,r:"extra-attributes"},{n:["dblclick"],t:70,f:{r:["rac.pop","@node"],s:"[_0.show(_1)]"}},{n:["focus"],t:70,f:{r:["rac"],s:"[_0.stash()]"}},{n:["input"],t:70,f:{r:["rac","@event"],s:"[_0.input(_1)]"}},{n:["keydown"],t:70,f:{r:["rac","@event"],s:"[_0.key(_1)]"}},{t:73,v:"t",f:"false"},{n:"value",f:[{t:2,r:"rac.display"}],t:13}]}," ",{t:7,e:"rac-pop",m:[{t:13,n:"style",f:"padding: 0;",g:1},{t:13,n:"class",f:"rac-pop",g:1},{n:["init"],t:70,f:{r:["@context","$1"],s:'[(_0).raise("pop",{},_1)]'}},{n:"popped",t:13,f:[{t:2,r:"rac.popped"}]},{n:"where",f:"below",t:13,g:1},{n:"align",f:"end",t:13,g:1},{n:"gap",f:[{t:2,x:{r:[],s:"2"},s:1}],t:13},{n:"offsets",t:13,f:[{t:2,r:"rac.offsets"}]},{n:"fit",t:13,f:[{t:2,r:"rac.fit"}]}],f:[{t:4,f:[{t:7,e:"input",m:[{n:"class-rac-modal",t:13},{n:["input"],t:70,f:{r:["rac","@event"],s:"[_0.input(_1)]"}},{n:["keydown"],t:70,f:{r:["rac","@event"],s:"[_0.key(_1)]"}},{t:73,v:"t",f:"false"},{n:"value",f:[{t:2,r:"rac.display"}],t:13},{n:"autocompletefocus",t:71}]}],n:50,r:"inModal"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rac-list",g:1},{n:"tabindex",f:"-1",t:13,g:1}],f:[{t:55,f:[{f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item rac-invalid",g:1}],f:["Loading..."]}],t:4},{t:62,f:[" ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item",g:1},{n:"tabindex",f:"-1",t:13,g:1},{n:"class-rac-selected",t:13,f:[{t:2,x:{r:["rac.value","."],s:"_0===_1"}}]},{n:"class-rac-hover",t:13,f:[{t:2,x:{r:["rac.selected","@index"],s:"_0===_1"}}]},{n:["click"],t:70,f:{r:["@context","."],s:'[(_0).set("rac.value",_1)]'}},{n:["mouseover"],t:70,f:{r:["@context","@index"],s:'[(_0).set("rac.selected",_1)]'}}],f:[{t:2,x:{r:["rac","."],s:"_0._display(_1)"}}]}],n:52,r:"items"}," "],n:"items"},{t:63,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item rac-invalid",g:1}],f:["Load failed."]}]}],r:"rac.list"}]}]}]}],e:{2:function(){return 2},'[(_0).set("rac.pop",_1)]':function(e,t){return[e.set("rac.pop",t)]},"[_0.show(_1)]":function(e,t){return[e.show(t)]},"[_0.stash()]":function(e){return[e.stash()]},"[_0.input(_1)]":function(e,t){return[e.input(t)]},"[_0.key(_1)]":function(e,t){return[e.key(t)]},'[(_0).raise("pop",{},_1)]':function(e,t){return[e.raise("pop",{},t)]},"_0===_1":function(e,t){return e===t},'[(_0).set("rac.value",_1)]':function(e,t){return[e.set("rac.value",t)]},'[(_0).set("rac.selected",_1)]':function(e,t){return[e.set("rac.selected",t)]},"_0._display(_1)":function(e,t){return e._display(t)}}};function k(e,t){return t.reduce(function(e,t){return e?e[t]:e},e)}var O=t.macro(function(e){var n,i;function o(t){null==t&&(t=null==e.get("rac.value")?"":e.get("rac.display")),t===e.get("rac.tempDisplay")&&(t="");var n=e.get("rac._items");if("function"==typeof n){var i=n(t);"object"==typeof i&&"function"==typeof i.then?i.then(function(t){return e.set("rac.list",t)}):e.set("rac.list",i)}else if(Array.isArray(n)){var o,r=e.get("rac._display");try{o=new RegExp(t||"","i")}catch(e){o=new RegExp((t||"").replace(/([\{\(\[\]\)\}\?\*\^\$])/g,"\\$1"))}e.set("rac.list",n.filter(function(e){return o.test(r(e))}))}else e.set("rac.list",[])}function r(n,r,l){var c=e.get("rac.displayprop");if(e.get("rac.__display")!==c||void 0===e.get("rac._display")){if("string"==typeof c){var s=t.splitKeypath(c);c=function(e){return null==e?"(none)":k(e,s)}}else Array.isArray(c)?c=function(e){return null==e?"(none)":k(e,e)}:c||(c=function(e){return null==e?"(none)":""+e});e.set("rac._display",c),e.set("rac.__display",e.get("rac.displayprop")),e.set("rac.display",c(e.get("rac.value")))}if(c=e.get("rac.member"),e.get("rac.__member")!==c||void 0===e.get("rac._member")){if("string"==typeof c){var p=t.splitKeypath(c);c=function(e){return k(e,p)}}else Array.isArray(c)?c=function(e){return k(e,e)}:c||(c=function(e){return e});e.set("rac._member",c),e.set("rac.__member",e.get("rac.member"))}c=e.get("rac.items"),e.get("rac.__items")===c&&void 0!==e.get("rac._items")||(Array.isArray(c)?e.set("rac._items",c):"function"==typeof c?e.set("rac._items",c):"object"==typeof c&&"function"==typeof c.then?c.then(function(t){e.set("rac._items",t),o()}):e.set("rac._items",[]),e.set("rac.__items",e.get("rac.items"))),i&&"rac.display"===l&&e.get("rac.limit")&&!i.contains(document.activeElement)&&a(),o()}function a(){var t=e.get("rac._display");if("function"==typeof t){var n=t(e.get("rac.value"));e.set("rac.display",n),e.set("rac.tempDisplay",n)}}function l(t){(t.items&&e.link(t.items,"rac.items"),t.value&&e.link(t.value,"rac._value"),t.selected&&e.link(t.selected,"rac.selected"),t["display-value"]&&e.link(t["display-value"],"rac.display"),"display"in t&&e.set("rac.displayprop",t.display),"member"in t&&e.set("rac.member",t.member),"offsets"in t?(e.set("rac.offsets",t.offsets),e.set("rac.fit",!0)):e.set("rac.fit",!1),e.set("rac.limit",t["limit-set"]),e.get("rac.limit")&&e.get("input"))&&(e.get("input")!==document.activeElement&&a());r()}e.aliasLocal("rac"),e.set("rac.list",[]),e.set("rac.popped",!1),e.set("rac.stash",function(){e.set("rac.tempDisplay",e.get("rac.display")),e.set("rac.tempValue",e.get("rac.value"))}),e.set("rac.key",function(t){var n=t.which;if(27===n)e.set("rac.popped",!1),e.set("rac.display",e.get("rac.tempDisplay")),e.set("rac.value",e.get("rac.tempValue"));else if(38===n||40===n){t.preventDefault(),e.get("rac.pop").show(e.find("input"));var i=e.get("rac.selected"),o=e.get("rac.list");38===n?i<=0||null==i?e.set("rac.selected",Array.isArray(o)?o.length-1:0):e.set("rac.selected",i-1):Array.isArray(o)?e.set("rac.selected",i<o.length?i+1:0):e.set("rac.selected",0)}else if(10===n||13===n){var r=e.get("rac.list");Array.isArray(r)&&e.set("rac.value",r[e.get("rac.selected")])}else 9===n&&(e.set("rac.popped",!1),e.get("rac.updateDisplay")())}),e.set("rac.input",function(t){n&&clearTimeout(n),n=setTimeout(function(){n=null,o(t.target.value),e.get("rac.pop").show(e.find("input"))},500),e.set("rac.display",t.target.value)}),e.setTemplate(_),e.set("rac.updateDisplay",function(t){setTimeout(function(){i&&e.get("rac.limit")&&!i.contains(document.activeElement)&&a()},140)}),l(e.attributes);var c={init:!1,defer:!0},s=[e.observe("rac.displayprop",r,c),e.observe("rac.memberprop",r,c),e.observe("rac.items",r,c),e.observe("rac.list",function(t){Array.isArray(t)?e.set("rac.selected",t.indexOf(e.get("rac.value"))):e.set("rac.selected",-1)},c),e.observe("rac.value",function(t){a(),function(){if(!e.get("rac._value")||e.get("rac.value")){var t=e.get("rac._member");if("function"==typeof t){var n=t(e.get("rac.value"));e.set("rac._value",n)}e.ractive.getContext(e.find("input")).raise("selected",{},e.get("rac._value"),e.get("rac.display"))}}(),e.set("rac.popped",!1),e.set("rac.tempValue",t)}),e.observe("rac._value",function(t){var n=e.get("rac._member"),i=e.get("rac.list").find(function(e){return n(e)===t});i!==e.get("rac.value")&&e.set("rac.value",i)})];return{teardown:function(){e.unlink("rac.items"),e.unlink("rac._value"),e.unlink("rac.selected"),e.unlink("rac.display"),s.forEach(function(e){return e.cancel()})},update:l,render:function(){i=e.find("span")}}},{attributes:["items","selected","display","value","member","limit-set","offsets","display-value"],css:function(e){return[function(e){var t=Object.assign({},e("raui.primary"),e("raui.autocomplete.primary"));return".rautocomplete {\n position: relative;\n display: inline-block;\n }\n \n .rac-pop {\n min-width: 100%;\n }\n \n .rac-pop > .rpop {\n padding: 0;\n }\n \n .rac-list {\n display: flex;\n flex-direction: column;\n max-height: 50vh;\n min-height: 2.125em;\n max-width: 100%;\n overflow: auto;\n }\n \n .rac-item {\n color: "+(t.fg||"#222")+";\n background-color: "+(t.bg||"#fff")+";\n padding: 0.25em;\n cursor: pointer;\n }\n \n .rac-selected {\n color: "+(t.bg||"#fff")+";\n background-color: "+(t.fga||"#07e")+";\n }\n \n .rac-hover {\n color: "+(t.fg||"#222")+";\n background-color: "+(t.bc||"#ccc")+";\n }\n \n .rac-invalid {\n cursor: not-allowed;\n }\n \n input.rac-modal {\n width: 100%;\n box-sizing: border-box;\n }"}.call(this,e)].join(" ")},cssId:"rautocomplete",noCssTransform:!0});function T(e){return void 0===e&&(e={}),function(t){var n=t.instance;n.partials[e.name||"autocomplete"]=O,n.components["rac-pop"]=u,n.decorators.autocompletefocus=w}}e.Autocomplete=O,e.FieldType=function(e){return void 0===e&&(e={}),function(t,n,i){return[{t:7,e:e.name||"autocomplete",m:t,f:n}]}},e.plugin=T,e.default=T,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.RMAutocomplete={},e.Ractive)}(this,function(e,t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var n="undefined"!=typeof window?window:null;function i(e,t,i){if(n&&n.Ractive&&"object"==typeof n.Ractive[t]){var o=document.currentScript;if(o||(o=(o=document.querySelectorAll("script"))[o.length-1]),o){var r=o.getAttribute("data-alias");r&&(r=(r=r.split("&")).reduce(function(e,t){var n=t.split("="),i=n[0],o=n[1];return e[i]=o,e},{})),Ractive[t][r&&r[e]||e]=i}}}function o(e,t){void 0===t&&(t={});var n=e.processParams(t,{duration:400,easing:"easeInOut"});t.dir=t.dir||!1;var i=t.distance||"20px",o=t.scale||"0.9",r="above"===t.dir?"translateY("+i+")":"left"===t.dir?"translateX("+i+")":"right"===t.dir?"translateX(-"+i+")":"translateY(-"+i+")";return e.isIntro||n.intro?(e.setStyle("opacity",0),e.setStyle("transform","scale("+o+") "+r),e.animateStyle({opacity:1,transform:"none"},n)):(e.setStyle("opacity",1),e.setStyle("transform","none"),e.animateStyle({opacity:0,transform:"scale("+o+") "+r},n))}function r(e){return void 0===e&&(e={}),function(t){t.instance.transitions[e.name||"pop"]=o}}function a(e,t){var n=!1,i=!1;function o(n){for(var i=n.target;i;){if(i===e)return;if(!i.parentNode&&i!==document)return;i=i.parentNode}t(n)}return setTimeout(function(){n=!0,i||(document.body.addEventListener("click",o),document.body.addEventListener("touchstop",o))}),{teardown:function(){i=!0,n&&(document.body.removeEventListener("click",o),document.body.removeEventListener("touchstop",o))}}}function l(e,t){var n=e.processParams(t,{duration:200,easing:"easeInOut"});return e.isIntro||n.intro?(e.setStyle("opacity",0),e.animateStyle("opacity",1,n)):(e.setStyle("opacity",1),e.animateStyle("opacity",0,n))}function c(e){return void 0===e&&(e={}),function(t){t.instance.transitions[e.name||"fade"]=l}}i("pop","transitions",o),i("fade","transitions",l);var s,p,f,d={v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-wrapper",g:1},{n:"class-rpop-with-tail",t:13,f:[{t:2,r:"position.tail"}]},{n:"class",f:["rpop-",{t:2,x:{r:["where"],s:'_0||"below"'}}," rpop-align-",{t:2,x:{r:["align"],s:'_0||"middle"'}}],t:13},{t:4,f:[{n:"style-top",f:[{t:2,r:"position.popTop"},"px"],t:13},{n:"style-left",f:[{t:2,r:"position.popLeft"},"px"],t:13}],n:50,r:"position"},{t:4,f:[{t:4,f:[{n:"style-top",f:[{t:2,r:"top"}],t:13}],n:50,r:"top"},{t:4,f:[{n:"style-left",f:[{t:2,r:"left"}],t:13}],n:50,r:"left"}],n:51,l:1},{n:"pop",t:72,f:{r:["where"],s:'[{dir:_0||"below"}]'},v:"t2"},{n:"cleanup",t:71},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:50,r:"clickClose"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:51,r:"noClickout"},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailRight"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail-outer",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailRight"}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content"}]}]}],n:50,r:"__popped"}],e:{'_0||"below"':function(e){return e||"below"},'_0||"middle"':function(e){return e||"middle"},'[{dir:_0||"below"}]':function(e){return[{dir:e||"below"}]},'[_0.set("popped",false)]':function(e){return[e.set("popped",!1)]},"_0+(_1?1:0)":function(e,t){return e+(t?1:0)},"_0+(_1?0:1)":function(e,t){return e+(t?0:1)},"_0-2":function(e){return e-2},"[{delay:200}]":function(){return[{delay:200}]},"[_0===_1&&_2.done(),true]":function(e,t,n){return[e===t&&n.done(),!0]},"[_0.done()]":function(e){return[e.done()]},true:function(){return!0}},p:{modal:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-modal",g:1},{n:"fade",t:72,v:"t1"},{n:"fade",t:72,f:{r:[],s:"[{delay:200}]"},v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["@node","@event.target","."],s:"[_0===_1&&_2.done(),true]"}}],n:51,r:".noClickout"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1},{n:"pop",t:72,f:{r:[],s:"[{delay:200}]"},v:"t1"},{n:"pop",t:72,v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.done()]"}}],n:50,r:".clickClose"},{t:8,r:".attrs",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}],f:[{t:8,r:".content",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}]}]}],n:54,r:"contents.0"}],n:50,r:"contents.length"}]}},u=function(e){function t(t){e.call(this,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.position=function(e){var t=e||this.source,n=this.get("popped");if(t&&n){var i=this.find("div");if(t&&i&&i.offsetParent){var o=i.offsetParent,r=o.getBoundingClientRect(),a=i.getBoundingClientRect(),l=t.getBoundingClientRect(),c=this.get("where")||"below",s=this.get("align")||"middle",p=this.get("tail"),f="above"===c||"below"===c,d=this.get("fit"),u=this.get("gap"),b="above"===c||"below"===c?0:"left"===c?-a.width-u:l.width+u,m="left"===c||"right"===c?-l.height:"above"===c?-l.height-a.height-u:u;"middle"===s?"below"===c||"above"===c?b-=(a.width-l.width)/2:"left"!==c&&"right"!==c||(m-=(a.height-l.height)/2):"end"===s&&("below"===c||"above"===c?b+=l.width-a.width:"left"!==c&&"right"!==c||(m+=l.height-a.height));var h={popTop:l.bottom-r.top+m,popLeft:l.left-r.left+b,tail:p,vert:"above"===c||"below"===c};if(o.scrollTop&&(h.popTop+=o.scrollTop),o.scrollLeft&&(h.popLeft+=o.scrollLeft),p){"above"===c?h.tailBottom=-10:"below"===c?h.tailTop=-10:"left"===c?h.tailRight=-10:"right"===c&&(h.tailLeft=-10);var g=this.tailSource?this.tailSource.getBoundingClientRect():l;"start"===s?f?h.tailLeft=Math.floor(g.width/2)-10:h.tailTop=Math.floor(g.height/2)-10:"end"===s?f?h.tailRight=Math.floor(g.width/2)-10:h.tailBottom=Math.floor(g.height/2)-10:"middle"===s&&(f?h.tailLeft=Math.floor(g.width/2)-10:h.tailTop=Math.floor(g.height/2)-10),g!==l?f?(h.tailLeft&&(h.tailLeft+=g.left-l.left),h.tailRight&&(h.tailRight+=l.right-g.right)):(h.tailTop&&(h.tailTop+=g.top-l.top),h.tailBottom&&(h.tailBottom+=l.bottom-g.bottom)):"middle"===s&&(f?(h.tailLeft&&(h.tailLeft+=g.left-(h.popLeft+r.left)),h.tailRight&&(h.tailRight+=h.popLeft+r.left+a.width-g.right)):(h.tailTop&&(h.tailTop+=g.top-(h.popTop+r.top)),h.tailBottom&&(h.tailBottom+=h.popTop+r.top+a.height-g.bottom)))}if(d){var v=o;if(this.get("offsets"))for(var y=this.get("offsets");y--;)v=v.offsetParent;var x=o.scrollWidth,w=o.scrollHeight;if(h.popLeft+a.width>x){var _=h.popLeft-(x-a.width);h.popLeft-=_,f&&h.tailLeft&&(h.tailLeft+=_),f&&h.tailRight&&(h.tailRight-=_),p&&!f&&(h.tail=!1)}if(h.popLeft<0){var k=-1*h.popLeft;h.popLeft+=k,f&&h.tailLeft&&(h.tailLeft-=k),f&&h.tailRight&&(h.tailRight+=k),p&&!f&&(h.tail=!1)}if(h.popTop+a.height>w){var O=h.popTop-(w-a.height);h.popTop-=O,!f&&h.tailTop&&(h.tailTop+=O),!f&&h.tailBottom&&(h.tailBottom-=O),p&&f&&(h.tail=!1)}if(h.popTop<0){var T=-1*h.popTop;h.popTop+=T,!f&&h.tailTop&&(h.tailTop-=T),!f&&h.tailBottom&&(h.tailBottom+=T),p&&f&&(h.tail=!1)}}this.set("position",h)}else this.set("position",null)}},t.prototype.show=function(e){this.source=e,this.set("popped",!0)},t.prototype.hide=function(){this.set("popped",!1)},t}(t);t.extendWith(u,{attributes:["popped","tail","where","align","top","left","fit","clickClose","noClickout","gap","offsets"],use:[r(),(void 0===f&&(f={}),function(e){e.instance.events[f.name||"clickout"]=a}),c()],template:d,css:function(e){return[function(e){var t=Object.assign({},e("raui.primary"),e("raui.pop.primary")),n=(e("raui.themes")||[]).slice();return(e("raui.pop.themes")||[]).forEach(function(e){~n.indexOf(e)||n.push(e)}),"\n .rpop-wrapper {\n position: absolute;\n display: inline-block;\n z-index: 11;\n transition-property: top, left, padding;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-with-tail.rpop-above {\n padding-bottom: 10px;\n }\n .rpop-with-tail.rpop-below {\n padding-top: 10px;\n }\n .rpop-with-tail.rpop-left {\n padding-right: 10px;\n }\n .rpop-with-tail.rpop-right {\n padding-left: 10px;\n }\n \n .rpop {\n position: relative;\n box-shadow: 0 1px 4px 0 rgba(0,0,0,0.24);\n border: 1px solid #ccc;\n border-radius: 0.2em;\n background-color: "+(t.bg||"#fff")+";\n color: "+(t.fg||"#222")+";\n padding: 0.5em;\n z-index: 2;\n }\n \n .rpop-modal {\n position: fixed;\n display: flex;\n z-index: 10;\n background-color: rgba(0, 0, 0, 0.2);\n align-items: center;\n justify-content: center;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 1em;\n overflow: auto;\n }\n \n .rpop-tail, .rpop-tail-outer {\n z-index: 3;\n width: 0;\n height: 0;\n position: absolute;\n border-style: solid;\n border-width: 10px;\n border-color: transparent;\n transition-property: top, left, bottom, right, border-color;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-tail-outer {\n z-index: 1;\n border-width: 12px;\n border-color: transparent;\n }\n \n .rpop-below .rpop-tail {\n border-bottom-color: "+(t.bg||"#fff")+";\n }\n .rpop-below .rpop-tail-outer {\n border-bottom-color: "+(t.bc||"#ccc")+";\n }\n \n .rpop-above .rpop-tail {\n border-top-color: "+(t.bg||"#fff")+";\n }\n .rpop-above .rpop-tail-outer {\n border-top-color: "+(t.bc||"#ccc")+";\n }\n \n .rpop-left .rpop-tail {\n border-left-color: "+(t.bg||"#fff")+";\n }\n .rpop-left .rpop-tail-outer {\n border-left-color: "+(t.bc||"#ccc")+";\n }\n \n .rpop-right .rpop-tail {\n border-right-color: "+(t.bg||"#fff")+";\n }\n .rpop-right .rpop-tail-outer {\n border-right-color: "+(t.bc||"#ccc")+";\n }\n "+n.map(function(t){var n=Object.assign({},e("raui.primary"),e("raui.pop.primary"),e("raui."+t),e("raui.pop."+t));return"\n ."+t+" .rpop {\n background-color: "+(n.bg||"#fff")+";\n color: "+(n.fg||"#222")+";\n }\n \n ."+t+".rpop-below .rpop-tail {\n border-bottom-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-below .rpop-tail-outer {\n border-bottom-color: "+(n.bc||"#ccc")+";\n }\n \n ."+t+".rpop-above .rpop-tail {\n border-top-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-above .rpop-tail-outer {\n border-top-color: "+(n.bc||"#ccc")+";\n }\n \n ."+t+".rpop-left .rpop-tail {\n border-left-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-left .rpop-tail-outer {\n border-left-color: "+(n.bc||"#ccc")+";\n }\n \n ."+t+".rpop-right .rpop-tail {\n border-right-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-right .rpop-tail-outer {\n border-right-color: "+(n.bc||"#ccc")+";\n }\n "})}.call(this,e)].join(" ")},cssId:"rpop",noCssTransform:!0,observe:{popped:function(e){var t=this;setTimeout(function(){t.get("popped")===e&&t.set("_popped",e)},100)},_popped:{handler:function(e){var t=this;if(e){var n=this.get("@style.raui.pop.mobile");if(n&&window.matchMedia("(max-width: "+n+")").matches){p||(p=new b({target:document.body,append:!0})).observe("contents",function(e){s=(e||[]).length>0});var i=this.getContext().getParent(!0);i.isContext=1,p.unshift("contents",{content:this.partials.content,context:i,attrs:this.partials["extra-attributes"]||[],clickClose:this.get("clickClose"),noClickout:this.get("noClickout"),done:function(){t.set("popped",!1)}})}else this.set("__popped",!0)}else s?p.shift("contents"):this.set("__popped",!1)},defer:!0},__popped:{handler:function(e){if(e){var t=this.find("div"),n=t,i=n.offsetHeight+n.offsetTop,o=n.offsetWidth+n.offsetLeft,r=n.offsetParent;if(!this.overflows)for(var a=this.overflows={e:[],v:[]};t&&t.style;){if(t===r){if(t.offsetWidth>=o&&t.offsetHeight>=i)break;o+=t.offsetLeft,i+=t.offsetTop,r=t.offsetParent}var l=getComputedStyle(t);if("auto"===l.overflow)break;"hidden"===l.overflow&&(a.e.push(t),a.v.push(t.style.overflow),t.style.overflow="visible"),t=t.parentNode}this.position(),this.transition("pop",n,{intro:!0,dir:this.get("where")||"below"})}else this.source=null,this.tailSource=null},defer:!0},"align where tail fit":{handler:function(){this.position()},defer:!0}},decorators:{cleanup:function(e){var t=this;return{teardown:function(){var e=t.overflows;if(e){t.overflows=null;for(var n=0;n<e.e.length;n++)e.e[n].style.overflow=e.v[n]}}}}},data:function(){return{gap:4}}});var b=function(e){function t(t){e.call(this,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(t);function m(){}function h(e){~this.className.indexOf("focus")||(this.className+=" focus")}function g(e){this.className=this.className.replace(/\bfocus\b/g,"").trim()}function v(e){var t,n,i,o,r,a,l,c,s,p,f,d,u,b=this.getContext(e);function v(){var b=y().split(/\s+/).filter(function(e){return!!e});(t=!!~b.indexOf("field"))||(b.push("field"),t=!0),(n=e.querySelector("input[type=checkbox]"))&&!~b.indexOf("check")&&b.push("check"),(i=e.querySelector("input[type=radio]"))&&!~b.indexOf("radio")&&b.push("radio");var m=n||i;m&&m.checked&&!~b.indexOf("checked")&&b.push("checked"),m&&m.disabled&&!~b.indexOf("disabled")&&b.push("disabled"),!m&&p?(p.cancel(),p=0,f&&(f.disconnect(),f=0),delete m._form_callback,u&&(delete u.checked,d=u=void 0)):m&&(m._form_callback=function(t,n){if(void 0===n&&(n=!0),n&&"radio"===m.type&&m.name){var i=[];i.push.apply(i,document.querySelectorAll("input[type=radio][name="+m.name+"]")),(i=i.filter(function(e){return e!==m})).forEach(function(e){return e._form_callback&&e._form_callback(t,!1)})}var o=m.checked;o&&!~e.className.indexOf("checked")?e.className+=" checked":!o&&~e.className.indexOf("checked")&&(e.className=e.className.replace(/\bchecked\b/g,"").replace(/ +/g," ").trim())},MutationObserver&&(f=new MutationObserver(function(){var t;(t=m.disabled)&&!~e.className.indexOf("disabled")?e.className+=" disabled":!t&&~e.className.indexOf("disabled")&&(e.className=e.className.replace(/\bdisabled\b/g,"").replace(/ +/g," ").trim())})).observe(m,{attributes:!0}),p=this.getContext(m).listen("change",m._form_callback),(d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(m),"checked"))&&d.configurable&&(u=m,Object.defineProperty(m,"checked",{get:d.get,set:function(e){d.set.call(u,e),m._form_callback()},enumerable:!0,configurable:!0}))),(o=!!e.querySelector("textarea"))&&!~b.indexOf("textarea")&&b.push("textarea"),(r=!!e.querySelector("select"))&&!~b.indexOf("select")&&b.push("select"),(a=!!e.querySelector("input[type=file]"))&&!~b.indexOf("file")&&b.push("file"),(l=!!(l=e.querySelector("button"))&&l.parentNode===e)&&!~b.indexOf("button")&&b.push("button"),(c=!!e.querySelector("div"))&&!~b.indexOf("plain")&&b.push("plain"),(s=!(n||i||a||!e.querySelector("input")))&&!~b.indexOf("input")&&b.push("input"),e.className=b.join(" ")}function y(){var p=e.className;return t||(p=p.replace(/\bfield\b/g,"").trim()),n||(p=p.replace(/\bcheck(ed)?\b/g,"").trim()),i||(p=p.replace(/\bradio\b/g,"").trim()),o||(p=p.replace(/\btextarea\b/g,"").trim()),r||(p=p.replace(/\bselect\b/g,"").trim()),a||(p=p.replace(/\bfile\b/g,"").trim()),l||(p=p.replace(/\bbutton\b/g,"").trim()),c||(p=p.replace(/\bplain\b/g,"").trim()),s||(p=p.replace(/\binput\b/g,"").trim()),p=p.replace(/ +/g," ")}var x=b.listen("focusin",h),w=b.listen("focusout",g);return v.call(this),{update:m,invalidate:v.bind(this),teardown:function(){var t=y();t=t.replace(/\bfocus\b/g,"").trim(),x.cancel(),w.cancel(),p&&p.cancel(),f&&f.disconnect(),u&&(delete u.checked,d=u=void 0),e.className=t}}}function y(e,t){if(!e)return!1;for(var n=0;n<e.length;n++){if(e[n].e===t)return!0;if(e[n].f&&y(e[n].f,t))return!0}return!1}t.extendWith(b,{template:{v:d.v,t:d.p.modal},data:function(){return{contents:[]}},use:[r(),c()]}),v.style=function(e){var t=Object.assign({},e("raui.primary"),e("raui.form.primary")),n=Object.assign({},e("raui.primary.active"),e("raui.form.primary.active")),i=e("raui.form.boxy");return"\n label.field {\n display: inline-block;\n font-size: 0.9em;\n font-weight: 500;\n color: "+(t.fg||"#222")+";\n transition: 0.2s ease-in-out;\n transition-property: color;\n vertical-align: top;\n box-sizing: border-box;\n padding: 0.25em 0.5em;\n line-height: 1.5em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: inherit;\n }\n\n label.field.textarea {\n display: block;\n border: 0.0625em solid "+(t.bc||"#ccc")+";\n padding: 0.5em 0.8em 0.8em 0.8em;\n border-radius: "+(t.radius||"0.2em")+";\n box-shadow: none;\n transition-property: color, border-color, box-shadow;\n margin: 0.8em 0.2em;\n min-height: auto;\n background-color: "+(i?t.bg||"#fff":"transparent")+";\n }\n\n label.field.focus {\n color: "+(n.fg||t.fga||"#07e")+";\n }\n\n label.field.textarea.focus {\n border-color: "+(n.fg||t.fga||"#07e")+";\n "+(i?"":"box-shadow: 0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n 0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+";")+"\n }\n\n label.field input,\n label.field select,\n label.field textarea\n {\n display: block;\n border-width: "+(i?"0.0625em":"0 0 0.0625em 0")+";\n border-color: "+(t.bc||"#ccc")+";\n border-style: solid;\n box-sizing: border-box;\n background-color: "+(i?t.bg||"#fff":"transparent")+";\n transition: 0.2s ease-in-out;\n transition-property: box-shadow, color;\n outline: none;\n box-shadow: none;\n width: 100%;\n margin-bottom: 0.8em;\n font-size: 1.1em;"+(i?"\n border-radius: "+(t.radius||"0.2em")+";":"")+"\n font-weight: 400;\n font-family: inherit;\n }\n\n label.field input"+(i?"":":disabled")+",\n label.field select"+(i?"":":disabled")+" {\n padding: 0 0.75em;\n }\n label.field select"+(i?"":":disabled")+" {\n padding-right: 2em;\n }\n\n label.field input:disabled,\n label.field select:disabled,\n label.field textarea:disabled {\n background: #f4f4f4;\n }\n\n label.field textarea {\n line-height: 1.2em;\n }\n label.field .field-wrapper {\n display: block;\n }\n label.field > select, label.field > input,\n label.field > .field-wrapper > input, label.field > .field-wrapper > select {\n height: 2.5em;\n }\n\n "+(i?"":"label.field:hover > input,\n label.field:hover select,\n label.field.file:hover:after {\n box-shadow: 0 0.0625em 0 0 "+(t.bc||"#ccc")+";\n }\n\n label.field.textarea:hover {\n box-shadow: 0.0625em 0.0625em "+(t.bc||"#ccc")+",\n -0.0625em 0.0625em "+(t.bc||"#ccc")+",\n 0.0625em -0.0625em "+(t.bc||"#ccc")+",\n -0.0625em -0.0625em "+(t.bc||"#ccc")+";\n }\n\n label.field.textarea.focus:hover {\n box-shadow: 0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n 0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+";\n }")+"\n\n /**** CHECK BOXES ****/\n\n label.field.check {\n position:relative;\n z-index: 0;\n overflow: visible;\n cursor: pointer;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.check.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: -3px;\n top: 23px;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n background-color: "+(t.bc||"#ccc")+";\n box-shadow: none;\n outline: none;\n opacity: 0;\n transform: scale(1);\n pointer-events: none;\n transition: opacity 0.3s, transform 0.2s;\n }\n label.field.inline.check input {\n top: 3px;\n left: -3px;\n }\n\n label.field.check input:checked {\n background-color: "+(t.fga||"#07e")+';\n }\n\n label.field.check:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n margin: 3px 11px 3px 1px;\n border: solid 2px; /* Safari */\n border-color: '+(t.fg||"#222")+';\n border-radius: 2px;\n width: 18px;\n height: 18px;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after {\n content: "";\n display: block;\n position: absolute;\n top: 0px;\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.8em, 2.65em) rotate(-45deg);\n }\n\n label.field.check.inline:after {\n transform: translate(0.8em, 1.2em) rotate(-45deg);\n }\n\n label.field.check.checked:before {\n border-color: '+(t.fga||"#07e")+";\n background-color: "+(t.fga||"#07e")+";\n }\n label.field.check.focus:before {\n border-color: "+(t.fga||"#07e")+";\n }\n\n label.field.check.checked:after {\n border-color: "+(t.bg||"#fff")+";\n }\n\n label.field.check input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled {\n color: "+(t.bc||"#ccc")+";\n cursor: initial;\n }\n\n label.field.check.disabled:before {\n border-color: "+(t.bc||"#ccc")+";\n }\n\n label.field.check.checked.disabled:before {\n border-color: transparent;\n background-color: "+(t.bc||"#ccc")+";\n }\n\n\n /**** RADIO BUTTONS ****/\n \n label.field.radio {\n z-index: 0;\n position: relative;\n display: inline-block;\n overflow: visible;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.radio.inline {\n padding-top: 0.8em;\n }\n\n label.field.radio input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: 0;\n top: 0;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 41px;\n height: 40px;\n background-color: "+(t.bc||"#ccc")+';\n outline: none;\n opacity: 0;\n pointer-events: none;\n transform: translate(-0.2em, 24px) scale(1);\n transition: opacity 0.3s, transform 0.3s;\n }\n label.field.inline.radio input {\n transform: translate(-0.2em, 3px) scale(1);\n }\n\n label.field.radio {\n cursor: pointer;\n position: relative;\n }\n\n label.field.radio:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n margin: 2px 10px 2px 0;\n border: solid 2px; /* Safari */\n border-color: '+(t.fg||"#222")+';\n border-radius: 50%;\n width: 20px;\n height: 20px;\n vertical-align: middle;\n transition: border-color 0.2s;\n }\n\n label.field.radio:after {\n content: "";\n display: block;\n position: absolute;\n border-radius: 50%;\n width: 10px;\n height: 10px;\n background-color: '+(t.fga||"#07e")+";\n transform: translate(5px, -17px) scale(0);\n transition: transform 0.2s;\n }\n\n label.field.radio input:checked {\n background-color: "+(t.fga||"#07e")+";\n }\n\n label.field.radio.checked:before {\n border-color: "+(t.fga||"#07e")+";\n }\n\n label.field.radio.checked:after {\n transform: translate(5px, -17px) scale(1);\n }\n\n label.field.radio:hover input {\n opacity: 0.04;\n }\n\n label.field.radio input:focus {\n opacity: 0.12;\n transform: translate(-0.2em, 24px) scale(1);\n transition: transform 0.2s, opacity 0.2s;\n }\n label.field.inline.radio input:focus {\n transform: translate(-0.2em, 3px) scale(1);\n }\n\n label.field.radio:hover input:focus {\n opacity: 0.16;\n }\n\n label.field.radio input:active {\n opacity: 1;\n transform: translate(-0.2em, 24px) scale(0);\n transition: transform 0s, opacity 0s;\n }\n label.field.inline.radio input:active {\n transform: translate(-0.2em, 3px) scale(0);\n }\n\n label.field.radio.checked:before {\n border-color: "+(t.fga||"#07e")+";\n }\n\n label.field.radio.focus:before {\n border-color: "+(t.fga||"#07e")+";\n }\n\n label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.radio.disabled {\n color: "+(t.bc||"#ccc")+";\n cursor: initial;\n }\n\n label.field.radio.disabled:before {\n border-color: "+(t.bc||"#ccc")+";\n }\n\n label.field.radio.disabled:after {\n background-color: "+(t.bc||"#ccc")+";\n }\n\n\n\n label.field select {\n padding-right: 2em;\n }\n\n label.field.select {\n cursor: pointer;\n position: relative;\n }\n\n label.field.select:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n right: 19px;\n height: 0.6em;\n top: 2.6em;\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n pointer-events: none;\n color: "+(t.bc||"#ccc")+";\n }\n\n label.field textarea {\n border: none;"+(i?"\n padding: 0;":"")+"\n }\n\n label.field > select {\n -moz-appearance: none;\n -webkit-appearance: none;\n }\n\n label.field input:focus,\n label.field select:focus,\n label.field.file.focus:after\n {\n border-color: "+(n.fg||t.fga||"#07e")+";\n "+(i?"":"box-shadow: 0 0.0625em 0 0 "+(n.fg||t.fga||"#07e")+";")+"\n }\n\n label.field input[type=checkbox]:focus,\n label.field input[type=radio]:focus {\n box-shadow: none;\n }\n\n label.field.file.focus:after {\n color: "+(n.fg||t.fga||"#07e")+";\n }\n label.field.file [type=file] {\n position: absolute;\n width: 0;\n height: 0;\n opacity: 0;\n z-index: -1;\n }\n label.field.file {\n position: relative;\n min-width: 9em;\n height: 5em;\n }\n label.field.file:after {\n position: absolute;\n content: 'Choose a file';\n box-sizing: border-box;\n width: calc(100% - 0.3em);\n height: 2.5em;\n font-size: 1.1em;\n line-height: 1.5em;\n color: "+(t.fg||"#222")+";\n text-align: "+(i?"center":"left")+";\n padding: 0.5em "+(i?"0.5em":"0")+";\n cursor: pointer;\n font-style: oblique;\n left: 0.25em;\n top: 1.6em;\n transition: 0.2s ease-in-out;\n transition-property: color, border-bolor, box-shadow;"+(i?"\n border-radius: "+(t.radius||"0.2em")+";\n border-color: "+(t.bc||"#ccc")+";\n border-style: solid;\n border-width: 0.0625em;":"\n border-bottom-color: "+(t.bc||"#ccc")+";\n border-bottom-width: 0.0625em;\n border-bottom-style: solid;\n ")+"\n }\n label.field.file.inline:after {\n top: 0.2em;\n }\n\n label.field.button {\n vertical-align: top;\n padding-top: "+(i?"1.7":"1.958")+"em;\n }\n label.field .with-buttons button, label.field.button button {\n font-size: 1.1em;\n margin-top: "+(i?"0.15em":"0")+";\n }\n\n label.field .field-wrapper.with-buttons {\n display: flex;\n }\n label.field .with-buttons button {\n flex-shrink: 0;\n padding-left: 0.5em;\n padding-right: 0.5em;\n margin-top: 0;\n margin-right: 0;\n "+(i?"height: 2.5em;\n box-shadow: none;\n border-radius: 0;\n border-left: 1px solid "+(t.bg||"#fff")+";\n margin-left: 0;":"height: 2.25em;")+"\n }"+(i?"\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 "+(t.radius||"0.2em")+" "+(t.radius||"0.2em")+" 0;\n }\n label.field .with-buttons input {\n border-radius: "+(t.radius||"0.2em")+" 0 0 "+(t.radius||"0.2em")+";\n min-width: 0;\n }\n ":"")+"\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n font-weight: normal;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1."+(i?"15":"1")+"em;\n }\n\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: "+(t.fga||"#07e")+";\n color: "+(t.bg||"#fff;")+";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1.2em;\n text-align: center;\n margin-top: -0.2em;\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n "};var x=t.macro(function(e){var t=[],n=(e.template.m||[]).slice(),i=e.template.f||[],o=n.find(function(e){return"value"===e.n}),r=n.find(function(e){return"type"===e.n}),a=n.find(function(e){return"tip"===e.n});if(a&&n.splice(n.indexOf(a),1),r&&"function"==typeof x.types[r.f])t.push.apply(t,x.types[r.f](n,i,e));else if(o){var l={t:7,e:"input",m:[o]};if(y(i,"option")&&(l.e="select",l.f=i),r&&(l.m.push(r),"checkbox"===r.f||"radio"===r.f)){var c=n.find(function(e){return"target"===e.n});c?l.m.push(Object.assign({},c,{n:"name"})):l.m.splice(l.m.indexOf(o),1,Object.assign({},o,{n:"checked"}))}l.m=l.m.concat(n.filter(function(e){return 73===e.t||73===e.t||"placeholder"===e.n})),t.push(l);var s=i.filter(function(e){return"button"===e.e||y(e.f,"button")});s.length&&(t.push.apply(t,s),t=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:t}])}else{var p=i.filter(function(e){return e.e});p.find(function(e){return"button"===e.e})&&p.length>1?t=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:i}]:t.push.apply(t,i)}var f=n.find(function(e){return"label"===e.n});a&&t.unshift({t:7,e:"span",m:[{t:13,n:"class",f:"field-tip"+(f?"":" field-solo-tip"),g:1},{t:13,n:"title",f:a.f},{t:70,n:["click"],f:{r:[],s:"[false]"}}],f:"?"}),f?t.unshift(f.f):t.unshift(" ");var d={t:7,e:"label",m:[{t:71,n:"field"}].concat(n.filter(function(e){return 13!==e.t&&73!==e.t||"value"!==e.n&&"type"!==e.n&&"inline"!==e.n&&"label"!==e.n&&"placeholder"!==e.n&&"target"!==e.n})),f:t};n.find(function(e){return"inline"===e.n})&&d.m.push({t:13,n:"class",f:"inline"}),e.setTemplate([d])});function w(e){return"function"==typeof e.focus&&e.focus(),{teardown:m}}x.types={},i("field","decorators",v),i("field","partials",x),i("autofocus","decorators",w);var _={v:4,t:[{t:7,e:"span",m:[{t:13,n:"class",f:"rautocomplete field-wrapper",g:1},{n:["pop"],t:70,f:{r:["@context","$1"],s:'[(_0).set("rac.pop",_1)]'}}],f:[{t:7,e:"input",m:[{t:8,r:"extra-attributes"},{n:["dblclick"],t:70,f:{r:["rac.pop","@node"],s:"[_0.show(_1)]"}},{n:["focus"],t:70,f:{r:["rac"],s:"[_0.stash()]"}},{n:["input"],t:70,f:{r:["rac","@event"],s:"[_0.input(_1)]"}},{n:["keydown"],t:70,f:{r:["rac","@event"],s:"[_0.key(_1)]"}},{t:73,v:"t",f:"false"},{n:"value",f:[{t:2,r:"rac.display"}],t:13}]}," ",{t:7,e:"rac-pop",m:[{t:13,n:"style",f:"padding: 0;",g:1},{t:13,n:"class",f:"rac-pop",g:1},{n:["init"],t:70,f:{r:["@context","$1"],s:'[(_0).raise("pop",{},_1)]'}},{n:"popped",t:13,f:[{t:2,r:"rac.popped"}]},{n:"where",f:"below",t:13,g:1},{n:"align",f:"end",t:13,g:1},{n:"gap",f:[{t:2,x:{r:[],s:"2"},s:1}],t:13},{n:"offsets",t:13,f:[{t:2,r:"rac.offsets"}]},{n:"fit",t:13,f:[{t:2,r:"rac.fit"}]}],f:[{t:4,f:[{t:7,e:"input",m:[{n:"class-rac-modal",t:13},{n:["input"],t:70,f:{r:["rac","@event"],s:"[_0.input(_1)]"}},{n:["keydown"],t:70,f:{r:["rac","@event"],s:"[_0.key(_1)]"}},{t:73,v:"t",f:"false"},{n:"value",f:[{t:2,r:"rac.display"}],t:13},{n:"autocompletefocus",t:71}]}],n:50,r:"inModal"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rac-list",g:1},{n:"tabindex",f:"-1",t:13,g:1}],f:[{t:55,f:[{f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item rac-invalid",g:1}],f:["Loading..."]}],t:4},{t:62,f:[" ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item",g:1},{n:"tabindex",f:"-1",t:13,g:1},{n:"class-rac-selected",t:13,f:[{t:2,x:{r:["rac.value","."],s:"_0===_1"}}]},{n:"class-rac-hover",t:13,f:[{t:2,x:{r:["rac.selected","@index"],s:"_0===_1"}}]},{n:["click"],t:70,f:{r:["@context","."],s:'[(_0).set("rac.value",_1)]'}},{n:["mouseover"],t:70,f:{r:["@context","@index"],s:'[(_0).set("rac.selected",_1)]'}}],f:[{t:2,x:{r:["rac","."],s:"_0._display(_1)"}}]}],n:52,r:"items"}," "],n:"items"},{t:63,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item rac-invalid",g:1}],f:["Load failed."]}]}],r:"rac.list"}]}]}]}],e:{2:function(){return 2},'[(_0).set("rac.pop",_1)]':function(e,t){return[e.set("rac.pop",t)]},"[_0.show(_1)]":function(e,t){return[e.show(t)]},"[_0.stash()]":function(e){return[e.stash()]},"[_0.input(_1)]":function(e,t){return[e.input(t)]},"[_0.key(_1)]":function(e,t){return[e.key(t)]},'[(_0).raise("pop",{},_1)]':function(e,t){return[e.raise("pop",{},t)]},"_0===_1":function(e,t){return e===t},'[(_0).set("rac.value",_1)]':function(e,t){return[e.set("rac.value",t)]},'[(_0).set("rac.selected",_1)]':function(e,t){return[e.set("rac.selected",t)]},"_0._display(_1)":function(e,t){return e._display(t)}}};function k(e,t){return t.reduce(function(e,t){return e?e[t]:e},e)}var O=t.macro(function(e){var n,i;function o(t){null==t&&(t=null==e.get("rac.value")?"":e.get("rac.display")),t===e.get("rac.tempDisplay")&&(t="");var n=e.get("rac._items");if("function"==typeof n){var i=n(t);"object"==typeof i&&"function"==typeof i.then?i.then(function(t){return e.set("rac.list",t)}):e.set("rac.list",i)}else if(Array.isArray(n)){var o,r=e.get("rac._display");try{o=new RegExp(t||"","i")}catch(e){o=new RegExp((t||"").replace(/([\{\(\[\]\)\}\?\*\^\$])/g,"\\$1"))}e.set("rac.list",n.filter(function(e){return o.test(r(e))}))}else e.set("rac.list",[])}function r(n,r,l){var c=e.get("rac.displayprop");if(e.get("rac.__display")!==c||void 0===e.get("rac._display")){if("string"==typeof c){var s=t.splitKeypath(c);c=function(e){return null==e?"(none)":k(e,s)}}else Array.isArray(c)?c=function(e){return null==e?"(none)":k(e,e)}:c||(c=function(e){return null==e?"(none)":""+e});e.set("rac._display",c),e.set("rac.__display",e.get("rac.displayprop")),e.set("rac.display",c(e.get("rac.value")))}if(c=e.get("rac.member"),e.get("rac.__member")!==c||void 0===e.get("rac._member")){if("string"==typeof c){var p=t.splitKeypath(c);c=function(e){return k(e,p)}}else Array.isArray(c)?c=function(e){return k(e,e)}:c||(c=function(e){return e});e.set("rac._member",c),e.set("rac.__member",e.get("rac.member"))}c=e.get("rac.items"),e.get("rac.__items")===c&&void 0!==e.get("rac._items")||(Array.isArray(c)?e.set("rac._items",c):"function"==typeof c?e.set("rac._items",c):"object"==typeof c&&"function"==typeof c.then?c.then(function(t){e.set("rac._items",t),o()}):e.set("rac._items",[]),e.set("rac.__items",e.get("rac.items"))),i&&"rac.display"===l&&e.get("rac.limit")&&!i.contains(document.activeElement)&&a(),o()}function a(){var t=e.get("rac._display");if("function"==typeof t){var n=t(e.get("rac.value"));e.set("rac.display",n),e.set("rac.tempDisplay",n)}}function l(t){(t.items&&e.link(t.items,"rac.items"),t.value&&e.link(t.value,"rac._value"),t.selected&&e.link(t.selected,"rac.selected"),t["display-value"]&&e.link(t["display-value"],"rac.display"),"display"in t&&e.set("rac.displayprop",t.display),"member"in t&&e.set("rac.member",t.member),"offsets"in t?(e.set("rac.offsets",t.offsets),e.set("rac.fit",!0)):e.set("rac.fit",!1),e.set("rac.limit",t["limit-set"]),e.get("rac.limit")&&e.get("input"))&&(e.get("input")!==document.activeElement&&a());r()}e.aliasLocal("rac"),e.set("rac.list",[]),e.set("rac.popped",!1),e.set("rac.stash",function(){e.set("rac.tempDisplay",e.get("rac.display")),e.set("rac.tempValue",e.get("rac.value"))}),e.set("rac.key",function(t){var n=t.which;if(27===n)e.set("rac.popped",!1),e.set("rac.display",e.get("rac.tempDisplay")),e.set("rac.value",e.get("rac.tempValue"));else if(38===n||40===n){t.preventDefault(),e.get("rac.pop").show(e.find("input"));var i=e.get("rac.selected"),o=e.get("rac.list");38===n?i<=0||null==i?e.set("rac.selected",Array.isArray(o)?o.length-1:0):e.set("rac.selected",i-1):Array.isArray(o)?e.set("rac.selected",i<o.length?i+1:0):e.set("rac.selected",0)}else if(10===n||13===n){var r=e.get("rac.list");Array.isArray(r)&&e.set("rac.value",r[e.get("rac.selected")])}else 9===n&&(e.set("rac.popped",!1),e.get("rac.updateDisplay")())}),e.set("rac.input",function(t){n&&clearTimeout(n),n=setTimeout(function(){n=null,o(t.target.value),e.get("rac.pop").show(e.find("input"))},500),e.set("rac.display",t.target.value)}),e.setTemplate(_),e.set("rac.updateDisplay",function(t){setTimeout(function(){i&&e.get("rac.limit")&&!i.contains(document.activeElement)&&a()},140)}),l(e.attributes);var c={init:!1,defer:!0},s=[e.observe("rac.displayprop",r,c),e.observe("rac.memberprop",r,c),e.observe("rac.items",r,c),e.observe("rac.list",function(t){Array.isArray(t)?e.set("rac.selected",t.indexOf(e.get("rac.value"))):e.set("rac.selected",-1)},c),e.observe("rac.value",function(t){a(),function(){if(!e.get("rac._value")||e.get("rac.value")){var t=e.get("rac._member");if("function"==typeof t){var n=t(e.get("rac.value"));e.set("rac._value",n)}e.ractive.getContext(e.find("input")).raise("selected",{},e.get("rac._value"),e.get("rac.display"))}}(),e.set("rac.popped",!1),e.set("rac.tempValue",t)}),e.observe("rac._value",function(t){var n=e.get("rac._member"),i=e.get("rac.list").find(function(e){return n(e)===t});i!==e.get("rac.value")&&e.set("rac.value",i)})];return{teardown:function(){e.unlink("rac.items"),e.unlink("rac._value"),e.unlink("rac.selected"),e.unlink("rac.display"),s.forEach(function(e){return e.cancel()})},update:l,render:function(){i=e.find("span")}}},{attributes:["items","selected","display","value","member","limit-set","offsets","display-value"],css:function(e){return[function(e){var t=Object.assign({},e("raui.primary"),e("raui.autocomplete.primary"));return".rautocomplete {\n position: relative;\n display: inline-block;\n }\n \n .rac-pop {\n min-width: 100%;\n }\n \n .rac-pop > .rpop {\n padding: 0;\n }\n \n .rac-list {\n display: flex;\n flex-direction: column;\n max-height: 50vh;\n min-height: 2.125em;\n max-width: 100%;\n overflow: auto;\n }\n \n .rac-item {\n color: "+(t.fg||"#222")+";\n background-color: "+(t.bg||"#fff")+";\n padding: 0.25em;\n cursor: pointer;\n }\n \n .rac-selected {\n color: "+(t.bg||"#fff")+";\n background-color: "+(t.fga||"#07e")+";\n }\n \n .rac-hover {\n color: "+(t.fg||"#222")+";\n background-color: "+(t.bc||"#ccc")+";\n }\n \n .rac-invalid {\n cursor: not-allowed;\n }\n \n input.rac-modal {\n width: 100%;\n box-sizing: border-box;\n }"}.call(this,e)].join(" ")},cssId:"rautocomplete",noCssTransform:!0});function T(e){return void 0===e&&(e={}),function(t){var n=t.instance;n.partials[e.name||"autocomplete"]=O,n.components["rac-pop"]=u,n.decorators.autocompletefocus=w}}e.Autocomplete=O,e.FieldType=function(e){return void 0===e&&(e={}),function(t,n,i){return[{t:7,e:e.name||"autocomplete",m:t,f:n}]}},e.plugin=T,e.default=T,Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -162,4 +162,7 @@ (function (global, factory) { | ||
var g = groupForPos(groups, node.selectionStart); | ||
if (updateValues(groups, g, node.selectionStart, true)) { updateDisplay(groups, node); } | ||
var idx = groups.indexOf(g); | ||
if (updateValues(groups, g, node.selectionStart, true)) { | ||
updateDisplay(groups, node); | ||
applyValues(groups, sendValue, ev.shiftKey && idx > 0 || !ev.shiftKey && idx + 1 < groups.length); | ||
} | ||
if (ev.shiftKey && idx > 0) { | ||
@@ -166,0 +169,0 @@ node.setSelectionRange(groups[idx - 1].start, groups[idx - 1].end); |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.RMDate={})}(this,function(e){"use strict";var t=/[^\d]+/,n=/[^\d_]+/,a="_",l={y:0,M:1,d:2,H:3,m:4,s:5,S:6};function u(e,t,n){void 0===n&&(n="0");for(var a=null==e?"":""+e,l=a.length;l<t;l++)a=n+a;return a}function r(e,t,n){void 0===n&&(n="0");for(var a=null==e?"":""+e,l=a.length;l<t;l++)a+=n;return a}var s={mask:"yyyy-MM-dd",time:"00:00:00.000",date:function(){var e=new Date;return new Date(e.getFullYear()+"-"+u(e.getMonth()+1,2)+"-"+u(e.getDate(),2)+"T"+s.time)}};function i(e,l,s,i){void 0===s&&(s=0),void 0===i&&(i=!1);for(var o=!1,v=0;v<e.length;v++){var f=e[v],c=f.input.replace(t,""),p=e[v+1]&&e[v+1].prefix&&n.test(f.input);if(c.length>f.length&&f===l){var g=c.length-l.length;c=c.substr(0,s-l.start)+c.substr(s-l.start+g)}else c=c.substr(0,f.length);if(f.input=c,""===c)f.value=null,f.display=d(f);else if(f!==l)f.value=+c,"M"===f.type&&f.value--,f.display=d(f);else if("M"===f.type&&+c>1||"d"===f.type&&+c>3||"H"===f.type&&+c>2||("m"===f.type||"s"===f.type)&&+c>6)f.value=+c,"M"===f.type&&f.value--,f.display=u(c,f.length),o=!0;else if("y"===f.type&&2===c.length&&(p||i)){var h=(new Date).getFullYear(),y=100*Math.floor(h/100),b=Math.abs(h-(y+ +c))<20?y+ +c:y-100+ +c;f.value=b,f.input=f.display=u(b,f.length),o=!0}else f.display=r(c,f.length,a),f.value=+c}return o}function o(e,t){var n=(t=e.value=t&&D(t))?[t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()]:[null,null,null,null,null,null,null];e.forEach(function(e){e.value=n[l[e.type]],e.input=e.display=d(e)})}function v(e,t,n){var a=e.value||m,u=[a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()];if(e.forEach(function(e){var t=e.value;null!==t&&"M"===e.type?t<0?t=0:t>11&&(t=11):null===t||"m"!==e.type&&"s"!==e.type?null!==t&&"H"===e.type?t<0?t=0:t>23&&(t=23):null!==t&&"h"===e.type&&(t<1?t=1:t>12&&(t=12)):t<0?t=0:t>59&&(t=59),t!==e.value&&(e.value=t,e.display=d(e)),u[l[e.type]]=e.value}),null!==u[0]&&null!==u[1]&&null!==u[2]){var r=e.find(function(e){return"d"===e.type});if(r)if(u[2]<1)r.value=u[2]=1,r.display=d(r);else{var s=b(new Date(u[0],u[1],1));u[2]>s&&(r.value=u[2]=s,r.display=d(r))}}e.find(function(e){return null===e.value})||0===u[0]||u[1]>11||u[1]<0||0===u[2]?e.value=null:(u.unshift(null),e.value=new(Date.bind.apply(Date,u))),t(n)}function f(e,t){t.value=e.reduce(function(e,t){return e+t.prefix+t.display},"")+e.suffix}function c(e,t){return e.find(function(e){return t>=e.start&&t<=e.end})}function d(e){if(null===e.value)return u("",e.length,a);switch(e.type){case"y":return e.value?e.length<=2?(""+e.value).substr(2,2):""+u(e.value,e.length):u("",e.length,a);case"M":return~e.value?1===e.length?""+(e.value+1):2===e.length?(e.value<9?"0":"")+(e.value+1):3===e.length?g[e.value].substr(0,3):g[e.value]:u("",e.length,a);case"d":return e.value?1===e.length?""+e.value:2===e.length?(e.value<=9?"0":"")+e.value:3===e.length?h[e.groups.value.getDay()].substr(0,3):h[e.groups.value.getDay()]:u("",e.length,a);case"H":case"h":case"m":case"s":return 1===e.length?""+e.value:u(e.value,e.length);case"S":return 1===e.length?""+e.value:u(e.value,3)}}var p=/y+|M+|d+|E+|H+|m+|s+|S+|k+|a+/g,g=["January","February","March","April","May","June","July","August","September","October","November","December"],h=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],y={teardown:function(){}};function b(e){return new Date(new Date(e.getFullYear(),e.getMonth()+1,1)-864e5).getDate()}var m=new Date("0000-01-01T00:00:00");function D(e){var t=e;if("function"==typeof t&&(t=e()),"string"==typeof t)try{t=new Date(t)}catch(e){return defaultDate()}return t instanceof Date?t:m}e.padl=u,e.padr=r,e.defaults=s,e.default=function(e){void 0===e&&(e={});var t=e.mask||s.mask,n=(e.time||s.time,e.date||s.date);if("function"!=typeof n){var l=n;n=function(){return l}}return function(l){l.instance.decorators[e.name||"date"]=function(l,u,s){void 0===u&&(u={});var g=Object.assign({},e,"string"==typeof u?{value:u}:0,"string"==typeof s?{mask:s}:0,"object"==typeof u?u:0),h=this.getContext(l),m=g.mask||t,M={observers:[],listeners:[]};if("INPUT"!==l.tagName)return console.warn("Attempted to add a date decorator a "+l.tagName),y;if(!m)return y;for(var w,x=[],S=0;w=p.exec(m);){var k={mask:w[0],type:w[0][0],length:w[0].length,start:w.index,end:w.index+w[0].length,chunk:x.length,prefix:m.substring(S,w.index),groups:x,value:null,display:r("",w[0].length,a)};S=k.end,x.push(k)}if(x.suffix=m.substring(x[x.length-1].end),x.last=null,x.slice(1).find(function(e){return!e.prefix}))return console.warn("Attempted to add a date decorator missing interstitial between fields '"+m+"'"),y;function E(e){if(null===x.value&&null===x.last||+x.value==+x.last)return 1;if(!e||!1===g.lazy){if(!1===g.null&&null===x.value)return o(x,x.last),1;x.last=x.value,"string"==typeof g.value&&(M.observers.forEach(function(e){return e.silence()}),h.set(g.value,x.value),M.observers.forEach(function(e){return e.resume()}))}}"string"==typeof g.value?M.observers.push(h.observe(g.value,function(e){e||!1!==g.null||(e=n()),x.value=e,o(x,e),x.last=e,f(x,l)},{defer:!0})):((g.date||!1===g.null)&&(x.value=D(g.date||n())),f(x,l)),M.listeners.push(h.listen("input",function(){var e=l.selectionStart,t=l.value;!function(e,t,n){var a=t.value,l=t.selectionStart,u=c(e,l),r=0,s=e[r],i=e[r+1];e.forEach(function(e){return e.input=""});for(var o=0;o<a.length;o++)i&&a[o]===i.prefix[0]&&(u!==s||s.input.length>=s.length||a.length-o<n.length-s.end+(s.length-s.input.length))?(i.prefix.length>1&&(o+=i.prefix.length-1),a[o+1]===i.prefix[0]&&(o+=i.prefix.length),s=e[++r],i=e[r+1]):s.input+=a[o]}(x,l,m);var n=c(x,e),a=i(x,n,e);if(v(x,E,!0),f(x,l),n&&(t.length>=m.length&&e===n.end||a)&&n!==x[x.length-1]){var u=x[x.indexOf(n)+1];l.setSelectionRange(u.start,u.end)}else l.setSelectionRange(e,e)})),M.listeners.push(h.listen("blur",function(){E(!1)&&o(x,x.value),f(x,l)}));var H=function(){var e=c(x,l.selectionStart);document.activeElement===l&&l.setSelectionRange(e.start,e.end)};return M.listeners.push(h.listen("click",H)),M.listeners.push(h.listen("focus",H)),M.listeners.push(h.listen("keydown",function(e){switch(e.key){case"Enter":case"Tab":var t=c(x,l.selectionStart);i(x,t,l.selectionStart,!0)&&f(x,l);var n=x.indexOf(t);e.shiftKey&&n>0?(l.setSelectionRange(x[n-1].start,x[n-1].end),e.preventDefault(),e.stopPropagation()):!e.shiftKey&&n+1<x.length&&(l.setSelectionRange(x[n+1].start,x[n+1].end),e.preventDefault(),e.stopPropagation());break;case"ArrowUp":case"ArrowDown":var a=[l.selectionStart,l.selectionEnd],u=a[0],r=a[1],s=c(x,u);null===s.value&&(s.value=1),function(e,t){switch(e.type){case"y":e.value=e.value+(t?-1:1);break;case"M":e.value=t?e.value<1?11:e.value-1:e.value>10?0:e.value+1;break;case"d":var n=e.groups,a=b(new Date((n.find(function(e){return"y"===e.type})||{value:1}).value,(n.find(function(e){return"M"===e.type})||{value:1}).value));e.value=t?e.value<2?a:e.value-1:e.value+1>a?1:e.value+1;break;case"H":e.value=t?e.value<1?23:e.value-1:e.value>22?0:e.value+1;break;case"h":e.value=t?e.value<1?12:e.value-1:e.value>11?1:e.value+1;break;case"m":case"s":e.value=t?e.value<1?59:e.value-1:e.value>58?0:e.value+1;break;case"S":e.value=t?e.value<1?999:e.value-1:e.value>998?0:e.value+1}}(s,"ArrowDown"===e.key),s.input=s.display=d(s),v(x,E,!0),f(x,l),e.preventDefault(),e.stopPropagation(),l.setSelectionRange(u,r)}})),{teardown:function(){M.observers.forEach(function(e){return e.cancel()}),M.listeners.forEach(function(e){return e.cancel()})}}}}},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.RMDate={})}(this,function(e){"use strict";var t=/[^\d]+/,n=/[^\d_]+/,a="_",l={y:0,M:1,d:2,H:3,m:4,s:5,S:6};function u(e,t,n){void 0===n&&(n="0");for(var a=null==e?"":""+e,l=a.length;l<t;l++)a=n+a;return a}function r(e,t,n){void 0===n&&(n="0");for(var a=null==e?"":""+e,l=a.length;l<t;l++)a+=n;return a}var s={mask:"yyyy-MM-dd",time:"00:00:00.000",date:function(){var e=new Date;return new Date(e.getFullYear()+"-"+u(e.getMonth()+1,2)+"-"+u(e.getDate(),2)+"T"+s.time)}};function i(e,l,s,i){void 0===s&&(s=0),void 0===i&&(i=!1);for(var o=!1,v=0;v<e.length;v++){var f=e[v],c=f.input.replace(t,""),g=e[v+1]&&e[v+1].prefix&&n.test(f.input);if(c.length>f.length&&f===l){var p=c.length-l.length;c=c.substr(0,s-l.start)+c.substr(s-l.start+p)}else c=c.substr(0,f.length);if(f.input=c,""===c)f.value=null,f.display=d(f);else if(f!==l)f.value=+c,"M"===f.type&&f.value--,f.display=d(f);else if("M"===f.type&&+c>1||"d"===f.type&&+c>3||"H"===f.type&&+c>2||("m"===f.type||"s"===f.type)&&+c>6)f.value=+c,"M"===f.type&&f.value--,f.display=u(c,f.length),o=!0;else if("y"===f.type&&2===c.length&&(g||i)){var h=(new Date).getFullYear(),y=100*Math.floor(h/100),b=Math.abs(h-(y+ +c))<20?y+ +c:y-100+ +c;f.value=b,f.input=f.display=u(b,f.length),o=!0}else f.display=r(c,f.length,a),f.value=+c}return o}function o(e,t){var n=(t=e.value=t&&D(t))?[t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()]:[null,null,null,null,null,null,null];e.forEach(function(e){e.value=n[l[e.type]],e.input=e.display=d(e)})}function v(e,t,n){var a=e.value||m,u=[a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()];if(e.forEach(function(e){var t=e.value;null!==t&&"M"===e.type?t<0?t=0:t>11&&(t=11):null===t||"m"!==e.type&&"s"!==e.type?null!==t&&"H"===e.type?t<0?t=0:t>23&&(t=23):null!==t&&"h"===e.type&&(t<1?t=1:t>12&&(t=12)):t<0?t=0:t>59&&(t=59),t!==e.value&&(e.value=t,e.display=d(e)),u[l[e.type]]=e.value}),null!==u[0]&&null!==u[1]&&null!==u[2]){var r=e.find(function(e){return"d"===e.type});if(r)if(u[2]<1)r.value=u[2]=1,r.display=d(r);else{var s=b(new Date(u[0],u[1],1));u[2]>s&&(r.value=u[2]=s,r.display=d(r))}}e.find(function(e){return null===e.value})||0===u[0]||u[1]>11||u[1]<0||0===u[2]?e.value=null:(u.unshift(null),e.value=new(Date.bind.apply(Date,u))),t(n)}function f(e,t){t.value=e.reduce(function(e,t){return e+t.prefix+t.display},"")+e.suffix}function c(e,t){return e.find(function(e){return t>=e.start&&t<=e.end})}function d(e){if(null===e.value)return u("",e.length,a);switch(e.type){case"y":return e.value?e.length<=2?(""+e.value).substr(2,2):""+u(e.value,e.length):u("",e.length,a);case"M":return~e.value?1===e.length?""+(e.value+1):2===e.length?(e.value<9?"0":"")+(e.value+1):3===e.length?p[e.value].substr(0,3):p[e.value]:u("",e.length,a);case"d":return e.value?1===e.length?""+e.value:2===e.length?(e.value<=9?"0":"")+e.value:3===e.length?h[e.groups.value.getDay()].substr(0,3):h[e.groups.value.getDay()]:u("",e.length,a);case"H":case"h":case"m":case"s":return 1===e.length?""+e.value:u(e.value,e.length);case"S":return 1===e.length?""+e.value:u(e.value,3)}}var g=/y+|M+|d+|E+|H+|m+|s+|S+|k+|a+/g,p=["January","February","March","April","May","June","July","August","September","October","November","December"],h=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],y={teardown:function(){}};function b(e){return new Date(new Date(e.getFullYear(),e.getMonth()+1,1)-864e5).getDate()}var m=new Date("0000-01-01T00:00:00");function D(e){var t=e;if("function"==typeof t&&(t=e()),"string"==typeof t)try{t=new Date(t)}catch(e){return defaultDate()}return t instanceof Date?t:m}e.padl=u,e.padr=r,e.defaults=s,e.default=function(e){void 0===e&&(e={});var t=e.mask||s.mask,n=(e.time||s.time,e.date||s.date);if("function"!=typeof n){var l=n;n=function(){return l}}return function(l){l.instance.decorators[e.name||"date"]=function(l,u,s){void 0===u&&(u={});var p=Object.assign({},e,"string"==typeof u?{value:u}:0,"string"==typeof s?{mask:s}:0,"object"==typeof u?u:0),h=this.getContext(l),m=p.mask||t,M={observers:[],listeners:[]};if("INPUT"!==l.tagName)return console.warn("Attempted to add a date decorator a "+l.tagName),y;if(!m)return y;for(var w,x=[],S=0;w=g.exec(m);){var k={mask:w[0],type:w[0][0],length:w[0].length,start:w.index,end:w.index+w[0].length,chunk:x.length,prefix:m.substring(S,w.index),groups:x,value:null,display:r("",w[0].length,a)};S=k.end,x.push(k)}if(x.suffix=m.substring(x[x.length-1].end),x.last=null,x.slice(1).find(function(e){return!e.prefix}))return console.warn("Attempted to add a date decorator missing interstitial between fields '"+m+"'"),y;function E(e){if(null===x.value&&null===x.last||+x.value==+x.last)return 1;if(!e||!1===p.lazy){if(!1===p.null&&null===x.value)return o(x,x.last),1;x.last=x.value,"string"==typeof p.value&&(M.observers.forEach(function(e){return e.silence()}),h.set(p.value,x.value),M.observers.forEach(function(e){return e.resume()}))}}"string"==typeof p.value?M.observers.push(h.observe(p.value,function(e){e||!1!==p.null||(e=n()),x.value=e,o(x,e),x.last=e,f(x,l)},{defer:!0})):((p.date||!1===p.null)&&(x.value=D(p.date||n())),f(x,l)),M.listeners.push(h.listen("input",function(){var e=l.selectionStart,t=l.value;!function(e,t,n){var a=t.value,l=t.selectionStart,u=c(e,l),r=0,s=e[r],i=e[r+1];e.forEach(function(e){return e.input=""});for(var o=0;o<a.length;o++)i&&a[o]===i.prefix[0]&&(u!==s||s.input.length>=s.length||a.length-o<n.length-s.end+(s.length-s.input.length))?(i.prefix.length>1&&(o+=i.prefix.length-1),a[o+1]===i.prefix[0]&&(o+=i.prefix.length),s=e[++r],i=e[r+1]):s.input+=a[o]}(x,l,m);var n=c(x,e),a=i(x,n,e);if(v(x,E,!0),f(x,l),n&&(t.length>=m.length&&e===n.end||a)&&n!==x[x.length-1]){var u=x[x.indexOf(n)+1];l.setSelectionRange(u.start,u.end)}else l.setSelectionRange(e,e)})),M.listeners.push(h.listen("blur",function(){E(!1)&&o(x,x.value),f(x,l)}));var H=function(){var e=c(x,l.selectionStart);document.activeElement===l&&l.setSelectionRange(e.start,e.end)};return M.listeners.push(h.listen("click",H)),M.listeners.push(h.listen("focus",H)),M.listeners.push(h.listen("keydown",function(e){switch(e.key){case"Enter":case"Tab":var t=c(x,l.selectionStart),n=x.indexOf(t);i(x,t,l.selectionStart,!0)&&(f(x,l),v(x,E,e.shiftKey&&n>0||!e.shiftKey&&n+1<x.length)),e.shiftKey&&n>0?(l.setSelectionRange(x[n-1].start,x[n-1].end),e.preventDefault(),e.stopPropagation()):!e.shiftKey&&n+1<x.length&&(l.setSelectionRange(x[n+1].start,x[n+1].end),e.preventDefault(),e.stopPropagation());break;case"ArrowUp":case"ArrowDown":var a=[l.selectionStart,l.selectionEnd],u=a[0],r=a[1],s=c(x,u);null===s.value&&(s.value=1),function(e,t){switch(e.type){case"y":e.value=e.value+(t?-1:1);break;case"M":e.value=t?e.value<1?11:e.value-1:e.value>10?0:e.value+1;break;case"d":var n=e.groups,a=b(new Date((n.find(function(e){return"y"===e.type})||{value:1}).value,(n.find(function(e){return"M"===e.type})||{value:1}).value));e.value=t?e.value<2?a:e.value-1:e.value+1>a?1:e.value+1;break;case"H":e.value=t?e.value<1?23:e.value-1:e.value>22?0:e.value+1;break;case"h":e.value=t?e.value<1?12:e.value-1:e.value>11?1:e.value+1;break;case"m":case"s":e.value=t?e.value<1?59:e.value-1:e.value>58?0:e.value+1;break;case"S":e.value=t?e.value<1?999:e.value-1:e.value>998?0:e.value+1}}(s,"ArrowDown"===e.key),s.input=s.display=d(s),v(x,E,!0),f(x,l),e.preventDefault(),e.stopPropagation(),l.setSelectionRange(u,r)}})),{teardown:function(){M.observers.forEach(function(e){return e.cancel()}),M.listeners.forEach(function(e){return e.cancel()})}}}}},Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -40,2 +40,3 @@ (function (global, factory) { | ||
if (!(dt instanceof Date)) { return {}; } | ||
if (isNaN(dt)) { dt = new Date(); } | ||
@@ -884,4 +885,7 @@ if (offset) { dt = new Date(dt.getFullYear(), dt.getMonth() + offset, dt.getDate()); } | ||
var g = groupForPos(groups, node.selectionStart); | ||
if (updateValues(groups, g, node.selectionStart, true)) { updateDisplay(groups, node); } | ||
var idx = groups.indexOf(g); | ||
if (updateValues(groups, g, node.selectionStart, true)) { | ||
updateDisplay(groups, node); | ||
applyValues(groups, sendValue, ev.shiftKey && idx > 0 || !ev.shiftKey && idx + 1 < groups.length); | ||
} | ||
if (ev.shiftKey && idx > 0) { | ||
@@ -888,0 +892,0 @@ node.setSelectionRange(groups[idx - 1].start, groups[idx - 1].end); |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],e):e(t.RMDateInput={},t.Ractive)}(this,function(t,e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var n=function(){try{var t=navigator.language||navigator.browserLanguage||navigator.languages[0]||"en";return[[0,1,2,3,4,5,6,7,8,9,10,11].map(function(e){return new Date(2006,e,1).toLocaleString(t,{month:"long"})}),[1,2,3,4,5,6,7].map(function(e){return new Date(2006,0,e).toLocaleString(t,{weekday:"long"})})]}catch(t){return[["January","February","March","April","May","June","July","August","September","October","November","December"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]]}}(),r=n[0],o=n[1],i=o.map(function(t){return t[0]}).concat(o.map(function(t){return t[0].toUpperCase()})),a=r.map(function(t){return t.substr(0,3)}),l=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.month=function(t,e){void 0===e&&(e=0);var n,r=t||new Date;if(!(r instanceof Date))return{};e&&(r=new Date(r.getFullYear(),r.getMonth()+e,r.getDate()));try{n=+this.get("firstDay")}catch(t){}("number"!=typeof n||isNaN(n))&&(n=0),n>6&&(n=0);for(var o=new Date(r.getFullYear(),r.getMonth(),0),a=new Date(r.getFullYear(),r.getMonth()+1,0).getDate(),l=new Date(r.getFullYear(),r.getMonth()+1,1),s=new Date(r.getFullYear(),r.getMonth(),1).getDay(),f=[],c=f[0]=[],u=0;u<7;u++)f[0].unshift({y:o.getFullYear(),m:o.getMonth(),d:o.getDate()-u}),f[0].push({y:r.getFullYear(),m:r.getMonth(),d:u+1});f[0]=n<=s?f[0].slice(7-(s-n),14-(s-n)):f[0].slice(n-s,7+n-s),1===f[0][0].d&&f.unshift(c.slice(0,7));for(var p=f[f.length-1][f[f.length-1].length-1].d,d=f.length;d<5;d++){f[d]=[];for(var g=0;g<7&&p+1<=a;g++)f[d].push({y:r.getFullYear(),m:r.getMonth(),d:++p});if(f[d].length<7){for(var h=7-f[d].length,v=1;v<=h;v++)f[d].push({y:l.getFullYear(),m:l.getMonth(),d:v});f[d+1]=[];for(var m=0,y=h+1;m<7;m++,y++)f[d+1].push({y:l.getFullYear(),m:l.getMonth(),d:y})}}if(!f[5]){for(f[5]=[];p<a;)f[5].push({y:r.getFullYear(),m:r.getMonth(),d:++p});for(var b=1;b<8;b++)f[5].push({y:l.getFullYear(),m:l.getMonth(),d:b});f[5]=f[5].slice(0,7)}return{days:i.slice(n,n+7),weeks:f,year:r.getFullYear(),month:r.getMonth(),currentYear:(new Date).getFullYear()}},e.prototype.year=function(t,e){void 0===e&&(e=0);var n=t||new Date;if(!(n instanceof Date))return{};e&&(n=new Date(n.getFullYear()+e,n.getMonth(),n.getDate()));for(var r=[],o=0;o<4;o++){r.push([]);for(var i=0;i<3;i++)r[o].push({m:3*o+i,y:n.getFullYear()})}return{year:n.getFullYear(),months:r}},e.prototype.decade=function(t,e){void 0===e&&(e=0);var n=t||new Date;if(!(n instanceof Date))return{};e&&(n=new Date(n.getFullYear()+10*e,n.getMonth(),n.getDate()));for(var r=10*Math.floor(n.getFullYear()/10),o=r-1,i=[],a=0;a<4;a++){i.push([]);for(var l=0;l<3;l++)i[a].push({y:o+3*a+l})}return{start:r,end:r+9,years:i}},e.prototype.monthName=function(t){return r[t]},e.prototype.shortMonthName=function(t){return a[t]},e.prototype.dayName=function(t){return o[t]},e.prototype.select=function(t){if(t&&t instanceof Date)this.set("current",t);else{var e=this.get("safeCurrent");t&&this.set("current",new Date(t.y||e.getFullYear(),"number"==typeof t.m?t.m:e.getMonth(),t.d||e.getDate()));var n=this.get("mode");"year"===n?this.set("mode","months"):"months"===n&&this.set("mode","month"),this.set("target",this.get("current"))}},e.prototype.isCurrent=function(t){var e=this.get("safeCurrent");return!!e&&(t&&t.y===e.getFullYear()&&(null==t.m||t.m===e.getMonth())&&(null==t.d||t.d===e.getDate()))},e.prototype.next=function(){var t=this.get("safeTarget"),e=this.get("mode");"month"===e&&this.set("target",new Date(t.getFullYear(),t.getMonth()+1,1)),"months"===e&&this.set("target",new Date(t.getFullYear()+1,t.getMonth(),1)),"year"===e&&this.set("target",new Date(t.getFullYear()+10,t.getMonth(),1))},e.prototype.prev=function(){var t=this.get("safeTarget"),e=this.get("mode");"month"===e&&this.set("target",new Date(t.getFullYear(),t.getMonth()-1,1)),"months"===e&&this.set("target",new Date(t.getFullYear()-1,t.getMonth(),1)),"year"===e&&this.set("target",new Date(t.getFullYear()-10,t.getMonth(),1))},e.prototype.today=function(){this.set("current",new Date),this.set("target",this.get("current"))},e}(e);e.extendWith(l,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal",g:1}],f:[{t:4,f:[{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"left",x:{x:{r:["@index"],s:"_0===0"}}},{n:"right",x:{x:{r:["@last","@index"],s:"_0===_1"}}}]}],n:52,z:[{n:"offset",x:{r:"."}}],r:"~/padding"}],n:50,r:"~/padding"},{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"offset",x:{x:{r:[],s:"0"}}},{n:"left",x:{x:{r:[],s:"true"}}},{n:"right",x:{x:{r:[],s:"true"}}}]}],n:51,l:1}]}],e:{0:function(){return 0},"_0===0":function(t){return 0===t},"_0===_1":function(t,e){return t===e},true:function(){return!0},"[_0.prev(),false]":function(t){return[t.prev(),!1]},'[_0.set("mode","month"),false]':function(t){return[t.set("mode","month"),!1]},"[_0.next(),false]":function(t){return[t.next(),!1]},"_1>_0||_1<_2":function(t,e,n){return e>t||e<n},"_0.isCurrent(_1)":function(t,e){return t.isCurrent(e)},"[_0.select(_1),false]":function(t,e){return[t.select(e),!1]},"_0.decade(_1,_2)":function(t,e,n){return t.decade(e,n)},'[_0.set("mode","year"),false]':function(t){return[t.set("mode","year"),!1]},"_0.shortMonthName(_1)":function(t,e){return t.shortMonthName(e)},"_0.year(_1,_2)":function(t,e,n){return t.year(e,n)},'[_0.set("mode","months"),false]':function(t){return[t.set("mode","months"),!1]},"_0.monthName(_1)":function(t,e){return t.monthName(e)},"_0!==_1":function(t,e){return t!==e},"[_0.select(_1)]":function(t,e){return[t.select(e)]},"_0.month(_1,_2)":function(t,e,n){return t.month(e,n)}},p:{year:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","month"),false]'}}],f:[{t:2,r:".start"}," - ",{t:2,r:".end"}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-decade",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:["year.end",".y","year.start"],s:"_1>_0||_1<_2"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1),false]"}}],f:[{t:2,r:".y"}]}],n:52,r:"."}]}],n:52,r:".years"}]}],n:54,z:[{n:"year",x:{r:"."}}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.decade(_1,_2)"}}],months:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","year"),false]'}}],f:[{t:2,r:".year"}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-year",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1),false]"}}],f:[{t:2,x:{r:["@this",".m"],s:"_0.shortMonthName(_1)"}}]}],n:52,r:"."}]}],n:52,r:".months"}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.year(_1,_2)"}}],month:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1},{n:"class-rcal-pad",t:13,f:[{t:2,r:"~/pad"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","months"),false]'}}],f:[{t:2,x:{r:["@this",".month"],s:"_0.monthName(_1)"}},{t:4,f:[", ",{t:2,r:".year"}],n:50,x:{r:[".currentYear",".year"],s:"_0!==_1"}}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-month",g:1}],f:[{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week rcal-week-header",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day rcal-day-header",g:1}],f:[{t:2,r:"."}]}],n:52,r:".days"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:[".m","month.month"],s:"_0!==_1"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1)]"}}],f:[{t:2,r:".d"}]}],n:52,r:"."}]}],n:52,r:".weeks"}],n:54,z:[{n:"month",x:{r:"."}}]}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.month(_1,_2)"}}]}},css:function(t){return[function(t){return".rcal-wrapper {\n display: inline-block;\n }\n \n .rcal-pad {\n padding: 0.5em;\n }\n \n .rcal-block-outer {\n border: 1px solid "+(t("raui.datePicker.primary.bga")||t("raui.primary.bga")||"#f4f4f4")+";\n }\n \n .rcal-block-header {\n text-align: center;\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n cursor: default;\n display: flex;\n justify-content: space-between;\n padding: 0 0.5em;\n line-height: 1em;\n height: 1.5em;\n align-items: center;\n }\n \n .rcal-click {\n cursor: pointer;\n }\n \n .rcal-left, .rcal-right {\n height: 0.8em;\n display: inline-block;\n box-sizing: border-box;\n border: 0.4em solid transparent;\n cursor: pointer;\n }\n .rcal-left {\n border-right-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n }\n .rcal-right {\n border-left-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n }\n \n .rcal-month, .rcal-year, .rcal-decade {\n display: flex;\n flex-direction: column;\n background-color: "+(t("raui.datePicker.primary.bga")||t("raui.primary.bga")||"#f4f4f4")+";\n width: calc(10.5em + 6px);\n height: calc(10.5em + 6px);\n justify-content: space-between;\n }\n .rcal-year, .rcal-decade {\n justify-content: space-around;\n }\n \n .rcal-week {\n height: 1.5em;\n display: flex;\n justify-content: space-between;\n width: calc(10.5em + 6px);\n }\n \n .rcal-inner-row {\n height: 2em;\n display: flex;\n justify-content: space-around;\n width: calc(10.5em + 6px);\n }\n \n .rcal-inner-pick {\n background-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n width: 3em;\n height: 2em;\n line-height: 2em;\n text-align: center;\n cursor: pointer;\n }\n \n .rcal-week-header {\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n }\n \n .rcal-day {\n background-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n width: 1.5em;\n height: 1.5em;\n text-align: center;\n line-height: 1.5em;\n cursor: pointer;\n }\n \n .rcal-day-header {\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n cursor: default;\n }\n \n .rcal-off-day {\n background-color: "+(t("raui.datePicker.primary.bc")||t("raui.primary.bc")||"#ccc")+";\n }\n \n .rcal-current {\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n background-color: "+(t("raui.datePicker.primary.fg")||t("raui.primary.fg")||"#222")+";\n }\n "}.call(this,t)].join(" ")},noCssTransform:!0,data:function(){return{mode:"month",target:new Date}},computed:{safeCurrent:function(){var t=this.get("current");if("string"==typeof t)try{t=new Date(t)}catch(t){}return t instanceof Date||(t=new Date),t},safeTarget:function(){var t=this.get("target");if(t||(t=this.get("current")),"string"==typeof t)try{t=new Date(t)}catch(t){}return t instanceof Date?t:new Date}}});var s="undefined"!=typeof window?window:null;function f(t,e,n){if(s&&s.Ractive&&"object"==typeof s.Ractive[e]){var r=document.currentScript;if(r||(r=(r=document.querySelectorAll("script"))[r.length-1]),r){var o=r.getAttribute("data-alias");o&&(o=(o=o.split("&")).reduce(function(t,e){var n=e.split("="),r=n[0],o=n[1];return t[r]=o,t},{})),Ractive[e][o&&o[t]||t]=n}}}function c(t,e){void 0===e&&(e={});var n=t.processParams(e,{duration:400,easing:"easeInOut"});e.dir=e.dir||!1;var r=e.distance||"20px",o=e.scale||"0.9",i="above"===e.dir?"translateY("+r+")":"left"===e.dir?"translateX("+r+")":"right"===e.dir?"translateX(-"+r+")":"translateY(-"+r+")";return t.isIntro||n.intro?(t.setStyle("opacity",0),t.setStyle("transform","scale("+o+") "+i),t.animateStyle({opacity:1,transform:"none"},n)):(t.setStyle("opacity",1),t.setStyle("transform","none"),t.animateStyle({opacity:0,transform:"scale("+o+") "+i},n))}function u(t){return void 0===t&&(t={}),function(e){e.instance.transitions[t.name||"pop"]=c}}function p(t,e){var n=!1,r=!1;function o(n){for(var r=n.target;r;){if(r===t)return;if(!r.parentNode&&r!==document)return;r=r.parentNode}e(n)}return setTimeout(function(){n=!0,r||(document.body.addEventListener("click",o),document.body.addEventListener("touchstop",o))}),{teardown:function(){r=!0,n&&(document.body.removeEventListener("click",o),document.body.removeEventListener("touchstop",o))}}}function d(t,e){var n=t.processParams(e,{duration:200,easing:"easeInOut"});return t.isIntro||n.intro?(t.setStyle("opacity",0),t.animateStyle("opacity",1,n)):(t.setStyle("opacity",1),t.animateStyle("opacity",0,n))}function g(t){return void 0===t&&(t={}),function(e){e.instance.transitions[t.name||"fade"]=d}}f("pop","transitions",c),f("fade","transitions",d);var h,v,m,y,b={v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-wrapper",g:1},{n:"class-rpop-with-tail",t:13,f:[{t:2,r:"position.tail"}]},{n:"class",f:["rpop-",{t:2,x:{r:["where"],s:'_0||"below"'}}," rpop-align-",{t:2,x:{r:["align"],s:'_0||"middle"'}}],t:13},{t:4,f:[{n:"style-top",f:[{t:2,r:"position.popTop"},"px"],t:13},{n:"style-left",f:[{t:2,r:"position.popLeft"},"px"],t:13}],n:50,r:"position"},{t:4,f:[{t:4,f:[{n:"style-top",f:[{t:2,r:"top"}],t:13}],n:50,r:"top"},{t:4,f:[{n:"style-left",f:[{t:2,r:"left"}],t:13}],n:50,r:"left"}],n:51,l:1},{n:"pop",t:72,f:{r:["where"],s:'[{dir:_0||"below"}]'},v:"t2"},{n:"cleanup",t:71},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:50,r:"clickClose"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:51,r:"noClickout"},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailRight"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail-outer",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailRight"}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content"}]}]}],n:50,r:"__popped"}],e:{'_0||"below"':function(t){return t||"below"},'_0||"middle"':function(t){return t||"middle"},'[{dir:_0||"below"}]':function(t){return[{dir:t||"below"}]},'[_0.set("popped",false)]':function(t){return[t.set("popped",!1)]},"_0+(_1?1:0)":function(t,e){return t+(e?1:0)},"_0+(_1?0:1)":function(t,e){return t+(e?0:1)},"_0-2":function(t){return t-2},"[{delay:200}]":function(){return[{delay:200}]},"[_0===_1&&_2.done(),true]":function(t,e,n){return[t===e&&n.done(),!0]},"[_0.done()]":function(t){return[t.done()]},true:function(){return!0}},p:{modal:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-modal",g:1},{n:"fade",t:72,v:"t1"},{n:"fade",t:72,f:{r:[],s:"[{delay:200}]"},v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["@node","@event.target","."],s:"[_0===_1&&_2.done(),true]"}}],n:51,r:".noClickout"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1},{n:"pop",t:72,f:{r:[],s:"[{delay:200}]"},v:"t1"},{n:"pop",t:72,v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.done()]"}}],n:50,r:".clickClose"},{t:8,r:".attrs",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}],f:[{t:8,r:".content",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}]}]}],n:54,r:"contents.0"}],n:50,r:"contents.length"}]}};function w(){}var x,_=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.position=function(t){var e=t||this.source,n=this.get("popped");if(e&&n){var r=this.find("div");if(e&&r&&r.offsetParent){var o=r.offsetParent,i=o.getBoundingClientRect(),a=r.getBoundingClientRect(),l=e.getBoundingClientRect(),s=this.get("where")||"below",f=this.get("align")||"middle",c=this.get("tail"),u="above"===s||"below"===s,p=this.get("fit"),d=this.get("gap"),g="above"===s||"below"===s?0:"left"===s?-a.width-d:l.width+d,h="left"===s||"right"===s?-l.height:"above"===s?-l.height-a.height-d:d;"middle"===f?"below"===s||"above"===s?g-=(a.width-l.width)/2:"left"!==s&&"right"!==s||(h-=(a.height-l.height)/2):"end"===f&&("below"===s||"above"===s?g+=l.width-a.width:"left"!==s&&"right"!==s||(h+=l.height-a.height));var v={popTop:l.bottom-i.top+h,popLeft:l.left-i.left+g,tail:c,vert:"above"===s||"below"===s};if(o.scrollTop&&(v.popTop+=o.scrollTop),o.scrollLeft&&(v.popLeft+=o.scrollLeft),c){"above"===s?v.tailBottom=-10:"below"===s?v.tailTop=-10:"left"===s?v.tailRight=-10:"right"===s&&(v.tailLeft=-10);var m=this.tailSource?this.tailSource.getBoundingClientRect():l;"start"===f?u?v.tailLeft=Math.floor(m.width/2)-10:v.tailTop=Math.floor(m.height/2)-10:"end"===f?u?v.tailRight=Math.floor(m.width/2)-10:v.tailBottom=Math.floor(m.height/2)-10:"middle"===f&&(u?v.tailLeft=Math.floor(m.width/2)-10:v.tailTop=Math.floor(m.height/2)-10),m!==l?u?(v.tailLeft&&(v.tailLeft+=m.left-l.left),v.tailRight&&(v.tailRight+=l.right-m.right)):(v.tailTop&&(v.tailTop+=m.top-l.top),v.tailBottom&&(v.tailBottom+=l.bottom-m.bottom)):"middle"===f&&(u?(v.tailLeft&&(v.tailLeft+=m.left-(v.popLeft+i.left)),v.tailRight&&(v.tailRight+=v.popLeft+i.left+a.width-m.right)):(v.tailTop&&(v.tailTop+=m.top-(v.popTop+i.top)),v.tailBottom&&(v.tailBottom+=v.popTop+i.top+a.height-m.bottom)))}if(p){var y=o;if(this.get("offsets"))for(var b=this.get("offsets");b--;)y=y.offsetParent;var w=o.scrollWidth,x=o.scrollHeight;if(v.popLeft+a.width>w){var _=v.popLeft-(w-a.width);v.popLeft-=_,u&&v.tailLeft&&(v.tailLeft+=_),u&&v.tailRight&&(v.tailRight-=_),c&&!u&&(v.tail=!1)}if(v.popLeft<0){var k=-1*v.popLeft;v.popLeft+=k,u&&v.tailLeft&&(v.tailLeft-=k),u&&v.tailRight&&(v.tailRight+=k),c&&!u&&(v.tail=!1)}if(v.popTop+a.height>x){var D=v.popTop-(x-a.height);v.popTop-=D,!u&&v.tailTop&&(v.tailTop+=D),!u&&v.tailBottom&&(v.tailBottom-=D),c&&u&&(v.tail=!1)}if(v.popTop<0){var M=-1*v.popTop;v.popTop+=M,!u&&v.tailTop&&(v.tailTop-=M),!u&&v.tailBottom&&(v.tailBottom+=M),c&&u&&(v.tail=!1)}}this.set("position",v)}else this.set("position",null)}},e.prototype.show=function(t){this.source=t,this.set("popped",!0)},e.prototype.hide=function(){this.set("popped",!1)},e}(e);e.extendWith(_,{attributes:["popped","tail","where","align","top","left","fit","clickClose","noClickout","gap","offsets"],use:[u(),(void 0===x&&(x={}),function(t){t.instance.events[x.name||"clickout"]=p}),g()],template:b,css:function(t){return[function(t){var e=Object.assign({},t("raui.primary"),t("raui.pop.primary")),n=(t("raui.themes")||[]).slice();return(t("raui.pop.themes")||[]).forEach(function(t){~n.indexOf(t)||n.push(t)}),"\n .rpop-wrapper {\n position: absolute;\n display: inline-block;\n z-index: 11;\n transition-property: top, left, padding;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-with-tail.rpop-above {\n padding-bottom: 10px;\n }\n .rpop-with-tail.rpop-below {\n padding-top: 10px;\n }\n .rpop-with-tail.rpop-left {\n padding-right: 10px;\n }\n .rpop-with-tail.rpop-right {\n padding-left: 10px;\n }\n \n .rpop {\n position: relative;\n box-shadow: 0 1px 4px 0 rgba(0,0,0,0.24);\n border: 1px solid #ccc;\n border-radius: 0.2em;\n background-color: "+(e.bg||"#fff")+";\n color: "+(e.fg||"#222")+";\n padding: 0.5em;\n z-index: 2;\n }\n \n .rpop-modal {\n position: fixed;\n display: flex;\n z-index: 10;\n background-color: rgba(0, 0, 0, 0.2);\n align-items: center;\n justify-content: center;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 1em;\n overflow: auto;\n }\n \n .rpop-tail, .rpop-tail-outer {\n z-index: 3;\n width: 0;\n height: 0;\n position: absolute;\n border-style: solid;\n border-width: 10px;\n border-color: transparent;\n transition-property: top, left, bottom, right, border-color;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-tail-outer {\n z-index: 1;\n border-width: 12px;\n border-color: transparent;\n }\n \n .rpop-below .rpop-tail {\n border-bottom-color: "+(e.bg||"#fff")+";\n }\n .rpop-below .rpop-tail-outer {\n border-bottom-color: "+(e.bc||"#ccc")+";\n }\n \n .rpop-above .rpop-tail {\n border-top-color: "+(e.bg||"#fff")+";\n }\n .rpop-above .rpop-tail-outer {\n border-top-color: "+(e.bc||"#ccc")+";\n }\n \n .rpop-left .rpop-tail {\n border-left-color: "+(e.bg||"#fff")+";\n }\n .rpop-left .rpop-tail-outer {\n border-left-color: "+(e.bc||"#ccc")+";\n }\n \n .rpop-right .rpop-tail {\n border-right-color: "+(e.bg||"#fff")+";\n }\n .rpop-right .rpop-tail-outer {\n border-right-color: "+(e.bc||"#ccc")+";\n }\n "+n.map(function(e){var n=Object.assign({},t("raui.primary"),t("raui.pop.primary"),t("raui."+e),t("raui.pop."+e));return"\n ."+e+" .rpop {\n background-color: "+(n.bg||"#fff")+";\n color: "+(n.fg||"#222")+";\n }\n \n ."+e+".rpop-below .rpop-tail {\n border-bottom-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-below .rpop-tail-outer {\n border-bottom-color: "+(n.bc||"#ccc")+";\n }\n \n ."+e+".rpop-above .rpop-tail {\n border-top-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-above .rpop-tail-outer {\n border-top-color: "+(n.bc||"#ccc")+";\n }\n \n ."+e+".rpop-left .rpop-tail {\n border-left-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-left .rpop-tail-outer {\n border-left-color: "+(n.bc||"#ccc")+";\n }\n \n ."+e+".rpop-right .rpop-tail {\n border-right-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-right .rpop-tail-outer {\n border-right-color: "+(n.bc||"#ccc")+";\n }\n "})}.call(this,t)].join(" ")},cssId:"rpop",noCssTransform:!0,observe:{popped:function(t){var e=this;t&&(h&&(this.source=h),v&&(this.tailSource=v)),setTimeout(function(){e.get("popped")===t&&e.set("_popped",t)},100)},_popped:{handler:function(t){var e=this;if(t){var n=this.get("@style.raui.pop.mobile");if(n&&window.matchMedia("(max-width: "+n+")").matches){y||(y=new k({target:document.body,append:!0})).observe("contents",function(t){m=(t||[]).length>0});var r=this.getContext().getParent(!0);r.isContext=1,y.unshift("contents",{content:this.partials.content,context:r,attrs:this.partials["extra-attributes"]||[],clickClose:this.get("clickClose"),noClickout:this.get("noClickout"),done:function(){e.set("popped",!1)}})}else this.set("__popped",!0)}else m?y.shift("contents"):this.set("__popped",!1)},defer:!0},__popped:{handler:function(t){if(t){var e=this.find("div"),n=e,r=n.offsetHeight+n.offsetTop,o=n.offsetWidth+n.offsetLeft,i=n.offsetParent;if(!this.overflows)for(var a=this.overflows={e:[],v:[]};e&&e.style;){if(e===i){if(e.offsetWidth>=o&&e.offsetHeight>=r)break;o+=e.offsetLeft,r+=e.offsetTop,i=e.offsetParent}var l=getComputedStyle(e);if("auto"===l.overflow)break;"hidden"===l.overflow&&(a.e.push(e),a.v.push(e.style.overflow),e.style.overflow="visible"),e=e.parentNode}this.position(),this.transition("pop",n,{intro:!0,dir:this.get("where")||"below"})}else this.source=null,this.tailSource=null},defer:!0},"align where tail fit":{handler:function(){this.position()},defer:!0}},decorators:{cleanup:function(t){var e=this;return{teardown:function(){var t=e.overflows;if(t){e.overflows=null;for(var n=0;n<t.e.length;n++)t.e[n].style.overflow=t.v[n]}}}}},data:function(){return{gap:4}}});var k=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(e);e.extendWith(k,{template:{v:b.v,t:b.p.modal},data:function(){return{contents:[]}},use:[u(),g()]});var D=/[^\d]+/,M=/[^\d_]+/,T="_",S={y:0,M:1,d:2,H:3,m:4,s:5,S:6};function L(t,e,n){void 0===n&&(n="0");for(var r=null==t?"":""+t,o=r.length;o<e;o++)r=n+r;return r}function F(t,e,n){void 0===n&&(n="0");for(var r=null==t?"":""+t,o=r.length;o<e;o++)r+=n;return r}var Y={mask:"yyyy-MM-dd",time:"00:00:00.000",date:function(){var t=new Date;return new Date(t.getFullYear()+"-"+L(t.getMonth()+1,2)+"-"+L(t.getDate(),2)+"T"+Y.time)}};function C(t){void 0===t&&(t={});var e=t.mask||Y.mask,n=(t.time||Y.time,t.date||Y.date);if("function"!=typeof n){var r=n;n=function(){return r}}return function(r){r.instance.decorators[t.name||"date"]=function(r,o,i){void 0===o&&(o={});var a=Object.assign({},t,"string"==typeof o?{value:o}:0,"string"==typeof i?{mask:i}:0,"object"==typeof o?o:0),l=this.getContext(r),s=a.mask||e,f={observers:[],listeners:[]};if("INPUT"!==r.tagName)return console.warn("Attempted to add a date decorator a "+r.tagName),H;if(!s)return H;for(var c,u=[],p=0;c=z.exec(s);){var d={mask:c[0],type:c[0][0],length:c[0].length,start:c.index,end:c.index+c[0].length,chunk:u.length,prefix:s.substring(p,c.index),groups:u,value:null,display:F("",c[0].length,T)};p=d.end,u.push(d)}if(u.suffix=s.substring(u[u.length-1].end),u.last=null,u.slice(1).find(function(t){return!t.prefix}))return console.warn("Attempted to add a date decorator missing interstitial between fields '"+s+"'"),H;function g(t){if(null===u.value&&null===u.last||+u.value==+u.last)return 1;if(!t||!1===a.lazy){if(!1===a.null&&null===u.value)return P(u,u.last),1;u.last=u.value,"string"==typeof a.value&&(f.observers.forEach(function(t){return t.silence()}),l.set(a.value,u.value),f.observers.forEach(function(t){return t.resume()}))}}"string"==typeof a.value?f.observers.push(l.observe(a.value,function(t){t||!1!==a.null||(t=n()),u.value=t,P(u,t),u.last=t,B(u,r)},{defer:!0})):((a.date||!1===a.null)&&(u.value=J(a.date||n())),B(u,r)),f.listeners.push(l.listen("input",function(){var t=r.selectionStart,e=r.value;!function(t,e,n){var r=e.value,o=e.selectionStart,i=N(t,o),a=0,l=t[a],s=t[a+1];t.forEach(function(t){return t.input=""});for(var f=0;f<r.length;f++)s&&r[f]===s.prefix[0]&&(i!==l||l.input.length>=l.length||r.length-f<n.length-l.end+(l.length-l.input.length))?(s.prefix.length>1&&(f+=s.prefix.length-1),r[f+1]===s.prefix[0]&&(f+=s.prefix.length),l=t[++a],s=t[a+1]):l.input+=r[f]}(u,r,s);var n=N(u,t),o=R(u,n,t);if(j(u,g,!0),B(u,r),n&&(e.length>=s.length&&t===n.end||o)&&n!==u[u.length-1]){var i=u[u.indexOf(n)+1];r.setSelectionRange(i.start,i.end)}else r.setSelectionRange(t,t)})),f.listeners.push(l.listen("blur",function(){g(!1)&&P(u,u.value),B(u,r)}));var h=function(){var t=N(u,r.selectionStart);document.activeElement===r&&r.setSelectionRange(t.start,t.end)};return f.listeners.push(l.listen("click",h)),f.listeners.push(l.listen("focus",h)),f.listeners.push(l.listen("keydown",function(t){switch(t.key){case"Enter":case"Tab":var e=N(u,r.selectionStart);R(u,e,r.selectionStart,!0)&&B(u,r);var n=u.indexOf(e);t.shiftKey&&n>0?(r.setSelectionRange(u[n-1].start,u[n-1].end),t.preventDefault(),t.stopPropagation()):!t.shiftKey&&n+1<u.length&&(r.setSelectionRange(u[n+1].start,u[n+1].end),t.preventDefault(),t.stopPropagation());break;case"ArrowUp":case"ArrowDown":var o=[r.selectionStart,r.selectionEnd],i=o[0],a=o[1],l=N(u,i);null===l.value&&(l.value=1),function(t,e){switch(t.type){case"y":t.value=t.value+(e?-1:1);break;case"M":t.value=e?t.value<1?11:t.value-1:t.value>10?0:t.value+1;break;case"d":var n=t.groups,r=I(new Date((n.find(function(t){return"y"===t.type})||{value:1}).value,(n.find(function(t){return"M"===t.type})||{value:1}).value));t.value=e?t.value<2?r:t.value-1:t.value+1>r?1:t.value+1;break;case"H":t.value=e?t.value<1?23:t.value-1:t.value>22?0:t.value+1;break;case"h":t.value=e?t.value<1?12:t.value-1:t.value>11?1:t.value+1;break;case"m":case"s":t.value=e?t.value<1?59:t.value-1:t.value>58?0:t.value+1;break;case"S":t.value=e?t.value<1?999:t.value-1:t.value>998?0:t.value+1}}(l,"ArrowDown"===t.key),l.input=l.display=E(l),j(u,g,!0),B(u,r),t.preventDefault(),t.stopPropagation(),r.setSelectionRange(i,a)}})),{teardown:function(){f.observers.forEach(function(t){return t.cancel()}),f.listeners.forEach(function(t){return t.cancel()})}}}}}function R(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=!1);for(var o=!1,i=0;i<t.length;i++){var a=t[i],l=a.input.replace(D,""),s=t[i+1]&&t[i+1].prefix&&M.test(a.input);if(l.length>a.length&&a===e){var f=l.length-e.length;l=l.substr(0,n-e.start)+l.substr(n-e.start+f)}else l=l.substr(0,a.length);if(a.input=l,""===l)a.value=null,a.display=E(a);else if(a!==e)a.value=+l,"M"===a.type&&a.value--,a.display=E(a);else if("M"===a.type&&+l>1||"d"===a.type&&+l>3||"H"===a.type&&+l>2||("m"===a.type||"s"===a.type)&&+l>6)a.value=+l,"M"===a.type&&a.value--,a.display=L(l,a.length),o=!0;else if("y"===a.type&&2===l.length&&(s||r)){var c=(new Date).getFullYear(),u=100*Math.floor(c/100),p=Math.abs(c-(u+ +l))<20?u+ +l:u-100+ +l;a.value=p,a.input=a.display=L(p,a.length),o=!0}else a.display=F(l,a.length,T),a.value=+l}return o}function P(t,e){var n=(e=t.value=e&&J(e))?[e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()]:[null,null,null,null,null,null,null];t.forEach(function(t){t.value=n[S[t.type]],t.input=t.display=E(t)})}function j(t,e,n){var r=t.value||W,o=[r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()];if(t.forEach(function(t){var e=t.value;null!==e&&"M"===t.type?e<0?e=0:e>11&&(e=11):null===e||"m"!==t.type&&"s"!==t.type?null!==e&&"H"===t.type?e<0?e=0:e>23&&(e=23):null!==e&&"h"===t.type&&(e<1?e=1:e>12&&(e=12)):e<0?e=0:e>59&&(e=59),e!==t.value&&(t.value=e,t.display=E(t)),o[S[t.type]]=t.value}),null!==o[0]&&null!==o[1]&&null!==o[2]){var i=t.find(function(t){return"d"===t.type});if(i)if(o[2]<1)i.value=o[2]=1,i.display=E(i);else{var a=I(new Date(o[0],o[1],1));o[2]>a&&(i.value=o[2]=a,i.display=E(i))}}t.find(function(t){return null===t.value})||0===o[0]||o[1]>11||o[1]<0||0===o[2]?t.value=null:(o.unshift(null),t.value=new(Date.bind.apply(Date,o))),e(n)}function B(t,e){e.value=t.reduce(function(t,e){return t+e.prefix+e.display},"")+t.suffix}function N(t,e){return t.find(function(t){return e>=t.start&&e<=t.end})}function E(t){if(null===t.value)return L("",t.length,T);switch(t.type){case"y":return t.value?t.length<=2?(""+t.value).substr(2,2):""+L(t.value,t.length):L("",t.length,T);case"M":return~t.value?1===t.length?""+(t.value+1):2===t.length?(t.value<9?"0":"")+(t.value+1):3===t.length?O[t.value].substr(0,3):O[t.value]:L("",t.length,T);case"d":return t.value?1===t.length?""+t.value:2===t.length?(t.value<=9?"0":"")+t.value:3===t.length?A[t.groups.value.getDay()].substr(0,3):A[t.groups.value.getDay()]:L("",t.length,T);case"H":case"h":case"m":case"s":return 1===t.length?""+t.value:L(t.value,t.length);case"S":return 1===t.length?""+t.value:L(t.value,3)}}var z=/y+|M+|d+|E+|H+|m+|s+|S+|k+|a+/g,O=["January","February","March","April","May","June","July","August","September","October","November","December"],A=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],H={teardown:function(){}};function I(t){return new Date(new Date(t.getFullYear(),t.getMonth()+1,1)-864e5).getDate()}var W=new Date("0000-01-01T00:00:00");function J(t){var e=t;if("function"==typeof e&&(e=t()),"string"==typeof e)try{e=new Date(e)}catch(t){return defaultDate()}return e instanceof Date?e:W}function U(t){t.attributes.value?t.link(t.attributes.value,"rdi.val"):t.unlink("rdi.val");var e={value:"rdi.val"};["null","lazy","mask"].forEach(function(n){n in t.attributes&&(e[n]=t.attributes[n])}),t.set("rdi.opts",e)}var q=Ractive.macro(function(t){return t.aliasLocal("rdi"),U(t),t.setTemplate({v:4,t:[{t:7,e:"span",m:[{t:13,n:"class",f:"rdi-date field-wrapper",g:1}],f:[{t:7,e:"input",m:[{n:"rdi-reg",t:71,f:{r:[],s:'["node"]'}},{n:"rdi-date",t:71,f:{r:["rdi.opts"],s:"[_0]"}},{n:"class-rdi-date",t:13},{t:8,r:"extra-attributes"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rdi-x",g:1},{n:["click"],t:70,f:{r:["@context"],s:'[(_0).set("rdi.val",null)]'}},{n:"title",f:"Clear",t:13,g:1}],f:["×"]}],n:50,x:{r:["rdi.opts.null","rdi.val"],s:"_0&&_1!==null"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rdi-pop",g:1},{n:"rdi-pop",t:71,f:{r:["rdi.node","rdi.tail"],s:'[{path:"rdi.popped",node:_0,tail:_1}]'}},{n:["click"],t:70,f:{r:[],s:"[false,false]"}},{n:"title",f:"Select from calendar",t:13,g:1}],f:[{t:7,e:"svg",m:[{n:"rdi-reg",t:71,f:{r:[],s:'["tail"]'}},{n:"x",f:"0px",t:13,g:1},{n:"y",f:"0px",t:13,g:1},{n:"viewBox",f:"0 0 48 48",t:13,g:1},{n:"xml:space",f:"preserve",t:13}],f:[{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.5;fill:none;stroke-width:1;",g:1},{n:"y",f:"1",t:13,g:1},{n:"x",f:"1",t:13,g:1},{n:"height",f:"46",t:13,g:1},{n:"width",f:"46",t:13,g:1}]}," ",{t:7,e:"rect",m:[{n:"y",f:"1",t:13,g:1},{n:"x",f:"1",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"46",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"3",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.8;stroke:none;",g:1},{t:13,n:"class",f:"rdi-today",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"14",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"25",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.4;stroke:none;",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"37",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"3",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"14",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"25",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.4;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"37",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"3",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"14",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"25",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.4;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"37",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}]}]}]}," ",{t:7,e:"rdi-pop",m:[{n:"popped",t:13,f:[{t:2,r:"rdi.popped"}]},{n:"tail",f:0,t:13},{n:"align",f:"end",t:13,g:1}],f:[{t:7,e:"rdi-picker",m:[{n:["init"],t:70,f:{r:["@context","rdi.val"],s:'[(_0).component.set("target",_1)]'}},{n:"current",t:13,f:[{t:2,r:"rdi.val"}]}]}]}],e:{'["node"]':function(){return["node"]},"[_0]":function(t){return[t]},'[(_0).set("rdi.val",null)]':function(t){return[t.set("rdi.val",null)]},"_0&&_1!==null":function(t,e){return t&&null!==e},'[{path:"rdi.popped",node:_0,tail:_1}]':function(t,e){return[{path:"rdi.popped",node:t,tail:e}]},"[false,false]":function(){return[!1,!1]},'["tail"]':function(){return["tail"]},'[(_0).component.set("target",_1)]':function(t,e){return[t.component.set("target",e)]}}}),{update:function(){U(t)}}},{css:function(t){return[function(t){return".rdi-date {\n position: relative;\n display: inline-block;\n }\n \n .rdi-x {\n position: absolute;\n right: 2em;\n top: 0.025em;\n cursor: pointer;\n }\n \n .rdi-pop {\n position: absolute;\n display: flex;\n justify-content: space-around;\n align-items: flex-end;\n flex-direction: column;\n right: 0.5em;\n height: 100%;\n top: 0;\n cursor: pointer;\n }\n \n .rdi-pop > svg {\n height: 48px;\n max-height: 60%;\n fill: "+(t("raui.dateInput.primary.fg")||t("raui.primary.fg")||"#222")+";\n }\n \n .rdi-today {\n fill: "+(t("raui.dateInput.primary.fga")||t("raui.primary.fga")||"#07e")+";\n }"}.call(this,t)].join(" ")},cssId:"rdi",noCssTransform:!0,attributes:["value","null","lazy","mask"]});t.DateInput=q,t.default=function(t){return void 0===t&&(t={}),function(e){var n,r=e.instance;r.components["rdi-picker"]=l,r.components["rdi-pop"]=_,(void 0===(n={name:"rdi-pop"})&&(n={}),function(t){t.instance.decorators[n.name||"pop"]=function(t,e,r){if(void 0===r&&(r={}),!e)return{teardown:w};"string"==typeof e?r.path=e:"object"==typeof e&&(r=e);var o,i,a=this.getContext(t);function l(n){if("mouseover"!==n.type||!a.get(e)){if("click"!==n.type||!i||o){var l=h,s=v;"function"==typeof(h=r.node||t)&&(h=h()),h=h||t,"function"==typeof(v=r.tail)&&(v=v()),a.toggle(r.path),h=l,v=s}i&&"click"===n.type&&(o=a.observeOnce(r.path,function(){o=null}))}}function s(t){o||a.set(r.path,!1)}return("click"in r?r.click:!1!==n.click)&&a.listen("click",l),("hover"in r?r.hover:n.hover)&&(i=1,a.listen("mouseover",l),a.listen("mouseout",s)),{teardown:function(){a.unlisten("click",l),i&&(a.unlisten("mouseover",l),a.unlisten("mouseout",s),o&&o.cancel())}}}})({instance:r}),C({name:"rdi-date"})({instance:r}),r.partials[t.name||"date-input"]=q,r.decorators["rdi-reg"]=function(t,e){return this.getContext(t).set("rdi."+e,function(){return t}),{teardown:function(){}}}}},Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],e):e(t.RMDateInput={},t.Ractive)}(this,function(t,e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var n=function(){try{var t=navigator.language||navigator.browserLanguage||navigator.languages[0]||"en";return[[0,1,2,3,4,5,6,7,8,9,10,11].map(function(e){return new Date(2006,e,1).toLocaleString(t,{month:"long"})}),[1,2,3,4,5,6,7].map(function(e){return new Date(2006,0,e).toLocaleString(t,{weekday:"long"})})]}catch(t){return[["January","February","March","April","May","June","July","August","September","October","November","December"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]]}}(),r=n[0],o=n[1],i=o.map(function(t){return t[0]}).concat(o.map(function(t){return t[0].toUpperCase()})),a=r.map(function(t){return t.substr(0,3)}),l=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.month=function(t,e){void 0===e&&(e=0);var n,r=t||new Date;if(!(r instanceof Date))return{};isNaN(r)&&(r=new Date),e&&(r=new Date(r.getFullYear(),r.getMonth()+e,r.getDate()));try{n=+this.get("firstDay")}catch(t){}("number"!=typeof n||isNaN(n))&&(n=0),n>6&&(n=0);for(var o=new Date(r.getFullYear(),r.getMonth(),0),a=new Date(r.getFullYear(),r.getMonth()+1,0).getDate(),l=new Date(r.getFullYear(),r.getMonth()+1,1),s=new Date(r.getFullYear(),r.getMonth(),1).getDay(),f=[],c=f[0]=[],u=0;u<7;u++)f[0].unshift({y:o.getFullYear(),m:o.getMonth(),d:o.getDate()-u}),f[0].push({y:r.getFullYear(),m:r.getMonth(),d:u+1});f[0]=n<=s?f[0].slice(7-(s-n),14-(s-n)):f[0].slice(n-s,7+n-s),1===f[0][0].d&&f.unshift(c.slice(0,7));for(var p=f[f.length-1][f[f.length-1].length-1].d,d=f.length;d<5;d++){f[d]=[];for(var g=0;g<7&&p+1<=a;g++)f[d].push({y:r.getFullYear(),m:r.getMonth(),d:++p});if(f[d].length<7){for(var h=7-f[d].length,v=1;v<=h;v++)f[d].push({y:l.getFullYear(),m:l.getMonth(),d:v});f[d+1]=[];for(var m=0,y=h+1;m<7;m++,y++)f[d+1].push({y:l.getFullYear(),m:l.getMonth(),d:y})}}if(!f[5]){for(f[5]=[];p<a;)f[5].push({y:r.getFullYear(),m:r.getMonth(),d:++p});for(var b=1;b<8;b++)f[5].push({y:l.getFullYear(),m:l.getMonth(),d:b});f[5]=f[5].slice(0,7)}return{days:i.slice(n,n+7),weeks:f,year:r.getFullYear(),month:r.getMonth(),currentYear:(new Date).getFullYear()}},e.prototype.year=function(t,e){void 0===e&&(e=0);var n=t||new Date;if(!(n instanceof Date))return{};e&&(n=new Date(n.getFullYear()+e,n.getMonth(),n.getDate()));for(var r=[],o=0;o<4;o++){r.push([]);for(var i=0;i<3;i++)r[o].push({m:3*o+i,y:n.getFullYear()})}return{year:n.getFullYear(),months:r}},e.prototype.decade=function(t,e){void 0===e&&(e=0);var n=t||new Date;if(!(n instanceof Date))return{};e&&(n=new Date(n.getFullYear()+10*e,n.getMonth(),n.getDate()));for(var r=10*Math.floor(n.getFullYear()/10),o=r-1,i=[],a=0;a<4;a++){i.push([]);for(var l=0;l<3;l++)i[a].push({y:o+3*a+l})}return{start:r,end:r+9,years:i}},e.prototype.monthName=function(t){return r[t]},e.prototype.shortMonthName=function(t){return a[t]},e.prototype.dayName=function(t){return o[t]},e.prototype.select=function(t){if(t&&t instanceof Date)this.set("current",t);else{var e=this.get("safeCurrent");t&&this.set("current",new Date(t.y||e.getFullYear(),"number"==typeof t.m?t.m:e.getMonth(),t.d||e.getDate()));var n=this.get("mode");"year"===n?this.set("mode","months"):"months"===n&&this.set("mode","month"),this.set("target",this.get("current"))}},e.prototype.isCurrent=function(t){var e=this.get("safeCurrent");return!!e&&(t&&t.y===e.getFullYear()&&(null==t.m||t.m===e.getMonth())&&(null==t.d||t.d===e.getDate()))},e.prototype.next=function(){var t=this.get("safeTarget"),e=this.get("mode");"month"===e&&this.set("target",new Date(t.getFullYear(),t.getMonth()+1,1)),"months"===e&&this.set("target",new Date(t.getFullYear()+1,t.getMonth(),1)),"year"===e&&this.set("target",new Date(t.getFullYear()+10,t.getMonth(),1))},e.prototype.prev=function(){var t=this.get("safeTarget"),e=this.get("mode");"month"===e&&this.set("target",new Date(t.getFullYear(),t.getMonth()-1,1)),"months"===e&&this.set("target",new Date(t.getFullYear()-1,t.getMonth(),1)),"year"===e&&this.set("target",new Date(t.getFullYear()-10,t.getMonth(),1))},e.prototype.today=function(){this.set("current",new Date),this.set("target",this.get("current"))},e}(e);e.extendWith(l,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal",g:1}],f:[{t:4,f:[{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"left",x:{x:{r:["@index"],s:"_0===0"}}},{n:"right",x:{x:{r:["@last","@index"],s:"_0===_1"}}}]}],n:52,z:[{n:"offset",x:{r:"."}}],r:"~/padding"}],n:50,r:"~/padding"},{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"offset",x:{x:{r:[],s:"0"}}},{n:"left",x:{x:{r:[],s:"true"}}},{n:"right",x:{x:{r:[],s:"true"}}}]}],n:51,l:1}]}],e:{0:function(){return 0},"_0===0":function(t){return 0===t},"_0===_1":function(t,e){return t===e},true:function(){return!0},"[_0.prev(),false]":function(t){return[t.prev(),!1]},'[_0.set("mode","month"),false]':function(t){return[t.set("mode","month"),!1]},"[_0.next(),false]":function(t){return[t.next(),!1]},"_1>_0||_1<_2":function(t,e,n){return e>t||e<n},"_0.isCurrent(_1)":function(t,e){return t.isCurrent(e)},"[_0.select(_1),false]":function(t,e){return[t.select(e),!1]},"_0.decade(_1,_2)":function(t,e,n){return t.decade(e,n)},'[_0.set("mode","year"),false]':function(t){return[t.set("mode","year"),!1]},"_0.shortMonthName(_1)":function(t,e){return t.shortMonthName(e)},"_0.year(_1,_2)":function(t,e,n){return t.year(e,n)},'[_0.set("mode","months"),false]':function(t){return[t.set("mode","months"),!1]},"_0.monthName(_1)":function(t,e){return t.monthName(e)},"_0!==_1":function(t,e){return t!==e},"[_0.select(_1)]":function(t,e){return[t.select(e)]},"_0.month(_1,_2)":function(t,e,n){return t.month(e,n)}},p:{year:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","month"),false]'}}],f:[{t:2,r:".start"}," - ",{t:2,r:".end"}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-decade",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:["year.end",".y","year.start"],s:"_1>_0||_1<_2"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1),false]"}}],f:[{t:2,r:".y"}]}],n:52,r:"."}]}],n:52,r:".years"}]}],n:54,z:[{n:"year",x:{r:"."}}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.decade(_1,_2)"}}],months:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","year"),false]'}}],f:[{t:2,r:".year"}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-year",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1),false]"}}],f:[{t:2,x:{r:["@this",".m"],s:"_0.shortMonthName(_1)"}}]}],n:52,r:"."}]}],n:52,r:".months"}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.year(_1,_2)"}}],month:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1},{n:"class-rcal-pad",t:13,f:[{t:2,r:"~/pad"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","months"),false]'}}],f:[{t:2,x:{r:["@this",".month"],s:"_0.monthName(_1)"}},{t:4,f:[", ",{t:2,r:".year"}],n:50,x:{r:[".currentYear",".year"],s:"_0!==_1"}}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-month",g:1}],f:[{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week rcal-week-header",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day rcal-day-header",g:1}],f:[{t:2,r:"."}]}],n:52,r:".days"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:[".m","month.month"],s:"_0!==_1"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1)]"}}],f:[{t:2,r:".d"}]}],n:52,r:"."}]}],n:52,r:".weeks"}],n:54,z:[{n:"month",x:{r:"."}}]}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.month(_1,_2)"}}]}},css:function(t){return[function(t){return".rcal-wrapper {\n display: inline-block;\n }\n \n .rcal-pad {\n padding: 0.5em;\n }\n \n .rcal-block-outer {\n border: 1px solid "+(t("raui.datePicker.primary.bga")||t("raui.primary.bga")||"#f4f4f4")+";\n }\n \n .rcal-block-header {\n text-align: center;\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n cursor: default;\n display: flex;\n justify-content: space-between;\n padding: 0 0.5em;\n line-height: 1em;\n height: 1.5em;\n align-items: center;\n }\n \n .rcal-click {\n cursor: pointer;\n }\n \n .rcal-left, .rcal-right {\n height: 0.8em;\n display: inline-block;\n box-sizing: border-box;\n border: 0.4em solid transparent;\n cursor: pointer;\n }\n .rcal-left {\n border-right-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n }\n .rcal-right {\n border-left-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n }\n \n .rcal-month, .rcal-year, .rcal-decade {\n display: flex;\n flex-direction: column;\n background-color: "+(t("raui.datePicker.primary.bga")||t("raui.primary.bga")||"#f4f4f4")+";\n width: calc(10.5em + 6px);\n height: calc(10.5em + 6px);\n justify-content: space-between;\n }\n .rcal-year, .rcal-decade {\n justify-content: space-around;\n }\n \n .rcal-week {\n height: 1.5em;\n display: flex;\n justify-content: space-between;\n width: calc(10.5em + 6px);\n }\n \n .rcal-inner-row {\n height: 2em;\n display: flex;\n justify-content: space-around;\n width: calc(10.5em + 6px);\n }\n \n .rcal-inner-pick {\n background-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n width: 3em;\n height: 2em;\n line-height: 2em;\n text-align: center;\n cursor: pointer;\n }\n \n .rcal-week-header {\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n }\n \n .rcal-day {\n background-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n width: 1.5em;\n height: 1.5em;\n text-align: center;\n line-height: 1.5em;\n cursor: pointer;\n }\n \n .rcal-day-header {\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n cursor: default;\n }\n \n .rcal-off-day {\n background-color: "+(t("raui.datePicker.primary.bc")||t("raui.primary.bc")||"#ccc")+";\n }\n \n .rcal-current {\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n background-color: "+(t("raui.datePicker.primary.fg")||t("raui.primary.fg")||"#222")+";\n }\n "}.call(this,t)].join(" ")},noCssTransform:!0,data:function(){return{mode:"month",target:new Date}},computed:{safeCurrent:function(){var t=this.get("current");if("string"==typeof t)try{t=new Date(t)}catch(t){}return t instanceof Date||(t=new Date),t},safeTarget:function(){var t=this.get("target");if(t||(t=this.get("current")),"string"==typeof t)try{t=new Date(t)}catch(t){}return t instanceof Date?t:new Date}}});var s="undefined"!=typeof window?window:null;function f(t,e,n){if(s&&s.Ractive&&"object"==typeof s.Ractive[e]){var r=document.currentScript;if(r||(r=(r=document.querySelectorAll("script"))[r.length-1]),r){var o=r.getAttribute("data-alias");o&&(o=(o=o.split("&")).reduce(function(t,e){var n=e.split("="),r=n[0],o=n[1];return t[r]=o,t},{})),Ractive[e][o&&o[t]||t]=n}}}function c(t,e){void 0===e&&(e={});var n=t.processParams(e,{duration:400,easing:"easeInOut"});e.dir=e.dir||!1;var r=e.distance||"20px",o=e.scale||"0.9",i="above"===e.dir?"translateY("+r+")":"left"===e.dir?"translateX("+r+")":"right"===e.dir?"translateX(-"+r+")":"translateY(-"+r+")";return t.isIntro||n.intro?(t.setStyle("opacity",0),t.setStyle("transform","scale("+o+") "+i),t.animateStyle({opacity:1,transform:"none"},n)):(t.setStyle("opacity",1),t.setStyle("transform","none"),t.animateStyle({opacity:0,transform:"scale("+o+") "+i},n))}function u(t){return void 0===t&&(t={}),function(e){e.instance.transitions[t.name||"pop"]=c}}function p(t,e){var n=!1,r=!1;function o(n){for(var r=n.target;r;){if(r===t)return;if(!r.parentNode&&r!==document)return;r=r.parentNode}e(n)}return setTimeout(function(){n=!0,r||(document.body.addEventListener("click",o),document.body.addEventListener("touchstop",o))}),{teardown:function(){r=!0,n&&(document.body.removeEventListener("click",o),document.body.removeEventListener("touchstop",o))}}}function d(t,e){var n=t.processParams(e,{duration:200,easing:"easeInOut"});return t.isIntro||n.intro?(t.setStyle("opacity",0),t.animateStyle("opacity",1,n)):(t.setStyle("opacity",1),t.animateStyle("opacity",0,n))}function g(t){return void 0===t&&(t={}),function(e){e.instance.transitions[t.name||"fade"]=d}}f("pop","transitions",c),f("fade","transitions",d);var h,v,m,y,b={v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-wrapper",g:1},{n:"class-rpop-with-tail",t:13,f:[{t:2,r:"position.tail"}]},{n:"class",f:["rpop-",{t:2,x:{r:["where"],s:'_0||"below"'}}," rpop-align-",{t:2,x:{r:["align"],s:'_0||"middle"'}}],t:13},{t:4,f:[{n:"style-top",f:[{t:2,r:"position.popTop"},"px"],t:13},{n:"style-left",f:[{t:2,r:"position.popLeft"},"px"],t:13}],n:50,r:"position"},{t:4,f:[{t:4,f:[{n:"style-top",f:[{t:2,r:"top"}],t:13}],n:50,r:"top"},{t:4,f:[{n:"style-left",f:[{t:2,r:"left"}],t:13}],n:50,r:"left"}],n:51,l:1},{n:"pop",t:72,f:{r:["where"],s:'[{dir:_0||"below"}]'},v:"t2"},{n:"cleanup",t:71},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:50,r:"clickClose"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:51,r:"noClickout"},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailRight"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail-outer",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailRight"}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content"}]}]}],n:50,r:"__popped"}],e:{'_0||"below"':function(t){return t||"below"},'_0||"middle"':function(t){return t||"middle"},'[{dir:_0||"below"}]':function(t){return[{dir:t||"below"}]},'[_0.set("popped",false)]':function(t){return[t.set("popped",!1)]},"_0+(_1?1:0)":function(t,e){return t+(e?1:0)},"_0+(_1?0:1)":function(t,e){return t+(e?0:1)},"_0-2":function(t){return t-2},"[{delay:200}]":function(){return[{delay:200}]},"[_0===_1&&_2.done(),true]":function(t,e,n){return[t===e&&n.done(),!0]},"[_0.done()]":function(t){return[t.done()]},true:function(){return!0}},p:{modal:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-modal",g:1},{n:"fade",t:72,v:"t1"},{n:"fade",t:72,f:{r:[],s:"[{delay:200}]"},v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["@node","@event.target","."],s:"[_0===_1&&_2.done(),true]"}}],n:51,r:".noClickout"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1},{n:"pop",t:72,f:{r:[],s:"[{delay:200}]"},v:"t1"},{n:"pop",t:72,v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.done()]"}}],n:50,r:".clickClose"},{t:8,r:".attrs",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}],f:[{t:8,r:".content",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}]}]}],n:54,r:"contents.0"}],n:50,r:"contents.length"}]}};function w(){}var x,_=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.position=function(t){var e=t||this.source,n=this.get("popped");if(e&&n){var r=this.find("div");if(e&&r&&r.offsetParent){var o=r.offsetParent,i=o.getBoundingClientRect(),a=r.getBoundingClientRect(),l=e.getBoundingClientRect(),s=this.get("where")||"below",f=this.get("align")||"middle",c=this.get("tail"),u="above"===s||"below"===s,p=this.get("fit"),d=this.get("gap"),g="above"===s||"below"===s?0:"left"===s?-a.width-d:l.width+d,h="left"===s||"right"===s?-l.height:"above"===s?-l.height-a.height-d:d;"middle"===f?"below"===s||"above"===s?g-=(a.width-l.width)/2:"left"!==s&&"right"!==s||(h-=(a.height-l.height)/2):"end"===f&&("below"===s||"above"===s?g+=l.width-a.width:"left"!==s&&"right"!==s||(h+=l.height-a.height));var v={popTop:l.bottom-i.top+h,popLeft:l.left-i.left+g,tail:c,vert:"above"===s||"below"===s};if(o.scrollTop&&(v.popTop+=o.scrollTop),o.scrollLeft&&(v.popLeft+=o.scrollLeft),c){"above"===s?v.tailBottom=-10:"below"===s?v.tailTop=-10:"left"===s?v.tailRight=-10:"right"===s&&(v.tailLeft=-10);var m=this.tailSource?this.tailSource.getBoundingClientRect():l;"start"===f?u?v.tailLeft=Math.floor(m.width/2)-10:v.tailTop=Math.floor(m.height/2)-10:"end"===f?u?v.tailRight=Math.floor(m.width/2)-10:v.tailBottom=Math.floor(m.height/2)-10:"middle"===f&&(u?v.tailLeft=Math.floor(m.width/2)-10:v.tailTop=Math.floor(m.height/2)-10),m!==l?u?(v.tailLeft&&(v.tailLeft+=m.left-l.left),v.tailRight&&(v.tailRight+=l.right-m.right)):(v.tailTop&&(v.tailTop+=m.top-l.top),v.tailBottom&&(v.tailBottom+=l.bottom-m.bottom)):"middle"===f&&(u?(v.tailLeft&&(v.tailLeft+=m.left-(v.popLeft+i.left)),v.tailRight&&(v.tailRight+=v.popLeft+i.left+a.width-m.right)):(v.tailTop&&(v.tailTop+=m.top-(v.popTop+i.top)),v.tailBottom&&(v.tailBottom+=v.popTop+i.top+a.height-m.bottom)))}if(p){var y=o;if(this.get("offsets"))for(var b=this.get("offsets");b--;)y=y.offsetParent;var w=o.scrollWidth,x=o.scrollHeight;if(v.popLeft+a.width>w){var _=v.popLeft-(w-a.width);v.popLeft-=_,u&&v.tailLeft&&(v.tailLeft+=_),u&&v.tailRight&&(v.tailRight-=_),c&&!u&&(v.tail=!1)}if(v.popLeft<0){var k=-1*v.popLeft;v.popLeft+=k,u&&v.tailLeft&&(v.tailLeft-=k),u&&v.tailRight&&(v.tailRight+=k),c&&!u&&(v.tail=!1)}if(v.popTop+a.height>x){var D=v.popTop-(x-a.height);v.popTop-=D,!u&&v.tailTop&&(v.tailTop+=D),!u&&v.tailBottom&&(v.tailBottom-=D),c&&u&&(v.tail=!1)}if(v.popTop<0){var M=-1*v.popTop;v.popTop+=M,!u&&v.tailTop&&(v.tailTop-=M),!u&&v.tailBottom&&(v.tailBottom+=M),c&&u&&(v.tail=!1)}}this.set("position",v)}else this.set("position",null)}},e.prototype.show=function(t){this.source=t,this.set("popped",!0)},e.prototype.hide=function(){this.set("popped",!1)},e}(e);e.extendWith(_,{attributes:["popped","tail","where","align","top","left","fit","clickClose","noClickout","gap","offsets"],use:[u(),(void 0===x&&(x={}),function(t){t.instance.events[x.name||"clickout"]=p}),g()],template:b,css:function(t){return[function(t){var e=Object.assign({},t("raui.primary"),t("raui.pop.primary")),n=(t("raui.themes")||[]).slice();return(t("raui.pop.themes")||[]).forEach(function(t){~n.indexOf(t)||n.push(t)}),"\n .rpop-wrapper {\n position: absolute;\n display: inline-block;\n z-index: 11;\n transition-property: top, left, padding;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-with-tail.rpop-above {\n padding-bottom: 10px;\n }\n .rpop-with-tail.rpop-below {\n padding-top: 10px;\n }\n .rpop-with-tail.rpop-left {\n padding-right: 10px;\n }\n .rpop-with-tail.rpop-right {\n padding-left: 10px;\n }\n \n .rpop {\n position: relative;\n box-shadow: 0 1px 4px 0 rgba(0,0,0,0.24);\n border: 1px solid #ccc;\n border-radius: 0.2em;\n background-color: "+(e.bg||"#fff")+";\n color: "+(e.fg||"#222")+";\n padding: 0.5em;\n z-index: 2;\n }\n \n .rpop-modal {\n position: fixed;\n display: flex;\n z-index: 10;\n background-color: rgba(0, 0, 0, 0.2);\n align-items: center;\n justify-content: center;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 1em;\n overflow: auto;\n }\n \n .rpop-tail, .rpop-tail-outer {\n z-index: 3;\n width: 0;\n height: 0;\n position: absolute;\n border-style: solid;\n border-width: 10px;\n border-color: transparent;\n transition-property: top, left, bottom, right, border-color;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-tail-outer {\n z-index: 1;\n border-width: 12px;\n border-color: transparent;\n }\n \n .rpop-below .rpop-tail {\n border-bottom-color: "+(e.bg||"#fff")+";\n }\n .rpop-below .rpop-tail-outer {\n border-bottom-color: "+(e.bc||"#ccc")+";\n }\n \n .rpop-above .rpop-tail {\n border-top-color: "+(e.bg||"#fff")+";\n }\n .rpop-above .rpop-tail-outer {\n border-top-color: "+(e.bc||"#ccc")+";\n }\n \n .rpop-left .rpop-tail {\n border-left-color: "+(e.bg||"#fff")+";\n }\n .rpop-left .rpop-tail-outer {\n border-left-color: "+(e.bc||"#ccc")+";\n }\n \n .rpop-right .rpop-tail {\n border-right-color: "+(e.bg||"#fff")+";\n }\n .rpop-right .rpop-tail-outer {\n border-right-color: "+(e.bc||"#ccc")+";\n }\n "+n.map(function(e){var n=Object.assign({},t("raui.primary"),t("raui.pop.primary"),t("raui."+e),t("raui.pop."+e));return"\n ."+e+" .rpop {\n background-color: "+(n.bg||"#fff")+";\n color: "+(n.fg||"#222")+";\n }\n \n ."+e+".rpop-below .rpop-tail {\n border-bottom-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-below .rpop-tail-outer {\n border-bottom-color: "+(n.bc||"#ccc")+";\n }\n \n ."+e+".rpop-above .rpop-tail {\n border-top-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-above .rpop-tail-outer {\n border-top-color: "+(n.bc||"#ccc")+";\n }\n \n ."+e+".rpop-left .rpop-tail {\n border-left-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-left .rpop-tail-outer {\n border-left-color: "+(n.bc||"#ccc")+";\n }\n \n ."+e+".rpop-right .rpop-tail {\n border-right-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-right .rpop-tail-outer {\n border-right-color: "+(n.bc||"#ccc")+";\n }\n "})}.call(this,t)].join(" ")},cssId:"rpop",noCssTransform:!0,observe:{popped:function(t){var e=this;t&&(h&&(this.source=h),v&&(this.tailSource=v)),setTimeout(function(){e.get("popped")===t&&e.set("_popped",t)},100)},_popped:{handler:function(t){var e=this;if(t){var n=this.get("@style.raui.pop.mobile");if(n&&window.matchMedia("(max-width: "+n+")").matches){y||(y=new k({target:document.body,append:!0})).observe("contents",function(t){m=(t||[]).length>0});var r=this.getContext().getParent(!0);r.isContext=1,y.unshift("contents",{content:this.partials.content,context:r,attrs:this.partials["extra-attributes"]||[],clickClose:this.get("clickClose"),noClickout:this.get("noClickout"),done:function(){e.set("popped",!1)}})}else this.set("__popped",!0)}else m?y.shift("contents"):this.set("__popped",!1)},defer:!0},__popped:{handler:function(t){if(t){var e=this.find("div"),n=e,r=n.offsetHeight+n.offsetTop,o=n.offsetWidth+n.offsetLeft,i=n.offsetParent;if(!this.overflows)for(var a=this.overflows={e:[],v:[]};e&&e.style;){if(e===i){if(e.offsetWidth>=o&&e.offsetHeight>=r)break;o+=e.offsetLeft,r+=e.offsetTop,i=e.offsetParent}var l=getComputedStyle(e);if("auto"===l.overflow)break;"hidden"===l.overflow&&(a.e.push(e),a.v.push(e.style.overflow),e.style.overflow="visible"),e=e.parentNode}this.position(),this.transition("pop",n,{intro:!0,dir:this.get("where")||"below"})}else this.source=null,this.tailSource=null},defer:!0},"align where tail fit":{handler:function(){this.position()},defer:!0}},decorators:{cleanup:function(t){var e=this;return{teardown:function(){var t=e.overflows;if(t){e.overflows=null;for(var n=0;n<t.e.length;n++)t.e[n].style.overflow=t.v[n]}}}}},data:function(){return{gap:4}}});var k=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(e);e.extendWith(k,{template:{v:b.v,t:b.p.modal},data:function(){return{contents:[]}},use:[u(),g()]});var D=/[^\d]+/,M=/[^\d_]+/,T="_",S={y:0,M:1,d:2,H:3,m:4,s:5,S:6};function L(t,e,n){void 0===n&&(n="0");for(var r=null==t?"":""+t,o=r.length;o<e;o++)r=n+r;return r}function F(t,e,n){void 0===n&&(n="0");for(var r=null==t?"":""+t,o=r.length;o<e;o++)r+=n;return r}var Y={mask:"yyyy-MM-dd",time:"00:00:00.000",date:function(){var t=new Date;return new Date(t.getFullYear()+"-"+L(t.getMonth()+1,2)+"-"+L(t.getDate(),2)+"T"+Y.time)}};function C(t){void 0===t&&(t={});var e=t.mask||Y.mask,n=(t.time||Y.time,t.date||Y.date);if("function"!=typeof n){var r=n;n=function(){return r}}return function(r){r.instance.decorators[t.name||"date"]=function(r,o,i){void 0===o&&(o={});var a=Object.assign({},t,"string"==typeof o?{value:o}:0,"string"==typeof i?{mask:i}:0,"object"==typeof o?o:0),l=this.getContext(r),s=a.mask||e,f={observers:[],listeners:[]};if("INPUT"!==r.tagName)return console.warn("Attempted to add a date decorator a "+r.tagName),H;if(!s)return H;for(var c,u=[],p=0;c=z.exec(s);){var d={mask:c[0],type:c[0][0],length:c[0].length,start:c.index,end:c.index+c[0].length,chunk:u.length,prefix:s.substring(p,c.index),groups:u,value:null,display:F("",c[0].length,T)};p=d.end,u.push(d)}if(u.suffix=s.substring(u[u.length-1].end),u.last=null,u.slice(1).find(function(t){return!t.prefix}))return console.warn("Attempted to add a date decorator missing interstitial between fields '"+s+"'"),H;function g(t){if(null===u.value&&null===u.last||+u.value==+u.last)return 1;if(!t||!1===a.lazy){if(!1===a.null&&null===u.value)return P(u,u.last),1;u.last=u.value,"string"==typeof a.value&&(f.observers.forEach(function(t){return t.silence()}),l.set(a.value,u.value),f.observers.forEach(function(t){return t.resume()}))}}"string"==typeof a.value?f.observers.push(l.observe(a.value,function(t){t||!1!==a.null||(t=n()),u.value=t,P(u,t),u.last=t,N(u,r)},{defer:!0})):((a.date||!1===a.null)&&(u.value=J(a.date||n())),N(u,r)),f.listeners.push(l.listen("input",function(){var t=r.selectionStart,e=r.value;!function(t,e,n){var r=e.value,o=e.selectionStart,i=B(t,o),a=0,l=t[a],s=t[a+1];t.forEach(function(t){return t.input=""});for(var f=0;f<r.length;f++)s&&r[f]===s.prefix[0]&&(i!==l||l.input.length>=l.length||r.length-f<n.length-l.end+(l.length-l.input.length))?(s.prefix.length>1&&(f+=s.prefix.length-1),r[f+1]===s.prefix[0]&&(f+=s.prefix.length),l=t[++a],s=t[a+1]):l.input+=r[f]}(u,r,s);var n=B(u,t),o=R(u,n,t);if(j(u,g,!0),N(u,r),n&&(e.length>=s.length&&t===n.end||o)&&n!==u[u.length-1]){var i=u[u.indexOf(n)+1];r.setSelectionRange(i.start,i.end)}else r.setSelectionRange(t,t)})),f.listeners.push(l.listen("blur",function(){g(!1)&&P(u,u.value),N(u,r)}));var h=function(){var t=B(u,r.selectionStart);document.activeElement===r&&r.setSelectionRange(t.start,t.end)};return f.listeners.push(l.listen("click",h)),f.listeners.push(l.listen("focus",h)),f.listeners.push(l.listen("keydown",function(t){switch(t.key){case"Enter":case"Tab":var e=B(u,r.selectionStart),n=u.indexOf(e);R(u,e,r.selectionStart,!0)&&(N(u,r),j(u,g,t.shiftKey&&n>0||!t.shiftKey&&n+1<u.length)),t.shiftKey&&n>0?(r.setSelectionRange(u[n-1].start,u[n-1].end),t.preventDefault(),t.stopPropagation()):!t.shiftKey&&n+1<u.length&&(r.setSelectionRange(u[n+1].start,u[n+1].end),t.preventDefault(),t.stopPropagation());break;case"ArrowUp":case"ArrowDown":var o=[r.selectionStart,r.selectionEnd],i=o[0],a=o[1],l=B(u,i);null===l.value&&(l.value=1),function(t,e){switch(t.type){case"y":t.value=t.value+(e?-1:1);break;case"M":t.value=e?t.value<1?11:t.value-1:t.value>10?0:t.value+1;break;case"d":var n=t.groups,r=I(new Date((n.find(function(t){return"y"===t.type})||{value:1}).value,(n.find(function(t){return"M"===t.type})||{value:1}).value));t.value=e?t.value<2?r:t.value-1:t.value+1>r?1:t.value+1;break;case"H":t.value=e?t.value<1?23:t.value-1:t.value>22?0:t.value+1;break;case"h":t.value=e?t.value<1?12:t.value-1:t.value>11?1:t.value+1;break;case"m":case"s":t.value=e?t.value<1?59:t.value-1:t.value>58?0:t.value+1;break;case"S":t.value=e?t.value<1?999:t.value-1:t.value>998?0:t.value+1}}(l,"ArrowDown"===t.key),l.input=l.display=E(l),j(u,g,!0),N(u,r),t.preventDefault(),t.stopPropagation(),r.setSelectionRange(i,a)}})),{teardown:function(){f.observers.forEach(function(t){return t.cancel()}),f.listeners.forEach(function(t){return t.cancel()})}}}}}function R(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=!1);for(var o=!1,i=0;i<t.length;i++){var a=t[i],l=a.input.replace(D,""),s=t[i+1]&&t[i+1].prefix&&M.test(a.input);if(l.length>a.length&&a===e){var f=l.length-e.length;l=l.substr(0,n-e.start)+l.substr(n-e.start+f)}else l=l.substr(0,a.length);if(a.input=l,""===l)a.value=null,a.display=E(a);else if(a!==e)a.value=+l,"M"===a.type&&a.value--,a.display=E(a);else if("M"===a.type&&+l>1||"d"===a.type&&+l>3||"H"===a.type&&+l>2||("m"===a.type||"s"===a.type)&&+l>6)a.value=+l,"M"===a.type&&a.value--,a.display=L(l,a.length),o=!0;else if("y"===a.type&&2===l.length&&(s||r)){var c=(new Date).getFullYear(),u=100*Math.floor(c/100),p=Math.abs(c-(u+ +l))<20?u+ +l:u-100+ +l;a.value=p,a.input=a.display=L(p,a.length),o=!0}else a.display=F(l,a.length,T),a.value=+l}return o}function P(t,e){var n=(e=t.value=e&&J(e))?[e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()]:[null,null,null,null,null,null,null];t.forEach(function(t){t.value=n[S[t.type]],t.input=t.display=E(t)})}function j(t,e,n){var r=t.value||W,o=[r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()];if(t.forEach(function(t){var e=t.value;null!==e&&"M"===t.type?e<0?e=0:e>11&&(e=11):null===e||"m"!==t.type&&"s"!==t.type?null!==e&&"H"===t.type?e<0?e=0:e>23&&(e=23):null!==e&&"h"===t.type&&(e<1?e=1:e>12&&(e=12)):e<0?e=0:e>59&&(e=59),e!==t.value&&(t.value=e,t.display=E(t)),o[S[t.type]]=t.value}),null!==o[0]&&null!==o[1]&&null!==o[2]){var i=t.find(function(t){return"d"===t.type});if(i)if(o[2]<1)i.value=o[2]=1,i.display=E(i);else{var a=I(new Date(o[0],o[1],1));o[2]>a&&(i.value=o[2]=a,i.display=E(i))}}t.find(function(t){return null===t.value})||0===o[0]||o[1]>11||o[1]<0||0===o[2]?t.value=null:(o.unshift(null),t.value=new(Date.bind.apply(Date,o))),e(n)}function N(t,e){e.value=t.reduce(function(t,e){return t+e.prefix+e.display},"")+t.suffix}function B(t,e){return t.find(function(t){return e>=t.start&&e<=t.end})}function E(t){if(null===t.value)return L("",t.length,T);switch(t.type){case"y":return t.value?t.length<=2?(""+t.value).substr(2,2):""+L(t.value,t.length):L("",t.length,T);case"M":return~t.value?1===t.length?""+(t.value+1):2===t.length?(t.value<9?"0":"")+(t.value+1):3===t.length?O[t.value].substr(0,3):O[t.value]:L("",t.length,T);case"d":return t.value?1===t.length?""+t.value:2===t.length?(t.value<=9?"0":"")+t.value:3===t.length?A[t.groups.value.getDay()].substr(0,3):A[t.groups.value.getDay()]:L("",t.length,T);case"H":case"h":case"m":case"s":return 1===t.length?""+t.value:L(t.value,t.length);case"S":return 1===t.length?""+t.value:L(t.value,3)}}var z=/y+|M+|d+|E+|H+|m+|s+|S+|k+|a+/g,O=["January","February","March","April","May","June","July","August","September","October","November","December"],A=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],H={teardown:function(){}};function I(t){return new Date(new Date(t.getFullYear(),t.getMonth()+1,1)-864e5).getDate()}var W=new Date("0000-01-01T00:00:00");function J(t){var e=t;if("function"==typeof e&&(e=t()),"string"==typeof e)try{e=new Date(e)}catch(t){return defaultDate()}return e instanceof Date?e:W}function K(t){t.attributes.value?t.link(t.attributes.value,"rdi.val"):t.unlink("rdi.val");var e={value:"rdi.val"};["null","lazy","mask"].forEach(function(n){n in t.attributes&&(e[n]=t.attributes[n])}),t.set("rdi.opts",e)}var U=Ractive.macro(function(t){return t.aliasLocal("rdi"),K(t),t.setTemplate({v:4,t:[{t:7,e:"span",m:[{t:13,n:"class",f:"rdi-date field-wrapper",g:1}],f:[{t:7,e:"input",m:[{n:"rdi-reg",t:71,f:{r:[],s:'["node"]'}},{n:"rdi-date",t:71,f:{r:["rdi.opts"],s:"[_0]"}},{n:"class-rdi-date",t:13},{t:8,r:"extra-attributes"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rdi-x",g:1},{n:["click"],t:70,f:{r:["@context"],s:'[(_0).set("rdi.val",null)]'}},{n:"title",f:"Clear",t:13,g:1}],f:["×"]}],n:50,x:{r:["rdi.opts.null","rdi.val"],s:"_0&&_1!==null"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rdi-pop",g:1},{n:"rdi-pop",t:71,f:{r:["rdi.node","rdi.tail"],s:'[{path:"rdi.popped",node:_0,tail:_1}]'}},{n:["click"],t:70,f:{r:[],s:"[false,false]"}},{n:"title",f:"Select from calendar",t:13,g:1}],f:[{t:7,e:"svg",m:[{n:"rdi-reg",t:71,f:{r:[],s:'["tail"]'}},{n:"x",f:"0px",t:13,g:1},{n:"y",f:"0px",t:13,g:1},{n:"viewBox",f:"0 0 48 48",t:13,g:1},{n:"xml:space",f:"preserve",t:13}],f:[{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.5;fill:none;stroke-width:1;",g:1},{n:"y",f:"1",t:13,g:1},{n:"x",f:"1",t:13,g:1},{n:"height",f:"46",t:13,g:1},{n:"width",f:"46",t:13,g:1}]}," ",{t:7,e:"rect",m:[{n:"y",f:"1",t:13,g:1},{n:"x",f:"1",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"46",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"3",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.8;stroke:none;",g:1},{t:13,n:"class",f:"rdi-today",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"14",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"25",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.4;stroke:none;",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"37",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"3",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"14",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"25",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.4;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"37",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"3",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"14",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"25",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.4;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"37",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}]}]}]}," ",{t:7,e:"rdi-pop",m:[{n:"popped",t:13,f:[{t:2,r:"rdi.popped"}]},{n:"tail",f:0,t:13},{n:"align",f:"end",t:13,g:1}],f:[{t:7,e:"rdi-picker",m:[{n:["init"],t:70,f:{r:["@context","rdi.val"],s:'[(_0).component.set("target",_1)]'}},{n:"current",t:13,f:[{t:2,r:"rdi.val"}]}]}]}],e:{'["node"]':function(){return["node"]},"[_0]":function(t){return[t]},'[(_0).set("rdi.val",null)]':function(t){return[t.set("rdi.val",null)]},"_0&&_1!==null":function(t,e){return t&&null!==e},'[{path:"rdi.popped",node:_0,tail:_1}]':function(t,e){return[{path:"rdi.popped",node:t,tail:e}]},"[false,false]":function(){return[!1,!1]},'["tail"]':function(){return["tail"]},'[(_0).component.set("target",_1)]':function(t,e){return[t.component.set("target",e)]}}}),{update:function(){K(t)}}},{css:function(t){return[function(t){return".rdi-date {\n position: relative;\n display: inline-block;\n }\n \n .rdi-x {\n position: absolute;\n right: 2em;\n top: 0.025em;\n cursor: pointer;\n }\n \n .rdi-pop {\n position: absolute;\n display: flex;\n justify-content: space-around;\n align-items: flex-end;\n flex-direction: column;\n right: 0.5em;\n height: 100%;\n top: 0;\n cursor: pointer;\n }\n \n .rdi-pop > svg {\n height: 48px;\n max-height: 60%;\n fill: "+(t("raui.dateInput.primary.fg")||t("raui.primary.fg")||"#222")+";\n }\n \n .rdi-today {\n fill: "+(t("raui.dateInput.primary.fga")||t("raui.primary.fga")||"#07e")+";\n }"}.call(this,t)].join(" ")},cssId:"rdi",noCssTransform:!0,attributes:["value","null","lazy","mask"]});t.DateInput=U,t.default=function(t){return void 0===t&&(t={}),function(e){var n,r=e.instance;r.components["rdi-picker"]=l,r.components["rdi-pop"]=_,(void 0===(n={name:"rdi-pop"})&&(n={}),function(t){t.instance.decorators[n.name||"pop"]=function(t,e,r){if(void 0===r&&(r={}),!e)return{teardown:w};"string"==typeof e?r.path=e:"object"==typeof e&&(r=e);var o,i,a=this.getContext(t);function l(n){if("mouseover"!==n.type||!a.get(e)){if("click"!==n.type||!i||o){var l=h,s=v;"function"==typeof(h=r.node||t)&&(h=h()),h=h||t,"function"==typeof(v=r.tail)&&(v=v()),a.toggle(r.path),h=l,v=s}i&&"click"===n.type&&(o=a.observeOnce(r.path,function(){o=null}))}}function s(t){o||a.set(r.path,!1)}return("click"in r?r.click:!1!==n.click)&&a.listen("click",l),("hover"in r?r.hover:n.hover)&&(i=1,a.listen("mouseover",l),a.listen("mouseout",s)),{teardown:function(){a.unlisten("click",l),i&&(a.unlisten("mouseover",l),a.unlisten("mouseout",s),o&&o.cancel())}}}})({instance:r}),C({name:"rdi-date"})({instance:r}),r.partials[t.name||"date-input"]=U,r.decorators["rdi-reg"]=function(t,e){return this.getContext(t).set("rdi."+e,function(){return t}),{teardown:function(){}}}}},Object.defineProperty(t,"__esModule",{value:!0})}); |
@@ -40,2 +40,3 @@ (function (global, factory) { | ||
if (!(dt instanceof Date)) { return {}; } | ||
if (isNaN(dt)) { dt = new Date(); } | ||
@@ -42,0 +43,0 @@ if (offset) { dt = new Date(dt.getFullYear(), dt.getMonth() + offset, dt.getDate()); } |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],e):e(t.RMDatePicker={},t.Ractive)}(this,function(t,e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var r=function(){try{var t=navigator.language||navigator.browserLanguage||navigator.languages[0]||"en";return[[0,1,2,3,4,5,6,7,8,9,10,11].map(function(e){return new Date(2006,e,1).toLocaleString(t,{month:"long"})}),[1,2,3,4,5,6,7].map(function(e){return new Date(2006,0,e).toLocaleString(t,{weekday:"long"})})]}catch(t){return[["January","February","March","April","May","June","July","August","September","October","November","December"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]]}}(),n=r[0],a=r[1],i=a.map(function(t){return t[0]}).concat(a.map(function(t){return t[0].toUpperCase()})),c=n.map(function(t){return t.substr(0,3)}),s=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.month=function(t,e){void 0===e&&(e=0);var r,n=t||new Date;if(!(n instanceof Date))return{};e&&(n=new Date(n.getFullYear(),n.getMonth()+e,n.getDate()));try{r=+this.get("firstDay")}catch(t){}("number"!=typeof r||isNaN(r))&&(r=0),r>6&&(r=0);for(var a=new Date(n.getFullYear(),n.getMonth(),0),c=new Date(n.getFullYear(),n.getMonth()+1,0).getDate(),s=new Date(n.getFullYear(),n.getMonth()+1,1),o=new Date(n.getFullYear(),n.getMonth(),1).getDay(),f=[],l=f[0]=[],u=0;u<7;u++)f[0].unshift({y:a.getFullYear(),m:a.getMonth(),d:a.getDate()-u}),f[0].push({y:n.getFullYear(),m:n.getMonth(),d:u+1});f[0]=r<=o?f[0].slice(7-(o-r),14-(o-r)):f[0].slice(r-o,7+r-o),1===f[0][0].d&&f.unshift(l.slice(0,7));for(var g=f[f.length-1][f[f.length-1].length-1].d,d=f.length;d<5;d++){f[d]=[];for(var h=0;h<7&&g+1<=c;h++)f[d].push({y:n.getFullYear(),m:n.getMonth(),d:++g});if(f[d].length<7){for(var m=7-f[d].length,p=1;p<=m;p++)f[d].push({y:s.getFullYear(),m:s.getMonth(),d:p});f[d+1]=[];for(var y=0,_=m+1;y<7;y++,_++)f[d+1].push({y:s.getFullYear(),m:s.getMonth(),d:_})}}if(!f[5]){for(f[5]=[];g<c;)f[5].push({y:n.getFullYear(),m:n.getMonth(),d:++g});for(var v=1;v<8;v++)f[5].push({y:s.getFullYear(),m:s.getMonth(),d:v});f[5]=f[5].slice(0,7)}return{days:i.slice(r,r+7),weeks:f,year:n.getFullYear(),month:n.getMonth(),currentYear:(new Date).getFullYear()}},e.prototype.year=function(t,e){void 0===e&&(e=0);var r=t||new Date;if(!(r instanceof Date))return{};e&&(r=new Date(r.getFullYear()+e,r.getMonth(),r.getDate()));for(var n=[],a=0;a<4;a++){n.push([]);for(var i=0;i<3;i++)n[a].push({m:3*a+i,y:r.getFullYear()})}return{year:r.getFullYear(),months:n}},e.prototype.decade=function(t,e){void 0===e&&(e=0);var r=t||new Date;if(!(r instanceof Date))return{};e&&(r=new Date(r.getFullYear()+10*e,r.getMonth(),r.getDate()));for(var n=10*Math.floor(r.getFullYear()/10),a=n-1,i=[],c=0;c<4;c++){i.push([]);for(var s=0;s<3;s++)i[c].push({y:a+3*c+s})}return{start:n,end:n+9,years:i}},e.prototype.monthName=function(t){return n[t]},e.prototype.shortMonthName=function(t){return c[t]},e.prototype.dayName=function(t){return a[t]},e.prototype.select=function(t){if(t&&t instanceof Date)this.set("current",t);else{var e=this.get("safeCurrent");t&&this.set("current",new Date(t.y||e.getFullYear(),"number"==typeof t.m?t.m:e.getMonth(),t.d||e.getDate()));var r=this.get("mode");"year"===r?this.set("mode","months"):"months"===r&&this.set("mode","month"),this.set("target",this.get("current"))}},e.prototype.isCurrent=function(t){var e=this.get("safeCurrent");return!!e&&(t&&t.y===e.getFullYear()&&(null==t.m||t.m===e.getMonth())&&(null==t.d||t.d===e.getDate()))},e.prototype.next=function(){var t=this.get("safeTarget"),e=this.get("mode");"month"===e&&this.set("target",new Date(t.getFullYear(),t.getMonth()+1,1)),"months"===e&&this.set("target",new Date(t.getFullYear()+1,t.getMonth(),1)),"year"===e&&this.set("target",new Date(t.getFullYear()+10,t.getMonth(),1))},e.prototype.prev=function(){var t=this.get("safeTarget"),e=this.get("mode");"month"===e&&this.set("target",new Date(t.getFullYear(),t.getMonth()-1,1)),"months"===e&&this.set("target",new Date(t.getFullYear()-1,t.getMonth(),1)),"year"===e&&this.set("target",new Date(t.getFullYear()-10,t.getMonth(),1))},e.prototype.today=function(){this.set("current",new Date),this.set("target",this.get("current"))},e}(e);e.extendWith(s,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal",g:1}],f:[{t:4,f:[{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"left",x:{x:{r:["@index"],s:"_0===0"}}},{n:"right",x:{x:{r:["@last","@index"],s:"_0===_1"}}}]}],n:52,z:[{n:"offset",x:{r:"."}}],r:"~/padding"}],n:50,r:"~/padding"},{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"offset",x:{x:{r:[],s:"0"}}},{n:"left",x:{x:{r:[],s:"true"}}},{n:"right",x:{x:{r:[],s:"true"}}}]}],n:51,l:1}]}],e:{0:function(){return 0},"_0===0":function(t){return 0===t},"_0===_1":function(t,e){return t===e},true:function(){return!0},"[_0.prev(),false]":function(t){return[t.prev(),!1]},'[_0.set("mode","month"),false]':function(t){return[t.set("mode","month"),!1]},"[_0.next(),false]":function(t){return[t.next(),!1]},"_1>_0||_1<_2":function(t,e,r){return e>t||e<r},"_0.isCurrent(_1)":function(t,e){return t.isCurrent(e)},"[_0.select(_1),false]":function(t,e){return[t.select(e),!1]},"_0.decade(_1,_2)":function(t,e,r){return t.decade(e,r)},'[_0.set("mode","year"),false]':function(t){return[t.set("mode","year"),!1]},"_0.shortMonthName(_1)":function(t,e){return t.shortMonthName(e)},"_0.year(_1,_2)":function(t,e,r){return t.year(e,r)},'[_0.set("mode","months"),false]':function(t){return[t.set("mode","months"),!1]},"_0.monthName(_1)":function(t,e){return t.monthName(e)},"_0!==_1":function(t,e){return t!==e},"[_0.select(_1)]":function(t,e){return[t.select(e)]},"_0.month(_1,_2)":function(t,e,r){return t.month(e,r)}},p:{year:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","month"),false]'}}],f:[{t:2,r:".start"}," - ",{t:2,r:".end"}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-decade",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:["year.end",".y","year.start"],s:"_1>_0||_1<_2"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1),false]"}}],f:[{t:2,r:".y"}]}],n:52,r:"."}]}],n:52,r:".years"}]}],n:54,z:[{n:"year",x:{r:"."}}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.decade(_1,_2)"}}],months:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","year"),false]'}}],f:[{t:2,r:".year"}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-year",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1),false]"}}],f:[{t:2,x:{r:["@this",".m"],s:"_0.shortMonthName(_1)"}}]}],n:52,r:"."}]}],n:52,r:".months"}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.year(_1,_2)"}}],month:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1},{n:"class-rcal-pad",t:13,f:[{t:2,r:"~/pad"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","months"),false]'}}],f:[{t:2,x:{r:["@this",".month"],s:"_0.monthName(_1)"}},{t:4,f:[", ",{t:2,r:".year"}],n:50,x:{r:[".currentYear",".year"],s:"_0!==_1"}}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-month",g:1}],f:[{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week rcal-week-header",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day rcal-day-header",g:1}],f:[{t:2,r:"."}]}],n:52,r:".days"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:[".m","month.month"],s:"_0!==_1"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1)]"}}],f:[{t:2,r:".d"}]}],n:52,r:"."}]}],n:52,r:".weeks"}],n:54,z:[{n:"month",x:{r:"."}}]}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.month(_1,_2)"}}]}},css:function(t){return[function(t){return".rcal-wrapper {\n display: inline-block;\n }\n \n .rcal-pad {\n padding: 0.5em;\n }\n \n .rcal-block-outer {\n border: 1px solid "+(t("raui.datePicker.primary.bga")||t("raui.primary.bga")||"#f4f4f4")+";\n }\n \n .rcal-block-header {\n text-align: center;\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n cursor: default;\n display: flex;\n justify-content: space-between;\n padding: 0 0.5em;\n line-height: 1em;\n height: 1.5em;\n align-items: center;\n }\n \n .rcal-click {\n cursor: pointer;\n }\n \n .rcal-left, .rcal-right {\n height: 0.8em;\n display: inline-block;\n box-sizing: border-box;\n border: 0.4em solid transparent;\n cursor: pointer;\n }\n .rcal-left {\n border-right-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n }\n .rcal-right {\n border-left-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n }\n \n .rcal-month, .rcal-year, .rcal-decade {\n display: flex;\n flex-direction: column;\n background-color: "+(t("raui.datePicker.primary.bga")||t("raui.primary.bga")||"#f4f4f4")+";\n width: calc(10.5em + 6px);\n height: calc(10.5em + 6px);\n justify-content: space-between;\n }\n .rcal-year, .rcal-decade {\n justify-content: space-around;\n }\n \n .rcal-week {\n height: 1.5em;\n display: flex;\n justify-content: space-between;\n width: calc(10.5em + 6px);\n }\n \n .rcal-inner-row {\n height: 2em;\n display: flex;\n justify-content: space-around;\n width: calc(10.5em + 6px);\n }\n \n .rcal-inner-pick {\n background-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n width: 3em;\n height: 2em;\n line-height: 2em;\n text-align: center;\n cursor: pointer;\n }\n \n .rcal-week-header {\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n }\n \n .rcal-day {\n background-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n width: 1.5em;\n height: 1.5em;\n text-align: center;\n line-height: 1.5em;\n cursor: pointer;\n }\n \n .rcal-day-header {\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n cursor: default;\n }\n \n .rcal-off-day {\n background-color: "+(t("raui.datePicker.primary.bc")||t("raui.primary.bc")||"#ccc")+";\n }\n \n .rcal-current {\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n background-color: "+(t("raui.datePicker.primary.fg")||t("raui.primary.fg")||"#222")+";\n }\n "}.call(this,t)].join(" ")},noCssTransform:!0,data:function(){return{mode:"month",target:new Date}},computed:{safeCurrent:function(){var t=this.get("current");if("string"==typeof t)try{t=new Date(t)}catch(t){}return t instanceof Date||(t=new Date),t},safeTarget:function(){var t=this.get("target");if(t||(t=this.get("current")),"string"==typeof t)try{t=new Date(t)}catch(t){}return t instanceof Date?t:new Date}}}),t.DatePicker=s,t.default=function(t){return void 0===t&&(t={}),function(e){e.instance.components[t.name||"date-picker"]=s}},Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],e):e(t.RMDatePicker={},t.Ractive)}(this,function(t,e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var r=function(){try{var t=navigator.language||navigator.browserLanguage||navigator.languages[0]||"en";return[[0,1,2,3,4,5,6,7,8,9,10,11].map(function(e){return new Date(2006,e,1).toLocaleString(t,{month:"long"})}),[1,2,3,4,5,6,7].map(function(e){return new Date(2006,0,e).toLocaleString(t,{weekday:"long"})})]}catch(t){return[["January","February","March","April","May","June","July","August","September","October","November","December"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]]}}(),n=r[0],a=r[1],i=a.map(function(t){return t[0]}).concat(a.map(function(t){return t[0].toUpperCase()})),c=n.map(function(t){return t.substr(0,3)}),s=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.month=function(t,e){void 0===e&&(e=0);var r,n=t||new Date;if(!(n instanceof Date))return{};isNaN(n)&&(n=new Date),e&&(n=new Date(n.getFullYear(),n.getMonth()+e,n.getDate()));try{r=+this.get("firstDay")}catch(t){}("number"!=typeof r||isNaN(r))&&(r=0),r>6&&(r=0);for(var a=new Date(n.getFullYear(),n.getMonth(),0),c=new Date(n.getFullYear(),n.getMonth()+1,0).getDate(),s=new Date(n.getFullYear(),n.getMonth()+1,1),o=new Date(n.getFullYear(),n.getMonth(),1).getDay(),f=[],l=f[0]=[],u=0;u<7;u++)f[0].unshift({y:a.getFullYear(),m:a.getMonth(),d:a.getDate()-u}),f[0].push({y:n.getFullYear(),m:n.getMonth(),d:u+1});f[0]=r<=o?f[0].slice(7-(o-r),14-(o-r)):f[0].slice(r-o,7+r-o),1===f[0][0].d&&f.unshift(l.slice(0,7));for(var g=f[f.length-1][f[f.length-1].length-1].d,d=f.length;d<5;d++){f[d]=[];for(var h=0;h<7&&g+1<=c;h++)f[d].push({y:n.getFullYear(),m:n.getMonth(),d:++g});if(f[d].length<7){for(var m=7-f[d].length,p=1;p<=m;p++)f[d].push({y:s.getFullYear(),m:s.getMonth(),d:p});f[d+1]=[];for(var y=0,_=m+1;y<7;y++,_++)f[d+1].push({y:s.getFullYear(),m:s.getMonth(),d:_})}}if(!f[5]){for(f[5]=[];g<c;)f[5].push({y:n.getFullYear(),m:n.getMonth(),d:++g});for(var v=1;v<8;v++)f[5].push({y:s.getFullYear(),m:s.getMonth(),d:v});f[5]=f[5].slice(0,7)}return{days:i.slice(r,r+7),weeks:f,year:n.getFullYear(),month:n.getMonth(),currentYear:(new Date).getFullYear()}},e.prototype.year=function(t,e){void 0===e&&(e=0);var r=t||new Date;if(!(r instanceof Date))return{};e&&(r=new Date(r.getFullYear()+e,r.getMonth(),r.getDate()));for(var n=[],a=0;a<4;a++){n.push([]);for(var i=0;i<3;i++)n[a].push({m:3*a+i,y:r.getFullYear()})}return{year:r.getFullYear(),months:n}},e.prototype.decade=function(t,e){void 0===e&&(e=0);var r=t||new Date;if(!(r instanceof Date))return{};e&&(r=new Date(r.getFullYear()+10*e,r.getMonth(),r.getDate()));for(var n=10*Math.floor(r.getFullYear()/10),a=n-1,i=[],c=0;c<4;c++){i.push([]);for(var s=0;s<3;s++)i[c].push({y:a+3*c+s})}return{start:n,end:n+9,years:i}},e.prototype.monthName=function(t){return n[t]},e.prototype.shortMonthName=function(t){return c[t]},e.prototype.dayName=function(t){return a[t]},e.prototype.select=function(t){if(t&&t instanceof Date)this.set("current",t);else{var e=this.get("safeCurrent");t&&this.set("current",new Date(t.y||e.getFullYear(),"number"==typeof t.m?t.m:e.getMonth(),t.d||e.getDate()));var r=this.get("mode");"year"===r?this.set("mode","months"):"months"===r&&this.set("mode","month"),this.set("target",this.get("current"))}},e.prototype.isCurrent=function(t){var e=this.get("safeCurrent");return!!e&&(t&&t.y===e.getFullYear()&&(null==t.m||t.m===e.getMonth())&&(null==t.d||t.d===e.getDate()))},e.prototype.next=function(){var t=this.get("safeTarget"),e=this.get("mode");"month"===e&&this.set("target",new Date(t.getFullYear(),t.getMonth()+1,1)),"months"===e&&this.set("target",new Date(t.getFullYear()+1,t.getMonth(),1)),"year"===e&&this.set("target",new Date(t.getFullYear()+10,t.getMonth(),1))},e.prototype.prev=function(){var t=this.get("safeTarget"),e=this.get("mode");"month"===e&&this.set("target",new Date(t.getFullYear(),t.getMonth()-1,1)),"months"===e&&this.set("target",new Date(t.getFullYear()-1,t.getMonth(),1)),"year"===e&&this.set("target",new Date(t.getFullYear()-10,t.getMonth(),1))},e.prototype.today=function(){this.set("current",new Date),this.set("target",this.get("current"))},e}(e);e.extendWith(s,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal",g:1}],f:[{t:4,f:[{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"left",x:{x:{r:["@index"],s:"_0===0"}}},{n:"right",x:{x:{r:["@last","@index"],s:"_0===_1"}}}]}],n:52,z:[{n:"offset",x:{r:"."}}],r:"~/padding"}],n:50,r:"~/padding"},{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"offset",x:{x:{r:[],s:"0"}}},{n:"left",x:{x:{r:[],s:"true"}}},{n:"right",x:{x:{r:[],s:"true"}}}]}],n:51,l:1}]}],e:{0:function(){return 0},"_0===0":function(t){return 0===t},"_0===_1":function(t,e){return t===e},true:function(){return!0},"[_0.prev(),false]":function(t){return[t.prev(),!1]},'[_0.set("mode","month"),false]':function(t){return[t.set("mode","month"),!1]},"[_0.next(),false]":function(t){return[t.next(),!1]},"_1>_0||_1<_2":function(t,e,r){return e>t||e<r},"_0.isCurrent(_1)":function(t,e){return t.isCurrent(e)},"[_0.select(_1),false]":function(t,e){return[t.select(e),!1]},"_0.decade(_1,_2)":function(t,e,r){return t.decade(e,r)},'[_0.set("mode","year"),false]':function(t){return[t.set("mode","year"),!1]},"_0.shortMonthName(_1)":function(t,e){return t.shortMonthName(e)},"_0.year(_1,_2)":function(t,e,r){return t.year(e,r)},'[_0.set("mode","months"),false]':function(t){return[t.set("mode","months"),!1]},"_0.monthName(_1)":function(t,e){return t.monthName(e)},"_0!==_1":function(t,e){return t!==e},"[_0.select(_1)]":function(t,e){return[t.select(e)]},"_0.month(_1,_2)":function(t,e,r){return t.month(e,r)}},p:{year:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","month"),false]'}}],f:[{t:2,r:".start"}," - ",{t:2,r:".end"}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-decade",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:["year.end",".y","year.start"],s:"_1>_0||_1<_2"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1),false]"}}],f:[{t:2,r:".y"}]}],n:52,r:"."}]}],n:52,r:".years"}]}],n:54,z:[{n:"year",x:{r:"."}}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.decade(_1,_2)"}}],months:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","year"),false]'}}],f:[{t:2,r:".year"}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-year",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1),false]"}}],f:[{t:2,x:{r:["@this",".m"],s:"_0.shortMonthName(_1)"}}]}],n:52,r:"."}]}],n:52,r:".months"}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.year(_1,_2)"}}],month:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1},{n:"class-rcal-pad",t:13,f:[{t:2,r:"~/pad"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","months"),false]'}}],f:[{t:2,x:{r:["@this",".month"],s:"_0.monthName(_1)"}},{t:4,f:[", ",{t:2,r:".year"}],n:50,x:{r:[".currentYear",".year"],s:"_0!==_1"}}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-month",g:1}],f:[{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week rcal-week-header",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day rcal-day-header",g:1}],f:[{t:2,r:"."}]}],n:52,r:".days"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:[".m","month.month"],s:"_0!==_1"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1)]"}}],f:[{t:2,r:".d"}]}],n:52,r:"."}]}],n:52,r:".weeks"}],n:54,z:[{n:"month",x:{r:"."}}]}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.month(_1,_2)"}}]}},css:function(t){return[function(t){return".rcal-wrapper {\n display: inline-block;\n }\n \n .rcal-pad {\n padding: 0.5em;\n }\n \n .rcal-block-outer {\n border: 1px solid "+(t("raui.datePicker.primary.bga")||t("raui.primary.bga")||"#f4f4f4")+";\n }\n \n .rcal-block-header {\n text-align: center;\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n cursor: default;\n display: flex;\n justify-content: space-between;\n padding: 0 0.5em;\n line-height: 1em;\n height: 1.5em;\n align-items: center;\n }\n \n .rcal-click {\n cursor: pointer;\n }\n \n .rcal-left, .rcal-right {\n height: 0.8em;\n display: inline-block;\n box-sizing: border-box;\n border: 0.4em solid transparent;\n cursor: pointer;\n }\n .rcal-left {\n border-right-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n }\n .rcal-right {\n border-left-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n }\n \n .rcal-month, .rcal-year, .rcal-decade {\n display: flex;\n flex-direction: column;\n background-color: "+(t("raui.datePicker.primary.bga")||t("raui.primary.bga")||"#f4f4f4")+";\n width: calc(10.5em + 6px);\n height: calc(10.5em + 6px);\n justify-content: space-between;\n }\n .rcal-year, .rcal-decade {\n justify-content: space-around;\n }\n \n .rcal-week {\n height: 1.5em;\n display: flex;\n justify-content: space-between;\n width: calc(10.5em + 6px);\n }\n \n .rcal-inner-row {\n height: 2em;\n display: flex;\n justify-content: space-around;\n width: calc(10.5em + 6px);\n }\n \n .rcal-inner-pick {\n background-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n width: 3em;\n height: 2em;\n line-height: 2em;\n text-align: center;\n cursor: pointer;\n }\n \n .rcal-week-header {\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n }\n \n .rcal-day {\n background-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n width: 1.5em;\n height: 1.5em;\n text-align: center;\n line-height: 1.5em;\n cursor: pointer;\n }\n \n .rcal-day-header {\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n cursor: default;\n }\n \n .rcal-off-day {\n background-color: "+(t("raui.datePicker.primary.bc")||t("raui.primary.bc")||"#ccc")+";\n }\n \n .rcal-current {\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n background-color: "+(t("raui.datePicker.primary.fg")||t("raui.primary.fg")||"#222")+";\n }\n "}.call(this,t)].join(" ")},noCssTransform:!0,data:function(){return{mode:"month",target:new Date}},computed:{safeCurrent:function(){var t=this.get("current");if("string"==typeof t)try{t=new Date(t)}catch(t){}return t instanceof Date||(t=new Date),t},safeTarget:function(){var t=this.get("target");if(t||(t=this.get("current")),"string"==typeof t)try{t=new Date(t)}catch(t){}return t instanceof Date?t:new Date}}}),t.DatePicker=s,t.default=function(t){return void 0===t&&(t={}),function(e){e.instance.components[t.name||"date-picker"]=s}},Object.defineProperty(t,"__esModule",{value:!0})}); |
@@ -42,3 +42,3 @@ (function (global, factory) { | ||
return ("\n label.field {\n display: inline-block;\n font-size: 0.9em;\n font-weight: 500;\n color: " + (primary.fg || '#222') + ";\n transition: 0.2s ease-in-out;\n transition-property: color;\n vertical-align: top;\n box-sizing: border-box;\n padding: 0.25em 0.5em;\n line-height: 1.5em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: inherit;\n }\n\n label.field.textarea {\n display: block;\n border: 0.0625em solid " + (primary.bc || '#ccc') + ";\n padding: 0.5em 0.8em 0.8em 0.8em;\n border-radius: " + (primary.radius || '0.2em') + ";\n box-shadow: none;\n transition-property: color, border-color, box-shadow;\n margin: 0.8em 0.2em;\n min-height: auto;\n background-color: " + (boxy ? primary.bg || '#fff' : 'transparent') + ";\n }\n\n label.field.focus {\n color: " + (active.fg || primary.fga || '#07e') + ";\n }\n\n label.field.textarea.focus {\n border-color: " + (active.fg || primary.fga || '#07e') + ";\n " + (!boxy ? ("box-shadow: 0.0625em 0.0625em " + (active.fg || primary.fga || '#07e') + ",\n -0.0625em 0.0625em " + (active.fg || primary.fga || '#07e') + ",\n 0.0625em -0.0625em " + (active.fg || primary.fga || '#07e') + ",\n -0.0625em -0.0625em " + (active.fg || primary.fga || '#07e') + ";") : '') + "\n }\n\n label.field input,\n label.field select,\n label.field textarea\n {\n display: block;\n border-width: " + (boxy ? '0.0625em' : '0 0 0.0625em 0') + ";\n border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n box-sizing: border-box;\n background-color: " + (boxy ? primary.bg || '#fff' : 'transparent') + ";\n transition: 0.2s ease-in-out;\n transition-property: box-shadow, color;\n outline: none;\n box-shadow: none;\n width: 100%;\n margin-bottom: 0.8em;\n font-size: 1.1em;" + (boxy ? ("\n border-radius: " + (primary.radius || '0.2em') + ";") : '') + "\n font-weight: 400;\n font-family: inherit;\n }\n\n label.field input" + (boxy ? '' : ':disabled') + ",\n label.field select" + (boxy ? '' : ':disabled') + " {\n padding: 0 0.75em;\n }\n label.field select" + (boxy ? '' : ':disabled') + " {\n padding-right: 2em;\n }\n\n label.field input:disabled,\n label.field select:disabled,\n label.field textarea:disabled {\n background: #f4f4f4;\n }\n\n label.field textarea {\n line-height: 1.2em;\n }\n label.field .field-wrapper {\n display: block;\n }\n label.field > select, label.field > input,\n label.field > .field-wrapper > input, label.field > .field-wrapper > select {\n height: 2.5em;\n }\n\n " + (!boxy ? ("label.field:hover > input,\n label.field:hover select,\n label.field.file:hover:after {\n box-shadow: 0 0.0625em 0 0 " + (primary.bc || '#ccc') + ";\n }\n\n label.field.textarea:hover {\n box-shadow: 0.0625em 0.0625em " + (primary.bc || '#ccc') + ",\n -0.0625em 0.0625em " + (primary.bc || '#ccc') + ",\n 0.0625em -0.0625em " + (primary.bc || '#ccc') + ",\n -0.0625em -0.0625em " + (primary.bc || '#ccc') + ";\n }\n\n label.field.textarea.focus:hover {\n box-shadow: 0.0625em 0.0625em " + (active.fg || primary.fga || '#07e') + ",\n -0.0625em 0.0625em " + (active.fg || primary.fga || '#07e') + ",\n 0.0625em -0.0625em " + (active.fg || primary.fga || '#07e') + ",\n -0.0625em -0.0625em " + (active.fg || primary.fga || '#07e') + ";\n }") : '') + "\n\n /**** CHECK BOXES ****/\n\n label.field.check {\n position:relative;\n z-index: 0;\n overflow: visible;\n cursor: pointer;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.check.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: -3px;\n top: 23px;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n background-color: " + (primary.bc || '#ccc') + ";\n box-shadow: none;\n outline: none;\n opacity: 0;\n transform: scale(1);\n pointer-events: none;\n transition: opacity 0.3s, transform 0.2s;\n }\n label.field.inline.check input {\n top: 3px;\n left: -3px;\n }\n\n label.field.check input:checked {\n background-color: " + (primary.fga || '#07e') + ";\n }\n\n label.field.check:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before {\n content: \"\";\n display: inline-block;\n box-sizing: border-box;\n margin: 3px 11px 3px 1px;\n border: solid 2px; /* Safari */\n border-color: " + (primary.fg || '#222') + ";\n border-radius: 2px;\n width: 18px;\n height: 18px;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after {\n content: \"\";\n display: block;\n position: absolute;\n top: 0px;\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.8em, 2.65em) rotate(-45deg);\n }\n\n label.field.check.inline:after {\n transform: translate(0.8em, 1.2em) rotate(-45deg);\n }\n\n label.field.check.checked:before {\n border-color: " + (primary.fga || '#07e') + ";\n background-color: " + (primary.fga || '#07e') + ";\n }\n label.field.check.focus:before {\n border-color: " + (primary.fga || '#07e') + ";\n }\n\n label.field.check.checked:after {\n border-color: " + (primary.bg || '#fff') + ";\n }\n\n label.field.check input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled {\n color: " + (primary.bc || '#ccc') + ";\n cursor: initial;\n }\n\n label.field.check.disabled:before {\n border-color: " + (primary.bc || '#ccc') + ";\n }\n\n label.field.check.checked.disabled:before {\n border-color: transparent;\n background-color: " + (primary.bc || '#ccc') + ";\n }\n\n\n /**** RADIO BUTTONS ****/\n \n label.field.radio {\n z-index: 0;\n position: relative;\n display: inline-block;\n overflow: visible;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.radio.inline {\n padding-top: 0.8em;\n }\n\n label.field.radio input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: 0;\n top: 0;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 41px;\n height: 40px;\n background-color: " + (primary.bc || '#ccc') + ";\n outline: none;\n opacity: 0;\n pointer-events: none;\n transform: translate(-0.2em, 24px) scale(1);\n transition: opacity 0.3s, transform 0.3s;\n }\n label.field.inline.radio input {\n transform: translate(-0.2em, 3px) scale(1);\n }\n\n label.field.radio {\n cursor: pointer;\n position: relative;\n }\n\n label.field.radio:before {\n content: \"\";\n display: inline-block;\n box-sizing: border-box;\n margin: 2px 10px 2px 0;\n border: solid 2px; /* Safari */\n border-color: " + (primary.fg || '#222') + ";\n border-radius: 50%;\n width: 20px;\n height: 20px;\n vertical-align: middle;\n transition: border-color 0.2s;\n }\n\n label.field.radio:after {\n content: \"\";\n display: block;\n position: absolute;\n border-radius: 50%;\n width: 10px;\n height: 10px;\n background-color: " + (primary.fga || '#07e') + ";\n transform: translate(5px, -17px) scale(0);\n transition: transform 0.2s;\n }\n\n label.field.radio input:checked {\n background-color: " + (primary.fga || '#07e') + ";\n }\n\n label.field.radio.checked:before {\n border-color: " + (primary.fga || '#07e') + ";\n }\n\n label.field.radio.checked:after {\n transform: translate(5px, -17px) scale(1);\n }\n\n label.field.radio:hover input {\n opacity: 0.04;\n }\n\n label.field.radio input:focus {\n opacity: 0.12;\n transform: translate(-0.2em, 24px) scale(1);\n transition: transform 0.2s, opacity 0.2s;\n }\n label.field.inline.radio input:focus {\n transform: translate(-0.2em, 3px) scale(1);\n }\n\n label.field.radio:hover input:focus {\n opacity: 0.16;\n }\n\n label.field.radio input:active {\n opacity: 1;\n transform: translate(-0.2em, 24px) scale(0);\n transition: transform 0s, opacity 0s;\n }\n label.field.inline.radio input:active {\n transform: translate(-0.2em, 3px) scale(0);\n }\n\n label.field.radio.checked:before {\n border-color: " + (primary.fga || '#07e') + ";\n }\n\n label.field.radio.focus:before {\n border-color: " + (primary.fga || '#07e') + ";\n }\n\n label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.radio.disabled {\n color: " + (primary.bc || '#ccc') + ";\n cursor: initial;\n }\n\n label.field.radio.disabled:before {\n border-color: " + (primary.bc || '#ccc') + ";\n }\n\n label.field.radio.disabled:after {\n background-color: " + (primary.bc || '#ccc') + ";\n }\n\n\n\n label.field select {\n padding-right: 2em;\n }\n\n label.field.select {\n cursor: pointer;\n position: relative;\n }\n\n label.field.select:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n right: 19px;\n height: 0.6em;\n top: 2.6em;\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n pointer-events: none;\n color: " + (primary.bc || '#ccc') + ";\n }\n\n label.field textarea {\n border: none;" + (boxy ? "\n padding: 0;" : '') + "\n }\n\n label.field > select {\n -moz-appearance: none;\n -webkit-appearance: none;\n }\n\n label.field input:focus,\n label.field select:focus,\n label.field.file.focus:after\n {\n border-color: " + (active.fg || primary.fga || '#07e') + ";\n " + (!boxy ? ("box-shadow: 0 0.0625em 0 0 " + (active.fg || primary.fga || '#07e') + ";") : '') + "\n }\n\n label.field input[type=checkbox]:focus,\n label.field input[type=radio]:focus {\n box-shadow: none;\n }\n\n label.field.file.focus:after {\n color: " + (active.fg || primary.fga || '#07e') + ";\n }\n label.field.file [type=file] {\n position: absolute;\n width: 0;\n height: 0;\n opacity: 0;\n z-index: -1;\n }\n label.field.file {\n position: relative;\n min-width: 9em;\n height: 5em;\n }\n label.field.file:after {\n position: absolute;\n content: 'Choose a file';\n box-sizing: border-box;\n width: calc(100% - 0.3em);\n height: 2.5em;\n font-size: 1.1em;\n line-height: 1.5em;\n color: " + (primary.fg || '#222') + ";\n text-align: " + (boxy ? 'center' : 'left') + ";\n padding: 0.5em " + (boxy ? '0.5em' : '0') + ";\n cursor: pointer;\n font-style: oblique;\n left: 0.25em;\n top: 1.6em;\n transition: 0.2s ease-in-out;\n transition-property: color, border-bolor, box-shadow;" + (boxy ? ("\n border-radius: " + (primary.radius || '0.2em') + ";\n border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n border-width: 0.0625em;") : ("\n border-bottom-color: " + (primary.bc || '#ccc') + ";\n border-bottom-width: 0.0625em;\n border-bottom-style: solid;\n ")) + "\n }\n label.field.file.inline:after {\n top: 0.2em;\n }\n\n label.field.button {\n vertical-align: top;\n padding-top: " + (boxy ? '1.7' : '1.958') + "em;\n }\n label.field .with-buttons button, label.field.button button {\n font-size: 1.1em;\n margin-top: " + (boxy ? '0.15em' : '0') + ";\n }\n\n label.field .field-wrapper.with-buttons {\n display: flex;\n }\n label.field .with-buttons button {\n flex-shrink: 0;\n padding-left: 0.5em;\n padding-right: 0.5em;\n margin-top: 0;\n margin-right: 0;\n " + (boxy ? ("height: 2.5em;\n box-shadow: none;\n border-radius: 0;\n border-left: 1px solid " + (primary.bg || '#fff') + ";\n margin-left: 0;") : | ||
"height: 2.25em;") + "\n }" + (boxy ? ("\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 " + (primary.radius || '0.2em') + " " + (primary.radius || '0.2em') + " 0;\n }\n label.field .with-buttons input {\n border-radius: " + (primary.radius || '0.2em') + " 0 0 " + (primary.radius || '0.2em') + ";\n min-width: 0;\n }\n ") : '') + "\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1." + (boxy ? '15' : '1') + "em;\n }\n\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: " + (primary.fga || '#07e') + ";\n color: " + (primary.bg || '#fff;') + ";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1.2em;\n text-align: center;\n margin-top: -0.2em;\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n "); | ||
"height: 2.25em;") + "\n }" + (boxy ? ("\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 " + (primary.radius || '0.2em') + " " + (primary.radius || '0.2em') + " 0;\n }\n label.field .with-buttons input {\n border-radius: " + (primary.radius || '0.2em') + " 0 0 " + (primary.radius || '0.2em') + ";\n min-width: 0;\n }\n ") : '') + "\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n font-weight: normal;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1." + (boxy ? '15' : '1') + "em;\n }\n\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: " + (primary.fga || '#07e') + ";\n color: " + (primary.bg || '#fff;') + ";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1.2em;\n text-align: center;\n margin-top: -0.2em;\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n "); | ||
// TODO: other themes | ||
@@ -45,0 +45,0 @@ } |
@@ -1,1 +0,1 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],n):n(e.RMForm={},e.Ractive)}(this,function(e,n){"use strict";n=n&&n.hasOwnProperty("default")?n.default:n;var i="undefined"!=typeof window?window:null;function t(e,n,t){if(i&&i.Ractive&&"object"==typeof i.Ractive[n]){var l=document.currentScript;if(l||(l=(l=document.querySelectorAll("script"))[l.length-1]),l){var a=l.getAttribute("data-alias");a&&(a=(a=a.split("&")).reduce(function(e,n){var i=n.split("="),t=i[0],l=i[1];return e[t]=l,e},{})),Ractive[n][a&&a[e]||e]=t}}}function l(e){var n=Object.assign({},e("raui.primary"),e("raui.form.primary")),i=Object.assign({},e("raui.primary.active"),e("raui.form.primary.active")),t=e("raui.form.boxy");return"\n label.field {\n display: inline-block;\n font-size: 0.9em;\n font-weight: 500;\n color: "+(n.fg||"#222")+";\n transition: 0.2s ease-in-out;\n transition-property: color;\n vertical-align: top;\n box-sizing: border-box;\n padding: 0.25em 0.5em;\n line-height: 1.5em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: inherit;\n }\n\n label.field.textarea {\n display: block;\n border: 0.0625em solid "+(n.bc||"#ccc")+";\n padding: 0.5em 0.8em 0.8em 0.8em;\n border-radius: "+(n.radius||"0.2em")+";\n box-shadow: none;\n transition-property: color, border-color, box-shadow;\n margin: 0.8em 0.2em;\n min-height: auto;\n background-color: "+(t?n.bg||"#fff":"transparent")+";\n }\n\n label.field.focus {\n color: "+(i.fg||n.fga||"#07e")+";\n }\n\n label.field.textarea.focus {\n border-color: "+(i.fg||n.fga||"#07e")+";\n "+(t?"":"box-shadow: 0.0625em 0.0625em "+(i.fg||n.fga||"#07e")+",\n -0.0625em 0.0625em "+(i.fg||n.fga||"#07e")+",\n 0.0625em -0.0625em "+(i.fg||n.fga||"#07e")+",\n -0.0625em -0.0625em "+(i.fg||n.fga||"#07e")+";")+"\n }\n\n label.field input,\n label.field select,\n label.field textarea\n {\n display: block;\n border-width: "+(t?"0.0625em":"0 0 0.0625em 0")+";\n border-color: "+(n.bc||"#ccc")+";\n border-style: solid;\n box-sizing: border-box;\n background-color: "+(t?n.bg||"#fff":"transparent")+";\n transition: 0.2s ease-in-out;\n transition-property: box-shadow, color;\n outline: none;\n box-shadow: none;\n width: 100%;\n margin-bottom: 0.8em;\n font-size: 1.1em;"+(t?"\n border-radius: "+(n.radius||"0.2em")+";":"")+"\n font-weight: 400;\n font-family: inherit;\n }\n\n label.field input"+(t?"":":disabled")+",\n label.field select"+(t?"":":disabled")+" {\n padding: 0 0.75em;\n }\n label.field select"+(t?"":":disabled")+" {\n padding-right: 2em;\n }\n\n label.field input:disabled,\n label.field select:disabled,\n label.field textarea:disabled {\n background: #f4f4f4;\n }\n\n label.field textarea {\n line-height: 1.2em;\n }\n label.field .field-wrapper {\n display: block;\n }\n label.field > select, label.field > input,\n label.field > .field-wrapper > input, label.field > .field-wrapper > select {\n height: 2.5em;\n }\n\n "+(t?"":"label.field:hover > input,\n label.field:hover select,\n label.field.file:hover:after {\n box-shadow: 0 0.0625em 0 0 "+(n.bc||"#ccc")+";\n }\n\n label.field.textarea:hover {\n box-shadow: 0.0625em 0.0625em "+(n.bc||"#ccc")+",\n -0.0625em 0.0625em "+(n.bc||"#ccc")+",\n 0.0625em -0.0625em "+(n.bc||"#ccc")+",\n -0.0625em -0.0625em "+(n.bc||"#ccc")+";\n }\n\n label.field.textarea.focus:hover {\n box-shadow: 0.0625em 0.0625em "+(i.fg||n.fga||"#07e")+",\n -0.0625em 0.0625em "+(i.fg||n.fga||"#07e")+",\n 0.0625em -0.0625em "+(i.fg||n.fga||"#07e")+",\n -0.0625em -0.0625em "+(i.fg||n.fga||"#07e")+";\n }")+"\n\n /**** CHECK BOXES ****/\n\n label.field.check {\n position:relative;\n z-index: 0;\n overflow: visible;\n cursor: pointer;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.check.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: -3px;\n top: 23px;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n background-color: "+(n.bc||"#ccc")+";\n box-shadow: none;\n outline: none;\n opacity: 0;\n transform: scale(1);\n pointer-events: none;\n transition: opacity 0.3s, transform 0.2s;\n }\n label.field.inline.check input {\n top: 3px;\n left: -3px;\n }\n\n label.field.check input:checked {\n background-color: "+(n.fga||"#07e")+';\n }\n\n label.field.check:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n margin: 3px 11px 3px 1px;\n border: solid 2px; /* Safari */\n border-color: '+(n.fg||"#222")+';\n border-radius: 2px;\n width: 18px;\n height: 18px;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after {\n content: "";\n display: block;\n position: absolute;\n top: 0px;\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.8em, 2.65em) rotate(-45deg);\n }\n\n label.field.check.inline:after {\n transform: translate(0.8em, 1.2em) rotate(-45deg);\n }\n\n label.field.check.checked:before {\n border-color: '+(n.fga||"#07e")+";\n background-color: "+(n.fga||"#07e")+";\n }\n label.field.check.focus:before {\n border-color: "+(n.fga||"#07e")+";\n }\n\n label.field.check.checked:after {\n border-color: "+(n.bg||"#fff")+";\n }\n\n label.field.check input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled {\n color: "+(n.bc||"#ccc")+";\n cursor: initial;\n }\n\n label.field.check.disabled:before {\n border-color: "+(n.bc||"#ccc")+";\n }\n\n label.field.check.checked.disabled:before {\n border-color: transparent;\n background-color: "+(n.bc||"#ccc")+";\n }\n\n\n /**** RADIO BUTTONS ****/\n \n label.field.radio {\n z-index: 0;\n position: relative;\n display: inline-block;\n overflow: visible;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.radio.inline {\n padding-top: 0.8em;\n }\n\n label.field.radio input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: 0;\n top: 0;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 41px;\n height: 40px;\n background-color: "+(n.bc||"#ccc")+';\n outline: none;\n opacity: 0;\n pointer-events: none;\n transform: translate(-0.2em, 24px) scale(1);\n transition: opacity 0.3s, transform 0.3s;\n }\n label.field.inline.radio input {\n transform: translate(-0.2em, 3px) scale(1);\n }\n\n label.field.radio {\n cursor: pointer;\n position: relative;\n }\n\n label.field.radio:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n margin: 2px 10px 2px 0;\n border: solid 2px; /* Safari */\n border-color: '+(n.fg||"#222")+';\n border-radius: 50%;\n width: 20px;\n height: 20px;\n vertical-align: middle;\n transition: border-color 0.2s;\n }\n\n label.field.radio:after {\n content: "";\n display: block;\n position: absolute;\n border-radius: 50%;\n width: 10px;\n height: 10px;\n background-color: '+(n.fga||"#07e")+";\n transform: translate(5px, -17px) scale(0);\n transition: transform 0.2s;\n }\n\n label.field.radio input:checked {\n background-color: "+(n.fga||"#07e")+";\n }\n\n label.field.radio.checked:before {\n border-color: "+(n.fga||"#07e")+";\n }\n\n label.field.radio.checked:after {\n transform: translate(5px, -17px) scale(1);\n }\n\n label.field.radio:hover input {\n opacity: 0.04;\n }\n\n label.field.radio input:focus {\n opacity: 0.12;\n transform: translate(-0.2em, 24px) scale(1);\n transition: transform 0.2s, opacity 0.2s;\n }\n label.field.inline.radio input:focus {\n transform: translate(-0.2em, 3px) scale(1);\n }\n\n label.field.radio:hover input:focus {\n opacity: 0.16;\n }\n\n label.field.radio input:active {\n opacity: 1;\n transform: translate(-0.2em, 24px) scale(0);\n transition: transform 0s, opacity 0s;\n }\n label.field.inline.radio input:active {\n transform: translate(-0.2em, 3px) scale(0);\n }\n\n label.field.radio.checked:before {\n border-color: "+(n.fga||"#07e")+";\n }\n\n label.field.radio.focus:before {\n border-color: "+(n.fga||"#07e")+";\n }\n\n label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.radio.disabled {\n color: "+(n.bc||"#ccc")+";\n cursor: initial;\n }\n\n label.field.radio.disabled:before {\n border-color: "+(n.bc||"#ccc")+";\n }\n\n label.field.radio.disabled:after {\n background-color: "+(n.bc||"#ccc")+";\n }\n\n\n\n label.field select {\n padding-right: 2em;\n }\n\n label.field.select {\n cursor: pointer;\n position: relative;\n }\n\n label.field.select:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n right: 19px;\n height: 0.6em;\n top: 2.6em;\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n pointer-events: none;\n color: "+(n.bc||"#ccc")+";\n }\n\n label.field textarea {\n border: none;"+(t?"\n padding: 0;":"")+"\n }\n\n label.field > select {\n -moz-appearance: none;\n -webkit-appearance: none;\n }\n\n label.field input:focus,\n label.field select:focus,\n label.field.file.focus:after\n {\n border-color: "+(i.fg||n.fga||"#07e")+";\n "+(t?"":"box-shadow: 0 0.0625em 0 0 "+(i.fg||n.fga||"#07e")+";")+"\n }\n\n label.field input[type=checkbox]:focus,\n label.field input[type=radio]:focus {\n box-shadow: none;\n }\n\n label.field.file.focus:after {\n color: "+(i.fg||n.fga||"#07e")+";\n }\n label.field.file [type=file] {\n position: absolute;\n width: 0;\n height: 0;\n opacity: 0;\n z-index: -1;\n }\n label.field.file {\n position: relative;\n min-width: 9em;\n height: 5em;\n }\n label.field.file:after {\n position: absolute;\n content: 'Choose a file';\n box-sizing: border-box;\n width: calc(100% - 0.3em);\n height: 2.5em;\n font-size: 1.1em;\n line-height: 1.5em;\n color: "+(n.fg||"#222")+";\n text-align: "+(t?"center":"left")+";\n padding: 0.5em "+(t?"0.5em":"0")+";\n cursor: pointer;\n font-style: oblique;\n left: 0.25em;\n top: 1.6em;\n transition: 0.2s ease-in-out;\n transition-property: color, border-bolor, box-shadow;"+(t?"\n border-radius: "+(n.radius||"0.2em")+";\n border-color: "+(n.bc||"#ccc")+";\n border-style: solid;\n border-width: 0.0625em;":"\n border-bottom-color: "+(n.bc||"#ccc")+";\n border-bottom-width: 0.0625em;\n border-bottom-style: solid;\n ")+"\n }\n label.field.file.inline:after {\n top: 0.2em;\n }\n\n label.field.button {\n vertical-align: top;\n padding-top: "+(t?"1.7":"1.958")+"em;\n }\n label.field .with-buttons button, label.field.button button {\n font-size: 1.1em;\n margin-top: "+(t?"0.15em":"0")+";\n }\n\n label.field .field-wrapper.with-buttons {\n display: flex;\n }\n label.field .with-buttons button {\n flex-shrink: 0;\n padding-left: 0.5em;\n padding-right: 0.5em;\n margin-top: 0;\n margin-right: 0;\n "+(t?"height: 2.5em;\n box-shadow: none;\n border-radius: 0;\n border-left: 1px solid "+(n.bg||"#fff")+";\n margin-left: 0;":"height: 2.25em;")+"\n }"+(t?"\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 "+(n.radius||"0.2em")+" "+(n.radius||"0.2em")+" 0;\n }\n label.field .with-buttons input {\n border-radius: "+(n.radius||"0.2em")+" 0 0 "+(n.radius||"0.2em")+";\n min-width: 0;\n }\n ":"")+"\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1."+(t?"15":"1")+"em;\n }\n\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: "+(n.fga||"#07e")+";\n color: "+(n.bg||"#fff;")+";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1.2em;\n text-align: center;\n margin-top: -0.2em;\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n "}function a(){}function o(e){~this.className.indexOf("focus")||(this.className+=" focus")}function r(e){this.className=this.className.replace(/\bfocus\b/g,"").trim()}function c(e){var n,i,t,l,c,d,f,s,b,p,u,m,h,g=this.getContext(e);function x(){var a=y().split(/\s+/).filter(function(e){return!!e});(n=!!~a.indexOf("field"))||(a.push("field"),n=!0),(i=e.querySelector("input[type=checkbox]"))&&!~a.indexOf("check")&&a.push("check"),(t=e.querySelector("input[type=radio]"))&&!~a.indexOf("radio")&&a.push("radio");var o=i||t;o&&o.checked&&!~a.indexOf("checked")&&a.push("checked"),o&&o.disabled&&!~a.indexOf("disabled")&&a.push("disabled"),!o&&p?(p.cancel(),p=0,u&&(u.disconnect(),u=0),delete o._form_callback,h&&(delete h.checked,m=h=void 0)):o&&(o._form_callback=function(n,i){if(void 0===i&&(i=!0),i&&"radio"===o.type&&o.name){var t=[];t.push.apply(t,document.querySelectorAll("input[type=radio][name="+o.name+"]")),(t=t.filter(function(e){return e!==o})).forEach(function(e){return e._form_callback&&e._form_callback(n,!1)})}var l=o.checked;l&&!~e.className.indexOf("checked")?e.className+=" checked":!l&&~e.className.indexOf("checked")&&(e.className=e.className.replace(/\bchecked\b/g,"").replace(/ +/g," ").trim())},MutationObserver&&(u=new MutationObserver(function(){var n;(n=o.disabled)&&!~e.className.indexOf("disabled")?e.className+=" disabled":!n&&~e.className.indexOf("disabled")&&(e.className=e.className.replace(/\bdisabled\b/g,"").replace(/ +/g," ").trim())})).observe(o,{attributes:!0}),p=this.getContext(o).listen("change",o._form_callback),(m=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(o),"checked"))&&m.configurable&&(h=o,Object.defineProperty(o,"checked",{get:m.get,set:function(e){m.set.call(h,e),o._form_callback()},enumerable:!0,configurable:!0}))),(l=!!e.querySelector("textarea"))&&!~a.indexOf("textarea")&&a.push("textarea"),(c=!!e.querySelector("select"))&&!~a.indexOf("select")&&a.push("select"),(d=!!e.querySelector("input[type=file]"))&&!~a.indexOf("file")&&a.push("file"),(f=!!(f=e.querySelector("button"))&&f.parentNode===e)&&!~a.indexOf("button")&&a.push("button"),(s=!!e.querySelector("div"))&&!~a.indexOf("plain")&&a.push("plain"),(b=!(i||t||d||!e.querySelector("input")))&&!~a.indexOf("input")&&a.push("input"),e.className=a.join(" ")}function y(){var a=e.className;return n||(a=a.replace(/\bfield\b/g,"").trim()),i||(a=a.replace(/\bcheck(ed)?\b/g,"").trim()),t||(a=a.replace(/\bradio\b/g,"").trim()),l||(a=a.replace(/\btextarea\b/g,"").trim()),c||(a=a.replace(/\bselect\b/g,"").trim()),d||(a=a.replace(/\bfile\b/g,"").trim()),f||(a=a.replace(/\bbutton\b/g,"").trim()),s||(a=a.replace(/\bplain\b/g,"").trim()),b||(a=a.replace(/\binput\b/g,"").trim()),a=a.replace(/ +/g," ")}var k=g.listen("focusin",o),v=g.listen("focusout",r);return x.call(this),{update:a,invalidate:x.bind(this),teardown:function(){var n=y();n=n.replace(/\bfocus\b/g,"").trim(),k.cancel(),v.cancel(),p&&p.cancel(),u&&u.disconnect(),h&&(delete h.checked,m=h=void 0),e.className=n}}}function d(e,n){if(!e)return!1;for(var i=0;i<e.length;i++){if(e[i].e===n)return!0;if(e[i].f&&d(e[i].f,n))return!0}return!1}c.style=l;var f=n.macro(function(e){var n=[],i=(e.template.m||[]).slice(),t=e.template.f||[],l=i.find(function(e){return"value"===e.n}),a=i.find(function(e){return"type"===e.n}),o=i.find(function(e){return"tip"===e.n});if(o&&i.splice(i.indexOf(o),1),a&&"function"==typeof f.types[a.f])n.push.apply(n,f.types[a.f](i,t,e));else if(l){var r={t:7,e:"input",m:[l]};if(d(t,"option")&&(r.e="select",r.f=t),a&&(r.m.push(a),"checkbox"===a.f||"radio"===a.f)){var c=i.find(function(e){return"target"===e.n});c?r.m.push(Object.assign({},c,{n:"name"})):r.m.splice(r.m.indexOf(l),1,Object.assign({},l,{n:"checked"}))}r.m=r.m.concat(i.filter(function(e){return 73===e.t||73===e.t||"placeholder"===e.n})),n.push(r);var s=t.filter(function(e){return"button"===e.e||d(e.f,"button")});s.length&&(n.push.apply(n,s),n=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:n}])}else{var b=t.filter(function(e){return e.e});b.find(function(e){return"button"===e.e})&&b.length>1?n=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:t}]:n.push.apply(n,t)}var p=i.find(function(e){return"label"===e.n});o&&n.unshift({t:7,e:"span",m:[{t:13,n:"class",f:"field-tip"+(p?"":" field-solo-tip"),g:1},{t:13,n:"title",f:o.f},{t:70,n:["click"],f:{r:[],s:"[false]"}}],f:"?"}),p?n.unshift(p.f):n.unshift(" ");var u={t:7,e:"label",m:[{t:71,n:"field"}].concat(i.filter(function(e){return 13!==e.t&&73!==e.t||"value"!==e.n&&"type"!==e.n&&"inline"!==e.n&&"label"!==e.n&&"placeholder"!==e.n&&"target"!==e.n})),f:n};i.find(function(e){return"inline"===e.n})&&u.m.push({t:13,n:"class",f:"inline"}),e.setTemplate([u])});function s(e){return"function"==typeof e.focus&&e.focus(),{teardown:a}}function b(e){return void 0===e&&(e={}),function(n){var i=n.Ractive,t=n.instance;if(!i.isInstance(t)&&e.includeStyle)if(t===i)i.addCSS("form-decorator",l);else{var a=t.css;t.css=function(e){return("function"!=typeof a?a||"":a(e))+l(e)}}t.partials[e.name||"field"]=f,t.decorators[e.name||"field"]=c,t.decorators[e.autofocusName||"autofocus"]=s}}f.types={},t("field","decorators",c),t("field","partials",f),t("autofocus","decorators",s),e.style=l,e.field=c,e.macro=f,e.autofocus=s,e.plugin=b,e.default=b,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],n):n(e.RMForm={},e.Ractive)}(this,function(e,n){"use strict";n=n&&n.hasOwnProperty("default")?n.default:n;var i="undefined"!=typeof window?window:null;function t(e,n,t){if(i&&i.Ractive&&"object"==typeof i.Ractive[n]){var l=document.currentScript;if(l||(l=(l=document.querySelectorAll("script"))[l.length-1]),l){var a=l.getAttribute("data-alias");a&&(a=(a=a.split("&")).reduce(function(e,n){var i=n.split("="),t=i[0],l=i[1];return e[t]=l,e},{})),Ractive[n][a&&a[e]||e]=t}}}function l(e){var n=Object.assign({},e("raui.primary"),e("raui.form.primary")),i=Object.assign({},e("raui.primary.active"),e("raui.form.primary.active")),t=e("raui.form.boxy");return"\n label.field {\n display: inline-block;\n font-size: 0.9em;\n font-weight: 500;\n color: "+(n.fg||"#222")+";\n transition: 0.2s ease-in-out;\n transition-property: color;\n vertical-align: top;\n box-sizing: border-box;\n padding: 0.25em 0.5em;\n line-height: 1.5em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: inherit;\n }\n\n label.field.textarea {\n display: block;\n border: 0.0625em solid "+(n.bc||"#ccc")+";\n padding: 0.5em 0.8em 0.8em 0.8em;\n border-radius: "+(n.radius||"0.2em")+";\n box-shadow: none;\n transition-property: color, border-color, box-shadow;\n margin: 0.8em 0.2em;\n min-height: auto;\n background-color: "+(t?n.bg||"#fff":"transparent")+";\n }\n\n label.field.focus {\n color: "+(i.fg||n.fga||"#07e")+";\n }\n\n label.field.textarea.focus {\n border-color: "+(i.fg||n.fga||"#07e")+";\n "+(t?"":"box-shadow: 0.0625em 0.0625em "+(i.fg||n.fga||"#07e")+",\n -0.0625em 0.0625em "+(i.fg||n.fga||"#07e")+",\n 0.0625em -0.0625em "+(i.fg||n.fga||"#07e")+",\n -0.0625em -0.0625em "+(i.fg||n.fga||"#07e")+";")+"\n }\n\n label.field input,\n label.field select,\n label.field textarea\n {\n display: block;\n border-width: "+(t?"0.0625em":"0 0 0.0625em 0")+";\n border-color: "+(n.bc||"#ccc")+";\n border-style: solid;\n box-sizing: border-box;\n background-color: "+(t?n.bg||"#fff":"transparent")+";\n transition: 0.2s ease-in-out;\n transition-property: box-shadow, color;\n outline: none;\n box-shadow: none;\n width: 100%;\n margin-bottom: 0.8em;\n font-size: 1.1em;"+(t?"\n border-radius: "+(n.radius||"0.2em")+";":"")+"\n font-weight: 400;\n font-family: inherit;\n }\n\n label.field input"+(t?"":":disabled")+",\n label.field select"+(t?"":":disabled")+" {\n padding: 0 0.75em;\n }\n label.field select"+(t?"":":disabled")+" {\n padding-right: 2em;\n }\n\n label.field input:disabled,\n label.field select:disabled,\n label.field textarea:disabled {\n background: #f4f4f4;\n }\n\n label.field textarea {\n line-height: 1.2em;\n }\n label.field .field-wrapper {\n display: block;\n }\n label.field > select, label.field > input,\n label.field > .field-wrapper > input, label.field > .field-wrapper > select {\n height: 2.5em;\n }\n\n "+(t?"":"label.field:hover > input,\n label.field:hover select,\n label.field.file:hover:after {\n box-shadow: 0 0.0625em 0 0 "+(n.bc||"#ccc")+";\n }\n\n label.field.textarea:hover {\n box-shadow: 0.0625em 0.0625em "+(n.bc||"#ccc")+",\n -0.0625em 0.0625em "+(n.bc||"#ccc")+",\n 0.0625em -0.0625em "+(n.bc||"#ccc")+",\n -0.0625em -0.0625em "+(n.bc||"#ccc")+";\n }\n\n label.field.textarea.focus:hover {\n box-shadow: 0.0625em 0.0625em "+(i.fg||n.fga||"#07e")+",\n -0.0625em 0.0625em "+(i.fg||n.fga||"#07e")+",\n 0.0625em -0.0625em "+(i.fg||n.fga||"#07e")+",\n -0.0625em -0.0625em "+(i.fg||n.fga||"#07e")+";\n }")+"\n\n /**** CHECK BOXES ****/\n\n label.field.check {\n position:relative;\n z-index: 0;\n overflow: visible;\n cursor: pointer;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.check.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: -3px;\n top: 23px;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n background-color: "+(n.bc||"#ccc")+";\n box-shadow: none;\n outline: none;\n opacity: 0;\n transform: scale(1);\n pointer-events: none;\n transition: opacity 0.3s, transform 0.2s;\n }\n label.field.inline.check input {\n top: 3px;\n left: -3px;\n }\n\n label.field.check input:checked {\n background-color: "+(n.fga||"#07e")+';\n }\n\n label.field.check:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n margin: 3px 11px 3px 1px;\n border: solid 2px; /* Safari */\n border-color: '+(n.fg||"#222")+';\n border-radius: 2px;\n width: 18px;\n height: 18px;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after {\n content: "";\n display: block;\n position: absolute;\n top: 0px;\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.8em, 2.65em) rotate(-45deg);\n }\n\n label.field.check.inline:after {\n transform: translate(0.8em, 1.2em) rotate(-45deg);\n }\n\n label.field.check.checked:before {\n border-color: '+(n.fga||"#07e")+";\n background-color: "+(n.fga||"#07e")+";\n }\n label.field.check.focus:before {\n border-color: "+(n.fga||"#07e")+";\n }\n\n label.field.check.checked:after {\n border-color: "+(n.bg||"#fff")+";\n }\n\n label.field.check input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled {\n color: "+(n.bc||"#ccc")+";\n cursor: initial;\n }\n\n label.field.check.disabled:before {\n border-color: "+(n.bc||"#ccc")+";\n }\n\n label.field.check.checked.disabled:before {\n border-color: transparent;\n background-color: "+(n.bc||"#ccc")+";\n }\n\n\n /**** RADIO BUTTONS ****/\n \n label.field.radio {\n z-index: 0;\n position: relative;\n display: inline-block;\n overflow: visible;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.radio.inline {\n padding-top: 0.8em;\n }\n\n label.field.radio input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: 0;\n top: 0;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 41px;\n height: 40px;\n background-color: "+(n.bc||"#ccc")+';\n outline: none;\n opacity: 0;\n pointer-events: none;\n transform: translate(-0.2em, 24px) scale(1);\n transition: opacity 0.3s, transform 0.3s;\n }\n label.field.inline.radio input {\n transform: translate(-0.2em, 3px) scale(1);\n }\n\n label.field.radio {\n cursor: pointer;\n position: relative;\n }\n\n label.field.radio:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n margin: 2px 10px 2px 0;\n border: solid 2px; /* Safari */\n border-color: '+(n.fg||"#222")+';\n border-radius: 50%;\n width: 20px;\n height: 20px;\n vertical-align: middle;\n transition: border-color 0.2s;\n }\n\n label.field.radio:after {\n content: "";\n display: block;\n position: absolute;\n border-radius: 50%;\n width: 10px;\n height: 10px;\n background-color: '+(n.fga||"#07e")+";\n transform: translate(5px, -17px) scale(0);\n transition: transform 0.2s;\n }\n\n label.field.radio input:checked {\n background-color: "+(n.fga||"#07e")+";\n }\n\n label.field.radio.checked:before {\n border-color: "+(n.fga||"#07e")+";\n }\n\n label.field.radio.checked:after {\n transform: translate(5px, -17px) scale(1);\n }\n\n label.field.radio:hover input {\n opacity: 0.04;\n }\n\n label.field.radio input:focus {\n opacity: 0.12;\n transform: translate(-0.2em, 24px) scale(1);\n transition: transform 0.2s, opacity 0.2s;\n }\n label.field.inline.radio input:focus {\n transform: translate(-0.2em, 3px) scale(1);\n }\n\n label.field.radio:hover input:focus {\n opacity: 0.16;\n }\n\n label.field.radio input:active {\n opacity: 1;\n transform: translate(-0.2em, 24px) scale(0);\n transition: transform 0s, opacity 0s;\n }\n label.field.inline.radio input:active {\n transform: translate(-0.2em, 3px) scale(0);\n }\n\n label.field.radio.checked:before {\n border-color: "+(n.fga||"#07e")+";\n }\n\n label.field.radio.focus:before {\n border-color: "+(n.fga||"#07e")+";\n }\n\n label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.radio.disabled {\n color: "+(n.bc||"#ccc")+";\n cursor: initial;\n }\n\n label.field.radio.disabled:before {\n border-color: "+(n.bc||"#ccc")+";\n }\n\n label.field.radio.disabled:after {\n background-color: "+(n.bc||"#ccc")+";\n }\n\n\n\n label.field select {\n padding-right: 2em;\n }\n\n label.field.select {\n cursor: pointer;\n position: relative;\n }\n\n label.field.select:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n right: 19px;\n height: 0.6em;\n top: 2.6em;\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n pointer-events: none;\n color: "+(n.bc||"#ccc")+";\n }\n\n label.field textarea {\n border: none;"+(t?"\n padding: 0;":"")+"\n }\n\n label.field > select {\n -moz-appearance: none;\n -webkit-appearance: none;\n }\n\n label.field input:focus,\n label.field select:focus,\n label.field.file.focus:after\n {\n border-color: "+(i.fg||n.fga||"#07e")+";\n "+(t?"":"box-shadow: 0 0.0625em 0 0 "+(i.fg||n.fga||"#07e")+";")+"\n }\n\n label.field input[type=checkbox]:focus,\n label.field input[type=radio]:focus {\n box-shadow: none;\n }\n\n label.field.file.focus:after {\n color: "+(i.fg||n.fga||"#07e")+";\n }\n label.field.file [type=file] {\n position: absolute;\n width: 0;\n height: 0;\n opacity: 0;\n z-index: -1;\n }\n label.field.file {\n position: relative;\n min-width: 9em;\n height: 5em;\n }\n label.field.file:after {\n position: absolute;\n content: 'Choose a file';\n box-sizing: border-box;\n width: calc(100% - 0.3em);\n height: 2.5em;\n font-size: 1.1em;\n line-height: 1.5em;\n color: "+(n.fg||"#222")+";\n text-align: "+(t?"center":"left")+";\n padding: 0.5em "+(t?"0.5em":"0")+";\n cursor: pointer;\n font-style: oblique;\n left: 0.25em;\n top: 1.6em;\n transition: 0.2s ease-in-out;\n transition-property: color, border-bolor, box-shadow;"+(t?"\n border-radius: "+(n.radius||"0.2em")+";\n border-color: "+(n.bc||"#ccc")+";\n border-style: solid;\n border-width: 0.0625em;":"\n border-bottom-color: "+(n.bc||"#ccc")+";\n border-bottom-width: 0.0625em;\n border-bottom-style: solid;\n ")+"\n }\n label.field.file.inline:after {\n top: 0.2em;\n }\n\n label.field.button {\n vertical-align: top;\n padding-top: "+(t?"1.7":"1.958")+"em;\n }\n label.field .with-buttons button, label.field.button button {\n font-size: 1.1em;\n margin-top: "+(t?"0.15em":"0")+";\n }\n\n label.field .field-wrapper.with-buttons {\n display: flex;\n }\n label.field .with-buttons button {\n flex-shrink: 0;\n padding-left: 0.5em;\n padding-right: 0.5em;\n margin-top: 0;\n margin-right: 0;\n "+(t?"height: 2.5em;\n box-shadow: none;\n border-radius: 0;\n border-left: 1px solid "+(n.bg||"#fff")+";\n margin-left: 0;":"height: 2.25em;")+"\n }"+(t?"\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 "+(n.radius||"0.2em")+" "+(n.radius||"0.2em")+" 0;\n }\n label.field .with-buttons input {\n border-radius: "+(n.radius||"0.2em")+" 0 0 "+(n.radius||"0.2em")+";\n min-width: 0;\n }\n ":"")+"\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n font-weight: normal;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1."+(t?"15":"1")+"em;\n }\n\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: "+(n.fga||"#07e")+";\n color: "+(n.bg||"#fff;")+";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1.2em;\n text-align: center;\n margin-top: -0.2em;\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n "}function a(){}function o(e){~this.className.indexOf("focus")||(this.className+=" focus")}function r(e){this.className=this.className.replace(/\bfocus\b/g,"").trim()}function c(e){var n,i,t,l,c,d,f,s,b,p,u,m,h,g=this.getContext(e);function x(){var a=y().split(/\s+/).filter(function(e){return!!e});(n=!!~a.indexOf("field"))||(a.push("field"),n=!0),(i=e.querySelector("input[type=checkbox]"))&&!~a.indexOf("check")&&a.push("check"),(t=e.querySelector("input[type=radio]"))&&!~a.indexOf("radio")&&a.push("radio");var o=i||t;o&&o.checked&&!~a.indexOf("checked")&&a.push("checked"),o&&o.disabled&&!~a.indexOf("disabled")&&a.push("disabled"),!o&&p?(p.cancel(),p=0,u&&(u.disconnect(),u=0),delete o._form_callback,h&&(delete h.checked,m=h=void 0)):o&&(o._form_callback=function(n,i){if(void 0===i&&(i=!0),i&&"radio"===o.type&&o.name){var t=[];t.push.apply(t,document.querySelectorAll("input[type=radio][name="+o.name+"]")),(t=t.filter(function(e){return e!==o})).forEach(function(e){return e._form_callback&&e._form_callback(n,!1)})}var l=o.checked;l&&!~e.className.indexOf("checked")?e.className+=" checked":!l&&~e.className.indexOf("checked")&&(e.className=e.className.replace(/\bchecked\b/g,"").replace(/ +/g," ").trim())},MutationObserver&&(u=new MutationObserver(function(){var n;(n=o.disabled)&&!~e.className.indexOf("disabled")?e.className+=" disabled":!n&&~e.className.indexOf("disabled")&&(e.className=e.className.replace(/\bdisabled\b/g,"").replace(/ +/g," ").trim())})).observe(o,{attributes:!0}),p=this.getContext(o).listen("change",o._form_callback),(m=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(o),"checked"))&&m.configurable&&(h=o,Object.defineProperty(o,"checked",{get:m.get,set:function(e){m.set.call(h,e),o._form_callback()},enumerable:!0,configurable:!0}))),(l=!!e.querySelector("textarea"))&&!~a.indexOf("textarea")&&a.push("textarea"),(c=!!e.querySelector("select"))&&!~a.indexOf("select")&&a.push("select"),(d=!!e.querySelector("input[type=file]"))&&!~a.indexOf("file")&&a.push("file"),(f=!!(f=e.querySelector("button"))&&f.parentNode===e)&&!~a.indexOf("button")&&a.push("button"),(s=!!e.querySelector("div"))&&!~a.indexOf("plain")&&a.push("plain"),(b=!(i||t||d||!e.querySelector("input")))&&!~a.indexOf("input")&&a.push("input"),e.className=a.join(" ")}function y(){var a=e.className;return n||(a=a.replace(/\bfield\b/g,"").trim()),i||(a=a.replace(/\bcheck(ed)?\b/g,"").trim()),t||(a=a.replace(/\bradio\b/g,"").trim()),l||(a=a.replace(/\btextarea\b/g,"").trim()),c||(a=a.replace(/\bselect\b/g,"").trim()),d||(a=a.replace(/\bfile\b/g,"").trim()),f||(a=a.replace(/\bbutton\b/g,"").trim()),s||(a=a.replace(/\bplain\b/g,"").trim()),b||(a=a.replace(/\binput\b/g,"").trim()),a=a.replace(/ +/g," ")}var k=g.listen("focusin",o),v=g.listen("focusout",r);return x.call(this),{update:a,invalidate:x.bind(this),teardown:function(){var n=y();n=n.replace(/\bfocus\b/g,"").trim(),k.cancel(),v.cancel(),p&&p.cancel(),u&&u.disconnect(),h&&(delete h.checked,m=h=void 0),e.className=n}}}function d(e,n){if(!e)return!1;for(var i=0;i<e.length;i++){if(e[i].e===n)return!0;if(e[i].f&&d(e[i].f,n))return!0}return!1}c.style=l;var f=n.macro(function(e){var n=[],i=(e.template.m||[]).slice(),t=e.template.f||[],l=i.find(function(e){return"value"===e.n}),a=i.find(function(e){return"type"===e.n}),o=i.find(function(e){return"tip"===e.n});if(o&&i.splice(i.indexOf(o),1),a&&"function"==typeof f.types[a.f])n.push.apply(n,f.types[a.f](i,t,e));else if(l){var r={t:7,e:"input",m:[l]};if(d(t,"option")&&(r.e="select",r.f=t),a&&(r.m.push(a),"checkbox"===a.f||"radio"===a.f)){var c=i.find(function(e){return"target"===e.n});c?r.m.push(Object.assign({},c,{n:"name"})):r.m.splice(r.m.indexOf(l),1,Object.assign({},l,{n:"checked"}))}r.m=r.m.concat(i.filter(function(e){return 73===e.t||73===e.t||"placeholder"===e.n})),n.push(r);var s=t.filter(function(e){return"button"===e.e||d(e.f,"button")});s.length&&(n.push.apply(n,s),n=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:n}])}else{var b=t.filter(function(e){return e.e});b.find(function(e){return"button"===e.e})&&b.length>1?n=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:t}]:n.push.apply(n,t)}var p=i.find(function(e){return"label"===e.n});o&&n.unshift({t:7,e:"span",m:[{t:13,n:"class",f:"field-tip"+(p?"":" field-solo-tip"),g:1},{t:13,n:"title",f:o.f},{t:70,n:["click"],f:{r:[],s:"[false]"}}],f:"?"}),p?n.unshift(p.f):n.unshift(" ");var u={t:7,e:"label",m:[{t:71,n:"field"}].concat(i.filter(function(e){return 13!==e.t&&73!==e.t||"value"!==e.n&&"type"!==e.n&&"inline"!==e.n&&"label"!==e.n&&"placeholder"!==e.n&&"target"!==e.n})),f:n};i.find(function(e){return"inline"===e.n})&&u.m.push({t:13,n:"class",f:"inline"}),e.setTemplate([u])});function s(e){return"function"==typeof e.focus&&e.focus(),{teardown:a}}function b(e){return void 0===e&&(e={}),function(n){var i=n.Ractive,t=n.instance;if(!i.isInstance(t)&&e.includeStyle)if(t===i)i.addCSS("form-decorator",l);else{var a=t.css;t.css=function(e){return("function"!=typeof a?a||"":a(e))+l(e)}}t.partials[e.name||"field"]=f,t.decorators[e.name||"field"]=c,t.decorators[e.autofocusName||"autofocus"]=s}}f.types={},t("field","decorators",c),t("field","partials",f),t("autofocus","decorators",s),e.style=l,e.field=c,e.macro=f,e.autofocus=s,e.plugin=b,e.default=b,Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -23,8 +23,8 @@ (function (global, factory) { | ||
if (node.scrollTop <= allow) { str += ' top'; } | ||
else if (node.scrollTop >= node.scrollHeight - node.clientHeight - allow) { str += ' bottom'; } | ||
else { str += ' vmiddle'; } | ||
if (node.scrollTop >= node.scrollHeight - node.clientHeight - allow) { str += ' bottom'; } | ||
if (!~str.indexOf('top') && !~str.indexOf('bottom')) { str += ' vmiddle'; } | ||
if (node.scrollLeft <= allow) { str += ' left'; } | ||
else if (node.scrollLeft >= node.scrollWidth - node.clientWidth - allow) { str += ' right'; } | ||
else { str += ' hmiddle'; } | ||
if (node.scrollLeft >= node.scrollWidth - node.clientWidth - allow) { str += ' right'; } | ||
else if (!~str.indexOf('left') && !~str.indexOf('right')) { str += ' hmiddle'; } | ||
@@ -31,0 +31,0 @@ ctx.set(bind, str); |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.RMScrolled={})}(this,function(e){"use strict";function t(e,t){void 0===t&&(t={});var o="string"==typeof t?t:t.bind;if("string"!=typeof o)return{teardown:function(){}};var n=t.allow||2,i=this.getContext(e);function l(){var t="";e.scrollHeight>e.clientHeight&&(t+="vscroll"),e.scrollWidth>e.clientWidth&&(t+=(t?" ":"")+"hscroll"),e.scrollTop<=n?t+=" top":e.scrollTop>=e.scrollHeight-e.clientHeight-n?t+=" bottom":t+=" vmiddle",e.scrollLeft<=n?t+=" left":e.scrollLeft>=e.scrollWidth-e.clientWidth-n?t+=" right":t+=" hmiddle",i.set(o,t)}return e.addEventListener("scroll",l,{passive:!0}),requestAnimationFrame(l),{refresh:l,teardown:function(){e.removeEventListener("scroll",l)}}}function o(e){return void 0===e&&(e={}),function(o){o.instance.decorators[e.name||"scrolled"]=t}}e.scrolled=t,e.plugin=o,e.default=o,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.RMScrolled={})}(this,function(e){"use strict";function t(e,t){void 0===t&&(t={});var o="string"==typeof t?t:t.bind;if("string"!=typeof o)return{teardown:function(){}};var n=t.allow||2,i=this.getContext(e);function l(){var t="";e.scrollHeight>e.clientHeight&&(t+="vscroll"),e.scrollWidth>e.clientWidth&&(t+=(t?" ":"")+"hscroll"),e.scrollTop<=n&&(t+=" top"),e.scrollTop>=e.scrollHeight-e.clientHeight-n&&(t+=" bottom"),~t.indexOf("top")||~t.indexOf("bottom")||(t+=" vmiddle"),e.scrollLeft<=n&&(t+=" left"),e.scrollLeft>=e.scrollWidth-e.clientWidth-n?t+=" right":~t.indexOf("left")||~t.indexOf("right")||(t+=" hmiddle"),i.set(o,t)}return e.addEventListener("scroll",l,{passive:!0}),requestAnimationFrame(l),{refresh:l,teardown:function(){e.removeEventListener("scroll",l)}}}function o(e){return void 0===e&&(e={}),function(o){o.instance.decorators[e.name||"scrolled"]=t}}e.scrolled=t,e.plugin=o,e.default=o,Object.defineProperty(e,"__esModule",{value:!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 c(e,t){var r,i,c=this.getContext(e),f=this,d=t||{};function u(t){if("number"==typeof d.offset&&(t-=d.offset),!d.type||"class"===d.type){var n,i=e.className,o=-1;for(var a in r)l[a].lastIndex=-1,r[a]<=t?(l[a].test(i)||(i+=" "+a),r[a]>o&&(o=r[a],n=a)):i=i.replace(l[a],"").trim();if(e.className=i.replace(s," "),!n)return;d.value&&c.set(d.value,o),d.name&&c.set(d.name,n),d.size&&c.set(d.size,t)}}function p(){var t=(n||(n=document.createElement("div"),document.body.appendChild(n)),n);for(var o in i=f.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 h=this.observe("@style.break",p,{init:!1}),b=c.observe("@local.width",u,{init:!1}),g=o.call(this,e,{clientWidth:"@local.width"});return e.className+=" grid grid-root",d.immediate?p():requestAnimationFrame(p),{update:function(t){d=t||{},requestAnimationFrame(function(){return u(e.clientWidth)})},teardown:function(){e.className=e.className.replace(l["grid grid-root"],"").trim(),b.cancel(),h.cancel(),g.teardown()}}}function f(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}c.style=f,i("grid","decorators",c);var d=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 p(n.getContext(t),a.delay||d,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 p=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 h(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+=" vmiddle",e.scrollLeft<=r?t+=" left":e.scrollLeft>=e.scrollWidth-e.clientWidth-r?t+=" right":t+=" hmiddle",i.set(n,t)}return e.addEventListener("scroll",o,{passive:!0}),requestAnimationFrame(o),{refresh:o,teardown:function(){e.removeEventListener("scroll",o)}}}p.prototype.subscribe=function(e,t,n){(this.fires[e+","+t]||(this.fires[e+","+t]=[])).push(n),this.refs++},p.prototype.unsubscribe=function(e,t,n){var r=this.fires[e+","+t]||[];r.splice(r.indexOf(n),1),this.refs--,this.refs||this.teardown()},p.prototype.bind=function(){window.PointerEvent||window.navigator.pointerEnabled?this.context.listen("pointerdown",h):window.navigator.msPointerEnabled?this.context.listen("MSPointerDown",h):(this.context.listen("mousedown",h),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)},p.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},p.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}},p.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),c()):c()},s=function(e){1===e.touches.length&&e.touches[0].identifier===a||c();var t=e.touches[0];(Math.abs(t.clientX-i)>=5||Math.abs(t.clientY-o)>=5)&&c()},c=function(){t&&clearTimeout(t),n.node.removeEventListener("touchend",l,!1),window.removeEventListener("touchmove",s,!1),window.removeEventListener("touchcancel",c,!1)};return this.node.addEventListener("touchend",l,!1),window.addEventListener("touchmove",s,!1),window.addEventListener("touchcancel",c,!1),t=setTimeout(function(){c(),n.fire(e,i,o,!0)},400),this.bubble||e.stopPropagation(),this.bubble},p.prototype.teardown=function(){var e=this.context;e.unlisten("pointerdown",h),e.unlisten("MSPointerDown",h),e.unlisten("mousedown",h),e.unlisten("touchstart",b),e.unlisten("focus",g),delete this.node.__r_clicks__},i("expand","transitions",x);var _=/^([-+])?([^\s]+)$/;function y(e){return"string"==typeof e}function k(e){return"number"==typeof e}function O(e){return"object"==typeof e}function A(e){return"object"==typeof e&&"RegExp"===Object.prototype.toString.call(e)}var S,P,E=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}};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.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._setSort=function(e,t){var n=this.get("columns."+e);if(n&&(n.sort||n.filter)){var r=n.sort||n.filter,i=r;y(i)&&"~"===i[0]&&(i=this.get(i));var o=t.ctrlKey,a=this.get("sort");if(Array.isArray(i)||(i=[i]),a?Array.isArray(a)||(a=[a]):a=[],a.length){var l=a.map(function(e){return _.exec(e).slice(1)}),s=i.reduce(function(e,t){return e&&!!l.find(function(e){return e[1]===t})},!0);s&&a.length!==i.length&&!o?this.set("sort",i.map(function(e){return"+"+i})):o?s?this.set("sort",l.map(function(e){return~i.indexOf(e[1])?("+"===e[0]?"-":"+")+e[1]:e[0]+e[1]})):this.set("sort",a.concat(i.map(function(e){return""+(e===r&&n.dir||"+")+e}))):s?this.set("sort",l.map(function(e){return("+"===e[0]?"-":"+")+e[1]})):this.set("sort",i.map(function(e){return""+(e===r&&n.dir||"+")+e}))}else this.set("sort",i.map(function(e){return""+(e===r&&n.dir||"+")+e}))}},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))},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)},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},Object.defineProperties(t.prototype,n),t}(t);function L(e,n){if(e&&n){if("function"==typeof n.get)return n.get;var r=e._getters||(e._getters={}),i=n.filter;y(i)&&0===i.indexOf("~/")&&(i=e.get(i));var o=Array.isArray(i)?i.join("."):!!y(i)&&i;if(o){if(!r[o])if(y(i)&&~i.indexOf("*")){var a=t.splitKeypath(i);r[o]=function(e){var t=T(e,a);return t.v||t.l}}else y(i)&&(i=t.splitKeypath(i)),r[o]=function(e){return j(e,i)};return r[o]}}}function H(e,n){if(e&&n){if("function"==typeof n.get)return n.get;var r=e._getters||(e._getters={}),i=n.path;y(i)&&0===i.indexOf("~/")&&(i=e.get(i));var o=Array.isArray(i)?i.join("."):!!y(i)&&i;if(o){if(!r[o])if(y(i)&&~i.indexOf("*")){var a=t.splitKeypath(i);r[o]=function(e){var t=T(e,a);return t.v||t.l}}else y(i)&&(i=t.splitKeypath(i)),r[o]=function(e){return j(e,i)};return r[o]}return y(i=n.value)&&0===i.indexOf("~/")&&(i=e.get(i)),"function"==typeof i?i:void 0}}function j(e,t){if(!t.length||e||"object"==typeof e){for(var n=e,r=0;r<t.length;r++)if("object"!=typeof(n=n[t[r]])||!n)return r+1<t.length?void 0:n;return n}}function T(e,t){if(!t.length)return{v:e};if(t.length&&"object"!=typeof e)return{n:1};var n=t[0];if("*"===n&&Array.isArray(e)){var r=t.slice(1);return{l:e.reduce(function(e,t){var n=T(t,r);return O(n)?n.v?e.push(n.v):n.l?e.push.apply(e,n.l):n.n||e.push(n):e.push(n),e},[])}}return T(e[n],t.slice(1))}function z(e,t){return e<t?-1:e>t?1:e==t?0:!e&&t?-1:e&&!t?1:0}E.settings={valign:"center",border:!1,"fixed-header":!0,"allow-select":!0,"allow-select-all":!0,"auto-titles":!1,paginate:"virtual"},t.extendWith(E,{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",t:13,f:[{t:2,x:{r:["~/scroll"],s:'!~(_0||"").indexOf("top")'}}]},{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:8,r:"grid-head"}]}],n:50,x:{r:["~/noHeader","~/fixedHeader"],s:"!_0&&_1"}}," ",{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"],s:"!_0&&_1"}},{t:4,f:[{n:"scrollheader",t:71}],n:50,x:{r:["~/fixedHeader","~/noWrap"],s:"_0&&_1"}}],f:[{t:7,e:"div",m:[{n:"grid",t:71,f:{r:[],s:'[{size:"~/tableWidth"}]'}},{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: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:{r:"~/shuffle"}}],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:8,r:"pagination"}],n:50,x:{r:["~/paginate"],s:'_0!=="virtual"'}}]}],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==="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":function(e,t){return!e&&t},'[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]':function(){return[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]},'["~/scroll"]':function(){return["~/scroll"]},"_0&&_1":function(e,t){return e&&t},'[{size:"~/tableWidth"}]':function(){return[{size:"~/tableWidth"}]},"!_0&&!_1":function(e,t){return!e&&!t},"!_0":function(e){return!e},'_0!=="virtual"':function(e){return"virtual"!==e},"(_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-bottom",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:{}},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-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 .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 \n .rtable-border .rtable-row-wrap {\n border-width: 0 1px 1px 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 1px;\n margin-left: -1px;\n width: 100%;\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||"#dedede")+";\n }\n .rtable-header-fixed {\n line-height: 1em;\n }\n \n .rtable-header.rtable-row-wrap {\n border-bottom: 2px solid "+(r.divider||t.bc||"#ccc")+";\n }\n \n .rtable-top {\n flex-grow: 5;\n flex-shrink: 1;\n overflow-y: auto;\n margin: 0.5em 0;\n position: relative;\n }\n .rtable-fixed-header .rtable-header {\n margin-top: 0.5em;\n position: relative;\n z-index: 2;\n }\n .rtable-fixed-header.rtable-scrolled .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);\n z-index: 3;\n }\n .rtable-fixed-header .rtable-top {\n margin-top: 0;\n }\n .rtable-nowrap.rtable-fixed-header .rtable-top {\n margin-top: -3px;\n }\n .rtable-with-select.rtable-nowrap.rtable-fixed-header .rtable-top {\n margin-top: 0px;\n }\n .rtable-nowrap.rtable-fixed-header .rtable-header-fixed {\n flex-shrink: 0;\n width: 100%;\n overflow-x: auto;\n scrollbar-width: none;\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: 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: 2.1em;\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: calc(2.1em + 1px);\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 left: 0.1em;\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-bottom {\n display: flex;\n flex-wrap: wrap;\n flex-shrink: 0;\n padding: 0 0.5em 0.5em 0.5em;\n justify-content: space-between;\n user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n }\n \n .rtable-bottom > * {\n padding: 0.5em;\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: 0;\n left: 0;\n border-radius: 2em;\n transform: translate(-0.1em, 0) scale(1);\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: 1;\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: translate(0.2em, -0.3em) 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: translate(0.2em, -0.3em) 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: 4px;\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: 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")?f(e):"")}.call(this,e)].join(" ")},cssId:"rtable",noCssTransform:!0,attributes:["paginate","items","filter","sort","helpers","fixed","allow-select","allow-select-all","border","fixed-header","valign","no-header","empty","shuffle","no-wrap"],components:{table:!1,Table:!1},syncComputedChildren:!0,decorators:{grid:c,sized:o,scrollheader:function(e){var t=this,n=function(e){requestAnimationFrame(function(){return t.find(".rtable-header-fixed").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===P&&(P={}),function(e){e.instance.transitions[P.name||"expand"]=x}),(void 0===S&&(S={}),function(e){e.instance.decorators[S.name||"scrolled"]=w})],on:{construct:function(){var e,t,n,r,i,o=this.component;if(!o)return;var a=o.template.f||[],l=o.template.m?o.template.m.slice():[],s=o.template;o.template={e:s.e,f:s.f,t:s.t,m:l};var c=0;function f(e,t,n){if(e&&e.f&&1===e.f.length&&2===e.f[0].t){var r="_a"+c++;return l.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 d(e){var t=[],n=[];return e.forEach(function(e){if("column"===e.e||"col"===e.e){var r,i={},o=e.m||C;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}))&&y(r.f)&&(i.id=r.f),i.label=o.find(function(e){return"label"===e.n}),i.label&&i.label.f&&(i.label=f(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=f(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=f(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=f(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&&O(i.hidden.f)?i.hidden=f(i.hidden):i.hidden=!1,y(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&&O(i.noPad.f)?i.noPad=f(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&&O(i.editable.f)?i.editable=f(i.editable):i.editable=!1,i.valign=o.find(function(e){return"valign"===e.n}),i.valign&&O(i.valign.f)?i.valign=f(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&&O(i.fixed.f)?i.fixed=f(i.fixed):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=f(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!~R.indexOf(e.n)}),i.attrs.forEach(function(e,t){N.test(e.n)&&(i.attrs[t]={t:13,n:"class-"+e.n})})}else if("field"===e.e){var l,s={},c=e.m||C;if(y(l=c.find(function(e){return"path"===e.n}))?s.path=l:l&&l.f&&(s.path=f(l)),(l=c.find(function(e){return"value"===e.n}))&&l.f&&(s.value=f(l)),y(l=c.find(function(e){return"type"===e.n}))?s.type=l:l&&l.f&&(s.type=f(l)),y((l=c.find(function(e){return"id"===e.n})).f)&&(s.id=l.f),y(l=c.find(function(e){return"dir"===e.n}))?s.dir=l:l&&y(l.f)&&(s.dir=l.f),y(l=c.find(function(e){return"label"===e.n}))?s.label=l:l&&l.f&&(s.label=f(l)),(l=c.find(function(e){return"get"===e.n}))&&l.f){var d=f(l,!1,!0);s.get=function(e){var t=this.get(d);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=a.find(function(e){return"expand"===e.e}),t=a.find(function(e){return"group"===e.e}),n=a.find(function(e){return"wrapper"===e.e}),r=a.find(function(e){return"row"===e.e}),this._init={sets:d(a),partials:{}};var u=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;var p=[{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:u.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"}]};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&&(n.m.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:"~/columns."+t+".fixed"}]}),n.m.push({t:4,n:50,x:{r:["~/noWrap","~/columns."+t+".fixed"],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:"~/columns."+t+".fixed"}]}]}));var r=n;return e.hidden&&e.hidden.r&&(r={t:4,n:51,r:e.hidden.r,f:[n]}),r}),m:[{t:13,n:"class-row"}]}]}];p[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 h,b=[{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:u.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:"."}}]}];e.attrs.length?(e.attrsP=e.attrs,e.attrs=[{t:16,r:"~/columns."+t+".attrsP",c:{r:"."}}]):e.attrs=[];var r=e.attrs;if(e.fixed&&(r.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:"~/columns."+t+".fixed"}]}),r.push({t:4,n:50,x:{r:["~/noWrap","~/columns."+t+".fixed"],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:"~/columns."+t+".fixed"}]}]})),e.editable&&e.filter){var i={t:70,n:["click","mousedown","pointerdown","MSPointerDown","touchstart"],f:{r:["@event"],s:"[_0.stopPropagation()]"}},o=[{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}]},i]}]},{t:4,n:51,l:1,f:[{t:7,e:"input",m:[{t:13,n:"value",f:[{t:2,r:e.filter}]},i]}]}];"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:o}),{t:4,n:51,l:1,f:n}]):(r.push({t:13,n:"class-rtable-editing"}),n=o)}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 a={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 l=e.attrsP&&e.attrsP.find(function(e){return"title"===e.n});l?l.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(l),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 s=a;return e.hidden&&e.hidden.r&&(s={t:4,n:51,r:e.hidden.r,f:[a]}),s}),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(),b[0].f[0].f[0].m.push({t:16,r:"~/rowAttrs",c:{r:"."}}));n&&n.m&&n.m.length&&(this._init.sets.wrapperAttrs=n.m.slice(),b[0].m.push({t:16,r:"~/wrapperAttrs",c:{r:"."}}));r&&r.f&&r.f.length&&b[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"],s:"_1?'calc('+(_0-3)+'px - 2em)':(_0-3)+'px'"}}]}]}],f:[{t:16,r:"~/meta.extra",c:{r:"."}}]});e&&e.f&&e.f.length&&(b[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:"."}}]}],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"],s:"_1?'calc('+(_0-3)+'px - 2em)':(_0-3)+'px'"}}]}]}]}]}),b[0].f[0].f[0].m.push({t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._expand(_1)]"}}),b[0].f[0].m.push({t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._expand(_1)]"}}));if(b[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&&(h=t.m.find(function(e){return"by"===e.n}))&&(y(h.f)||1===h.length&&2===h[0].t)){var g={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"]}};b.unshift(g),this._init.by=h.f;var v,m=d(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});m.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]"}}]}]}]}]}),(v=t.m.find(function(e){return"select"===e.n}))&&(i||(i=[])).push(Object.assign({},v,{n:"allowGroupSelect"})),(v=t.m.find(function(e){return"show"===e.n}))&&(i||(i=[])).push(Object.assign({},v,{n:"showGroups"})),g.f[0].f=m}this._init.partials["grid-row"]=b,this._init.partials["grid-head"]=p,i&&this.component&&(this.component.mappings=i)},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:{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.find(".rtable-header")||{},l=Array.apply(null,n.findAll(".rtable-live")).map(function(e){return e.offsetHeight});if(l.length<5){var s=Math.floor(t.clientHeight/(a.offsetHeight||1));s<5&&(s=5),n.set("_paginate",s),l=Array.apply(null,n.findAll(".rtable-live")).map(function(e){return e.offsetHeight})}l.length>0?i=!0:l=[25];var c=Math.ceil(l.reduce(function(e,t){return e+t},0)/l.length);n._avgSize=c;var f=Math.floor((t.clientHeight-(a.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,c=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"),c=o-10,f=n.get("rows.length");o>f&&(o=f);var d=n._avgSize,u=c*d,p=Math.floor(e/d)-5;p<0&&(p=0);var h=p;if(p+o>f&&(p=f-o),r===p&&!isNaN(t.top))return s=!1;if(!k(r)||isNaN(r)||isNaN(t.top)||e<t.top+u||e>t.bottom-u||r>0&&e<d*c){var b=h,g=f-h-o;b<0?(g+=-1*b,b=0):b>f-o&&(b=f-o),g<0&&(g=0);var v,m,x=b*d,w=g*d;p<r+o&&p>r-o&&(v=p>r?n.findAll(".rtable-live")[p-r]:n.findAll(".rtable-live")[r-p]),v&&p>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":p}),"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},f=this._scrollListener=this.on("scroll",function(e){e.node;s||(s=!0,requestAnimationFrame(c))});this._scrollListener.fn=c,f.observer=this.observe("rows.length",function(){n.set("virtual.offset",null),c()},{init:!1,strict:!0});var d=f.cancel;f.cancel=function(){d(),f.observer.cancel()}}a()}else this._autoObserver&&this._autoObserver.cancel(),this._scrollListener&&this._scrollListener.cancel();k(e)&&this.set("_paginate",e)},defer:!0}},data:function(){return Object.assign({page:0,selections:[],showGroups:!0,allowGroupSelect:!0,expanded:null,minPerPage:10,virtual:{offset:0},shuffle:!0},E.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:{get:function(){var e=this,t=this.viewmodel.value.columns,n=this.viewmodel.value.fields,r=t.filter(function(e){return e.filter}).map(function(t){return L(e,t)}).filter(function(e){return e}),i=this.get("items")||[],o=i,a=this.get("filter"),l=this.get("sort");if(O(a)&&!Array.isArray(a)&&(a=[a]),(a instanceof RegExp||y(a))&&a){var s=a===""+a.toLowerCase()||a===""+a.toUpperCase();try{var c=y(a)?new RegExp(a,s?"i":""):a;i=i.filter(function(e){for(var t=r.length;t--;){var n=e&&r[t](e);if(n&&y(n)&&c.test(n))return!0}})}catch(e){}}else if(Array.isArray(a)){var f=function e(t,n,r,i){return n.map(function(n){var o={op:n.op||"=",value:n.value||""};if(n.id){var a=r.find(function(e){return e.id===n.id||e.filter===n.id});a&&(o.get=L(t,a),o.get?o.type=a.type||"string":a=0),a||(a=i.find(function(e){return e.id===n.id}))&&(o.get=H(t,a),o.type=a.type||"string")}else o.op="skip";return"and"!==n.op&&"or"!==n.op&&"&&"!==n.op&&"||"!==n.op||(o.op=n.op,Array.isArray(n.value)&&(o.value=e(t,n.value,r,i))),o}).filter(function(e){return"skip"!==e.op})}(this,a,t,n),d={};try{i=i.filter(function(t){return f.reduce(function(n,r){return n&&function e(t,n,r){var i=this;if(!n||!t.get&&"and"!==t.op&&"or"!==t.op&&"&&"!==t.op&&"||"!==t.op)return!1;var o=t.get&&t.get.call(this,n);if("function"==typeof t.op)return t.op.call(void 0,n);var a=t.value;if("="===t.op||"=="===t.op||"is"===t.op||"eq"===t.op)return"number"===t.type||"date"===t.type?+o==+a:o==a;if("!="===t.op||"<>"===t.op||"ne"===t.op||"is not"===t.op)return"number"===t.type||"date"===t.type?+o!=+a:o!=a;if("not"===t.op)return!o;if(">"===t.op||"gt"===t.op)return M(o)>M(a);if(">="===t.op||"gte"===t.op)return M(o)>=M(a);if("<"===t.op||"lt"===t.op)return M(o)<M(a);if("<="===t.op||"lte"===t.op)return M(o)<=M(a);if("like"===t.op||"notlike"===t.op||"~"===t.op||"!~"===t.op){var l="like"===t.op||"~"===t.op;if(y(a)){if(!a)return!0;var s=r[a]||(r[a]=new RegExp(".*"+a.replace(/%/g,".*")+".*","gi"));l=s.test(o)}else A(a)&&(l=a.test(o));return"like"===t.op||"~"===t.op?l:!l}if("contains"===t.op||"@"===t.op){if(Array.isArray(o))return!!~o.indexOf(a)}else if("containslike"===t.op||"@~"===t.op||"containsnotlike"===t.op||"@!~"===t.op){if(Array.isArray(o)){var c=A(a)?a:y(a)?r[a]||(r[a]=new RegExp(".*"+a.replace(/%/g,".*")+".*","gi")):null;if(!c)return!1;var f=o.findIndex(function(e){return c.test((e||"").toString())});return"containslike"===t.op||"@~"===t.op?f>=0:f<0}}else{if(("not in"===t.op||"in"===t.op)&&Array.isArray(a))return"not in"===t.op?!~a.indexOf(o):!!~a.indexOf(o);if(("or"===t.op||"||"===t.op)&&Array.isArray(a))return a.reduce(function(t,o){return t||e.call(i,o,n,r)},!1);if(("and"===t.op||"&&"===t.op)&&Array.isArray(a))return a.reduce(function(t,o){return t&&e.call(i,o,n,r)},!0)}return!0}.call(e,r,t,d)},!0)})}catch(e){}}return(y(l)||O(l)&&!Array.isArray(l))&&(l=[l]),Array.isArray(l)&&(l=l.map(function(r){if(y(r)){var i="-"===r[0]||"+"===r[0]?r.substr(1):r,o=t.find(function(e){return e.id===i}),a=n.find(function(e){return e.id===i}),l={dir:"-"===r[0]?-1:1,get:o&&L(e,o)||a&&H(e,a)||L(e,{filter:i})};if(o&&"number"===o.type||a&&"number"===a.type){var s=l.get;l.get=function(e){return M(s.call(this,e))}}return l}if(r&&"object"==typeof r){var c=t.find(function(e){return e.id===r.id}),f=n.find(function(e){return e.id===r.id}),d={dir:k(r.dir)?r.dir:"desc"===r.dir?-1:1,get:"function"==typeof r.get&&r.get||c&&L(e,c)||f&&H(e,f)||r.path&&H(e,{filter:r.path,value:r.value})};if("number"===r.type||c&&"number"===c.type||f&&"number"===f.type){var u=d.get;d.get=function(e){return M(u.call(this,e))}}return d}}).filter(function(e){return e&&e.get}),i.sort(function(t,n){for(var r,i,o,a=0;a<l.length;a++)if(r=l[a].get.call(e,t),i=l[a].get.call(e,n),0!==(o=l[a].dir*z(r,i)))return o;return o})),this.set("isFiltered",o.length!==i.length),i}},visibleRows:{get: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:{get:function(){var e=this.get("items")||C,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:{get: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 W=/^[^\d]*/;function M(e){return k(e)?e:e&&(e=(""+e).replace(W,""))?parseFloat(e):1/0}var R=["label","type","filter","hidden","sort","no-pad","id","editable","fixed"],N=/^[a-z]{1,3}[0-9]+(?:-[0-9]+)?$/,C=[];function G(e){return void 0===e&&(e={}),function(t){var n=t.Ractive,r=t.instance;"includeGrid"in e&&n.styleSet("table.inclideGrid",e.includeGrid),r.components[e.name||"data-table"]=E}}i("RMTable","components",E),e.Table=E,e.numberify=M,e.plugin=G,e.default=G,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 c(e,t){var r,i,c=this.getContext(e),f=this,d=t||{};function u(t){if("number"==typeof d.offset&&(t-=d.offset),!d.type||"class"===d.type){var n,i=e.className,o=-1;for(var a in r)l[a].lastIndex=-1,r[a]<=t?(l[a].test(i)||(i+=" "+a),r[a]>o&&(o=r[a],n=a)):i=i.replace(l[a],"").trim();if(e.className=i.replace(s," "),!n)return;d.value&&c.set(d.value,o),d.name&&c.set(d.name,n),d.size&&c.set(d.size,t)}}function p(){var t=(n||(n=document.createElement("div"),document.body.appendChild(n)),n);for(var o in i=f.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 h=this.observe("@style.break",p,{init:!1}),b=c.observe("@local.width",u,{init:!1}),g=o.call(this,e,{clientWidth:"@local.width"});return e.className+=" grid grid-root",d.immediate?p():requestAnimationFrame(p),{update:function(t){d=t||{},requestAnimationFrame(function(){return u(e.clientWidth)})},teardown:function(){e.className=e.className.replace(l["grid grid-root"],"").trim(),b.cancel(),h.cancel(),g.teardown()}}}function f(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}c.style=f,i("grid","decorators",c);var d=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 p(n.getContext(t),a.delay||d,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 p=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 h(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)}}}p.prototype.subscribe=function(e,t,n){(this.fires[e+","+t]||(this.fires[e+","+t]=[])).push(n),this.refs++},p.prototype.unsubscribe=function(e,t,n){var r=this.fires[e+","+t]||[];r.splice(r.indexOf(n),1),this.refs--,this.refs||this.teardown()},p.prototype.bind=function(){window.PointerEvent||window.navigator.pointerEnabled?this.context.listen("pointerdown",h):window.navigator.msPointerEnabled?this.context.listen("MSPointerDown",h):(this.context.listen("mousedown",h),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)},p.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},p.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}},p.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),c()):c()},s=function(e){1===e.touches.length&&e.touches[0].identifier===a||c();var t=e.touches[0];(Math.abs(t.clientX-i)>=5||Math.abs(t.clientY-o)>=5)&&c()},c=function(){t&&clearTimeout(t),n.node.removeEventListener("touchend",l,!1),window.removeEventListener("touchmove",s,!1),window.removeEventListener("touchcancel",c,!1)};return this.node.addEventListener("touchend",l,!1),window.addEventListener("touchmove",s,!1),window.addEventListener("touchcancel",c,!1),t=setTimeout(function(){c(),n.fire(e,i,o,!0)},400),this.bubble||e.stopPropagation(),this.bubble},p.prototype.teardown=function(){var e=this.context;e.unlisten("pointerdown",h),e.unlisten("MSPointerDown",h),e.unlisten("mousedown",h),e.unlisten("touchstart",b),e.unlisten("focus",g),delete this.node.__r_clicks__},i("expand","transitions",x);var _=/^([-+])?([^\s]+)$/;function y(e){return"string"==typeof e}function k(e){return"number"==typeof e}function O(e){return"object"==typeof e}function A(e){return"object"==typeof e&&"RegExp"===Object.prototype.toString.call(e)}var S,P,E=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}};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.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._setSort=function(e,t){var n=this.get("columns."+e);if(n&&(n.sort||n.filter)){var r=n.sort||n.filter,i=r;y(i)&&"~"===i[0]&&(i=this.get(i));var o=t.ctrlKey,a=this.get("sort");if(Array.isArray(i)||(i=[i]),a?Array.isArray(a)||(a=[a]):a=[],a.length){var l=a.map(function(e){return _.exec(e).slice(1)}),s=i.reduce(function(e,t){return e&&!!l.find(function(e){return e[1]===t})},!0);s&&a.length!==i.length&&!o?this.set("sort",i.map(function(e){return"+"+i})):o?s?this.set("sort",l.map(function(e){return~i.indexOf(e[1])?("+"===e[0]?"-":"+")+e[1]:e[0]+e[1]})):this.set("sort",a.concat(i.map(function(e){return""+(e===r&&n.dir||"+")+e}))):s?this.set("sort",l.map(function(e){return("+"===e[0]?"-":"+")+e[1]})):this.set("sort",i.map(function(e){return""+(e===r&&n.dir||"+")+e}))}else this.set("sort",i.map(function(e){return""+(e===r&&n.dir||"+")+e}))}},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)},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},Object.defineProperties(t.prototype,n),t}(t);function H(e,n){if(e&&n){if("function"==typeof n.get)return n.get;var r=e._getters||(e._getters={}),i=n.filter;y(i)&&0===i.indexOf("~/")&&(i=e.get(i));var o=Array.isArray(i)?i.join("."):!!y(i)&&i;if(o){if(!r[o])if(y(i)&&~i.indexOf("*")){var a=t.splitKeypath(i);r[o]=function(e){var t=z(e,a);return t.v||t.l}}else y(i)&&(i=t.splitKeypath(i)),r[o]=function(e){return j(e,i)};return r[o]}}}function L(e,n){if(e&&n){if("function"==typeof n.get)return n.get;var r=e._getters||(e._getters={}),i=n.path;y(i)&&0===i.indexOf("~/")&&(i=e.get(i));var o=Array.isArray(i)?i.join("."):!!y(i)&&i;if(o){if(!r[o])if(y(i)&&~i.indexOf("*")){var a=t.splitKeypath(i);r[o]=function(e){var t=z(e,a);return t.v||t.l}}else y(i)&&(i=t.splitKeypath(i)),r[o]=function(e){return j(e,i)};return r[o]}return y(i=n.value)&&0===i.indexOf("~/")&&(i=e.get(i)),"function"==typeof i?i:void 0}}function j(e,t){if(!t.length||e||"object"==typeof e){for(var n=e,r=0;r<t.length;r++)if("object"!=typeof(n=n[t[r]])||!n)return r+1<t.length?void 0:n;return n}}function z(e,t){if(!t.length)return{v:e};if(t.length&&"object"!=typeof e)return{n:1};var n=t[0];if("*"===n&&Array.isArray(e)){var r=t.slice(1);return{l:e.reduce(function(e,t){var n=z(t,r);return O(n)?n.v?e.push(n.v):n.l?e.push.apply(e,n.l):n.n||e.push(n):e.push(n),e},[])}}return z(e[n],t.slice(1))}function T(e,t){return e<t?-1:e>t?1:e==t?0:!e&&t?-1:e&&!t?1:0}E.settings={valign:"center",border:!1,"fixed-header":!0,"allow-select":!0,"allow-select-all":!0,"auto-titles":!1,paginate:"virtual"},t.extendWith(E,{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},{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: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},{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"}]'}},{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: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:{r:"~/shuffle"}}],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:"selcted"}},{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"}]':function(){return[{size:"~/tableWidth"}]},"!_0&&!_1":function(e,t){return!e&&!t},"!_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-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 .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 \n .rtable-border .rtable-row-wrap {\n border-width: 0 1px 1px 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 1px;\n margin-left: -1px;\n width: 100%;\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 }\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: 3;\n }\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-top {\n margin-top: -3px;\n }\n .rtable-nowrap.rtable-fixed-header .rtable-header-fixed {\n flex-shrink: 0;\n width: 100%;\n overflow-x: auto;\n scrollbar-width: none;\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: 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: 2.1em;\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: calc(2.1em + 1px);\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 left: 0.1em;\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: 0;\n left: 0;\n border-radius: 2em;\n transform: translate(-0.1em, 0) scale(1);\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: 1;\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: translate(0.2em, -0.3em) 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: translate(0.2em, -0.3em) 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: 4px;\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: 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")?f(e):"")}.call(this,e)].join(" ")},cssId:"rtable",noCssTransform:!0,attributes:["paginate","items","filter","sort","helpers","fixed","allow-select","allow-select-all","border","fixed-header","valign","no-header","empty","shuffle","no-wrap"],components:{table:!1,Table:!1},syncComputedChildren:!0,decorators:{grid:c,sized:o,scrollheader:function(e){var t=this,n=function(e){requestAnimationFrame(function(){return t.find(".rtable-header-fixed").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===P&&(P={}),function(e){e.instance.transitions[P.name||"expand"]=x}),(void 0===S&&(S={}),function(e){e.instance.decorators[S.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||[],c=l.template.m?l.template.m.slice():[],f=l.template;l.template={e:f.e,f:f.f,t:f.t,m:c};var d=0;function u(e,t,n){if(e&&e.f&&1===e.f.length&&2===e.f[0].t){var r="_a"+d++;return c.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 p(e){var t=[],n=[];return e.forEach(function(e){if("column"===e.e||"col"===e.e){var r,i={},o=e.m||N;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}))&&y(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&&O(i.hidden.f)?i.hidden=u(i.hidden):i.hidden=!1,y(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&&O(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&&O(i.editable.f)?i.editable=u(i.editable):i.editable=!1,i.valign=o.find(function(e){return"valign"===e.n}),i.valign&&O(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&&O(i.fixed.f)?i.fixed=u(i.fixed):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!~R.indexOf(e.n)}),i.attrs.forEach(function(e,t){C.test(e.n)&&(i.attrs[t]={t:13,n:"class-"+e.n})})}else if("field"===e.e){var l,s={},c=e.m||N;if(y(l=c.find(function(e){return"path"===e.n}))?s.path=l:l&&l.f&&(s.path=u(l)),(l=c.find(function(e){return"value"===e.n}))&&l.f&&(s.value=u(l)),y(l=c.find(function(e){return"type"===e.n}))?s.type=l:l&&l.f&&(s.type=u(l)),y((l=c.find(function(e){return"id"===e.n})).f)&&(s.id=l.f),y(l=c.find(function(e){return"dir"===e.n}))?s.dir=l:l&&y(l.f)&&(s.dir=l.f),y(l=c.find(function(e){return"label"===e.n}))?s.label=l:l&&l.f&&(s.label=u(l)),(l=c.find(function(e){return"get"===e.n}))&&l.f){var f=u(l,!1,!0);s.get=function(e){var t=this.get(f);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:p(s),partials:{}};var h=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=[{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:h.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"}]};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&&(n.m.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:"~/columns."+t+".fixed"}]}),n.m.push({t:4,n:50,x:{r:["~/noWrap","~/columns."+t+".fixed"],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:"~/columns."+t+".fixed"}]}]}));var r=n;return e.hidden&&e.hidden.r&&(r={t:4,n:51,r:e.hidden.r,f:[n]}),r}),m:[{t:13,n:"class-row"}]}]}];b[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 g,v=[{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:h.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:"."}}]}];e.attrs.length?(e.attrsP=e.attrs,e.attrs=[{t:16,r:"~/columns."+t+".attrsP",c:{r:"."}}]):e.attrs=[];var r=e.attrs;if(e.fixed&&(r.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:"~/columns."+t+".fixed"}]}),r.push({t:4,n:50,x:{r:["~/noWrap","~/columns."+t+".fixed"],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:"~/columns."+t+".fixed"}]}]})),e.editable&&e.filter){var i={t:70,n:["click","mousedown","pointerdown","MSPointerDown","touchstart"],f:{r:["@event"],s:"[_0.stopPropagation()]"}},o=[{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}]},i]}]},{t:4,n:51,l:1,f:[{t:7,e:"input",m:[{t:13,n:"value",f:[{t:2,r:e.filter}]},i]}]}];"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:o}),{t:4,n:51,l:1,f:n}]):(r.push({t:13,n:"class-rtable-editing"}),n=o)}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 a={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 l=e.attrsP&&e.attrsP.find(function(e){return"title"===e.n});l?l.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(l),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 s=a;return e.hidden&&e.hidden.r&&(s={t:4,n:51,r:e.hidden.r,f:[a]}),s}),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(),v[0].f[0].f[0].m.push({t:16,r:"~/rowAttrs",c:{r:"."}}));n&&n.m&&n.m.length&&(this._init.sets.wrapperAttrs=n.m.slice(),v[0].m.push({t:16,r:"~/wrapperAttrs",c:{r:"."}}));r&&r.f&&r.f.length&&v[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"],s:"_1?'calc('+(_0-3)+'px - 2em)':(_0-3)+'px'"}}]}]}],f:[{t:16,r:"~/meta.extra",c:{r:"."}}]});e&&e.f&&e.f.length&&(v[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:"."}}]}],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"],s:"_1?'calc('+(_0-3)+'px - 2em)':(_0-3)+'px'"}}]}]}]}]}),v[0].f[0].f[0].m.push({t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._expand(_1)]"}}),v[0].f[0].m.push({t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._expand(_1)]"}}));if(v[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&&(g=t.m.find(function(e){return"by"===e.n}))&&(y(g.f)||1===g.length&&2===g[0].t)){var m={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"]}};v.unshift(m),this._init.by=g.f;var x,w=p(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});w.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]"}}]}]}]}]}),(x=t.m.find(function(e){return"select"===e.n}))&&(a||(a=[])).push(Object.assign({},x,{n:"allowGroupSelect"})),(x=t.m.find(function(e){return"show"===e.n}))&&(a||(a=[])).push(Object.assign({},x,{n:"showGroups"})),m.f[0].f=w}this._init.partials["grid-row"]=v,this._init.partials["grid-head"]=b,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:{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.find(".rtable-header")||{},l=Array.apply(null,n.findAll(".rtable-live")).map(function(e){return e.offsetHeight});if(l.length<5){var s=Math.floor(t.clientHeight/(a.offsetHeight||1));s<5&&(s=5),n.set("_paginate",s),l=Array.apply(null,n.findAll(".rtable-live")).map(function(e){return e.offsetHeight})}l.length>0?i=!0:l=[25];var c=Math.ceil(l.reduce(function(e,t){return e+t},0)/l.length);n._avgSize=c;var f=Math.floor((t.clientHeight-(a.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,c=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"),c=o-10,f=n.get("rows.length");o>f&&(o=f);var d=n._avgSize,u=c*d,p=Math.floor(e/d)-5;p<0&&(p=0);var h=p;if(p+o>f&&(p=f-o),r===p&&!isNaN(t.top))return s=!1;if(!k(r)||isNaN(r)||isNaN(t.top)||e<t.top+u||e>t.bottom-u||r>0&&e<d*c){var b=h,g=f-h-o;b<0?(g+=-1*b,b=0):b>f-o&&(b=f-o),g<0&&(g=0);var v,m,x=b*d,w=g*d;p<r+o&&p>r-o&&(v=p>r?n.findAll(".rtable-live")[p-r]:n.findAll(".rtable-live")[r-p]),v&&p>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":p}),"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},f=this._scrollListener=this.on("scroll",function(e){e.node;s||(s=!0,requestAnimationFrame(c))});this._scrollListener.fn=c,f.observer=this.observe("rows.length",function(){n.set("virtual.offset",null),c()},{init:!1,strict:!0});var d=f.cancel;f.cancel=function(){d(),f.observer.cancel()}}a()}else this._autoObserver&&this._autoObserver.cancel(),this._scrollListener&&this._scrollListener.cancel();k(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:!0},E.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:{get:function(){var e=this,t=this.viewmodel.value.columns,n=this.viewmodel.value.fields,r=t.filter(function(e){return e.filter}).map(function(t){return H(e,t)}).filter(function(e){return e}),i=this.get("items")||[],o=i,a=this.get("filter"),l=this.get("sort");if(O(a)&&!Array.isArray(a)&&(a=[a]),(a instanceof RegExp||y(a))&&a){var s=a===""+a.toLowerCase()||a===""+a.toUpperCase();try{var c=y(a)?new RegExp(a,s?"i":""):a;i=i.filter(function(e){for(var t=r.length;t--;){var n=e&&r[t](e);if(n&&y(n)&&c.test(n))return!0}})}catch(e){}}else if(Array.isArray(a)){var f=function e(t,n,r,i){return n.map(function(n){var o={op:n.op||"=",value:n.value||""};if(n.id){var a=r.find(function(e){return e.id===n.id||e.filter===n.id});a&&(o.get=H(t,a),o.get?o.type=a.type||"string":a=0),a||(a=i.find(function(e){return e.id===n.id}))&&(o.get=L(t,a),o.type=a.type||"string")}else o.op="skip";return"and"!==n.op&&"or"!==n.op&&"&&"!==n.op&&"||"!==n.op||(o.op=n.op,Array.isArray(n.value)&&(o.value=e(t,n.value,r,i))),o}).filter(function(e){return"skip"!==e.op})}(this,a,t,n),d={};try{i=i.filter(function(t){return f.reduce(function(n,r){return n&&function e(t,n,r){var i=this;if(!n||!t.get&&"and"!==t.op&&"or"!==t.op&&"&&"!==t.op&&"||"!==t.op)return!1;var o=t.get&&t.get.call(this,n);if("function"==typeof t.op)return t.op.call(void 0,n);var a=t.value;if("="===t.op||"=="===t.op||"is"===t.op||"eq"===t.op)return"number"===t.type||"date"===t.type?+o==+a:o==a;if("!="===t.op||"<>"===t.op||"ne"===t.op||"is not"===t.op)return"number"===t.type||"date"===t.type?+o!=+a:o!=a;if("not"===t.op)return!o;if(">"===t.op||"gt"===t.op)return M(o)>M(a);if(">="===t.op||"gte"===t.op)return M(o)>=M(a);if("<"===t.op||"lt"===t.op)return M(o)<M(a);if("<="===t.op||"lte"===t.op)return M(o)<=M(a);if("like"===t.op||"notlike"===t.op||"~"===t.op||"!~"===t.op){var l="like"===t.op||"~"===t.op;if(y(a)){if(!a)return!0;var s=r[a]||(r[a]=new RegExp(".*"+a.replace(/%/g,".*")+".*","gi"));l=s.test(o)}else A(a)&&(l=a.test(o));return"like"===t.op||"~"===t.op?l:!l}if("contains"===t.op||"@"===t.op){if(Array.isArray(o))return!!~o.indexOf(a)}else if("containslike"===t.op||"@~"===t.op||"containsnotlike"===t.op||"@!~"===t.op){if(Array.isArray(o)){var c=A(a)?a:y(a)?r[a]||(r[a]=new RegExp(".*"+a.replace(/%/g,".*")+".*","gi")):null;if(!c)return!1;var f=o.findIndex(function(e){return c.test((e||"").toString())});return"containslike"===t.op||"@~"===t.op?f>=0:f<0}}else{if(("not in"===t.op||"in"===t.op)&&Array.isArray(a))return"not in"===t.op?!~a.indexOf(o):!!~a.indexOf(o);if(("or"===t.op||"||"===t.op)&&Array.isArray(a))return a.reduce(function(t,o){return t||e.call(i,o,n,r)},!1);if(("and"===t.op||"&&"===t.op)&&Array.isArray(a))return a.reduce(function(t,o){return t&&e.call(i,o,n,r)},!0)}return!0}.call(e,r,t,d)},!0)})}catch(e){}}return(y(l)||O(l)&&!Array.isArray(l))&&(l=[l]),Array.isArray(l)&&(l=l.map(function(r){if(y(r)){var i="-"===r[0]||"+"===r[0]?r.substr(1):r,o=t.find(function(e){return e.id===i}),a=n.find(function(e){return e.id===i}),l={dir:"-"===r[0]?-1:1,get:o&&H(e,o)||a&&L(e,a)||H(e,{filter:i})};if(o&&"number"===o.type||a&&"number"===a.type){var s=l.get;l.get=function(e){return M(s.call(this,e))}}return l}if(r&&"object"==typeof r){var c=t.find(function(e){return e.id===r.id}),f=n.find(function(e){return e.id===r.id}),d={dir:k(r.dir)?r.dir:"desc"===r.dir?-1:1,get:"function"==typeof r.get&&r.get||c&&H(e,c)||f&&L(e,f)||r.path&&L(e,{filter:r.path,value:r.value})};if("number"===r.type||c&&"number"===c.type||f&&"number"===f.type){var u=d.get;d.get=function(e){return M(u.call(this,e))}}return d}}).filter(function(e){return e&&e.get}),i.sort(function(t,n){for(var r,i,o,a=0;a<l.length;a++)if(r=l[a].get.call(e,t),i=l[a].get.call(e,n),0!==(o=l[a].dir*T(r,i)))return o;return o})),this.set("isFiltered",o.length!==i.length),i}},visibleRows:{get: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:{get:function(){var e=this.get("items")||N,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:{get: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 W=/^[^\d]*/;function M(e){return k(e)?e:e&&(e=(""+e).replace(W,""))?parseFloat(e):1/0}var R=["label","type","filter","hidden","sort","no-pad","id","editable","fixed"],C=/^[a-z]{1,3}[0-9]+(?:-[0-9]+)?$/,N=[];function G(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"]=E}}i("RMTable","components",E),e.Table=E,e.numberify=M,e.plugin=G,e.default=G,Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -25,8 +25,8 @@ (function (global, factory) { | ||
if (node.scrollTop <= allow) { str += ' top'; } | ||
else if (node.scrollTop >= node.scrollHeight - node.clientHeight - allow) { str += ' bottom'; } | ||
else { str += ' vmiddle'; } | ||
if (node.scrollTop >= node.scrollHeight - node.clientHeight - allow) { str += ' bottom'; } | ||
if (!~str.indexOf('top') && !~str.indexOf('bottom')) { str += ' vmiddle'; } | ||
if (node.scrollLeft <= allow) { str += ' left'; } | ||
else if (node.scrollLeft >= node.scrollWidth - node.clientWidth - allow) { str += ' right'; } | ||
else { str += ' hmiddle'; } | ||
if (node.scrollLeft >= node.scrollWidth - node.clientWidth - allow) { str += ' right'; } | ||
else if (!~str.indexOf('left') && !~str.indexOf('right')) { str += ' hmiddle'; } | ||
@@ -33,0 +33,0 @@ ctx.set(bind, str); |
@@ -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+=" vmiddle",t.scrollLeft<=i?n+=" left":t.scrollLeft>=t.scrollWidth-t.clientWidth-i?n+=" 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 }\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})}); |
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
2494059
0.66%27018
0.4%