// Compiled by ClojureScript 1.9.562 {}
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__24566__auto__ = [];
var len__24559__auto___35874 = arguments.length;
var i__24560__auto___35875 = (0);
while(true){
if((i__24560__auto___35875 < len__24559__auto___35874)){
args__24566__auto__.push((arguments[i__24560__auto___35875]));

var G__35876 = (i__24560__auto___35875 + (1));
i__24560__auto___35875 = G__35876;
continue;
} else {
}
break;
}

var argseq__24567__auto__ = ((((1) < args__24566__auto__.length))?(new cljs.core.IndexedSeq(args__24566__auto__.slice((1)),(0),null)):null);
return garden.stylesheet.rule.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__24567__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__35877__delegate = function (children){
return cljs.core.into.call(null,cljs.core.apply.call(null,cljs.core.vector,selector,more),children);
};
var G__35877 = function (var_args){
var children = null;
if (arguments.length > 0) {
var G__35878__i = 0, G__35878__a = new Array(arguments.length -  0);
while (G__35878__i < G__35878__a.length) {G__35878__a[G__35878__i] = arguments[G__35878__i + 0]; ++G__35878__i;}
  children = new cljs.core.IndexedSeq(G__35878__a,0,null);
} 
return G__35877__delegate.call(this,children);};
G__35877.cljs$lang$maxFixedArity = 0;
G__35877.cljs$lang$applyTo = (function (arglist__35879){
var children = cljs.core.seq(arglist__35879);
return G__35877__delegate(children);
});
G__35877.cljs$core$IFn$_invoke$arity$variadic = G__35877__delegate;
return G__35877;
})()
;
}
});

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

garden.stylesheet.rule.cljs$lang$applyTo = (function (seq35872){
var G__35873 = cljs.core.first.call(null,seq35872);
var seq35872__$1 = cljs.core.next.call(null,seq35872);
return garden.stylesheet.rule.cljs$core$IFn$_invoke$arity$variadic(G__35873,seq35872__$1);
});

garden.stylesheet.cssfn = (function garden$stylesheet$cssfn(fn_name){
return (function() { 
var G__35880__delegate = function (args){
return (new garden.types.CSSFunction(fn_name,args,null,null,null));
};
var G__35880 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__35881__i = 0, G__35881__a = new Array(arguments.length -  0);
while (G__35881__i < G__35881__a.length) {G__35881__a[G__35881__i] = arguments[G__35881__i + 0]; ++G__35881__i;}
  args = new cljs.core.IndexedSeq(G__35881__a,0,null);
} 
return G__35880__delegate.call(this,args);};
G__35880.cljs$lang$maxFixedArity = 0;
G__35880.cljs$lang$applyTo = (function (arglist__35882){
var args = cljs.core.seq(arglist__35882);
return G__35880__delegate(args);
});
G__35880.cljs$core$IFn$_invoke$arity$variadic = G__35880__delegate;
return G__35880;
})()
;
});
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__24566__auto__ = [];
var len__24559__auto___35884 = arguments.length;
var i__24560__auto___35885 = (0);
while(true){
if((i__24560__auto___35885 < len__24559__auto___35884)){
args__24566__auto__.push((arguments[i__24560__auto___35885]));

var G__35886 = (i__24560__auto___35885 + (1));
i__24560__auto___35885 = G__35886;
continue;
} else {
}
break;
}

var argseq__24567__auto__ = ((((0) < args__24566__auto__.length))?(new cljs.core.IndexedSeq(args__24566__auto__.slice((0)),(0),null)):null);
return garden.stylesheet.at_font_face.cljs$core$IFn$_invoke$arity$variadic(argseq__24567__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);

garden.stylesheet.at_font_face.cljs$lang$applyTo = (function (seq35883){
return garden.stylesheet.at_font_face.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq.call(null,seq35883));
});

/**
 * Create a CSS @import rule.
 */
garden.stylesheet.at_import = (function garden$stylesheet$at_import(var_args){
var args35887 = [];
var len__24559__auto___35892 = arguments.length;
var i__24560__auto___35893 = (0);
while(true){
if((i__24560__auto___35893 < len__24559__auto___35892)){
args35887.push((arguments[i__24560__auto___35893]));

var G__35894 = (i__24560__auto___35893 + (1));
i__24560__auto___35893 = G__35894;
continue;
} else {
}
break;
}

var G__35891 = args35887.length;
switch (G__35891) {
case 1:
return garden.stylesheet.at_import.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
default:
var argseq__24582__auto__ = (new cljs.core.IndexedSeq(args35887.slice((1)),(0),null));
return garden.stylesheet.at_import.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__24582__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));
});

garden.stylesheet.at_import.cljs$lang$applyTo = (function (seq35888){
var G__35889 = cljs.core.first.call(null,seq35888);
var seq35888__$1 = cljs.core.next.call(null,seq35888);
return garden.stylesheet.at_import.cljs$core$IFn$_invoke$arity$variadic(G__35889,seq35888__$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__24566__auto__ = [];
var len__24559__auto___35898 = arguments.length;
var i__24560__auto___35899 = (0);
while(true){
if((i__24560__auto___35899 < len__24559__auto___35898)){
args__24566__auto__.push((arguments[i__24560__auto___35899]));

var G__35900 = (i__24560__auto___35899 + (1));
i__24560__auto___35899 = G__35900;
continue;
} else {
}
break;
}

var argseq__24567__auto__ = ((((1) < args__24566__auto__.length))?(new cljs.core.IndexedSeq(args__24566__auto__.slice((1)),(0),null)):null);
return garden.stylesheet.at_media.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__24567__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);

garden.stylesheet.at_media.cljs$lang$applyTo = (function (seq35896){
var G__35897 = cljs.core.first.call(null,seq35896);
var seq35896__$1 = cljs.core.next.call(null,seq35896);
return garden.stylesheet.at_media.cljs$core$IFn$_invoke$arity$variadic(G__35897,seq35896__$1);
});

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

var G__35905 = (i__24560__auto___35904 + (1));
i__24560__auto___35904 = G__35905;
continue;
} else {
}
break;
}

var argseq__24567__auto__ = ((((1) < args__24566__auto__.length))?(new cljs.core.IndexedSeq(args__24566__auto__.slice((1)),(0),null)):null);
return garden.stylesheet.at_keyframes.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__24567__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);

garden.stylesheet.at_keyframes.cljs$lang$applyTo = (function (seq35901){
var G__35902 = cljs.core.first.call(null,seq35901);
var seq35901__$1 = cljs.core.next.call(null,seq35901);
return garden.stylesheet.at_keyframes.cljs$core$IFn$_invoke$arity$variadic(G__35902,seq35901__$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));
});
