let pmfApplyFrameWrapper = document.getElementById('pmfApplyFrame'); const {dataset} = pmfApplyFrameWrapper; const termsOfConditionQuery = dataset?.termsOfServiceUrl ? `termsOfServiceUrl=${encodeURIComponent(dataset.termsOfServiceUrl)}` : undefined; const thankYouPageQuery = dataset?.thankYouPageUrl ? `thankYouPageUrl=${encodeURIComponent(dataset.thankYouPageUrl)}` : undefined; const brandedPage = dataset?.branded ? `brandedPage=${encodeURIComponent(dataset.branded)}` : undefined; let iframe = document.createElement('iframe'); iframe.src = `https://apply.myrmapp.com/apply?mode=iframe&origin=${window.location.href}&${termsOfConditionQuery}&${thankYouPageQuery}&${brandedPage}`; iframe.width = '100%'; iframe.height = '100%'; iframe.style.border = '0'; iframe.style.borderRadius = '3px'; iframe.name = 'pmfApplyFrame'; iframe.allow = 'clipboard-read; clipboard-write' pmfApplyFrameWrapper.appendChild(iframe);