@seatlayer/js 0.105.0 → 0.106.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{channelsMode-BS7exzUF.d.cts → channelsMode-DV9D-48T.d.cts} +90 -6
- package/dist/{channelsMode-BS7exzUF.d.ts → channelsMode-DV9D-48T.d.ts} +90 -6
- package/dist/channelsMode-W5KNSQSJ.js +1 -0
- package/dist/{chunk-K6JOQ4VE.js → chunk-CNLSM36T.js} +99 -98
- package/dist/chunk-HHV7F37Y.js +29 -0
- package/dist/chunk-T57HSGPG.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/manager.cjs +347 -314
- package/dist/manager.d.cts +2 -2
- package/dist/manager.d.ts +2 -2
- package/dist/manager.js +89 -201
- package/dist/managerExtras-K2UGS5TD.js +546 -0
- package/package.json +2 -2
- package/dist/channelsMode-GTGKGXZ3.js +0 -1
- package/dist/chunk-LLQUHT5Q.js +0 -1
- package/dist/chunk-QB6PA3C6.js +0 -1
- package/dist/managerExtras-BP2MLTS5.js +0 -430
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import{k as S}from"./chunk-QB6PA3C6.js";function ne(i){i.querySelectorAll("select:not([data-themed])").forEach(e=>{e.dataset.themed="true";let t=document.createElement("details");t.className="slm-themed-picker";let n=document.createElement("summary"),s=document.createElement("div");s.className="slm-themed-options";let a=e.getAttribute("aria-label")||Array.from(e.labels??[]).map(r=>r.textContent).join(" ")||"Choose option";n.setAttribute("aria-label",a.trim()),t.append(n,s),e.after(t),e.hidden=!0;let o=()=>{n.textContent=e.selectedOptions[0]?.textContent??"Choose\u2026",n.setAttribute("aria-disabled",String(e.disabled)),s.replaceChildren(...Array.from(e.options).map(r=>{let l=document.createElement("button");return l.type="button",l.textContent=r.textContent,l.setAttribute("aria-label",r.textContent??""),l.disabled=e.disabled||r.disabled,l.setAttribute("aria-pressed",String(r.selected)),l.onclick=()=>{e.value=r.value,t.open=!1,o(),n.focus(),e.dispatchEvent(new Event("change",{bubbles:!0})),o()},l}))};o(),e.addEventListener("change",o),n.onclick=r=>{if(e.disabled){r.preventDefault();return}o(),i.querySelectorAll(".slm-themed-picker").forEach(l=>{l!==t&&(l.open=!1)})},t.addEventListener("focusout",r=>{t.contains(r.relatedTarget)||(t.open=!1)}),t.addEventListener("keydown",r=>{if(r.key==="Escape"&&(r.preventDefault(),r.stopPropagation(),t.open=!1,n.focus()),r.key==="ArrowDown"||r.key==="ArrowUp"){if(e.disabled)return;r.preventDefault(),t.open=!0;let l=Array.from(s.querySelectorAll("button:not(:disabled)")),c=l.indexOf(document.activeElement);l[(c+(r.key==="ArrowDown"?1:l.length-1)+l.length)%l.length]?.focus()}})})}function ft(i){i.querySelectorAll('input[type="date"],input[type="datetime-local"],input[type="time"]').forEach(e=>{e.dataset.slmPicker!=="1"&&(e.dataset.slmPicker="1",e.addEventListener("click",()=>{if(!(e.disabled||e.readOnly))try{e.showPicker?.()}catch{}}))})}var ie={tag:'<path d="M3.5 12.2V4.5a1 1 0 0 1 1-1h7.7l8.3 8.3a1.4 1.4 0 0 1 0 2l-6.3 6.3a1.4 1.4 0 0 1-2 0z"/><circle cx="8" cy="8" r="1.6"/>',ban:'<circle cx="12" cy="12" r="8.5"/><path d="M6 6l12 12"/>',cursor:'<path d="M5 3.5l13 7-5.6 1.6L10 18z"/>',box:'<rect x="4" y="4" width="16" height="16" rx="2" stroke-dasharray="3 2.4"/>',search:'<circle cx="11" cy="11" r="6.5"/><path d="M16 16l4.5 4.5"/>',alert:'<path d="M12 3.8l9.3 16.2H2.7z"/><path d="M12 10v4.5M12 17.3v.2"/>',check:'<path d="M5 12.5l4.5 4.5L19 7.5"/>',eye:'<path d="M2.5 12s3.5-6.5 9.5-6.5 9.5 6.5 9.5 6.5-3.5 6.5-9.5 6.5S2.5 12 2.5 12z"/><circle cx="12" cy="12" r="3"/>',bookmark:'<path d="M6.5 3.5h11v17l-5.5-4-5.5 4z"/>',layers:'<path d="M12 3.5l8.5 4.5L12 12.5 3.5 8z"/><path d="M3.5 12L12 16.5 20.5 12"/><path d="M3.5 16L12 20.5 20.5 16"/>',table:'<circle cx="12" cy="12" r="5"/><circle cx="12" cy="3.5" r="1.6"/><circle cx="12" cy="20.5" r="1.6"/><circle cx="3.5" cy="12" r="1.6"/><circle cx="20.5" cy="12" r="1.6"/>',clock:'<circle cx="12" cy="12" r="8.5"/><path d="M12 7.5V12l3 2"/>',lock:'<rect x="5" y="10.5" width="14" height="10" rx="2"/><path d="M8 10.5V7.5a4 4 0 0 1 8 0v3"/>',info:'<circle cx="12" cy="12" r="8.5"/><path d="M12 11v5.5M12 7.6v.2"/>',user:'<circle cx="12" cy="8" r="3.8"/><path d="M4.5 20.5a7.5 7.5 0 0 1 15 0"/>',bolt:'<path d="M13 3L5 13.5h6l-1 7.5 8-10.5h-6z"/>',star:'<path d="M12 3.8l2.5 5.2 5.7.8-4.1 4 1 5.6L12 16.8l-5.1 2.6 1-5.6-4.1-4 5.7-.8z"/>',seat:'<path d="M7 11V6.5a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2V11"/><path d="M5 11h14v4H5z"/><path d="M7 15v4.5M17 15v4.5"/>',gauge:'<path d="M4 16a8 8 0 1 1 16 0"/><path d="M12 16l4-5"/>',bell:'<path d="M6 16V11a6 6 0 0 1 12 0v5l1.5 2h-15z"/><path d="M10 20.5a2 2 0 0 0 4 0"/>',undo:'<path d="M8.5 5L4 9.5 8.5 14"/><path d="M4 9.5h10a6 6 0 0 1 0 12h-3"/>',plus:'<path d="M12 5v14M5 12h14"/>',palette:'<path d="M12 3.5a8.5 8.5 0 1 0 0 17c1.2 0 1.8-.8 1.8-1.7 0-1.3-1-1.6-1-2.8 0-1 .8-1.7 1.8-1.7h2.2a3.7 3.7 0 0 0 3.7-3.7C20.5 6.4 16.7 3.5 12 3.5z"/><circle cx="7.8" cy="11" r="1.2"/><circle cx="10.5" cy="7.3" r="1.2"/><circle cx="15" cy="7.6" r="1.2"/>',x:'<path d="M6 6l12 12M18 6L6 18"/>',ticket:'<path d="M3.5 8.5V6a1 1 0 0 1 1-1h15a1 1 0 0 1 1 1v2.5a2.5 2.5 0 0 0 0 5V16a1 1 0 0 1-1 1h-15a1 1 0 0 1-1-1v-2.5a2.5 2.5 0 0 0 0-5z"/><path d="M14 5.5v11" stroke-dasharray="1.6 2"/>',history:'<path d="M4 12a8 8 0 1 0 2.3-5.6"/><path d="M4 4.5v3.5h3.5"/><path d="M12 8v4.2l2.8 1.8"/>',spark:'<path d="M12 3.5l1.8 5 5 1.8-5 1.8-1.8 5-1.8-5-5-1.8 5-1.8z"/><path d="M18.5 15.5l.7 1.8 1.8.7-1.8.7-.7 1.8-.7-1.8-1.8-.7 1.8-.7z"/>',lasso:'<ellipse cx="12" cy="9.5" rx="8" ry="5.5" stroke-dasharray="3 2.4"/><path d="M8.5 14.5c-1.5 1.2-1.6 3.4.2 4.2 1.4.6 2.8-.3 2.8-1.7"/>',hand:'<path d="M8 13V6a2 2 0 0 1 4 0v6-8a2 2 0 0 1 4 0v8-6a2 2 0 0 1 4 0v10c0 4-3 6-7 6-3 0-5-2-7-5l-3-4a2 2 0 0 1 3-2l2 2Z"/>',fit:'<path d="M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5"/>',route:'<circle cx="6" cy="6" r="2.2"/><circle cx="18" cy="18" r="2.2"/><path d="M8.2 6H15a3 3 0 0 1 0 6H9a3 3 0 0 0 0 6h6.8"/>'};function P(i,e,t=30){let n=Math.round(t*.58);return`<span class="slm-plate" style="width:${t}px;height:${t}px;background:color-mix(in srgb,${e} 15%,transparent)"><svg width="${n}" height="${n}" viewBox="0 0 24 24" fill="none" stroke="${e}" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${ie[i]??""}</svg></span>`}var wt={booked:["seat","#8a94a6"],free:["seat","#22a06b"],held:["clock","#d99a0b"],blocked:["ban","#d64545"],reserved:["bookmark","#c026d3"]};function Y(i,e="currentColor",t=16){return`<svg width="${t}" height="${t}" viewBox="0 0 24 24" fill="none" stroke="${e}" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${ie[i]??""}</svg>`}function ae(i){return`<div class="slm-railhead slm-taskhead">${P(i.glyph,i.hue)}<p class="slm-eyebrow">${S(i.title)}</p>${i.badge?`<span class="slm-scope event">${S(i.badge)}</span>`:""}</div><p class="slm-hint">${i.purpose}${i.how?` <button type="button" class="slm-howlink" data-how="${i.how}">How it works \u203A</button>`:""}</p>`}function xt(){return'<div class="slm-selcard" data-ref="selcard" aria-live="polite"></div>'}function Be(){return typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent)?"\u2318K":"Ctrl K"}function se(){return typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches}var Oe=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent)?"\u2318Z":"Ctrl Z",_e='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg>',qe=[["cursor","#d99a0b","Click a seat","or anywhere near it"],["box","#d99a0b","Drag on the map","to draw a box"],["search","#4c6fff","Find","a seat, row or section with "]],Ne=[["cursor","#d99a0b","Tap a seat","or anywhere near it"],["box","#d99a0b","Press and hold, then drag","to draw a box"],["search","#4c6fff","Find","a seat, row or section"]];function St(i,e){if(i.classList.toggle("empty",e.count===0),!e.count){i.innerHTML=`<div class="slm-selcount"><b>0</b> seats selected<button type="button" class="slm-linkbtn" data-sel-all>Select all</button></div><div class="slm-ways">${(se()?Ne:qe).map(([n,s,a,o])=>`<span>${P(n,s,26)}<span><b>${a}</b>${o}${n==="search"&&!se()?Be():""}</span></span>`).join("")}${e.saved?`<button type="button" class="slm-savedrow" data-saved-list>${P("star","#d99a0b",26)}<span><b>Saved selections</b>${e.saved.toLocaleString()} on this event</span>${_e}</button>`:""}</div>`;return}let t=e.count===1?"seat":"seats";i.innerHTML=`<div class="slm-selcount"><b>${e.count.toLocaleString()}</b> ${t} selected<button type="button" class="slm-linkbtn" data-sel-clear>Clear</button></div><p class="slm-selwhere">${S(e.where)}</p><div class="slm-selparts">${e.parts.map(n=>`<span class="tone-${n.tone}">${S(n.label)}</span>`).join("")}${e.types.map(n=>`<span class="type"><i style="background:${S(n.color)}"></i>${S(n.label)} ${n.count.toLocaleString()}</span>`).join("")}</div>`+(e.stale?`<p class="slm-selstale">${P("alert","#b45309",20)}${S(e.stale)}</p>`:"")+`<div class="slm-selbtns">${e.canSimilar?`<span class="slm-simwrap"><button type="button" class="slm-btn ghost" data-sel-similar aria-haspopup="menu" aria-expanded="false">${Y("spark","#d99a0b")}Select similar</button></span>`:""}<button type="button" class="slm-btn ghost" data-sel-undo title="Undo the last change to the selection (${Oe})"${e.canUndo?"":" disabled"}>${Y("undo","#64748b")}Undo</button>${e.canSave?`<button type="button" class="slm-btn ghost slm-selsave" data-sel-save>${Y("star","#d99a0b")}Save</button>`:""}</div>`}function Ue(i){return i.length?i.length===1?`row ${i[0]}`:i.length<=4?`rows ${i[0]}\u2013${i[i.length-1]}`:`${i.length} rows`:""}function Ct(i){if(!i.length)return"";if(i.length===1){let t=Ue(i[0].rows);return t?`${i[0].label} \xB7 ${t}`:i[0].label}let e=i.slice(0,2).map(t=>t.label).join(", ");return`${i.length} sections: ${e}${i.length>2?"\u2026":""}`}function y(i,e,t,n){return`<div class="slm-panelalert ${i}" role="${i==="error"?"alert":"status"}">${P(n??(i==="ok"?"check":"alert"),i==="error"?"#d64545":i==="warn"?"#b45309":i==="ok"?"#22a06b":"#3b82f6",24)}<span><b>${S(e)}</b>${S(t)}</span></div>`}function $t(i){return`<div class="slm-railfoot" data-ref="${i}"><button type="button" class="slm-btn" data-foot-action></button><button type="button" class="slm-linkbtn" data-foot-secondary hidden></button><p class="slm-note" data-foot-note></p></div>`}function Lt(i,e){let t=i.querySelector("[data-foot-action]"),n=i.querySelector("[data-foot-note]");t&&(t.textContent=e.label,t.disabled=!!e.disabled||!!e.busy,t.classList.toggle("danger",!!e.danger),t.classList.toggle("busy",!!e.busy),t.setAttribute("aria-busy",String(!!e.busy)));let s=i.querySelector("[data-foot-secondary]");s&&(s.hidden=!e.secondary,s.textContent=e.secondary??"",s.disabled=!!e.busy),n&&(n.textContent=e.note??"",n.hidden=!e.note)}function Ve(i,e){if(!i.labels.length)return"Nothing found";let t=[];i.sections&&t.push(`${i.sections.toLocaleString()} section${i.sections===1?"":"s"}`),i.rows&&t.push(`${i.rows.toLocaleString()} row${i.rows===1?"":"s"}`);let n=`${i.labels.length.toLocaleString()} seat${i.labels.length===1?"":"s"} found`,s=t.length?`${t.join(" \xB7 ")} \xB7 ${n}`:n;return e?`${s} \xB7 Enter to ${e==="frame"?"show":"select"}`:s}function Fe(i={}){return`
|
|
1
|
+
import{a as ne,m as S}from"./chunk-T57HSGPG.js";var ie={tag:'<path d="M3.5 12.2V4.5a1 1 0 0 1 1-1h7.7l8.3 8.3a1.4 1.4 0 0 1 0 2l-6.3 6.3a1.4 1.4 0 0 1-2 0z"/><circle cx="8" cy="8" r="1.6"/>',ban:'<circle cx="12" cy="12" r="8.5"/><path d="M6 6l12 12"/>',cursor:'<path d="M5 3.5l13 7-5.6 1.6L10 18z"/>',box:'<rect x="4" y="4" width="16" height="16" rx="2" stroke-dasharray="3 2.4"/>',search:'<circle cx="11" cy="11" r="6.5"/><path d="M16 16l4.5 4.5"/>',alert:'<path d="M12 3.8l9.3 16.2H2.7z"/><path d="M12 10v4.5M12 17.3v.2"/>',check:'<path d="M5 12.5l4.5 4.5L19 7.5"/>',eye:'<path d="M2.5 12s3.5-6.5 9.5-6.5 9.5 6.5 9.5 6.5-3.5 6.5-9.5 6.5S2.5 12 2.5 12z"/><circle cx="12" cy="12" r="3"/>',bookmark:'<path d="M6.5 3.5h11v17l-5.5-4-5.5 4z"/>',layers:'<path d="M12 3.5l8.5 4.5L12 12.5 3.5 8z"/><path d="M3.5 12L12 16.5 20.5 12"/><path d="M3.5 16L12 20.5 20.5 16"/>',table:'<circle cx="12" cy="12" r="5"/><circle cx="12" cy="3.5" r="1.6"/><circle cx="12" cy="20.5" r="1.6"/><circle cx="3.5" cy="12" r="1.6"/><circle cx="20.5" cy="12" r="1.6"/>',clock:'<circle cx="12" cy="12" r="8.5"/><path d="M12 7.5V12l3 2"/>',lock:'<rect x="5" y="10.5" width="14" height="10" rx="2"/><path d="M8 10.5V7.5a4 4 0 0 1 8 0v3"/>',info:'<circle cx="12" cy="12" r="8.5"/><path d="M12 11v5.5M12 7.6v.2"/>',user:'<circle cx="12" cy="8" r="3.8"/><path d="M4.5 20.5a7.5 7.5 0 0 1 15 0"/>',bolt:'<path d="M13 3L5 13.5h6l-1 7.5 8-10.5h-6z"/>',star:'<path d="M12 3.8l2.5 5.2 5.7.8-4.1 4 1 5.6L12 16.8l-5.1 2.6 1-5.6-4.1-4 5.7-.8z"/>',seat:'<path d="M7 11V6.5a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2V11"/><path d="M5 11h14v4H5z"/><path d="M7 15v4.5M17 15v4.5"/>',gauge:'<path d="M4 16a8 8 0 1 1 16 0"/><path d="M12 16l4-5"/>',bell:'<path d="M6 16V11a6 6 0 0 1 12 0v5l1.5 2h-15z"/><path d="M10 20.5a2 2 0 0 0 4 0"/>',undo:'<path d="M8.5 5L4 9.5 8.5 14"/><path d="M4 9.5h10a6 6 0 0 1 0 12h-3"/>',plus:'<path d="M12 5v14M5 12h14"/>',palette:'<path d="M12 3.5a8.5 8.5 0 1 0 0 17c1.2 0 1.8-.8 1.8-1.7 0-1.3-1-1.6-1-2.8 0-1 .8-1.7 1.8-1.7h2.2a3.7 3.7 0 0 0 3.7-3.7C20.5 6.4 16.7 3.5 12 3.5z"/><circle cx="7.8" cy="11" r="1.2"/><circle cx="10.5" cy="7.3" r="1.2"/><circle cx="15" cy="7.6" r="1.2"/>',x:'<path d="M6 6l12 12M18 6L6 18"/>',ticket:'<path d="M3.5 8.5V6a1 1 0 0 1 1-1h15a1 1 0 0 1 1 1v2.5a2.5 2.5 0 0 0 0 5V16a1 1 0 0 1-1 1h-15a1 1 0 0 1-1-1v-2.5a2.5 2.5 0 0 0 0-5z"/><path d="M14 5.5v11" stroke-dasharray="1.6 2"/>',history:'<path d="M4 12a8 8 0 1 0 2.3-5.6"/><path d="M4 4.5v3.5h3.5"/><path d="M12 8v4.2l2.8 1.8"/>',spark:'<path d="M12 3.5l1.8 5 5 1.8-5 1.8-1.8 5-1.8-5-5-1.8 5-1.8z"/><path d="M18.5 15.5l.7 1.8 1.8.7-1.8.7-.7 1.8-.7-1.8-1.8-.7 1.8-.7z"/>',lasso:'<ellipse cx="12" cy="9.5" rx="8" ry="5.5" stroke-dasharray="3 2.4"/><path d="M8.5 14.5c-1.5 1.2-1.6 3.4.2 4.2 1.4.6 2.8-.3 2.8-1.7"/>',hand:'<path d="M8 13V6a2 2 0 0 1 4 0v6-8a2 2 0 0 1 4 0v8-6a2 2 0 0 1 4 0v10c0 4-3 6-7 6-3 0-5-2-7-5l-3-4a2 2 0 0 1 3-2l2 2Z"/>',fit:'<path d="M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5"/>',route:'<circle cx="6" cy="6" r="2.2"/><circle cx="18" cy="18" r="2.2"/><path d="M8.2 6H15a3 3 0 0 1 0 6H9a3 3 0 0 0 0 6h6.8"/>'};function M(i,e,t=30){let n=Math.round(t*.58);return`<span class="slm-plate" style="width:${t}px;height:${t}px;background:color-mix(in srgb,${e} 15%,transparent)"><svg width="${n}" height="${n}" viewBox="0 0 24 24" fill="none" stroke="${e}" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${ie[i]??""}</svg></span>`}var yt={booked:["seat","#8a94a6"],free:["seat","#22a06b"],held:["clock","#d99a0b"],blocked:["ban","#d64545"],reserved:["bookmark","#c026d3"]};function B(i,e="currentColor",t=16){return`<svg width="${t}" height="${t}" viewBox="0 0 24 24" fill="none" stroke="${e}" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${ie[i]??""}</svg>`}function ae(i){return`<div class="slm-railhead slm-taskhead">${M(i.glyph,i.hue)}<p class="slm-eyebrow">${S(i.title)}</p>${i.badge?`<span class="slm-scope event">${S(i.badge)}</span>`:""}</div><p class="slm-hint">${i.purpose}${i.how?` <button type="button" class="slm-howlink" data-how="${i.how}">How it works \u203A</button>`:""}</p>`}function kt(){return'<div class="slm-selcard" data-ref="selcard" aria-live="polite"></div>'}function oe(){return typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent)?"\u2318K":"Ctrl K"}function wt(){return oe().replace("\u2318","\u2318 ").split(" ").map(i=>`<kbd>${i}</kbd>`).join("")}function se(){return typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches}var Oe=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent)?"\u2318Z":"Ctrl Z",_e='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg>',qe=[["cursor","#d99a0b","Click a seat","or anywhere near it"],["box","#d99a0b","Drag on the map","to draw a box"],["search","#4c6fff","Search",", then Enter"]],Ne=[["cursor","#d99a0b","Tap a seat","or anywhere near it"],["box","#d99a0b","Press and hold, then drag","to draw a box"],["search","#4c6fff","Find","a seat, row or section"]];function xt(i,e){if(i.classList.toggle("empty",e.count===0),!e.count){i.innerHTML=`<div class="slm-selcount"><b>0</b> seats selected</div><div class="slm-ways">${(se()?Ne:qe).map(([n,s,a,o])=>`<span>${M(n,s,26)}<span><b>${a}</b>${n==="search"&&!se()?oe():""}${o}</span></span>`).join("")}${e.saved?`<button type="button" class="slm-savedrow" data-saved-list>${M("star","#d99a0b",26)}<span><b>Saved selections</b>${e.saved.toLocaleString()} on this event</span>${_e}</button>`:""}</div>`;return}let t=e.count===1?"seat":"seats";i.innerHTML=`<div class="slm-selcount"><b>${e.count.toLocaleString()}</b> ${t} selected<button type="button" class="slm-linkbtn" data-sel-clear>Clear</button></div><p class="slm-selwhere">${S(e.where)}</p><div class="slm-selparts">${e.parts.map(n=>`<span class="tone-${n.tone}">${S(n.label)}</span>`).join("")}${e.types.map(n=>`<span class="type"><i style="background:${S(n.color)}"></i>${S(n.label)}${n.count==null?"":` ${n.count.toLocaleString()}`}</span>`).join("")}</div>`+(e.stale?`<p class="slm-selstale">${M("alert","#b45309",20)}${S(e.stale)}</p>`:"")+`<div class="slm-selbtns">${e.canSimilar?`<span class="slm-simwrap"><button type="button" class="slm-btn ghost" data-sel-similar aria-haspopup="menu" aria-expanded="false">${B("spark","#d99a0b")}Select similar</button></span>`:""}<button type="button" class="slm-btn ghost" data-sel-undo title="Undo the last change to the selection (${Oe})"${e.canUndo?"":" disabled"}>${B("undo","#64748b")}Undo</button>${e.canSave?`<button type="button" class="slm-btn ghost slm-selsave" data-sel-save>${B("star","#d99a0b")}Save</button>`:""}</div>`}function Ue(i){return i.length?i.length===1?`row ${i[0]}`:i.length<=4?`rows ${i[0]}\u2013${i[i.length-1]}`:`${i.length} rows`:""}function St(i){if(!i.length)return"";if(i.length===1){let t=Ue(i[0].rows);return t?`${i[0].label} \xB7 ${t}`:i[0].label}let e=i.slice(0,2).map(t=>t.label).join(", ");return`${i.length} sections: ${e}${i.length>2?"\u2026":""}`}function v(i,e,t,n){return`<div class="slm-panelalert ${i}" role="${i==="error"?"alert":"status"}">${B(n??(i==="ok"?"check":"alert"),"currentColor",18)}<span><b>${S(e)}</b>${S(t)}</span></div>`}function Ct(i){return`<div class="slm-railfoot" data-ref="${i}"><button type="button" class="slm-btn" data-foot-action></button><button type="button" class="slm-linkbtn" data-foot-secondary hidden></button><p class="slm-note" data-foot-note></p></div>`}function $t(i,e){let t=i.querySelector("[data-foot-action]"),n=i.querySelector("[data-foot-note]");t&&(t.textContent=e.label,t.disabled=!!e.disabled||!!e.busy,t.classList.toggle("danger",!!e.danger),t.classList.toggle("busy",!!e.busy),t.setAttribute("aria-busy",String(!!e.busy)));let s=i.querySelector("[data-foot-secondary]");s&&(s.hidden=!e.secondary,s.innerHTML=e.secondary?`${e.look?B("undo","currentColor",14):""}${S(e.secondary)}`:"",s.disabled=!!e.busy),n&&(n.textContent=e.note??"",n.hidden=!e.note),i.classList.toggle("done",e.look==="done"),i.classList.toggle("settle",e.look==="settle")}function Ve(i,e){if(!i.labels.length)return"Nothing found";let t=[];i.sections&&t.push(`${i.sections.toLocaleString()} section${i.sections===1?"":"s"}`),i.rows&&t.push(`${i.rows.toLocaleString()} row${i.rows===1?"":"s"}`);let n=`${i.labels.length.toLocaleString()} seat${i.labels.length===1?"":"s"} found`,s=t.length?`${t.join(" \xB7 ")} \xB7 ${n}`:n;return e?`${s} \xB7 Enter to ${e==="frame"?"show":"select"}`:s}function Fe(i={}){return`
|
|
2
2
|
<div class="slm-find${i.compact?" slm-find-bar":""}" data-ch-find>
|
|
3
3
|
<input type="search" class="slm-input" data-ch-find-input placeholder="Find seat, row or section" aria-label="Find seat, row or section" autocomplete="off"${i.compact?' aria-keyshortcuts="/"':""}>
|
|
4
4
|
<span class="slm-find-count" data-ch-find-count role="status"></span>
|
|
5
|
-
</div>`}function
|
|
5
|
+
</div>`}function re(i,e){return i.toLocaleLowerCase().split(/\s+/).some(t=>e.length>=2?t.startsWith(e):t===e)}function ze(i,e){let t=i.trim().toLocaleLowerCase();if(!t)return{labels:[],seats:0,rows:0,sections:0};let n=new Set,s=0,a=0;for(let d of e.sections)if(re(d.label,t)){s+=1;for(let u of d.labels)n.add(u)}let o=t.split(/\s+/),r=o[o.length-1],l=o.slice(0,-1).join(" ");for(let d of e.rows)if(d.label.toLocaleLowerCase()===r&&!(l&&!re(d.sectionLabel,l))){a+=1;for(let u of d.labels)n.add(u)}let c=0;for(let d of e.seatLabels){let u=d.toLocaleLowerCase();(u===t||u.startsWith(`${t}-`))&&(n.has(d)||(c+=1),n.add(d))}return{labels:[...n],seats:c,rows:a,sections:s}}function At(i){let e=i.clearAttr?`<button type="button" class="slm-linkbtn slm-selclear" ${i.clearAttr}${i.count?"":" disabled"}>Clear</button>`:"";return`<div class="slm-selbar" aria-live="polite">
|
|
6
6
|
<span class="slm-selnum${i.bump?" bump":""}">${i.count.toLocaleString()}</span>
|
|
7
7
|
<span class="slm-sellabel">${S(i.noun??"selected")}</span>
|
|
8
8
|
${i.breakdown??""}${e}
|
|
9
|
-
</div>`}var je=i=>`${i.toLocaleString()} ${i===1?"seat":"seats"}`,Ye=(i,e)=>`${i.toLocaleString()} free of ${e.toLocaleString()}`,
|
|
9
|
+
</div>`}var je=i=>`${i.toLocaleString()} ${i===1?"seat":"seats"}`,Ye=(i,e)=>`${i.toLocaleString()} free of ${e.toLocaleString()}`,q=class{constructor(e){this.host=e;this.rowsCache=null;this.seatListSection=null;this.seatListCap=null;this.menu=null;this.opening=!1}rows(){return this.rowsCache||(this.rowsCache=this.host.rows()),this.rowsCache}reset(){this.rowsCache=null,this.seatListSection=null,this.menu?.remove(),this.menu=null}chipsHtml(e={}){let t=this.host.sections().length?'<button type="button" class="slm-btn ghost" data-ch-act="pick-sections">Section</button>':"",n=this.rows().length?'<button type="button" class="slm-btn ghost" data-ch-act="pick-rows">Rows\u2026</button>':"",s=this.host.categories().length?'<button type="button" class="slm-btn ghost" data-ch-act="pick-category">Category</button>':"",a=e.find===!1?"":Fe();return`
|
|
10
10
|
<div class="slm-chooser" data-ch-chooser>
|
|
11
11
|
<div class="slm-ch-row2">${e.intents??""}${t}${n}</div>
|
|
12
12
|
<div class="slm-ch-row2">${s}<button type="button" class="slm-btn ghost" data-ch-act="seatlist">Seat list</button>${e.saved?'<button type="button" class="slm-btn ghost" data-saved-open>Saved\u2026</button>':""}</div>
|
|
13
13
|
${a}
|
|
14
|
-
</div>`}wire(e,t={}){this.wireChips(e),this.wireFind(e,t)}wireChips(e){e.querySelectorAll("[data-ch-act]").forEach(t=>{let n=t.dataset.chAct;n==="pick-sections"?t.addEventListener("click",()=>this.openSections(t)):n==="pick-rows"?t.addEventListener("click",()=>this.openRows()):n==="pick-category"?t.addEventListener("click",()=>this.openCategory()):n==="seatlist"&&t.addEventListener("click",()=>this.openSeatList())})}handleAction(e){if(e==="pick-sections")this.openSections();else if(e==="pick-rows")this.openRows();else if(e==="pick-category")this.openCategory();else if(e==="seatlist")this.openSeatList();else return!1;return!0}wireFind(e,t={}){let n=e.querySelector("[data-ch-find-input]"),s=e.querySelector("[data-ch-find-count]");if(!n||!s)return;let a={labels:[],seats:0,rows:0,sections:0},o=l=>{s.textContent=l,s.title=l},r=()=>{let l=n.value.trim();a=this.find(n.value),o(l?Ve(a,t.enter??"select"):""),this.host.highlight?.(l?a.labels:null),t.onFind?.(a)};n.addEventListener("input",r),n.addEventListener("keydown",l=>{if(l.key==="Escape"&&n.value){l.preventDefault(),l.stopPropagation(),n.value="",r();return}if(l.key!=="Enter"||(l.preventDefault(),!a.labels.length))return;if(t.enter==="frame"){this.host.frame?.(a.labels),o(`${a.labels.length.toLocaleString()} on the map`);return}let c=new Set([...this.host.selectionLabels(),...a.labels]);if(this.host.cap!=null&&c.size>this.host.cap){o(`That would make ${c.size.toLocaleString()} selected seats \u2014 the limit is ${this.host.cap.toLocaleString()}.`);return}this.host.selectByLabels(a.labels),o(`${a.labels.length.toLocaleString()} selected`)}),n.addEventListener("search",r)}find(e){return ze(e,{sections:this.host.sections().map(t=>({...t,labels:this.host.labelsInSection(t.id)})),rows:this.rows(),seatLabels:this.host.seats().map(t=>t.label)})}openCategory(){this.openPicker("pick-category",e=>e.openCategory(this))}openRows(){this.openPicker("pick-rows",e=>e.openRows(this))}openSeatList(e=""){this.openPicker("seatlist",t=>t.openSeatList(this,e))}openPicker(e,t){if(this.opening||!this.host.pickers)return;let n=this.host.pickers();if(!(n instanceof Promise)){t(n);return}this.opening=!0;let s=[...document.querySelectorAll(`[data-ch-act="${e}"]`)];s.forEach(a=>a.setAttribute("aria-busy","true")),n.then(t,()=>this.host.pickerFailed?.(()=>this.openPicker(e,t))).finally(()=>{this.opening=!1,s.forEach(a=>a.removeAttribute("aria-busy"))})}openSections(e){let t=e??document.querySelector('[data-ch-act="pick-sections"]');this.menu?.remove(),this.menu=null;let n=this.host.cap??1/0,s=this.host.sections().map(c=>{let
|
|
14
|
+
</div>`}wire(e,t={}){this.wireChips(e),this.wireFind(e,t)}wireChips(e){e.querySelectorAll("[data-ch-act]").forEach(t=>{let n=t.dataset.chAct;n==="pick-sections"?t.addEventListener("click",()=>this.openSections(t)):n==="pick-rows"?t.addEventListener("click",()=>this.openRows()):n==="pick-category"?t.addEventListener("click",()=>this.openCategory()):n==="seatlist"&&t.addEventListener("click",()=>this.openSeatList())})}handleAction(e){if(e==="pick-sections")this.openSections();else if(e==="pick-rows")this.openRows();else if(e==="pick-category")this.openCategory();else if(e==="seatlist")this.openSeatList();else return!1;return!0}wireFind(e,t={}){let n=e.querySelector("[data-ch-find-input]"),s=e.querySelector("[data-ch-find-count]");if(!n||!s)return;let a={labels:[],seats:0,rows:0,sections:0},o=l=>{s.textContent=l,s.title=l},r=()=>{let l=n.value.trim();a=this.find(n.value),o(l?Ve(a,t.enter??"select"):""),this.host.highlight?.(l?a.labels:null),t.onFind?.(a)};n.addEventListener("input",r),n.addEventListener("keydown",l=>{if(l.key==="Escape"&&n.value){l.preventDefault(),l.stopPropagation(),n.value="",r();return}if(l.key!=="Enter"||(l.preventDefault(),!a.labels.length))return;if(t.enter==="frame"){this.host.frame?.(a.labels),o(`${a.labels.length.toLocaleString()} on the map`);return}let c=new Set([...this.host.selectionLabels(),...a.labels]);if(this.host.cap!=null&&c.size>this.host.cap){o(`That would make ${c.size.toLocaleString()} selected seats \u2014 the limit is ${this.host.cap.toLocaleString()}.`);return}this.host.selectByLabels(a.labels),o(`${a.labels.length.toLocaleString()} selected`)}),n.addEventListener("search",r)}find(e){return ze(e,{sections:this.host.sections().map(t=>({...t,labels:this.host.labelsInSection(t.id)})),rows:this.rows(),seatLabels:this.host.seats().map(t=>t.label)})}openCategory(){this.openPicker("pick-category",e=>e.openCategory(this))}openRows(){this.openPicker("pick-rows",e=>e.openRows(this))}openSeatList(e=""){this.openPicker("seatlist",t=>t.openSeatList(this,e))}openPicker(e,t){if(this.opening||!this.host.pickers)return;let n=this.host.pickers();if(!(n instanceof Promise)){t(n);return}this.opening=!0;let s=[...document.querySelectorAll(`[data-ch-act="${e}"]`)];s.forEach(a=>a.setAttribute("aria-busy","true")),n.then(t,()=>this.host.pickerFailed?.(()=>this.openPicker(e,t))).finally(()=>{this.opening=!1,s.forEach(a=>a.removeAttribute("aria-busy"))})}openSections(e){let t=e??document.querySelector('[data-ch-act="pick-sections"]');this.menu?.remove(),this.menu=null;let n=this.host.cap??1/0,s=this.host.sections().map(c=>{let d=this.host.labelsInSection(c.id),u=this.host.sectionInfo?.(c.id);return{...c,labels:d,total:u?.total??d.length,color:u?.color}}).filter(c=>c.total>0),a=document.createElement("div");a.className="slm-ch-secmenu",a.setAttribute("role","menu"),a.innerHTML=`<p class="slm-ch-menuhead">Add a whole section</p>${s.map(c=>`
|
|
15
15
|
<button type="button" role="menuitem" data-ch-scope-id="${S(c.id)}"${c.labels.length?"":" disabled"}>
|
|
16
16
|
<span class="dot" style="background:${S(c.color??"#6e7bff")}" aria-hidden="true"></span>
|
|
17
17
|
<span><b>${S(c.label)}</b><small>${Ye(c.labels.length,c.total)}</small></span>
|
|
18
|
-
</button>`).join("")||'<p class="slm-ch-menuhead">This chart has no sections with free seats.</p>'}<p class="slm-ch-menuerr" data-ch-error hidden></p>`;let o=t?.parentElement??document.body;o.style.position=o===document.body?o.style.position:"relative",o.appendChild(a),this.menu=a;let r=()=>{a.remove(),this.menu===a&&(this.menu=null),document.removeEventListener("pointerdown",l,!0)},l=c=>{!a.contains(c.target)&&c.target!==t&&r()};document.addEventListener("pointerdown",l,!0),a.addEventListener("keydown",c=>{let h=[...a.querySelectorAll("button:not([disabled])")],u=h.indexOf(document.activeElement);c.key==="Escape"?(r(),t?.focus(),c.preventDefault()):(c.key==="ArrowDown"||c.key==="ArrowUp")&&(h[(u+(c.key==="ArrowDown"?1:-1)+h.length)%h.length]?.focus(),c.preventDefault())}),a.querySelectorAll("[data-ch-scope-id]").forEach(c=>c.addEventListener("click",()=>{let h=s.find(m=>m.id===c.dataset.chScopeId);if(!h)return;let u=new Set([...this.host.selectionLabels(),...h.labels]);if(u.size>n){let m=a.querySelector("[data-ch-error]");m.hidden=!1,m.textContent=`That would make ${je(u.size)}. One change can take up to ${n.toLocaleString()}.`;return}r(),this.host.selectByLabels([...u])})),a.querySelector("button:not([disabled])")?.focus()}};var b="public",C="Public sale";function $(i){return i==null||i===""||i===b}var U=["#a78bfa","#2dd4bf","#fb923c","#60a5fa","#f472b6","#a3e635","#f87171","#38bdf8","#c084fc","#facc15"],Ke="#f4b740",re="ABCDEFGHJKLMNPQRSTUVWXYZ";function T(i,e){let t=(i??"").trim();return((/\p{L}/u.exec(t)?.[0]??t[0]??"")||e).toUpperCase().slice(0,1)}function W(i,e){let t=new Set([...e].map(a=>T(a,"")).filter(Boolean)),n=T(i,"");return{letter:re.includes(n)&&!t.has(n)?n:[...re].find(a=>!t.has(a))??(n||"X"),color:U[t.size%U.length]}}function ce(i,e=0){return $(i.id)?{letter:T(i.marker,"P"),color:i.color||Ke}:{letter:T(i.marker||i.name,"?"),color:i.color||U[e%U.length]}}function he(i,e,t){let n=new Map;for(let o of i){let r=X(e.get(o));n.set(r,(n.get(r)??0)+1)}let s=[{id:b,name:t?.publicSale?.name??C},...(t?.channels??[]).map(o=>({id:o.id,name:o.name}))],a=[];for(let o of s){let r=n.get(o.id);r&&a.push({channelId:o.id,name:o.name,count:r}),n.delete(o.id)}for(let[o,r]of n)a.push({channelId:o,name:$(o)?C:"Another channel",count:r});return a}function X(i){return $(i)?b:i}var le=12;function K(i){return{count:i.length,labels:i.slice(0,le),truncated:i.length>le}}function de(i){let{labels:e,allocation:t,statusOf:n,nameOf:s}=i,a=X(i.targetChannelId),o=new Set,r=0,l=0,c=new Map,h=[],u=[],m=[];for(let k of e){if(o.has(k))continue;o.add(k);let L=n(k);if(!L){m.push(k);continue}let A=X(t.get(k));if(A===a){l+=1;continue}if(L==="held"){h.push(k);continue}if(L==="booked"){u.push(k);continue}A===b?r+=1:c.set(A,(c.get(A)??0)+1)}let g=[...c.entries()].map(([k,L])=>({channelId:k,name:s(k),count:L}));return{changedFromPublic:{count:r},movedFromOtherChannel:{count:g.reduce((k,L)=>k+L.count,0),channels:g},alreadyInTarget:{count:l},skippedHeld:K(h),skippedBooked:K(u),notFound:K(m)}}function V(i){return i.changedFromPublic.count+i.movedFromOtherChannel.count}function Pt(i){return i.movedFromOtherChannel.count>0}function ue(i,e){let t=[];i.changedFromPublic.count&&t.push({kind:"add",icon:"+",count:i.changedFromPublic.count,text:`${i.changedFromPublic.count.toLocaleString()} from ${C}`});for(let n of i.movedFromOtherChannel.channels)t.push({kind:"move",icon:"\u21C4",count:n.count,text:`${n.count.toLocaleString()} moved out of ${n.name??"another channel"}`,why:"this needs your OK"});return i.alreadyInTarget.count&&t.push({kind:"same",icon:"=",count:i.alreadyInTarget.count,text:`${i.alreadyInTarget.count.toLocaleString()} already in ${e}`,why:"unchanged"}),i.skippedHeld.count&&t.push({kind:"skip",icon:"\u23F8",count:i.skippedHeld.count,text:`${i.skippedHeld.count.toLocaleString()} in a buyer's cart`,why:"can't move while held",peek:N(i.skippedHeld)}),i.skippedBooked.count&&t.push({kind:"skip",icon:"\u{1F512}",count:i.skippedBooked.count,text:`${i.skippedBooked.count.toLocaleString()} already sold`,why:"sales are never rewritten",peek:N(i.skippedBooked)}),i.notFound.count&&t.push({kind:"skip",icon:"?",count:i.notFound.count,text:`${i.notFound.count.toLocaleString()} not on this map`,why:"these seats are no longer part of the event",peek:N(i.notFound)}),t}function N(i){if(!i.labels.length)return;let e=i.labels.slice(0,4).join(", ");return i.truncated||i.labels.length>4?`${e}\u2026`:e}function pe(i){let e=i?.retryAfterMs??(i?.latestHoldExpiresAt?Math.max(0,i.latestHoldExpiresAt-Date.now()):0);if(!e)return"in a moment";let t=Math.ceil(e/6e4);return t<=1?"in about a minute":`in about ${t} minutes`}function me(i){if(!i||!i.intent)return"\u2014";let e=i.intent==="server"?"Your website or app":i.intent==="hosted_link"?"Buyer links":i.intent==="internal"?"Your own staff sell these":"Protected reserve",t=i.hasActiveGrants?"in use now":i.lastMintAt?`last used ${new Date(i.lastMintAt).toLocaleDateString()}`:null,n=i.detail??t;return n?`${e} \xB7 ${n}`:e}function H(i){return i==="internal"?"Sell through your own staff":i==="server"?"Integrate a website or app":i==="hosted_link"?"Sell with a buyer link":"Keep as protected reserve"}function Tt(i){switch(i){case"internal":return"Only your own box office can sell these seats, through your secret key. Buyer links and website integrations are refused.";case"server":return"Your website's backend mints each buyer a short-lived session for these seats. Buyer links are refused; the code lives on the Embed page.";case"hosted_link":return"SeatLayer makes a link you send to a named group. They open it and buy only these seats. No other route can sell them.";default:return"Nobody can buy these seats. Every way of letting a buyer in \u2014 a buyer link, your website, even your own staff \u2014 is refused while this is the route. The seats stay out of public sale."}}function Xe(i){return i==="hosted_link"?"hosted_link":i==="server"?"server":i==="staff"?"internal":null}function F(i){let e=G(i?.accessIntent),t=Xe(i?.route),n=`This channel is set to "${H(e)}"`;return t?`${n}, so it cannot do that. Switch it to "${H(t)}" first.`:`${n}, so it cannot do that. Choose a different route for this channel first.`}function G(i){return i==="internal"||i==="server"||i==="hosted_link"||i==="none"?i:"none"}function q(i,e,t){return`${i.toLocaleString()} ${i===1?e:t}`}function ge(i){let e=Math.max(0,i?.liveAccessLinks??0),t=Math.max(0,i?.activeSessions??0),n=G(i?.from),s=G(i?.to),o=`${[e?q(e,"buyer link is live","buyer links are live"):null,t?q(t,"buyer is in a checkout","buyers are in a checkout"):null].filter(Boolean).join(", and ")||"Buyers are inside this channel"} on "${H(n)}". Moving it to "${H(s)}" changes what happens to them.`,r=[];return e&&r.push(`${q(e,"buyer link closes","buyer links close")} immediately. Anyone who has not opened it yet never will \u2014 send a new link if you still need one.`),t&&r.push(`${q(t,"buyer who is already in a checkout keeps","buyers who are already in a checkout keep")} their seats and can finish paying. Nobody is thrown out. No new buyers come in this way, so the old route empties on its own within 12 hours.`),{headline:o,consequences:r}}var Q={maxRedemptions:100,maxQuantity:4};function be(i){switch(i.status??i.state){case"active":return{text:"Active",kind:"active"};case"expired":return{text:"Expired",kind:"archived"};case"exhausted":return{text:"All used",kind:"paused"};case"rotated":return{text:"Replaced",kind:"archived"};default:return{text:"Revoked",kind:"archived"}}}function ve(i){return i.state==="active"&&i.status==="active"}function Z(i){return Number.isFinite(i)?new Date(i).toLocaleString(void 0,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit"}):"\u2014"}function Mt(i){return[{k:"Expires",v:Z(i.expiresAt)},{k:"Redemptions",v:`${i.redemptions.toLocaleString()} of ${i.maxRedemptions.toLocaleString()} used`},{k:"Seats per buyer",v:`${i.maxQuantity.toLocaleString()} seat${i.maxQuantity===1?"":"s"} maximum`},{k:"Covers",v:i.includePublic?"This channel's allocation and Public sale seats":"This channel's allocation only"}]}function fe(i){return[`${i.redemptions.toLocaleString()} of ${i.maxRedemptions.toLocaleString()} used`,`${i.maxQuantity.toLocaleString()} ${i.maxQuantity===1?"seat":"seats"} per buyer`,`ends ${Z(i.expiresAt)}`,i.includePublic?"with Public sale seats":"",i.activeSessions?`${i.activeSessions.toLocaleString()} ${i.activeSessions===1?"buyer":"buyers"} inside now`:""].filter(Boolean).join(" \xB7 ")}function ye(i){let e=`${i.maxQuantity.toLocaleString()} ${i.maxQuantity===1?"seat":"seats"} each`,t=`${i.maxRedemptions.toLocaleString()} ${i.maxRedemptions===1?"person":"people"} in all`;return`Anyone with this link can buy up to ${e}, ${t}, until ${Z(i.expiresAt)}.`+(i.includePublic?" It also opens Public sale seats.":"")}function B(i){let e=i?.serverMessage?.trim();switch(i?.code){case"invalid_expiry":case"invalid_max_redemptions":case"invalid_max_quantity":case"invalid_session_ttl":case"invalid_label":return e||"That setting is outside what a hosted link allows. Adjust it and try again.";case"too_many_access_links":return e||"This channel already has as many live links as it can hold. Revoke one before creating another.";case"access_link_not_active":return"That link is no longer active, so it cannot be rotated or revoked.";case"channel_unavailable":return"This channel is paused or archived, so it cannot let new buyers in. Resume it first.";case"channel_access_intent_forbids":return F(i?.details);case"end_active_sessions_required":return"Choose what happens to the buyers who already came in through this link.";case"not_found":return"That link is no longer here. Refresh and try again.";default:return i?.status===403?"Hosted access links need channel-management permission.":e||"That did not go through. Try again."}}function Dt(i){return(i?.channels??[]).map(e=>({kind:"skip",icon:"\u26A0",count:e.count,text:`${e.count.toLocaleString()} would leave ${e.name??"a channel"}`,why:"the new chart no longer has these seats",peek:e.labels?.length?N({count:e.count,labels:e.labels,truncated:e.truncated??!1}):void 0}))}function ke(i){return i==="builtin"?"Built-in":i==="active"?"Active":i==="paused"?"Paused":"Archived"}var we=Symbol.for("seatlayer.ManageApiError"),p=class extends Error{static[Symbol.hasInstance](e){return typeof e=="object"&&e!==null&&e[we]===!0}constructor(e,t,n,s,a,o){super(t),Object.defineProperty(this,we,{value:!0}),this.name="ManageApiError",this.status=e,this.code=n,this.conflicts=s,this.details=a,this.serverMessage=o}};async function xe(i){let t=(i.headers.get("content-type")??"").includes("application/json")?await i.json().catch(()=>null):null;if(!i.ok){let n=t;throw new p(i.status,n?.error??`request_failed_${i.status}`,n?.code,n?.conflicts,n?.details,typeof n?.message=="string"?n.message:void 0)}return t}function x(i){return i&&typeof i=="object"?i:{}}function z(i,e,t=0){return typeof i=="number"&&Number.isFinite(i)?i:typeof e=="number"&&Number.isFinite(e)?e:t}function Se(i,e){return i===null?null:typeof i=="number"&&Number.isFinite(i)?i:i!==void 0?null:typeof e=="number"&&Number.isFinite(e)?e:null}function $e(i){let e=x(i),t=z(e.bookedValue,e.bookedRevenue);return{...e,bookedValue:t,bookedRevenue:t}}function Ge(i){let e=x(i),t=x(e.report),n=Array.isArray(t.byCategory)?t.byCategory.map(a=>{let o=x(a),r=z(o.bookedValue,o.bookedRevenue);return{...o,bookedValue:r,bookedRevenue:r}}):[],s=Array.isArray(t.bySection)?t.bySection.map($e):void 0;return{...e,report:{...t,byCategory:n,...s?{bySection:s}:{}}}}function We(i){let e=x(i),t=x(e.bookedValue),n=x(e.revenue),s=Object.keys(t).length?t:n,a=Array.isArray(t.bySection)?t.bySection:Array.isArray(n.bySection)?n.bySection:[],o={...s,gross:z(t.gross,n.gross),bySection:a.map($e)},r=x(e.velocity),l=Array.isArray(r.bySection)?r.bySection.map(c=>{let h=x(c),u=z(h.bookedValue,h.grossRevenue);return{...h,bookedValue:u,grossRevenue:u}}):[];return{...e,bookedValue:o,revenue:o,velocity:{...r,bySection:l}}}function Qe(i){let e=x(i),t=x(e.report),n=typeof t.includesBookedValue=="boolean"?t.includesBookedValue:t.includesRevenue===!0,s=Array.isArray(t.rows)?t.rows.map(r=>{let l=x(r),c=x(l.attribution),h=Se(c.bookedValue,c.revenue);return{...l,attribution:{...c,bookedValue:h,revenue:h}}}):[],a=x(t.totals),o=Se(a.bookedValue,a.revenue);return{...e,report:{...t,includesBookedValue:n,includesRevenue:n,rows:s,totals:{...a,bookedValue:o,revenue:o}}}}function J(i){let e=x(i),t=typeof e.includesBookedValue=="boolean"?e.includesBookedValue:e.includesRevenue===!0;return{...e,includesBookedValue:t,includesRevenue:t}}var Ce=class{constructor(e,t){this.base=e.replace(/\/+$/,""),this.token=t}setToken(e){this.token=e}auth(e,t={}){let n=t.method??"GET",s={Authorization:`Bearer ${this.token}`},a;return t.body!==void 0&&(s["Content-Type"]="application/json",a=JSON.stringify(t.body)),fetch(`${this.base}${e}`,{method:n,headers:s,body:a,credentials:"omit"}).then(o=>xe(o))}async authBlob(e){let t=await fetch(`${this.base}${e}`,{method:"GET",headers:{Authorization:`Bearer ${this.token}`},credentials:"omit"});return t.ok||await xe(t),t.blob()}chart(e){return this.auth(`/v1/events/${encodeURIComponent(e)}/chart`)}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.authBlob(`/v1/events/${encodeURIComponent(e)}/assets/${encodeURIComponent(t)}`):Promise.reject(new p(404,"not_found","not_found"))}objects(e){return this.auth(`/v1/events/${encodeURIComponent(e)}/objects`)}subscribeTicket(e){return this.auth(`/v1/events/${encodeURIComponent(e)}/subscribe-tickets`,{method:"POST"})}socketUrl(e){return`${this.base.replace(/^http/,"ws")}/pub/events/${encodeURIComponent(e)}/subscribe?surface=manager`}block(e,t,n={}){let s={labels:t};return typeof n.releaseAt=="number"&&(s.releaseAt=n.releaseAt),n.reason&&(s.reason=n.reason),this.auth(`/v1/events/${encodeURIComponent(e)}/block`,{method:"POST",body:s})}unblock(e,t){return this.auth(`/v1/events/${encodeURIComponent(e)}/unblock`,{method:"POST",body:{labels:t}})}unblockAll(e){return this.auth(`/v1/events/${encodeURIComponent(e)}/unblock-all`,{method:"POST"})}eventRequest(e,t,n={}){return this.auth(`/v1/events/${encodeURIComponent(e)}/${t}`,n)}unbook(e,t,n){return this.auth(`/v1/events/${encodeURIComponent(e)}/unbook`,{method:"POST",body:{labels:t,bookingRef:n}})}setHoldTtl(e,t){return this.auth(`/v1/events/${encodeURIComponent(e)}/hold-ttl`,{method:"POST",body:{holdTtlMs:t}})}setCategory(e,t,n){return this.auth(`/v1/events/${encodeURIComponent(e)}/category-assignments`,{method:"POST",body:{labels:t,categoryKey:n}})}lookupOrders(e,t){return this.auth(`/v1/events/${encodeURIComponent(e)}/orders/lookup?q=${encodeURIComponent(t)}`)}categoryDifferences(e){return this.auth(`/v1/events/${encodeURIComponent(e)}/category-assignments`)}resetCategoriesToChart(e,t){return this.auth(`/v1/events/${encodeURIComponent(e)}/category-assignments`,{method:"POST",body:{mode:"chart",...t?{labels:t}:{}}})}setTableBooking(e,t,n,s={}){return this.auth(`/v1/events/${encodeURIComponent(e)}/table-booking`,{method:"POST",body:{tableIds:t,mode:n,...s}})}bookings(e,t={}){let n=new URLSearchParams;t.q&&n.set("q",t.q),t.state&&n.set("state",t.state),t.cursor&&n.set("cursor",t.cursor),t.limit!=null&&n.set("limit",String(t.limit));let s=n.toString();return this.auth(`/v1/events/${encodeURIComponent(e)}/bookings${s?`?${s}`:""}`)}booking(e,t){return this.auth(`/v1/events/${encodeURIComponent(e)}/bookings/${encodeURIComponent(t)}`)}listBookings(e,t={}){return this.bookings(e,t)}retrieveBooking(e,t){return this.booking(e,t)}availability(e){return this.auth(`/v1/events/${encodeURIComponent(e)}/availability`)}setAvailability(e,t){return this.auth(`/v1/events/${encodeURIComponent(e)}/availability`,{method:"POST",body:{rules:t}})}channels(e,t={}){let n=t.includeArchived?"?includeArchived=1":"";return this.auth(`/v1/events/${encodeURIComponent(e)}/channels${n}`)}channelAllocation(e,t={}){let n=new URLSearchParams;t.afterLabel&&n.set("afterLabel",t.afterLabel),t.limit!=null&&n.set("limit",String(t.limit));let s=n.toString();return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/allocation${s?`?${s}`:""}`)}channelAudit(e,t={}){let n=new URLSearchParams;t.limit!=null&&n.set("limit",String(t.limit)),t.before!=null&&n.set("before",String(t.before));let s=n.toString();return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/audit${s?`?${s}`:""}`)}createChannel(e,t){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels`,{method:"POST",body:t})}renameChannel(e,t,n){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}`,{method:"PATCH",body:{name:n}})}updateChannelPricing(e,t,n,s){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}`,{method:"PATCH",body:{priceOverrides:n,expectedPricingVersion:s}})}setChannelPaused(e,t,n){let s=n?"pause":"unpause";return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/${s}`,{method:"POST",body:{}})}archiveChannel(e,t,n){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/archive`,{method:"POST",body:{destination:n}})}applyChannelAssignment(e,t){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/assignments`,{method:"POST",body:{targetChannelId:t.targetChannelId||null,labels:t.labels,assignmentVersion:t.assignmentVersion}})}channelPreview(e,t,n={}){let s=new URLSearchParams;t.length&&s.set("channelIds",t.join(",")),n.includePublic!=null&&s.set("includePublic",n.includePublic?"1":"0");let a=s.toString();return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/preview${a?`?${a}`:""}`)}setChannelAccessIntent(e,t,n,s={}){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}`,{method:"PATCH",body:{accessIntent:n,...s.acknowledgeLiveAccess?{acknowledgeLiveAccess:!0}:{},...s.reason?{reason:s.reason}:{}}})}createAccessLink(e,t,n={}){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/access-links`,{method:"POST",body:n})}accessLinks(e,t){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/access-links`)}rotateAccessLink(e,t,n,s){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/access-links/${encodeURIComponent(n)}/rotate`,{method:"POST",body:{endActiveSessions:s}})}revokeAccessLink(e,t,n,s=!1){let a=s?"?endActiveSessions=1":"";return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/access-links/${encodeURIComponent(n)}${a}`,{method:"DELETE"})}report(e){return this.auth(`/v1/events/${encodeURIComponent(e)}/report`).then(Ge)}seatHistory(e,t,n,s){let a=new URLSearchParams({label:t});return n&&a.set("before",String(n)),s&&a.set("action",s),this.auth(`/v1/events/${encodeURIComponent(e)}/seat-history?${a}`)}seatStory(e,t,n,s){let a=new URLSearchParams({label:t,v:"2"});return n&&a.set("before",String(n)),s&&a.set("action",s),this.auth(`/v1/events/${encodeURIComponent(e)}/seat-history?${a}`)}controlRoom(e,t=15){return this.auth(`/v1/events/${encodeURIComponent(e)}/control-room?window=${t}&activity=2`).then(We)}channelReport(e){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/report`).then(Qe)}createChannelReportLink(e,t,n={}){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/report-links`,{method:"POST",body:n}).then(s=>{let a=x(s);return{...a,link:J(a.link)}})}channelReportLinks(e,t){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/report-links`).then(n=>{let s=x(n);return{links:Array.isArray(s.links)?s.links.map(J):[]}})}revokeChannelReportLink(e,t,n){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/report-links/${encodeURIComponent(n)}`,{method:"DELETE"}).then(s=>{let a=x(s);return{...a,link:J(a.link)}})}log(e,t={}){let n=new URLSearchParams;t.limit!=null&&n.set("limit",String(t.limit)),t.before!=null&&n.set("before",String(t.before));let s=n.toString();return this.auth(`/v1/events/${encodeURIComponent(e)}/log${s?`?${s}`:""}`)}async reportCsv(e){let t=await fetch(`${this.base}/v1/events/${encodeURIComponent(e)}/report.csv`,{headers:{Authorization:`Bearer ${this.token}`},credentials:"omit"});if(!t.ok)throw new p(t.status,`request_failed_${t.status}`);return t.blob()}};function ee(i){return i.map((e,t)=>`
|
|
18
|
+
</button>`).join("")||'<p class="slm-ch-menuhead">This chart has no sections with free seats.</p>'}<p class="slm-ch-menuerr" data-ch-error hidden></p>`;let o=t?.parentElement??document.body;o.style.position=o===document.body?o.style.position:"relative",o.appendChild(a),this.menu=a;let r=()=>{a.remove(),this.menu===a&&(this.menu=null),document.removeEventListener("pointerdown",l,!0)},l=c=>{!a.contains(c.target)&&c.target!==t&&r()};document.addEventListener("pointerdown",l,!0),a.addEventListener("keydown",c=>{let d=[...a.querySelectorAll("button:not([disabled])")],u=d.indexOf(document.activeElement);c.key==="Escape"?(r(),t?.focus(),c.preventDefault()):(c.key==="ArrowDown"||c.key==="ArrowUp")&&(d[(u+(c.key==="ArrowDown"?1:-1)+d.length)%d.length]?.focus(),c.preventDefault())}),a.querySelectorAll("[data-ch-scope-id]").forEach(c=>c.addEventListener("click",()=>{let d=s.find(g=>g.id===c.dataset.chScopeId);if(!d)return;let u=new Set([...this.host.selectionLabels(),...d.labels]);if(u.size>n){let g=a.querySelector("[data-ch-error]");g.hidden=!1,g.textContent=`That would make ${je(u.size)}. One change can take up to ${n.toLocaleString()}.`;return}r(),this.host.selectByLabels([...u])})),a.querySelector("button:not([disabled])")?.focus()}};var f="public",C="Public sale";function $(i){return i==null||i===""||i===f}var V=["#a78bfa","#2dd4bf","#fb923c","#60a5fa","#f472b6","#a3e635","#f87171","#38bdf8","#c084fc","#facc15"],Ke="#f4b740",le="ABCDEFGHJKLMNPQRSTUVWXYZ";function P(i,e){let t=(i??"").trim();return((/\p{L}/u.exec(t)?.[0]??t[0]??"")||e).toUpperCase().slice(0,1)}function W(i,e){let t=new Set([...e].map(a=>P(a,"")).filter(Boolean)),n=P(i,"");return{letter:le.includes(n)&&!t.has(n)?n:[...le].find(a=>!t.has(a))??(n||"X"),color:V[t.size%V.length]}}function he(i,e=0){return $(i.id)?{letter:P(i.marker,"P"),color:i.color||Ke}:{letter:P(i.marker||i.name,"?"),color:i.color||V[e%V.length]}}function de(i,e,t){let n=new Map;for(let o of i){let r=X(e.get(o));n.set(r,(n.get(r)??0)+1)}let s=[{id:f,name:t?.publicSale?.name??C},...(t?.channels??[]).map(o=>({id:o.id,name:o.name}))],a=[];for(let o of s){let r=n.get(o.id);r&&a.push({channelId:o.id,name:o.name,count:r}),n.delete(o.id)}for(let[o,r]of n)a.push({channelId:o,name:$(o)?C:"Another channel",count:r});return a}function X(i){return $(i)?f:i}var ce=12;function K(i){return{count:i.length,labels:i.slice(0,ce),truncated:i.length>ce}}function ue(i){let{labels:e,allocation:t,statusOf:n,nameOf:s}=i,a=X(i.targetChannelId),o=new Set,r=0,l=0,c=new Map,d=[],u=[],g=[];for(let p of e){if(o.has(p))continue;o.add(p);let L=n(p);if(!L){g.push(p);continue}let A=X(t.get(p));if(A===a){l+=1;continue}if(L==="held"){d.push(p);continue}if(L==="booked"){u.push(p);continue}A===f?r+=1:c.set(A,(c.get(A)??0)+1)}let x=[...c.entries()].map(([p,L])=>({channelId:p,name:s(p),count:L}));return{changedFromPublic:{count:r},movedFromOtherChannel:{count:x.reduce((p,L)=>p+L.count,0),channels:x},alreadyInTarget:{count:l},skippedHeld:K(d),skippedBooked:K(u),notFound:K(g)}}function F(i){return i.changedFromPublic.count+i.movedFromOtherChannel.count}function Et(i){return i.movedFromOtherChannel.count>0}function pe(i,e){let t=[];i.changedFromPublic.count&&t.push({kind:"add",icon:"+",count:i.changedFromPublic.count,text:`${i.changedFromPublic.count.toLocaleString()} from ${C}`});for(let n of i.movedFromOtherChannel.channels)t.push({kind:"move",icon:"\u21C4",count:n.count,text:`${n.count.toLocaleString()} moved out of ${n.name??"another channel"}`,why:"this needs your OK"});return i.alreadyInTarget.count&&t.push({kind:"same",icon:"=",count:i.alreadyInTarget.count,text:`${i.alreadyInTarget.count.toLocaleString()} already in ${e}`,why:"unchanged"}),i.skippedHeld.count&&t.push({kind:"skip",icon:"\u23F8",count:i.skippedHeld.count,text:`${i.skippedHeld.count.toLocaleString()} in a buyer's cart`,why:"can't move while held",peek:U(i.skippedHeld)}),i.skippedBooked.count&&t.push({kind:"skip",icon:"\u{1F512}",count:i.skippedBooked.count,text:`${i.skippedBooked.count.toLocaleString()} already sold`,why:"sales are never rewritten",peek:U(i.skippedBooked)}),i.notFound.count&&t.push({kind:"skip",icon:"?",count:i.notFound.count,text:`${i.notFound.count.toLocaleString()} not on this map`,why:"these seats are no longer part of the event",peek:U(i.notFound)}),t}function U(i){if(!i.labels.length)return;let e=i.labels.slice(0,4).join(", ");return i.truncated||i.labels.length>4?`${e}\u2026`:e}function me(i){let e=i?.retryAfterMs??(i?.latestHoldExpiresAt?Math.max(0,i.latestHoldExpiresAt-Date.now()):0);if(!e)return"in a moment";let t=Math.ceil(e/6e4);return t<=1?"in about a minute":`in about ${t} minutes`}function ge(i){if(!i||!i.intent)return"\u2014";let e=i.intent==="server"?"Your website or app":i.intent==="hosted_link"?"Buyer links":i.intent==="internal"?"Your own staff sell these":"Protected reserve",t=i.hasActiveGrants?"in use now":i.lastMintAt?`last used ${new Date(i.lastMintAt).toLocaleDateString()}`:null,n=i.detail??t;return n?`${e} \xB7 ${n}`:e}function H(i){return i==="internal"?"Sell through your own staff":i==="server"?"Integrate a website or app":i==="hosted_link"?"Sell with a buyer link":"Keep as protected reserve"}function Pt(i){switch(i){case"internal":return"Only your own box office can sell these seats, through your secret key. Buyer links and website integrations are refused.";case"server":return"Your website's backend mints each buyer a short-lived session for these seats. Buyer links are refused; the code lives on the Embed page.";case"hosted_link":return"SeatLayer makes a link you send to a named group. They open it and buy only these seats. No other route can sell them.";default:return"Nobody can buy these seats. Every way of letting a buyer in \u2014 a buyer link, your website, even your own staff \u2014 is refused while this is the route. The seats stay out of public sale."}}function Xe(i){return i==="hosted_link"?"hosted_link":i==="server"?"server":i==="staff"?"internal":null}function z(i){let e=G(i?.accessIntent),t=Xe(i?.route),n=`This channel is set to "${H(e)}"`;return t?`${n}, so it cannot do that. Switch it to "${H(t)}" first.`:`${n}, so it cannot do that. Choose a different route for this channel first.`}function G(i){return i==="internal"||i==="server"||i==="hosted_link"||i==="none"?i:"none"}function N(i,e,t){return`${i.toLocaleString()} ${i===1?e:t}`}function be(i){let e=Math.max(0,i?.liveAccessLinks??0),t=Math.max(0,i?.activeSessions??0),n=G(i?.from),s=G(i?.to),o=`${[e?N(e,"buyer link is live","buyer links are live"):null,t?N(t,"buyer is in a checkout","buyers are in a checkout"):null].filter(Boolean).join(", and ")||"Buyers are inside this channel"} on "${H(n)}". Moving it to "${H(s)}" changes what happens to them.`,r=[];return e&&r.push(`${N(e,"buyer link closes","buyer links close")} immediately. Anyone who has not opened it yet never will \u2014 send a new link if you still need one.`),t&&r.push(`${N(t,"buyer who is already in a checkout keeps","buyers who are already in a checkout keep")} their seats and can finish paying. Nobody is thrown out. No new buyers come in this way, so the old route empties on its own within 12 hours.`),{headline:o,consequences:r}}var Q={maxRedemptions:100,maxQuantity:4};function ve(i){switch(i.status??i.state){case"active":return{text:"Active",kind:"active"};case"expired":return{text:"Expired",kind:"archived"};case"exhausted":return{text:"All used",kind:"paused"};case"rotated":return{text:"Replaced",kind:"archived"};default:return{text:"Revoked",kind:"archived"}}}function fe(i){return i.state==="active"&&i.status==="active"}function Z(i){return Number.isFinite(i)?new Date(i).toLocaleString(void 0,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit"}):"\u2014"}function Tt(i){return[{k:"Expires",v:Z(i.expiresAt)},{k:"Redemptions",v:`${i.redemptions.toLocaleString()} of ${i.maxRedemptions.toLocaleString()} used`},{k:"Seats per buyer",v:`${i.maxQuantity.toLocaleString()} seat${i.maxQuantity===1?"":"s"} maximum`},{k:"Covers",v:i.includePublic?"This channel's allocation and Public sale seats":"This channel's allocation only"}]}function ye(i){return[`${i.redemptions.toLocaleString()} of ${i.maxRedemptions.toLocaleString()} used`,`${i.maxQuantity.toLocaleString()} ${i.maxQuantity===1?"seat":"seats"} per buyer`,`ends ${Z(i.expiresAt)}`,i.includePublic?"with Public sale seats":"",i.activeSessions?`${i.activeSessions.toLocaleString()} ${i.activeSessions===1?"buyer":"buyers"} inside now`:""].filter(Boolean).join(" \xB7 ")}function ke(i){let e=`${i.maxQuantity.toLocaleString()} ${i.maxQuantity===1?"seat":"seats"} each`,t=`${i.maxRedemptions.toLocaleString()} ${i.maxRedemptions===1?"person":"people"} in all`;return`Anyone with this link can buy up to ${e}, ${t}, until ${Z(i.expiresAt)}.`+(i.includePublic?" It also opens Public sale seats.":"")}function O(i){let e=i?.serverMessage?.trim();switch(i?.code){case"invalid_expiry":case"invalid_max_redemptions":case"invalid_max_quantity":case"invalid_session_ttl":case"invalid_label":return e||"That setting is outside what a hosted link allows. Adjust it and try again.";case"too_many_access_links":return e||"This channel already has as many live links as it can hold. Revoke one before creating another.";case"access_link_not_active":return"That link is no longer active, so it cannot be rotated or revoked.";case"channel_unavailable":return"This channel is paused or archived, so it cannot let new buyers in. Resume it first.";case"channel_access_intent_forbids":return z(i?.details);case"end_active_sessions_required":return"Choose what happens to the buyers who already came in through this link.";case"not_found":return"That link is no longer here. Refresh and try again.";default:return i?.status===403?"Hosted access links need channel-management permission.":e||"That did not go through. Try again."}}function Mt(i){return(i?.channels??[]).map(e=>({kind:"skip",icon:"\u26A0",count:e.count,text:`${e.count.toLocaleString()} would leave ${e.name??"a channel"}`,why:"the new chart no longer has these seats",peek:e.labels?.length?U({count:e.count,labels:e.labels,truncated:e.truncated??!1}):void 0}))}function we(i){return i==="builtin"?"Built-in":i==="active"?"Active":i==="paused"?"Paused":"Archived"}var xe=Symbol.for("seatlayer.ManageApiError"),m=class extends Error{static[Symbol.hasInstance](e){return typeof e=="object"&&e!==null&&e[xe]===!0}constructor(e,t,n,s,a,o){super(t),Object.defineProperty(this,xe,{value:!0}),this.name="ManageApiError",this.status=e,this.code=n,this.conflicts=s,this.details=a,this.serverMessage=o}};async function Se(i){let t=(i.headers.get("content-type")??"").includes("application/json")?await i.json().catch(()=>null):null;if(!i.ok){let n=t;throw new m(i.status,n?.error??`request_failed_${i.status}`,n?.code,n?.conflicts,n?.details,typeof n?.message=="string"?n.message:void 0)}return t}function k(i){return i&&typeof i=="object"?i:{}}function j(i,e,t=0){return typeof i=="number"&&Number.isFinite(i)?i:typeof e=="number"&&Number.isFinite(e)?e:t}function Ce(i,e){return i===null?null:typeof i=="number"&&Number.isFinite(i)?i:i!==void 0?null:typeof e=="number"&&Number.isFinite(e)?e:null}function Le(i){let e=k(i),t=j(e.bookedValue,e.bookedRevenue);return{...e,bookedValue:t,bookedRevenue:t}}function Ge(i){let e=k(i),t=k(e.report),n=Array.isArray(t.byCategory)?t.byCategory.map(a=>{let o=k(a),r=j(o.bookedValue,o.bookedRevenue);return{...o,bookedValue:r,bookedRevenue:r}}):[],s=Array.isArray(t.bySection)?t.bySection.map(Le):void 0;return{...e,report:{...t,byCategory:n,...s?{bySection:s}:{}}}}function We(i){let e=k(i),t=k(e.bookedValue),n=k(e.revenue),s=Object.keys(t).length?t:n,a=Array.isArray(t.bySection)?t.bySection:Array.isArray(n.bySection)?n.bySection:[],o={...s,gross:j(t.gross,n.gross),bySection:a.map(Le)},r=k(e.velocity),l=Array.isArray(r.bySection)?r.bySection.map(c=>{let d=k(c),u=j(d.bookedValue,d.grossRevenue);return{...d,bookedValue:u,grossRevenue:u}}):[];return{...e,bookedValue:o,revenue:o,velocity:{...r,bySection:l}}}function Qe(i){let e=k(i),t=k(e.report),n=typeof t.includesBookedValue=="boolean"?t.includesBookedValue:t.includesRevenue===!0,s=Array.isArray(t.rows)?t.rows.map(r=>{let l=k(r),c=k(l.attribution),d=Ce(c.bookedValue,c.revenue);return{...l,attribution:{...c,bookedValue:d,revenue:d}}}):[],a=k(t.totals),o=Ce(a.bookedValue,a.revenue);return{...e,report:{...t,includesBookedValue:n,includesRevenue:n,rows:s,totals:{...a,bookedValue:o,revenue:o}}}}function J(i){let e=k(i),t=typeof e.includesBookedValue=="boolean"?e.includesBookedValue:e.includesRevenue===!0;return{...e,includesBookedValue:t,includesRevenue:t}}var $e=class{constructor(e,t){this.base=e.replace(/\/+$/,""),this.token=t}setToken(e){this.token=e}auth(e,t={}){let n=t.method??"GET",s={Authorization:`Bearer ${this.token}`},a;return t.body!==void 0&&(s["Content-Type"]="application/json",a=JSON.stringify(t.body)),fetch(`${this.base}${e}`,{method:n,headers:s,body:a,credentials:"omit"}).then(o=>Se(o))}async authBlob(e){let t=await fetch(`${this.base}${e}`,{method:"GET",headers:{Authorization:`Bearer ${this.token}`},credentials:"omit"});return t.ok||await Se(t),t.blob()}chart(e){return this.auth(`/v1/events/${encodeURIComponent(e)}/chart`)}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.authBlob(`/v1/events/${encodeURIComponent(e)}/assets/${encodeURIComponent(t)}`):Promise.reject(new m(404,"not_found","not_found"))}objects(e){return this.auth(`/v1/events/${encodeURIComponent(e)}/objects`)}subscribeTicket(e){return this.auth(`/v1/events/${encodeURIComponent(e)}/subscribe-tickets`,{method:"POST"})}socketUrl(e){return`${this.base.replace(/^http/,"ws")}/pub/events/${encodeURIComponent(e)}/subscribe?surface=manager`}block(e,t,n={}){let s={labels:t};return typeof n.releaseAt=="number"&&(s.releaseAt=n.releaseAt),n.reason&&(s.reason=n.reason),this.auth(`/v1/events/${encodeURIComponent(e)}/block`,{method:"POST",body:s})}unblock(e,t){return this.auth(`/v1/events/${encodeURIComponent(e)}/unblock`,{method:"POST",body:{labels:t}})}unblockAll(e){return this.auth(`/v1/events/${encodeURIComponent(e)}/unblock-all`,{method:"POST"})}eventRequest(e,t,n={}){return this.auth(`/v1/events/${encodeURIComponent(e)}/${t}`,n)}unbook(e,t,n){return this.auth(`/v1/events/${encodeURIComponent(e)}/unbook`,{method:"POST",body:{labels:t,bookingRef:n}})}setHoldTtl(e,t){return this.auth(`/v1/events/${encodeURIComponent(e)}/hold-ttl`,{method:"POST",body:{holdTtlMs:t}})}setCategory(e,t,n){return this.auth(`/v1/events/${encodeURIComponent(e)}/category-assignments`,{method:"POST",body:{labels:t,categoryKey:n}})}lookupOrders(e,t){return this.auth(`/v1/events/${encodeURIComponent(e)}/orders/lookup?q=${encodeURIComponent(t)}`)}categoryDifferences(e){return this.auth(`/v1/events/${encodeURIComponent(e)}/category-assignments`)}resetCategoriesToChart(e,t){return this.auth(`/v1/events/${encodeURIComponent(e)}/category-assignments`,{method:"POST",body:{mode:"chart",...t?{labels:t}:{}}})}setTableBooking(e,t,n,s={}){return this.auth(`/v1/events/${encodeURIComponent(e)}/table-booking`,{method:"POST",body:{tableIds:t,mode:n,...s}})}bookings(e,t={}){let n=new URLSearchParams;t.q&&n.set("q",t.q),t.state&&n.set("state",t.state),t.cursor&&n.set("cursor",t.cursor),t.limit!=null&&n.set("limit",String(t.limit));let s=n.toString();return this.auth(`/v1/events/${encodeURIComponent(e)}/bookings${s?`?${s}`:""}`)}booking(e,t){return this.auth(`/v1/events/${encodeURIComponent(e)}/bookings/${encodeURIComponent(t)}`)}listBookings(e,t={}){return this.bookings(e,t)}retrieveBooking(e,t){return this.booking(e,t)}availability(e){return this.auth(`/v1/events/${encodeURIComponent(e)}/availability`)}setAvailability(e,t){return this.auth(`/v1/events/${encodeURIComponent(e)}/availability`,{method:"POST",body:{rules:t}})}channels(e,t={}){let n=t.includeArchived?"?includeArchived=1":"";return this.auth(`/v1/events/${encodeURIComponent(e)}/channels${n}`)}channelAllocation(e,t={}){let n=new URLSearchParams;t.afterLabel&&n.set("afterLabel",t.afterLabel),t.limit!=null&&n.set("limit",String(t.limit));let s=n.toString();return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/allocation${s?`?${s}`:""}`)}channelAudit(e,t={}){let n=new URLSearchParams;t.limit!=null&&n.set("limit",String(t.limit)),t.before!=null&&n.set("before",String(t.before));let s=n.toString();return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/audit${s?`?${s}`:""}`)}createChannel(e,t){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels`,{method:"POST",body:t})}renameChannel(e,t,n){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}`,{method:"PATCH",body:{name:n}})}updateChannelPricing(e,t,n,s){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}`,{method:"PATCH",body:{priceOverrides:n,expectedPricingVersion:s}})}setChannelPaused(e,t,n){let s=n?"pause":"unpause";return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/${s}`,{method:"POST",body:{}})}archiveChannel(e,t,n){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/archive`,{method:"POST",body:{destination:n}})}applyChannelAssignment(e,t){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/assignments`,{method:"POST",body:{targetChannelId:t.targetChannelId||null,labels:t.labels,assignmentVersion:t.assignmentVersion}})}channelPreview(e,t,n={}){let s=new URLSearchParams;t.length&&s.set("channelIds",t.join(",")),n.includePublic!=null&&s.set("includePublic",n.includePublic?"1":"0");let a=s.toString();return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/preview${a?`?${a}`:""}`)}setChannelAccessIntent(e,t,n,s={}){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}`,{method:"PATCH",body:{accessIntent:n,...s.acknowledgeLiveAccess?{acknowledgeLiveAccess:!0}:{},...s.reason?{reason:s.reason}:{}}})}createAccessLink(e,t,n={}){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/access-links`,{method:"POST",body:n})}accessLinks(e,t){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/access-links`)}rotateAccessLink(e,t,n,s){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/access-links/${encodeURIComponent(n)}/rotate`,{method:"POST",body:{endActiveSessions:s}})}revokeAccessLink(e,t,n,s=!1){let a=s?"?endActiveSessions=1":"";return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/access-links/${encodeURIComponent(n)}${a}`,{method:"DELETE"})}report(e){return this.auth(`/v1/events/${encodeURIComponent(e)}/report`).then(Ge)}seatHistory(e,t,n,s){let a=new URLSearchParams({label:t});return n&&a.set("before",String(n)),s&&a.set("action",s),this.auth(`/v1/events/${encodeURIComponent(e)}/seat-history?${a}`)}seatStory(e,t,n,s){let a=new URLSearchParams({label:t,v:"2"});return n&&a.set("before",String(n)),s&&a.set("action",s),this.auth(`/v1/events/${encodeURIComponent(e)}/seat-history?${a}`)}controlRoom(e,t=15){return this.auth(`/v1/events/${encodeURIComponent(e)}/control-room?window=${t}&activity=2`).then(We)}channelReport(e){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/report`).then(Qe)}createChannelReportLink(e,t,n={}){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/report-links`,{method:"POST",body:n}).then(s=>{let a=k(s);return{...a,link:J(a.link)}})}channelReportLinks(e,t){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/report-links`).then(n=>{let s=k(n);return{links:Array.isArray(s.links)?s.links.map(J):[]}})}revokeChannelReportLink(e,t,n){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/report-links/${encodeURIComponent(n)}`,{method:"DELETE"}).then(s=>{let a=k(s);return{...a,link:J(a.link)}})}log(e,t={}){let n=new URLSearchParams;t.limit!=null&&n.set("limit",String(t.limit)),t.before!=null&&n.set("before",String(t.before));let s=n.toString();return this.auth(`/v1/events/${encodeURIComponent(e)}/log${s?`?${s}`:""}`)}async reportCsv(e){let t=await fetch(`${this.base}/v1/events/${encodeURIComponent(e)}/report.csv`,{headers:{Authorization:`Bearer ${this.token}`},credentials:"omit"});if(!t.ok)throw new m(t.status,`request_failed_${t.status}`);return t.blob()}};function ee(i){return i.map((e,t)=>`
|
|
19
19
|
<div class="slm-ch-bucket" style="animation-delay:${Math.min(t,4)*30}ms">
|
|
20
|
-
<span class="ico ${e.kind}" aria-hidden="true">${
|
|
21
|
-
<span><b>${e.count.toLocaleString()}</b> ${
|
|
22
|
-
${e.why?`<span class="why">\u2014 ${
|
|
23
|
-
${e.peek?`<span class="peek">${
|
|
24
|
-
</div>`).join("")}var
|
|
20
|
+
<span class="ico ${e.kind}" aria-hidden="true">${h(e.icon)}</span>
|
|
21
|
+
<span><b>${e.count.toLocaleString()}</b> ${h(e.text.replace(/^[\d,.\s]+/,""))}
|
|
22
|
+
${e.why?`<span class="why">\u2014 ${h(e.why)}</span>`:""}</span>
|
|
23
|
+
${e.peek?`<span class="peek">${h(e.peek)}</span>`:"<span></span>"}
|
|
24
|
+
</div>`).join("")}var Ae=`
|
|
25
25
|
<p class="slm-eyebrow" style="margin-top:18px">On your website</p>
|
|
26
26
|
<p class="slm-hint">There is nothing more to set up on this screen. Your own server mints a short-lived buyer
|
|
27
27
|
access session for this channel with the SeatLayer server SDK and hands it to the widget. A channel name
|
|
28
28
|
on its own never grants access.</p>
|
|
29
29
|
<p class="slm-note"><a class="slm-linkbtn" href="https://docs.seatlayer.io/server-api/channels"
|
|
30
|
-
target="_blank" rel="noreferrer noopener">Read the website integration guide \u2192</a></p>`;function
|
|
30
|
+
target="_blank" rel="noreferrer noopener">Read the website integration guide \u2192</a></p>`;function h(i){return String(i??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ie(i){return new Date(i-new Date(i).getTimezoneOffset()*6e4).toISOString().slice(0,16)}function te(i,e){let t=i.querySelector(e)?.value.trim()??"",n=Number(t);return t!==""&&Number.isInteger(n)?n:null}function Ee(i,e){let t=typeof navigator>"u"?null:navigator.clipboard;return t?.writeText?t.writeText(e).then(()=>!0,()=>Re(i,e)):Promise.resolve(Re(i,e))}function Re(i,e){let t=i.querySelector("[data-ch-lk-sink]");if(t&&typeof document.execCommand=="function")try{t.value=e,t.select(),t.setSelectionRange(0,e.length);let n=document.execCommand("copy");if(t.value="",n)return!0}catch{t.value=""}return Ze(i),!1}function Ze(i){let e=i.querySelector("[data-ch-lk-url]");if(e)try{let t=document.createRange();t.selectNodeContents(e);let n=window.getSelection();n?.removeAllRanges(),n?.addRange(t)}catch{}}var Je=8,et="#6e7bff",tt="#b9c0ff",nt={unavailableFill:"#303846",unavailableStroke:"#4b5669",allocationStroke:"#101723",sectionPlate:"rgba(11,16,28,.88)",sectionPlateInk:"#f8fafc"},st={unavailableFill:"rgba(156,163,175,.55)",unavailableStroke:"rgba(107,114,128,.65)",allocationStroke:"#ffffff",sectionPlate:"rgba(255,255,255,.9)",sectionPlateInk:"#172033"};function it(i){return i?.dataset?.theme==="light"?st:nt}function Me(i){let e=i.canvas,t=i.layer;if(!e||!t)return;let n=i.host.mapLayer.getBoundingClientRect(),s=Math.max(1,Math.round(n.width)),a=Math.max(1,Math.round(n.height)),o=typeof devicePixelRatio=="number"?Math.min(3,Math.max(1,devicePixelRatio)):1;(e.width!==s*o||e.height!==a*o)&&(e.width=s*o,e.height=a*o);let r=i.resolveCtx();if(!r)return;r.setTransform(o,0,0,o,0,0),r.clearRect(0,0,s,a);let l=it(i.host.root),c=i.host.isSeatDetail(),d=Math.max(3,i.host.seatPixelSize()),u=d/2,g=i.view==="preview"?i.previewProjection:null,x=g?new Set(g.available===!1?[]:g.eligible??[]):null,p=new Map,L=!c&&i.host.sections().length>1?new Map:null,A=i.view==="preview"&&c&&d<=15?new Map:null;for(let R of i.host.seats()){let Be=i.host.statusOf(R.label)??"free",D=i.allocation.get(R.label)??f;if(D!==f){let y=p.get(D)??{x:0,y:0,n:0};y.x+=R.x,y.y+=R.y,y.n+=1,p.set(D,y)}if(!c){let y=i.host.sectionOfLabel(R.label),b=y?i.host.worldToScreen({x:R.x,y:R.y}):null;if(L&&y&&b){let E=L.get(y.id)??{label:y.label,minX:b.x,minY:b.y,maxX:b.x,maxY:b.y};E.minX=Math.min(E.minX,b.x),E.minY=Math.min(E.minY,b.y),E.maxX=Math.max(E.maxX,b.x),E.maxY=Math.max(E.maxY,b.y),L.set(y.id,E)}continue}if(Be!=="free")continue;let T=null,_=null;if(i.view==="preview"?x?.has(R.label)?(T=et,_=tt):(T=l.unavailableFill,_=l.unavailableStroke):(T=D===f?"#c9d0dc":i.markerFor(D).color,_=l.allocationStroke),!T)continue;let w=i.host.worldToScreen({x:R.x,y:R.y});if(w&&!(w.x<-d||w.y<-d||w.x>s+d||w.y>a+d)){if(A){let y=i.host.sectionOfLabel(R.label);if(y){let b=A.get(y.id)??{label:y.label,minX:w.x,minY:w.y,maxX:w.x,maxY:w.y};b.minX=Math.min(b.minX,w.x),b.minY=Math.min(b.minY,w.y),b.maxX=Math.max(b.maxX,w.x),b.maxY=Math.max(b.maxY,w.y),A.set(y.id,b)}}r.fillStyle=T;{let y=Math.max(2,u+Math.min(1.5,u*.06));r.globalAlpha=1,r.beginPath(),r.arc(w.x,w.y,y,0,Math.PI*2),r.fill(),r.strokeStyle=_??T,r.lineWidth=i.view==="preview"?Math.max(1,Math.min(1.75,d*.13)):Math.max(1,Math.min(1.5,d*.1)),r.stroke(),i.view==="preview"&&x?.has(R.label)&&d>=22&&at(r,R.label,w.x,w.y,y)}}}r.globalAlpha=1,A&&ct(r,A,l),ot(L,i),ht(p,i,r)}function at(i,e,t,n,s){let a=s*1.55,o=Math.min(13,Math.max(7,s*.55)),r=6;for(;o>=r&&(i.font=`800 ${o}px var(--slm-font, system-ui, sans-serif)`,!(i.measureText(e).width<=a));)o-=.5;o<r||(i.fillStyle="#ffffff",i.textAlign="center",i.textBaseline="middle",i.fillText(e,t,n))}function ot(i,e){let t=e.layer;if(t&&(t.querySelectorAll(".slm-ch-section-target").forEach(n=>n.remove()),!!i))for(let[n,s]of i){let a=s.maxX-s.minX,o=s.maxY-s.minY;if(a<20||o<20)continue;let r=document.createElement("button");r.type="button",r.className="slm-ch-section-target",r.style.left=`${s.minX-8}px`,r.style.top=`${s.minY-8}px`,r.style.width=`${a+16}px`,r.style.height=`${o+16}px`,r.setAttribute("aria-label",`Open ${s.label} seats`),lt(r,e,()=>e.onSectionTargetClick(n)),t.appendChild(r)}}var Pe=4;function rt(i,e){let t={button:0,buttons:1,clientX:e.x,clientY:e.y,bubbles:!0,cancelable:!0,composed:!0};return typeof PointerEvent=="function"?new PointerEvent("pointerdown",{...t,pointerId:i.pointerId,pointerType:i.pointerType,isPrimary:!0}):new MouseEvent("pointerdown",t)}function Te(i){return i.host.mapLayer.querySelector(".slm-map-host")??i.host.mapLayer}function lt(i,e,t){i.addEventListener("wheel",l=>{let c=Te(e);c!==i&&(l.preventDefault(),c.dispatchEvent(new WheelEvent("wheel",{deltaX:l.deltaX,deltaY:l.deltaY,deltaZ:l.deltaZ,deltaMode:l.deltaMode,clientX:l.clientX,clientY:l.clientY,ctrlKey:l.ctrlKey,shiftKey:l.shiftKey,altKey:l.altKey,metaKey:l.metaKey,bubbles:!0,cancelable:!0,composed:!0})))},{passive:!1});let n=null,s=!1,a=()=>{n=null,e.layer?.classList.remove("panning"),window.removeEventListener("pointermove",o,!0),window.removeEventListener("pointerup",r,!0),window.removeEventListener("pointercancel",r,!0)};function o(l){if(!n||s||Math.abs(l.clientX-n.x)<Pe&&Math.abs(l.clientY-n.y)<Pe)return;s=!0;let c=n;e.layer?.classList.add("panning");let d=document.elementFromPoint?.(c.x,c.y)??null;(d&&d!==i?d:Te(e)).dispatchEvent(rt(l,c))}function r(){a()}i.addEventListener("pointerdown",l=>{s=!1,n={x:l.clientX,y:l.clientY},window.addEventListener("pointermove",o,!0),window.addEventListener("pointerup",r,!0),window.addEventListener("pointercancel",r,!0)}),i.addEventListener("click",l=>{if(s){s=!1,l.preventDefault(),l.stopPropagation();return}t()})}function ct(i,e,t){for(let n of e.values()){let s=n.maxX-n.minX,a=n.maxY-n.minY;if(s<52||a<26)continue;let o=(n.minX+n.maxX)/2,r=(n.minY+n.maxY)/2,l=Math.max(11,Math.min(15,a*.16));i.font=`800 ${l}px var(--slm-font, system-ui, sans-serif)`;let c=Math.min(s-8,i.measureText(n.label).width+18),d=l+10;i.fillStyle=t.sectionPlate,i.fillRect(o-c/2,r-d/2,c,d),i.fillStyle=t.sectionPlateInk,i.textAlign="center",i.textBaseline="middle",i.fillText(n.label,o,r)}}function ht(i,e,t){let n=e.layer;if(!n||(n.querySelectorAll(".slm-ch-flag").forEach(a=>a.remove()),e.view==="preview"))return;let s=[...i.entries()].sort((a,o)=>o[1].n-a[1].n).slice(0,Je);for(let[a,o]of s){let r=e.list?.channels.find(u=>u.id===a);if(!r)continue;let l=e.host.worldToScreen({x:o.x/o.n,y:o.y/o.n});if(!l)continue;let c=e.markerFor(a),d=document.createElement("span");d.className="slm-ch-flag",d.style.left=`${l.x}px`,d.style.top=`${l.y}px`,d.innerHTML=`<span class="mk" style="background:${h(c.color)}">${h(c.letter)}</span>${h(r.name)}${r.state==="paused"?" \xB7 Paused":""}`,n.appendChild(d)}}var dt=`
|
|
31
31
|
.slm{--slm-ch-marker-ink:#0e1017;
|
|
32
32
|
--slm-mo-instant:80ms;--slm-mo-quick:140ms;--slm-mo-base:200ms;--slm-mo-slow:320ms;--slm-mo-ambient:2000ms;
|
|
33
33
|
--slm-mo-out:cubic-bezier(.2,.8,.2,1);--slm-mo-in-out:cubic-bezier(.4,0,.2,1);--slm-mo-exit:cubic-bezier(.4,0,1,1);
|
|
@@ -117,6 +117,7 @@ import{k as S}from"./chunk-QB6PA3C6.js";function ne(i){i.querySelectorAll("selec
|
|
|
117
117
|
.slm-ch-assigncard .slm-note{margin:8px 0 0}
|
|
118
118
|
.slm-ch-giveto{display:flex;align-items:center;gap:8px}.slm-ch-giveto label{flex:none;margin:0;font-size:12px;font-weight:600;color:var(--slm-text)}
|
|
119
119
|
.slm-ch-giveto>:last-child{flex:1;min-width:0}
|
|
120
|
+
.slm-ch-pick{position:relative}.slm-ch-pick .slm-ch-mk{position:absolute;left:7px;top:6px;width:22px;height:22px;pointer-events:none}.slm-ch-pick summary{padding-left:36px!important}
|
|
120
121
|
.slm-ch-staged2{margin-top:12px;padding:12px 14px;border-radius:14px;border:1px solid color-mix(in srgb,var(--slm-accent) 55%,transparent);
|
|
121
122
|
background:color-mix(in srgb,var(--slm-accent) 10%,var(--slm-surface));font-size:12px;font-weight:500}
|
|
122
123
|
.slm-ch-stagedtop{display:flex;align-items:baseline;gap:8px;margin-bottom:6px}
|
|
@@ -287,42 +288,42 @@ import{k as S}from"./chunk-QB6PA3C6.js";function ne(i){i.querySelectorAll("selec
|
|
|
287
288
|
.slm-ch-staged.shake{outline:2px solid #e5484d;outline-offset:2px}
|
|
288
289
|
.slm-ch-staged.done{outline:2px solid #5bd39b;outline-offset:2px}
|
|
289
290
|
}
|
|
290
|
-
`;var ut=3e4,I=5e3,
|
|
291
|
+
`;var ut=3e4,I=5e3,Y=ae({glyph:"route",hue:"#ea7a1e",title:"Channels",purpose:"Give seats to a sales channel, such as the box office or a partner, and decide how buyers reach them.",how:"channels"}),He=3e4,pt='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#8b5cf6" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.5 12.2V4.5a1 1 0 0 1 1-1h7.7l8.3 8.3a1.4 1.4 0 0 1 0 2l-6.3 6.3a1.4 1.4 0 0 1-2 0z"/><circle cx="8" cy="8" r="1.6"/></svg>',mt={hosted_link:["Buyer links","Only people with a link can buy these seats."],server:["Your website or app","Your integration lets buyers in."],internal:["Your own staff","Sold at the box office or by phone."],none:["Protected reserve","Nobody can buy them until you change this."]},gt='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#64748b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8.5 5L4 9.5 8.5 14"/><path d="M4 9.5h10a6 6 0 0 1 0 12h-3"/></svg>',bt='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#ea7a1e" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg>',vt='<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#d99a0b" stroke-width="1.9" stroke-linejoin="round" aria-hidden="true"><path d="M5 3.5l13 7-5.6 1.6L10 18z"/></svg>',De=class{constructor(e,t){this.active=!1;this.list=null;this.allocation=new Map;this.assignmentVersion=0;this.loadError=null;this.loading=!0;this.view="inspect";this.mapIntent="pan";this.focusedSectionId=null;this.showArchived=!1;this.detailChannelId=null;this.assignOpen=!1;this.targetChannelId="";this.conflict=!1;this.applied=null;this.railNote=null;this.appliedTimer=null;this.dialog=null;this.detent="medium";this.links=[];this.linksChannelId=null;this.linksState="idle";this.listSeq=0;this.linksSeq=0;this.previewAudience=[];this.previewIncludePublic=!1;this.previewProjection=null;this.previewState="idle";this.pollTimer=null;this.layer=null;this.canvas=null;this.overlayVisible=!0;this.ctx=void 0;this.bannerEl=null;this.stagedEl=null;this.liveEl=null;this.scrimEl=null;this.lastFocus=null;this.stagedDoneTimer=null;this.lastSelectionCount=0;this.lastCounts=new Map;this.railHtml=null;this.allocationVersion=null;this.onVisibility=null;this.host=e,this.caps=t;let n={selectionLabels:()=>e.selectionLabels(),selectByLabels:s=>e.selectByLabels(s),clearSelection:()=>e.clearSelection(),selectSection:s=>e.selectSection(s),sections:()=>e.sections(),labelsInSection:s=>e.labelsInSection(s),rows:()=>e.rows(),categories:()=>e.categories(),labelsInCategory:s=>e.labelsInCategory(s),seats:()=>e.seats(),statusOf:s=>e.statusOf(s),sectionOfLabel:s=>e.sectionOfLabel(s),seatMeta:s=>{let a=this.allocation.get(s)??f;return`${this.nameOf(a)??C} \xB7 ${e.statusOf(s)??"free"}`},openDialog:(s,a)=>this.renderScrim(s,a),closeDialog:()=>this.closeDialog(),pickers:e.pickers,pickerFailed:e.pickerFailed,enhanceDialog:e.enhanceDialog,cap:I};this.chooser=new q(n)}enter(){this.active||(this.active=!0,this.mapIntent="pan",this.assignOpen=!1,this.focusedSectionId=null,this.chooser.reset(),this.railHtml=null,this.ensureLayer(),this.host.root.classList.add("ch-mode"),this.applySheetClasses(),this.host.sections().length>1&&this.host.showSectionOverview(),this.paintRail(),this.onInteractionChange?.(),this.refresh(),this.pollTimer=setInterval(()=>{typeof document<"u"&&document.hidden||this.refresh({quiet:!0})},ut),typeof document<"u"&&typeof document.addEventListener=="function"&&(this.onVisibility=()=>{this.active&&!document.hidden&&this.refresh({quiet:!0})},document.addEventListener("visibilitychange",this.onVisibility)))}leave(){this.active&&(this.active=!1,this.pollTimer&&clearInterval(this.pollTimer),this.pollTimer=null,this.onVisibility&&typeof document<"u"&&document.removeEventListener("visibilitychange",this.onVisibility),this.onVisibility=null,this.railHtml=null,this.closeDialog({restoreFocus:!1}),this.links=[],this.linksChannelId=null,this.linksState="idle",this.layer?.classList.remove("on"),this.host.root.classList.remove("ch-mode","ch-preview","ch-sheet","detent-collapsed","detent-medium","detent-full"),this.host.setMapInert(!1),this.setBanner(!1),this.setStaged(null))}destroy(){this.leave(),this.stagedDoneTimer&&clearTimeout(this.stagedDoneTimer),this.layer?.remove(),this.layer=null,this.bannerEl?.remove(),this.bannerEl=null}setCapabilities(e){this.caps=e,this.active&&this.paintRail()}isActive(){return this.active}canSelect(){return this.caps.manage&&this.view==="inspect"}usesMarqueeSelection(){return this.canSelect()&&this.mapIntent==="assign"}handleSectionFocus(e){this.active&&(this.focusedSectionId=e,this.paintRail())}applyRealtimeHint(){this.active&&this.refresh({quiet:!0})}handleSelectionChange(){this.active&&(this.paintSelection(),this.paintStagedBar())}handleViewChange(){this.active&&this.paintOverlay()}handleLayoutChange(){this.active&&(this.applySheetClasses(),this.paintOverlay())}async refresh(e={}){if(!this.caps.view)return;let t=++this.listSeq,n=()=>t!==this.listSeq;try{let s=await this.host.api.channels(this.host.eventKey,{includeArchived:this.showArchived});if(n())return;if(this.list=s,this.assignmentVersion=s.assignmentVersion,this.loadError=null,this.targetChannelId||(this.targetChannelId=s.channels.find(a=>a.state==="active")?.id??f),this.allocationVersion!==s.assignmentVersion){if(await this.loadAllocation(t),n())return;this.allocationVersion=s.assignmentVersion}if(this.detailChannelId&&await this.loadLinks(this.detailChannelId),n())return;this.loading=!1,this.active&&(this.paintRail(),this.paintOverlay()),this.host.channelsChanged?.()}catch(s){if(n())return;this.loading=!1,s instanceof m&&s.status===403&&(this.caps={view:!1,manage:!1}),this.loadError=s,e.quiet||this.host.onError(s),this.active&&this.paintRail()}}async loadAllocation(e){let t=new Map,n;for(let s=0;s<200;s+=1){if(e!==void 0&&e!==this.listSeq)return;let a=await this.host.api.channelAllocation(this.host.eventKey,{afterLabel:n,limit:1e3});for(let o of a.allocations)$(o.channelId)||t.set(o.label,o.channelId);if(this.assignmentVersion=a.assignmentVersion,!a.nextAfterLabel)break;n=a.nextAfterLabel}e!==void 0&&e!==this.listSeq||(this.allocation=t)}legendChannels(){return this.list?[{label:this.list.publicSale.name||C,color:"#c9d0dc",free:this.list.publicSale.counts.free},...this.list.channels.filter(e=>e.archivedAt==null).map(e=>({label:e.name,color:this.markerFor(e.id).color,free:e.counts.allocated?e.counts.free:-1}))]:[]}channelById(e){if($(e))return{id:f,name:this.list?.publicSale?.name??C,marker:"P",color:null};let t=this.list?.channels.find(n=>n.id===e);return t?{id:e,name:t.name,marker:t.marker,color:t.color}:null}nameOf(e){return this.channelById(e)?.name??null}channelNameForLabel(e){return this.list?this.nameOf(this.allocation.get(e)??f):null}plateHtml(e=""){let t=this.markerFor(e);return`<span class="slm-ch-mk" style="background:${h(t.color)}" aria-hidden="true">${h(t.letter)}</span>`}markerFor(e){let t=Math.max(0,this.list?.channels.findIndex(s=>s.id===e)??0),n=this.channelById(e);return he(n??{id:e,name:"?",marker:null,color:null},t)}assignableChannels(){return[{id:f,name:this.list?.publicSale.name??C},...(this.list?.channels??[]).filter(e=>e.state!=="archived").map(e=>({id:e.id,name:e.name}))]}currentPlan(){let e=this.host.selectionLabels(),t=ue({labels:e,targetChannelId:this.targetChannelId,allocation:this.allocation,statusOf:n=>this.host.statusOf(n),nameOf:n=>this.nameOf(n)});return{labels:e,buckets:t,target:this.targetChannelId}}ensureLayer(){if(this.layer)return;let e=document.createElement("div");e.className="slm-ch-layer",e.innerHTML=`
|
|
291
292
|
<canvas class="slm-ch-canvas" data-ch="canvas" aria-hidden="true"></canvas>
|
|
292
293
|
<div class="slm-ch-banner" data-ch="banner" role="status"></div>
|
|
293
294
|
<div class="slm-ch-staged" data-ch="staged" role="group" aria-label="Staged channel changes"></div>
|
|
294
|
-
<div class="slm-ch-live" data-ch="live" role="status" aria-live="polite"></div>`,this.host.mapLayer.appendChild(e),this.layer=e,this.canvas=e.querySelector('[data-ch="canvas"]'),this.bannerEl=e.querySelector('[data-ch="banner"]'),this.bannerEl&&this.host.pillLane&&this.host.pillLane.appendChild(this.bannerEl),this.stagedEl=e.querySelector('[data-ch="staged"]'),this.liveEl=e.querySelector('[data-ch="live"]'),requestAnimationFrame(()=>e.classList.add("on"))}announce(e){this.liveEl&&(this.liveEl.textContent=e)}setOverlayVisible(e){if(this.overlayVisible===e)return;if(this.overlayVisible=e,e){this.active&&this.paintOverlay();return}let t=this.canvas;t&&(this.ctx??null)?.clearRect(0,0,t.width,t.height),this.layer?.querySelectorAll(".slm-ch-flag").forEach(n=>n.remove())}paintOverlay(){let e=this.canvas,t=this.layer;!e||!t||!this.overlayVisible||
|
|
295
|
+
<div class="slm-ch-live" data-ch="live" role="status" aria-live="polite"></div>`,this.host.mapLayer.appendChild(e),this.layer=e,this.canvas=e.querySelector('[data-ch="canvas"]'),this.bannerEl=e.querySelector('[data-ch="banner"]'),this.bannerEl&&this.host.pillLane&&this.host.pillLane.appendChild(this.bannerEl),this.stagedEl=e.querySelector('[data-ch="staged"]'),this.liveEl=e.querySelector('[data-ch="live"]'),requestAnimationFrame(()=>e.classList.add("on"))}announce(e){this.liveEl&&(this.liveEl.textContent=e)}setOverlayVisible(e){if(this.overlayVisible===e)return;if(this.overlayVisible=e,e){this.active&&this.paintOverlay();return}let t=this.canvas;t&&(this.ctx??null)?.clearRect(0,0,t.width,t.height),this.layer?.querySelectorAll(".slm-ch-flag").forEach(n=>n.remove())}paintOverlay(){let e=this.canvas,t=this.layer;!e||!t||!this.overlayVisible||Me({layer:t,canvas:e,resolveCtx:()=>{if(this.ctx===void 0)try{this.ctx=e.getContext("2d")}catch{this.ctx=null}return this.ctx},host:this.host,view:this.view,previewProjection:this.previewProjection,allocation:this.allocation,focusedSectionId:this.focusedSectionId,list:this.list,markerFor:n=>this.markerFor(n),onSectionTargetClick:n=>{this.focusedSectionId=n,this.host.focusSection(n),this.paintRail()}})}setStaged(e,t=""){let n=this.stagedEl;if(n){if(!e){n.classList.remove("on","done","shake"),n.innerHTML="";return}n.innerHTML=e,n.className=`slm-ch-staged on${t?` ${t}`:""}`}}paintStagedBar(){if(!this.active||this.view==="preview"||!this.caps.manage){this.setStaged(null);return}let{labels:e,buckets:t}=this.currentPlan();if(this.host.onStagedChange?.(F(t)),!e.length){this.setStaged(null);return}let n=this.nameOf(this.targetChannelId)??C,s=F(t),a=e.length>I,o=t.skippedHeld.count+t.skippedBooked.count,r=[`<b>${e.length.toLocaleString()}</b> selected`,`<b>+${s.toLocaleString()}</b> to ${h(n)}`];t.alreadyInTarget.count&&r.push(`<b>${t.alreadyInTarget.count.toLocaleString()}</b> already in`),o&&r.push(`<b>${o.toLocaleString()}</b> can't move now`),this.setStaged(`
|
|
295
296
|
<span>${r.join(" \xB7 ")}</span>
|
|
296
297
|
<span class="grow"></span>
|
|
297
298
|
<button type="button" class="drop" data-ch-act="discard">Discard</button>
|
|
298
299
|
<button type="button" class="go" data-ch-act="review"${a?" disabled":""}>
|
|
299
300
|
${a?`Maximum ${I.toLocaleString()} seats`:"Review changes"}
|
|
300
|
-
</button>`),this.stagedEl?.querySelectorAll("[data-ch-act]").forEach(l=>{l.addEventListener("click",()=>{l.dataset.chAct==="discard"?this.host.clearSelection():this.openDialog({kind:"review"})})})}setBanner(e,t="",n){let s=this.bannerEl;if(!s)return;if(this.host.root.classList.toggle("ch-preview",e),!e){s.classList.remove("on"),s.innerHTML="";return}let a=this.previewAudience.length===1?this.markerFor(this.previewAudience[0]):{color:"var(--slm-accent)",letter:""},o=n==null?"":` \xB7 ${n.toLocaleString()} ${n===1?"seat":"seats"} available now`;s.innerHTML=`<span class="dot" style="background:${
|
|
301
|
-
Previewing buyer access \xB7 ${
|
|
302
|
-
<button type="button" data-ch-act="exit-preview">Exit preview</button>`,s.classList.add("on"),s.querySelector('[data-ch-act="exit-preview"]')?.addEventListener("click",()=>this.setView("inspect"))}setView(e){if(this.view=e,e==="inspect")this.previewProjection=null,this.previewState="idle",this.setBanner(!1);else{if(!this.previewAudience.length){let t=this.list?.channels.find(n=>n.state==="active");this.previewAudience=[t?t.id:
|
|
301
|
+
</button>`),this.stagedEl?.querySelectorAll("[data-ch-act]").forEach(l=>{l.addEventListener("click",()=>{l.dataset.chAct==="discard"?this.host.clearSelection():this.openDialog({kind:"review"})})})}setBanner(e,t="",n){let s=this.bannerEl;if(!s)return;if(this.host.root.classList.toggle("ch-preview",e),!e){s.classList.remove("on"),s.innerHTML="";return}let a=this.previewAudience.length===1?this.markerFor(this.previewAudience[0]):{color:"var(--slm-accent)",letter:""},o=n==null?"":` \xB7 ${n.toLocaleString()} ${n===1?"seat":"seats"} available now`;s.innerHTML=`<span class="dot" style="background:${h(a.color)}"></span>
|
|
302
|
+
Previewing buyer access \xB7 ${h(t)}${o} \xB7 read-only
|
|
303
|
+
<button type="button" data-ch-act="exit-preview">Exit preview</button>`,s.classList.add("on"),s.querySelector('[data-ch-act="exit-preview"]')?.addEventListener("click",()=>this.setView("inspect"))}setView(e){if(this.view=e,e==="inspect")this.previewProjection=null,this.previewState="idle",this.setBanner(!1);else{if(!this.previewAudience.length){let t=this.list?.channels.find(n=>n.state==="active");this.previewAudience=[t?t.id:f]}this.loadPreview()}this.paintRail(),this.paintOverlay(),this.paintStagedBar(),this.onInteractionChange?.()}async loadPreview(){let e=[...this.previewAudience],t=e.map(n=>this.nameOf(n)??C).join(" + ");this.setBanner(!0,t),this.previewProjection=null,this.previewState="loading",this.active&&this.paintRail();try{this.previewProjection=await this.host.api.channelPreview(this.host.eventKey,e,{includePublic:this.previewIncludePublic||e.some($)}),this.previewState="ready";let n=this.previewProjection.available===!1?void 0:this.previewProjection.counts?.eligible??this.previewProjection.eligible?.length;this.setBanner(!0,t,n)}catch(n){let s=n instanceof m?n.status:0;this.previewState=s===404||s===405||s===501?"unsupported":"error",this.previewProjection=null,this.previewState==="error"&&this.host.onError(n)}this.active&&(this.paintRail(),this.paintOverlay())}setRailHtml(e){if(e===this.railHtml)return!1;let t=this.host.rail,n=t.scrollTop;return t.innerHTML=e,this.railHtml=e,n&&(t.scrollTop=n),!0}paintRail(){if(!this.active)return;let e=this.host.rail;if(!this.caps.view){this.setRailHtml(`${Y}${v("info","Channels are not shared with your role"," Seeing how seats are shared out needs channel-management permission on this event.","lock")}`);return}if(this.loading&&!this.list){this.setRailHtml(`${Y}${this.viewSegmentHtml()}
|
|
303
304
|
<div class="slm-ch-busy" role="status" data-ch-state="list-loading">Loading channels and who holds which seats\u2026</div>
|
|
304
|
-
<div class="slm-ch-skel"></div><div class="slm-ch-skel"></div><div class="slm-ch-skel"></div>`);return}if(!this.list&&this.loadError){this.setRailHtml(`${
|
|
305
|
-
<div data-ch-state="list-error" role="alert">${
|
|
306
|
-
<button type="button" class="slm-btn ghost slm-ch-small" data-ch-act="retry">Try again</button>`)&&e.querySelector('[data-ch-act="retry"]')?.addEventListener("click",()=>{this.refresh()});return}let t=this.host.selectionLabels(),n=this.host.isCompact()?'<div class="slm-ch-grab"><span class="slm-ch-grabbar"></span></div>':"",s=this.viewSegmentHtml(),a=this.view==="preview"?this.previewRailHtml():this.detailChannelId?this.detailRailHtml(this.detailChannelId):t.length&&this.caps.manage?this.selectionRailHtml(t):this.listRailHtml();this.setRailHtml(`${n}${
|
|
305
|
+
<div class="slm-ch-skel"></div><div class="slm-ch-skel"></div><div class="slm-ch-skel"></div>`);return}if(!this.list&&this.loadError){this.setRailHtml(`${Y}${this.viewSegmentHtml()}
|
|
306
|
+
<div data-ch-state="list-error" role="alert">${v("error","Couldn't load sales channels"," This event may well have channels; we could not read them. Everything else on this event still works.").replace(' role="alert"',"")}</div>
|
|
307
|
+
<button type="button" class="slm-btn ghost slm-ch-small" data-ch-act="retry">Try again</button>`)&&e.querySelector('[data-ch-act="retry"]')?.addEventListener("click",()=>{this.refresh()});return}let t=this.host.selectionLabels(),n=this.host.isCompact()?'<div class="slm-ch-grab"><span class="slm-ch-grabbar"></span></div>':"",s=this.viewSegmentHtml(),a=this.view==="preview"?this.previewRailHtml():this.detailChannelId?this.detailRailHtml(this.detailChannelId):t.length&&this.caps.manage?this.selectionRailHtml(t):this.listRailHtml();this.setRailHtml(`${n}${Y}${s}${a}`)&&this.wireRail(),this.paintStagedBar()}viewSegmentHtml(){let e=this.view==="inspect"?" on":"",t=this.view==="preview"?" on":"";return`<div class="slm-ch-viewseg" role="group" aria-label="Channels view">
|
|
307
308
|
<button type="button" class="${e.trim()}" data-ch-view="inspect"
|
|
308
309
|
aria-pressed="${this.view==="inspect"}">Allocation</button>
|
|
309
310
|
<button type="button" class="${t.trim()}" data-ch-view="preview"
|
|
310
311
|
aria-pressed="${this.view==="preview"}">Buyer preview</button>
|
|
311
|
-
</div>${this.mapNavigationHtml()}`}mapNavigationHtml(){if(this.host.sections().length<2)return"";let e=this.focusedSectionId?this.host.sections().find(t=>t.id===this.focusedSectionId)?.label??"section":null;return e?`<div class="slm-ch-mapnav-head"><span>${
|
|
312
|
-
<button type="button" data-ch-act="sections">All sections</button></div>`:""}countsHtml(e,t){let n=(s,a,o,r="")=>{let l=this.lastCounts.get(`${t}:${s}`),c=l!=null&&l!==a?" bump":"";return this.lastCounts.set(`${t}:${s}`,a),`<span class="${r}"><b class="${c.trim()}">${a.toLocaleString()}</b> ${o}</span>`};return`<span class="slm-ch-counts">${[n("allocated",e.allocated,"allocated"),n("free",e.free,"free","free"),n("booked",e.booked,"sold"),e.held?n("held",e.held,"in a cart"):""].filter(Boolean).join('<i aria-hidden="true">\xB7</i>')}</span>`}channelRowHtml(e,t={}){let n=this.markerFor(e.id),s=t.builtin?"builtin":e.state,a=e.state==="paused"||e.state==="archived"?" dim":"",o=!t.builtin&&this.caps.manage&&this.detailChannelId!==e.id,r=`slm-ch-row${t.builtin?" public":""}${e.state==="archived"?" archived":""}${this.detailChannelId===e.id||this.applied&&this.applied.result.targetChannelId===e.id?" on":""}${o?" open":""}`,l=!t.builtin&&this.caps.manage?`<button type="button" class="slm-ch-more" data-ch-menu="${
|
|
313
|
-
aria-label="More actions for ${
|
|
314
|
-
aria-label="Open ${
|
|
312
|
+
</div>${this.mapNavigationHtml()}`}mapNavigationHtml(){if(this.host.sections().length<2)return"";let e=this.focusedSectionId?this.host.sections().find(t=>t.id===this.focusedSectionId)?.label??"section":null;return e?`<div class="slm-ch-mapnav-head"><span>${h(e)}</span>
|
|
313
|
+
<button type="button" data-ch-act="sections">All sections</button></div>`:""}countsHtml(e,t){let n=(s,a,o,r="")=>{let l=this.lastCounts.get(`${t}:${s}`),c=l!=null&&l!==a?" bump":"";return this.lastCounts.set(`${t}:${s}`,a),`<span class="${r}"><b class="${c.trim()}">${a.toLocaleString()}</b> ${o}</span>`};return`<span class="slm-ch-counts">${[n("allocated",e.allocated,"allocated"),n("free",e.free,"free","free"),n("booked",e.booked,"sold"),e.held?n("held",e.held,"in a cart"):""].filter(Boolean).join('<i aria-hidden="true">\xB7</i>')}</span>`}channelRowHtml(e,t={}){let n=this.markerFor(e.id),s=t.builtin?"builtin":e.state,a=e.state==="paused"||e.state==="archived"?" dim":"",o=!t.builtin&&this.caps.manage&&this.detailChannelId!==e.id,r=`slm-ch-row${t.builtin?" public":""}${e.state==="archived"?" archived":""}${this.detailChannelId===e.id||this.applied&&this.applied.result.targetChannelId===e.id?" on":""}${o?" open":""}`,l=!t.builtin&&this.caps.manage?`<button type="button" class="slm-ch-more" data-ch-menu="${h(e.id)}"
|
|
314
|
+
aria-label="More actions for ${h(e.name)}" aria-haspopup="dialog">\u22EF</button>`:"",c=o?` role="button" tabindex="0" data-ch-open="${h(e.id)}"
|
|
315
|
+
aria-label="Open ${h(e.name)}"`:"";return`<div class="${r}"${c}>
|
|
315
316
|
<span class="slm-ch-head">
|
|
316
|
-
<span class="slm-ch-mk${a}" style="background:${
|
|
317
|
-
<span class="slm-ch-name">${
|
|
318
|
-
<span class="slm-ch-badge ${s}">${
|
|
317
|
+
<span class="slm-ch-mk${a}" style="background:${h(n.color)}" aria-hidden="true">${h(n.letter)}</span>
|
|
318
|
+
<span class="slm-ch-name">${h(e.name)}</span>
|
|
319
|
+
<span class="slm-ch-badge ${s}">${h(we(t.builtin?"builtin":e.state))}</span>
|
|
319
320
|
${l}
|
|
320
321
|
</span>
|
|
321
322
|
${this.countsHtml(e.counts,e.id||"public")}
|
|
322
|
-
<span class="slm-ch-access">${t.builtin?"Everyone on your event page":
|
|
323
|
-
</div>`}listRailHtml(){let e=this.list,t=e.channels.filter(l=>l.state==="archived").length,n=e.channels.filter(l=>this.showArchived||l.state!=="archived"),s=[this.channelRowHtml(e.publicSale,{builtin:!0}),...n.map((l,c)=>this.channelRowHtml(l,{index:c}))].join(""),a=n.length?"":`<div class="slm-ch-empty" data-ch-state="list-empty">${
|
|
323
|
+
<span class="slm-ch-access">${t.builtin?"Everyone on your event page":h(ge(e.access))}</span>
|
|
324
|
+
</div>`}listRailHtml(){let e=this.list,t=e.channels.filter(l=>l.state==="archived").length,n=e.channels.filter(l=>this.showArchived||l.state!=="archived"),s=[this.channelRowHtml(e.publicSale,{builtin:!0}),...n.map((l,c)=>this.channelRowHtml(l,{index:c}))].join(""),a=n.length?"":`<div class="slm-ch-empty" data-ch-state="list-empty">${M("route","#ea7a1e",40)}
|
|
324
325
|
<b>Every seat is on public sale</b><p>${t&&!this.showArchived?`No open channels. ${t.toLocaleString()} archived channel${t===1?" is":"s are"} hidden below.`:"Make a channel to keep seats for your box office, a partner or a members sale."}</p>
|
|
325
|
-
${this.caps.manage?'<button type="button" class="slm-btn ghost slm-ch-small" data-ch-act="create">New channel</button>':""}</div>`,o=this.caps.manage?`<button type="button" class="slm-btn ghost slm-ch-new" data-ch-act="create">${bt}New channel</button>`:"";return`${this.caps.manage?"":
|
|
326
|
+
${this.caps.manage?'<button type="button" class="slm-btn ghost slm-ch-small" data-ch-act="create">New channel</button>':""}</div>`,o=this.caps.manage?`<button type="button" class="slm-btn ghost slm-ch-new" data-ch-act="create">${bt}New channel</button>`:"";return`${this.caps.manage?"":v("info","You can see, not change",' You can see how seats are shared out. Changing it needs the "Manage channels" permission.',"lock")}${this.appliedHtml()}
|
|
326
327
|
<div class="slm-ch-listhead"><p class="slm-eyebrow">Sales channels</p>${o}</div>
|
|
327
328
|
<div class="slm-ch-list">${s}</div>
|
|
328
329
|
${a}
|
|
@@ -331,19 +332,19 @@ import{k as S}from"./chunk-QB6PA3C6.js";function ne(i){i.querySelectorAll("selec
|
|
|
331
332
|
<button type="button" class="slm-linkbtn" data-ch-act="toggle-archived" aria-pressed="${this.showArchived}"
|
|
332
333
|
style="text-align:left">${this.showArchived?"Hide":"Show"} archived${t?` (${t})`:""}</button>
|
|
333
334
|
</p>${this.undoBarHtml()}`}assignEntryHtml(){return this.caps.manage?this.assignOpen?`<div style="margin-top:8px">${this.assignmentToolsHtml({collapsible:!0})}</div>`:`
|
|
334
|
-
<button type="button" class="slm-btn ghost slm-ch-give" data-ch-act="assign-open" aria-expanded="false">${vt}Give seats to a channel</button>`:""}assignmentToolsHtml(e={}){let t=this.assignableChannels().map(
|
|
335
|
+
<button type="button" class="slm-btn ghost slm-ch-give" data-ch-act="assign-open" aria-expanded="false">${vt}Give seats to a channel</button>`:""}assignmentToolsHtml(e={}){let t=this.assignableChannels(),n=t.map(o=>`<option value="${h(o.id)}"${o.id===this.targetChannelId?" selected":""}>${h(o.name)}</option>`).join(""),s=this.mapIntent==="assign"?"slm-btn":"slm-btn ghost",a=e.collapsible?`<button type="button" class="slm-linkbtn" data-ch-act="assign-close"
|
|
336
|
+
aria-expanded="true" style="float:right;font-weight:800">Done</button>`:"";return`
|
|
335
337
|
<div class="slm-ch-assigncard">
|
|
336
|
-
|
|
337
|
-
aria-expanded="true" style="float:right;font-weight:800">Done</button>`:""}Give seats to a channel</p>
|
|
338
|
+
${a?`<p class="slm-eyebrow">${a}Give seats to a channel</p>`:""}
|
|
338
339
|
<div class="slm-field slm-ch-giveto">
|
|
339
340
|
<label for="slm-ch-target">Give seats to</label>
|
|
340
|
-
<select class="slm-select" id="slm-ch-target" data-ch-target>${
|
|
341
|
+
<span class="slm-ch-pick">${this.plateHtml((t.find(o=>o.id===this.targetChannelId)??t[0])?.id)}<select class="slm-select" id="slm-ch-target" data-ch-target>${n}</select></span>
|
|
341
342
|
</div>
|
|
342
|
-
${this.chooser.chipsHtml({intents:`<button type="button" class="${
|
|
343
|
+
${this.chooser.chipsHtml({intents:`<button type="button" class="${s}" data-ch-act="drag-select">Drag box</button>`})}
|
|
343
344
|
<p class="slm-note">Pick seats on the map, then review. Nothing moves until
|
|
344
345
|
you apply; seats in a cart or sold never move.</p>
|
|
345
|
-
</div>`}selectionRailHtml(e){let t=
|
|
346
|
-
<button type="button" class="slm-btn ghost slm-ch-small slm-ch-wide" data-ch-act="refresh-review">Refresh and review again</button>`:"",o=e.length!==this.lastSelectionCount?" bump":"";this.lastSelectionCount=e.length;let r=e.length>I,l=0,c=t.map(
|
|
346
|
+
</div>`}selectionRailHtml(e){let t=de(e,this.allocation,this.list),n=this.targetChannelId,s=n&&this.nameOf(n)||"this channel",a=this.conflict?`<div role="alert">${v("warn","Someone changed these seats while you were choosing",` Nothing was applied. Your ${e.length.toLocaleString()}-seat selection is kept.`).replace(' role="status"',"")}</div>
|
|
347
|
+
<button type="button" class="slm-btn ghost slm-ch-small slm-ch-wide" data-ch-act="refresh-review">Refresh and review again</button>`:"",o=e.length!==this.lastSelectionCount?" bump":"";this.lastSelectionCount=e.length;let r=e.length>I,l=0,c=t.map(g=>{let x=g.count.toLocaleString();return g.channelId===n?(l+=g.count,`<div class="same">= ${x} already in ${h(s)}</div>`):$(g.channelId)?`<div class="add">+ ${x} from ${h(g.name)}</div>`:`<div class="move">\u21C4 ${x} from ${h(g.name)}</div>`}).join(""),d=e.length-l,u=r?`Choose at most ${I.toLocaleString()} seats`:d?`Review ${d.toLocaleString()} ${d===1?"change":"changes"}`:"Review the selection";return`
|
|
347
348
|
${a}
|
|
348
349
|
${this.assignmentToolsHtml()}
|
|
349
350
|
<div class="slm-ch-staged2" aria-live="polite" aria-label="Selection sources">
|
|
@@ -351,9 +352,9 @@ import{k as S}from"./chunk-QB6PA3C6.js";function ne(i){i.querySelectorAll("selec
|
|
|
351
352
|
<button type="button" class="slm-linkbtn" data-ch-act="discard">Clear</button></div>
|
|
352
353
|
${c}
|
|
353
354
|
</div>
|
|
354
|
-
${r?
|
|
355
|
+
${r?v("warn","Too many seats for one change",` One change can move up to ${I.toLocaleString()} seats. Split it, for example by row groups.`).replace(' role="status"',' role="alert"'):""}
|
|
355
356
|
<div class="slm-railfoot"><button type="button" class="slm-btn" data-ch-act="review"${r?" disabled":""}>${u}</button>
|
|
356
|
-
<p class="slm-note">Nothing moves until you apply.</p></div>`}detailRailHtml(e){let t=`<p class="slm-eyebrow">
|
|
357
|
+
<p class="slm-note">Nothing moves until you apply.</p><button type="button" class="slm-linkbtn" data-ch-act="discard">Clear selection</button></div>`}detailRailHtml(e){let t=`<p class="slm-eyebrow">
|
|
357
358
|
<button type="button" class="slm-linkbtn" data-ch-act="back" style="text-align:left">\u2039 All channels</button>
|
|
358
359
|
</p>`,n=this.list?.channels.find(l=>l.id===e);if(!n)return`${t}
|
|
359
360
|
<div class="slm-ch-alert warn" role="status" data-ch-state="detail-gone"><span>\u2139</span>
|
|
@@ -365,8 +366,8 @@ import{k as S}from"./chunk-QB6PA3C6.js";function ne(i){i.querySelectorAll("selec
|
|
|
365
366
|
${t}
|
|
366
367
|
<div class="slm-ch-list">${this.channelRowHtml(n)}</div>
|
|
367
368
|
${s}
|
|
368
|
-
${r}`}distributeHtml(e){let t=e.access?.intent??"none",n=this.linksState!=="unsupported",s=(a,o)=>{let r=a===t,[l,c]=mt[a];return`<div class="slm-ch-dist${r?" on":""}" data-ch-route="${
|
|
369
|
-
<span class="top"><b>${l}</b>${r?`<span class="cur">Current</span>${a==="server"?'<button type="button" class="slm-linkbtn" data-ch-act="embed-code">Get embed code</button>':""}`:`<button type="button" class="slm-btn ghost slm-ch-small" data-ch-act="${
|
|
369
|
+
${r}`}distributeHtml(e){let t=e.access?.intent??"none",n=this.linksState!=="unsupported",s=(a,o)=>{let r=a===t,[l,c]=mt[a];return`<div class="slm-ch-dist${r?" on":""}" data-ch-route="${h(a)}">
|
|
370
|
+
<span class="top"><b>${l}</b>${r?`<span class="cur">Current</span>${a==="server"?'<button type="button" class="slm-linkbtn" data-ch-act="embed-code">Get embed code</button>':""}`:`<button type="button" class="slm-btn ghost slm-ch-small" data-ch-act="${h(o)}">Switch</button>`}</span>
|
|
370
371
|
<span class="why">${c}</span>
|
|
371
372
|
</div>`};return`
|
|
372
373
|
<p class="slm-eyebrow" style="margin-top:14px">How buyers reach it</p>
|
|
@@ -375,42 +376,42 @@ import{k as S}from"./chunk-QB6PA3C6.js";function ne(i){i.querySelectorAll("selec
|
|
|
375
376
|
${s("internal","route-internal")}
|
|
376
377
|
${s("none","route-none")}
|
|
377
378
|
${this.hostedLinksHtml(t==="hosted_link")}
|
|
378
|
-
${t==="server"?
|
|
379
|
+
${t==="server"?Ae:""}`}async loadLinks(e){if(!this.caps.view)return;let t=++this.linksSeq,n=()=>t!==this.linksSeq||this.linksChannelId!==e;this.linksChannelId!==e&&(this.links=[],this.linksChannelId=e,this.linksState="loading");try{let s=await this.host.api.accessLinks(this.host.eventKey,e);if(n())return;this.links=s.links??[],this.linksState="ready"}catch(s){if(n())return;let a=s instanceof m?s.status:0;this.links=[],this.linksState=a===404||a===405||a===501?"unsupported":"error",this.linksState==="error"&&this.host.onError(s)}}hostedLinksHtml(e=!1){let t='<p class="slm-eyebrow" style="margin-top:14px">Buyer links</p>';return this.linksState==="unsupported"?`${t}<div data-ch-state="links-unsupported">${v("info","Buyer links need a newer server"," Everything else on this channel works normally.")}</div>`:this.linksState==="error"?`${t}<div data-ch-state="links-error" role="alert">${v("error","Couldn't load this channel's links"," This is a failed read, not an empty list; any live link is still working.").replace(' role="alert"',"")}</div>
|
|
379
380
|
<button type="button" class="slm-btn ghost slm-ch-small" data-ch-act="link-reload">Try again</button>`:this.linksState==="idle"||this.linksState==="loading"&&!this.links.length?`${t}<div class="slm-ch-busy" role="status" data-ch-state="links-loading">Loading buyer links\u2026</div>`:this.links.length?`${t}
|
|
380
381
|
${this.links.map((n,s)=>this.linkCardHtml(n,s===0&&e)).join("")}
|
|
381
382
|
<p class="slm-note">A link is shown once, when you make it. SeatLayer keeps only a fingerprint, so a lost link can be replaced but not shown again.</p>`:e&&this.caps.manage?`${t}<p class="slm-note">No links yet. Make one and send it to the buyers who should get these seats.</p>
|
|
382
|
-
<button type="button" class="slm-btn ghost slm-ch-small" data-ch-act="link-create">New link</button>`:""}linkCardHtml(e,t=!1){let n=
|
|
383
|
-
<button type="button" class="slm-btn ghost slm-ch-small" data-ch-revoke="${
|
|
383
|
+
<button type="button" class="slm-btn ghost slm-ch-small" data-ch-act="link-create">New link</button>`:""}linkCardHtml(e,t=!1){let n=ve(e),s=this.caps.manage&&fe(e),a=this.caps.manage&&(s||t)?`<div class="slm-ch-acts">${t?'<button type="button" class="slm-btn ghost slm-ch-small" data-ch-act="link-create">New link</button>':""}${s?`<button type="button" class="slm-btn ghost slm-ch-small" data-ch-rotate="${h(e.id)}">Rotate</button>
|
|
384
|
+
<button type="button" class="slm-btn ghost slm-ch-small" data-ch-revoke="${h(e.id)}">Revoke</button>`:""}</div>`:"";return`<div class="slm-ch-link">
|
|
384
385
|
<span class="lk-head">
|
|
385
|
-
<span class="lk-name">${
|
|
386
|
-
<span class="slm-ch-badge ${n.kind}">${
|
|
386
|
+
<span class="lk-name">${h(e.label||"Buyer link")}</span>
|
|
387
|
+
<span class="slm-ch-badge ${n.kind}">${h(n.text)}</span>
|
|
387
388
|
</span>
|
|
388
|
-
<span class="lk-facts">${
|
|
389
|
+
<span class="lk-facts">${h(ye(e))}</span>
|
|
389
390
|
${a}
|
|
390
|
-
</div>`}previewRailHtml(){let e=[{id:
|
|
391
|
-
<button type="button" class="slm-btn ghost slm-ch-small" data-ch-act="preview-retry">Try again</button>`:"",l=this.previewProjection?.unavailable??[],c=this.previewProjection?.available===!1?
|
|
391
|
+
</div>`}previewRailHtml(){let e=[{id:f,name:this.list?.publicSale.name??C},...(this.list?.channels??[]).filter(p=>p.state!=="archived").map(p=>({id:p.id,name:p.name}))],t=this.previewAudience[0]??f,n=e.map(p=>`<option value="${h(p.id)}"${p.id===t?" selected":""}>${h(p.name)}</option>`).join(""),s=$(t)?"a buyer on your event page":`a ${this.nameOf(t)??"channel"} buyer`,a=this.previewState==="unsupported"?`<div data-ch-state="preview-unsupported">${v("info","Preview needs a newer server"," Giving seats to channels works normally; the preview appears once this event's API is updated.")}</div>`:"",o=this.previewState==="loading"?`<div class="slm-ch-busy" role="status" data-ch-state="preview-loading">Asking the server what ${h(s)} sees\u2026</div>`:"",r=this.previewState==="error"?`<div data-ch-state="preview-error" role="alert">${v("error","Couldn't load the buyer preview"," Nothing is wrong with these seats; only the preview failed.").replace(' role="alert"',"")}</div>
|
|
392
|
+
<button type="button" class="slm-btn ghost slm-ch-small" data-ch-act="preview-retry">Try again</button>`:"",l=this.previewProjection?.unavailable??[],c=l.length===1&&this.list?.channels.find(p=>p.id===l[0].channelId&&p.access?.intent==="hosted_link"),d=this.previewProjection?.available===!1?v("warn",l.length===1?`${this.nameOf(l[0].channelId)??"This channel"} is ${l[0].state}`:"This private sale is not available",` A buyer arriving with ${c?`a ${c.name} link`:l.length===1?"its access":"this access"} sees this message, not these seats.`):"",u=this.previewProjection?.counts?.eligible??this.previewProjection?.eligible?.length,g=u!=null&&this.previewProjection?.available!==!1?v("ok",`${u.toLocaleString()} ${u===1?"seat is":"seats are"} available to them now`,` Exactly what ${s} sees. Read-only: nothing is held.${this.previewProjection?.includePublic===!1?" Public sale seats are not part of this access.":""}`,"eye"):"",x=$(t)?"":`
|
|
392
393
|
<label class="slm-ch-check"><input type="checkbox" data-ch-includepublic ${this.previewIncludePublic?"checked":""} />
|
|
393
394
|
Also include Public sale seats</label>`;return`
|
|
394
395
|
<div class="slm-field slm-ch-seeas">
|
|
395
396
|
<label for="slm-ch-audience">See it as</label>
|
|
396
397
|
<select class="slm-select" id="slm-ch-audience" data-ch-audience>${n}</select>
|
|
397
398
|
</div>
|
|
398
|
-
${
|
|
399
|
-
${o}${r}${a}${
|
|
400
|
-
<h3 id="slm-ch-dlg-title">Change how ${
|
|
401
|
-
<p class="sub">${
|
|
399
|
+
${x}
|
|
400
|
+
${o}${r}${a}${d}${g}`}paintSelection(){this.caps.manage&&this.host.selectionLabels().length&&(this.assignOpen=!0),this.view==="inspect"&&!this.detailChannelId&&this.paintRail()}wireRail(){let e=this.host.rail;e.querySelectorAll("[data-ch-view]").forEach(o=>{o.addEventListener("click",()=>this.setView(o.dataset.chView))}),e.querySelectorAll("[data-ch-map]").forEach(o=>{o.addEventListener("click",()=>{this.mapIntent=o.dataset.chMap==="assign"?"assign":"pan",this.mapIntent==="assign"&&(this.assignOpen=!0),this.paintRail(),this.onInteractionChange?.()})}),e.querySelectorAll("[data-ch-open]").forEach(o=>{let r=()=>this.openChannel(o.dataset.chOpen);o.addEventListener("click",r),o.addEventListener("keydown",l=>{l.key!=="Enter"&&l.key!==" "&&l.key!=="Spacebar"||(l.preventDefault(),r())})}),e.querySelectorAll("[data-ch-menu]").forEach(o=>{o.addEventListener("click",r=>{r.stopPropagation(),this.openDialog({kind:"menu",channelId:o.dataset.chMenu})}),o.addEventListener("keydown",r=>{r.stopPropagation()})}),e.querySelectorAll("[data-ch-rotate]").forEach(o=>{o.addEventListener("click",()=>this.openDialog({kind:"linkRotate",channelId:this.detailChannelId,linkId:o.dataset.chRotate}))}),e.querySelectorAll("[data-ch-revoke]").forEach(o=>{o.addEventListener("click",()=>this.openDialog({kind:"linkRevoke",channelId:this.detailChannelId,linkId:o.dataset.chRevoke}))});let t=e.querySelector("[data-ch-target]");t?.addEventListener("change",()=>{this.targetChannelId=t.value,this.conflict=!1,this.paintRail()});let n=e.querySelector("[data-ch-audience]");n?.addEventListener("change",()=>{this.previewAudience=[n.value],this.loadPreview()});let s=e.querySelector("[data-ch-includepublic]");s?.addEventListener("change",()=>{this.previewIncludePublic=s.checked,this.loadPreview()}),e.querySelector(".slm-ch-grab")?.addEventListener("click",()=>this.cycleDetent()),e.querySelectorAll("[data-ch-act]").forEach(o=>{o.addEventListener("click",()=>this.railAction(o.dataset.chAct))}),this.chooser.wireFind(e)}openChannel(e){this.detailChannelId=e,this.paintRail(),this.loadLinks(e).then(()=>this.paintRail())}railAction(e){switch(e){case"sections":this.focusedSectionId=null,this.host.showSectionOverview(),this.paintRail();break;case"create":this.openDialog({kind:"create"});break;case"review":this.openDialog({kind:"review"});break;case"rename":this.openDialog({kind:"rename",channelId:this.detailChannelId});break;case"pricing":this.openDialog({kind:"pricing",channelId:this.detailChannelId});break;case"archive":this.openDialog({kind:"archive",channelId:this.detailChannelId});break;case"seatlist":this.openDialog({kind:"seatlist"});break;case"pause":this.togglePause();break;case"discard":this.host.clearSelection();break;case"applied-details":this.applied&&this.openDialog({kind:"review",applied:this.applied.result});break;case"undo-applied":this.undoApplied();break;case"back":this.detailChannelId=null,this.linksChannelId=null,this.links=[],this.linksState="idle",this.paintRail();break;case"link-create":this.openDialog({kind:"linkCreate",channelId:this.detailChannelId});break;case"embed-code":this.chooseWebsiteIntegration();break;case"route-internal":this.setAccessIntent("internal");break;case"route-none":this.setAccessIntent("none");break;case"link-reload":this.detailChannelId&&this.reloadLinks();break;case"retry":this.refresh();break;case"toggle-archived":this.showArchived=!this.showArchived,this.refresh();break;case"refresh-review":this.conflict=!1,this.refresh().then(()=>this.openDialog({kind:"review"}));break;case"pick-sections":this.openDialog({kind:"scope",scope:"sections"});break;case"pick-rows":this.openDialog({kind:"scope",scope:"rows"});break;case"drag-select":this.mapIntent="assign",this.paintRail(),this.onInteractionChange?.();break;case"pick-category":this.pickCategory();break;case"assign-open":this.assignOpen=!0,this.mapIntent="assign",this.paintRail(),this.onInteractionChange?.();break;case"assign-close":this.assignOpen=!1,this.mapIntent="pan",this.paintRail(),this.onInteractionChange?.();break;case"preview-retry":this.loadPreview();break;default:break}}pickCategory(){this.chooser.openCategory()}renderScopeDialog(e){e.scope==="rows"?this.chooser.openRows():this.chooser.openSections()}openDialog(e){this.dialog=e,this.renderDialog()}renderDialog(){let e=this.dialog;e&&(e.kind==="create"?this.renderCreateDialog(e):e.kind==="review"?this.renderReviewDialog(e):e.kind==="scope"?this.renderScopeDialog(e):e.kind==="archive"?this.renderArchiveDialog(e):e.kind==="rename"?this.renderRenameDialog(e):e.kind==="pricing"?this.renderPricingDialog(e):e.kind==="seatlist"?this.renderSeatListDialog():e.kind==="menu"?this.renderMenuDialog(e):e.kind==="linkCreate"?this.renderLinkCreateDialog(e):e.kind==="linkRotate"?this.renderLinkRotateDialog(e):e.kind==="linkRevoke"?this.renderLinkRevokeDialog(e):e.kind==="intentSwitch"&&this.renderIntentSwitchDialog(e))}renderIntentSwitchDialog(e){let t=this.list?.channels.find(o=>o.id===e.channelId),n=e.intentTo;if(!t||!n||!this.caps.manage){this.closeDialog();return}let{headline:s,consequences:a}=be(e.switchBlocked);this.renderScrim(`
|
|
401
|
+
<h3 id="slm-ch-dlg-title">Change how ${h(t.name)} reaches buyers?</h3>
|
|
402
|
+
<p class="sub">${h(s)}</p>
|
|
402
403
|
<div class="slm-ch-alert warn" role="alert"><span>\u26A0</span><span>
|
|
403
|
-
${a.map(o=>`<span style="display:block;margin-bottom:6px">${
|
|
404
|
+
${a.map(o=>`<span style="display:block;margin-bottom:6px">${h(o)}</span>`).join("")}
|
|
404
405
|
</span></div>
|
|
405
406
|
${e.pendingLink?`<p class="slm-note">Your new buyer link is created as soon as
|
|
406
407
|
the route changes \u2014 you will not have to fill the form in again.</p>`:""}
|
|
407
|
-
<p class="slm-ch-err" data-ch-error ${e.error?"":"hidden"}>${
|
|
408
|
+
<p class="slm-ch-err" data-ch-error ${e.error?"":"hidden"}>${h(e.error??"")}</p>
|
|
408
409
|
<div class="foot">
|
|
409
410
|
<button type="button" class="quiet" data-ch-close>Leave it as it is</button>
|
|
410
411
|
<button type="button" class="slm-btn" data-ch-intent-ack${e.busy?" disabled":""}>
|
|
411
|
-
${e.busy?"Changing\u2026":`Change to "${
|
|
412
|
+
${e.busy?"Changing\u2026":`Change to "${h(H(n))}"`}</button>
|
|
412
413
|
</div>`,o=>{o.querySelector("[data-ch-intent-ack]")?.addEventListener("click",()=>{this.acknowledgeIntentSwitch(n,e.pendingLink??null)})})}async acknowledgeIntentSwitch(e,t){let n=this.detailChannelId;if(!n){this.closeDialog();return}if(this.dialog&&(this.dialog.busy=!0,this.renderDialog()),!await this.setAccessIntent(e,{acknowledgeLiveAccess:!0})){this.dialog?.kind==="intentSwitch"&&(this.dialog.busy=!1,this.renderDialog());return}if(!t){this.closeDialog();return}this.dialog?.kind==="intentSwitch"&&(this.dialog.busy=!1,this.renderDialog()),await this.mintLink(n,t)}renderScrim(e,t){let n=this.scrimEl;n||(this.lastFocus=document.activeElement??null),n?.remove();let s=document.createElement("div");s.className="slm-ch-scrim",s.innerHTML=`<div class="slm-ch-dialog" role="dialog" aria-modal="true"
|
|
413
|
-
aria-labelledby="slm-ch-dlg-title" tabindex="-1">${e}</div>`,this.host.root.appendChild(s),this.scrimEl=s;let a=s.firstElementChild;a.querySelectorAll("[data-ch-close]").forEach(r=>{r.addEventListener("click",()=>this.closeDialog())}),s.addEventListener("keydown",r=>{if(r.key==="Escape"){r.stopPropagation(),this.closeDialog();return}if(r.key!=="Tab")return;let l=[...a.querySelectorAll('summary,button:not([disabled]),select:not([hidden]),input,textarea,a[href],[tabindex]:not([tabindex="-1"])')];if(!l.length)return;let c=l[0],
|
|
414
|
+
aria-labelledby="slm-ch-dlg-title" tabindex="-1">${e}</div>`,this.host.root.appendChild(s),this.scrimEl=s;let a=s.firstElementChild;a.querySelectorAll("[data-ch-close]").forEach(r=>{r.addEventListener("click",()=>this.closeDialog())}),s.addEventListener("keydown",r=>{if(r.key==="Escape"){r.stopPropagation(),this.closeDialog();return}if(r.key!=="Tab")return;let l=[...a.querySelectorAll('summary,button:not([disabled]),select:not([hidden]),input,textarea,a[href],[tabindex]:not([tabindex="-1"])')];if(!l.length)return;let c=l[0],d=l[l.length-1];r.shiftKey&&document.activeElement===c?(r.preventDefault(),d.focus()):!r.shiftKey&&document.activeElement===d&&(r.preventDefault(),c.focus())}),t(a),ne(a),(a.querySelector("input,summary,button")??a).focus()}closeDialog(e={}){this.dialog=null,this.scrimEl?.remove(),this.scrimEl=null,e.restoreFocus!==!1&&this.lastFocus?.focus?.(),this.lastFocus=null}renderCreateDialog(e){let t=(this.list?.channels??[]).map(s=>P(s.marker||s.name,"")),n=W("",t);this.renderScrim(`
|
|
414
415
|
<h3 id="slm-ch-dlg-title">New sales channel</h3>
|
|
415
416
|
<p class="sub">A named share of seats only the right buyers can reach. You pick the seats next.</p>
|
|
416
417
|
<div class="slm-field">
|
|
@@ -421,7 +422,7 @@ import{k as S}from"./chunk-QB6PA3C6.js";function ne(i){i.querySelectorAll("selec
|
|
|
421
422
|
<div class="slm-field">
|
|
422
423
|
<label>Marker</label>
|
|
423
424
|
<div style="display:flex;gap:8px;align-items:center">
|
|
424
|
-
<span class="slm-ch-mk" data-ch-marker style="background:${
|
|
425
|
+
<span class="slm-ch-mk" data-ch-marker style="background:${h(n.color)};width:28px;height:28px;font-size:13px">${h(n.letter)}</span>
|
|
425
426
|
<span class="slm-note" style="margin:0">The letter comes from the name; the colour is picked for you.</span>
|
|
426
427
|
</div>
|
|
427
428
|
</div>
|
|
@@ -430,25 +431,25 @@ import{k as S}from"./chunk-QB6PA3C6.js";function ne(i){i.querySelectorAll("selec
|
|
|
430
431
|
<input class="slm-input" id="slm-ch-ref" maxlength="120" placeholder="e.g. travel-agency-a" />
|
|
431
432
|
<p class="slm-note">For your own system and webhooks.</p>
|
|
432
433
|
</div>
|
|
433
|
-
<p class="slm-ch-err" data-ch-error ${e.error?"":"hidden"}>${
|
|
434
|
+
<p class="slm-ch-err" data-ch-error ${e.error?"":"hidden"}>${h(e.error??"")}</p>
|
|
434
435
|
<div class="foot">
|
|
435
436
|
<button type="button" class="quiet" data-ch-close>Cancel</button>
|
|
436
437
|
<button type="button" class="slm-btn ghost" data-ch-create="plain">Create without seats</button>
|
|
437
438
|
<button type="button" class="slm-btn" data-ch-create="allocate">Create and pick seats</button>
|
|
438
|
-
</div>`,s=>{let a=s.querySelector("#slm-ch-name"),o=s.querySelector("[data-ch-marker]");a.addEventListener("input",()=>{let r=W(a.value,t);o.textContent=r.letter,o.style.background=r.color}),s.querySelectorAll("[data-ch-create]").forEach(r=>{r.addEventListener("click",()=>{let l=r.dataset.chCreate==="allocate";this.createChannel(a.value,o.textContent??"",o.style.background,s.querySelector("#slm-ch-ref")?.value??"",l)})})})}async createChannel(e,t,n,s,a){let o=e.trim();if(!o){this.showDialogError("Give the channel a name your team will recognise.");return}try{let r=await this.host.api.createChannel(this.host.eventKey,{name:o,marker:
|
|
439
|
+
</div>`,s=>{let a=s.querySelector("#slm-ch-name"),o=s.querySelector("[data-ch-marker]");a.addEventListener("input",()=>{let r=W(a.value,t);o.textContent=r.letter,o.style.background=r.color}),s.querySelectorAll("[data-ch-create]").forEach(r=>{r.addEventListener("click",()=>{let l=r.dataset.chCreate==="allocate";this.createChannel(a.value,o.textContent??"",o.style.background,s.querySelector("#slm-ch-ref")?.value??"",l)})})})}async createChannel(e,t,n,s,a){let o=e.trim();if(!o){this.showDialogError("Give the channel a name your team will recognise.");return}try{let r=await this.host.api.createChannel(this.host.eventKey,{name:o,marker:P(t,"")||null,color:n||null,externalRef:s.trim()||null});this.closeDialog(),await this.refresh(),this.targetChannelId=r.channel.id,this.detailChannelId=a?null:r.channel.id,this.announce(`Channel ${o} created with 0 seats allocated.`),this.host.toast(a?`${o} created. Select seats on the map to allocate them.`:`${o} created.`,"ok"),this.paintRail()}catch(r){let l=r instanceof m?r.code:void 0;this.showDialogError(l==="channel_name_taken"?"That name is already used on this event. Pick another.":"Couldn't create the channel. Try again."),this.host.onError(r)}}showDialogError(e){let t=this.scrimEl?.querySelector("[data-ch-error]");t&&(t.textContent=e,t.hidden=!1)}renderReviewDialog(e){let{labels:t,buckets:n}=this.currentPlan(),s=e.applied,a=s?s.buckets:n,o=this.nameOf(s?.targetChannelId??this.targetChannelId)??C,r=pe(a,o),l=s?s.applied:F(n),c=!s&&t.length>0&&l===0,d=!s&&t.length>I,u=ee(r),g=s?'<div class="foot"><button type="button" class="slm-btn" data-ch-close>Done</button></div>':`<div class="foot">
|
|
439
440
|
<button type="button" class="quiet" data-ch-close>Back</button>
|
|
440
|
-
<button type="button" class="slm-btn" data-ch-apply ${c||
|
|
441
|
+
<button type="button" class="slm-btn" data-ch-apply ${c||d||e.busy?"disabled":""}>
|
|
441
442
|
${e.busy?"Applying\u2026":`Apply ${l.toLocaleString()} change${l===1?"":"s"}`}
|
|
442
443
|
</button>
|
|
443
|
-
</div>`,
|
|
444
|
-
<h3 id="slm-ch-dlg-title">${s?`Moved ${s.applied.toLocaleString()} seat${s.applied===1?"":"s"} to ${
|
|
444
|
+
</div>`,x=c?v("warn","Nothing here can move right now",` Every seat is in a buyer's cart, already sold, or already in ${o}.`):"",p=d?v("warn","Too many seats for one change",` One change can move up to ${I.toLocaleString()} seats. Split it, for example by row groups.`).replace(' role="status"',' role="alert"'):"";this.renderScrim(`
|
|
445
|
+
<h3 id="slm-ch-dlg-title">${s?`Moved ${s.applied.toLocaleString()} seat${s.applied===1?"":"s"} to ${h(o)}`:`Move ${t.length.toLocaleString()} seat${t.length===1?"":"s"} to ${h(o)}`}</h3>
|
|
445
446
|
<p class="sub">${s?"These are the exact counts the server applied.":"Every selected seat is in exactly one line below."}</p>
|
|
446
|
-
${
|
|
447
|
-
${
|
|
447
|
+
${x}
|
|
448
|
+
${p}
|
|
448
449
|
${u||'<div class="slm-empty">Nothing selected.</div>'}
|
|
449
|
-
<p class="slm-ch-err" data-ch-error ${e.error?"":"hidden"}>${
|
|
450
|
-
${
|
|
451
|
-
<h3 id="slm-ch-dlg-title">${
|
|
450
|
+
<p class="slm-ch-err" data-ch-error ${e.error?"":"hidden"}>${h(e.error??"")}</p>
|
|
451
|
+
${g}`,L=>{L.querySelector("[data-ch-apply]")?.addEventListener("click",()=>{this.apply()})}),s&&this.announce(`Applied ${s.applied} change${s.applied===1?"":"s"} to ${o}.`)}async apply(){if(!this.dialog||!this.caps.manage)return;let{labels:e}=this.currentPlan();if(!e.length)return;if(e.length>I){this.showDialogError(`Choose at most ${I.toLocaleString()} seats for one Apply.`);return}this.dialog={...this.dialog,busy:!0,error:null},this.renderDialog();let t=s=>{let a=this.allocation.get(s);return $(a)?f:a},n=new Map(e.map(s=>[s,t(s)]));try{let s=await this.host.api.applyChannelAssignment(this.host.eventKey,{targetChannelId:$(this.targetChannelId)?null:this.targetChannelId,labels:e,assignmentVersion:this.assignmentVersion});this.assignmentVersion=s.assignmentVersion,this.conflict=!1,await this.refresh({quiet:!0}),this.closeDialog({restoreFocus:!1});let a=$(s.targetChannelId)?f:s.targetChannelId,o=new Map;for(let[r,l]of n)l===a||t(r)!==a||o.set(l,[...o.get(l)??[],r]);this.host.clearSelection(),this.showApplied(s,o),this.host.moved?.({target:this.nameOf(s.targetChannelId)??C,labels:[...o.values()].flat(),back:[...o]})}catch(s){if(s instanceof m&&s.status===409&&s.code==="channel_assignment_conflict"){this.conflict=!0,this.closeDialog(),this.shakeStaged(),this.paintRail(),this.announce("Assignments changed while you were editing. Nothing was applied and your selection is kept.");return}if(s instanceof m&&s.status===403){this.caps={view:this.caps.view,manage:!1},this.closeDialog(),this.paintRail(),this.host.toast('Changing channels needs the "Manage channels" permission.',"err");return}this.dialog={kind:"review",busy:!1,error:"Couldn't apply those changes. Try again."},this.renderDialog(),this.host.onError(s)}}showApplied(e,t=new Map){let n=this.nameOf(e.targetChannelId)??C,s=e.buckets.skippedHeld.count+e.buckets.skippedBooked.count+e.buckets.notFound.count;this.railNote=null,this.applied={result:e,back:t,until:Date.now()+He},this.setStaged(null),this.paintRail(),this.announce(`Assigned ${e.applied} seat${e.applied===1?"":"s"} to ${n}${s?`; ${s} skipped`:""}.`),this.appliedTimer&&clearTimeout(this.appliedTimer),this.appliedTimer=setTimeout(()=>{this.appliedTimer=null,this.paintRail()},He+100)}appliedHtml(){let e=this.applied;if(!e)return this.railNote??"";let{result:t}=e,n=this.nameOf(t.targetChannelId)??C,s=t.applied,a=t.buckets.alreadyInTarget.count,o=t.buckets.skippedHeld.count+t.buckets.skippedBooked.count+t.buckets.notFound.count,r=$(t.targetChannelId)?"Buyers on your event page":`Buyers coming through ${n}`,l=[a?`${a.toLocaleString()} ${a===1?"was":"were"} already there.`:"",o?`${o.toLocaleString()} could not move (in a cart, sold or no longer on the map).`:"",s?`${r} see them now.`:""].filter(Boolean).join(" ");return v("ok",`${s.toLocaleString()} ${s===1?"seat":"seats"} now in ${n}`,` ${l}`)+(o?'<button type="button" class="slm-linkbtn slm-ch-details" data-ch-act="applied-details">Details</button>':"")}undoBarHtml(){let e=this.applied;return!e||!e.back.size||e.until<=Date.now()?"":`<div class="slm-undobar"><span>Moved just now</span><button type="button" class="slm-btn ghost slm-ch-small" data-ch-act="undo-applied">${gt}Undo</button></div>`}async undoApplied(){let e=this.applied;if(!e?.back.size||!this.caps.manage)return;this.applied=null,this.railNote='<div class="slm-ch-busy" role="status">Putting the seats back\u2026</div>',this.paintRail();let{moved:t,failed:n}=await this.sendBack(e.back);t&&this.host.moved?.({target:"",labels:[...e.back.values()].flat(),back:[],restores:!0}),this.railNote=n?v("warn",t?`${t.toLocaleString()} seats went back; the rest could not`:"Couldn't undo"," Someone may have changed these seats meanwhile. Nothing else moved.").replace(' role="status"',' role="alert"'):v("ok","Undone",` ${t.toLocaleString()} ${t===1?"seat is":"seats are"} back where ${t===1?"it was":"they were"}.`),this.paintRail()}async sendBack(e){let t=0,n=!1;await this.refresh({quiet:!0});for(let[s,a]of e)try{let o=await this.host.api.applyChannelAssignment(this.host.eventKey,{targetChannelId:$(s)?null:s,labels:a,assignmentVersion:this.assignmentVersion});this.assignmentVersion=o.assignmentVersion,t+=o.applied}catch(o){n=!0,this.host.onError(o);break}return await this.refresh({quiet:!0}),{moved:t,failed:n}}shakeStaged(){let e=this.stagedEl;!e||!e.classList.contains("on")||(e.classList.remove("shake"),e.offsetWidth,e.classList.add("shake"))}renderMenuDialog(e){let t=this.list?.channels.find(s=>s.id===e.channelId);if(!t||!this.caps.manage){this.closeDialog();return}let n=t.state==="paused";this.renderScrim(`
|
|
452
|
+
<h3 id="slm-ch-dlg-title">${h(t.name)}</h3>
|
|
452
453
|
<p class="sub">Open the channel to allocate seats and hand out buyer access.
|
|
453
454
|
These are the rest of its actions.</p>
|
|
454
455
|
<div class="slm-ch-menu">
|
|
@@ -461,49 +462,49 @@ import{k as S}from"./chunk-QB6PA3C6.js";function ne(i){i.querySelectorAll("selec
|
|
|
461
462
|
Archiving closes the channel for good and returns its free seats to a destination you choose.
|
|
462
463
|
Nothing is ever deleted silently.</p>
|
|
463
464
|
<div class="foot"><button type="button" class="quiet" data-ch-close>Cancel</button></div>`,s=>{s.querySelectorAll("[data-ch-menu-act]").forEach(a=>{a.addEventListener("click",()=>{let o=a.dataset.chMenuAct;if(o==="open"){this.closeDialog(),this.openChannel(t.id);return}if(o==="rename"){this.openDialog({kind:"rename",channelId:t.id});return}if(o==="archive"){this.openDialog({kind:"archive",channelId:t.id});return}this.closeDialog(),this.togglePause(t.id)})})})}renderRenameDialog(e){let t=this.list?.channels.find(n=>n.id===e.channelId);if(!t){this.closeDialog();return}this.renderScrim(`
|
|
464
|
-
<h3 id="slm-ch-dlg-title">Rename ${
|
|
465
|
+
<h3 id="slm-ch-dlg-title">Rename ${h(t.name)}</h3>
|
|
465
466
|
<p class="sub">Only your team and your reports see this name.</p>
|
|
466
467
|
<div class="slm-field">
|
|
467
468
|
<label for="slm-ch-newname">Name</label>
|
|
468
|
-
<input class="slm-input" id="slm-ch-newname" maxlength="80" value="${
|
|
469
|
+
<input class="slm-input" id="slm-ch-newname" maxlength="80" value="${h(t.name)}" />
|
|
469
470
|
</div>
|
|
470
|
-
<p class="slm-ch-err" data-ch-error ${e.error?"":"hidden"}>${
|
|
471
|
+
<p class="slm-ch-err" data-ch-error ${e.error?"":"hidden"}>${h(e.error??"")}</p>
|
|
471
472
|
<div class="foot">
|
|
472
473
|
<button type="button" class="quiet" data-ch-close>Cancel</button>
|
|
473
474
|
<button type="button" class="slm-btn" data-ch-rename>Save name</button>
|
|
474
|
-
</div>`,n=>{n.querySelector("[data-ch-rename]")?.addEventListener("click",()=>{let s=n.querySelector("#slm-ch-newname")?.value??"";if(!s.trim()){this.showDialogError("A channel needs a name.");return}this.host.api.renameChannel(this.host.eventKey,t.id,s.trim()).then(()=>(this.closeDialog(),this.refresh())).catch(a=>{this.showDialogError(a instanceof
|
|
475
|
-
<span><b>${
|
|
475
|
+
</div>`,n=>{n.querySelector("[data-ch-rename]")?.addEventListener("click",()=>{let s=n.querySelector("#slm-ch-newname")?.value??"";if(!s.trim()){this.showDialogError("A channel needs a name.");return}this.host.api.renameChannel(this.host.eventKey,t.id,s.trim()).then(()=>(this.closeDialog(),this.refresh())).catch(a=>{this.showDialogError(a instanceof m&&a.code==="channel_name_taken"?"That name is already used on this event.":"Couldn't rename the channel."),this.host.onError(a)})})})}renderPricingDialog(e){let t=this.list?.channels.find(o=>o.id===e.channelId),n=this.host.api.updateChannelPricing;if(!t||!n||!this.caps.manage){this.closeDialog();return}let s=new Map((t.priceOverrides??[]).map(o=>[`${o.categoryKey}\0${o.tierId??""}`,o.price])),a=this.host.categories().flatMap(o=>(o.tiers?.length?o.tiers:[null]).map(l=>{let c=l?.id??null,d=`${o.key}\0${c??""}`,u=l?.price??o.price??0,g=s.get(d),x=l?`${o.label} \xB7 ${l.name}`:o.label;return`<label class="slm-ch-price-row">
|
|
476
|
+
<span><b>${h(x)}</b><small>Event price ${h(String(u))}</small></span>
|
|
476
477
|
<input class="slm-input" type="number" min="0" max="1000000" step="0.01"
|
|
477
|
-
inputmode="decimal" aria-label="Custom price for ${
|
|
478
|
-
data-ch-price-category="${
|
|
479
|
-
placeholder="${
|
|
478
|
+
inputmode="decimal" aria-label="Custom price for ${h(x)}"
|
|
479
|
+
data-ch-price-category="${h(o.key)}" data-ch-price-tier="${h(c??"")}"
|
|
480
|
+
placeholder="${h(String(u))}" value="${g===void 0?"":h(String(g))}"
|
|
480
481
|
${e.busy?"disabled":""} />
|
|
481
482
|
</label>`})).join("");this.renderScrim(`
|
|
482
|
-
<h3 id="slm-ch-dlg-title">Prices for ${
|
|
483
|
+
<h3 id="slm-ch-dlg-title">Prices for ${h(t.name)}</h3>
|
|
483
484
|
<p class="sub">Set only the prices that differ for these buyers. Leave a field empty to use the event price.</p>
|
|
484
485
|
<div class="slm-ch-price-list">${a||'<p class="slm-empty">This event has no priced categories.</p>'}</div>
|
|
485
|
-
<p class="slm-ch-err" data-ch-error ${e.error?"":"hidden"}>${
|
|
486
|
+
<p class="slm-ch-err" data-ch-error ${e.error?"":"hidden"}>${h(e.error??"")}</p>
|
|
486
487
|
<div class="foot">
|
|
487
488
|
<button type="button" class="quiet" data-ch-close ${e.busy?"disabled":""}>Cancel</button>
|
|
488
489
|
<button type="button" class="slm-btn" data-ch-price-save ${e.busy||!a?"disabled":""}>
|
|
489
490
|
${e.busy?"Saving\u2026":"Save prices"}
|
|
490
491
|
</button>
|
|
491
|
-
</div>`,o=>{o.querySelector("[data-ch-price-save]")?.addEventListener("click",()=>{let r=[];for(let l of o.querySelectorAll("[data-ch-price-category]")){let c=l.value.trim();if(!c)continue;let
|
|
492
|
-
<h3 id="slm-ch-dlg-title">Archive ${
|
|
492
|
+
</div>`,o=>{o.querySelector("[data-ch-price-save]")?.addEventListener("click",()=>{let r=[];for(let l of o.querySelectorAll("[data-ch-price-category]")){let c=l.value.trim();if(!c)continue;let d=Number(c);if(!Number.isFinite(d)||d<0||d>1e6){l.focus(),this.showDialogError("Enter a price from 0 to 1,000,000, or leave the field blank.");return}r.push({categoryKey:l.dataset.chPriceCategory,tierId:l.dataset.chPriceTier||null,price:d})}this.saveChannelPricing(t,r)})})}async saveChannelPricing(e,t){let n=this.host.api.updateChannelPricing;if(!(!n||!this.dialog||this.dialog.kind!=="pricing")){this.dialog={...this.dialog,busy:!0,error:null},this.renderDialog();try{await n.call(this.host.api,this.host.eventKey,e.id,t,e.pricingVersion??0),this.closeDialog(),await this.refresh(),this.host.toast(t.length?`Custom prices saved for ${e.name}.`:`${e.name} now uses event prices.`,"ok")}catch(s){if(s instanceof m&&s.code==="channel_pricing_conflict"){await this.refresh({quiet:!0}),this.dialog={kind:"pricing",channelId:e.id,error:"Prices changed in another window. Latest values are shown \u2014 review and save again."},this.renderDialog();return}this.dialog={kind:"pricing",channelId:e.id,error:s instanceof m&&s.serverMessage?s.serverMessage:"Couldn't save these prices. Try again."},this.renderDialog(),this.host.onError(s)}}}async chooseWebsiteIntegration(){this.detailChannelId&&await this.setAccessIntent("server")}async setAccessIntent(e,t={}){let n=this.detailChannelId;if(!n||!this.caps.manage)return!1;try{let s=await this.host.api.setChannelAccessIntent(this.host.eventKey,n,e,t);return await this.refresh(),this.host.toast(this.intentSavedCopy(e,s?.intentSwitch),"ok"),!0}catch(s){return s instanceof m&&s.code==="channel_intent_switch_blocked"?(this.openDialog({kind:"intentSwitch",channelId:n,intentTo:e,switchBlocked:s.details}),!1):s instanceof m&&s.code==="channel_access_intent_forbids"?(this.host.toast(z(s.details),"err"),!1):(this.host.toast("Couldn't change how this channel reaches buyers.","err"),this.host.onError(s),!1)}}intentSavedCopy(e,t){let n=e==="server"?"Set to your website or app. The embed code is on the Embed page.":e==="internal"?"Only your own staff can sell this channel now.":e==="hosted_link"?"Set to buyer links. Create one to let buyers in.":"Kept as a protected reserve. No route can sell these seats.";if(!t)return n;let s=t.closedLinks?` ${t.closedLinks.toLocaleString()} buyer link${t.closedLinks===1?"":"s"} closed.`:"",a=t.keptSessions?` ${t.keptSessions.toLocaleString()} buyer${t.keptSessions===1?"":"s"} already in a checkout can still finish.`:"";return`${n}${s}${a}`}async togglePause(e=this.detailChannelId){let t=this.list?.channels.find(s=>s.id===e);if(!t||!this.caps.manage)return;let n=t.state!=="paused";try{await this.host.api.setChannelPaused(this.host.eventKey,t.id,n),await this.refresh(),this.host.toast(n?`${t.name} paused. Existing checkouts can finish; no new buyer access is issued.`:`${t.name} resumed.`,"ok")}catch(s){this.host.toast("Couldn't change that channel.","err"),this.host.onError(s)}}renderArchiveDialog(e){let t=this.list?.channels.find(l=>l.id===e.channelId);if(!t){this.closeDialog();return}let n=e.archiveBlocked??null,s=!n&&t.counts.held>0,a=this.assignableChannels().filter(l=>l.id!==t.id),o=n?n.heldUnits??n.activeHolds??0:s?t.counts.held:0,r=o?v("warn",`${o.toLocaleString()} ${o===1?"seat is":"seats are"} in a buyer's cart right now`,n?` Archive waits until they finish or their time runs out, ${me(n)}.`:" Archive waits until they finish or their time runs out; you can try, and we will say when to come back.").replace(' role="status"',n?' role="alert"':' role="status"'):"";this.renderScrim(`
|
|
493
|
+
<h3 id="slm-ch-dlg-title">Archive ${h(t.name)}</h3>
|
|
493
494
|
<p class="sub">The channel closes for good. Its free seats move where you choose; sales keep their record.</p>
|
|
494
495
|
<div class="slm-field">
|
|
495
496
|
<label for="slm-ch-dest">Move the ${t.counts.free.toLocaleString()} free ${t.counts.free===1?"seat":"seats"} to</label>
|
|
496
|
-
<select class="slm-select" id="slm-ch-dest">
|
|
497
|
-
${a.map(l=>`<option value="${
|
|
498
|
-
</select>
|
|
497
|
+
<span class="slm-ch-pick">${this.plateHtml(a[0]?.id)}<select class="slm-select" id="slm-ch-dest">
|
|
498
|
+
${a.map(l=>`<option value="${h(l.id)}">${h(l.name)}</option>`).join("")}
|
|
499
|
+
</select></span>
|
|
499
500
|
</div>
|
|
500
501
|
${r}
|
|
501
|
-
<p class="slm-ch-err" data-ch-error ${e.error?"":"hidden"}>${
|
|
502
|
+
<p class="slm-ch-err" data-ch-error ${e.error?"":"hidden"}>${h(e.error??"")}</p>
|
|
502
503
|
<div class="foot">
|
|
503
504
|
<button type="button" class="quiet" data-ch-close>Cancel</button>
|
|
504
505
|
<button type="button" class="slm-btn danger" data-ch-archive ${n?"disabled":""}>Archive channel</button>
|
|
505
|
-
</div>`,l=>{l.querySelector("
|
|
506
|
-
<h3 id="slm-ch-dlg-title">Create a buyer link for ${
|
|
506
|
+
</div>`,l=>{let c=l.querySelector("#slm-ch-dest");c.onchange=()=>{l.querySelector(".slm-ch-mk").outerHTML=this.plateHtml(c.value)},l.querySelector("[data-ch-archive]")?.addEventListener("click",()=>{this.archive(t.id,c.value||null)})})}async archive(e,t){try{await this.host.api.archiveChannel(this.host.eventKey,e,t),this.closeDialog(),this.detailChannelId=null,await this.refresh(),this.host.toast("Channel archived. Its remaining seats moved to the destination you chose.","ok")}catch(n){if(n instanceof m&&n.status===409&&n.code==="channel_archive_blocked_by_holds"){this.dialog={kind:"archive",channelId:e,archiveBlocked:n.details??{}},this.renderDialog();return}this.showDialogError("Couldn't archive that channel. Try again."),this.host.onError(n)}}renderSeatListDialog(){this.chooser.openSeatList()}async reloadLinks(){let e=this.detailChannelId;e&&(this.linksState=this.links.length?this.linksState:"loading",await this.loadLinks(e),this.paintRail())}async reloadAfterLinkChange(e){if(this.detailChannelId===e){await this.refresh({quiet:!0});return}await this.loadLinks(e),this.active&&this.paintRail()}linkById(e){return this.links.find(t=>t.id===e)??null}renderLinkCreateDialog(e){let t=this.list?.channels.find(n=>n.id===e.channelId);if(!t||!this.caps.manage){this.closeDialog();return}this.renderScrim(`
|
|
507
|
+
<h3 id="slm-ch-dlg-title">Create a buyer link for ${h(t.name)}</h3>
|
|
507
508
|
<p class="sub">Anyone who opens the link can buy from this channel's allocation \u2014 and only from it.
|
|
508
509
|
You'll see the link once, right after you create it.</p>
|
|
509
510
|
<div class="slm-field">
|
|
@@ -537,40 +538,40 @@ import{k as S}from"./chunk-QB6PA3C6.js";function ne(i){i.querySelectorAll("selec
|
|
|
537
538
|
<input type="checkbox" id="slm-ch-lk-public" />
|
|
538
539
|
Also let this link buy Public sale seats
|
|
539
540
|
</label>
|
|
540
|
-
<p class="slm-ch-err" data-ch-error ${e.error?"":"hidden"}>${
|
|
541
|
+
<p class="slm-ch-err" data-ch-error ${e.error?"":"hidden"}>${h(e.error??"")}</p>
|
|
541
542
|
<div class="foot">
|
|
542
543
|
<button type="button" class="quiet" data-ch-close>Cancel</button>
|
|
543
544
|
<button type="button" class="slm-btn" data-ch-lk-create>Create link</button>
|
|
544
|
-
</div>`,n=>{let s=n.querySelector("[data-ch-lk-expiry]"),a=n.querySelector("[data-ch-lk-when-field]"),o=n.querySelector("#slm-ch-lk-when");s.addEventListener("change",()=>{let r=s.value==="custom";a.hidden=!r,r&&!o.value&&(o.value=
|
|
545
|
+
</div>`,n=>{let s=n.querySelector("[data-ch-lk-expiry]"),a=n.querySelector("[data-ch-lk-when-field]"),o=n.querySelector("#slm-ch-lk-when");s.addEventListener("change",()=>{let r=s.value==="custom";a.hidden=!r,r&&!o.value&&(o.value=Ie(Date.now()+7*864e5))}),n.querySelector("[data-ch-lk-create]")?.addEventListener("click",()=>{let r=te(n,"#slm-ch-lk-redemptions"),l=te(n,"#slm-ch-lk-quantity");if(r==null||l==null){this.showDialogError("Those two settings need to be whole numbers.");return}let c;if(s.value==="custom"&&(c=Date.parse(o.value),!Number.isFinite(c))){this.showDialogError("Pick the date and time the link should stop working.");return}this.createLink(t.id,{label:n.querySelector("#slm-ch-lk-label")?.value.trim()||null,includePublic:n.querySelector("#slm-ch-lk-public")?.checked??!1,...c===void 0?{}:{expiresAt:c},maxRedemptions:r,maxQuantity:l})})})}async createLink(e,t){await this.ensureHostedLinkRoute(e,t)&&await this.mintLink(e,t)}async mintLink(e,t){try{let n=await this.host.api.createAccessLink(this.host.eventKey,e,t);this.revealLink(n,{channelId:e}),await this.reloadAfterLinkChange(e)}catch(n){this.showDialogError(O(n instanceof m?n:void 0)),n instanceof m||this.host.onError(n)}}async ensureHostedLinkRoute(e,t){if((this.list?.channels.find(s=>s.id===e)?.access?.intent??"none")==="hosted_link")return!0;try{return await this.host.api.setChannelAccessIntent(this.host.eventKey,e,"hosted_link"),await this.refresh(),!0}catch(s){return s instanceof m&&s.code==="channel_intent_switch_blocked"?(this.openDialog({kind:"intentSwitch",channelId:e,intentTo:"hosted_link",switchBlocked:s.details,pendingLink:t}),!1):(this.showDialogError(s instanceof m&&s.code==="channel_access_intent_forbids"?z(s.details):"Couldn't set this channel up for buyer links. Try again."),s instanceof m||this.host.onError(s),!1)}}revealLink(e,t){let n=e.url;this.dialog=null;let s=t.rotated?v("warn","The old link has stopped working",` ${e.endedSessions?`${e.endedSessions.toLocaleString()} ${e.endedSessions===1?"buyer":"buyers"} lost access now.`:"Buyers who already came in can finish; every new visit needs this link."}`):"";this.renderScrim(`
|
|
545
546
|
<h3 id="slm-ch-dlg-title">Copy this link now</h3>
|
|
546
547
|
<p class="sub">It is shown once. SeatLayer keeps only a fingerprint, so a lost link can be replaced but not shown again.</p>
|
|
547
548
|
${s}
|
|
548
549
|
<div class="slm-ch-copyrow">
|
|
549
|
-
<div class="slm-ch-secret" data-ch-lk-url title="${
|
|
550
|
+
<div class="slm-ch-secret" data-ch-lk-url title="${h(n)}">${h(n)}</div>
|
|
550
551
|
<button type="button" class="slm-btn" data-ch-lk-copy aria-live="polite">Copy</button>
|
|
551
552
|
</div>
|
|
552
553
|
<input class="slm-ch-copysink" data-ch-lk-sink tabindex="-1" aria-hidden="true" readonly />
|
|
553
|
-
<p class="slm-note" style="margin-top:10px">${
|
|
554
|
+
<p class="slm-note" style="margin-top:10px">${h(ke(e.link))}</p>
|
|
554
555
|
<div class="foot">
|
|
555
556
|
<button type="button" class="slm-btn" data-ch-close data-ch-lk-done>I've copied it</button>
|
|
556
|
-
</div>`,a=>{let o=a.querySelector("[data-ch-lk-copy]"),r=null;o?.addEventListener("click",()=>{
|
|
557
|
-
<h3 id="slm-ch-dlg-title">Replace the ${
|
|
557
|
+
</div>`,a=>{let o=a.querySelector("[data-ch-lk-copy]"),r=null;o?.addEventListener("click",()=>{Ee(a,n).then(l=>{if(!l){o.textContent="Copy",o.classList.remove("copied"),this.announce("Copying was blocked. The link is selected \u2014 copy it by hand.");return}o.textContent="Copied",o.classList.add("copied"),this.announce("Buyer link copied."),r&&clearTimeout(r),r=setTimeout(()=>{o.textContent="Copy",o.classList.remove("copied")},1500)})})}),this.announce("Your buyer link is ready and is shown once.")}renderLinkRotateDialog(e){let t=this.linkById(e.linkId);if(!t||!this.caps.manage){this.closeDialog();return}let n=t.activeSessions??0,s=n?`${n.toLocaleString()} ${n===1?"buyer is":"buyers are"} inside with the current link. Choose what happens to them.`:"Nobody is inside with the current link right now. Choose what happens to anyone who arrives before you send the new one.";this.renderScrim(`
|
|
558
|
+
<h3 id="slm-ch-dlg-title">Replace the ${h(t.label||"buyer")} link?</h3>
|
|
558
559
|
<p class="sub">${s}</p>
|
|
559
560
|
<label class="slm-ch-radio">
|
|
560
561
|
<input type="radio" name="slm-ch-rot" value="keep" data-ch-rot />
|
|
561
|
-
<span><b>Let them finish their order</b
|
|
562
|
+
<span><b>Let them finish their order</b></span>
|
|
562
563
|
</label>
|
|
563
564
|
<label class="slm-ch-radio">
|
|
564
565
|
<input type="radio" name="slm-ch-rot" value="end" data-ch-rot />
|
|
565
|
-
<span><b>End their access now</b
|
|
566
|
+
<span><b>End their access now</b></span>
|
|
566
567
|
</label>
|
|
567
568
|
<p class="slm-note">Choose one. SeatLayer will not decide this for you.</p>
|
|
568
|
-
<p class="slm-ch-err" data-ch-error ${e.error?"":"hidden"}>${
|
|
569
|
+
<p class="slm-ch-err" data-ch-error ${e.error?"":"hidden"}>${h(e.error??"")}</p>
|
|
569
570
|
<div class="foot">
|
|
570
571
|
<button type="button" class="quiet" data-ch-close>Cancel</button>
|
|
571
572
|
<button type="button" class="slm-btn" data-ch-lk-rotate disabled>Replace and copy the new link</button>
|
|
572
|
-
</div>`,a=>{let o=a.querySelector("[data-ch-lk-rotate]");a.querySelectorAll("[data-ch-rot]").forEach(r=>{r.addEventListener("change",()=>{o.disabled=!1})}),o.addEventListener("click",()=>{let r=[...a.querySelectorAll("[data-ch-rot]")].find(l=>l.checked);if(!r){this.showDialogError(
|
|
573
|
-
<h3 id="slm-ch-dlg-title">Revoke the ${
|
|
573
|
+
</div>`,a=>{let o=a.querySelector("[data-ch-lk-rotate]");a.querySelectorAll("[data-ch-rot]").forEach(r=>{r.addEventListener("change",()=>{o.disabled=!1})}),o.addEventListener("click",()=>{let r=[...a.querySelectorAll("[data-ch-rot]")].find(l=>l.checked);if(!r){this.showDialogError(O({code:"end_active_sessions_required"}));return}this.rotateLink(e.channelId,t.id,r.value==="end")})})}async rotateLink(e,t,n){try{let s=await this.host.api.rotateAccessLink(this.host.eventKey,e,t,n);this.revealLink(s,{channelId:e,rotated:!0}),await this.reloadAfterLinkChange(e)}catch(s){this.showDialogError(O(s instanceof m?s:void 0)),s instanceof m||this.host.onError(s)}}renderLinkRevokeDialog(e){let t=this.linkById(e.linkId);if(!t||!this.caps.manage){this.closeDialog();return}let n=t.activeSessions??0;this.renderScrim(`
|
|
574
|
+
<h3 id="slm-ch-dlg-title">Revoke the ${h(t.label||"buyer")} link?</h3>
|
|
574
575
|
<p class="sub">It stops opening immediately and cannot be restored \u2014 there is no undo, and no way to
|
|
575
576
|
bring the same URL back. Seats already bought through it keep their sale.</p>
|
|
576
577
|
${n?`<label class="slm-ch-radio">
|
|
@@ -579,8 +580,8 @@ import{k as S}from"./chunk-QB6PA3C6.js";function ne(i){i.querySelectorAll("selec
|
|
|
579
580
|
buyer${n===1?"":"s"} already inside</b><span class="why">Leave this off and they can
|
|
580
581
|
finish what they started; new visits are refused either way.</span></span>
|
|
581
582
|
</label>`:""}
|
|
582
|
-
<p class="slm-ch-err" data-ch-error ${e.error?"":"hidden"}>${
|
|
583
|
+
<p class="slm-ch-err" data-ch-error ${e.error?"":"hidden"}>${h(e.error??"")}</p>
|
|
583
584
|
<div class="foot">
|
|
584
585
|
<button type="button" class="quiet" data-ch-close>Cancel</button>
|
|
585
586
|
<button type="button" class="slm-btn danger" data-ch-lk-revoke>Revoke link</button>
|
|
586
|
-
</div>`,s=>{s.querySelector("[data-ch-lk-revoke]")?.addEventListener("click",()=>{let a=s.querySelector("[data-ch-lk-endsessions]")?.checked??!1;this.revokeLink(e.channelId,t.id,a)})})}async revokeLink(e,t,n){try{let s=await this.host.api.revokeAccessLink(this.host.eventKey,e,t,n);this.closeDialog(),await this.reloadAfterLinkChange(e),this.host.toast(s.endedSessions?`Link revoked. ${s.endedSessions.toLocaleString()} buyer${s.endedSessions===1?"":"s"} lost access.`:"Link revoked. It no longer opens for anyone.","ok")}catch(s){this.showDialogError(
|
|
587
|
+
</div>`,s=>{s.querySelector("[data-ch-lk-revoke]")?.addEventListener("click",()=>{let a=s.querySelector("[data-ch-lk-endsessions]")?.checked??!1;this.revokeLink(e.channelId,t.id,a)})})}async revokeLink(e,t,n){try{let s=await this.host.api.revokeAccessLink(this.host.eventKey,e,t,n);this.closeDialog(),await this.reloadAfterLinkChange(e),this.host.toast(s.endedSessions?`Link revoked. ${s.endedSessions.toLocaleString()} buyer${s.endedSessions===1?"":"s"} lost access.`:"Link revoked. It no longer opens for anyone.","ok")}catch(s){this.showDialogError(O(s instanceof m?s:void 0)),s instanceof m||this.host.onError(s)}}applySheetClasses(){let e=this.host.root,t=this.host.isCompact();e.classList.toggle("ch-sheet",t&&this.active);for(let n of["collapsed","medium","full"])e.classList.toggle(`detent-${n}`,t&&this.active&&this.detent===n);this.host.setMapInert(t&&this.active&&this.detent==="full")}cycleDetent(){let e=["collapsed","medium","full"];this.detent=e[(e.indexOf(this.detent)+1)%e.length],this.applySheetClasses()}handleBack(){return this.scrimEl?(this.closeDialog(),!0):this.host.isCompact()&&this.detent==="full"?(this.detent="medium",this.applySheetClasses(),!0):!1}};export{M as a,yt as b,B as c,ae as d,kt as e,oe as f,wt as g,se as h,xt as i,St as j,v as k,Ct as l,$t as m,m as n,$e as o,At as p,q,f as r,C as s,$ as t,P as u,W as v,he as w,de as x,ue as y,F as z,Et as A,pe as B,me as C,ge as D,H as E,Pt as F,z as G,be as H,Q as I,ve as J,fe as K,Tt as L,O as M,Mt as N,we as O,ee as P,dt as Q,De as R};
|