@seatlayer/js 0.54.0 → 0.55.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/README.md +19 -5
- package/dist/{channelsMode-BX7s9bUl.d.cts → channelsMode-1b6xBWKM.d.cts} +132 -5
- package/dist/{channelsMode-BX7s9bUl.d.ts → channelsMode-1b6xBWKM.d.ts} +132 -5
- package/dist/{channelsMode-RUNPEHKD.js → channelsMode-LDIT556C.js} +1 -1
- package/dist/{chunk-7F6RSJRL.js → chunk-MZAMI4UR.js} +8 -13
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +88 -8
- package/dist/index.d.ts +88 -8
- package/dist/index.js +4 -4
- package/dist/manager.cjs +187 -116
- package/dist/manager.d.cts +2 -2
- package/dist/manager.d.ts +2 -2
- package/dist/manager.js +124 -48
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var C="public",E="Public sale";function M(i){return i==null||i===""||i===C}var X=["#a78bfa","#2dd4bf","#fb923c","#60a5fa","#f472b6","#a3e635","#f87171","#38bdf8","#c084fc","#facc15"],He="#f4b740",ce="ABCDEFGHJKLMNPQRSTUVWXYZ";function _(i,e){let t=(i??"").trim();return((/\p{L}/u.exec(t)?.[0]??t[0]??"")||e).toUpperCase().slice(0,1)}function ee(i,e){let t=new Set([...e].map(r=>_(r,"")).filter(Boolean)),n=_(i,"");return{letter:ce.includes(n)&&!t.has(n)?n:[...ce].find(r=>!t.has(r))??(n||"X"),color:X[t.size%X.length]}}function de(i,e=0){return M(i.id)?{letter:_(i.marker,"P"),color:i.color||He}:{letter:_(i.marker||i.name,"?"),color:i.color||X[e%X.length]}}function ue(i,e,t){let n=new Map;for(let o of i){let a=J(e.get(o));n.set(a,(n.get(a)??0)+1)}let s=[{id:C,name:t?.publicSale?.name??E},...(t?.channels??[]).map(o=>({id:o.id,name:o.name}))],r=[];for(let o of s){let a=n.get(o.id);a&&r.push({channelId:o.id,name:o.name,count:a}),n.delete(o.id)}for(let[o,a]of n)r.push({channelId:o,name:M(o)?E:"Another channel",count:a});return r}function J(i){return M(i)?C:i}var he=12;function Q(i){return{count:i.length,labels:i.slice(0,he),truncated:i.length>he}}function pe(i){let{labels:e,allocation:t,statusOf:n,nameOf:s}=i,r=J(i.targetChannelId),o=new Set,a=0,l=0,h=new Map,d=[],p=[],w=[];for(let b of e){if(o.has(b))continue;o.add(b);let u=n(b);if(!u){w.push(b);continue}let m=J(t.get(b));if(m===r){l+=1;continue}if(u==="held"){d.push(b);continue}if(u==="booked"){p.push(b);continue}m===C?a+=1:h.set(m,(h.get(m)??0)+1)}let L=[...h.entries()].map(([b,u])=>({channelId:b,name:s(b),count:u}));return{changedFromPublic:{count:a},movedFromOtherChannel:{count:L.reduce((b,u)=>b+u.count,0),channels:L},alreadyInTarget:{count:l},skippedHeld:Q(d),skippedBooked:Q(p),notFound:Q(w)}}function K(i){return i.changedFromPublic.count+i.movedFromOtherChannel.count}function me(i){return i.movedFromOtherChannel.count>0}function ge(i,e){let t=[];i.changedFromPublic.count&&t.push({kind:"add",icon:"+",count:i.changedFromPublic.count,text:`${i.changedFromPublic.count.toLocaleString()} from ${E}`});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:"needs this confirmation"});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 checkout`,why:"can't move while held",peek:Y(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:Y(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:Y(i.notFound)}),t}function Y(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 be(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 ve(i){if(!i||!i.intent)return"\u2014";let e=i.intent==="server"?"Website integration":i.intent==="hosted_link"?"Buyer link":i.intent==="internal"?"Your 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 q(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 fe(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 Be(i){return i==="hosted_link"?"hosted_link":i==="server"?"server":i==="staff"?"internal":null}function G(i){let e=Z(i?.accessIntent),t=Be(i?.route),n=`This channel is set to "${q(e)}"`;return t?`${n}, so it cannot do that. Switch it to "${q(t)}" first.`:`${n}, so it cannot do that. Choose a different route for this channel first.`}function Z(i){return i==="internal"||i==="server"||i==="hosted_link"||i==="none"?i:"none"}function F(i,e,t){return`${i.toLocaleString()} ${i===1?e:t}`}function ye(i){let e=Math.max(0,i?.liveAccessLinks??0),t=Math.max(0,i?.activeSessions??0),n=Z(i?.from),s=Z(i?.to),o=`${[e?F(e,"buyer link is live","buyer links are live"):null,t?F(t,"buyer is in a checkout","buyers are in a checkout"):null].filter(Boolean).join(", and ")||"Buyers are inside this channel"} on "${q(n)}". Moving it to "${q(s)}" changes what happens to them.`,a=[];return e&&a.push(`${F(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&&a.push(`${F(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:a}}var te={maxRedemptions:100,maxQuantity:4};function ke(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 ne(i){return i.state==="active"&&i.status==="active"}function _e(i){return Number.isFinite(i)?new Date(i).toLocaleString(void 0,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit"}):"\u2014"}function se(i){return[{k:"Expires",v:_e(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 j(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 G(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 Ze(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?Y({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 f=class extends Error{constructor(e,t,n,s,r,o){super(t),this.name="ManageApiError",this.status=e,this.code=n,this.conflicts=s,this.details=r,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 f(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 S(i){return i&&typeof i=="object"?i:{}}function W(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 Le(i){let e=S(i),t=W(e.bookedValue,e.bookedRevenue);return{...e,bookedValue:t,bookedRevenue:t}}function qe(i){let e=S(i),t=S(e.report),n=Array.isArray(t.byCategory)?t.byCategory.map(r=>{let o=S(r),a=W(o.bookedValue,o.bookedRevenue);return{...o,bookedValue:a,bookedRevenue:a}}):[],s=Array.isArray(t.bySection)?t.bySection.map(Le):void 0;return{...e,report:{...t,byCategory:n,...s?{bySection:s}:{}}}}function Oe(i){let e=S(i),t=S(e.bookedValue),n=S(e.revenue),s=Object.keys(t).length?t:n,r=Array.isArray(t.bySection)?t.bySection:Array.isArray(n.bySection)?n.bySection:[],o={...s,gross:W(t.gross,n.gross),bySection:r.map(Le)},a=S(e.velocity),l=Array.isArray(a.bySection)?a.bySection.map(h=>{let d=S(h),p=W(d.bookedValue,d.grossRevenue);return{...d,bookedValue:p,grossRevenue:p}}):[];return{...e,bookedValue:o,revenue:o,velocity:{...a,bySection:l}}}function ze(i){let e=S(i),t=S(e.report),n=typeof t.includesBookedValue=="boolean"?t.includesBookedValue:t.includesRevenue===!0,s=Array.isArray(t.rows)?t.rows.map(a=>{let l=S(a),h=S(l.attribution),d=Se(h.bookedValue,h.revenue);return{...l,attribution:{...h,bookedValue:d,revenue:d}}}):[],r=S(t.totals),o=Se(r.bookedValue,r.revenue);return{...e,report:{...t,includesBookedValue:n,includesRevenue:n,rows:s,totals:{...r,bookedValue:o,revenue:o}}}}function ie(i){let e=S(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}`},r;return t.body!==void 0&&(s["Content-Type"]="application/json",r=JSON.stringify(t.body)),fetch(`${this.base}${e}`,{method:n,headers:s,body:r,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 f(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"})}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}})}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}})}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 r=s.toString();return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/preview${r?`?${r}`:""}`)}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 r=s?"?endActiveSessions=1":"";return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/access-links/${encodeURIComponent(n)}${r}`,{method:"DELETE"})}report(e){return this.auth(`/v1/events/${encodeURIComponent(e)}/report`).then(qe)}controlRoom(e,t=15){return this.auth(`/v1/events/${encodeURIComponent(e)}/control-room?window=${t}`).then(Oe)}channelReport(e){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/report`).then(ze)}createChannelReportLink(e,t,n={}){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/report-links`,{method:"POST",body:n}).then(s=>{let r=S(s);return{...r,link:ie(r.link)}})}channelReportLinks(e,t){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/report-links`).then(n=>{let s=S(n);return{links:Array.isArray(s.links)?s.links.map(ie):[]}})}revokeChannelReportLink(e,t,n){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/report-links/${encodeURIComponent(n)}`,{method:"DELETE"}).then(s=>{let r=S(s);return{...r,link:ie(r.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 f(t.status,`request_failed_${t.status}`);return t.blob()}};function ae(i){return i.map((e,t)=>`
|
|
1
|
+
var C="public",E="Public sale";function M(i){return i==null||i===""||i===C}var X=["#a78bfa","#2dd4bf","#fb923c","#60a5fa","#f472b6","#a3e635","#f87171","#38bdf8","#c084fc","#facc15"],He="#f4b740",ce="ABCDEFGHJKLMNPQRSTUVWXYZ";function _(i,e){let t=(i??"").trim();return((/\p{L}/u.exec(t)?.[0]??t[0]??"")||e).toUpperCase().slice(0,1)}function ee(i,e){let t=new Set([...e].map(r=>_(r,"")).filter(Boolean)),n=_(i,"");return{letter:ce.includes(n)&&!t.has(n)?n:[...ce].find(r=>!t.has(r))??(n||"X"),color:X[t.size%X.length]}}function de(i,e=0){return M(i.id)?{letter:_(i.marker,"P"),color:i.color||He}:{letter:_(i.marker||i.name,"?"),color:i.color||X[e%X.length]}}function ue(i,e,t){let n=new Map;for(let o of i){let a=J(e.get(o));n.set(a,(n.get(a)??0)+1)}let s=[{id:C,name:t?.publicSale?.name??E},...(t?.channels??[]).map(o=>({id:o.id,name:o.name}))],r=[];for(let o of s){let a=n.get(o.id);a&&r.push({channelId:o.id,name:o.name,count:a}),n.delete(o.id)}for(let[o,a]of n)r.push({channelId:o,name:M(o)?E:"Another channel",count:a});return r}function J(i){return M(i)?C:i}var he=12;function Q(i){return{count:i.length,labels:i.slice(0,he),truncated:i.length>he}}function pe(i){let{labels:e,allocation:t,statusOf:n,nameOf:s}=i,r=J(i.targetChannelId),o=new Set,a=0,l=0,h=new Map,d=[],p=[],w=[];for(let b of e){if(o.has(b))continue;o.add(b);let u=n(b);if(!u){w.push(b);continue}let m=J(t.get(b));if(m===r){l+=1;continue}if(u==="held"){d.push(b);continue}if(u==="booked"){p.push(b);continue}m===C?a+=1:h.set(m,(h.get(m)??0)+1)}let L=[...h.entries()].map(([b,u])=>({channelId:b,name:s(b),count:u}));return{changedFromPublic:{count:a},movedFromOtherChannel:{count:L.reduce((b,u)=>b+u.count,0),channels:L},alreadyInTarget:{count:l},skippedHeld:Q(d),skippedBooked:Q(p),notFound:Q(w)}}function K(i){return i.changedFromPublic.count+i.movedFromOtherChannel.count}function me(i){return i.movedFromOtherChannel.count>0}function ge(i,e){let t=[];i.changedFromPublic.count&&t.push({kind:"add",icon:"+",count:i.changedFromPublic.count,text:`${i.changedFromPublic.count.toLocaleString()} from ${E}`});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:"needs this confirmation"});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 checkout`,why:"can't move while held",peek:Y(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:Y(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:Y(i.notFound)}),t}function Y(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 be(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 ve(i){if(!i||!i.intent)return"\u2014";let e=i.intent==="server"?"Website integration":i.intent==="hosted_link"?"Buyer link":i.intent==="internal"?"Your 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 q(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 fe(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 Be(i){return i==="hosted_link"?"hosted_link":i==="server"?"server":i==="staff"?"internal":null}function G(i){let e=Z(i?.accessIntent),t=Be(i?.route),n=`This channel is set to "${q(e)}"`;return t?`${n}, so it cannot do that. Switch it to "${q(t)}" first.`:`${n}, so it cannot do that. Choose a different route for this channel first.`}function Z(i){return i==="internal"||i==="server"||i==="hosted_link"||i==="none"?i:"none"}function F(i,e,t){return`${i.toLocaleString()} ${i===1?e:t}`}function ye(i){let e=Math.max(0,i?.liveAccessLinks??0),t=Math.max(0,i?.activeSessions??0),n=Z(i?.from),s=Z(i?.to),o=`${[e?F(e,"buyer link is live","buyer links are live"):null,t?F(t,"buyer is in a checkout","buyers are in a checkout"):null].filter(Boolean).join(", and ")||"Buyers are inside this channel"} on "${q(n)}". Moving it to "${q(s)}" changes what happens to them.`,a=[];return e&&a.push(`${F(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&&a.push(`${F(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:a}}var te={maxRedemptions:100,maxQuantity:4};function ke(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 ne(i){return i.state==="active"&&i.status==="active"}function _e(i){return Number.isFinite(i)?new Date(i).toLocaleString(void 0,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit"}):"\u2014"}function se(i){return[{k:"Expires",v:_e(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 j(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 G(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 Ze(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?Y({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 f=class extends Error{constructor(e,t,n,s,r,o){super(t),this.name="ManageApiError",this.status=e,this.code=n,this.conflicts=s,this.details=r,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 f(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 S(i){return i&&typeof i=="object"?i:{}}function W(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 Le(i){let e=S(i),t=W(e.bookedValue,e.bookedRevenue);return{...e,bookedValue:t,bookedRevenue:t}}function qe(i){let e=S(i),t=S(e.report),n=Array.isArray(t.byCategory)?t.byCategory.map(r=>{let o=S(r),a=W(o.bookedValue,o.bookedRevenue);return{...o,bookedValue:a,bookedRevenue:a}}):[],s=Array.isArray(t.bySection)?t.bySection.map(Le):void 0;return{...e,report:{...t,byCategory:n,...s?{bySection:s}:{}}}}function Oe(i){let e=S(i),t=S(e.bookedValue),n=S(e.revenue),s=Object.keys(t).length?t:n,r=Array.isArray(t.bySection)?t.bySection:Array.isArray(n.bySection)?n.bySection:[],o={...s,gross:W(t.gross,n.gross),bySection:r.map(Le)},a=S(e.velocity),l=Array.isArray(a.bySection)?a.bySection.map(h=>{let d=S(h),p=W(d.bookedValue,d.grossRevenue);return{...d,bookedValue:p,grossRevenue:p}}):[];return{...e,bookedValue:o,revenue:o,velocity:{...a,bySection:l}}}function ze(i){let e=S(i),t=S(e.report),n=typeof t.includesBookedValue=="boolean"?t.includesBookedValue:t.includesRevenue===!0,s=Array.isArray(t.rows)?t.rows.map(a=>{let l=S(a),h=S(l.attribution),d=Se(h.bookedValue,h.revenue);return{...l,attribution:{...h,bookedValue:d,revenue:d}}}):[],r=S(t.totals),o=Se(r.bookedValue,r.revenue);return{...e,report:{...t,includesBookedValue:n,includesRevenue:n,rows:s,totals:{...r,bookedValue:o,revenue:o}}}}function ie(i){let e=S(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}`},r;return t.body!==void 0&&(s["Content-Type"]="application/json",r=JSON.stringify(t.body)),fetch(`${this.base}${e}`,{method:n,headers:s,body:r,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 f(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"})}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}})}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}})}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 r=s.toString();return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/preview${r?`?${r}`:""}`)}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 r=s?"?endActiveSessions=1":"";return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/access-links/${encodeURIComponent(n)}${r}`,{method:"DELETE"})}report(e){return this.auth(`/v1/events/${encodeURIComponent(e)}/report`).then(qe)}controlRoom(e,t=15){return this.auth(`/v1/events/${encodeURIComponent(e)}/control-room?window=${t}`).then(Oe)}channelReport(e){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/report`).then(ze)}createChannelReportLink(e,t,n={}){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/report-links`,{method:"POST",body:n}).then(s=>{let r=S(s);return{...r,link:ie(r.link)}})}channelReportLinks(e,t){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/report-links`).then(n=>{let s=S(n);return{links:Array.isArray(s.links)?s.links.map(ie):[]}})}revokeChannelReportLink(e,t,n){return this.auth(`/v1/events/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}/report-links/${encodeURIComponent(n)}`,{method:"DELETE"}).then(s=>{let r=S(s);return{...r,link:ie(r.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 f(t.status,`request_failed_${t.status}`);return t.blob()}};function ae(i){return i.map((e,t)=>`
|
|
2
2
|
<div class="slm-ch-bucket" style="animation-delay:${Math.min(t,4)*30}ms">
|
|
3
3
|
<span class="ico ${e.kind}" aria-hidden="true">${c(e.icon)}</span>
|
|
4
4
|
<span><b>${e.count.toLocaleString()}</b> ${c(e.text.replace(/^[\d,.\s]+/,""))}
|
|
@@ -10,7 +10,7 @@ var C="public",E="Public sale";function M(i){return i==null||i===""||i===C}var X
|
|
|
10
10
|
access session for this channel with the SeatLayer server SDK and hands it to the widget. A channel name
|
|
11
11
|
on its own never grants access.</p>
|
|
12
12
|
<p class="slm-note"><a class="slm-linkbtn" href="https://docs.seatlayer.io/server-api/channels"
|
|
13
|
-
target="_blank" rel="noreferrer noopener">Read the website integration guide \u2192</a></p>`;function c(i){return String(i??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Re(i){return new Date(i-new Date(i).getTimezoneOffset()*6e4).toISOString().slice(0,16)}function oe(i,e){let t=i.querySelector(e)?.value.trim()??"",n=Number(t);return t!==""&&Number.isInteger(n)?n:null}function re(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
|
|
13
|
+
target="_blank" rel="noreferrer noopener">Read the website integration guide \u2192</a></p>`;function c(i){return String(i??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Re(i){return new Date(i-new Date(i).getTimezoneOffset()*6e4).toISOString().slice(0,16)}function oe(i,e){let t=i.querySelector(e)?.value.trim()??"",n=Number(t);return t!==""&&Number.isInteger(n)?n:null}function re(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 Ue=8,Ve="#6e7bff",Ne="#b9c0ff",je="#303846",Fe="#4b5669",Ye="#101723";function Ae(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)),r=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!==r*o)&&(e.width=s*o,e.height=r*o);let a=i.resolveCtx();if(!a)return;a.setTransform(o,0,0,o,0,0),a.clearRect(0,0,s,r);let l=i.host.isSeatDetail(),h=Math.max(3,i.host.seatPixelSize()),d=h/2,p=i.view==="preview"?i.previewProjection:null,w=p?new Set(p.available===!1?[]:p.eligible??[]):null,L=new Map,b=!l&&i.host.sections().length>1?new Map:null,u=i.view==="preview"&&l&&h<=15?new Map:null;for(let m of i.host.seats()){let T=i.host.statusOf(m.label)??"free",H=i.allocation.get(m.label)??C;if(H!==C){let y=L.get(H)??{x:0,y:0,n:0};y.x+=m.x,y.y+=m.y,y.n+=1,L.set(H,y)}if(!l){let y=i.host.sectionOfLabel(m.label),v=y?i.host.worldToScreen({x:m.x,y:m.y}):null;if(b&&y&&v){let g=b.get(y.id)??{label:y.label,minX:v.x,minY:v.y,maxX:v.x,maxY:v.y};g.minX=Math.min(g.minX,v.x),g.minY=Math.min(g.minY,v.y),g.maxX=Math.max(g.maxX,v.x),g.maxY=Math.max(g.maxY,v.y),b.set(y.id,g)}continue}if(T!=="free")continue;let B=null,R=null;if(i.view==="preview"?w?.has(m.label)?(B=Ve,R=Ne):(B=je,R=Fe):H!==C&&(B=i.markerFor(H).color,R=Ye),!B)continue;let k=i.host.worldToScreen({x:m.x,y:m.y});if(k&&!(k.x<-h||k.y<-h||k.x>s+h||k.y>r+h)){if(u){let y=i.host.sectionOfLabel(m.label);if(y){let v=u.get(y.id)??{label:y.label,minX:k.x,minY:k.y,maxX:k.x,maxY:k.y};v.minX=Math.min(v.minX,k.x),v.minY=Math.min(v.minY,k.y),v.maxX=Math.max(v.maxX,k.x),v.maxY=Math.max(v.maxY,k.y),u.set(y.id,v)}}if(a.fillStyle=B,i.view==="preview"||H!==C){let y=Math.max(2,d+Math.min(1.5,d*.06));a.globalAlpha=1,a.beginPath(),a.arc(k.x,k.y,y,0,Math.PI*2),a.fill(),a.strokeStyle=R??B,a.lineWidth=i.view==="preview"?Math.max(1,Math.min(1.75,h*.13)):Math.max(1,Math.min(1.5,h*.1)),a.stroke(),i.view==="preview"&&w?.has(m.label)&&h>=22&&Xe(a,m.label,k.x,k.y,y)}else a.globalAlpha=.85,a.fillRect(k.x-d,k.y-d,h,h)}}a.globalAlpha=1,u&&Ge(a,u),Ke(b,i),We(L,i,a)}function Xe(i,e,t,n,s){let r=s*1.55,o=Math.min(13,Math.max(7,s*.55)),a=6;for(;o>=a&&(i.font=`800 ${o}px var(--slm-font, system-ui, sans-serif)`,!(i.measureText(e).width<=r));)o-=.5;o<a||(i.fillStyle="#ffffff",i.textAlign="center",i.textBaseline="middle",i.fillText(e,t,n))}function Ke(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 r=s.maxX-s.minX,o=s.maxY-s.minY;if(r<20||o<20)continue;let a=document.createElement("button");a.type="button",a.className="slm-ch-section-target",a.style.left=`${s.minX-8}px`,a.style.top=`${s.minY-8}px`,a.style.width=`${r+16}px`,a.style.height=`${o+16}px`,a.setAttribute("aria-label",`Open ${s.label} seats`),a.addEventListener("click",()=>e.onSectionTargetClick(n)),t.appendChild(a)}}function Ge(i,e){for(let t of e.values()){let n=t.maxX-t.minX,s=t.maxY-t.minY;if(n<52||s<26)continue;let r=(t.minX+t.maxX)/2,o=(t.minY+t.maxY)/2,a=Math.max(11,Math.min(15,s*.16));i.font=`800 ${a}px var(--slm-font, system-ui, sans-serif)`;let l=Math.min(n-8,i.measureText(t.label).width+18),h=a+10;i.fillStyle="rgba(11, 16, 28, .88)",i.fillRect(r-l/2,o-h/2,l,h),i.fillStyle="#f8fafc",i.textAlign="center",i.textBaseline="middle",i.fillText(t.label,r,o)}}function We(i,e,t){let n=e.layer;if(!n||(n.querySelectorAll(".slm-ch-flag").forEach(r=>r.remove()),e.view==="preview"))return;let s=[...i.entries()].sort((r,o)=>o[1].n-r[1].n).slice(0,Ue);for(let[r,o]of s){let a=e.list?.channels.find(p=>p.id===r);if(!a)continue;let l=e.host.worldToScreen({x:o.x/o.n,y:o.y/o.n});if(!l)continue;let h=e.markerFor(r),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:${c(h.color)}">${c(h.letter)}</span>${c(a.name)}${a.state==="paused"?" \xB7 Paused":""}`,n.appendChild(d)}}var Qe=`
|
|
14
14
|
.slm{--slm-mo-instant:80ms;--slm-mo-quick:140ms;--slm-mo-base:200ms;--slm-mo-slow:320ms;--slm-mo-ambient:2000ms;
|
|
15
15
|
--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);
|
|
16
16
|
--slm-mo-spring:cubic-bezier(.34,1.3,.64,1)}
|
|
@@ -232,11 +232,6 @@ var C="public",E="Public sale";function M(i){return i==null||i===""||i===C}var X
|
|
|
232
232
|
.slm-ch-grabbar{width:42px;height:4px;border-radius:2px;background:rgba(255,255,255,.22);margin:0 auto}
|
|
233
233
|
.slm.compact .slm-ch-staged{bottom:auto;top:8px}
|
|
234
234
|
.slm.compact .slm-btn,.slm.compact .slm-ch-row,.slm.compact .slm-ch-viewseg button{min-height:44px}
|
|
235
|
-
.slm-tools{display:none}
|
|
236
|
-
.slm.compact .slm-tools{display:block;width:100%;padding:9px 13px;min-height:44px;border:1px solid var(--slm-line);
|
|
237
|
-
border-radius:10px;background:var(--slm-surface);color:var(--slm-text);font-size:13px;font-weight:800}
|
|
238
|
-
.slm.compact .slm-modes{display:none}
|
|
239
|
-
|
|
240
235
|
@media (prefers-reduced-motion:reduce){
|
|
241
236
|
.slm-ch-layer,.slm-ch-banner,.slm-ch-staged,.slm-ch-row,.slm.compact.ch-sheet .slm-rail,
|
|
242
237
|
.slm-ch-meter i,.slm-ch-radio{transition:none!important}
|
|
@@ -451,20 +446,20 @@ var C="public",E="Public sale";function M(i){return i==null||i===""||i===C}var X
|
|
|
451
446
|
<div class="foot">
|
|
452
447
|
<button type="button" class="quiet" data-ch-close>Cancel</button>
|
|
453
448
|
<button type="button" class="slm-btn" data-ch-add-scope disabled>Add seats</button>
|
|
454
|
-
</div>`,l=>{let h=new Map(s.map(g=>[g.id,g])),d=new Set,p=new Set,w=new Set(this.host.selectionLabels()),L=l.querySelector("[data-ch-add-scope]"),b=l.querySelector("[data-ch-error]"),u=l.querySelector("[data-ch-scope-list]"),m=l.querySelector("[data-ch-scope-search]"),T=l.querySelector("[data-ch-scope-summary]"),H=l.querySelector("[data-ch-scope-filter]"),B=200,R="",k=()=>{let g=new Set(w);for(let P of d)for(let D of h.get(P)?.labels??[])g.add(D);return g},y=()=>{let g=k(),P=g.size-w.size,D=g.size>$;L.disabled=P===0||D,L.textContent=D?`Maximum ${$.toLocaleString()} seats`:`Add ${P.toLocaleString()} seat${P===1?"":"s"}`,b.hidden=!D,b.textContent=D?`That would make ${g.size.toLocaleString()} selected seats. Choose fewer rows or sections.`:"",T.textContent=`${d.size.toLocaleString()} row${d.size===1?"":"s"} \xB7 ${P.toLocaleString()} seat${P===1?"":"s"} added`},v=()=>{let g=[],P=0,D=0;a.forEach(([A,x],
|
|
449
|
+
</div>`,l=>{let h=new Map(s.map(g=>[g.id,g])),d=new Set,p=new Set,w=new Set(this.host.selectionLabels()),L=l.querySelector("[data-ch-add-scope]"),b=l.querySelector("[data-ch-error]"),u=l.querySelector("[data-ch-scope-list]"),m=l.querySelector("[data-ch-scope-search]"),T=l.querySelector("[data-ch-scope-summary]"),H=l.querySelector("[data-ch-scope-filter]"),B=200,R="",k=()=>{let g=new Set(w);for(let P of d)for(let D of h.get(P)?.labels??[])g.add(D);return g},y=()=>{let g=k(),P=g.size-w.size,D=g.size>$;L.disabled=P===0||D,L.textContent=D?`Maximum ${$.toLocaleString()} seats`:`Add ${P.toLocaleString()} seat${P===1?"":"s"}`,b.hidden=!D,b.textContent=D?`That would make ${g.size.toLocaleString()} selected seats. Choose fewer rows or sections.`:"",T.textContent=`${d.size.toLocaleString()} row${d.size===1?"":"s"} \xB7 ${P.toLocaleString()} seat${P===1?"":"s"} added`},v=()=>{let g=[],P=0,D=0;a.forEach(([A,x],U)=>{let O=A.toLocaleLowerCase(),z=R?x.filter(I=>`${O} ${I.label.toLocaleLowerCase()}`.includes(R)):x;if(R&&!z.length)return;P+=z.length;let le=x.every(I=>d.has(I.id)),Te=!le&&x.some(I=>d.has(I.id)),V=!!R||p.has(U),Pe=Math.max(0,B-D),N=V?z.slice(0,Pe):[];D+=N.length;let De=x.reduce((I,Me)=>I+Me.labels.length,0);g.push(`<div class="slm-ch-scopegroup">
|
|
455
450
|
<button type="button" class="slm-ch-groupcheck" role="checkbox" aria-checked="${le?"true":Te?"mixed":"false"}"
|
|
456
|
-
aria-label="Select all ${x.length.toLocaleString()} rows in ${c(A)}" data-ch-scope-group="${
|
|
451
|
+
aria-label="Select all ${x.length.toLocaleString()} rows in ${c(A)}" data-ch-scope-group="${U}">
|
|
457
452
|
<span class="box" aria-hidden="true">\u2713</span><span>${c(A)}</span>
|
|
458
453
|
<span class="meta">${x.length.toLocaleString()} rows \xB7 ${De.toLocaleString()} seats</span>
|
|
459
454
|
</button>
|
|
460
|
-
<button type="button" class="slm-ch-grouptoggle" aria-expanded="${
|
|
461
|
-
data-ch-scope-toggle="${
|
|
455
|
+
<button type="button" class="slm-ch-grouptoggle" aria-expanded="${V}" aria-label="${V?"Hide":"Show"} rows in ${c(A)}"
|
|
456
|
+
data-ch-scope-toggle="${U}">${V?"Hide":"Show"}</button>
|
|
462
457
|
</div>`),g.push(...N.map(I=>`<button type="button" class="slm-ch-seatitem" role="checkbox"
|
|
463
458
|
aria-checked="${d.has(I.id)}" data-ch-scope-id="${c(I.id)}">
|
|
464
459
|
<span class="box" aria-hidden="true">\u2713</span><span>${c(I.label)}</span>
|
|
465
460
|
<span class="meta">${I.labels.length.toLocaleString()} seat${I.labels.length===1?"":"s"}</span>
|
|
466
|
-
</button>`)),
|
|
467
|
-
Use Drag box or the seat list instead.</div>`),H.textContent=R?`Showing ${D.toLocaleString()} of ${P.toLocaleString()} matching rows. Section checkboxes still select every row in that section.`:"Showing section groups. Expand one or search to see rows.",u.querySelectorAll("[data-ch-scope-group]").forEach(A=>A.addEventListener("click",()=>{let x=a[Number(A.dataset.chScopeGroup)]?.[1]??[],
|
|
461
|
+
</button>`)),V&&z.length>N.length&&g.push(`<p class="slm-ch-scopehint">${(z.length-N.length).toLocaleString()} more row${z.length-N.length===1?"":"s"}. Search to narrow the list.</p>`)}),u.innerHTML=g.join("")||(R?`<div class="slm-ch-scope-empty" data-ch-state="scope-nomatch">No sections or rows match \u201C${c(R)}\u201D.</div>`:`<div class="slm-ch-scope-empty" data-ch-state="scope-empty">This chart has no rows with selectable seats.
|
|
462
|
+
Use Drag box or the seat list instead.</div>`),H.textContent=R?`Showing ${D.toLocaleString()} of ${P.toLocaleString()} matching rows. Section checkboxes still select every row in that section.`:"Showing section groups. Expand one or search to see rows.",u.querySelectorAll("[data-ch-scope-group]").forEach(A=>A.addEventListener("click",()=>{let x=a[Number(A.dataset.chScopeGroup)]?.[1]??[],U=x.every(O=>d.has(O.id));for(let O of x)U?d.delete(O.id):d.add(O.id);v(),y()})),u.querySelectorAll("[data-ch-scope-toggle]").forEach(A=>A.addEventListener("click",()=>{let x=Number(A.dataset.chScopeToggle);p.has(x)?p.delete(x):p.add(x),v()})),u.querySelectorAll("[data-ch-scope-id]").forEach(A=>A.addEventListener("click",()=>{let x=A.dataset.chScopeId;d.has(x)?d.delete(x):d.add(x),v(),y()}))};m.addEventListener("input",()=>{R=m.value.trim().toLocaleLowerCase(),v(),y()}),L.addEventListener("click",()=>{let g=[...k()];!d.size||g.length>$||(this.closeDialog(),this.host.selectByLabels(g))}),v(),y()});return}let o=[...r.entries()].map(([a,l])=>`
|
|
468
463
|
<div class="slm-ch-seatgroup"><span>${c(a)}</span></div>
|
|
469
464
|
${l.map(h=>`<button type="button" class="slm-ch-seatitem" role="checkbox"
|
|
470
465
|
aria-checked="false" data-ch-scope-id="${c(h.id)}">
|