// Compiled by ClojureScript 1.10.520 {}
goog.provide('garden.stylesheet');
goog.require('cljs.core');
goog.require('garden.util');
goog.require('garden.color');
goog.require('garden.types');
/**
 * Create a rule function for the given selector. The `selector`
 *   argument must be valid selector (ie. a keyword, string, or symbol).
 *   Additional arguments may consist of extra selectors or
 *   declarations.
 * 
 *   The returned function accepts any number of arguments which represent
 *   the rule's children.
 * 
 *   Ex.
 *    (let [text-field (rule "[type="text"])]
 *     (text-field {:border ["1px" :solid "black"]}))
 *    ;; => ["[type="text"] {:boder ["1px" :solid "black"]}]
 */
garden.stylesheet.rule = (function garden$stylesheet$rule(var_args){
var args__4736__auto__ = [];
var len__4730__auto___31210 = arguments.length;
var i__4731__auto___31211 = (0);
while(true){
if((i__4731__auto___31211 < len__4730__auto___31210)){
args__4736__auto__.push((arguments[i__4731__auto___31211]));

var G__31212 = (i__4731__auto___31211 + (1));
i__4731__auto___31211 = G__31212;
continue;
} else {
}
break;
}

var argseq__4737__auto__ = ((((1) < args__4736__auto__.length))?(new cljs.core.IndexedSeq(args__4736__auto__.slice((1)),(0),null)):null);
return garden.stylesheet.rule.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__4737__auto__);
});

garden.stylesheet.rule.cljs$core$IFn$_invoke$arity$variadic = (function (selector,more){
if((!((((selector instanceof cljs.core.Keyword)) || (typeof selector === 'string') || ((selector instanceof cljs.core.Symbol)))))){
throw cljs.core.ex_info.call(null,"Selector must be either a keyword, string, or symbol.",cljs.core.PersistentArrayMap.EMPTY);
} else {
return (function() { 
var G__31213__delegate = function (children){
return cljs.core.into.call(null,cljs.core.apply.call(null,cljs.core.vector,selector,more),children);
};
var G__31213 = function (var_args){
var children = null;
if (arguments.length > 0) {
var G__31214__i = 0, G__31214__a = new Array(arguments.length -  0);
while (G__31214__i < G__31214__a.length) {G__31214__a[G__31214__i] = arguments[G__31214__i + 0]; ++G__31214__i;}
  children = new cljs.core.IndexedSeq(G__31214__a,0,null);
} 
return G__31213__delegate.call(this,children);};
G__31213.cljs$lang$maxFixedArity = 0;
G__31213.cljs$lang$applyTo = (function (arglist__31215){
var children = cljs.core.seq(arglist__31215);
return G__31213__delegate(children);
});
G__31213.cljs$core$IFn$_invoke$arity$variadic = G__31213__delegate;
return G__31213;
})()
;
}
});

garden.stylesheet.rule.cljs$lang$maxFixedArity = (1);

/** @this {Function} */
garden.stylesheet.rule.cljs$lang$applyTo = (function (seq31208){
var G__31209 = cljs.core.first.call(null,seq31208);
var seq31208__$1 = cljs.core.next.call(null,seq31208);
var self__4717__auto__ = this;
return self__4717__auto__.cljs$core$IFn$_invoke$arity$variadic(G__31209,seq31208__$1);
});

garden.stylesheet.cssfn = (function garden$stylesheet$cssfn(fn_name){
return (function() { 
var G__31216__delegate = function (args){
return (new garden.types.CSSFunction(fn_name,args,null,null,null));
};
var G__31216 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__31217__i = 0, G__31217__a = new Array(arguments.length -  0);
while (G__31217__i < G__31217__a.length) {G__31217__a[G__31217__i] = arguments[G__31217__i + 0]; ++G__31217__i;}
  args = new cljs.core.IndexedSeq(G__31217__a,0,null);
} 
return G__31216__delegate.call(this,args);};
G__31216.cljs$lang$maxFixedArity = 0;
G__31216.cljs$lang$applyTo = (function (arglist__31218){
var args = cljs.core.seq(arglist__31218);
return G__31216__delegate(args);
});
G__31216.cljs$core$IFn$_invoke$arity$variadic = G__31216__delegate;
return G__31216;
})()
;
});
garden.stylesheet.at_rule = (function garden$stylesheet$at_rule(identifier,value){
return (new garden.types.CSSAtRule(identifier,value,null,null,null));
});
/**
 * Create a CSS @font-face rule.
 */
garden.stylesheet.at_font_face = (function garden$stylesheet$at_font_face(var_args){
var args__4736__auto__ = [];
var len__4730__auto___31220 = arguments.length;
var i__4731__auto___31221 = (0);
while(true){
if((i__4731__auto___31221 < len__4730__auto___31220)){
args__4736__auto__.push((arguments[i__4731__auto___31221]));

var G__31222 = (i__4731__auto___31221 + (1));
i__4731__auto___31221 = G__31222;
continue;
} else {
}
break;
}

var argseq__4737__auto__ = ((((0) < args__4736__auto__.length))?(new cljs.core.IndexedSeq(args__4736__auto__.slice((0)),(0),null)):null);
return garden.stylesheet.at_font_face.cljs$core$IFn$_invoke$arity$variadic(argseq__4737__auto__);
});

garden.stylesheet.at_font_face.cljs$core$IFn$_invoke$arity$variadic = (function (font_properties){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["@font-face",font_properties], null);
});

garden.stylesheet.at_font_face.cljs$lang$maxFixedArity = (0);

/** @this {Function} */
garden.stylesheet.at_font_face.cljs$lang$applyTo = (function (seq31219){
var self__4718__auto__ = this;
return self__4718__auto__.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq.call(null,seq31219));
});

/**
 * Create a CSS @import rule.
 */
garden.stylesheet.at_import = (function garden$stylesheet$at_import(var_args){
var G__31226 = arguments.length;
switch (G__31226) {
case 1:
return garden.stylesheet.at_import.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
default:
var args_arr__4751__auto__ = [];
var len__4730__auto___31228 = arguments.length;
var i__4731__auto___31229 = (0);
while(true){
if((i__4731__auto___31229 < len__4730__auto___31228)){
args_arr__4751__auto__.push((arguments[i__4731__auto___31229]));

var G__31230 = (i__4731__auto___31229 + (1));
i__4731__auto___31229 = G__31230;
continue;
} else {
}
break;
}

var argseq__4752__auto__ = (new cljs.core.IndexedSeq(args_arr__4751__auto__.slice((1)),(0),null));
return garden.stylesheet.at_import.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__4752__auto__);

}
});

garden.stylesheet.at_import.cljs$core$IFn$_invoke$arity$1 = (function (url){
return garden.stylesheet.at_rule.call(null,new cljs.core.Keyword(null,"import","import",-1399500709),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"url","url",276297046),url,new cljs.core.Keyword(null,"media-queries","media-queries",-1563277678),null], null));
});

garden.stylesheet.at_import.cljs$core$IFn$_invoke$arity$variadic = (function (url,media_queries){
return garden.stylesheet.at_rule.call(null,new cljs.core.Keyword(null,"import","import",-1399500709),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"url","url",276297046),url,new cljs.core.Keyword(null,"media-queries","media-queries",-1563277678),media_queries], null));
});

/** @this {Function} */
garden.stylesheet.at_import.cljs$lang$applyTo = (function (seq31224){
var G__31225 = cljs.core.first.call(null,seq31224);
var seq31224__$1 = cljs.core.next.call(null,seq31224);
var self__4717__auto__ = this;
return self__4717__auto__.cljs$core$IFn$_invoke$arity$variadic(G__31225,seq31224__$1);
});

garden.stylesheet.at_import.cljs$lang$maxFixedArity = (1);

/**
 * Create a CSS @media rule.
 */
garden.stylesheet.at_media = (function garden$stylesheet$at_media(var_args){
var args__4736__auto__ = [];
var len__4730__auto___31233 = arguments.length;
var i__4731__auto___31234 = (0);
while(true){
if((i__4731__auto___31234 < len__4730__auto___31233)){
args__4736__auto__.push((arguments[i__4731__auto___31234]));

var G__31235 = (i__4731__auto___31234 + (1));
i__4731__auto___31234 = G__31235;
continue;
} else {
}
break;
}

var argseq__4737__auto__ = ((((1) < args__4736__auto__.length))?(new cljs.core.IndexedSeq(args__4736__auto__.slice((1)),(0),null)):null);
return garden.stylesheet.at_media.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__4737__auto__);
});

garden.stylesheet.at_media.cljs$core$IFn$_invoke$arity$variadic = (function (media_queries,rules){
return garden.stylesheet.at_rule.call(null,new cljs.core.Keyword(null,"media","media",-1066138403),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"media-queries","media-queries",-1563277678),media_queries,new cljs.core.Keyword(null,"rules","rules",1198912366),rules], null));
});

garden.stylesheet.at_media.cljs$lang$maxFixedArity = (1);

/** @this {Function} */
garden.stylesheet.at_media.cljs$lang$applyTo = (function (seq31231){
var G__31232 = cljs.core.first.call(null,seq31231);
var seq31231__$1 = cljs.core.next.call(null,seq31231);
var self__4717__auto__ = this;
return self__4717__auto__.cljs$core$IFn$_invoke$arity$variadic(G__31232,seq31231__$1);
});

garden.stylesheet.at_supports = (function garden$stylesheet$at_supports(var_args){
var args__4736__auto__ = [];
var len__4730__auto___31238 = arguments.length;
var i__4731__auto___31239 = (0);
while(true){
if((i__4731__auto___31239 < len__4730__auto___31238)){
args__4736__auto__.push((arguments[i__4731__auto___31239]));

var G__31240 = (i__4731__auto___31239 + (1));
i__4731__auto___31239 = G__31240;
continue;
} else {
}
break;
}

var argseq__4737__auto__ = ((((1) < args__4736__auto__.length))?(new cljs.core.IndexedSeq(args__4736__auto__.slice((1)),(0),null)):null);
return garden.stylesheet.at_supports.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__4737__auto__);
});

garden.stylesheet.at_supports.cljs$core$IFn$_invoke$arity$variadic = (function (feature_queries,rules){

return garden.stylesheet.at_rule.call(null,new cljs.core.Keyword(null,"feature","feature",27242652),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"feature-queries","feature-queries",-1340998408),feature_queries,new cljs.core.Keyword(null,"rules","rules",1198912366),rules], null));
});

garden.stylesheet.at_supports.cljs$lang$maxFixedArity = (1);

/** @this {Function} */
garden.stylesheet.at_supports.cljs$lang$applyTo = (function (seq31236){
var G__31237 = cljs.core.first.call(null,seq31236);
var seq31236__$1 = cljs.core.next.call(null,seq31236);
var self__4717__auto__ = this;
return self__4717__auto__.cljs$core$IFn$_invoke$arity$variadic(G__31237,seq31236__$1);
});

/**
 * Create a CSS @keyframes rule.
 */
garden.stylesheet.at_keyframes = (function garden$stylesheet$at_keyframes(var_args){
var args__4736__auto__ = [];
var len__4730__auto___31243 = arguments.length;
var i__4731__auto___31244 = (0);
while(true){
if((i__4731__auto___31244 < len__4730__auto___31243)){
args__4736__auto__.push((arguments[i__4731__auto___31244]));

var G__31245 = (i__4731__auto___31244 + (1));
i__4731__auto___31244 = G__31245;
continue;
} else {
}
break;
}

var argseq__4737__auto__ = ((((1) < args__4736__auto__.length))?(new cljs.core.IndexedSeq(args__4736__auto__.slice((1)),(0),null)):null);
return garden.stylesheet.at_keyframes.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__4737__auto__);
});

garden.stylesheet.at_keyframes.cljs$core$IFn$_invoke$arity$variadic = (function (identifier,frames){
return garden.stylesheet.at_rule.call(null,new cljs.core.Keyword(null,"keyframes","keyframes",-1437976012),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"identifier","identifier",-805503498),identifier,new cljs.core.Keyword(null,"frames","frames",1765687497),frames], null));
});

garden.stylesheet.at_keyframes.cljs$lang$maxFixedArity = (1);

/** @this {Function} */
garden.stylesheet.at_keyframes.cljs$lang$applyTo = (function (seq31241){
var G__31242 = cljs.core.first.call(null,seq31241);
var seq31241__$1 = cljs.core.next.call(null,seq31241);
var self__4717__auto__ = this;
return self__4717__auto__.cljs$core$IFn$_invoke$arity$variadic(G__31242,seq31241__$1);
});

/**
 * Create a color from RGB values.
 */
garden.stylesheet.rgb = (function garden$stylesheet$rgb(r,g,b){
return garden.color.rgb.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [r,g,b], null));
});
/**
 * Create a color from HSL values.
 */
garden.stylesheet.hsl = (function garden$stylesheet$hsl(h,s,l){
return garden.color.hsl.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [h,s,l], null));
});
