Skip to content

Instantly share code, notes, and snippets.

@mk
Created November 14, 2019 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mk/6d921f6b0c5a14e0463a4b425b830f91 to your computer and use it in GitHub Desktop.
Save mk/6d921f6b0c5a14e0463a4b425b830f91 to your computer and use it in GitHub Desktop.
cljs compile errors
billing.js:344 Uncaught SyntaxError: Unexpected token '.'
settings.js:59 Uncaught SyntaxError: Unexpected token '.'
status.js:776 Uncaught SyntaxError: Unexpected token ')'
(ns com.nextjournal.journal.views.billing
(:require [com.nextjournal.editor.components.ui.icon :as icon]
[com.nextjournal.editor.router :as router]
[com.nextjournal.journal.form :as form]
[com.nextjournal.journal.form.group]
[com.nextjournal.journal.form.billing :as form.billing]
[com.nextjournal.graph.uuid :as uuid]
[com.nextjournal.journal.views.helpers :as helpers]
[com.nextjournal.journal.views.specs :as views.specs]
[clojure.spec.alpha :as s]
#?@(:clj [[java-time]]
:cljs [[com.nextjournal.devcards :refer [defcard-nj]]
[re-frame.core :as re-frame]
[com.nextjournal.editor.components.ui.spinner :as spinner]
[com.nextjournal.editor.event-buffer :as event-buffer]
[com.nextjournal.editor.util :as util]])))
(defn format-usd [amount]
(str "$" amount))
#?(:cljs
(re-frame/reg-event-db
::select-plan
[event-buffer/add]
(fn [db [_ plan]]
(cond-> db
(= plan :open-science)
(dissoc :stripe)
:always
(assoc-in [:view-data :plan] plan)))))
#?(:cljs
(re-frame/reg-event-db
::update-stripe-card
[event-buffer/add]
(fn [db [_ card]]
(assoc-in db [:stripe :card] card))))
#?(:cljs
(re-frame/reg-sub
::stripe-token
(fn [db]
(get-in db [:stripe :token]))))
#?(:cljs
(re-frame/reg-event-fx
::update-stripe-token
[event-buffer/add]
(fn [{:keys [db]} [_ stripe-token and-then]]
{:db (assoc-in db [:stripe :token] stripe-token)
:dispatch and-then})))
#?(:cljs
(re-frame/reg-sub
::stripe-card
(fn [db]
(get-in db [:stripe :card]))))
(defn credit-card-input [view-data]
#?(:clj [:div]
:cljs
(let [on-card-error
(fn [e]
(let [error-el (js/document.getElementById "card-errors")]
(set! (.-textContent error-el)
(if-let [error (.-error e)] (.-message error) ""))))]
[:div
{:ref (fn [el]
(when el
(let [elements (.elements js/stripe)
style {:fontSize "15px"
:fontFamily "Fira Code, sans-serif"}
card (.create elements "card" (clj->js {:style {:base style}}))]
(.mount card "#card-element")
(.addEventListener card "change" on-card-error)
(re-frame/dispatch [::update-stripe-card card]))))}
[:div.nj-input.stripe-card-input
{:id "card-element"}]
[:div.mt2.red.f6 {:id "card-errors" :role "alert"}]])))
(defn open-science-description [{:keys [intent]}]
[:div.flex.lh-copy
[:div.flex-auto.mr3
[:div.flex
(icon/view "CheckmarkBold" {:class "mr1 relative fill-teal" :style {:margin-top "3px"}})
"All notebooks are public"]
[:div.flex
(icon/view "CheckmarkBold" {:class "mr1 relative fill-teal" :style {:margin-top "3px"}})
"One concurrent compute resource with up to 4 GB RAM"]]])
(defn private-research-description [{:keys [intent]}]
[:div.lh-copy
[:div.flex
(icon/view "CheckmarkBold" {:class "mr1 relative fill-teal" :style {:margin-top "3px"}})
"Private notebooks"]
[:div.flex
(icon/view "CheckmarkBold" {:class "mr1 relative fill-teal" :style {:margin-top "3px"}})
"Secrets management"]
[:div.flex
(icon/view "CheckmarkBold" {:class "mr1 relative fill-teal" :style {:margin-top "3px"}})
"Private data access"]
[:div.flex
(icon/view "CheckmarkBold" {:class "mr1 relative fill-teal" :style {:margin-top "3px"}})
"One concurrent compute resource including GPU"]
[:div.flex
(icon/view "Info" {:class "mr1 relative fill-teal" :style {:margin-top "1px"}})
"Additional compute resources are billed per use"]])
(defn enterprise-description [{:keys [intent]}]
[:div.lh-copy
[:div.flex
(icon/view "CheckmarkBold" {:class "mr1 relative fill-teal" :style {:margin-top "3px"}})
"SAML single sign-on"]
[:div.flex
(icon/view "CheckmarkBold" {:class "mr1 relative fill-teal" :style {:margin-top "3px"}})
"Priority support"]
[:div.flex
(icon/view "CheckmarkBold" {:class "mr1 relative fill-teal" :style {:margin-top "3px"}})
"Self-hosted or cloud-hosted"]
[:div.flex
(icon/view "CheckmarkBold" {:class "mr1 relative fill-teal" :style {:margin-top "3px"}})
"Invoice billing"]
[:div.flex
(icon/view "Info" {:class "mr1 relative fill-teal" :style {:margin-top "1px"}})
"starts at five seats"]])
(defn select-plan [{:keys [plan intent selected-plan] :as view-data}]
(let [select-plan (fn [p] #?(:cljs (re-frame/dispatch [::select-plan p])))
plan (or plan selected-plan)]
[:div
(let [selected? (not= plan :private-research)]
[:div.mb3
[:div.settings-section.nj-shadow.nj-shadow-hover.flex-ns.items-center
{:on-click #(select-plan :open-science)
:class (when selected? "box-selected")
:style {:padding-top 0 :padding-bottom 0}}
[:img.w-20-ns.mr4-ns {:src "/images/illustrations/open-science-plan.svg"}]
[:div.flex-auto.f6
[:input.mr3.dn {:type "radio" :id "open-science-plan" :name "plan" :value "0"
:checked selected?
:on-change #(select-plan :open-science)}]
[:label.f5.b.db.mb2 {:for "open-science-plan"} "Open Science — Free"]
[open-science-description {:intent intent}]]
[:div.flex.justify-center.db-ns.pv3.pv0-na
[:div.br-100.mr4-ns.flex.items-center.justify-center
{:style {:width "60px" :height "60px" :border "2px solid var(--teal-color)"}}
(when selected?
(icon/view "Checkmark" {:size 40 :class "fill-teal"}))]]]])
(let [selected? (= plan :private-research)]
[:div.mb3
[:div.settings-section.nj-shadow.nj-shadow-hover.flex-ns.items-center
{:on-click #(select-plan :private-research)
:class (when selected? "box-selected")
:style {:padding-top 0 :padding-bottom 0}}
[:img.w-20-ns.mr4-ns {:src "/images/illustrations/private-research-plan.svg"}]
[:div.flex-auto.f6
[:input.mr3.dn {:type "radio" :id "private-research-group-plan" :name "plan" :value "1"
:checked selected?
:on-change #(select-plan :private-research)}]
[:label.f5.b.db.mb2
{:for "private-research-group-plan"}
"Private Research — $99 "
(when-not (= intent ::upgrade-person) "per researcher ")
"per month"]
[private-research-description {:intent intent}]]
[:div.flex.justify-center.db-ns.pv3.pv0-ns
[:div.br-100.mr4-ns.flex.items-center.justify-center
{:style {:width "60px" :height "60px" :border "2px solid var(--teal-color)"}}
(when selected?
(icon/view "Checkmark" {:size 40 :class "fill-teal"}))]]]])]))
#?(:cljs
(re-frame/reg-event-db
::changing-plan
(fn [db [_ changing-plan?]]
(assoc-in db [:view-data :changing-plan?] changing-plan?))))
#?(:cljs
(re-frame/reg-event-db
::changing-payment
(fn [db [_ changing-payment?]]
(assoc-in db [:view-data :changing-payment?] changing-payment?))))
(defn plan-view [{:keys [profile url-for intent]}]
[:div.sans-serif.flex
(if (:stripe/subscription-id profile)
[:div.lh-copy.f5.flex-auto
[:b "Private Research"]
" — $99 per researcher per month"
[:br]
[:span.f6
"Private notebooks, secrets management and private data access."]
[:p.black-50.f6.mb2
"Need to change or cancel your plan? Want to export your data?"]
[:a.nj-button-sm--secondary.dib.w-100.w-auto-ns.intercom-launcher
{:href "#"}
"Get in touch"]]
[:div.lh-copy.f5.flex-auto
[:b "Open Science"]
" — Free"
[:br]
[:span.f6
"All notebooks are public."]
[:p.mb3.black-50.f6
"Need private data store, secrets management and private data access?"]
[:a.nj-button--secondary.dib.w-100.w-auto-ns
{:href (if (= intent ::upgrade-group)
(url-for :billing/upgrade-group :params {:profile-id-or-handle (:profile/handle profile)})
(url-for :billing/upgrade-person))}
"Upgrade"
[:span.dn.di-ns " to a Private Research plan"]]])])
(defn change-plan-view [{:keys [current-plan intent plan] :as view-data}]
[:div
[:div
[select-plan view-data]
(when (and (or (not current-plan) (= current-plan :open-science))
(contains? #{:private-research} plan))
[:div
[:h3.mt4.mb2.bb.b--black-05.pb1
"Pay with credit card"]
[:p.sans-serif.mb2.black-60.f6
(if (= intent ::upgrade-person)
"This plan will be billed to your personal account."
"This plan will be billed to the group, not your personal account.")]
#?(:cljs
[credit-card-input view-data])])]
[:div.mt3.flex
[:button.nj-button--primary.mr2 "Change plan"]
#?(:cljs
[:button.nj-button--secondary
{:on-click (fn [e]
(.preventDefault e)
(re-frame/dispatch [::changing-plan false]))}
"Cancel"])]])
(defn payment-view [{:keys [credit-card due-next total]}]
(let [{:keys [ending-in expiration]} credit-card]
[:div.flex.sans-serif.f6
[:div.flex-auto.lh-copy
[:p.mb0
(icon/view "CreditCard" {:size 16 :class "o-30 mr1 relative" :style {:top "3px"}})
[:b "Credit Card ending in " ending-in]
" Expiration: "
[:b expiration]]
[:p.mt0
"Next payment due: " [:b (helpers/format-util-date due-next helpers/fmt-date-only)]]
[:p.mt0
"Total amount: " [:b (format-usd total)]]]
#?(:cljs
[:div
[:button.nj-button-sm--secondary
{:on-click (fn [e]
(.preventDefault e)
(re-frame/dispatch [::changing-payment true]))}
"Change card"]])]))
(defn change-payment-view [{:keys [intent] :as view-data}]
[:div
[:p.sans-serif.mb2.black-60.f6
(if (= intent ::upgrade-person)
"This plan will be billed to your personal account."
"This plan will be billed to the group, not your personal account.")]
#?(:cljs
[:div {:style {:max-width "490px"}}
[credit-card-input view-data]])
[:div.mt3.flex
[:button.nj-button--primary.mr2 "Change plan"]
#?(:cljs
[:button.nj-button--secondary
{:on-click (fn [e]
(.preventDefault e)
(re-frame/dispatch [::changing-payment false]))}
"Cancel"])]])
(defn invoices-view [invoices]
;; See: https://stripe.com/docs/api/invoices
[:table.sans-serif.f6 {:cell-padding 0 :cell-spacing 0}
[:thead
[:tr
[:th.tl.pa2.pr3.bb.b--black-05.f7 "Date"]
[:th.tr.pa2.pr3.bb.b--black-05.f7 "Amount"]
[:th.tr.pa2.bb.b--black-05.f7 "Invoice"]]]
[:tbody
(map-indexed
(fn [i {:keys [amount date id invoice-pdf]}]
^{:key id}
[:tr {:class (when (odd? i) "bg-teal-transparent")}
[:td.pa2.pr3.bb.b--black-05 (helpers/format-util-date date helpers/fmt-date-only)]
[:td.pa2.pr3.bb.b--black-05.tr (format-usd amount)]
[:td.pa2.bb.b--black-05.tr
[:a {:href invoice-pdf} "Download"]]])
invoices)]])
#?(:cljs
(defn submit-billing-form-handler [match stripe-card stripe-token]
(fn [event]
(.preventDefault event)
(when-let [form (util/dom-closest (.-target event) "form")]
(let [form-data (form/get-form-data form)
submit-stripe? (and (not stripe-token) stripe-card)
match (assoc-in match [:data :form-params] form-data)]
(cond
stripe-token
(let [match (assoc-in match [:data :form-params :stripe-token] stripe-token)]
(re-frame/dispatch [:navigate-to match]))
submit-stripe?
(let [token-promise (js/stripe.createToken stripe-card)]
(.then token-promise
(fn [result]
(when-let [token (-> result .-token js->clj)]
(let [match (assoc-in match [:data :form-params :stripe-token] token)]
(re-frame/dispatch [::update-stripe-token token [:navigate-to match]]))))))
:else
(re-frame/dispatch [:navigate-to match])))))))
(defn settings [view-data]
(plan-view view-data))
#?(:cljs
(re-frame/reg-event-fx
::validate-handle
(fn [{:keys [db]} [_ handle]]
(js/console.log "validate-handle" handle)
{:db (assoc-in db [:view-data :handle-validation] {:handle handle :state :loading})})))
(defn handle-input [{:keys [field intent]}]
(let [{:keys [state error]} {}
{handle :value} field
handle (form/atom handle)]
(fn [{:keys [field]}]
[:div.sans-serif
[:div.relative
[:input.nj-input.mb2.w-100.border-box
(form/field-attrs-for
field
{:type "text"
:value @handle
#?@(:cljs [:on-change #(reset! handle (.. % -target -value))])})]
#?(:cljs
(when state
[:div.absolute
{:style {:right "10px" :top "10px"}}
(case state
:loading [spinner/view {:size 16 :class "fill-teal"}]
:error (icon/view "CloseBold" {:class "fill-red"})
:success (icon/view "CheckmarkBold" {:class "fill-green"}))]))]
[:div.black-50.f6.lh-copy
"Your"
(when-not (= intent ::upgrade-person) " group's")
" notebooks will be available at: "
[:br]
[:b "https://nextjournal.com/" @handle]]])))
(defn pay-with-credit-card [{:keys [intent] :as view-data}]
[:div
[:label.db.b.mb2.f5 "Pay with credit card"]
[:div.mb2
#?(:clj [:div]
:cljs
(let [stripe-token @(re-frame/subscribe [::stripe-token])]
(if-not stripe-token
[credit-card-input view-data]
[:span (str "Your credit card ending in " (get-in stripe-token ["card" "last4"]) " will get used")])))]
[:p.black-50.f6.mt0
(if (= intent ::upgrade-person)
"This plan will be billed to your personal account."
"This plan will be billed to the group, not your personal account.")]])
(s/def ::profile (views.specs/into-map-with-keys ::views.specs/profile))
(s/def ::upgrade.view-data (s/keys :opt-un [::profile]))
(s/fdef upgrade :args (s/cat :view-data ::upgrade.view-data))
(defn upgrade
"Provides the unified form to create a subscription, either for upgrading
a peson or existing group, or createing a new group."
[{:keys [form-data form-id handle-validation intent plan profile url-for] :as view-data}]
(let [needs-handle? (nil? (:profile/handle profile))
upgrade? (contains? #{::upgrade-group ::upgrade-person} intent)
form (form/construct form-id (-> form-data
(assoc :record profile)))
match (form/route-match form)
selected-plan (condp = (get-in form [:inputs ::form.billing/plan])
"0" :open-science
"1" :private-research
nil)]
[:div.page
[:h2.mb4
(case intent
::create-group "Set up a new group"
::upgrade-group (str "Upgrade " (:profile/name profile))
::upgrade-person "Upgrade your personal account")]
(when upgrade?
[:div.mb4
[:div.settings-section.nj-shadow.flex-ns
[:img.w-30.mr4 {:src "/images/illustrations/private-research-plan.svg"}]
[:div.flex-auto
[:h4.mb2.mt0
"Private Research — $99 "
(when-not (= intent ::upgrade-person) "per researcher ")
"per month"]
[:div.f6
[private-research-description {:intent intent}]
(when (= intent ::upgrade-person)
[:div.bt.b--black-05.mt2.pt3.flex-ns.items-center
[:span.mr2
"Need advance collaboration features? "]
[:a.flex.items-center {:href (url-for :add-group)}
"Create a group instead"
(icon/view "ArrowRight" {:size 16 :class "fill-teal mr2"})]])]]]])
(form/form-for
form
{#?@(:cljs [:on-submit (submit-billing-form-handler
match
@(re-frame/subscribe [::stripe-card])
@(re-frame/subscribe [::stripe-token]))])}
^{:key "main-info"}
[:div.sans-serif.flex-ns.mb4
(when-not upgrade?
(let [f (form/field-for form ::form.billing/name)]
[:div.mb3.flex-auto.mr4-ns
[:label.db.b.mb2.f5 "Group Name"]
[form/render-input f form]
(form/render-errors-for f)]))
(when needs-handle?
(let [f (form/field-for form ::form.billing/handle)]
[:div.flex-auto
[:label.db.b.mb2.f5 "Handle"]
[handle-input {:field f :intent intent :handle-validation handle-validation}]
(form/render-errors-for f)]))]
^{:key "billing-info"}
[:div.sans-serif
(if upgrade?
[:div.flex-ns
[:div.flex-auto.mr3-ns
(let [f (form/field-for form ::form.billing/billing-email)]
[:div.mb3 {:style {:max-width "490px"}}
[:label.db.b.mb2.f5 "Billing Email"]
[form/render-input f form]
[:div.black-50.f6.lh-copy.mt2 "This is the email that we'll send receipts to."]
(form/render-errors-for f)])]
[:div.flex-auto
[pay-with-credit-card view-data]]]
[:div
[:h3.mb3 "Choose a plan" (when-not (= intent ::upgrade-person) " for this group")]
[select-plan (assoc view-data :selected-plan selected-plan)]
[:div.mb4
[:div.settings-section.flex-ns.items-center.nj-shadow
{:style {:padding-top 0 :padding-bottom 0}}
[:img.w-20-ns.mr4-ns {:src "/images/illustrations/enterprise-plan.svg"}]
[:div.f6.flex-auto
[:label.f5.b.db.mb2
{:for "private-research-group-plan"}
"Enterprise — $149 "
(when-not (= intent ::upgrade-person) "per researcher ")
"per month"]
[enterprise-description {:intent intent}]]
[:div.flex.db-ns.justify-center.pv3.pv0-ns
[:div.mr4-ns.f7.ttu.tc.justify-center.lh-copy.b
{:style {:max-width "60px"}}
(icon/view "Chat" {:size 40 :class "fill-teal mb1"})
[:a.intercom-launcher {:href "#intercom"} "Contact Sales"]]]]]
[:div.flex-ns
(let [f (form/field-for form ::form.billing/billing-email)]
[:div.flex-auto.mr4-ns
[:label.db.b.mb2.f5 "Billing Email"]
[form/render-input f form]
[:div.black-50.f6.lh-copy.mt2 "This is the email that we'll send receipts to."]
(form/render-errors-for f)])
(when (contains? #{:private-research} (or plan selected-plan))
[:div.flex-auto
[pay-with-credit-card view-data]])]])]
^{:key "submit-controls"}
[:div.mt3.pt3.bt.b--black-05
[:button.nj-button--primary.w-100.w-auto-ns
(if upgrade? "Upgrade now" "Create group")]])]))
#?(:cljs
(do
(defcard-nj handle
[handle-input nil])
(defcard-nj handle-error
[handle-input {:handle "nextjournal"
:state :error
:error "https://nextjournal.com/nextjournal is already taken."}])
(defcard-nj handle-success
[handle-input {:handle "nextjournal"
:state :success}])
(defcard-nj handle-loading
[handle-input {:handle "nextjournal"
:state :loading}])
(defcard-nj open-science-plan
[plan-view {:profile {}}])
(defcard-nj private-research-plan
[plan-view {:profile {:stripe/subscription-id (name (gensym))}}])
(defcard-nj change-plan-view
[change-plan-view {}])
(defcard-nj payment
[payment-view {:credit-card {:ending-in "4242" :expiration "09/2021"}
:due-next #inst "2018-11-03T19:23:56.949-00:00"
:total 396.00}])
(defcard-nj change-payment
[change-payment-view {}])
(defcard-nj invoices
[invoices-view [{:date #inst "2018-10-03T19:23:56.949-00:00"
:amount 396.00
:id (gensym)
:invoice-pdf "https://stripe.com/"}
{:date #inst "2018-09-03T19:23:56.949-00:00"
:amount 396.00
:id (gensym)
:invoice-pdf "https://stripe.com/"}
{:date #inst "2018-08-03T19:23:56.949-00:00"
:amount 99.00
:id (gensym)
:invoice-pdf "https://stripe.com/"}]])))
// Compiled by ClojureScript 0.0.1493314493 {:language-out :ecmascript5}
goog.provide('com.nextjournal.journal.views.billing');
goog.require('cljs.core');
goog.require('com.nextjournal.editor.components.ui.icon');
goog.require('com.nextjournal.editor.router');
goog.require('com.nextjournal.journal.form');
goog.require('com.nextjournal.journal.form.group');
goog.require('com.nextjournal.journal.form.billing');
goog.require('com.nextjournal.graph.uuid');
goog.require('com.nextjournal.journal.views.helpers');
goog.require('com.nextjournal.journal.views.specs');
goog.require('cljs.spec.alpha');
goog.require('com.nextjournal.devcards');
goog.require('re_frame.core');
goog.require('com.nextjournal.editor.components.ui.spinner');
goog.require('com.nextjournal.editor.event_buffer');
goog.require('com.nextjournal.editor.util');
com.nextjournal.journal.views.billing.format_usd = (function com$nextjournal$journal$views$billing$format_usd(amount){
return ["$",cljs.core.str.cljs$core$IFn$_invoke$arity$1(amount)].join('');
});
re_frame.core.reg_event_db.call(null,new cljs.core.Keyword("com.nextjournal.journal.views.billing","select-plan","com.nextjournal.journal.views.billing/select-plan",-1755294475),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.event_buffer.add], null),(function (db,p__135129){
var vec__135130 = p__135129;
var _ = cljs.core.nth.call(null,vec__135130,(0),null);
var plan = cljs.core.nth.call(null,vec__135130,(1),null);
var G__135133 = db;
var G__135133__$1 = ((cljs.core._EQ_.call(null,plan,new cljs.core.Keyword(null,"open-science","open-science",-170639210)))?cljs.core.dissoc.call(null,G__135133,new cljs.core.Keyword(null,"stripe","stripe",-2092535278)):G__135133);
return cljs.core.assoc_in.call(null,G__135133__$1,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"view-data","view-data",461796245),new cljs.core.Keyword(null,"plan","plan",1118952668)], null),plan);
}));
re_frame.core.reg_event_db.call(null,new cljs.core.Keyword("com.nextjournal.journal.views.billing","update-stripe-card","com.nextjournal.journal.views.billing/update-stripe-card",1503021121),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.event_buffer.add], null),(function (db,p__135134){
var vec__135135 = p__135134;
var _ = cljs.core.nth.call(null,vec__135135,(0),null);
var card = cljs.core.nth.call(null,vec__135135,(1),null);
return cljs.core.assoc_in.call(null,db,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stripe","stripe",-2092535278),new cljs.core.Keyword(null,"card","card",-1430355152)], null),card);
}));
re_frame.core.reg_sub.call(null,new cljs.core.Keyword("com.nextjournal.journal.views.billing","stripe-token","com.nextjournal.journal.views.billing/stripe-token",291608366),(function (db){
return cljs.core.get_in.call(null,db,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stripe","stripe",-2092535278),new cljs.core.Keyword(null,"token","token",-1211463215)], null));
}));
re_frame.core.reg_event_fx.call(null,new cljs.core.Keyword("com.nextjournal.journal.views.billing","update-stripe-token","com.nextjournal.journal.views.billing/update-stripe-token",-469294398),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.event_buffer.add], null),(function (p__135138,p__135139){
var map__135140 = p__135138;
var map__135140__$1 = (((((!((map__135140 == null))))?(((((map__135140.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__135140.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__135140):map__135140);
var db = cljs.core.get.call(null,map__135140__$1,new cljs.core.Keyword(null,"db","db",993250759));
var vec__135141 = p__135139;
var _ = cljs.core.nth.call(null,vec__135141,(0),null);
var stripe_token = cljs.core.nth.call(null,vec__135141,(1),null);
var and_then = cljs.core.nth.call(null,vec__135141,(2),null);
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"db","db",993250759),cljs.core.assoc_in.call(null,db,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stripe","stripe",-2092535278),new cljs.core.Keyword(null,"token","token",-1211463215)], null),stripe_token),new cljs.core.Keyword(null,"dispatch","dispatch",1319337009),and_then], null);
}));
re_frame.core.reg_sub.call(null,new cljs.core.Keyword("com.nextjournal.journal.views.billing","stripe-card","com.nextjournal.journal.views.billing/stripe-card",1412267933),(function (db){
return cljs.core.get_in.call(null,db,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stripe","stripe",-2092535278),new cljs.core.Keyword(null,"card","card",-1430355152)], null));
}));
com.nextjournal.journal.views.billing.credit_card_input = (function com$nextjournal$journal$views$billing$credit_card_input(view_data){
var on_card_error = (function (e){
var error_el = document.getElementById("card-errors");
return error_el.textContent = (function (){var temp__5733__auto__ = e.error;
if(cljs.core.truth_(temp__5733__auto__)){
var error = temp__5733__auto__;
return error.message;
} else {
return "";
}
})();
});
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"ref","ref",1289896967),((function (on_card_error){
return (function (el){
if(cljs.core.truth_(el)){
var elements = stripe.elements();
var style = new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"fontSize","fontSize",919623033),"15px",new cljs.core.Keyword(null,"fontFamily","fontFamily",1493518353),"Fira Code, sans-serif"], null);
var card = elements.create("card",cljs.core.clj__GT_js.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"base","base",185279322),style], null)], null)));
card.mount("#card-element");
card.addEventListener("change",on_card_error);
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("com.nextjournal.journal.views.billing","update-stripe-card","com.nextjournal.journal.views.billing/update-stripe-card",1503021121),card], null));
} else {
return null;
}
});})(on_card_error))
], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.nj-input.stripe-card-input","div.nj-input.stripe-card-input",-1943734262),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"id","id",-1388402092),"card-element"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.mt2.red.f6","div.mt2.red.f6",832342753),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"id","id",-1388402092),"card-errors",new cljs.core.Keyword(null,"role","role",-736691072),"alert"], null)], null)], null);
});
com.nextjournal.journal.views.billing.open_science_description = (function com$nextjournal$journal$views$billing$open_science_description(p__135145){
var map__135146 = p__135145;
var map__135146__$1 = (((((!((map__135146 == null))))?(((((map__135146.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__135146.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__135146):map__135146);
var intent = cljs.core.get.call(null,map__135146__$1,new cljs.core.Keyword(null,"intent","intent",-390846953));
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.lh-copy","div.flex.lh-copy",-1020017202),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex-auto.mr3","div.flex-auto.mr3",564838572),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex","div.flex",-396986231),com.nextjournal.editor.components.ui.icon.view.call(null,"CheckmarkBold",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"class","class",-2030961996),"mr1 relative fill-teal",new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"3px"], null)], null)),"All notebooks are public"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex","div.flex",-396986231),com.nextjournal.editor.components.ui.icon.view.call(null,"CheckmarkBold",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"class","class",-2030961996),"mr1 relative fill-teal",new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"3px"], null)], null)),"One concurrent compute resource with up to 4 GB RAM"], null)], null)], null);
});
com.nextjournal.journal.views.billing.private_research_description = (function com$nextjournal$journal$views$billing$private_research_description(p__135148){
var map__135149 = p__135148;
var map__135149__$1 = (((((!((map__135149 == null))))?(((((map__135149.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__135149.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__135149):map__135149);
var intent = cljs.core.get.call(null,map__135149__$1,new cljs.core.Keyword(null,"intent","intent",-390846953));
return new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.lh-copy","div.lh-copy",-582910100),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex","div.flex",-396986231),com.nextjournal.editor.components.ui.icon.view.call(null,"CheckmarkBold",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"class","class",-2030961996),"mr1 relative fill-teal",new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"3px"], null)], null)),"Private notebooks"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex","div.flex",-396986231),com.nextjournal.editor.components.ui.icon.view.call(null,"CheckmarkBold",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"class","class",-2030961996),"mr1 relative fill-teal",new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"3px"], null)], null)),"Secrets management"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex","div.flex",-396986231),com.nextjournal.editor.components.ui.icon.view.call(null,"CheckmarkBold",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"class","class",-2030961996),"mr1 relative fill-teal",new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"3px"], null)], null)),"Private data access"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex","div.flex",-396986231),com.nextjournal.editor.components.ui.icon.view.call(null,"CheckmarkBold",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"class","class",-2030961996),"mr1 relative fill-teal",new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"3px"], null)], null)),"One concurrent compute resource including GPU"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex","div.flex",-396986231),com.nextjournal.editor.components.ui.icon.view.call(null,"Info",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"class","class",-2030961996),"mr1 relative fill-teal",new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"1px"], null)], null)),"Additional compute resources are billed per use"], null)], null);
});
com.nextjournal.journal.views.billing.enterprise_description = (function com$nextjournal$journal$views$billing$enterprise_description(p__135173){
var map__135174 = p__135173;
var map__135174__$1 = (((((!((map__135174 == null))))?(((((map__135174.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__135174.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__135174):map__135174);
var intent = cljs.core.get.call(null,map__135174__$1,new cljs.core.Keyword(null,"intent","intent",-390846953));
return new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.lh-copy","div.lh-copy",-582910100),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex","div.flex",-396986231),com.nextjournal.editor.components.ui.icon.view.call(null,"CheckmarkBold",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"class","class",-2030961996),"mr1 relative fill-teal",new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"3px"], null)], null)),"SAML single sign-on"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex","div.flex",-396986231),com.nextjournal.editor.components.ui.icon.view.call(null,"CheckmarkBold",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"class","class",-2030961996),"mr1 relative fill-teal",new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"3px"], null)], null)),"Priority support"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex","div.flex",-396986231),com.nextjournal.editor.components.ui.icon.view.call(null,"CheckmarkBold",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"class","class",-2030961996),"mr1 relative fill-teal",new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"3px"], null)], null)),"Self-hosted or cloud-hosted"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex","div.flex",-396986231),com.nextjournal.editor.components.ui.icon.view.call(null,"CheckmarkBold",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"class","class",-2030961996),"mr1 relative fill-teal",new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"3px"], null)], null)),"Invoice billing"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex","div.flex",-396986231),com.nextjournal.editor.components.ui.icon.view.call(null,"Info",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"class","class",-2030961996),"mr1 relative fill-teal",new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"1px"], null)], null)),"starts at five seats"], null)], null);
});
com.nextjournal.journal.views.billing.select_plan = (function com$nextjournal$journal$views$billing$select_plan(p__135209){
var map__135210 = p__135209;
var map__135210__$1 = (((((!((map__135210 == null))))?(((((map__135210.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__135210.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__135210):map__135210);
var view_data = map__135210__$1;
var plan = cljs.core.get.call(null,map__135210__$1,new cljs.core.Keyword(null,"plan","plan",1118952668));
var intent = cljs.core.get.call(null,map__135210__$1,new cljs.core.Keyword(null,"intent","intent",-390846953));
var selected_plan = cljs.core.get.call(null,map__135210__$1,new cljs.core.Keyword(null,"selected-plan","selected-plan",210054588));
var select_plan = ((function (map__135210,map__135210__$1,view_data,plan,intent,selected_plan){
return (function (p){
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("com.nextjournal.journal.views.billing","select-plan","com.nextjournal.journal.views.billing/select-plan",-1755294475),p], null));
});})(map__135210,map__135210__$1,view_data,plan,intent,selected_plan))
;
var plan__$1 = (function (){var or__88041__auto__ = plan;
if(cljs.core.truth_(or__88041__auto__)){
return or__88041__auto__;
} else {
return selected_plan;
}
})();
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),(function (){var selected_QMARK_ = cljs.core.not_EQ_.call(null,plan__$1,new cljs.core.Keyword(null,"private-research","private-research",-417719578));
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.mb3","div.mb3",1788115986),new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.settings-section.nj-shadow.nj-shadow-hover.flex-ns.items-center","div.settings-section.nj-shadow.nj-shadow-hover.flex-ns.items-center",1095272461),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (selected_QMARK_,select_plan,plan__$1,map__135210,map__135210__$1,view_data,plan,intent,selected_plan){
return (function (){
return select_plan.call(null,new cljs.core.Keyword(null,"open-science","open-science",-170639210));
});})(selected_QMARK_,select_plan,plan__$1,map__135210,map__135210__$1,view_data,plan,intent,selected_plan))
,new cljs.core.Keyword(null,"class","class",-2030961996),((selected_QMARK_)?"box-selected":null),new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"padding-top","padding-top",1929675955),(0),new cljs.core.Keyword(null,"padding-bottom","padding-bottom",-1899795591),(0)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"img.w-20-ns.mr4-ns","img.w-20-ns.mr4-ns",2012939825),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"src","src",-1651076051),"/images/illustrations/open-science-plan.svg"], null)], null),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex-auto.f6","div.flex-auto.f6",-1896621959),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"input.mr3.dn","input.mr3.dn",1432000176),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"type","type",1174270348),"radio",new cljs.core.Keyword(null,"id","id",-1388402092),"open-science-plan",new cljs.core.Keyword(null,"name","name",1843675177),"plan",new cljs.core.Keyword(null,"value","value",305978217),"0",new cljs.core.Keyword(null,"checked","checked",-50955819),selected_QMARK_,new cljs.core.Keyword(null,"on-change","on-change",-732046149),((function (selected_QMARK_,select_plan,plan__$1,map__135210,map__135210__$1,view_data,plan,intent,selected_plan){
return (function (){
return select_plan.call(null,new cljs.core.Keyword(null,"open-science","open-science",-170639210));
});})(selected_QMARK_,select_plan,plan__$1,map__135210,map__135210__$1,view_data,plan,intent,selected_plan))
], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"label.f5.b.db.mb2","label.f5.b.db.mb2",-1975430006),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"for","for",-1323786319),"open-science-plan"], null),"Open Science \u2014 Free"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.journal.views.billing.open_science_description,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"intent","intent",-390846953),intent], null)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.justify-center.db-ns.pv3.pv0-na","div.flex.justify-center.db-ns.pv3.pv0-na",-1005312463),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.br-100.mr4-ns.flex.items-center.justify-center","div.br-100.mr4-ns.flex.items-center.justify-center",2032143943),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"width","width",-384071477),"60px",new cljs.core.Keyword(null,"height","height",1025178622),"60px",new cljs.core.Keyword(null,"border","border",1444987323),"2px solid var(--teal-color)"], null)], null),((selected_QMARK_)?com.nextjournal.editor.components.ui.icon.view.call(null,"Checkmark",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"size","size",1098693007),(40),new cljs.core.Keyword(null,"class","class",-2030961996),"fill-teal"], null)):null)], null)], null)], null)], null);
})(),(function (){var selected_QMARK_ = cljs.core._EQ_.call(null,plan__$1,new cljs.core.Keyword(null,"private-research","private-research",-417719578));
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.mb3","div.mb3",1788115986),new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.settings-section.nj-shadow.nj-shadow-hover.flex-ns.items-center","div.settings-section.nj-shadow.nj-shadow-hover.flex-ns.items-center",1095272461),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (selected_QMARK_,select_plan,plan__$1,map__135210,map__135210__$1,view_data,plan,intent,selected_plan){
return (function (){
return select_plan.call(null,new cljs.core.Keyword(null,"private-research","private-research",-417719578));
});})(selected_QMARK_,select_plan,plan__$1,map__135210,map__135210__$1,view_data,plan,intent,selected_plan))
,new cljs.core.Keyword(null,"class","class",-2030961996),((selected_QMARK_)?"box-selected":null),new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"padding-top","padding-top",1929675955),(0),new cljs.core.Keyword(null,"padding-bottom","padding-bottom",-1899795591),(0)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"img.w-20-ns.mr4-ns","img.w-20-ns.mr4-ns",2012939825),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"src","src",-1651076051),"/images/illustrations/private-research-plan.svg"], null)], null),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex-auto.f6","div.flex-auto.f6",-1896621959),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"input.mr3.dn","input.mr3.dn",1432000176),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"type","type",1174270348),"radio",new cljs.core.Keyword(null,"id","id",-1388402092),"private-research-group-plan",new cljs.core.Keyword(null,"name","name",1843675177),"plan",new cljs.core.Keyword(null,"value","value",305978217),"1",new cljs.core.Keyword(null,"checked","checked",-50955819),selected_QMARK_,new cljs.core.Keyword(null,"on-change","on-change",-732046149),((function (selected_QMARK_,select_plan,plan__$1,map__135210,map__135210__$1,view_data,plan,intent,selected_plan){
return (function (){
return select_plan.call(null,new cljs.core.Keyword(null,"private-research","private-research",-417719578));
});})(selected_QMARK_,select_plan,plan__$1,map__135210,map__135210__$1,view_data,plan,intent,selected_plan))
], null)], null),new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"label.f5.b.db.mb2","label.f5.b.db.mb2",-1975430006),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"for","for",-1323786319),"private-research-group-plan"], null),"Private Research \u2014 $99 ",((cljs.core._EQ_.call(null,intent,new cljs.core.Keyword("com.nextjournal.journal.views.billing","upgrade-person","com.nextjournal.journal.views.billing/upgrade-person",-850105781)))?null:"per researcher "),"per month"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.journal.views.billing.private_research_description,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"intent","intent",-390846953),intent], null)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.justify-center.db-ns.pv3.pv0-ns","div.flex.justify-center.db-ns.pv3.pv0-ns",-62613084),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.br-100.mr4-ns.flex.items-center.justify-center","div.br-100.mr4-ns.flex.items-center.justify-center",2032143943),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"width","width",-384071477),"60px",new cljs.core.Keyword(null,"height","height",1025178622),"60px",new cljs.core.Keyword(null,"border","border",1444987323),"2px solid var(--teal-color)"], null)], null),((selected_QMARK_)?com.nextjournal.editor.components.ui.icon.view.call(null,"Checkmark",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"size","size",1098693007),(40),new cljs.core.Keyword(null,"class","class",-2030961996),"fill-teal"], null)):null)], null)], null)], null)], null);
})()], null);
});
re_frame.core.reg_event_db.call(null,new cljs.core.Keyword("com.nextjournal.journal.views.billing","changing-plan","com.nextjournal.journal.views.billing/changing-plan",-388843646),(function (db,p__135212){
var vec__135213 = p__135212;
var _ = cljs.core.nth.call(null,vec__135213,(0),null);
var changing_plan_QMARK_ = cljs.core.nth.call(null,vec__135213,(1),null);
return cljs.core.assoc_in.call(null,db,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"view-data","view-data",461796245),new cljs.core.Keyword(null,"changing-plan?","changing-plan?",-76708114)], null),changing_plan_QMARK_);
}));
re_frame.core.reg_event_db.call(null,new cljs.core.Keyword("com.nextjournal.journal.views.billing","changing-payment","com.nextjournal.journal.views.billing/changing-payment",-444927572),(function (db,p__135217){
var vec__135218 = p__135217;
var _ = cljs.core.nth.call(null,vec__135218,(0),null);
var changing_payment_QMARK_ = cljs.core.nth.call(null,vec__135218,(1),null);
return cljs.core.assoc_in.call(null,db,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"view-data","view-data",461796245),new cljs.core.Keyword(null,"changing-payment?","changing-payment?",627620475)], null),changing_payment_QMARK_);
}));
com.nextjournal.journal.views.billing.plan_view = (function com$nextjournal$journal$views$billing$plan_view(p__135221){
var map__135222 = p__135221;
var map__135222__$1 = (((((!((map__135222 == null))))?(((((map__135222.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__135222.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__135222):map__135222);
var profile = cljs.core.get.call(null,map__135222__$1,new cljs.core.Keyword(null,"profile","profile",-545963874));
var url_for = cljs.core.get.call(null,map__135222__$1,new cljs.core.Keyword(null,"url-for","url-for",-1886539080));
var intent = cljs.core.get.call(null,map__135222__$1,new cljs.core.Keyword(null,"intent","intent",-390846953));
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.sans-serif.flex","div.sans-serif.flex",-811090387),(cljs.core.truth_(new cljs.core.Keyword("stripe","subscription-id","stripe/subscription-id",-410231812).cljs$core$IFn$_invoke$arity$1(profile))?new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.lh-copy.f5.flex-auto","div.lh-copy.f5.flex-auto",2084614720),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"b","b",1482224470),"Private Research"], null)," \u2014 $99 per researcher per month",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"br","br",934104792)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.f6","span.f6",1680427572),"Private notebooks, secrets management and private data access."], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"p.black-50.f6.mb2","p.black-50.f6.mb2",-1641469357),"Need to change or cancel your plan? Want to export your data?"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a.nj-button-sm--secondary.dib.w-100.w-auto-ns.intercom-launcher","a.nj-button-sm--secondary.dib.w-100.w-auto-ns.intercom-launcher",-1615781747),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"href","href",-793805698),"#"], null),"Get in touch"], null)], null):new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.lh-copy.f5.flex-auto","div.lh-copy.f5.flex-auto",2084614720),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"b","b",1482224470),"Open Science"], null)," \u2014 Free",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"br","br",934104792)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.f6","span.f6",1680427572),"All notebooks are public."], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"p.mb3.black-50.f6","p.mb3.black-50.f6",-2019706607),"Need private data store, secrets management and private data access?"], null),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a.nj-button--secondary.dib.w-100.w-auto-ns","a.nj-button--secondary.dib.w-100.w-auto-ns",-791954629),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"href","href",-793805698),((cljs.core._EQ_.call(null,intent,new cljs.core.Keyword("com.nextjournal.journal.views.billing","upgrade-group","com.nextjournal.journal.views.billing/upgrade-group",1539746155)))?url_for.call(null,new cljs.core.Keyword("billing","upgrade-group","billing/upgrade-group",-824423259),new cljs.core.Keyword(null,"params","params",710516235),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"profile-id-or-handle","profile-id-or-handle",1791828524),new cljs.core.Keyword("profile","handle","profile/handle",1185486493).cljs$core$IFn$_invoke$arity$1(profile)], null)):url_for.call(null,new cljs.core.Keyword("billing","upgrade-person","billing/upgrade-person",2032299897)))], null),"Upgrade",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.dn.di-ns","span.dn.di-ns",-1337002039)," to a Private Research plan"], null)], null)], null))], null);
});
com.nextjournal.journal.views.billing.change_plan_view = (function com$nextjournal$journal$views$billing$change_plan_view(p__135228){
var map__135229 = p__135228;
var map__135229__$1 = (((((!((map__135229 == null))))?(((((map__135229.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__135229.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__135229):map__135229);
var view_data = map__135229__$1;
var current_plan = cljs.core.get.call(null,map__135229__$1,new cljs.core.Keyword(null,"current-plan","current-plan",-1436063793));
var intent = cljs.core.get.call(null,map__135229__$1,new cljs.core.Keyword(null,"intent","intent",-390846953));
var plan = cljs.core.get.call(null,map__135229__$1,new cljs.core.Keyword(null,"plan","plan",1118952668));
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.journal.views.billing.select_plan,view_data], null),((((((cljs.core.not.call(null,current_plan)) || (cljs.core._EQ_.call(null,current_plan,new cljs.core.Keyword(null,"open-science","open-science",-170639210))))) && (cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"private-research","private-research",-417719578),null], null), null),plan))))?new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"h3.mt4.mb2.bb.b--black-05.pb1","h3.mt4.mb2.bb.b--black-05.pb1",-154580593),"Pay with credit card"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"p.sans-serif.mb2.black-60.f6","p.sans-serif.mb2.black-60.f6",421014105),((cljs.core._EQ_.call(null,intent,new cljs.core.Keyword("com.nextjournal.journal.views.billing","upgrade-person","com.nextjournal.journal.views.billing/upgrade-person",-850105781)))?"This plan will be billed to your personal account.":"This plan will be billed to the group, not your personal account.")], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.journal.views.billing.credit_card_input,view_data], null)], null):null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.mt3.flex","div.mt3.flex",119929555),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"button.nj-button--primary.mr2","button.nj-button--primary.mr2",-1791972608),"Change plan"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"button.nj-button--secondary","button.nj-button--secondary",-12962044),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (map__135229,map__135229__$1,view_data,current_plan,intent,plan){
return (function (e){
e.preventDefault();
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("com.nextjournal.journal.views.billing","changing-plan","com.nextjournal.journal.views.billing/changing-plan",-388843646),false], null));
});})(map__135229,map__135229__$1,view_data,current_plan,intent,plan))
], null),"Cancel"], null)], null)], null);
});
com.nextjournal.journal.views.billing.payment_view = (function com$nextjournal$journal$views$billing$payment_view(p__135235){
var map__135236 = p__135235;
var map__135236__$1 = (((((!((map__135236 == null))))?(((((map__135236.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__135236.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__135236):map__135236);
var credit_card = cljs.core.get.call(null,map__135236__$1,new cljs.core.Keyword(null,"credit-card","credit-card",643068702));
var due_next = cljs.core.get.call(null,map__135236__$1,new cljs.core.Keyword(null,"due-next","due-next",370503338));
var total = cljs.core.get.call(null,map__135236__$1,new cljs.core.Keyword(null,"total","total",1916810418));
var map__135238 = credit_card;
var map__135238__$1 = (((((!((map__135238 == null))))?(((((map__135238.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__135238.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__135238):map__135238);
var ending_in = cljs.core.get.call(null,map__135238__$1,new cljs.core.Keyword(null,"ending-in","ending-in",1677203837));
var expiration = cljs.core.get.call(null,map__135238__$1,new cljs.core.Keyword(null,"expiration","expiration",238846697));
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.sans-serif.f6","div.flex.sans-serif.f6",1617811620),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex-auto.lh-copy","div.flex-auto.lh-copy",2129264851),new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"p.mb0","p.mb0",-192396293),com.nextjournal.editor.components.ui.icon.view.call(null,"CreditCard",new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"size","size",1098693007),(16),new cljs.core.Keyword(null,"class","class",-2030961996),"o-30 mr1 relative",new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"top","top",-1856271961),"3px"], null)], null)),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"b","b",1482224470),"Credit Card ending in ",ending_in], null)," Expiration: ",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"b","b",1482224470),expiration], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"p.mt0","p.mt0",-1480809839),"Next payment due: ",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"b","b",1482224470),com.nextjournal.journal.views.helpers.format_util_date.call(null,due_next,com.nextjournal.journal.views.helpers.fmt_date_only)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"p.mt0","p.mt0",-1480809839),"Total amount: ",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"b","b",1482224470),com.nextjournal.journal.views.billing.format_usd.call(null,total)], null)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"button.nj-button-sm--secondary","button.nj-button-sm--secondary",-524749413),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (map__135238,map__135238__$1,ending_in,expiration,map__135236,map__135236__$1,credit_card,due_next,total){
return (function (e){
e.preventDefault();
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("com.nextjournal.journal.views.billing","changing-payment","com.nextjournal.journal.views.billing/changing-payment",-444927572),true], null));
});})(map__135238,map__135238__$1,ending_in,expiration,map__135236,map__135236__$1,credit_card,due_next,total))
], null),"Change card"], null)], null)], null);
});
com.nextjournal.journal.views.billing.change_payment_view = (function com$nextjournal$journal$views$billing$change_payment_view(p__135241){
var map__135242 = p__135241;
var map__135242__$1 = (((((!((map__135242 == null))))?(((((map__135242.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__135242.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__135242):map__135242);
var view_data = map__135242__$1;
var intent = cljs.core.get.call(null,map__135242__$1,new cljs.core.Keyword(null,"intent","intent",-390846953));
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"p.sans-serif.mb2.black-60.f6","p.sans-serif.mb2.black-60.f6",421014105),((cljs.core._EQ_.call(null,intent,new cljs.core.Keyword("com.nextjournal.journal.views.billing","upgrade-person","com.nextjournal.journal.views.billing/upgrade-person",-850105781)))?"This plan will be billed to your personal account.":"This plan will be billed to the group, not your personal account.")], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"max-width","max-width",-1939924051),"490px"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.journal.views.billing.credit_card_input,view_data], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.mt3.flex","div.mt3.flex",119929555),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"button.nj-button--primary.mr2","button.nj-button--primary.mr2",-1791972608),"Change plan"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"button.nj-button--secondary","button.nj-button--secondary",-12962044),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (map__135242,map__135242__$1,view_data,intent){
return (function (e){
e.preventDefault();
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("com.nextjournal.journal.views.billing","changing-payment","com.nextjournal.journal.views.billing/changing-payment",-444927572),false], null));
});})(map__135242,map__135242__$1,view_data,intent))
], null),"Cancel"], null)], null)], null);
});
com.nextjournal.journal.views.billing.invoices_view = (function com$nextjournal$journal$views$billing$invoices_view(invoices){
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"table.sans-serif.f6","table.sans-serif.f6",1498281227),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"cell-padding","cell-padding",978029542),(0),new cljs.core.Keyword(null,"cell-spacing","cell-spacing",769666488),(0)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"thead","thead",-291875296),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"tr","tr",-1424774646),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"th.tl.pa2.pr3.bb.b--black-05.f7","th.tl.pa2.pr3.bb.b--black-05.f7",-122200854),"Date"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"th.tr.pa2.pr3.bb.b--black-05.f7","th.tr.pa2.pr3.bb.b--black-05.f7",509022836),"Amount"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"th.tr.pa2.bb.b--black-05.f7","th.tr.pa2.bb.b--black-05.f7",580761966),"Invoice"], null)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"tbody","tbody",-80678300),cljs.core.map_indexed.call(null,(function (i,p__135249){
var map__135250 = p__135249;
var map__135250__$1 = (((((!((map__135250 == null))))?(((((map__135250.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__135250.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__135250):map__135250);
var amount = cljs.core.get.call(null,map__135250__$1,new cljs.core.Keyword(null,"amount","amount",364489504));
var date = cljs.core.get.call(null,map__135250__$1,new cljs.core.Keyword(null,"date","date",-1463434462));
var id = cljs.core.get.call(null,map__135250__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
var invoice_pdf = cljs.core.get.call(null,map__135250__$1,new cljs.core.Keyword(null,"invoice-pdf","invoice-pdf",-1140992613));
return cljs.core.with_meta(new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"tr","tr",-1424774646),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"class","class",-2030961996),((cljs.core.odd_QMARK_.call(null,i))?"bg-teal-transparent":null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"td.pa2.pr3.bb.b--black-05","td.pa2.pr3.bb.b--black-05",782749734),com.nextjournal.journal.views.helpers.format_util_date.call(null,date,com.nextjournal.journal.views.helpers.fmt_date_only)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"td.pa2.pr3.bb.b--black-05.tr","td.pa2.pr3.bb.b--black-05.tr",2028827599),com.nextjournal.journal.views.billing.format_usd.call(null,amount)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"td.pa2.bb.b--black-05.tr","td.pa2.bb.b--black-05.tr",714115273),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a","a",-2123407586),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"href","href",-793805698),invoice_pdf], null),"Download"], null)], null)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key","key",-1516042587),id], null));
}),invoices)], null)], null);
});
com.nextjournal.journal.views.billing.submit_billing_form_handler = (function com$nextjournal$journal$views$billing$submit_billing_form_handler(match,stripe_card,stripe_token){
return (function (event){
event.preventDefault();
var temp__5735__auto__ = com.nextjournal.editor.util.dom_closest.call(null,event.target,"form");
if(cljs.core.truth_(temp__5735__auto__)){
var form = temp__5735__auto__;
var form_data = com.nextjournal.journal.form.get_form_data.call(null,form);
var submit_stripe_QMARK_ = (function (){var and__88026__auto__ = cljs.core.not.call(null,stripe_token);
if(and__88026__auto__){
return stripe_card;
} else {
return and__88026__auto__;
}
})();
var match__$1 = cljs.core.assoc_in.call(null,match,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"data","data",-232669377),new cljs.core.Keyword(null,"form-params","form-params",1884296467)], null),form_data);
if(cljs.core.truth_(stripe_token)){
var match__$2 = cljs.core.assoc_in.call(null,match__$1,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"data","data",-232669377),new cljs.core.Keyword(null,"form-params","form-params",1884296467),new cljs.core.Keyword(null,"stripe-token","stripe-token",-2083260199)], null),stripe_token);
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"navigate-to","navigate-to",-1161651312),match__$2], null));
} else {
if(cljs.core.truth_(submit_stripe_QMARK_)){
var token_promise = stripe.createToken(stripe_card);
return token_promise.then(((function (token_promise,form_data,submit_stripe_QMARK_,match__$1,form,temp__5735__auto__){
return (function (result){
var temp__5735__auto____$1 = cljs.core.js__GT_clj.call(null,result.token);
if(cljs.core.truth_(temp__5735__auto____$1)){
var token = temp__5735__auto____$1;
var match__$2 = cljs.core.assoc_in.call(null,match__$1,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"data","data",-232669377),new cljs.core.Keyword(null,"form-params","form-params",1884296467),new cljs.core.Keyword(null,"stripe-token","stripe-token",-2083260199)], null),token);
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("com.nextjournal.journal.views.billing","update-stripe-token","com.nextjournal.journal.views.billing/update-stripe-token",-469294398),token,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"navigate-to","navigate-to",-1161651312),match__$2], null)], null));
} else {
return null;
}
});})(token_promise,form_data,submit_stripe_QMARK_,match__$1,form,temp__5735__auto__))
);
} else {
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"navigate-to","navigate-to",-1161651312),match__$1], null));
}
}
} else {
return null;
}
});
});
com.nextjournal.journal.views.billing.settings = (function com$nextjournal$journal$views$billing$settings(view_data){
return com.nextjournal.journal.views.billing.plan_view.call(null,view_data);
});
re_frame.core.reg_event_fx.call(null,new cljs.core.Keyword("com.nextjournal.journal.views.billing","validate-handle","com.nextjournal.journal.views.billing/validate-handle",-1313259056),(function (p__135256,p__135257){
var map__135258 = p__135256;
var map__135258__$1 = (((((!((map__135258 == null))))?(((((map__135258.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__135258.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__135258):map__135258);
var db = cljs.core.get.call(null,map__135258__$1,new cljs.core.Keyword(null,"db","db",993250759));
var vec__135259 = p__135257;
var _ = cljs.core.nth.call(null,vec__135259,(0),null);
var handle = cljs.core.nth.call(null,vec__135259,(1),null);
console.log("validate-handle",handle);
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"db","db",993250759),cljs.core.assoc_in.call(null,db,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"view-data","view-data",461796245),new cljs.core.Keyword(null,"handle-validation","handle-validation",1570687096)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"handle","handle",1538948854),handle,new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"loading","loading",-737050189)], null))], null);
}));
com.nextjournal.journal.views.billing.handle_input = (function com$nextjournal$journal$views$billing$handle_input(p__135269){
var map__135270 = p__135269;
var map__135270__$1 = (((((!((map__135270 == null))))?(((((map__135270.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__135270.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__135270):map__135270);
var field = cljs.core.get.call(null,map__135270__$1,new cljs.core.Keyword(null,"field","field",-1302436500));
var intent = cljs.core.get.call(null,map__135270__$1,new cljs.core.Keyword(null,"intent","intent",-390846953));
var map__135273 = cljs.core.PersistentArrayMap.EMPTY;
var map__135273__$1 = (((((!((map__135273 == null))))?(((((map__135273.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__135273.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__135273):map__135273);
var state = cljs.core.get.call(null,map__135273__$1,new cljs.core.Keyword(null,"state","state",-1988618099));
var error = cljs.core.get.call(null,map__135273__$1,new cljs.core.Keyword(null,"error","error",-978969032));
var map__135274 = field;
var map__135274__$1 = (((((!((map__135274 == null))))?(((((map__135274.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__135274.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__135274):map__135274);
var handle = cljs.core.get.call(null,map__135274__$1,new cljs.core.Keyword(null,"value","value",305978217));
var handle__$1 = com.nextjournal.journal.form.atom.call(null,handle);
return ((function (map__135273,map__135273__$1,state,error,map__135274,map__135274__$1,handle,handle__$1,map__135270,map__135270__$1,field,intent){
return (function (p__135281){
var map__135282 = p__135281;
var map__135282__$1 = (((((!((map__135282 == null))))?(((((map__135282.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__135282.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__135282):map__135282);
var field__$1 = cljs.core.get.call(null,map__135282__$1,new cljs.core.Keyword(null,"field","field",-1302436500));
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.sans-serif","div.sans-serif",-783434288),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.relative","div.relative",430334058),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"input.nj-input.mb2.w-100.border-box","input.nj-input.mb2.w-100.border-box",322294030),com.nextjournal.journal.form.field_attrs_for.call(null,field__$1,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"type","type",1174270348),"text",new cljs.core.Keyword(null,"value","value",305978217),cljs.core.deref.call(null,handle__$1),new cljs.core.Keyword(null,"on-change","on-change",-732046149),((function (map__135282,map__135282__$1,field__$1,map__135273,map__135273__$1,state,error,map__135274,map__135274__$1,handle,handle__$1,map__135270,map__135270__$1,field,intent){
return (function (p1__135268_SHARP_){
return cljs.core.reset_BANG_.call(null,handle__$1,p1__135268_SHARP_.target.value);
});})(map__135282,map__135282__$1,field__$1,map__135273,map__135273__$1,state,error,map__135274,map__135274__$1,handle,handle__$1,map__135270,map__135270__$1,field,intent))
], null))], null),(cljs.core.truth_(state)?new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.absolute","div.absolute",1404644568),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"right","right",-452581833),"10px",new cljs.core.Keyword(null,"top","top",-1856271961),"10px"], null)], null),(function (){var G__135284 = state;
var G__135284__$1 = (((G__135284 instanceof cljs.core.Keyword))?G__135284.fqn:null);
switch (G__135284__$1) {
case "loading":
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.spinner.view,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"size","size",1098693007),(16),new cljs.core.Keyword(null,"class","class",-2030961996),"fill-teal"], null)], null);
break;
case "error":
return com.nextjournal.editor.components.ui.icon.view.call(null,"CloseBold",new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"class","class",-2030961996),"fill-red"], null));
break;
case "success":
return com.nextjournal.editor.components.ui.icon.view.call(null,"CheckmarkBold",new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"class","class",-2030961996),"fill-green"], null));
break;
default:
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__135070__$1)].join('')));
}
})()], null):null)], null),new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.black-50.f6.lh-copy","div.black-50.f6.lh-copy",1586842753),"Your",((cljs.core._EQ_.call(null,intent,new cljs.core.Keyword("com.nextjournal.journal.views.billing","upgrade-person","com.nextjournal.journal.views.billing/upgrade-person",-850105781)))?null:" group's")," notebooks will be available at: ",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"br","br",934104792)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"b","b",1482224470),"https://nextjournal.com/",cljs.core.deref.call(null,handle__$1)], null)], null)], null);
});
;})(map__135060,map__135060__$1,state,error,map__135061,map__135061__$1,handle,handle__$1,map__135050,map__135050__$1,field,intent))
});
com.nextjournal.journal.views.billing.pay_with_credit_card = (function com$nextjournal$journal$views$billing$pay_with_credit_card(p__135072){
var map__135073 = p__135072;
var map__135073__$1 = (((((!((map__135073 == null))))?(((((map__135073.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__135073.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__135073):map__135073);
var view_data = map__135073__$1;
var intent = cljs.core.get.call(null,map__135073__$1,new cljs.core.Keyword(null,"intent","intent",-390846953));
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"label.db.b.mb2.f5","label.db.b.mb2.f5",1755411769),"Pay with credit card"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.mb2","div.mb2",1996210983),(function (){var stripe_token = cljs.core.deref.call(null,re_frame.core.subscribe.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("com.nextjournal.journal.views.billing","stripe-token","com.nextjournal.journal.views.billing/stripe-token",291608366)], null)));
if(cljs.core.not.call(null,stripe_token)){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.journal.views.billing.credit_card_input,view_data], null);
} else {
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1394872991),["Your credit card ending in ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.get_in.call(null,stripe_token,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["card","last4"], null)))," will get used"].join('')], null);
}
})()], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"p.black-50.f6.mt0","p.black-50.f6.mt0",-1644833307),((cljs.core._EQ_.call(null,intent,new cljs.core.Keyword("com.nextjournal.journal.views.billing","upgrade-person","com.nextjournal.journal.views.billing/upgrade-person",-850105781)))?"This plan will be billed to your personal account.":"This plan will be billed to the group, not your personal account.")], null)], null);
});
cljs.spec.alpha.def_impl.call(null,new cljs.core.Keyword("com.nextjournal.journal.views.billing","profile","com.nextjournal.journal.views.billing/profile",-1916576159),cljs.core.list(new cljs.core.Symbol("com.nextjournal.journal.views.specs","into-map-with-keys","com.nextjournal.journal.views.specs/into-map-with-keys",2080105451,null),new cljs.core.Keyword("com.nextjournal.journal.views.specs","profile","com.nextjournal.journal.views.specs/profile",1084418116)),com.nextjournal.journal.views.specs.into_map_with_keys.call(null,new cljs.core.Keyword("com.nextjournal.journal.views.specs","profile","com.nextjournal.journal.views.specs/profile",1084418116)));
cljs.spec.alpha.def_impl.call(null,new cljs.core.Keyword("com.nextjournal.journal.views.billing","upgrade.view-data","com.nextjournal.journal.views.billing/upgrade.view-data",392323924),cljs.core.list(new cljs.core.Symbol("cljs.spec.alpha","keys","cljs.spec.alpha/keys",1109346032,null),new cljs.core.Keyword(null,"opt-un","opt-un",883442496),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("com.nextjournal.journal.views.billing","profile","com.nextjournal.journal.views.billing/profile",-1916576159)], null)),cljs.spec.alpha.map_spec_impl.call(null,cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"req-un","req-un",1074571008),new cljs.core.Keyword(null,"opt-un","opt-un",883442496),new cljs.core.Keyword(null,"gfn","gfn",791517474),new cljs.core.Keyword(null,"pred-exprs","pred-exprs",1792271395),new cljs.core.Keyword(null,"keys-pred","keys-pred",858984739),new cljs.core.Keyword(null,"opt-keys","opt-keys",1262688261),new cljs.core.Keyword(null,"req-specs","req-specs",553962313),new cljs.core.Keyword(null,"req","req",-326448303),new cljs.core.Keyword(null,"req-keys","req-keys",514319221),new cljs.core.Keyword(null,"opt-specs","opt-specs",-384905450),new cljs.core.Keyword(null,"pred-forms","pred-forms",172611832),new cljs.core.Keyword(null,"opt","opt",-794706369)],[null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("com.nextjournal.journal.views.billing","profile","com.nextjournal.journal.views.billing/profile",-1916576159)], null),null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(function (G__135085){
return cljs.core.map_QMARK_.call(null,G__135085);
})], null),(function (G__135085){
return cljs.core.map_QMARK_.call(null,G__135085);
}),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"profile","profile",-545963874)], null),cljs.core.PersistentVector.EMPTY,null,cljs.core.PersistentVector.EMPTY,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("com.nextjournal.journal.views.billing","profile","com.nextjournal.journal.views.billing/profile",-1916576159)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.list(new cljs.core.Symbol("cljs.core","fn","cljs.core/fn",-1065745098,null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"%","%",-950237169,null)], null),cljs.core.list(new cljs.core.Symbol("cljs.core","map?","cljs.core/map?",-1390345523,null),new cljs.core.Symbol(null,"%","%",-950237169,null)))], null),null])));
cljs.spec.alpha.def_impl.call(null,new cljs.core.Symbol("com.nextjournal.journal.views.billing","upgrade","com.nextjournal.journal.views.billing/upgrade",-626928508,null),cljs.core.list(new cljs.core.Symbol("cljs.spec.alpha","fspec","cljs.spec.alpha/fspec",-1289128341,null),new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("cljs.spec.alpha","cat","cljs.spec.alpha/cat",-1471398329,null),new cljs.core.Keyword(null,"view-data","view-data",461796245),new cljs.core.Keyword("com.nextjournal.journal.views.billing","upgrade.view-data","com.nextjournal.journal.views.billing/upgrade.view-data",392323924))),cljs.spec.alpha.fspec_impl.call(null,cljs.spec.alpha.spec_impl.call(null,cljs.core.list(new cljs.core.Symbol("cljs.spec.alpha","cat","cljs.spec.alpha/cat",-1471398329,null),new cljs.core.Keyword(null,"view-data","view-data",461796245),new cljs.core.Keyword("com.nextjournal.journal.views.billing","upgrade.view-data","com.nextjournal.journal.views.billing/upgrade.view-data",392323924)),cljs.spec.alpha.cat_impl.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"view-data","view-data",461796245)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("com.nextjournal.journal.views.billing","upgrade.view-data","com.nextjournal.journal.views.billing/upgrade.view-data",392323924)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("com.nextjournal.journal.views.billing","upgrade.view-data","com.nextjournal.journal.views.billing/upgrade.view-data",392323924)], null)),null,null),cljs.core.list(new cljs.core.Symbol("cljs.spec.alpha","cat","cljs.spec.alpha/cat",-1471398329,null),new cljs.core.Keyword(null,"view-data","view-data",461796245),new cljs.core.Keyword("com.nextjournal.journal.views.billing","upgrade.view-data","com.nextjournal.journal.views.billing/upgrade.view-data",392323924)),cljs.spec.alpha.spec_impl.call(null,new cljs.core.Symbol("cljs.core","any?","cljs.core/any?",-2068111842,null),cljs.core.any_QMARK_,null,null),new cljs.core.Symbol("cljs.core","any?","cljs.core/any?",-2068111842,null),null,null,null));
/**
* Provides the unified form to create a subscription, either for upgrading
* a peson or existing group, or createing a new group.
*/
.upgrade = (function $upgrade(p__135123){
var map__135124 = p__135123;
var map__135124__$1 = (((((!((map__135124 == null))))?(((((map__135124.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__135124.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__135124):map__135124);
var view_data = map__135124__$1;
var form_data = cljs.core.get.call(null,map__135124__$1,new cljs.core.Keyword(null,"form-data","form-data",1829298254));
var form_id = cljs.core.get.call(null,map__135124__$1,new cljs.core.Keyword(null,"form-id","form-id",-158754567));
var handle_validation = cljs.core.get.call(null,map__135124__$1,new cljs.core.Keyword(null,"handle-validation","handle-validation",1570687096));
var intent = cljs.core.get.call(null,map__135124__$1,new cljs.core.Keyword(null,"intent","intent",-390846953));
var plan = cljs.core.get.call(null,map__135124__$1,new cljs.core.Keyword(null,"plan","plan",1118952668));
var profile = cljs.core.get.call(null,map__135124__$1,new cljs.core.Keyword(null,"profile","profile",-545963874));
var url_for = cljs.core.get.call(null,map__135124__$1,new cljs.core.Keyword(null,"url-for","url-for",-1886539080));
var needs_handle_QMARK_ = (new cljs.core.Keyword("profile","handle","profile/handle",1185486493).cljs$core$IFn$_invoke$arity$1(profile) == null);
var upgrade_QMARK_ = cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword("com.nextjournal.journal.views.billing","upgrade-group","com.nextjournal.journal.views.billing/upgrade-group",1539746155),null,new cljs.core.Keyword("com.nextjournal.journal.views.billing","upgrade-person","com.nextjournal.journal.views.billing/upgrade-person",-850105781),null], null), null),intent);
var form = form.construct(form_id,cljs.core.assoc.call(null,form_data,new cljs.core.Keyword(null,"record","record",-779106859),profile));
var match = form.route_match(form);
var selected_plan = (function (){var pred__135182 = cljs.core._EQ_;
var expr__135183 = cljs.core.get_in.call(null,form,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"inputs","inputs",865803858),new cljs.core.Keyword("com.nextjournal.journal.form.billing","plan","com.nextjournal.journal.form.billing/plan",1938477851)], null));
if(cljs.core.truth_(pred__135182.call(null,"0",expr__135183))){
return new cljs.core.Keyword(null,"open-science","open-science",-170639210);
} else {
if(cljs.core.truth_(pred__135182.call(null,"1",expr__135183))){
return new cljs.core.Keyword(null,"private-research","private-research",-417719578);
} else {
return null;
}
}
})();
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.page","div.page",1917984906),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"h2.mb4","h2.mb4",1950600175),(function (){var G__135185 = intent;
var G__135185__$1 = (((G__135185 instanceof cljs.core.Keyword))?G__135185.fqn:null);
switch (G__135185__$1) {
case "com.nextjournal.journal.views.billing/create-group":
return "Set up a new group";
break;
case "com.nextjournal.journal.views.billing/upgrade-group":
return ["Upgrade ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword("profile","name","profile/name",2019215848).cljs$core$IFn$_invoke$arity$1(profile))].join('');
break;
case "com.nextjournal.journal.views.billing/upgrade-person":
return "Upgrade your personal account";
break;
default:
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__135185__$1)].join('')));
}
})()], null),((upgrade_QMARK_)?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.mb4","div.mb4",-1839111368),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.settings-section.nj-shadow.flex-ns","div.settings-section.nj-shadow.flex-ns",-672784244),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"img.w-30.mr4","img.w-30.mr4",1915617370),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"src","src",-1651076051),"/images/illustrations/private-research-plan.svg"], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex-auto","div.flex-auto",-1435035172),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"h4.mb2.mt0","h4.mb2.mt0",1325172391),"Private Research \u2014 $99 ",((cljs.core._EQ_.call(null,intent,new cljs.core.Keyword("com.nextjournal.journal.views.billing","upgrade-person","com.nextjournal.journal.views.billing/upgrade-person",-850105781)))?null:"per researcher "),"per month"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.f6","div.f6",-901767325),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [.private_research_description,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"intent","intent",-390846953),intent], null)], null),((cljs.core._EQ_.call(null,intent,new cljs.core.Keyword("com.nextjournal.journal.views.billing","upgrade-person","com.nextjournal.journal.views.billing/upgrade-person",-850105781)))?new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.bt.b--black-05.mt2.pt3.flex-ns.items-center","div.bt.b--black-05.mt2.pt3.flex-ns.items-center",642249747),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.mr2","span.mr2",785378767),"Need advance collaboration features? "], null),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a.flex.items-center","a.flex.items-center",46069439),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"href","href",-793805698),url_for.call(null,new cljs.core.Keyword(null,"add-group","add-group",1646859519))], null),"Create a group instead",icon.view("ArrowRight",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"size","size",1098693007),(16),new cljs.core.Keyword(null,"class","class",-2030961996),"fill-teal mr2"], null))], null)], null):null)], null)], null)], null)], null):null),form.form_for(form,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"on-submit","on-submit",1227871159),.submit_billing_form_handler.call(null,match,cljs.core.deref.call(null,re_frame.subscribe(new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("com.nextjournal.journal.views.billing","stripe-card","com.nextjournal.journal.views.billing/stripe-card",1412267933)], null))),cljs.core.deref.call(null,re_frame.subscribe(new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("com.nextjournal.journal.views.billing","stripe-token","com.nextjournal.journal.views.billing/stripe-token",291608366)], null))))], null),cljs.core.with_meta(new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.sans-serif.flex-ns.mb4","div.sans-serif.flex-ns.mb4",-357402610),((upgrade_QMARK_)?null:(function (){var f = form.field_for(form,new cljs.core.Keyword("com.nextjournal.journal.form.billing","name","com.nextjournal.journal.form.billing/name",-1661126038));
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.mb3.flex-auto.mr4-ns","div.mb3.flex-auto.mr4-ns",-182225806),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"label.db.b.mb2.f5","label.db.b.mb2.f5",1755411769),"Group Name"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [form.render_input,f,form], null),form.render_errors_for(f)], null);
})()),((needs_handle_QMARK_)?(function (){var f = form.field_for(form,new cljs.core.Keyword("com.nextjournal.journal.form.billing","handle","com.nextjournal.journal.form.billing/handle",-351568585));
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex-auto","div.flex-auto",-1435035172),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"label.db.b.mb2.f5","label.db.b.mb2.f5",1755411769),"Handle"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [.handle_input,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"field","field",-1302436500),f,new cljs.core.Keyword(null,"intent","intent",-390846953),intent,new cljs.core.Keyword(null,"handle-validation","handle-validation",1570687096),handle_validation], null)], null),form.render_errors_for(f)], null);
})():null)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key","key",-1516042587),"main-info"], null)),cljs.core.with_meta(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.sans-serif","div.sans-serif",-783434288),((upgrade_QMARK_)?new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex-ns","div.flex-ns",2063550166),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex-auto.mr3-ns","div.flex-auto.mr3-ns",-734723301),(function (){var f = form.field_for(form,new cljs.core.Keyword("com.nextjournal.journal.form.billing","billing-email","com.nextjournal.journal.form.billing/billing-email",1454402223));
return new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.mb3","div.mb3",1788115986),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"max-width","max-width",-1939924051),"490px"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"label.db.b.mb2.f5","label.db.b.mb2.f5",1755411769),"Billing Email"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [form.render_input,f,form], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.black-50.f6.lh-copy.mt2","div.black-50.f6.lh-copy.mt2",-932051766),"This is the email that we'll send receipts to."], null),form.render_errors_for(f)], null);
})()], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex-auto","div.flex-auto",-1435035172),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [.pay_with_credit_card,view_data], null)], null)], null):new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"h3.mb3","h3.mb3",1298719462),"Choose a plan",((cljs.core._EQ_.call(null,intent,new cljs.core.Keyword("com.nextjournal.journal.views.billing","upgrade-person","com.nextjournal.journal.views.billing/upgrade-person",-850105781)))?null:" for this group")], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [.select_plan,cljs.core.assoc.call(null,view_data,new cljs.core.Keyword(null,"selected-plan","selected-plan",210054588),selected_plan)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.mb4","div.mb4",-1839111368),new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.settings-section.flex-ns.items-center.nj-shadow","div.settings-section.flex-ns.items-center.nj-shadow",1620191284),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"padding-top","padding-top",1929675955),(0),new cljs.core.Keyword(null,"padding-bottom","padding-bottom",-1899795591),(0)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"img.w-20-ns.mr4-ns","img.w-20-ns.mr4-ns",2012939825),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"src","src",-1651076051),"/images/illustrations/enterprise-plan.svg"], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.f6.flex-auto","div.f6.flex-auto",648864528),new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"label.f5.b.db.mb2","label.f5.b.db.mb2",-1975430006),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"for","for",-1323786319),"private-research-group-plan"], null),"Enterprise \u2014 $149 ",((cljs.core._EQ_.call(null,intent,new cljs.core.Keyword("com.nextjournal.journal.views.billing","upgrade-person","com.nextjournal.journal.views.billing/upgrade-person",-850105781)))?null:"per researcher "),"per month"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [.enterprise_description,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"intent","intent",-390846953),intent], null)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.db-ns.justify-center.pv3.pv0-ns","div.flex.db-ns.justify-center.pv3.pv0-ns",920489681),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.mr4-ns.f7.ttu.tc.justify-center.lh-copy.b","div.mr4-ns.f7.ttu.tc.justify-center.lh-copy.b",592415490),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"max-width","max-width",-1939924051),"60px"], null)], null),icon.view("Chat",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"size","size",1098693007),(40),new cljs.core.Keyword(null,"class","class",-2030961996),"fill-teal mb1"], null)),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a.intercom-launcher","a.intercom-launcher",2144692492),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"href","href",-793805698),"#intercom"], null),"Contact Sales"], null)], null)], null)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex-ns","div.flex-ns",2063550166),(function (){var f = form.field_for(form,new cljs.core.Keyword("com.nextjournal.journal.form.billing","billing-email","com.nextjournal.journal.form.billing/billing-email",1454402223));
return new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex-auto.mr4-ns","div.flex-auto.mr4-ns",123531188),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"label.db.b.mb2.f5","label.db.b.mb2.f5",1755411769),"Billing Email"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [form.render_input,f,form], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.black-50.f6.lh-copy.mt2","div.black-50.f6.lh-copy.mt2",-932051766),"This is the email that we'll send receipts to."], null),form.render_errors_for(f)], null);
})(),((cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"private-research","private-research",-417719578),null], null), null),(function (){var or__88041__auto__ = plan;
if(cljs.core.truth_(or__88041__auto__)){
return or__88041__auto__;
} else {
return selected_plan;
}
})()))?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex-auto","div.flex-auto",-1435035172),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [.pay_with_credit_card,view_data], null)], null):null)], null)], null))], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key","key",-1516042587),"billing-info"], null)),cljs.core.with_meta(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.mt3.pt3.bt.b--black-05","div.mt3.pt3.bt.b--black-05",557543179),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"button.nj-button--primary.w-100.w-auto-ns","button.nj-button--primary.w-100.w-auto-ns",1354237148),((upgrade_QMARK_)?"Upgrade now":"Create group")], null)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key","key",-1516042587),"submit-controls"], null)))], null);
});
devcards.core.register_card.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"com.nextjournal.journal.views.billing","com.nextjournal.journal.views.billing",-2147209546),new cljs.core.Keyword(null,"handle","handle",1538948854)], null),new cljs.core.Keyword(null,"func","func",-238706040),(function (){
return devcards.core.card_base.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"handle",new cljs.core.Keyword(null,"documentation","documentation",1889593999),null,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){
if((typeof com !== 'undefined') && (typeof com.nextjournal !== 'undefined') && (typeof com.nextjournal.journal !== 'undefined') && (typeof com.nextjournal.journal.views !== 'undefined') && (typeof com.nextjournal.journal.views.billing !== 'undefined') && (typeof com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135377 !== 'undefined')){
} else {
/**
* @constructor
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IWithMeta}
* @implements {devcards.core.IDevcardOptions}
*/
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135377 = (function (meta135378){
this.meta135378 = meta135378;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135377.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_135379,meta135378__$1){
var self__ = this;
var _135379__$1 = this;
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135377(meta135378__$1));
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135377.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_135379){
var self__ = this;
var _135379__$1 = this;
return self__.meta135378;
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135377.prototype.devcards$core$IDevcardOptions$ = cljs.core.PROTOCOL_SENTINEL;
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135377.prototype.devcards$core$IDevcardOptions$_devcard_options$arity$2 = (function (this__108045__auto__,devcard_opts__108046__auto__){
var self__ = this;
var this__108045__auto____$1 = this;
return cljs.core.assoc.call(null,devcard_opts__108046__auto__,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){var v__108543__auto__ = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.journal.views.billing.handle_input,null], null);
if(cljs.core.fn_QMARK_.call(null,v__108543__auto__)){
return ((function (v__108543__auto__,this__108045__auto____$1){
return (function (data_atom__108544__auto__,owner__108545__auto__){
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [v__108543__auto__,data_atom__108544__auto__,owner__108545__auto__], null)], null));
});
;})(v__108543__auto__,this__108045__auto____$1))
} else {
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,v__108543__auto__], null));
}
})(),new cljs.core.Keyword(null,"options","options",99638489),cljs.core.merge.call(null,cljs.core.PersistentArrayMap.EMPTY,devcards.core.assert_options_map.call(null,new cljs.core.Keyword(null,"options","options",99638489).cljs$core$IFn$_invoke$arity$1(devcard_opts__108046__auto__))));
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135377.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta135378","meta135378",-634952554,null)], null);
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135377.cljs$lang$type = true;
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135377.cljs$lang$ctorStr = "com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135377";
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135377.cljs$lang$ctorPrWriter = (function (this__88718__auto__,writer__88719__auto__,opt__88720__auto__){
return cljs.core._write.call(null,writer__88719__auto__,"com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135377");
});
/**
* Positional factory function for com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135377.
*/
com.nextjournal.journal.views.billing.__GT_t_com$nextjournal$journal$views$billing135377 = (function com$nextjournal$journal$views$billing$__GT_t_com$nextjournal$journal$views$billing135377(meta135378){
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135377(meta135378));
});
}
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135377(null));
})()
,new cljs.core.Keyword(null,"initial-data","initial-data",-1315709804),null,new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watch-atom","watch-atom",-2134031308),false], null)], null));
})], null));
devcards.core.register_card.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"com.nextjournal.journal.views.billing","com.nextjournal.journal.views.billing",-2147209546),new cljs.core.Keyword(null,"handle-error","handle-error",1613855484)], null),new cljs.core.Keyword(null,"func","func",-238706040),(function (){
return devcards.core.card_base.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"handle-error",new cljs.core.Keyword(null,"documentation","documentation",1889593999),null,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){
if((typeof com !== 'undefined') && (typeof com.nextjournal !== 'undefined') && (typeof com.nextjournal.journal !== 'undefined') && (typeof com.nextjournal.journal.views !== 'undefined') && (typeof com.nextjournal.journal.views.billing !== 'undefined') && (typeof com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135393 !== 'undefined')){
} else {
/**
* @constructor
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IWithMeta}
* @implements {devcards.core.IDevcardOptions}
*/
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135393 = (function (meta135394){
this.meta135394 = meta135394;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135393.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_135395,meta135394__$1){
var self__ = this;
var _135395__$1 = this;
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135393(meta135394__$1));
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135393.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_135395){
var self__ = this;
var _135395__$1 = this;
return self__.meta135394;
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135393.prototype.devcards$core$IDevcardOptions$ = cljs.core.PROTOCOL_SENTINEL;
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135393.prototype.devcards$core$IDevcardOptions$_devcard_options$arity$2 = (function (this__108045__auto__,devcard_opts__108046__auto__){
var self__ = this;
var this__108045__auto____$1 = this;
return cljs.core.assoc.call(null,devcard_opts__108046__auto__,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){var v__108543__auto__ = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.journal.views.billing.handle_input,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"handle","handle",1538948854),"nextjournal",new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword(null,"error","error",-978969032),"https://nextjournal.com/nextjournal is already taken."], null)], null);
if(cljs.core.fn_QMARK_.call(null,v__108543__auto__)){
return ((function (v__108543__auto__,this__108045__auto____$1){
return (function (data_atom__108544__auto__,owner__108545__auto__){
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [v__108543__auto__,data_atom__108544__auto__,owner__108545__auto__], null)], null));
});
;})(v__108543__auto__,this__108045__auto____$1))
} else {
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,v__108543__auto__], null));
}
})(),new cljs.core.Keyword(null,"options","options",99638489),cljs.core.merge.call(null,cljs.core.PersistentArrayMap.EMPTY,devcards.core.assert_options_map.call(null,new cljs.core.Keyword(null,"options","options",99638489).cljs$core$IFn$_invoke$arity$1(devcard_opts__108046__auto__))));
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135393.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta135394","meta135394",1729567967,null)], null);
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135393.cljs$lang$type = true;
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135393.cljs$lang$ctorStr = "com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135393";
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135393.cljs$lang$ctorPrWriter = (function (this__88718__auto__,writer__88719__auto__,opt__88720__auto__){
return cljs.core._write.call(null,writer__88719__auto__,"com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135393");
});
/**
* Positional factory function for com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135393.
*/
com.nextjournal.journal.views.billing.__GT_t_com$nextjournal$journal$views$billing135393 = (function com$nextjournal$journal$views$billing$__GT_t_com$nextjournal$journal$views$billing135393(meta135394){
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135393(meta135394));
});
}
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135393(null));
})()
,new cljs.core.Keyword(null,"initial-data","initial-data",-1315709804),null,new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watch-atom","watch-atom",-2134031308),false], null)], null));
})], null));
devcards.core.register_card.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"com.nextjournal.journal.views.billing","com.nextjournal.journal.views.billing",-2147209546),new cljs.core.Keyword(null,"handle-success","handle-success",1317281100)], null),new cljs.core.Keyword(null,"func","func",-238706040),(function (){
return devcards.core.card_base.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"handle-success",new cljs.core.Keyword(null,"documentation","documentation",1889593999),null,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){
if((typeof com !== 'undefined') && (typeof com.nextjournal !== 'undefined') && (typeof com.nextjournal.journal !== 'undefined') && (typeof com.nextjournal.journal.views !== 'undefined') && (typeof com.nextjournal.journal.views.billing !== 'undefined') && (typeof com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135404 !== 'undefined')){
} else {
/**
* @constructor
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IWithMeta}
* @implements {devcards.core.IDevcardOptions}
*/
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135404 = (function (meta135405){
this.meta135405 = meta135405;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135404.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_135406,meta135405__$1){
var self__ = this;
var _135406__$1 = this;
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135404(meta135405__$1));
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135404.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_135406){
var self__ = this;
var _135406__$1 = this;
return self__.meta135405;
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135404.prototype.devcards$core$IDevcardOptions$ = cljs.core.PROTOCOL_SENTINEL;
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135404.prototype.devcards$core$IDevcardOptions$_devcard_options$arity$2 = (function (this__108045__auto__,devcard_opts__108046__auto__){
var self__ = this;
var this__108045__auto____$1 = this;
return cljs.core.assoc.call(null,devcard_opts__108046__auto__,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){var v__108543__auto__ = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.journal.views.billing.handle_input,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"handle","handle",1538948854),"nextjournal",new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"success","success",1890645906)], null)], null);
if(cljs.core.fn_QMARK_.call(null,v__108543__auto__)){
return ((function (v__108543__auto__,this__108045__auto____$1){
return (function (data_atom__108544__auto__,owner__108545__auto__){
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [v__108543__auto__,data_atom__108544__auto__,owner__108545__auto__], null)], null));
});
;})(v__108543__auto__,this__108045__auto____$1))
} else {
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,v__108543__auto__], null));
}
})(),new cljs.core.Keyword(null,"options","options",99638489),cljs.core.merge.call(null,cljs.core.PersistentArrayMap.EMPTY,devcards.core.assert_options_map.call(null,new cljs.core.Keyword(null,"options","options",99638489).cljs$core$IFn$_invoke$arity$1(devcard_opts__108046__auto__))));
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135404.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta135405","meta135405",455387264,null)], null);
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135404.cljs$lang$type = true;
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135404.cljs$lang$ctorStr = "com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135404";
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135404.cljs$lang$ctorPrWriter = (function (this__88718__auto__,writer__88719__auto__,opt__88720__auto__){
return cljs.core._write.call(null,writer__88719__auto__,"com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135404");
});
/**
* Positional factory function for com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135404.
*/
com.nextjournal.journal.views.billing.__GT_t_com$nextjournal$journal$views$billing135404 = (function com$nextjournal$journal$views$billing$__GT_t_com$nextjournal$journal$views$billing135404(meta135405){
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135404(meta135405));
});
}
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135404(null));
})()
,new cljs.core.Keyword(null,"initial-data","initial-data",-1315709804),null,new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watch-atom","watch-atom",-2134031308),false], null)], null));
})], null));
devcards.core.register_card.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"com.nextjournal.journal.views.billing","com.nextjournal.journal.views.billing",-2147209546),new cljs.core.Keyword(null,"handle-loading","handle-loading",-915245609)], null),new cljs.core.Keyword(null,"func","func",-238706040),(function (){
return devcards.core.card_base.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"handle-loading",new cljs.core.Keyword(null,"documentation","documentation",1889593999),null,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){
if((typeof com !== 'undefined') && (typeof com.nextjournal !== 'undefined') && (typeof com.nextjournal.journal !== 'undefined') && (typeof com.nextjournal.journal.views !== 'undefined') && (typeof com.nextjournal.journal.views.billing !== 'undefined') && (typeof com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135421 !== 'undefined')){
} else {
/**
* @constructor
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IWithMeta}
* @implements {devcards.core.IDevcardOptions}
*/
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135421 = (function (meta135422){
this.meta135422 = meta135422;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135421.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_135423,meta135422__$1){
var self__ = this;
var _135423__$1 = this;
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135421(meta135422__$1));
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135421.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_135423){
var self__ = this;
var _135423__$1 = this;
return self__.meta135422;
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135421.prototype.devcards$core$IDevcardOptions$ = cljs.core.PROTOCOL_SENTINEL;
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135421.prototype.devcards$core$IDevcardOptions$_devcard_options$arity$2 = (function (this__108045__auto__,devcard_opts__108046__auto__){
var self__ = this;
var this__108045__auto____$1 = this;
return cljs.core.assoc.call(null,devcard_opts__108046__auto__,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){var v__108543__auto__ = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.journal.views.billing.handle_input,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"handle","handle",1538948854),"nextjournal",new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"loading","loading",-737050189)], null)], null);
if(cljs.core.fn_QMARK_.call(null,v__108543__auto__)){
return ((function (v__108543__auto__,this__108045__auto____$1){
return (function (data_atom__108544__auto__,owner__108545__auto__){
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [v__108543__auto__,data_atom__108544__auto__,owner__108545__auto__], null)], null));
});
;})(v__108543__auto__,this__108045__auto____$1))
} else {
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,v__108543__auto__], null));
}
})(),new cljs.core.Keyword(null,"options","options",99638489),cljs.core.merge.call(null,cljs.core.PersistentArrayMap.EMPTY,devcards.core.assert_options_map.call(null,new cljs.core.Keyword(null,"options","options",99638489).cljs$core$IFn$_invoke$arity$1(devcard_opts__108046__auto__))));
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135421.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta135422","meta135422",-1431552182,null)], null);
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135421.cljs$lang$type = true;
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135421.cljs$lang$ctorStr = "com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135421";
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135421.cljs$lang$ctorPrWriter = (function (this__88718__auto__,writer__88719__auto__,opt__88720__auto__){
return cljs.core._write.call(null,writer__88719__auto__,"com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135421");
});
/**
* Positional factory function for com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135421.
*/
com.nextjournal.journal.views.billing.__GT_t_com$nextjournal$journal$views$billing135421 = (function com$nextjournal$journal$views$billing$__GT_t_com$nextjournal$journal$views$billing135421(meta135422){
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135421(meta135422));
});
}
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135421(null));
})()
,new cljs.core.Keyword(null,"initial-data","initial-data",-1315709804),null,new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watch-atom","watch-atom",-2134031308),false], null)], null));
})], null));
devcards.core.register_card.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"com.nextjournal.journal.views.billing","com.nextjournal.journal.views.billing",-2147209546),new cljs.core.Keyword(null,"open-science-plan","open-science-plan",-832976270)], null),new cljs.core.Keyword(null,"func","func",-238706040),(function (){
return devcards.core.card_base.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"open-science-plan",new cljs.core.Keyword(null,"documentation","documentation",1889593999),null,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){
if((typeof com !== 'undefined') && (typeof com.nextjournal !== 'undefined') && (typeof com.nextjournal.journal !== 'undefined') && (typeof com.nextjournal.journal.views !== 'undefined') && (typeof com.nextjournal.journal.views.billing !== 'undefined') && (typeof com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135427 !== 'undefined')){
} else {
/**
* @constructor
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IWithMeta}
* @implements {devcards.core.IDevcardOptions}
*/
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135427 = (function (meta135428){
this.meta135428 = meta135428;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135427.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_135429,meta135428__$1){
var self__ = this;
var _135429__$1 = this;
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135427(meta135428__$1));
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135427.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_135429){
var self__ = this;
var _135429__$1 = this;
return self__.meta135428;
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135427.prototype.devcards$core$IDevcardOptions$ = cljs.core.PROTOCOL_SENTINEL;
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135427.prototype.devcards$core$IDevcardOptions$_devcard_options$arity$2 = (function (this__108045__auto__,devcard_opts__108046__auto__){
var self__ = this;
var this__108045__auto____$1 = this;
return cljs.core.assoc.call(null,devcard_opts__108046__auto__,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){var v__108543__auto__ = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.journal.views.billing.plan_view,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"profile","profile",-545963874),cljs.core.PersistentArrayMap.EMPTY], null)], null);
if(cljs.core.fn_QMARK_.call(null,v__108543__auto__)){
return ((function (v__108543__auto__,this__108045__auto____$1){
return (function (data_atom__108544__auto__,owner__108545__auto__){
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [v__108543__auto__,data_atom__108544__auto__,owner__108545__auto__], null)], null));
});
;})(v__108543__auto__,this__108045__auto____$1))
} else {
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,v__108543__auto__], null));
}
})(),new cljs.core.Keyword(null,"options","options",99638489),cljs.core.merge.call(null,cljs.core.PersistentArrayMap.EMPTY,devcards.core.assert_options_map.call(null,new cljs.core.Keyword(null,"options","options",99638489).cljs$core$IFn$_invoke$arity$1(devcard_opts__108046__auto__))));
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135427.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta135428","meta135428",-1615952805,null)], null);
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135427.cljs$lang$type = true;
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135427.cljs$lang$ctorStr = "com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135427";
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135427.cljs$lang$ctorPrWriter = (function (this__88718__auto__,writer__88719__auto__,opt__88720__auto__){
return cljs.core._write.call(null,writer__88719__auto__,"com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135427");
});
/**
* Positional factory function for com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135427.
*/
com.nextjournal.journal.views.billing.__GT_t_com$nextjournal$journal$views$billing135427 = (function com$nextjournal$journal$views$billing$__GT_t_com$nextjournal$journal$views$billing135427(meta135428){
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135427(meta135428));
});
}
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135427(null));
})()
,new cljs.core.Keyword(null,"initial-data","initial-data",-1315709804),null,new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watch-atom","watch-atom",-2134031308),false], null)], null));
})], null));
devcards.core.register_card.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"com.nextjournal.journal.views.billing","com.nextjournal.journal.views.billing",-2147209546),new cljs.core.Keyword(null,"private-research-plan","private-research-plan",105637918)], null),new cljs.core.Keyword(null,"func","func",-238706040),(function (){
return devcards.core.card_base.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"private-research-plan",new cljs.core.Keyword(null,"documentation","documentation",1889593999),null,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){
if((typeof com !== 'undefined') && (typeof com.nextjournal !== 'undefined') && (typeof com.nextjournal.journal !== 'undefined') && (typeof com.nextjournal.journal.views !== 'undefined') && (typeof com.nextjournal.journal.views.billing !== 'undefined') && (typeof com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135454 !== 'undefined')){
} else {
/**
* @constructor
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IWithMeta}
* @implements {devcards.core.IDevcardOptions}
*/
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135454 = (function (meta135455){
this.meta135455 = meta135455;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135454.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_135456,meta135455__$1){
var self__ = this;
var _135456__$1 = this;
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135454(meta135455__$1));
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135454.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_135456){
var self__ = this;
var _135456__$1 = this;
return self__.meta135455;
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135454.prototype.devcards$core$IDevcardOptions$ = cljs.core.PROTOCOL_SENTINEL;
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135454.prototype.devcards$core$IDevcardOptions$_devcard_options$arity$2 = (function (this__108045__auto__,devcard_opts__108046__auto__){
var self__ = this;
var this__108045__auto____$1 = this;
return cljs.core.assoc.call(null,devcard_opts__108046__auto__,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){var v__108543__auto__ = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.journal.views.billing.plan_view,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"profile","profile",-545963874),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword("stripe","subscription-id","stripe/subscription-id",-410231812),cljs.core.name.call(null,cljs.core.gensym.call(null))], null)], null)], null);
if(cljs.core.fn_QMARK_.call(null,v__108543__auto__)){
return ((function (v__108543__auto__,this__108045__auto____$1){
return (function (data_atom__108544__auto__,owner__108545__auto__){
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [v__108543__auto__,data_atom__108544__auto__,owner__108545__auto__], null)], null));
});
;})(v__108543__auto__,this__108045__auto____$1))
} else {
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,v__108543__auto__], null));
}
})(),new cljs.core.Keyword(null,"options","options",99638489),cljs.core.merge.call(null,cljs.core.PersistentArrayMap.EMPTY,devcards.core.assert_options_map.call(null,new cljs.core.Keyword(null,"options","options",99638489).cljs$core$IFn$_invoke$arity$1(devcard_opts__108046__auto__))));
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135454.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta135455","meta135455",-154557642,null)], null);
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135454.cljs$lang$type = true;
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135454.cljs$lang$ctorStr = "com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135454";
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135454.cljs$lang$ctorPrWriter = (function (this__88718__auto__,writer__88719__auto__,opt__88720__auto__){
return cljs.core._write.call(null,writer__88719__auto__,"com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135454");
});
/**
* Positional factory function for com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135454.
*/
com.nextjournal.journal.views.billing.__GT_t_com$nextjournal$journal$views$billing135454 = (function com$nextjournal$journal$views$billing$__GT_t_com$nextjournal$journal$views$billing135454(meta135455){
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135454(meta135455));
});
}
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135454(null));
})()
,new cljs.core.Keyword(null,"initial-data","initial-data",-1315709804),null,new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watch-atom","watch-atom",-2134031308),false], null)], null));
})], null));
devcards.core.register_card.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"com.nextjournal.journal.views.billing","com.nextjournal.journal.views.billing",-2147209546),new cljs.core.Keyword(null,"change-plan-view","change-plan-view",-278481116)], null),new cljs.core.Keyword(null,"func","func",-238706040),(function (){
return devcards.core.card_base.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"change-plan-view",new cljs.core.Keyword(null,"documentation","documentation",1889593999),null,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){
if((typeof com !== 'undefined') && (typeof com.nextjournal !== 'undefined') && (typeof com.nextjournal.journal !== 'undefined') && (typeof com.nextjournal.journal.views !== 'undefined') && (typeof com.nextjournal.journal.views.billing !== 'undefined') && (typeof com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135470 !== 'undefined')){
} else {
/**
* @constructor
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IWithMeta}
* @implements {devcards.core.IDevcardOptions}
*/
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135470 = (function (meta135471){
this.meta135471 = meta135471;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135470.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_135472,meta135471__$1){
var self__ = this;
var _135472__$1 = this;
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135470(meta135471__$1));
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135470.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_135472){
var self__ = this;
var _135472__$1 = this;
return self__.meta135471;
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135470.prototype.devcards$core$IDevcardOptions$ = cljs.core.PROTOCOL_SENTINEL;
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135470.prototype.devcards$core$IDevcardOptions$_devcard_options$arity$2 = (function (this__108045__auto__,devcard_opts__108046__auto__){
var self__ = this;
var this__108045__auto____$1 = this;
return cljs.core.assoc.call(null,devcard_opts__108046__auto__,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){var v__108543__auto__ = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.journal.views.billing.change_plan_view,cljs.core.PersistentArrayMap.EMPTY], null);
if(cljs.core.fn_QMARK_.call(null,v__108543__auto__)){
return ((function (v__108543__auto__,this__108045__auto____$1){
return (function (data_atom__108544__auto__,owner__108545__auto__){
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [v__108543__auto__,data_atom__108544__auto__,owner__108545__auto__], null)], null));
});
;})(v__108543__auto__,this__108045__auto____$1))
} else {
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,v__108543__auto__], null));
}
})(),new cljs.core.Keyword(null,"options","options",99638489),cljs.core.merge.call(null,cljs.core.PersistentArrayMap.EMPTY,devcards.core.assert_options_map.call(null,new cljs.core.Keyword(null,"options","options",99638489).cljs$core$IFn$_invoke$arity$1(devcard_opts__108046__auto__))));
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135470.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta135471","meta135471",-1404535607,null)], null);
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135470.cljs$lang$type = true;
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135470.cljs$lang$ctorStr = "com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135470";
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135470.cljs$lang$ctorPrWriter = (function (this__88718__auto__,writer__88719__auto__,opt__88720__auto__){
return cljs.core._write.call(null,writer__88719__auto__,"com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135470");
});
/**
* Positional factory function for com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135470.
*/
com.nextjournal.journal.views.billing.__GT_t_com$nextjournal$journal$views$billing135470 = (function com$nextjournal$journal$views$billing$__GT_t_com$nextjournal$journal$views$billing135470(meta135471){
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135470(meta135471));
});
}
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135470(null));
})()
,new cljs.core.Keyword(null,"initial-data","initial-data",-1315709804),null,new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watch-atom","watch-atom",-2134031308),false], null)], null));
})], null));
devcards.core.register_card.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"com.nextjournal.journal.views.billing","com.nextjournal.journal.views.billing",-2147209546),new cljs.core.Keyword(null,"payment","payment",-1682035288)], null),new cljs.core.Keyword(null,"func","func",-238706040),(function (){
return devcards.core.card_base.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"payment",new cljs.core.Keyword(null,"documentation","documentation",1889593999),null,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){
if((typeof com !== 'undefined') && (typeof com.nextjournal !== 'undefined') && (typeof com.nextjournal.journal !== 'undefined') && (typeof com.nextjournal.journal.views !== 'undefined') && (typeof com.nextjournal.journal.views.billing !== 'undefined') && (typeof com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135517 !== 'undefined')){
} else {
/**
* @constructor
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IWithMeta}
* @implements {devcards.core.IDevcardOptions}
*/
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135517 = (function (meta135518){
this.meta135518 = meta135518;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135517.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_135519,meta135518__$1){
var self__ = this;
var _135519__$1 = this;
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135517(meta135518__$1));
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135517.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_135519){
var self__ = this;
var _135519__$1 = this;
return self__.meta135518;
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135517.prototype.devcards$core$IDevcardOptions$ = cljs.core.PROTOCOL_SENTINEL;
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135517.prototype.devcards$core$IDevcardOptions$_devcard_options$arity$2 = (function (this__108045__auto__,devcard_opts__108046__auto__){
var self__ = this;
var this__108045__auto____$1 = this;
return cljs.core.assoc.call(null,devcard_opts__108046__auto__,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){var v__108543__auto__ = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.journal.views.billing.payment_view,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"credit-card","credit-card",643068702),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"ending-in","ending-in",1677203837),"4242",new cljs.core.Keyword(null,"expiration","expiration",238846697),"09/2021"], null),new cljs.core.Keyword(null,"due-next","due-next",370503338),new Date(1541273036949),new cljs.core.Keyword(null,"total","total",1916810418),396.0], null)], null);
if(cljs.core.fn_QMARK_.call(null,v__108543__auto__)){
return ((function (v__108543__auto__,this__108045__auto____$1){
return (function (data_atom__108544__auto__,owner__108545__auto__){
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [v__108543__auto__,data_atom__108544__auto__,owner__108545__auto__], null)], null));
});
;})(v__108543__auto__,this__108045__auto____$1))
} else {
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,v__108543__auto__], null));
}
})(),new cljs.core.Keyword(null,"options","options",99638489),cljs.core.merge.call(null,cljs.core.PersistentArrayMap.EMPTY,devcards.core.assert_options_map.call(null,new cljs.core.Keyword(null,"options","options",99638489).cljs$core$IFn$_invoke$arity$1(devcard_opts__108046__auto__))));
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135517.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta135518","meta135518",-193077608,null)], null);
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135517.cljs$lang$type = true;
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135517.cljs$lang$ctorStr = "com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135517";
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135517.cljs$lang$ctorPrWriter = (function (this__88718__auto__,writer__88719__auto__,opt__88720__auto__){
return cljs.core._write.call(null,writer__88719__auto__,"com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135517");
});
/**
* Positional factory function for com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135517.
*/
com.nextjournal.journal.views.billing.__GT_t_com$nextjournal$journal$views$billing135517 = (function com$nextjournal$journal$views$billing$__GT_t_com$nextjournal$journal$views$billing135517(meta135518){
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135517(meta135518));
});
}
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135517(null));
})()
,new cljs.core.Keyword(null,"initial-data","initial-data",-1315709804),null,new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watch-atom","watch-atom",-2134031308),false], null)], null));
})], null));
devcards.core.register_card.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"com.nextjournal.journal.views.billing","com.nextjournal.journal.views.billing",-2147209546),new cljs.core.Keyword(null,"change-payment","change-payment",-2072544808)], null),new cljs.core.Keyword(null,"func","func",-238706040),(function (){
return devcards.core.card_base.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"change-payment",new cljs.core.Keyword(null,"documentation","documentation",1889593999),null,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){
if((typeof com !== 'undefined') && (typeof com.nextjournal !== 'undefined') && (typeof com.nextjournal.journal !== 'undefined') && (typeof com.nextjournal.journal.views !== 'undefined') && (typeof com.nextjournal.journal.views.billing !== 'undefined') && (typeof com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135528 !== 'undefined')){
} else {
/**
* @constructor
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IWithMeta}
* @implements {devcards.core.IDevcardOptions}
*/
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135528 = (function (meta135529){
this.meta135529 = meta135529;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135528.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_135530,meta135529__$1){
var self__ = this;
var _135530__$1 = this;
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135528(meta135529__$1));
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135528.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_135530){
var self__ = this;
var _135530__$1 = this;
return self__.meta135529;
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135528.prototype.devcards$core$IDevcardOptions$ = cljs.core.PROTOCOL_SENTINEL;
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135528.prototype.devcards$core$IDevcardOptions$_devcard_options$arity$2 = (function (this__108045__auto__,devcard_opts__108046__auto__){
var self__ = this;
var this__108045__auto____$1 = this;
return cljs.core.assoc.call(null,devcard_opts__108046__auto__,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){var v__108543__auto__ = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.journal.views.billing.change_payment_view,cljs.core.PersistentArrayMap.EMPTY], null);
if(cljs.core.fn_QMARK_.call(null,v__108543__auto__)){
return ((function (v__108543__auto__,this__108045__auto____$1){
return (function (data_atom__108544__auto__,owner__108545__auto__){
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [v__108543__auto__,data_atom__108544__auto__,owner__108545__auto__], null)], null));
});
;})(v__108543__auto__,this__108045__auto____$1))
} else {
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,v__108543__auto__], null));
}
})(),new cljs.core.Keyword(null,"options","options",99638489),cljs.core.merge.call(null,cljs.core.PersistentArrayMap.EMPTY,devcards.core.assert_options_map.call(null,new cljs.core.Keyword(null,"options","options",99638489).cljs$core$IFn$_invoke$arity$1(devcard_opts__108046__auto__))));
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135528.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta135529","meta135529",404695711,null)], null);
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135528.cljs$lang$type = true;
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135528.cljs$lang$ctorStr = "com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135528";
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135528.cljs$lang$ctorPrWriter = (function (this__88718__auto__,writer__88719__auto__,opt__88720__auto__){
return cljs.core._write.call(null,writer__88719__auto__,"com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135528");
});
/**
* Positional factory function for com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135528.
*/
com.nextjournal.journal.views.billing.__GT_t_com$nextjournal$journal$views$billing135528 = (function com$nextjournal$journal$views$billing$__GT_t_com$nextjournal$journal$views$billing135528(meta135529){
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135528(meta135529));
});
}
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135528(null));
})()
,new cljs.core.Keyword(null,"initial-data","initial-data",-1315709804),null,new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watch-atom","watch-atom",-2134031308),false], null)], null));
})], null));
devcards.core.register_card.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"com.nextjournal.journal.views.billing","com.nextjournal.journal.views.billing",-2147209546),new cljs.core.Keyword(null,"invoices","invoices",1154128192)], null),new cljs.core.Keyword(null,"func","func",-238706040),(function (){
return devcards.core.card_base.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"invoices",new cljs.core.Keyword(null,"documentation","documentation",1889593999),null,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){
if((typeof com !== 'undefined') && (typeof com.nextjournal !== 'undefined') && (typeof com.nextjournal.journal !== 'undefined') && (typeof com.nextjournal.journal.views !== 'undefined') && (typeof com.nextjournal.journal.views.billing !== 'undefined') && (typeof com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135573 !== 'undefined')){
} else {
/**
* @constructor
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IWithMeta}
* @implements {devcards.core.IDevcardOptions}
*/
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135573 = (function (meta135574){
this.meta135574 = meta135574;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135573.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_135575,meta135574__$1){
var self__ = this;
var _135575__$1 = this;
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135573(meta135574__$1));
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135573.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_135575){
var self__ = this;
var _135575__$1 = this;
return self__.meta135574;
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135573.prototype.devcards$core$IDevcardOptions$ = cljs.core.PROTOCOL_SENTINEL;
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135573.prototype.devcards$core$IDevcardOptions$_devcard_options$arity$2 = (function (this__108045__auto__,devcard_opts__108046__auto__){
var self__ = this;
var this__108045__auto____$1 = this;
return cljs.core.assoc.call(null,devcard_opts__108046__auto__,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){var v__108543__auto__ = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.journal.views.billing.invoices_view,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"date","date",-1463434462),new Date(1538594636949),new cljs.core.Keyword(null,"amount","amount",364489504),396.0,new cljs.core.Keyword(null,"id","id",-1388402092),cljs.core.gensym.call(null),new cljs.core.Keyword(null,"invoice-pdf","invoice-pdf",-1140992613),"https://stripe.com/"], null),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"date","date",-1463434462),new Date(1536002636949),new cljs.core.Keyword(null,"amount","amount",364489504),396.0,new cljs.core.Keyword(null,"id","id",-1388402092),cljs.core.gensym.call(null),new cljs.core.Keyword(null,"invoice-pdf","invoice-pdf",-1140992613),"https://stripe.com/"], null),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"date","date",-1463434462),new Date(1533324236949),new cljs.core.Keyword(null,"amount","amount",364489504),99.0,new cljs.core.Keyword(null,"id","id",-1388402092),cljs.core.gensym.call(null),new cljs.core.Keyword(null,"invoice-pdf","invoice-pdf",-1140992613),"https://stripe.com/"], null)], null)], null);
if(cljs.core.fn_QMARK_.call(null,v__108543__auto__)){
return ((function (v__108543__auto__,this__108045__auto____$1){
return (function (data_atom__108544__auto__,owner__108545__auto__){
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [v__108543__auto__,data_atom__108544__auto__,owner__108545__auto__], null)], null));
});
;})(v__108543__auto__,this__108045__auto____$1))
} else {
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,v__108543__auto__], null));
}
})(),new cljs.core.Keyword(null,"options","options",99638489),cljs.core.merge.call(null,cljs.core.PersistentArrayMap.EMPTY,devcards.core.assert_options_map.call(null,new cljs.core.Keyword(null,"options","options",99638489).cljs$core$IFn$_invoke$arity$1(devcard_opts__108046__auto__))));
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135573.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta135574","meta135574",868564648,null)], null);
});
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135573.cljs$lang$type = true;
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135573.cljs$lang$ctorStr = "com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135573";
com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135573.cljs$lang$ctorPrWriter = (function (this__88718__auto__,writer__88719__auto__,opt__88720__auto__){
return cljs.core._write.call(null,writer__88719__auto__,"com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135573");
});
/**
* Positional factory function for com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135573.
*/
com.nextjournal.journal.views.billing.__GT_t_com$nextjournal$journal$views$billing135573 = (function com$nextjournal$journal$views$billing$__GT_t_com$nextjournal$journal$views$billing135573(meta135574){
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135573(meta135574));
});
}
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135573(null));
})()
,new cljs.core.Keyword(null,"initial-data","initial-data",-1315709804),null,new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watch-atom","watch-atom",-2134031308),false], null)], null));
})], null));
//# sourceMappingURL=billing.js.map?rel=1573720735583
65");
});
/**
* Positional factory function for com.nextjournal.journal.views.billing/t_com$nextjournal$journal$views$billing135465.
*/
com.nextjournal.journal.views.billing.__GT_t_com$nextjournal$journal$views$billing135465 = (function com$nextjournal$journal$views$billing$__GT_t_com$nextjournal$journal$views$billing135465(meta135466){
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135465(meta135466));
});
}
return (new com.nextjournal.journal.views.billing.t_com$nextjournal$journal$views$billing135465(null));
})()
,new cljs.core.Keyword(null,"initial-data","initial-data",-1315709804),null,new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watch-atom","watch-atom",-2134031308),false], null)], null));
})], null));
//# sourceMappingURL=billing.js.map?rel=1573720735531
(ns com.nextjournal.editor.article.settings
(:require [com.nextjournal.devcards :as devcards :refer [defcard-nj]]
[reagent.core :as reagent]
[re-frame.core :as re-frame]
[com.nextjournal.editor.config :as config]
[com.nextjournal.editor.operations :as operations]
[com.nextjournal.editor.events :as events]
[com.nextjournal.editor.event-buffer :as event-buffer]
[com.nextjournal.graph.uuid :as uuid]
[com.nextjournal.editor.article.runner-notification :as runner-notification]
[com.nextjournal.editor.components.ui.icon :as icon]
[com.nextjournal.editor.components.ui.positioning :as positioning]
[com.nextjournal.editor.components.ui.modal-dialog :as modal-dialog]
[com.nextjournal.editor.components.ui.autocompleter :as autocompleter]
[com.nextjournal.journal.views.helpers :as helpers]
[react-transition-group]))
(defn handler [response]
(re-frame/dispatch [:update-owner (str response)]))
(defn article-name-view [{:keys [autofocus? suggested-name article editable? disabled? error id]}]
(let [{:keys [:article/name]} article]
(if editable?
[:input.flex-auto
{:default-value (or name suggested-name)
:disabled disabled?
:id id
:placeholder "notebook-name"
:ref (fn [el]
(when el
(when autofocus?
(positioning/focus-at-end el))))
:class (str "nj-input nj-input-sm " (when error "nj-input--invalid"))}]
[:span name])))
(defn handle-view [{:keys [autofocus? current-person editable? disabled? error id]}]
(let [{:keys [:person/profile]} current-person
handle (:profile/handle profile)]
(if editable?
[:input
{:default-value handle
:disabled disabled?
:id id
:placeholder "your-handle"
:ref (fn [el]
(when el
(when autofocus?
(positioning/focus-at-end el))))
:class (str "nj-input nj-input-sm " (when error "nj-input--invalid"))}]
[:span.fw5.f6 handle])))
(defn same-profile? [p1 p2]
(= (:nextjournal/id p1) (:nextjournal/id p2)))
(defn ownership-section [{:keys [current-person]
::keys [state]}]
(let [{:keys [private-access-allowed?]} @(re-frame/subscribe [:view-data])
article @(re-frame/subscribe [:article-entity])
{:article/keys [visibility]} article
visibility (or visibility :article.visibility/public)
current-person-profile (:person/profile current-person)
current-owner-profile (:article/profile article)
groups (:group/_member current-person)
{:keys [new-owner-profile new-visibility popover]} @state
current-profile (or new-owner-profile current-owner-profile)
new-visibility (if (and current-profile
(not (:profile/private-access? current-profile)))
:article.visibility/public
new-visibility)
visibility-choices [{:label "public"
:value :article.visibility/public
:hint [:div.lh-copy "visible to everyone"]}
{:label "private"
:value :article.visibility/private
:hint [:div.lh-copy
(str "only visible to "
(let [p (or new-owner-profile current-owner-profile)]
(if (same-profile? current-person-profile p) "you" (:profile/name p))))]}]]
[:div
[:h5.ma3.mb0 "Ownership & Visibility"]
[:div.pa3.bb.b--black-05.f6
[:div
(if (seq groups)
(let [ownership-choices
(cons {:label (str "You" (when-let [name (:profile/name current-person-profile)]
(str " (" name ")")))
:value current-person-profile}
(map (fn [{:keys [:group/profile]}]
{:label (:profile/name profile)
:value profile})
groups))]
[:span
"This notebook belongs to "
[:span.teal.dim.pointer.b
{:style {:border-bottom "1px dotted rgba(0,0,0,.15)"}
:on-click #(swap! state assoc :popover :ownership)
:id "ownership-select"}
(if new-owner-profile
(:label (first (filter #(= (:value %) new-owner-profile)
ownership-choices)))
(:profile/name current-owner-profile))
[icon/view "ChevronDown" {:size 12 :class "fill-teal "}]
[autocompleter/view {:open? (= popover :ownership)
:position "#ownership-select"
:choices ownership-choices
:on-complete #(swap! state merge {:popover false
:new-owner-profile
(if (same-profile? % current-owner-profile) nil %)})
:on-cancel #(swap! state assoc :popover false)
:selected-value (or new-owner-profile current-owner-profile)
:popover-style {:z-index 990}}]]
" and is "])
"This notebook is ")
(let [v (or new-visibility visibility :article.visibility/public)
owner-profile (or new-owner-profile current-owner-profile)]
(if (:profile/private-access? owner-profile)
[:span.teal.dim.pointer.b
{:id "visibility-select"
:on-click #(swap! state assoc :popover :visibility)
:style {:border-bottom "1px dotted rgba(0,0,0,.15)"}}
(name v)
[icon/view "ChevronDown" {:size 12 :class "fill-teal"}]
[autocompleter/view {:open? (= popover :visibility)
:position "#visibility-select"
:choices visibility-choices
:on-complete #(swap! state merge {:popover false
:new-visibility %})
:on-cancel #(swap! state assoc :popover false)
:selected-value v
:popover-style {:z-index 990 :max-width 250}}]]
[:span.b.f6 "public."]))]
[:p.mt2.black-70.f7
[:span
"Currently, this notebook "
(if (:article/name article)
[:span
"is published at "
[:a {:href (:article/url article) :target "_blank"}
(-> article :article/profile :profile/handle) "/"
[article-name-view {:article article}]]
" and "
(if (= visibility :article.visibility/private)
[:span
"only visible to "
(if (same-profile? current-person-profile current-owner-profile)
"you."
(str "members of " (-> article :article/profile :profile/name) "."))]
[:span "visible to everyone."])]
[:span
"isn't published yet. "
(if (same-profile? current-person-profile current-owner-profile)
"Only you can edit this draft."
(str "All members of " (:profile/name current-owner-profile) " can edit this draft."))])]]
(when (or (and new-visibility (not= visibility new-visibility))
(and new-owner-profile (not (same-profile? current-owner-profile new-owner-profile))))
[:div.flex.mt3.justify-center
[:div.lh-copy.black-70.bg-light-teal.pa3.br2.nj-shadow.ba.b--black-10
[:p.f6.mt0.tc
[:strong "Warning: "]
(when (and new-visibility (not= visibility new-visibility))
(let [owner-profile (or new-owner-profile current-owner-profile)]
(if (= new-visibility :article.visibility/private)
[:span
"This change you will make this notebook visible only to "
(if (same-profile? current-person-profile owner-profile)
"you. "
(str "members of " (:profile/name owner-profile) ". "))]
[:span
"The changes you made will make this notebook visible to everyone. "])))
(when (and new-owner-profile (not (same-profile? current-owner-profile new-owner-profile)))
[:span
"This notebook will be moved to "
(if (same-profile? new-owner-profile current-person-profile)
"your"
(str (:profile/name new-owner-profile) "'s"))
" profile. "])]
[:div.flex.items-center.mt3.justify-center
[:button.nj-button-sm--primary.mr2
{:on-click #(re-frame/dispatch [:change-owner (cond-> {}
new-owner-profile
(assoc :profile-id (-> new-owner-profile :nextjournal/id uuid/->base58))
new-visibility
(assoc :visibility new-visibility))])}
"Make this change"]
[:button.nj-button-sm--secondary
{:on-click #(swap! state merge {:new-visibility nil :new-owner-profile nil})}
"Revert"]]]])]]))
(re-frame/reg-event-fx
::set
[event-buffer/add]
(fn [{:keys [db]} [_ key val]]
(let [op [:assoc-in [:article :settings key] val]]
{:db (operations/apply db op)
:persist-op op})))
(defn view [opts]
(let [ui-state (reagent/atom {})]
(fn [{:keys [settings current-person article] :as opts}]
(let [{:keys [journal? numbered?]} settings
{:keys [url-for]} (::devcards/view-data opts @(re-frame/subscribe [:view-data]))]
[:div {:style {:flex 1 :display "flex" :flex-direction "column"}}
[:div.modal-bg-offset.pa3.bb.b--black-05
[:h4.mt0.mb0 "Settings"]]
[:div {:style {:flex 1 :overflow "auto" :max-height "calc(100vh - 80px - 80px)"}}
(when-not (= :profile/anonymous (get-in current-person [:person/profile :nextjournal/ident]))
[ownership-section (assoc opts ::state ui-state)])
[:h5.ma3.mb0 "Layout"]
[:div.pa3.bb.b--black-05
(when (config/feature-enabled? "journal")
[:div.flex.items-center.mb2.f6
[:input.mr2 {:type "checkbox"
:checked journal?
:id "journal-checkbox"
:on-change #(re-frame/dispatch [::set :journal? (-> ^js/Event % .-target .-checked)])}]
[:label {:for "journal-checkbox"} "Journal with Subpages"]])
[:div.flex.items-center.mb2.f6
[:input.mr2 {:type "checkbox"
:checked numbered?
:id "numbered-checkbox"
:on-change #(re-frame/dispatch [::set :numbered? (-> ^js/Event % .-target .-checked)])}]
[:label {:for "numbered-checkbox"} "Numbered Section Headings"]]]
[:h5.ma3.mb0 "Notebook"]
[:div.pa3.flex.items-center
[:a.nj-button-sm--secondary.inline-flex.items-center.mr3
{:href (url-for :export-article :params {:article-id (-> article :nextjournal/id uuid/->base58)})
:target "_blank"}
[icon/view "Download" {:size 16 :class "fill-teal mr2"}]
[:span "Export as Markdown"]]
[:a.nj-button-sm--secondary.inline-flex.items-center
(helpers/perform-action-on :click
[:archive-article {:article-id (-> article :nextjournal/id uuid/->base58)}])
[:span.dark-red "Archive"]]]]]))))
(def demo-profile {:profile/handle "nextjournal" :db/id 0})
(def demo-current-person
{:person/profile demo-profile
:group/_member [{:group/profile demo-profile}]})
(def demo-article
{:article/name "test-article"
:article/published-at #inst "2018-01-16T16:25:01.109-00:00"
:article/url "https://nextjournal.com/nextjournal/test-article"
:article/profile demo-profile
:nextjournal/id (gensym)})
(def demo-state
{:current-person demo-current-person
:article demo-article
:settings {:authors? false :centered? false :numbered? true :sidebar? true :subtitle? false}
::devcards/view-data {:url-for #()}})
(defcard-nj settings-modal
[modal-dialog/container
{:title "Notebook Settings"}
^{:key "settings"}
[view demo-state]])
(defcard-nj settings-modal-unpublished
[modal-dialog/container
{:title "Notebook Settings"}
^{:key "settings"}
[view
(merge demo-state
{:article
(-> (dissoc demo-article :article/published-at)
(assoc :article/url "https://nextjournal.com/a/17592186045434"))})]])
(defcard-nj settings-modal-no-groups
[modal-dialog/container
{:title "Notebook Settings"}
^{:key "settings"}
[view
(merge demo-state
{:current-person (dissoc demo-current-person :group/_member)})]])
// Compiled by ClojureScript 0.0.1493314493 {:language-out :ecmascript5}
goog.provide('com.nextjournal.editor.article.settings');
goog.require('cljs.core');
goog.require('com.nextjournal.devcards');
goog.require('reagent.core');
goog.require('re_frame.core');
goog.require('com.nextjournal.editor.config');
goog.require('com.nextjournal.editor.operations');
goog.require('com.nextjournal.editor.events');
goog.require('com.nextjournal.editor.event_buffer');
goog.require('com.nextjournal.graph.uuid');
goog.require('com.nextjournal.editor.article.runner_notification');
goog.require('com.nextjournal.editor.components.ui.icon');
goog.require('com.nextjournal.editor.components.ui.positioning');
goog.require('com.nextjournal.editor.components.ui.modal_dialog');
goog.require('com.nextjournal.editor.components.ui.autocompleter');
goog.require('com.nextjournal.journal.views.helpers');
com.nextjournal.editor.article.settings.global$module$react_transition_group = goog.global["ReactTransitionGroup"];
com.nextjournal.editor.article.settings.handler = (function com$nextjournal$editor$article$settings$handler(response){
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"update-owner","update-owner",-1664364038),cljs.core.str.cljs$core$IFn$_invoke$arity$1(response)], null));
});
com.nextjournal.editor.article.settings.article_name_view = (function com$nextjournal$editor$article$settings$article_name_view(p__133368){
var map__133369 = p__133368;
var map__133369__$1 = (((((!((map__133369 == null))))?(((((map__133369.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__133369.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__133369):map__133369);
var autofocus_QMARK_ = cljs.core.get.call(null,map__133369__$1,new cljs.core.Keyword(null,"autofocus?","autofocus?",1363866447));
var suggested_name = cljs.core.get.call(null,map__133369__$1,new cljs.core.Keyword(null,"suggested-name","suggested-name",19259951));
var article = cljs.core.get.call(null,map__133369__$1,new cljs.core.Keyword(null,"article","article",-21685045));
var editable_QMARK_ = cljs.core.get.call(null,map__133369__$1,new cljs.core.Keyword(null,"editable?","editable?",-1805477333));
var disabled_QMARK_ = cljs.core.get.call(null,map__133369__$1,new cljs.core.Keyword(null,"disabled?","disabled?",-1523234181));
var error = cljs.core.get.call(null,map__133369__$1,new cljs.core.Keyword(null,"error","error",-978969032));
var id = cljs.core.get.call(null,map__133369__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
var map__133371 = article;
var map__133371__$1 = (((((!((map__133371 == null))))?(((((map__133371.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__133371.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__133371):map__133371);
var name = cljs.core.get.call(null,map__133371__$1,new cljs.core.Keyword("article","name","article/name",-1857254093));
if(cljs.core.truth_(editable_QMARK_)){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"input.flex-auto","input.flex-auto",289793834),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"default-value","default-value",232220170),(function (){var or__88041__auto__ = name;
if(cljs.core.truth_(or__88041__auto__)){
return or__88041__auto__;
} else {
return suggested_name;
}
})(),new cljs.core.Keyword(null,"disabled","disabled",-1529784218),disabled_QMARK_,new cljs.core.Keyword(null,"id","id",-1388402092),id,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"notebook-name",new cljs.core.Keyword(null,"ref","ref",1289896967),((function (map__133371,map__133371__$1,name,map__133369,map__133369__$1,autofocus_QMARK_,suggested_name,article,editable_QMARK_,disabled_QMARK_,error,id){
return (function (el){
if(cljs.core.truth_(el)){
if(cljs.core.truth_(autofocus_QMARK_)){
return com.nextjournal.editor.components.ui.positioning.focus_at_end.call(null,el);
} else {
return null;
}
} else {
return null;
}
});})(map__133371,map__133371__$1,name,map__133369,map__133369__$1,autofocus_QMARK_,suggested_name,article,editable_QMARK_,disabled_QMARK_,error,id))
,new cljs.core.Keyword(null,"class","class",-2030961996),["nj-input nj-input-sm ",(cljs.core.truth_(error)?"nj-input--invalid":null)].join('')], null)], null);
} else {
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1394872991),name], null);
}
});
.handle_view = (function $handle_view(p__133373){
var map__133374 = p__133373;
var map__133374__$1 = (((((!((map__133374 == null))))?(((((map__133374.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__133374.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__133374):map__133374);
var autofocus_QMARK_ = cljs.core.get.call(null,map__133374__$1,new cljs.core.Keyword(null,"autofocus?","autofocus?",1363866447));
var current_person = cljs.core.get.call(null,map__133374__$1,new cljs.core.Keyword(null,"current-person","current-person",1723841966));
var editable_QMARK_ = cljs.core.get.call(null,map__133374__$1,new cljs.core.Keyword(null,"editable?","editable?",-1805477333));
var disabled_QMARK_ = cljs.core.get.call(null,map__133374__$1,new cljs.core.Keyword(null,"disabled?","disabled?",-1523234181));
var error = cljs.core.get.call(null,map__133374__$1,new cljs.core.Keyword(null,"error","error",-978969032));
var id = cljs.core.get.call(null,map__133374__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
var map__133381 = current_person;
var map__133381__$1 = (((((!((map__133381 == null))))?(((((map__133381.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__133381.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__133381):map__133381);
var profile = cljs.core.get.call(null,map__133381__$1,new cljs.core.Keyword("person","profile","person/profile",604560361));
var handle = new cljs.core.Keyword("profile","handle","profile/handle",1185486493).cljs$core$IFn$_invoke$arity$1(profile);
if(cljs.core.truth_(editable_QMARK_)){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"input","input",556931961),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"default-value","default-value",232220170),handle,new cljs.core.Keyword(null,"disabled","disabled",-1529784218),disabled_QMARK_,new cljs.core.Keyword(null,"id","id",-1388402092),id,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"your-handle",new cljs.core.Keyword(null,"ref","ref",1289896967),((function (map__133381,map__133381__$1,profile,handle,map__133374,map__133374__$1,autofocus_QMARK_,current_person,editable_QMARK_,disabled_QMARK_,error,id){
return (function (el){
if(cljs.core.truth_(el)){
if(cljs.core.truth_(autofocus_QMARK_)){
return positioning.focus_at_end(el);
} else {
return null;
}
} else {
return null;
}
});})(map__133381,map__133381__$1,profile,handle,map__133374,map__133374__$1,autofocus_QMARK_,current_person,editable_QMARK_,disabled_QMARK_,error,id))
,new cljs.core.Keyword(null,"class","class",-2030961996),["nj-input nj-input-sm ",(cljs.core.truth_(error)?"nj-input--invalid":null)].join('')], null)], null);
} else {
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.fw5.f6","span.fw5.f6",999480103),handle], null);
}
});
com.nextjournal.editor.article.settings.same_profile_QMARK_ = (function com$nextjournal$editor$article$settings$same_profile_QMARK_(p1,p2){
return cljs.core._EQ_.call(null,new cljs.core.Keyword("nextjournal","id","nextjournal/id",74984816).cljs$core$IFn$_invoke$arity$1(p1),new cljs.core.Keyword("nextjournal","id","nextjournal/id",74984816).cljs$core$IFn$_invoke$arity$1(p2));
});
.ownership_section = (function $ownership_section(p__133414){
var map__133415 = p__133414;
var map__133415__$1 = (((((!((map__133415 == null))))?(((((map__133415.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__133415.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__133415):map__133415);
var current_person = cljs.core.get.call(null,map__133415__$1,new cljs.core.Keyword(null,"current-person","current-person",1723841966));
var state = cljs.core.get.call(null,map__133415__$1,new cljs.core.Keyword("com.nextjournal.editor.article.settings","state","com.nextjournal.editor.article.settings/state",297051412));
var map__133417 = cljs.core.deref.call(null,re_frame.subscribe(new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"view-data","view-data",461796245)], null)));
var map__133417__$1 = (((((!((map__133417 == null))))?(((((map__133417.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__133417.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__133417):map__133417);
var private_access_allowed_QMARK_ = cljs.core.get.call(null,map__133417__$1,new cljs.core.Keyword(null,"private-access-allowed?","private-access-allowed?",-2018331910));
var article = cljs.core.deref.call(null,re_frame.subscribe(new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"article-entity","article-entity",-1105734316)], null)));
var map__133418 = article;
var map__133418__$1 = (((((!((map__133418 == null))))?(((((map__133418.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__133418.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__133418):map__133418);
var visibility = cljs.core.get.call(null,map__133418__$1,new cljs.core.Keyword("article","visibility","article/visibility",740249879));
var visibility__$1 = (function (){var or__88041__auto__ = visibility;
if(cljs.core.truth_(or__88041__auto__)){
return or__88041__auto__;
} else {
return new cljs.core.Keyword("article.visibility","public","article.visibility/public",-1418437339);
}
})();
var current_person_profile = new cljs.core.Keyword("person","profile","person/profile",604560361).cljs$core$IFn$_invoke$arity$1(current_person);
var current_owner_profile = new cljs.core.Keyword("article","profile","article/profile",863743832).cljs$core$IFn$_invoke$arity$1(article);
var groups = new cljs.core.Keyword("group","_member","group/_member",-702908652).cljs$core$IFn$_invoke$arity$1(current_person);
var map__133419 = cljs.core.deref.call(null,state);
var map__133419__$1 = (((((!((map__133419 == null))))?(((((map__133419.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__133419.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__133419):map__133419);
var new_owner_profile = cljs.core.get.call(null,map__133419__$1,new cljs.core.Keyword(null,"new-owner-profile","new-owner-profile",-2145168049));
var new_visibility = cljs.core.get.call(null,map__133419__$1,new cljs.core.Keyword(null,"new-visibility","new-visibility",-1305147802));
var popover = cljs.core.get.call(null,map__133419__$1,new cljs.core.Keyword(null,"popover","popover",-1809582136));
var current_profile = (function (){var or__88041__auto__ = new_owner_profile;
if(cljs.core.truth_(or__88041__auto__)){
return or__88041__auto__;
} else {
return current_owner_profile;
}
})();
var new_visibility__$1 = (cljs.core.truth_((function (){var and__88026__auto__ = current_profile;
if(cljs.core.truth_(and__88026__auto__)){
return cljs.core.not.call(null,new cljs.core.Keyword("profile","private-access?","profile/private-access?",1338186772).cljs$core$IFn$_invoke$arity$1(current_profile));
} else {
return and__88026__auto__;
}
})())?new cljs.core.Keyword("article.visibility","public","article.visibility/public",-1418437339):new_visibility);
var visibility_choices = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1718410804),"public",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword("article.visibility","public","article.visibility/public",-1418437339),new cljs.core.Keyword(null,"hint","hint",439639918),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.lh-copy","div.lh-copy",-582910100),"visible to everyone"], null)], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1718410804),"private",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword("article.visibility","private","article.visibility/private",1419493520),new cljs.core.Keyword(null,"hint","hint",439639918),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.lh-copy","div.lh-copy",-582910100),["only visible to ",cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var p = (function (){var or__88041__auto__ = new_owner_profile;
if(cljs.core.truth_(or__88041__auto__)){
return or__88041__auto__;
} else {
return current_owner_profile;
}
})();
if(cljs.core.truth_(.same_profile_QMARK_.call(null,current_person_profile,p))){
return "you";
} else {
return new cljs.core.Keyword("profile","name","profile/name",2019215848).cljs$core$IFn$_invoke$arity$1(p);
}
})())].join('')], null)], null)], null);
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"h5.ma3.mb0","h5.ma3.mb0",108610746),"Ownership & Visibility"], null),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.pa3.bb.b--black-05.f6","div.pa3.bb.b--black-05.f6",-1317167639),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),((cljs.core.seq.call(null,groups))?(function (){var ownership_choices = cljs.core.cons.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),["You",(function (){var temp__5735__auto__ = new cljs.core.Keyword("profile","name","profile/name",2019215848).cljs$core$IFn$_invoke$arity$1(current_person_profile);
if(cljs.core.truth_(temp__5735__auto__)){
var name = temp__5735__auto__;
return [" (",cljs.core.str.cljs$core$IFn$_invoke$arity$1(name),")"].join('');
} else {
return null;
}
})()].join(''),new cljs.core.Keyword(null,"value","value",305978217),current_person_profile], null),cljs.core.map.call(null,((function (map__133417,map__133417__$1,private_access_allowed_QMARK_,article,map__133418,map__133418__$1,visibility,visibility__$1,current_person_profile,current_owner_profile,groups,map__133419,map__133419__$1,new_owner_profile,new_visibility,popover,current_profile,new_visibility__$1,visibility_choices,map__133415,map__133415__$1,current_person,state){
return (function (p__133472){
var map__133473 = p__133472;
var map__133473__$1 = (((((!((map__133473 == null))))?(((((map__133473.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__133473.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__133473):map__133473);
var profile = cljs.core.get.call(null,map__133473__$1,new cljs.core.Keyword("group","profile","group/profile",-451651297));
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),new cljs.core.Keyword("profile","name","profile/name",2019215848).cljs$core$IFn$_invoke$arity$1(profile),new cljs.core.Keyword(null,"value","value",305978217),profile], null);
});})(map__133417,map__133417__$1,private_access_allowed_QMARK_,article,map__133418,map__133418__$1,visibility,visibility__$1,current_person_profile,current_owner_profile,groups,map__133419,map__133419__$1,new_owner_profile,new_visibility,popover,current_profile,new_visibility__$1,visibility_choices,map__133415,map__133415__$1,current_person,state))
,groups));
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1394872991),"This notebook belongs to ",new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.teal.dim.pointer.b","span.teal.dim.pointer.b",1845069465),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"border-bottom","border-bottom",2110948415),"1px dotted rgba(0,0,0,.15)"], null),new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (ownership_choices,map__133417,map__133417__$1,private_access_allowed_QMARK_,article,map__133418,map__133418__$1,visibility,visibility__$1,current_person_profile,current_owner_profile,groups,map__133419,map__133419__$1,new_owner_profile,new_visibility,popover,current_profile,new_visibility__$1,visibility_choices,map__133415,map__133415__$1,current_person,state){
return (function (){
return cljs.core.swap_BANG_.call(null,state,cljs.core.assoc,new cljs.core.Keyword(null,"popover","popover",-1809582136),new cljs.core.Keyword(null,"ownership","ownership",892314581));
});})(ownership_choices,map__133417,map__133417__$1,private_access_allowed_QMARK_,article,map__133418,map__133418__$1,visibility,visibility__$1,current_person_profile,current_owner_profile,groups,map__133419,map__133419__$1,new_owner_profile,new_visibility,popover,current_profile,new_visibility__$1,visibility_choices,map__133415,map__133415__$1,current_person,state))
,new cljs.core.Keyword(null,"id","id",-1388402092),"ownership-select"], null),(cljs.core.truth_(new_owner_profile)?new cljs.core.Keyword(null,"label","label",1718410804).cljs$core$IFn$_invoke$arity$1(cljs.core.first.call(null,cljs.core.filter.call(null,((function (ownership_choices,map__133417,map__133417__$1,private_access_allowed_QMARK_,article,map__133418,map__133418__$1,visibility,visibility__$1,current_person_profile,current_owner_profile,groups,map__133419,map__133419__$1,new_owner_profile,new_visibility,popover,current_profile,new_visibility__$1,visibility_choices,map__133415,map__133415__$1,current_person,state){
return (function (p1__133409_SHARP_){
return cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(p1__133409_SHARP_),new_owner_profile);
});})(ownership_choices,map__133417,map__133417__$1,private_access_allowed_QMARK_,article,map__133418,map__133418__$1,visibility,visibility__$1,current_person_profile,current_owner_profile,groups,map__133419,map__133419__$1,new_owner_profile,new_visibility,popover,current_profile,new_visibility__$1,visibility_choices,map__133415,map__133415__$1,current_person,state))
,ownership_choices))):new cljs.core.Keyword("profile","name","profile/name",2019215848).cljs$core$IFn$_invoke$arity$1(current_owner_profile)),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [icon.view,"ChevronDown",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"size","size",1098693007),(12),new cljs.core.Keyword(null,"class","class",-2030961996),"fill-teal "], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [autocompleter.view,new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"open?","open?",1238443125),cljs.core._EQ_.call(null,popover,new cljs.core.Keyword(null,"ownership","ownership",892314581)),new cljs.core.Keyword(null,"position","position",-2011731912),"#ownership-select",new cljs.core.Keyword(null,"choices","choices",1385611597),ownership_choices,new cljs.core.Keyword(null,"on-complete","on-complete",-1531183971),((function (ownership_choices,map__133417,map__133417__$1,private_access_allowed_QMARK_,article,map__133418,map__133418__$1,visibility,visibility__$1,current_person_profile,current_owner_profile,groups,map__133419,map__133419__$1,new_owner_profile,new_visibility,popover,current_profile,new_visibility__$1,visibility_choices,map__133415,map__133415__$1,current_person,state){
return (function (p1__133410_SHARP_){
return cljs.core.swap_BANG_.call(null,state,cljs.core.merge,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"popover","popover",-1809582136),false,new cljs.core.Keyword(null,"new-owner-profile","new-owner-profile",-2145168049),(cljs.core.truth_(.same_profile_QMARK_.call(null,p1__133410_SHARP_,current_owner_profile))?null:p1__133410_SHARP_)], null));
});})(ownership_choices,map__133417,map__133417__$1,private_access_allowed_QMARK_,article,map__133418,map__133418__$1,visibility,visibility__$1,current_person_profile,current_owner_profile,groups,map__133419,map__133419__$1,new_owner_profile,new_visibility,popover,current_profile,new_visibility__$1,visibility_choices,map__133415,map__133415__$1,current_person,state))
,new cljs.core.Keyword(null,"on-cancel","on-cancel",-2071892932),((function (ownership_choices,map__133417,map__133417__$1,private_access_allowed_QMARK_,article,map__133418,map__133418__$1,visibility,visibility__$1,current_person_profile,current_owner_profile,groups,map__133419,map__133419__$1,new_owner_profile,new_visibility,popover,current_profile,new_visibility__$1,visibility_choices,map__133415,map__133415__$1,current_person,state){
return (function (){
return cljs.core.swap_BANG_.call(null,state,cljs.core.assoc,new cljs.core.Keyword(null,"popover","popover",-1809582136),false);
});})(ownership_choices,map__133417,map__133417__$1,private_access_allowed_QMARK_,article,map__133418,map__133418__$1,visibility,visibility__$1,current_person_profile,current_owner_profile,groups,map__133419,map__133419__$1,new_owner_profile,new_visibility,popover,current_profile,new_visibility__$1,visibility_choices,map__133415,map__133415__$1,current_person,state))
,new cljs.core.Keyword(null,"selected-value","selected-value",-81904500),(function (){var or__88041__auto__ = new_owner_profile;
if(cljs.core.truth_(or__88041__auto__)){
return or__88041__auto__;
} else {
return current_owner_profile;
}
})(),new cljs.core.Keyword(null,"popover-style","popover-style",156926651),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"z-index","z-index",1892827090),(990)], null)], null)], null)], null)," and is "], null);
})():"This notebook is "),(function (){var v = (function (){var or__88041__auto__ = new_visibility__$1;
if(cljs.core.truth_(or__88041__auto__)){
return or__88041__auto__;
} else {
var or__88041__auto____$1 = visibility__$1;
if(cljs.core.truth_(or__88041__auto____$1)){
return or__88041__auto____$1;
} else {
return new cljs.core.Keyword("article.visibility","public","article.visibility/public",-1418437339);
}
}
})();
var owner_profile = (function (){var or__88041__auto__ = new_owner_profile;
if(cljs.core.truth_(or__88041__auto__)){
return or__88041__auto__;
} else {
return current_owner_profile;
}
})();
if(cljs.core.truth_(new cljs.core.Keyword("profile","private-access?","profile/private-access?",1338186772).cljs$core$IFn$_invoke$arity$1(owner_profile))){
return new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.teal.dim.pointer.b","span.teal.dim.pointer.b",1845069465),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"id","id",-1388402092),"visibility-select",new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (v,owner_profile,map__133417,map__133417__$1,private_access_allowed_QMARK_,article,map__133418,map__133418__$1,visibility,visibility__$1,current_person_profile,current_owner_profile,groups,map__133419,map__133419__$1,new_owner_profile,new_visibility,popover,current_profile,new_visibility__$1,visibility_choices,map__133415,map__133415__$1,current_person,state){
return (function (){
return cljs.core.swap_BANG_.call(null,state,cljs.core.assoc,new cljs.core.Keyword(null,"popover","popover",-1809582136),new cljs.core.Keyword(null,"visibility","visibility",1338380893));
});})(v,owner_profile,map__133417,map__133417__$1,private_access_allowed_QMARK_,article,map__133418,map__133418__$1,visibility,visibility__$1,current_person_profile,current_owner_profile,groups,map__133419,map__133419__$1,new_owner_profile,new_visibility,popover,current_profile,new_visibility__$1,visibility_choices,map__133415,map__133415__$1,current_person,state))
,new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"border-bottom","border-bottom",2110948415),"1px dotted rgba(0,0,0,.15)"], null)], null),cljs.core.name.call(null,v),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [icon.view,"ChevronDown",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"size","size",1098693007),(12),new cljs.core.Keyword(null,"class","class",-2030961996),"fill-teal"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [autocompleter.view,new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"open?","open?",1238443125),cljs.core._EQ_.call(null,popover,new cljs.core.Keyword(null,"visibility","visibility",1338380893)),new cljs.core.Keyword(null,"position","position",-2011731912),"#visibility-select",new cljs.core.Keyword(null,"choices","choices",1385611597),visibility_choices,new cljs.core.Keyword(null,"on-complete","on-complete",-1531183971),((function (v,owner_profile,map__133417,map__133417__$1,private_access_allowed_QMARK_,article,map__133418,map__133418__$1,visibility,visibility__$1,current_person_profile,current_owner_profile,groups,map__133419,map__133419__$1,new_owner_profile,new_visibility,popover,current_profile,new_visibility__$1,visibility_choices,map__133415,map__133415__$1,current_person,state){
return (function (p1__133411_SHARP_){
return cljs.core.swap_BANG_.call(null,state,cljs.core.merge,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"popover","popover",-1809582136),false,new cljs.core.Keyword(null,"new-visibility","new-visibility",-1305147802),p1__133411_SHARP_], null));
});})(v,owner_profile,map__133417,map__133417__$1,private_access_allowed_QMARK_,article,map__133418,map__133418__$1,visibility,visibility__$1,current_person_profile,current_owner_profile,groups,map__133419,map__133419__$1,new_owner_profile,new_visibility,popover,current_profile,new_visibility__$1,visibility_choices,map__133415,map__133415__$1,current_person,state))
,new cljs.core.Keyword(null,"on-cancel","on-cancel",-2071892932),((function (v,owner_profile,map__133417,map__133417__$1,private_access_allowed_QMARK_,article,map__133418,map__133418__$1,visibility,visibility__$1,current_person_profile,current_owner_profile,groups,map__133419,map__133419__$1,new_owner_profile,new_visibility,popover,current_profile,new_visibility__$1,visibility_choices,map__133415,map__133415__$1,current_person,state){
return (function (){
return cljs.core.swap_BANG_.call(null,state,cljs.core.assoc,new cljs.core.Keyword(null,"popover","popover",-1809582136),false);
});})(v,owner_profile,map__133417,map__133417__$1,private_access_allowed_QMARK_,article,map__133418,map__133418__$1,visibility,visibility__$1,current_person_profile,current_owner_profile,groups,map__133419,map__133419__$1,new_owner_profile,new_visibility,popover,current_profile,new_visibility__$1,visibility_choices,map__133415,map__133415__$1,current_person,state))
,new cljs.core.Keyword(null,"selected-value","selected-value",-81904500),v,new cljs.core.Keyword(null,"popover-style","popover-style",156926651),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"z-index","z-index",1892827090),(990),new cljs.core.Keyword(null,"max-width","max-width",-1939924051),(250)], null)], null)], null)], null);
} else {
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.b.f6","span.b.f6",312533142),"public."], null);
}
})()], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"p.mt2.black-70.f7","p.mt2.black-70.f7",1003215570),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1394872991),"Currently, this notebook ",(cljs.core.truth_(new cljs.core.Keyword("article","name","article/name",-1857254093).cljs$core$IFn$_invoke$arity$1(article))?new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1394872991),"is published at ",new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a","a",-2123407586),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"href","href",-793805698),new cljs.core.Keyword("article","url","article/url",-319806900).cljs$core$IFn$_invoke$arity$1(article),new cljs.core.Keyword(null,"target","target",253001721),"_blank"], null),new cljs.core.Keyword("profile","handle","profile/handle",1185486493).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword("article","profile","article/profile",863743832).cljs$core$IFn$_invoke$arity$1(article)),"/",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [.article_name_view,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"article","article",-21685045),article], null)], null)], null)," and ",((cljs.core._EQ_.call(null,visibility__$1,new cljs.core.Keyword("article.visibility","private","article.visibility/private",1419493520)))?new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1394872991),"only visible to ",(cljs.core.truth_(.same_profile_QMARK_.call(null,current_person_profile,current_owner_profile))?"you.":["members of ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword("profile","name","profile/name",2019215848).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword("article","profile","article/profile",863743832).cljs$core$IFn$_invoke$arity$1(article))),"."].join(''))], null):new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1394872991),"visible to everyone."], null))], null):new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1394872991),"isn't published yet. ",(cljs.core.truth_(.same_profile_QMARK_.call(null,current_person_profile,current_owner_profile))?"Only you can edit this draft.":["All members of ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword("profile","name","profile/name",2019215848).cljs$core$IFn$_invoke$arity$1(current_owner_profile))," can edit this draft."].join(''))], null))], null)], null),(cljs.core.truth_((function (){var or__88041__auto__ = (function (){var and__88026__auto__ = new_visibility__$1;
if(cljs.core.truth_(and__88026__auto__)){
return cljs.core.not_EQ_.call(null,visibility__$1,new_visibility__$1);
} else {
return and__88026__auto__;
}
})();
if(cljs.core.truth_(or__88041__auto__)){
return or__88041__auto__;
} else {
var and__88026__auto__ = new_owner_profile;
if(cljs.core.truth_(and__88026__auto__)){
return cljs.core.not.call(null,.same_profile_QMARK_.call(null,current_owner_profile,new_owner_profile));
} else {
return and__88026__auto__;
}
}
})())?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.mt3.justify-center","div.flex.mt3.justify-center",-1387462735),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.lh-copy.black-70.bg-light-teal.pa3.br2.nj-shadow.ba.b--black-10","div.lh-copy.black-70.bg-light-teal.pa3.br2.nj-shadow.ba.b--black-10",-155337060),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"p.f6.mt0.tc","p.f6.mt0.tc",1555792904),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"strong","strong",269529000),"Warning: "], null),(cljs.core.truth_((function (){var and__88026__auto__ = new_visibility__$1;
if(cljs.core.truth_(and__88026__auto__)){
return cljs.core.not_EQ_.call(null,visibility__$1,new_visibility__$1);
} else {
return and__88026__auto__;
}
})())?(function (){var owner_profile = (function (){var or__88041__auto__ = new_owner_profile;
if(cljs.core.truth_(or__88041__auto__)){
return or__88041__auto__;
} else {
return current_owner_profile;
}
})();
if(cljs.core._EQ_.call(null,new_visibility__$1,new cljs.core.Keyword("article.visibility","private","article.visibility/private",1419493520))){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1394872991),"This change you will make this notebook visible only to ",(cljs.core.truth_(.same_profile_QMARK_.call(null,current_person_profile,owner_profile))?"you. ":["members of ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword("profile","name","profile/name",2019215848).cljs$core$IFn$_invoke$arity$1(owner_profile)),". "].join(''))], null);
} else {
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1394872991),"The changes you made will make this notebook visible to everyone. "], null);
}
})():null),(cljs.core.truth_((function (){var and__88026__auto__ = new_owner_profile;
if(cljs.core.truth_(and__88026__auto__)){
return cljs.core.not.call(null,.same_profile_QMARK_.call(null,current_owner_profile,new_owner_profile));
} else {
return and__88026__auto__;
}
})())?new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1394872991),"This notebook will be moved to ",(cljs.core.truth_(.same_profile_QMARK_.call(null,new_owner_profile,current_person_profile))?"your":[cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword("profile","name","profile/name",2019215848).cljs$core$IFn$_invoke$arity$1(new_owner_profile)),"'s"].join(''))," profile. "], null):null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.items-center.mt3.justify-center","div.flex.items-center.mt3.justify-center",-1561923357),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"button.nj-button-sm--primary.mr2","button.nj-button-sm--primary.mr2",1412527573),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (map__133417,map__133417__$1,private_access_allowed_QMARK_,article,map__133418,map__133418__$1,visibility,visibility__$1,current_person_profile,current_owner_profile,groups,map__133419,map__133419__$1,new_owner_profile,new_visibility,popover,current_profile,new_visibility__$1,visibility_choices,map__133415,map__133415__$1,current_person,state){
return (function (){
return re_frame.dispatch(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"change-owner","change-owner",-1259425800),(function (){var G__133543 = cljs.core.PersistentArrayMap.EMPTY;
var G__133543__$1 = (cljs.core.truth_(new_owner_profile)?cljs.core.assoc.call(null,G__133543,new cljs.core.Keyword(null,"profile-id","profile-id",1866572309),uuid.__GT_base58(new cljs.core.Keyword("nextjournal","id","nextjournal/id",74984816).cljs$core$IFn$_invoke$arity$1(new_owner_profile))):G__133543);
if(cljs.core.truth_(new_visibility__$1)){
return cljs.core.assoc.call(null,G__133543__$1,new cljs.core.Keyword(null,"visibility","visibility",1338380893),new_visibility__$1);
} else {
return G__133543__$1;
}
})()], null));
});})(map__133417,map__133417__$1,private_access_allowed_QMARK_,article,map__133418,map__133418__$1,visibility,visibility__$1,current_person_profile,current_owner_profile,groups,map__133419,map__133419__$1,new_owner_profile,new_visibility,popover,current_profile,new_visibility__$1,visibility_choices,map__133415,map__133415__$1,current_person,state))
], null),"Make this change"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"button.nj-button-sm--secondary","button.nj-button-sm--secondary",-524749413),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (map__133417,map__133417__$1,private_access_allowed_QMARK_,article,map__133418,map__133418__$1,visibility,visibility__$1,current_person_profile,current_owner_profile,groups,map__133419,map__133419__$1,new_owner_profile,new_visibility,popover,current_profile,new_visibility__$1,visibility_choices,map__133415,map__133415__$1,current_person,state){
return (function (){
return cljs.core.swap_BANG_.call(null,state,cljs.core.merge,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"new-visibility","new-visibility",-1305147802),null,new cljs.core.Keyword(null,"new-owner-profile","new-owner-profile",-2145168049),null], null));
});})(map__133417,map__133417__$1,private_access_allowed_QMARK_,article,map__133418,map__133418__$1,visibility,visibility__$1,current_person_profile,current_owner_profile,groups,map__133419,map__133419__$1,new_owner_profile,new_visibility,popover,current_profile,new_visibility__$1,visibility_choices,map__133415,map__133415__$1,current_person,state))
], null),"Revert"], null)], null)], null)], null):null)], null)], null);
});
re_frame.core.reg_event_fx.call(null,new cljs.core.Keyword("com.nextjournal.editor.article.settings","set","com.nextjournal.editor.article.settings/set",-1990045357),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.event_buffer.add], null),(function (p__133550,p__133551){
var map__133552 = p__133550;
var map__133552__$1 = (((((!((map__133552 == null))))?(((((map__133552.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__133552.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__133552):map__133552);
var db = cljs.core.get.call(null,map__133552__$1,new cljs.core.Keyword(null,"db","db",993250759));
var vec__133553 = p__133551;
var _ = cljs.core.nth.call(null,vec__133553,(0),null);
var key = cljs.core.nth.call(null,vec__133553,(1),null);
var val = cljs.core.nth.call(null,vec__133553,(2),null);
var op = new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"assoc-in","assoc-in",-1754117270),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"article","article",-21685045),new cljs.core.Keyword(null,"settings","settings",1556144875),key], null),val], null);
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"db","db",993250759),com.nextjournal.editor.operations.apply.call(null,db,op),new cljs.core.Keyword(null,"persist-op","persist-op",-2006616637),op], null);
}));
com.nextjournal.editor.article.settings.view = (function com$nextjournal$editor$article$settings$view(opts){
var ui_state = reagent.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
return ((function (ui_state){
return (function (p__133559){
var map__133560 = p__133559;
var map__133560__$1 = (((((!((map__133560 == null))))?(((((map__133560.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__133560.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__133560):map__133560);
var opts__$1 = map__133560__$1;
var settings = cljs.core.get.call(null,map__133560__$1,new cljs.core.Keyword(null,"settings","settings",1556144875));
var current_person = cljs.core.get.call(null,map__133560__$1,new cljs.core.Keyword(null,"current-person","current-person",1723841966));
var article = cljs.core.get.call(null,map__133560__$1,new cljs.core.Keyword(null,"article","article",-21685045));
var map__133579 = settings;
var map__133579__$1 = (((((!((map__133579 == null))))?(((((map__133579.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__133579.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__133579):map__133579);
var journal_QMARK_ = cljs.core.get.call(null,map__133579__$1,new cljs.core.Keyword(null,"journal?","journal?",-897756522));
var numbered_QMARK_ = cljs.core.get.call(null,map__133579__$1,new cljs.core.Keyword(null,"numbered?","numbered?",-435212600));
var map__133580 = new cljs.core.Keyword("com.nextjournal.devcards","view-data","com.nextjournal.devcards/view-data",480843538).cljs$core$IFn$_invoke$arity$2(opts__$1,cljs.core.deref.call(null,re_frame.core.subscribe.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"view-data","view-data",461796245)], null))));
var map__133580__$1 = (((((!((map__133580 == null))))?(((((map__133580.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__133580.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__133580):map__133580);
var url_for = cljs.core.get.call(null,map__133580__$1,new cljs.core.Keyword(null,"url-for","url-for",-1886539080));
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"flex","flex",-1425124628),(1),new cljs.core.Keyword(null,"display","display",242065432),"flex",new cljs.core.Keyword(null,"flex-direction","flex-direction",364609438),"column"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.modal-bg-offset.pa3.bb.b--black-05","div.modal-bg-offset.pa3.bb.b--black-05",-1934269852),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"h4.mt0.mb0","h4.mt0.mb0",-1107447502),"Settings"], null)], null),new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"flex","flex",-1425124628),(1),new cljs.core.Keyword(null,"overflow","overflow",2058931880),"auto",new cljs.core.Keyword(null,"max-height","max-height",-612563804),"calc(100vh - 80px - 80px)"], null)], null),((cljs.core._EQ_.call(null,new cljs.core.Keyword("profile","anonymous","profile/anonymous",136566888),cljs.core.get_in.call(null,current_person,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("person","profile","person/profile",604560361),new cljs.core.Keyword("nextjournal","ident","nextjournal/ident",666251538)], null))))?null:new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.settings.ownership_section,cljs.core.assoc.call(null,opts__$1,new cljs.core.Keyword("com.nextjournal.editor.article.settings","state","com.nextjournal.editor.article.settings/state",297051412),ui_state)], null)),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"h5.ma3.mb0","h5.ma3.mb0",108610746),"Layout"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.pa3.bb.b--black-05","div.pa3.bb.b--black-05",-1224534043),(cljs.core.truth_(com.nextjournal.editor.config.feature_enabled_QMARK_.call(null,"journal"))?new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.items-center.mb2.f6","div.flex.items-center.mb2.f6",1434445486),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"input.mr2","input.mr2",1253133682),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"checked","checked",-50955819),journal_QMARK_,new cljs.core.Keyword(null,"id","id",-1388402092),"journal-checkbox",new cljs.core.Keyword(null,"on-change","on-change",-732046149),((function (map__133579,map__133579__$1,journal_QMARK_,numbered_QMARK_,map__133580,map__133580__$1,url_for,map__133560,map__133560__$1,opts__$1,settings,current_person,article,ui_state){
return (function (p1__133557_SHARP_){
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("com.nextjournal.editor.article.settings","set","com.nextjournal.editor.article.settings/set",-1990045357),new cljs.core.Keyword(null,"journal?","journal?",-897756522),p1__133557_SHARP_.target.checked], null));
});})(map__133579,map__133579__$1,journal_QMARK_,numbered_QMARK_,map__133580,map__133580__$1,url_for,map__133560,map__133560__$1,opts__$1,settings,current_person,article,ui_state))
], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"label","label",1718410804),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"for","for",-1323786319),"journal-checkbox"], null),"Journal with Subpages"], null)], null):null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.items-center.mb2.f6","div.flex.items-center.mb2.f6",1434445486),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"input.mr2","input.mr2",1253133682),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"checked","checked",-50955819),numbered_QMARK_,new cljs.core.Keyword(null,"id","id",-1388402092),"numbered-checkbox",new cljs.core.Keyword(null,"on-change","on-change",-732046149),((function (map__133579,map__133579__$1,journal_QMARK_,numbered_QMARK_,map__133580,map__133580__$1,url_for,map__133560,map__133560__$1,opts__$1,settings,current_person,article,ui_state){
return (function (p1__133558_SHARP_){
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("com.nextjournal.editor.article.settings","set","com.nextjournal.editor.article.settings/set",-1990045357),new cljs.core.Keyword(null,"numbered?","numbered?",-435212600),p1__133558_SHARP_.target.checked], null));
});})(map__133579,map__133579__$1,journal_QMARK_,numbered_QMARK_,map__133580,map__133580__$1,url_for,map__133560,map__133560__$1,opts__$1,settings,current_person,article,ui_state))
], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"label","label",1718410804),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"for","for",-1323786319),"numbered-checkbox"], null),"Numbered Section Headings"], null)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"h5.ma3.mb0","h5.ma3.mb0",108610746),"Notebook"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.pa3.flex.items-center","div.pa3.flex.items-center",-468491076),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a.nj-button-sm--secondary.inline-flex.items-center.mr3","a.nj-button-sm--secondary.inline-flex.items-center.mr3",-1247387365),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"href","href",-793805698),url_for.call(null,new cljs.core.Keyword(null,"export-article","export-article",-347899581),new cljs.core.Keyword(null,"params","params",710516235),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"article-id","article-id",793965839),com.nextjournal.graph.uuid.__GT_base58.call(null,new cljs.core.Keyword("nextjournal","id","nextjournal/id",74984816).cljs$core$IFn$_invoke$arity$1(article))], null)),new cljs.core.Keyword(null,"target","target",253001721),"_blank"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.icon.view,"Download",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"size","size",1098693007),(16),new cljs.core.Keyword(null,"class","class",-2030961996),"fill-teal mr2"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1394872991),"Export as Markdown"], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a.nj-button-sm--secondary.inline-flex.items-center","a.nj-button-sm--secondary.inline-flex.items-center",136861403),com.nextjournal.journal.views.helpers.perform_action_on.call(null,new cljs.core.Keyword(null,"click","click",1912301393),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"archive-article","archive-article",-1660770125),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"article-id","article-id",793965839),com.nextjournal.graph.uuid.__GT_base58.call(null,new cljs.core.Keyword("nextjournal","id","nextjournal/id",74984816).cljs$core$IFn$_invoke$arity$1(article))], null)], null)),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.dark-red","span.dark-red",479860130),"Archive"], null)], null)], null)], null)], null);
});
;})(ui_state))
});
com.nextjournal.editor.article.settings.demo_profile = new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword("profile","handle","profile/handle",1185486493),"nextjournal",new cljs.core.Keyword("db","id","db/id",-1388397098),(0)], null);
com.nextjournal.editor.article.settings.demo_current_person = new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword("person","profile","person/profile",604560361),com.nextjournal.editor.article.settings.demo_profile,new cljs.core.Keyword("group","_member","group/_member",-702908652),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword("group","profile","group/profile",-451651297),com.nextjournal.editor.article.settings.demo_profile], null)], null)], null);
com.nextjournal.editor.article.settings.demo_article = new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword("article","name","article/name",-1857254093),"test-article",new cljs.core.Keyword("article","published-at","article/published-at",-878143069),new Date(1516119901109),new cljs.core.Keyword("article","url","article/url",-319806900),"https://nextjournal.com/nextjournal/test-article",new cljs.core.Keyword("article","profile","article/profile",863743832),com.nextjournal.editor.article.settings.demo_profile,new cljs.core.Keyword("nextjournal","id","nextjournal/id",74984816),cljs.core.gensym.call(null)], null);
com.nextjournal.editor.article.settings.demo_state = new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"current-person","current-person",1723841966),com.nextjournal.editor.article.settings.demo_current_person,new cljs.core.Keyword(null,"article","article",-21685045),com.nextjournal.editor.article.settings.demo_article,new cljs.core.Keyword(null,"settings","settings",1556144875),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"authors?","authors?",-1767972971),false,new cljs.core.Keyword(null,"centered?","centered?",-109742703),false,new cljs.core.Keyword(null,"numbered?","numbered?",-435212600),true,new cljs.core.Keyword(null,"sidebar?","sidebar?",-534999672),true,new cljs.core.Keyword(null,"subtitle?","subtitle?",1680777944),false], null),new cljs.core.Keyword("com.nextjournal.devcards","view-data","com.nextjournal.devcards/view-data",480843538),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"url-for","url-for",-1886539080),(function (){
return cljs.core.List.EMPTY;
})], null)], null);
devcards.core.register_card.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"com.nextjournal.editor.article.settings","com.nextjournal.editor.article.settings",1736175162),new cljs.core.Keyword(null,"settings-modal","settings-modal",-22169422)], null),new cljs.core.Keyword(null,"func","func",-238706040),(function (){
return devcards.core.card_base.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"settings-modal",new cljs.core.Keyword(null,"documentation","documentation",1889593999),null,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){
if((typeof com !== 'undefined') && (typeof com.nextjournal !== 'undefined') && (typeof com.nextjournal.editor !== 'undefined') && (typeof com.nextjournal.editor.article !== 'undefined') && (typeof com.nextjournal.editor.article.settings !== 'undefined') && (typeof com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133621 !== 'undefined')){
} else {
/**
* @constructor
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IWithMeta}
* @implements {devcards.core.IDevcardOptions}
*/
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133621 = (function (meta133622){
this.meta133622 = meta133622;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133621.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_133623,meta133622__$1){
var self__ = this;
var _133623__$1 = this;
return (new com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133621(meta133622__$1));
});
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133621.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_133623){
var self__ = this;
var _133623__$1 = this;
return self__.meta133622;
});
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133621.prototype.devcards$core$IDevcardOptions$ = cljs.core.PROTOCOL_SENTINEL;
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133621.prototype.devcards$core$IDevcardOptions$_devcard_options$arity$2 = (function (this__108045__auto__,devcard_opts__108046__auto__){
var self__ = this;
var this__108045__auto____$1 = this;
return cljs.core.assoc.call(null,devcard_opts__108046__auto__,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){var v__108543__auto__ = new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.modal_dialog.container,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"title","title",636505583),"Notebook Settings"], null),cljs.core.with_meta(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.settings.view,com.nextjournal.editor.article.settings.demo_state], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key","key",-1516042587),"settings"], null))], null);
if(cljs.core.fn_QMARK_.call(null,v__108543__auto__)){
return ((function (v__108543__auto__,this__108045__auto____$1){
return (function (data_atom__108544__auto__,owner__108545__auto__){
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [v__108543__auto__,data_atom__108544__auto__,owner__108545__auto__], null)], null));
});
;})(v__108543__auto__,this__108045__auto____$1))
} else {
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,v__108543__auto__], null));
}
})(),new cljs.core.Keyword(null,"options","options",99638489),cljs.core.merge.call(null,cljs.core.PersistentArrayMap.EMPTY,devcards.core.assert_options_map.call(null,new cljs.core.Keyword(null,"options","options",99638489).cljs$core$IFn$_invoke$arity$1(devcard_opts__108046__auto__))));
});
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133621.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta133622","meta133622",-795571541,null)], null);
});
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133621.cljs$lang$type = true;
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133621.cljs$lang$ctorStr = "com.nextjournal.editor.article.settings/t_com$nextjournal$editor$article$settings133621";
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133621.cljs$lang$ctorPrWriter = (function (this__88718__auto__,writer__88719__auto__,opt__88720__auto__){
return cljs.core._write.call(null,writer__88719__auto__,"com.nextjournal.editor.article.settings/t_com$nextjournal$editor$article$settings133621");
});
/**
* Positional factory function for com.nextjournal.editor.article.settings/t_com$nextjournal$editor$article$settings133621.
*/
com.nextjournal.editor.article.settings.__GT_t_com$nextjournal$editor$article$settings133621 = (function com$nextjournal$editor$article$settings$__GT_t_com$nextjournal$editor$article$settings133621(meta133622){
return (new com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133621(meta133622));
});
}
return (new com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133621(null));
})()
,new cljs.core.Keyword(null,"initial-data","initial-data",-1315709804),null,new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watch-atom","watch-atom",-2134031308),false], null)], null));
})], null));
devcards.core.register_card.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"com.nextjournal.editor.article.settings","com.nextjournal.editor.article.settings",1736175162),new cljs.core.Keyword(null,"settings-modal-unpublished","settings-modal-unpublished",2052839959)], null),new cljs.core.Keyword(null,"func","func",-238706040),(function (){
return devcards.core.card_base.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"settings-modal-unpublished",new cljs.core.Keyword(null,"documentation","documentation",1889593999),null,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){
if((typeof com !== 'undefined') && (typeof com.nextjournal !== 'undefined') && (typeof com.nextjournal.editor !== 'undefined') && (typeof com.nextjournal.editor.article !== 'undefined') && (typeof com.nextjournal.editor.article.settings !== 'undefined') && (typeof com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133690 !== 'undefined')){
} else {
/**
* @constructor
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IWithMeta}
* @implements {devcards.core.IDevcardOptions}
*/
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133690 = (function (meta133691){
this.meta133691 = meta133691;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133690.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_133692,meta133691__$1){
var self__ = this;
var _133692__$1 = this;
return (new com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133690(meta133691__$1));
});
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133690.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_133692){
var self__ = this;
var _133692__$1 = this;
return self__.meta133691;
});
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133690.prototype.devcards$core$IDevcardOptions$ = cljs.core.PROTOCOL_SENTINEL;
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133690.prototype.devcards$core$IDevcardOptions$_devcard_options$arity$2 = (function (this__108045__auto__,devcard_opts__108046__auto__){
var self__ = this;
var this__108045__auto____$1 = this;
return cljs.core.assoc.call(null,devcard_opts__108046__auto__,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){var v__108543__auto__ = new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.modal_dialog.container,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"title","title",636505583),"Notebook Settings"], null),cljs.core.with_meta(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.settings.view,cljs.core.merge.call(null,com.nextjournal.editor.article.settings.demo_state,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"article","article",-21685045),cljs.core.assoc.call(null,cljs.core.dissoc.call(null,com.nextjournal.editor.article.settings.demo_article,new cljs.core.Keyword("article","published-at","article/published-at",-878143069)),new cljs.core.Keyword("article","url","article/url",-319806900),"https://nextjournal.com/a/17592186045434")], null))], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key","key",-1516042587),"settings"], null))], null);
if(cljs.core.fn_QMARK_.call(null,v__108543__auto__)){
return ((function (v__108543__auto__,this__108045__auto____$1){
return (function (data_atom__108544__auto__,owner__108545__auto__){
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [v__108543__auto__,data_atom__108544__auto__,owner__108545__auto__], null)], null));
});
;})(v__108543__auto__,this__108045__auto____$1))
} else {
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,v__108543__auto__], null));
}
})(),new cljs.core.Keyword(null,"options","options",99638489),cljs.core.merge.call(null,cljs.core.PersistentArrayMap.EMPTY,devcards.core.assert_options_map.call(null,new cljs.core.Keyword(null,"options","options",99638489).cljs$core$IFn$_invoke$arity$1(devcard_opts__108046__auto__))));
});
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133690.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta133691","meta133691",1501454165,null)], null);
});
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133690.cljs$lang$type = true;
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133690.cljs$lang$ctorStr = "com.nextjournal.editor.article.settings/t_com$nextjournal$editor$article$settings133690";
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133690.cljs$lang$ctorPrWriter = (function (this__88718__auto__,writer__88719__auto__,opt__88720__auto__){
return cljs.core._write.call(null,writer__88719__auto__,"com.nextjournal.editor.article.settings/t_com$nextjournal$editor$article$settings133690");
});
/**
* Positional factory function for com.nextjournal.editor.article.settings/t_com$nextjournal$editor$article$settings133690.
*/
com.nextjournal.editor.article.settings.__GT_t_com$nextjournal$editor$article$settings133690 = (function com$nextjournal$editor$article$settings$__GT_t_com$nextjournal$editor$article$settings133690(meta133691){
return (new com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133690(meta133691));
});
}
return (new com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133690(null));
})()
,new cljs.core.Keyword(null,"initial-data","initial-data",-1315709804),null,new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watch-atom","watch-atom",-2134031308),false], null)], null));
})], null));
devcards.core.register_card.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"com.nextjournal.editor.article.settings","com.nextjournal.editor.article.settings",1736175162),new cljs.core.Keyword(null,"settings-modal-no-groups","settings-modal-no-groups",-1680061917)], null),new cljs.core.Keyword(null,"func","func",-238706040),(function (){
return devcards.core.card_base.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"settings-modal-no-groups",new cljs.core.Keyword(null,"documentation","documentation",1889593999),null,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){
if((typeof com !== 'undefined') && (typeof com.nextjournal !== 'undefined') && (typeof com.nextjournal.editor !== 'undefined') && (typeof com.nextjournal.editor.article !== 'undefined') && (typeof com.nextjournal.editor.article.settings !== 'undefined') && (typeof com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133713 !== 'undefined')){
} else {
/**
* @constructor
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IWithMeta}
* @implements {devcards.core.IDevcardOptions}
*/
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133713 = (function (meta133714){
this.meta133714 = meta133714;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133713.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_133715,meta133714__$1){
var self__ = this;
var _133715__$1 = this;
return (new com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133713(meta133714__$1));
});
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133713.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_133715){
var self__ = this;
var _133715__$1 = this;
return self__.meta133714;
});
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133713.prototype.devcards$core$IDevcardOptions$ = cljs.core.PROTOCOL_SENTINEL;
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133713.prototype.devcards$core$IDevcardOptions$_devcard_options$arity$2 = (function (this__108045__auto__,devcard_opts__108046__auto__){
var self__ = this;
var this__108045__auto____$1 = this;
return cljs.core.assoc.call(null,devcard_opts__108046__auto__,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){var v__108543__auto__ = new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.modal_dialog.container,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"title","title",636505583),"Notebook Settings"], null),cljs.core.with_meta(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.settings.view,cljs.core.merge.call(null,com.nextjournal.editor.article.settings.demo_state,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"current-person","current-person",1723841966),cljs.core.dissoc.call(null,com.nextjournal.editor.article.settings.demo_current_person,new cljs.core.Keyword("group","_member","group/_member",-702908652))], null))], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key","key",-1516042587),"settings"], null))], null);
if(cljs.core.fn_QMARK_.call(null,v__108543__auto__)){
return ((function (v__108543__auto__,this__108045__auto____$1){
return (function (data_atom__108544__auto__,owner__108545__auto__){
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [v__108543__auto__,data_atom__108544__auto__,owner__108545__auto__], null)], null));
});
;})(v__108543__auto__,this__108045__auto____$1))
} else {
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,v__108543__auto__], null));
}
})(),new cljs.core.Keyword(null,"options","options",99638489),cljs.core.merge.call(null,cljs.core.PersistentArrayMap.EMPTY,devcards.core.assert_options_map.call(null,new cljs.core.Keyword(null,"options","options",99638489).cljs$core$IFn$_invoke$arity$1(devcard_opts__108046__auto__))));
});
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133713.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta133714","meta133714",-30576162,null)], null);
});
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133713.cljs$lang$type = true;
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133713.cljs$lang$ctorStr = "com.nextjournal.editor.article.settings/t_com$nextjournal$editor$article$settings133713";
com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133713.cljs$lang$ctorPrWriter = (function (this__88718__auto__,writer__88719__auto__,opt__88720__auto__){
return cljs.core._write.call(null,writer__88719__auto__,"com.nextjournal.editor.article.settings/t_com$nextjournal$editor$article$settings133713");
});
/**
* Positional factory function for com.nextjournal.editor.article.settings/t_com$nextjournal$editor$article$settings133713.
*/
com.nextjournal.editor.article.settings.__GT_t_com$nextjournal$editor$article$settings133713 = (function com$nextjournal$editor$article$settings$__GT_t_com$nextjournal$editor$article$settings133713(meta133714){
return (new com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133713(meta133714));
});
}
return (new com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133713(null));
})()
,new cljs.core.Keyword(null,"initial-data","initial-data",-1315709804),null,new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watch-atom","watch-atom",-2134031308),false], null)], null));
})], null));
//# sourceMappingURL=settings.js.map?rel=1573720733794
ings$__GT_t_com$nextjournal$editor$article$settings133544(meta133547){
return (new com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133544(meta133547));
});
}
return (new com.nextjournal.editor.article.settings.t_com$nextjournal$editor$article$settings133544(null));
})()
,new cljs.core.Keyword(null,"initial-data","initial-data",-1315709804),null,new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watch-atom","watch-atom",-2134031308),false], null)], null));
})], null));
//# sourceMappingURL=settings.js.map?rel=1573720733599
(ns com.nextjournal.editor.article.status
(:require-macros [cljs.core.async.macros :refer [go-loop]])
(:require [com.nextjournal.devcards :refer [defcard-nj]]
[reagent.core :as reagent]
[clojure.string :as str]
[cljs.core.async :as async :refer [<!]]
[re-frame.core :as re-frame]
[com.nextjournal.journal.views.helpers :as helpers]
[com.nextjournal.editor.article.publish-view :as publish]
[com.nextjournal.editor.article.sidebar :as sidebar]
[com.nextjournal.editor.component :as component]
[com.nextjournal.editor.components.ui.spinner :as spinner]
[com.nextjournal.editor.components.ui.icon :as icon]
[com.nextjournal.editor.components.ui.positioning :as positioning]
[com.nextjournal.editor.components.ui.autocompleter :as autocompleter]
[com.nextjournal.editor.components.ui.tooltip :as tooltip]
[com.nextjournal.editor.components.code :as code]
[com.nextjournal.editor.fixtures.code :as code-fixtures]
[com.nextjournal.editor.components.ui.popover :as popover]
[com.nextjournal.journal.form :as form]
[com.nextjournal.editor.components.runtime :as runtime]
[com.nextjournal.editor.components.ui.runtime :as runtime-ui]
[com.nextjournal.editor.components.ui.reference :as reference]
[com.nextjournal.journal.form.notifications :as form.notifications]
[com.nextjournal.editor.events]
[com.nextjournal.editor.fixtures.code :as code-fixtures]
[com.nextjournal.editor.util :as util]
[com.nextjournal.journal.views.helpers :as helpers]
[com.nextjournal.graph.link :as link]
[com.nextjournal.editor.config :as config]
[goog.string :as gstring]
[keybind.core :as key]
[com.nextjournal.editor.article.runner-notification :as runner-notification]))
(defn progress-view [{:keys [duration-estimation]}]
(let [t (reagent/atom 0)
close-chan (async/chan)]
(reagent/create-class
{:component-did-mount
(fn [this]
(when-not config/ssr?
(let [start (js/Date.now)
interval 100]
(go-loop []
(let [[_ chan] (async/alts! [close-chan (async/timeout interval)])]
(when (and (not= chan close-chan)
(< @t duration-estimation))
(swap! t (constantly (- (js/Date.now) start)))
(recur)))))))
:component-will-unmount
(fn [this]
(async/put! close-chan :stop))
:reagent-render
(fn [_]
[:div.absolute.overflow-hidden.br2
{:style {:left 0 :right 0 :bottom 0 :top 0 :z-index 0 :pointer-events "none"}}
[:div.bg-teal.animating-stripes
{:style {:opacity 0.3 :height "100%" :width (str (* (/ @t duration-estimation) 100) "%")}}]])})))
(defn status-icon [{:keys [state]}]
[:div
(case state
:stopped [:div.dot-dark-bg
[spinner/dot {:size 10 :animating? false :class "bg-off"}]]
:shutdown-scheduled[:div.dot-dark-bg
[spinner/dot {:size 10 :animating? false :class "bg-warning"}]]
:stopping [:div.dot-dark-bg
[spinner/dot {:size 10 :animating? true :class "bg-enqueued"}]]
:scheduling [:span.flex.items-center {:style {:margin-top -2}}
[:div.finding.no-shrink.relative {:style {:width 18 :height 14}}
[:div#dish.absolute.left-0.top-0 {:style {:width 18 :height 14}}
[:img.absolute.left-0.top-0
{:src "/images/FindingDish.svg" :width "100%" :height "100%"}]
[:img#wave1.absolute.left-0.top-0
{:src "/images/FindingWave1.svg" :width "100%" :height "100%"}]
[:img#wave2.absolute.left-0.top-0
{:src "/images/FindingWave2.svg" :width "100%" :height "100%"}]]
[:img.absolute.left-0.top-0
{:src "/images/FindingMount.svg" :width "100%" :height "100%"}]]]
:booting [:div.dot-dark-bg
[spinner/dot {:size 10 :animating? true :class "bg-off"}]]
:activating [:div.dot-dark-bg
[spinner/dot {:size 10 :animating? true :class "bg-off"}]]
:ready [:div.dot-dark-bg
[spinner/dot {:size 10 :animating? false :class "bg-on"}]]
:idle [:div.dot-dark-bg
[spinner/dot {:size 10 :animating? false :class "bg-on"}]]
:executing [:div.dot-dark-bg
[spinner/dot {:size 10 :animating? true :class "bg-on"}]]
:errored [:div.dot-dark-bg
[spinner/dot {:size 10 :animating? false :class "bg-dark-red"}]]
:sending [:div.dot-dark-bg
[spinner/dot {:size 10 :animating? true :class "bg-off"}]]
:downloading [spinner/downloading {:class "bg-teal"}]
:restoring [:div.dot-dark-bg
[spinner/dot {:size 10 :animating? true :class "bg-off"}]]
:uploading [spinner/uploading {:class "bg-teal"}]
:published [:div.dot-dark-bg
[spinner/dot {:size 10 :animating? false :class "bg-teal"}]]
nil)])
(defmulti log-event->entry :kind)
(defmethod log-event->entry :execution [{:keys [node index count] :as event}]
(let [{:keys [kind environment] :as node} (link/resolve node)
name (case kind
"docker-environment" (:environment/name node)
"runtime" (if (= (:state event) :downloading)
(runtime-ui/env-name-with-badge environment)
(runtime-ui/runtime-name-with-badge node))
nil)]
^{:key event}
[:span.flex-auto.inline-flex.items-center.log-entry
{:class (case (:state event)
:errored "dark-red"
:idle "green-contrast"
"")}
(case (:state event)
:downloading (str "Downloading"
(when (> count 1) (str " [" index "/" count "]"))
(when name (str " " name)) "...")
:restoring (str "Restoring"
(when (> count 1) (str " [" index "/" count "]"))
(when name (str " " name)) "...")
:uploading "Uploading..."
:booting (str "Booting" (when name (str " " name)) "...")
:idle "Idle."
:executing (str "Executing"
(when (> count 1) (str " Cell [" index "/" count "]"))
"...")
:skipped (str "Skipped"
(when (> count 1) (str " Cell [" index "/" count "]"))
"...")
:finished "Succeeded."
:stopped (str "Stopped" (when name (str " " name)) ".")
:errored "Errored."
(:state event))]))
(defmethod log-event->entry :runner [{:keys [state reason result] :as event}]
[:span.log-entry.flex-auto
{:class (case result
:canceled "dark-gray b"
:errored "dark-red b"
:succeeded "green-contrast b"
"")}
(case state
:stopped (case reason
:quota-exceeded "Scheduling failed, Resource currently not available"
:quota-exceeded-gpu "Scheduling failed, GPU currently not available"
:idle-timeout "Runner stopped"
:terminated "Runner terminated unexpectedly"
:scheduling-error "Scheduling Failed"
:scheduling-timeout "Scheduling Timeout"
:still-stopped "Ignored while runner is stopped."
:send-failed "Runner does not respond."
"Runner stopped")
:shutdown-scheduled ""
:scheduling "Scheduling Runner..."
:activating "Activating Runner..."
:booting "Booting Runner..."
:ready (case result
:canceled "Canceled."
:errored "Errored."
:rejected "Response Rejected"
:succeeded "Succeeded."
:reconnected "Runner reconnected."
result)
:executing "Processing request..."
:enqueued "Enqueued."
:sending "Sending request..."
state)])
(defmethod log-event->entry :notification [{:keys [message]}]
[:span.log-entry.flex-auto
[:span.orange.b message]])
(defmethod log-event->entry :error [{:keys [action state details]}]
[:span.log-entry.flex-auto
[:span action]
[:span.dark-red.b (str " " (clojure.string/capitalize (name state)) ". ")]
(when details
[:span.dark-red details])])
(defmethod log-event->entry :article [{:keys [state]}]
[:span.b.log-entry.flex-auto
(if (= :published state)
[:span.green-contrast "Succeeded."]
state)])
(defmethod log-event->entry :default [event]
[:span (pr-str event)])
(defn run-label [{:keys [request :request/id]}]
(let [{:keys [action node-id reset?] :as request} (or request @(re-frame/subscribe [:runner-request id]))
{:keys [kind name] :as node} (when node-id (link/resolve [:node node-id]))]
[:span
(case action
:publish "Publish:"
:save-environment (str (when reset? "Reset, Run & ")
"Save" (when node
(str " "
(runtime-ui/runtime-name-with-badge node)
":")))
:run (str (when reset? "Reset & ")
"Run"
(when node
(str " "
(case kind
"runtime" (runtime-ui/runtime-name-with-badge node)
"code" (str "Cell "
(runtime-ui/runtime-name-with-badge (:runtime node))
(when-not (str/blank? name) (str " (" name ")")))
"docker-environment" "Docker Import"
"github-repository" "Github Import"
"runtime-language" "Searching Jupyter Kernels"
"bucket" "Bucket Access"
"aws-efs" "AWS EFS Mount"
(str "Unhandled " kind))))
":")
:stop-execution "Stop:"
:recreate-runtime (str "Restarting " (if node (runtime-ui/runtime-name-with-badge node) "All") ":")
:checkpoint-runtime (str (if node (str "Checkpointing " (runtime-ui/runtime-name-with-badge node)) "Saving Session") ":")
:restore-runtime (str "Restoring " (if node (runtime-ui/runtime-name-with-badge node) "Session") ":")
:reset-runtime (str "Reset " (if node (runtime-ui/runtime-name-with-badge node) "All") ":")
:restart-runtime (str "Restart " (if node (runtime-ui/runtime-name-with-badge node) "All") ":")
:shutdown-runner "Shutdown Runner: "
:cancel-idle-shutdown "Keep running for another 20 minutes"
:shutdown-idle-runner "Shutdown Idle Runner: "
:idle-shutdown-scheduled (str "Shutdown in " (:minutes request) " minutes")
action)]))
(defn log-entry
[i class {:keys [node duration complete?] request-id :request/id :as event}]
^{:key (str "runner-log-" i)}
[:div.flex.items-center.pv1.pl3.hover-bg-light-silver.monospace.b--black-05
{:on-click (when node #(re-frame/dispatch [:follow node]))
:class (str (when node "pointer ")
(when-not (zero? i) "bt ")
class)
:style {:font-size 12 :padding-left 26 :padding-right 21}}
[:div.flex.flex-auto.lh-copy
[:div.flex-auto
[:span
[run-label event]
" "]
[log-event->entry (dissoc event :timestamp)]]
(when duration
[:span.black-40.tr.tnum.ml3.nowrap
{:style {:font-size 10 :width 60 :margin-top 2}}
(gstring/format "%.3fs" (/ duration 1000))])]])
(defn on-outside-click [dom-id on-close event]
(when (and (not (-> event .-target (util/dom-closest (str "#" dom-id))))
(not (-> event .-target (util/dom-closest (str "#toggle-" dom-id)))))
(.stopPropagation event)
(on-close)))
(defn log-popover [{:keys [runner-log]} dom-id log-open? notifications-popover-open?]
[popover/view
{:position #(positioning/to-fixed-el (str "#" dom-id) % (positioning/attachment :bottom-left {:offset {:x 0 :y 29}}))
:close-on-outside-click? false
:open? @log-open?
:on-close (fn []
(reset! log-open? false))
:arrow nil
:style {:margin-left -9 :position "fixed"}
:arrow-style {:left 24}
:layout-class "runner-popover"
:id dom-id}
^{:key "runner-log"}
[:div.sans-serif.flex-column
{:ref #(when % (set! (-> % .-style .-width)
(str (.-offsetWidth (js/document.getElementById "status-bar")) "px")))}
(let [notifications-form (-> ::form.notifications/notification-settings
(form/construct {})
(assoc :inline? true))
current-setting (if-let [setting (:person/notification-settings @(re-frame/subscribe [:current-person]))]
(name setting)
"off")]
[:div.runner-notifications.flex.items-center
[:div {:style {:display "none"}} (form/render notifications-form)]
[:div.f7.flex-auto.lh-copy
[:span
"Show notification when run completes"]]
(let [choices [{:value "off" :label "Off" :index 0}
{:value "in-background" :label "When tab is in background" :short-label "Tab in Background" :index 1}
{:value "always-on" :label "Always" :index 2}]]
[:div.flex.items-center.b.f7.teal.dim.pointer
{:on-click #(reset! notifications-popover-open? true)
:id "notification-style-popover"}
(let [c (->> choices
(filter #(= (:value %) current-setting))
first)]
(or (:short-label c) (:label c)))
[icon/view "ChevronDown" {:size 16 :class "fill-teal"}]
[autocompleter/view
{:open? (and @notifications-popover-open?)
:position #(positioning/to-el "#notification-style-popover" %
(positioning/attachment :bottom-center {:offset {:x 0 :y -7}}))
:arrow "top"
:selected-value current-setting
:on-complete (fn [value]
(re-frame/dispatch [:request-notification-permission
(fn []
(when (= "granted" (.-permission js/Notification))
(form.notifications/submit! notifications-form "notifications" value))
(reset! log-open? true)
(reset! notifications-popover-open? false))]))
:on-cancel #(do (reset! log-open? true)
(reset! notifications-popover-open? false))
:popover-id "notification-style"
:choices choices}]])])
[:div.runner-log
(->> runner-log
(reduce (fn [{:keys [log-entries i last-request-id class]}
{request-id :request/id :as event}]
(let [css-class "bg-teal-transparent "
class (if (= last-request-id request-id) class (if (= "" class) css-class ""))]
{:log-entries (conj log-entries (log-entry i class event))
:i (inc i) :class class
:last-request-id request-id}))
{:i 0 :log-entries [] :class ""})
:log-entries
(apply list))]]])
(defn dropdown-view [{:keys [id class style arrow autocompleter-style popover-style position] :or {arrow "top"}}]
(let [open? (reagent/atom false)
dom-id (str id (gensym))
on-outside-click (partial on-outside-click dom-id #(reset! open? false))]
(fn [{:keys [id button choices shortcut]}]
[:div
{:class (str (when @open? "dropdown-open ") class)
:style style
:on-click #(reset! open? (not @open?))
:id (str "toggle-" dom-id)
:ref (fn [el]
(if el
(do
(js/document.addEventListener "click" on-outside-click)
(when-let [{:keys [binding name]} shortcut]
(key/bind! binding name #(reset! open? true))))
(js/document.removeEventListener "click" on-outside-click)))}
button
[autocompleter/view
{:position (or position
#(positioning/to-fixed-el (str "#toggle-" dom-id) % (positioning/attachment :bottom-left)))
:open? @open?
:close-on-outside-click? false
:on-close #(reset! open? false)
:on-cancel #(reset! open? false)
:on-complete #(do (%) (reset! open? false))
:arrow arrow
:arrow-style {:left 24}
:id dom-id
:style (merge {:z-index 1001} autocompleter-style)
:popover-style popover-style
:choices choices}]])))
(def run-shortcut (str helpers/cmd "Enter"))
(def run+go-to-next-shortcut (str helpers/shift " Enter"))
(def run-all-in-runtime-shortcut (str helpers/shift helpers/cmd "Enter"))
(def restart-runtime-shortcut (str helpers/shift helpers/cmd "R"))
(def reset-runtime-shortcut (str helpers/shift helpers/cmd "K"))
(def run-all-shortcut (str helpers/alt helpers/cmd "Enter"))
(def run-options-shortcut (str helpers/cmd "Enter"))
(defn runner-choices [{:keys [cell-id runtime-id runner-status]}]
(let [runner-stopped? (or (str/blank? runner-status) (#{:stopped :stopping} runner-status))
runtime (link/resolve [:runtime runtime-id])
runtime-name (when runtime-id
(runtime-ui/runtime-name-with-badge runtime))
exec-state (when runtime-id
(or (:state runtime)
@(re-frame/subscribe [:runtime-state runtime-id])))]
(doall
(concat
[{:label "Run Cell"
:shortcut run-shortcut
:disabled? (not cell-id)
:value #(re-frame/dispatch [:run cell-id])}
{:label "Run Cell and Go To Next"
:shortcut run+go-to-next-shortcut
:disabled? (not cell-id)
:value #(re-frame/dispatch [:run+go-to-next cell-id])}
{:label (str "Run all in " (or runtime-name "Runtime"))
:shortcut run-all-in-runtime-shortcut
:disabled? (not runtime-id)
:value #(re-frame/dispatch [:run runtime-id])}
{:label "Run all"
:shortcut run-all-shortcut
:value #(re-frame/dispatch [:run])}
:separator
{:label "Stop Execution"
:disabled? (or (nil? runner-status) (#{:stopped :ready} runner-status))
:value #(if (= :booting runner-status)
(re-frame/dispatch [:shutdown-runner])
(re-frame/dispatch [:stop-execution]))}
{:label (str "Restart " (or runtime-name "Runtime"))
:hint "Keep filesystem state"
:disabled? (or (not runtime-id)
(= exec-state "stopped")
(= (:language runtime) "bash"))
:shortcut restart-runtime-shortcut
:value #(re-frame/dispatch [:restart-runtime {:node-id runtime-id}])}
{:label (str "Reset " (or runtime-name "Runtime"))
:hint "Process and filesystem state"
:disabled? (or (not runtime-id)
(= exec-state "stopped"))
:shortcut reset-runtime-shortcut
:value #(re-frame/dispatch [:reset-runtime {:node-id runtime-id}])}]
[{:label "Reset All"
:value #(re-frame/dispatch [:reset-runtime {:reset-all? true}])}]
(when (config/feature-enabled? "checkpoints")
(cond-> [:separator]
(not runner-stopped?)
(conj {:label "Save Session"
:value #(re-frame/dispatch [:checkpoint-runtime nil])})
true
(conj {:label "Restore All Runtimes"
:value #(re-frame/dispatch [:restore-runtime nil])})))
(when-not runner-stopped?
[:separator
{:label (if (or (str/blank? runner-status) (= :scheduling runner-status)) "Cancel Scheduling" "Shutdown Runner")
:value #(re-frame/dispatch [:shutdown-runner])}])))))
(defn run-controls [{:keys [status runtimes] :as s}]
(let [log @(re-frame/subscribe [:runner-log])
runner-status (-> (filter #(= (:kind %) :runner) log) first :state)]
[:div.flex.items-center
[:div {:class "f7 black bg-white br2 pointer flex items-center relative"
:style {:height 24 :line-height 24 :box-shadow "0 1px 2px rgba(0,0,0,.2)"}
:id "run-controls-button"}
[tooltip/view
{:tip [:div
[:div "Run"]
[:span.extra run-all-shortcut]]}
[:button.nj-button--unstyled.flex.items-center
{:style { :padding "5px 5px 5px 7px"}
:on-click #(re-frame/dispatch [:run])
:data-testid "runall-button"}
[icon/view "RunAll" {:size 20 :class "dim fill-teal"}]]]
[:div.flex.items-center
[:i.bg-black-10 {:style {:width 1 :height 16}}]
[dropdown-view
{:class ""
:style {}
:arrow false
:position #(positioning/to-fixed-el "#run-controls-button" % (positioning/attachment :bottom-left {:offset {:x 5 :y 20}}))
:popover-style {:margin-left -5 :margin-top 5 :position "fixed"}
:button [tooltip/view
{:tip [:div
[:div.nowrap
"Show run options"]
[:span.extra run-options-shortcut]]}
[:button.nj-button--unstyled.flex.item-center
{:style {:padding "5px 7px"}}
[icon/view "ChevronDown" {:size 12 :class "o-50"}]]]
:id "run-controls"
:choices (runner-choices {:runner-status runner-status
:cell-id @(re-frame/subscribe [:cell-id-to-run])
:runtime-id @(re-frame/subscribe [:runtime-id-to-run])})}]]]
(let [cancel-disabled? (or (nil? runner-status) (#{:stopped :ready} runner-status))]
[tooltip/view
{:tip [:div.nowrap "Stop Execution"]}
[:div {:class (str "f7 black bg-white br2 ph2 flex items-center relative ml2 "
(if cancel-disabled? "o-70 " "pointer "))
:style {:height 24 :line-height "24px" :box-shadow "0 1px 2px rgba(0,0,0,.2)"}
:id "run-stop-button"
:disabled cancel-disabled?
:on-click #(if (= :booting runner-status)
(re-frame/dispatch [:shutdown-runner])
(re-frame/dispatch [:stop-execution]))}
[:span.flex.items-center
[icon/view "Stop" {:size 18 :class "fill-teal"}]]]])]))
(defn published-view [{:keys [url]}]
(let [dismiss-timeout 10000
on-dismiss #(re-frame/dispatch [:reset-published])
hovered? (reagent/atom false)
timeout (js/setTimeout on-dismiss dismiss-timeout)
progress-props {:base-color "rgba(255,255,255,.4)"
:fill-color "#fff"
:line-width 1
:duration dismiss-timeout
:style {:position "absolute" :left -4 :top -4}}]
(fn []
[:div.flex.items-center.white
{:on-mouse-enter #(when-not @hovered?
(js/clearTimeout timeout)
(reset! hovered? true))}
[:span.mr1 "This notebook was published to:"]
[tooltip/view
{:container-class "di"
:tip [:div.nowrap "Open in new window"]}
[:a.white.underline.mr3 {:href url
:target "_blank"}
url]]
[tooltip/view
{:tip [:div.nowrap "Hide"]}
[:button.nj-button--unstyled.flex.items-center.relative
{:on-click on-dismiss}
(if @hovered?
^{:key "published-cancelled-dismiss"}
[spinner/radial-progress (merge progress-props {:animating? false})]
^{:key "published-animating-dismiss"}
[spinner/radial-progress progress-props])
[icon/view "CheckmarkBold" {:size 12 :class "fill-white"}]]]])))
(defn active-duration-view [computation-started-at]
(let [duration (reagent/atom 0)
close-chan (async/chan)]
(reagent/create-class
{:component-did-mount
(fn [this]
(when-not config/ssr?
(let [start computation-started-at
interval 100]
(go-loop []
(let [[_ chan] (async/alts! [close-chan (async/timeout interval)])]
(when (not= chan close-chan)
(swap! duration (constantly (- (js/Date.now) start)))
(recur)))))))
:component-will-unmount
(fn [this]
(async/put! close-chan :stop))
:reagent-render
(fn [_]
[:span.tr.black-40.mr2 {:style {:font-size 10 :width 60}} (gstring/format "%.1f00s" (/ @duration 1000))])})))
(defn errors-popover [errors]
(let [open? (reagent/atom false)
close-on-outside-click (partial on-outside-click "error-status" #(reset! open? false))]
(fn [errors]
[:button.nj-button--unstyled.pointer.flex.monospace.items-center
{:on-click #(swap! open? not)
:ref #(if %
(js/document.addEventListener "click" close-on-outside-click)
(js/document.removeEventListener "click" close-on-outside-click))
:id "error-status"}
[icon/view "Error" {:size 16 :class "fill-dark-red" :style {:margin-top -1}}]
[:span.mr1.dark-red.b
{:style {:margin-left 3}}
(count errors)]
[popover/view
{:position #(positioning/to-el "#error-status" % (positioning/attachment :bottom-left))
:close-on-outside-click? false
:open? @open?
:on-close #(reset! open? false)
:arrow nil
:style {:margin-top 10 :margin-left -9 :position "fixed"}
:id "errors-popver"}
^{:key "errors-popover"}
[:div
{:style {:max-width 300}}
(doall
(map (fn [{:keys [message] link :node}]
^{:key (str "error-popover-" link)}
[:div.flex.pa2.items-center.pointer.hover-bg-light-silver
[icon/view "Error" {:size 32 :class "fill-dark-red no-shrink"}]
[:div.monospace.mr2.ml2.dark-red.lh-copy
{:style {:font-size 12 :word-break "break-word"}
:on-click #(re-frame/dispatch [:follow link])}
message
(when-let [node (link/resolve link)]
[:div.sans-serif {:style {:font-size 10 :margin-top 3}}
(case (:kind node)
"runtime" (str (runtime-ui/runtime-name-with-badge node) " Runtime")
"code" (str (runtime-ui/runtime-name-with-badge (:runtime node)) " Cell")
"docker-environment" (str "Docker Import: " (:environment/name node))
nil)])]
(when link
[icon/view "ChevronRight" {:size 32 :class "o-50 no-shrink"}])])
errors))]]])))
(defn runner-log-view [s]
(let [log-open? (reagent/atom false)
notifications-popover-open? (reagent/atom false)
update-notification! (reagent/atom false)]
(fn [{:keys [code-cells runner-log-status runtimes status-duration] :as s}]
(let [dom-id "runner-status"
_ @update-notification!]
[:div.flex-auto.flex
^{:key "runner-log-status"}
[:div.flex.items-center.flex-auto
{:on-click #(swap! log-open? not)
:id "runner-status"}
[:div.mr2
[status-icon runner-log-status]]
[:div.flex-auto.monospace.flex.items-center
{:style {:font-size 12}}
[:span.db.truncate.flex-auto.black
[run-label runner-log-status]
" "
(log-event->entry runner-log-status)]
(if-let [duration (:duration runner-log-status)]
[:span.tr.black-40.mr1 {:style {:font-size 10 :width 60}} (gstring/format "%.3fs" (/ duration 1000))]
(when (and (not (:result runner-log-status))
(not (contains? #{:error :notification} (:kind runner-log-status))))
[active-duration-view (:timestamp runner-log-status)]))]
[:button.nj-button--unstyled.flex.items-center
[icon/view "ChevronDown" {:size 12 :class "o-50"}]]
(when (:duration-estimation runner-log-status)
[progress-view runner-log-status])]
^{:key "runner-log-popover"}
[log-popover s dom-id log-open? notifications-popover-open?]
(when-let [{:keys [article-entity]} runner-log-status]
(when (and (= :published (:state runner-log-status))
(:article/url article-entity))
[:div.flex.items-center
[:i.bg-black-10.ml2.mr2 {:style {:width 1 :height 16}}]
[tooltip/view
{:tip [:div.nowrap "Open notebook in new tab"]}
[:a.nj-button--unstyled.pointer.flex.monospace.items-center
{:href (:article/url article-entity)
:target "_blank"}
[icon/view "PopOut" {:size 16 :class "fill-teal" :style {:margin-top -1}}]]]]))
(when-let [errors (:errors runner-log-status)]
[:div.flex.items-center {:style {:font-size 10}}
[:i.bg-black-10.ml2.mr2 {:style {:width 1 :height 16}}]
[errors-popover errors]])
(when (= :shutdown-scheduled (get-in runner-log-status [:state]))
[:div.flex.items-center
[:div.bg-black-10.ml1.mr2 {:style {:width 1 :height 18}}]
[:span.teal.dim.nowrap
{:on-click #(re-frame/dispatch [:cancel-idle-shutdown])
:style {:font-size 11}}
"Keep Running"]])
(when (and @(re-frame/subscribe [:running?])
(not= :person.notification-settings/off (:person/notification-settings @(re-frame/subscribe [:current-person])))
(not (runner-notification/asked-for-permission?)))
[:div.flex.items-center
[:div.bg-black-10.ml2.mr2 {:style {:width 1 :height 18}}]
[:span.teal.dim.nowrap
{:style {:font-size 11}
:on-click (fn []
(reset! log-open? true)
(reset! notifications-popover-open? true))}
"Notify Me"]])]))))
(defn offline-view []
[:div.flex.items-center.dark-red.f7
[icon/offline {:size 18 :class "fill-red" :style {:margin-right 7 :margin-top -1}}]
[:span.b "Offline"]
[:div.bg-black-10.ml2.mr2 {:style {:width 1 :height 18}}]
[:span "Reconnecting automatically..."]])
(defn connection-errored-view [error]
(let [details-visible? (reagent/atom false)]
(fn [error]
(let [details? (not (clojure.string/blank? error))]
[:div.flex.items-center.flex-auto.f7
[:div.flex.items-center.dark-red.flex-auto
{:class (when details? "pointer")
:on-click #(when details? (swap! details-visible? not))
:id "connection-error-button"}
[icon/offline {:class "fill-dark-red" :size 18 :style {:margin-right 5 :margin-top -1}}]
[:span.flex-auto "Error connecting to Nextjournal"]
(when details?
[icon/view "ChevronDown" {:class "ml1 fill-dark-red"}])]
[:div.bg-black-10.ml2.mr2 {:style {:width 1 :height 18}}]
[:span.teal.dim
{:on-click #(re-frame/dispatch [:connect])}
"Retry now"]
[popover/view
{:arrow nil
:open? @details-visible?
:style {:position "fixed" :margin-top 0 :margin-left -9}
:position (fn [el]
(positioning/to-fixed-el "#connection-error-button" el (positioning/attachment :bottom-left {:offset {:x 0 :y 25}}))
(set! (-> el .-style .-width)
(str (.-offsetWidth (js/document.getElementById "connection-error-button")) "px")))}
^{:key "connection-error-details"}
[:div.pv2.ph3.dark-red.monospace.f7
error]]]))))
(defn connecting-view []
[:div.f7.flex.items-center.sans-serif.relative.black-80
[spinner/dot {:animating? true :class "bg-teal"}]
[:span.ml2 "Connecting to Nextjournal..."]])
(defn view [{:keys [connection code-cells docker-environments runner-log-status] :as s}]
(assert (contains? #{:connected :connecting :errored :offline} (:state connection)))
[:div.flex.items-center.sans-serif.relative.flex-auto.mr2
(when (or (seq code-cells) (seq docker-environments))
[:div.mr2
[run-controls s]])
(when (or (not= (:state connection) :connected)
runner-log-status)
[:div.flex.items-center.br2.bg-white.flex-auto.ph2.status-bar.pointer
{:style {:height 24 :line-height "24px" :box-shadow "0 1px 2px rgba(0,0,0,.2)"}
:id "status-bar"}
(case (:state connection)
:offline [offline-view]
:errored [connection-errored-view (:error connection)]
:connecting [connecting-view]
:connected (when runner-log-status
[runner-log-view s]))])])
(defn topbar [& hs]
[:div.bg-teal.ph3.flex.items-center {:style {:height 43}}
[:div.logo.logo-white.mr3]
hs
[:div {:style {:width 150}}]])
(defcard-nj connected
[topbar
[view {:connection {:state :connected}
:code-cells code-fixtures/demo-cells-with-output}]])
(def demo-log [{:kind :runner, :com.nextjournal.runner.log/level :info, :timestamp #inst "2018-06-04T08:55:39.208-00:00", :state :ready, :result :succeeded :request {:action :run, :reuse-context? true, :request/id #uuid "0dbff8e0-67d5-11e8-b2ee-e308276a38d9"} :errors [{:message "java.util.concurrent.ExecutionException:\njavax.ws.rs.ProcessingException:\njava.io.IOException: No such file or directory"}]}
{:com.nextjournal.runner.log/level :info, :request/id #uuid "0dbff8e0-67d5-11e8-b2ee-e308276a38d9", :index 1, :duration 78, :state :executing :request {:action :run, :reuse-context? true, :request/id #uuid "0dbff8e0-67d5-11e8-b2ee-e308276a38d9"}}
{:kind :runner, :com.nextjournal.runner.log/level :info, :timestamp #inst "2018-06-04T08:55:39.120-00:00", :state :executing, :request {:action :run, :reuse-context? true, :request/id #uuid "0dbff8e0-67d5-11e8-b2ee-e308276a38d9"}}
{:kind :runner, :com.nextjournal.runner.log/level :info, :timestamp #inst "2018-06-04T08:47:12.601-00:00", :state :ready, :result :succeeded}
{:com.nextjournal.runner.log/level :info, :request/id #uuid "da558c00-67d3-11e8-b2ee-e308276a38d9", :index 1, :duration 457, :state :executing :request {:action :run, :reuse-context? true, :request/id #uuid "da558c00-67d3-11e8-b2ee-e308276a38d9"}}
{:kind :execution, :com.nextjournal.runner.log/level :info, :timestamp #inst "2018-06-04T08:47:07.833-00:00", :state :booting, :node [:node "285ad4cc-d8d8-4cb7-a5ed-5aa19be83aa0"] :request {:action :run, :reuse-context? true, :request/id #uuid "da558c00-67d3-11e8-b2ee-e308276a38d9"}}
{:kind :execution, :com.nextjournal.runner.log/level :info, :timestamp #inst "2018-06-04T08:47:03.803-00:00", :state :downloading, :node [:node "285ad4cc-d8d8-4cb7-a5ed-5aa19be83aa0"] :request {:action :run, , :reuse-context? true, :request/id #uuid "da558c00-67d3-11e8-b2ee-e308276a38d9"}}
{:kind :runner, :com.nextjournal.runner.log/level :info, :timestamp #inst "2018-06-04T08:47:03.396-00:00", :state :executing, :request {:action :run, :reuse-context? true, :request/id #uuid "da558c00-67d3-11e8-b2ee-e308276a38d9"}}])
(defcard-nj log
[topbar
[view {:connection {:state :connected}
:code-cells code-fixtures/demo-cells-with-output
:runner-log-status (first demo-log)
:runner-log demo-log}]])
(defcard-nj scheduling
[topbar
[view {:connection {:state :connected}
:code-cells code-fixtures/demo-cells-with-output
:runner-log-status {:kind :runner, :com.nextjournal.runner.log/level :info, :timestamp #inst "2018-06-04T08:47:03.396-00:00", :state :scheduling, :duration-estimation 20000 :request {:action :run, :reuse-context? true, :request/id #uuid "da558c00-67d3-11e8-b2ee-e308276a38d9"}}
:runner-log demo-log}]])
(defcard-nj offline
[topbar
[view {:connection {:state :offline}}]])
(defcard-nj connecting
[topbar
[view {:connection {:state :connecting}}]])
(defcard-nj connection-error
[topbar
[view {:connection {:state :errored}}]])
(defcard-nj connection-error-details
[topbar
[view {:connection {:state :errored :error "Host is unreachable."}}]])
// Compiled by ClojureScript 0.0.1493314493 {:language-out :ecmascript5}
goog.provide('com.nextjournal.editor.article.status');
goog.require('cljs.core');
goog.require('com.nextjournal.devcards');
goog.require('reagent.core');
goog.require('clojure.string');
goog.require('cljs.core.async');
goog.require('re_frame.core');
goog.require('com.nextjournal.journal.views.helpers');
goog.require('com.nextjournal.editor.article.publish_view');
goog.require('com.nextjournal.editor.article.sidebar');
goog.require('com.nextjournal.editor.component');
goog.require('com.nextjournal.editor.components.ui.spinner');
goog.require('com.nextjournal.editor.components.ui.icon');
goog.require('com.nextjournal.editor.components.ui.positioning');
goog.require('com.nextjournal.editor.components.ui.autocompleter');
goog.require('com.nextjournal.editor.components.ui.tooltip');
goog.require('com.nextjournal.editor.components.code');
goog.require('com.nextjournal.editor.fixtures.code');
goog.require('com.nextjournal.editor.components.ui.popover');
goog.require('com.nextjournal.journal.form');
goog.require('com.nextjournal.editor.components.runtime');
goog.require('com.nextjournal.editor.components.ui.runtime');
goog.require('com.nextjournal.editor.components.ui.reference');
goog.require('com.nextjournal.journal.form.notifications');
goog.require('com.nextjournal.editor.events');
goog.require('com.nextjournal.editor.util');
goog.require('com.nextjournal.graph.link');
goog.require('com.nextjournal.editor.config');
goog.require('goog.string');
goog.require('keybind.core');
goog.require('com.nextjournal.editor.article.runner_notification');
com.nextjournal.editor.article.status.progress_view = (function com$nextjournal$editor$article$status$progress_view(p__134326){
var map__134327 = p__134326;
var map__134327__$1 = (((((!((map__134327 == null))))?(((((map__134327.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134327.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134327):map__134327);
var duration_estimation = cljs.core.get.call(null,map__134327__$1,new cljs.core.Keyword(null,"duration-estimation","duration-estimation",-850460845));
var t = reagent.core.atom.call(null,(0));
var close_chan = cljs.core.async.chan.call(null);
return reagent.core.create_class.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"component-did-mount","component-did-mount",-1126910518),((function (t,close_chan,map__134327,map__134327__$1,duration_estimation){
return (function (this$){
if(com.nextjournal.editor.config.ssr_QMARK_){
return null;
} else {
var start = Date.now();
var interval = (100);
var c__103438__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__103438__auto__,start,interval,t,close_chan,map__134327,map__134327__$1,duration_estimation){
return (function (){
var f__103439__auto__ = (function (){var switch__103105__auto__ = ((function (c__103438__auto__,start,interval,t,close_chan,map__134327,map__134327__$1,duration_estimation){
return (function (state_134359){
var state_val_134360 = (state_134359[(1)]);
if((state_val_134360 === (1))){
var state_134359__$1 = state_134359;
var statearr_134361_134379 = state_134359__$1;
(statearr_134361_134379[(2)] = null);
(statearr_134361_134379[(1)] = (2));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_134360 === (2))){
var inst_134335 = cljs.core.PersistentVector.EMPTY_NODE;
var inst_134336 = cljs.core.async.timeout.call(null,interval);
var inst_134337 = [close_chan,inst_134336];
var inst_134338 = (new cljs.core.PersistentVector(null,2,(5),inst_134335,inst_134337,null));
var state_134359__$1 = state_134359;
return cljs.core.async.ioc_alts_BANG_.call(null,state_134359__$1,(4),inst_134338);
} else {
if((state_val_134360 === (3))){
var inst_134357 = (state_134359[(2)]);
var state_134359__$1 = state_134359;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_134359__$1,inst_134357);
} else {
if((state_val_134360 === (4))){
var inst_134340 = (state_134359[(2)]);
var inst_134341 = cljs.core.nth.call(null,inst_134340,(0),null);
var inst_134342 = cljs.core.nth.call(null,inst_134340,(1),null);
var inst_134343 = cljs.core.not_EQ_.call(null,inst_134342,close_chan);
var inst_134344 = cljs.core.deref.call(null,t);
var inst_134345 = (inst_134344 < duration_estimation);
var inst_134346 = ((inst_134343) && (inst_134345));
var state_134359__$1 = (function (){var statearr_134365 = state_134359;
(statearr_134365[(7)] = inst_134341);
return statearr_134365;
})();
if(cljs.core.truth_(inst_134346)){
var statearr_134366_134381 = state_134359__$1;
(statearr_134366_134381[(1)] = (5));
} else {
var statearr_134367_134382 = state_134359__$1;
(statearr_134367_134382[(1)] = (6));
}
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_134360 === (5))){
var inst_134348 = Date.now();
var inst_134349 = (inst_134348 - start);
var inst_134350 = cljs.core.constantly.call(null,inst_134349);
var inst_134351 = cljs.core.swap_BANG_.call(null,t,inst_134350);
var state_134359__$1 = (function (){var statearr_134368 = state_134359;
(statearr_134368[(8)] = inst_134351);
return statearr_134368;
})();
var statearr_134369_134383 = state_134359__$1;
(statearr_134369_134383[(2)] = null);
(statearr_134369_134383[(1)] = (2));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_134360 === (6))){
var state_134359__$1 = state_134359;
var statearr_134370_134384 = state_134359__$1;
(statearr_134370_134384[(2)] = null);
(statearr_134370_134384[(1)] = (7));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_134360 === (7))){
var inst_134355 = (state_134359[(2)]);
var state_134359__$1 = state_134359;
var statearr_134371_134385 = state_134359__$1;
(statearr_134371_134385[(2)] = inst_134355);
(statearr_134371_134385[(1)] = (3));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
});})(c__103438__auto__,start,interval,t,close_chan,map__134327,map__134327__$1,duration_estimation))
;
return ((function (switch__103105__auto__,c__103438__auto__,start,interval,t,close_chan,map__134327,map__134327__$1,duration_estimation){
return (function() {
var com$nextjournal$editor$article$status$progress_view_$_state_machine__103106__auto__ = null;
var com$nextjournal$editor$article$status$progress_view_$_state_machine__103106__auto____0 = (function (){
var statearr_134372 = [null,null,null,null,null,null,null,null,null];
(statearr_134372[(0)] = com$nextjournal$editor$article$status$progress_view_$_state_machine__103106__auto__);
(statearr_134372[(1)] = (1));
return statearr_134372;
});
var com$nextjournal$editor$article$status$progress_view_$_state_machine__103106__auto____1 = (function (state_134359){
while(true){
var ret_value__103107__auto__ = (function (){try{while(true){
var result__103108__auto__ = switch__103105__auto__.call(null,state_134359);
if(cljs.core.keyword_identical_QMARK_.call(null,result__103108__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__103108__auto__;
}
break;
}
}catch (e134373){if((e134373 instanceof Object)){
var ex__103109__auto__ = e134373;
var statearr_134374_134386 = state_134359;
(statearr_134374_134386[(5)] = ex__103109__auto__);
cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_134359);
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e134373;
}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__103107__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__134387 = state_134359;
state_134359 = G__134387;
continue;
} else {
return ret_value__103107__auto__;
}
break;
}
});
com$nextjournal$editor$article$status$progress_view_$_state_machine__103106__auto__ = function(state_134359){
switch(arguments.length){
case 0:
return com$nextjournal$editor$article$status$progress_view_$_state_machine__103106__auto____0.call(this);
case 1:
return com$nextjournal$editor$article$status$progress_view_$_state_machine__103106__auto____1.call(this,state_134359);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
com$nextjournal$editor$article$status$progress_view_$_state_machine__103106__auto__.cljs$core$IFn$_invoke$arity$0 = com$nextjournal$editor$article$status$progress_view_$_state_machine__103106__auto____0;
com$nextjournal$editor$article$status$progress_view_$_state_machine__103106__auto__.cljs$core$IFn$_invoke$arity$1 = com$nextjournal$editor$article$status$progress_view_$_state_machine__103106__auto____1;
return com$nextjournal$editor$article$status$progress_view_$_state_machine__103106__auto__;
})()
;})(switch__103105__auto__,c__103438__auto__,start,interval,t,close_chan,map__134327,map__134327__$1,duration_estimation))
})();
var state__103440__auto__ = (function (){var statearr_134375 = f__103439__auto__.call(null);
(statearr_134375[(6)] = c__103438__auto__);
return statearr_134375;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__103440__auto__);
});})(c__103438__auto__,start,interval,t,close_chan,map__134327,map__134327__$1,duration_estimation))
);
return c__103438__auto__;
}
});})(t,close_chan,map__134327,map__134327__$1,duration_estimation))
,new cljs.core.Keyword(null,"component-will-unmount","component-will-unmount",-2058314698),((function (t,close_chan,map__134327,map__134327__$1,duration_estimation){
return (function (this$){
return cljs.core.async.put_BANG_.call(null,close_chan,new cljs.core.Keyword(null,"stop","stop",-2140911342));
});})(t,close_chan,map__134327,map__134327__$1,duration_estimation))
,new cljs.core.Keyword(null,"reagent-render","reagent-render",-985383853),((function (t,close_chan,map__134327,map__134327__$1,duration_estimation){
return (function (_){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.absolute.overflow-hidden.br2","div.absolute.overflow-hidden.br2",1875344085),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"left","left",-399115937),(0),new cljs.core.Keyword(null,"right","right",-452581833),(0),new cljs.core.Keyword(null,"bottom","bottom",-1550509018),(0),new cljs.core.Keyword(null,"top","top",-1856271961),(0),new cljs.core.Keyword(null,"z-index","z-index",1892827090),(0),new cljs.core.Keyword(null,"pointer-events","pointer-events",-1053858853),"none"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.bg-teal.animating-stripes","div.bg-teal.animating-stripes",1473949351),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"opacity","opacity",397153780),0.3,new cljs.core.Keyword(null,"height","height",1025178622),"100%",new cljs.core.Keyword(null,"width","width",-384071477),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(((cljs.core.deref.call(null,t) / duration_estimation) * (100))),"%"].join('')], null)], null)], null)], null);
});})(t,close_chan,map__134327,map__134327__$1,duration_estimation))
], null));
});
com.nextjournal.editor.article.status.status_icon = (function com$nextjournal$editor$article$status$status_icon(p__134376){
var map__134377 = p__134376;
var map__134377__$1 = (((((!((map__134377 == null))))?(((((map__134377.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134377.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134377):map__134377);
var state = cljs.core.get.call(null,map__134377__$1,new cljs.core.Keyword(null,"state","state",-1988618099));
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),(function (){var G__134380 = state;
var G__134380__$1 = (((G__134380 instanceof cljs.core.Keyword))?G__134380.fqn:null);
switch (G__134380__$1) {
case "stopped":
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.dot-dark-bg","div.dot-dark-bg",-275032176),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.spinner.dot,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"size","size",1098693007),(10),new cljs.core.Keyword(null,"animating?","animating?",-333605094),false,new cljs.core.Keyword(null,"class","class",-2030961996),"bg-off"], null)], null)], null);
break;
case "shutdown-scheduled":
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.dot-dark-bg","div.dot-dark-bg",-275032176),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.spinner.dot,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"size","size",1098693007),(10),new cljs.core.Keyword(null,"animating?","animating?",-333605094),false,new cljs.core.Keyword(null,"class","class",-2030961996),"bg-warning"], null)], null)], null);
break;
case "stopping":
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.dot-dark-bg","div.dot-dark-bg",-275032176),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.spinner.dot,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"size","size",1098693007),(10),new cljs.core.Keyword(null,"animating?","animating?",-333605094),true,new cljs.core.Keyword(null,"class","class",-2030961996),"bg-enqueued"], null)], null)], null);
break;
case "scheduling":
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.flex.items-center","span.flex.items-center",-463750193),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-top","margin-top",392161226),(-2)], null)], null),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.finding.no-shrink.relative","div.finding.no-shrink.relative",723748258),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"width","width",-384071477),(18),new cljs.core.Keyword(null,"height","height",1025178622),(14)], null)], null),new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div#dish.absolute.left-0.top-0","div#dish.absolute.left-0.top-0",-1038551090),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"width","width",-384071477),(18),new cljs.core.Keyword(null,"height","height",1025178622),(14)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"img.absolute.left-0.top-0","img.absolute.left-0.top-0",1390005311),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"src","src",-1651076051),"/images/FindingDish.svg",new cljs.core.Keyword(null,"width","width",-384071477),"100%",new cljs.core.Keyword(null,"height","height",1025178622),"100%"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"img#wave1.absolute.left-0.top-0","img#wave1.absolute.left-0.top-0",1465667230),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"src","src",-1651076051),"/images/FindingWave1.svg",new cljs.core.Keyword(null,"width","width",-384071477),"100%",new cljs.core.Keyword(null,"height","height",1025178622),"100%"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"img#wave2.absolute.left-0.top-0","img#wave2.absolute.left-0.top-0",846136148),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"src","src",-1651076051),"/images/FindingWave2.svg",new cljs.core.Keyword(null,"width","width",-384071477),"100%",new cljs.core.Keyword(null,"height","height",1025178622),"100%"], null)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"img.absolute.left-0.top-0","img.absolute.left-0.top-0",1390005311),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"src","src",-1651076051),"/images/FindingMount.svg",new cljs.core.Keyword(null,"width","width",-384071477),"100%",new cljs.core.Keyword(null,"height","height",1025178622),"100%"], null)], null)], null)], null);
break;
case "booting":
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.dot-dark-bg","div.dot-dark-bg",-275032176),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.spinner.dot,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"size","size",1098693007),(10),new cljs.core.Keyword(null,"animating?","animating?",-333605094),true,new cljs.core.Keyword(null,"class","class",-2030961996),"bg-off"], null)], null)], null);
break;
case "activating":
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.dot-dark-bg","div.dot-dark-bg",-275032176),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.spinner.dot,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"size","size",1098693007),(10),new cljs.core.Keyword(null,"animating?","animating?",-333605094),true,new cljs.core.Keyword(null,"class","class",-2030961996),"bg-off"], null)], null)], null);
break;
case "ready":
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.dot-dark-bg","div.dot-dark-bg",-275032176),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.spinner.dot,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"size","size",1098693007),(10),new cljs.core.Keyword(null,"animating?","animating?",-333605094),false,new cljs.core.Keyword(null,"class","class",-2030961996),"bg-on"], null)], null)], null);
break;
case "idle":
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.dot-dark-bg","div.dot-dark-bg",-275032176),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.spinner.dot,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"size","size",1098693007),(10),new cljs.core.Keyword(null,"animating?","animating?",-333605094),false,new cljs.core.Keyword(null,"class","class",-2030961996),"bg-on"], null)], null)], null);
break;
case "executing":
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.dot-dark-bg","div.dot-dark-bg",-275032176),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.spinner.dot,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"size","size",1098693007),(10),new cljs.core.Keyword(null,"animating?","animating?",-333605094),true,new cljs.core.Keyword(null,"class","class",-2030961996),"bg-on"], null)], null)], null);
break;
case "errored":
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.dot-dark-bg","div.dot-dark-bg",-275032176),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.spinner.dot,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"size","size",1098693007),(10),new cljs.core.Keyword(null,"animating?","animating?",-333605094),false,new cljs.core.Keyword(null,"class","class",-2030961996),"bg-dark-red"], null)], null)], null);
break;
case "sending":
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.dot-dark-bg","div.dot-dark-bg",-275032176),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.spinner.dot,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"size","size",1098693007),(10),new cljs.core.Keyword(null,"animating?","animating?",-333605094),true,new cljs.core.Keyword(null,"class","class",-2030961996),"bg-off"], null)], null)], null);
break;
case "downloading":
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.spinner.downloading,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"class","class",-2030961996),"bg-teal"], null)], null);
break;
case "restoring":
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.dot-dark-bg","div.dot-dark-bg",-275032176),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.spinner.dot,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"size","size",1098693007),(10),new cljs.core.Keyword(null,"animating?","animating?",-333605094),true,new cljs.core.Keyword(null,"class","class",-2030961996),"bg-off"], null)], null)], null);
break;
case "uploading":
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.spinner.uploading,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"class","class",-2030961996),"bg-teal"], null)], null);
break;
case "published":
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.dot-dark-bg","div.dot-dark-bg",-275032176),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.spinner.dot,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"size","size",1098693007),(10),new cljs.core.Keyword(null,"animating?","animating?",-333605094),false,new cljs.core.Keyword(null,"class","class",-2030961996),"bg-teal"], null)], null)], null);
break;
default:
return null;
}
})()], null);
});
if((typeof com !== 'undefined') && (typeof com.nextjournal !== 'undefined') && (typeof com.nextjournal.editor !== 'undefined') && (typeof com.nextjournal.editor.article !== 'undefined') && (typeof com.nextjournal.editor.article.status !== 'undefined') && (typeof com.nextjournal.editor.article.status.log_event__GT_entry !== 'undefined')){
} else {
com.nextjournal.editor.article.status.log_event__GT_entry = (function (){var method_table__89119__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var prefer_table__89120__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var method_cache__89121__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var cached_hierarchy__89122__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var hierarchy__89123__auto__ = cljs.core.get.call(null,cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"hierarchy","hierarchy",-1053470341),cljs.core.get_global_hierarchy.call(null));
return (new cljs.core.MultiFn(cljs.core.symbol.call(null,"com.nextjournal.editor.article.status","log-event->entry"),new cljs.core.Keyword(null,"kind","kind",-717265803),new cljs.core.Keyword(null,"default","default",-1987822328),hierarchy__89123__auto__,method_table__89119__auto__,prefer_table__89120__auto__,method_cache__89121__auto__,cached_hierarchy__89122__auto__));
})();
}
cljs.core._add_method.call(null,com.nextjournal.editor.article.status.log_event__GT_entry,new cljs.core.Keyword(null,"execution","execution",253283524),(function (p__134389){
var map__134390 = p__134389;
var map__134390__$1 = (((((!((map__134390 == null))))?(((((map__134390.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134390.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134390):map__134390);
var event = map__134390__$1;
var node = cljs.core.get.call(null,map__134390__$1,new cljs.core.Keyword(null,"node","node",581201198));
var index = cljs.core.get.call(null,map__134390__$1,new cljs.core.Keyword(null,"index","index",-1531685915));
var count = cljs.core.get.call(null,map__134390__$1,new cljs.core.Keyword(null,"count","count",2139924085));
var map__134392 = com.nextjournal.graph.link.resolve.call(null,node);
var map__134392__$1 = (((((!((map__134392 == null))))?(((((map__134392.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134392.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134392):map__134392);
var node__$1 = map__134392__$1;
var kind = cljs.core.get.call(null,map__134392__$1,new cljs.core.Keyword(null,"kind","kind",-717265803));
var environment = cljs.core.get.call(null,map__134392__$1,new cljs.core.Keyword(null,"environment","environment",-666037640));
var name = (function (){var G__134394 = kind;
switch (G__134394) {
case "docker-environment":
return new cljs.core.Keyword("environment","name","environment/name",1925513790).cljs$core$IFn$_invoke$arity$1(node__$1);
break;
case "runtime":
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"state","state",-1988618099).cljs$core$IFn$_invoke$arity$1(event),new cljs.core.Keyword(null,"downloading","downloading",-213530737))){
return com.nextjournal.editor.components.ui.runtime.env_name_with_badge.call(null,environment);
} else {
return com.nextjournal.editor.components.ui.runtime.runtime_name_with_badge.call(null,node__$1);
}
break;
default:
return null;
}
})();
return cljs.core.with_meta(new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.flex-auto.inline-flex.items-center.log-entry","span.flex-auto.inline-flex.items-center.log-entry",-407880471),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"class","class",-2030961996),(function (){var G__134395 = new cljs.core.Keyword(null,"state","state",-1988618099).cljs$core$IFn$_invoke$arity$1(event);
var G__134395__$1 = (((G__134395 instanceof cljs.core.Keyword))?G__134395.fqn:null);
switch (G__134395__$1) {
case "errored":
return "dark-red";
break;
case "idle":
return "green-contrast";
break;
default:
return "";
}
})()], null),(function (){var G__134396 = new cljs.core.Keyword(null,"state","state",-1988618099).cljs$core$IFn$_invoke$arity$1(event);
var G__134396__$1 = (((G__134396 instanceof cljs.core.Keyword))?G__134396.fqn:null);
switch (G__134396__$1) {
case "downloading":
return ["Downloading",(((count > (1)))?[" [",cljs.core.str.cljs$core$IFn$_invoke$arity$1(index),"/",cljs.core.str.cljs$core$IFn$_invoke$arity$1(count),"]"].join(''):null),(cljs.core.truth_(name)?[" ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(name)].join(''):null),"..."].join('');
break;
case "restoring":
return ["Restoring",(((count > (1)))?[" [",cljs.core.str.cljs$core$IFn$_invoke$arity$1(index),"/",cljs.core.str.cljs$core$IFn$_invoke$arity$1(count),"]"].join(''):null),(cljs.core.truth_(name)?[" ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(name)].join(''):null),"..."].join('');
break;
case "uploading":
return "Uploading...";
break;
case "booting":
return ["Booting",(cljs.core.truth_(name)?[" ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(name)].join(''):null),"..."].join('');
break;
case "idle":
return "Idle.";
break;
case "executing":
return ["Executing",(((count > (1)))?[" Cell [",cljs.core.str.cljs$core$IFn$_invoke$arity$1(index),"/",cljs.core.str.cljs$core$IFn$_invoke$arity$1(count),"]"].join(''):null),"..."].join('');
break;
case "skipped":
return ["Skipped",(((count > (1)))?[" Cell [",cljs.core.str.cljs$core$IFn$_invoke$arity$1(index),"/",cljs.core.str.cljs$core$IFn$_invoke$arity$1(count),"]"].join(''):null),"..."].join('');
break;
case "finished":
return "Succeeded.";
break;
case "stopped":
return ["Stopped",(cljs.core.truth_(name)?[" ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(name)].join(''):null),"."].join('');
break;
case "errored":
return "Errored.";
break;
default:
return new cljs.core.Keyword(null,"state","state",-1988618099).cljs$core$IFn$_invoke$arity$1(event);
}
})()], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key","key",-1516042587),event], null));
}));
cljs.core._add_method.call(null,com.nextjournal.editor.article.status.log_event__GT_entry,new cljs.core.Keyword(null,"runner","runner",1945441304),(function (p__134400){
var map__134401 = p__134400;
var map__134401__$1 = (((((!((map__134401 == null))))?(((((map__134401.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134401.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134401):map__134401);
var event = map__134401__$1;
var state = cljs.core.get.call(null,map__134401__$1,new cljs.core.Keyword(null,"state","state",-1988618099));
var reason = cljs.core.get.call(null,map__134401__$1,new cljs.core.Keyword(null,"reason","reason",-2070751759));
var result = cljs.core.get.call(null,map__134401__$1,new cljs.core.Keyword(null,"result","result",1415092211));
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.log-entry.flex-auto","span.log-entry.flex-auto",1572891179),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"class","class",-2030961996),(function (){var G__134406 = result;
var G__134406__$1 = (((G__134406 instanceof cljs.core.Keyword))?G__134406.fqn:null);
switch (G__134406__$1) {
case "canceled":
return "dark-gray b";
break;
case "errored":
return "dark-red b";
break;
case "succeeded":
return "green-contrast b";
break;
default:
return "";
}
})()], null),(function (){var G__134410 = state;
var G__134410__$1 = (((G__134410 instanceof cljs.core.Keyword))?G__134410.fqn:null);
switch (G__134410__$1) {
case "stopped":
var G__134412 = reason;
var G__134412__$1 = (((G__134412 instanceof cljs.core.Keyword))?G__134412.fqn:null);
switch (G__134412__$1) {
case "quota-exceeded":
return "Scheduling failed, Resource currently not available";
break;
case "quota-exceeded-gpu":
return "Scheduling failed, GPU currently not available";
break;
case "idle-timeout":
return "Runner stopped";
break;
case "terminated":
return "Runner terminated unexpectedly";
break;
case "scheduling-error":
return "Scheduling Failed";
break;
case "scheduling-timeout":
return "Scheduling Timeout";
break;
case "still-stopped":
return "Ignored while runner is stopped.";
break;
case "send-failed":
return "Runner does not respond.";
break;
default:
return "Runner stopped";
}
break;
case "shutdown-scheduled":
return "";
break;
case "scheduling":
return "Scheduling Runner...";
break;
case "activating":
return "Activating Runner...";
break;
case "booting":
return "Booting Runner...";
break;
case "ready":
var G__134413 = result;
var G__134413__$1 = (((G__134413 instanceof cljs.core.Keyword))?G__134413.fqn:null);
switch (G__134413__$1) {
case "canceled":
return "Canceled.";
break;
case "errored":
return "Errored.";
break;
case "rejected":
return "Response Rejected";
break;
case "succeeded":
return "Succeeded.";
break;
case "reconnected":
return "Runner reconnected.";
break;
default:
return result;
}
break;
case "executing":
return "Processing request...";
break;
case "enqueued":
return "Enqueued.";
break;
case "sending":
return "Sending request...";
break;
default:
return state;
}
})()], null);
}));
cljs.core._add_method.call(null,com.nextjournal.editor.article.status.log_event__GT_entry,new cljs.core.Keyword(null,"notification","notification",-222338233),(function (p__134416){
var map__134417 = p__134416;
var map__134417__$1 = (((((!((map__134417 == null))))?(((((map__134417.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134417.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134417):map__134417);
var message = cljs.core.get.call(null,map__134417__$1,new cljs.core.Keyword(null,"message","message",-406056002));
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.log-entry.flex-auto","span.log-entry.flex-auto",1572891179),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.orange.b","span.orange.b",1807920914),message], null)], null);
}));
cljs.core._add_method.call(null,com.nextjournal.editor.article.status.log_event__GT_entry,new cljs.core.Keyword(null,"error","error",-978969032),(function (p__134424){
var map__134425 = p__134424;
var map__134425__$1 = (((((!((map__134425 == null))))?(((((map__134425.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134425.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134425):map__134425);
var action = cljs.core.get.call(null,map__134425__$1,new cljs.core.Keyword(null,"action","action",-811238024));
var state = cljs.core.get.call(null,map__134425__$1,new cljs.core.Keyword(null,"state","state",-1988618099));
var details = cljs.core.get.call(null,map__134425__$1,new cljs.core.Keyword(null,"details","details",1956795411));
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.log-entry.flex-auto","span.log-entry.flex-auto",1572891179),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1394872991),action], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.dark-red.b","span.dark-red.b",1228739640),[" ",clojure.string.capitalize.call(null,cljs.core.name.call(null,state)),". "].join('')], null),(cljs.core.truth_(details)?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.dark-red","span.dark-red",479860130),details], null):null)], null);
}));
cljs.core._add_method.call(null,com.nextjournal.editor.article.status.log_event__GT_entry,new cljs.core.Keyword(null,"article","article",-21685045),(function (p__134435){
var map__134436 = p__134435;
var map__134436__$1 = (((((!((map__134436 == null))))?(((((map__134436.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134436.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134436):map__134436);
var state = cljs.core.get.call(null,map__134436__$1,new cljs.core.Keyword(null,"state","state",-1988618099));
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.b.log-entry.flex-auto","span.b.log-entry.flex-auto",960294416),((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"published","published",-514587618),state))?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.green-contrast","span.green-contrast",761485131),"Succeeded."], null):state)], null);
}));
cljs.core._add_method.call(null,com.nextjournal.editor.article.status.log_event__GT_entry,new cljs.core.Keyword(null,"default","default",-1987822328),(function (event){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1394872991),cljs.core.pr_str.call(null,event)], null);
}));
com.nextjournal.editor.article.status.run_label = (function com$nextjournal$editor$article$status$run_label(p__134443){
var map__134445 = p__134443;
var map__134445__$1 = (((((!((map__134445 == null))))?(((((map__134445.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134445.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134445):map__134445);
var request = cljs.core.get.call(null,map__134445__$1,new cljs.core.Keyword(null,"request","request",1772954723));
var id = cljs.core.get.call(null,map__134445__$1,new cljs.core.Keyword("request","id","request/id",1829218213));
var map__134449 = (function (){var or__88041__auto__ = request;
if(cljs.core.truth_(or__88041__auto__)){
return or__88041__auto__;
} else {
return cljs.core.deref.call(null,re_frame.core.subscribe.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"runner-request","runner-request",236812426),id], null)));
}
})();
var map__134449__$1 = (((((!((map__134449 == null))))?(((((map__134449.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134449.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134449):map__134449);
var request__$1 = map__134449__$1;
var action = cljs.core.get.call(null,map__134449__$1,new cljs.core.Keyword(null,"action","action",-811238024));
var node_id = cljs.core.get.call(null,map__134449__$1,new cljs.core.Keyword(null,"node-id","node-id",779482292));
var reset_QMARK_ = cljs.core.get.call(null,map__134449__$1,new cljs.core.Keyword(null,"reset?","reset?",-1051875415));
var map__134450 = (cljs.core.truth_(node_id)?com.nextjournal.graph.link.resolve.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"node","node",581201198),node_id], null)):null);
var map__134450__$1 = (((((!((map__134450 == null))))?(((((map__134450.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134450.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134450):map__134450);
var node = map__134450__$1;
var kind = cljs.core.get.call(null,map__134450__$1,new cljs.core.Keyword(null,"kind","kind",-717265803));
var name = cljs.core.get.call(null,map__134450__$1,new cljs.core.Keyword(null,"name","name",1843675177));
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1394872991),(function (){var G__134456 = action;
var G__134456__$1 = (((G__134456 instanceof cljs.core.Keyword))?G__134456.fqn:null);
switch (G__134456__$1) {
case "publish":
return "Publish:";
break;
case "save-environment":
return [(cljs.core.truth_(reset_QMARK_)?"Reset, Run & ":null),"Save",(cljs.core.truth_(node)?[" ",com.nextjournal.editor.components.ui.runtime.runtime_name_with_badge.call(null,node),":"].join(''):null)].join('');
break;
case "run":
return [(cljs.core.truth_(reset_QMARK_)?"Reset & ":null),"Run",(cljs.core.truth_(node)?[" ",cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var G__134469 = kind;
switch (G__134469) {
case "runtime":
return com.nextjournal.editor.components.ui.runtime.runtime_name_with_badge.call(null,node);
break;
case "code":
return ["Cell ",com.nextjournal.editor.components.ui.runtime.runtime_name_with_badge.call(null,new cljs.core.Keyword(null,"runtime","runtime",-1331573996).cljs$core$IFn$_invoke$arity$1(node)),((clojure.string.blank_QMARK_.call(null,name))?null:[" (",cljs.core.str.cljs$core$IFn$_invoke$arity$1(name),")"].join(''))].join('');
break;
case "docker-environment":
return "Docker Import";
break;
case "github-repository":
return "Github Import";
break;
case "runtime-language":
return "Searching Jupyter Kernels";
break;
case "bucket":
return "Bucket Access";
break;
case "aws-efs":
return "AWS EFS Mount";
break;
default:
return ["Unhandled ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(kind)].join('');
}
})())].join(''):null),":"].join('');
break;
case "stop-execution":
return "Stop:";
break;
case "recreate-runtime":
return ["Restarting ",(cljs.core.truth_(node)?com.nextjournal.editor.components.ui.runtime.runtime_name_with_badge.call(null,node):"All"),":"].join('');
break;
case "checkpoint-runtime":
return [(cljs.core.truth_(node)?["Checkpointing ",com.nextjournal.editor.components.ui.runtime.runtime_name_with_badge.call(null,node)].join(''):"Saving Session"),":"].join('');
break;
case "restore-runtime":
return ["Restoring ",(cljs.core.truth_(node)?com.nextjournal.editor.components.ui.runtime.runtime_name_with_badge.call(null,node):"Session"),":"].join('');
break;
case "reset-runtime":
return ["Reset ",(cljs.core.truth_(node)?com.nextjournal.editor.components.ui.runtime.runtime_name_with_badge.call(null,node):"All"),":"].join('');
break;
case "restart-runtime":
return ["Restart ",(cljs.core.truth_(node)?com.nextjournal.editor.components.ui.runtime.runtime_name_with_badge.call(null,node):"All"),":"].join('');
break;
case "shutdown-runner":
return "Shutdown Runner: ";
break;
case "cancel-idle-shutdown":
return "Keep running for another 20 minutes";
break;
case "shutdown-idle-runner":
return "Shutdown Idle Runner: ";
break;
case "idle-shutdown-scheduled":
return ["Shutdown in ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"minutes","minutes",1319166394).cljs$core$IFn$_invoke$arity$1(request__$1))," minutes"].join('');
break;
default:
return action;
}
})()], null);
});
com.nextjournal.editor.article.status.log_entry = (function com$nextjournal$editor$article$status$log_entry(i,class$,p__134480){
var map__134481 = p__134480;
var map__134481__$1 = (((((!((map__134481 == null))))?(((((map__134481.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134481.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134481):map__134481);
var event = map__134481__$1;
var request_id = cljs.core.get.call(null,map__134481__$1,new cljs.core.Keyword("request","id","request/id",1829218213));
var node = cljs.core.get.call(null,map__134481__$1,new cljs.core.Keyword(null,"node","node",581201198));
var duration = cljs.core.get.call(null,map__134481__$1,new cljs.core.Keyword(null,"duration","duration",1444101068));
var complete_QMARK_ = cljs.core.get.call(null,map__134481__$1,new cljs.core.Keyword(null,"complete?","complete?",-892991879));
return cljs.core.with_meta(new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.items-center.pv1.pl3.hover-bg-light-silver.monospace.b--black-05","div.flex.items-center.pv1.pl3.hover-bg-light-silver.monospace.b--black-05",-1356171930),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"on-click","on-click",1632826543),(cljs.core.truth_(node)?((function (map__134481,map__134481__$1,event,request_id,node,duration,complete_QMARK_){
return (function (){
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"follow","follow",-809317662),node], null));
});})(map__134481,map__134481__$1,event,request_id,node,duration,complete_QMARK_))
:null),new cljs.core.Keyword(null,"class","class",-2030961996),[(cljs.core.truth_(node)?"pointer ":null),(((i === (0)))?null:"bt "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(class$)].join(''),new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"font-size","font-size",-1847940346),(12),new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),(26),new cljs.core.Keyword(null,"padding-right","padding-right",-1250249681),(21)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.flex-auto.lh-copy","div.flex.flex-auto.lh-copy",-2131021353),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex-auto","div.flex-auto",-1435035172),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1394872991),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.run_label,event], null)," "], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.log_event__GT_entry,cljs.core.dissoc.call(null,event,new cljs.core.Keyword(null,"timestamp","timestamp",579478971))], null)], null),(cljs.core.truth_(duration)?new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.black-40.tr.tnum.ml3.nowrap","span.black-40.tr.tnum.ml3.nowrap",-1081400763),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"font-size","font-size",-1847940346),(10),new cljs.core.Keyword(null,"width","width",-384071477),(60),new cljs.core.Keyword(null,"margin-top","margin-top",392161226),(2)], null)], null),goog.string.format("%.3fs",(duration / (1000)))], null):null)], null)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key","key",-1516042587),["runner-log-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(i)].join('')], null));
});
com.nextjournal.editor.article.status.on_outside_click = (function com$nextjournal$editor$article$status$on_outside_click(dom_id,on_close,event){
if(((cljs.core.not.call(null,com.nextjournal.editor.util.dom_closest.call(null,event.target,["#",cljs.core.str.cljs$core$IFn$_invoke$arity$1(dom_id)].join('')))) && (cljs.core.not.call(null,com.nextjournal.editor.util.dom_closest.call(null,event.target,["#toggle-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(dom_id)].join('')))))){
event.stopPropagation();
return on_close.call(null);
} else {
return null;
}
});
com.nextjournal.editor.article.status.log_popover = (function com$nextjournal$editor$article$status$log_popover(p__134495,dom_id,log_open_QMARK_,notifications_popover_open_QMARK_){
var map__134496 = p__134495;
var map__134496__$1 = (((((!((map__134496 == null))))?(((((map__134496.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134496.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134496):map__134496);
var runner_log = cljs.core.get.call(null,map__134496__$1,new cljs.core.Keyword(null,"runner-log","runner-log",-1012616002));
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.popover.view,cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"arrow","arrow",1071351425),new cljs.core.Keyword(null,"layout-class","layout-class",-663665917),new cljs.core.Keyword(null,"on-close","on-close",-761178394),new cljs.core.Keyword(null,"arrow-style","arrow-style",-1573298546),new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"close-on-outside-click?","close-on-outside-click?",-2030567500),new cljs.core.Keyword(null,"open?","open?",1238443125),new cljs.core.Keyword(null,"position","position",-2011731912)],[null,"runner-popover",((function (map__134496,map__134496__$1,runner_log){
return (function (){
return cljs.core.reset_BANG_.call(null,log_open_QMARK_,false);
});})(map__134496,map__134496__$1,runner_log))
,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"left","left",-399115937),(24)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),(-9),new cljs.core.Keyword(null,"position","position",-2011731912),"fixed"], null),dom_id,false,cljs.core.deref.call(null,log_open_QMARK_),((function (map__134496,map__134496__$1,runner_log){
return (function (p1__134491_SHARP_){
return com.nextjournal.editor.components.ui.positioning.to_fixed_el.call(null,["#",cljs.core.str.cljs$core$IFn$_invoke$arity$1(dom_id)].join(''),p1__134491_SHARP_,com.nextjournal.editor.components.ui.positioning.attachment.call(null,new cljs.core.Keyword(null,"bottom-left","bottom-left",1607421488),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"offset","offset",296498311),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),(29)], null)], null)));
});})(map__134496,map__134496__$1,runner_log))
]),cljs.core.with_meta(new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.sans-serif.flex-column","div.sans-serif.flex-column",-1002686468),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"ref","ref",1289896967),((function (map__134496,map__134496__$1,runner_log){
return (function (p1__134492_SHARP_){
if(cljs.core.truth_(p1__134492_SHARP_)){
return p1__134492_SHARP_.style.width = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(document.getElementById("status-bar").offsetWidth),"px"].join('');
} else {
return null;
}
});})(map__134496,map__134496__$1,runner_log))
], null),(function (){var notifications_form = cljs.core.assoc.call(null,com.nextjournal.journal.form.construct.call(null,new cljs.core.Keyword("com.nextjournal.journal.form.notifications","notification-settings","com.nextjournal.journal.form.notifications/notification-settings",-14003804),cljs.core.PersistentArrayMap.EMPTY),new cljs.core.Keyword(null,"inline?","inline?",-1674483791),true);
var current_setting = (function (){var temp__5733__auto__ = new cljs.core.Keyword("person","notification-settings","person/notification-settings",1786551819).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,re_frame.core.subscribe.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"current-person","current-person",1723841966)], null))));
if(cljs.core.truth_(temp__5733__auto__)){
var setting = temp__5733__auto__;
return cljs.core.name.call(null,setting);
} else {
return "off";
}
})();
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.runner-notifications.flex.items-center","div.runner-notifications.flex.items-center",800483630),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"display","display",242065432),"none"], null)], null),com.nextjournal.journal.form.render.call(null,notifications_form)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.f7.flex-auto.lh-copy","div.f7.flex-auto.lh-copy",459022303),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1394872991),"Show notification when run completes"], null)], null),(function (){var choices = new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"value","value",305978217),"off",new cljs.core.Keyword(null,"label","label",1718410804),"Off",new cljs.core.Keyword(null,"index","index",-1531685915),(0)], null),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"value","value",305978217),"in-background",new cljs.core.Keyword(null,"label","label",1718410804),"When tab is in background",new cljs.core.Keyword(null,"short-label","short-label",-303224557),"Tab in Background",new cljs.core.Keyword(null,"index","index",-1531685915),(1)], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"value","value",305978217),"always-on",new cljs.core.Keyword(null,"label","label",1718410804),"Always",new cljs.core.Keyword(null,"index","index",-1531685915),(2)], null)], null);
return new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.items-center.b.f7.teal.dim.pointer","div.flex.items-center.b.f7.teal.dim.pointer",1721812611),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (choices,notifications_form,current_setting,map__134496,map__134496__$1,runner_log){
return (function (){
return cljs.core.reset_BANG_.call(null,notifications_popover_open_QMARK_,true);
});})(choices,notifications_form,current_setting,map__134496,map__134496__$1,runner_log))
,new cljs.core.Keyword(null,"id","id",-1388402092),"notification-style-popover"], null),(function (){var c = cljs.core.first.call(null,cljs.core.filter.call(null,((function (choices,notifications_form,current_setting,map__134496,map__134496__$1,runner_log){
return (function (p1__134493_SHARP_){
return cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(p1__134493_SHARP_),current_setting);
});})(choices,notifications_form,current_setting,map__134496,map__134496__$1,runner_log))
,choices));
var or__88041__auto__ = new cljs.core.Keyword(null,"short-label","short-label",-303224557).cljs$core$IFn$_invoke$arity$1(c);
if(cljs.core.truth_(or__88041__auto__)){
return or__88041__auto__;
} else {
return new cljs.core.Keyword(null,"label","label",1718410804).cljs$core$IFn$_invoke$arity$1(c);
}
})(),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.icon.view,"ChevronDown",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"size","size",1098693007),(16),new cljs.core.Keyword(null,"class","class",-2030961996),"fill-teal"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.autocompleter.view,new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"open?","open?",1238443125),cljs.core.deref.call(null,notifications_popover_open_QMARK_),new cljs.core.Keyword(null,"position","position",-2011731912),((function (choices,notifications_form,current_setting,map__134496,map__134496__$1,runner_log){
return (function (p1__134494_SHARP_){
return com.nextjournal.editor.components.ui.positioning.to_el.call(null,"#notification-style-popover",p1__134494_SHARP_,com.nextjournal.editor.components.ui.positioning.attachment.call(null,new cljs.core.Keyword(null,"bottom-center","bottom-center",1844600634),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"offset","offset",296498311),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),(-7)], null)], null)));
});})(choices,notifications_form,current_setting,map__134496,map__134496__$1,runner_log))
,new cljs.core.Keyword(null,"arrow","arrow",1071351425),"top",new cljs.core.Keyword(null,"selected-value","selected-value",-81904500),current_setting,new cljs.core.Keyword(null,"on-complete","on-complete",-1531183971),((function (choices,notifications_form,current_setting,map__134496,map__134496__$1,runner_log){
return (function (value){
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"request-notification-permission","request-notification-permission",257642008),((function (choices,notifications_form,current_setting,map__134496,map__134496__$1,runner_log){
return (function (){
if(cljs.core._EQ_.call(null,"granted",Notification.permission)){
com.nextjournal.journal.form.notifications.submit_BANG_.call(null,notifications_form,"notifications",value);
} else {
}
cljs.core.reset_BANG_.call(null,log_open_QMARK_,true);
return cljs.core.reset_BANG_.call(null,notifications_popover_open_QMARK_,false);
});})(choices,notifications_form,current_setting,map__134496,map__134496__$1,runner_log))
], null));
});})(choices,notifications_form,current_setting,map__134496,map__134496__$1,runner_log))
,new cljs.core.Keyword(null,"on-cancel","on-cancel",-2071892932),((function (choices,notifications_form,current_setting,map__134496,map__134496__$1,runner_log){
return (function (){
cljs.core.reset_BANG_.call(null,log_open_QMARK_,true);
return cljs.core.reset_BANG_.call(null,notifications_popover_ifications_form,current_setting,map__134483,map__134483__$1,runner_log))
,new cljs.core.Keyword(null,"popover-id","popover-id",-36949681),"notification-style",new cljs.core.Keyword(null,"choices","choices",1385611597),choices], null)], null)], null);
})()], null);
})(),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.runner-log","div.runner-log",-1800407685),cljs.core.apply.call(null,cljs.core.list,new cljs.core.Keyword(null,"log-entries","log-entries",-1767369922).cljs$core$IFn$_invoke$arity$1(cljs.core.reduce.call(null,((function (map__134483,map__134483__$1,runner_log){
return (function (p__134498,p__134499){
var map__134500 = p__134498;
var map__134500__$1 = (((((!((map__134500 == null))))?(((((map__134500.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134500.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134500):map__134500);
var log_entries = cljs.core.get.call(null,map__134500__$1,new cljs.core.Keyword(null,"log-entries","log-entries",-1767369922));
var i = cljs.core.get.call(null,map__134500__$1,new cljs.core.Keyword(null,"i","i",-1386841315));
var last_request_id = cljs.core.get.call(null,map__134500__$1,new cljs.core.Keyword(null,"last-request-id","last-request-id",1758040734));
var class$ = cljs.core.get.call(null,map__134500__$1,new cljs.core.Keyword(null,"class","class",-2030961996));
var map__134501 = p__134499;
var map__134501__$1 = (((((!((map__134501 == null))))?(((((map__134501.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134501.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134501):map__134501);
var event = map__134501__$1;
var request_id = cljs.core.get.call(null,map__134501__$1,new cljs.core.Keyword("request","id","request/id",1829218213));
var css_class = "bg-teal-transparent ";
var class$__$1 = ((cljs.core._EQ_.call(null,last_request_id,request_id))?class$:((cljs.core._EQ_.call(null,"",class$))?css_class:""));
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"log-entries","log-entries",-1767369922),cljs.core.conj.call(null,log_entries,com.nextjournal.editor.article.status.log_entry.call(null,i,class$__$1,event)),new cljs.core.Keyword(null,"i","i",-1386841315),(i + (1)),new cljs.core.Keyword(null,"class","class",-2030961996),class$__$1,new cljs.core.Keyword(null,"last-request-id","last-request-id",1758040734),request_id], null);
});})(map__134483,map__134483__$1,runner_log))
,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"i","i",-1386841315),(0),new cljs.core.Keyword(null,"log-entries","log-entries",-1767369922),cljs.core.PersistentVector.EMPTY,new cljs.core.Keyword(null,"class","class",-2030961996),""], null),runner_log)))], null)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key","key",-1516042587),"runner-log"], null))], null);
});
com.nextjournal.editor.article.status.dropdown_view = (function com$nextjournal$editor$article$status$dropdown_view(p__134507){
var map__134508 = p__134507;
var map__134508__$1 = (((((!((map__134508 == null))))?(((((map__134508.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134508.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134508):map__134508);
var id = cljs.core.get.call(null,map__134508__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
var class$ = cljs.core.get.call(null,map__134508__$1,new cljs.core.Keyword(null,"class","class",-2030961996));
var style = cljs.core.get.call(null,map__134508__$1,new cljs.core.Keyword(null,"style","style",-496642736));
var arrow = cljs.core.get.call(null,map__134508__$1,new cljs.core.Keyword(null,"arrow","arrow",1071351425),"top");
var autocompleter_style = cljs.core.get.call(null,map__134508__$1,new cljs.core.Keyword(null,"autocompleter-style","autocompleter-style",723089225));
var popover_style = cljs.core.get.call(null,map__134508__$1,new cljs.core.Keyword(null,"popover-style","popover-style",156926651));
var position = cljs.core.get.call(null,map__134508__$1,new cljs.core.Keyword(null,"position","position",-2011731912));
var open_QMARK_ = reagent.core.atom.call(null,false);
var dom_id = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(id),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.gensym.call(null))].join('');
var on_outside_click = cljs.core.partial.call(null,com.nextjournal.editor.article.status.on_outside_click,dom_id,((function (open_QMARK_,dom_id,map__134508,map__134508__$1,id,class$,style,arrow,autocompleter_style,popover_style,position){
return (function (){
return cljs.core.reset_BANG_.call(null,open_QMARK_,false);
});})(open_QMARK_,dom_id,map__134508,map__134508__$1,id,class$,style,arrow,autocompleter_style,popover_style,position))
);
return ((function (open_QMARK_,dom_id,on_outside_click,map__134508,map__134508__$1,id,class$,style,arrow,autocompleter_style,popover_style,position){
return (function (p__134541){
var map__134542 = p__134541;
var map__134542__$1 = (((((!((map__134542 == null))))?(((((map__134542.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134542.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134542):map__134542);
var id__$1 = cljs.core.get.call(null,map__134542__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
var button = cljs.core.get.call(null,map__134542__$1,new cljs.core.Keyword(null,"button","button",1456579943));
var choices = cljs.core.get.call(null,map__134542__$1,new cljs.core.Keyword(null,"choices","choices",1385611597));
var shortcut = cljs.core.get.call(null,map__134542__$1,new cljs.core.Keyword(null,"shortcut","shortcut",-431647697));
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"class","class",-2030961996),[(cljs.core.truth_(cljs.core.deref.call(null,open_QMARK_))?"dropdown-open ":null),cljs.core.str.cljs$core$IFn$_invoke$arity$1(class$)].join(''),new cljs.core.Keyword(null,"style","style",-496642736),style,new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (map__134542,map__134542__$1,id__$1,button,choices,shortcut,open_QMARK_,dom_id,on_outside_click,map__134508,map__134508__$1,id,class$,style,arrow,autocompleter_style,popover_style,position){
return (function (){
return cljs.core.reset_BANG_.call(null,open_QMARK_,cljs.core.not.call(null,cljs.core.deref.call(null,open_QMARK_)));
});})(map__134542,map__134542__$1,id__$1,button,choices,shortcut,open_QMARK_,dom_id,on_outside_click,map__134508,map__134508__$1,id,class$,style,arrow,autocompleter_style,popover_style,position))
,new cljs.core.Keyword(null,"id","id",-1388402092),["toggle-",dom_id].join(''),new cljs.core.Keyword(null,"ref","ref",1289896967),((function (map__134542,map__134542__$1,id__$1,button,choices,shortcut,open_QMARK_,dom_id,on_outside_click,map__134508,map__134508__$1,id,class$,style,arrow,autocompleter_style,popover_style,position){
return (function (el){
if(cljs.core.truth_(el)){
document.addEventListener("click",on_outside_click);
var temp__5735__auto__ = shortcut;
if(cljs.core.truth_(temp__5735__auto__)){
var map__134546 = temp__5735__auto__;
var map__134546__$1 = (((((!((map__134546 == null))))?(((((map__134546.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134546.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134546):map__134546);
var binding = cljs.core.get.call(null,map__134546__$1,new cljs.core.Keyword(null,"binding","binding",539932593));
var name = cljs.core.get.call(null,map__134546__$1,new cljs.core.Keyword(null,"name","name",1843675177));
return keybind.core.bind_BANG_.call(null,binding,name,((function (map__134546,map__134546__$1,binding,name,temp__5735__auto__,map__134542,map__134542__$1,id__$1,button,choices,shortcut,open_QMARK_,dom_id,on_outside_click,map__1345RK_,dom_id,on_outside_click,map__134525,map__134525__$1,id,class$,style,arrow,autocompleter_style,popover_style,position){
return (function (){
return cljs.core.reset_BANG_.call(null,open_QMARK_,true);
});})(map__134552,map__134552__$1,binding,name,temp__5735__auto__,map__134531,map__134531__$1,id__$1,button,choices,shortcut,open_QMARK_,dom_id,on_outside_click,map__134525,map__134525__$1,id,class$,style,arrow,autocompleter_style,popover_style,position))
);
} else {
return null;
}
} else {
return document.removeEventListener("click",on_outside_click);
}
});})(map__134531,map__134531__$1,id__$1,button,choices,shortcut,open_QMARK_,dom_id,on_outside_click,map__134525,map__134525__$1,id,class$,style,arrow,autocompleter_style,popover_style,position))
], null),button,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.autocompleter.view,cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"arrow","arrow",1071351425),new cljs.core.Keyword(null,"on-close","on-close",-761178394),new cljs.core.Keyword(null,"choices","choices",1385611597),new cljs.core.Keyword(null,"arrow-style","arrow-style",-1573298546),new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"close-on-outside-click?","close-on-outside-click?",-2030567500),new cljs.core.Keyword(null,"open?","open?",1238443125),new cljs.core.Keyword(null,"position","position",-2011731912),new cljs.core.Keyword(null,"popover-style","popover-style",156926651),new cljs.core.Keyword(null,"on-cancel","on-cancel",-2071892932),new cljs.core.Keyword(null,"on-complete","on-complete",-1531183971)],[arrow,((function (map__134531,map__134531__$1,id__$1,button,choices,shortcut,open_QMARK_,dom_id,on_outside_click,map__134525,map__134525__$1,id,class$,style,arrow,autocompleter_style,popover_style,position){
return (function (){
return cljs.core.reset_BANG_.call(null,open_QMARK_,false);
});})(map__134531,map__134531__$1,id__$1,button,choices,shortcut,open_QMARK_,dom_id,on_outside_click,map__134525,map__134525__$1,id,class$,style,arrow,autocompleter_style,popover_style,position))
,choices,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"left","left",-399115937),(24)], null),cljs.core.merge.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"z-index","z-index",1892827090),(1001)], null),autocompleter_style),dom_id,false,cljs.core.deref.call(null,open_QMARK_),(function (){var or__88041__auto__ = position;
if(cljs.core.truth_(or__88041__auto__)){
return or__88041__auto__;
} else {
return ((function (or__88041__auto__,map__134531,map__134531__$1,id__$1,button,choices,shortcut,open_QMARK_,dom_id,on_outside_click,map__134525,map__134525__$1,id,class$,style,arrow,autocompleter_style,popover_style,position){
return (function (p1__134522_SHARP_){
return com.nextjournal.editor.components.ui.positioning.to_fixed_el.call(null,["#toggle-",dom_id].join(''),p1__134522_SHARP_,com.nextjournal.editor.components.ui.positioning.attachment.call(null,new cljs.core.Keyword(null,"bottom-left","bottom-left",1607421488)));
});
;})(or__88041__auto__,map__134531,map__134531__$1,id__$1,button,choices,shortcut,open_QMARK_,dom_id,on_outside_click,map__134525,map__134525__$1,id,class$,style,arrow,autocompleter_style,popover_style,position))
}
})(),popover_style,((function (map__134531,map__134531__$1,id__$1,button,choices,shortcut,open_QMARK_,dom_id,on_outside_click,map__134525,map__134525__$1,id,class$,style,arrow,autocompleter_style,popover_style,position){
return (function (){
return cljs.core.reset_BANG_.call(null,open_QMARK_,false);
});})(map__134531,map__134531__$1,id__$1,button,choices,shortcut,open_QMARK_,dom_id,on_outside_click,map__134525,map__134525__$1,id,class$,style,arrow,autocompleter_style,popover_style,position))
,((function (map__134531,map__134531__$1,id__$1,button,choices,shortcut,open_QMARK_,dom_id,on_outside_click,map__134525,map__134525__$1,id,class$,style,arrow,autocompleter_style,popover_style,position){
return (function (p1__134523_SHARP_){
p1__134523_SHARP_.call(null);
return cljs.core.reset_BANG_.call(null,open_QMARK_,false);
});})(map__134531,map__134531__$1,id__$1,button,choices,shortcut,open_QMARK_,dom_id,on_outside_click,map__134525,map__134525__$1,id,class$,style,arrow,autocompleter_style,popover_style,position))
])], null)], null);
});
;})(open_QMARK_,dom_id,on_outside_click,map__134525,map__134525__$1,id,class$,style,arrow,autocompleter_style,popover_style,position))
});
com.nextjournal.editor.article.status.run_shortcut = [com.nextjournal.journal.views.helpers.cmd,"Enter"].join('');
com.nextjournal.editor.article.status.run_PLUS_go_to_next_shortcut = [com.nextjournal.journal.views.helpers.shift," Enter"].join('');
com.nextjournal.editor.article.status.run_all_in_runtime_shortcut = [com.nextjournal.journal.views.helpers.shift,com.nextjournal.journal.views.helpers.cmd,"Enter"].join('');
com.nextjournal.editor.article.status.restart_runtime_shortcut = [com.nextjournal.journal.views.helpers.shift,com.nextjournal.journal.views.helpers.cmd,"R"].join('');
com.nextjournal.editor.article.status.reset_runtime_shortcut = [com.nextjournal.journal.views.helpers.shift,com.nextjournal.journal.views.helpers.cmd,"K"].join('');
com.nextjournal.editor.article.status.run_all_shortcut = [com.nextjournal.journal.views.helpers.alt,com.nextjournal.journal.views.helpers.cmd,"Enter"].join('');
com.nextjournal.editor.article.status.run_options_shortcut = [com.nextjournal.journal.views.helpers.cmd,"Enter"].join('');
com.nextjournal.editor.article.status.runner_choices = (function com$nextjournal$editor$article$status$runner_choices(p__134554){
var map__134555 = p__134554;
var map__134555__$1 = (((((!((map__134555 == null))))?(((((map__134555.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134555.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134555):map__134555);
var cell_id = cljs.core.get.call(null,map__134555__$1,new cljs.core.Keyword(null,"cell-id","cell-id",1789875608));
var runtime_id = cljs.core.get.call(null,map__134555__$1,new cljs.core.Keyword(null,"runtime-id","runtime-id",2075495517));
var runner_status = cljs.core.get.call(null,map__134555__$1,new cljs.core.Keyword(null,"runner-status","runner-status",-259479044));
var runner_stopped_QMARK_ = (function (){var or__88041__auto__ = clojure.string.blank_QMARK_.call(null,runner_status);
if(or__88041__auto__){
return or__88041__auto__;
} else {
return new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"stopping","stopping",1036724975),null,new cljs.core.Keyword(null,"stopped","stopped",-1490414640),null], null), null).call(null,runner_status);
}
})();
var runtime = com.nextjournal.graph.link.resolve.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"runtime","runtime",-1331573996),runtime_id], null));
var runtime_name = (cljs.core.truth_(runtime_id)?com.nextjournal.editor.components.ui.runtime.runtime_name_with_badge.call(null,runtime):null);
var exec_state = (cljs.core.truth_(runtime_id)?(function (){var or__88041__auto__ = new cljs.core.Keyword(null,"state","state",-1988618099).cljs$core$IFn$_invoke$arity$1(runtime);
if(cljs.core.truth_(or__88041__auto__)){
return or__88041__auto__;
} else {
return cljs.core.deref.call(null,re_frame.core.subscribe.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"runtime-state","runtime-state",-1315052366),runtime_id], null)));
}
})():null);
return cljs.core.doall.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 8, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"label","label",1718410804),"Run Cell",new cljs.core.Keyword(null,"shortcut","shortcut",-431647697),com.nextjournal.editor.article.status.run_shortcut,new cljs.core.Keyword(null,"disabled?","disabled?",-1523234181),cljs.core.not.call(null,cell_id),new cljs.core.Keyword(null,"value","value",305978217),((function (runner_stopped_QMARK_,runtime,runtime_name,exec_state,map__134555,map__134555__$1,cell_id,runtime_id,runner_status){
return (function (){
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"run","run",-1821166653),cell_id], null));
});})(runner_stopped_QMARK_,runtime,runtime_name,exec_state,map__134555,map__134555__$1,cell_id,runtime_id,runner_status))
], null),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"label","label",1718410804),"Run Cell and Go To Next",new cljs.core.Keyword(null,"shortcut","shortcut",-431647697),com.nextjournal.editor.article.status.run_PLUS_go_to_next_shortcut,new cljs.core.Keyword(null,"disabled?","disabled?",-1523234181),cljs.core.not.call(null,cell_id),new cljs.core.Keyword(null,"value","value",305978217),((function (runner_stopped_QMARK_,runtime,runtime_name,exec_state,map__134555,map__134555__$1,cell_id,runtime_id,runner_status){
return (function (){
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"run+go-to-next","run+go-to-next",403075953),cell_id], null));
});})(runner_stopped_QMARK_,runtime,runtime_name,exec_state,map__134555,map__134555__$1,cell_id,runtime_id,runner_status))
], null),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"label","label",1718410804),["Run all in ",(function (){var or__88041__auto__ = runtime_name;
if(cljs.core.truth_(or__88041__auto__)){
return or__88041__auto__;
} else {
return "Runtime";
}
})()].join(''),new cljs.core.Keyword(null,"shortcut","shortcut",-431647697),com.nextjournal.editor.article.status.run_all_in_runtime_shortcut,new cljs.core.Keyword(null,"disabled?","disabled?",-1523234181),cljs.core.not.call(null,runtime_id),new cljs.core.Keyword(null,"value","value",305978217),((function (runner_stopped_QMARK_,runtime,runtime_name,exec_state,map__134555,map__134555__$1,cell_id,runtime_id,runner_status){
return (function (){
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"run","run",-1821166653),runtime_id], null));
});})(runner_stopped_QMARK_,runtime,runtime_name,exec_state,map__134555,map__134555__$1,cell_id,runtime_id,runner_status))
], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1718410804),"Run all",new cljs.core.Keyword(null,"shortcut","shortcut",-431647697),com.nextjournal.editor.article.status.run_all_shortcut,new cljs.core.Keyword(null,"value","value",305978217),((function (runner_stopped_QMARK_,runtime,runtime_name,exec_state,map__134555,map__134555__$1,cell_id,runtime_id,runner_status){
return (function (){
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"run","run",-1821166653)], null));
});})(runner_stopped_QMARK_,runtime,runtime_name,exec_state,map__134555,map__134555__$1,cell_id,runtime_id,runner_status))
], null),new cljs.core.Keyword(null,"separator","separator",-1628749125),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1718410804),"Stop Execution",new cljs.core.Keyword(null,"disabled?","disabled?",-1523234181),(function (){var or__88041__auto__ = (runner_status == null);
if(or__88041__auto__){
return or__88041__auto__;
} else {
return new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"ready","ready",1086465795),null,new cljs.core.Keyword(null,"stopped","stopped",-1490414640),null], null), null).call(null,runner_status);
}
})(),new cljs.core.Keyword(null,"value","value",305978217),((function (runner_stopped_QMARK_,runtime,runtime_name,exec_state,map__134555,map__134555__$1,cell_id,runtime_id,runner_status){
return (function (){
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"booting","booting",-1345777253),runner_status)){
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"shutdown-runner","shutdown-runner",1275037514)], null));
} else {
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stop-execution","stop-execution",1978950059)], null));
}
});})(runner_stopped_QMARK_,runtime,runtime_name,exec_state,map__134555,map__134555__$1,cell_id,runtime_id,runner_status))
], null),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"label","label",1718410804),["Restart ",(function (){var or__88041__auto__ = runtime_name;
if(cljs.core.truth_(or__88041__auto__)){
return or__88041__auto__;
} else {
return "Runtime";
}
})()].join(''),new cljs.core.Keyword(null,"hint","hint",439639918),"Keep filesystem state",new cljs.core.Keyword(null,"disabled?","disabled?",-1523234181),((cljs.core.not.call(null,runtime_id)) || (cljs.core._EQ_.call(null,exec_state,"stopped")) || (cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"language","language",-1591107564).cljs$core$IFn$_invoke$arity$1(runtime),"bash"))),new cljs.core.Keyword(null,"shortcut","shortcut",-431647697),com.nextjournal.editor.article.status.restart_runtime_shortcut,new cljs.core.Keyword(null,"value","value",305978217),((function (runner_stopped_QMARK_,runtime,runtime_name,exec_state,map__134555,map__134555__$1,cell_id,runtime_id,runner_status){
return (function (){
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"restart-runtime","restart-runtime",-129921839),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"node-id","node-id",779482292),runtime_id], null)], null));
});})(runner_stopped_QMARK_,runtime,runtime_name,exec_state,map__134555,map__134555__$1,cell_id,runtime_id,runner_status))
], null),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"label","label",1718410804),["Reset ",(function (){var or__88041__auto__ = runtime_name;
if(cljs.core.truth_(or__88041__auto__)){
return or__88041__auto__;
} else {
return "Runtime";
}
})()].join(''),new cljs.core.Keyword(null,"hint","hint",439639918),"Process and filesystem state",new cljs.core.Keyword(null,"disabled?","disabled?",-1523234181),((cljs.core.not.call(null,runtime_id)) || (cljs.core._EQ_.call(null,exec_state,"stopped"))),new cljs.core.Keyword(null,"shortcut","shortcut",-431647697),com.nextjournal.editor.article.status.reset_runtime_shortcut,new cljs.core.Keyword(null,"value","value",305978217),((function (runner_stopped_QMARK_,runtime,runtime_name,exec_state,map__134555,map__134555__$1,cell_id,runtime_id,runner_status){
return (function (){
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"reset-runtime","reset-runtime",1374136773),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"node-id","node-id",779482292),runtime_id], null)], null));
});})(runner_stopped_QMARK_,runtime,runtime_name,exec_state,map__134555,map__134555__$1,cell_id,runtime_id,runner_status))
], null)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Reset All",new cljs.core.Keyword(null,"value","value",305978217),((function (runner_stopped_QMARK_,runtime,runtime_name,exec_state,map__134555,map__134555__$1,cell_id,runtime_id,runner_status){
return (function (){
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"reset-runtime","reset-runtime",1374136773),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"reset-all?","reset-all?",54795625),true], null)], null));
});})(runner_stopped_QMARK_,runtime,runtime_name,exec_state,map__134555,map__134555__$1,cell_id,runtime_id,runner_status))
], null)], null),(cljs.core.truth_(com.nextjournal.editor.config.feature_enabled_QMARK_.call(null,"checkpoints"))?(function (){var G__134557 = new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"separator","separator",-1628749125)], null);
var G__134557__$1 = ((cljs.core.not.call(null,runner_stopped_QMARK_))?cljs.core.conj.call(null,G__134557,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Save Session",new cljs.core.Keyword(null,"value","value",305978217),((function (G__134557,runner_stopped_QMARK_,runtime,runtime_name,exec_state,map__134555,map__134555__$1,cell_id,runtime_id,runner_status){
return (function (){
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"checkpoint-runtime","checkpoint-runtime",1550185168),null], null));
});})(G__134557,runner_stopped_QMARK_,runtime,runtime_name,exec_state,map__134555,map__134555__$1,cell_id,runtime_id,runner_status))
], null)):G__134557);
return cljs.core.conj.call(null,G__134557__$1,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Restore All Runtimes",new cljs.core.Keyword(null,"value","value",305978217),((function (G__134557,G__134557__$1,runner_stopped_QMARK_,runtime,runtime_name,exec_state,map__134555,map__134555__$1,cell_id,runtime_id,runner_status){
return (function (){
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"restore-runtime","restore-runtime",-2098476406),null], null));
});})(G__134557,G__134557__$1,runner_stopped_QMARK_,runtime,runtime_name,exec_state,map__134555,map__134555__$1,cell_id,runtime_id,runner_status))
], null));
})():null),(cljs.core.truth_(runner_stopped_QMARK_)?null:new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"separator","separator",-1628749125),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),((((clojure.string.blank_QMARK_.call(null,runner_status)) || (cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"scheduling","scheduling",69053604),runner_status))))?"Cancel Scheduling":"Shutdown Runner"),new cljs.core.Keyword(null,"value","value",305978217),((function (runner_stopped_QMARK_,runtime,runtime_name,exec_state,map__134555,map__134555__$1,cell_id,runtime_id,runner_status){
return (function (){
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"shutdown-runner","shutdown-runner",1275037514)], null));
});})(runner_stopped_QMARK_,runtime,runtime_name,exec_state,map__134555,map__134555__$1,cell_id,runtime_id,runner_status))
], null)], null))));
});
com.nextjournal.editor.article.status.run_controls = (function com$nextjournal$editor$article$status$run_controls(p__134568){
var map__134570 = p__134568;
var map__134570__$1 = (((((!((map__134570 == null))))?(((((map__134570.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134570.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134570):map__134570);
var s = map__134570__$1;
var status = cljs.core.get.call(null,map__134570__$1,new cljs.core.Keyword(null,"status","status",-1997798413));
var runtimes = cljs.core.get.call(null,map__134570__$1,new cljs.core.Keyword(null,"runtimes","runtimes",-1735270339));
var log = cljs.core.deref.call(null,re_frame.core.subscribe.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"runner-log","runner-log",-1012616002)], null)));
var runner_status = new cljs.core.Keyword(null,"state","state",-1988618099).cljs$core$IFn$_invoke$arity$1(cljs.core.first.call(null,cljs.core.filter.call(null,((function (log,map__134570,map__134570__$1,s,status,runtimes){
return (function (p1__134560_SHARP_){
return cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"kind","kind",-717265803).cljs$core$IFn$_invoke$arity$1(p1__134560_SHARP_),new cljs.core.Keyword(null,"runner","runner",1945441304));
});})(log,map__134570,map__134570__$1,s,status,runtimes))
,log)));
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.items-center","div.flex.items-center",-1537844053),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"class","class",-2030961996),"f7 black bg-white br2 pointer flex items-center relative",new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"height","height",1025178622),(24),new cljs.core.Keyword(null,"line-height","line-height",1870784992),(24),new cljs.core.Keyword(null,"box-shadow","box-shadow",1600206755),"0 1px 2px rgba(0,0,0,.2)"], null),new cljs.core.Keyword(null,"id","id",-1388402092),"run-controls-button"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.tooltip.view,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tip","tip",1221810860),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),"Run"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.extra","span.extra",582750390),com.nextjournal.editor.article.status.run_all_shortcut], null)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"button.nj-button--unstyled.flex.items-center","button.nj-button--unstyled.flex.items-center",-260085653),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding","padding",1660304693),"5px 5px 5px 7px"], null),new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (log,runner_status,map__134570,map__134570__$1,s,status,runtimes){
return (function (){
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"run","run",-1821166653)], null));
});})(log,runner_status,map__134570,map__134570__$1,s,status,runtimes))
,new cljs.core.Keyword(null,"data-testid","data-testid",102116723),"runall-button"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.icon.view,"RunAll",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"size","size",1098693007),(20),new cljs.core.Keyword(null,"class","class",-2030961996),"dim fill-teal"], null)], null)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.items-center","div.flex.items-center",-1537844053),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"i.bg-black-10","i.bg-black-10",614179383),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"width","width",-384071477),(1),new cljs.core.Keyword(null,"height","height",1025178622),(16)], null)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.dropdown_view,new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"class","class",-2030961996),"",new cljs.core.Keyword(null,"style","style",-496642736),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"arrow","arrow",1071351425),false,new cljs.core.Keyword(null,"position","position",-2011731912),((function (log,runner_status,map__134570,map__134570__$1,s,status,runtimes){
return (function (p1__134567_SHARP_){
return com.nextjournal.editor.components.ui.positioning.to_fixed_el.call(null,"#run-controls-button",p1__134567_SHARP_,com.nextjournal.editor.components.ui.positioning.attachment.call(null,new cljs.core.Keyword(null,"bottom-left","bottom-left",1607421488),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"offset","offset",296498311),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"x","x",2099068185),(5),new cljs.core.Keyword(null,"y","y",-1757859776),(20)], null)], null)));
});})(log,runner_status,map__134570,map__134570__$1,s,status,runtimes))
,new cljs.core.Keyword(null,"popover-style","popover-style",156926651),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),(-5),new cljs.core.Keyword(null,"margin-top","margin-top",392161226),(5),new cljs.core.Keyword(null,"position","position",-2011731912),"fixed"], null),new cljs.core.Keyword(null,"button","button",1456579943),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.tooltip.view,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tip","tip",1221810860),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.nowrap","div.nowrap",96985847),"Show run options"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.extra","span.extra",582750390),com.nextjournal.editor.article.status.run_options_shortcut], null)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"button.nj-button--unstyled.flex.item-center","button.nj-button--unstyled.flex.item-center",1314188207),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding","padding",1660304693),"5px 7px"], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.icon.view,"ChevronDown",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"size","size",1098693007),(12),new cljs.core.Keyword(null,"class","class",-2030961996),"o-50"], null)], null)], null)], null),new cljs.core.Keyword(null,"id","id",-1388402092),"run-controls",new cljs.core.Keyword(null,"choices","choices",1385611597),com.nextjournal.editor.article.status.runner_choices.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"runner-status","runner-status",-259479044),runner_status,new cljs.core.Keyword(null,"cell-id","cell-id",1789875608),cljs.core.deref.call(null,re_frame.core.subscribe.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"cell-id-to-run","cell-id-to-run",2310170)], null))),new cljs.core.Keyword(null,"runtime-id","runtime-id",2075495517),cljs.core.deref.call(null,re_frame.core.subscribe.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"runtime-id-to-run","runtime-id-to-run",1995195205)], null)))], null))], null)], null)], null)], null),(function (){var cancel_disabled_QMARK_ = (function (){var or__88041__auto__ = (runner_status == null);
if(or__88041__auto__){
return or__88041__auto__;
} else {
return new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"ready","ready",1086465795),null,new cljs.core.Keyword(null,"stopped","stopped",-1490414640),null], null), null).call(null,runner_status);
}
})();
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.tooltip.view,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tip","tip",1221810860),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.nowrap","div.nowrap",96985847),"Stop Execution"], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"class","class",-2030961996),["f7 black bg-white br2 ph2 flex items-center relative ml2 ",(cljs.core.truth_(cancel_disabled_QMARK_)?"o-70 ":"pointer ")].join(''),new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"height","height",1025178622),(24),new cljs.core.Keyword(null,"line-height","line-height",1870784992),"24px",new cljs.core.Keyword(null,"box-shadow","box-shadow",1600206755),"0 1px 2px rgba(0,0,0,.2)"], null),new cljs.core.Keyword(null,"id","id",-1388402092),"run-stop-button",new cljs.core.Keyword(null,"disabled","disabled",-1529784218),cancel_disabled_QMARK_,new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (cancel_disabled_QMARK_,log,runner_status,map__134570,map__134570__$1,s,status,runtimes){
return (function (){
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"booting","booting",-1345777253),runner_status)){
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"shutdown-runner","shutdown-runner",1275037514)], null));
} else {
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stop-execution","stop-execution",1978950059)], null));
}
});})(cancel_disabled_QMARK_,log,runner_status,map__134570,map__134570__$1,s,status,runtimes))
], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.flex.items-center","span.flex.items-center",-463750193),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.icon.view,"Stop",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"size","size",1098693007),(18),new cljs.core.Keyword(null,"class","class",-2030961996),"fill-teal"], null)], null)], null)], null)], null);
})()], null);
});
com.nextjournal.editor.article.status.published_view = (function com$nextjournal$editor$article$status$published_view(p__134616){
var map__134617 = p__134616;
var map__134617__$1 = (((((!((map__134617 == null))))?(((((map__134617.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134617.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134617):map__134617);
var url = cljs.core.get.call(null,map__134617__$1,new cljs.core.Keyword(null,"url","url",276297046));
var dismiss_timeout = (10000);
var on_dismiss = ((function (dismiss_timeout,map__134617,map__134617__$1,url){
return (function (){
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"reset-published","reset-published",-1720520619)], null));
});})(dismiss_timeout,map__134617,map__134617__$1,url))
;
var hovered_QMARK_ = reagent.core.atom.call(null,false);
var timeout = setTimeout(on_dismiss,dismiss_timeout);
var progress_props = new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"base-color","base-color",-1117474436),"rgba(255,255,255,.4)",new cljs.core.Keyword(null,"fill-color","fill-color",-1156875903),"#fff",new cljs.core.Keyword(null,"line-width","line-width",-906934988),(1),new cljs.core.Keyword(null,"duration","duration",1444101068),dismiss_timeout,new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"position","position",-2011731912),"absolute",new cljs.core.Keyword(null,"left","left",-399115937),(-4),new cljs.core.Keyword(null,"top","top",-1856271961),(-4)], null)], null);
return ((function (dismiss_timeout,on_dismiss,hovered_QMARK_,timeout,progress_props,map__134617,map__134617__$1,url){
return (function (){
return new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.items-center.white","div.flex.items-center.white",2146268985),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"on-mouse-enter","on-mouse-enter",-1664921661),((function (dismiss_timeout,on_dismiss,hovered_QMARK_,timeout,progress_props,map__134617,map__134617__$1,url){
return (function (){
if(cljs.core.truth_(cljs.core.deref.call(null,hovered_QMARK_))){
return null;
} else {
clearTimeout(timeout);
return cljs.core.reset_BANG_.call(null,hovered_QMARK_,true);
}
});})(dismiss_timeout,on_dismiss,hovered_QMARK_,timeout,progress_props,map__134617,map__134617__$1,url))
], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.mr1","span.mr1",-1835946972),"This notebook was published to:"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.tooltip.view,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"container-class","container-class",-1968115489),"di",new cljs.core.Keyword(null,"tip","tip",1221810860),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.nowrap","div.nowrap",96985847),"Open in new window"], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a.white.underline.mr3","a.white.underline.mr3",-1916453908),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"href","href",-793805698),url,new cljs.core.Keyword(null,"target","target",253001721),"_blank"], null),url], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.tooltip.view,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tip","tip",1221810860),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.nowrap","div.nowrap",96985847),"Hide"], null)], null),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"button.nj-button--unstyled.flex.items-center.relative","button.nj-button--unstyled.flex.items-center.relative",-2029592640),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"on-click","on-click",1632826543),on_dismiss], null),(cljs.core.truth_(cljs.core.deref.call(null,hovered_QMARK_))?cljs.core.with_meta(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.spinner.radial_progress,cljs.core.merge.call(null,progress_props,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"animating?","animating?",-333605094),false], null))], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key","key",-1516042587),"published-cancelled-dismiss"], null)):cljs.core.with_meta(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.spinner.radial_progress,progress_props], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key","key",-1516042587),"published-animating-dismiss"], null))),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.icon.view,"CheckmarkBold",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"size","size",1098693007),(12),new cljs.core.Keyword(null,"class","class",-2030961996),"fill-white"], null)], null)], null)], null)], null);
});
;})(dismiss_timeout,on_dismiss,hovered_QMARK_,timeout,progress_props,map__134617,map__134617__$1,url))
});
com.nextjournal.editor.article.status.active_duration_view = (function com$nextjournal$editor$article$status$active_duration_view(computation_started_at){
var duration = reagent.core.atom.call(null,(0));
var close_chan = cljs.core.async.chan.call(null);
return reagent.core.create_class.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"component-did-mount","component-did-mount",-1126910518),((function (duration,close_chan){
return (function (this$){
if(com.nextjournal.editor.config.ssr_QMARK_){
return null;
} else {
var start = computation_started_at;
var interval = (100);
var c__103438__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__103438__auto__,start,interval,duration,close_chan){
return (function (){
var f__103439__auto__ = (function (){var switch__103105__auto__ = ((function (c__103438__auto__,start,interval,duration,close_chan){
return (function (state_134655){
var state_val_134656 = (state_134655[(1)]);
if((state_val_134656 === (1))){
var state_134655__$1 = state_134655;
var statearr_134658_134733 = state_134655__$1;
(statearr_134658_134733[(2)] = null);
(statearr_134658_134733[(1)] = (2));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_134656 === (2))){
var inst_134631 = cljs.core.PersistentVector.EMPTY_NODE;
var inst_134633 = cljs.core.async.timeout.call(null,interval);
var inst_134634 = [close_chan,inst_134633];
var inst_134635 = (new cljs.core.PersistentVector(null,2,(5),inst_134631,inst_134634,null));
var state_134655__$1 = state_134655;
return cljs.core.async.ioc_alts_BANG_.call(null,state_134655__$1,(4),inst_134635);
} else {
if((state_val_134656 === (3))){
var inst_134653 = (state_134655[(2)]);
var state_134655__$1 = state_134655;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_134655__$1,inst_134653);
} else {
if((state_val_134656 === (4))){
var inst_134637 = (state_134655[(2)]);
var inst_134638 = cljs.core.nth.call(null,inst_134637,(0),null);
var inst_134639 = cljs.core.nth.call(null,inst_134637,(1),null);
var inst_134640 = cljs.core.not_EQ_.call(null,inst_134639,close_chan);
var state_134655__$1 = (function (){var statearr_134709 = state_134655;
(statearr_134709[(7)] = inst_134638);
return statearr_134709;
})();
if(inst_134640){
var statearr_134710_134735 = state_134655__$1;
(statearr_134710_134735[(1)] = (5));
} else {
var statearr_134711_134736 = state_134655__$1;
(statearr_134711_134736[(1)] = (6));
}
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_134656 === (5))){
var inst_134643 = Date.now();
var inst_134644 = (inst_134643 - start);
var inst_134646 = cljs.core.constantly.call(null,inst_134644);
var inst_134647 = cljs.core.swap_BANG_.call(null,duration,inst_134646);
var state_134655__$1 = (function (){var statearr_134712 = state_134655;
(statearr_134712[(8)] = inst_134647);
return statearr_134712;
})();
var statearr_134713_134737 = state_134655__$1;
(statearr_134713_134737[(2)] = null);
(statearr_134713_134737[(1)] = (2));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_134656 === (6))){
var state_134655__$1 = state_134655;
var statearr_134714_134738 = state_134655__$1;
(statearr_134714_134738[(2)] = null);
(statearr_134714_134738[(1)] = (7));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_134656 === (7))){
var inst_134651 = (state_134655[(2)]);
var state_134655__$1 = state_134655;
var statearr_134715_134739 = state_134655__$1;
(statearr_134715_134739[(2)] = inst_134651);
(statearr_134715_134739[(1)] = (3));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
});})(c__103438__auto__,start,interval,duration,close_chan))
;
return ((function (switch__103105__auto__,c__103438__auto__,start,interval,duration,close_chan){
return (function() {
var com$nextjournal$editor$article$status$active_duration_view_$_state_machine__103106__auto__ = null;
var com$nextjournal$editor$article$status$active_duration_view_$_state_machine__103106__auto____0 = (function (){
var statearr_134716 = [null,null,null,null,null,null,null,null,null];
(statearr_134716[(0)] = com$nextjournal$editor$article$status$active_duration_view_$_state_machine__103106__auto__);
(statearr_134716[(1)] = (1));
return statearr_134716;
});
var com$nextjournal$editor$article$status$active_duration_view_$_state_machine__103106__auto____1 = (function (state_134655){
while(true){
var ret_value__103107__auto__ = (function (){try{while(true){
var result__103108__auto__ = switch__103105__auto__.call(null,state_134655);
if(cljs.core.keyword_identical_QMARK_.call(null,result__103108__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__103108__auto__;
}
break;
}
}catch (e134717){if((e134717 instanceof Object)){
var ex__103109__auto__ = e134717;
var statearr_134718_134740 = state_134655;
(statearr_134718_134740[(5)] = ex__103109__auto__);
cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_134655);
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e134717;
}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__103107__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__134741 = state_134655;
state_134655 = G__134741;
continue;
} else {
return ret_value__103107__auto__;
}
break;
}
});
com$nextjournal$editor$article$status$active_duration_view_$_state_machine__103106__auto__ = function(state_134655){
switch(arguments.length){
case 0:
return com$nextjournal$editor$article$status$active_duration_view_$_state_machine__103106__auto____0.call(this);
case 1:
return com$nextjournal$editor$article$status$active_duration_view_$_state_machine__103106__auto____1.call(this,state_134655);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
com$nextjournal$editor$article$status$active_duration_view_$_state_machine__103106__auto__.cljs$core$IFn$_invoke$arity$0 = com$nextjournal$editor$article$status$active_duration_view_$_state_machine__103106__auto____0;
com$nextjournal$editor$article$status$active_duration_view_$_state_machine__103106__auto__.cljs$core$IFn$_invoke$arity$1 = com$nextjournal$editor$article$status$active_duration_view_$_state_machine__103106__auto____1;
return com$nextjournal$editor$article$status$active_duration_view_$_state_machine__103106__auto__;
})()
;})(switch__103105__auto__,c__103438__auto__,start,interval,duration,close_chan))
})();
var state__103440__auto__ = (function (){var statearr_134724 = f__103439__auto__.call(null);
(statearr_134724[(6)] = c__103438__auto__);
return statearr_134724;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__103440__auto__);
});})(c__103438__auto__,start,interval,duration,close_chan))
);
return c__103438__auto__;
}
});})(duration,close_chan))
,new cljs.core.Keyword(null,"component-will-unmount","component-will-unmount",-2058314698),((function (duration,close_chan){
return (function (this$){
return cljs.core.async.put_BANG_.call(null,close_chan,new cljs.core.Keyword(null,"stop","stop",-2140911342));
});})(duration,close_chan))
,new cljs.core.Keyword(null,"reagent-render","reagent-render",-985383853),((function (duration,close_chan){
return (function (_){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.tr.black-40.mr2","span.tr.black-40.mr2",156925187),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"font-size","font-size",-1847940346),(10),new cljs.core.Keyword(null,"width","width",-384071477),(60)], null)], null),goog.string.format("%.1f00s",(cljs.core.deref.call(null,duration) / (1000)))], null);
});})(duration,close_chan))
], null));
});
com.nextjournal.editor.article.status.errors_popover = (function com$nextjournal$editor$article$status$errors_popover(errors){
var open_QMARK_ = reagent.core.atom.call(null,false);
var close_on_outside_click = cljs.core.partial.call(null,com.nextjournal.editor.article.status.on_outside_click,"error-status",((function (open_QMARK_){
return (function (){
return cljs.core.reset_BANG_.call(null,open_QMARK_,false);
});})(open_QMARK_))
);
return ((function (open_QMARK_,close_on_outside_click){
return (function (errors__$1){
return new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"button.nj-button--unstyled.pointer.flex.monospace.items-center","button.nj-button--unstyled.pointer.flex.monospace.items-center",2129568496),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (open_QMARK_,close_on_outside_click){
return (function (){
return cljs.core.swap_BANG_.call(null,open_QMARK_,cljs.core.not);
});})(open_QMARK_,close_on_outside_click))
,new cljs.core.Keyword(null,"ref","ref",1289896967),((function (open_QMARK_,close_on_outside_click){
return (function (p1__134729_SHARP_){
if(cljs.core.truth_(p1__134729_SHARP_)){
return document.addEventListener("click",close_on_outside_click);
} else {
return document.removeEventListener("click",close_on_outside_click);
}
});})(open_QMARK_,close_on_outside_click))
,new cljs.core.Keyword(null,"id","id",-1388402092),"error-status"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.icon.view,"Error",new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"size","size",1098693007),(16),new cljs.core.Keyword(null,"class","class",-2030961996),"fill-dark-red",new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-top","margin-top",392161226),(-1)], null)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.mr1.dark-red.b","span.mr1.dark-red.b",1503958823),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),(3)], null)], null),cljs.core.count.call(null,errors__$1)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.popover.view,new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"position","position",-2011731912),((function (open_QMARK_,close_on_outside_click){
return (function (p1__134731_SHARP_){
return com.nextjournal.editor.components.ui.positioning.to_el.call(null,"#error-status",p1__134731_SHARP_,com.nextjournal.editor.components.ui.positioning.attachment.call(null,new cljs.core.Keyword(null,"bottom-left","bottom-left",1607421488)));
});})(open_QMARK_,close_on_outside_click))
,new cljs.core.Keyword(null,"close-on-outside-click?","close-on-outside-click?",-2030567500),false,new cljs.core.Keyword(null,"open?","open?",1238443125),cljs.core.deref.call(null,open_QMARK_),new cljs.core.Keyword(null,"on-close","on-close",-761178394),((function (open_QMARK_,close_on_outside_click){
return (function (){
return cljs.core.reset_BANG_.call(null,open_QMARK_,false);
});})(open_QMARK_,close_on_outside_click))
,new cljs.core.Keyword(null,"arrow","arrow",1071351425),null,new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"margin-top","margin-top",392161226),(10),new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),(-9),new cljs.core.Keyword(null,"position","position",-2011731912),"fixed"], null),new cljs.core.Keyword(null,"id","id",-1388402092),"errors-popver"], null),cljs.core.with_meta(new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"max-width","max-width",-1939924051),(300)], null)], null),cljs.core.doall.call(null,cljs.core.map.call(null,((function (open_QMARK_,close_on_outside_click){
return (function (p__134754){
var map__134755 = p__134754;
var map__134755__$1 = (((((!((map__134755 == null))))?(((((map__134755.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134755.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134755):map__134755);
var link = cljs.core.get.call(null,map__134755__$1,new cljs.core.Keyword(null,"node","node",581201198));
var message = cljs.core.get.call(null,map__134755__$1,new cljs.core.Keyword(null,"message","message",-406056002));
return cljs.core.with_meta(new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.pa2.items-center.pointer.hover-bg-light-silver","div.flex.pa2.items-center.pointer.hover-bg-light-silver",-244296855),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.icon.view,"Error",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"size","size",1098693007),(32),new cljs.core.Keyword(null,"class","class",-2030961996),"fill-dark-red no-shrink"], null)], null),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.monospace.mr2.ml2.dark-red.lh-copy","div.monospace.mr2.ml2.dark-red.lh-copy",-1275211788),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"font-size","font-size",-1847940346),(12),new cljs.core.Keyword(null,"word-break","word-break",-407281356),"break-word"], null),new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (map__134755,map__134755__$1,link,message,open_QMARK_,close_on_outside_click){
return (function (){
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"follow","follow",-809317662),link], null));
});})(map__134755,map__134755__$1,link,message,open_QMARK_,close_on_outside_click))
], null),message,(function (){var temp__5735__auto__ = com.nextjournal.graph.link.resolve.call(null,link);
if(cljs.core.truth_(temp__5735__auto__)){
var node = temp__5735__auto__;
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.sans-serif","div.sans-serif",-783434288),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"font-size","font-size",-1847940346),(10),new cljs.core.Keyword(null,"margin-top","margin-top",392161226),(3)], null)], null),(function (){var G__134814 = new cljs.core.Keyword(null,"kind","kind",-717265803).cljs$core$IFn$_invoke$arity$1(node);
switch (G__134814) {
case "runtime":
return [com.nextjournal.editor.components.ui.runtime.runtime_name_with_badge.call(null,node)," Runtime"].join('');
break;
case "code":
return [com.nextjournal.editor.components.ui.runtime.runtime_name_with_badge.call(null,new cljs.core.Keyword(null,"runtime","runtime",-1331573996).cljs$core$IFn$_invoke$arity$1(node))," Cell"].join('');
break;
case "docker-environment":
return ["Docker Import: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword("environment","name","environment/name",1925513790).cljs$core$IFn$_invoke$arity$1(node))].join('');
break;
default:
return null;
}
})()], null);
} else {
return null;
}
})()], null),(cljs.core.truth_(link)?new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.icon.view,"ChevronRight",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"size","size",1098693007),(32),new cljs.core.Keyword(null,"class","class",-2030961996),"o-50 no-shrink"], null)], null):null)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key","key",-1516042587),["error-popover-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(link)].join('')], null));
});})(open_QMARK_,close_on_outside_click))
,errors__$1))], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key","key",-1516042587),"errors-popover"], null))], null)], null);
});
;})(open_QMARK_,close_on_outside_click))
});
com.nextjournal.editor.article.status.runner_log_view = (function com$nextjournal$editor$article$status$runner_log_view(s){
var log_open_QMARK_ = reagent.core.atom.call(null,false);
var notifications_popover_open_QMARK_ = reagent.core.atom.call(null,false);
var update_notification_BANG_ = reagent.core.atom.call(null,false);
return ((function (log_open_QMARK_,notifications_popover_open_QMARK_,update_notification_BANG_){
return (function (p__134815){
var map__134816 = p__134815;
var map__134816__$1 = (((((!((map__134816 == null))))?(((((map__134816.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134816.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134816):map__134816);
var s__$1 = map__134816__$1;
var code_cells = cljs.core.get.call(null,map__134816__$1,new cljs.core.Keyword(null,"code-cells","code-cells",-715438414));
var runner_log_status = cljs.core.get.call(null,map__134816__$1,new cljs.core.Keyword(null,"runner-log-status","runner-log-status",-641067116));
var runtimes = cljs.core.get.call(null,map__134816__$1,new cljs.core.Keyword(null,"runtimes","runtimes",-1735270339));
var status_duration = cljs.core.get.call(null,map__134816__$1,new cljs.core.Keyword(null,"status-duration","status-duration",1767900668));
var dom_id = "runner-status";
var _ = cljs.core.deref.call(null,update_notification_BANG_);
return new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex-auto.flex","div.flex-auto.flex",2086980551),cljs.core.with_meta(new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.items-center.flex-auto","div.flex.items-center.flex-auto",1042425523),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (dom_id,_,map__134816,map__134816__$1,s__$1,code_cells,runner_log_status,runtimes,status_duration,log_open_QMARK_,notifications_popover_open_QMARK_,update_notification_BANG_){
return (function (){
return cljs.core.swap_BANG_.call(null,log_open_QMARK_,cljs.core.not);
});})(dom_id,_,map__134816,map__134816__$1,s__$1,code_cells,runner_log_status,runtimes,status_duration,log_open_QMARK_,notifications_popover_open_QMARK_,update_notification_BANG_))
,new cljs.core.Keyword(null,"id","id",-1388402092),"runner-status"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.mr2","div.mr2",722454104),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.status_icon,runner_log_status], null)], null),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex-auto.monospace.flex.items-center","div.flex-auto.monospace.flex.items-center",1421837872),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"font-size","font-size",-1847940346),(12)], null)], null),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.db.truncate.flex-auto.black","span.db.truncate.flex-auto.black",2111110147),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.run_label,runner_log_status], null)," ",com.nextjournal.editor.article.status.log_event__GT_entry.call(null,runner_log_status)], null),(function (){var temp__5733__auto__ = new cljs.core.Keyword(null,"duration","duration",1444101068).cljs$core$IFn$_invoke$arity$1(runner_log_status);
if(cljs.core.truth_(temp__5733__auto__)){
var duration = temp__5733__auto__;
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.tr.black-40.mr1","span.tr.black-40.mr1",-2057912429),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"font-size","font-size",-1847940346),(10),new cljs.core.Keyword(null,"width","width",-384071477),(60)], null)], null),goog.string.format("%.3fs",(duration / (1000)))], null);
} else {
if(((cljs.core.not.call(null,new cljs.core.Keyword(null,"result","result",1415092211).cljs$core$IFn$_invoke$arity$1(runner_log_status))) && ((!(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"notification","notification",-222338233),null,new cljs.core.Keyword(null,"error","error",-978969032),null], null), null),new cljs.core.Keyword(null,"kind","kind",-717265803).cljs$core$IFn$_invoke$arity$1(runner_log_status))))))){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.active_duration_view,new cljs.core.Keyword(null,"timestamp","timestamp",579478971).cljs$core$IFn$_invoke$arity$1(runner_log_status)], null);
} else {
return null;
}
}
})()], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"button.nj-button--unstyled.flex.items-center","button.nj-button--unstyled.flex.items-center",-260085653),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.icon.view,"ChevronDown",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"size","size",1098693007),(12),new cljs.core.Keyword(null,"class","class",-2030961996),"o-50"], null)], null)], null),(cljs.core.truth_(new cljs.core.Keyword(null,"duration-estimation","duration-estimation",-850460845).cljs$core$IFn$_invoke$arity$1(runner_log_status))?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.progress_view,runner_log_status], null):null)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key","key",-1516042587),"runner-log-status"], null)),cljs.core.with_meta(new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.log_popover,s__$1,dom_id,log_open_QMARK_,notifications_popover_open_QMARK_], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key","key",-1516042587),"runner-log-popover"], null)),(function (){var temp__5735__auto__ = runner_log_status;
if(cljs.core.truth_(temp__5735__auto__)){
var map__134819 = temp__5735__auto__;
var map__134819__$1 = (((((!((map__134819 == null))))?(((((map__134819.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134819.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134819):map__134819);
var article_entity = cljs.core.get.call(null,map__134819__$1,new cljs.core.Keyword(null,"article-entity","article-entity",-1105734316));
if(cljs.core.truth_((function (){var and__88026__auto__ = cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"published","published",-514587618),new cljs.core.Keyword(null,"state","state",-1988618099).cljs$core$IFn$_invoke$arity$1(runner_log_status));
if(and__88026__auto__){
return new cljs.core.Keyword("article","url","article/url",-319806900).cljs$core$IFn$_invoke$arity$1(article_entity);
} else {
return and__88026__auto__;
}
})())){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.items-center","div.flex.items-center",-1537844053),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"i.bg-black-10.ml2.mr2","i.bg-black-10.ml2.mr2",645260017),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"width","width",-384071477),(1),new cljs.core.Keyword(null,"height","height",1025178622),(16)], null)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.tooltip.view,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tip","tip",1221810860),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.nowrap","div.nowrap",96985847),"Open notebook in new tab"], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a.nj-button--unstyled.pointer.flex.monospace.items-center","a.nj-button--unstyled.pointer.flex.monospace.items-center",1943060789),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"href","href",-793805698),new cljs.core.Keyword("article","url","article/url",-319806900).cljs$core$IFn$_invoke$arity$1(article_entity),new cljs.core.Keyword(null,"target","target",253001721),"_blank"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.icon.view,"PopOut",new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"size","size",1098693007),(16),new cljs.core.Keyword(null,"class","class",-2030961996),"fill-teal",new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-top","margin-top",392161226),(-1)], null)], null)], null)], null)], null)], null);
} else {
return null;
}
} else {
return null;
}
})(),(function (){var temp__5735__auto__ = new cljs.core.Keyword(null,"errors","errors",-908790718).cljs$core$IFn$_invoke$arity$1(runner_log_status);
if(cljs.core.truth_(temp__5735__auto__)){
var errors = temp__5735__auto__;
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.items-center","div.flex.items-center",-1537844053),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"font-size","font-size",-1847940346),(10)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"i.bg-black-10.ml2.mr2","i.bg-black-10.ml2.mr2",645260017),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"width","width",-384071477),(1),new cljs.core.Keyword(null,"height","height",1025178622),(16)], null)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.errors_popover,errors], null)], null);
} else {
return null;
}
})(),((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"shutdown-scheduled","shutdown-scheduled",-409146111),cljs.core.get_in.call(null,runner_log_status,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"state","state",-1988618099)], null))))?new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.items-center","div.flex.items-center",-1537844053),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.bg-black-10.ml1.mr2","div.bg-black-10.ml1.mr2",658564113),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"width","width",-384071477),(1),new cljs.core.Keyword(null,"height","height",1025178622),(18)], null)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.teal.dim.nowrap","span.teal.dim.nowrap",334668351),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (dom_id,_,map__134816,map__134816__$1,s__$1,code_cells,runner_log_status,runtimes,status_duration,log_open_QMARK_,notifications_popover_open_QMARK_,update_notification_BANG_){
return (function (){
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"cancel-idle-shutdown","cancel-idle-shutdown",-1081066696)], null));
});})(dom_id,_,map__134816,map__134816__$1,s__$1,code_cells,runner_log_status,runtimes,status_duration,log_open_QMARK_,notifications_popover_open_QMARK_,update_notification_BANG_))
,new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"font-size","font-size",-1847940346),(11)], null)], null),"Keep Running"], null)], null):null),(cljs.core.truth_((function (){var and__88026__auto__ = cljs.core.deref.call(null,re_frame.core.subscribe.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"running?","running?",-257884763)], null)));
if(cljs.core.truth_(and__88026__auto__)){
return ((cljs.core.not_EQ_.call(null,new cljs.core.Keyword("person.notification-settings","off","person.notification-settings/off",1910978601),new cljs.core.Keyword("person","notification-settings","person/notification-settings",1786551819).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,re_frame.core.subscribe.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"current-person","current-person",1723841966)], null)))))) && ((!(com.nextjournal.editor.article.runner_notification.asked_for_permission_QMARK_.call(null)))));
} else {
return and__88026__auto__;
}
})())?new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.items-center","div.flex.items-center",-1537844053),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.bg-black-10.ml2.mr2","div.bg-black-10.ml2.mr2",-1994910256),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"width","width",-384071477),(1),new cljs.core.Keyword(null,"height","height",1025178622),(18)], null)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.teal.dim.nowrap","span.teal.dim.nowrap",334668351),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"font-size","font-size",-1847940346),(11)], null),new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (dom_id,_,map__134816,map__134816__$1,s__$1,code_cells,runner_log_status,runtimes,status_duration,log_open_QMARK_,notifications_popover_open_QMARK_,update_notification_BANG_){
return (function (){
cljs.core.reset_BANG_.call(null,log_open_QMARK_,true);
return cljs.core.reset_BANG_.call(null,notifications_popover_open_QMARK_,true);
});})(dom_id,_,map__134816,map__134816__$1,s__$1,code_cells,runner_log_status,runtimes,status_duration,log_open_QMARK_,notifications_popover_open_QMARK_,update_notification_BANG_))
], null),"Notify Me"], null)], null):null)], null);
});
;})(log_open_QMARK_,notifications_popover_open_QMARK_,update_notification_BANG_))
});
com.nextjournal.editor.article.status.offline_view = (function com$nextjournal$editor$article$status$offline_view(){
return new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.items-center.dark-red.f7","div.flex.items-center.dark-red.f7",-1291745984),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.icon.offline,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"size","size",1098693007),(18),new cljs.core.Keyword(null,"class","class",-2030961996),"fill-red",new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),(7),new cljs.core.Keyword(null,"margin-top","margin-top",392161226),(-1)], null)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.b","span.b",-1984977699),"Offline"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.bg-black-10.ml2.mr2","div.bg-black-10.ml2.mr2",-1994910256),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"width","width",-384071477),(1),new cljs.core.Keyword(null,"height","height",1025178622),(18)], null)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1394872991),"Reconnecting automatically..."], null)], null);
});
com.nextjournal.editor.article.status.connection_errored_view = (function com$nextjournal$editor$article$status$connection_errored_view(error){
var details_visible_QMARK_ = reagent.core.atom.call(null,false);
return ((function (details_visible_QMARK_){
return (function (error__$1){
var details_QMARK_ = (!(clojure.string.blank_QMARK_.call(null,error__$1)));
return new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.items-center.flex-auto.f7","div.flex.items-center.flex-auto.f7",-544795554),new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.items-center.dark-red.flex-auto","div.flex.items-center.dark-red.flex-auto",789087301),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"class","class",-2030961996),((details_QMARK_)?"pointer":null),new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (details_QMARK_,details_visible_QMARK_){
return (function (){
if(details_QMARK_){
return cljs.core.swap_BANG_.call(null,details_visible_QMARK_,cljs.core.not);
} else {
return null;
}
});})(details_QMARK_,details_visible_QMARK_))
,new cljs.core.Keyword(null,"id","id",-1388402092),"connection-error-button"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.icon.offline,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"class","class",-2030961996),"fill-dark-red",new cljs.core.Keyword(null,"size","size",1098693007),(18),new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),(5),new cljs.core.Keyword(null,"margin-top","margin-top",392161226),(-1)], null)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.flex-auto","span.flex-auto",1237463074),"Error connecting to Nextjournal"], null),((details_QMARK_)?new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.icon.view,"ChevronDown",new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"class","class",-2030961996),"ml1 fill-dark-red"], null)], null):null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.bg-black-10.ml2.mr2","div.bg-black-10.ml2.mr2",-1994910256),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"width","width",-384071477),(1),new cljs.core.Keyword(null,"height","height",1025178622),(18)], null)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.teal.dim","span.teal.dim",-15159426),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (details_QMARK_,details_visible_QMARK_){
return (function (){
return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"connect","connect",1232828233)], null));
});})(details_QMARK_,details_visible_QMARK_))
], null),"Retry now"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.popover.view,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"arrow","arrow",1071351425),null,new cljs.core.Keyword(null,"open?","open?",1238443125),cljs.core.deref.call(null,details_visible_QMARK_),new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"position","position",-2011731912),"fixed",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),(0),new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),(-9)], null),new cljs.core.Keyword(null,"position","position",-2011731912),((function (details_QMARK_,details_visible_QMARK_){
return (function (el){
com.nextjournal.editor.components.ui.positioning.to_fixed_el.call(null,"#connection-error-button",el,com.nextjournal.editor.components.ui.positioning.attachment.call(null,new cljs.core.Keyword(null,"bottom-left","bottom-left",1607421488),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"offset","offset",296498311),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),(25)], null)], null)));
return el.style.width = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(document.getElementById("connection-error-button").offsetWidth),"px"].join('');
});})(details_QMARK_,details_visible_QMARK_))
], null),cljs.core.with_meta(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.pv2.ph3.dark-red.monospace.f7","div.pv2.ph3.dark-red.monospace.f7",1412507204),error__$1], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key","key",-1516042587),"connection-error-details"], null))], null)], null);
});
;})(details_visible_QMARK_))
});
com.nextjournal.editor.article.status.connecting_view = (function com$nextjournal$editor$article$status$connecting_view(){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.f7.flex.items-center.sans-serif.relative.black-80","div.f7.flex.items-center.sans-serif.relative.black-80",1850230811),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.components.ui.spinner.dot,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"animating?","animating?",-333605094),true,new cljs.core.Keyword(null,"class","class",-2030961996),"bg-teal"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.ml2","span.ml2",-1187862863),"Connecting to Nextjournal..."], null)], null);
});
com.nextjournal.editor.article.status.view = (function com$nextjournal$editor$article$status$view(p__134850){
var map__134851 = p__134850;
var map__134851__$1 = (((((!((map__134851 == null))))?(((((map__134851.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__134851.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__134851):map__134851);
var s = map__134851__$1;
var connection = cljs.core.get.call(null,map__134851__$1,new cljs.core.Keyword(null,"connection","connection",-123599300));
var code_cells = cljs.core.get.call(null,map__134851__$1,new cljs.core.Keyword(null,"code-cells","code-cells",-715438414));
var docker_environments = cljs.core.get.call(null,map__134851__$1,new cljs.core.Keyword(null,"docker-environments","docker-environments",814286833));
var runner_log_status = cljs.core.get.call(null,map__134851__$1,new cljs.core.Keyword(null,"runner-log-status","runner-log-status",-641067116));
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"offline","offline",-107631935),null,new cljs.core.Keyword(null,"connecting","connecting",-1347943866),null,new cljs.core.Keyword(null,"connected","connected",-169833045),null,new cljs.core.Keyword(null,"errored","errored",1667893684),null], null), null),new cljs.core.Keyword(null,"state","state",-1988618099).cljs$core$IFn$_invoke$arity$1(connection))){
} else {
throw (new Error("Assert failed: (contains? #{:offline :connecting :connected :errored} (:state connection))"));
}
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.items-center.sans-serif.relative.flex-auto.mr2","div.flex.items-center.sans-serif.relative.flex-auto.mr2",-1059652952),((((cljs.core.seq.call(null,code_cells)) || (cljs.core.seq.call(null,docker_environments))))?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.mr2","div.mr2",722454104),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.run_controls,s], null)], null):null),(cljs.core.truth_((function (){var or__88041__auto__ = cljs.core.not_EQ_.call(null,new cljs.core.Keyword(null,"state","state",-1988618099).cljs$core$IFn$_invoke$arity$1(connection),new cljs.core.Keyword(null,"connected","connected",-169833045));
if(or__88041__auto__){
return or__88041__auto__;
} else {
return runner_log_status;
}
})())?new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.flex.items-center.br2.bg-white.flex-auto.ph2.status-bar.pointer","div.flex.items-center.br2.bg-white.flex-auto.ph2.status-bar.pointer",-371145013),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"height","height",1025178622),(24),new cljs.core.Keyword(null,"line-height","line-height",1870784992),"24px",new cljs.core.Keyword(null,"box-shadow","box-shadow",1600206755),"0 1px 2px rgba(0,0,0,.2)"], null),new cljs.core.Keyword(null,"id","id",-1388402092),"status-bar"], null),(function (){var G__134853 = new cljs.core.Keyword(null,"state","state",-1988618099).cljs$core$IFn$_invoke$arity$1(connection);
var G__134853__$1 = (((G__134853 instanceof cljs.core.Keyword))?G__134853.fqn:null);
switch (G__134853__$1) {
case "offline":
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.offline_view], null);
break;
case "errored":
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.connection_errored_view,new cljs.core.Keyword(null,"error","error",-978969032).cljs$core$IFn$_invoke$arity$1(connection)], null);
break;
case "connecting":
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.connecting_view], null);
break;
case "connected":
if(cljs.core.truth_(runner_log_status)){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.runner_log_view,s], null);
} else {
return null;
}
break;
default:
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__134853__$1)].join('')));
}
})()], null):null)], null);
});
com.nextjournal.editor.article.status.topbar = (function com$nextjournal$editor$article$status$topbar(var_args){
var args__89360__auto__ = [];
var len__89350__auto___134859 = arguments.length;
var i__89351__auto___134863 = (0);
while(true){
if((i__89351__auto___134863 < len__89350__auto___134859)){
args__89360__auto__.push((arguments[i__89351__auto___134863]));
var G__134864 = (i__89351__auto___134863 + (1));
i__89351__auto___134863 = G__134864;
continue;
} else {
}
break;
}
var argseq__89361__auto__ = ((((0) < args__89360__auto__.length))?(new cljs.core.IndexedSeq(args__89360__auto__.slice((0)),(0),null)):null);
return com.nextjournal.editor.article.status.topbar.cljs$core$IFn$_invoke$arity$variadic(argseq__89361__auto__);
});
com.nextjournal.editor.article.status.topbar.cljs$core$IFn$_invoke$arity$variadic = (function (hs){
return new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.bg-teal.ph3.flex.items-center","div.bg-teal.ph3.flex.items-center",-1719100976),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"height","height",1025178622),(43)], null)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.logo.logo-white.mr3","div.logo.logo-white.mr3",1924087146)], null),hs,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",-384071477),(150)], null)], null)], null)], null);
});
com.nextjournal.editor.article.status.topbar.cljs$lang$maxFixedArity = (0);
/** @this {Function} */
com.nextjournal.editor.article.status.topbar.cljs$lang$applyTo = (function (seq134854){
var self__89336__auto__ = this;
return self__89336__auto__.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq.call(null,seq134854));
});
devcards.core.register_card.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"com.nextjournal.editor.article.status","com.nextjournal.editor.article.status",366010521),new cljs.core.Keyword(null,"connected","connected",-169833045)], null),new cljs.core.Keyword(null,"func","func",-238706040),(function (){
return devcards.core.card_base.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"connected",new cljs.core.Keyword(null,"documentation","documentation",1889593999),null,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){
if((typeof com !== 'undefined') && (typeof com.nextjournal !== 'undefined') && (typeof com.nextjournal.editor !== 'undefined') && (typeof com.nextjournal.editor.article !== 'undefined') && (typeof com.nextjournal.editor.article.status !== 'undefined') && (typeof com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134860 !== 'undefined')){
} else {
/**
* @constructor
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IWithMeta}
* @implements {devcards.core.IDevcardOptions}
*/
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134860 = (function (meta134861){
this.meta134861 = meta134861;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134860.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_134862,meta134861__$1){
var self__ = this;
var _134862__$1 = this;
return (new com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134860(meta134861__$1));
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134860.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_134862){
var self__ = this;
var _134862__$1 = this;
return self__.meta134861;
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134860.prototype.devcards$core$IDevcardOptions$ = cljs.core.PROTOCOL_SENTINEL;
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134860.prototype.devcards$core$IDevcardOptions$_devcard_options$arity$2 = (function (this__108045__auto__,devcard_opts__108046__auto__){
var self__ = this;
var this__108045__auto____$1 = this;
return cljs.core.assoc.call(null,devcard_opts__108046__auto__,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){var v__108543__auto__ = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.topbar,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.view,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"connection","connection",-123599300),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"connected","connected",-169833045)], null),new cljs.core.Keyword(null,"code-cells","code-cells",-715438414),com.nextjournal.editor.fixtures.code.demo_cells_with_output], null)], null)], null);
if(cljs.core.fn_QMARK_.call(null,v__108543__auto__)){
return ((function (v__108543__auto__,this__108045__auto____$1){
return (function (data_atom__108544__auto__,owner__108545__auto__){
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [v__108543__auto__,data_atom__108544__auto__,owner__108545__auto__], null)], null));
});
;})(v__108543__auto__,this__108045__auto____$1))
} else {
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,v__108543__auto__], null));
}
})(),new cljs.core.Keyword(null,"options","options",99638489),cljs.core.merge.call(null,cljs.core.PersistentArrayMap.EMPTY,devcards.core.assert_options_map.call(null,new cljs.core.Keyword(null,"options","options",99638489).cljs$core$IFn$_invoke$arity$1(devcard_opts__108046__auto__))));
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134860.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta134861","meta134861",753240566,null)], null);
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134860.cljs$lang$type = true;
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134860.cljs$lang$ctorStr = "com.nextjournal.editor.article.status/t_com$nextjournal$editor$article$status134860";
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134860.cljs$lang$ctorPrWriter = (function (this__88718__auto__,writer__88719__auto__,opt__88720__auto__){
return cljs.core._write.call(null,writer__88719__auto__,"com.nextjournal.editor.article.status/t_com$nextjournal$editor$article$status134860");
});
/**
* Positional factory function for com.nextjournal.editor.article.status/t_com$nextjournal$editor$article$status134860.
*/
com.nextjournal.editor.article.status.__GT_t_com$nextjournal$editor$article$status134860 = (function com$nextjournal$editor$article$status$__GT_t_com$nextjournal$editor$article$status134860(meta134861){
return (new com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134860(meta134861));
});
}
return (new com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134860(null));
})()
,new cljs.core.Keyword(null,"initial-data","initial-data",-1315709804),null,new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watch-atom","watch-atom",-2134031308),false], null)], null));
})], null));
com.nextjournal.editor.article.status.demo_log = new cljs.core.PersistentVector(null, 8, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"kind","kind",-717265803),new cljs.core.Keyword(null,"runner","runner",1945441304),new cljs.core.Keyword("com.nextjournal.runner.log","level","com.nextjournal.runner.log/level",-1205827549),new cljs.core.Keyword(null,"info","info",-317069002),new cljs.core.Keyword(null,"timestamp","timestamp",579478971),new Date(1528102539208),new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"ready","ready",1086465795),new cljs.core.Keyword(null,"result","result",1415092211),new cljs.core.Keyword(null,"succeeded","succeeded",-1860573089),new cljs.core.Keyword(null,"request","request",1772954723),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"action","action",-811238024),new cljs.core.Keyword(null,"run","run",-1821166653),new cljs.core.Keyword(null,"reuse-context?","reuse-context?",-878651022),true,new cljs.core.Keyword("request","id","request/id",1829218213),new cljs.core.UUID("0dbff8e0-67d5-11e8-b2ee-e308276a38d9", -469003720)], null),new cljs.core.Keyword(null,"errors","errors",-908790718),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"message","message",-406056002),"java.util.concurrent.ExecutionException:\njavax.ws.rs.ProcessingException:\njava.io.IOException: No such file or directory"], null)], null)], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword("com.nextjournal.runner.log","level","com.nextjournal.runner.log/level",-1205827549),new cljs.core.Keyword(null,"info","info",-317069002),new cljs.core.Keyword("request","id","request/id",1829218213),new cljs.core.UUID("0dbff8e0-67d5-11e8-b2ee-e308276a38d9", -469003720),new cljs.core.Keyword(null,"index","index",-1531685915),(1),new cljs.core.Keyword(null,"duration","duration",1444101068),(78),new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"executing","executing",-322017999),new cljs.core.Keyword(null,"request","request",1772954723),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"action","action",-811238024),new cljs.core.Keyword(null,"run","run",-1821166653),new cljs.core.Keyword(null,"reuse-context?","reuse-context?",-878651022),true,new cljs.core.Keyword("request","id","request/id",1829218213),new cljs.core.UUID("0dbff8e0-67d5-11e8-b2ee-e308276a38d9", -469003720)], null)], null),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"kind","kind",-717265803),new cljs.core.Keyword(null,"runner","runner",1945441304),new cljs.core.Keyword("com.nextjournal.runner.log","level","com.nextjournal.runner.log/level",-1205827549),new cljs.core.Keyword(null,"info","info",-317069002),new cljs.core.Keyword(null,"timestamp","timestamp",579478971),new Date(1528102539120),new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"executing","executing",-322017999),new cljs.core.Keyword(null,"request","request",1772954723),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"action","action",-811238024),new cljs.core.Keyword(null,"run","run",-1821166653),new cljs.core.Keyword(null,"reuse-context?","reuse-context?",-878651022),true,new cljs.core.Keyword("request","id","request/id",1829218213),new cljs.core.UUID("0dbff8e0-67d5-11e8-b2ee-e308276a38d9", -469003720)], null)], null),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"kind","kind",-717265803),new cljs.core.Keyword(null,"runner","runner",1945441304),new cljs.core.Keyword("com.nextjournal.runner.log","level","com.nextjournal.runner.log/level",-1205827549),new cljs.core.Keyword(null,"info","info",-317069002),new cljs.core.Keyword(null,"timestamp","timestamp",579478971),new Date(1528102032601),new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"ready","ready",1086465795),new cljs.core.Keyword(null,"result","result",1415092211),new cljs.core.Keyword(null,"succeeded","succeeded",-1860573089)], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword("com.nextjournal.runner.log","level","com.nextjournal.runner.log/level",-1205827549),new cljs.core.Keyword(null,"info","info",-317069002),new cljs.core.Keyword("request","id","request/id",1829218213),new cljs.core.UUID("da558c00-67d3-11e8-b2ee-e308276a38d9", -1543652552),new cljs.core.Keyword(null,"index","index",-1531685915),(1),new cljs.core.Keyword(null,"duration","duration",1444101068),(457),new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"executing","executing",-322017999),new cljs.core.Keyword(null,"request","request",1772954723),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"action","action",-811238024),new cljs.core.Keyword(null,"run","run",-1821166653),new cljs.core.Keyword(null,"reuse-context?","reuse-context?",-878651022),true,new cljs.core.Keyword("request","id","request/id",1829218213),new cljs.core.UUID("da558c00-67d3-11e8-b2ee-e308276a38d9", -1543652552)], null)], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"kind","kind",-717265803),new cljs.core.Keyword(null,"execution","execution",253283524),new cljs.core.Keyword("com.nextjournal.runner.log","level","com.nextjournal.runner.log/level",-1205827549),new cljs.core.Keyword(null,"info","info",-317069002),new cljs.core.Keyword(null,"timestamp","timestamp",579478971),new Date(1528102027833),new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"booting","booting",-1345777253),new cljs.core.Keyword(null,"node","node",581201198),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"node","node",581201198),"285ad4cc-d8d8-4cb7-a5ed-5aa19be83aa0"], null),new cljs.core.Keyword(null,"request","request",1772954723),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"action","action",-811238024),new cljs.core.Keyword(null,"run","run",-1821166653),new cljs.core.Keyword(null,"reuse-context?","reuse-context?",-878651022),true,new cljs.core.Keyword("request","id","request/id",1829218213),new cljs.core.UUID("da558c00-67d3-11e8-b2ee-e308276a38d9", -1543652552)], null)], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"kind","kind",-717265803),new cljs.core.Keyword(null,"execution","execution",253283524),new cljs.core.Keyword("com.nextjournal.runner.log","level","com.nextjournal.runner.log/level",-1205827549),new cljs.core.Keyword(null,"info","info",-317069002),new cljs.core.Keyword(null,"timestamp","timestamp",579478971),new Date(1528102023803),new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"downloading","downloading",-213530737),new cljs.core.Keyword(null,"node","node",581201198),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"node","node",581201198),"285ad4cc-d8d8-4cb7-a5ed-5aa19be83aa0"], null),new cljs.core.Keyword(null,"request","request",1772954723),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"action","action",-811238024),new cljs.core.Keyword(null,"run","run",-1821166653),new cljs.core.Keyword(null,"reuse-context?","reuse-context?",-878651022),true,new cljs.core.Keyword("request","id","request/id",1829218213),new cljs.core.UUID("da558c00-67d3-11e8-b2ee-e308276a38d9", -1543652552)], null)], null),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"kind","kind",-717265803),new cljs.core.Keyword(null,"runner","runner",1945441304),new cljs.core.Keyword("com.nextjournal.runner.log","level","com.nextjournal.runner.log/level",-1205827549),new cljs.core.Keyword(null,"info","info",-317069002),new cljs.core.Keyword(null,"timestamp","timestamp",579478971),new Date(1528102023396),new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"executing","executing",-322017999),new cljs.core.Keyword(null,"request","request",1772954723),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"action","action",-811238024),new cljs.core.Keyword(null,"run","run",-1821166653),new cljs.core.Keyword(null,"reuse-context?","reuse-context?",-878651022),true,new cljs.core.Keyword("request","id","request/id",1829218213),new cljs.core.UUID("da558c00-67d3-11e8-b2ee-e308276a38d9", -1543652552)], null)], null)], null);
devcards.core.register_card.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"com.nextjournal.editor.article.status","com.nextjournal.editor.article.status",366010521),new cljs.core.Keyword(null,"log","log",-1595516004)], null),new cljs.core.Keyword(null,"func","func",-238706040),(function (){
return devcards.core.card_base.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"log",new cljs.core.Keyword(null,"documentation","documentation",1889593999),null,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){
if((typeof com !== 'undefined') && (typeof com.nextjournal !== 'undefined') && (typeof com.nextjournal.editor !== 'undefined') && (typeof com.nextjournal.editor.article !== 'undefined') && (typeof com.nextjournal.editor.article.status !== 'undefined') && (typeof com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134866 !== 'undefined')){
} else {
/**
* @constructor
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IWithMeta}
* @implements {devcards.core.IDevcardOptions}
*/
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134866 = (function (meta134867){
this.meta134867 = meta134867;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134866.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_134868,meta134867__$1){
var self__ = this;
var _134868__$1 = this;
return (new com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134866(meta134867__$1));
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134866.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_134868){
var self__ = this;
var _134868__$1 = this;
return self__.meta134867;
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134866.prototype.devcards$core$IDevcardOptions$ = cljs.core.PROTOCOL_SENTINEL;
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134866.prototype.devcards$core$IDevcardOptions$_devcard_options$arity$2 = (function (this__108045__auto__,devcard_opts__108046__auto__){
var self__ = this;
var this__108045__auto____$1 = this;
return cljs.core.assoc.call(null,devcard_opts__108046__auto__,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){var v__108543__auto__ = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.topbar,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.view,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"connection","connection",-123599300),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"connected","connected",-169833045)], null),new cljs.core.Keyword(null,"code-cells","code-cells",-715438414),com.nextjournal.editor.fixtures.code.demo_cells_with_output,new cljs.core.Keyword(null,"runner-log-status","runner-log-status",-641067116),cljs.core.first.call(null,com.nextjournal.editor.article.status.demo_log),new cljs.core.Keyword(null,"runner-log","runner-log",-1012616002),com.nextjournal.editor.article.status.demo_log], null)], null)], null);
if(cljs.core.fn_QMARK_.call(null,v__108543__auto__)){
return ((function (v__108543__auto__,this__108045__auto____$1){
return (function (data_atom__108544__auto__,owner__108545__auto__){
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [v__108543__auto__,data_atom__108544__auto__,owner__108545__auto__], null)], null));
});
;})(v__108543__auto__,this__108045__auto____$1))
} else {
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,v__108543__auto__], null));
}
})(),new cljs.core.Keyword(null,"options","options",99638489),cljs.core.merge.call(null,cljs.core.PersistentArrayMap.EMPTY,devcards.core.assert_options_map.call(null,new cljs.core.Keyword(null,"options","options",99638489).cljs$core$IFn$_invoke$arity$1(devcard_opts__108046__auto__))));
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134866.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta134867","meta134867",-1481113718,null)], null);
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134866.cljs$lang$type = true;
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134866.cljs$lang$ctorStr = "com.nextjournal.editor.article.status/t_com$nextjournal$editor$article$status134866";
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134866.cljs$lang$ctorPrWriter = (function (this__88718__auto__,writer__88719__auto__,opt__88720__auto__){
return cljs.core._write.call(null,writer__88719__auto__,"com.nextjournal.editor.article.status/t_com$nextjournal$editor$article$status134866");
});
/**
* Positional factory function for com.nextjournal.editor.article.status/t_com$nextjournal$editor$article$status134866.
*/
com.nextjournal.editor.article.status.__GT_t_com$nextjournal$editor$article$status134866 = (function com$nextjournal$editor$article$status$__GT_t_com$nextjournal$editor$article$status134866(meta134867){
return (new com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134866(meta134867));
});
}
return (new com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134866(null));
})()
,new cljs.core.Keyword(null,"initial-data","initial-data",-1315709804),null,new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watch-atom","watch-atom",-2134031308),false], null)], null));
})], null));
devcards.core.register_card.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"com.nextjournal.editor.article.status","com.nextjournal.editor.article.status",366010521),new cljs.core.Keyword(null,"scheduling","scheduling",69053604)], null),new cljs.core.Keyword(null,"func","func",-238706040),(function (){
return devcards.core.card_base.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"scheduling",new cljs.core.Keyword(null,"documentation","documentation",1889593999),null,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){
if((typeof com !== 'undefined') && (typeof com.nextjournal !== 'undefined') && (typeof com.nextjournal.editor !== 'undefined') && (typeof com.nextjournal.editor.article !== 'undefined') && (typeof com.nextjournal.editor.article.status !== 'undefined') && (typeof com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134888 !== 'undefined')){
} else {
/**
* @constructor
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IWithMeta}
* @implements {devcards.core.IDevcardOptions}
*/
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134888 = (function (meta134889){
this.meta134889 = meta134889;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134888.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_134890,meta134889__$1){
var self__ = this;
var _134890__$1 = this;
return (new com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134888(meta134889__$1));
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134888.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_134890){
var self__ = this;
var _134890__$1 = this;
return self__.meta134889;
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134888.prototype.devcards$core$IDevcardOptions$ = cljs.core.PROTOCOL_SENTINEL;
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134888.prototype.devcards$core$IDevcardOptions$_devcard_options$arity$2 = (function (this__108045__auto__,devcard_opts__108046__auto__){
var self__ = this;
var this__108045__auto____$1 = this;
return cljs.core.assoc.call(null,devcard_opts__108046__auto__,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){var v__108543__auto__ = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.topbar,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.view,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"connection","connection",-123599300),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"connected","connected",-169833045)], null),new cljs.core.Keyword(null,"code-cells","code-cells",-715438414),com.nextjournal.editor.fixtures.code.demo_cells_with_output,new cljs.core.Keyword(null,"runner-log-status","runner-log-status",-641067116),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"kind","kind",-717265803),new cljs.core.Keyword(null,"runner","runner",1945441304),new cljs.core.Keyword("com.nextjournal.runner.log","level","com.nextjournal.runner.log/level",-1205827549),new cljs.core.Keyword(null,"info","info",-317069002),new cljs.core.Keyword(null,"timestamp","timestamp",579478971),new Date(1528102023396),new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"scheduling","scheduling",69053604),new cljs.core.Keyword(null,"duration-estimation","duration-estimation",-850460845),(20000),new cljs.core.Keyword(null,"request","request",1772954723),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"action","action",-811238024),new cljs.core.Keyword(null,"run","run",-1821166653),new cljs.core.Keyword(null,"reuse-context?","reuse-context?",-878651022),true,new cljs.core.Keyword("request","id","request/id",1829218213),new cljs.core.UUID("da558c00-67d3-11e8-b2ee-e308276a38d9", -1543652552)], null)], null),new cljs.core.Keyword(null,"runner-log","runner-log",-1012616002),com.nextjournal.editor.article.status.demo_log], null)], null)], null);
if(cljs.core.fn_QMARK_.call(null,v__108543__auto__)){
return ((function (v__108543__auto__,this__108045__auto____$1){
return (function (data_atom__108544__auto__,owner__108545__auto__){
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [v__108543__auto__,data_atom__108544__auto__,owner__108545__auto__], null)], null));
});
;})(v__108543__auto__,this__108045__auto____$1))
} else {
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,v__108543__auto__], null));
}
})(),new cljs.core.Keyword(null,"options","options",99638489),cljs.core.merge.call(null,cljs.core.PersistentArrayMap.EMPTY,devcards.core.assert_options_map.call(null,new cljs.core.Keyword(null,"options","options",99638489).cljs$core$IFn$_invoke$arity$1(devcard_opts__108046__auto__))));
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134888.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta134889","meta134889",-1153585581,null)], null);
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134888.cljs$lang$type = true;
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134888.cljs$lang$ctorStr = "com.nextjournal.editor.article.status/t_com$nextjournal$editor$article$status134888";
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134888.cljs$lang$ctorPrWriter = (function (this__88718__auto__,writer__88719__auto__,opt__88720__auto__){
return cljs.core._write.call(null,writer__88719__auto__,"com.nextjournal.editor.article.status/t_com$nextjournal$editor$article$status134888");
});
/**
* Positional factory function for com.nextjournal.editor.article.status/t_com$nextjournal$editor$article$status134888.
*/
com.nextjournal.editor.article.status.__GT_t_com$nextjournal$editor$article$status134888 = (function com$nextjournal$editor$article$status$__GT_t_com$nextjournal$editor$article$status134888(meta134889){
return (new com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134888(meta134889));
});
}
return (new com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134888(null));
})()
,new cljs.core.Keyword(null,"initial-data","initial-data",-1315709804),null,new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watch-atom","watch-atom",-2134031308),false], null)], null));
})], null));
devcards.core.register_card.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"com.nextjournal.editor.article.status","com.nextjournal.editor.article.status",366010521),new cljs.core.Keyword(null,"offline","offline",-107631935)], null),new cljs.core.Keyword(null,"func","func",-238706040),(function (){
return devcards.core.card_base.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"offline",new cljs.core.Keyword(null,"documentation","documentation",1889593999),null,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){
if((typeof com !== 'undefined') && (typeof com.nextjournal !== 'undefined') && (typeof com.nextjournal.editor !== 'undefined') && (typeof com.nextjournal.editor.article !== 'undefined') && (typeof com.nextjournal.editor.article.status !== 'undefined') && (typeof com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134898 !== 'undefined')){
} else {
/**
* @constructor
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IWithMeta}
* @implements {devcards.core.IDevcardOptions}
*/
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134898 = (function (meta134899){
this.meta134899 = meta134899;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134898.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_134900,meta134899__$1){
var self__ = this;
var _134900__$1 = this;
return (new com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134898(meta134899__$1));
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134898.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_134900){
var self__ = this;
var _134900__$1 = this;
return self__.meta134899;
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134898.prototype.devcards$core$IDevcardOptions$ = cljs.core.PROTOCOL_SENTINEL;
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134898.prototype.devcards$core$IDevcardOptions$_devcard_options$arity$2 = (function (this__108045__auto__,devcard_opts__108046__auto__){
var self__ = this;
var this__108045__auto____$1 = this;
return cljs.core.assoc.call(null,devcard_opts__108046__auto__,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){var v__108543__auto__ = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.topbar,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.view,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"connection","connection",-123599300),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"offline","offline",-107631935)], null)], null)], null)], null);
if(cljs.core.fn_QMARK_.call(null,v__108543__auto__)){
return ((function (v__108543__auto__,this__108045__auto____$1){
return (function (data_atom__108544__auto__,owner__108545__auto__){
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [v__108543__auto__,data_atom__108544__auto__,owner__108545__auto__], null)], null));
});
;})(v__108543__auto__,this__108045__auto____$1))
} else {
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,v__108543__auto__], null));
}
})(),new cljs.core.Keyword(null,"options","options",99638489),cljs.core.merge.call(null,cljs.core.PersistentArrayMap.EMPTY,devcards.core.assert_options_map.call(null,new cljs.core.Keyword(null,"options","options",99638489).cljs$core$IFn$_invoke$arity$1(devcard_opts__108046__auto__))));
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134898.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta134899","meta134899",-274557049,null)], null);
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134898.cljs$lang$type = true;
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134898.cljs$lang$ctorStr = "com.nextjournal.editor.article.status/t_com$nextjournal$editor$article$status134898";
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134898.cljs$lang$ctorPrWriter = (function (this__88718__auto__,writer__88719__auto__,opt__88720__auto__){
return cljs.core._write.call(null,writer__88719__auto__,"com.nextjournal.editor.article.status/t_com$nextjournal$editor$article$status134898");
});
/**
* Positional factory function for com.nextjournal.editor.article.status/t_com$nextjournal$editor$article$status134898.
*/
com.nextjournal.editor.article.status.__GT_t_com$nextjournal$editor$article$status134898 = (function com$nextjournal$editor$article$status$__GT_t_com$nextjournal$editor$article$status134898(meta134899){
return (new com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134898(meta134899));
});
}
return (new com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134898(null));
})()
,new cljs.core.Keyword(null,"initial-data","initial-data",-1315709804),null,new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watch-atom","watch-atom",-2134031308),false], null)], null));
})], null));
devcards.core.register_card.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"com.nextjournal.editor.article.status","com.nextjournal.editor.article.status",366010521),new cljs.core.Keyword(null,"connecting","connecting",-1347943866)], null),new cljs.core.Keyword(null,"func","func",-238706040),(function (){
return devcards.core.card_base.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"connecting",new cljs.core.Keyword(null,"documentation","documentation",1889593999),null,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){
if((typeof com !== 'undefined') && (typeof com.nextjournal !== 'undefined') && (typeof com.nextjournal.editor !== 'undefined') && (typeof com.nextjournal.editor.article !== 'undefined') && (typeof com.nextjournal.editor.article.status !== 'undefined') && (typeof com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134912 !== 'undefined')){
} else {
/**
* @constructor
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IWithMeta}
* @implements {devcards.core.IDevcardOptions}
*/
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134912 = (function (meta134913){
this.meta134913 = meta134913;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134912.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_134914,meta134913__$1){
var self__ = this;
var _134914__$1 = this;
return (new com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134912(meta134913__$1));
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134912.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_134914){
var self__ = this;
var _134914__$1 = this;
return self__.meta134913;
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134912.prototype.devcards$core$IDevcardOptions$ = cljs.core.PROTOCOL_SENTINEL;
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134912.prototype.devcards$core$IDevcardOptions$_devcard_options$arity$2 = (function (this__108045__auto__,devcard_opts__108046__auto__){
var self__ = this;
var this__108045__auto____$1 = this;
return cljs.core.assoc.call(null,devcard_opts__108046__auto__,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){var v__108543__auto__ = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.topbar,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.view,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"connection","connection",-123599300),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"connecting","connecting",-1347943866)], null)], null)], null)], null);
if(cljs.core.fn_QMARK_.call(null,v__108543__auto__)){
return ((function (v__108543__auto__,this__108045__auto____$1){
return (function (data_atom__108544__auto__,owner__108545__auto__){
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [v__108543__auto__,data_atom__108544__auto__,owner__108545__auto__], null)], null));
});
;})(v__108543__auto__,this__108045__auto____$1))
} else {
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,v__108543__auto__](null,"options","options",99638489),cljs.core.merge.call(null,cljs.core.PersistentArrayMap.EMPTY,devcards.core.assert_options_map.call(null,new cljs.core.Keyword(null,"options","options",99638489).cljs$core$IFn$_invoke$arity$1(devcard_opts__108046__auto__))));
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134879.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta134880","meta134880",1735060591,null)], null);
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134879.cljs$lang$type = true;
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134879.cljs$lang$ctorStr = "com.nextjournal.editor.article.status/t_com$nextjournal$editor$article$status134879";
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134879.cljs$lang$ctorPrWriter = (function (this__88718__auto__,writer__88719__auto__,opt__88720__auto__){
return cljs.core._write.call(null,writer__88719__auto__,"com.nextjournal.editor.article.status/t_com$nextjournal$editor$article$status134879");
});
/**
* Positional factory function for com.nextjournal.editor.article.status/t_com$nextjournal$editor$article$status134879.
*/
com.nextjournal.editor.article.status.__GT_t_com$nextjournal$editor$article$status134879 = (function com$nextjournal$editor$article$status$__GT_t_com$nextjournal$editor$article$status134879(meta134880){
return (new com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134879(meta134880));
});
}
return (new com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134879(null));
})()
,new cljs.core.Keyword(null,"initial-data","initial-data",-1315709804),null,new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watch-atom","watch-atom",-2134031308),false], null)], null));
})], null));
devcards.core.register_card.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"com.nextjournal.editor.article.status","com.nextjournal.editor.article.status",366010521),new cljs.core.Keyword(null,"connection-error","connection-error",-707388013)], null),new cljs.core.Keyword(null,"func","func",-238706040),(function (){
return devcards.core.card_base.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"connection-error",new cljs.core.Keyword(null,"documentation","documentation",1889593999),null,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){
if((typeof com !== 'undefined') && (typeof com.nextjournal !== 'undefined') && (typeof com.nextjournal.editor !== 'undefined') && (typeof com.nextjournal.editor.article !== 'undefined') && (typeof com.nextjournal.editor.article.status !== 'undefined') && (typeof com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134891 !== 'undefined')){
} else {
/**
* @constructor
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IWithMeta}
* @implements {devcards.core.IDevcardOptions}
*/
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134891 = (function (meta134892){
this.meta134892 = meta134892;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134891.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_134893,meta134892__$1){
var self__ = this;
var _134893__$1 = this;
return (new com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134891(meta134892__$1));
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134891.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_134893){
var self__ = this;
var _134893__$1 = this;
return self__.meta134892;
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134891.prototype.devcards$core$IDevcardOptions$ = cljs.core.PROTOCOL_SENTINEL;
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134891.prototype.devcards$core$IDevcardOptions$_devcard_options$arity$2 = (function (this__108045__auto__,devcard_opts__108046__auto__){
var self__ = this;
var this__108045__auto____$1 = this;
return cljs.core.assoc.call(null,devcard_opts__108046__auto__,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){var v__108543__auto__ = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.topbar,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.view,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"connection","connection",-123599300),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"errored","errored",1667893684)], null)], null)], null)], null);
if(cljs.core.fn_QMARK_.call(null,v__108543__auto__)){
return ((function (v__108543__auto__,this__108045__auto____$1){
return (function (data_atom__108544__auto__,owner__108545__auto__){
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [v__108543__auto__,data_atom__108544__auto__,owner__108545__auto__], null)], null));
});
;})(v__108543__auto__,this__108045__auto____$1))
} else {
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,v__108543__auto__], null));
}
})(),new cljs.core.Keyword(null,"options","options",99638489),cljs.core.merge.call(null,cljs.core.PersistentArrayMap.EMPTY,devcards.core.assert_options_map.call(null,new cljs.core.Keyword(null,"options","options",99638489).cljs$core$IFn$_invoke$arity$1(devcard_opts__108046__auto__))));
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134891.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta134892","meta134892",1396414033,null)], null);
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134891.cljs$lang$type = true;
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134891.cljs$lang$ctorStr = "com.nextjournal.editor.article.status/t_com$nextjournal$editor$article$status134891";
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134891.cljs$lang$ctorPrWriter = (function (this__88718__auto__,writer__88719__auto__,opt__88720__auto__){
return cljs.core._write.call(null,writer__88719__auto__,"com.nextjournal.editor.article.status/t_com$nextjournal$editor$article$status134891");
});
/**
* Positional factory function for com.nextjournal.editor.article.status/t_com$nextjournal$editor$article$status134891.
*/
com.nextjournal.editor.article.status.__GT_t_com$nextjournal$editor$article$status134891 = (function com$nextjournal$editor$article$status$__GT_t_com$nextjournal$editor$article$status134891(meta134892){
return (new com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134891(meta134892));
});
}
return (new com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134891(null));
})()
,new cljs.core.Keyword(null,"initial-data","initial-data",-1315709804),null,new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watch-atom","watch-atom",-2134031308),false], null)], null));
})], null));
devcards.core.register_card.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"com.nextjournal.editor.article.status","com.nextjournal.editor.article.status",366010521),new cljs.core.Keyword(null,"connection-error-details","connection-error-details",192033186)], null),new cljs.core.Keyword(null,"func","func",-238706040),(function (){
return devcards.core.card_base.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"connection-error-details",new cljs.core.Keyword(null,"documentation","documentation",1889593999),null,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){
if((typeof com !== 'undefined') && (typeof com.nextjournal !== 'undefined') && (typeof com.nextjournal.editor !== 'undefined') && (typeof com.nextjournal.editor.article !== 'undefined') && (typeof com.nextjournal.editor.article.status !== 'undefined') && (typeof com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134904 !== 'undefined')){
} else {
/**
* @constructor
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IWithMeta}
* @implements {devcards.core.IDevcardOptions}
*/
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134904 = (function (meta134905){
this.meta134905 = meta134905;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134904.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_134906,meta134905__$1){
var self__ = this;
var _134906__$1 = this;
return (new com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134904(meta134905__$1));
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134904.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_134906){
var self__ = this;
var _134906__$1 = this;
return self__.meta134905;
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134904.prototype.devcards$core$IDevcardOptions$ = cljs.core.PROTOCOL_SENTINEL;
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134904.prototype.devcards$core$IDevcardOptions$_devcard_options$arity$2 = (function (this__108045__auto__,devcard_opts__108046__auto__){
var self__ = this;
var this__108045__auto____$1 = this;
return cljs.core.assoc.call(null,devcard_opts__108046__auto__,new cljs.core.Keyword(null,"main-obj","main-obj",-1544409742),(function (){var v__108543__auto__ = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.topbar,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.editor.article.status.view,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"connection","connection",-123599300),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"errored","errored",1667893684),new cljs.core.Keyword(null,"error","error",-978969032),"Host is unreachable."], null)], null)], null)], null);
if(cljs.core.fn_QMARK_.call(null,v__108543__auto__)){
return ((function (v__108543__auto__,this__108045__auto____$1){
return (function (data_atom__108544__auto__,owner__108545__auto__){
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [v__108543__auto__,data_atom__108544__auto__,owner__108545__auto__], null)], null));
});
;})(v__108543__auto__,this__108045__auto____$1))
} else {
return reagent.core.as_element.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.nextjournal.devcards.error_boundary,v__108543__auto__], null));
}
})(),new cljs.core.Keyword(null,"options","options",99638489),cljs.core.merge.call(null,cljs.core.PersistentArrayMap.EMPTY,devcards.core.assert_options_map.call(null,new cljs.core.Keyword(null,"options","options",99638489).cljs$core$IFn$_invoke$arity$1(devcard_opts__108046__auto__))));
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134904.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta134905","meta134905",1519739113,null)], null);
});
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134904.cljs$lang$type = true;
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134904.cljs$lang$ctorStr = "com.nextjournal.editor.article.status/t_com$nextjournal$editor$article$status134904";
com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134904.cljs$lang$ctorPrWriter = (function (this__88718__auto__,writer__88719__auto__,opt__88720__auto__){
return cljs.core._write.call(null,writer__88719__auto__,"com.nextjournal.editor.article.status/t_com$nextjournal$editor$article$status134904");
});
/**
* Positional factory function for com.nextjournal.editor.article.status/t_com$nextjournal$editor$article$status134904.
*/
com.nextjournal.editor.article.status.__GT_t_com$nextjournal$editor$article$status134904 = (function com$nextjournal$editor$article$status$__GT_t_com$nextjournal$editor$article$status134904(meta134905){
return (new com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134904(meta134905));
});
}
return (new com.nextjournal.editor.article.status.t_com$nextjournal$editor$article$status134904(null));
})()
,new cljs.core.Keyword(null,"initial-data","initial-data",-1315709804),null,new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watch-atom","watch-atom",-2134031308),false], null)], null));
})], null));
//# sourceMappingURL=status.js.map?rel=1573720734855
gURL=status.js.map?rel=1573720734915
668
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment