(()=>{"use strict";var e,t={63309:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var o=n(r(73609));window.createSnippetChooser=function(e){var t=o.default("#"+e+"-chooser"),r=t.find(".title"),n=o.default("#"+e),a=t.find(".edit-link"),i=t.data("chooserUrl"),l=null;n.val()&&(l={id:n.val(),edit_link:a.attr("href"),string:r.text()});var u={getState:function(){return l},getValue:function(){return l&&l.id},setState:function(e){e?(n.val(e.id),r.text(e.string),t.removeClass("blank"),a.attr("href",e.edit_link)):(n.val(""),t.addClass("blank")),l=e},getTextLabel:function(e){if(!l)return null;var t=l.string;return e&&e.maxLength&&t.length>e.maxLength?t.substring(0,e.maxLength-1)+"…":t},focus:function(){o.default(".action-choose",t).focus()},openChooserModal:function(){var e="";wagtailConfig.ACTIVE_CONTENT_LOCALE&&(e="?locale="+wagtailConfig.ACTIVE_CONTENT_LOCALE),ModalWorkflow({url:i+e,onload:SNIPPET_CHOOSER_MODAL_ONLOAD_HANDLERS,responses:{snippetChosen:function(e){u.setState(e)}}})},clear:function(){u.setState(null)}};return o.default(".action-choose",t).on("click",(function(){u.openChooserModal()})),o.default(".action-clear",t).on("click",(function(){u.clear()})),u}},73609:e=>{e.exports=jQuery}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var a=r[e]={id:e,loaded:!1,exports:{}};return t[e].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}n.m=t,e=[],n.O=(t,r,o,a)=>{if(!r){var i=1/0;for(s=0;s<e.length;s++){for(var[r,o,a]=e[s],l=!0,u=0;u<r.length;u++)(!1&a||i>=a)&&Object.keys(n.O).every((e=>n.O[e](r[u])))?r.splice(u--,1):(l=!1,a<i&&(i=a));l&&(e.splice(s--,1),t=o())}return t}a=a||0;for(var s=e.length;s>0&&e[s-1][2]>a;s--)e[s]=e[s-1];e[s]=[r,o,a]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.j=602,(()=>{var e={602:0};n.O.j=t=>0===e[t];var t=(t,r)=>{var o,a,[i,l,u]=r,s=0;for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(u)var c=u(n);for(t&&t(r);s<i.length;s++)a=i[s],n.o(e,a)&&e[a]&&e[a][0](),e[i[s]]=0;return n.O(c)},r=globalThis.webpackChunkwagtail=globalThis.webpackChunkwagtail||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),n.O(void 0,[876],(()=>n(63309)));var o=n.O(void 0,[876],(()=>n(90971)));o=n.O(o)})();
//# sourceMappingURL=snippet-chooser.js.map