(self.AMP=self.AMP||[]).push({m:1,v:"2202072236000",n:"amp-form",ev:"0.1",l:!0,f:function(t,e){(()=>{function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i=t.length?{done:!0}:{done:!1,value:t[s++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n;function s(){return n||(n=Promise.resolve(void 0))}var r=class{constructor(){this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}};function o(t){return new Promise((e=>{e(t())}))}function a(t){return t?Array.prototype.slice.call(t):[]}var{isArray:c}=Array,{hasOwnProperty:u,toString:h}=Object.prototype;function l(t){return"[object Object]"===h.call(t)}function f(t){const e=Object.create(null);return t&&Object.assign(e,t),e}function d(t,e){return u.call(t,e)}function m(t,e,i,n,s,r,o,a,c,u,h){return t}var p="amp:dom-update",_="amp:form-value-change",b="name";function A(t){return(t.ownerDocument||t).defaultView}function P(t){return CSS.escape(t)}function v(t){m(/^[\w-]+$/.test(t))}function E(t,e){return v(e),e=e.toUpperCase(),function(t,i){const n=[];for(let i=t.parentElement;i;i=i.parentElement)i.tagName==e&&n.push(i);return n}(t)}function T(t){var e;null===(e=t.parentElement)||void 0===e||e.removeChild(t)}function y(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function g(t,e){const{length:i}=t;for(let n=0;n{t.selected&&i[u].push(t.value)})):i[u].push(d))}const o=V(t);if(null!=o&&o.name){const{name:t,value:e}=o;void 0===i[t]&&(i[t]=[]),i[t].push(e)}return Object.keys(i).forEach((t=>{0==i[t].length&&delete i[t]})),i}function V(t){const{elements:e}=t,{activeElement:i}=t.ownerDocument,n=a(e).filter(w);return n.includes(i)?i:n[0]||null}function w(t){const{tagName:e,type:i}=t;return"BUTTON"==e||"submit"==i}function x(t){return t.disabled||E(t,"fieldset").some((t=>t.disabled))}function M(t){const e=t,i=t;switch(t.type){case"select-multiple":case"select-one":return a(e.options).every((({defaultSelected:t,selected:e})=>e===t));case"checkbox":case"radio":const{checked:t,defaultChecked:n}=i;return t===n;default:const{defaultValue:s,value:r}=i;return r===s}}var S=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;function O(t,e=""){try{return decodeURIComponent(t)}catch(t){return e}}function j(t){const e=f();if(!t)return e;let i;for(;i=S.exec(t);){const t=O(i[1],i[1]),n=i[2]?O(i[2].replace(/\+/g," "),i[2]):"";e[t]=n}return e}var F=self.AMP_CONFIG||{},$=("string"==typeof F.thirdPartyFrameRegex?new RegExp(F.thirdPartyFrameRegex):F.thirdPartyFrameRegex)||/^d-\d+\.ampproject\.net$/,k=("string"==typeof F.cdnProxyRegex?new RegExp(F.cdnProxyRegex):F.cdnProxyRegex)||/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org$/;function N(t){if(!self.document||!self.document.head)return null;if(self.location&&k.test(self.location.origin))return null;const e=self.document.head.querySelector(`meta[name="${t}"]`);return e&&e.getAttribute("content")||null}var X={thirdParty:F.thirdPartyUrl||"https://3p.ampproject.net",thirdPartyFrameHost:F.thirdPartyFrameHost||"ampproject.net",thirdPartyFrameRegex:$,cdn:F.cdnUrl||N("runtime-host")||"https://cdn.ampproject.org",cdnProxyRegex:k,localhostRegex:/^https?:\/\/localhost(:\d+)?$/,errorReporting:F.errorReportingUrl||"https://us-central1-amp-error-reporting.cloudfunctions.net/r",betaErrorReporting:F.betaErrorReportingUrl||"https://us-central1-amp-error-reporting.cloudfunctions.net/r-beta",localDev:F.localDev||!1,trustedViewerHosts:[/(^|\.)google\.(com?|[a-z]{2}|com?\.[a-z]{2}|cat)$/,/(^|\.)gmail\.(com|dev)$/],geoApi:F.geoApiUrl||N("amp-geo-api")};self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var D=self.__AMP_LOG;function C(t,e){throw new Error("failed to call initLogConstructor")}function U(t){return D.user||(D.user=H()),function(t,e){return e&&e.ownerDocument.defaultView!=t}(D.user.win,t)?D.userForEmbed||(D.userForEmbed=H()):D.user}function H(t){return C()}function z(){return D.dev||(D.dev=C())}function L(t,e,i,n,s,r,o,a,c,u,h){return t}function G(t,e,i,n,s,r,o,a,c,u,h){return U().assert(t,e,i,n,s,r,o,a,c,u,h)}function q(t,e){return Q(t=function(t){return t.__AMP_TOP||(t.__AMP_TOP=t)}(t),e)}function B(t,e){return Q(Z(Y(t)),e)}function J(t,e){const i=Z(Y(t));return it(i,e)?Q(i,e):null}function W(t,e){return function(t,e){const i=tt(t,e);if(i)return i;const n=et(t);return n[e]=function(){const t=new r,{promise:e,reject:i,resolve:n}=t;return e.catch((()=>{})),{obj:null,promise:e,resolve:n,reject:i,context:null,ctor:null}}(),n[e].promise}(Z(t),e)}function K(t,e){return tt(Z(t),e)}function Y(t){return t.nodeType?(e=A(t),q(e,"ampdoc")).getAmpDoc(t):t;var e}function Z(t){const e=Y(t);return e.isSingleDoc()?e.win:e}function Q(t,e){L(it(t,e));const i=et(t)[e];return i.obj||(L(i.ctor),L(i.context),i.obj=new i.ctor(i.context),L(i.obj),i.context=null,i.resolve&&i.resolve(i.obj)),i.obj}function tt(t,e){const i=et(t)[e];return i?i.promise?i.promise:(Q(t,e),i.promise=Promise.resolve(i.obj)):null}function et(t){let e=t.__AMP_SERVICES;return e||(e=t.__AMP_SERVICES={}),e}function it(t,e){const i=t.__AMP_SERVICES&&t.__AMP_SERVICES[e];return!(!i||!i.ctor)}function nt(t,e,i,n){const s=K(t,e);if(s)return s;const r=Y(t);return r.whenExtensionsKnown().then((()=>{const t=r.getExtensionVersion(i);return t?q(r.win,"extensions").waitForExtension(i,t):null})).then((i=>i?n?K(t,e):W(t,e):null))}var st,rt=t=>Y(t),ot=t=>B(t,"mutator"),at=t=>J(t,"url"),ct=t=>B(t,"viewport");function ut(t,e,i,n){let s=t,r=i,o=t=>{try{return r(t)}catch(t){var e,i;throw null===(e=(i=self).__AMP_REPORT_ERROR)||void 0===e||e.call(i,t),t}};const a=function(){if(void 0!==st)return st;st=!1;try{const t={get capture(){return st=!0,!1}};self.addEventListener("test-options",null,t),self.removeEventListener("test-options",null,t)}catch(t){}return st}(),c=!(null==n||!n.capture);return s.addEventListener(e,o,a?n:c),()=>{null==s||s.removeEventListener(e,o,a?n:c),r=null,s=null,o=null}}function ht(t,e,i,n){const s={detail:i};return Object.assign(s,n),new t.CustomEvent(e,s)}function lt(t,e,i,n){return ut(t,e,i,n)}function ft(t,e,i,n){let s;const r=new Promise((n=>{s=function(t,e,i,n){let s=i;const r=ut(t,e,(t=>{try{s(t)}finally{s=null,r()}}),n);return r}(t,e,n,i)}));return r.then(s,s),n&&n(s),r}function dt(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function mt(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function pt(t,e){const i=q(t,"platform");return i.isIos()&&11==i.getMajorVersion()?new Pt(e):FormData.prototype.entries&&FormData.prototype.delete?new At(e):new bt(e)}var _t,bt=class{constructor(t){this.XF=t?R(t):f()}append(t,e,i){const n=String(t);this.XF[n]=this.XF[n]||[],this.XF[n].push(String(e))}delete(t){delete this.XF[t]}entries(){const t=[];Object.keys(this.XF).forEach((e=>{this.XF[e].forEach((i=>t.push([e,i])))}));let e=0;return{next:()=>e{this.XF[e].forEach((i=>t.append(e,i)))})),t}},At=class{constructor(t){this.GF=new FormData(t),this.qF(t)}qF(t){if(!t)return;const e=V(t);e&&e.name&&this.append(e.name,e.value)}append(t,e,i){this.GF.append(t,e)}delete(t){this.GF.delete(t)}entries(){return this.GF.entries()}getFormData(){return this.GF}},Pt=class extends At{constructor(t){super(t),t&&g(t.elements,(t=>{"file"==t.type&&0==t.files.length&&(this.GF.delete(t.name),this.GF.append(t.name,new Blob([]),""))}))}append(t,e,i){var n;e&&"object"==typeof e&&""==(n=e).name&&0==n.size?this.GF.append(t,new Blob([]),i||""):this.GF.append(t,e)}},vt=new Set(["c","v","a","ad"]),Et="__amp_source_origin",Tt=t=>"string"==typeof t?yt(t):t;function yt(t,e){return _t||(_t=self.document.createElement("a")),function(t,e,i){return t.href="",new URL(e,t.href)}(_t,t)}function gt(t,e,i){if(!e)return t;const n=t.split("#",2),s=n[0].split("?",2);let r=s[0]+(s[1]?i?`?${e}&${s[1]}`:`?${s[1]}&${e}`:`?${e}`);return r+=n[1]?`#${n[1]}`:"",r}function It(t,e){return`${encodeURIComponent(t)}=${encodeURIComponent(e)}`}function Rt(t){const e=[];for(const n in t){let s=t[n];if(null!=s){s=c(i=s)?i:[i];for(let t=0;t"","getPropertyValue":()=>""};function jt(t,e,i,n,s){const r=function(t,e,i){if(Nt(e))return e;wt||(wt=f());let n=wt[e];if(!n||i){if(n=e,void 0===t[e]){const i=function(t){return t.charAt(0).toUpperCase()+t.slice(1)}(e),s=function(t,e){for(let i=0;i{const n=e.querySelector("textarea[autoexpand]");if(!n||i)return!n&&i?(i.dispose(),void(i=null)):void 0;i=new Dt(t)};lt(e,p,n),n()}constructor(t){const e=t.getRootNode();this.hm=e.ownerDocument||e,this.i=L(this.hm.defaultView),this.aa=ct(t),this.R_=[],this.R_.push(lt(e,"input",(t=>{const e=t.target;"TEXTAREA"==e.tagName&&e.hasAttribute(Xt)&&Ct(e)}))),this.R_.push(lt(e,"mousedown",(t=>{if(1!=t.which)return;const e=t.target;"TEXTAREA"==e.tagName&&function(t){const e=ot(t);Promise.all([e.measureElement((()=>t.scrollHeight)),ft(t,"mouseup")]).then((i=>{const n=i[0];let s=0;return e.measureMutateElement(t,(()=>{s=t.scrollHeight}),(()=>{!function(t,e,i){e!=i&&t.removeAttribute(Xt)}(t,n,s)}))}))}(e)})));let i=e.querySelectorAll("textarea");this.R_.push(lt(e,p,(()=>{i=e.querySelectorAll("textarea")})));const n=function(t,e,i){let n=0,s=null;function r(i){s=null,n=t.setTimeout(o,100),e.apply(null,i)}function o(){n=0,s&&r(s)}return function(...t){n?s=t:r(t)}}(this.i,(t=>{t.relayoutAll&&g(i,(t=>{"TEXTAREA"==t.tagName&&t.hasAttribute(Xt)&&Ct(t)}))}));var s;this.R_.push(this.aa.onResize(n)),s=i,Promise.all(a(s).map((t=>function(t){return ot(t).measureElement((()=>t.scrollHeight>t.clientHeight))}(t).then((e=>{e&&t.removeAttribute(Xt)})))))}dispose(){this.R_.forEach((t=>t()))}};function Ct(t){const e=ot(t),i=L(t.ownerDocument.defaultView);let n=0,s=0,r=0;const o=function(t){const e=L(t.ownerDocument),i=L(e.defaultView),n=L(e.body),s=ot(t),r=t.cloneNode(!1);r.classList.add("i-amphtml-textarea-clone");let o=0,a=0,c=!1;return s.measureMutateElement(n,(()=>{const e=kt(i,t),n=parseInt(e.getPropertyValue("max-height"),10);o=parseInt(e.getPropertyValue("width"),10),c=isNaN(n)||t.scrollHeight{c&&(t.scrollTop=0),jt(r,"width",$t(o)),e.body.appendChild(r)})).then((()=>s.measureMutateElement(n,(()=>{a=r.scrollHeight}),(()=>{T(r)})))).then((()=>a))}(t);return e.measureMutateElement(t,(()=>{const e=kt(i,t);s=t.scrollHeight;const o=parseInt(e.getPropertyValue("max-height"),10);r=isNaN(o)?1/0:o,n="content-box"==e.getPropertyValue("box-sizing")?-parseInt(e.getPropertyValue("padding-top"),10)-parseInt(e.getPropertyValue("padding-bottom"),10):parseInt(e.getPropertyValue("border-top-width"),10)+parseInt(e.getPropertyValue("border-bottom-width"),10)}),(()=>o.then((e=>{const o=e+n;t.classList.toggle("i-amphtml-textarea-max",o>r);const a="iAmphtmlHasExpanded"in t.dataset,c=/google/i.test(i.navigator.vendor)?3:0;(a||s<=e+c)&&(t.dataset.iAmphtmlHasExpanded="",jt(t,"height",$t(e+n)))}))))}var Ut={"INPUT":!0,"SELECT":!0,"TEXTAREA":!0},Ht="submit",zt=1,Lt=2,Gt=1,qt=2,Bt=3,Jt={"acceptCharset":{access:zt,attr:"accept-charset"},"accessKey":{access:zt,attr:"accesskey"},"action":{access:zt,type:Gt},"attributes":{access:Lt},"autocomplete":{access:zt,def:"on"},"children":{access:Lt},"dataset":{access:Lt},"dir":{access:zt},"draggable":{access:zt,type:qt,def:!1},"elements":{access:Lt},"encoding":{access:Lt},"enctype":{access:zt},"hidden":{access:zt,type:Bt,def:!1},"id":{access:zt,def:""},"lang":{access:zt},"localName":{access:Lt},"method":{access:zt,def:"get"},"name":{access:zt},"noValidate":{access:zt,attr:"novalidate",type:Bt,def:!1},"prefix":{access:Lt},"spellcheck":{access:zt},"style":{access:Lt},"target":{access:zt,def:""},"title":{access:zt},"translate":{access:zt}};function Wt(t){t.bubbleElement.removeAttribute("aria-alert"),t.bubbleElement.removeAttribute("role"),y(t.bubbleElement),Ft(t.bubbleElement,!1)}function Kt(t){t.targetRect=t.viewport.getLayoutRect(t.targetElement)}function Yt(t){y(t.bubbleElement);const e=t.bubbleElement.ownerDocument.createElement("div");e.id=`bubble-message-${t.id}`,e.textContent=t.message,t.bubbleElement.setAttribute("aria-labeledby",e.id),t.bubbleElement.setAttribute("role","alert"),t.bubbleElement.setAttribute("aria-live","assertive"),t.bubbleElement.appendChild(e),Ft(t.bubbleElement,!0),function(t,e){for(const i in e)jt(t,i,e[i])}(t.bubbleElement,{top:t.targetRect.top-10+"px",left:`${t.targetRect.left+t.targetRect.width/2}px`})}var Zt,Qt,te="Please match the requested format.",ee=0,ie=class{constructor(t){this.form=t,this.ampdoc=rt(t),this.mutator=ot(t),this.root=this.ampdoc.getRootNode(),this.WF=null}report(){}onBlur(t){}onInput(t){}inputs(){return this.form.querySelectorAll("input,select,textarea")}checkInputValidity(t){if("TEXTAREA"===t.tagName&&t.hasAttribute("pattern")&&(t.checkValidity()||t.validationMessage===te)){const e=t.getAttribute("pattern"),i=new RegExp(`^${e}$`,"m").test(t.value);t.setCustomValidity(i?"":te)}return t.checkValidity()}checkFormValidity(t){return this.KF(t),t.checkValidity()}reportFormValidity(t){return this.KF(t),t.reportValidity()}KF(t){g(t.elements,(t=>{"TEXTAREA"==t.tagName&&this.checkInputValidity(t)}))}fireValidityEventIfNecessary(){const t=this.WF;if(this.WF=this.checkFormValidity(this.form),t!==this.WF){const t=ht(A(this.form),this.WF?"valid":"invalid",null,{bubbles:!0});this.form.dispatchEvent(t)}}},ne=class extends ie{report(){this.reportFormValidity(this.form),this.fireValidityEventIfNecessary()}},se=class extends ie{constructor(t){super(t);const e="i-amphtml-validation-bubble-"+ee++;this.YF=new class{constructor(t,e){this.Ci=e,this.aa=ct(t),this.zo=q(t.win,"vsync"),this.ZF=null,this.QF="",this.ws=!1,this.TX=t.win.document.createElement("div"),Ft(this.TX,!1),this.TX.classList.add("i-amphtml-validation-bubble"),this.TX.__BUBBLE_OBJ=this,t.getBody().appendChild(this.TX)}isActiveOn(t){return this.ws&&t==this.ZF}hide(){this.ws&&(this.ws=!1,this.ZF=null,this.QF="",this.zo.run({measure:void 0,mutate:Wt},{bubbleElement:this.TX}))}show(t,e){if(this.isActiveOn(t)&&e==this.QF)return;this.ws=!0,this.ZF=t,this.QF=e;const i={message:e,targetElement:t,bubbleElement:this.TX,viewport:this.aa,id:this.Ci};this.zo.run({measure:Kt,mutate:Yt},i)}}(this.ampdoc,e)}report(){const t=this.inputs();for(let e=0;e!0===t.validity[e]));return i.length?i[0]:null}(t);e&&this.showValidationFor(t,e)}RX(){return`i-amphtml-aria-desc-${this.yX}-${this.IX++}`}hideAllValidations(){const t=this.inputs();for(let e=0;ei.classList.add("visible")))}hideValidationFor(t){const e=this.getVisibleValidationFor(t);e&&(delete t.__AMP_VISIBLE_VALIDATION,t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),this.mutator.mutateElement(e,(()=>e.classList.remove("visible"))))}getVisibleValidationFor(t){return t.__AMP_VISIBLE_VALIDATION}shouldValidateOnInteraction(t){throw Error("Not Implemented")}onInteraction(t){const e=t.target,i=!!e.checkValidity&&this.shouldValidateOnInteraction(e);this.hideValidationFor(e),i&&!this.checkInputValidity(e)&&this.reportInput(e)}onBlur(t){this.onInteraction(t)}onInput(t){this.onInteraction(t)}},oe=class extends re{report(){this.hideAllValidations();const t=this.inputs();for(let e=0;e{t.setCustomValidity("")}))}},fe=class extends le{},de=class extends le{constructor(t,e){super(t),this.jX=e,this.FX=null,this.$X=[]}Sx(){const t=this.jX().then((()=>[]),(t=>function(t){const{response:e}=t;return e?e.json().then((t=>t.verifyErrors||[]),(()=>[])):Promise.resolve([])}(t)));return this.kX(t).then((t=>this.NX(t)))}kX(t){if(!this.FX){this.FX=new class{constructor(t){if(this.XX=new r,this.DX=0,t)for(var e,n=i(t,!0);!(e=n()).done;){const t=e.value;this.add(t)}}add(t){const e=++this.DX;return t.then((t=>{this.DX===e&&this.XX.resolve(t)}),(t=>{this.DX===e&&this.XX.reject(t)})),this.XX.promise}then(t,e){return this.XX.promise.then(t,e)}};const t=()=>this.FX=null;this.FX.then(t,t)}return this.FX.add(t)}NX(t){const e=[],i=this.$X;this.$X=t;for(let i=0;it.every((t=>e.name!==t.name)))).map((t=>this.xX.querySelector(`[name="${t.name}"]`)));return{updatedElements:e.concat(n),errors:t}}};function me(t,e,i){if(e[i])return e[i];const n=t.querySelector(`style[${i}], link[${i}]`);return n?(e[i]=n,n):null}function pe(t,e){const i=t.styleSheets;for(let t=0;t{this.remove(t)}}remove(t){this.Tt&&function(t,e){const i=t.indexOf(e);-1!=i&&t.splice(i,1)}(this.Tt,t)}removeAll(){this.Tt&&(this.Tt.length=0)}fire(t){if(this.Tt)for(var e,n=i(this.Tt,!0);!(e=n()).done;)(0,e.value)(t)}getHandlerCount(){var t,e;return null!==(t=null===(e=this.Tt)||void 0===e?void 0:e.length)&&void 0!==t?t:0}}}beforeSubmit(t){return this.jc.add(t)}fire(t){this.jc.fire(t)}}),t.registerServiceForDoc(_e,class{constructor(t){this.CX=this.UX(t).then((()=>this.HX(t)))}whenInitialized(){return this.CX}UX(t){const e=new r;return function(t,e,i,n,s){const r=t.getHeadNode(),o=function(t,e,i,n){let s=t.__AMP_CSS_SM;s||(s=t.__AMP_CSS_SM=f());const r=`amp-extension=${n}`;if(r){const i=me(t,s,r);if(i)return"STYLE"==i.tagName&&i.textContent!==e&&(i.textContent=e),i}const o=(t.ownerDocument||t).createElement("style");o.textContent=e;let a=null;return o.setAttribute("amp-extension",n),a=me(t,s,"amp-runtime"),function(t,e,i=null){if(!i)return void function(t,e){t.insertBefore(e,t.firstChild)}(t,e);const n=i.nextSibling;t.insertBefore(e,n)}(t,o,a),r&&(s[r]=o),o}(r,function(t,e){const i=t.__AMP_CSS_TR;return i?i(e):e}(r,'form.amp-form-submit-error [submit-error],form.amp-form-submit-success [submit-success],form.amp-form-submitting [submitting]{display:block}textarea[autoexpand]:not(.i-amphtml-textarea-max){overflow:hidden!important}.i-amphtml-textarea-clone{visibility:hidden;position:absolute;top:-9999px;left:-9999px;height:0!important}.i-amphtml-validation-bubble{transform:translate(-50%,-100%);background-color:#fff;box-shadow:0 5px 15px 0 rgba(0,0,0,.5);max-width:200px;position:absolute;display:block;box-sizing:border-box;padding:10px;border-radius:5px}.i-amphtml-validation-bubble:after{content:" ";position:absolute;bottom:-8px;left:30px;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #fff}[visible-when-invalid]{color:red}\n/*# sourceURL=/extensions/amp-form/0.1/amp-form.css*/'),0,"amp-form");if(i){const e=t.getRootNode();if(pe(e,o))return i(o),o;const n=setInterval((()=>{pe(e,o)&&(clearInterval(n),i(o))}),4)}}(t,0,e.resolve),e.promise}HX(t){return t.whenReady().then((()=>{const e=t.getRootNode();this.zX(e.querySelectorAll("form")),Dt.install(t),this.LX(e),this.GX(e)}))}zX(t){t&&g(t,((t,e)=>{I(t)||new class{constructor(t,e){try{!function(t){const e=((n=A(t)).FormProxy||(n.FormProxy=function(t){function e(t){this.xX=t}const i=e.prototype,{Object:n}=t,s=n.prototype;return[t.HTMLFormElement,t.EventTarget].reduce(((t,e)=>{let i=e&&e.prototype;for(;i&&i!==s&&!(t.indexOf(i)>=0);)t.push(i),i=n.getPrototypeOf(i);return t}),[]).forEach((e=>{for(const n in e){const r=t.Object.getOwnPropertyDescriptor(e,n);if(r&&n.toUpperCase()!=n&&!n.startsWith("on")&&!s.hasOwnProperty.call(i,n))if("function"==typeof r.value){const t=r.value;i[n]=function(){return t.apply(this.xX,arguments)}}else{const e={};r.get&&(e.get=function(){return r.get.call(this.xX)}),r.set&&(e.set=function(t){return r.set.call(this.xX,t)}),t.Object.defineProperty(i,n,e)}}})),e}(n)),n.FormProxy),i=new e(t);var n;"action"in i||function(t,e){const i=t.ownerDocument.defaultView.HTMLFormElement.prototype.cloneNode.call(t,!1);for(const n in i){if(n in e||n.toUpperCase()==n||n.startsWith("on"))continue;const i=Jt[n],s=t[n];if(i)if(i.access==Lt){let i;if(s&&s.nodeType){const e=s,{nextSibling:r,parentNode:o}=e;o.removeChild(e);try{i=t[n]}finally{o.insertBefore(e,r)}}else i=s;Object.defineProperty(e,n,{get:()=>i})}else if(i.access==zt){const s=i.attr||n;Object.defineProperty(e,n,{get(){const n=e.getAttribute(s);if(null==n&&void 0!==i.def)return i.def;if(i.type==qt)return"true"===n;if(i.type==Bt)return null!=n;if(i.type==Gt){const e=n||"";return at(t).parse(e).href}return n},set(t){i.type==Bt&&(t=t?"":null),null!=t?e.setAttribute(s,t):e.removeAttribute(s)}})}else L(!1);else Object.defineProperty(e,n,{get:()=>t[n],set(e){t[n]=e}})}}(t,i),t.$p=i}(t)}catch(t){z().error(_e,"form proxy failed to install",t)}!function(t,e){t.__AMP_FORM=e}(t,this),this.Ci=e,this.hm=t.ownerDocument,this.i=this.hm.defaultView,this.Fr=Q(this.i,"timer"),this.xX=t,this.es=rt(this.xX),this.qX=null,this.BX=(t=>J(t,"url-replace"))(this.es),this.tg=B(this.es,"templates"),this.hR=(t=>q(t,"xhr"))(this.i),this.P_=(t=>J(t,"action"))(this.es),this.Od=ot(this.es),this.sh=(t=>B(t,"viewer"))(this.es),this.N$=new class{constructor(t,e,i){this.sh=e,this.tg=i,this.$O=t}isEnabled(){const t=this.sh.getAmpDoc();return!(!t.isSingleDoc()||!t.getRootNode().documentElement.hasAttribute("allow-viewer-render-template"))&&this.sh.hasCapability("viewerRenderTemplate")}assertTrustedViewer(t){return this.sh.isTrustedViewer().then((e=>{G(e,"Refused to attempt SSR in untrusted viewer: ",t)}))}ssr(t,e,i=null,n={}){let s;return i||(s=this.tg.maybeFindTemplate(t)),this.assertTrustedViewer(t).then((()=>this.sh.sendMessageAwaitResponse("viewerRenderTemplate",this.kO(e,s,i,n))))}applySsrOrCsrTemplate(t,e){let i;return this.isEnabled()?(G("string"==typeof e.html,"Skipping template rendering due to failed fetch"),i=this.assertTrustedViewer(t).then((()=>this.tg.findAndSetHtmlForTemplate(t,e.html)))):i=c(e)?this.tg.findAndRenderTemplateArray(t,e):this.tg.findAndRenderTemplate(t,e),i}kO(t,e,i,n={}){const s={"type":this.$O},r=i&&i.successTemplate?i.successTemplate:e;r&&(s.successTemplate={"type":"amp-mustache","payload":r.innerHTML});const o=i&&i.errorTemplate?i.errorTemplate:null;return o&&(s.errorTemplate={"type":"amp-mustache","payload":o.innerHTML}),n&&Object.assign(s,n),{"originalRequest":Mt(t.xhrUrl,t.fetchOpt),"ampComponent":s}}}(_e,this.sh,this.tg),this.dM=(this.xX.getAttribute("method")||"GET").toUpperCase(),this.o=this.xX.getAttribute("target"),this.JX=this.WX("action-xhr"),this.KX=this.WX("verify-xhr"),this.YX=this.ZX("enctype"),this.QX=!this.xX.hasAttribute("novalidate"),this.xX.setAttribute("novalidate",""),this.QX||this.xX.setAttribute("amp-novalidate",""),this.xX.classList.add("i-amphtml-form"),this.Ui=Ae;const i=this.xX.elements;for(let t=0;t0&&!this.UU;if(t!==this.HU){this.xX.classList.toggle("amp-form-dirty",t);const e=ht(this.i,"amp:form-dirtiness-change",{"isDirty":t},{bubbles:!0});this.xX.dispatchEvent(e)}this.HU=t}wM(){this.xX.addEventListener("input",this.BU.bind(this)),this.xX.addEventListener("reset",this.JU.bind(this)),this.xX.addEventListener(_,this.BU.bind(this))}zU(){for(let t=0;tthis.eG(),(n=this.xX).hasAttribute("verify-xhr")?new de(n,s):new fe(n)),this.P_.addToAllowlist("FORM",["clear","submit"],["email"]),this.P_.installActionHandler(this.xX,this.iG.bind(this)),this.wM(),this.nG(),this.sG(),this.rG=null,this.oG=null,this.aG=null,(t=>W(t,"form-submit-service"))(t).then((t=>{this.aG=t})),this.cG=this.hm&&function(t,e){const i=e.documentElement;return["⚡4email","amp4email"].some((t=>i.hasAttribute(t)))}(0,this.hm)}WX(t){const e=this.xX.getAttribute(t);if(e){const i=at(this.es);i.assertHttpsUrl(e,this.xX,t),G(!i.isProxyOrigin(e),"form %s should not be on AMP CDN: %s",t,this.xX)}return e}ZX(t){const e=this.xX.getAttribute(t);return"application/x-www-form-urlencoded"===e||"multipart/form-data"===e?e:"multipart/form-data"}getXssiPrefix(){return this.xX.getAttribute("xssi-prefix")}requestForFormFetch(t,e,i,n){let s,r,o={"Accept":"application/json"};if("GET"==e||"HEAD"==e){this.uG();const e=this.hG();n&&n.forEach((t=>delete e[t])),i&&function(t,e,i=10){const n=[],s=[];for(s.push({t:t,s:e,d:0});s.length>0;){const{d:t,s:e,t:a}=s.shift();if(n.includes(e))throw new Error("Source object has a circular reference.");if(n.push(e),a!==e)if(t>i)Object.assign(a,e);else for(var r=0,o=Object.keys(e);rr.delete(t)));for(const t in i)r.append(t,i[t])}return{xhrUrl:s,fetchOpt:{"body":r,"method":e,"credentials":"include","headers":o}}}setXhrAction(t){this.JX=t}iG(t){return t.satisfiesTrust(2)?"submit"==t.method?this.lG().then((()=>this.fG(t))):("clear"===t.method&&this.dG(),null):null}lG(){if(this.qX)return this.qX;const t=a(this.xX.querySelectorAll(be.join(","))).map((t=>t.build()));return this.qX=this.mG(t,2e3)}wM(){this.es.whenNextVisible().then((()=>{const t=this.xX.querySelector("[autofocus]");t&&function(t){try{t.focus()}catch(t){}}(t)})),this.xX.addEventListener("submit",this.pG.bind(this),!0),this.xX.addEventListener("blur",(t=>{Ie(t.target),this.QU.onBlur(t)}),!0),this.xX.addEventListener(_,(t=>{Ie(t.target),this.QU.onInput(t)}),!0),this.N$.isEnabled()||this.xX.addEventListener("change",(t=>{this.tG.onCommit().then((e=>{const{errors:i,updatedElements:n}=e;n.forEach(Ie),this.QU.onBlur(t),this.Ui===Pe&&(i.length?(this._G("verify-error"),this.bG({"verifyErrors":i}).then((()=>{this.AG("verify-error",i,2)}))):this._G(Ae))}))})),this.xX.addEventListener("input",(t=>{Ie(t.target),this.QU.onInput(t)}))}nG(){var t;(t=this.es,nt(t,"inputmask","amp-inputmask")).then((t=>{t&&t.install()}))}PG(t){this.vG(!1,"Form analytics not supported");const e={},i=this.hG();for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e["formFields["+t+"]"]=i[t].join(","));e.formId=this.xX.id;try{this.EG(t,e)}catch(t){z().error(_e,"Sending analytics failed:",t)}}fG(t){return this.Ui!=ve&&this.TG()?this.yG(t.trust,null):Promise.resolve(null)}dG(){this.xX.reset(),this._G(Ae),this.xX.classList.remove("user-valid"),this.xX.classList.remove("user-invalid"),g(this.xX.querySelectorAll(".user-valid, .user-invalid"),(t=>{t.classList.remove("user-valid"),t.classList.remove("user-invalid")})),g(this.xX.querySelectorAll(".visible[validation-for]"),(t=>{t.classList.remove("visible")})),function(t){const e=document.createElement("input");for(const i in e.validity)g(t.querySelectorAll(`.${P(i)}`),(t=>{t.classList.remove(i)}))}(this.xX)}pG(t){return this.Ui!=ve&&this.TG()?((this.JX||"POST"==this.dM)&&t.preventDefault(),this.yG(3,t)):(t.stopImmediatePropagation(),t.preventDefault(),Promise.resolve(null))}yG(t,e){try{const t={form:this.xX,actionXhrMutator:this.setXhrAction.bind(this)};L(this.aG).fire(t)}catch(t){z().error(_e,"Form submit service failed: %s",t)}const i=this.gG(),n=this.xX.getElementsByClassName("i-amphtml-async-input");if(this.FU.onSubmitting(),!this.JX&&"GET"==this.dM){if(this.vG(!1,"Non-XHR GETs not supported."),this.uG(),0===n.length){for(let t=0;t{const e=this.wG(t);t.classList.contains("i-async-require-action")?r.push(e):o.push(e)})),Promise.all(r).then((()=>this.mG(o,1e4).then((()=>this.xG(t)),(e=>this.MG(e,t)))),(e=>this.MG(e,t)))}MG(t,e){const i={};return t&&t.message&&(i.error=t.message),this.SG(t,i,e)}gG(){return this.xX.querySelectorAll('[type="hidden"][data-amp-replace]')}xG(t){return this.JX?this.OG(t):("POST"==this.dM?this.jG():"GET"==this.dM&&this.IG(!0),s())}eG(){return this.Ui===ve?s():(this._G(Pe),this.AG("verify",null,3),this.VG(this.gG()).then((()=>this.FG())))}OG(t){let e;return this.N$.isEnabled()?e=this.$G(t):(this.kG(t),e=this.NG().then((e=>this.XG(e,t)),(e=>this.DG(e,t)))),e}$G(t){const e=this.hG();return this.bG(e).then((()=>this.P_.trigger(this.xX,Ht,null,t))).then((()=>{const t=this.requestForFormFetch(this.JX,this.dM);var e,i,n;return t.fetchOpt=function(t,e){const i=t||{},n=i.credentials;return m(void 0===n||"include"==n||"omit"==n),i.method=void 0===(s=i.method)?"GET":(s=s.toUpperCase(),m(xt.includes(s)),s),i.headers=i.headers||{},m(null!==i.body),i;var s}(t.fetchOpt),t.fetchOpt=function(t,e,i){i=i||{};const n=function(t){return t.origin||yt(t.location.href).origin}(t);return n==yt(e).origin&&(i.headers=i.headers||{},i.headers["AMP-Same-Origin"]="true"),i}(this.i,t.xhrUrl,t.fetchOpt),t.xhrUrl=(e=this.i,i=t.xhrUrl,n=t.fetchOpt,m("string"==typeof i),!1!==n.ampCors&&(i=function(t,e){return function(t){const e=j(yt(t).search);G(!(Et in e),"Source origin is not allowed in %s",t)}(e),function(t,e,i,n){return gt(t,It("__amp_source_origin",i),void 0)}(e,0,function(t){return yt(function(t){if(!Vt(t=Tt(t)))return t.href;const e=t.pathname.split("/"),i=e[1];G(vt.has(i),"Unknown path prefix in url %s",t.href);const n=e[2],s="s"==n?"https://"+decodeURIComponent(e[3]):"http://"+decodeURIComponent(n);return G(s.indexOf(".")>0,"Expected a . in origin %s",s),e.splice(1,"s"==n?3:2),s+e.join("/")+function(t,e){if(!t||"?"==t)return"";const i=new RegExp("[?&](amp_(js[^&=]*|gsa|r|kit)|usqp)\\b[^&]*","g"),n=t.replace(i,"").replace(/^[?&]/,"");return n?"?"+n:""}(t.search)+(t.hash||"")}(t)).origin}(t.location.href))}(e,i)),i),this.N$.ssr(this.xX,t,this.CG())})).then((e=>this.UG(e,t)),(e=>{const i={};return e&&e.message&&(i.error=e.message),this.SG(e,i,t)}))}CG(){let t;const e=this.xX.querySelector("[submit-success]");let i;e&&(t=this.tg.maybeFindTemplate(e));const n=this.xX.querySelector("[submit-error]");return n&&(i=this.tg.maybeFindTemplate(n)),{successTemplate:t,errorTemplate:i}}UG(t,e){const i=t.init,n=function(t,e){try{return function(t){return JSON.parse(t)}(t)}catch(t){return null==e||e(t),null}}(t.body,(t=>U().error(_e,"Failed to parse response JSON: %s",t)));if(i){const s=i.status;if(s>=300)return this.SG(s,t,e,n)}return this.HG(t,e,n)}kG(t){this.PG("amp-form-submit");const e=this.hG();this.bG(e).then((()=>{this.P_.trigger(this.xX,Ht,null,t)}))}VG(t){const e=[];for(let i=0;it.getValue())).then((e=>{const i=t.getAttribute(b);let n=this.xX.querySelector(`input[name=${P(i)}]`);var s,r;n||(s=this.i.document,r={"name":t.getAttribute(b),"hidden":"true"},n=function(t,e){for(const i in e)t.setAttribute(i,e[i]);return t}(s.createElement("input"),r)),n.setAttribute("value",e),this.xX.appendChild(n)}))}NG(){return this.jX(this.JX,this.dM)}FG(){const t=a(this.xX.querySelectorAll(`[${P("no-verify")}]`)).map((t=>t.name||t.id));return this.jX(this.KX,this.dM,{[he]:!0},t)}jX(t,e,i,n){this.vG(!1,"XHRs should be proxied.");const s=this.requestForFormFetch(t,e,i,n);return this.hR.fetch(s.xhrUrl,s.fetchOpt)}zG(t){return t-1}XG(t,e){return this.hR.xssiJson(t,this.getXssiPrefix()).then((t=>this.HG(t,e)),(t=>U().error(_e,"Failed to parse response JSON: %s",t))).then((()=>{this.PG("amp-form-submit-success"),this.LG(t)}))}HG(t,e,i){return this._G("submit-success"),o((()=>{this.bG(t||{}).then((()=>{const n=this.zG(e);this.AG("submit-success",void 0===i?t:i,n),this.FU.onSubmitSuccess()}))}))}DG(t,e){let i;if(t&&t.response){const e=t;i=this.hR.xssiJson(e.response,this.getXssiPrefix()).catch((()=>null))}else i=Promise.resolve(null);return i.then((i=>{this.SG(t,i,e),this.PG("amp-form-submit-error"),this.LG(t.response)}))}SG(t,e,i,n){return this._G("submit-error"),U().error(_e,"Form submission failed: %s",t),o((()=>{this.bG(e).then((()=>{const t=this.zG(i);this.AG("submit-error",void 0===n?e:n,t),this.FU.onSubmitError()}))}))}jG(){G(!1,"Only XHR based (via action-xhr attribute) submissions are supported for POST requests. %s",this.xX)}IG(t){this.PG("amp-form-submit"),t&&this.xX.submit(),this._G(Ae)}vG(t,e){G(this.N$.isEnabled()===t,"[amp-form]: viewerRenderTemplate | %s",e)}uG(){G(0==this.xX.querySelectorAll("input[type=password],input[type=file]").length,"input[type=password] or input[type=file] may only appear in form[method=post]")}TG(){if(e=this.i.document,void 0===Qt&&(Qt=!!e.createElement("input").checkValidity),Qt){const e=(g((t=this.xX).querySelectorAll("input,select,textarea,fieldset"),(t=>ge(t))),ge(t));if(this.QX)return this.QU.report(),e}var t,e;return!0}LG(t){if(this.vG(!1,"Redirects not supported."),!t||!t.headers)return;const e=t.headers.get(ye);if(e){G(!this.cG,"Redirects not supported in AMP4Email.",this.xX),G("_blank"!=this.o,"Redirecting to target=_blank using AMP-Redirect-To is currently not supported, use target=_top instead. %s",this.xX);try{const t=at(this.es);t.assertAbsoluteHttpOrHttpsUrl(e),t.assertHttpsUrl(e,"AMP-Redirect-To","Url")}catch(t){G(!1,"The `AMP-Redirect-To` header value must be an absolute URL starting with https://. Found %s",e)}(i=this.es,B(i,"navigation")).navigateTo(this.i,e,ye)}var i}AG(t,e,i){const n=ht(this.i,`${_e}.${t}`,{"response":e});this.P_.trigger(this.xX,t,n,i)}mG(t,e){return Promise.race([Promise.all(t),this.Fr.promise(e)])}EG(t,e){!function(t,e,i={},n=!0){var s;(s=t,nt(s,"amp-analytics-instrumentation","amp-analytics")).then((s=>{s&&s.triggerEventForTarget(t,e,i,n)}))}(this.xX,t,e)}hG(){return R(this.xX)}_G(t){const e=this.Ui;this.xX.classList.remove(`amp-form-${e}`),this.xX.classList.add(`amp-form-${t}`),this.GG(e),this.Ui=t}bG(t){c(t)&&(t={});const e=this.xX.querySelector(`[${this.Ui}]`);let i=s();if(e){const n=`rendered-message-${this.Ci}`;e.setAttribute("role","alert"),e.setAttribute("aria-labeledby",n),e.setAttribute("aria-live","assertive"),this.tg.hasTemplate(e)?i=this.N$.applySsrOrCsrTemplate(L(e),t).then((t=>{let i;return c(t)?1===t.length?i=t[0]:(i=document.createElement("div"),t.forEach((t=>i.appendChild(t)))):i=t,i.id=n,i.setAttribute("i-amphtml-rendered",""),this.Od.mutateElement(e,(()=>{e.appendChild(i);const t=ht(this.i,p,null,{bubbles:!0});e.dispatchEvent(t)}))})):this.Od.mutateElement(e,(()=>{}))}return i}GG(t){const e=this.xX.querySelector(`[${t}]`);if(!e)return;const i=(n=e,v("i-amphtml-rendered"),"> [i-amphtml-rendered]",n.querySelector(function(t,e){return t.replace(/^|,/g,"$&:scope ")}("> [i-amphtml-rendered]")));var n;i&&T(i)}sG(){if(Vt(this.i.location)||!this.xX.hasAttribute("data-initialize-from-url"))return;const t=["SELECT","TEXTAREA"],e=["color","date","datetime-local","email","hidden","month","number","range","search","tel","text","time","url","week"],i=["checkbox","radio"],n=(n,r)=>{if(n.hasAttribute("data-amp-replace"))return;if(!n.hasAttribute("data-allow-initialization"))return;const o=s[r]||"",a=n.getAttribute("type")||"text",c=n.tagName;if("INPUT"===c){if(e.includes(a.toLocaleLowerCase()))n.value!==o&&(n.value=o);else if(i.includes(a)){const t=n.value===o;n.checked!==t&&(n.checked=t)}}else t.includes(c)&&n.value!==o&&(n.value=o)},s=j(this.i.location.search);Object.keys(s).forEach((t=>{const e=this.xX.elements[t];e&&(e.nodeType===Node.ELEMENT_NODE?n(e,t):e.length&&g(e,(e=>n(e,t))))}))}renderTemplatePromiseForTesting(){return this.oG}xhrSubmitPromiseForTesting(){return this.rG}}(t,`amp-form-${e}`)}))}LX(t){t.addEventListener(p,(()=>{this.zX(t.querySelectorAll("form"))}))}GX(t){t.addEventListener("keydown",(t=>{if(t.defaultPrevented||"Enter"!=t.key||!t.ctrlKey&&!t.metaKey||"TEXTAREA"!==t.target.tagName)return;const{form:e}=t.target,i=e?I(e):null;i&&(i.pG(t),t.preventDefault())}))}})})(); /*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */}});