goog.provide('emptyhead.principle.crud');
/**
 * Helper function to make principle object.
 *   You may want `register-principle!` instead.
 */
emptyhead.principle.crud.make_principle = (function emptyhead$principle$crud$make_principle(var_args){
var args__5732__auto__ = [];
var len__5726__auto___31667 = arguments.length;
var i__5727__auto___31668 = (0);
while(true){
if((i__5727__auto___31668 < len__5726__auto___31667)){
args__5732__auto__.push((arguments[i__5727__auto___31668]));

var G__31669 = (i__5727__auto___31668 + (1));
i__5727__auto___31668 = G__31669;
continue;
} else {
}
break;
}

var argseq__5733__auto__ = ((((1) < args__5732__auto__.length))?(new cljs.core.IndexedSeq(args__5732__auto__.slice((1)),(0),null)):null);
return emptyhead.principle.crud.make_principle.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__5733__auto__);
});

(emptyhead.principle.crud.make_principle.cljs$core$IFn$_invoke$arity$variadic = (function (operator,p__31661){
var map__31662 = p__31661;
var map__31662__$1 = cljs.core.__destructure_map(map__31662);
var data = cljs.core.get.cljs$core$IFn$_invoke$arity$3(map__31662__$1,new cljs.core.Keyword(null,"data","data",-232669377),cljs.core.PersistentArrayMap.EMPTY);
var ext_contract = cljs.core.get.cljs$core$IFn$_invoke$arity$3(map__31662__$1,new cljs.core.Keyword(null,"ext-contract","ext-contract",812214039),cljs.core.PersistentArrayMap.EMPTY);
var ext_stages = cljs.core.get.cljs$core$IFn$_invoke$arity$3(map__31662__$1,new cljs.core.Keyword(null,"ext-stages","ext-stages",680954732),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"principle","principle",-1390571781),operator], null)], null));
var transient$ = cljs.core.get.cljs$core$IFn$_invoke$arity$3(map__31662__$1,new cljs.core.Keyword(null,"transient","transient",-741416458),true);
return cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"operator","operator",-1860875338),new cljs.core.Keyword(null,"data","data",-232669377),new cljs.core.Keyword(null,"ext-contract","ext-contract",812214039),new cljs.core.Keyword(null,"ext-stages","ext-stages",680954732),new cljs.core.Keyword(null,"return","return",-1891502105),new cljs.core.Keyword(null,"transient","transient",-741416458)],[operator,data,ext_contract,ext_stages,cljs.core.PersistentArrayMap.EMPTY,(!(transient$ === false))]);
}));

(emptyhead.principle.crud.make_principle.cljs$lang$maxFixedArity = (1));

/** @this {Function} */
(emptyhead.principle.crud.make_principle.cljs$lang$applyTo = (function (seq31659){
var G__31660 = cljs.core.first(seq31659);
var seq31659__$1 = cljs.core.next(seq31659);
var self__5711__auto__ = this;
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__31660,seq31659__$1);
}));

/**
 * Create a principle and register it in the state.
 *   Returns a reference to the created principle.
 */
emptyhead.principle.crud.register_principle_BANG_ = (function emptyhead$principle$crud$register_principle_BANG_(var_args){
var args__5732__auto__ = [];
var len__5726__auto___31670 = arguments.length;
var i__5727__auto___31671 = (0);
while(true){
if((i__5727__auto___31671 < len__5726__auto___31670)){
args__5732__auto__.push((arguments[i__5727__auto___31671]));

var G__31672 = (i__5727__auto___31671 + (1));
i__5727__auto___31671 = G__31672;
continue;
} else {
}
break;
}

var argseq__5733__auto__ = ((((1) < args__5732__auto__.length))?(new cljs.core.IndexedSeq(args__5732__auto__.slice((1)),(0),null)):null);
return emptyhead.principle.crud.register_principle_BANG_.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__5733__auto__);
});

(emptyhead.principle.crud.register_principle_BANG_.cljs$core$IFn$_invoke$arity$variadic = (function (operator,p__31665){
var map__31666 = p__31665;
var map__31666__$1 = cljs.core.__destructure_map(map__31666);
var args = map__31666__$1;
var data = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__31666__$1,new cljs.core.Keyword(null,"data","data",-232669377));
var ext_contract = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__31666__$1,new cljs.core.Keyword(null,"ext-contract","ext-contract",812214039));
var ext_stages = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__31666__$1,new cljs.core.Keyword(null,"ext-stages","ext-stages",680954732));
var transient$ = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__31666__$1,new cljs.core.Keyword(null,"transient","transient",-741416458));
return emptyhead.idea.crud.have_idea_BANG_.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([new cljs.core.Keyword(null,"prefix","prefix",-265908465),["principle_",cljs.core.name(operator),"_"].join(''),new cljs.core.Keyword(null,"properties","properties",685819552),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"principle","principle",-1390571781)], null)], null),new cljs.core.Keyword(null,"data","data",-232669377),emptyhead.principle.crud.make_principle.cljs$core$IFn$_invoke$arity$variadic(operator,cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([args], 0))], 0));
}));

(emptyhead.principle.crud.register_principle_BANG_.cljs$lang$maxFixedArity = (1));

/** @this {Function} */
(emptyhead.principle.crud.register_principle_BANG_.cljs$lang$applyTo = (function (seq31663){
var G__31664 = cljs.core.first(seq31663);
var seq31663__$1 = cljs.core.next(seq31663);
var self__5711__auto__ = this;
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__31664,seq31663__$1);
}));

/**
 * Get the extension contract of a `principle`.
 *   Returns the contract.
 */
emptyhead.principle.crud.contract = (function emptyhead$principle$crud$contract(principle){
return emptyhead.idea.protocol.val_fn(new cljs.core.Keyword(null,"ext-contract","ext-contract",812214039),principle);
});
/**
 * Get the extension stages of a `principle`.
 *   Returns the list of stages.
 */
emptyhead.principle.crud.stages = (function emptyhead$principle$crud$stages(principle){
return emptyhead.idea.protocol.val_fn(new cljs.core.Keyword(null,"ext-stages","ext-stages",680954732),principle);
});
/**
 * Get the operator id of a `principle`.
 *   Returns the operator keyword.
 */
emptyhead.principle.crud.operator = (function emptyhead$principle$crud$operator(principle){
return emptyhead.idea.protocol.val_fn(new cljs.core.Keyword(null,"operator","operator",-1860875338),principle);
});

//# sourceMappingURL=emptyhead.principle.crud.js.map
