;; Events layout defcomps — root header from env free variables,
;; events-specific headers passed as &key params.

;; --- Calendar admin layout: root + post + child(admin + cal + cal-admin) ---

(defcomp ~events-cal-admin-layout-full (&key post-header admin-header
                                              calendar-header calendar-admin-header)
  (<> (~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
                     :app-label app-label :nav-tree nav-tree :auth-menu auth-menu
                     :nav-panel nav-panel :settings-url settings-url :is-admin is-admin)
    post-header
    (~header-child-sx :inner (<> admin-header calendar-header calendar-admin-header))))

(defcomp ~events-cal-admin-layout-oob (&key admin-oob cal-oob cal-admin-oob-wrap clear-oob)
  (<> admin-oob cal-oob cal-admin-oob-wrap clear-oob))

;; --- Slots layout: same full as cal-admin ---

(defcomp ~events-slots-layout-oob (&key admin-oob cal-admin-oob clear-oob)
  (<> admin-oob cal-admin-oob clear-oob))

;; --- Slot detail layout: root + post + child(admin + cal + cal-admin + slot) ---

(defcomp ~events-slot-layout-full (&key post-header admin-header
                                         calendar-header calendar-admin-header slot-header)
  (<> (~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
                     :app-label app-label :nav-tree nav-tree :auth-menu auth-menu
                     :nav-panel nav-panel :settings-url settings-url :is-admin is-admin)
    post-header
    (~header-child-sx :inner (<> admin-header calendar-header calendar-admin-header slot-header))))

(defcomp ~events-slot-layout-oob (&key admin-oob cal-admin-oob slot-oob-wrap clear-oob)
  (<> admin-oob cal-admin-oob slot-oob-wrap clear-oob))

;; --- Day admin layout: root + post + child(admin + cal + day + day-admin) ---

(defcomp ~events-day-admin-layout-full (&key post-header admin-header
                                              calendar-header day-header day-admin-header)
  (<> (~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
                     :app-label app-label :nav-tree nav-tree :auth-menu auth-menu
                     :nav-panel nav-panel :settings-url settings-url :is-admin is-admin)
    post-header
    (~header-child-sx :inner (<> admin-header calendar-header day-header day-admin-header))))

(defcomp ~events-day-admin-layout-oob (&key admin-oob cal-oob day-admin-oob-wrap clear-oob)
  (<> admin-oob cal-oob day-admin-oob-wrap clear-oob))

;; --- Entry layout: root + child(post + cal + day + entry) ---

(defcomp ~events-entry-layout-full (&key post-header calendar-header day-header entry-header)
  (<> (~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
                     :app-label app-label :nav-tree nav-tree :auth-menu auth-menu
                     :nav-panel nav-panel :settings-url settings-url :is-admin is-admin)
    (~header-child-sx :inner (<> post-header calendar-header day-header entry-header))))

(defcomp ~events-entry-layout-oob (&key day-oob entry-oob-wrap clear-oob)
  (<> day-oob entry-oob-wrap clear-oob))

;; --- Entry admin layout: root + post + child(admin + cal + day + entry + entry-admin) ---

(defcomp ~events-entry-admin-layout-full (&key post-header admin-header
                                                calendar-header day-header
                                                entry-header entry-admin-header)
  (<> (~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
                     :app-label app-label :nav-tree nav-tree :auth-menu auth-menu
                     :nav-panel nav-panel :settings-url settings-url :is-admin is-admin)
    post-header
    (~header-child-sx :inner (<> admin-header calendar-header day-header
                                entry-header entry-admin-header))))

(defcomp ~events-entry-admin-layout-oob (&key admin-oob entry-oob entry-admin-oob-wrap clear-oob)
  (<> admin-oob entry-oob entry-admin-oob-wrap clear-oob))

;; --- Ticket types layout: root + child(post + cal + day + entry + entry-admin + ticket-types) ---

(defcomp ~events-ticket-types-layout-full (&key post-header calendar-header day-header
                                                 entry-header entry-admin-header
                                                 ticket-types-header)
  (<> (~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
                     :app-label app-label :nav-tree nav-tree :auth-menu auth-menu
                     :nav-panel nav-panel :settings-url settings-url :is-admin is-admin)
    (~header-child-sx :inner (<> post-header calendar-header day-header
                                entry-header entry-admin-header ticket-types-header))))

(defcomp ~events-ticket-types-layout-oob (&key entry-admin-oob ticket-types-oob-wrap)
  (<> entry-admin-oob ticket-types-oob-wrap))

;; --- Ticket type detail layout: root + child(post + cal + day + entry + entry-admin + types + type) ---

(defcomp ~events-ticket-type-layout-full (&key post-header calendar-header day-header
                                                entry-header entry-admin-header
                                                ticket-types-header ticket-type-header)
  (<> (~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
                     :app-label app-label :nav-tree nav-tree :auth-menu auth-menu
                     :nav-panel nav-panel :settings-url settings-url :is-admin is-admin)
    (~header-child-sx :inner (<> post-header calendar-header day-header
                                entry-header entry-admin-header
                                ticket-types-header ticket-type-header))))

(defcomp ~events-ticket-type-layout-oob (&key ticket-types-oob ticket-type-oob-wrap)
  (<> ticket-types-oob ticket-type-oob-wrap))

;; --- Markets layout: root + child(post + markets) ---

(defcomp ~events-markets-layout-full (&key post-header markets-header)
  (<> (~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
                     :app-label app-label :nav-tree nav-tree :auth-menu auth-menu
                     :nav-panel nav-panel :settings-url settings-url :is-admin is-admin)
    (~header-child-sx :inner (<> post-header markets-header))))

(defcomp ~events-markets-layout-oob (&key post-oob markets-oob-wrap)
  (<> post-oob markets-oob-wrap))
