PageSourceSearch

https://docs.ideal-postcodes.co.uk/assets/js/2cbc839c.a82664b0.js

js ideal-postcodes.co.uk collected 2026-09-24 15:29:17 UTC 25,175 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunk_atlas_docs_ideal=globalThis.webpackChunk_atlas_docs_ideal||[]).push([[312],{1318(e,t,r){r.d(t,{n:()=>p,u:()=>s});var o=r(74888),n=r(19741),a=r(21850);const s='body {\n  font-family: Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n  margin: 0;\n  padding: 1.5rem;\n  background-color: #f9fafb;\n  color: #111827;\n  font-size: 14px;\n  line-height: 1.5;\n  display: flex;\n  justify-content: center;\n}\nform {\n  width: 100%;\n  max-width: 24rem;\n  display: flex;\n  flex-direction: column;\n  gap: 0.25rem;\n}\ninput + label { margin-top: 0.5rem; }\nlabel {\n  display: block;\n  font-size: 0.8125rem;\n  font-weight: 500;\n  color: #374151;\n}\ninput, textarea {\n  width: 100%;\n  padding: 0.5rem 0.75rem;\n  font-size: 0.875rem;\n  font-family: inherit;\n  color: #111827;\n  background-color: #ffffff;\n  border: 1px solid #d1d5db;\n  border-radius: 0.375rem;\n  box-sizing: border-box;\n  transition: border-color 150ms ease, box-shadow 150ms ease;\n}\ntextarea { min-height: 5rem; resize: vertical; line-height: 1.5; }\ninput:focus, textarea:focus {\n  outline: none;\n  border-color: #2933e6;\n  box-shadow: 0 0 0 3px rgba(41, 51, 230, 0.15);\n}\n[data-theme="dark"] body { background-color: #1f1f1f; color: #e5e7eb; }\n[data-theme="dark"] label { color: #d1d5db; }\n[data-theme="dark"] input, [data-theme="dark"] textarea {\n  background-color: #2a2a2a;\n  border-color: #444950;\n  color: #e5e7eb;\n}\n[data-theme="dark"] input:focus, [data-theme="dark"] textarea:focus {\n  border-color: #545ceb;\n  box-shadow: 0 0 0 3px rgba(84, 92, 235, 0.25);\n}\n\n/* Postcode Lookup widget default chrome \u2014 matches form input styling.\n   Wrapped in :where() so user-supplied .idpc-* rules always win regardless of\n   load order. */\n:where(.idpc-input) {\n  border-color: #2933e6;\n  box-shadow: 0 0 0 1px rgba(41, 51, 230, 0.1);\n}\n:where(.idpc-input:focus) { border-color: #2933e6; box-shadow: 0 0 0 3px rgba(41, 51, 230, 0.2); }\n:where([data-theme="dark"] .idpc-input) { border-color: #545ceb; box-shadow: 0 0 0 1px rgba(84, 92, 235, 0.15); }\n:where([data-theme="dark"] .idpc-input:focus) { border-color: #545ceb; box-shadow: 0 0 0 3px rgba(84, 92, 235, 0.3); }\n:where(.idpc-button) {\n  margin-top: 0.5rem;\n  padding: 0.5rem 1rem;\n  font-size: 0.875rem;\n  font-weight: 500;\n  color: #ffffff;\n  background-color: #2933e6;\n  border: 1px solid #2933e6;\n  border-radius: 0.375rem;\n  cursor: pointer;\n  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;\n}\n:where(.idpc-button:hover) { background-color: #1f29c4; border-color: #1f29c4; }\n:where(.idpc-button:focus) { outline: none; box-shadow: 0 0 0 3px rgba(41, 51, 230, 0.25); }\n:where(.idpc-select-container) { margin-top: 0.5rem; }\n:where(.idpc-select-container select) {\n  width: 100%;\n  padding: 0.5rem 2.25rem 0.5rem 0.75rem;\n  font-size: 0.875rem;\n  color: #111827;\n  background-color: #ffffff;\n  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 20 20\' fill=\'%236b7280\'%3E%3Cpath fill-rule=\'evenodd\' d=\'M5.23 7.21a.75.75 0 011.06.02L10 11.06l3.71-3.83a.75.75 0 111.08 1.04l-4.25 4.39a.75.75 0 01-1.08 0L5.21 8.27a.75.75 0 01.02-1.06z\' clip-rule=\'evenodd\'/%3E%3C/svg%3E");\n  background-repeat: no-repeat;\n  background-position: right 0.625rem center;\n  background-size: 1rem;\n  border: 1px solid #d1d5db;\n  border-radius: 0.375rem;\n  box-sizing: border-box;\n  cursor: pointer;\n  appearance: none;\n  -webkit-appearance: none;\n  transition: border-color 150ms ease, box-shadow 150ms ease;\n}\n:where(.idpc-select-container select:focus) {\n  outline: none;\n  border-color: #2933e6;\n  box-shadow: 0 0 0 3px rgba(41, 51, 230, 0.15);\n}\n:where(.idpc-error) { margin-top: 0.5rem; font-size: 0.8125rem; color: #b91c1c; }\n:where(.idpc-unhide) {\n  display: block;\n  width: fit-content;\n  margin-top: 1rem;\n  margin-bottom: 0.5rem;\n  padding: 0.375rem 0.75rem;\n  font-size: 0.8125rem;\n  font-weight: 500;\n  color: #2933e6;\n  background-color: transparent;\n  border: 1px solid #2933e6;\n  border-radius: 0.375rem;\n  cursor: pointer;\n  user-select: none;\n  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;\n}\n:where(.idpc-unhide:hover) { background-color: #2933e6; color: #ffffff; }\n:where(.idpc-unhide:focus) { outline: none; box-shadow: 0 0 0 3px rgba(41, 51, 230, 0.25); }\n:where([data-theme="dark"] .idpc-unhide) { color: #545ceb; border-color: #545ceb; }\n:where([data-theme="dark"] .idpc-unhide:hover) { background-color: #545ceb; color: #ffffff; }\n/* Separate the widget context from address fields that follow it. */\n:where(form >
1 div:has(> .idpc-input)), :where(form > div:has(> .idpc-button)) { margin-bottom: 0.75rem; }\n:where([data-theme="dark"] .idpc-button) { background-color: #545ceb; border-color: #545ceb; }\n:where([data-theme="dark"] .idpc-button:hover) { background-color: #4047d6; border-color: #4047d6; }\n:where([data-theme="dark"] .idpc-select-container select) {\n  background-color: #2a2a2a;\n  border-color: #444950;\n  color: #e5e7eb;\n  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 20 20\' fill=\'%239ca3af\'%3E%3Cpath fill-rule=\'evenodd\' d=\'M5.23 7.21a.75.75 0 011.06.02L10 11.06l3.71-3.83a.75.75 0 111.08 1.04l-4.25 4.39a.75.75 0 01-1.08 0L5.21 8.27a.75.75 0 01.02-1.06z\' clip-rule=\'evenodd\'/%3E%3C/svg%3E");\n}\n:where([data-theme="dark"] .idpc-select-container select:focus) {\n  border-color: #545ceb;\n  box-shadow: 0 0 0 3px rgba(84, 92, 235, 0.25);\n}\n:where([data-theme="dark"] .idpc-error) { color: #f87171; }\n\n/* Address Finder / Postcode Lookup dropdown \u2014 dark variant.\n   Targets v5.0.4\'s actual selectors (idpc_af is the dropdown wrapper).\n   Once the unreleased beta with --idpc-* variables ships, swap to variable\n   overrides for cleaner theming. */\nhtml[data-theme="dark"] div.idpc_autocomplete {\n  color: #e5e7eb !important;\n}\nhtml[data-theme="dark"] div.idpc_af {\n  background: #2a2a2a !important;\n  border-color: rgba(255, 255, 255, 0.15) !important;\n  box-shadow: 0.05em 0.2em 0.6em rgba(0, 0, 0, 0.6) !important;\n}\nhtml[data-theme="dark"] div.idpc_af > ul > li:hover {\n  background-color: #3a3a3a !important;\n}\nhtml[data-theme="dark"] div.idpc_af > ul > li.idpc_error,\nhtml[data-theme="dark"] div.idpc_af > ul > li.idpc_error:hover {\n  background-color: #2a2a2a !important;\n  color: #9ca3af !important;\n}\nhtml[data-theme="dark"] div.idpc_af > ul > li[aria-selected="true"] {\n  background-color: #545ceb !important;\n  color: #ffffff !important;\n}\nhtml[data-theme="dark"] div.idpc_toolbar {\n  border-top-color: rgba(255, 255, 255, 0.15) !important;\n}\n/* Country toggle: source CSS sets hover bg to #e5e4e2 (light grey) which\n   reads as bright white-on-white in dark mode. Tone it down and ensure the\n   country-name text stays legible when it expands on hover. */\nhtml[data-theme="dark"] div.idpc_autocomplete > div > div > span:hover {\n  background-color: #3a3a3a !important;\n}\nhtml[data-theme="dark"] div.idpc_toolbar > span span.idpc_country {\n  color: #e5e7eb !important;\n}';var i=r(65723);const d={border:"1px solid var(--ifm-color-emphasis-300)",borderRadius:"var(--ifm-card-border-radius)",backgroundColor:"var(--ifm-background-surface-color)"},l=(e={})=>{const{imports:t={},mode:r="simple",themeColor:o,editor:l,editorTheme:c,fontFamily:p,baseCss:u=s}=e;return function({html:e,js:s,css:h,scripts:f,stylesheets:m,head:b,baseCss:g=u,imports:w,height:v="500px",view:y="split",mode:x=r,loading:k="lazy",activeEditor:j,className:C,style:A,editorTheme:_=c,theme:S="light"}){const P="dark"===S;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.A,{fallback:(0,i.jsx)("div",{style:{height:v},children:"Loading..."}),children:()=>{const r=[g&&`<style>${g}</style>`,b].filter(Boolean).join("\n");return(0,i.jsx)(a.A,{height:v,loading:k,className:C,style:{...d,...A},config:{mode:x,view:y,theme:P?"dark":"light",htmlAttrs:{"data-theme":P?"dark":"light"},markup:{language:"html",content:e},...s&&{script:{language:"javascript",content:s}},...h&&{style:{language:"css",content:h}},languages:[...s?["javascript"]:[],"html",...h?["css"]:[]],activeEditor:j??(s?"script":"markup"),lineNumbers:!1,wordWrap:!0,useTabs:!1,tabSize:2,...f&&{scripts:f},...m&&{stylesheets:m},...r&&{head:r},imports:{...t,...w},..._&&{editorTheme:_},...o&&{themeColor:P?o.dark:o.light},...l&&{editor:l},...p&&{fontFamily:p}}})}}),(0,i.jsxs)("div",{style:{display:"none"},"aria-hidden":"true",children:[(0,i.jsx)("pre",{children:e}),s&&(0,i.jsx)("pre",{children:s}),h&&(0,i.jsx)("pre",{children:h})]})]})}},c=(l(),l({imports:{"@ideal-postcodes/address-finder":"https://esm.sh/@ideal-postcodes/address-finder-bundled@5","@ideal-postcodes/postcode-lookup":"https://esm.sh/@ideal-postcodes/postcode-lookup-bundled@3"},themeColor:{light:"#2933e6",dark:"#7b83f5"},editorTheme:["github-light@light","github-dark@dark"],fontFamily:"Fira Code"}));function p(e){const{isDarkTheme:t}=(0,o.G)();return(0,i.jsx)(c,{...e,theme:t?"dark":"light"})}},19741(e,t,r){r.d(t,{A:()=>a});r(22155);var o=r(41950),n=r(65723);function a({children:e,fallback:t}){return(0,o.A)()?(0,n.jsx)(n.Fragment,{children:e?.()}):t??null}},21850(e,t,r){r.d(t,{A:()=>b});var o,n,a=r(22155),s=r(65723),i=Object.create,d=Object.defineProperty,l=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,p=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,h=(o=(e,t)=>
vendor: 4,608 bytes, line 1
1{var r=function(){var e=String.fromCharCode,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",o={};function n(e,t){if(!o[e]){o[e]={};for(var r=0;r<e.length;r++)o[e][e.charAt(r)]=r}return o[e][t]}var a={compressToBase64:function(e){if(null==e)return"";var r=a._compress(e,6,function(e){return t.charAt(e)});switch(r.length%4){default:case 0:return r;case 1:return r+"===";case 2:return r+"==";case 3:return r+"="}},decompressFromBase64:function(e){return null==e?"":""==e?null:a._decompress(e.length,32,function(r){return n(t,e.charAt(r))})},compressToUTF16:function(t){return null==t?"":a._compress(t,15,function(t){return e(t+32)})+" "},decompressFromUTF16:function(e){return null==e?"":""==e?null:a._decompress(e.length,16384,function(t){return e.charCodeAt(t)-32})},compressToUint8Array:function(e){for(var t=a.compress(e),r=new Uint8Array(2*t.length),o=0,n=t.length;o<n;o++){var s=t.charCodeAt(o);r[2*o]=s>>>8,r[2*o+1]=s%256}return r},decompressFromUint8Array:function(t){if(null==t)return a.decompress(t);for(var r=new Array(t.length/2),o=0,n=r.length;o<n;o++)r[o]=256*t[2*o]+t[2*o+1];var s=[];return r.forEach(function(t){s.push(e(t))}),a.decompress(s.join(""))},compressToEncodedURIComponent:function(e){return null==e?"":a._compress(e,6,function(e){return r.charAt(e)})},decompressFromEncodedURIComponent:function(e){return null==e?"":""==e?null:(e=e.replace(/ /g,"+"),a._decompress(e.length,32,function(t){return n(r,e.charAt(t))}))},compress:function(t){return a._compress(t,16,function(t){return e(t)})},_compress:function(e,t,r){if(null==e)return"";var o,n,a,s={},i={},d="",l="",c="",p=2,u=3,h=2,f=[],m=0,b=0;for(a=0;a<e.length;a+=1)if(d=e.charAt(a),Object.prototype.hasOwnProperty.call(s,d)||(s[d]=u++,i[d]=!0),l=c+d,Object.prototype.hasOwnProperty.call(s,l))c=l;else{if(Object.prototype.hasOwnProperty.call(i,c)){if(c.charCodeAt(0)<256){for(o=0;o<h;o++)m<<=1,b==t-1?(b=0,f.push(r(m)),m=0):b++;for(n=c.charCodeAt(0),o=0;o<8;o++)m=m<<1|1&n,b==t-1?(b=0,f.push(r(m)),m=0):b++,n>>=1}else{for(n=1,o=0;o<h;o++)m=m<<1|n,b==t-1?(b=0,f.push(r(m)),m=0):b++,n=0;for(n=c.charCodeAt(0),o=0;o<16;o++)m=m<<1|1&n,b==t-1?(b=0,f.push(r(m)),m=0):b++,n>>=1}0==--p&&(p=Math.pow(2,h),h++),delete i[c]}else for(n=s[c],o=0;o<h;o++)m=m<<1|1&n,b==t-1?(b=0,f.push(r(m)),m=0):b++,n>>=1;0==--p&&(p=Math.pow(2,h),h++),s[l]=u++,c=String(d)}if(""!==c){if(Object.prototype.hasOwnProperty.call(i,c)){if(c.charCodeAt(0)<256){for(o=0;o<h;o++)m<<=1,b==t-1?(b=0,f.push(r(m)),m=0):b++;for(n=c.charCodeAt(0),o=0;o<8;o++)m=m<<1|1&n,b==t-1?(b=0,f.push(r(m)),m=0):b++,n>>=1}else{for(n=1,o=0;o<h;o++)m=m<<1|n,b==t-1?(b=0,f.push(r(m)),m=0):b++,n=0;for(n=c.charCodeAt(0),o=0;o<16;o++)m=m<<1|1&n,b==t-1?(b=0,f.push(r(m)),m=0):b++,n>>=1}0==--p&&(p=Math.pow(2,h),h++),delete i[c]}else for(n=s[c],o=0;o<h;o++)m=m<<1|1&n,b==t-1?(b=0,f.push(r(m)),m=0):b++,n>>=1;0==--p&&(p=Math.pow(2,h),h++)}for(n=2,o=0;o<h;o++)m=m<<1|1&n,b==t-1?(b=0,f.push(r(m)),m=0):b++,n>>=1;for(;;){if(m<<=1,b==t-1){f.push(r(m));break}b++}return f.join("")},decompress:function(e){return null==e?"":""==e?null:a._decompress(e.length,32768,function(t){return e.charCodeAt(t)})},_decompress:function(t,r,o){var n,a,s,i,d,l,c,p=[],u=4,h=4,f=3,m="",b=[],g={val:o(0),position:r,index:1};for(n=0;n<3;n+=1)p[n]=n;for(s=0,d=Math.pow(2,2),l=1;l!=d;)i=g.val&g.position,g.position>>=1,0==g.position&&(g.position=r,g.val=o(g.index++)),s|=(i>0?1:0)*l,l<<=1;switch(s){case 0:for(s=0,d=Math.pow(2,8),l=1;l!=d;)i=g.val&g.position,g.position>>=1,0==g.position&&(g.position=r,g.val=o(g.index++)),s|=(i>0?1:0)*l,l<<=1;c=e(s);break;case 1:for(s=0,d=Math.pow(2,16),l=1;l!=d;)i=g.val&g.position,g.position>>=1,0==g.position&&(g.position=r,g.val=o(g.index++)),s|=(i>0?1:0)*l,l<<=1;c=e(s);break;case 2:return""}for(p[3]=c,a=c,b.push(c);;){if(g.index>t)return"";for(s=0,d=Math.pow(2,f),l=1;l!=d;)i=g.val&g.position,g.position>>=1,0==g.position&&(g.position=r,g.val=o(g.index++)),s|=(i>0?1:0)*l,l<<=1;switch(c=s){case 0:for(s=0,d=Math.pow(2,8),l=1;l!=d;)i=g.val&g.position,g.position>>=1,0==g.position&&(g.position=r,g.val=o(g.index++)),s|=(i>0?1:0)*l,l<<=1;p[h++]=e(s),c=h-1,u--;break;case 1:for(s=0,d=Math.pow(2,16),l=1;l!=d;)i=g.val&g.position,g.position>>=1,0==g.position&&(g.position=r,g.val=o(g.index++)),s|=(i>0?1:0)*l,l<<=1;p[h++]=e(s),c=h-1,u--;break;case 2:return b.join("")}if(0==u&&(u=Math.pow(2,f),f++),p[c])m=p[c];else{if(c!==h)return null;m=a+a.charAt(0)}b.push(m),p[h++]=a+m.charAt(0),a=m,0==--u&&(u=Math.pow(2,f),f++)}}};return a}();void 0!==t&&null!=t&&(t.exports=r)},()=>(n||o((n={exports:{}}
1).exports,n),n.exports)),f=((e,t,r)=>(r=null!=e?i(p(e)):{},((e,t,r,o)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of c(t))!u.call(e,n)&&n!==r&&d(e,n,{get:()=>t[n],enumerable:!(o=l(t,n))||o.enumerable});return e})(!t&&e&&e.__esModule?r:d(r,"default",{value:e,enumerable:!0}),e)))(h());async function m(e,t={}){"object"==typeof e&&!(e instanceof HTMLElement)&&(e.headless||"headless"===e.view)&&(t=e,e=null);let{config:r={},headless:o,loading:n="lazy",view:a}=t,s=o||"headless"===a,i=null,d=null;if("string"==typeof e)i=document.querySelector(e);else if(e instanceof HTMLElement)i=e;else if(!s||"object"!=typeof e)throw new Error("A valid container element is required.");if(!i){if(!s)throw new Error(`Cannot find element: "${e}"`);i=document.createElement("div"),A(i),document.body.appendChild(i)}let l=new URL(function(e={}){let t,{appUrl:r="https://livecodes.io",params:o={},config:n={},headless:a,import:s,lite:i,view:d,...l}=e;try{t=new URL(r)}catch(u){throw new Error(`${r} is not a valid URL.`)}let c=new URLSearchParams;Object.entries(l).forEach(([e,r])=>{void 0!==r&&t.searchParams.set(e,String(r))});let p="headless"===e.view||a;if(i&&(console.warn('Deprecation notice: "lite" option is deprecated. Use "config: { mode: \'lite\' }" instead.'),"object"==typeof n&&null==n.mode?n.mode="lite":t.searchParams.set("lite","true")),d&&(console.warn('Deprecation notice: The "view" option has been moved to "config.view". For headless mode use "headless: true".'),"object"==typeof n&&null==n.view&&"headless"!==d?n.view=d:t.searchParams.set("view",d)),"string"==typeof n)try{new URL(n),t.searchParams.set("config",encodeURIComponent(n))}catch(u){throw new Error('"config" is not a valid URL or configuration object.')}else n&&"object"==typeof n&&Object.keys(n).length>0&&(n.title&&"Untitled Project"!==n.title&&t.searchParams.set("title",n.title),n.description&&n.description.length>0&&t.searchParams.set("description",n.description),c.set("config","code/"+(0,f.compressToEncodedURIComponent)(JSON.stringify(n))));if(o&&"object"==typeof o&&Object.keys(o).length>0)try{c.set("params",(0,f.compressToEncodedURIComponent)(JSON.stringify(o)))}catch(u){Object.keys(o).forEach(e=>{t.searchParams.set(e,encodeURIComponent(String(o[e])))})}return s&&t.searchParams.set("x",encodeURIComponent(s)),p&&t.searchParams.set("headless","true"),c.toString().length>0&&(t.hash=c.toString()),t.href}(t)),c=l.origin;l.searchParams.set("embed","true"),l.searchParams.set("loading",s?"eager":n),l.searchParams.set("sdkVersion","0.13.0"),"object"==typeof r&&Object.keys(r).length>0&&l.searchParams.set("config","sdk");let p=t.params;"object"==typeof p&&Object.keys(p).length>0&&JSON.stringify(p).length<1800&&Object.keys(p).forEach(e=>{l.searchParams.set(e,encodeURIComponent(String(p[e])))});let u=!1,h="Cannot call API methods after calling `destroy()`.",m=[],b=(e,t="message")=>{addEventListener(t,e),m.push(e)},g=await new Promise(e=>{var t,o,a,p,u,h,f,m,g;if(!i)return;let w=i.dataset.height||i.style.height;if(w&&!s){let e=isNaN(Number(w))?w:w+"px";i.style.height=e}"false"!==i.dataset.defaultStyles&&!s&&((t=i.style).backgroundColor||(t.backgroundColor="#fff"),(o=i.style).border||(o.border="1px solid black"),(a=i.style).borderRadius||(a.borderRadius="8px"),(p=i.style).boxSizing||(p.boxSizing="border-box"),(u=i.style).padding||(u.padding="0"),(h=i.style).width||(h.width="100%"),(f=i.style).height||(f.height=i.style.height||"300px"),i.style.minHeight="200px",i.style.flexGrow="1",(m=i.style).overflow||(m.overflow="hidden"),(g=i.style).resize||(g.resize="vertical"));let v="livecodes",y=i.querySelector(`iframe.${v}`),x=y||document.createElement("iframe");x.classList.add(v),x.setAttribute("allow","accelerometer; camera; encrypted-media; display-capture; geolocation; gyroscope; microphone; midi; clipboard-read; clipboard-write; web-share"),x.setAttribute("allowtransparency","true"),x.setAttribute("allowpaymentrequest","true"),x.setAttribute("allowfullscreen","true"),x.setAttribute("sandbox","allow-same-origin allow-downloads allow-forms allow-modals allow-orientation-lock allow-pointer-lock allow-popups allow-presentation allow-scripts");let k="eager"===n?"eager":"lazy";x.setAttribute("loading",k),s?A(x):(x.style.height="100%",x.style.minHeight="200px",x.style.width="100%",x.style.margin="0",x.style.border="0",x.style.borderRadius=i.style.borderRadius),b(function e(t){var r;t.source!==x.contentWindow||t.origin!==c||"livecodes-init"!==(null==(r=t.data)?void 0:r.type)||(removeEventListener("message",e),d=Number(t.data.payload.appVersion.replace(/^v/,"")))}),(!d||d<46)&&b(function e(t){var o,n;t.source!==x.contentWindow||t.origin!==c||"livecodes-get-config"!==(null==(o=t.data)?void 0:o.type)||(removeEventListener("message",e),null==(n=x.contentWindow)||n.postMessage({type:"livecodes-config",payload:r},c))}),x.onload=()=>{e(x)},x.src=l.href,y||i.appendChild(x)}),w=new Promise(e=>{b(function t(r){var o;r.source!==g.contentWindow||r.origin!==c||"livecodes-ready"!==(null==(o=r.data)?void 0:o.type)||(removeEventListener("message",t),e(),w.settled=!0)})}),v=()=>u?Promise.reject(h):new Promise(async e=>{var t;w.settled&&e();null==(t=g.contentWindow)||t.postMessage({type:"livecodes-load"},c),await w,e()}),y=(e,t)=>new Promise(async(r,o)=>{var n;if(u)return o(h);await v();let a=_();b(function t(n){var s,i;if(n.source===g.contentWindow&&n.origin===c&&"livecodes-api-response"===(null==(s=n.data)?void 0:s.type)&&(null==(i=n.data)?void 0:i.id)===a&&n.data.method===e){removeEventListener("message",t);let e=n.data.payload;null!=e&&e.error?o(e.error):r(e)}}),null==(n=g.contentWindow)||n.postMessage({method:e,id:a,args:t},c)}),x={},k=["load","ready","code","console","tests","destroy"],j=(e,t)=>{var r;if(u)throw new Error(h);return k.includes(e)?(y("watch",[e]),x[e]||(x[e]=[]),null==(r=x[e])||r.push(t),{remove:()=>{var r,o;x[e]=null==(r=x[e])?void 0:r.filter(e=>e!==t),0===(null==(o=x[e])?void 0:o.length)&&y("watch",[e,"unsubscribe"])}}):{remove:()=>{}}};b(async function(e){var t,r,o,n;let a={"livecodes-app-loaded":"load","livecodes-ready":"ready","livecodes-change":"code","livecodes-console":"console","livecodes-test-results":"tests","livecodes-destroy":"destroy"}[null!=(r=null==(t=e.data)?void 0:t.type)?r:""];if(e.source!==g.contentWindow||e.origin!==c||!a||!x[a])return;let s=null==(o=e.data)?void 0:o.payload;
1null==(n=x[a])||n.forEach(e=>{e(s)})});let C;function A(e){e.style.position="absolute",e.style.top="0",e.style.visibility="hidden",e.style.opacity="0"}"lazy"===n&&"IntersectionObserver"in window&&(C=new IntersectionObserver((e,t)=>{e.forEach(async e=>{e.isIntersecting&&(await v(),t.unobserve(i))})},{rootMargin:"150px"}),C.observe(i));let _=()=>(String(Math.random())+Date.now().toFixed()).replace("0.","");return{load:()=>v(),run:()=>y("run"),format:e=>y("format",[e]),getShareUrl:e=>y("getShareUrl",[e]),getConfig:e=>y("getConfig",[e]),setConfig:e=>y("setConfig",[e]),getCode:()=>y("getCode"),show:(e,t)=>y("show",[e,t]),runTests:()=>y("runTests"),onChange:e=>j("code",e),watch:j,exec:(e,...t)=>y("exec",[e,...t]),destroy:()=>{return u?Promise.reject(h):(null==(e=null==g?void 0:g.remove)||e.call(g),Object.values(x).forEach(e=>{e.length=0}),m.forEach(e=>removeEventListener("message",e)),m.length=0,C&&i&&C.unobserve(i),u=!0,Promise.resolve());var e}}}function b(e){let t=(0,a.useRef)(null),[r,o]=(0,a.useState)(e.className||""),[n,i]=(0,a.useState)(e.style||{}),[d,l]=(0,a.useState)(e.height),[c,p]=(0,a.useState)(),[u,h]=(0,a.useState)(JSON.stringify(e.config||"")),[f,b]=(0,a.useState)("");return(0,a.useEffect)(()=>{if(!t.current)return;let{className:r,style:n,height:a,sdkReady:s,config:d,...g}=e;if(o(r||""),i(n||{}),l(a),c&&f===JSON.stringify(g)){if(u===JSON.stringify(d))return;h(JSON.stringify(d)),"string"==typeof d?fetch(d).then(e=>e.json()).then(e=>{null==c||c.setConfig(e)}):d&&c.setConfig(d)}else b(JSON.stringify(g)),null==c||c.destroy(),m(t.current,{config:d,...g}).then(e=>{p(e),"function"==typeof s&&s(e)})},[e]),(0,a.useEffect)(()=>()=>{null==c||c.destroy()},[]),(0,s.jsx)("div",{ref:t,className:r,style:n,"data-height":d})}},34056(e,t,r){r.d(t,{R:()=>s,x:()=>i});var o=r(22155);const n={},a=o.createContext(n);function s(e){const t=o.useContext(a);return o.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function i(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:s(e.components),o.createElement(a.Provider,{value:t},e.children)}},55306(e,t,r){r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>d,default:()=>u,frontMatter:()=>i,metadata:()=>o,toc:()=>c});const o=JSON.parse('{"id":"address-finder/separate-input","title":"Separate Input from Address","description":"Specify an inputField to apply the Address Finder to a field other than the first line of the address.","source":"@site/docs/address-finder/separate-input.mdx","sourceDirName":"address-finder","slug":"/address-finder/separate-input","permalink":"/docs/address-finder/separate-input","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Separate Input from Address","sidebar_label":"Separate Input from Address"},"sidebar":"addressfinder","previous":{"title":"Accessibility","permalink":"/docs/address-finder/accessibility"},"next":{"title":"Attach Multiple Instances","permalink":"/docs/address-finder/multiple"}}');var n=r(65723),a=r(34056),s=r(1318);const i={title:"Separate Input from Address",sidebar_label:"Separate Input from Address"},d=void 0,l={},c=[{value:"Live Demo",id:"live-demo",level:2}];function p(e){const t={code:"code",h2:"h2",p:"p",...(0,a.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:["Specify an ",(0,n.jsx)(t.code,{children:"inputField"})," to apply the Address Finder to a field other than the first line of the address."]}),"\n",(0,n.jsx)(t.h2,{id:"live-demo",children:"Live Demo"}),"\n",(0,n.jsx)(s.n,{html:'<form style="max-width: 450px; padding: 10px;">\n  <label for="input">Search Your Address</label>\n  <input type="text" id="input" placeholder="Start typing address here" />\n  <label for="line_1">Address First Line</label>\n  <input type="text" id="line_1" />\n  <label for="line_2">Address Second Line</label>\n  <input type="text" id="line_2" />\n  <label for="line_3">Address Third Line</label>\n  <input type="text" id="line_3" />\n  <label for="post_town">Town or City</label>\n  <input type="text" id="post_town" />\n  <label for="postcode">Postcode</label>\n  <input type="text" id="postcode" />\n</form>',js:'\nimport { AddressFinder }
1 from "@ideal-postcodes/address-finder";\n\nAddressFinder.setup({\n  apiKey: "ak_test",\n  inputField: "#input",\n  outputFields: {\n    line_1: "#line_1",\n    line_2: "#line_2",\n    line_3: "#line_3",\n    post_town: "#post_town",\n    postcode: "#postcode",\n  },\n});\n'})]})}function u(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(p,{...e})}):p(e)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.