PageSourceSearch

https://www.mynailbar.fr/assets/vendor/quill-delta/quill-delta.index-54c1b8ff779d54b161cff6ac85c92046.js

js mynailbar.fr collected 2026-10-08 19:05:02 UTC 10,149 bytes, 8 lines download raw bytes

1/**
2 * Bundled by jsDelivr using Rollup v4.62.2 and esbuild v0.28.1.
3 * Original file: /npm/[email protected]/dist/Delta.js
4 *
5 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
6 */
7import*as U from"fast-diff";import*as F from"lodash.clonedeep";import*as Q from"lodash.isequal";function A(m){return m&&Object.prototype.hasOwnProperty.call(m,"default")?m.default:m}var M={exports:{}},z=A(U),q=A(F),N=A(Q),I={},P;function B(){if(P)return I;P=1,Object.defineProperty(I,"__esModule",{value:!0});const m=q,j=N;var v;return(function(o){function y(d={},h={},f=!1){typeof d!="object"&&(d={}),typeof h!="object"&&(h={});let c=m(h);f||(c=Object.keys(c).reduce((e,t)=>(c[t]!=null&&(e[t]=c[t]),e),{}));for(const e in d)d[e]!==void 0&&h[e]===void 0&&(c[e]=d[e]);return Object.keys(c).length>0?c:void 0}o.compose=y;function O(d={},h={}){typeof d!="object"&&(d={}),typeof h!="object"&&(h={});const f=Object.keys(d).concat(Object.keys(h)).reduce((c,e)=>(j(d[e],h[e])||(c[e]=h[e]===void 0?null:h[e]),c),{});return Object.keys(f).length>0?f:void 0}o.diff=O;function g(d={},h={}){d=d||{};const f=Object.keys(h).reduce((c,e)=>(h[e]!==d[e]&&d[e]!==void 0&&(c[e]=h[e]),c),{});return Object.keys(d).reduce((c,e)=>(d[e]!==h[e]&&h[e]===void 0&&(c[e]=null),c),f)}o.invert=g;function b(d,h,f=!1){if(typeof d!="object")return h;if(typeof h!="object")return;if(!f)return h;const c=Object.keys(h).reduce((e,t)=>(d[t]===void 0&&(e[t]=h[t]),e),{});return Object.keys(c).length>0?c:void 0}o.transform=b})(v||(v={})),I.default=v,I}var $={},R;function _(){if(R)return $;R=1,Object.defineProperty($,"__esModule",{value:!0});var m;return(function(j){function v(o){return typeof o.delete=="number"?o.delete:typeof o.retain=="number"?o.retain:typeof o.retain=="object"&&o.retain!==null?1:typeof o.insert=="string"?o.insert.length:1}j.length=v})(m||(m={})),$.default=m,$}var T={},D;function G(){if(D)return T;D=1,Object.defineProperty(T,"__esModule",{value:!0});const m=_();class j{constructor(o){this.ops=o,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(o){o||(o=1/0);const y=this.ops[this.index];if(y){const O=this.offset,g=m.default.length(y);if(o>=g-O?(o=g-O,this.index+=1,this.offset=0):this.offset+=o,typeof y.delete=="number")return{delete:o};{const b={};return y.attributes&&(b.attributes=y.attributes),typeof y.retain=="number"?b.retain=o:typeof y.retain=="object"&&y.retain!==null?b.retain=y.retain:typeof y.insert=="string"?b.insert=y.insert.substr(O,o):b.insert=y.insert,b}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?m.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const o=this.ops[this.index];return o?typeof o.delete=="number"?"delete":typeof o.retain=="number"||typeof o.retain=="object"&&o.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const o=this.offset,y=this.index,O=this.next(),g=this.ops.slice(this.index);return this.offset=o,this.index=y,[O].concat(g)}}else return[]}}return T.default=j,T}var H;function J(){return H||(H=1,(function(m,j){Object.defineProperty(j,"__esModule",{value:!0}),j.AttributeMap=j.OpIterator=j.Op=void 0;const v=z,o=q,y=N,O=B();j.AttributeMap=O.default;const g=_();j.Op=g.default;const b=G();j.OpIterator=b.default;const d="\0",h=(c,e)=>{if(typeof c!="object"||c===null)throw new Error(`cannot retain a ${typeof c}`);if(typeof e!="object"||e===null)throw new Error(`cannot retain a ${typeof e}`);const t=Object.keys(c)[0];if(!t||t!==Object.keys(e)[0])throw new Error(`embed types not matched: ${t} != ${Object.keys(e)[0]}`);return[t,c[t],e[t]]};class f{constructor(e){Array.isArray(e)?this.ops=e:e!=null&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]}static registerEmbed(e,t){this.handlers[e]=t}static unregisterEmbed(e){delete this.handlers[e]}static getHandler(e){const t=this.handlers[e];if(!t)throw new Error(`no handlers for embed type "${e}"`);return t}insert(e,t){const n={};return typeof e=="string"&&e.length===0?this:(n.insert=e,t!=null&&typeof t=="object"&&Object.keys(t).length>0&&(n.attributes=t),this.push(n))}delete(e){return e<=0?this:this.push({delete:e})}retain(e,t){if(typeof e=="number"&&e<=0)return this;const n={retain:e};return t!=null&&typeof t=="object"&&Object.keys(t).length>0&&(n.attributes=t),this.push(n)}push(e){let t=this.ops.length,n=this.ops[t-1];if(e=o(e),typeof n=="object"){if(typeof e.delete=="number"&&typeof n.delete=="number")return this.ops[t-1]={delete:n.delete+e.delete},this;if(typeof n.delete=="number"&&e.insert!=null&&(t-=1,n=this.ops[t-1],typeof n!="object"))return this.ops.unshift(e),this;if(y(e.attributes,n.attributes)){if(typeof e.insert=="string"&&typeof n.insert=="string")return this.ops[t-1]={insert:n.insert+e.insert},typeof e.attributes=="object"&&(this.ops[t-1].attributes=e.attributes),this;if(typeof e.retain=="number"&&typeof n.retain=="number")return this.ops[t-1]={retain:n.retain+e.retain},typeof e.attributes=="object"&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this}chop(){const e=this.ops[this.ops.length-1];return e&&typeof e.retain=="number"&&!e.attributes&&this.ops.pop(),this}filter(e){return this.ops.filter(e)}forEach(e){this.ops.forEach(e)}map(e){return this.ops.map(e)}partition(e){const t=[],n=[];return this.forEach(r=>{(e(r)?t:n).push(r)}),[t,n]}reduce(e,t){return this.ops.reduce(e,t)}
7changeLength(){return this.reduce((e,t)=>t.insert?e+g.default.length(t):t.delete?e-t.delete:e,0)}length(){return this.reduce((e,t)=>e+g.default.length(t),0)}slice(e=0,t=1/0){const n=[],r=new b.default(this.ops);let s=0;for(;s<t&&r.hasNext();){let i;s<e?i=r.next(e-s):(i=r.next(t-s),n.push(i)),s+=g.default.length(i)}return new f(n)}compose(e){const t=new b.default(this.ops),n=new b.default(e.ops),r=[],s=n.peek();if(s!=null&&typeof s.retain=="number"&&s.attributes==null){let a=s.retain;for(;t.peekType()==="insert"&&t.peekLength()<=a;)a-=t.peekLength(),r.push(t.next());s.retain-a>0&&n.next(s.retain-a)}const i=new f(r);for(;t.hasNext()||n.hasNext();)if(n.peekType()==="insert")i.push(n.next());else if(t.peekType()==="delete")i.push(t.next());else{const a=Math.min(t.peekLength(),n.peekLength()),l=t.next(a),p=n.next(a);if(p.retain){const u={};if(typeof l.retain=="number")u.retain=typeof p.retain=="number"?a:p.retain;else if(typeof p.retain=="number")l.retain==null?u.insert=l.insert:u.retain=l.retain;else{const k=l.retain==null?"insert":"retain",[w,L,C]=h(l[k],p.retain),S=f.getHandler(w);u[k]={[w]:S.compose(L,C,k==="retain")}}const x=O.default.compose(l.attributes,p.attributes,typeof l.retain=="number");if(x&&(u.attributes=x),i.push(u),!n.hasNext()&&y(i.ops[i.ops.length-1],u)){const k=new f(t.rest());return i.concat(k).chop()}}else typeof p.delete=="number"&&(typeof l.retain=="number"||typeof l.retain=="object"&&l.retain!==null)&&i.push(p)}return i.chop()}concat(e){const t=new f(this.ops.slice());return e.ops.length>0&&(t.push(e.ops[0]),t.ops=t.ops.concat(e.ops.slice(1))),t}diff(e,t){if(this.ops===e.ops)return new f;const n=[this,e].map(l=>l.map(p=>{if(p.insert!=null)return typeof p.insert=="string"?p.insert:d;const u=l===e?"on":"with";throw new Error("diff() called "+u+" non-document")}).join("")),r=new f,s=v(n[0],n[1],t,!0),i=new b.default(this.ops),a=new b.default(e.ops);return s.forEach(l=>{let p=l[1].length;for(;p>0;){let u=0;switch(l[0]){case v.INSERT:u=Math.min(a.peekLength(),p),r.push(a.next(u));break;case v.DELETE:u=Math.min(p,i.peekLength()),i.next(u),r.delete(u);break;case v.EQUAL:u=Math.min(i.peekLength(),a.peekLength(),p);const x=i.next(u),k=a.next(u);y(x.insert,k.insert)?r.retain(u,O.default.diff(x.attributes,k.attributes)):r.push(k).delete(u);break}p-=u}}),r.chop()}eachLine(e,t=`
8`){const n=new b.default(this.ops);let r=new f,s=0;for(;n.hasNext();){if(n.peekType()!=="insert")return;const i=n.peek(),a=g.default.length(i)-n.peekLength(),l=typeof i.insert=="string"?i.insert.indexOf(t,a)-a:-1;if(l<0)r.push(n.next());else if(l>0)r.push(n.next(l));else{if(e(r,n.next(1).attributes||{},s)===!1)return;s+=1,r=new f}}r.length()>0&&e(r,{},s)}invert(e){const t=new f;return this.reduce((n,r)=>{if(r.insert)t.delete(g.default.length(r));else{if(typeof r.retain=="number"&&r.attributes==null)return t.retain(r.retain),n+r.retain;if(r.delete||typeof r.retain=="number"){const s=r.delete||r.retain;return e.slice(n,n+s).forEach(a=>{r.delete?t.push(a):r.retain&&r.attributes&&t.retain(g.default.length(a),O.default.invert(r.attributes,a.attributes))}),n+s}else if(typeof r.retain=="object"&&r.retain!==null){const s=e.slice(n,n+1),i=new b.default(s.ops).next(),[a,l,p]=h(r.retain,i.insert),u=f.getHandler(a);return t.retain({[a]:u.invert(l,p)},O.default.invert(r.attributes,i.attributes)),n+1}}return n},0),t.chop()}transform(e,t=!1){if(t=!!t,typeof e=="number")return this.transformPosition(e,t);const n=e,r=new b.default(this.ops),s=new b.default(n.ops),i=new f;for(;r.hasNext()||s.hasNext();)if(r.peekType()==="insert"&&(t||s.peekType()!=="insert"))i.retain(g.default.length(r.next()));else if(s.peekType()==="insert")i.push(s.next());else{const a=Math.min(r.peekLength(),s.peekLength()),l=r.next(a),p=s.next(a);if(l.delete)continue;if(p.delete)i.push(p);else{const u=l.retain,x=p.retain;let k=typeof x=="object"&&x!==null?x:a;if(typeof u=="object"&&u!==null&&typeof x=="object"&&x!==null){const w=Object.keys(u)[0];if(w===Object.keys(x)[0]){const L=f.getHandler(w);L&&(k={[w]:L.transform(u[w],x[w],t)})}}i.retain(k,O.default.transform(l.attributes,p.attributes,t))}}return i.chop()}transformPosition(e,t=!1){t=!!t;const n=new b.default(this.ops);let r=0;for(;n.hasNext()&&r<=e;){const s=n.peekLength(),i=n.peekType();if(n.next(),i==="delete"){e-=Math.min(s,e-r);continue}else i==="insert"&&(r<e||!t)&&(e+=s);r+=s}return e}}f.Op=g.default,f.OpIterator=b.default,f.AttributeMap=O.default,f.handlers={},j.default=f,m.exports=f,m.exports.default=f}
8)(M,M.exports)),M.exports}var E=J(),K=E.AttributeMap,V=E.Op,W=E.OpIterator,X=E.__esModule;export{K as AttributeMap,V as Op,W as OpIterator,X as __esModule,E as default};

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.