text: /*! For license information please see 8ba700c462f7ff5941fc.bundle.js.LICENSE.txt */
  (window["app-designer_WP_JSONP"]=window["app-designer_WP_JSONP"]||[]).push([[2],{1949:function(e,t,n){"use strict";n.r(t);var r=n(902);n.d(t,"default",(function(){return r.a}))},1990:function(e,t,n){"use strict";var r=n(6),a=n(1);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(n(16)),o=a(n(27)),s=a(n(35)),u=a(n(20)),l=r(n(0)),c=a(n(2)),d=a(n(2552)),f=n(79),p=a(n(255)),h=a(n(193)),m=a(n(431)),g=a(n(215)),v=a(n(2553)),b=a(n(118)),y=a(n(85)),w=a(n(42)),k=a(n(58)),E=n(24),x=a(n(19));function P(){var e=(0,u.default)(["\n  display: contents;\n  color: "," !important;\n"]);return P=function(){return e},e}function O(){var e=(0,u.default)(["\n\n  background-image: ",";\n  background-repeat: no-repeat;\n  background-position: center center;\n  background-size: ",";\n  height: ",";\n  width: 100%;\n"]);return O=function(){return e},e}var _=x.default.div(O(),(function(e){var t=e.label;return"url(".concat(t,")")}),(function(e){return e.ImagePlaceHolderbackgroundSize}),(function(e){return e.ImagePlaceHolderHeight})),C=function(e){switch(e.toLowerCase()){case"sidebar":return"body2";default:return"body1"}},D=(0,f.makeStyles)({select:function(e){return function(e){switch(e.toLowerCase()){case"sidebar":return{minHeight:"30px",height:"30px",paddingTop:"0",paddingBottom:"0","& > p":{lineHeight:"30px"}};case"regular":return{minHeight:"48px",height:"48px",paddingTop:"0",paddingBottom:"0","& > p":{lineHeight:"48px"}};default:return{"& > p":{lineHeight:"32px"}}}}(e.variant)},icon:function(e){return function(e){switch(e.toLowerCase()){case"sidebar":return{right:"0",top:"auto",fontSize:"1.25rem"};case"regular":return{right:"0",top:"auto"};default:return{}}}(e.variant)}}),A=(0,x.default)(h.default)(P(),(function(e){return e.theme.palette.error.main})),L=function(e){var t=e.variant,n=e.readonly,r=e.label,a=e.onChange,u=e.dataElementId,c=e.dataElementLabel,f=e.dataElementLocation,h=e.selectProps,x=(e.className,e.options),P=e.ImagePlaceHolderbackgroundSize,O=e.ImagePlaceHolderHeight,L=e.validationError,S=(0,s.default)(e,["variant","readonly","label","onChange","dataElementId","dataElementLabel","dataElementLocation","selectProps","className","options","ImagePlaceHolderbackgroundSize","ImagePlaceHolderHeight","validationError"]),j="sidebar"===t||"regular"===t?"outlined":t,U=(0,l.useState)(0),I=(0,o.default)(U,2),H=I[0],F=I[1],T=D({variant:t}),z=(0,l.useRef)(null);return(0,l.useEffect)((function(){r&&F(z.current?z.current.offsetWidth:0)}),[z.current]),l.default.createElement(p.default,{variant:j,disabled:n,dataElementId:"".concat(u,"--form-control"),dataElementLabel:"".concat(c,"--form-control"),dataElementLocation:f},r&&l.default.createElement(m.default,{htmlFor:"select-".concat(u),ref:z},r),l.default.createElement(v.default,(0,i.default)({},(0,b.default)(S,["styleSettings","skeletonLoader","fieldId","exclude_self"]),h,{classes:T,variant:j,IconComponent:d.default,inputProps:{id:"select-".concat(u)},label:r,labelWidth:H,dataElementId:u,dataElementLabel:c,dataElementLocation:f,onChange:function(e){return a(e.target.value)},error:!!L}),(0,k.default)(x)&&x.map((function(e){var n=e.value,r=e.label,a=e.type,i=e.disabled;return l.default.createElement(g.default,{key:n,disabled:!!i,value:n,dataElementId:"".concat(u,"--menu-item"),dataElementLabel:"".concat(c,"--menu-item-").concat(n),dataElementLocation:E.DataElementLocations.POP_UP},"image/svg"===a?l.default.createElement(_,{label:r,ImagePlaceHolderbackgroundSize:P,ImagePlaceHolderHeight:O}):l.default.createElement(y.default,{variant:C(t)},l.default.createElement(w.default,{message:r})))}))),l.default.createElement(A,null,L))};L.propTypes={selectProps:c.default.object,options:c.default.arrayOf(c.default.shape({value:c.default.any,label:c.default.oneOfType([c.default.string,c.default.node])})),label:c.default.oneOfType([c.default.string,c.default.node]),variant:c.default.oneOf(["standard","outlined","filled","sidebar","regular"]),readonly:c.default.bool,dataElementLocation:c.default.oneOf(E.DataElementLocationsArray).isRequired,dataElementLabel:c.default.string.isRequired,dataElementId:c.default.string.isRequired,onChange:c.default.func.isRequired,className:c.default.string,ImagePlaceHolderbackgroundSize:c.default.string,ImagePlaceHolderHeight:c.default.string,validationError:c.default.oneOfType([c.default.string,c.default.node])},L.defaultProps={variant:"outlined",readOnly:!1,options:[],ImagePlaceHolderbackgroundSize:"500px",ImagePlaceHolderHeight:"30px"};var S=(0,l.memo)(L);t.default=S},2159:function(e,t,n){"use strict";var r=n(1);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(14)),i=r(n(56)),o=r(n(57)),s=r(n(4));n(258);var u=r(n(2614));function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var d=function e(t,n,r,l,d,f){var p=this,h=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{};if((0,s.default)(this,e),this.setEndpoints=function(e,t,n){if(e)p.signedUrlEndpoint="".concat(t,"/v1.0/Documents"),p.publishedDocumentEndpoint=p.signedUrlEndpoint+"/published",p.signedUrlEndpointCallback="".concat(t,"/v1.0/Documents/publish");else{var r=p.multipleAtOnce?"signed_urls":"signed_url";if(n){var a=Object.keys(n).map((function(e){return"".concat(e,"=").concat(n[e])}));p.signedUrlEndpoint="".concat(t,"/v1.0/images/").concat(r,"?").concat(a.join("&"))}else p.signedUrlEndpoint="".concat(t,"/v1.0/images/").concat(r);p.signedUrlEndpointCallback="".concat(t,"/v1.0/images/signed_url_callback")}},this.prepareFiles=function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=(0,o.default)(i.default.mark((function e(n,r){var a,o,s,u;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.getImageDimensions(t);case 2:a=e.sent,o=a.height,s=a.width,u=p.checkFileName(t),n({height:o,width:s,file:u});case 7:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.mapPropertiesNeeded=function(e){var t={file_name:e.name,content_type:e.type,content_length:e.size};return p.isDocument&&(t.asset_type=3),t},this.getSignedUrls=function(){var e=(0,o.default)(i.default.mark((function e(t){var n,r,a,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.map((function(e){var t=e.width,n=e.height;return c(c({},p.mapPropertiesNeeded(e.file)),{},{width:t,height:n})})),r={method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(p.token)},credentials:"include",body:JSON.stringify(n)},e.next=4,fetch(p.signedUrlEndpoint,r);case 4:return a=e.sent,e.next=7,a.json();case 7:return o=e.sent,e.abrupt("return",o);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.runAllCallbacks=(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=p.imagesCompleted.map((function(e){return e.imageId})),e.next=3,p.postCallback(t);case 3:e.sent.forEach((function(e,t){var n={};n.callBackResponse=e,p.progressCallback(n,t)}));case 5:case"end":return e.stop()}}),e)}))),this.initialize=(0,o.default)(i.default.mark((function e(){var t,n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!p.multipleAtOnce||p.isDocument){e.next=13;break}return e.next=3,p.files.map((function(e){return p.prepareFiles(e)}));case 3:return t=e.sent,e.next=6,Promise.all(t);case 6:return n=e.sent,e.next=9,p.getSignedUrls(n);case 9:e.sent.forEach(function(){var e=(0,o.default)(i.default.mark((function e(t,r){var a,o,s,u,l,c,d,f,h,m,g,v;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=t.signed_url,o=a.signed_url,s=a.content_headers,u=a.original_filename,l=t.image_id,c=n.find((function(e){return e.file.name===u})),e.prev=2,d=function(e,t){p.imagesCompleted[r]={response:e,imageId:l},p.imagesCompleted.filter((function(e){return e})).length===p.files.length&&p.runAllCallbacks()},f=function(e,t){p.progressCallback(e,r)},h=function(e){p.errorCallback(e)},e.next=8,p.getSessionUrl(c.file,o,s);case 8:(m=e.sent)?p.uploadFile(m,c.file,l,d,f,h):(g=new Error("sessionUrl is null"),p.errorCallback(g)),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(2),v=new Error("sessionUrl: ".concat(e.t0)),p.errorCallback(v);case 16:case"end":return e.stop()}}),e,null,[[2,12]])})));return function(t,n){return e.apply(this,arguments)}}()),e.next=14;break;case 13:p.files.forEach(function(){var e=(0,o.default)(i.default.mark((function e(t,n){var r,a,o,s,u,l,c,d,f,h,m,g,v,b,y,w,k;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=p.checkFileName(t),!p.isDocument){e.next=5;break}e.t0={},e.next=8;break;case 5:return e.next=7,p.getImageDimensions(t);case 7:e.t0=e.sent;case 8:return a=e.t0,o=a.height,s=a.width,e.next=13,p.getSignedUrl(r,s,o);case 13:return u=e.sent,l=u.signed_url,c=l.signed_url,d=l.content_headers,l.original_filename,f=l.file_name,h=u.image_id,m=p.isDocument?f:h,e.prev=21,g=function(e,t){p.progressCallback(e,n,p.isDocument?null:{height:o,width:s})},v=function(e,t){p.progressCallback(e,n)},b=function(e){p.errorCallback(e)},e.next=27,p.getSessionUrl(r,c,d);case 27:(y=e.sent)?p.uploadFile(y,t,m,g,v,b):(w=new Error("sessionUrl is null"),p.errorCallback(w)),e.next=35;break;case 31:e.prev=31,e.t1=e.catch(21),k=new Error("sessionUrl: ".concat(e.t1)),p.errorCallback(k);case 35:case"end":return e.stop()}}),e,null,[[21,31]])})));return function(t,n){return e.apply(this,arguments)}}());case 14:case"end":return e.stop()}}),e)}))),this.checkFileName=function(e){return new window.File([e],encodeURI(e.name.replace(/[<>:"/\\|?*()]+/g,"").replace(/\s/g,"-")),{type:e.type})},this.getSessionUrl=function(){var e=(0,o.default)(i.default.mark((function e(t,n,r){var a,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a={headers:{"x-goog-resumable":"start","Content-Length":0,"Content-Type":t.type,"x-goog-meta-x-builder-filename":t.name},method:"POST",mode:"cors"},e.next=3,fetch(n,a);case 3:return o=e.sent,e.abrupt("return",o.headers.get("location"));case 5:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),this.getImageDimensions=function(e){return new Promise((function(t,n){var r=new window.Image;r.onload=function(){t({width:r.width,height:r.height})},r.src=window.URL.createObjectURL(e)}))},this.getSignedUrl=function(){var e=(0,o.default)(i.default.mark((function e(t,n,r,a){var o,s,u,l;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=p.mapPropertiesNeeded(t),n&&r&&(o.width=n,o.height=r),s={method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(p.token)},credentials:"include",body:JSON.stringify(p.isDocument?[o]:o)},e.next=5,fetch(p.signedUrlEndpoint,s);case 5:return u=e.sent,e.next=8,u.json();case 8:if(l=e.sent,!p.isDocument){e.next=13;break}return e.abrupt("return",{signed_url:l[0]});case 13:return e.abrupt("return",l);case 14:case"end":return e.stop()}}),e)})));return function(t,n,r,a){return e.apply(this,arguments)}}(),this.getResponseEndpoint=function(e,t){if(p.isDocument)return p.signedUrlEndpointCallback+"/"+e;var n=Array.isArray(e)?"image_ids":"image_id";return t.body=JSON.stringify((0,a.default)({},n,e)),p.signedUrlEndpointCallback},this.postCallback=function(){var e=(0,o.default)(i.default.mark((function e(t){var n,r,a,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(p.token)},credentials:"include"},r=p.getResponseEndpoint(t,n),e.next=4,fetch(r,n);case 4:if(a=e.sent,!p.isDocument){e.next=9;break}return e.abrupt("return",null);case 9:return e.next=11,a.json();case 11:return o=e.sent,e.abrupt("return",o);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.getLastUploadedFile=(0,o.default)(i.default.mark((function e(){var t,n,r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={method:"GET",headers:{Authorization:"Bearer ".concat(p.token)},credentials:"include"},n=p.publishedDocumentEndpoint,e.next=4,fetch(n,t);case 4:return r=e.sent,e.abrupt("return",r.json());case 6:case"end":return e.stop()}}),e)}))),this.uploadFile=function(e,t,n,r,a,s){var l=new u.default({url:e,files:[t],sendAsBinary:!0,method:"PUT"});l.response=function(){var e=(0,o.default)(i.default.mark((function e(a,o){var s,u;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s={filename:t.name,internal_filename:t.name,content_type:t.type,content_length:t.size,file_status:1},u={image_url:""},p.multipleAtOnce){e.next=6;break}return e.next=5,p.postCallback(n);case 5:u=e.sent;case 6:if(!p.isDocument){e.next=12;break}return e.next=9,p.getLastUploadedFile();case 9:s.callBackResponse=e.sent,e.next=13;break;case 12:s.callBackResponse=u;case 13:s.response=a,r(s);case 15:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),l.progress=function(e,t){a(e,t)},l.error=function(e){s(e)},l.start()},this.fileToBinary=function(e){return new Promise((function(t,n){var r=new window.FileReader;r.onload=function(){t(r.result)},r.readAsArrayBuffer(e)}))},!t||!r||!n)throw new Error("Please supply the correct arguments");this.files=t,this.token=n,this.imagesCompleted=[],this.options=h,this.multipleAtOnce=h&&h.multipleAtOnce,this.isDocument=h&&h.isDocument,this.progressCallback=d,this.errorCallback=f,this.setEndpoints(this.isDocument,r,l)};t.default=d},2552:function(e,t,n){"use strict";var r=n(1),a=n(6);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(n(0)),o=(0,r(n(66)).default)(i.createElement("path",{d:"M12 5.83L15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z"}),"UnfoldMore");t.default=o},2553:function(e,t,n){"use strict";var r=n(1);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(24),i=r(n(1949)),o=(0,a.withDataProperty)(i.default,a.DataElementTypes.SELECT);t.default=o},2614:function(e,t,n){"use strict";var r=n(1);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(38)),i=r(n(4)),o=r(n(5)),s=function(){function e(t){(0,i.default)(this,e),this.uploads={},this.encoding=t.encoding,this.destination=t.url,this.sendAsBinary=t.sendAsBinary,this.method=t.method||"POST",t.hasOwnProperty("data")&&(this.data=t.data),this.useAuthentication=t.hasOwnProperty("authentication"),this.useAuthentication&&(this.authentication=t.authentication),this.rawfiles=t.files.constructor===Array?t.files:Array.from(t.files),this.statuses=Array.from(Array(this.rawfiles.length),(function(e){return!1})),this.registerEvents(),this.token=null}return(0,o.default)(e,[{key:"registerEvents",value:function(){this.progress=null,this.started=null,this.completed=null,this.error=null,this.completedAll=null,this.response=null}},{key:"start",value:function(){var e=this,t=this.rawfiles;t.map((function(t,n){return e.prepareFile(t,n)})).forEach((function(n,r){var a=e.sendAsBinary&&t&&t[0]?t[0]:"base64"!==e.encoding?e.createFormData(r,n.file):e.createBase64FormData(r,n.file);e.uploads[r]={id:r,data:n.file,progress:0};var i=new window.XMLHttpRequest;i.upload.addEventListener("progress",(function(t){return e.onprogress(t,r)})),i.onerror=function(t){return e.onerror(t,r)},i.onloadstart=function(t){return e.onstart(t,r)},i.onloadend=function(t){return e.onend(t,r)},i.onload=function(t){return e.onload(i.response,t,r)},i.open(e.method,e.destination),e.useAuthentication&&(i.withCredentials=!0,i.setRequestHeader("Authorization","Bearer "+e.authentication.token)),i.send(a)}))}},{key:"createFormData",value:function(e,t){var n=this,r=new window.FormData;return this.data&&("object"===(0,a.default)(this.data)?Object.keys(this.data).forEach((function(e){"xhr-data"!==e?r.append(e,n.data[e]):console.error("[Upload] Error: 'xhr-data' is a reserved keyword.")})):r.append("xhr-data",this.data)),r.append("xhr-upload-".concat(e),t),r}},{key:"createBase64FormData",value:function(e,t){var n=new window.FormData;return n.append("data",t,"uploaded-from-file.jpg"),n.append("encoding","base64"),n.append("fileName",t.name),n.append("mimeType",t.type),n}},{key:"onstart",value:function(e,t){"function"==typeof this.started&&this.started(t)}},{key:"onprogress",value:function(e,t){e.lengthComputable&&(this.uploads[t].progress=e.loaded/e.total,"function"==typeof this.progress&&this.progress(e.loaded/e.total,t))}},{key:"onend",value:function(e,t){"function"==typeof this.completed&&(this.completed(t),this.statuses[t]=!0,this.statuses.every((function(e){return!0===e}))&&"function"==typeof this.completedAll&&this.completedAll())}},{key:"onerror",value:function(e){"function"==typeof this.error&&this.error(e)}},{key:"onload",value:function(e,t,n){if("function"==typeof this.response)try{var r=JSON.parse(e);r[0].fileIndex=n,this.response(r)}catch(t){this.response(e,n)}}},{key:"prepareFile",value:function(e,t){return"base64"===this.encoding?{file:e}:{id:t,progress:0,file:e}}}]),e}();t.default=s}}]);
  //# sourceMappingURL=8ba700c462f7ff5941fc.bundle.js.map