• File: WGIntxf941P.js
  • Full Path: /srv/http/kleku/pub/radary/Jak nie dać się naciągnąć na mandat _files/WGIntxf941P.js
  • Date Modified: 2019-09-06 10:00:00
  • File size: 36.86 KB
  • MIME-type: application/javascript
  • Charset: utf-8
 
Open Back
/*1367995895,173214269*/

if (self.CavalryLogger) { CavalryLogger.start_js(["fE6g5"]); }

__d("ComposerPublishTrackingStory",["Event","ge","reportData","DOMQuery"],function(a,b,c,d,e,f){var g=b('Event'),h=b('ge'),i=b('reportData'),j=b('DOMQuery');f.init=function(k){g.listen(k,'submit',function(){var l=h('home_stream');if(!l)return;var m=j.scry(l,'.uiStreamStory')[0];if(m&&m.getAttribute('data-ft')){var n=JSON.parse(m.getAttribute('data-ft'));if(!(("mf_story_key" in n)&&("qid" in n)))return;var o={mf_story_key:n.mf_story_key,qid:n.qid};i("compose",{ft:o});}});};});
__d("ComposerXAttachmentBootstrap",["CSS","Form","Parent","URI","cx"],function(a,b,c,d,e,f){var g=b('CSS'),h=b('Form'),i=b('Parent'),j=b('URI'),k=b('cx'),l=[],m={bootstrap:function(n){m.load(i.byTag(n,'form'),n.getAttribute('data-endpoint'));},load:function(n,o,p){var q=j(o).addQueryData({composerurihash:m.getURIHash(o)});g.conditionClass(n,"_fu",p);var r=i.byClass(n,"_2_4");g.removeClass(r,'async_saving');h.setDisabled(n,false);n.action=q.toString();h.bootstrap(n);},getURIHash:function(n){if(n==='initial')return 'initial';var o=l.indexOf(n);if(o!==-1){return o+'';}else{o=l.length;l[o]=n;return o+'';}}};e.exports=m;});
__d("ComposerXStore",["function-extensions","Arbiter","ge"],function(a,b,c,d,e,f){b('function-extensions');var g=b('Arbiter'),h=b('ge'),i={};function j(l,m){return 'ComposerX/'+l+'/'+m;}var k={set:function(l,m,n){if(!i[l])i[l]={};i[l][m]=n;g.inform(j(l,m),{},g.BEHAVIOR_STATE);},get:function(l,m){if(i[l])return i[l][m];return null;},getAllForComposer:function(l){return i[l]||{};},waitForComponents:function(l,m,n){g.registerCallback(n,m.map(j.curry(l)));}};g.subscribe('page_transition',function(){for(var l in i)if(!h(l))delete i[l];});e.exports=k;});
__d("ComposerX",["Arbiter","ComposerXAttachmentBootstrap","ComposerXStore","CSS","DOM","DOMQuery","copyProperties","csx","cx","getObjectValues"],function(a,b,c,d,e,f){var g=b('Arbiter'),h=b('ComposerXAttachmentBootstrap'),i=b('ComposerXStore'),j=b('CSS'),k=b('DOM'),l=b('DOMQuery'),m=b('copyProperties'),n=b('csx'),o=b('cx'),p=b('getObjectValues'),q='any';function r(s){this._root=s;this._composerID=s.id;this._attachments={};this._attachmentFetchForm=l.find(s,"._2_4");this._resetSubscription=g.subscribe('composer/publish',function(t,u){if(u.composer_id===this._composerID)this.reset();}.bind(this));}m(r.prototype,{_endpointHashToShow:q,_lastFetchEndpoint:'',_initialAttachmentEndpoint:'',getAttachment:function(s,t){var u=h.getURIHash(s);this._endpointHashToShow=u;var v=this._attachments[u];if(v){this._showAttachmentAfterComponentsLoaded(u);}else this.fetchAttachmentData(s,t);},fetchAttachmentData:function(s,t){var u=h.getURIHash(s);if(this._attachments[u])return;if(s!==this._lastFetchEndpoint){h.load(this._attachmentFetchForm,s,t);this._lastFetchEndpoint=s;}},setAttachment:function(s,t,u,v){this._setupAttachment(s,t,u,v);this._showAttachmentAfterComponentsLoaded(s);},setInitialAttachment:function(s,t,u,v){var w=h.getURIHash(s);this._setupAttachment(w,t,u,v);this._initialAttachmentEndpoint=s;if(!this._currentInstance)this._showAttachmentAfterComponentsLoaded(w);},setComponent:function(s,t){if(!i.get(this._composerID,s)){i.set(this._composerID,s,t);k.appendContent(this._attachmentFetchForm,k.create('input',{type:'hidden',name:'loaded_components[]',value:s}));}},reset:function(){if(this._currentInstance){this._currentInstance.cleanup();this._currentInstance=null;}for(var s in this._attachments)this._attachments[s].instance.reset();var t=i.getAllForComposer(this._composerID);p(t).forEach(function(u){if(u.reset)u.reset(u);});this.getAttachment(this._initialAttachmentEndpoint);g.inform('composer/reset');},destroy:function(){if(this._resetSubscription){this._resetSubscription.unsubscribe();this._resetSubscription=null;}},addPlaceholders:function(s,t){var u;for(var v in this._attachments){u=this._attachments[v];if(u.instance===s){t.forEach(function(w){u.placeholders.push(w);u.required_components.push(w.component_name);});break;}}if(this._currentInstance===s)this._fillPlaceholders(t);},_setupAttachment:function(s,t,u,v){t.setComposerID(this._composerID);this._attachments[s]={instance:t,placeholders:u,required_components:v};var w=l.find(this._root,"div._55d0"),x=t.getRoot();if(x.parentNode!==w){j.hide(x);k.appendContent(w,x);}},_showAttachment:function(s,t,u){if(this._currentInstance===s)return;if(this._endpointHashToShow===q){this._endpointHashToShow=null;}else if(this._endpointHashToShow!==t)return;if(this._currentInstance){if(!this._currentInstance.canSwitchAway())return;this._currentInstance.cleanup();}this._currentInstance=s;var v=l.find(this._root,"div._55d0"),w=v.childNodes,x=s.getRoot();for(var y=0;y<w.length;y++)if(w[y]!==x)j.hide(w[y]);j.show(x);this._fillPlaceholders(u);var z=h.getURIHash(this._initialAttachmentEndpoint),aa=t===z;s.initWithComponents(aa);this._setAttachmentSelectedClass(s.attachmentClassName);g.inform('composer/initializedAttachment',{composerRoot:this._root,isInitial:aa});},_showAttachmentAfterComponentsLoaded:function(s){var t=this._attachments[s];i.waitForComponents(this._composerID,t.required_components,this._showAttachment.bind(this,t.instance,s,t.placeholders));},_fillPlaceholders:function(s){s.forEach(function(t){var u=i.get(this._composerID,t.component_name);if(t.element!==u.element.parentNode)k.setContent(t.element,u.element);}.bind(this));},_setAttachmentSelectedClass:function(s){var t=l.scry(this._root,"._519b")[0],u;if(t){j.removeClass(t,"_519b");u=l.scry(t,'*[aria-pressed="true"]')[0];if(u)u.setAttribute('aria-pressed','false');}if(s){var v=l.scry(this._root,'.'+s)[0];if(v){j.addClass(v,"_519b");u=l.scry(v,'*[aria-pressed="false"]')[0];if(u)u.setAttribute('aria-pressed','true');}}}});e.exports=r;});
__d("ComposerXAttachment",["ComposerXStore","copyProperties","emptyFunction"],function(a,b,c,d,e,f){var g=b('ComposerXStore'),h=b('copyProperties'),i=b('emptyFunction');function j(){}h(j.prototype,{getRoot:i,initWithComponents:function(k){},cleanup:i,reset:i,attachmentClassName:'',getComponent:function(k){return g.get(this._composerID,k);},canSwitchAway:i.thatReturnsTrue,setComposerID:function(k){this._composerID=k;},allowOGTagPreview:function(){return false;}});e.exports=j;});
__d("ComposerXController",["Arbiter","ComposerX","ComposerXAttachmentBootstrap","Parent","$","cx","emptyFunction","ge"],function(a,b,c,d,e,f){var g=b('Arbiter'),h=b('ComposerX'),i=b('ComposerXAttachmentBootstrap'),j=b('Parent'),k=b('$'),l=b('cx'),m=b('emptyFunction'),n=b('ge'),o={};function p(r){var s=j.byClass(k(r),"_119"),t=s.id;if(!o[t])o[t]=new h(s);return o[t];}var q={getAttachment:function(r,s,t){var u=p(r);u.getAttachment(s,t);},fetchAttachmentData:function(r,s,t){p(r).fetchAttachmentData(s,t);},setAttachment:function(r,s,t,u,v){var w=p(r);w.setAttachment(s,t,u,v);},setInitialAttachment:function(r,s,t,u,v){var w=p(r);w.setInitialAttachment(s,t,u,v);},setComponent:function(r,s,t){var u=p(r);u.setComponent(s,t);},reset:function(r){var s=p(r);s.reset();},holdTheMarkup:m,getEndpoint:function(r,s,t){var u=p(r);i.load(u._attachmentFetchForm,s,t);},addPlaceholders:function(r,s,t){var u=p(r);u.addPlaceholders(s,t);}};i.bootstrap=function(r){q.getAttachment(r,r.getAttribute('data-endpoint'));};g.subscribe('page_transition',function(){for(var r in o)if(!n(r)){o[r].destroy();delete o[r];}});e.exports=q;});
__d("ComposerXAttachmentUtils",["CSS","DOMQuery","Focus","Input","PageTransitions","Run","StickyPlaceholderInput","tx"],function(a,b,c,d,e,f){var g=b('CSS'),h=b('DOMQuery'),i=b('Focus'),j=b('Input'),k=b('PageTransitions'),l=b('Run'),m=b('StickyPlaceholderInput'),n=b('tx'),o={initMentions:function(p,q){p.instance.setPlaceholder(q);var r=h.find(p.element,'textarea.input');i.set(r);},setStickyPlaceholderForMentions:function(p,q){if(h.contains(p.element,document.activeElement)&&g.hasClass(document.activeElement,'DOMControl_placeholder'))document.activeElement.blur();p.instance.setPlaceholder(q);},setStickyPlaceholderForTypeahead:function(p,q){var r=h.find(p,'.textInput');m.setPlaceholderText(r,q);},registerInputForLeaveWarning:function(p){l.onBeforeUnload(function(){var q=k.getNextURI();if(q.getQueryData().hasOwnProperty('theater'))return;if(a.Dialog&&a.Dialog.getCurrent())return;if(p.offsetParent!==null&&!j.isEmpty(p))return "Tw\u00f3j post nie jest jeszcze uko\u0144czony. Czy chcesz wyj\u015b\u0107, nie ko\u0144cz\u0105c?";});}};e.exports=o;});
__d("DragDropFileUpload",[],function(a,b,c,d,e,f){f.isSupported=function(){return typeof(FileList)!=="undefined";};});
__d("DocumentDragDrop",["Event","Arbiter","CSS","DOM","DOMQuery","DragDropFileUpload","emptyFunction","getObjectValues"],function(a,b,c,d,e,f){var g=b('Event'),h=b('Arbiter'),i=b('CSS'),j=b('DOM'),k=b('DOMQuery'),l=b('DragDropFileUpload'),m=b('emptyFunction'),n=b('getObjectValues'),o={},p=0;function q(){p=0;n(o).forEach(function(t){i.removeClass(t.element,t.className);h.inform('dragleave',{element:t.element});});}function r(){if(!l.isSupported())return;g.listen(document,'dragenter',function(u){if(p===0)n(o).forEach(function(v){i.addClass(v.element,v.className);h.inform('dragenter',{element:v.element,event:u});});p++;});g.listen(document,'dragleave',function(u){p--;if(p===0)q();});g.listen(document,'drop',function(u){var v=u.getTarget();if(k.isNodeOfType(u.getTarget(),'input'))if(v.type==='file')return;u.prevent();});g.listen(document,'dragover',g.prevent);var t=null;document.addEventListener('dragover',function(){t&&clearTimeout(t);t=setTimeout(q,839);},true);r=m;}var s={registerStatusElement:function(t,u){r();o[j.getID(t)]={element:t,className:u};},removeStatusElement:function(t){var u=j.getID(t),v=o[u];i.removeClass(v.element,v.className);delete o[u];}};e.exports=s;});
__d("DragDropTarget",["Event","CSS","DocumentDragDrop","DragDropFileUpload","copyProperties","emptyFunction"],function(a,b,c,d,e,f){var g=b('Event'),h=b('CSS'),i=b('DocumentDragDrop'),j=b('DragDropFileUpload'),k=b('copyProperties'),l=b('emptyFunction');function m(n){this._element=n;this._listeners=[];this._statusElem=n;this._dragEnterCount=0;this._enabled=false;}k(m.prototype,{_onFilesDropCallback:l,_onURLDropCallback:l,_fileFilterFn:l.thatReturnsArgument,setOnFilesDropCallback:function(n){this._onFilesDropCallback=n;return this;},setOnURLDropCallback:function(n){this._onURLDropCallback=n;return this;},enable:function(){if(!j.isSupported())return this;i.registerStatusElement(this._statusElem,'fbWantsDragDrop');this._listeners.push(g.listen(this._element,'dragenter',this._onDragEnter.bind(this)));this._listeners.push(g.listen(this._element,'dragleave',this._onDragLeave.bind(this)));this._listeners.push(g.listen(this._element,'dragover',g.kill));this._listeners.push(g.listen(this._element,'drop',function(n){this._dragEnterCount=0;h.removeClass(this._statusElem,'fbDropReady');h.removeClass(this._statusElem,'fbDropReadyPhoto');h.removeClass(this._statusElem,'fbDropReadyPhotos');h.removeClass(this._statusElem,'fbDropReadyLink');var o=this._fileFilterFn(n.dataTransfer.files);if(o.length)this._onFilesDropCallback(o);var p=n.dataTransfer.getData('url')||n.dataTransfer.getData('text/uri-list');if(p)this._onURLDropCallback(p);n.kill();}.bind(this)));this._enabled=true;return this;},disable:function(){if(!this._enabled)return this;i.removeStatusElement(this._statusElem,'fbWantsDragDrop');h.removeClass(this._statusElem,'fbDropReady');h.removeClass(this._statusElem,'fbDropReadyPhoto');h.removeClass(this._statusElem,'fbDropReadyPhotos');h.removeClass(this._statusElem,'fbDropReadyLink');while(this._listeners.length)this._listeners.pop().remove();this._enabled=false;return this;},setFileFilter:function(n){this._fileFilterFn=n;return this;},setStatusElement:function(n){this._statusElem=n;return this;},_onDragEnter:function(n){if(this._dragEnterCount===0){var o=n.dataTransfer.items,p=false;for(var q=0;q<o.length;q++)if(!o[q].type.match('image/*')){p=true;break;}h.addClass(this._statusElem,'fbDropReady');if(p){h.addClass(this._statusElem,'fbDropReadyLink');}else if(o.length>1){h.addClass(this._statusElem,'fbDropReadyPhotos');}else h.addClass(this._statusElem,'fbDropReadyPhoto');}this._dragEnterCount++;},_onDragLeave:function(){this._dragEnterCount=Math.max(this._dragEnterCount-1,0);if(this._dragEnterCount===0){h.removeClass(this._statusElem,'fbDropReady');h.removeClass(this._statusElem,'fbDropReadyPhoto');h.removeClass(this._statusElem,'fbDropReadyPhotos');h.removeClass(this._statusElem,'fbDropReadyLink');}}});e.exports=m;});
__d("ComposerXDragDrop",["Arbiter","ComposerXController","CSS","DragDropTarget","DOMQuery","Parent","URI","copyProperties","csx","cx"],function(a,b,c,d,e,f){var g=b('Arbiter'),h=b('ComposerXController'),i=b('CSS'),j=b('DragDropTarget'),k=b('DOMQuery'),l=b('Parent'),m=b('URI'),n=b('copyProperties'),o=b('csx'),p=b('cx'),q='/ajax/composerx/attachment/media/upload/',r='/ajax/composerx/attachment/link/scraper/',s=function(u){u();};function t(u,v,w,x){this._root=u;this._composerID=v;this._targetID=w;x=x||s;this._dragdrop=new j(u).setOnFilesDropCallback(function(y){x(this._uploadFiles.bind(this,y));}.bind(this)).setFileFilter(t.filterImages).enable();t.handleDragEnterAndLeave(u);g.subscribe('composer/deactivateDragdrop',function(){this.deactivate();}.bind(this));}n(t,{handleDragEnterAndLeave:function(u){var v=k.scry(l.byClass(u,"_119"),"._2wr");g.subscribe('dragenter',function(w,x){if(u==x.element)v.forEach(i.hide);});g.subscribe('dragleave',function(w,x){if(u==x.element)v.forEach(i.show);});},filterImages:function(u){var v=[];for(var w=0;w<u.length;w++)if(u[w].type.match('image/*'))v.push(u[w]);return v;}});n(t.prototype,{enableURLDropping:function(){this._dragdrop.setOnURLDropCallback(this._onURLDrop.bind(this));},deactivate:function(){this._dragdrop.disable();},_uploadFiles:function(u){h.getAttachment(this._root,q);g.inform('ComposerXFilesStore/filesDropped/'+this._composerID+'/mediaupload',{files:u},g.BEHAVIOR_PERSISTENT);},_onURLDrop:function(u){var v=new m(r);v.addQueryData({scrape_url:encodeURIComponent(u)});h.getAttachment(this._root,v.toString());}});e.exports=t;});
__d("ComposerXBootloadStatusAttachment",["Event","function-extensions","Arbiter","AsyncRequest","Bootloader","Class","ComposerXAttachment","ComposerXController","ComposerXDragDrop","ComposerXStore","CSS","DOM","DOMQuery","Focus","Parent","PlaceholderListener","PrivacyConst","URI","SelectorDeprecated","copyProperties","csx","cx"],function(a,b,c,d,e,f){var g=b('Event');b('function-extensions');var h=b('Arbiter'),i=b('AsyncRequest'),j=b('Bootloader'),k=b('Class'),l=b('ComposerXAttachment'),m=b('ComposerXController'),n=b('ComposerXDragDrop'),o=b('ComposerXStore'),p=b('CSS'),q=b('DOM'),r=b('DOMQuery'),s=b('Focus'),t=b('Parent'),u=b('PlaceholderListener'),v=b('PrivacyConst'),w=b('URI'),x=b('SelectorDeprecated'),y=b('copyProperties'),z=b('csx'),aa=b('cx'),ba={};function ca(da,ea){this.parent.construct(this);this._root=da;this._config=ea;}k.extend(ca,l);y(ca.prototype,{_attachmentIsActive:false,_bootloading:false,_fullVersion:false,_focusListener:null,_privacyWidgetTags:null,_scraper:null,_dragdrop:null,attachmentClassName:"_4j",getRoot:function(){return this._root;},initWithComponents:function(da){ba[this._composerID]=this;this._attachmentIsActive=true;var ea=r.find(this.getComponent('maininput').element,'textarea.input');if(this._fullVersion){this._fullInitWithComponents();}else if(!this._bootloading)if(r.contains(this._root,document.activeElement)){this._onInitialFocus();}else this._focusListener=g.listen(ea,'focus',this._onInitialFocus.bind(this));this._dragEnterHandler=h.subscribe('dragenter',function(fa,ga){if(ga.element==this._root){var ha=ga.event.dataTransfer.items,ia;if(ha)ia=n.filterImages(ha);if(ia&&ia.length>0){s.set(ea);}else{var ja=t.byClass(this._root,'focus_target');u.expandInput(ja);if(!this._bootloading&&!this._fullVersion)this._onInitialFocus();}}}.bind(this));this.getComponent('maininput').instance.setPlaceholder(this._config.mentionsPlaceholder);if(!da)s.set(ea);if(this._config.plus_version){this._dragdrop=new n(this._root,this._composerID,this._config.targetID);this._dragdrop.enableURLDropping();}},_fullInitWithComponents:function(){j.loadModules(['ComposerXPrivacyWidgetTags','URLScraper','URI'],function(da,ea,fa){this._tagger.init(this);this._privacyWidgetTags=new da(this);var ga=r.find(this.getComponent('maininput').element,'textarea.input');if(!this._scraper){this._scraper=new ea(ga);this._scraper.subscribe('match',function(ha,ia){var ja=this._getScraperEndpoint();ja.addQueryData({scrape_url:encodeURIComponent(ia.url)});m.getAttachment(this._root,ja.toString());}.bind(this));}this._scraper.enable();this._scraper.check();}.bind(this));this._initPrivacyReminder();},_initPrivacyReminder:function(){if(!this._reminderDialog||this._reminderShown)return;var da=this.getComponent('mainprivacywidget'),ea=x.getSelectedOptions(da.element),fa=x.getOptionValue(ea[0]);if(fa!==String(v.BaseValue.SELF))return;this._reminderDialog.setContext(this.getComponent('mainprivacywidget').element).show();this._reminderShown=true;var ga=function(){new i('/ajax/privacy/reminders/dismiss').setData({type:'only_me'}).send();this._reminderDialog.hide();}.bind(this);this._reminderEvents=[g.listen(this._reminderDialog.getContent(),'click',ga),g.listen(this._reminderDialog.getContext(),'click',ga)];},cleanup:function(){this._attachmentIsActive=false;if(this._focusListener){this._focusListener.remove();this._focusListener=null;}if(this._reminderDialog&&this._reminderShown){this._reminderDialog.hide();this._reminderEvents.forEach(function(da){da.remove();});}if(this._dragdrop){this._dragdrop.deactivate();this._dragdrop=null;}if(this._fullVersion){this._tagger.cleanup();this._privacyWidgetTags.destroy();this._privacyWidgetTags=null;this._scraper.disable();}if(this._dragEnterHandler){this._dragEnterHandler.unsubscribe();this._dragEnterHandler=null;}},reset:function(){var da=t.byClass(this._root,"child_was_focused");if(da)p.removeClass(da,"child_was_focused");if(this._tagger)this._tagger.reset();this.getComponent('maininput').instance.setPlaceholder(this._config.mentionsPlaceholder);},canSwitchAway:function(){return !t.byClass(this._root,'async_saving');},setBootloadedContent:function(da,ea,fa,ga){this._reminderDialog=ga;var ha=fa.map(function(ia){return ia.component_name;});o.waitForComponents(this._composerID,ha,function(){var ia=r.find(this._root,"._3-6"),ja=r.find(this._root,"._3-7");q.setContent(ia,da.tagger_content);q.setContent(ja,da.tagger_icons);m.addPlaceholders(this._root,this,fa);this._tagger=ea;this._fullVersion=true;if(this._attachmentIsActive){if(this._focusListener){this._focusListener.remove();this._focusListener=null;}this._fullInitWithComponents();}}.bind(this));},_getScraperEndpoint:function(){return w('/ajax/composerx/attachment/link/scraper/');},_onInitialFocus:function(){m.getEndpoint(this._root,'/ajax/composerx/attachment/status/bootload/',true);this._bootloading=true;},allowOGTagPreview:function(){return true;}});ca.setBootloadedContent=function(da,ea,fa,ga,ha){var ia=ba[da];if(ia)ia.setBootloadedContent(ea,fa,ga,ha);};e.exports=ca;});
__d("ComposerXMentionsInputReset",["DOMQuery","Input"],function(a,b,c,d,e,f){var g=b('DOMQuery'),h=b('Input');function i(j){var k=g.scry(j.element,'textarea.input')[0];j.instance.reset();h.reset(k);}e.exports=i;});
__d("ComposerXPrivacyWidgetReset",["Arbiter"],function(a,b,c,d,e,f){var g=b('Arbiter');function h(i){g.inform('Composer/changedtags',{withTags:[],mention:{},eventTag:false});}e.exports=h;});
__d("ComposerXTaggerIconReset",["CSS","cx"],function(a,b,c,d,e,f){var g=b('CSS'),h=b('cx');function i(j){g.removeClass(j.element,"_1dsa");g.removeClass(j.element,"_1dsb");g.removeClass(j.element,"_509o");}e.exports=i;});
__d("ErrorDialog",["Dialog","emptyFunction"],function(a,b,c,d,e,f){var g=b('Dialog'),h=b('emptyFunction'),i={showAsyncError:function(j){try{return i.show(j.getErrorSummary(),j.getErrorDescription());}catch(k){alert(j);}},show:function(j,k,l,m){return (new g()).setTitle(j).setBody(k).setButtons([g.OK]).setStackable(true).setModal(true).setHandler(l||h).setButtonsMessage(m||'').show();}};e.exports=i;});
__d("MentionsInputMatchers",[],function(a,b,c,d,e,f){var g=['@','\\uff20','+','\\uff0b'].join(''),h='.,*?$|#{}()\\^\\-\\[\\]\\\\\/!%&\'"~=<>_:;',i='\\b[A-Z][^ A-Z'+h+']',j='([^'+g+h+']|['+h+'][^ '+h+'])',k='(?:^|\\s)(?:['+g+']('+j+'{0,20}))',l='(?:(?:'+i+'+)|'+k+')',m='(?:'+i+'{4,})',n={trigger:new RegExp('['+g+']$'),mainMatcher:new RegExp(k+'$'),autoMatcher:new RegExp(l+'$'),userMatcher:new RegExp(m+'$')};e.exports=n;});
__d("MentionsInput",["function-extensions","Arbiter","ArbiterMixin","CSS","DataStore","DOM","Event","HTML","Input","InputSelection","Keys","MentionsInputMatchers","Parent","Style","TypeaheadUtil","UserAgent","copyProperties","htmlize","removeFromArray","repeatString"],function(a,b,c,d,e,f){b('function-extensions');var g=b('Arbiter'),h=b('ArbiterMixin'),i=b('CSS'),j=b('DataStore'),k=b('DOM'),l=b('Event'),m=b('HTML'),n=b('Input'),o=b('InputSelection'),p=b('Keys'),q=b('MentionsInputMatchers'),r=b('Parent'),s=b('Style'),t=b('TypeaheadUtil'),u=b('UserAgent'),v=b('copyProperties'),w=b('htmlize'),x=b('removeFromArray'),y=b('repeatString'),z='\uFEFF',aa=new RegExp(z,'g'),ba=function(fa){return fa+z;};function ca(fa,ga){return fa.replace(ga,y(' ',ga.length));}function da(fa,ga){return fa.substring(0,ga)+fa.substring(ga+1);}function ea(fa,ga,ha,ia,ja,ka){j.set(fa,'MentionsInput',this);this._root=fa;this._typeahead=ga;this._input=ha;var la=null,ma=this.init.bind(this,ia,ja,ka);try{la=document.activeElement===this._input;}catch(na){}if(la){ma.defer();}else var oa=l.listen(this._input,'focus',function(){ma.defer();oa.remove();});}ea.getInstance=function(fa){var ga=r.byClass(fa,'uiMentionsInput');return ga?j.get(ga,'MentionsInput'):null;};v(ea.prototype,h,{init:function(fa,ga,ha){if(this._initialized)return;this._initialized=true;this._highlighter=k.find(this._root,'.highlighter');this._highlighterInner=this._highlighter.firstChild;this._highlighterContent=k.find(this._root,'.highlighterContent');this._hiddenInput=k.find(this._root,'.mentionsHidden');this._placeholder=this._input.getAttribute('placeholder')||'';this._maxMentions=fa.max||6;this._metrics=ha;if(!this._hiddenInput.name){var ia=this._input.name;this._input.name=ia+'_text';this._hiddenInput.name=ia;}this._initEvents();this._initTypeahead();this.reset(ga);this.inform('init',null,g.BEHAVIOR_STATE);},reset:function(fa){if(!this._initialized)return;this._mentioned={};this._orderedUIDs=[];this._numMentioned=0;this._filterData=null;this._hiddenInput&&(this._hiddenInput.value='');this._highlighterContent&&k.empty(this._highlighterContent);this._highlighterAuxContent&&k.remove(this._highlighterAuxContent);this._highlighterAuxContent=null;n.setPlaceholder(this._input,this._placeholder);s.set(this._typeahead.getElement(),'height','auto');var ga=fa&&fa.value||'',ha=fa&&fa.mentions;if(ha&&ha.length){var ia=[];ha.forEach(function(ja){ia.push(ja.offset+ja.length);delete ja.offset;delete ja.length;this._addToken(ja);},this);ia.reverse().forEach(function(ja){ga=ga.substring(0,ja)+z+ga.substring(ja);});}n.setValue(this._input,ga);this._updateTypeahead();this._updateWidth();this._update();},getValue:function(){return this._getMarkedValue().replace(aa,'');},_getMarkedValue:function(){return n.getValue(this._input);},getRawValue:function(){this._update();return n.getValue(this._hiddenInput);},checkValue:function(){var fa=this._typeahead.getCore().getValue();if(q.trigger.exec(fa)||fa==='')this.inform('sessionEnd',{});},getTypeahead:function(){return this._typeahead;},_initEvents:function(){var fa=this._update.bind(this);l.listen(this._input,{input:fa,keyup:fa,change:fa,blur:this._handleBlur.bind(this),focus:this._handleFocus.bind(this),keydown:this._handleKeydown.bind(this)});if(this._metrics){this._metrics._reset();this._metrics.bindSessionStart(this._typeahead,'render',true);this._metrics.bindSessionEnd(this._typeahead.getView(),'select',true);this._metrics.bindSessionEnd(this,'sessionEnd',false);l.listen(this._input,'keyup',function(event){this.checkValue.bind(this).defer();}.bind(this));}},_initTypeahead:function(){this._typeahead.subscribe('select',function(ka,la){var ma=la.selected;this._addToken({uid:ma.uid,text:ma.text,type:ma.type,weakreference:ma.weak_reference});this.updateValue();}.bind(this));var fa=this._input,ga=null;function ha(){if(ga===null){ga=n.getSubmitOnEnter(fa);n.setSubmitOnEnter(fa,false);}}function ia(){if(ga!==null){n.setSubmitOnEnter(fa,ga);ga=null;}}this._typeahead.subscribe('reset',ia);this._typeahead.subscribe('render',ha);this._typeahead.subscribe('highlight',function(ka,la){la.index>=0?ha():ia();});this._typeahead.subscribe('query',function(){this._filterData=null;}.bind(this));var ja=this._typeahead.getCore();ja.suffix=z;this._handleFocus();},_handleBlur:function(){if(this._filterToken){this._filterToken.remove();this._filterToken=null;}},_handleFocus:function(){if(!this._filterToken)this._filterToken=this._typeahead.getData().addFilter(this._filterResults.bind(this));this._updateWidth();},_handleKeydown:function(event){var fa=event.keyCode;if(fa==p.BACKSPACE||fa==p.DELETE)this._handleBackspaceAndDelete(event,fa);if(fa==p.LEFT||fa==p.RIGHT)setTimeout(this._handleLeftAndRight.bind(this,fa),10);},_handleLeftAndRight:function(fa){var ga=this._getMarkedValue(),ha=o.get(this._input),ia=ha.start,ja=ha.end,ka=fa==p.LEFT,la=fa==p.RIGHT;if(ia==ja){var ma=ka?-1:1;if(ga.charAt(ia)==z)o.set(this._input,ia+ma);}else if(ka&&ga.charAt(ia)==z){o.set(this._input,ia-1,ja);}else if(ka&&ga.charAt(ja)==z){o.set(this._input,ia,ja-1);}else if(la&&ga.charAt(ja)==z){o.set(this._input,ia,ja+1);}else if(la&&ga.charAt(ia)==z)o.set(this._input,ia+1,ja);},_handleBackspaceAndDelete:function(event,fa){var ga=o.get(this._input),ha=false;if(ga.start!==ga.end)if(this._offsetIsInsideMention(ga.start+1)&&this._offsetIsInsideMention(ga.end)){ha=(fa===p.BACKSPACE);}else return;var ia=fa===p.DELETE?1:-1,ja=ia+(ha?ga.end:ga.start),ka=this._getMarkedValue(),la=ka;for(var ma=0;ma<this._orderedUIDs.length;++ma){var na=this._mentioned[this._orderedUIDs[ma]],oa=na.text,pa=ba(oa),qa=la.indexOf(pa),ra=qa+pa.length;if(ja<qa||ja>=ra){la=ca(la,pa);continue;}var sa,ta;if(na.type!='user'){sa=0;ta=[oa];}else{sa=pa.substring(0,ja-qa).split(' ').length-1;ta=oa.split(' ');}var ua=ta.splice(sa,1)[0],va=ta.join(' '),wa=sa===0?qa:ra-ua.length-1;if(va){na.text=va;va=ba(va);}else this._removeToken(na.uid);var xa=ka.substring(0,qa)+va+ka.substring(ra);n.setValue(this._input,xa);o.set(this._input,wa);this._update();event.kill();break;}},_offsetIsInsideMention:function(fa){for(var ga=0;ga<this._offsets.length;ga++)if(fa>this._offsets[ga][0]&&fa<=this._offsets[ga][1])return true;return false;},_filterResults:function(fa){if(this._filterData===null){var ga=o.get(this._input).start;if(this._offsetIsInsideMention(ga)){this._filterData={caretIsInsideMention:true};return false;}var ha=this._typeahead.getCore();this._filterData={value:ha.getValue(),rawValue:ha.getRawValue()};}if(this._filterData.caretIsInsideMention)return false;if(q.mainMatcher.test(this._filterData.rawValue))return true;if(fa.type!='user')return false;if(fa.disable_autosuggest)return false;if(q.userMatcher.test(this._filterData.value))return true;return t.isExactMatch(this._filterData.value,this._typeahead.getData().getTextToIndex(fa));},_addToken:function(fa){var ga=fa.uid;if(!this._mentioned.hasOwnProperty(ga)){this._mentioned[ga]=fa;this._orderedUIDs.push(ga);this._numMentioned++;this._updateTypeahead();}},_removeToken:function(fa){if(this._mentioned.hasOwnProperty(fa)){delete this._mentioned[fa];x(this._orderedUIDs,fa);this._numMentioned--;this._updateTypeahead();}},_update:function(){var fa=this._getMarkedValue();if(fa==this._value)return;this._value=fa;this._updateMentions();this._updateDirection();this.updateValue();},_updateMentions:function(){this._offsets=[];var fa=this._getMarkedValue(),ga=fa;for(var ha=0;ha<this._orderedUIDs.length;++ha){var ia=this._orderedUIDs[ha],ja=ba(this._mentioned[ia].text),ka=ga.indexOf(ja);if(ka==-1)this._removeToken(ia);ga=ca(ga,ja);this._offsets.push([ka,ka+ja.length]);}var la=fa;while((ka=ga.indexOf(z))>-1){la=da(la,ka);ga=da(ga,ka);}if(fa!==la){var ma=o.get(this._input);n.setValue(this._input,la);o.set(this._input,ma.start);this._value=la;}},updateValue:function(){var fa=this._getMarkedValue(),ga=this._orderedUIDs,ha,ia,ja,ka,la,ma;for(ha=0;ha<ga.length;++ha){ka=ba(this._mentioned[ga[ha]].text);fa=fa.replace(ka,'@['+ga[ha]+':]');}ma=w(fa);for(ha=0;ha<ga.length;++ha){ia=ga[ha];ja=this._mentioned[ia].text;ka=ba(ja);la=this._mentioned[ia].weakreference?'<b class="weak">':'<b>';ma=ma.replace('@['+ia+':]',la+w(ka)+'</b>');ja=ja.replace(/[\\\]:]/g,function(na){return '\\'+na;});fa=fa.replace('@['+ia+':]','@['+ia+':'+ja+']');}if(u.ie())ma=ma.replace(/ /g,'&nbsp;<wbr/>');k.setContent(this._highlighterContent,m(ma));this._hiddenInput.value=fa;this._updateHighlighter();this._updateHeight();},_updateDirection:function(){var fa=s.get(this._input,'direction');if(fa==this._dir)return;this._dir=fa;s.set(this._highlighter,'direction',fa);if(fa=='rtl'){s.set(this._highlighter,'text-align','right');}else s.set(this._highlighter,'text-align','left');},_updateWidth:function(){var fa=s.getFloat.curry(this._input),ga=this._input.offsetWidth-fa('paddingLeft')-fa('paddingRight')-fa('borderLeftWidth')-fa('borderRightWidth');if(u.firefox())ga-=2;if(u.ie()<=7){ga-=s.getFloat(this._highlighterInner,'paddingLeft');this._highlighter.style.zoom=1;}this._highlighterInner.style.width=Math.max(ga,0)+'px';},_updateHeight:function(){if(this._highlighterAuxContent){var fa=this._highlighter.offsetHeight,ga=this._typeahead.getElement();if(fa>ga.offsetHeight){s.set(ga,'height',fa+'px');g.inform('reflow');}}},_updateTypeahead:function(){var fa=this._typeahead.getCore(),ga=null;if(!this._maxMentions||this._numMentioned<this._maxMentions)ga=q.autoMatcher;fa.matcher=ga;fa.setExclusions(this._orderedUIDs);this.inform('update',{mentioned:this._mentioned});},setPlaceholder:function(fa){this._placeholder=fa;if(!this.hasAuxContent())n.setPlaceholder(this._input,fa);},_updateHighlighter:function(){if(this._highlighterContent)i.conditionShow(this._highlighterContent,this._numMentioned>0||this.hasAuxContent());},setAuxContent:function(fa){if(this._highlighterContent){if(!this._highlighterAuxContent){this._highlighterAuxContent=k.create('span',{className:'highlighterAuxContent'});k.insertAfter(this._highlighterContent,this._highlighterAuxContent);}k.setContent(this._highlighterAuxContent,fa);if(fa){n.setPlaceholder(this._input,'');}else n.setPlaceholder(this._input,this._placeholder);this._updateHighlighter();this._updateHeight();}},hasAuxContent:function(){var fa=this.getAuxContentRoot();return fa&&fa.innerHTML.length>0;},getAuxContentRoot:function(){return this._highlighterAuxContent;},addMention:function(fa){var ga=this._getMarkedValue();if(ga!=='')ga+=' ';n.setValue(this._input,ga+ba(fa.text)+' ');this._addToken(fa);this._update();},getMentions:function(){return this._mentioned;}});e.exports=ea;});
__d("MentionsTypeaheadAreaView",["Class","ContextualTypeaheadView","Parent","copyProperties"],function(a,b,c,d,e,f){var g=b('Class'),h=b('ContextualTypeaheadView'),i=b('Parent'),j=b('copyProperties');function k(l,m){this.parent.construct(this,l,m);}g.extend(k,h);j(k.prototype,{getContext:function(){return i.byClass(this.element,'uiMentionsInput');}});e.exports=k;});
__d("legacy:MentionsInput",["MentionsInput"],function(a,b,c,d){a.MentionsInput=b('MentionsInput');},3);
__d("TypeaheadAreaCore",["Class","InputSelection","TypeaheadCore","copyProperties","emptyFunction"],function(a,b,c,d,e,f){var g=b('Class'),h=b('InputSelection'),i=b('TypeaheadCore'),j=b('copyProperties'),k=b('emptyFunction');function l(m){this.parent.construct(this,m);this.matcher=new RegExp(this.matcher+'$');this.preventFocusChangeOnTab=true;}g.extend(l,i);j(l.prototype,{prefix:'',suffix:', ',matcher:"\\b[^,]*",click:k,select:function(m){this.parent.select(m);var n=this.element.value,o=this.prefix+m.text+this.suffix;this.expandBounds(n,o);var p=n.substring(0,this.start),q=n.substring(this.end);this.element.value=p+o+q;h.set(this.element,p.length+o.length);},expandBounds:function(m,n){m=m.toLowerCase();n=n.toLowerCase();var o,p,q,r,s=/\s/;p=m.substring(this.start,this.end);q=n.indexOf(p);o=this.start;while(o>=0&&q>=0){r=m.charAt(o-1);if(!r||s.test(r))this.start=o;p=r+p;q=n.indexOf(p);o--;}p=m.substring(this.start,this.end);q=n.indexOf(p);o=this.end;while(o<=m.length&&q>=0){r=m.charAt(o);if(!r||s.test(r))this.end=o;p=p+r;q=n.indexOf(p);o++;}},getRawValue:function(){var m=h.get(this.element).start||0;return this.parent.getValue().substring(0,m);},getValue:function(){var m=this.matcher&&this.matcher.exec(this.getRawValue());if(!m)return '';var n=m[0],o=m.index+n.length;n=n.replace(/^\s/,'');var p=n.length;n=n.replace(/\s$/,'');var q=p-n.length;this.start=o-p;this.end=o+q;return m[1]||m[0];}});e.exports=l;});
__d("TypeaheadMetrics",["Event","AsyncRequest","copyProperties","emptyFunction"],function(a,b,c,d,e,f){var g=b('Event'),h=b('AsyncRequest'),i=b('copyProperties'),j=b('emptyFunction');function k(l){this.extraData={};i(this,l);}i(k.prototype,{endPoint:'/ajax/typeahead/record_basic_metrics.php',init:function(l){this.init=j;this.core=l.getCore();this.view=l.getView();this.data=l.getData();this.stats={};this.sessionActive=false;this._sessionStartEvents=[];this._sessionEndEvents=[];this._reset();this.initEvents();},_reset:function(){this.stats={};this.avgStats={};this.sessionActive=false;this.results=null;this.sid=Math.floor(Date.now()*Math.random());this.data.setQueryData({sid:this.sid});},recordSelect:function(l){var m=l.selected;if(m.uid==null){this.recordStat('selected_id','SELECT_NULL');}else this.recordStat('selected_id',m.uid);this.recordStat('selected_type',m.type);this.recordStat('selected_position',l.index);this.recordStat('selected_with_mouse',l.clicked?1:0);this._sessionEnd();},bindSessionStart:function(l,event,m){if(m)for(var n=0;n<this._sessionStartEvents.length;++n){var o=this._sessionStartEvents[n];o.obj.unsubscribe(o.token);}this._sessionStartEvents.push({obj:l,token:l.subscribe(event,function(p,q){this._sessionStart();}.bind(this))});},bindSessionEnd:function(l,event,m){if(m)for(var n=0;n<this._sessionEndEvents.length;++n){var o=this._sessionEndEvents[n];o.obj.unsubscribe(o.token);}this._sessionEndEvents.push({obj:l,token:l.subscribe(event,function(p,q){this._sessionEnd();}.bind(this))});},initEvents:function(){this.bindSessionStart(this.core,'focus',false);this.bindSessionEnd(this.core,'blur',false);this.view.subscribe('select',function(l,m){this.recordSelect(m);}.bind(this));this.bindSessionEnd(this.view,'select',false);this.view.subscribe('render',function(l,m){this.results=m;}.bind(this));this.data.subscribe('beforeQuery',function(l,m){if(!m.value)return;this.query=m.value;this.recordCountStat('num_queries');}.bind(this));this.data.subscribe('beforeFetch',function(l,m){if(m.fetch_context.bootstrap){this.bootstrapBegin=Date.now();}else m.fetch_context.queryBegin=Date.now();}.bind(this));this.data.subscribe('fetchComplete',function(l,m){if(m.fetch_context.bootstrap){this.recordAvgStat('bootstrap_latency',Date.now()-this.bootstrapBegin);var n={};m.response.payload.entries.forEach(function(o){if(!n[o.type]){n[o.type]=1;}else n[o.type]++;});this.recordStat('bootstrap_response_types',n);this.bootstrapped=true;}else{if('filtered_count' in m.response.payload)this.recordStat('filtered_count',m.response.payload.filtered_count);this.recordAvgStat('avg_query_latency',Date.now()-m.fetch_context.queryBegin);}}.bind(this));this.data.subscribe('dirty',function(l,m){this.bootstrapped=false;});},_sessionStart:function(){if(this.sessionActive)return;this.sessionActive=true;},_sessionEnd:function(){if(!this.sessionActive)return;this.sessionActive=false;this.submit();this._reset();},recordStat:function(l,m){this.stats[l]=m;},recordCountStat:function(l){var m=this.stats[l];this.stats[l]=m?m+1:1;},recordAvgStat:function(l,m){if(this.avgStats[l]){this.avgStats[l][0]+=m;++this.avgStats[l][1];}else this.avgStats[l]=[m,1];},submit:function(){if(Object.keys(this.stats).length){i(this.stats,this.extraData);if(this.results){var l=(this.results).map(function(o,p){return o.uid;});this.recordStat('candidate_results',JSON.stringify(l));}if(this.query)this.recordStat('query',this.query);if(this.sid)this.recordStat('sid',this.sid);if(this.bootstrapped)this.recordStat('bootstrapped',1);for(var m in this.avgStats){var n=this.avgStats[m];this.stats[m]=n[0]/n[1];}new h().setURI(this.endPoint).setMethod('POST').setData({stats:this.stats}).send();this._reset();}}});k.register=function(l,m,n){if(document.activeElement===l){m.init(n);}else var o=g.listen(l,'focus',function(){m.init(n);o.remove();});};e.exports=k;});
__d("TypeaheadHoistFriends",["copyProperties"],function(a,b,c,d,e,f){var g=b('copyProperties');function h(i){this._typeahead=i;}g(h.prototype,{_subscription:null,enable:function(){var i=this._typeahead.getView();this._subscription=i.subscribe('beforeRender',function(j,k){var l=[],m=[],n=[];for(var o=0;o<k.results.length;++o){var p=k.results[o];if(p.type=='header'){n=n.concat(m,l);n.push(p);m=[];l=[];}else if(p.type=='user'&&p.bootstrapped){m.push(p);}else l.push(p);}k.results=n.concat(m,l);});},disable:function(){this._typeahead.getView().unsubscribe(this._subscription);this._subscription=null;}});e.exports=h;});
__d("legacy:HoistFriendsTypeaheadBehavior",["TypeaheadHoistFriends"],function(a,b,c,d){var e=b('TypeaheadHoistFriends');if(!a.TypeaheadBehaviors)a.TypeaheadBehaviors={};a.TypeaheadBehaviors.hoistFriends=function(f){f.enableBehavior(e);};},3);