!function(){"use strict";var e,t={6917:function(){var e=window.wp.blocks,t=window.wp.components,a=(window.wp.i18n,window.wp.blockEditor);function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},n.apply(null,arguments)}var l=JSON.parse('{"UU":"purdue/alert-page"}'),r=window.wp.primitives;(0,e.registerBlockType)(l.UU,{icon:()=>React.createElement(r.SVG,{id:"Layer_1","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 87.5"},React.createElement("defs",null),React.createElement("g",{id:"Window-maximize",className:"cls-1"},React.createElement("g",{className:"cls-1"},React.createElement(r.Path,{className:"color-d9ab28",d:"M100,16.62V85.37a9.38,9.38,0,0,1-9.37,9.37H9.37A9.38,9.38,0,0,1,0,85.37V16.62A9.38,9.38,0,0,1,9.37,7.24H90.63A9.38,9.38,0,0,1,100,16.62ZM90.63,38.49H9.37v45.7a1.18,1.18,0,0,0,1.18,1.18h78.9a1.18,1.18,0,0,0,1.18-1.18Z",transform:"translate(0 -7.24)"})))),edit:e=>{const{className:l,setAttributes:r}=e,{header:c,imgURL:o,imgAlt:i,youtubeURL:m,showOnce:s,tag:u,subtext:d,linkText:h,linkURL:g,external:p,id:R}=e.attributes,v=(0,a.useBlockProps)(),b=()=>{r({imgUrl:"",imgAlt:""})},w=function(e){const t=e?.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/);return t&&11===t[2].length?t[2]:null}(m),E=`https://www.youtube.com/embed/${w}`;return[React.createElement(a.InspectorControls,{key:"1"},React.createElement(t.PanelBody,null,React.createElement(t.PanelRow,null,React.createElement(t.TextControl,{label:"Call to action text",value:h,onChange:e=>r({linkText:e})})),React.createElement(t.PanelRow,null,React.createElement(t.TextControl,{label:"Link address",type:"url",value:g,onChange:e=>r({linkURL:e})})),React.createElement(t.PanelRow,null,React.createElement(t.CheckboxControl,{label:"Open link in new tab?",checked:p,onChange:()=>r({external:!p})})),React.createElement(t.PanelRow,null,React.createElement(t.TextControl,{label:"Youtube video link",help:"Add a youtube video link to feature a video in the alert page",type:"url",value:m,onChange:e=>r({youtubeURL:e})})),React.createElement(t.PanelRow,null,React.createElement(t.CheckboxControl,{label:"Show the alert only once?",checked:s,onChange:()=>r({showOnce:!s})})))),React.createElement("div",n({key:"2"},v),React.createElement("div",{className:"modal alert-page-widget alert-page-widget-editor"},React.createElement("div",{className:"modal-background"}),React.createElement("div",{className:"modal-close","aria-label":"close"}),React.createElement("div",{className:"modal-content"},m&&""!==m?React.createElement("div",{className:"iframe-container"},React.createElement("iframe",{className:"modal-youtube-video",id:w,src:E})):React.createElement(a.MediaUploadCheck,null,React.createElement(a.MediaUpload,{onSelect:e=>{r({imgURL:e.url,imgAlt:e.alt})},render:({open:e})=>React.createElement("div",{className:"image-container"},React.createElement("img",{className:"image",src:o,alt:i}),React.createElement("div",{className:"image-buttons"},React.createElement(t.Button,{isPrimary:!0,onClick:e},""!==o?"Select a new image":"Select an image"),o?React.createElement(t.Button,{isSecondary:!0,className:"remove-image-button",onClick:b},"Remove image"):""))})),React.createElement(a.RichText,{tagName:"p",value:u,className:"aler-page__tag",onChange:e=>{r({tag:e})},placeholder:"Add tag"}),React.createElement(a.RichText,{tagName:"h2",value:c,className:"aler-page__header",onChange:e=>{r({header:e})},placeholder:"Add header"}),React.createElement(a.RichText,{tagName:"p",value:d,className:"aler-page__subtext",onChange:e=>{r({subtext:e})},placeholder:"Add subtext"}),React.createElement("div",{className:"purdue-home-button",href:g,target:p?"_blank":"_self"},h))))]}})}},a={};function n(e){var l=a[e];if(void 0!==l)return l.exports;var r=a[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,e=[],n.O=function(t,a,l,r){if(!a){var c=1/0;for(s=0;s<e.length;s++){a=e[s][0],l=e[s][1],r=e[s][2];for(var o=!0,i=0;i<a.length;i++)(!1&r||c>=r)&&Object.keys(n.O).every(function(e){return n.O[e](a[i])})?a.splice(i--,1):(o=!1,r<c&&(c=r));if(o){e.splice(s--,1);var m=l();void 0!==m&&(t=m)}}return t}r=r||0;for(var s=e.length;s>0&&e[s-1][2]>r;s--)e[s]=e[s-1];e[s]=[a,l,r]},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={6123:0,691:0};n.O.j=function(t){return 0===e[t]};var t=function(t,a){var l,r,c=a[0],o=a[1],i=a[2],m=0;if(c.some(function(t){return 0!==e[t]})){for(l in o)n.o(o,l)&&(n.m[l]=o[l]);if(i)var s=i(n)}for(t&&t(a);m<c.length;m++)r=c[m],n.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return n.O(s)},a=self.webpackChunkpurdue_home_theme=self.webpackChunkpurdue_home_theme||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))}();var l=n.O(void 0,[691],function(){return n(6917)});l=n.O(l)}();