Bundle embedded web app
This commit is contained in:
File diff suppressed because one or more lines are too long
1
static/web/_next/static/chunks/6160.b3755bde5b40d7a4.js
Normal file
1
static/web/_next/static/chunks/6160.b3755bde5b40d7a4.js
Normal file
@@ -0,0 +1 @@
|
||||
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6160],{66160:function(e,i,t){"use strict";t.r(i),t.d(i,{BrowserNotifyModal:function(){return m}});var s=t(85893),n=t(84485),o=t(71577),r=t(11382),a=t(71230),l=t(67294),c=t(4480),d=t(77466);async function h(e,i,t){let s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channel:e,destination:i})};try{await fetch("".concat("/api/notifications/register","?accessToken=").concat(t),s)}catch(n){console.error(n)}}async function w(e){let i=await navigator.serviceWorker.ready,t=await i.pushManager.getSubscription();return t||(t=await i.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:function(e){let i="=".repeat((4-e.length%4)%4),t=(e+i).replace(/-/g,"+").replace(/_/g,"/"),s=window.atob(t),n=new Uint8Array(s.length);for(let o=0;o<s.length;++o)n[o]=s.charCodeAt(o);return n}(e)})),JSON.stringify(t)}var f=t(38851),u=t.n(f);function p(){return"serviceWorker"in navigator&&"PushManager"in window}let{Title:b}=n.Z,_=()=>(0,s.jsx)("div",{children:"Browser notifications are not supported in your browser."}),y=e=>{let{start:i}=e;return(0,s.jsx)("div",{id:"browser-push-preview-box",className:u().pushPreview,children:(0,s.jsxs)("div",{className:u().inner,children:[(0,s.jsxs)("div",{className:u().title,children:[window.location.toString()," wants to"]}),(0,s.jsxs)("div",{className:u().permissionLine,children:[(0,s.jsx)("svg",{className:u().bell,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M14 12.3333V13H2V12.3333L3.33333 11V7C3.33333 4.93333 4.68667 3.11333 6.66667 2.52667C6.66667 2.46 6.66667 2.4 6.66667 2.33333C6.66667 1.97971 6.80714 1.64057 7.05719 1.39052C7.30724 1.14048 7.64638 1 8 1C8.35362 1 8.69276 1.14048 8.94281 1.39052C9.19286 1.64057 9.33333 1.97971 9.33333 2.33333C9.33333 2.4 9.33333 2.46 9.33333 2.52667C11.3133 3.11333 12.6667 4.93333 12.6667 7V11L14 12.3333ZM9.33333 13.6667C9.33333 14.0203 9.19286 14.3594 8.94281 14.6095C8.69276 14.8595 8.35362 15 8 15C7.64638 15 7.30724 14.8595 7.05719 14.6095C6.80714 14.3594 6.66667 14.0203 6.66667 13.6667",fill:"#676670"})}),(0,s.jsx)("span",{className:u().showNotificationsText,children:"Show notifications"})]}),(0,s.jsxs)("div",{className:u().buttonRow,children:[(0,s.jsx)(o.Z,{type:"primary",onClick(){i()},children:"Allow"}),(0,s.jsx)("button",{type:"button",className:u().disabled,children:"Block"})]})]})})},g=()=>(0,s.jsxs)("div",{children:[(0,s.jsx)(b,{children:"Notifications are enabled"}),"To disable push notifications from ",window.location.hostname.toString()," access your browser permissions for this site and turn off notifications.",(0,s.jsx)("a",{href:"https://owncast.online/docs/notifications",children:" Learn more."})]}),m=()=>{let[e,i]=(0,l.useState)(null),t=(0,c.sJ)(d.FI),n=(0,c.sJ)(d.g1),[o,f]=(0,l.useState)(!1),b=p()&&"default"!==Notification.permission,{notifications:m}=n,{browser:v}=m,{publicKey:x}=v,N=v.enabled&&p();if(b)return(0,s.jsx)(g,{});let j=async()=>{if(!p()||"default"===Notification.permission){f(!0);try{let e=await w(x);h("BROWSER_PUSH_NOTIFICATION",e,t),i(null)}catch(s){i("Error registering for live notifications: ".concat(s.message,". Make sure you're not inside a private browser environment or have previously disabled notifications for this stream."))}f(!1)}};return N?(0,s.jsxs)(r.Z,{spinning:o,children:[(0,s.jsxs)(a.Z,{className:u().description,children:["Get notified right in the browser each time this stream goes live.",(0,s.jsx)("a",{href:"https://owncast.online/docs/notifications/#browser-notifications",children:"Learn more"}),"\xa0 about Owncast browser notifications."]}),(0,s.jsx)(a.Z,{children:e}),(0,s.jsx)(y,{start:()=>j()})]}):(0,s.jsx)(_,{})}},38851:function(e){e.exports={description:"BrowserNotifyModal_description__tMKKq",pushPreview:"BrowserNotifyModal_pushPreview__4Og4q",inner:"BrowserNotifyModal_inner__uhFDw",title:"BrowserNotifyModal_title__dd_Lh",permissionLine:"BrowserNotifyModal_permissionLine__K8nyJ",bell:"BrowserNotifyModal_bell__9mIeI",buttonRow:"BrowserNotifyModal_buttonRow__oxJUg",disabled:"BrowserNotifyModal_disabled__v88lb"}}}]);
|
||||
@@ -1 +0,0 @@
|
||||
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6160],{66160:function(e,i,t){"use strict";t.r(i),t.d(i,{BrowserNotifyModal:function(){return x}});var n=t(85893),s=t(84485),r=t(71577),o=t(11382),a=t(71230),l=t(15746),c=t(67294),d=t(4480),h=t(77466);async function w(e,i,t){let n={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channel:e,destination:i})};try{await fetch("".concat("/api/notifications/register","?accessToken=").concat(t),n)}catch(s){console.error(s)}}async function u(e){let i=await navigator.serviceWorker.ready,t=await i.pushManager.getSubscription();return t||(t=await i.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:function(e){let i="=".repeat((4-e.length%4)%4),t=(e+i).replace(/-/g,"+").replace(/_/g,"/"),n=window.atob(t),s=new Uint8Array(n.length);for(let r=0;r<n.length;++r)s[r]=n.charCodeAt(r);return s}(e)})),JSON.stringify(t)}var f=t(38851),p=t.n(f);function g(){return"serviceWorker"in navigator&&"PushManager"in window}let{Title:b}=s.Z,y=()=>(0,n.jsx)("div",{children:"Browser notifications are not supported in your browser."}),_=e=>{let{start:i}=e;return(0,n.jsx)("div",{id:"browser-push-preview-box",className:p().pushPreview,children:(0,n.jsxs)("div",{className:p().inner,children:[(0,n.jsxs)("div",{className:p().title,children:[window.location.toString()," wants to"]}),(0,n.jsxs)("div",{className:p().permissionLine,children:[(0,n.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M14 12.3333V13H2V12.3333L3.33333 11V7C3.33333 4.93333 4.68667 3.11333 6.66667 2.52667C6.66667 2.46 6.66667 2.4 6.66667 2.33333C6.66667 1.97971 6.80714 1.64057 7.05719 1.39052C7.30724 1.14048 7.64638 1 8 1C8.35362 1 8.69276 1.14048 8.94281 1.39052C9.19286 1.64057 9.33333 1.97971 9.33333 2.33333C9.33333 2.4 9.33333 2.46 9.33333 2.52667C11.3133 3.11333 12.6667 4.93333 12.6667 7V11L14 12.3333ZM9.33333 13.6667C9.33333 14.0203 9.19286 14.3594 8.94281 14.6095C8.69276 14.8595 8.35362 15 8 15C7.64638 15 7.30724 14.8595 7.05719 14.6095C6.80714 14.3594 6.66667 14.0203 6.66667 13.6667",fill:"#676670"})}),"Show notifications"]}),(0,n.jsxs)("div",{className:p().buttonRow,children:[(0,n.jsx)(r.Z,{type:"primary",className:p().allow,onClick(){i()},children:"Allow"}),(0,n.jsx)("button",{type:"button",className:p().disabled,children:"Block"})]})]})})},v=()=>(0,n.jsxs)("div",{children:[(0,n.jsx)(b,{children:"Notifications are enabled"}),"To disable push notifications from ",window.location.hostname.toString()," access your browser permissions for this site and turn off notifications.",(0,n.jsx)("a",{href:"https://owncast.online/docs/notifications",children:" Learn more."})]}),x=()=>{let[e,i]=(0,c.useState)(null),t=(0,d.sJ)(h.FI),s=(0,d.sJ)(h.g1),[r,f]=(0,c.useState)(!1),p=g()&&"default"!==Notification.permission,{notifications:x}=s,{browser:m}=x,{publicKey:N}=m,j=m.enabled&&g();if(p)return(0,n.jsx)(v,{});let C=async()=>{if(!g()||"default"===Notification.permission){f(!0);try{let e=await u(N);w("BROWSER_PUSH_NOTIFICATION",e,t),i(null)}catch(n){i("Error registering for live notifications: ".concat(n.message,". Make sure you're not inside a private browser environment or have previously disabled notifications for this stream."))}f(!1)}};return j?(0,n.jsxs)(o.Z,{spinning:r,children:[(0,n.jsxs)(a.Z,{align:"top",children:[(0,n.jsx)(b,{children:"Browser Notifications"}),"Get notified right in the browser each time this stream goes live. Blah blah blah more description text goes here."]}),(0,n.jsx)(a.Z,{children:e}),(0,n.jsx)(a.Z,{align:"top",children:(0,n.jsx)(l.Z,{span:12,children:(0,n.jsx)(_,{start:()=>C()})})})]}):(0,n.jsx)(y,{})}},38851:function(e){e.exports={pushPreview:"BrowserNotifyModal_pushPreview__4Og4q",inner:"BrowserNotifyModal_inner__uhFDw",title:"BrowserNotifyModal_title__dd_Lh",permissionLine:"BrowserNotifyModal_permissionLine__K8nyJ",buttonRow:"BrowserNotifyModal_buttonRow__oxJUg",disabled:"BrowserNotifyModal_disabled__v88lb",allow:"BrowserNotifyModal_allow__M9AWC"}}}]);
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
static/web/_next/static/css/bb299f55f92630db.css
Normal file
1
static/web/_next/static/css/bb299f55f92630db.css
Normal file
@@ -0,0 +1 @@
|
||||
.BrowserNotifyModal_description__tMKKq{margin-bottom:5px}.BrowserNotifyModal_pushPreview__4Og4q{border-style:dashed;border-width:2px;width:100%;max-width:400px;margin:10px 1% 1%}.BrowserNotifyModal_pushPreview__4Og4q .BrowserNotifyModal_inner__uhFDw{margin:10px;padding:15px;background-color:#fff;box-shadow:2px 6px 7px 0 #87898d}.BrowserNotifyModal_pushPreview__4Og4q .BrowserNotifyModal_inner__uhFDw .BrowserNotifyModal_title__dd_Lh{font-weight:700}.BrowserNotifyModal_pushPreview__4Og4q .BrowserNotifyModal_inner__uhFDw .BrowserNotifyModal_permissionLine__K8nyJ{margin-top:5px;display:flex;align-items:center}.BrowserNotifyModal_pushPreview__4Og4q .BrowserNotifyModal_inner__uhFDw .BrowserNotifyModal_permissionLine__K8nyJ .BrowserNotifyModal_bell__9mIeI{margin-top:-1px;margin-right:5px}.BrowserNotifyModal_pushPreview__4Og4q .BrowserNotifyModal_inner__uhFDw .BrowserNotifyModal_buttonRow__oxJUg{display:flex;flex-direction:row;justify-content:flex-end}.BrowserNotifyModal_pushPreview__4Og4q .BrowserNotifyModal_inner__uhFDw .BrowserNotifyModal_buttonRow__oxJUg .BrowserNotifyModal_disabled__v88lb{cursor:not-allowed;outline-width:1;outline-color:"#e2e8f0";outline-style:"solid";background-color:#fff}.BrowserNotifyModal_pushPreview__4Og4q .BrowserNotifyModal_inner__uhFDw .BrowserNotifyModal_buttonRow__oxJUg button{margin-left:10px;padding:4px 15px;border-radius:3px;border-style:solid}
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
.BrowserNotifyModal_pushPreview__4Og4q{border-style:dashed;border-width:2px;width:30vw}.BrowserNotifyModal_pushPreview__4Og4q .BrowserNotifyModal_inner__uhFDw{margin:10px;padding:15px;background-color:#fff;box-shadow:2px 6px 7px 0 #87898d}.BrowserNotifyModal_pushPreview__4Og4q .BrowserNotifyModal_inner__uhFDw .BrowserNotifyModal_title__dd_Lh{font-weight:700}.BrowserNotifyModal_pushPreview__4Og4q .BrowserNotifyModal_inner__uhFDw .BrowserNotifyModal_permissionLine__K8nyJ{margin-top:5px}.BrowserNotifyModal_pushPreview__4Og4q .BrowserNotifyModal_inner__uhFDw .BrowserNotifyModal_buttonRow__oxJUg{display:flex;flex-direction:row;justify-content:flex-end}.BrowserNotifyModal_pushPreview__4Og4q .BrowserNotifyModal_inner__uhFDw .BrowserNotifyModal_buttonRow__oxJUg .BrowserNotifyModal_disabled__v88lb{cursor:not-allowed;outline-width:1;outline-color:"#e2e8f0";outline-style:"solid";background-color:#fff}.BrowserNotifyModal_pushPreview__4Og4q .BrowserNotifyModal_inner__uhFDw .BrowserNotifyModal_buttonRow__oxJUg .BrowserNotifyModal_allow__M9AWC{background-color:var(--theme-primary-color)}.BrowserNotifyModal_pushPreview__4Og4q .BrowserNotifyModal_inner__uhFDw .BrowserNotifyModal_buttonRow__oxJUg button{margin-left:10px;padding:4px 15px;border-radius:3px;border-style:solid}
|
||||
Reference in New Issue
Block a user