@evs-chris/raui
Advanced tools
Comparing version 0.15.3 to 0.15.4
@@ -10,5 +10,7 @@ function teardown() {} | ||
instance.decorators[options.name || 'autofocus'] = function(node, opts) { | ||
var o = Object.assign({}, options, opts); | ||
if (o.immediate) { node.focus(); } | ||
else { setTimeout(function () { return node.focus(); }, o.timeout || 250); } | ||
if (typeof node.focus === 'function') { | ||
var o = Object.assign({}, options, opts); | ||
if (o.immediate && !node.disabeld) { node.focus(); } | ||
else { setTimeout(function () { return !node.disabled && node.focus(); }, o.timeout || 250); } | ||
} | ||
return { teardown: teardown }; | ||
@@ -15,0 +17,0 @@ }; |
@@ -1,1 +0,1 @@ | ||
function teardown(){}export default function plugin(options){if(options===void 0)options={};return function(ref){var instance=ref.instance;instance.decorators[options.name||"autofocus"]=function(node,opts){var o=Object.assign({},options,opts);if(o.immediate){node.focus()}else{setTimeout(function(){return node.focus()},o.timeout||250)}return{teardown:teardown}}}} | ||
function teardown(){}export default function plugin(options){if(options===void 0)options={};return function(ref){var instance=ref.instance;instance.decorators[options.name||"autofocus"]=function(node,opts){if(typeof node.focus==="function"){var o=Object.assign({},options,opts);if(o.immediate&&!node.disabeld){node.focus()}else{setTimeout(function(){return!node.disabled&&node.focus()},o.timeout||250)}}return{teardown:teardown}}}} |
@@ -282,4 +282,7 @@ import globalRegister from './globalRegister'; | ||
export function autofocus(node) { | ||
if (typeof node.focus === 'function') { node.focus(); } | ||
export function autofocus(node, opts) { | ||
if (typeof node.focus === 'function' && !node.disabled) { | ||
if (opts && opts.immediate) { node.focus(); } | ||
else { setTimeout(function () { return !node.disabled && node.focus(); }, (opts || {}).timeout || 250); } | ||
} | ||
return { teardown: noop }; | ||
@@ -286,0 +289,0 @@ } |
@@ -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 disabled=Object.assign({},data("raui.primary.disabled"),data("raui.form.primary.disabled"));var boxy=data("raui.form.boxy");return"\n label.field, .field-manual {\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 .field-manual .field-body\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 input[readonly],\n label.field select:disabled,\n label.field textarea:disabled,\n label.field textarea[readonly] {\n background: "+(disabled.bg||"#f4f4f4")+";\n color: "+(disabled.fg||"#444")+";\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, label.field.radio {\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, label.field.radio.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input, 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.5em;\n top: 1em;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 3.2em;\n height: 3.2em;\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, label.field.inline.radio input {\n top: -0.45em;\n left: -0.55em;\n }\n\n label.field.check input:checked, label.field.radio input:checked {\n background-color: "+(primary.fga||"#07e")+";\n }\n\n label.field.check:hover > input, label.field.radio:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus, label.field.radio input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus, label.field.radio:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active, label.field.radio input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before, label.field.radio:before {\n content: '';\n display: inline-block;\n box-sizing: border-box;\n margin: 0 0.5em 0.2em 0.1em;\n border: solid 0.125em; /* Safari */\n border-color: "+(primary.fg||"#222")+';\n border-radius: 0.125em;\n width: 1.2em;\n height: 1.2em;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after, label.field.radio:after {\n content: \'\';\n display: inline-block;\n opacity: 0;\n position: absolute;\n width: 1.2em;\n height: 1.2em;\n top: 2.3em;\n left: 0.6em;\n border-radius: 0.125em;\n }\n label.field.check.inline:after, label.field.radio.inline:after {\n top: 0.8em;\n }\n\n label.field.check.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="'+(primary.bg||"#fff").replace(/#/g,"%23")+'" d="m 15.378906,1.7050781 a 1.0583349,1.0583349 0 0 0 -1.478515,0.234375 L 6.6210937,11.960938 1.8652344,8.5058594 a 1.0583349,1.0583349 0 0 0 -1.47851565,0.234375 1.0583349,1.0583349 0 0 0 0.234375,1.4785156 L 6.234375,14.294922 A 1.0584408,1.0584408 0 0 0 7.7128906,14.060547 L 15.613281,3.1835938 A 1.0583349,1.0583349 0 0 0 15.378906,1.7050781 Z" /></svg>\') '+(primary.fga||"#07e")+';\n }\n\n label.field.radio.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><circle fill="'+(primary.bg||"#fff").replace(/#/g,"%23")+'" cx="8" cy="8" r="5" /></svg>\') '+(primary.fga||"#07e")+";\n }\n\n label.field.check.checked:before, label.field.radio.checked:before {\n border-color: "+(primary.fga||"#07e")+";\n }\n label.field.check.focus:before, label.field.radio.focus:before {\n border-color: "+(primary.fga||"#07e")+";\n }\n\n label.field.check input:disabled, label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled, label.field.radio.disabled {\n color: "+(disabled.fg||"#444")+";\n cursor: initial;\n }\n\n label.field.check.disabled:before, label.field.radio.disabled:before {\n border-color: "+(disabled.bc||"#ccc")+";\n background-color: "+(disabled.bg||"#f4f4f4")+";\n }\n\n label.field.check.checked.disabled:after, label.field.radio.checked.disabled:after {\n border-color: transparent;\n background-color: "+(disabled.bc||"#ccc")+";\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: 1.125em;\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 min-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);var res={update:noop,invalidate:invalidate.bind(this),teardown:function teardown(){ctx.ractive.fire("fieldUnregistered",ctx,node,res);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},setDisabled:function setDisabled(v){var children=node.querySelectorAll("input,button,select,textarea");children.forEach(function(c){return c.disabled=v});this.invalidate()}};ctx.ractive.fire("fieldRegistered",ctx,node,res);return res}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 label=[];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"});var disabled=attrs.find(function(a){return a.n==="disabled"});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(disabled){el.m.push(disabled)}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{content.forEach(function(e){if(e.e==="label"){if(e.f&&e.f.length){label.push.apply(label,e.f)}}else{body.push(e)}});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:body}]}}var labelattr=attrs.find(function(a){return a.n==="label"});if(labelattr&&labelattr.f&&labelattr.f.length){label.push.apply(label,Array.isArray(labelattr.f)?labelattr.f:[labelattr.f])}if(tip){body.unshift({t:7,e:"span",m:[{t:13,n:"class",f:"field-tip"+(!label.length?" field-solo-tip":""),g:1},{t:13,n:"title",f:tip.f},{t:70,n:["click"],f:{r:[],s:"[false]"}}],f:"?"})}var inline=attrs.find(function(a){return a.n==="inline"});if(label&&!inline){body.unshift.apply(body,label)}else if(!inline){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"&&a.n!=="disabled"})),f:body};if(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 disabled=Object.assign({},data("raui.primary.disabled"),data("raui.form.primary.disabled"));var boxy=data("raui.form.boxy");return"\n label.field, .field-manual {\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 .field-manual .field-body\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 input[readonly],\n label.field select:disabled,\n label.field textarea:disabled,\n label.field textarea[readonly] {\n background: "+(disabled.bg||"#f4f4f4")+";\n color: "+(disabled.fg||"#444")+";\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, label.field.radio {\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, label.field.radio.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input, 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.5em;\n top: 1em;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 3.2em;\n height: 3.2em;\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, label.field.inline.radio input {\n top: -0.45em;\n left: -0.55em;\n }\n\n label.field.check input:checked, label.field.radio input:checked {\n background-color: "+(primary.fga||"#07e")+";\n }\n\n label.field.check:hover > input, label.field.radio:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus, label.field.radio input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus, label.field.radio:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active, label.field.radio input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before, label.field.radio:before {\n content: '';\n display: inline-block;\n box-sizing: border-box;\n margin: 0 0.5em 0.2em 0.1em;\n border: solid 0.125em; /* Safari */\n border-color: "+(primary.fg||"#222")+';\n border-radius: 0.125em;\n width: 1.2em;\n height: 1.2em;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after, label.field.radio:after {\n content: \'\';\n display: inline-block;\n opacity: 0;\n position: absolute;\n width: 1.2em;\n height: 1.2em;\n top: 2.3em;\n left: 0.6em;\n border-radius: 0.125em;\n }\n label.field.check.inline:after, label.field.radio.inline:after {\n top: 0.8em;\n }\n\n label.field.check.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="'+(primary.bg||"#fff").replace(/#/g,"%23")+'" d="m 15.378906,1.7050781 a 1.0583349,1.0583349 0 0 0 -1.478515,0.234375 L 6.6210937,11.960938 1.8652344,8.5058594 a 1.0583349,1.0583349 0 0 0 -1.47851565,0.234375 1.0583349,1.0583349 0 0 0 0.234375,1.4785156 L 6.234375,14.294922 A 1.0584408,1.0584408 0 0 0 7.7128906,14.060547 L 15.613281,3.1835938 A 1.0583349,1.0583349 0 0 0 15.378906,1.7050781 Z" /></svg>\') '+(primary.fga||"#07e")+';\n }\n\n label.field.radio.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><circle fill="'+(primary.bg||"#fff").replace(/#/g,"%23")+'" cx="8" cy="8" r="5" /></svg>\') '+(primary.fga||"#07e")+";\n }\n\n label.field.check.checked:before, label.field.radio.checked:before {\n border-color: "+(primary.fga||"#07e")+";\n }\n label.field.check.focus:before, label.field.radio.focus:before {\n border-color: "+(primary.fga||"#07e")+";\n }\n\n label.field.check input:disabled, label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled, label.field.radio.disabled {\n color: "+(disabled.fg||"#444")+";\n cursor: initial;\n }\n\n label.field.check.disabled:before, label.field.radio.disabled:before {\n border-color: "+(disabled.bc||"#ccc")+";\n background-color: "+(disabled.bg||"#f4f4f4")+";\n }\n\n label.field.check.checked.disabled:after, label.field.radio.checked.disabled:after {\n border-color: transparent;\n background-color: "+(disabled.bc||"#ccc")+";\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: 1.125em;\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 min-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);var res={update:noop,invalidate:invalidate.bind(this),teardown:function teardown(){ctx.ractive.fire("fieldUnregistered",ctx,node,res);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},setDisabled:function setDisabled(v){var children=node.querySelectorAll("input,button,select,textarea");children.forEach(function(c){return c.disabled=v});this.invalidate()}};ctx.ractive.fire("fieldRegistered",ctx,node,res);return res}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 label=[];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"});var disabled=attrs.find(function(a){return a.n==="disabled"});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(disabled){el.m.push(disabled)}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{content.forEach(function(e){if(e.e==="label"){if(e.f&&e.f.length){label.push.apply(label,e.f)}}else{body.push(e)}});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:body}]}}var labelattr=attrs.find(function(a){return a.n==="label"});if(labelattr&&labelattr.f&&labelattr.f.length){label.push.apply(label,Array.isArray(labelattr.f)?labelattr.f:[labelattr.f])}if(tip){body.unshift({t:7,e:"span",m:[{t:13,n:"class",f:"field-tip"+(!label.length?" field-solo-tip":""),g:1},{t:13,n:"title",f:tip.f},{t:70,n:["click"],f:{r:[],s:"[false]"}}],f:"?"})}var inline=attrs.find(function(a){return a.n==="inline"});if(label&&!inline){body.unshift.apply(body,label)}else if(!inline){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"&&a.n!=="disabled"})),f:body};if(inline){outer.m.push({t:13,n:"class",f:"inline"})}handle.setTemplate([outer])});macro.types={};export function autofocus(node,opts){if(typeof node.focus==="function"&&!node.disabled){if(opts&&opts.immediate){node.focus()}else{setTimeout(function(){return!node.disabled&&node.focus()},(opts||{}).timeout||250)}}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; |
{ | ||
"name": "@evs-chris/raui", | ||
"version": "0.15.3", | ||
"version": "0.15.4", | ||
"description": "Components, decorators, and helpers for Ractive apps that are generally Material-ish", | ||
@@ -5,0 +5,0 @@ "homepage": "https://evs-chris.github.io/raui/demo", |
@@ -6,5 +6,7 @@ function teardown() {} | ||
instance.decorators[options.name || 'autofocus'] = function(node, opts) { | ||
const o = Object.assign({}, options, opts); | ||
if (o.immediate) node.focus(); | ||
else setTimeout(() => node.focus(), o.timeout || 250); | ||
if (typeof node.focus === 'function') { | ||
const o = Object.assign({}, options, opts); | ||
if (o.immediate && !node.disabeld) node.focus(); | ||
else setTimeout(() => !node.disabled && node.focus(), o.timeout || 250); | ||
} | ||
return { teardown }; | ||
@@ -11,0 +13,0 @@ }; |
@@ -691,4 +691,7 @@ import globalRegister from './globalRegister'; | ||
export function autofocus(node) { | ||
if (typeof node.focus === 'function') node.focus(); | ||
export function autofocus(node, opts) { | ||
if (typeof node.focus === 'function' && !node.disabled) { | ||
if (opts && opts.immediate) node.focus(); | ||
else setTimeout(() => !node.disabled && node.focus(), (opts || {}).timeout || 250); | ||
} | ||
return { teardown: noop }; | ||
@@ -695,0 +698,0 @@ } |
@@ -777,4 +777,7 @@ (function (global, factory) { | ||
function autofocus(node) { | ||
if (typeof node.focus === 'function') { node.focus(); } | ||
function autofocus(node, opts) { | ||
if (typeof node.focus === 'function' && !node.disabled) { | ||
if (opts && opts.immediate) { node.focus(); } | ||
else { setTimeout(function () { return !node.disabled && node.focus(); }, (opts || {}).timeout || 250); } | ||
} | ||
return { teardown: noop$1 }; | ||
@@ -781,0 +784,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.RauiAutocomplete={},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 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(e,t){var n=t.split("="),i=n[0],r=n[1];return e[i]=r,e},{})),Ractive[t][o&&o[e]||e]=i}}}function r(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",r=t.scale||"0.9",o="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("+r+") "+o),e.animateStyle({opacity:1,transform:"none"},n)):(e.setStyle("opacity",1),e.setStyle("transform","none"),e.animateStyle({opacity:0,transform:"scale("+r+") "+o},n))}function o(e){return void 0===e&&(e={}),function(t){t.instance.transitions[e.name||"pop"]=r}}function a(e,t){var n=!1,i=!1;function r(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",r,{capture:!0}),document.body.addEventListener("touchstop",r,{capture:!0}))}),{teardown:function(){i=!0,n&&(document.body.removeEventListener("click",r,{capture:!0}),document.body.removeEventListener("touchstop",r,{capture:!0}))}}}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",r),i("fade","transitions",l);var s,f,p,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?3:0)"}},"px"],t:13}],n:50,x:{r:["position.tailTop"],s:"_0!=null"}},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?3:0)"}},"px"],t:13}],n:50,x:{r:["position.tailBottom"],s:"_0!=null"}},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:3)"}},"px"],t:13}],n:50,x:{r:["position.tailLeft"],s:"_0!=null"}},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:3)"}},"px"],t:13}],n:50,x:{r:["position.tailRight"],s:"_0!=null"}}]}," ",{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,x:{r:["position.tailTop"],s:"_0!=null"}},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,x:{r:["position.tailBottom"],s:"_0!=null"}},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,x:{r:["position.tailLeft"],s:"_0!=null"}},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,x:{r:["position.tailRight"],s:"_0!=null"}}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content",z:[{n:"trigger",x:{r:"triggerContext"}}]}]}]}],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?3:0)":function(e,t){return e+(t?3:0)},"_0!=null":function(e){return null!=e},"_0+(_1?0:3)":function(e,t){return e+(t?0:3)},"_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(t){var n=t||this.source,i=this.get("popped");if(n&&i){var r=this.find("div");if(n&&r&&r.offsetParent){n?this.set("triggerContext",e.getContext(n)):this.set("triggerContext",null);var o=r.offsetParent,a=o.getBoundingClientRect(),l=r.getBoundingClientRect(),c=n.getBoundingClientRect(),s=this.get("where")||"below",f=this.get("align")||"middle",p=this.get("tail"),d="above"===s||"below"===s,u=this.get("fit"),b=this.get("gap"),m="above"===s||"below"===s?0:"left"===s?-l.width-b:c.width+b,h="left"===s||"right"===s?-c.height:"above"===s?-c.height-l.height-b:b;"middle"===f?"below"===s||"above"===s?m-=(l.width-c.width)/2:"left"!==s&&"right"!==s||(h-=(l.height-c.height)/2):"end"===f&&("below"===s||"above"===s?m+=c.width-l.width:"left"!==s&&"right"!==s||(h+=c.height-l.height));var g={popTop:c.bottom-a.top+h,popLeft:c.left-a.left+m,tail:p,vert:"above"===s||"below"===s};if(o.scrollTop&&(g.popTop+=o.scrollTop),o.scrollLeft&&(g.popLeft+=o.scrollLeft),p){"above"===s?g.tailBottom=-10:"below"===s?g.tailTop=-10:"left"===s?g.tailRight=-10:"right"===s&&(g.tailLeft=-10);var v=this.tailSource?this.tailSource.getBoundingClientRect():c;"start"===f?d?g.tailLeft=Math.floor(v.width/2)-10:g.tailTop=Math.floor(v.height/2)-10:"end"===f?d?g.tailRight=Math.floor(v.width/2)-10:g.tailBottom=Math.floor(v.height/2)-10:"middle"===f&&(d?g.tailLeft=Math.floor(v.width/2)-10:g.tailTop=Math.floor(v.height/2)-10),v!==c?d?(null!=g.tailLeft&&(g.tailLeft+=v.left-c.left),null!=g.tailRight&&(g.tailRight+=c.right-v.right)):(null!=g.tailTop&&(g.tailTop+=v.top-c.top),null!=g.tailBottom&&(g.tailBottom+=c.bottom-v.bottom)):"middle"===f&&(d?(null!=g.tailLeft&&(g.tailLeft+=v.left-(g.popLeft+a.left)),null!=g.tailRight&&(g.tailRight+=g.popLeft+a.left+l.width-v.right)):(null!=g.tailTop&&(g.tailTop+=v.top-(g.popTop+a.top)),null!=g.tailBottom&&(g.tailBottom+=g.popTop+a.top+l.height-v.bottom)))}if(u){var y=o;if(this.get("offsets"))for(var x=this.get("offsets");x--;)y=y.offsetParent;var _=o.scrollWidth,w=o.scrollHeight;if(g.popLeft+l.width>_){var k=g.popLeft-(_-l.width);g.popLeft-=k,d&&g.tailLeft&&(g.tailLeft+=k),d&&g.tailRight&&(g.tailRight-=k),p&&!d&&(g.tail=!1)}if(g.popLeft<0){var T=-1*g.popLeft;g.popLeft+=T,d&&g.tailLeft&&(g.tailLeft-=T),d&&g.tailRight&&(g.tailRight+=T),p&&!d&&(g.tail=!1)}if(g.popTop+l.height>w){var L=g.popTop-(w-l.height);g.popTop-=L,!d&&g.tailTop&&(g.tailTop+=L),!d&&g.tailBottom&&(g.tailBottom-=L),p&&d&&(g.tail=!1)}if(g.popTop<0){var O=-1*g.popTop;g.popTop+=O,!d&&g.tailTop&&(g.tailTop-=O),!d&&g.tailBottom&&(g.tailBottom+=O),p&&d&&(g.tail=!1)}}if(a.left+g.popLeft<0){var B=0-(a.left+g.popLeft);g.popLeft+=B,d&&g.tailLeft&&(g.tailLeft-=B),d&&g.tailRight&&(g.tailRight+=B),p&&!d&&(g.tail=!1)}if(a.top+g.popTop<0){var A=0-(a.top+g.popTop);g.popTop+=A,!d&&g.tailTop&&(g.tailTop-=A),!d&&g.tailBottom&&(g.tailBottom+=A),p&&d&&(g.tail=!1)}g.tailLeft&&(g.tailLeft=Math.floor(g.tailLeft)),g.tailRight&&(g.tailRight=Math.floor(g.tailRight)),g.tailTop&&(g.tailTop=Math.floor(g.tailTop)),g.tailBottom&&(g.tailBottom=Math.floor(g.tailBottom)),this.set("position",g)}else this.set("position",null)}},t.prototype.show=function(e){return this.source=e,this.set("popped",!0),this._transdone},t.prototype.hide=function(){return this.set("popped",!1),this._transdone},t.prototype.popFind=function(e){return s?f.find(e):this.find(pattenr)},t.prototype.popFindAll=function(e){return s?f.findAll(e):this.findAll(pattenr)},t}(t);t.extendWith(u,{attributes:["popped","tail","where","align","top","left","fit","clickClose","noClickout","gap","offsets"],use:[o(),(void 0===p&&(p={}),function(e){e.instance.events[p.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: 21;\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: 20;\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,n=this,i=this._transdone=new Promise(function(e){return t=e});i.resolve=t,setTimeout(function(){n._transdone=i,n.get("popped")===e&&n.set("_popped",e)},1)},_popped:{handler:function(e){var t=this,n=this._transdone.resolve;if(e){var i=this.get("@style.raui.pop.mobile");if(i&&window.matchMedia("(max-width: "+i+")").matches){f||(f=new b({target:document.body,append:!0}));var r=this.getContext().getParent(!0);r.isContext=1,this.set("__popped",!1).then(n),f.unshift("contents",{content:this.partials.content,context:r,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?(f.shift("contents"),n()):this.set("__popped",!1).then(n)},defer:!0,init:!1},__popped:{handler:function(e){var t=this._transdone.resolve;if(e){var n=this.find("div"),i=n,r=i.offsetHeight+i.offsetTop,o=i.offsetWidth+i.offsetLeft,a=i.offsetParent;if(!this.overflows)for(var l=this.overflows={e:[],v:[]};n&&n.style;){if(n===a){if(n.offsetWidth>=o&&n.offsetHeight>=r)break;o+=n.offsetLeft,r+=n.offsetTop,a=n.offsetParent}var c=getComputedStyle(n);if("auto"===c.overflow)break;"hidden"===c.overflow&&(l.e.push(n),l.v.push(n.style.overflow),n.style.overflow="visible"),n=n.parentNode}this.position(),this.transition("pop",i,{intro:!0,dir:this.get("where")||"below"}).then(t)}else this.source=null,this.tailSource=null},defer:!0,init:!1},"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,r,o,a,l,c,s,f,p,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&&f?(f.cancel(),f=0,p&&(p.disconnect(),p=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 r=m.checked;r&&!~e.className.indexOf("checked")?e.className+=" checked":!r&&~e.className.indexOf("checked")&&(e.className=e.className.replace(/\bchecked\b/g,"").replace(/ +/g," ").trim())},MutationObserver&&(p=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}),f=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}))),(r=!!e.querySelector("textarea"))&&!~b.indexOf("textarea")&&b.push("textarea"),(o=!!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 f=e.className;return t||(f=f.replace(/\bfield\b/g,"").trim()),n||(f=f.replace(/\bcheck(ed)?\b/g,"").trim()),i||(f=f.replace(/\bradio\b/g,"").trim()),r||(f=f.replace(/\btextarea\b/g,"").trim()),o||(f=f.replace(/\bselect\b/g,"").trim()),a||(f=f.replace(/\bfile\b/g,"").trim()),l||(f=f.replace(/\bbutton\b/g,"").trim()),c||(f=f.replace(/\bplain\b/g,"").trim()),s||(f=f.replace(/\binput\b/g,"").trim()),f=f.replace(/ +/g," ")}var x=b.listen("focusin",h),_=b.listen("focusout",g);v.call(this);var w={update:m,invalidate:v.bind(this),teardown:function(){b.ractive.fire("fieldUnregistered",b,e,w);var t=y();t=t.replace(/\bfocus\b/g,"").trim(),x.cancel(),_.cancel(),f&&f.cancel(),p&&p.disconnect(),u&&(delete u.checked,d=u=void 0),e.className=t},setDisabled:function(t){e.querySelectorAll("input,button,select,textarea").forEach(function(e){return e.disabled=t}),this.invalidate()}};return b.ractive.fire("fieldRegistered",b,e,w),w}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:[o(),c()],observe:{contents:function(e){s=(e||[]).length>0}},on:{init:function(){f?console.warn("More than one PopOver mobile host created."):f=this}}}),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=Object.assign({},e("raui.primary.disabled"),e("raui.form.primary.disabled")),r=e("raui.form.boxy");return"\n label.field, .field-manual {\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: "+(r?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 "+(r?"":"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 .field-manual .field-body\n {\n display: block;\n border-width: "+(r?"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: "+(r?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;"+(r?"\n border-radius: "+(t.radius||"0.2em")+";":"")+"\n font-weight: 400;\n font-family: inherit;\n }\n\n label.field input"+(r?"":":disabled")+",\n label.field select"+(r?"":":disabled")+" {\n padding: 0 0.75em;\n }\n label.field select"+(r?"":":disabled")+" {\n padding-right: 2em;\n }\n\n label.field input:disabled,\n label.field input[readonly],\n label.field select:disabled,\n label.field textarea:disabled,\n label.field textarea[readonly] {\n background: "+(i.bg||"#f4f4f4")+";\n color: "+(i.fg||"#444")+";\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 "+(r?"":"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, label.field.radio {\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, label.field.radio.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input, 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.5em;\n top: 1em;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 3.2em;\n height: 3.2em;\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, label.field.inline.radio input {\n top: -0.45em;\n left: -0.55em;\n }\n\n label.field.check input:checked, label.field.radio input:checked {\n background-color: "+(t.fga||"#07e")+";\n }\n\n label.field.check:hover > input, label.field.radio:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus, label.field.radio input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus, label.field.radio:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active, label.field.radio input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before, label.field.radio:before {\n content: '';\n display: inline-block;\n box-sizing: border-box;\n margin: 0 0.5em 0.2em 0.1em;\n border: solid 0.125em; /* Safari */\n border-color: "+(t.fg||"#222")+';\n border-radius: 0.125em;\n width: 1.2em;\n height: 1.2em;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after, label.field.radio:after {\n content: \'\';\n display: inline-block;\n opacity: 0;\n position: absolute;\n width: 1.2em;\n height: 1.2em;\n top: 2.3em;\n left: 0.6em;\n border-radius: 0.125em;\n }\n label.field.check.inline:after, label.field.radio.inline:after {\n top: 0.8em;\n }\n\n label.field.check.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="'+(t.bg||"#fff").replace(/#/g,"%23")+'" d="m 15.378906,1.7050781 a 1.0583349,1.0583349 0 0 0 -1.478515,0.234375 L 6.6210937,11.960938 1.8652344,8.5058594 a 1.0583349,1.0583349 0 0 0 -1.47851565,0.234375 1.0583349,1.0583349 0 0 0 0.234375,1.4785156 L 6.234375,14.294922 A 1.0584408,1.0584408 0 0 0 7.7128906,14.060547 L 15.613281,3.1835938 A 1.0583349,1.0583349 0 0 0 15.378906,1.7050781 Z" /></svg>\') '+(t.fga||"#07e")+';\n }\n\n label.field.radio.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><circle fill="'+(t.bg||"#fff").replace(/#/g,"%23")+'" cx="8" cy="8" r="5" /></svg>\') '+(t.fga||"#07e")+";\n }\n\n label.field.check.checked:before, label.field.radio.checked:before {\n border-color: "+(t.fga||"#07e")+";\n }\n label.field.check.focus:before, label.field.radio.focus:before {\n border-color: "+(t.fga||"#07e")+";\n }\n\n label.field.check input:disabled, label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled, label.field.radio.disabled {\n color: "+(i.fg||"#444")+";\n cursor: initial;\n }\n\n label.field.check.disabled:before, label.field.radio.disabled:before {\n border-color: "+(i.bc||"#ccc")+";\n background-color: "+(i.bg||"#f4f4f4")+";\n }\n\n label.field.check.checked.disabled:after, label.field.radio.checked.disabled:after {\n border-color: transparent;\n background-color: "+(i.bc||"#ccc")+";\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: 1.125em;\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;"+(r?"\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 "+(r?"":"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: "+(r?"center":"left")+";\n padding: 0.5em "+(r?"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;"+(r?"\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: "+(r?"1.7":"1.958")+"em;\n }\n label.field .with-buttons button, label.field.button button {\n font-size: 1.1em;\n margin-top: "+(r?"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 "+(r?"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 }"+(r?"\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 min-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."+(r?"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=[],i=(e.template.m||[]).slice(),r=e.template.f||[],o=i.find(function(e){return"value"===e.n}),a=i.find(function(e){return"type"===e.n}),l=i.find(function(e){return"tip"===e.n}),c=i.find(function(e){return"disabled"===e.n});if(l&&i.splice(i.indexOf(l),1),a&&"function"==typeof x.types[a.f])t.push.apply(t,x.types[a.f](i,r,e));else if(o){var s={t:7,e:"input",m:[o]};if(c&&s.m.push(c),y(r,"option")&&(s.e="select",s.f=r),a&&(s.m.push(a),"checkbox"===a.f||"radio"===a.f)){var f=i.find(function(e){return"target"===e.n});f?s.m.push(Object.assign({},f,{n:"name"})):s.m.splice(s.m.indexOf(o),1,Object.assign({},o,{n:"checked"}))}s.m=s.m.concat(i.filter(function(e){return 73===e.t||73===e.t||"placeholder"===e.n})),t.push(s);var p=r.filter(function(e){return"button"===e.e||y(e.f,"button")});p.length&&(t.push.apply(t,p),t=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:t}])}else{r.forEach(function(e){"label"===e.e?e.f&&e.f.length&&n.push.apply(n,e.f):t.push(e)});var d=r.filter(function(e){return e.e});d.find(function(e){return"button"===e.e})&&d.length>1&&(t=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:t}])}var u=i.find(function(e){return"label"===e.n});u&&u.f&&u.f.length&&n.push.apply(n,Array.isArray(u.f)?u.f:[u.f]),l&&t.unshift({t:7,e:"span",m:[{t:13,n:"class",f:"field-tip"+(n.length?"":" field-solo-tip"),g:1},{t:13,n:"title",f:l.f},{t:70,n:["click"],f:{r:[],s:"[false]"}}],f:"?"});var b=i.find(function(e){return"inline"===e.n});n&&!b?t.unshift.apply(t,n):b||t.unshift(" ");var m={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&&"disabled"!==e.n})),f:t};b&&m.m.push({t:13,n:"class",f:"inline"}),e.setTemplate([m])});function _(e){return"function"==typeof e.focus&&e.focus(),{teardown:m}}x.types={},i("field","decorators",v),i("field","partials",x),i("autofocus","decorators",_);var w={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:["blur"],t:70,f:{r:["rac","@node"],s:"[_0.checkBlur(_1)]"}},{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:"div",m:[{t:13,n:"class",f:"rac-drop",g:1},{n:["click"],t:70,f:{r:["rac.pop","@context"],s:'[_0.show((_1).find("input"))]'}}]}," ",{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:["blur"],t:70,f:{r:["rac"],s:"[_0.checkBlur()]"}},{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},{t:4,f:[{n:"class-rac-selected",t:13,f:[{t:2,x:{r:["rac.value","."],s:"_0===_1"}}]}],n:50,r:"rac.valueBound"},{n:"class-rac-hover",t:13,f:[{t:2,x:{r:["rac.selected","@index"],s:"_0===_1"}}]},{t:4,f:[{n:["click"],t:70,f:{r:["@context",".","rac"],s:'[(_0).set("rac.value",_1),_2._drawDisplay()]'}},{n:["mouseover"],t:70,f:{r:["@context","@index"],s:'[(_0).set("rac.selected",_1)]'}}],n:50,r:"rac.popped"}],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.checkBlur(_1)]":function(e,t){return[e.checkBlur(t)]},"[_0.input(_1)]":function(e,t){return[e.input(t)]},"[_0.key(_1)]":function(e,t){return[e.key(t)]},'[_0.show((_1).find("input"))]':function(e,t){return[e.show(t.find("input"))]},'[(_0).raise("pop",{},_1)]':function(e,t){return[e.raise("pop",{},t)]},"[_0.checkBlur()]":function(e){return[e.checkBlur()]},"_0===_1":function(e,t){return e===t},'[(_0).set("rac.value",_1),_2._drawDisplay()]':function(e,t,n){return[e.set("rac.value",t),n._drawDisplay()]},'[(_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 T=["INPUT","SELECT","TEXTAREA","BUTTON","BODY"],L=t.macro(function(e){var n,i,r;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 r,o=e.get("rac._display");try{r=new RegExp(t||"","i")}catch(e){r=new RegExp((t||"").replace(/([\{\(\[\]\)\}\?\*\^\$])/g,"\\$1"))}e.set("rac.list",n.filter(function(e){return r.test(o(e))}))}else e.set("rac.list",[])}function a(t,n){var i=e.get("rac.default");return null==(t=null!=t||n?t:e.get("rac.value"))&&i&&(t="function"==typeof i?i(e.get("rac.display")):i),t}function l(n,r,l){var s=e.get("rac.displayprop");if(e.get("rac.__display")!==s||void 0===e.get("rac._display")){var f=function(){return e.attributes["display-value"]?e.get("rac.display"):"(none)"};if("string"==typeof s){var p=t.splitKeypath(s);s=function(e){return null==e&&(e=a()),null==e?f():k(e,p)}}else if(Array.isArray(s)){var d=s;s=function(e){return null==e&&(e=a()),null==e?f():k(e,d)}}else s||(s=function(e){return null==e&&(e=a()),null==e?f():""+e});e.set("rac._display",s),e.set("rac.__display",e.get("rac.displayprop")),e.set("rac.display",s(e.get("rac.value")))}if(s=e.get("rac.member"),e.get("rac.__member")!==s||void 0===e.get("rac._member")){if("string"==typeof s){var u=t.splitKeypath(s);s=function(e){return k(a(e),u)}}else if(Array.isArray(s)){var b=s;s=function(e){return k(a(e),b)}}else s||(s=function(e){return a(e)});e.set("rac._member",s),e.set("rac.__member",e.get("rac.member"))}s=e.get("rac.items"),e.get("rac.__items")===s&&void 0!==e.get("rac._items")||(Array.isArray(s)?e.set("rac._items",s):"function"==typeof s?e.set("rac._items",s):"object"==typeof s&&"function"==typeof s.then?s.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)&&c(),o()}function c(){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 s(t){(t.items&&e.link(t.items,"rac.items"),t.value&&e.link(t.value,"rac._value"),e.set("rac.valueBound",!!t.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",!("fit"in t)||t.fit)):e.set("rac.fit","fit"in t&&t.fit),e.set("rac.limit",t["limit-set"]),e.set("rac.default",t.default),e.get("rac.limit")&&e.get("input"))&&(e.get("input")!==document.activeElement&&c());l()}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"),r=e.get("rac.list");38===n?i<=0||null==i?e.set("rac.selected",Array.isArray(r)?r.length-1:0):e.set("rac.selected",i-1):Array.isArray(r)?e.set("rac.selected",i<r.length-1?i+1:0):e.set("rac.selected",0)}else if(10===n||13===n){var o=e.get("rac.list");Array.isArray(o)&&(e.set("rac.value",o[e.get("rac.selected")]),c())}else if(9===n){if(e.get("rac.popped")){var l=e.get("rac.list");if(Array.isArray(l)){var s=l[e.get("rac.selected")];null==s&&(s=a(s,!0)),e.set("rac.value",s)}e.get("rac.limit")||setTimeout(function(){return c()},140)}else null!=e.get("rac.value")&&~e.get("rac.selected")&&e.get("rac.display")==e.get("rac.tempDisplay")||e.set("rac.value",a(null,!0));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);var i=e.find("input");i&&document.activeElement===i&&e.get("rac.pop").show(i)},500),e.attributes.lazy||e.set("rac.display",t.target.value)}),e.setTemplate(w),e.set("rac._drawDisplay",c),e.set("rac.updateDisplay",function(t){setTimeout(function(){i&&e.get("rac.limit")&&!i.contains(document.activeElement)&&c()},140)}),s(e.attributes);var f=!1,p={init:!1,defer:!0},d=[e.observe("rac.displayprop",l,p),e.observe("rac.memberprop",l,p),e.observe("rac.items",l,p),e.observe("rac.list",function(t){Array.isArray(t)?e.set("rac.selected",t.indexOf(e.get("rac.value"))):e.set("rac.selected",-1)},p),e.observe("rac.value",function(t){c(),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),!i&&null!=t&&e.get("rac.valueBound")&&(e.set("rac.display",t),l())}),e.observe("rac.selected",function(){r&&clearTimeout(n),r=setTimeout(function(){r=null;var t=e.find(".rac-hover");t&&t.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},14)}),e.observe("rac.popped",function(e){e&&setTimeout(function(){return f=!1},300),f=!0})];return e.set("rac.checkBlur",function(t){if(f)return!1;var n=document.activeElement;if(~T.indexOf(n.nodeName)||n.getAttribute("tabindex")){var i=e.findAll("input").concat(e.get("rac.pop").popFindAll("input"));document.activeElement&&!~i.indexOf(document.activeElement)&&e.get("rac.key")({which:9})}}),{teardown:function(){e.unlink("rac.items"),e.unlink("rac._value"),e.unlink("rac.selected"),e.unlink("rac.display"),d.forEach(function(e){return e.cancel()})},update:s,render:function(){i=e.find("span")}}},{attributes:["items","selected","display","value","member","limit-set","fit","offsets","display-value","default"],css:function(e){return[function(e){var t=Object.assign({},e("raui.primary"),e("raui.autocomplete"),e("raui.autocomplete.primary")),n=Object.assign({},e("raui.autocomplete.drop"),e("raui.autocomplete.primary.drop")),i=e("raui.form.boxy");return".rautocomplete {\n position: relative;\n display: inline-block;\n }\n \n .rac-drop {\n width: 2em;\n height: 100%;\n position: absolute;\n top: 0;\n right: 2px;\n cursor: pointer;\n }\n .rac-drop:after {\n font-family: "+(n.font||"sans-serif")+";\n content: "+(n.string||"'▾'")+";\n position: absolute;\n top: calc(50% - 0.5em);\n height: 1em;\n line-height: 1em;\n width: 100%;\n text-align: center;\n font-weight: "+(n.weight||"normal")+";\n color: "+(n.color||t.bc||"#ccc")+";\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-selected.rac-hover {\n background-color: "+(t.bc||"#ccc")+";\n color: "+(t.fga||"#07e")+";\n }\n \n .rac-invalid {\n cursor: not-allowed;\n }\n \n input.rac-modal {\n width: 100%;\n box-sizing: border-box;\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 }"}.call(this,e)].join(" ")},cssId:"rautocomplete",noCssTransform:!0});function O(e){return void 0===e&&(e={}),function(t){var n=t.instance;n.partials[e.name||"autocomplete"]=L,n.components["rac-pop"]=u,n.decorators.autocompletefocus=_}}e.Autocomplete=L,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=O,e.default=O,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.RauiAutocomplete={},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,{capture:!0}),document.body.addEventListener("touchstop",o,{capture:!0}))}),{teardown:function(){i=!0,n&&(document.body.removeEventListener("click",o,{capture:!0}),document.body.removeEventListener("touchstop",o,{capture:!0}))}}}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,f,p,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?3:0)"}},"px"],t:13}],n:50,x:{r:["position.tailTop"],s:"_0!=null"}},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?3:0)"}},"px"],t:13}],n:50,x:{r:["position.tailBottom"],s:"_0!=null"}},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:3)"}},"px"],t:13}],n:50,x:{r:["position.tailLeft"],s:"_0!=null"}},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:3)"}},"px"],t:13}],n:50,x:{r:["position.tailRight"],s:"_0!=null"}}]}," ",{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,x:{r:["position.tailTop"],s:"_0!=null"}},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,x:{r:["position.tailBottom"],s:"_0!=null"}},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,x:{r:["position.tailLeft"],s:"_0!=null"}},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,x:{r:["position.tailRight"],s:"_0!=null"}}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content",z:[{n:"trigger",x:{r:"triggerContext"}}]}]}]}],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?3:0)":function(e,t){return e+(t?3:0)},"_0!=null":function(e){return null!=e},"_0+(_1?0:3)":function(e,t){return e+(t?0:3)},"_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(t){var n=t||this.source,i=this.get("popped");if(n&&i){var o=this.find("div");if(n&&o&&o.offsetParent){n?this.set("triggerContext",e.getContext(n)):this.set("triggerContext",null);var r=o.offsetParent,a=r.getBoundingClientRect(),l=o.getBoundingClientRect(),c=n.getBoundingClientRect(),s=this.get("where")||"below",f=this.get("align")||"middle",p=this.get("tail"),d="above"===s||"below"===s,u=this.get("fit"),b=this.get("gap"),m="above"===s||"below"===s?0:"left"===s?-l.width-b:c.width+b,h="left"===s||"right"===s?-c.height:"above"===s?-c.height-l.height-b:b;"middle"===f?"below"===s||"above"===s?m-=(l.width-c.width)/2:"left"!==s&&"right"!==s||(h-=(l.height-c.height)/2):"end"===f&&("below"===s||"above"===s?m+=c.width-l.width:"left"!==s&&"right"!==s||(h+=c.height-l.height));var g={popTop:c.bottom-a.top+h,popLeft:c.left-a.left+m,tail:p,vert:"above"===s||"below"===s};if(r.scrollTop&&(g.popTop+=r.scrollTop),r.scrollLeft&&(g.popLeft+=r.scrollLeft),p){"above"===s?g.tailBottom=-10:"below"===s?g.tailTop=-10:"left"===s?g.tailRight=-10:"right"===s&&(g.tailLeft=-10);var v=this.tailSource?this.tailSource.getBoundingClientRect():c;"start"===f?d?g.tailLeft=Math.floor(v.width/2)-10:g.tailTop=Math.floor(v.height/2)-10:"end"===f?d?g.tailRight=Math.floor(v.width/2)-10:g.tailBottom=Math.floor(v.height/2)-10:"middle"===f&&(d?g.tailLeft=Math.floor(v.width/2)-10:g.tailTop=Math.floor(v.height/2)-10),v!==c?d?(null!=g.tailLeft&&(g.tailLeft+=v.left-c.left),null!=g.tailRight&&(g.tailRight+=c.right-v.right)):(null!=g.tailTop&&(g.tailTop+=v.top-c.top),null!=g.tailBottom&&(g.tailBottom+=c.bottom-v.bottom)):"middle"===f&&(d?(null!=g.tailLeft&&(g.tailLeft+=v.left-(g.popLeft+a.left)),null!=g.tailRight&&(g.tailRight+=g.popLeft+a.left+l.width-v.right)):(null!=g.tailTop&&(g.tailTop+=v.top-(g.popTop+a.top)),null!=g.tailBottom&&(g.tailBottom+=g.popTop+a.top+l.height-v.bottom)))}if(u){var y=r;if(this.get("offsets"))for(var x=this.get("offsets");x--;)y=y.offsetParent;var _=r.scrollWidth,w=r.scrollHeight;if(g.popLeft+l.width>_){var k=g.popLeft-(_-l.width);g.popLeft-=k,d&&g.tailLeft&&(g.tailLeft+=k),d&&g.tailRight&&(g.tailRight-=k),p&&!d&&(g.tail=!1)}if(g.popLeft<0){var T=-1*g.popLeft;g.popLeft+=T,d&&g.tailLeft&&(g.tailLeft-=T),d&&g.tailRight&&(g.tailRight+=T),p&&!d&&(g.tail=!1)}if(g.popTop+l.height>w){var L=g.popTop-(w-l.height);g.popTop-=L,!d&&g.tailTop&&(g.tailTop+=L),!d&&g.tailBottom&&(g.tailBottom-=L),p&&d&&(g.tail=!1)}if(g.popTop<0){var O=-1*g.popTop;g.popTop+=O,!d&&g.tailTop&&(g.tailTop-=O),!d&&g.tailBottom&&(g.tailBottom+=O),p&&d&&(g.tail=!1)}}if(a.left+g.popLeft<0){var B=0-(a.left+g.popLeft);g.popLeft+=B,d&&g.tailLeft&&(g.tailLeft-=B),d&&g.tailRight&&(g.tailRight+=B),p&&!d&&(g.tail=!1)}if(a.top+g.popTop<0){var A=0-(a.top+g.popTop);g.popTop+=A,!d&&g.tailTop&&(g.tailTop-=A),!d&&g.tailBottom&&(g.tailBottom+=A),p&&d&&(g.tail=!1)}g.tailLeft&&(g.tailLeft=Math.floor(g.tailLeft)),g.tailRight&&(g.tailRight=Math.floor(g.tailRight)),g.tailTop&&(g.tailTop=Math.floor(g.tailTop)),g.tailBottom&&(g.tailBottom=Math.floor(g.tailBottom)),this.set("position",g)}else this.set("position",null)}},t.prototype.show=function(e){return this.source=e,this.set("popped",!0),this._transdone},t.prototype.hide=function(){return this.set("popped",!1),this._transdone},t.prototype.popFind=function(e){return s?f.find(e):this.find(pattenr)},t.prototype.popFindAll=function(e){return s?f.findAll(e):this.findAll(pattenr)},t}(t);t.extendWith(u,{attributes:["popped","tail","where","align","top","left","fit","clickClose","noClickout","gap","offsets"],use:[r(),(void 0===p&&(p={}),function(e){e.instance.events[p.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: 21;\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: 20;\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,n=this,i=this._transdone=new Promise(function(e){return t=e});i.resolve=t,setTimeout(function(){n._transdone=i,n.get("popped")===e&&n.set("_popped",e)},1)},_popped:{handler:function(e){var t=this,n=this._transdone.resolve;if(e){var i=this.get("@style.raui.pop.mobile");if(i&&window.matchMedia("(max-width: "+i+")").matches){f||(f=new b({target:document.body,append:!0}));var o=this.getContext().getParent(!0);o.isContext=1,this.set("__popped",!1).then(n),f.unshift("contents",{content:this.partials.content,context:o,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?(f.shift("contents"),n()):this.set("__popped",!1).then(n)},defer:!0,init:!1},__popped:{handler:function(e){var t=this._transdone.resolve;if(e){var n=this.find("div"),i=n,o=i.offsetHeight+i.offsetTop,r=i.offsetWidth+i.offsetLeft,a=i.offsetParent;if(!this.overflows)for(var l=this.overflows={e:[],v:[]};n&&n.style;){if(n===a){if(n.offsetWidth>=r&&n.offsetHeight>=o)break;r+=n.offsetLeft,o+=n.offsetTop,a=n.offsetParent}var c=getComputedStyle(n);if("auto"===c.overflow)break;"hidden"===c.overflow&&(l.e.push(n),l.v.push(n.style.overflow),n.style.overflow="visible"),n=n.parentNode}this.position(),this.transition("pop",i,{intro:!0,dir:this.get("where")||"below"}).then(t)}else this.source=null,this.tailSource=null},defer:!0,init:!1},"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,f,p,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&&f?(f.cancel(),f=0,p&&(p.disconnect(),p=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&&(p=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}),f=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 f=e.className;return t||(f=f.replace(/\bfield\b/g,"").trim()),n||(f=f.replace(/\bcheck(ed)?\b/g,"").trim()),i||(f=f.replace(/\bradio\b/g,"").trim()),o||(f=f.replace(/\btextarea\b/g,"").trim()),r||(f=f.replace(/\bselect\b/g,"").trim()),a||(f=f.replace(/\bfile\b/g,"").trim()),l||(f=f.replace(/\bbutton\b/g,"").trim()),c||(f=f.replace(/\bplain\b/g,"").trim()),s||(f=f.replace(/\binput\b/g,"").trim()),f=f.replace(/ +/g," ")}var x=b.listen("focusin",h),_=b.listen("focusout",g);v.call(this);var w={update:m,invalidate:v.bind(this),teardown:function(){b.ractive.fire("fieldUnregistered",b,e,w);var t=y();t=t.replace(/\bfocus\b/g,"").trim(),x.cancel(),_.cancel(),f&&f.cancel(),p&&p.disconnect(),u&&(delete u.checked,d=u=void 0),e.className=t},setDisabled:function(t){e.querySelectorAll("input,button,select,textarea").forEach(function(e){return e.disabled=t}),this.invalidate()}};return b.ractive.fire("fieldRegistered",b,e,w),w}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()],observe:{contents:function(e){s=(e||[]).length>0}},on:{init:function(){f?console.warn("More than one PopOver mobile host created."):f=this}}}),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=Object.assign({},e("raui.primary.disabled"),e("raui.form.primary.disabled")),o=e("raui.form.boxy");return"\n label.field, .field-manual {\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: "+(o?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 "+(o?"":"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 .field-manual .field-body\n {\n display: block;\n border-width: "+(o?"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: "+(o?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;"+(o?"\n border-radius: "+(t.radius||"0.2em")+";":"")+"\n font-weight: 400;\n font-family: inherit;\n }\n\n label.field input"+(o?"":":disabled")+",\n label.field select"+(o?"":":disabled")+" {\n padding: 0 0.75em;\n }\n label.field select"+(o?"":":disabled")+" {\n padding-right: 2em;\n }\n\n label.field input:disabled,\n label.field input[readonly],\n label.field select:disabled,\n label.field textarea:disabled,\n label.field textarea[readonly] {\n background: "+(i.bg||"#f4f4f4")+";\n color: "+(i.fg||"#444")+";\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 "+(o?"":"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, label.field.radio {\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, label.field.radio.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input, 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.5em;\n top: 1em;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 3.2em;\n height: 3.2em;\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, label.field.inline.radio input {\n top: -0.45em;\n left: -0.55em;\n }\n\n label.field.check input:checked, label.field.radio input:checked {\n background-color: "+(t.fga||"#07e")+";\n }\n\n label.field.check:hover > input, label.field.radio:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus, label.field.radio input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus, label.field.radio:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active, label.field.radio input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before, label.field.radio:before {\n content: '';\n display: inline-block;\n box-sizing: border-box;\n margin: 0 0.5em 0.2em 0.1em;\n border: solid 0.125em; /* Safari */\n border-color: "+(t.fg||"#222")+';\n border-radius: 0.125em;\n width: 1.2em;\n height: 1.2em;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after, label.field.radio:after {\n content: \'\';\n display: inline-block;\n opacity: 0;\n position: absolute;\n width: 1.2em;\n height: 1.2em;\n top: 2.3em;\n left: 0.6em;\n border-radius: 0.125em;\n }\n label.field.check.inline:after, label.field.radio.inline:after {\n top: 0.8em;\n }\n\n label.field.check.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="'+(t.bg||"#fff").replace(/#/g,"%23")+'" d="m 15.378906,1.7050781 a 1.0583349,1.0583349 0 0 0 -1.478515,0.234375 L 6.6210937,11.960938 1.8652344,8.5058594 a 1.0583349,1.0583349 0 0 0 -1.47851565,0.234375 1.0583349,1.0583349 0 0 0 0.234375,1.4785156 L 6.234375,14.294922 A 1.0584408,1.0584408 0 0 0 7.7128906,14.060547 L 15.613281,3.1835938 A 1.0583349,1.0583349 0 0 0 15.378906,1.7050781 Z" /></svg>\') '+(t.fga||"#07e")+';\n }\n\n label.field.radio.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><circle fill="'+(t.bg||"#fff").replace(/#/g,"%23")+'" cx="8" cy="8" r="5" /></svg>\') '+(t.fga||"#07e")+";\n }\n\n label.field.check.checked:before, label.field.radio.checked:before {\n border-color: "+(t.fga||"#07e")+";\n }\n label.field.check.focus:before, label.field.radio.focus:before {\n border-color: "+(t.fga||"#07e")+";\n }\n\n label.field.check input:disabled, label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled, label.field.radio.disabled {\n color: "+(i.fg||"#444")+";\n cursor: initial;\n }\n\n label.field.check.disabled:before, label.field.radio.disabled:before {\n border-color: "+(i.bc||"#ccc")+";\n background-color: "+(i.bg||"#f4f4f4")+";\n }\n\n label.field.check.checked.disabled:after, label.field.radio.checked.disabled:after {\n border-color: transparent;\n background-color: "+(i.bc||"#ccc")+";\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: 1.125em;\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;"+(o?"\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 "+(o?"":"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: "+(o?"center":"left")+";\n padding: 0.5em "+(o?"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;"+(o?"\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: "+(o?"1.7":"1.958")+"em;\n }\n label.field .with-buttons button, label.field.button button {\n font-size: 1.1em;\n margin-top: "+(o?"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 "+(o?"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 }"+(o?"\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 min-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."+(o?"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=[],i=(e.template.m||[]).slice(),o=e.template.f||[],r=i.find(function(e){return"value"===e.n}),a=i.find(function(e){return"type"===e.n}),l=i.find(function(e){return"tip"===e.n}),c=i.find(function(e){return"disabled"===e.n});if(l&&i.splice(i.indexOf(l),1),a&&"function"==typeof x.types[a.f])t.push.apply(t,x.types[a.f](i,o,e));else if(r){var s={t:7,e:"input",m:[r]};if(c&&s.m.push(c),y(o,"option")&&(s.e="select",s.f=o),a&&(s.m.push(a),"checkbox"===a.f||"radio"===a.f)){var f=i.find(function(e){return"target"===e.n});f?s.m.push(Object.assign({},f,{n:"name"})):s.m.splice(s.m.indexOf(r),1,Object.assign({},r,{n:"checked"}))}s.m=s.m.concat(i.filter(function(e){return 73===e.t||73===e.t||"placeholder"===e.n})),t.push(s);var p=o.filter(function(e){return"button"===e.e||y(e.f,"button")});p.length&&(t.push.apply(t,p),t=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:t}])}else{o.forEach(function(e){"label"===e.e?e.f&&e.f.length&&n.push.apply(n,e.f):t.push(e)});var d=o.filter(function(e){return e.e});d.find(function(e){return"button"===e.e})&&d.length>1&&(t=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:t}])}var u=i.find(function(e){return"label"===e.n});u&&u.f&&u.f.length&&n.push.apply(n,Array.isArray(u.f)?u.f:[u.f]),l&&t.unshift({t:7,e:"span",m:[{t:13,n:"class",f:"field-tip"+(n.length?"":" field-solo-tip"),g:1},{t:13,n:"title",f:l.f},{t:70,n:["click"],f:{r:[],s:"[false]"}}],f:"?"});var b=i.find(function(e){return"inline"===e.n});n&&!b?t.unshift.apply(t,n):b||t.unshift(" ");var m={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&&"disabled"!==e.n})),f:t};b&&m.m.push({t:13,n:"class",f:"inline"}),e.setTemplate([m])});function _(e,t){return"function"!=typeof e.focus||e.disabled||(t&&t.immediate?e.focus():setTimeout(function(){return!e.disabled&&e.focus()},(t||{}).timeout||250)),{teardown:m}}x.types={},i("field","decorators",v),i("field","partials",x),i("autofocus","decorators",_);var w={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:["blur"],t:70,f:{r:["rac","@node"],s:"[_0.checkBlur(_1)]"}},{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:"div",m:[{t:13,n:"class",f:"rac-drop",g:1},{n:["click"],t:70,f:{r:["rac.pop","@context"],s:'[_0.show((_1).find("input"))]'}}]}," ",{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:["blur"],t:70,f:{r:["rac"],s:"[_0.checkBlur()]"}},{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},{t:4,f:[{n:"class-rac-selected",t:13,f:[{t:2,x:{r:["rac.value","."],s:"_0===_1"}}]}],n:50,r:"rac.valueBound"},{n:"class-rac-hover",t:13,f:[{t:2,x:{r:["rac.selected","@index"],s:"_0===_1"}}]},{t:4,f:[{n:["click"],t:70,f:{r:["@context",".","rac"],s:'[(_0).set("rac.value",_1),_2._drawDisplay()]'}},{n:["mouseover"],t:70,f:{r:["@context","@index"],s:'[(_0).set("rac.selected",_1)]'}}],n:50,r:"rac.popped"}],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.checkBlur(_1)]":function(e,t){return[e.checkBlur(t)]},"[_0.input(_1)]":function(e,t){return[e.input(t)]},"[_0.key(_1)]":function(e,t){return[e.key(t)]},'[_0.show((_1).find("input"))]':function(e,t){return[e.show(t.find("input"))]},'[(_0).raise("pop",{},_1)]':function(e,t){return[e.raise("pop",{},t)]},"[_0.checkBlur()]":function(e){return[e.checkBlur()]},"_0===_1":function(e,t){return e===t},'[(_0).set("rac.value",_1),_2._drawDisplay()]':function(e,t,n){return[e.set("rac.value",t),n._drawDisplay()]},'[(_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 T=["INPUT","SELECT","TEXTAREA","BUTTON","BODY"],L=t.macro(function(e){var n,i,o;function r(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 a(t,n){var i=e.get("rac.default");return null==(t=null!=t||n?t:e.get("rac.value"))&&i&&(t="function"==typeof i?i(e.get("rac.display")):i),t}function l(n,o,l){var s=e.get("rac.displayprop");if(e.get("rac.__display")!==s||void 0===e.get("rac._display")){var f=function(){return e.attributes["display-value"]?e.get("rac.display"):"(none)"};if("string"==typeof s){var p=t.splitKeypath(s);s=function(e){return null==e&&(e=a()),null==e?f():k(e,p)}}else if(Array.isArray(s)){var d=s;s=function(e){return null==e&&(e=a()),null==e?f():k(e,d)}}else s||(s=function(e){return null==e&&(e=a()),null==e?f():""+e});e.set("rac._display",s),e.set("rac.__display",e.get("rac.displayprop")),e.set("rac.display",s(e.get("rac.value")))}if(s=e.get("rac.member"),e.get("rac.__member")!==s||void 0===e.get("rac._member")){if("string"==typeof s){var u=t.splitKeypath(s);s=function(e){return k(a(e),u)}}else if(Array.isArray(s)){var b=s;s=function(e){return k(a(e),b)}}else s||(s=function(e){return a(e)});e.set("rac._member",s),e.set("rac.__member",e.get("rac.member"))}s=e.get("rac.items"),e.get("rac.__items")===s&&void 0!==e.get("rac._items")||(Array.isArray(s)?e.set("rac._items",s):"function"==typeof s?e.set("rac._items",s):"object"==typeof s&&"function"==typeof s.then?s.then(function(t){e.set("rac._items",t),r()}):e.set("rac._items",[]),e.set("rac.__items",e.get("rac.items"))),i&&"rac.display"===l&&e.get("rac.limit")&&!i.contains(document.activeElement)&&c(),r()}function c(){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 s(t){(t.items&&e.link(t.items,"rac.items"),t.value&&e.link(t.value,"rac._value"),e.set("rac.valueBound",!!t.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",!("fit"in t)||t.fit)):e.set("rac.fit","fit"in t&&t.fit),e.set("rac.limit",t["limit-set"]),e.set("rac.default",t.default),e.get("rac.limit")&&e.get("input"))&&(e.get("input")!==document.activeElement&&c());l()}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-1?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")]),c())}else if(9===n){if(e.get("rac.popped")){var l=e.get("rac.list");if(Array.isArray(l)){var s=l[e.get("rac.selected")];null==s&&(s=a(s,!0)),e.set("rac.value",s)}e.get("rac.limit")||setTimeout(function(){return c()},140)}else null!=e.get("rac.value")&&~e.get("rac.selected")&&e.get("rac.display")==e.get("rac.tempDisplay")||e.set("rac.value",a(null,!0));e.set("rac.popped",!1),e.get("rac.updateDisplay")()}}),e.set("rac.input",function(t){n&&clearTimeout(n),n=setTimeout(function(){n=null,r(t.target.value);var i=e.find("input");i&&document.activeElement===i&&e.get("rac.pop").show(i)},500),e.attributes.lazy||e.set("rac.display",t.target.value)}),e.setTemplate(w),e.set("rac._drawDisplay",c),e.set("rac.updateDisplay",function(t){setTimeout(function(){i&&e.get("rac.limit")&&!i.contains(document.activeElement)&&c()},140)}),s(e.attributes);var f=!1,p={init:!1,defer:!0},d=[e.observe("rac.displayprop",l,p),e.observe("rac.memberprop",l,p),e.observe("rac.items",l,p),e.observe("rac.list",function(t){Array.isArray(t)?e.set("rac.selected",t.indexOf(e.get("rac.value"))):e.set("rac.selected",-1)},p),e.observe("rac.value",function(t){c(),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),!i&&null!=t&&e.get("rac.valueBound")&&(e.set("rac.display",t),l())}),e.observe("rac.selected",function(){o&&clearTimeout(n),o=setTimeout(function(){o=null;var t=e.find(".rac-hover");t&&t.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},14)}),e.observe("rac.popped",function(e){e&&setTimeout(function(){return f=!1},300),f=!0})];return e.set("rac.checkBlur",function(t){if(f)return!1;var n=document.activeElement;if(~T.indexOf(n.nodeName)||n.getAttribute("tabindex")){var i=e.findAll("input").concat(e.get("rac.pop").popFindAll("input"));document.activeElement&&!~i.indexOf(document.activeElement)&&e.get("rac.key")({which:9})}}),{teardown:function(){e.unlink("rac.items"),e.unlink("rac._value"),e.unlink("rac.selected"),e.unlink("rac.display"),d.forEach(function(e){return e.cancel()})},update:s,render:function(){i=e.find("span")}}},{attributes:["items","selected","display","value","member","limit-set","fit","offsets","display-value","default"],css:function(e){return[function(e){var t=Object.assign({},e("raui.primary"),e("raui.autocomplete"),e("raui.autocomplete.primary")),n=Object.assign({},e("raui.autocomplete.drop"),e("raui.autocomplete.primary.drop")),i=e("raui.form.boxy");return".rautocomplete {\n position: relative;\n display: inline-block;\n }\n \n .rac-drop {\n width: 2em;\n height: 100%;\n position: absolute;\n top: 0;\n right: 2px;\n cursor: pointer;\n }\n .rac-drop:after {\n font-family: "+(n.font||"sans-serif")+";\n content: "+(n.string||"'▾'")+";\n position: absolute;\n top: calc(50% - 0.5em);\n height: 1em;\n line-height: 1em;\n width: 100%;\n text-align: center;\n font-weight: "+(n.weight||"normal")+";\n color: "+(n.color||t.bc||"#ccc")+";\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-selected.rac-hover {\n background-color: "+(t.bc||"#ccc")+";\n color: "+(t.fga||"#07e")+";\n }\n \n .rac-invalid {\n cursor: not-allowed;\n }\n \n input.rac-modal {\n width: 100%;\n box-sizing: border-box;\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 }"}.call(this,e)].join(" ")},cssId:"rautocomplete",noCssTransform:!0});function O(e){return void 0===e&&(e={}),function(t){var n=t.instance;n.partials[e.name||"autocomplete"]=L,n.components["rac-pop"]=u,n.decorators.autocompletefocus=_}}e.Autocomplete=L,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=O,e.default=O,Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -16,5 +16,7 @@ (function (global, factory) { | ||
instance.decorators[options.name || 'autofocus'] = function(node, opts) { | ||
var o = Object.assign({}, options, opts); | ||
if (o.immediate) { node.focus(); } | ||
else { setTimeout(function () { return node.focus(); }, o.timeout || 250); } | ||
if (typeof node.focus === 'function') { | ||
var o = Object.assign({}, options, opts); | ||
if (o.immediate && !node.disabeld) { node.focus(); } | ||
else { setTimeout(function () { return !node.disabled && node.focus(); }, o.timeout || 250); } | ||
} | ||
return { teardown: teardown }; | ||
@@ -21,0 +23,0 @@ }; |
@@ -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.RauiAutofocus={})}(this,function(e){"use strict";function t(){}e.default=function(e){return void 0===e&&(e={}),function(n){n.instance.decorators[e.name||"autofocus"]=function(n,o){var u=Object.assign({},e,o);return u.immediate?n.focus():setTimeout(function(){return n.focus()},u.timeout||250),{teardown:t}}}},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.RauiAutofocus={})}(this,function(e){"use strict";function t(){}e.default=function(e){return void 0===e&&(e={}),function(o){o.instance.decorators[e.name||"autofocus"]=function(o,n){if("function"==typeof o.focus){var u=Object.assign({},e,n);u.immediate&&!o.disabeld?o.focus():setTimeout(function(){return!o.disabled&&o.focus()},u.timeout||250)}return{teardown:t}}}},Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -315,4 +315,7 @@ (function (global, factory) { | ||
function autofocus(node) { | ||
if (typeof node.focus === 'function') { node.focus(); } | ||
function autofocus(node, opts) { | ||
if (typeof node.focus === 'function' && !node.disabled) { | ||
if (opts && opts.immediate) { node.focus(); } | ||
else { setTimeout(function () { return !node.disabled && node.focus(); }, (opts || {}).timeout || 250); } | ||
} | ||
return { teardown: noop }; | ||
@@ -319,0 +322,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.RauiForm={},e.Ractive)}(this,function(e,n){"use strict";n=n&&n.hasOwnProperty("default")?n.default:n;var i="undefined"!=typeof window?window:null;function l(e,n,l){if(i&&i.Ractive&&"object"==typeof i.Ractive[n]){var t=document.currentScript;if(t||(t=(t=document.querySelectorAll("script"))[t.length-1]),t){var a=t.getAttribute("data-alias");a&&(a=(a=a.split("&")).reduce(function(e,n){var i=n.split("="),l=i[0],t=i[1];return e[l]=t,e},{})),Ractive[n][a&&a[e]||e]=l}}}function t(e){var n=Object.assign({},e("raui.primary"),e("raui.form.primary")),i=Object.assign({},e("raui.primary.active"),e("raui.form.primary.active")),l=Object.assign({},e("raui.primary.disabled"),e("raui.form.primary.disabled")),t=e("raui.form.boxy");return"\n label.field, .field-manual {\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 .field-manual .field-body\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 input[readonly],\n label.field select:disabled,\n label.field textarea:disabled,\n label.field textarea[readonly] {\n background: "+(l.bg||"#f4f4f4")+";\n color: "+(l.fg||"#444")+";\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, label.field.radio {\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, label.field.radio.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input, 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.5em;\n top: 1em;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 3.2em;\n height: 3.2em;\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, label.field.inline.radio input {\n top: -0.45em;\n left: -0.55em;\n }\n\n label.field.check input:checked, label.field.radio input:checked {\n background-color: "+(n.fga||"#07e")+";\n }\n\n label.field.check:hover > input, label.field.radio:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus, label.field.radio input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus, label.field.radio:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active, label.field.radio input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before, label.field.radio:before {\n content: '';\n display: inline-block;\n box-sizing: border-box;\n margin: 0 0.5em 0.2em 0.1em;\n border: solid 0.125em; /* Safari */\n border-color: "+(n.fg||"#222")+';\n border-radius: 0.125em;\n width: 1.2em;\n height: 1.2em;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after, label.field.radio:after {\n content: \'\';\n display: inline-block;\n opacity: 0;\n position: absolute;\n width: 1.2em;\n height: 1.2em;\n top: 2.3em;\n left: 0.6em;\n border-radius: 0.125em;\n }\n label.field.check.inline:after, label.field.radio.inline:after {\n top: 0.8em;\n }\n\n label.field.check.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="'+(n.bg||"#fff").replace(/#/g,"%23")+'" d="m 15.378906,1.7050781 a 1.0583349,1.0583349 0 0 0 -1.478515,0.234375 L 6.6210937,11.960938 1.8652344,8.5058594 a 1.0583349,1.0583349 0 0 0 -1.47851565,0.234375 1.0583349,1.0583349 0 0 0 0.234375,1.4785156 L 6.234375,14.294922 A 1.0584408,1.0584408 0 0 0 7.7128906,14.060547 L 15.613281,3.1835938 A 1.0583349,1.0583349 0 0 0 15.378906,1.7050781 Z" /></svg>\') '+(n.fga||"#07e")+';\n }\n\n label.field.radio.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><circle fill="'+(n.bg||"#fff").replace(/#/g,"%23")+'" cx="8" cy="8" r="5" /></svg>\') '+(n.fga||"#07e")+";\n }\n\n label.field.check.checked:before, label.field.radio.checked:before {\n border-color: "+(n.fga||"#07e")+";\n }\n label.field.check.focus:before, label.field.radio.focus:before {\n border-color: "+(n.fga||"#07e")+";\n }\n\n label.field.check input:disabled, label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled, label.field.radio.disabled {\n color: "+(l.fg||"#444")+";\n cursor: initial;\n }\n\n label.field.check.disabled:before, label.field.radio.disabled:before {\n border-color: "+(l.bc||"#ccc")+";\n background-color: "+(l.bg||"#f4f4f4")+";\n }\n\n label.field.check.checked.disabled:after, label.field.radio.checked.disabled:after {\n border-color: transparent;\n background-color: "+(l.bc||"#ccc")+";\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: 1.125em;\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 min-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 r(e){~this.className.indexOf("focus")||(this.className+=" focus")}function o(e){this.className=this.className.replace(/\bfocus\b/g,"").trim()}function c(e){var n,i,l,t,c,d,f,s,b,u,p,m,h,g=this.getContext(e);function y(){var a=v().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"),(l=e.querySelector("input[type=radio]"))&&!~a.indexOf("radio")&&a.push("radio");var r=i||l;r&&r.checked&&!~a.indexOf("checked")&&a.push("checked"),r&&r.disabled&&!~a.indexOf("disabled")&&a.push("disabled"),!r&&u?(u.cancel(),u=0,p&&(p.disconnect(),p=0),delete r._form_callback,h&&(delete h.checked,m=h=void 0)):r&&(r._form_callback=function(n,i){if(void 0===i&&(i=!0),i&&"radio"===r.type&&r.name){var l=[];l.push.apply(l,document.querySelectorAll("input[type=radio][name="+r.name+"]")),(l=l.filter(function(e){return e!==r})).forEach(function(e){return e._form_callback&&e._form_callback(n,!1)})}var t=r.checked;t&&!~e.className.indexOf("checked")?e.className+=" checked":!t&&~e.className.indexOf("checked")&&(e.className=e.className.replace(/\bchecked\b/g,"").replace(/ +/g," ").trim())},MutationObserver&&(p=new MutationObserver(function(){var n;(n=r.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(r,{attributes:!0}),u=this.getContext(r).listen("change",r._form_callback),(m=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),"checked"))&&m.configurable&&(h=r,Object.defineProperty(r,"checked",{get:m.get,set:function(e){m.set.call(h,e),r._form_callback()},enumerable:!0,configurable:!0}))),(t=!!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||l||d||!e.querySelector("input")))&&!~a.indexOf("input")&&a.push("input"),e.className=a.join(" ")}function v(){var a=e.className;return n||(a=a.replace(/\bfield\b/g,"").trim()),i||(a=a.replace(/\bcheck(ed)?\b/g,"").trim()),l||(a=a.replace(/\bradio\b/g,"").trim()),t||(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 x=g.listen("focusin",r),k=g.listen("focusout",o);y.call(this);var w={update:a,invalidate:y.bind(this),teardown:function(){g.ractive.fire("fieldUnregistered",g,e,w);var n=v();n=n.replace(/\bfocus\b/g,"").trim(),x.cancel(),k.cancel(),u&&u.cancel(),p&&p.disconnect(),h&&(delete h.checked,m=h=void 0),e.className=n},setDisabled:function(n){e.querySelectorAll("input,button,select,textarea").forEach(function(e){return e.disabled=n}),this.invalidate()}};return g.ractive.fire("fieldRegistered",g,e,w),w}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=t;var f=n.macro(function(e){var n=[],i=[],l=(e.template.m||[]).slice(),t=e.template.f||[],a=l.find(function(e){return"value"===e.n}),r=l.find(function(e){return"type"===e.n}),o=l.find(function(e){return"tip"===e.n}),c=l.find(function(e){return"disabled"===e.n});if(o&&l.splice(l.indexOf(o),1),r&&"function"==typeof f.types[r.f])n.push.apply(n,f.types[r.f](l,t,e));else if(a){var s={t:7,e:"input",m:[a]};if(c&&s.m.push(c),d(t,"option")&&(s.e="select",s.f=t),r&&(s.m.push(r),"checkbox"===r.f||"radio"===r.f)){var b=l.find(function(e){return"target"===e.n});b?s.m.push(Object.assign({},b,{n:"name"})):s.m.splice(s.m.indexOf(a),1,Object.assign({},a,{n:"checked"}))}s.m=s.m.concat(l.filter(function(e){return 73===e.t||73===e.t||"placeholder"===e.n})),n.push(s);var u=t.filter(function(e){return"button"===e.e||d(e.f,"button")});u.length&&(n.push.apply(n,u),n=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:n}])}else{t.forEach(function(e){"label"===e.e?e.f&&e.f.length&&i.push.apply(i,e.f):n.push(e)});var p=t.filter(function(e){return e.e});p.find(function(e){return"button"===e.e})&&p.length>1&&(n=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:n}])}var m=l.find(function(e){return"label"===e.n});m&&m.f&&m.f.length&&i.push.apply(i,Array.isArray(m.f)?m.f:[m.f]),o&&n.unshift({t:7,e:"span",m:[{t:13,n:"class",f:"field-tip"+(i.length?"":" field-solo-tip"),g:1},{t:13,n:"title",f:o.f},{t:70,n:["click"],f:{r:[],s:"[false]"}}],f:"?"});var h=l.find(function(e){return"inline"===e.n});i&&!h?n.unshift.apply(n,i):h||n.unshift(" ");var g={t:7,e:"label",m:[{t:71,n:"field"}].concat(l.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&&"disabled"!==e.n})),f:n};h&&g.m.push({t:13,n:"class",f:"inline"}),e.setTemplate([g])});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,l=n.instance;if(!i.isInstance(l)&&e.includeStyle)if(l===i)i.addCSS("form-decorator",t);else{var a=l.css;l.css=function(e){return("function"!=typeof a?a||"":a(e))+t(e)}}l.partials[e.name||"field"]=f,l.decorators[e.name||"field"]=c,l.decorators[e.autofocusName||"autofocus"]=s}}f.types={},l("field","decorators",c),l("field","partials",f),l("autofocus","decorators",s),e.style=t,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.RauiForm={},e.Ractive)}(this,function(e,n){"use strict";n=n&&n.hasOwnProperty("default")?n.default:n;var i="undefined"!=typeof window?window:null;function l(e,n,l){if(i&&i.Ractive&&"object"==typeof i.Ractive[n]){var t=document.currentScript;if(t||(t=(t=document.querySelectorAll("script"))[t.length-1]),t){var a=t.getAttribute("data-alias");a&&(a=(a=a.split("&")).reduce(function(e,n){var i=n.split("="),l=i[0],t=i[1];return e[l]=t,e},{})),Ractive[n][a&&a[e]||e]=l}}}function t(e){var n=Object.assign({},e("raui.primary"),e("raui.form.primary")),i=Object.assign({},e("raui.primary.active"),e("raui.form.primary.active")),l=Object.assign({},e("raui.primary.disabled"),e("raui.form.primary.disabled")),t=e("raui.form.boxy");return"\n label.field, .field-manual {\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 .field-manual .field-body\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 input[readonly],\n label.field select:disabled,\n label.field textarea:disabled,\n label.field textarea[readonly] {\n background: "+(l.bg||"#f4f4f4")+";\n color: "+(l.fg||"#444")+";\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, label.field.radio {\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, label.field.radio.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input, 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.5em;\n top: 1em;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 3.2em;\n height: 3.2em;\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, label.field.inline.radio input {\n top: -0.45em;\n left: -0.55em;\n }\n\n label.field.check input:checked, label.field.radio input:checked {\n background-color: "+(n.fga||"#07e")+";\n }\n\n label.field.check:hover > input, label.field.radio:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus, label.field.radio input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus, label.field.radio:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active, label.field.radio input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before, label.field.radio:before {\n content: '';\n display: inline-block;\n box-sizing: border-box;\n margin: 0 0.5em 0.2em 0.1em;\n border: solid 0.125em; /* Safari */\n border-color: "+(n.fg||"#222")+';\n border-radius: 0.125em;\n width: 1.2em;\n height: 1.2em;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after, label.field.radio:after {\n content: \'\';\n display: inline-block;\n opacity: 0;\n position: absolute;\n width: 1.2em;\n height: 1.2em;\n top: 2.3em;\n left: 0.6em;\n border-radius: 0.125em;\n }\n label.field.check.inline:after, label.field.radio.inline:after {\n top: 0.8em;\n }\n\n label.field.check.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="'+(n.bg||"#fff").replace(/#/g,"%23")+'" d="m 15.378906,1.7050781 a 1.0583349,1.0583349 0 0 0 -1.478515,0.234375 L 6.6210937,11.960938 1.8652344,8.5058594 a 1.0583349,1.0583349 0 0 0 -1.47851565,0.234375 1.0583349,1.0583349 0 0 0 0.234375,1.4785156 L 6.234375,14.294922 A 1.0584408,1.0584408 0 0 0 7.7128906,14.060547 L 15.613281,3.1835938 A 1.0583349,1.0583349 0 0 0 15.378906,1.7050781 Z" /></svg>\') '+(n.fga||"#07e")+';\n }\n\n label.field.radio.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><circle fill="'+(n.bg||"#fff").replace(/#/g,"%23")+'" cx="8" cy="8" r="5" /></svg>\') '+(n.fga||"#07e")+";\n }\n\n label.field.check.checked:before, label.field.radio.checked:before {\n border-color: "+(n.fga||"#07e")+";\n }\n label.field.check.focus:before, label.field.radio.focus:before {\n border-color: "+(n.fga||"#07e")+";\n }\n\n label.field.check input:disabled, label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled, label.field.radio.disabled {\n color: "+(l.fg||"#444")+";\n cursor: initial;\n }\n\n label.field.check.disabled:before, label.field.radio.disabled:before {\n border-color: "+(l.bc||"#ccc")+";\n background-color: "+(l.bg||"#f4f4f4")+";\n }\n\n label.field.check.checked.disabled:after, label.field.radio.checked.disabled:after {\n border-color: transparent;\n background-color: "+(l.bc||"#ccc")+";\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: 1.125em;\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 min-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 r(e){~this.className.indexOf("focus")||(this.className+=" focus")}function o(e){this.className=this.className.replace(/\bfocus\b/g,"").trim()}function c(e){var n,i,l,t,c,d,f,s,b,u,p,m,h,g=this.getContext(e);function y(){var a=v().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"),(l=e.querySelector("input[type=radio]"))&&!~a.indexOf("radio")&&a.push("radio");var r=i||l;r&&r.checked&&!~a.indexOf("checked")&&a.push("checked"),r&&r.disabled&&!~a.indexOf("disabled")&&a.push("disabled"),!r&&u?(u.cancel(),u=0,p&&(p.disconnect(),p=0),delete r._form_callback,h&&(delete h.checked,m=h=void 0)):r&&(r._form_callback=function(n,i){if(void 0===i&&(i=!0),i&&"radio"===r.type&&r.name){var l=[];l.push.apply(l,document.querySelectorAll("input[type=radio][name="+r.name+"]")),(l=l.filter(function(e){return e!==r})).forEach(function(e){return e._form_callback&&e._form_callback(n,!1)})}var t=r.checked;t&&!~e.className.indexOf("checked")?e.className+=" checked":!t&&~e.className.indexOf("checked")&&(e.className=e.className.replace(/\bchecked\b/g,"").replace(/ +/g," ").trim())},MutationObserver&&(p=new MutationObserver(function(){var n;(n=r.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(r,{attributes:!0}),u=this.getContext(r).listen("change",r._form_callback),(m=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),"checked"))&&m.configurable&&(h=r,Object.defineProperty(r,"checked",{get:m.get,set:function(e){m.set.call(h,e),r._form_callback()},enumerable:!0,configurable:!0}))),(t=!!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||l||d||!e.querySelector("input")))&&!~a.indexOf("input")&&a.push("input"),e.className=a.join(" ")}function v(){var a=e.className;return n||(a=a.replace(/\bfield\b/g,"").trim()),i||(a=a.replace(/\bcheck(ed)?\b/g,"").trim()),l||(a=a.replace(/\bradio\b/g,"").trim()),t||(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 x=g.listen("focusin",r),k=g.listen("focusout",o);y.call(this);var w={update:a,invalidate:y.bind(this),teardown:function(){g.ractive.fire("fieldUnregistered",g,e,w);var n=v();n=n.replace(/\bfocus\b/g,"").trim(),x.cancel(),k.cancel(),u&&u.cancel(),p&&p.disconnect(),h&&(delete h.checked,m=h=void 0),e.className=n},setDisabled:function(n){e.querySelectorAll("input,button,select,textarea").forEach(function(e){return e.disabled=n}),this.invalidate()}};return g.ractive.fire("fieldRegistered",g,e,w),w}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=t;var f=n.macro(function(e){var n=[],i=[],l=(e.template.m||[]).slice(),t=e.template.f||[],a=l.find(function(e){return"value"===e.n}),r=l.find(function(e){return"type"===e.n}),o=l.find(function(e){return"tip"===e.n}),c=l.find(function(e){return"disabled"===e.n});if(o&&l.splice(l.indexOf(o),1),r&&"function"==typeof f.types[r.f])n.push.apply(n,f.types[r.f](l,t,e));else if(a){var s={t:7,e:"input",m:[a]};if(c&&s.m.push(c),d(t,"option")&&(s.e="select",s.f=t),r&&(s.m.push(r),"checkbox"===r.f||"radio"===r.f)){var b=l.find(function(e){return"target"===e.n});b?s.m.push(Object.assign({},b,{n:"name"})):s.m.splice(s.m.indexOf(a),1,Object.assign({},a,{n:"checked"}))}s.m=s.m.concat(l.filter(function(e){return 73===e.t||73===e.t||"placeholder"===e.n})),n.push(s);var u=t.filter(function(e){return"button"===e.e||d(e.f,"button")});u.length&&(n.push.apply(n,u),n=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:n}])}else{t.forEach(function(e){"label"===e.e?e.f&&e.f.length&&i.push.apply(i,e.f):n.push(e)});var p=t.filter(function(e){return e.e});p.find(function(e){return"button"===e.e})&&p.length>1&&(n=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:n}])}var m=l.find(function(e){return"label"===e.n});m&&m.f&&m.f.length&&i.push.apply(i,Array.isArray(m.f)?m.f:[m.f]),o&&n.unshift({t:7,e:"span",m:[{t:13,n:"class",f:"field-tip"+(i.length?"":" field-solo-tip"),g:1},{t:13,n:"title",f:o.f},{t:70,n:["click"],f:{r:[],s:"[false]"}}],f:"?"});var h=l.find(function(e){return"inline"===e.n});i&&!h?n.unshift.apply(n,i):h||n.unshift(" ");var g={t:7,e:"label",m:[{t:71,n:"field"}].concat(l.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&&"disabled"!==e.n})),f:n};h&&g.m.push({t:13,n:"class",f:"inline"}),e.setTemplate([g])});function s(e,n){return"function"!=typeof e.focus||e.disabled||(n&&n.immediate?e.focus():setTimeout(function(){return!e.disabled&&e.focus()},(n||{}).timeout||250)),{teardown:a}}function b(e){return void 0===e&&(e={}),function(n){var i=n.Ractive,l=n.instance;if(!i.isInstance(l)&&e.includeStyle)if(l===i)i.addCSS("form-decorator",t);else{var a=l.css;l.css=function(e){return("function"!=typeof a?a||"":a(e))+t(e)}}l.partials[e.name||"field"]=f,l.decorators[e.name||"field"]=c,l.decorators[e.autofocusName||"autofocus"]=s}}f.types={},l("field","decorators",c),l("field","partials",f),l("autofocus","decorators",s),e.style=t,e.field=c,e.macro=f,e.autofocus=s,e.plugin=b,e.default=b,Object.defineProperty(e,"__esModule",{value:!0})}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2992837
33518