webshims.register("form-datalist",function(e,t,i,n,a,r){"use strict";var o=function(e){e&&"string"==typeof e||(e="DOM"),o[e+"Loaded"]||(o[e+"Loaded"]=!0,t.ready(e,function(){t.loader.loadList(["form-datalist-lazy"])}))},s={submit:1,button:1,reset:1,hidden:1,range:1,date:1,month:1};t.modules["form-number-date-ui"].loaded&&e.extend(s,{number:1,time:1}),t.propTypes.element=function(i){t.createPropDefault(i,"attr"),i.prop||(i.prop={get:function(){var t=e.attr(this,"list");return t&&(t=n.getElementById(t),t&&i.propNodeName&&!e.nodeName(t,i.propNodeName)&&(t=null)),t||null},writeable:!1})},function(){var l=e.webshims.cfg.forms,u=Modernizr.input.list;if(!u||l.customDatalist){var c=function(){var i={autocomplete:{attr:{get:function(){var t=this,i=e.data(t,"datalistWidget");return i?i._autocomplete:"autocomplete"in t?t.autocomplete:t.getAttribute("autocomplete")},set:function(t){var i=this,n=e.data(i,"datalistWidget");n?(n._autocomplete=t,"off"==t&&n.hideList()):"autocomplete"in i?i.autocomplete=t:i.setAttribute("autocomplete",t)}}}};u&&((e("<datalist><select><option></option></select></datalist>").prop("options")||[]).length||t.defineNodeNameProperty("datalist","options",{prop:{writeable:!1,get:function(){var t=this.options||[];if(!t.length){var i=this,n=e("select",i);n[0]&&n[0].options&&n[0].options.length&&(t=n[0].options)}return t}}}),i.list={attr:{get:function(){var i=t.contentAttr(this,"list");return null!=i?(e.data(this,"datalistListAttr",i),s[e.prop(this,"type")]||s[e.attr(this,"type")]||this.removeAttribute("list")):i=e.data(this,"datalistListAttr"),null==i?a:i},set:function(i){var n=this;e.data(n,"datalistListAttr",i),s[e.prop(this,"type")]||s[e.attr(this,"type")]?n.setAttribute("list",i):t.objectCreate(d,a,{input:n,id:i,datalist:e.prop(n,"list")}),e(n).triggerHandler("listdatalistchange")}},initAttr:!0,reflect:!0,propType:"element",propNodeName:"datalist"}),t.defineNodeNameProperties("input",i),t.addReady(function(t,i){i.filter("datalist > select, datalist, datalist > option, datalist > select > option").closest("datalist").each(function(){e(this).triggerHandler("updateDatalist")})})},d={_create:function(i){if(!s[e.prop(i.input,"type")]&&!s[e.attr(i.input,"type")]){var n=i.datalist,r=e.data(i.input,"datalistWidget"),l=this;return n&&r&&r.datalist!==n?(r.datalist=n,r.id=i.id,e(r.datalist).off("updateDatalist.datalistWidget").on("updateDatalist.datalistWidget",e.proxy(r,"_resetListCached")),r._resetListCached(),a):n?(r&&r.datalist===n||(this.datalist=n,this.id=i.id,this.hasViewableData=!0,this._autocomplete=e.attr(i.input,"autocomplete"),e.data(i.input,"datalistWidget",this),o("WINDOWLOAD"),t.isReady("form-datalist-lazy")?this._lazyCreate(i):(e(i.input).one("focus",o),t.ready("form-datalist-lazy",function(){l._destroyed||l._lazyCreate(i)}))),a):(r&&r.destroy(),a)}},destroy:function(t){var r,o=e.attr(this.input,"autocomplete");e(this.input).off(".datalistWidget").removeData("datalistWidget"),this.shadowList.remove(),e(n).off(".datalist"+this.id),e(i).off(".datalist"+this.id),this.input.form&&this.input.id&&e(this.input.form).off("submit.datalistWidget"+this.input.id),this.input.removeAttribute("aria-haspopup"),o===a?this.input.removeAttribute("autocomplete"):e(this.input).attr("autocomplete",o),t&&"beforeunload"==t.type&&(r=this.input,setTimeout(function(){e.attr(r,"list",e.attr(r,"list"))},9)),this._destroyed=!0}};t.loader.addModule("form-datalist-lazy",{noAutoCallback:!0,options:e.extend(r,{shadowListProto:d})}),c()}}()});