UNPKG

native-forms-react

Version:

Build forms, surveys and polls for React.

1 lines β€’ 224 kB
"use strict";var e,t=require("react"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function i(e,t){return e(t={exports:{}},t.exports),t.exports}var a=i((function(e){var t=function(e){var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(e,t,n,r){var o=t&&t.prototype instanceof u?t:u,i=Object.create(o.prototype),a=new E(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return S()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=x(a,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=l(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,a),i}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var s={};function u(){}function d(){}function f(){}var p={};p[o]=function(){return this};var m=Object.getPrototypeOf,g=m&&m(m(k([])));g&&g!==t&&n.call(g,o)&&(p=g);var h=f.prototype=u.prototype=Object.create(p);function v(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function b(e){var t;this._invoke=function(r,o){function i(){return new Promise((function(t,i){!function t(r,o,i,a){var c=l(e[r],e,o);if("throw"!==c.type){var s=c.arg,u=s.value;return u&&"object"==typeof u&&n.call(u,"__await")?Promise.resolve(u.__await).then((function(e){t("next",e,i,a)}),(function(e){t("throw",e,i,a)})):Promise.resolve(u).then((function(e){s.value=e,i(s)}),(function(e){return t("throw",e,i,a)}))}a(c.arg)}(r,o,t,i)}))}return t=t?t.then(i,i):i()}}function x(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return s;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=l(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,s;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,s):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,s)}function y(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(y,this),this.reset(!0)}function k(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:S}}function S(){return{value:void 0,done:!0}}return d.prototype=h.constructor=f,f.constructor=d,f[a]=d.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,a in e||(e[a]="GeneratorFunction")),e.prototype=Object.create(h),e},e.awrap=function(e){return{__await:e}},v(b.prototype),b.prototype[i]=function(){return this},e.AsyncIterator=b,e.async=function(t,n,r,o){var i=new b(c(t,n,r,o));return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},v(h),h[a]="Generator",h[o]=function(){return this},h.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=k,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),s},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),s}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;w(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}));function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}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 s(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){c(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}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function d(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function f(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function p(e,t){if(!e)return!1;if(!t||0===e.length)return!1;var n=e.filter((function(e){return e.questionToShow===t})),r=n.some((function(e){return"and"===e.behavior}))?"and":"or";if(0===n.length)return!1;if("and"===r){if(n.every((function(e){return!0===e.canShow})))return!1}else if(n.some((function(e){return!0===e.canShow})))return!1;return!0}function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=e.conditions||[];return!t||0===n.length||!p(n,t)}function g(e,t){var n=e.question||e.placeholder;if(Array.isArray(e.value)){if(e.value[0]&&"object"==typeof e.value[0]){if(!m(t,n))return{canSend:!0,visible:m(t,n)};var r=!0;return e.value.forEach((function(e){m(t,e.question||e.placeholder)&&e.isRequired&&!e.value&&(r=!1)})),{value:e.value.filter((function(e){return e.value})).map((function(e){return e.question?"\n"+e.question+": "+e.value:e.value})).join(", "),canSend:r,visible:m(t,n),error:e.value.find((function(e){return e.error}))}}return e.value=e.value.filter((function(e){return e})),{canSend:!m(t,n)||(!e.isRequired||e.value.length>0),value:e.value.join(", "),visible:m(t,n),error:!!e.error}}return{canSend:!m(t,n)||(!e.isRequired||!!e.value),value:e.value,visible:m(t,n),error:!!e.error}}var h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=e.pages||[],r={};return n.forEach((function(n){(n.blocks||[]).forEach((function(n){if("contact"!==n.type&&"matrix"!==n.type){var o=g(n,e).value;t&&n.files&&(o+=n.files.map((function(e){return"\n".concat(e.url)}))),o&&(r[n.question||n.placeholder]=o)}else{(n.value||[]).forEach((function(t){var n=g(t,e),o=n.value,i=n.canSend;o&&i&&(r[t.question||t.placeholder||t.title]=o)}))}}))})),e.extraData&&Object.keys(e.extraData).forEach((function(t){r[t]=e.extraData[t]})),r};function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.pages||[],n=[];return t.forEach((function(e){(e.blocks||[]).forEach((function(e){if("contact"===e.type||"matrix"===e.type)return n.push(e),void(e.value||[]).forEach((function(e){n.push(e)}));n.push(e)}))})),n}var b=process.env.REACT_APP_NATIVE_FORMS,x={LOCATION_API_URL:"https://pro.ip-api.com/json/?key=kgNLgHSjzWRCLx5",NATIVE_FORMS_ADDRESS:"https://nativeforms.com",MAX_UPLOAD_FILES_NUMBER:20};"labs"===b&&(x.SERVER_URL="https://us-central1-nativeforms-labs.cloudfunctions.net/backend",x.STORAGE_URL="https://storage.googleapis.com/nativeforms-labs.appspot.com",x.STORAGE_BUCKET="nativeforms-labs.appspot.com",x.STRIPE_PUBLIC_KEY="pk_test_O1481hcamvg6uAOlTbh9vZ6M005tp15O8u"),"production"===b&&(x.SERVER_URL="https://us-central1-nativeforms-prod.cloudfunctions.net/backend",x.STORAGE_URL="https://storage.googleapis.com/nativeforms-prod.appspot.com",x.STORAGE_BUCKET="nativeforms-prod.appspot.com",x.STRIPE_PUBLIC_KEY="pk_live_9DHV2qfrpAgcSHqytMtd7tYo00KZzy04QP"),b||(x.SERVER_URL="https://us-central1-nativeforms-prod.cloudfunctions.net/backend",x.STORAGE_URL="https://storage.googleapis.com/nativeforms-prod.appspot.com",x.STORAGE_BUCKET="nativeforms-prod.appspot.com",x.STRIPE_PUBLIC_KEY="pk_live_9DHV2qfrpAgcSHqytMtd7tYo00KZzy04QP");var y=function(e,t){var n=e.map((function(e){return e.count})).reduce((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e+t}),0);return e.forEach((function(e){e.count?e.percent=Number.parseFloat(e.count/n*100).toFixed(t):e.percent=0})),e};function w(e){return Array.isArray(e)?function(e){for(var t=new Array(e.length),n=0;n<e.length;n++)t[n]=w(e[n]);return t}(e):"object"==typeof e?function(e){if(!e)return null;var t={};for(var n in e)t[n]=w(e[n]);return t}(e):e}function E(e){if(!e)return 0;if(0===e.length)return 0;var t=e[0],n=!0;return e.forEach((function(e,r){var o=e.count||0,i=t.count||0;o>i&&(t=e,n=!0),o===i&&0!==r&&(n=!1)})),n?(t.highest=!0,t.count):null}function k(e){for(var t=e.length,n=0;n<t;n++)for(var r=0;r<t-n-1;r++){if((e[r].count||0)<(e[r+1].count||0)){var o=Object.assign(e[r]);e[r]=e[r+1],e[r+1]=o}}return e}function S(e){var t,n;return a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,a.awrap(fetch(e.customSubmitFormURL,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({form:e})}));case 2:return t=r.sent,r.next=5,a.awrap(t.json());case 5:if(n=r.sent,t.ok){r.next=8;break}return r.abrupt("return",e);case 8:return r.abrupt("return",n);case 9:case"end":return r.stop()}}))}var C=function(e){var t,n,r,o,i,c,l,s,u,d,f,p;return a.async((function(m){for(;;)switch(m.prev=m.next){case 0:return t=e.parameters,n=void 0===t?{}:t,r=e.preview,o=e.search,i=e.queryParams,c=e.form,l=void 0===c?{}:c,s=n.l,u=n.f,d=void 0===u?"":u,f=JSON.stringify({license:s,slug:o,formName:d,preview:!!r,queryParams:i}),l.id&&(f=JSON.stringify({form:l})),m.next=6,a.awrap(fetch(x.SERVER_URL+"/form-inbox/opened",{method:"POST",headers:{"Content-Type":"application/json","Content-Security-Policy":"connect-src 'self' https://us-central1-nativeforms-prod.cloudfunctions.net"},body:f}));case 6:return p=m.sent,m.abrupt("return",p.json());case 8:case"end":return m.stop()}}))},N=function(e){var t,n,r;return a.async((function(o){for(;;)switch(o.prev=o.next){case 0:return t=e.license,n=e.formID,o.next=3,a.awrap(fetch(x.SERVER_URL+"/form-inbox/completed-form",{method:"POST",headers:{"Content-Type":"application/json","Content-Security-Policy":"connect-src 'self' https://us-central1-nativeforms-prod.cloudfunctions.net"},body:JSON.stringify({license:t,formID:n})}));case 3:return r=o.sent,o.abrupt("return",r.json());case 5:case"end":return o.stop()}}))},z=function(e,t){return t?{json:function(){}}:new Promise((function(t,n){fetch(e.customServerURL||"".concat(x.SERVER_URL,"/form-inbox/completed"),{method:"POST",headers:{"Content-Type":"application/json","Content-Security-Policy":"connect-src 'self' https://us-central1-nativeforms-prod.cloudfunctions.net"},body:JSON.stringify({license:e.license,formData:e})}).then((function(){t()})).catch((function(){C({form:e}).then((function(){t()})).catch((function(e){n(e)}))}))}))},T=function(e){var t,n,r,o,i,c,l;return a.async((function(s){for(;;)switch(s.prev=s.next){case 0:return t=e.form,n=e.fromDate,r=void 0===n?1:n,o=e.toDate,i=void 0===o?(new Date).getTime():o,c=t.customServerEndpoint||x.SERVER_URL,s.next=4,a.awrap(fetch(c+"/api/inbox",{method:"POST",headers:{"Content-Type":"application/json","Content-Security-Policy":"connect-src 'self' https://us-central1-nativeforms-prod.cloudfunctions.net"},body:JSON.stringify({license:t.license,form:t,fromDate:r,toDate:i})}));case 4:if(!(l=s.sent).ok){s.next=7;break}return s.abrupt("return",l.json());case 7:return s.abrupt("return",null);case 8:case"end":return s.stop()}}))},O=function(e){var t,n,r,o,i;return a.async((function(c){for(;;)switch(c.prev=c.next){case 0:return t=e.poll.includeAllQuestions,n={summary:[],total:0},c.next=4,a.awrap(T({form:e}));case 4:if(r=c.sent){c.next=7;break}return c.abrupt("return",n);case 7:return o=[],i=[],v(e).forEach((function(e){if(e.question&&"contact"!==e.type&&"files"!==e.type&&"image"!==e.type&&"video"!==e.type&&"stripe"!==e.type&&"description"!==e.type&&(t||"selection"===e.type))if(e.select){var n=e.select.map((function(e){return{name:e}}));i.push({question:e.question,answers:n,type:e.type||"selection"})}else if(e.answers)i.push({question:e.question,multipleValues:e.multiSelect,answers:e.answers.map((function(e){return{name:e.value}})),type:e.type||"selection"});else if("number-scale"!==e.type)"stars"!==e.type?i.push({question:e.question,answers:[],type:e.type||"contact"}):i.push({question:e.question,answers:[{name:"5 stars"},{name:"4 stars"},{name:"3 stars"},{name:"2 stars"},{name:"1 star"}],type:e.type});else{var r=(e.scale?f(e.scale):[1,2,3,4,5,6,7,8,9,10]).map((function(e){return{name:e}})).reverse();i.push({question:e.question,type:e.type,answers:r})}})),r.forEach((function(e){var t=h(e);Object.keys(t).forEach((function(e){var n=i.find((function(t){return t.question===e}));if(n){(n.multipleValues?t[e].split(", "):[t[e].toString()]).forEach((function(e){var t;"stars"===n.type&&(e="😠"===(t=e)?"1 star":"πŸ™"===t?"2 stars":"😐"===t?"3 stars":"πŸ˜ƒ"===t?"4 stars":"😍"===t?"5 stars":t);var r=n.answers.find((function(t){return t.name.toString()===e.toString()}));r?r.count?r.count+=1:r.count=1:n.answers.push({name:e,count:1})}))}})),o.push(e)})),i.forEach((function(e){var t=e.answers,n=e.type;"selection"===n&&"stars"===n&&"number-scale"===n||(e.answers=k(t).slice(0,10)),y(t,2);var r=E(t);r&&(e.highestValue=r)})),n.summary=w(i),n.total=r.length,c.abrupt("return",n);case 16:case"end":return c.stop()}}))},P=function(e){var t=e.size,r=e.color;return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:t||22,height:t||22,fill:r||"inherit",viewBox:"0 0 24 24"},n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),n.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))},_=function(e){var t=e.size,r=e.color;return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:t||16,height:t||16,fill:r||"inherit",viewBox:"0 0 24 24"},n.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),n.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}))},j=function(e){var t=e.size,r=e.selected;return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:t||16,height:t||16,fill:r?"#f6b745":"#eeeeee"},n.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),n.createElement("path",{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}),n.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))},q=function(e){var t=e.size,r=e.color;return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:t||26,height:t||26,fill:r||"inherit",viewBox:"0 0 24 24"},n.createElement("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"}),n.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))},L=function(){return n.createElement("svg",{viewBox:"0 0 18 18",width:"18",fill:"#ffffff",height:"18",xmlns:"http://www.w3.org/2000/svg"},n.createElement("path",{d:"m8.6 1.3-8.4 15a.5.5 0 0 0 .4.7h16.8a.5.5 0 0 0 .5-.5.5.5 0 0 0-.1-.2l-8.4-15a.5.5 0 0 0-.8 0ZM10 14.7a.3.3 0 0 1-.3.3H8.3a.3.3 0 0 1-.3-.3v-1.4a.3.3 0 0 1 .3-.3h1.4a.3.3 0 0 1 .3.3Zm0-3a.3.3 0 0 1-.3.3H8.3a.3.3 0 0 1-.3-.3v-6a.3.3 0 0 1 .3-.2h1.4a.3.3 0 0 1 .3.3Z"}))},M=function(){return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"72",height:"72",viewBox:"0 0 212 212"},n.createElement("path",{d:"M92 1a106 106 0 0 1 113 67 105 105 0 0 1 0 76 106 106 0 0 1-52 56 104 104 0 0 1-58 11 105 105 0 0 1-69-36 107 107 0 0 1-26-73 106 106 0 0 1 26-66A107 107 0 0 1 92 1m4 9a98 98 0 0 0-46 17 96 96 0 0 0-13 146 96 96 0 0 0 58 29 169 169 0 0 0 23 0 97 97 0 0 0 81-72c4-11 3-23 3-35a97 97 0 0 0-20-48c-8-10-17-19-28-25a97 97 0 0 0-58-12z",fill:"#f3617a"}),n.createElement("path",{d:"M101 44h9v100h-9V44zM101 154h9v13h-9v-13z",fill:"#EA1034"}))},R=function(){return n.createElement("svg",{width:"80",height:"80",viewBox:"0 0 128 128",xmlns:"http://www.w3.org/2000/svg"},n.createElement("path",{fill:"#b9d3b0",d:"M59.45 3.6a59.83 59.83 0 0145 15.08 60.03 60.03 0 0119.57 37.33 59.16 59.16 0 01-10.87 42.12 59.67 59.67 0 01-38.12 23.77 59.81 59.81 0 01-43.01-8.92A59.81 59.81 0 018.03 81.62a59.89 59.89 0 014.71-47.82C22.12 16.88 40.15 5.16 59.45 3.6m-3.26 5.58a54.31 54.31 0 00-33.93 20.15 54.12 54.12 0 00-10.18 45.44 54.31 54.31 0 0064.09 41.21 54.25 54.25 0 0035.49-25.27 54.31 54.31 0 00-17-73.45 54.55 54.55 0 00-38.47-8.08z"}),n.createElement("path",{fill:"#76a964",d:"M86.49 48.49c3.05-3.12 6.12-6.23 9.44-9.08 1.85.55 3.72 1.68 4.18 3.7.24 1.64-1.15 2.83-2.14 3.92-13.68 13.6-27.27 27.29-40.95 40.9a8.4 8.4 0 01-4.4-2.54c-5.99-6.05-12.07-12.02-18.03-18.09-3.27-2.42 1.42-8.29 4.3-5.15 5.96 5.46 11.27 11.6 17.4 16.88 9.72-10.51 20.17-20.33 30.2-30.54z"}))},I=function(){return n.createElement("svg",{width:"18",height:"36",viewBox:"0 0 102 207",xmlns:"http://www.w3.org/2000/svg"},n.createElement("g",{fill:"#444"},n.createElement("path",{d:"M41.81 77.81c3.03-4.59 5.51-9.56 9.06-13.79 3.93 5.25 7.03 11.05 10.6 16.54 3.29 5.52 7.2 10.68 9.96 16.51-13.81.38-27.64.33-41.44.03 3.58-6.65 7.91-12.84 11.82-19.29zM29.9 110.09c13.98-.17 27.96-.15 41.94 0-6.94 9.77-13.68 19.71-20.97 29.22-3.39-3.75-6.11-8.02-9.03-12.13-3.94-5.73-8.22-11.21-11.94-17.09z"})))},D=function(e){var t=e.size,r=void 0===t?24:t,o=e.fill,i=void 0===o?"inherit":o;return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:r,height:r,fill:i,viewBox:"0 0 24 24"},n.createElement("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),n.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}))},A=function(e){var t=e.size,r=void 0===t?24:t,o=e.fill,i=void 0===o?"inherit":o;return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:r,height:r,fill:i,viewBox:"0 0 24 24"},n.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),n.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}))},F=function(e){var t=e.size,r=void 0===t?18:t,o=e.fill,i=void 0===o?"inherit":o;return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:r,height:r,fill:i,viewBox:"0 0 24 24"},n.createElement("path",{d:"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"}),n.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))},B=function(e){var t=e.width,r=e.height,o=e.fill;return n.createElement("svg",{width:t,height:r,fill:o,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg"},n.createElement("path",{d:"M15.7 15.7A46.6 46.6 0 0147 4h162a46.6 46.6 0 0147 45.6v118a46.8 46.8 0 01-47.2 45.8c-.6 10.8 0 21.7-.2 32.5-1 7.1-10.8 10.7-16 5.6-9.5-8.9-18.8-18-28-27-5.8-6.2-14.1-10-22.6-9.9H51A47.1 47.1 0 010 171V49.5c.3-12.8 6-25.3 15.7-33.8m62.6 58.8C71.9 76 68 84 71 89.9c1.6 4.4 6.3 7 11 7.1h92c4.7 0 9.4-2.6 11-7.1 3.5-7-2.4-15.9-10-15.9H85c-2.2 0-4.6-.3-6.7.5m-.8 46.6a14.3 14.3 0 00-7.4 8.5v4.8c1.2 3.7 3.8 6.9 7.5 8.5 5.8.6 11.6.5 17.4.4 16.2-.2 32.3.5 48.5-.4 4-2 7.8-6 7.6-10.8.3-5-3.5-9-7.6-11-9.8-.8-19.6-.3-29.4-.4-12.2.1-24.4-.5-36.6.4z"}))},V=function(e){var t=e.size,r=void 0===t?24:t,o=e.fill,i=void 0===o?"inherit":o;return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:r,height:r,fill:i},n.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),n.createElement("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"}))},H=function(){return n.createElement("svg",{width:"24",height:"24",viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg"},n.createElement("path",{d:"M55.6 99.6c10.9-12.2 23-23.3 34.3-35 .3 17.1 0 34.3.1 51.4h75c0-17.2-.2-34.3.1-51.4 20.8 21.3 42.3 42 63.3 63.1-21.1 21-42.6 41.4-63.3 62.7-.3-16.8 0-33.6-.1-50.4H90c0 16.8.2 33.6-.1 50.4-5.3-5.2-10.2-10.7-16-15.4l-47-47.2c9.8-9 19-18.9 28.7-28.2z"}))},W=function(e){var t=e.size,r=void 0===t?24:t,o=e.fill,i=void 0===o?"inherit":o;return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:r,height:r,fill:i,viewBox:"0 0 512 512"},n.createElement("path",{d:"M290.4 13.2l-11.5 219 204.7-78.6A219.2 219.3 0 00290.4 13.2zM239 60.8A219.2 219.3 0 0038.6 206.2a219.2 219.3 0 0077.3 251 219.2 219.3 0 00262.5-3.1 219.2 219.3 0 0071.3-252.7L245.1 280l12.2-219a219.2 219.3 0 00-18.3-.2z"}))},U=function(e){var t=e.size,r=void 0===t?24:t,o=e.fill,i=void 0===o?"inherit":o;return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:r,height:r,fill:i,viewBox:"0 0 24 24"},n.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),n.createElement("path",{d:"M5 9.2h3V19H5zM10.6 5h2.8v14h-2.8zm5.6 8H19v6h-2.8z"}))},J=function(e){var t=e.size,r=void 0===t?22:t;return n.createElement("svg",{width:r,height:r,fill:"#8A96A3",viewBox:"1 1 14 14",xmlns:"http://www.w3.org/2000/svg"},n.createElement("path",{d:"M8 4a2 2 0 0 0-2 2v.5a2 2 0 1 0 4 0V6a2 2 0 0 0-2-2z"}),n.createElement("path",{d:"M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14zm-2.9-4.1-1 1A5.5 5.5 0 0 1 8 2.5a5.5 5.5 0 0 1 3.9 9.4l-1-1a3 3 0 0 0-2.1-.9H7.2a3 3 0 0 0-2 .9z",clipRule:"evenodd",fillRule:"evenodd"}))};function G(e){var t=e.error,r=e.form,o=(void 0===r?{}:r)||{},i=o.customErrorTitle,a=void 0===i?"Ooops":i,c=o.customErrorDescription,l=void 0===c?t:c;return n.createElement("div",{className:"nf-error-container"},n.createElement(M,null),n.createElement("span",{className:"nf-error-header"},a),n.createElement("span",{className:"nf-error-description"},l))}function Y(){return n.createElement("div",{className:"nf-loading-container"},n.createElement("div",{className:"nf-spinner-primary"}))}function X(){if(!window||!window.location)return!1;if(!window)return!1;try{return window.self!==window.top}catch(e){return!0}}var $=function(e,t){if(!e.isReactNative&&document){var n=document.getElementById("nf-form-container");if(e.isNativeSlides&&(n=document.getElementsByClassName("ns-root")[0]),n)if("form_loaded"!==t&&"form_font_loaded"!==t){var r=n.getBoundingClientRect();setTimeout((function(){var t=n.getBoundingClientRect();if(r.width!==t.width||r.height!==t.height){var o=JSON.stringify({nf_event:{event:"form_dimension_change",dimensions:JSON.stringify(n.getBoundingClientRect()),form:JSON.stringify(e)}});Z(o)}}))}else{var o=JSON.stringify({nf_event:{event:"form_dimension_change",dimensions:JSON.stringify(n.getBoundingClientRect()),form:JSON.stringify(e)}});Z(o)}}},Q=function(e){var t=JSON.stringify({nf_event:{event:"form_fetch_error",form:JSON.stringify(e)}});Z(t)},K=function(e,t){var n=JSON.stringify({nf_event:{event:"form_send",form:JSON.stringify(e),json:JSON.stringify(t)}});Z(n)},Z=function(e){try{window.ReactNativeWebView&&window.ReactNativeWebView.postMessage(e),window.postMessage&&window.postMessage(e,"*"),X()&&(window.parent&&window.parent.postMessage(e,"*"),window.opener&&window.opener.postMessage(e,"*"))}catch(e){}},ee={main:"#2200FF",error:"#EA1034",success:"#0F9D58",required:"#EA1034",add:"#007A5A",dropZone:"#b2eecb",border:"#ced6dd",white:"#ffffff",black:"#000000",darkgrey:"#424d57",grey:"#647384",lightgrey:"#9da6b2",placeholder:"#757575",toastError:"#C9242D",toastSuccess:"#1bb257",toastWarning:"#efa842",toastInfo:"#5ca8f5",primary:"#000000",disabled:"#E3E4E5",overlay:"rgba(0, 0, 0, 0.5)",highest:"#0D66D0",blue:"#0099FF"},te=function(e){window.gtag&&window.gtag("event","".concat(e.label," - Form Opened"),{event_category:e.label||"",event_label:e.formName||""})},ne=function(e){window.gtag&&window.gtag("event","".concat(e.label," - Form Completed"),{event_category:e.label||"",event_label:e.formName||""})},re={email:{label:"Email"},name:{label:"Name"},phone:{label:"Phone"},avatar:{label:"Avatar"},address:{label:"Address"},city:{label:"City"},state:{label:"State"},zip:{label:"Zip"},country:{label:"Country"},company:{label:"Company"},title:{label:"Title"},countryCode:{label:"Country Code"}},oe=["preview","template","complete","error"],ie="Form does not exist or the link is broken",ae=["https://storage.googleapis.com/nativeforms-prod.appspot.com/ratings/rating1.png","https://storage.googleapis.com/nativeforms-prod.appspot.com/ratings/rating2.png","https://storage.googleapis.com/nativeforms-prod.appspot.com/ratings/rating3.png","https://storage.googleapis.com/nativeforms-prod.appspot.com/ratings/rating4.png","https://storage.googleapis.com/nativeforms-prod.appspot.com/ratings/rating5.png"],ce=["Afghanistan","Γ…land Islands","Albania","Algeria","American Samoa","AndorrA","Angola","Anguilla","Antarctica","Antigua and Barbuda","Argentina","Armenia","Aruba","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Bouvet Island","Brazil","British Indian Ocean Territory","Brunei Darussalam","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Cayman Islands","Central African Republic","Chad","Chile","China","Christmas Island","Cocos (Keeling) Islands","Colombia","Comoros","Congo","Congo, The Democratic Republic of the","Cook Islands","Costa Rica","Cote D'Ivoire","Croatia","Cuba","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Ethiopia","Falkland Islands (Malvinas)","Faroe Islands","Fiji","Finland","France","French Guiana","French Polynesia","French Southern Territories","Gabon","Gambia","Georgia","Germany","Ghana","Gibraltar","Greece","Greenland","Grenada","Guadeloupe","Guam","Guatemala","Guernsey","Guinea","Guinea-Bissau","Guyana","Haiti","Heard Island and Mcdonald Islands","Holy See (Vatican City State)","Honduras","Hong Kong","Hungary","Iceland","India","Indonesia","Iran, Islamic Republic Of","Iraq","Ireland","Isle of Man","Israel","Italy","Jamaica","Japan","Jersey","Jordan","Kazakhstan","Kenya","Kiribati","Korea, Democratic People'S Republic of","Korea, Republic of","Kuwait","Kyrgyzstan","Lao People'S Democratic Republic","Latvia","Lebanon","Lesotho","Liberia","Libyan Arab Jamahiriya","Liechtenstein","Lithuania","Luxembourg","Macao","Macedonia, The Former Yugoslav Republic of","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Martinique","Mauritania","Mauritius","Mayotte","Mexico","Micronesia, Federated States of","Moldova, Republic of","Monaco","Mongolia","Montserrat","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepal","Netherlands","Netherlands Antilles","New Caledonia","New Zealand","Nicaragua","Niger","Nigeria","Niue","Norfolk Island","Northern Mariana Islands","Norway","Oman","Pakistan","Palau","Palestinian Territory, Occupied","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Pitcairn","Poland","Portugal","Puerto Rico","Qatar","Reunion","Romania","Russian Federation","RWANDA","Saint Helena","Saint Kitts and Nevis","Saint Lucia","Saint Pierre and Miquelon","Saint Vincent and the Grenadines","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia and Montenegro","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","South Georgia and the South Sandwich Islands","Spain","Sri Lanka","Sudan","Suriname","Svalbard and Jan Mayen","Swaziland","Sweden","Switzerland","Syrian Arab Republic","Taiwan, Province of China","Tajikistan","Tanzania, United Republic of","Thailand","Timor-Leste","Togo","Tokelau","Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Turks and Caicos Islands","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","United States Minor Outlying Islands","Uruguay","Uzbekistan","Vanuatu","Venezuela","Viet Nam","Virgin Islands, British","Virgin Islands, U.S.","Wallis and Futuna","Western Sahara","Yemen","Zambia","Zimbabwe"],le=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new Date(e),r=n.getDate(),o=ue(n.getMonth());t.customMonths&&t.customMonths[n.getMonth()]&&(o=t.customMonths[n.getMonth()]);var i=n.getFullYear();return r+" "+o+" "+i},se=function(e,t){return Array.isArray(e)?e.map((function(e){return le(e,t)})).join(", "):le(e,t)};function ue(e){return["January","February","March","April","May","June","July","August","September","October","November","December"][e]}function de(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e&&e.split(",")[1]?e.split(",")[1].substring(7):/\((.*)\)/.exec((new Date).toString())[1]}function fe(e){var t=e;try{t=decodeURIComponent(e)}catch(e){}return t}function pe(e){return e.match(/^\d+$/)}var me=["$"];function ge(e){var t=e.min,n=e.max,r=e.percentage,o=void 0===r?0:r,i=e.percentage2,a=void 0===i?0:i,c=e.rangeSelect,l=e.leftSide,s=e.parseToLocal;if(!n||!t)return c?"".concat(a,"% - ").concat(o,"%"):"".concat(o,"%");var u=t.toString(),d=n.toString();if(pe(u)&&pe(d)){var f=parseInt(u,10),p=parseInt(d,10),m=Math.round(f+o/100*(p-f)),g=Math.round(f+a/100*(p-f));return c?"".concat(g.toString()," - ").concat(m.toString()):m.toString()}var h=!!u.match(/\d/g)&&u.match(/\d/g).length>0,v=!!d.match(/\d/g)&&d.match(/\d/g).length>0;if(h&&v){var b=t.split("").filter((function(e){return!pe(e)})).join("");b.includes(",")&&(b=b.replace(/,/g,"")),b.includes(".")&&(b=b.replace(/\./g,""));var x=parseInt(u.match(/\d/g).join(""),10),y=parseInt(d.match(/\d/g).join(""),10),w=Math.round(x+o/100*(y-x)),E=Math.round(x+a/100*(y-x));return(u.includes(",")||d.includes(","))&&(s=!0),s&&(w=w.toLocaleString(),E=E.toLocaleString()),me.includes(b)||l?c?"".concat(b).concat(E," - ").concat(b).concat(w):"".concat(b).concat(w):c?"".concat(E).concat(b," - ").concat(w).concat(b):"".concat(w).concat(b)}return c?"".concat(a,"% - ").concat(o,"%"):"".concat(o,"%")}var he=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fe(e.toLowerCase())};function ve(e){if(!e)return{};var t=e.split("?")[1];if(!t)return{};var n=t.split("&"),r={};return n.forEach((function(e){e=e.split("="),r[e[0]]=fe(e[1]||"")})),JSON.parse(JSON.stringify(r))}var be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",xe=function(e){var t,n,r,o,i,a="",c="",l="",s=0;do{r=(t=e.charCodeAt(s++))>>2,o=(3&t)<<4|(n=e.charCodeAt(s++))>>4,i=(15&n)<<2|(c=e.charCodeAt(s++))>>6,l=63&c,isNaN(n)?i=l=64:isNaN(c)&&(l=64),a=a+be.charAt(r)+be.charAt(o)+be.charAt(i)+be.charAt(l),t=n=c="",r=o=i=l=""}while(s<e.length);return a},ye=function(e){var t,n,r,o,i="",a="",c="",l=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{t=be.indexOf(e.charAt(l++))<<2|(r=be.indexOf(e.charAt(l++)))>>4,n=(15&r)<<4|(o=be.indexOf(e.charAt(l++)))>>2,a=(3&o)<<6|(c=be.indexOf(e.charAt(l++))),i+=String.fromCharCode(t),64!=o&&(i+=String.fromCharCode(n)),64!=c&&(i+=String.fromCharCode(a)),t=n=a="",r=o=c=""}while(l<e.length);return i};function we(e){var t,n,r,o=ye(Ee(e));return t=o.replace(/\0/g,""),n=t.split("&"),r={},n.forEach((function(e){e=e.split("="),r[e[0]]=fe(e[1]||"")})),JSON.parse(JSON.stringify(r))}function Ee(e){return e.split("").reverse().join("")}function ke(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!e)return{};var n=e.split("/")[3];if(t){var r=we(n);return{parameters:r,search:t}}if(n||(n=e.split("/")[1]),!n)return{};-1!==n.indexOf("?")&&(n=n.substring(0,n.indexOf("?"))),-1!==n.indexOf("#")&&(n=n.substring(0,n.indexOf("#")));var o=we(n);return{parameters:o,search:n}}var Se=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.toLowerCase();return"name"===t||"your name"===t||"first name"===t||"full name"===t?"name":t.includes("email")||t.includes("mail")?"email":t.includes("phone")?"tel":t.includes("address")?"address":t.includes("city")?"city":t.includes("state")?"state":t.includes("zip")?"zip":t.includes("country")?"country":void 0};function Ce(e){var t=e.title,r=e.form,o=e.onClose,i=e.borderRadius,a=void 0===i?0:i,c=r||{},l=c.headerBackgroundColor,s=void 0===l?ee.white:l,u=c.headerTextColor,d=void 0===u?ee.primary:u,f=c.headerTitle||t||"",p={backgroundColor:s,borderBottomColor:ee.border,borderTopLeftRadius:a,borderTopRightRadius:a},m={color:d};return n.createElement("div",{className:"nf-header-container",style:p},n.createElement("span",{className:"nf-header",style:m},f),n.createElement("div",{className:"nf-header-close",onClick:o},n.createElement(P,{color:d,size:20})))}var Ne=function(e,t){return function(n){return n.replace(e,t)}},ze=Ne(/\[([^\[]+)\]\(([^\)]+)\)/g,(function(e,t,n){return'<a style="cursor: pointer; color: #2200ff; text-decoration: none; font-weight: 500;" target="_blank" rel="noopener noreferrer" href="'+n+'">'+t+"</a>"})),Te=Ne(/\n(#+\s*)(.*)/g,(function(e,t,n){return"\n<h"+t.trim().length+' style="padding: 0; margin: 8px 0;">'+n+"</h"+t.trim().length+">"})),Oe=Ne(/(\*{1,2})(.*?)\1/g,(function(e,t,n){return"<"+(1===t.trim().length?"em":"strong")+">"+n+"</"+(1===t.trim().length?"em":"strong")+">"})),Pe=function(e){return e?function(e){return Oe(Te(ze(e)))}(e):""};function _e(e){var t,r,o=e.form,i=e.status,a=e.style,c=o||{},l=c.textColor,u=void 0===l?ee.primary:l,d=c.backgroundColor,f=void 0===d?ee.white:d,p=c.submitScreenAction,m=o.type,g=o.complete||{};switch(i){case"preview":case"template":case"complete":t=g.title,r=g.description;break;case"error":m="error",t="Ooops",r="Something went wrong."}var h=s({paddingTop:80,paddingBottom:80,paddingLeft:20,paddingRight:20},a);return n.createElement("div",{className:"nf-status-container",style:{backgroundColor:f}},n.createElement("div",{className:"nf-status-wrapper",style:h},n.createElement("div",{className:"nf-status-icon-wrapper"},"error"!==m?n.createElement(R,null):n.createElement(M,null)),n.createElement("span",{dangerouslySetInnerHTML:{__html:Pe(t)},className:"nf-status-header",style:{color:u}}),n.createElement("span",{dangerouslySetInnerHTML:{__html:Pe(r)},className:"nf-status-description",style:{color:u}}),p&&n.createElement("a",{href:p.url,className:"nf-submit-screen-action"},p.label," ",p.label&&n.createElement(A,{size:20,fill:ee.main}))))}function je(e){var t=e.form,r=t||{},o=r.backgroundColor,i=void 0===o?ee.white:o,a=r.theme,c=t.poweredBy||{},l=t.source||"unknown",s=c.color||("dark"===a?ee.white:ee.main),u=c.link||"".concat(x.NATIVE_FORMS_ADDRESS,"?utm_source=powered_by&utm_medium=").concat(l).concat(t.license?"&utm_campaign=".concat(t.license):"");return n.createElement("div",{className:"nf-powered-by-container",style:{backgroundColor:i}},n.createElement("a",{tabIndex:"-1",href:u,rel:"noopener noreferrer",className:"nf-link",target:"_blank",style:{textDecoration:"none",fontSize:10,color:"dark"===a?ee.white:ee.primary}},n.createElement("span",{style:{fontSize:10,color:"dark"===a?ee.white:ee.primary,fontWeight:400}},"Powered by"," ",c.company?n.createElement("strong",{style:{color:s}},c.company):n.createElement(n.Fragment,null,n.createElement("strong",{style:{color:s}},"NativeForms")))))}var qe=function(e){var t=e.href,r=e.label,o=e.style;return n.createElement("a",{className:"nf-link",onClick:function(e){t&&e.stopPropagation()},style:o,href:t,rel:"noopener noreferrer",target:"_blank"},r)};function Le(e){var r=e.form,o=e.isPreview,i=r||{},a=i.color,c=void 0===a?ee.main:a,l=i.textColor,s=void 0===l?ee.primary:l,d=i.backgroundColor,f=void 0===d?ee.white:d,p=i.legal,m=i.theme,g=p||{},h=g.terms,v=g.policy,b=g.customLegal,x=g.error,y=u(t.useState(!!p.acceptedAt),2),w=y[0],E=y[1],k={backgroundColor:w?c:f,borderColor:x?ee.error:w?"transparent":"dark"===m?ee.white:ee.lightgrey,borderWidth:1,borderStyle:"solid"},S={fontSize:14,lineHeight:"22px",color:s},C={fontSize:14,fontWeight:"500",lineHeight:"22px",color:c};return n.createElement("div",{className:"nf-policy-wrapper",id:"nf-policy-terms"},n.createElement("div",{onClick:function(){o||(p.acceptedAt?(delete p.acceptedAt,delete p.acceptedTimestamp,r.extraData=r.extraData||{},delete r.extraData["Terms and Policy accepted at"],E(!1)):(p.acceptedAt=(new Date).toString(),p.acceptedTimestamp=(new Date).getTime(),r.extraData=r.extraData||{},r.extraData["Terms and Policy accepted at"]=p.acceptedAt,delete r.legal.error,E(!0)))},className:"nf-policy-container"},n.createElement("div",{className:"nf-policy-checkbox",style:k},w&&n.createElement(_,{size:14,color:ee.white})),n.createElement("div",{className:"nf-policy-text"},b?n.createElement("span",{style:S,dangerouslySetInnerHTML:{__html:Pe(b)}}):n.createElement(n.Fragment,null,n.createElement("span",{style:S},"By completing this form you agree to our"," "),n.createElement(qe,{href:h,style:C,label:"Terms & Conditions"}),n.createElement("span",{style:S}," and "),n.createElement(qe,{href:v,style:C,label:"Privacy Policy."})))),x&&n.createElement("span",{className:"nf-policy-terms-error"},r.legal.customError||"Accepting our terms and policy is required."))}var Me=".nf-policy-wrapper{display:flex;flex-direction:column;width:100%;max-width:600px;box-sizing:border-box;padding:4px 28px 20px 28px}.nf-policy-container{width:100%;display:flex;flex-direction:row;align-self:flex-start;align-items:center;cursor:pointer;transition:opacity .2s ease-out}.nf-policy-container:active{opacity:.7}.nf-policy-checkbox{display:flex;flex-shrink: 0;flex-direction:column;align-items:center;justify-content:center;width:18px;height:18px;border-radius:2px;}.nf-policy-text{flex-direction:row;flex-wrap:wrap;align-items:flex-start;justify-content:flex-start;max-width:84%;margin: 0 16px}.nf-policy-terms-error{font-size:13px;line-height:1.4;color:".concat(ee.error,";box-sizing:border-box;padding: 10px 0 0 0}");function Re(e){var t=e.children,r=e.id;return n.createElement("div",{className:"nf-question".concat(r?" question-".concat(r):"")},t)}function Ie(e,t,n){if(!e)return!0;var r,o=e.blocks||[],i=!0,a=!1,c=!1;return o.forEach((function(e){n&&function(e,t){"contact"!==e.type?"matrix"!==e.type?"open"!==e.type?!!e.isRequired&&(!!m(t,e.question||e.placeholder)&&!e.value)&&(e.error=e.error||e.requiredError||t.requiredError||"This question is required."):!!e.isRequired&&(!!m(t,e.question||e.placeholder)&&!e.value)&&(e.error=e.error||e.requiredError||t.requiredError||"This field is required."):(e.value||[]).forEach((function(e){!!e.isRequired&&(!!m(t,e.question||e.placeholder)&&!e.value)&&(e.error=e.requiredError||t.requiredError||"This row is required.")})):(e.value||[]).forEach((function(e){!!e.isRequired&&(!!m(t,e.question||e.placeholder)&&!e.value)&&(e.error=e.requiredError||t.requiredError||"This field is required.")}))}(e,t);var o=g(e,t),l=o.canSend,s=o.value,u=o.error;u&&(r||(r=u.id?u.id:e.id),c=!0),!a&&s&&(a=!0),l||(i=!1)})),{isCompleted:i,hasValues:a,hasError:c,firstErrorQuestionID:r}}function De(e){var t=e.progress,r=e.max,o=e.color,i=e.textColor,a=e.showFormProgressCount,c=Math.round(t/r*100),l={backgroundColor:"".concat(o,"22")},s={backgroundColor:o,width:"".concat(c,"%")};return n.createElement("div",{className:"nf-progress-container"},n.createElement("span",{className:"nf-progress-text",style:{color:i}},a?"".concat(t," / ").concat(r):"".concat(c||0,"%")),n.createElement("div",{className:"nf-progress-line-container",style:l},n.createElement("div",{className:"nf-progress-line",style:s})))}function Ae(e,t,n){var r=e.pagesStack||e.pages||[],o=e.countOnlyMandatory,i=[];return r.forEach((function(r){"number"==typeof r&&(r=e.pages[r]),r.blocks&&r.blocks.forEach((function(r){if(!t||"image"!==r.type&&"description"!==r.type&&"video"!==r.type)if("contact"===r.type||!n&&"matrix"===r.type)(r.value||[]).forEach((function(t){if(m(e,r.question||r.placeholder)&&m(e,t.question||t.placeholder)){if(!t.isRequired&&o)return;i.push(t)}}));else if(m(e,r.question||r.placeholder)){if(!r.isRequired&&o)return;i.push(r)}}))})),i}function Fe(e){var r=e.form,o=e.changePageIndex,i=e.currentPage,a=e.isSending,c=e.uploadingProgress,l=e.isLastPage,s=r.color,u=void 0===s?ee.main:s,d=r.backgroundColor,f=void 0===d?ee.white:d,p=r.textColor,m=void 0===p?ee.primary:p,h=r.submitTextColor,v=void 0===h?ee.white:h,b=r.showFormProgressCount,x=r.poweredBy,y=r.leftArrowText,w=r.rightArrowText,E=r.rightArrowSendText,k=window.innerWidth<=600,S="quiz"===a,C=0===i;r.pagesStack&&(C=r.pagesStack[0]===i);var N=function(e){if(r.pagesStack){var t=r.pagesStack.indexOf(i);if("back"===e){var n=r.pagesStack[t-1];o(n,"back")}if("forward"===e){var a=r.pagesStack[t+1];o(a,a?"forward":"send")}}else"back"===e&&o(i-1),"forward"===e&&o(i+1)};t.useEffect((function(){var e=function(e){var t=e.target.nodeName.toLowerCase();return"input"===t||"textarea"===t||"select"===t||(37===e.keyCode?N("back"):39===e.keyCode&&(l||N("forward"))),!0};return document.addEventListener("keyup",e,!0),function(){document.removeEventListener("keyup",e,!0)}}),[o,l]);var z=Ae(r,!0).length,T=function(e){var t=0,n=e.countOnlyMandatory;return(e.pagesStack||e.pages||[]).forEach((function(r){"number"==typeof r&&(r=e.pages[r]),(r.blocks||[]).forEach((function(e){if("contact"!==e.type&&"matrix"!==e.type){var r=g(e),o=r.value,i=r.canSend;if(o&&i){if(!e.isRequired&&n)return;t++}}else{(e.value||[]).forEach((function(e){var r=g(e),o=r.value,i=r.canSend;if(o&&i){if(!e.isRequired&&n)return;t++}}))}}))})),t}(r),O=Ie(r.pages[i],r),P=O.isCompleted,_=O.hasError,j=P&&!_,q={opacity:a?.8:1,border:"1px solid ".concat(ee.border),backgroundColor:f,fill:0===i?ee.disabled:m},L={opacity:a?.8:1,border:"1px solid ".concat(l&&j?u:ee.border),backgroundColor:j&&l?u:f,fill:j?l?v:m:ee.disabled};return S&&(q.opacity=1,L.opacity=1,L.border="1px solid ".concat(ee.border),L.fill=l?ee.disabled:m,L.backgroundColor=f,l&&(L.display="none")),n.createElement("div",{className:"nf-page-controller",style:{paddingBottom:"hide"===x?24:16}},!C&&n.createElement("button",{key:"back",type:"button",onClick:function(){N("back")},className:"nf-arrow-button nf-left-arrow-button",style:q},n.createElement(D,null),y&&n.createElement("span",{className:"nf-arrow-left-text",style:{lineHeight:1,fontSize:k?13:14,color:0===i?ee.disabled:m,paddingRight:"4px",paddingLeft:"2px"}},y)),n.createElement(De,{color:u,textColor:m,progress:T,max:z,showFormProgressCount:b}),n.createElement("button",{key:l?"submit":"next",type:"button",onClick:function(){N("forward")},className:"nf-arrow-button nf-right-arrow-button",style:L},a?n.createElement(n.Fragment,null,S?n.createElement(n.Fragment,null,w&&n.createElement("span",{className:"nf-arrow-right-text",style:{lineHeight:1,fontSize:k?13:14,paddingRight:"2px",paddingLeft:"4px",color:j?l?v:m:ee.disabled}},w),n.createElement(A,null)):"sending_files"===a?n.createElement("span",{className:"nf-arrow-right-text",style:{lineHeight:1,color:v,fontSize:k?13:14,fontWeight:"bold"}},c,"%"):n.createElement("div",{className:"nf-spinner"})):l?n.createElement(n.Fragment,null,E&&n.createElement("span",{className:"nf-arrow-right-submit-text",style:{lineHeight:1,fontSize:k?13:14,paddingRight:"8px",paddingLeft:"4px",fontWeight:"bold",color:j?l?v:m:ee.disabled}},E),n.createElement(F,null)):n.createElement(n.Fragment,null,w&&n.createElement("span",{className:"nf-arrow-right-text",style:{lineHeight:1,fontSize:k?13:14,paddingRight:"2px",paddingLeft:"4px",color:j?l?v:m:ee.disabled}},w),n.createElement(A,null))))}var Be=n.lazy((function(){return new Promise((function(e){e(require("./index-c9013c52.js"))}))}));function Ve(e){var r=e.form,o=e.isPreview,i=r||{},a=i.textColor,c=void 0===a?ee.primary:a,l=i.backgroundColor,s=void 0===l?ee.white:l,d=i.theme,f=i.signature,p=f.label,m=f.error,g=t.useRef(),h=u(t.useState(),2),v=h[0],b=h[1];t.useEffect((function(){o&&g.current&&f.points&&g.current.fromData(JSON.parse(f.points))}),[o,g,f]);var x={position:"relative",backgroundColor:s,borderColor:"dark"===d?ee.white:ee.lightgrey,borderWidth:1,borderStyle:"solid",borderRadius:8};m&&(x.borderColor=ee.error);return n.createElement("div",{className:"nf-signature-wrapper",id:"nf-signature"},n.createElement("div",{className:"nf-signature-container"},p&&n.createElement("span",{style:{color:c,fontSize:13.5,lineHeight:1.5,fontWeight:"500",boxSizing:"border-box",padding:"8px 4px"}},p," ",n.createElement("span",{style:{fontSize:13.5,fontWeight:"bold",color:ee.required}},"*")),n.createElement("div",{className:"nf-signature",style:x},!o&&n.createElement("div",{style:{position:"absolute",top:6,right:6,opacity:.5,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},onClick:function(e){e.stopPropagation(),e.preventDefault(),g.current.clear(),delete f.points,delete f.signedTimestamp,r.extraData=r.extraData||{},delete r.extraData["Form signed at"],v&&b(!1)}},n.createElement(P,{size:20,color:c})),n.createElement(t.Suspense,{fallback:n.createElement("div",{style:{height:127}})},n.createElement(Be,{ref:g,onEnd:function(){f.points=JSON.stringify(g.current.toData()),f.signedTimestamp=(new Date).getTime(),r.extraData=r.extraData||{},r.extraData["Form signed at"]=(new Date).toString(),delete f.error,b(!0)},penColor:c,canvasProps:{width:300,height:120}})),o&&n.createElement("div",{onClick:function(e){e.stopPropagation(),e.preventDefault()},style:{blinder:{position:"absolute",top:0,bottom:0,right:0,left:0,width:"100%",height:"100%",zIndex:1}}}))),m&&n.createElement("span",{className:"nf-signature-error"},r.signature.customError||"Signing the form is required."))}var He=".nf-signature-wrapper{display:flex;flex-direction:column;width:100%;max-width:600px;box-sizing:border-box;padding:4px 12px 24px 24px}.nf-signature-container{display:flex;flex-direction:column;align-self:flex-start;align-items:flex-start;justify-content:flex-start;cursor:pointer;transition:opacity .2s ease-out}.nf-signature-error{font-size:13px;line-height:1.4;color:".concat(ee.error,";box-sizing:border-box;padding: 10px 4px 0 4px}");function We(e){var r=e.form,o=e.isPreview,i=r.customRecaptchaText,a=r.recaptchaError,c=u(t.useState(o),2),l=c[0],s=c[1];return n.createElement("div",{className:"nf-recaptcha-container",id:"nf-recaptcha"},n.createElement("div",{className:"nf-recaptcha-wrapper",style:{borderColor:a?ee.error:"#d3d3d3"}},l?n.createElement("div",{className:"nf-recaptcha-accepted"},n.createElement(_,{size:26,color:ee.success})):n.createElement("div",{onClick:function(){l||(r.acceptedRecaptcha=(new Date).getTime(),delete r.recaptchaError,s(!0))},className:"nf-recaptcha-checkbox",style:{borderColor:a?ee.error:"#c1c1c1"}}),n.createElement("span",{style:{colo