!function(){function t(t,n){var i,o,e,r,a,c,s;void 0!==(i=wp.customize.control(t))&&(o=(n=n||i.setting.get())["font-family"]&&kirkiGoogleFonts.items[n["font-family"]],e=[400,700],r=!o,a=wp.customize.control(t+"[font-weight]"),c=wp.customize.control(t+"[font-style]"),o&&(e=[],_.each(kirkiGoogleFonts.items[n["font-family"]].variants,(function(t){-1!==t.indexOf("i")&&(r=!0),t="regular"===t||"italic"===t?400:parseInt(t,10),-1===e.indexOf(t)&&e.push(parseInt(t,10)),!r&&c&&c.setting.set("normal")})),-1===e.indexOf(parseInt(n["font-weight"],10))&&(s=e.reduce((function(t,i){return Math.abs(i-parseInt(n["font-weight"],10))<Math.abs(t-parseInt(n["font-weight"],10))?i:t})),a.doSelectAction("selectOption",s.toString()),a.setting.set(s.toString())),1<e.length&&i.active()?a.activate():a.deactivate(),a&&(a.params.choices={},_.each([100,200,300,400,500,600,700,800,900],(function(t){-1!==e.indexOf(t)&&(a.params.choices[t.toString()]=kirkiFontWeights[t.toString()],a.formattedOptions=[],a.renderContent())})))),wp.hooks.addAction("kirki.dynamicControl.initKirkiControl","kirki",(function(n){a&&t+"[font-weight]"===n.id&&_.each([100,200,300,400,500,600,700,800,900],(function(t){-1!==e.indexOf(t)&&(a.params.choices[t.toString()]=kirkiFontWeights[t.toString()],a.formattedOptions=[],a.renderContent())}))})))}jQuery(document).ready((function(){_.each(kirkiTypographyControls,(function(n){t(n),wp.customize(n,(function(i){i.bind((function(i){t(n,i)}))}))}))}))}();
//# sourceMappingURL=control.js.map
